From cdc6f7d0b05f2c55f9a4eec9886aacb585a5b6fe Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Tue, 12 Nov 2019 18:49:20 +0800 Subject: [PATCH] media: remove unused video drivers Signed-off-by: Tao Huang Change-Id: Ic8d08dc1c2e41a97fd1baf874efaa05f9b5de9d9 --- drivers/media/video/Kconfig | 26 - drivers/media/video/Makefile | 47 - drivers/media/video/adv7181.c | 1555 -- drivers/media/video/gc0307.c | 1301 -- drivers/media/video/gc0307_old.c | 3079 --- drivers/media/video/gc0308.c | 1183 - drivers/media/video/gc0308_old.c | 2957 --- drivers/media/video/gc0308_user_series.c | 1014 - drivers/media/video/gc0309.c | 1102 - drivers/media/video/gc0309_for_td8801.c | 2830 --- drivers/media/video/gc0309_old.c | 2862 --- drivers/media/video/gc0312.c | 1258 -- drivers/media/video/gc0328.c | 1020 - drivers/media/video/gc0329.c | 1128 - drivers/media/video/gc0329_old.c | 3046 --- drivers/media/video/gc2015.c | 1117 - drivers/media/video/gc2015_old.c | 3095 --- drivers/media/video/gc2035.c | 1463 -- drivers/media/video/gc2035_old.c | 3267 --- drivers/media/video/gc2145.c | 1702 -- drivers/media/video/gc2155.c | 1622 -- drivers/media/video/generic_sensor.c | 1576 -- drivers/media/video/generic_sensor.h | 1394 -- drivers/media/video/gt2005.c | 1263 -- drivers/media/video/gt2005_old.c | 3727 ---- drivers/media/video/gt2005_user_series.c | 1065 - drivers/media/video/hi253.c | 3666 ---- drivers/media/video/hi704.c | 3034 --- drivers/media/video/hm2057.c | 1261 -- drivers/media/video/hm5065.c | 3188 --- drivers/media/video/hm5065.h | 12 - drivers/media/video/hm5065_old.c | 5870 ----- drivers/media/video/mt9d112.c | 3405 --- drivers/media/video/mt9d112.h | 29 - drivers/media/video/mt9d113.c | 3155 --- drivers/media/video/mt9d113.h | 33 - drivers/media/video/mt9m112.c | 2820 --- drivers/media/video/mt9m112.h | 31 - drivers/media/video/mt9p111.c | 2377 -- drivers/media/video/mt9p111.h | 48 - drivers/media/video/mt9p111_old.c | 5587 ----- drivers/media/video/mt9t111.c | 8490 -------- drivers/media/video/mt9t111.h | 33 - drivers/media/video/mv9335/Kconfig | 13 - drivers/media/video/mv9335/Makefile | 7 - drivers/media/video/mv9335/mv9335.c | 2795 --- drivers/media/video/nt99160_2way.c | 1283 -- drivers/media/video/nt99240_2way.c | 1218 -- drivers/media/video/nt99250.c | 2923 --- drivers/media/video/nt99252_3way.c | 1137 - drivers/media/video/nt99340_2way.c | 1192 -- drivers/media/video/ov2640_rk.c | 3131 --- drivers/media/video/ov2655.c | 3290 --- drivers/media/video/ov2659.c | 1152 - drivers/media/video/ov2659_old.c | 3372 --- drivers/media/video/ov3640.c | 4624 ---- drivers/media/video/ov3640.h | 26 - drivers/media/video/ov3640_af_firmware.c | 3477 --- drivers/media/video/ov3660.c | 3573 ---- drivers/media/video/ov5640.c | 1538 -- drivers/media/video/ov5640.h | 16 - drivers/media/video/ov5640_af_firmware.c | 11930 ----------- drivers/media/video/ov5640_af_firmware_old.c | 11929 ----------- drivers/media/video/ov5640_for_td8801.c | 4154 ---- drivers/media/video/ov5640_old.c | 4199 ---- drivers/media/video/ov5642.c | 6127 ------ drivers/media/video/ov5642.h | 26 - drivers/media/video/ov5642_af_firmware.c | 17862 ---------------- drivers/media/video/ov7675.c | 2821 --- drivers/media/video/ov7690.c | 2598 --- drivers/media/video/ov9650.c | 2362 -- drivers/media/video/rk2928_camera.c | 264 - drivers/media/video/rk29_camera.c | 1102 - drivers/media/video/rk29_camera_oneframe.c | 2579 --- drivers/media/video/rk29_camera_pingpong.c | 1353 -- drivers/media/video/rk30_camera_oneframe.c | 3897 ---- drivers/media/video/rk30_camera_pingpong.c | 3447 --- drivers/media/video/rk_camsys/Kconfig | 22 - drivers/media/video/rk_camsys/Makefile | 14 - drivers/media/video/rk_camsys/camsys_cif.c | 385 - drivers/media/video/rk_camsys/camsys_cif.h | 64 - drivers/media/video/rk_camsys/camsys_drv.c | 1737 -- drivers/media/video/rk_camsys/camsys_gpio.h | 93 - .../media/video/rk_camsys/camsys_internal.h | 507 - drivers/media/video/rk_camsys/camsys_marvin.c | 1244 -- drivers/media/video/rk_camsys/camsys_marvin.h | 85 - .../video/rk_camsys/camsys_mipicsi_phy.c | 293 - .../video/rk_camsys/camsys_mipicsi_phy.h | 15 - .../media/video/rk_camsys/camsys_soc_priv.c | 80 - .../media/video/rk_camsys/camsys_soc_priv.h | 41 - .../media/video/rk_camsys/camsys_soc_rk3288.c | 404 - .../media/video/rk_camsys/camsys_soc_rk3288.h | 130 - .../media/video/rk_camsys/camsys_soc_rk3326.c | 239 - .../media/video/rk_camsys/camsys_soc_rk3326.h | 77 - .../media/video/rk_camsys/camsys_soc_rk3366.c | 257 - .../media/video/rk_camsys/camsys_soc_rk3366.h | 123 - .../media/video/rk_camsys/camsys_soc_rk3368.c | 257 - .../media/video/rk_camsys/camsys_soc_rk3368.h | 123 - .../media/video/rk_camsys/camsys_soc_rk3399.c | 427 - .../media/video/rk_camsys/camsys_soc_rk3399.h | 177 - .../video/rk_camsys/ext_flashled_drv/Kconfig | 27 - .../video/rk_camsys/ext_flashled_drv/Makefile | 4 - .../rk_camsys/ext_flashled_drv/flashlight.c | 335 - .../rk_camsys/ext_flashled_drv/flashlight.h | 138 - .../rk_camsys/ext_flashled_drv/leds-rt8547.c | 887 - .../rk_camsys/ext_flashled_drv/leds-rt8547.h | 84 - .../ext_flashled_drv/rk_ext_fshled_ctl.c | 180 - .../ext_flashled_drv/rk_ext_fshled_ctl.h | 11 - .../video/rk_camsys/ext_flashled_drv/rtfled.c | 401 - .../video/rk_camsys/ext_flashled_drv/rtfled.h | 147 - drivers/media/video/s5k5ca.c | 6097 ------ drivers/media/video/s5k5ca.h | 243 - drivers/media/video/s5k6aa.c | 4818 ----- drivers/media/video/s5k6aa.h | 243 - drivers/media/video/sid130B.c | 3889 ---- drivers/media/video/siv120b.c | 2850 --- drivers/media/video/siv121d.c | 2729 --- drivers/media/video/sp0838.c | 1576 -- drivers/media/video/sp2518.c | 1274 -- drivers/media/video/sp2518_old.c | 3389 --- drivers/media/video/tp2825.c | 1846 -- 121 files changed, 238117 deletions(-) delete mode 100644 drivers/media/video/Kconfig delete mode 100644 drivers/media/video/Makefile delete mode 100644 drivers/media/video/adv7181.c delete mode 100644 drivers/media/video/gc0307.c delete mode 100755 drivers/media/video/gc0307_old.c delete mode 100644 drivers/media/video/gc0308.c delete mode 100755 drivers/media/video/gc0308_old.c delete mode 100644 drivers/media/video/gc0308_user_series.c delete mode 100644 drivers/media/video/gc0309.c delete mode 100644 drivers/media/video/gc0309_for_td8801.c delete mode 100755 drivers/media/video/gc0309_old.c delete mode 100644 drivers/media/video/gc0312.c delete mode 100644 drivers/media/video/gc0328.c delete mode 100644 drivers/media/video/gc0329.c delete mode 100755 drivers/media/video/gc0329_old.c delete mode 100644 drivers/media/video/gc2015.c delete mode 100755 drivers/media/video/gc2015_old.c delete mode 100644 drivers/media/video/gc2035.c delete mode 100755 drivers/media/video/gc2035_old.c delete mode 100644 drivers/media/video/gc2145.c delete mode 100644 drivers/media/video/gc2155.c delete mode 100644 drivers/media/video/generic_sensor.c delete mode 100644 drivers/media/video/generic_sensor.h delete mode 100644 drivers/media/video/gt2005.c delete mode 100755 drivers/media/video/gt2005_old.c delete mode 100644 drivers/media/video/gt2005_user_series.c delete mode 100755 drivers/media/video/hi253.c delete mode 100755 drivers/media/video/hi704.c delete mode 100644 drivers/media/video/hm2057.c delete mode 100644 drivers/media/video/hm5065.c delete mode 100644 drivers/media/video/hm5065.h delete mode 100755 drivers/media/video/hm5065_old.c delete mode 100755 drivers/media/video/mt9d112.c delete mode 100755 drivers/media/video/mt9d112.h delete mode 100755 drivers/media/video/mt9d113.c delete mode 100755 drivers/media/video/mt9d113.h delete mode 100755 drivers/media/video/mt9m112.c delete mode 100755 drivers/media/video/mt9m112.h delete mode 100644 drivers/media/video/mt9p111.c delete mode 100644 drivers/media/video/mt9p111.h delete mode 100755 drivers/media/video/mt9p111_old.c delete mode 100755 drivers/media/video/mt9t111.c delete mode 100755 drivers/media/video/mt9t111.h delete mode 100644 drivers/media/video/mv9335/Kconfig delete mode 100644 drivers/media/video/mv9335/Makefile delete mode 100644 drivers/media/video/mv9335/mv9335.c delete mode 100644 drivers/media/video/nt99160_2way.c delete mode 100644 drivers/media/video/nt99240_2way.c delete mode 100755 drivers/media/video/nt99250.c delete mode 100644 drivers/media/video/nt99252_3way.c delete mode 100644 drivers/media/video/nt99340_2way.c delete mode 100644 drivers/media/video/ov2640_rk.c delete mode 100755 drivers/media/video/ov2655.c delete mode 100644 drivers/media/video/ov2659.c delete mode 100755 drivers/media/video/ov2659_old.c delete mode 100644 drivers/media/video/ov3640.c delete mode 100755 drivers/media/video/ov3640.h delete mode 100755 drivers/media/video/ov3640_af_firmware.c delete mode 100755 drivers/media/video/ov3660.c delete mode 100644 drivers/media/video/ov5640.c delete mode 100644 drivers/media/video/ov5640.h delete mode 100755 drivers/media/video/ov5640_af_firmware.c delete mode 100755 drivers/media/video/ov5640_af_firmware_old.c delete mode 100644 drivers/media/video/ov5640_for_td8801.c delete mode 100755 drivers/media/video/ov5640_old.c delete mode 100755 drivers/media/video/ov5642.c delete mode 100644 drivers/media/video/ov5642.h delete mode 100644 drivers/media/video/ov5642_af_firmware.c delete mode 100755 drivers/media/video/ov7675.c delete mode 100755 drivers/media/video/ov7690.c delete mode 100755 drivers/media/video/ov9650.c delete mode 100644 drivers/media/video/rk2928_camera.c delete mode 100644 drivers/media/video/rk29_camera.c delete mode 100755 drivers/media/video/rk29_camera_oneframe.c delete mode 100644 drivers/media/video/rk29_camera_pingpong.c delete mode 100644 drivers/media/video/rk30_camera_oneframe.c delete mode 100644 drivers/media/video/rk30_camera_pingpong.c delete mode 100644 drivers/media/video/rk_camsys/Kconfig delete mode 100644 drivers/media/video/rk_camsys/Makefile delete mode 100644 drivers/media/video/rk_camsys/camsys_cif.c delete mode 100644 drivers/media/video/rk_camsys/camsys_cif.h delete mode 100644 drivers/media/video/rk_camsys/camsys_drv.c delete mode 100644 drivers/media/video/rk_camsys/camsys_gpio.h delete mode 100644 drivers/media/video/rk_camsys/camsys_internal.h delete mode 100644 drivers/media/video/rk_camsys/camsys_marvin.c delete mode 100644 drivers/media/video/rk_camsys/camsys_marvin.h delete mode 100644 drivers/media/video/rk_camsys/camsys_mipicsi_phy.c delete mode 100644 drivers/media/video/rk_camsys/camsys_mipicsi_phy.h delete mode 100644 drivers/media/video/rk_camsys/camsys_soc_priv.c delete mode 100644 drivers/media/video/rk_camsys/camsys_soc_priv.h delete mode 100644 drivers/media/video/rk_camsys/camsys_soc_rk3288.c delete mode 100644 drivers/media/video/rk_camsys/camsys_soc_rk3288.h delete mode 100644 drivers/media/video/rk_camsys/camsys_soc_rk3326.c delete mode 100644 drivers/media/video/rk_camsys/camsys_soc_rk3326.h delete mode 100644 drivers/media/video/rk_camsys/camsys_soc_rk3366.c delete mode 100644 drivers/media/video/rk_camsys/camsys_soc_rk3366.h delete mode 100644 drivers/media/video/rk_camsys/camsys_soc_rk3368.c delete mode 100644 drivers/media/video/rk_camsys/camsys_soc_rk3368.h delete mode 100644 drivers/media/video/rk_camsys/camsys_soc_rk3399.c delete mode 100644 drivers/media/video/rk_camsys/camsys_soc_rk3399.h delete mode 100644 drivers/media/video/rk_camsys/ext_flashled_drv/Kconfig delete mode 100644 drivers/media/video/rk_camsys/ext_flashled_drv/Makefile delete mode 100755 drivers/media/video/rk_camsys/ext_flashled_drv/flashlight.c delete mode 100755 drivers/media/video/rk_camsys/ext_flashled_drv/flashlight.h delete mode 100644 drivers/media/video/rk_camsys/ext_flashled_drv/leds-rt8547.c delete mode 100755 drivers/media/video/rk_camsys/ext_flashled_drv/leds-rt8547.h delete mode 100644 drivers/media/video/rk_camsys/ext_flashled_drv/rk_ext_fshled_ctl.c delete mode 100644 drivers/media/video/rk_camsys/ext_flashled_drv/rk_ext_fshled_ctl.h delete mode 100755 drivers/media/video/rk_camsys/ext_flashled_drv/rtfled.c delete mode 100755 drivers/media/video/rk_camsys/ext_flashled_drv/rtfled.h delete mode 100755 drivers/media/video/s5k5ca.c delete mode 100644 drivers/media/video/s5k5ca.h delete mode 100755 drivers/media/video/s5k6aa.c delete mode 100644 drivers/media/video/s5k6aa.h delete mode 100755 drivers/media/video/sid130B.c delete mode 100755 drivers/media/video/siv120b.c delete mode 100755 drivers/media/video/siv121d.c delete mode 100644 drivers/media/video/sp0838.c delete mode 100644 drivers/media/video/sp2518.c delete mode 100755 drivers/media/video/sp2518_old.c delete mode 100644 drivers/media/video/tp2825.c diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig deleted file mode 100644 index 59c68f725690..000000000000 --- a/drivers/media/video/Kconfig +++ /dev/null @@ -1,26 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -config ROCK_CHIP_SOC_CAMERA - tristate "rockchip supported soc cameras " - default n - -menu "rockchip camera sensor interface driver" - depends on ROCK_CHIP_SOC_CAMERA - - config ROCKCHIP_CAMERA_SENSOR_INTERFACE - tristate "rockchip camera sensor interface driver" - default n - - config RK30_CAMERA_ONEFRAME - tristate "rk30_camera_oneframe" - depends on ROCKCHIP_CAMERA_SENSOR_INTERFACE - select SOC_CAMERA - select VIDEOBUF_DMA_CONTIG - default n - - config RK30_CAMERA_PINGPONG - tristate "rk30_camera_pingpong" - depends on ROCKCHIP_CAMERA_SENSOR_INTERFACE - select SOC_CAMERA - select VIDEOBUF_DMA_CONTIG - default n -endmenu diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile deleted file mode 100644 index 06075cd80629..000000000000 --- a/drivers/media/video/Makefile +++ /dev/null @@ -1,47 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -obj-$(CONFIG_RK30_CAMERA_PINGPONG) += rk30_camera_pingpong.o generic_sensor.o \ -gc0307.o \ -gc0308.o \ -gc0309.o \ -gc0328.o \ -gc0329.o \ -gc0312.o \ -gc2015.o \ -gc2035.o \ -gc2145.o \ -gc2155.o \ -gt2005.o \ -hm2057.o \ -hm5065.o \ -mt9p111.o \ -nt99160_2way.o \ -nt99240_2way.o \ -ov2659.o \ -ov5640.o \ -sp0838.o \ -sp2518.o \ -tp2825.o \ -adv7181.o -obj-$(CONFIG_RK30_CAMERA_ONEFRAME) += rk30_camera_oneframe.o generic_sensor.o \ -gc0307.o \ -gc0308.o \ -gc0309.o \ -gc0312.o \ -gc0328.o \ -gc0329.o \ -gc2015.o \ -gc2035.o \ -gc2145.o \ -gc2155.o \ -gt2005.o \ -hm2057.o \ -hm5065.o \ -mt9p111.o \ -nt99160_2way.o \ -nt99240_2way.o \ -ov2659.o \ -ov5640.o \ -sp0838.o \ -sp2518.o \ -tp2825.o \ -adv7181.o diff --git a/drivers/media/video/adv7181.c b/drivers/media/video/adv7181.c deleted file mode 100644 index 84ad9bdfebae..000000000000 --- a/drivers/media/video/adv7181.c +++ /dev/null @@ -1,1555 +0,0 @@ -/* - * drivers/media/video/adv7181.c - * - * Copyright (C) ROCKCHIP, Inc. - * Author:zhoupeng - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "generic_sensor.h" -#include -#include -#include -#include - - -/* - * Driver Version Note - *v0.0.1: this driver is compatible with generic_sensor - *v0.0.2: support debug_fs for debug - */ -static int version = KERNEL_VERSION(0, 0, 1); -module_param(version, int, S_IRUGO); - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt, ## arg); \ -} while (0) -#define debug_printk(format, ...) dprintk(1, format, ## __VA_ARGS__) -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_ADV7181 -#define SENSOR_V4L2_IDENT V4L2_IDENT_ADV7181 -#define SENSOR_ID 0x20 -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER | \ - V4L2_MBUS_PCLK_SAMPLE_RISING | \ - V4L2_MBUS_HSYNC_ACTIVE_HIGH | \ - V4L2_MBUS_VSYNC_ACTIVE_HIGH | \ - V4L2_MBUS_DATA_ACTIVE_HIGH | \ - SOCAM_MCLK_24MHZ) - -#define ADV7181_STATUS1_REG 0x10 -#define ADV7181_STATUS1_IN_LOCK 0x01 -#define ADV7181_STATUS1_AUTOD_MASK 0x70 -#define ADV7181_STATUS1_AUTOD_NTSM_M_J 0x00 -#define ADV7181_STATUS1_AUTOD_NTSC_4_43 0x10 -#define ADV7181_STATUS1_AUTOD_PAL_M 0x20 -#define ADV7181_STATUS1_AUTOD_PAL_60 0x30 -#define ADV7181_STATUS1_AUTOD_PAL_B_G 0x40 -#define ADV7181_STATUS1_AUTOD_SECAM 0x50 -#define ADV7181_STATUS1_AUTOD_PAL_COMB 0x60 -#define ADV7181_STATUS1_AUTOD_SECAM_525 0x70 - -#define ADV7181_INPUT_CONTROL 0x00 -#define ADV7181_INPUT_DEFAULT 0x00 -#define ADV7181_INPUT_CVBS_AIN2 0x00 -#define ADV7181_INPUT_CVBS_AIN3 0x01 -#define ADV7181_INPUT_CVBS_AIN5 0x02 -#define ADV7181_INPUT_CVBS_AIN6 0x03 -#define ADV7181_INPUT_CVBS_AIN8 0x04 -#define ADV7181_INPUT_CVBS_AIN10 0x05 -#define ADV7181_INPUT_CVBS_AIN1 0x0B -#define ADV7181_INPUT_CVBS_AIN4 0x0D -#define ADV7181_INPUT_CVBS_AIN7 0x0F -#define ADV7181_INPUT_YPRPB_AIN6_8_10 0x09 - -static int SENSOR_PREVIEW_W = 720; -static int SENSOR_PREVIEW_H = 480; - -static struct rk_camera_device_signal_config dev_info[] = { - { - .type = RK_CAMERA_DEVICE_CVBS_NTSC, - .code = MEDIA_BUS_FMT_UYVY8_2X8, - .crop = { - .top = 24, - .left = 0, - .width = 720, - .height = 480 - } - } -}; - -static struct rk_camera_device_defrect defrects[4]; -static struct rk_camera_device_channel_info channel_infos; -static int now_channel_value = ADV7181_INPUT_CVBS_AIN1; -static char input_mode[10] = "NTSC"; - -#define SENSOR_PREVIEW_FPS 30000 /* 30fps */ -#define SENSOR_FULLRES_L_FPS 15000 /* 15fps */ -#define SENSOR_FULLRES_H_FPS 15000 /* 15fps */ -#define SENSOR_720P_FPS 0 -#define SENSOR_1080P_FPS 0 - -#define SENSOR_REGISTER_LEN 1 /* sensor register address bytes */ -#define SENSOR_VALUE_LEN 1 /* sensor register value bytes */ - -static unsigned int SensorConfiguration = (CFG_Effect | CFG_Scene); -static unsigned int SensorChipID[] = {SENSOR_ID}; -/* Sensor Driver Configuration End */ - - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a, b) CONS4(SensorReg, SENSOR_REGISTER_LEN, Val, SENSOR_VALUE_LEN)(a, b) -#define sensor_write(client, reg, v) CONS4(sensor_write_reg, SENSOR_REGISTER_LEN, val, SENSOR_VALUE_LEN)(client, (reg), (v)) -#define sensor_read(client, reg, v) CONS4(sensor_read_reg, SENSOR_REGISTER_LEN, val, SENSOR_VALUE_LEN)(client, (reg), (v)) -#define sensor_write_array generic_sensor_write_array -static void adv7181_reinit_parameter(v4l2_std_id std, - struct generic_sensor *sensor); -static void adv7181_send_uevent(struct generic_sensor *sensor); - -struct sensor_parameter { - unsigned int PreviewDummyPixels; - unsigned int CaptureDummyPixels; - unsigned int preview_exposure; - - unsigned short int preview_line_width; - unsigned short int preview_gain; - unsigned short int PreviewPclk; - unsigned short int CapturePclk; - char awb[6]; -}; - -struct specific_sensor { - struct generic_sensor common_sensor; - struct sensor_parameter parameter; -}; - -/* - * The follow setting need been filled. - * - * Must Filled: - * sensor_init_data : Sensor initial setting; - * sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; - * sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; - * sensor_softreset_data : Sensor software reset register; - * sensor_check_id_data : Sensir chip id register; - * - * Optional filled: - * sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; - * sensor_720p: Sensor 720p setting, it is for video; - * sensor_1080p: Sensor 1080p setting, it is for video; - * - * :::::WARNING::::: - * The SensorEnd which is the setting end flag must be filled int the last of each setting; - */ - -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_init_data[] = { -/* - {0x04, 0xC5}, - {0xE6, 0x4f}, - */ - SensorEnd -}; -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] = { - SensorEnd -}; -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] = { - SensorEnd -}; -/* Preview resolution setting*/ - -static struct rk_sensor_reg sensor_preview_data_yc[] = { - {0x04, 0x57},//Enable SFL - {0x1D, 0x47},//Enable 28MHz Crystal - {0x31, 0x02},//Clears NEWAV_MODE, 0xSAV/EAV to suit ADV video encoders - {0x3A, 0x13},//Set Latch Clock & turn off ADC2 & ADC3 - {0x3B, 0x81},//Enable Internal Bias - {0x3D, 0xA2},//MWE Enable Manual Window, 0xColour Kill Threshold to 2 - {0x3E, 0x6A},//BLM optimisation - {0x3F, 0xA0},//BGB - {0x86, 0x0B},//Enable stdi_line_count_mode - {0x69, 0x03},//Sets SDM_SEL to 03 for YC/CVBS Auto - {0xF3, 0x03},//Enable Anti Alias Filters on ADC0 & ADC1 - {0xF9, 0x03},//Set max v lock range - {0xC4, 0x80},//Enable maual input muxing - {0xC3, 0xED},//ADC1 to Ain9 (C) and ADC0 to Ain7 (Y) - {0x0E, 0x80},//ADI Recommended Setting - {0x52, 0x46},//ADI Recommended Setting - {0x54, 0x80},//ADI Recommended Setting - {0x7F, 0xFF},//ADI Recommended Setting - {0x81, 0x30},//ADI Recommended Setting - {0x90, 0xC9},//ADI Recommended Setting - {0x91, 0x40},//ADI Recommended Setting - {0x92, 0x3C},//ADI Recommended Setting - {0x93, 0xCA},//ADI Recommended Setting - {0x94, 0xD5},//ADI Recommended Setting - {0xB1, 0xFF},//ADI Recommended Setting - {0xB6, 0x08},//ADI Recommended Setting - {0xC0, 0x9A},//ADI Recommended Setting - {0xCF, 0x50},//ADI Recommended Setting - {0xD0, 0x4E},//ADI Recommended Setting - {0xD1, 0xB9},//ADI Recommended Setting - {0xD6, 0xDD},//ADI Recommended Setting - {0xD7, 0xE2},//ADI Recommended Setting - {0xE5, 0x51},//ADI Recommended Setting - {0xF6, 0x3B},//ADI Recommended Setting - {0x0E, 0x00},//ADI Recommended Setting - {0x03, 0x4C},//disable out put - SensorEnd -}; - -static struct rk_sensor_reg sensor_preview_data_cvbs[] = { - {0x04, 0x77}, - {0x17, 0x41}, - {0x1D, 0x47}, - {0x31, 0x02}, - {0x3A, 0x17}, - {0x3B, 0x81}, - {0x3D, 0xA2}, - {0x3E, 0x6A}, - {0x3F, 0xA0}, - {0x86, 0x0B}, - {0xF3, 0x01}, - {0xF9, 0x03}, - {0x0E, 0x80}, - {0x52, 0x46}, - {0x54, 0x80}, - {0x7F, 0xFF}, - {0x81, 0x30}, - {0x90, 0xC9}, - {0x91, 0x40}, - {0x92, 0x3C}, - {0x93, 0xCA}, - {0x94, 0xD5}, - {0xB1, 0xFF}, - {0xB6, 0x08}, - {0xC0, 0x9A}, - {0xCF, 0x50}, - {0xD0, 0x4E}, - {0xD1, 0xB9}, - {0xD6, 0xDD}, - {0xD7, 0xE2}, - {0xE5, 0x51}, - {0xF6, 0x3B}, - {0x0E, 0x00}, - {0x03, 0x4C}, //disable out put - SensorEnd -}; - -static struct rk_sensor_reg sensor_preview_data_yprpb_p[] = { -/* - {0x05, 0x01},//PRIM_MODE = 001b COMP - {0x06, 0x06},//VID_STD for 525P 2x1 - {0xC3, 0x56},//ADC1 to Ain8, ADC0 to Ain10, - {0xC4, 0xB4},//Enables manual override of mux & ADC2 to Ain6. - {0x1D, 0x47},//Enable 28.63636MHz crystal - {0x3A, 0x11},//Set Latch Clock 01b. Power down ADC3. - {0x3B, 0x81},//Enable Internal Bias - {0x3C, 0x3B},//PLL QPUMP to 011b - {0x6B, 0x83},//422 8bit out - {0xC9, 0x0C},//Enable 8-bit mode using psuedo DDR - {0x73, 0xCF},//Enable Manual Gain and set CH_A gain - {0x74, 0xA3},//Set CH_A and CH_B Gain - 0FAh - {0x75, 0xE8},//Set CH_B and CH_C Gain - {0x76, 0xFA},//Set CH_C Gain - {0x7B, 0x0E},//Turn on EAV and SAV Codes. - {0x85, 0x19},//Turn off SSPD and force SOY - {0x86, 0x0B},//Enable STDI Line Count Mode - {0xBF, 0x06},//Blue Screen Free Run Colour - {0xC0, 0x40},//default color - {0xC1, 0xF0},//default color - {0xC2, 0x80},//Default color - {0xC5, 0x01},// - {0x0E, 0x80},//ADI recommended sequence - {0x52, 0x46},//ADI recommended sequence - {0x54, 0x80},//ADI Recommended Setting - {0x57, 0x01},//ADI recommended sequence - {0xF6, 0x3B},//ADI Recommended Setting - {0x0E, 0x00},//ADI recommended sequence - {0x67, 0x33},//DPP Filters *** - */ - /*##CP 525p/625p## - *525p/60Hz YPrPb In 8Bit 422 HS/VS Encoder - */ - {0x05, 0x01}, - {0x06, 0x06}, - {0xc3, 0x56}, - {0xc4, 0xb4}, - {0x1d, 0x47}, - {0x3a, 0x11}, - {0x3b, 0x81}, - {0x3c, 0x3b}, - {0x6b, 0x83}, - {0xc9, 0x00}, - {0x73, 0x10}, - {0x74, 0xa3}, - {0x75, 0xe8}, - {0x76, 0xfa}, - {0x7b, 0x1c}, - {0x85, 0x19}, - {0x86, 0x0b}, - {0xbf, 0x06}, - {0xc0, 0x40}, - {0xc1, 0xf0}, - {0xc2, 0x80}, - {0xc5, 0x01}, - {0xc9, 0x08}, - {0x0e, 0x80}, - {0x52, 0x46}, - {0x54, 0x80}, - {0x57, 0x01}, - {0xf6, 0x3b}, - {0x0e, 0x00}, - {0x67, 0x2f}, - {0x03, 0x4C}, //disable out put - SensorEnd -}; - -static struct rk_sensor_reg sensor_preview_data_yprpb_i[] = { -/* ##SDP YPrPb## - * :AUTODETECT YPbPr In, 8 Bit 422 Encoder - */ - {0x8D, 0x83},//ADI Recommended - {0x1D, 0x47},//Enable 28MHz Crystal - {0x27, 0x98},//YC Delay, 0x Swap Cb and Cr - {0x31, 0x02},//Clears NEWAV_MODE, 0xSAV/EAV to suit ADV video encoders - {0x3A, 0x11},//set latch clock settings to 001b, 0xPower Down ADC3 - {0x3B, 0x81},//Enable internal Bias - {0x3D, 0xA2},//MWE Enable Manual Window - {0x3E, 0x6A},//BLM optimisation - {0x3F, 0xA0},//ADI Recommended - {0x86, 0x0B},//Enable stdi_line_count_mode - {0xB4, 0xF9},//ADI Recommended - {0xB5, 0x00},//ADI Recommended - {0xC3, 0x46},//ADC1 to Ain6 (Pr), 0xADC0 to Ain10 (Y), 0x - {0xC4, 0xB5},//ADC2 to Ain8 (Pb) and enables manual override of mux - {0xF3, 0x07},//Enable Anti Alias Filters on ADC 0,1,2 - {0xF9, 0x03},//Set max v lock range - {0x0E, 0x80},//ADI Recommended Setting - {0x52, 0x46},//ADI Recommended Setting - {0x54, 0x80},//ADI Recommended Setting - {0x7F, 0xFF},//ADI Recommended Setting - {0x81, 0x30},//ADI Recommended Setting - {0x90, 0xC9},//ADI Recommended Setting - {0x91, 0x40},//ADI Recommended Setting - {0x92, 0x3C},//ADI Recommended Setting - {0x93, 0xCA},//ADI Recommended Setting - {0x94, 0xD5},//ADI Recommended Setting - {0x7E, 0x73},//ADI Recommended Setting - {0xB1, 0xFF},//ADI Recommended Setting - {0xB6, 0x08},//ADI Recommended Setting - {0xC0, 0x9A},//ADI Recommended Setting - {0xCF, 0x50},//ADI Recommended Setting - {0xD0, 0x4E},//ADI Recommended Setting - {0xD1, 0xB9},//ADI Recommended Setting - {0xD6, 0xDD},//ADI Recommended Setting - {0xE5, 0x51},//ADI Recommended Setting - {0xF6, 0x3B},//ADI Recommended Setting - {0x0E, 0x00},//ADI Recommended Setting - {0x03, 0x4C},//8 Bit Mode; disable out put - SensorEnd -}; - -static struct rk_sensor_reg sensor_preview_data[] = { - /* autodetect cvbs in ntsc/pal/secam 8-bit 422 encode */ - {0x04, 0x77}, - {0x17, 0x41}, - {0x1D, 0x47}, - {0x31, 0x02}, - {0x3A, 0x17}, - {0x3B, 0x81}, - {0x3D, 0xA2}, - {0x3E, 0x6A}, - {0x3F, 0xA0}, - {0x86, 0x0B}, - {0xF3, 0x01}, - {0xF9, 0x03}, - {0x0E, 0x80}, - {0x52, 0x46}, - {0x54, 0x80}, - {0x7F, 0xFF}, - {0x81, 0x30}, - {0x90, 0xC9}, - {0x91, 0x40}, - {0x92, 0x3C}, - {0x93, 0xCA}, - {0x94, 0xD5}, - {0xB1, 0xFF}, - {0xB6, 0x08}, - {0xC0, 0x9A}, - {0xCF, 0x50}, - {0xD0, 0x4E}, - {0xD1, 0xB9}, - {0xD6, 0xDD}, - {0xD7, 0xE2}, - {0xE5, 0x51}, - {0xF6, 0x3B}, - {0x0E, 0x00}, - {0x03, 0x4C}, //disable out put - SensorEnd -}; - -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[] = { - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_softreset_data[] = { - /*SensorRegVal(0x0f, 0x00 | 0x80),*/ - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[] = { - SensorRegVal(0x11, 0x0), - SensorEnd -}; -/* - * The following setting must been filled, - * if the function is turn on by CONFIG_SENSOR_xxxx - */ -static struct rk_sensor_reg sensor_WhiteB_Auto[] = { - SensorEnd -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[] = { - SensorEnd -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[] = { - SensorEnd -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[] = { - SensorEnd -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[] = { - SensorEnd -}; -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = { - sensor_WhiteB_Auto, - sensor_WhiteB_TungstenLamp1, - sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, - sensor_WhiteB_Cloudy, - NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[] = { - SensorEnd -}; - -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = { - sensor_Brightness0, - sensor_Brightness1, - sensor_Brightness2, - sensor_Brightness3, - sensor_Brightness4, - sensor_Brightness5, - NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Negative[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Bluish[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = { - SensorEnd -}; - -static struct rk_sensor_reg *sensor_EffectSeqe[] = { - sensor_Effect_Normal, - sensor_Effect_WandB, - sensor_Effect_Negative, - sensor_Effect_Sepia, - sensor_Effect_Bluish, - sensor_Effect_Green, - NULL, -}; - -static struct rk_sensor_reg sensor_Exposure0[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure1[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure2[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure3[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure4[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure5[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure6[] = { - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = { - sensor_Exposure0, - sensor_Exposure1, - sensor_Exposure2, - sensor_Exposure3, - sensor_Exposure4, - sensor_Exposure5, - sensor_Exposure6, - NULL, -}; - -static struct rk_sensor_reg sensor_Saturation0[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[] = { - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = { - sensor_Saturation0, - sensor_Saturation1, - sensor_Saturation2, - NULL, -}; - -static struct rk_sensor_reg sensor_Contrast0[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast1[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast2[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast3[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast4[] = { - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Contrast5[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast6[] = { - SensorEnd -}; -static struct rk_sensor_reg *sensor_ContrastSeqe[] = { - sensor_Contrast0, - sensor_Contrast1, - sensor_Contrast2, - sensor_Contrast3, - sensor_Contrast4, - sensor_Contrast5, - sensor_Contrast6, - NULL, -}; - -static struct rk_sensor_reg sensor_SceneAuto[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = { - SensorEnd -}; -static struct rk_sensor_reg *sensor_SceneSeqe[] = { - sensor_SceneAuto, - sensor_SceneNight, - NULL, -}; - -static struct rk_sensor_reg sensor_Zoom0[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom3[] = { - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ZoomSeqe[] = { - sensor_Zoom0, - sensor_Zoom1, - sensor_Zoom2, - sensor_Zoom3, - NULL, -}; - -/* - * User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu - */ -static struct v4l2_querymenu sensor_menus[] = { -}; - -/* - * User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl - */ - -static inline int adv7181_channel_set(struct i2c_client *client, - struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct generic_sensor *sensor = to_generic_sensor(client); - struct rk_sensor_sequence *sensor_series = - sensor->info_priv.sensor_series; - int series_num = sensor->info_priv.num_series; - int ret = 0; - int i; - int id; - int channel_ain; - - if ((ext_ctrl->value < ctrl_info->qctrl->minimum) || - (ext_ctrl->value > ctrl_info->qctrl->maximum)) { - SENSOR_TR("%s(%d):channel(%d) is not support\n", - __func__, __LINE__, ext_ctrl->value); - ret = -EINVAL; - goto end; - } - if (sensor->channel_id != ext_ctrl->value) { - SENSOR_TR("%s(%d):set channel(%d)!\n", - __func__, __LINE__, ext_ctrl->value); - sensor->channel_id = ext_ctrl->value; - id = sensor->channel_id; - for (i = 0; i < series_num; i++) - if ((sensor_series[i].property == SEQUENCE_PREVIEW) && - (sensor_series[i].data[0].reg != SEQCMD_END)) - break; - if (strstr(channel_infos.channel_info[id], "cvbs")) { - ret = sscanf(channel_infos.channel_info[id], "%*s %d", - &channel_ain); - if (IS_ERR_VALUE(ret)) { - SENSOR_TR("%s(%d): channel_infos err!\n", - __func__, __LINE__); - ret = -EINVAL; - goto end; - } - switch (channel_ain) { - case 1: - now_channel_value = ADV7181_INPUT_CVBS_AIN1; - break; - case 2: - now_channel_value = ADV7181_INPUT_CVBS_AIN2; - break; - case 3: - now_channel_value = ADV7181_INPUT_CVBS_AIN3; - break; - case 4: - now_channel_value = ADV7181_INPUT_CVBS_AIN4; - break; - case 5: - now_channel_value = ADV7181_INPUT_CVBS_AIN5; - break; - case 6: - now_channel_value = ADV7181_INPUT_CVBS_AIN6; - break; - case 7: - now_channel_value = ADV7181_INPUT_CVBS_AIN7; - break; - case 8: - now_channel_value = ADV7181_INPUT_CVBS_AIN8; - break; - case 10: - now_channel_value = ADV7181_INPUT_CVBS_AIN10; - break; - } - sensor_series[i].data = sensor_preview_data_cvbs; - sensor->info_priv.dev_sig_cnf.type = - RK_CAMERA_DEVICE_CVBS_NTSC; - sensor->info_priv.dev_sig_cnf.code = - MEDIA_BUS_FMT_UYVY8_2X8; - adv7181_reinit_parameter(V4L2_STD_NTSC, sensor); - } else if (strstr(channel_infos.channel_info[id], "yprpb")) { - now_channel_value = ADV7181_INPUT_DEFAULT; - sensor_series[i].data = sensor_preview_data_yprpb_p; - sensor->info_priv.dev_sig_cnf.type = - RK_CAMERA_DEVICE_BT601_PIONGPONG; - sensor->info_priv.dev_sig_cnf.code = - MEDIA_BUS_FMT_YVYU8_2X8; - adv7181_reinit_parameter(V4L2_STD_525_60, sensor); - } else if (strstr(channel_infos.channel_info[id], "ycrpc")) { - now_channel_value = ADV7181_INPUT_YPRPB_AIN6_8_10; - sensor_series[i].data = sensor_preview_data_yprpb_i; - sensor->info_priv.dev_sig_cnf.type = - RK_CAMERA_DEVICE_CVBS_NTSC; - sensor->info_priv.dev_sig_cnf.code = - MEDIA_BUS_FMT_UYVY8_2X8; - } else if (strstr(channel_infos.channel_info[id], "yc")) { - SENSOR_TR("%s(%d): yc signal not support\n", - __func__, __LINE__); - ret = -EINVAL; - goto end; - now_channel_value = ADV7181_INPUT_DEFAULT; - sensor_series[i].data = sensor_preview_data_yc; - } - - sensor_write(client, ADV7181_INPUT_CONTROL, now_channel_value); - generic_sensor_write_array(client, sensor_series[i].data); - } - -end: - return ret; -} - -static inline int sensor_v4l2ctrl_inside_cb(struct soc_camera_device *icd, - struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl, - bool is_set) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct generic_sensor *sensor = to_generic_sensor(client); - int ret = 0; - - switch (ctrl_info->qctrl->id) { - case V4L2_CID_DEINTERLACE: - { - if (is_set) { - SENSOR_TR("deinterlace isn't support set!\n"); - ret = -EINVAL; - goto cb_end; - } else { - if ((RK_CAMERA_DEVICE_BT601_8 == - sensor->info_priv.dev_sig_cnf.type) || - (RK_CAMERA_DEVICE_BT601_PIONGPONG == - sensor->info_priv.dev_sig_cnf.type)) { - /* don't need deinterlace process */ - ext_ctrl->value = 0; - ctrl_info->cur_value = 0; - } else { - ext_ctrl->value = 1; - ctrl_info->cur_value = 1; - } - } - break; - } - case V4L2_CID_CHANNEL: - { - if (is_set) { - ret = adv7181_channel_set(client, ctrl_info, ext_ctrl); - if (ret) - goto cb_end; - } else { - ext_ctrl->value = sensor->channel_id; - ctrl_info->cur_value = sensor->channel_id; - } - break; - } - case V4L2_CID_VIDEO_STATE: - { - if (is_set) { - SENSOR_TR("%s(%d): set isn't support!\n", - __func__, __LINE__); - } else { - ext_ctrl->value = sensor->info_priv.video_state; - ctrl_info->cur_value = sensor->info_priv.video_state; - } - break; - } - default: - { - SENSOR_TR("%s(%d): cmd(0x%x) is unknown !", - __func__, __LINE__, ctrl_info->qctrl->id); - ret = -EINVAL; - } - } - -cb_end: - return ret; -} - -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = { - { - { - V4L2_CID_DEINTERLACE, - V4L2_CTRL_TYPE_BOOLEAN, - "deinterlace", - 0, - 1, - 1, - 0 - }, - sensor_v4l2ctrl_inside_cb, - NULL - }, - { - { - V4L2_CID_CHANNEL, - V4L2_CTRL_TYPE_INTEGER, - "channel", - 0, - 4, - 1, - 0 - }, - sensor_v4l2ctrl_inside_cb, - NULL - }, - { - { - V4L2_CID_VIDEO_STATE, - V4L2_CTRL_TYPE_BOOLEAN, - "video_state", - 0, - 1, - 1, - 0 - }, - sensor_v4l2ctrl_inside_cb, - NULL - } -}; - -/* - * MUST define the current used format as the first item - */ -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {MEDIA_BUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, -}; - -/* - ********************************************************** - * Following is local code: - * - * Please codeing your program here - ********************************************************** - */ -static int sensor_parameter_record(struct i2c_client *client) -{ - return 0; -} - -static int sensor_ae_transfer(struct i2c_client *client) -{ - return 0; -} -/* - ********************************************************** - * Following is callback - * If necessary, you could coding these callback - ********************************************************** - */ -static void adv7181_reinit_parameter(v4l2_std_id std, - struct generic_sensor *sensor) -{ - struct rk_sensor_sequence *series = sensor->info_priv.sensor_series; - int num_series = sensor->info_priv.num_series; - int i; - - if (std == V4L2_STD_NTSC || std == V4L2_STD_NTSC_443) { - SENSOR_PREVIEW_W = 720; - SENSOR_PREVIEW_H = 480; - strcpy(input_mode, "NTSC"); - } else if (std == V4L2_STD_PAL || std == V4L2_STD_PAL_60 || - std == V4L2_STD_PAL_M) { - SENSOR_PREVIEW_W = 720; - SENSOR_PREVIEW_H = 576; - strcpy(input_mode, "PAL"); - } else { - SENSOR_PREVIEW_W = 1024; - SENSOR_PREVIEW_H = 500; - strcpy(input_mode, "YUV"); - } - for (i = 0; i < 4; i++) { - if ((defrects[i].width == SENSOR_PREVIEW_W) && - (defrects[i].height == SENSOR_PREVIEW_H)) { - SENSOR_PREVIEW_W = defrects[i].defrect.width; - SENSOR_PREVIEW_H = defrects[i].defrect.height; - memcpy(&sensor->info_priv.dev_sig_cnf.crop, - &defrects[i].defrect, - sizeof(defrects[i].defrect)); - - if (!defrects[i].interface) { - SENSOR_TR("%s(%d): interface is NULL\n", - __func__, __LINE__); - continue; - } - - SENSOR_TR("%s(%d): type 0x%x\n", __func__, __LINE__, - sensor->info_priv.dev_sig_cnf.type); - } - } - /*update sensor info_priv*/ - for (i = 0; i < num_series; i++) { - series[i].gSeq_info.w = SENSOR_PREVIEW_W; - series[i].gSeq_info.h = SENSOR_PREVIEW_H; - } - generic_sensor_get_max_min_res(sensor->info_priv.sensor_series, - sensor->info_priv.num_series, - &(sensor->info_priv.max_real_res), - &(sensor->info_priv.max_res), - &(sensor->info_priv.min_res)); -} - -static void adv7181_send_uevent(struct generic_sensor *sensor) -{ - char *event_msg = NULL; - char *envp[2]; - - event_msg = kasprintf(GFP_KERNEL, - "CVBS_NAME=ADV7181, NOW_INPUT_MODE=%s, RESOLUTION=%dx%d", - input_mode, SENSOR_PREVIEW_W, SENSOR_PREVIEW_H); - SENSOR_TR("%s(%d): event_msg: %s\n", __func__, __LINE__, event_msg); - envp[0] = event_msg; - envp[1] = NULL; - kobject_uevent_env(&(sensor->subdev.v4l2_dev->dev->kobj), - KOBJ_CHANGE, envp); -} - -static v4l2_std_id adv7181_std_to_v4l2(u8 status1) -{ - /* in case V4L2_IN_ST_NO_SIGNAL */ - if (!(status1 & ADV7181_STATUS1_IN_LOCK)) - return V4L2_STD_UNKNOWN; - - switch (status1 & ADV7181_STATUS1_AUTOD_MASK) { - case ADV7181_STATUS1_AUTOD_NTSM_M_J: - return V4L2_STD_NTSC; - case ADV7181_STATUS1_AUTOD_NTSC_4_43: - return V4L2_STD_NTSC_443; - case ADV7181_STATUS1_AUTOD_PAL_M: - return V4L2_STD_PAL_M; - case ADV7181_STATUS1_AUTOD_PAL_60: - return V4L2_STD_PAL_60; - case ADV7181_STATUS1_AUTOD_PAL_B_G: - return V4L2_STD_PAL; - case ADV7181_STATUS1_AUTOD_SECAM: - return V4L2_STD_SECAM; - case ADV7181_STATUS1_AUTOD_PAL_COMB: - return V4L2_STD_PAL_Nc | V4L2_STD_PAL_N; - case ADV7181_STATUS1_AUTOD_SECAM_525: - return V4L2_STD_SECAM; - default: - return V4L2_STD_UNKNOWN; - } -} - -static u32 adv7181_status_to_v4l2(u8 status1) -{ - if (!(status1 & ADV7181_STATUS1_IN_LOCK)) - return V4L2_IN_ST_NO_SIGNAL; - - return 0; -} - -static int adv7181_uevent_video_state(struct i2c_client *client, int state) -{ - struct generic_sensor *sensor = to_generic_sensor(client); - char *event_msg = NULL; - char *envp[2]; - - return 0; - event_msg = kasprintf(GFP_KERNEL, "CVBS_NAME=ADV7181, VIDEO_STATUS=%d", state); - SENSOR_TR("%s(%d): event_msg: %s\n", __func__, __LINE__, event_msg); - envp[0] = event_msg; - envp[1] = NULL; - kobject_uevent_env(&(sensor->subdev.v4l2_dev->dev->kobj), KOBJ_CHANGE, envp); - - return 0; -} - -static int adv7181_status(struct i2c_client *client, u32 *status, - v4l2_std_id *std) -{ - unsigned char status1 = 0; - int ret = 0; - struct generic_sensor *sensor = to_generic_sensor(client); - - ret = sensor_read(client, ADV7181_STATUS1_REG, &status1); - - if (IS_ERR_VALUE(ret)) { - SENSOR_TR("%s(%d): register read failed: 0x%x\n", - __func__, __LINE__, ADV7181_STATUS1_REG); - return status1; - } - SENSOR_DG("%s(%d): ADV7181_STATUS1_REG read : 0x%x\n", - __func__, __LINE__, status1); - - if (status1 < 0) - return status1; - - if (adv7181_status_to_v4l2(status1) == V4L2_IN_ST_NO_SIGNAL) { - sensor->info_priv.video_state = RK_CAM_INPUT_VIDEO_STATE_LOSS; - adv7181_uevent_video_state(client, 0); - } else { - if (sensor->info_priv.video_state == RK_CAM_INPUT_VIDEO_STATE_LOSS) { - sensor->info_priv.video_state = RK_CAM_INPUT_VIDEO_STATE_LOCKED; - adv7181_uevent_video_state(client, 1); - } - } - - if (status) - *status = adv7181_status_to_v4l2(status1); - if (std) - *std = adv7181_std_to_v4l2(status1); - - return 0; -} - -/* - * the function is called in open sensor - */ -static int sensor_activate_cb(struct i2c_client *client) -{ - struct generic_sensor *sensor = to_generic_sensor(client); -/* u32 status = V4L2_IN_ST_NO_SIGNAL; - v4l2_std_id std; - - while (status == V4L2_IN_ST_NO_SIGNAL) { - msleep(20); - adv7181_status(client, &status, NULL); - } - SENSOR_TR("status %d\n", (int)status); - adv7181_status(client, NULL, &std); - adv7181_reinit_parameter(std, sensor); - SENSOR_TR("%s(%d):now mode %s\n", __func__, __LINE__, input_mode); - */ - SENSOR_DG("%s: %d\n", __func__, __LINE__); - sensor_write(client, ADV7181_INPUT_CONTROL, now_channel_value); - - sensor->info_priv.video_state = RK_CAM_INPUT_VIDEO_STATE_LOCKED; - if (sensor->state_check_work.state_check_wq) { - SENSOR_DG("sensor_activate_cb: queue_delayed_work 1000ms"); - queue_delayed_work(sensor->state_check_work.state_check_wq, - &sensor->state_check_work.work, 100); - } - - return 0; -} -/* - * the function is called in close sensor - */ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - int ret = 0; - struct generic_sensor *sensor = to_generic_sensor(client); - - ret = cancel_delayed_work_sync(&sensor->state_check_work.work); - return ret; -} - -static int sensor_s_stream(struct v4l2_subdev *sd, int enable) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - SENSOR_DG("stream %d\n", enable); - if (enable) - sensor_write(client, 0x03, 0x0C); - else - sensor_write(client, 0x03, 0x4C); - return 0; -} - -/* - * the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_th(struct i2c_client *client, - struct v4l2_mbus_framefmt *mf, - bool capture) -{ - if (capture) - sensor_parameter_record(client); - - return 0; -} -/* - * the function is called after sensor register setting finished in VIDIOC_S_FMT - */ -static int sensor_s_fmt_cb_bh(struct i2c_client *client, - struct v4l2_mbus_framefmt *mf, - bool capture) -{ - if (capture) - sensor_ae_transfer(client); - - return 0; -} -static int sensor_try_fmt_cb_th(struct i2c_client *client, - struct v4l2_mbus_framefmt *mf) -{ - return 0; -} - -static int sensor_softrest_usr_cb(struct i2c_client *client, - struct rk_sensor_reg *series) -{ - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client, - struct rk_sensor_reg *series) -{ - return 0; -} - -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - SENSOR_DG("Resume"); - - return 0; -} -static int sensor_mirror_cb(struct i2c_client *client, int mirror) -{ - return 0; -} -/* - * the function is v4l2 control V4L2_CID_HFLIP callback - */ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, - struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - SENSOR_DG("sensor_mirror success, value:0x%x", ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - return 0; -} -/* - * the function is v4l2 control V4L2_CID_VFLIP callback - */ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, - struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - SENSOR_DG("sensor_flip success, value:0x%x", ext_ctrl->value); - return 0; -} -/* - * the functions are focus callbacks - */ -static int sensor_focus_init_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client, int pos) -{ - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, - int *zone_tm_pos) -{ - return 0; -} - -/* - *face defect call back - */ -static int sensor_face_detect_usr_cb(struct i2c_client *client, int on) -{ - return 0; -} - -/* config debug fs ops */ -#define DEBUG_FS_NTSC_WIDTH 0x8000 -#define DEBUG_FS_NTSC_HEIGHT 0x8001 -#define DEBUG_FS_NTSC_LEFT 0x8002 -#define DEBUG_FS_NTSC_TOP 0x8003 - -#define DEBUG_FS_PAL_WIDTH 0x8004 -#define DEBUG_FS_PAL_HEIGHT 0x8005 -#define DEBUG_FS_PAL_LEFT 0x8006 -#define DEBUG_FS_PAL_TOP 0x8007 - -static ssize_t adv7181_debugfs_reg_write(struct file *file, - const char __user *buf, - size_t count, loff_t *ppos) -{ - struct specific_sensor *spsensor = - ((struct seq_file *)file->private_data)->private; - struct i2c_client *client = spsensor->common_sensor.client; - int reg, val, ret; - unsigned char read; - char kbuf[30]; - int nbytes = min(count, sizeof(kbuf) - 1); - int i = 0; - - if (copy_from_user(kbuf, buf, nbytes)) - return -EFAULT; - - kbuf[nbytes] = '\0'; - if (sscanf(kbuf, " %x %x", ®, &val) != 2) - return -EINVAL; - - SENSOR_TR("%s(%d): register write reg: 0x%x, val 0x%x\n", - __func__, __LINE__, reg, val); - - switch (reg) { - case DEBUG_FS_NTSC_WIDTH: - { - for (i = 0; i < 4; i++) - if (defrects[i].height == 480) - defrects[i].defrect.width = val; - break; - } - case DEBUG_FS_NTSC_HEIGHT: - { - for (i = 0; i < 4; i++) - if (defrects[i].height == 480) - defrects[i].defrect.height = val; - break; - } - case DEBUG_FS_NTSC_TOP: - { - for (i = 0; i < 4; i++) - if (defrects[i].height == 480) - defrects[i].defrect.top = val; - break; - } - case DEBUG_FS_NTSC_LEFT: - { - for (i = 0; i < 4; i++) - if (defrects[i].height == 480) - defrects[i].defrect.left = val; - break; - } - case DEBUG_FS_PAL_WIDTH: - { - for (i = 0; i < 4; i++) - if (defrects[i].height == 576) - defrects[i].defrect.width = val; - break; - } - case DEBUG_FS_PAL_HEIGHT: - { - for (i = 0; i < 4; i++) - if (defrects[i].height == 576) - defrects[i].defrect.height = val; - break; - } - case DEBUG_FS_PAL_LEFT: - { - for (i = 0; i < 4; i++) - if (defrects[i].height == 576) - defrects[i].defrect.left = val; - break; - } - case DEBUG_FS_PAL_TOP: - { - for (i = 0; i < 4; i++) - if (defrects[i].height == 576) - defrects[i].defrect.top = val; - break; - } - default: - { - ret = sensor_write(client, reg, val); - if (IS_ERR_VALUE(ret)) { - SENSOR_TR("d_fs: write fail: 0x%x, val 0x%x\n", - reg, val); - } - - ret = sensor_read(client, reg, &read); - if (IS_ERR_VALUE(ret)) { - SENSOR_TR("d_fs: write fail: 0x%x, val 0x%x\n", - reg, read); - } else - SENSOR_TR("d_fs: read 0x%x return 0x%x\n", - reg, val); - break; - } - } - - return count; -} - -static int adv7181_debugfs_reg_show(struct seq_file *s, void *v) -{ - int i, ret; - unsigned char val; - struct specific_sensor *spsensor = s->private; - struct i2c_client *client = spsensor->common_sensor.client; - - SENSOR_TR("%s(%d): test\n", __func__, __LINE__); - - for (i = 0; i <= 0xff; i++) { - ret = sensor_read(client, i, &val); - if (IS_ERR_VALUE(ret)) - SENSOR_TR("%s(%d): register read failed: 0x%x\n", - __func__, __LINE__, i); - - seq_printf(s, "0x%02x : 0x%02x\n", i, (u8)val); - } - - return 0; -} - -static int adv7181_debugfs_open(struct inode *inode, struct file *file) -{ - struct specific_sensor *spsensor = inode->i_private; - - return single_open(file, adv7181_debugfs_reg_show, spsensor); -} - -static const struct file_operations adv7181_debugfs_fops = { - .owner = THIS_MODULE, - .open = adv7181_debugfs_open, - .read = seq_read, - .write = adv7181_debugfs_reg_write, - .llseek = seq_lseek, - .release = single_release -}; - -static void adv7181_check_state_work(struct work_struct *work) -{ - struct rk_state_check_work *state_check_work = - container_of(work, struct rk_state_check_work, work.work); - struct generic_sensor *sensor = - container_of(state_check_work, - struct generic_sensor, - state_check_work); - struct i2c_client *client = sensor->client; - static v4l2_std_id std_old = V4L2_STD_NTSC; - v4l2_std_id std; - - if ((sensor->info_priv.dev_sig_cnf.type == - RK_CAMERA_DEVICE_BT601_8) || - (sensor->info_priv.dev_sig_cnf.type == - RK_CAMERA_DEVICE_BT601_PIONGPONG)) - return; - - adv7181_status(client, NULL, &std); - if ((std_old != std) && (std != V4L2_STD_UNKNOWN)) { - adv7181_reinit_parameter(std, sensor); - adv7181_send_uevent(sensor); - std_old = std; - SENSOR_TR("%s(%d):now mode %s\n", - __func__, __LINE__, input_mode); - } - - queue_delayed_work(sensor->state_check_work.state_check_wq, - &sensor->state_check_work.work, 100); -} - -/* - * The function can been run in sensor_init_parametres which run in - * sensor_probe, so user can do some initialization in the function. - */ -static void sensor_init_parameters_user(struct specific_sensor *spsensor, - struct soc_camera_device *icd) -{ - struct soc_camera_desc *desc = to_soc_camera_desc(icd); - struct rk29camera_platform_data *pdata = desc->subdev_desc.drv_priv; - struct rkcamera_platform_data *sensor_device = NULL, *new_camera; - struct dentry *debugfs_dir = - spsensor->common_sensor.info_priv.debugfs_dir; - int i; - - new_camera = pdata->register_dev_new; - while (new_camera != NULL) { - SENSOR_TR("%s(%d): icd_name %s, new_camera_name %s.\n", - __func__, __LINE__, - dev_name(icd->pdev), new_camera->dev_name); - if (strcmp(dev_name(icd->pdev), new_camera->dev_name) == 0) { - sensor_device = new_camera; - break; - } - new_camera = new_camera->next_camera; - } - if (!sensor_device) { - SENSOR_TR("%s(%d): Could not find %s\n", __func__, __LINE__, - dev_name(icd->pdev)); - return; - } - memcpy(&defrects, &sensor_device->defrects, - sizeof(sensor_device->defrects)); - for (i = 0; i < 4; i++) { - if ((defrects[i].width == SENSOR_PREVIEW_W) && - (defrects[i].height == SENSOR_PREVIEW_H)) { - memcpy(&dev_info[0].crop, &defrects[i].defrect, - sizeof(dev_info[0].crop)); - if (!strcmp(defrects[i].interface, "bt601_8")) - dev_info[i].type = RK_CAMERA_DEVICE_BT601_8; - if (!strcmp(defrects[i].interface, "cvbs_ntsc")) - dev_info[i].type = RK_CAMERA_DEVICE_CVBS_NTSC; - if (!strcmp(defrects[i].interface, "cvbs_pal")) - dev_info[i].type = RK_CAMERA_DEVICE_CVBS_PAL; - } - } - - SENSOR_TR("%s(%d): channel %d, default %d\n", __func__, __LINE__, - sensor_device->channel_info.channel_total, - sensor_device->channel_info.default_id); - spsensor->common_sensor.channel_id = - sensor_device->channel_info.default_id; - memcpy(&channel_infos, &sensor_device->channel_info, - sizeof(channel_infos)); - for (i = 0; i < 5; i++) { - SENSOR_TR("%s(%d): channel_ain%d %s\n", __func__, __LINE__, i, - channel_infos.channel_info[i]); - } - - /* init irq interrupt */ - /*SENSOR_TR("%s(%d): irq_active %d.\n", - __func__, __LINE__, new_camera->io.gpio_irq); - if (gpio_request(new_camera->io.gpio_irq, NULL) != 0) { - gpio_free(new_camera->io.gpio_irq); - SENSOR_TR("%s(%d): request irq gpio error\n", - __func__, __LINE__); - } - - spsensor->common_sensor.irq = gpio_to_irq(new_camera->io.gpio_irq); - ret = request_irq(spsensor->common_sensor.irq, ADV7181_irq, - IRQF_TRIGGER_FALLING, dev_name(icd->pdev), spsensor); - - if (ret < 0) { - SENSOR_TR("%s(%d): request irq failed\n", __func__, __LINE__); - free_irq(spsensor->common_sensor.irq, spsensor); - } - */ - - /* init debugfs */ - debugfs_dir = debugfs_create_dir("adv7181", NULL); - if (IS_ERR(debugfs_dir)) - SENSOR_TR("%s(%d): create debugfs dir failed\n", - __func__, __LINE__); - else - debugfs_create_file("register", S_IRUSR, debugfs_dir, spsensor, - &adv7181_debugfs_fops); - - /* init work_queue for state_check */ - INIT_DELAYED_WORK(&spsensor->common_sensor.state_check_work.work, - adv7181_check_state_work); - spsensor->common_sensor.state_check_work.state_check_wq = - create_singlethread_workqueue(SENSOR_NAME_STRING(_state_check_workqueue)); - if (spsensor->common_sensor.state_check_work.state_check_wq == NULL) { - SENSOR_TR("%s(%d): %s create failed.\n", __func__, __LINE__, - SENSOR_NAME_STRING(_state_check_workqueue)); - BUG(); - } - - memcpy(&spsensor->common_sensor.info_priv.dev_sig_cnf, - &dev_info[0], sizeof(dev_info)); - spsensor->common_sensor.crop_percent = 0; - spsensor->common_sensor.sensor_cb.sensor_s_stream_cb = sensor_s_stream; -} - -/* - * :::::WARNING::::: - * It is not allowed to modify the following code - */ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); - diff --git a/drivers/media/video/gc0307.c b/drivers/media/video/gc0307.c deleted file mode 100644 index add574a029df..000000000000 --- a/drivers/media/video/gc0307.c +++ /dev/null @@ -1,1301 +0,0 @@ -/* - * drivers/media/video/gc0307.c - * - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "generic_sensor.h" - -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.0.3: -* add sensor_focus_af_const_pause_usr_cb; -*/ -static int version = KERNEL_VERSION(0,0,3); -module_param(version, int, S_IRUGO); - - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_GC0307 -#define SENSOR_V4L2_IDENT V4L2_IDENT_GC0307 -#define SENSOR_ID 0x99 -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_PCLK_SAMPLE_RISING|V4L2_MBUS_HSYNC_ACTIVE_HIGH| V4L2_MBUS_VSYNC_ACTIVE_LOW|\ - V4L2_MBUS_DATA_ACTIVE_HIGH |SOCAM_MCLK_24MHZ) -#define SENSOR_PREVIEW_W 640 -#define SENSOR_PREVIEW_H 480 -#define SENSOR_PREVIEW_FPS 15000 // 15fps -#define SENSOR_FULLRES_L_FPS 7500 // 7.5fps -#define SENSOR_FULLRES_H_FPS 7500 // 7.5fps -#define SENSOR_720P_FPS 0 -#define SENSOR_1080P_FPS 0 - -#define SENSOR_REGISTER_LEN 1 // sensor register address bytes -#define SENSOR_VALUE_LEN 1 // sensor register value bytes - -static unsigned int SensorConfiguration = (CFG_WhiteBalance|CFG_Effect|CFG_Scene); -static unsigned int SensorChipID[] = {SENSOR_ID}; -/* Sensor Driver Configuration End */ - - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a,b) CONS4(SensorReg,SENSOR_REGISTER_LEN,Val,SENSOR_VALUE_LEN)(a,b) -#define sensor_write(client,reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_read(client,reg,v) CONS4(sensor_read_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_write_array generic_sensor_write_array - -struct sensor_parameter -{ - unsigned int PreviewDummyPixels; - unsigned int CaptureDummyPixels; - unsigned int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int PreviewPclk; - unsigned short int CapturePclk; - char awb[6]; -}; - -struct specific_sensor{ - struct generic_sensor common_sensor; - //define user data below - struct sensor_parameter parameter; - -}; - -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ - -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_init_data[] ={ - //========= close output - {0x43 ,0x00}, - {0x44 ,0xa2}, - - //========= close some functions - // open them after configure their parmameters - {0x40 ,0x10}, - {0x41 ,0x00}, - {0x42 ,0x10}, - {0x47 ,0x00}, //mode1, - {0x48 ,0xc3}, //mode2, - {0x49 ,0x00}, //dither_mode - {0x4a ,0x00}, //clock_gating_en - {0x4b ,0x00}, //mode_reg3 - {0x4E ,0x22},//0x23}, //sync mode yaowei - {0x4F ,0x01}, //AWB, AEC, every N frame - - //========= frame timing - {0x01 ,0x6a}, //HB - {0x02 ,0x70}, //VB - {0x1C ,0x00}, //Vs_st - {0x1D ,0x00}, //Vs_et - {0x10 ,0x00}, //high 4 bits of VB, HB - {0x11 ,0x05}, //row_tail, AD_pipe_number - - - - - - //========= windowing - {0x05 ,0x00}, //row_start - {0x06 ,0x00}, - {0x07 ,0x00}, //col start - {0x08 ,0x00}, - {0x09 ,0x01}, //win height - {0x0A ,0xE8}, - {0x0B ,0x02}, //win width, pixel array only 640 - {0x0C ,0x80}, - - //========= analog - {0x0D ,0x22}, //rsh_width - - {0x0E ,0x02}, //CISCTL mode2, - - - {0x12 ,0x70}, //7 hrst, 6_4 darsg, - {0x13 ,0x00}, //7 CISCTL_restart, 0 apwd - {0x14 ,0x00}, //NA - {0x15 ,0xba}, //7_4 vref - {0x16 ,0x13}, //5to4 _coln_r, __1to0__da18 - {0x17 ,0x52}, //opa_r, ref_r, sRef_r - //{0x18 ,0xc0}, //analog_mode, best case for left band. - - {0x1E ,0x0d}, //tsp_width - {0x1F ,0x32}, //sh_delay - - //========= offset - {0x47 ,0x00}, //7__test_image, __6__fixed_pga, __5__auto_DN, __4__CbCr_fix, - //__3to2__dark_sequence, __1__allow_pclk_vcync, __0__LSC_test_image - {0x19 ,0x06}, //pga_o - {0x1a ,0x06}, //pga_e - - {0x31 ,0x00}, //4 //pga_oFFset , high 8bits of 11bits - {0x3B ,0x00}, //global_oFFset, low 8bits of 11bits - - {0x59 ,0x0f}, //offset_mode - {0x58 ,0x88}, //DARK_VALUE_RATIO_G, DARK_VALUE_RATIO_RB - {0x57 ,0x08}, //DARK_CURRENT_RATE - {0x56 ,0x77}, //PGA_OFFSET_EVEN_RATIO, PGA_OFFSET_ODD_RATIO - - //========= blk - {0x35 ,0xd8}, //blk_mode - - {0x36 ,0x40}, - - {0x3C ,0x00}, - {0x3D ,0x00}, - {0x3E ,0x00}, - {0x3F ,0x00}, - - {0xb5 ,0x70}, - {0xb6 ,0x40}, - {0xb7 ,0x00}, - {0xb8 ,0x38}, - {0xb9 ,0xc3}, - {0xba ,0x0f}, - - {0x7e ,0x50},//0x45 ylz++ - {0x7f ,0x76}, //0x66 - - {0x5c ,0x48}, //78 - {0x5d ,0x58}, //88 - - - //========= manual_gain - {0x61 ,0x80}, //manual_gain_g1 - {0x63 ,0x80}, //manual_gain_r - {0x65 ,0x98}, //manual_gai_b, 0xa0=1.25, 0x98=1.1875 - {0x67 ,0x80}, //manual_gain_g2 - {0x68 ,0x18}, //global_manual_gain 2.4bits - - //=========CC _R - {0x69 ,0x58}, //54 - {0x6A ,0xf6}, //ff - {0x6B ,0xfb}, //fe - {0x6C ,0xf4}, //ff - {0x6D ,0x5a}, //5f - {0x6E ,0xe6}, //e1 - - {0x6f ,0x00}, - - //=========lsc - {0x70 ,0x14}, - {0x71 ,0x1c}, - {0x72 ,0x20}, - - {0x73 ,0x10}, - {0x74 ,0x3c}, - {0x75 ,0x52}, - - //=========dn - {0x7d ,0x2f}, //dn_mode - {0x80 ,0x0c}, //when auto_dn, check 7e,7f - {0x81 ,0x0c}, - {0x82 ,0x44}, - - //dd - {0x83 ,0x18}, //DD_TH1 - {0x84 ,0x18}, //DD_TH2 - {0x85 ,0x04}, //DD_TH3 - {0x87 ,0x34}, //32 b DNDD_low_range X16, DNDD_low_range_C_weight_center - - - //=========intp-ee - {0x88 ,0x04}, - {0x89 ,0x01}, - {0x8a ,0x50},//60 - {0x8b ,0x50},//60 - {0x8c ,0x07}, - - {0x50 ,0x0c}, - {0x5f ,0x3c}, - - {0x8e ,0x02}, - {0x86 ,0x02}, - - {0x51 ,0x20}, - {0x52 ,0x08}, - {0x53 ,0x00}, - - - //========= YCP - //contrast_center - {0x77 ,0x80}, //contrast_center - {0x78 ,0x00}, //fixed_Cb - {0x79 ,0x00}, //fixed_Cr - {0x7a ,0x00}, //luma_offset - {0x7b ,0x40}, //hue_cos - {0x7c ,0x00}, //hue_sin - - //saturation - {0xa0 ,0x40}, //global_saturation - {0xa1 ,0x42}, //luma_contrast - {0xa2 ,0x40}, //saturation_Cb //ylz 34 - {0xa3 ,0x34}, //saturation_Cr - - {0xa4 ,0xc8}, - {0xa5 ,0x02}, - {0xa6 ,0x28}, - {0xa7 ,0x02}, - - //skin - {0xa8 ,0xee}, - {0xa9 ,0x12}, - {0xaa ,0x01}, - {0xab ,0x20}, - {0xac ,0xf0}, - {0xad ,0x10}, - - //========= ABS - {0xae ,0x18}, - {0xaf ,0x74}, - {0xb0 ,0xe0}, - {0xb1 ,0x20}, - {0xb2 ,0x6c}, - {0xb3 ,0x40}, - {0xb4 ,0x04}, - - //========= AWB - {0xbb ,0x42}, - {0xbc ,0x60}, - {0xbd ,0x50}, - {0xbe ,0x50}, - - {0xbf ,0x0c}, - {0xc0 ,0x06}, - {0xc1 ,0x60}, - {0xc2 ,0xf1}, //f1 - {0xc3 ,0x40}, - {0xc4 ,0x1c}, //18//20 - {0xc5 ,0x56}, //33 - {0xc6 ,0x1d}, - - {0xca ,0x70}, - {0xcb ,0x70}, - {0xcc ,0x78}, - - {0xcd ,0x80}, //R_ratio - {0xce ,0x80}, //G_ratio , cold_white white - {0xcf ,0x80}, //B_ratio - - //========= aecT - {0x20 ,0x06},//0x02 - {0x21 ,0xc0}, - {0x22 ,0x40}, - {0x23 ,0x88}, - {0x24 ,0x96}, - {0x25 ,0x30}, - {0x26 ,0xd0}, - {0x27 ,0x00}, - - {0x28 ,0x02}, //AEC_exp_level_1bit11to8 - {0x29 ,0x58}, //AEC_exp_level_1bit7to0 - {0x2a ,0x03}, //AEC_exp_level_2bit11to8 - {0x2b ,0x84}, //AEC_exp_level_2bit7to0 - {0x2c ,0x09}, //AEC_exp_level_3bit11to8 659 - 8FPS, 8ca - 6FPS // - {0x2d ,0x60}, //AEC_exp_level_3bit7to0 - {0x2e ,0x0a}, //AEC_exp_level_4bit11to8 4FPS - {0x2f ,0x8c}, //AEC_exp_level_4bit7to0 - - {0x30 ,0x20}, - {0x31 ,0x00}, - {0x32 ,0x1c}, - {0x33 ,0x90}, - {0x34 ,0x10}, - - {0xd0 ,0x34}, - - {0xd1 ,0x40}, //AEC_target_Y - {0xd2 ,0x61},//0xf2 - {0xd4 ,0x96}, - {0xd5 ,0x01}, // william 0318 - {0xd6 ,0x96}, //antiflicker_step - {0xd7 ,0x03}, //AEC_exp_time_min ,william 20090312 - {0xd8 ,0x02}, - - {0xdd ,0x12},//0x12 - - //========= measure window - {0xe0 ,0x03}, - {0xe1 ,0x02}, - {0xe2 ,0x27}, - {0xe3 ,0x1e}, - {0xe8 ,0x3b}, - {0xe9 ,0x6e}, - {0xea ,0x2c}, - {0xeb ,0x50}, - {0xec ,0x73}, - - //========= close_frame - {0xed ,0x00}, //close_frame_num1 ,can be use to reduce FPS - {0xee ,0x00}, //close_frame_num2 - {0xef ,0x00}, //close_frame_num - - // page1 - {0xf0 ,0x01}, //select page1 - - {0x00 ,0x20}, - {0x01 ,0x20}, - {0x02 ,0x20}, - {0x03 ,0x20}, - {0x04 ,0x78}, - {0x05 ,0x78}, - {0x06 ,0x78}, - {0x07 ,0x78}, - - - - {0x10 ,0x04}, - {0x11 ,0x04}, - {0x12 ,0x04}, - {0x13 ,0x04}, - {0x14 ,0x01}, - {0x15 ,0x01}, - {0x16 ,0x01}, - {0x17 ,0x01}, - - - {0x20 ,0x00}, - {0x21 ,0x00}, - {0x22 ,0x00}, - {0x23 ,0x00}, - {0x24 ,0x00}, - {0x25 ,0x00}, - {0x26 ,0x00}, - {0x27 ,0x00}, - - {0x40 ,0x11}, - - //=============================lscP - {0x45 ,0x06}, - {0x46 ,0x06}, - {0x47 ,0x05}, - - {0x48 ,0x04}, - {0x49 ,0x03}, - {0x4a ,0x03}, - - - {0x62 ,0xd8}, - {0x63 ,0x24}, - {0x64 ,0x24}, - {0x65 ,0x24}, - {0x66 ,0xd8}, - {0x67 ,0x24}, - - {0x5a ,0x00}, - {0x5b ,0x00}, - {0x5c ,0x00}, - {0x5d ,0x00}, - {0x5e ,0x00}, - {0x5f ,0x00}, - - - //============================= ccP - - {0x69 ,0x03}, //cc_mode - - //CC_G - {0x70 ,0x5d}, - {0x71 ,0xed}, - {0x72 ,0xff}, - {0x73 ,0xe5}, - {0x74 ,0x5f}, - {0x75 ,0xe6}, - - //CC_B - {0x76 ,0x41}, - {0x77 ,0xef}, - {0x78 ,0xff}, - {0x79 ,0xff}, - {0x7a ,0x5f}, - {0x7b ,0xfa}, - - - //============================= AGP - - {0x7e ,0x00}, - {0x7f ,0x20}, //x040 - {0x80 ,0x48}, - {0x81 ,0x06}, - {0x82 ,0x08}, - - {0x83 ,0x23}, - {0x84 ,0x38}, - {0x85 ,0x4F}, - {0x86 ,0x61}, - {0x87 ,0x72}, - {0x88 ,0x80}, - {0x89 ,0x8D}, - {0x8a ,0xA2}, - {0x8b ,0xB2}, - {0x8c ,0xC0}, - {0x8d ,0xCA}, - {0x8e ,0xD3}, - {0x8f ,0xDB}, - {0x90 ,0xE2}, - {0x91 ,0xED}, - {0x92 ,0xF6}, - {0x93 ,0xFD}, - - //about gamma1 is hex r oct - {0x94 ,0x04}, - {0x95 ,0x0E}, - {0x96 ,0x1B}, - {0x97 ,0x28}, - {0x98 ,0x35}, - {0x99 ,0x41}, - {0x9a ,0x4E}, - {0x9b ,0x67}, - {0x9c ,0x7E}, - {0x9d ,0x94}, - {0x9e ,0xA7}, - {0x9f ,0xBA}, - {0xa0 ,0xC8}, - {0xa1 ,0xD4}, - {0xa2 ,0xE7}, - {0xa3 ,0xF4}, - {0xa4 ,0xFA}, - - //========= open functions - {0xf0 ,0x00}, //set back to page0 - {0x40 ,0x7e}, - {0x41 ,0x2F}, - - ///// Çë×¢Ò⣬µ÷ÕûGC0307µÄ¾µÏñºÍ·­×ª£¬ÐèҪͬʱÐÞ¸ÄÈý¸ö¼Ä´æÆ÷£¬ÈçÏÂ: - - {0x0f, 0xb2}, - {0x45, 0x27}, - {0x47, 0x2c}, - ///banding setting - { 0x01 ,0xfa}, // 24M - { 0x02 ,0x70}, - { 0x10 ,0x01}, - { 0xd6 ,0x64}, - { 0x28 ,0x02}, - { 0x29 ,0x58}, - { 0x2a ,0x02}, - { 0x2b ,0x58}, - { 0x2c ,0x02}, - { 0x2d ,0x58}, - { 0x2e ,0x06}, - { 0x2f ,0x40}, - - /************ - {0x0f, 0x02},//82 - {0x45, 0x24}, - {0x47, 0x20}, - **************/ - ///// ËÄÖÖ²»Í¬µÄ·­×ªºÍ¾µÏñÉ趨£¬¿Í»§¿ÉÖ±½Ó¸´ÖÆ!!!!!! - - -#if 0 - // IMAGE_NORMAL: - {0x0f, 0xb2}, - {0x45, 0x27}, - {0x47, 0x2c}, - - // IMAGE_H_MIRROR: - {0x0f, 0xa2}, - {0x45, 0x26}, - {0x47, 0x28}, - - // IMAGE_V_MIRROR: - {0x0f, 0x92}, - {0x45, 0x25}, - {0x47, 0x24}, - - // IMAGE_HV_MIRROR: // 180 - {0x0f, 0x82}, - {0x45, 0x24}, - {0x47, 0x20}, -#endif - {0x43, 0x40}, - {0x44, 0xe2}, - - SensorEnd -}; -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={ - SensorEnd - -}; -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] ={ - SensorEnd -}; -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data[] = -{ -#if 1 - { 0x05 , 0x00}, - { 0x06 , 0x00}, - { 0x07 , 0x00}, - { 0x08 , 0x00},//0x10 james 20100715 - { 0x09 , 0x01}, - { 0x0a , 0xe8}, - { 0x0b , 0x02}, - { 0x0c , 0x88},//0x80 james 20100715 - { 0x45 , 0x24}, // bit[7:2]=001001 - { 0x48 , 0x84}, // bit[7]=1 - { 0xe0 , 0x03}, - { 0xe1 , 0x02}, - { 0xe2 , 0x27}, - { 0xe3 , 0x1e}, - { 0xe8 , 0x3b}, - { 0xe9 , 0x6e}, - { 0xea , 0x2c}, - { 0xeb , 0x50}, - { 0xec , 0x73}, -#else - {0x17, 0x13}, - {0x18, 0x01}, - {0x32, 0xbf}, - {0x19, 0x03}, - {0x1a, 0x7b}, - {0x03, 0x0a}, - -#endif - SensorEnd -}; -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[]={ - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[]={ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_softreset_data[]={ - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[]={ - SensorRegVal(0x00,0), - SensorEnd -}; -/* -* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx -*/ -static struct rk_sensor_reg sensor_WhiteB_Auto[]= -{ - {0xc7,0x4c}, //for AWB can adjust back - {0xc8,0x40}, - {0xc9,0x4a}, - {0x41,0x2f}, - SensorEnd -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[]= -{ - {0x41,0x2b}, // Enable AWB - {0xc7,0x5a}, //WB_manual_gain - {0xc8,0x42}, - {0xc9,0x40}, - SensorEnd -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x41,0x2b}, // Enable AWB - {0xc7,0x50}, - {0xc8,0x45}, - {0xc9,0x40}, - SensorEnd -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0x41,0x2b}, // Enable AWB - {0xc7,0x48}, - {0xc8,0x40}, - {0xc9,0x5c}, - SensorEnd - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x41,0x2b}, // Enable AWB - {0xc7,0x40}, - {0xc8,0x42}, - {0xc9,0x50}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[]= -{ - // Brightness -2 - {0x7a, 0xe0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[]= -{ - // Brightness -1 - {0x7a, 0xf0}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[]= -{ - // Brightness 0 - {0x7a, 0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[]= -{ - // Brightness +1 - {0x7a, 0x10}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[]= -{ - // Brightness +2 - {0x7a, 0x20}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[]= -{ - // Brightness +3 - {0x7a, 0x30}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = -{ - {0x41,0x2f}, // 1 - {0x40,0x7e}, - {0x42,0x10}, - {0x47,0x24},//20 - {0x48,0xc3}, - {0x8a,0x50},//60 - {0x8b,0x50}, - {0x8c,0x07}, - {0x50,0x0c}, - {0x77,0x80}, - {0xa1,0x40}, - {0x7a,0x00}, - {0x78,0x00}, - {0x79,0x00}, - {0x7b,0x40}, - {0x7c,0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = -{ - {0x41,0x2f}, // danse - {0x40,0x7e}, - {0x42,0x10}, - {0x47,0x3c}, - {0x48,0xc3}, - {0x8a,0x60}, - {0x8b,0x60}, - {0x8c,0x07}, - {0x50,0x0c}, - {0x77,0x80}, - {0xa1,0x40}, - {0x7a,0x00}, - {0x78,0x00}, - {0x79,0x00}, - {0x7b,0x40}, - {0x7c,0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = -{ - {0x41,0x2f}, - {0x40,0x7e}, - {0x42,0x10}, - {0x47,0x3c}, - {0x48,0xc3}, - {0x8a,0x60}, - {0x8b,0x60}, - {0x8c,0x07}, - {0x50,0x0c}, - {0x77,0x80}, - {0xa1,0x40}, - {0x7a,0x00}, - {0x78,0xc0}, - {0x79,0x20}, - {0x7b,0x40}, - {0x7c,0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Negative[] = -{ - //Negative - {0x41,0x6f}, // 4 - {0x40,0x7e}, - {0x42,0x10}, - {0x47,0x20}, - {0x48,0xc3}, - {0x8a,0x60}, - {0x8b,0x60}, - {0x8c,0x07}, - {0x50,0x0c}, - {0x77,0x80}, - {0xa1,0x40}, - {0x7a,0x00}, - {0x78,0x00}, - {0x79,0x00}, - {0x7b,0x40}, - {0x7c,0x00}, - SensorEnd -}; -static struct rk_sensor_reg sensor_Effect_Bluish[] = -{ - // Bluish - {0x41,0x2f}, // 5 - {0x40,0x7e}, - {0x42,0x10}, - {0x47,0x2c}, - {0x48,0xc3}, - {0x8a,0x60}, - {0x8b,0x60}, - {0x8c,0x07}, - {0x50,0x0c}, - {0x77,0x80}, - {0xa1,0x40}, - {0x7a,0x00}, - {0x78,0x70}, - {0x79,0x00}, - {0x7b,0x3f}, - {0x7c,0xf5}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = -{ - // Greenish 6 - {0x41,0x2f}, - {0x40,0x7e}, - {0x42,0x10}, - {0x47,0x3c}, - {0x48,0xc3}, - {0x8a,0x60}, - {0x8b,0x60}, - {0x8c,0x07}, - {0x50,0x0c}, - {0x77,0x80}, - {0xa1,0x40}, - {0x7a,0x00}, - {0x78,0xc0}, - {0x79,0xc0}, - {0x7b,0x40}, - {0x7c,0x00}, - SensorEnd -}; -#if 0 -static struct rk_sensor_reg sensor_Effect_Grayscale[]= -{ - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0xff}, - {0xd2,0x90}, - {0x73,0x00}, - - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x00}, - {0xbb,0x00}, - {0x00,0x00}, - SensorEnd -}; -#endif -static struct rk_sensor_reg *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; - -static struct rk_sensor_reg sensor_Exposure0[]= -{ - //-3 - {0xd1, 0x38}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure1[]= -{ - //-2 - {0xd1, 0x40}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure2[]= -{ - //-1 - {0xd1, 0x48}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure3[]= -{ - //default - {0xd1, 0x50}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure4[]= -{ - // 1 - {0xd1, 0x58}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure5[]= -{ - // 2 - {0xd1, 0x60}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure6[]= -{ - // 3 - {0xd1, 0x68}, - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; - -static struct rk_sensor_reg sensor_Saturation0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -static struct rk_sensor_reg sensor_Contrast0[]= -{ - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast1[]= -{ - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast2[]= -{ - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast3[]= -{ - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast4[]= -{ - - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Contrast5[]= -{ - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast6[]= -{ - - SensorEnd -}; -static struct rk_sensor_reg *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; -static struct rk_sensor_reg sensor_SceneAuto[] = -{ - { 0xdd ,0x22}, //0x12 - { 0x41 ,0x2f}, - { 0x21 ,0xc0}, - { 0xd2 ,0x02}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = -{ - { 0xdd ,0x32}, - { 0x41 ,0x0f}, - { 0xb0 ,0x10}, - { 0x21 ,0xf0}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -static struct rk_sensor_reg sensor_Zoom0[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Zoom3[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; - -/* -* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu -*/ -static struct v4l2_querymenu sensor_menus[] = -{ -}; -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = -{ -}; - -//MUST define the current used format as the first item -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {MEDIA_BUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; -/*static struct soc_camera_ops sensor_ops;*/ - - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - - return 0; -} -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - - return 0; -} -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - - return 0; -} -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh (struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - return 0; -} -static int sensor_try_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf) -{ - return 0; -} - -static int sensor_softrest_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - return 0; -} -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("Suspend"); - - } else { - SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n",pm_msg.event); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - - SENSOR_DG("Resume"); - - return 0; - -} -static int sensor_mirror_cb (struct i2c_client *client, int mirror) -{ - char val1,val2,val3; - int err = 0; - - SENSOR_DG("mirror: %d",mirror); - if (mirror) { - sensor_write(client, 0xf0, 0); - err = sensor_read(client,0x0f,&val1); - err = sensor_read(client,0x45,&val2); - err = sensor_read(client,0x47,&val3); - if(err ==0){ - if((val1 == 0xb2) && (val2 == 0x27) && (val3 == 0x2c)){//normal - err = sensor_write(client, 0x0f, 0xa2); - err = sensor_write(client, 0x45, 0x26); - err = sensor_write(client, 0x47, 0x28); - }else if((val1 == 0xa2) && (val2 == 0x26) && (val3 == 0x28)){//h_mir - err = sensor_write(client, 0x0f, 0xb2); - err = sensor_write(client, 0x45, 0x27); - err = sensor_write(client, 0x47, 0x2c); - }else if((val1 == 0x92) && (val2 == 0x25) && (val3 == 0x24)){//v_flip - err = sensor_write(client, 0x0f, 0x82); - err = sensor_write(client, 0x45, 0x24); - err = sensor_write(client, 0x47, 0x20); - }else if((val1 == 0x82) && (val2 == 0x24) && (val3 == 0x20)){//h_v_mir - err = sensor_write(client, 0x0f, 0x92); - err = sensor_write(client, 0x45, 0x25); - err = sensor_write(client, 0x47, 0x24); - } - - } - - } else { - //do nothing - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_mirror_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_mirror failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_mirror success, value:0x%x",ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - char val1,val2,val3; - int err = 0; - - SENSOR_DG("flip: %d",flip); - if (flip) { - sensor_write(client, 0xf0, 0); - err = sensor_read(client,0x0f,&val1); - err = sensor_read(client,0x45,&val2); - err = sensor_read(client,0x47,&val3); - if(err ==0){ - if((val1 == 0xb2) && (val2 == 0x27) && (val3 == 0x2c)){//normal - err = sensor_write(client, 0x0f, 0x92); - err = sensor_write(client, 0x45, 0x25); - err = sensor_write(client, 0x47, 0x24); - }else if((val1 == 0xa2) && (val2 == 0x26) && (val3 == 0x28)){//h_mir - err = sensor_write(client, 0x0f, 0x82); - err = sensor_write(client, 0x45, 0x24); - err = sensor_write(client, 0x47, 0x20); - }else if((val1 == 0x92) && (val2 == 0x25) && (val3 == 0x24)){//v_flip - err = sensor_write(client, 0x0f, 0xb2); - err = sensor_write(client, 0x45, 0x27); - err = sensor_write(client, 0x47, 0x2c); - }else if((val1 == 0x82) && (val2 == 0x24) && (val3 == 0x20)){//h_v_mir - err = sensor_write(client, 0x0f, 0xa2); - err = sensor_write(client, 0x45, 0x26); - err = sensor_write(client, 0x47, 0x28); - } - - } - - } else { - //do nothing - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_flip_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_flip failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_flip success, value:0x%x",ext_ctrl->value); - return 0; -} -/* -* the functions are focus callbacks -*/ -static int sensor_focus_init_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos){ - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client){ - return 0; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos) -{ - return 0; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client,int on){ - return 0; -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor* spsensor,struct soc_camera_device *icd) -{ - return; -} - -/* -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); - - - - - diff --git a/drivers/media/video/gc0307_old.c b/drivers/media/video/gc0307_old.c deleted file mode 100755 index 79c2ec36b6f4..000000000000 --- a/drivers/media/video/gc0307_old.c +++ /dev/null @@ -1,3079 +0,0 @@ - -/* -o* Driver for MT9M001 CMOS Image Sensor from Micron - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_GC0307 -#define SENSOR_V4L2_IDENT V4L2_IDENT_GC0307 -#define SENSOR_ID 0x99 -#define SENSOR_MIN_WIDTH 640//176 -#define SENSOR_MIN_HEIGHT 480//144 -#define SENSOR_MAX_WIDTH 800//1600 -#define SENSOR_MAX_HEIGHT 600//1200 -#define SENSOR_INIT_WIDTH 640 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 480 -#define SENSOR_INIT_WINSEQADR sensor_vga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_YUYV8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 0 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 1 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 - -#define CONFIG_SENSOR_I2C_SPEED 100000//250000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) -struct reginfo -{ - u8 reg; - u8 val; -}; - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); - -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_GC0307_USER_DEFINED_SERIES -#include "gc0307_user_series.c" -#else -/* init 640X480 VGA */ -static struct reginfo sensor_init_data[] = -{ -//========= close output - {0x43 ,0x00}, - {0x44 ,0xa2}, - - //========= close some functions - // open them after configure their parmameters - {0x40 ,0x10}, - {0x41 ,0x00}, - {0x42 ,0x10}, - {0x47 ,0x00}, //mode1, - {0x48 ,0xc3}, //mode2, - {0x49 ,0x00}, //dither_mode - {0x4a ,0x00}, //clock_gating_en - {0x4b ,0x00}, //mode_reg3 - {0x4E ,0x22},//0x23}, //sync mode yaowei - {0x4F ,0x01}, //AWB, AEC, every N frame - - //========= frame timing - {0x01 ,0x6a}, //HB - {0x02 ,0x70}, //VB - {0x1C ,0x00}, //Vs_st - {0x1D ,0x00}, //Vs_et - {0x10 ,0x00}, //high 4 bits of VB, HB - {0x11 ,0x05}, //row_tail, AD_pipe_number - - - - - - //========= windowing - {0x05 ,0x00}, //row_start - {0x06 ,0x00}, - {0x07 ,0x00}, //col start - {0x08 ,0x00}, - {0x09 ,0x01}, //win height - {0x0A ,0xE8}, - {0x0B ,0x02}, //win width, pixel array only 640 - {0x0C ,0x80}, - - //========= analog - {0x0D ,0x22}, //rsh_width - - {0x0E ,0x02}, //CISCTL mode2, - - - {0x12 ,0x70}, //7 hrst, 6_4 darsg, - {0x13 ,0x00}, //7 CISCTL_restart, 0 apwd - {0x14 ,0x00}, //NA - {0x15 ,0xba}, //7_4 vref - {0x16 ,0x13}, //5to4 _coln_r, __1to0__da18 - {0x17 ,0x52}, //opa_r, ref_r, sRef_r - //{0x18 ,0xc0}, //analog_mode, best case for left band. - - {0x1E ,0x0d}, //tsp_width - {0x1F ,0x32}, //sh_delay - - //========= offset - {0x47 ,0x00}, //7__test_image, __6__fixed_pga, __5__auto_DN, __4__CbCr_fix, - //__3to2__dark_sequence, __1__allow_pclk_vcync, __0__LSC_test_image - {0x19 ,0x06}, //pga_o - {0x1a ,0x06}, //pga_e - - {0x31 ,0x00}, //4 //pga_oFFset , high 8bits of 11bits - {0x3B ,0x00}, //global_oFFset, low 8bits of 11bits - - {0x59 ,0x0f}, //offset_mode - {0x58 ,0x88}, //DARK_VALUE_RATIO_G, DARK_VALUE_RATIO_RB - {0x57 ,0x08}, //DARK_CURRENT_RATE - {0x56 ,0x77}, //PGA_OFFSET_EVEN_RATIO, PGA_OFFSET_ODD_RATIO - - //========= blk - {0x35 ,0xd8}, //blk_mode - - {0x36 ,0x40}, - - {0x3C ,0x00}, - {0x3D ,0x00}, - {0x3E ,0x00}, - {0x3F ,0x00}, - - {0xb5 ,0x70}, - {0xb6 ,0x40}, - {0xb7 ,0x00}, - {0xb8 ,0x38}, - {0xb9 ,0xc3}, - {0xba ,0x0f}, - - {0x7e ,0x50},//0x45 ylz++ - {0x7f ,0x76}, //0x66 - - {0x5c ,0x48}, //78 - {0x5d ,0x58}, //88 - - - //========= manual_gain - {0x61 ,0x80}, //manual_gain_g1 - {0x63 ,0x80}, //manual_gain_r - {0x65 ,0x98}, //manual_gai_b, 0xa0=1.25, 0x98=1.1875 - {0x67 ,0x80}, //manual_gain_g2 - {0x68 ,0x18}, //global_manual_gain 2.4bits - - //=========CC _R - {0x69 ,0x58}, //54 - {0x6A ,0xf6}, //ff - {0x6B ,0xfb}, //fe - {0x6C ,0xf4}, //ff - {0x6D ,0x5a}, //5f - {0x6E ,0xe6}, //e1 - - {0x6f ,0x00}, - - //=========lsc - {0x70 ,0x14}, - {0x71 ,0x1c}, - {0x72 ,0x20}, - - {0x73 ,0x10}, - {0x74 ,0x3c}, - {0x75 ,0x52}, - - //=========dn - {0x7d ,0x2f}, //dn_mode - {0x80 ,0x0c}, //when auto_dn, check 7e,7f - {0x81 ,0x0c}, - {0x82 ,0x44}, - - //dd - {0x83 ,0x18}, //DD_TH1 - {0x84 ,0x18}, //DD_TH2 - {0x85 ,0x04}, //DD_TH3 - {0x87 ,0x34}, //32 b DNDD_low_range X16, DNDD_low_range_C_weight_center - - - //=========intp-ee - {0x88 ,0x04}, - {0x89 ,0x01}, - {0x8a ,0x50},//60 - {0x8b ,0x50},//60 - {0x8c ,0x07}, - - {0x50 ,0x0c}, - {0x5f ,0x3c}, - - {0x8e ,0x02}, - {0x86 ,0x02}, - - {0x51 ,0x20}, - {0x52 ,0x08}, - {0x53 ,0x00}, - - - //========= YCP - //contrast_center - {0x77 ,0x80}, //contrast_center - {0x78 ,0x00}, //fixed_Cb - {0x79 ,0x00}, //fixed_Cr - {0x7a ,0x00}, //luma_offset - {0x7b ,0x40}, //hue_cos - {0x7c ,0x00}, //hue_sin - - //saturation - {0xa0 ,0x40}, //global_saturation - {0xa1 ,0x42}, //luma_contrast - {0xa2 ,0x40}, //saturation_Cb //ylz 34 - {0xa3 ,0x34}, //saturation_Cr - - {0xa4 ,0xc8}, - {0xa5 ,0x02}, - {0xa6 ,0x28}, - {0xa7 ,0x02}, - - //skin - {0xa8 ,0xee}, - {0xa9 ,0x12}, - {0xaa ,0x01}, - {0xab ,0x20}, - {0xac ,0xf0}, - {0xad ,0x10}, - - //========= ABS - {0xae ,0x18}, - {0xaf ,0x74}, - {0xb0 ,0xe0}, - {0xb1 ,0x20}, - {0xb2 ,0x6c}, - {0xb3 ,0x40}, - {0xb4 ,0x04}, - - //========= AWB - {0xbb ,0x42}, - {0xbc ,0x60}, - {0xbd ,0x50}, - {0xbe ,0x50}, - - {0xbf ,0x0c}, - {0xc0 ,0x06}, - {0xc1 ,0x60}, - {0xc2 ,0xf1}, //f1 - {0xc3 ,0x40}, - {0xc4 ,0x1c}, //18//20 - {0xc5 ,0x56}, //33 - {0xc6 ,0x1d}, - - {0xca ,0x70}, - {0xcb ,0x70}, - {0xcc ,0x78}, - - {0xcd ,0x80}, //R_ratio - {0xce ,0x80}, //G_ratio , cold_white white - {0xcf ,0x80}, //B_ratio - - //========= aecT - {0x20 ,0x06},//0x02 - {0x21 ,0xc0}, - {0x22 ,0x40}, - {0x23 ,0x88}, - {0x24 ,0x96}, - {0x25 ,0x30}, - {0x26 ,0xd0}, - {0x27 ,0x00}, - - {0x28 ,0x02}, //AEC_exp_level_1bit11to8 - {0x29 ,0x58}, //AEC_exp_level_1bit7to0 - {0x2a ,0x03}, //AEC_exp_level_2bit11to8 - {0x2b ,0x84}, //AEC_exp_level_2bit7to0 - {0x2c ,0x09}, //AEC_exp_level_3bit11to8 659 - 8FPS, 8ca - 6FPS // - {0x2d ,0x60}, //AEC_exp_level_3bit7to0 - {0x2e ,0x0a}, //AEC_exp_level_4bit11to8 4FPS - {0x2f ,0x8c}, //AEC_exp_level_4bit7to0 - - {0x30 ,0x20}, - {0x31 ,0x00}, - {0x32 ,0x1c}, - {0x33 ,0x90}, - {0x34 ,0x10}, - - {0xd0 ,0x34}, - - {0xd1 ,0x40}, //AEC_target_Y - {0xd2 ,0x61},//0xf2 - {0xd4 ,0x96}, - {0xd5 ,0x01}, // william 0318 - {0xd6 ,0x96}, //antiflicker_step - {0xd7 ,0x03}, //AEC_exp_time_min ,william 20090312 - {0xd8 ,0x02}, - - {0xdd ,0x12},//0x12 - - //========= measure window - {0xe0 ,0x03}, - {0xe1 ,0x02}, - {0xe2 ,0x27}, - {0xe3 ,0x1e}, - {0xe8 ,0x3b}, - {0xe9 ,0x6e}, - {0xea ,0x2c}, - {0xeb ,0x50}, - {0xec ,0x73}, - - //========= close_frame - {0xed ,0x00}, //close_frame_num1 ,can be use to reduce FPS - {0xee ,0x00}, //close_frame_num2 - {0xef ,0x00}, //close_frame_num - - // page1 - {0xf0 ,0x01}, //select page1 - - {0x00 ,0x20}, - {0x01 ,0x20}, - {0x02 ,0x20}, - {0x03 ,0x20}, - {0x04 ,0x78}, - {0x05 ,0x78}, - {0x06 ,0x78}, - {0x07 ,0x78}, - - - - {0x10 ,0x04}, - {0x11 ,0x04}, - {0x12 ,0x04}, - {0x13 ,0x04}, - {0x14 ,0x01}, - {0x15 ,0x01}, - {0x16 ,0x01}, - {0x17 ,0x01}, - - - {0x20 ,0x00}, - {0x21 ,0x00}, - {0x22 ,0x00}, - {0x23 ,0x00}, - {0x24 ,0x00}, - {0x25 ,0x00}, - {0x26 ,0x00}, - {0x27 ,0x00}, - - {0x40 ,0x11}, - - //=============================lscP - {0x45 ,0x06}, - {0x46 ,0x06}, - {0x47 ,0x05}, - - {0x48 ,0x04}, - {0x49 ,0x03}, - {0x4a ,0x03}, - - - {0x62 ,0xd8}, - {0x63 ,0x24}, - {0x64 ,0x24}, - {0x65 ,0x24}, - {0x66 ,0xd8}, - {0x67 ,0x24}, - - {0x5a ,0x00}, - {0x5b ,0x00}, - {0x5c ,0x00}, - {0x5d ,0x00}, - {0x5e ,0x00}, - {0x5f ,0x00}, - - - //============================= ccP - - {0x69 ,0x03}, //cc_mode - - //CC_G - {0x70 ,0x5d}, - {0x71 ,0xed}, - {0x72 ,0xff}, - {0x73 ,0xe5}, - {0x74 ,0x5f}, - {0x75 ,0xe6}, - - //CC_B - {0x76 ,0x41}, - {0x77 ,0xef}, - {0x78 ,0xff}, - {0x79 ,0xff}, - {0x7a ,0x5f}, - {0x7b ,0xfa}, - - - //============================= AGP - - {0x7e ,0x00}, - {0x7f ,0x20}, //x040 - {0x80 ,0x48}, - {0x81 ,0x06}, - {0x82 ,0x08}, - - {0x83 ,0x23}, - {0x84 ,0x38}, - {0x85 ,0x4F}, - {0x86 ,0x61}, - {0x87 ,0x72}, - {0x88 ,0x80}, - {0x89 ,0x8D}, - {0x8a ,0xA2}, - {0x8b ,0xB2}, - {0x8c ,0xC0}, - {0x8d ,0xCA}, - {0x8e ,0xD3}, - {0x8f ,0xDB}, - {0x90 ,0xE2}, - {0x91 ,0xED}, - {0x92 ,0xF6}, - {0x93 ,0xFD}, - - //about gamma1 is hex r oct - {0x94 ,0x04}, - {0x95 ,0x0E}, - {0x96 ,0x1B}, - {0x97 ,0x28}, - {0x98 ,0x35}, - {0x99 ,0x41}, - {0x9a ,0x4E}, - {0x9b ,0x67}, - {0x9c ,0x7E}, - {0x9d ,0x94}, - {0x9e ,0xA7}, - {0x9f ,0xBA}, - {0xa0 ,0xC8}, - {0xa1 ,0xD4}, - {0xa2 ,0xE7}, - {0xa3 ,0xF4}, - {0xa4 ,0xFA}, - - //========= open functions - {0xf0 ,0x00}, //set back to page0 - {0x40 ,0x7e}, - {0x41 ,0x2F}, - -///// Çë×¢Ò⣬µ÷ÕûGC0307µÄ¾µÏñºÍ·­×ª£¬ÐèҪͬʱÐÞ¸ÄÈý¸ö¼Ä´æÆ÷£¬ÈçÏÂ: - - {0x0f, 0x92}, - {0x45, 0x25}, - {0x47, 0x24}, -///banding setting - { 0x01 ,0xfa}, // 24M - { 0x02 ,0x70}, - { 0x10 ,0x01}, - { 0xd6 ,0x64}, - { 0x28 ,0x02}, - { 0x29 ,0x58}, - { 0x2a ,0x02}, - { 0x2b ,0x58}, - { 0x2c ,0x02}, - { 0x2d ,0x58}, - { 0x2e ,0x06}, - { 0x2f ,0x40}, - - /************ - {0x0f, 0x02},//82 - {0x45, 0x24}, - {0x47, 0x20}, - **************/ -///// ËÄÖÖ²»Í¬µÄ·­×ªºÍ¾µÏñÉ趨£¬¿Í»§¿ÉÖ±½Ó¸´ÖÆ!!!!!! - - -#if 0 -// IMAGE_NORMAL: - {0x0f, 0xb2}, - {0x45, 0x27}, - {0x47, 0x2c}, - -// IMAGE_H_MIRROR: - {0x0f, 0xa2}, - {0x45, 0x26}, - {0x47, 0x28}, - -// IMAGE_V_MIRROR: - {0x0f, 0x92}, - {0x45, 0x25}, - {0x47, 0x24}, - -// IMAGE_HV_MIRROR: // 180 - {0x0f, 0x82}, - {0x45, 0x24}, - {0x47, 0x20}, -#endif -{0x43, 0x40}, - {0x44, 0xe2}, -{0xff, 0xff}, -}; - -static struct reginfo sensor_720p[]= -{ - {0xff, 0xff}, -}; - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {0xff, 0xff}, - -}; - -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - {0xff, 0xff}, - -}; - -/* 640X480 VGA */ - -static struct reginfo sensor_vga[] = -{ -#if 1 -{ 0x05 , 0x00}, -{ 0x06 , 0x00}, -{ 0x07 , 0x00}, -{ 0x08 , 0x00},//0x10 james 20100715 -{ 0x09 , 0x01}, -{ 0x0a , 0xe8}, -{ 0x0b , 0x02}, -{ 0x0c , 0x88},//0x80 james 20100715 -{ 0x45 , 0x24}, // bit[7:2]=001001 -{ 0x48 , 0x84}, // bit[7]=1 -{ 0xe0 , 0x03}, -{ 0xe1 , 0x02}, -{ 0xe2 , 0x27}, -{ 0xe3 , 0x1e}, -{ 0xe8 , 0x3b}, -{ 0xe9 , 0x6e}, -{ 0xea , 0x2c}, -{ 0xeb , 0x50}, -{ 0xec , 0x73}, -#else -{0x17, 0x13}, -{0x18, 0x01}, -{0x32, 0xbf}, -{0x19, 0x03}, -{0x1a, 0x7b}, -{0x03, 0x0a}, - -#endif - {0xff, 0xff}, - - -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {0xff, 0xff}, - -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - {0xff, 0xff}, - -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {0xff, 0xff}, - -}; -#endif -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {0xff, 0xff}, - -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {0xff, 0xff}, - -}; - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0xc7,0x4c}, //for AWB can adjust back - {0xc8,0x40}, - {0xc9,0x4a}, - {0x41,0x2f}, - {0xff, 0xff}, - - - -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0x41,0x2b}, // Enable AWB - {0xc7,0x5a}, //WB_manual_gain - {0xc8,0x42}, - {0xc9,0x40}, - {0xff, 0xff}, - - -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x41,0x2b}, // Enable AWB - {0xc7,0x50}, - {0xc8,0x45}, - {0xc9,0x40}, - {0xff, 0xff}, - - -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0x41,0x2b}, // Enable AWB - {0xc7,0x48}, - {0xc8,0x40}, - {0xc9,0x5c}, - {0xff, 0xff}, - - - - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x41,0x2b}, // Enable AWB - {0xc7,0x40}, - {0xc8,0x42}, - {0xc9,0x50}, - {0xff, 0xff}, - - -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - // Brightness -2 - {0x7a, 0xe0}, - {0xff, 0xff}, - -}; - -static struct reginfo sensor_Brightness1[]= -{ - // Brightness -1 - {0x7a, 0xf0}, - {0xff, 0xff}, -}; - -static struct reginfo sensor_Brightness2[]= -{ - // Brightness 0 - {0x7a, 0x00}, - {0xff, 0xff}, -}; - -static struct reginfo sensor_Brightness3[]= -{ - // Brightness +1 - {0x7a, 0x10}, - {0xff, 0xff}, -}; - -static struct reginfo sensor_Brightness4[]= -{ - // Brightness +2 - {0x7a, 0x20}, - {0xff, 0xff}, -}; - -static struct reginfo sensor_Brightness5[]= -{ - // Brightness +3 - {0x7a, 0x30}, - {0xff, 0xff}, -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x41,0x2f}, // 1 - {0x40,0x7e}, - {0x42,0x10}, - {0x47,0x24},//20 - {0x48,0xc3}, - {0x8a,0x50},//60 - {0x8b,0x50}, - {0x8c,0x07}, - {0x50,0x0c}, - {0x77,0x80}, - {0xa1,0x40}, - {0x7a,0x00}, - {0x78,0x00}, - {0x79,0x00}, - {0x7b,0x40}, - {0x7c,0x00}, - {0xff, 0xff}, - -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {0x41,0x2f}, // danse - {0x40,0x7e}, - {0x42,0x10}, - {0x47,0x3c}, - {0x48,0xc3}, - {0x8a,0x60}, - {0x8b,0x60}, - {0x8c,0x07}, - {0x50,0x0c}, - {0x77,0x80}, - {0xa1,0x40}, - {0x7a,0x00}, - {0x78,0x00}, - {0x79,0x00}, - {0x7b,0x40}, - {0x7c,0x00}, - {0xff,0xff}, -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x41,0x2f}, - {0x40,0x7e}, - {0x42,0x10}, - {0x47,0x3c}, - {0x48,0xc3}, - {0x8a,0x60}, - {0x8b,0x60}, - {0x8c,0x07}, - {0x50,0x0c}, - {0x77,0x80}, - {0xa1,0x40}, - {0x7a,0x00}, - {0x78,0xc0}, - {0x79,0x20}, - {0x7b,0x40}, - {0x7c,0x00}, - {0xff,0xff}, - - - -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - //Negative - {0x41,0x6f}, // 4 - {0x40,0x7e}, - {0x42,0x10}, - {0x47,0x20}, - {0x48,0xc3}, - {0x8a,0x60}, - {0x8b,0x60}, - {0x8c,0x07}, - {0x50,0x0c}, - {0x77,0x80}, - {0xa1,0x40}, - {0x7a,0x00}, - {0x78,0x00}, - {0x79,0x00}, - {0x7b,0x40}, - {0x7c,0x00}, - {0xff, 0xff}, - -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - // Bluish - {0x41,0x2f}, // 5 - {0x40,0x7e}, - {0x42,0x10}, - {0x47,0x2c}, - {0x48,0xc3}, - {0x8a,0x60}, - {0x8b,0x60}, - {0x8c,0x07}, - {0x50,0x0c}, - {0x77,0x80}, - {0xa1,0x40}, - {0x7a,0x00}, - {0x78,0x70}, - {0x79,0x00}, - {0x7b,0x3f}, - {0x7c,0xf5}, - {0xff, 0xff}, - -}; - -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish 6 - {0x41,0x2f}, - {0x40,0x7e}, - {0x42,0x10}, - {0x47,0x3c}, - {0x48,0xc3}, - {0x8a,0x60}, - {0x8b,0x60}, - {0x8c,0x07}, - {0x50,0x0c}, - {0x77,0x80}, - {0xa1,0x40}, - {0x7a,0x00}, - {0x78,0xc0}, - {0x79,0xc0}, - {0x7b,0x40}, - {0x7c,0x00}, - {0xff,0xff}, - -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - {0xd1, 0x38}, - {0xff, 0xff}, -}; - -static struct reginfo sensor_Exposure1[]= -{ - {0xd1, 0x40}, - {0xff, 0xff}, -}; - -static struct reginfo sensor_Exposure2[]= -{ - {0xd1, 0x48}, - {0xff, 0xff}, -}; - -static struct reginfo sensor_Exposure3[]= -{ - {0xd1, 0x50}, - {0xff, 0xff}, -}; - -static struct reginfo sensor_Exposure4[]= -{ - {0xd1, 0x58}, - {0xff, 0xff}, -}; - -static struct reginfo sensor_Exposure5[]= -{ - {0xd1, 0x60}, - {0xff, 0xff}, -}; - -static struct reginfo sensor_Exposure6[]= -{ - {0xd1, 0x68}, - {0xff, 0xff}, -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {0xff, 0xff}, -}; - -static struct reginfo sensor_Saturation1[]= -{ - {0xff, 0xff}, -}; - -static struct reginfo sensor_Saturation2[]= -{ - {0xff, 0xff}, -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - {0xff, 0xff}, -}; - -static struct reginfo sensor_Contrast1[]= -{ - {0xff, 0xff}, -}; - -static struct reginfo sensor_Contrast2[]= -{ - {0xff, 0xff}, -}; - -static struct reginfo sensor_Contrast3[]= -{ - {0xff, 0xff}, -}; - -static struct reginfo sensor_Contrast4[]= -{ - {0xff, 0xff}, -}; - - -static struct reginfo sensor_Contrast5[]= -{ - {0xff, 0xff}, -}; - -static struct reginfo sensor_Contrast6[]= -{ - {0xff, 0xff}, -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {0xff, 0xff}, -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {0xff, 0xff}, -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {0xff, 0xff}, -}; - -static struct reginfo sensor_FlipOff[]= -{ - {0xff, 0xff}, -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ - { 0xdd ,0x22}, //0x12 - { 0x41 ,0x2f}, - { 0x21 ,0xc0}, - { 0xd2 ,0x02}, - {0xff, 0xff}, -}; - -static struct reginfo sensor_SceneNight[] = -{ - { 0xdd ,0x32}, - { 0x41 ,0x0f}, - { 0xb0 ,0x10}, - { 0x21 ,0xf0}, - - {0xff, 0xff}, -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {0xff, 0xff}, - -}; - -static struct reginfo sensor_Zoom1[] = -{ - {0xff, 0xff}, - -}; - -static struct reginfo sensor_Zoom2[] = -{ - {0xff, 0xff}, - -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {0xff, 0xff}, - -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif -static const struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG} -}; -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - unsigned int winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int funmodule_state; -} sensor_info_priv_t; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - -static int sensor_read(struct i2c_client *client, u8 reg, u8 *val); - -/* sensor register write */ -static int sensor_write_internal(struct i2c_client *client, u8 reg, u8 val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[1]; - - buf[0] = reg & 0xFF; - buf[1] = val; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - - return err; -} - -static int sensor_write(struct i2c_client *client, u8 reg, u8 val) -{ -#if 1 - int ret, cnt; - for(cnt=0; cnt<1; cnt++) - { - mdelay(1); - ret=sensor_write_internal(client, reg, val); - } - return ret; -#else - u8 val_tmp; - - do - { - printk("sensor_write() : reg %02x 0x%02x\n", reg, val); - sensor_write_internal(client, reg, val); - mdelay(1); - sensor_read(client, reg, &val_tmp); - if(val_tmp != val) - { - printk("sensor_write() error: reg %02x 0x%02x != 0x%02x \n", reg, val, val_tmp); - } - mdelay(1); - } - while(val_tmp != val); - return 0; -#endif -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) -{ - int err,cnt; - //u8 buf[2]; - u8 buf[1]; - struct i2c_msg msg[2]; - - //buf[0] = reg >> 8; - buf[0] = reg; -// buf[1] = reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 1; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -#if 1 -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err; - int i = 0; - - for(i=0; regarray[i].reg!=0xff;i++) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err != 0) - { - SENSOR_TR("%s..write failed current i = %d\n", SENSOR_NAME_STRING(),i); - return err; - } - } - return 0; -} -#else -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err; - int i = 0; - u8 val_read; - while (regarray[i].reg != 0) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err != 0) - { - SENSOR_TR("%s..write failed current i = %d\n", SENSOR_NAME_STRING(),i); - return err; - } - err = sensor_read(client, regarray[i].reg, &val_read); - SENSOR_TR("%s..reg[0x%x]=0x%x,0x%x\n", SENSOR_NAME_STRING(),regarray[i].reg, val_read, regarray[i].val); - i++; - } - return 0; -} -#endif - - -static int sensor_check_array(struct i2c_client *client, struct reginfo *regarray) -{ - int ret; - int i = 0; - - u8 value; - - SENSOR_DG("%s >>>>>>>>>>>>>>>>>>>>>>\n",__FUNCTION__); - for(i=0;ipowerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_power_end: - return ret; -} - -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd);; - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - int ret; - - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - /* ret = sensor_write(client, 0x12, 0x80); - if (ret != 0) - { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); */ //delay 5 microseconds - - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } -#if 0 -{ - int i; - u8 val; - printk("****************** check init data\n"); - for(i=0; sensor_init_data[i].reg!=0xff; i++) - { - sensor_read(client, sensor_init_data[i].reg, &val); - printk("reg 0x%02x: org=0x%02x, val=0x%02x, %s\n", - sensor_init_data[i].reg, - sensor_init_data[i].val, - val, - sensor_init_data[i].val==val?"O":"X"); - } - printk("**********************************\n"); - -} -#endif - sensor_task_lock(client,0); - //icd->user_width = SENSOR_INIT_WIDTH; - //icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.winseqe_cur_addr = (int)SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} - -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - //u8 reg_val; - struct sensor *sensor = to_sensor(client); - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - if (sensor->info_priv.funmodule_state & SENSOR_INIT_IS_OK) { - sensor_task_lock(client, 1); - sensor_task_lock(client, 0); - } - sensor_ioctrl(icd, Sensor_PowerDown, 1); - msleep(100); - - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - - return 0; -} -static struct reginfo sensor_power_down_sequence[]= -{ - {0xff, 0xff}, -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - - return 0; - -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - int ret=0, set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg!=0xff) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg!=0xff) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg!=0xff) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg!=0xff) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg!=0xff) - { - winseqe_set_addr = sensor_svga; - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 720)) && sensor_720p[0].reg!=0xff) - { - winseqe_set_addr = sensor_720p; - set_w = 1280; - set_h = 720; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg!=0xff) - { - winseqe_set_addr = sensor_sxga; - set_w = 1280; - set_h = 1024; - } - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) { - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - } else { /* ddl@rock-chips.com : Video */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - } - #endif - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - - sensor->info_priv.winseqe_cur_addr = (int)winseqe_set_addr; - - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - if (sensor->info_priv.whiteBalance != 0) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - sensor->info_priv.snap2preview = true; - } else if (sensor_fmt_videochk(sd,mf) == true) { /* ddl@rock-chips.com : Video */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - sensor->info_priv.video2preview = true; - } else if ((sensor->info_priv.snap2preview == true) || (sensor->info_priv.video2preview == true)) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - sensor->info_priv.video2preview = false; - sensor->info_priv.snap2preview = false; - } - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; - -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg!=0xff) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg!=0xff) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg!=0xff) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg!=0xff) - { - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg!=0xff) - { - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 720)) && sensor_720p[0].reg!=0xff) - { - set_w = 1280; - set_h = 720; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg!=0xff) - { - set_w = 1280; - set_h = 1024; - } - else - { - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - - mf->width = set_w; - mf->height = set_h; - mf->colorspace = fmt->colorspace; - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd);; - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV9650 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_mirror(struct i2c_client *client, int on) -{ - int err = 0; - return err; -} -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_mirror(client,value) != 0) - SENSOR_TR("%s(%d): sensor_mirror failed, value:0x%x",__FUNCTION__, __LINE__,value); - - SENSOR_DG("%s(%d): sensor_mirror success, value:0x%x",__FUNCTION__, __LINE__,value); - return 0; - } - SENSOR_TR("\n %s..%s value = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_flip(struct i2c_client *client, int on) -{ - int err = 0; - return err; -} -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_flip(client,value) != 0) - SENSOR_TR("%s(%d): sensor_flip failed, value:0x%x",__FUNCTION__, __LINE__,value); - - SENSOR_DG("%s(%d): sensor_flip success, value:0x%x",__FUNCTION__, __LINE__,value); - return 0; - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((*value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value > 0) && ((digitalzoom_cur + *value) > digitalzoom_total)) - { - *value = digitalzoom_total - digitalzoom_cur; - } - - if ((*value < 0) && ((digitalzoom_cur + *value) < 0)) - { - *value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += *value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, *value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd);; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd);; - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd);; - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd);; - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char pid = 0; - int ret, i=0; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - printk("%s(): set powerdn failed\n", __FUNCTION__); - goto sensor_video_probe_err; - } - - /* soft reset */ - /* ret = sensor_write(client, 0x12, 0x80); - if (ret != 0) - { - SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); - return -ENODEV; - } - mdelay(50); *///delay 5 microseconds -re: - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x00, &pid); - if (ret != 0) { - SENSOR_TR("%s read chip id high byte failed\n",SENSOR_NAME_STRING()); - if(++i<100) - goto re; - ret = -ENODEV; - goto sensor_video_probe_err; - } - - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - goto re; - ret = -ENODEV; - goto sensor_video_probe_err; - } - - - return 0; - -sensor_video_probe_err: - - return ret; -} - -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd);; - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0; -#if CONFIG_SENSOR_Flash - int i; -#endif - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - sensor->sensor_gpio_res = NULL; - for (i=0; isensor_io_request->gpio_res[i].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[i].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[i]; - } - } - if (sensor->sensor_gpio_res == NULL) { - SENSOR_TR("%s %s obtain gpio resource failed when RK29_CAM_SUBDEV_IOREQUEST \n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - sensor->info_priv.fmt = sensor_colour_fmts[0]; - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - - diff --git a/drivers/media/video/gc0308.c b/drivers/media/video/gc0308.c deleted file mode 100644 index 339bc3d042b6..000000000000 --- a/drivers/media/video/gc0308.c +++ /dev/null @@ -1,1183 +0,0 @@ -/* - * drivers/media/video/gc0308.c - * - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "generic_sensor.h" -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.0.3: -* add sensor_focus_af_const_pause_usr_cb; -*/ -static int version = KERNEL_VERSION(0,0,3); -module_param(version, int, S_IRUGO); - - - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_GC0308 -#define SENSOR_V4L2_IDENT V4L2_IDENT_GC0308 -#define SENSOR_ID 0x9b -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_PCLK_SAMPLE_RISING|V4L2_MBUS_HSYNC_ACTIVE_HIGH| V4L2_MBUS_VSYNC_ACTIVE_LOW|\ - V4L2_MBUS_DATA_ACTIVE_HIGH |SOCAM_MCLK_24MHZ) -#define SENSOR_PREVIEW_W 640 -#define SENSOR_PREVIEW_H 480 -#define SENSOR_PREVIEW_FPS 15000 // 15fps -#define SENSOR_FULLRES_L_FPS 7500 // 7.5fps -#define SENSOR_FULLRES_H_FPS 7500 // 7.5fps -#define SENSOR_720P_FPS 0 -#define SENSOR_1080P_FPS 0 - -#define SENSOR_REGISTER_LEN 1 // sensor register address bytes -#define SENSOR_VALUE_LEN 1 // sensor register value bytes - -static unsigned int SensorConfiguration = (CFG_WhiteBalance|CFG_Effect|CFG_Scene); -static unsigned int SensorChipID[] = {SENSOR_ID}; -/* Sensor Driver Configuration End */ - - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a,b) CONS4(SensorReg,SENSOR_REGISTER_LEN,Val,SENSOR_VALUE_LEN)(a,b) -#define sensor_write(client,reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_read(client,reg,v) CONS4(sensor_read_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_write_array generic_sensor_write_array - -struct sensor_parameter -{ - unsigned int PreviewDummyPixels; - unsigned int CaptureDummyPixels; - unsigned int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int PreviewPclk; - unsigned short int CapturePclk; - char awb[6]; -}; - -struct specific_sensor{ - struct generic_sensor common_sensor; - //define user data below - struct sensor_parameter parameter; - -}; - -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ - -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_init_data[] ={ - {0xfe , 0x80}, - - {0xfe , 0x00}, // set page0 - - {0xd2 , 0x10}, // close AEC - {0x22 , 0x55}, // close AWB - - {0x03 , 0x01}, - {0x04 , 0x2c}, - {0x5a , 0x56}, - {0x5b , 0x40}, - {0x5c , 0x4a}, - - {0x22 , 0x57}, // Open AWB - - {0x01 , 0xfa}, - {0x02 , 0x70}, - {0x0f , 0x01}, - - - {0xe2 , 0x00}, //anti-flicker step [11:8] - {0xe3 , 0x64}, //anti-flicker step [7:0] - - {0xe4 , 0x02}, //exp level 1 16.67fps - {0xe5 , 0x58}, - {0xe6 , 0x03}, //exp level 2 12.5fps - {0xe7 , 0x20}, - {0xe8 , 0x04}, //exp level 3 8.33fps - {0xe9 , 0xb0}, - {0xea , 0x09}, //exp level 4 4.00fps - {0xeb , 0xc4}, - - //{0xec , 0x20}, - - {0x05 , 0x00}, - {0x06 , 0x00}, - {0x07 , 0x00}, - {0x08 , 0x00}, - {0x09 , 0x01}, - {0x0a , 0xe8}, - {0x0b , 0x02}, - {0x0c , 0x88}, - {0x0d , 0x02}, - {0x0e , 0x02}, - {0x10 , 0x22}, - {0x11 , 0xfd}, - {0x12 , 0x2a}, - {0x13 , 0x00}, - {0x14 , 0x10}, //0x10 - //-------------H_V_Switch(4)---------------// - /* 1: // normal - {0x14 , 0x10}, - 2: // IMAGE_H_MIRROR - {0x14 , 0x11}, - - 3: // IMAGE_V_MIRROR - {0x14 , 0x12}, - - 4: // IMAGE_HV_MIRROR - {0x14 , 0x13},*/ - {0x15 , 0x0a}, - {0x16 , 0x05}, - {0x17 , 0x01}, - {0x18 , 0x44}, - {0x19 , 0x44}, - {0x1a , 0x1e}, - {0x1b , 0x00}, - {0x1c , 0xc1}, - {0x1d , 0x08}, - {0x1e , 0x60}, - {0x1f , 0x17}, - - - {0x20 , 0xff}, - {0x21 , 0xf8}, - {0x22 , 0x57}, - {0x24 , 0xa2}, - {0x25 , 0x0f}, - - //output sync_mode - {0x26 , 0x02}, //0x03 20101016 zhj - {0x2f , 0x01}, - {0x30 , 0xf7}, - {0x31 , 0x50}, - {0x32 , 0x00}, - {0x39 , 0x04}, - {0x3a , 0x18}, - {0x3b , 0x20}, - {0x3c , 0x00}, - {0x3d , 0x00}, - {0x3e , 0x00}, - {0x3f , 0x00}, - {0x50 , 0x10}, - {0x53 , 0x82}, - {0x54 , 0x80}, - {0x55 , 0x80}, - {0x56 , 0x82}, - {0x8b , 0x40}, - {0x8c , 0x40}, - {0x8d , 0x40}, - {0x8e , 0x2e}, - {0x8f , 0x2e}, - {0x90 , 0x2e}, - {0x91 , 0x3c}, - {0x92 , 0x50}, - {0x5d , 0x12}, - {0x5e , 0x1a}, - {0x5f , 0x24}, - {0x60 , 0x07}, - {0x61 , 0x15}, - {0x62 , 0x08}, - {0x64 , 0x03}, - {0x66 , 0xe8}, - {0x67 , 0x86}, - {0x68 , 0xa2}, - {0x69 , 0x18}, - {0x6a , 0x0f}, - {0x6b , 0x00}, - {0x6c , 0x5f}, - {0x6d , 0x8f}, - {0x6e , 0x55}, - {0x6f , 0x38}, - {0x70 , 0x15}, - {0x71 , 0x33}, - {0x72 , 0xdc}, - {0x73 , 0x80}, - {0x74 , 0x02}, - {0x75 , 0x3f}, - {0x76 , 0x02}, - {0x77 , 0x36}, - {0x78 , 0x88}, - {0x79 , 0x81}, - {0x7a , 0x81}, - {0x7b , 0x22}, - {0x7c , 0xff}, - {0x93 , 0x48}, - {0x94 , 0x00}, - {0x95 , 0x05}, - {0x96 , 0xe8}, - {0x97 , 0x40}, - {0x98 , 0xf0}, - {0xb1 , 0x38}, - {0xb2 , 0x38}, - {0xbd , 0x38}, - {0xbe , 0x36}, - {0xd0 , 0xc9}, - {0xd1 , 0x10}, - //{0xd2 , 0x90}, - {0xd3 , 0x80}, - {0xd5 , 0xf2}, - {0xd6 , 0x16}, - {0xdb , 0x92}, - {0xdc , 0xa5}, - {0xdf , 0x23}, - {0xd9 , 0x00}, - {0xda , 0x00}, - {0xe0 , 0x09}, - - {0xed , 0x04}, - {0xee , 0xa0}, - {0xef , 0x40}, - {0x80 , 0x03}, - {0x80 , 0x03}, - {0x9F , 0x10}, - {0xA0 , 0x20}, - {0xA1 , 0x38}, - {0xA2 , 0x4E}, - {0xA3 , 0x63}, - {0xA4 , 0x76}, - {0xA5 , 0x87}, - {0xA6 , 0xA2}, - {0xA7 , 0xB8}, - {0xA8 , 0xCA}, - {0xA9 , 0xD8}, - {0xAA , 0xE3}, - {0xAB , 0xEB}, - {0xAC , 0xF0}, - {0xAD , 0xF8}, - {0xAE , 0xFD}, - {0xAF , 0xFF}, - /*GC0308_GAMMA_Select, - 1: //smallest gamma curve - {0x9F , 0x0B}, - {0xA0 , 0x16}, - {0xA1 , 0x29}, - {0xA2 , 0x3C}, - {0xA3 , 0x4F}, - {0xA4 , 0x5F}, - {0xA5 , 0x6F}, - {0xA6 , 0x8A}, - {0xA7 , 0x9F}, - {0xA8 , 0xB4}, - {0xA9 , 0xC6}, - {0xAA , 0xD3}, - {0xAB , 0xDD}, - {0xAC , 0xE5}, - {0xAD , 0xF1}, - {0xAE , 0xFA}, - {0xAF , 0xFF}, - - 2: - {0x9F , 0x0E}, - {0xA0 , 0x1C}, - {0xA1 , 0x34}, - {0xA2 , 0x48}, - {0xA3 , 0x5A}, - {0xA4 , 0x6B}, - {0xA5 , 0x7B}, - {0xA6 , 0x95}, - {0xA7 , 0xAB}, - {0xA8 , 0xBF}, - {0xA9 , 0xCE}, - {0xAA , 0xD9}, - {0xAB , 0xE4}, - {0xAC , 0xEC}, - {0xAD , 0xF7}, - {0xAE , 0xFD}, - {0xAF , 0xFF}, - - 3: - {0x9F , 0x10}, - {0xA0 , 0x20}, - {0xA1 , 0x38}, - {0xA2 , 0x4E}, - {0xA3 , 0x63}, - {0xA4 , 0x76}, - {0xA5 , 0x87}, - {0xA6 , 0xA2}, - {0xA7 , 0xB8}, - {0xA8 , 0xCA}, - {0xA9 , 0xD8}, - {0xAA , 0xE3}, - {0xAB , 0xEB}, - {0xAC , 0xF0}, - {0xAD , 0xF8}, - {0xAE , 0xFD}, - {0xAF , 0xFF}, - - 4: - {0x9F , 0x14}, - {0xA0 , 0x28}, - {0xA1 , 0x44}, - {0xA2 , 0x5D}, - {0xA3 , 0x72}, - {0xA4 , 0x86}, - {0xA5 , 0x95}, - {0xA6 , 0xB1}, - {0xA7 , 0xC6}, - {0xA8 , 0xD5}, - {0xA9 , 0xE1}, - {0xAA , 0xEA}, - {0xAB , 0xF1}, - {0xAC , 0xF5}, - {0xAD , 0xFB}, - {0xAE , 0xFE}, - {0xAF , 0xFF}, - - 5: //largest gamma curve - {0x9F , 0x15}, - {0xA0 , 0x2A}, - {0xA1 , 0x4A}, - {0xA2 , 0x67}, - {0xA3 , 0x79}, - {0xA4 , 0x8C}, - {0xA5 , 0x9A}, - {0xA6 , 0xB3}, - {0xA7 , 0xC5}, - {0xA8 , 0xD5}, - {0xA9 , 0xDF}, - {0xAA , 0xE8}, - {0xAB , 0xEE}, - {0xAC , 0xF3}, - {0xAD , 0xFA}, - {0xAE , 0xFD}, - {0xAF , 0xFF}, */ - //-----------GAMMA Select End--------------// - - {0xc0 , 0x00}, - {0xc1 , 0x10}, - {0xc2 , 0x1C}, - {0xc3 , 0x30}, - {0xc4 , 0x43}, - {0xc5 , 0x54}, - {0xc6 , 0x65}, - {0xc7 , 0x75}, - {0xc8 , 0x93}, - {0xc9 , 0xB0}, - {0xca , 0xCB}, - {0xcb , 0xE6}, - {0xcc , 0xFF}, - {0xf0 , 0x02}, - {0xf1 , 0x01}, - {0xf2 , 0x01}, - {0xf3 , 0x30}, - {0xf9 , 0x9f}, - {0xfa , 0x78}, - - //--------------------------------------------------------------- - {0xfe , 0x01},// set page1 - - {0x00 , 0xf5}, - {0x02 , 0x1a}, - {0x0a , 0xa0}, - {0x0b , 0x60}, - {0x0c , 0x08}, - {0x0e , 0x4c}, - {0x0f , 0x39}, - {0x11 , 0x3f}, - {0x12 , 0x72}, - {0x13 , 0x13}, - {0x14 , 0x42}, - {0x15 , 0x43}, - {0x16 , 0xc2}, - {0x17 , 0xa8}, - {0x18 , 0x18}, - {0x19 , 0x40}, - {0x1a , 0xd0}, - {0x1b , 0xf5}, - {0x70 , 0x40}, - {0x71 , 0x58}, - {0x72 , 0x30}, - {0x73 , 0x48}, - {0x74 , 0x20}, - {0x75 , 0x60}, - {0x77 , 0x20}, - {0x78 , 0x32}, - {0x30 , 0x03}, - {0x31 , 0x40}, - {0x32 , 0xe0}, - {0x33 , 0xe0}, - {0x34 , 0xe0}, - {0x35 , 0xb0}, - {0x36 , 0xc0}, - {0x37 , 0xc0}, - {0x38 , 0x04}, - {0x39 , 0x09}, - {0x3a , 0x12}, - {0x3b , 0x1C}, - {0x3c , 0x28}, - {0x3d , 0x31}, - {0x3e , 0x44}, - {0x3f , 0x57}, - {0x40 , 0x6C}, - {0x41 , 0x81}, - {0x42 , 0x94}, - {0x43 , 0xA7}, - {0x44 , 0xB8}, - {0x45 , 0xD6}, - {0x46 , 0xEE}, - {0x47 , 0x0d}, - {0xfe , 0x00}, // set page0 - - //-----------Update the registers 2010/07/06-------------// - //Registers of Page0 - {0xfe , 0x00}, // set page0 - {0x10 , 0x26}, - {0x11 , 0x0d}, // fd,modified by mormo 2010/07/06 - {0x1a , 0x2a}, // 1e,modified by mormo 2010/07/06 - - {0x1c , 0x49}, // c1,modified by mormo 2010/07/06 - {0x1d , 0x9a}, // 08,modified by mormo 2010/07/06 - {0x1e , 0x61}, // 60,modified by mormo 2010/07/06 - - {0x3a , 0x20}, - - {0x50 , 0x14}, // 10,modified by mormo 2010/07/06 - {0x53 , 0x80}, - {0x56 , 0x80}, - - {0x8b , 0x20}, //LSC - {0x8c , 0x20}, - {0x8d , 0x20}, - {0x8e , 0x14}, - {0x8f , 0x10}, - {0x90 , 0x14}, - - {0x94 , 0x02}, - {0x95 , 0x07}, - {0x96 , 0xe0}, - - {0xb1 , 0x40}, // YCPT - {0xb2 , 0x40}, - {0xb3 , 0x40}, - {0xb6 , 0xe0}, - - {0xd0 , 0xcb}, // AECT c9,modifed by mormo 2010/07/06 - {0xd3 , 0x48}, // 80,modified by mormor 2010/07/06 - - {0xf2 , 0x02}, - {0xf7 , 0x12}, - {0xf8 , 0x0a}, - - //Registers of Page1 - {0xfe , 0x01},// set page1 - {0x02 , 0x20}, - {0x04 , 0x10}, - {0x05 , 0x08}, - {0x06 , 0x20}, - {0x08 , 0x0a}, - - {0x0e , 0x44}, - {0x0f , 0x32}, - {0x10 , 0x41}, - {0x11 , 0x37}, - {0x12 , 0x22}, - {0x13 , 0x19}, - {0x14 , 0x44}, - {0x15 , 0x44}, - - {0x19 , 0x50}, - {0x1a , 0xd8}, - - {0x32 , 0x10}, - - {0x35 , 0x00}, - {0x36 , 0x80}, - {0x37 , 0x00}, - //-----------Update the registers end---------// - - - {0xfe , 0x00}, // set page0 - {0xd2 , 0x90}, - SensorEnd -}; -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={ - SensorEnd - -}; - -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] ={ - SensorEnd -}; -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data[] = -{ - - SensorEnd -}; -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[]={ - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[]={ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_softreset_data[]={ - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[]={ - SensorRegVal(0x00,0), - SensorEnd -}; -/* -* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx -*/ -static struct rk_sensor_reg sensor_WhiteB_Auto[]= -{ - {0x5a, 0x4c}, - {0x5b, 0x40}, - {0x5c, 0x4a}, - {0x22, 0x57}, - SensorEnd -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[]= -{ - {0x22, 0x55}, // Disable AWB - {0x5a, 0x5a}, - {0x5b, 0x42}, - {0x5c, 0x40}, - SensorEnd -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x22, 0x55}, // Disable AWB - {0x5a, 0x50}, - {0x5b, 0x45}, - {0x5c, 0x40}, - SensorEnd -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0x22, 0x55}, // Disable AWB - {0x5a, 0x48}, - {0x5b, 0x40}, - {0x5c, 0x5c}, - SensorEnd - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x22, 0x55}, // Disable AWB - {0x5a, 0x40}, - {0x5b, 0x42}, - {0x5c, 0x50}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[]= -{ - // Brightness -2 - {0xb5, 0xe0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[]= -{ - // Brightness -1 - {0xb5, 0xf0}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[]= -{ - // Brightness 0 - {0xb5, 0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[]= -{ - // Brightness +1 - {0xb5, 0x20}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[]= -{ - // Brightness +2 - {0xb5, 0x30}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[]= -{ - // Brightness +3 - {0xb5, 0x40}, - - SensorEnd -}; -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = -{ - {0x23,0x00}, - {0x2d,0x0a}, - {0x20,0x7f}, - {0xd2,0x90}, - {0x73,0x00}, - {0x77,0x38}, - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x00}, - {0xbb,0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = -{ - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0x7f}, - {0xd2,0x90}, - {0x73,0x00}, - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x00}, - {0xbb,0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = -{ - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0x7f}, - {0xd2,0x90}, - {0x73,0x00}, - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0xd2}, - {0xbb,0x28}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Negative[] = -{ - //Negative - {0x23,0x01}, - {0x2d,0x0a}, - {0x20,0x7f}, - {0xd2,0x90}, - {0x73,0x00}, - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x00}, - {0xbb,0x00}, - SensorEnd -}; -static struct rk_sensor_reg sensor_Effect_Bluish[] = -{ - // Bluish - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0x7f}, - {0xd2,0x90}, - {0x73,0x00}, - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x50}, - {0xbb,0xe0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = -{ - // Greenish - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0x7f}, - {0xd2,0x90}, - {0x77,0x88}, - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0xc0}, - {0xbb,0xc0}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; - -static struct rk_sensor_reg sensor_Exposure0[]= -{ - {0xd3, 0x30}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure1[]= -{ - {0xd3, 0x38}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure2[]= -{ - {0xd3, 0x40}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure3[]= -{ - {0xd3, 0x48}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure4[]= -{ - {0xd3, 0x50}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure5[]= -{ - {0xd3, 0x58}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure6[]= -{ - {0xd3, 0x60}, - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; - -static struct rk_sensor_reg sensor_Saturation0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -static struct rk_sensor_reg sensor_Contrast0[]= -{ - {0xb3,0x34}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast1[]= -{ - {0xb3,0x38}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast2[]= -{ - {0xb3,0x3d}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast3[]= -{ - {0xb3,0x40}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast4[]= -{ - {0xb3,0x44}, - - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Contrast5[]= -{ - {0xb3,0x48}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast6[]= -{ - {0xb3,0x50}, - - SensorEnd -}; -static struct rk_sensor_reg *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; -static struct rk_sensor_reg sensor_SceneAuto[] = -{ - {0xec, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = -{ - {0xec, 0x30}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -static struct rk_sensor_reg sensor_Zoom0[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Zoom3[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; - -/* -* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu -*/ -static struct v4l2_querymenu sensor_menus[] = -{ -}; -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = -{ -}; - -//MUST define the current used format as the first item -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {MEDIA_BUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; -/*static struct soc_camera_ops sensor_ops;*/ - - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - - return 0; -} -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - - return 0; -} -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - - return 0; -} -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh (struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - return 0; -} -static int sensor_try_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf) -{ - return 0; -} - -static int sensor_softrest_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - return 0; -} -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("Suspend"); - - } else { - SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n",pm_msg.event); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - - SENSOR_DG("Resume"); - - return 0; - -} -static int sensor_mirror_cb (struct i2c_client *client, int mirror) -{ - char val; - int err = 0; - - SENSOR_DG("mirror: %d",mirror); - if (mirror) { - - //{0xfe , 0x00}, // set page0 - - //{0x14 , 0x13}, //0x10 - //-------------H_V_Switch(4)---------------// - /* 1: // normal - {0x14 , 0x10}, - 2: // IMAGE_H_MIRROR - {0x14 , 0x11}, - - 3: // IMAGE_V_MIRROR - {0x14 , 0x12}, - - 4: // IMAGE_HV_MIRROR - {0x14 , 0x13},*/ - sensor_write(client, 0xfe, 0); - err = sensor_read(client, 0x14, &val); - if (err == 0) { - if((val & 0x1) == 0) - err = sensor_write(client, 0x14, (val |0x1)); - else - err = sensor_write(client, 0x14, (val & 0xfe)); - } - } else { - //do nothing - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_mirror_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_mirror failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_mirror success, value:0x%x",ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - char val; - int err = 0; - - SENSOR_DG("flip: %d",flip); - if (flip) { - - //{0xfe , 0x00}, // set page0 - - //{0x14 , 0x13}, //0x10 - //-------------H_V_Switch(4)---------------// - /* 1: // normal - {0x14 , 0x10}, - 2: // IMAGE_H_MIRROR - {0x14 , 0x11}, - - 3: // IMAGE_V_MIRROR - {0x14 , 0x12}, - - 4: // IMAGE_HV_MIRROR - {0x14 , 0x13},*/ - sensor_write(client, 0xfe, 0); - err = sensor_read(client, 0x14, &val); - if (err == 0) { - if((val & 0x2) == 0) - err = sensor_write(client, 0x14, (val |0x2)); - else - err = sensor_write(client, 0x14, (val & 0xfc)); - } - } else { - //do nothing - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_flip_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_flip failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_flip success, value:0x%x",ext_ctrl->value); - return 0; -} -/* -* the functions are focus callbacks -*/ -static int sensor_focus_init_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos){ - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client){ - return 0; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos) -{ - return 0; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client,int on){ - return 0; -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor* spsensor,struct soc_camera_device *icd) -{ - return; -} - -/* -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); - - - diff --git a/drivers/media/video/gc0308_old.c b/drivers/media/video/gc0308_old.c deleted file mode 100755 index 7dc2544eacc6..000000000000 --- a/drivers/media/video/gc0308_old.c +++ /dev/null @@ -1,2957 +0,0 @@ - -/* -o* Driver for MT9M001 CMOS Image Sensor from Micron - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_GC0308 -#define SENSOR_V4L2_IDENT V4L2_IDENT_GC0308 -#define SENSOR_ID 0x9b -#define SENSOR_MIN_WIDTH 640//176 -#define SENSOR_MIN_HEIGHT 480//144 -#define SENSOR_MAX_WIDTH_REAL 640 -#define SENSOR_MAX_HEIGHT_REAL 480 -#if defined(CONFIG_SOC_CAMERA_GC0308_INTERPOLATION_5M) - #define SENSOR_MAX_WIDTH 2592 - #define SENSOR_MAX_HEIGHT 1944 -#elif defined(CONFIG_SOC_CAMERA_GC0308_INTERPOLATION_3M) - #define SENSOR_MAX_WIDTH 2048 - #define SENSOR_MAX_HEIGHT 1536 -#elif defined(CONFIG_SOC_CAMERA_GC0308_INTERPOLATION_2M) - #define SENSOR_MAX_WIDTH 1600 - #define SENSOR_MAX_HEIGHT 1200 -#else - #define SENSOR_MAX_WIDTH SENSOR_MAX_WIDTH_REAL - #define SENSOR_MAX_HEIGHT SENSOR_MAX_HEIGHT_REAL -#endif -#define SENSOR_INIT_WIDTH 640 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 480 -#define SENSOR_INIT_WINSEQADR sensor_vga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_YUYV8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 1 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 1 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 - -#define CONFIG_SENSOR_I2C_SPEED 250000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) - -struct reginfo -{ - u8 reg; - u8 val; -}; - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); - -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_GC0308_USER_DEFINED_SERIES -#include "gc0308_user_series.c" -#else -/* init 640X480 VGA */ -static struct reginfo sensor_init_data[] = -{ - - {0xfe , 0x80}, - - {0xfe , 0x00}, // set page0 - - {0xd2 , 0x10}, // close AEC - {0x22 , 0x55}, // close AWB - - {0x03 , 0x01}, - {0x04 , 0x2c}, - {0x5a , 0x56}, - {0x5b , 0x40}, - {0x5c , 0x4a}, - - {0x22 , 0x57}, // Open AWB - - {0x01 , 0xfa}, - {0x02 , 0x70}, - {0x0f , 0x01}, - - - {0xe2 , 0x00}, //anti-flicker step [11:8] - {0xe3 , 0x64}, //anti-flicker step [7:0] - - {0xe4 , 0x02}, //exp level 1 16.67fps - {0xe5 , 0x58}, - {0xe6 , 0x03}, //exp level 2 12.5fps - {0xe7 , 0x20}, - {0xe8 , 0x04}, //exp level 3 8.33fps - {0xe9 , 0xb0}, - {0xea , 0x09}, //exp level 4 4.00fps - {0xeb , 0xc4}, - - //{0xec , 0x20}, - - {0x05 , 0x00}, - {0x06 , 0x00}, - {0x07 , 0x00}, - {0x08 , 0x00}, - {0x09 , 0x01}, - {0x0a , 0xe8}, - {0x0b , 0x02}, - {0x0c , 0x88}, - {0x0d , 0x02}, - {0x0e , 0x02}, - {0x10 , 0x22}, - {0x11 , 0xfd}, - {0x12 , 0x2a}, - {0x13 , 0x00}, - //{0x14 , 0x10}, - {0x15 , 0x0a}, - {0x16 , 0x05}, - {0x17 , 0x01}, - {0x18 , 0x44}, - {0x19 , 0x44}, - {0x1a , 0x1e}, - {0x1b , 0x00}, - {0x1c , 0xc1}, - {0x1d , 0x08}, - {0x1e , 0x60}, - {0x1f , 0x17}, - - - {0x20 , 0xff}, - {0x21 , 0xf8}, - {0x22 , 0x57}, - {0x24 , 0xa2}, - {0x25 , 0x0f}, - - //output sync_mode - {0x26 , 0x02}, //0x03 20101016 zhj - {0x2f , 0x01}, - {0x30 , 0xf7}, - {0x31 , 0x50}, - {0x32 , 0x00}, - {0x39 , 0x04}, - {0x3a , 0x18}, - {0x3b , 0x20}, - {0x3c , 0x00}, - {0x3d , 0x00}, - {0x3e , 0x00}, - {0x3f , 0x00}, - {0x50 , 0x10}, - {0x53 , 0x82}, - {0x54 , 0x80}, - {0x55 , 0x80}, - {0x56 , 0x82}, - {0x8b , 0x40}, - {0x8c , 0x40}, - {0x8d , 0x40}, - {0x8e , 0x2e}, - {0x8f , 0x2e}, - {0x90 , 0x2e}, - {0x91 , 0x3c}, - {0x92 , 0x50}, - {0x5d , 0x12}, - {0x5e , 0x1a}, - {0x5f , 0x24}, - {0x60 , 0x07}, - {0x61 , 0x15}, - {0x62 , 0x08}, - {0x64 , 0x03}, - {0x66 , 0xe8}, - {0x67 , 0x86}, - {0x68 , 0xa2}, - {0x69 , 0x18}, - {0x6a , 0x0f}, - {0x6b , 0x00}, - {0x6c , 0x5f}, - {0x6d , 0x8f}, - {0x6e , 0x55}, - {0x6f , 0x38}, - {0x70 , 0x15}, - {0x71 , 0x33}, - {0x72 , 0xdc}, - {0x73 , 0x80}, - {0x74 , 0x02}, - {0x75 , 0x3f}, - {0x76 , 0x02}, - {0x77 , 0x36}, - {0x78 , 0x88}, - {0x79 , 0x81}, - {0x7a , 0x81}, - {0x7b , 0x22}, - {0x7c , 0xff}, - {0x93 , 0x48}, - {0x94 , 0x00}, - {0x95 , 0x05}, - {0x96 , 0xe8}, - {0x97 , 0x40}, - {0x98 , 0xf0}, - {0xb1 , 0x38}, - {0xb2 , 0x38}, - {0xbd , 0x38}, - {0xbe , 0x36}, - {0xd0 , 0xc9}, - {0xd1 , 0x10}, - //{0xd2 , 0x90}, - {0xd3 , 0x80}, - {0xd5 , 0xf2}, - {0xd6 , 0x16}, - {0xdb , 0x92}, - {0xdc , 0xa5}, - {0xdf , 0x23}, - {0xd9 , 0x00}, - {0xda , 0x00}, - {0xe0 , 0x09}, - - {0xed , 0x04}, - {0xee , 0xa0}, - {0xef , 0x40}, - {0x80 , 0x03}, - {0x80 , 0x03}, - {0x9F , 0x10}, - {0xA0 , 0x20}, - {0xA1 , 0x38}, - {0xA2 , 0x4E}, - {0xA3 , 0x63}, - {0xA4 , 0x76}, - {0xA5 , 0x87}, - {0xA6 , 0xA2}, - {0xA7 , 0xB8}, - {0xA8 , 0xCA}, - {0xA9 , 0xD8}, - {0xAA , 0xE3}, - {0xAB , 0xEB}, - {0xAC , 0xF0}, - {0xAD , 0xF8}, - {0xAE , 0xFD}, - {0xAF , 0xFF}, - {0xc0 , 0x00}, - {0xc1 , 0x10}, - {0xc2 , 0x1C}, - {0xc3 , 0x30}, - {0xc4 , 0x43}, - {0xc5 , 0x54}, - {0xc6 , 0x65}, - {0xc7 , 0x75}, - {0xc8 , 0x93}, - {0xc9 , 0xB0}, - {0xca , 0xCB}, - {0xcb , 0xE6}, - {0xcc , 0xFF}, - {0xf0 , 0x02}, - {0xf1 , 0x01}, - {0xf2 , 0x01}, - {0xf3 , 0x30}, - {0xf9 , 0x9f}, - {0xfa , 0x78}, - - //--------------------------------------------------------------- - {0xfe , 0x01},// set page1 - - {0x00 , 0xf5}, - {0x02 , 0x1a}, - {0x0a , 0xa0}, - {0x0b , 0x60}, - {0x0c , 0x08}, - {0x0e , 0x4c}, - {0x0f , 0x39}, - {0x11 , 0x3f}, - {0x12 , 0x72}, - {0x13 , 0x13}, - {0x14 , 0x42}, - {0x15 , 0x43}, - {0x16 , 0xc2}, - {0x17 , 0xa8}, - {0x18 , 0x18}, - {0x19 , 0x40}, - {0x1a , 0xd0}, - {0x1b , 0xf5}, - {0x70 , 0x40}, - {0x71 , 0x58}, - {0x72 , 0x30}, - {0x73 , 0x48}, - {0x74 , 0x20}, - {0x75 , 0x60}, - {0x77 , 0x20}, - {0x78 , 0x32}, - {0x30 , 0x03}, - {0x31 , 0x40}, - {0x32 , 0xe0}, - {0x33 , 0xe0}, - {0x34 , 0xe0}, - {0x35 , 0xb0}, - {0x36 , 0xc0}, - {0x37 , 0xc0}, - {0x38 , 0x04}, - {0x39 , 0x09}, - {0x3a , 0x12}, - {0x3b , 0x1C}, - {0x3c , 0x28}, - {0x3d , 0x31}, - {0x3e , 0x44}, - {0x3f , 0x57}, - {0x40 , 0x6C}, - {0x41 , 0x81}, - {0x42 , 0x94}, - {0x43 , 0xA7}, - {0x44 , 0xB8}, - {0x45 , 0xD6}, - {0x46 , 0xEE}, - {0x47 , 0x0d}, - {0xfe , 0x00}, // set page0 - - //-----------Update the registers 2010/07/06-------------// - //Registers of Page0 - {0xfe , 0x00}, // set page0 - {0x10 , 0x26}, - {0x11 , 0x0d}, // fd,modified by mormo 2010/07/06 - {0x1a , 0x2a}, // 1e,modified by mormo 2010/07/06 - - {0x1c , 0x49}, // c1,modified by mormo 2010/07/06 - {0x1d , 0x9a}, // 08,modified by mormo 2010/07/06 - {0x1e , 0x61}, // 60,modified by mormo 2010/07/06 - - {0x3a , 0x20}, - - {0x50 , 0x14}, // 10,modified by mormo 2010/07/06 - {0x53 , 0x80}, - {0x56 , 0x80}, - - {0x8b , 0x20}, //LSC - {0x8c , 0x20}, - {0x8d , 0x20}, - {0x8e , 0x14}, - {0x8f , 0x10}, - {0x90 , 0x14}, - - {0x94 , 0x02}, - {0x95 , 0x07}, - {0x96 , 0xe0}, - - {0xb1 , 0x40}, // YCPT - {0xb2 , 0x40}, - {0xb3 , 0x40}, - {0xb6 , 0xe0}, - - {0xd0 , 0xcb}, // AECT c9,modifed by mormo 2010/07/06 - {0xd3 , 0x48}, // 80,modified by mormor 2010/07/06 - - {0xf2 , 0x02}, - {0xf7 , 0x12}, - {0xf8 , 0x0a}, - - //Registers of Page1 - {0xfe , 0x01},// set page1 - {0x02 , 0x20}, - {0x04 , 0x10}, - {0x05 , 0x08}, - {0x06 , 0x20}, - {0x08 , 0x0a}, - - {0x0e , 0x44}, - {0x0f , 0x32}, - {0x10 , 0x41}, - {0x11 , 0x37}, - {0x12 , 0x22}, - {0x13 , 0x19}, - {0x14 , 0x44}, - {0x15 , 0x44}, - - {0x19 , 0x50}, - {0x1a , 0xd8}, - - {0x32 , 0x10}, - - {0x35 , 0x00}, - {0x36 , 0x80}, - {0x37 , 0x00}, - //-----------Update the registers end---------// - - - {0xfe , 0x00}, // set page0 - {0xd2 , 0x90}, - - - //-----------GAMMA Select(3)---------------// - {0x9F , 0x10}, - {0xA0 , 0x20}, - {0xA1 , 0x38}, - {0xA2 , 0x4E}, - {0xA3 , 0x63}, - {0xA4 , 0x76}, - {0xA5 , 0x87}, - {0xA6 , 0xA2}, - {0xA7 , 0xB8}, - {0xA8 , 0xCA}, - {0xA9 , 0xD8}, - {0xAA , 0xE3}, - {0xAB , 0xEB}, - {0xAC , 0xF0}, - {0xAD , 0xF8}, - {0xAE , 0xFD}, - {0xAF , 0xFF}, - - /*GC0308_GAMMA_Select, - 1: //smallest gamma curve - {0x9F , 0x0B}, - {0xA0 , 0x16}, - {0xA1 , 0x29}, - {0xA2 , 0x3C}, - {0xA3 , 0x4F}, - {0xA4 , 0x5F}, - {0xA5 , 0x6F}, - {0xA6 , 0x8A}, - {0xA7 , 0x9F}, - {0xA8 , 0xB4}, - {0xA9 , 0xC6}, - {0xAA , 0xD3}, - {0xAB , 0xDD}, - {0xAC , 0xE5}, - {0xAD , 0xF1}, - {0xAE , 0xFA}, - {0xAF , 0xFF}, - - 2: - {0x9F , 0x0E}, - {0xA0 , 0x1C}, - {0xA1 , 0x34}, - {0xA2 , 0x48}, - {0xA3 , 0x5A}, - {0xA4 , 0x6B}, - {0xA5 , 0x7B}, - {0xA6 , 0x95}, - {0xA7 , 0xAB}, - {0xA8 , 0xBF}, - {0xA9 , 0xCE}, - {0xAA , 0xD9}, - {0xAB , 0xE4}, - {0xAC , 0xEC}, - {0xAD , 0xF7}, - {0xAE , 0xFD}, - {0xAF , 0xFF}, - - 3: - {0x9F , 0x10}, - {0xA0 , 0x20}, - {0xA1 , 0x38}, - {0xA2 , 0x4E}, - {0xA3 , 0x63}, - {0xA4 , 0x76}, - {0xA5 , 0x87}, - {0xA6 , 0xA2}, - {0xA7 , 0xB8}, - {0xA8 , 0xCA}, - {0xA9 , 0xD8}, - {0xAA , 0xE3}, - {0xAB , 0xEB}, - {0xAC , 0xF0}, - {0xAD , 0xF8}, - {0xAE , 0xFD}, - {0xAF , 0xFF}, - - 4: - {0x9F , 0x14}, - {0xA0 , 0x28}, - {0xA1 , 0x44}, - {0xA2 , 0x5D}, - {0xA3 , 0x72}, - {0xA4 , 0x86}, - {0xA5 , 0x95}, - {0xA6 , 0xB1}, - {0xA7 , 0xC6}, - {0xA8 , 0xD5}, - {0xA9 , 0xE1}, - {0xAA , 0xEA}, - {0xAB , 0xF1}, - {0xAC , 0xF5}, - {0xAD , 0xFB}, - {0xAE , 0xFE}, - {0xAF , 0xFF}, - - 5: //largest gamma curve - {0x9F , 0x15}, - {0xA0 , 0x2A}, - {0xA1 , 0x4A}, - {0xA2 , 0x67}, - {0xA3 , 0x79}, - {0xA4 , 0x8C}, - {0xA5 , 0x9A}, - {0xA6 , 0xB3}, - {0xA7 , 0xC5}, - {0xA8 , 0xD5}, - {0xA9 , 0xDF}, - {0xAA , 0xE8}, - {0xAB , 0xEE}, - {0xAC , 0xF3}, - {0xAD , 0xFA}, - {0xAE , 0xFD}, - {0xAF , 0xFF}, */ - //-----------GAMMA Select End--------------// - - - - - //-------------H_V_Switch(4)---------------// - {0x14 , 0x10}, //0x10 - - /*GC0308_H_V_Switch, - - 1: // normal - {0x14 , 0x10}, - - 2: // IMAGE_H_MIRROR - {0x14 , 0x11}, - - 3: // IMAGE_V_MIRROR - {0x14 , 0x12}, - - 4: // IMAGE_HV_MIRROR - {0x14 , 0x13}, - */ - //-------------H_V_Select End--------------// - -}; - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {0x00,0x00} -}; - -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - {0x0, 0x0}, -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - {0x17, 0x13}, - {0x18, 0x01}, - {0x32, 0xbf}, - {0x19, 0x03}, - {0x1a, 0x7b}, - {0x03, 0x0a}, - {0x00,0x00} -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {0x00,0x00} -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - {0x00,0x00} -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {0x00,0x00} -}; -#endif -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {0x00, 0x00} -}; - - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0x5a, 0x4c}, - {0x5b, 0x40}, - {0x5c, 0x4a}, - {0x22, 0x57}, - {0x00, 0x00} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0x22, 0x55}, // Disable AWB - {0x5a, 0x5a}, - {0x5b, 0x42}, - {0x5c, 0x40}, - {0x00, 0x00} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x22, 0x55}, // Disable AWB - {0x5a, 0x50}, - {0x5b, 0x45}, - {0x5c, 0x40}, - {0x00, 0x00} -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0x22, 0x55}, // Disable AWB - {0x5a, 0x48}, - {0x5b, 0x40}, - {0x5c, 0x5c}, - {0x00, 0x00} - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x22, 0x55}, // Disable AWB - {0x5a, 0x40}, - {0x5b, 0x42}, - {0x5c, 0x50}, - {0x00, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - // Brightness -2 - {0xb5, 0xe0}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness1[]= -{ - // Brightness -1 - {0xb5, 0xf0}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - // Brightness 0 - {0xb5, 0x00}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - // Brightness +1 - {0xb5, 0x20}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - // Brightness +2 - {0xb5, 0x30}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - // Brightness +3 - {0xb5, 0x40}, - {0x00, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x23,0x00}, - {0x2d,0x0a}, - {0x20,0x7f}, - {0xd2,0x90}, - {0x73,0x00}, - {0x77,0x38}, - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x00}, - {0xbb,0x00}, - {0x00,0x00} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0x7f}, - {0xd2,0x90}, - {0x73,0x00}, - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x00}, - {0xbb,0x00}, - {0x00,0x00} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0x7f}, - {0xd2,0x90}, - {0x73,0x00}, - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0xd2}, - {0xbb,0x28}, - {0x00,0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - //Negative - {0x23,0x01}, - {0x2d,0x0a}, - {0x20,0x7f}, - {0xd2,0x90}, - {0x73,0x00}, - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x00}, - {0xbb,0x00}, - {0x00,0x00} -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - // Bluish - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0x7f}, - {0xd2,0x90}, - {0x73,0x00}, - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x50}, - {0xbb,0xe0}, - {0x00,0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0x7f}, - {0xd2,0x90}, - {0x77,0x88}, - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0xc0}, - {0xbb,0xc0}, - {0x00,0x00} -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - {0xd3, 0x30}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure1[]= -{ - {0xd3, 0x38}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - {0xd3, 0x40}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - {0xd3, 0x48}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - {0xd3, 0x50}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - {0xd3, 0x58}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - {0xd3, 0x60}, - {0x00, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {0x00, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - {0xb3,0x34}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - {0xb3,0x38}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast2[]= -{ - {0xb3,0x3d}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - {0xb3,0x40}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - {0xb3,0x44}, - {0x00, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - {0xb3,0x48}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - {0xb3,0x50}, - {0x00, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {0x00, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {0x00, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ - {0xec, 0x00}, - {0x00, 0x00} -}; - -static struct reginfo sensor_SceneNight[] = -{ - {0xec, 0x30}, - {0x00, 0x00} -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom1[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom2[] = -{ - {0x0, 0x0}, -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {0x0, 0x0}, -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif -static const struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - unsigned int winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int funmodule_state; -} sensor_info_priv_t; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, u8 reg, u8 val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[1]; - - buf[0] = reg & 0xFF; - buf[1] = val; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) -{ - int err,cnt; - //u8 buf[2]; - u8 buf[1]; - struct i2c_msg msg[2]; - - //buf[0] = reg >> 8; - buf[0] = reg; - buf[1] = reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 1; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -#if 1 -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err; - int i = 0; - - //for(i=0; i < sizeof(sensor_init_data) / 2;i++) - while((regarray[i].reg != 0) || (regarray[i].val != 0)) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err != 0) - { - SENSOR_TR("%s..write failed current i = %d\n", SENSOR_NAME_STRING(),i); - return err; - } - i++; - } - - return 0; -} -#else -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err; - int i = 0; - u8 val_read; - while (regarray[i].reg != 0) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err != 0) - { - SENSOR_TR("%s..write failed current i = %d\n", SENSOR_NAME_STRING(),i); - return err; - } - err = sensor_read(client, regarray[i].reg, &val_read); - SENSOR_TR("%s..reg[0x%x]=0x%x,0x%x\n", SENSOR_NAME_STRING(),regarray[i].reg, val_read, regarray[i].val); - i++; - } - return 0; -} -#endif - -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_check_array(struct i2c_client *client, struct reginfo *regarray) -{ - int ret; - int i = 0; - - u8 value; - - SENSOR_DG("%s >>>>>>>>>>>>>>>>>>>>>>\n",__FUNCTION__); - for(i=0;ipowerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_power_end: - return ret; -} - -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - int ret; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - /* ret = sensor_write(client, 0x12, 0x80); - if (ret != 0) - { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); */ //delay 5 microseconds - - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - - sensor_task_lock(client,0); - - sensor->info_priv.winseqe_cur_addr = (int)SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} - -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - //u8 reg_val; - struct sensor *sensor = to_sensor(client); - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - sensor_ioctrl(icd, Sensor_PowerDown, 1); - msleep(100); - - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - - return 0; -} -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - - return 0; - -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - int ret=0, set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - winseqe_set_addr = sensor_svga; - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - winseqe_set_addr = sensor_sxga; - set_w = 1280; - set_h = 1024; - } -#if defined(CONFIG_SOC_CAMERA_GC0308_INTERPOLATION) - else if (((set_w <= SENSOR_MAX_WIDTH) && (set_h <= SENSOR_MAX_HEIGHT)) ) - { - winseqe_set_addr = sensor_vga; - set_w = SENSOR_MAX_WIDTH_REAL; - set_h = SENSOR_MAX_HEIGHT_REAL; - } -#endif - - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) { - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - } else { /* ddl@rock-chips.com : Video */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - } - #endif - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - - sensor->info_priv.winseqe_cur_addr = (int)winseqe_set_addr; - - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - if (sensor->info_priv.whiteBalance != 0) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - sensor->info_priv.snap2preview = true; - } else if (sensor_fmt_videochk(sd,mf) == true) { /* ddl@rock-chips.com : Video */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - sensor->info_priv.video2preview = true; - } else if ((sensor->info_priv.snap2preview == true) || (sensor->info_priv.video2preview == true)) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - msleep(600); - sensor->info_priv.video2preview = false; - sensor->info_priv.snap2preview = false; - } - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; - -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - /* ddl@rock-chips.com : It is query max resolution only. */ - if (mf->reserved[6] == 0xfefe5a5a) { - mf->height = SENSOR_MAX_HEIGHT; - mf->width = SENSOR_MAX_WIDTH; - ret = 0; - goto sensor_try_fmt_end; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - set_w = 1280; - set_h = 1024; - } -#if defined(CONFIG_SOC_CAMERA_GC0308_INTERPOLATION) - else if (((set_w <= SENSOR_MAX_WIDTH) && (set_h <= SENSOR_MAX_HEIGHT)) ) - { - set_w = SENSOR_MAX_WIDTH_REAL; - set_h = SENSOR_MAX_HEIGHT_REAL; - } -#endif - - else - { - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - - mf->width = set_w; - mf->height = set_h; - - mf->colorspace = fmt->colorspace; -sensor_try_fmt_end: - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV9650 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((*value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value > 0) && ((digitalzoom_cur + *value) > digitalzoom_total)) - { - *value = digitalzoom_total - digitalzoom_cur; - } - - if ((*value < 0) && ((digitalzoom_cur + *value) < 0)) - { - *value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += *value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, *value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char pid = 0; - int ret; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - - /* soft reset */ - /* ret = sensor_write(client, 0x12, 0x80); - if (ret != 0) - { - SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); - return -ENODEV; - } - mdelay(50); *///delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x00, &pid); - if (ret != 0) { - SENSOR_TR("%s read chip id high byte failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - - return ret; -} - -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0; -#if CONFIG_SENSOR_Flash - int i; -#endif - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - sensor->sensor_gpio_res = NULL; - for (i=0; isensor_io_request->gpio_res[i].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[i].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[i]; - } - } - if (sensor->sensor_gpio_res == NULL) { - SENSOR_TR("%s %s obtain gpio resource failed when RK29_CAM_SUBDEV_IOREQUEST \n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - - sensor->info_priv.fmt = sensor_colour_fmts[0]; - - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - - diff --git a/drivers/media/video/gc0308_user_series.c b/drivers/media/video/gc0308_user_series.c deleted file mode 100644 index 6a33467f0b43..000000000000 --- a/drivers/media/video/gc0308_user_series.c +++ /dev/null @@ -1,1014 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ - -#if defined(CONFIG_MACH_RK30_PHONE_PAD) - -/* init 640X480 VGA */ -static struct reginfo sensor_init_data[] = -{ - - {0xfe , 0x80}, - - {0xfe , 0x00}, // set page0 - - {0xd2 , 0x10}, // close AEC - {0x22 , 0x55}, // close AWB - - {0x03 , 0x01}, - {0x04 , 0x2c}, - {0x5a , 0x56}, - {0x5b , 0x40}, - {0x5c , 0x4a}, - - {0x22 , 0x57}, // Open AWB - - {0x01 , 0xfa}, - {0x02 , 0x70}, - {0x0f , 0x01}, - - - {0xe2 , 0x00}, //anti-flicker step [11:8] - {0xe3 , 0x64}, //anti-flicker step [7:0] - - {0xe4 , 0x02}, //exp level 1 16.67fps - {0xe5 , 0x58}, - {0xe6 , 0x03}, //exp level 2 12.5fps - {0xe7 , 0x20}, - {0xe8 , 0x04}, //exp level 3 8.33fps - {0xe9 , 0xb0}, - {0xea , 0x09}, //exp level 4 4.00fps - {0xeb , 0xc4}, - - //{0xec , 0x20}, - - {0x05 , 0x00}, - {0x06 , 0x00}, - {0x07 , 0x00}, - {0x08 , 0x00}, - {0x09 , 0x01}, - {0x0a , 0xe8}, - {0x0b , 0x02}, - {0x0c , 0x88}, - {0x0d , 0x02}, - {0x0e , 0x02}, - {0x10 , 0x22}, - {0x11 , 0xfd}, - {0x12 , 0x2a}, - {0x13 , 0x00}, - //{0x14 , 0x10}, - {0x15 , 0x0a}, - {0x16 , 0x05}, - {0x17 , 0x01}, - {0x18 , 0x44}, - {0x19 , 0x44}, - {0x1a , 0x1e}, - {0x1b , 0x00}, - {0x1c , 0xc1}, - {0x1d , 0x08}, - {0x1e , 0x60}, - {0x1f , 0x17}, - - - {0x20 , 0xff}, - {0x21 , 0xf8}, - {0x22 , 0x57}, - {0x24 , 0xa2}, - {0x25 , 0x0f}, - - //output sync_mode - {0x26 , 0x02}, //0x03 20101016 zhj - {0x2f , 0x01}, - {0x30 , 0xf7}, - {0x31 , 0x50}, - {0x32 , 0x00}, - {0x39 , 0x04}, - {0x3a , 0x18}, - {0x3b , 0x20}, - {0x3c , 0x00}, - {0x3d , 0x00}, - {0x3e , 0x00}, - {0x3f , 0x00}, - {0x50 , 0x10}, - {0x53 , 0x82}, - {0x54 , 0x80}, - {0x55 , 0x80}, - {0x56 , 0x82}, - {0x8b , 0x40}, - {0x8c , 0x40}, - {0x8d , 0x40}, - {0x8e , 0x2e}, - {0x8f , 0x2e}, - {0x90 , 0x2e}, - {0x91 , 0x3c}, - {0x92 , 0x50}, - {0x5d , 0x12}, - {0x5e , 0x1a}, - {0x5f , 0x24}, - {0x60 , 0x07}, - {0x61 , 0x15}, - {0x62 , 0x08}, - {0x64 , 0x03}, - {0x66 , 0xe8}, - {0x67 , 0x86}, - {0x68 , 0xa2}, - {0x69 , 0x18}, - {0x6a , 0x0f}, - {0x6b , 0x00}, - {0x6c , 0x5f}, - {0x6d , 0x8f}, - {0x6e , 0x55}, - {0x6f , 0x38}, - {0x70 , 0x15}, - {0x71 , 0x33}, - {0x72 , 0xdc}, - {0x73 , 0x80}, - {0x74 , 0x02}, - {0x75 , 0x3f}, - {0x76 , 0x02}, - {0x77 , 0x36}, - {0x78 , 0x88}, - {0x79 , 0x81}, - {0x7a , 0x81}, - {0x7b , 0x22}, - {0x7c , 0xff}, - {0x93 , 0x48}, - {0x94 , 0x00}, - {0x95 , 0x05}, - {0x96 , 0xe8}, - {0x97 , 0x40}, - {0x98 , 0xf0}, - {0xb1 , 0x38}, - {0xb2 , 0x38}, - {0xbd , 0x38}, - {0xbe , 0x36}, - {0xd0 , 0xc9}, - {0xd1 , 0x10}, - //{0xd2 , 0x90}, - {0xd3 , 0x80}, - {0xd5 , 0xf2}, - {0xd6 , 0x16}, - {0xdb , 0x92}, - {0xdc , 0xa5}, - {0xdf , 0x23}, - {0xd9 , 0x00}, - {0xda , 0x00}, - {0xe0 , 0x09}, - - {0xed , 0x04}, - {0xee , 0xa0}, - {0xef , 0x40}, - {0x80 , 0x03}, - {0x80 , 0x03}, - {0x9F , 0x10}, - {0xA0 , 0x20}, - {0xA1 , 0x38}, - {0xA2 , 0x4E}, - {0xA3 , 0x63}, - {0xA4 , 0x76}, - {0xA5 , 0x87}, - {0xA6 , 0xA2}, - {0xA7 , 0xB8}, - {0xA8 , 0xCA}, - {0xA9 , 0xD8}, - {0xAA , 0xE3}, - {0xAB , 0xEB}, - {0xAC , 0xF0}, - {0xAD , 0xF8}, - {0xAE , 0xFD}, - {0xAF , 0xFF}, - {0xc0 , 0x00}, - {0xc1 , 0x10}, - {0xc2 , 0x1C}, - {0xc3 , 0x30}, - {0xc4 , 0x43}, - {0xc5 , 0x54}, - {0xc6 , 0x65}, - {0xc7 , 0x75}, - {0xc8 , 0x93}, - {0xc9 , 0xB0}, - {0xca , 0xCB}, - {0xcb , 0xE6}, - {0xcc , 0xFF}, - {0xf0 , 0x02}, - {0xf1 , 0x01}, - {0xf2 , 0x01}, - {0xf3 , 0x30}, - {0xf9 , 0x9f}, - {0xfa , 0x78}, - - //--------------------------------------------------------------- - {0xfe , 0x01},// set page1 - - {0x00 , 0xf5}, - {0x02 , 0x1a}, - {0x0a , 0xa0}, - {0x0b , 0x60}, - {0x0c , 0x08}, - {0x0e , 0x4c}, - {0x0f , 0x39}, - {0x11 , 0x3f}, - {0x12 , 0x72}, - {0x13 , 0x13}, - {0x14 , 0x42}, - {0x15 , 0x43}, - {0x16 , 0xc2}, - {0x17 , 0xa8}, - {0x18 , 0x18}, - {0x19 , 0x40}, - {0x1a , 0xd0}, - {0x1b , 0xf5}, - {0x70 , 0x40}, - {0x71 , 0x58}, - {0x72 , 0x30}, - {0x73 , 0x48}, - {0x74 , 0x20}, - {0x75 , 0x60}, - {0x77 , 0x20}, - {0x78 , 0x32}, - {0x30 , 0x03}, - {0x31 , 0x40}, - {0x32 , 0xe0}, - {0x33 , 0xe0}, - {0x34 , 0xe0}, - {0x35 , 0xb0}, - {0x36 , 0xc0}, - {0x37 , 0xc0}, - {0x38 , 0x04}, - {0x39 , 0x09}, - {0x3a , 0x12}, - {0x3b , 0x1C}, - {0x3c , 0x28}, - {0x3d , 0x31}, - {0x3e , 0x44}, - {0x3f , 0x57}, - {0x40 , 0x6C}, - {0x41 , 0x81}, - {0x42 , 0x94}, - {0x43 , 0xA7}, - {0x44 , 0xB8}, - {0x45 , 0xD6}, - {0x46 , 0xEE}, - {0x47 , 0x0d}, - {0xfe , 0x00}, // set page0 - - //-----------Update the registers 2010/07/06-------------// - //Registers of Page0 - {0xfe , 0x00}, // set page0 - {0x10 , 0x26}, - {0x11 , 0x0d}, // fd,modified by mormo 2010/07/06 - {0x1a , 0x2a}, // 1e,modified by mormo 2010/07/06 - - {0x1c , 0x49}, // c1,modified by mormo 2010/07/06 - {0x1d , 0x9a}, // 08,modified by mormo 2010/07/06 - {0x1e , 0x61}, // 60,modified by mormo 2010/07/06 - - {0x3a , 0x20}, - - {0x50 , 0x14}, // 10,modified by mormo 2010/07/06 - {0x53 , 0x80}, - {0x56 , 0x80}, - - {0x8b , 0x20}, //LSC - {0x8c , 0x20}, - {0x8d , 0x20}, - {0x8e , 0x14}, - {0x8f , 0x10}, - {0x90 , 0x14}, - - {0x94 , 0x02}, - {0x95 , 0x07}, - {0x96 , 0xe0}, - - {0xb1 , 0x40}, // YCPT - {0xb2 , 0x40}, - {0xb3 , 0x40}, - {0xb6 , 0xe0}, - - {0xd0 , 0xcb}, // AECT c9,modifed by mormo 2010/07/06 - {0xd3 , 0x48}, // 80,modified by mormor 2010/07/06 - - {0xf2 , 0x02}, - {0xf7 , 0x12}, - {0xf8 , 0x0a}, - - //Registers of Page1 - {0xfe , 0x01},// set page1 - {0x02 , 0x20}, - {0x04 , 0x10}, - {0x05 , 0x08}, - {0x06 , 0x20}, - {0x08 , 0x0a}, - - {0x0e , 0x44}, - {0x0f , 0x32}, - {0x10 , 0x41}, - {0x11 , 0x37}, - {0x12 , 0x22}, - {0x13 , 0x19}, - {0x14 , 0x44}, - {0x15 , 0x44}, - - {0x19 , 0x50}, - {0x1a , 0xd8}, - - {0x32 , 0x10}, - - {0x35 , 0x00}, - {0x36 , 0x80}, - {0x37 , 0x00}, - //-----------Update the registers end---------// - - - {0xfe , 0x00}, // set page0 - {0xd2 , 0x90}, - - - //-----------GAMMA Select(3)---------------// - {0x9F , 0x10}, - {0xA0 , 0x20}, - {0xA1 , 0x38}, - {0xA2 , 0x4E}, - {0xA3 , 0x63}, - {0xA4 , 0x76}, - {0xA5 , 0x87}, - {0xA6 , 0xA2}, - {0xA7 , 0xB8}, - {0xA8 , 0xCA}, - {0xA9 , 0xD8}, - {0xAA , 0xE3}, - {0xAB , 0xEB}, - {0xAC , 0xF0}, - {0xAD , 0xF8}, - {0xAE , 0xFD}, - {0xAF , 0xFF}, - - /*GC0308_GAMMA_Select, - 1: //smallest gamma curve - {0x9F , 0x0B}, - {0xA0 , 0x16}, - {0xA1 , 0x29}, - {0xA2 , 0x3C}, - {0xA3 , 0x4F}, - {0xA4 , 0x5F}, - {0xA5 , 0x6F}, - {0xA6 , 0x8A}, - {0xA7 , 0x9F}, - {0xA8 , 0xB4}, - {0xA9 , 0xC6}, - {0xAA , 0xD3}, - {0xAB , 0xDD}, - {0xAC , 0xE5}, - {0xAD , 0xF1}, - {0xAE , 0xFA}, - {0xAF , 0xFF}, - - 2: - {0x9F , 0x0E}, - {0xA0 , 0x1C}, - {0xA1 , 0x34}, - {0xA2 , 0x48}, - {0xA3 , 0x5A}, - {0xA4 , 0x6B}, - {0xA5 , 0x7B}, - {0xA6 , 0x95}, - {0xA7 , 0xAB}, - {0xA8 , 0xBF}, - {0xA9 , 0xCE}, - {0xAA , 0xD9}, - {0xAB , 0xE4}, - {0xAC , 0xEC}, - {0xAD , 0xF7}, - {0xAE , 0xFD}, - {0xAF , 0xFF}, - - 3: - {0x9F , 0x10}, - {0xA0 , 0x20}, - {0xA1 , 0x38}, - {0xA2 , 0x4E}, - {0xA3 , 0x63}, - {0xA4 , 0x76}, - {0xA5 , 0x87}, - {0xA6 , 0xA2}, - {0xA7 , 0xB8}, - {0xA8 , 0xCA}, - {0xA9 , 0xD8}, - {0xAA , 0xE3}, - {0xAB , 0xEB}, - {0xAC , 0xF0}, - {0xAD , 0xF8}, - {0xAE , 0xFD}, - {0xAF , 0xFF}, - - 4: - {0x9F , 0x14}, - {0xA0 , 0x28}, - {0xA1 , 0x44}, - {0xA2 , 0x5D}, - {0xA3 , 0x72}, - {0xA4 , 0x86}, - {0xA5 , 0x95}, - {0xA6 , 0xB1}, - {0xA7 , 0xC6}, - {0xA8 , 0xD5}, - {0xA9 , 0xE1}, - {0xAA , 0xEA}, - {0xAB , 0xF1}, - {0xAC , 0xF5}, - {0xAD , 0xFB}, - {0xAE , 0xFE}, - {0xAF , 0xFF}, - - 5: //largest gamma curve - {0x9F , 0x15}, - {0xA0 , 0x2A}, - {0xA1 , 0x4A}, - {0xA2 , 0x67}, - {0xA3 , 0x79}, - {0xA4 , 0x8C}, - {0xA5 , 0x9A}, - {0xA6 , 0xB3}, - {0xA7 , 0xC5}, - {0xA8 , 0xD5}, - {0xA9 , 0xDF}, - {0xAA , 0xE8}, - {0xAB , 0xEE}, - {0xAC , 0xF3}, - {0xAD , 0xFA}, - {0xAE , 0xFD}, - {0xAF , 0xFF}, */ - //-----------GAMMA Select End--------------// - - - - - //-------------H_V_Switch(4)---------------// - {0x14 , 0x10}, //0x10 - - /*GC0308_H_V_Switch, - - 1: // normal - {0x14 , 0x10}, - - 2: // IMAGE_H_MIRROR - {0x14 , 0x11}, - - 3: // IMAGE_V_MIRROR - {0x14 , 0x12}, - - 4: // IMAGE_HV_MIRROR - {0x14 , 0x13}, - */ - //-------------H_V_Select End--------------// - -}; - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {0x00,0x00} -}; - -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - {0x0, 0x0}, -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - {0x17, 0x13}, - {0x18, 0x01}, - {0x32, 0xbf}, - {0x19, 0x03}, - {0x1a, 0x7b}, - {0x03, 0x0a}, - {0x00,0x00} -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {0x00,0x00} -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - {0x00,0x00} -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {0x00,0x00} -}; - - - -#else - -/* init 640X480 VGA */ -static struct reginfo sensor_init_data[] = -{ - - {0xfe , 0x80}, - - {0xfe , 0x00}, // set page0 - - {0xd2 , 0x10}, // close AEC - {0x22 , 0x55}, // close AWB - - {0x03 , 0x01}, - {0x04 , 0x2c}, - {0x5a , 0x56}, - {0x5b , 0x40}, - {0x5c , 0x4a}, - - {0x22 , 0x57}, // Open AWB - - {0x01 , 0xfa}, - {0x02 , 0x70}, - {0x0f , 0x01}, - - - {0xe2 , 0x00}, //anti-flicker step [11:8] - {0xe3 , 0x64}, //anti-flicker step [7:0] - - {0xe4 , 0x02}, //exp level 1 16.67fps - {0xe5 , 0x58}, - {0xe6 , 0x03}, //exp level 2 12.5fps - {0xe7 , 0x20}, - {0xe8 , 0x04}, //exp level 3 8.33fps - {0xe9 , 0xb0}, - {0xea , 0x09}, //exp level 4 4.00fps - {0xeb , 0xc4}, - - //{0xec , 0x20}, - - {0x05 , 0x00}, - {0x06 , 0x00}, - {0x07 , 0x00}, - {0x08 , 0x00}, - {0x09 , 0x01}, - {0x0a , 0xe8}, - {0x0b , 0x02}, - {0x0c , 0x88}, - {0x0d , 0x02}, - {0x0e , 0x02}, - {0x10 , 0x22}, - {0x11 , 0xfd}, - {0x12 , 0x2a}, - {0x13 , 0x00}, - //{0x14 , 0x10}, - {0x15 , 0x0a}, - {0x16 , 0x05}, - {0x17 , 0x01}, - {0x18 , 0x44}, - {0x19 , 0x44}, - {0x1a , 0x1e}, - {0x1b , 0x00}, - {0x1c , 0xc1}, - {0x1d , 0x08}, - {0x1e , 0x60}, - {0x1f , 0x17}, - - - {0x20 , 0xff}, - {0x21 , 0xf8}, - {0x22 , 0x57}, - {0x24 , 0xa2}, - {0x25 , 0x0f}, - - //output sync_mode - {0x26 , 0x02}, //0x03 20101016 zhj - {0x2f , 0x01}, - {0x30 , 0xf7}, - {0x31 , 0x50}, - {0x32 , 0x00}, - {0x39 , 0x04}, - {0x3a , 0x18}, - {0x3b , 0x20}, - {0x3c , 0x00}, - {0x3d , 0x00}, - {0x3e , 0x00}, - {0x3f , 0x00}, - {0x50 , 0x10}, - {0x53 , 0x82}, - {0x54 , 0x80}, - {0x55 , 0x80}, - {0x56 , 0x82}, - {0x8b , 0x40}, - {0x8c , 0x40}, - {0x8d , 0x40}, - {0x8e , 0x2e}, - {0x8f , 0x2e}, - {0x90 , 0x2e}, - {0x91 , 0x3c}, - {0x92 , 0x50}, - {0x5d , 0x12}, - {0x5e , 0x1a}, - {0x5f , 0x24}, - {0x60 , 0x07}, - {0x61 , 0x15}, - {0x62 , 0x08}, - {0x64 , 0x03}, - {0x66 , 0xe8}, - {0x67 , 0x86}, - {0x68 , 0xa2}, - {0x69 , 0x18}, - {0x6a , 0x0f}, - {0x6b , 0x00}, - {0x6c , 0x5f}, - {0x6d , 0x8f}, - {0x6e , 0x55}, - {0x6f , 0x38}, - {0x70 , 0x15}, - {0x71 , 0x33}, - {0x72 , 0xdc}, - {0x73 , 0x80}, - {0x74 , 0x02}, - {0x75 , 0x3f}, - {0x76 , 0x02}, - {0x77 , 0x36}, - {0x78 , 0x88}, - {0x79 , 0x81}, - {0x7a , 0x81}, - {0x7b , 0x22}, - {0x7c , 0xff}, - {0x93 , 0x48}, - {0x94 , 0x00}, - {0x95 , 0x05}, - {0x96 , 0xe8}, - {0x97 , 0x40}, - {0x98 , 0xf0}, - {0xb1 , 0x38}, - {0xb2 , 0x38}, - {0xbd , 0x38}, - {0xbe , 0x36}, - {0xd0 , 0xc9}, - {0xd1 , 0x10}, - //{0xd2 , 0x90}, - {0xd3 , 0x80}, - {0xd5 , 0xf2}, - {0xd6 , 0x16}, - {0xdb , 0x92}, - {0xdc , 0xa5}, - {0xdf , 0x23}, - {0xd9 , 0x00}, - {0xda , 0x00}, - {0xe0 , 0x09}, - - {0xed , 0x04}, - {0xee , 0xa0}, - {0xef , 0x40}, - {0x80 , 0x03}, - {0x80 , 0x03}, - {0x9F , 0x10}, - {0xA0 , 0x20}, - {0xA1 , 0x38}, - {0xA2 , 0x4E}, - {0xA3 , 0x63}, - {0xA4 , 0x76}, - {0xA5 , 0x87}, - {0xA6 , 0xA2}, - {0xA7 , 0xB8}, - {0xA8 , 0xCA}, - {0xA9 , 0xD8}, - {0xAA , 0xE3}, - {0xAB , 0xEB}, - {0xAC , 0xF0}, - {0xAD , 0xF8}, - {0xAE , 0xFD}, - {0xAF , 0xFF}, - {0xc0 , 0x00}, - {0xc1 , 0x10}, - {0xc2 , 0x1C}, - {0xc3 , 0x30}, - {0xc4 , 0x43}, - {0xc5 , 0x54}, - {0xc6 , 0x65}, - {0xc7 , 0x75}, - {0xc8 , 0x93}, - {0xc9 , 0xB0}, - {0xca , 0xCB}, - {0xcb , 0xE6}, - {0xcc , 0xFF}, - {0xf0 , 0x02}, - {0xf1 , 0x01}, - {0xf2 , 0x01}, - {0xf3 , 0x30}, - {0xf9 , 0x9f}, - {0xfa , 0x78}, - - //--------------------------------------------------------------- - {0xfe , 0x01},// set page1 - - {0x00 , 0xf5}, - {0x02 , 0x1a}, - {0x0a , 0xa0}, - {0x0b , 0x60}, - {0x0c , 0x08}, - {0x0e , 0x4c}, - {0x0f , 0x39}, - {0x11 , 0x3f}, - {0x12 , 0x72}, - {0x13 , 0x13}, - {0x14 , 0x42}, - {0x15 , 0x43}, - {0x16 , 0xc2}, - {0x17 , 0xa8}, - {0x18 , 0x18}, - {0x19 , 0x40}, - {0x1a , 0xd0}, - {0x1b , 0xf5}, - {0x70 , 0x40}, - {0x71 , 0x58}, - {0x72 , 0x30}, - {0x73 , 0x48}, - {0x74 , 0x20}, - {0x75 , 0x60}, - {0x77 , 0x20}, - {0x78 , 0x32}, - {0x30 , 0x03}, - {0x31 , 0x40}, - {0x32 , 0xe0}, - {0x33 , 0xe0}, - {0x34 , 0xe0}, - {0x35 , 0xb0}, - {0x36 , 0xc0}, - {0x37 , 0xc0}, - {0x38 , 0x04}, - {0x39 , 0x09}, - {0x3a , 0x12}, - {0x3b , 0x1C}, - {0x3c , 0x28}, - {0x3d , 0x31}, - {0x3e , 0x44}, - {0x3f , 0x57}, - {0x40 , 0x6C}, - {0x41 , 0x81}, - {0x42 , 0x94}, - {0x43 , 0xA7}, - {0x44 , 0xB8}, - {0x45 , 0xD6}, - {0x46 , 0xEE}, - {0x47 , 0x0d}, - {0xfe , 0x00}, // set page0 - - //-----------Update the registers 2010/07/06-------------// - //Registers of Page0 - {0xfe , 0x00}, // set page0 - {0x10 , 0x26}, - {0x11 , 0x0d}, // fd,modified by mormo 2010/07/06 - {0x1a , 0x2a}, // 1e,modified by mormo 2010/07/06 - - {0x1c , 0x49}, // c1,modified by mormo 2010/07/06 - {0x1d , 0x9a}, // 08,modified by mormo 2010/07/06 - {0x1e , 0x61}, // 60,modified by mormo 2010/07/06 - - {0x3a , 0x20}, - - {0x50 , 0x14}, // 10,modified by mormo 2010/07/06 - {0x53 , 0x80}, - {0x56 , 0x80}, - - {0x8b , 0x20}, //LSC - {0x8c , 0x20}, - {0x8d , 0x20}, - {0x8e , 0x14}, - {0x8f , 0x10}, - {0x90 , 0x14}, - - {0x94 , 0x02}, - {0x95 , 0x07}, - {0x96 , 0xe0}, - - {0xb1 , 0x40}, // YCPT - {0xb2 , 0x40}, - {0xb3 , 0x40}, - {0xb6 , 0xe0}, - - {0xd0 , 0xcb}, // AECT c9,modifed by mormo 2010/07/06 - {0xd3 , 0x48}, // 80,modified by mormor 2010/07/06 - - {0xf2 , 0x02}, - {0xf7 , 0x12}, - {0xf8 , 0x0a}, - - //Registers of Page1 - {0xfe , 0x01},// set page1 - {0x02 , 0x20}, - {0x04 , 0x10}, - {0x05 , 0x08}, - {0x06 , 0x20}, - {0x08 , 0x0a}, - - {0x0e , 0x44}, - {0x0f , 0x32}, - {0x10 , 0x41}, - {0x11 , 0x37}, - {0x12 , 0x22}, - {0x13 , 0x19}, - {0x14 , 0x44}, - {0x15 , 0x44}, - - {0x19 , 0x50}, - {0x1a , 0xd8}, - - {0x32 , 0x10}, - - {0x35 , 0x00}, - {0x36 , 0x80}, - {0x37 , 0x00}, - //-----------Update the registers end---------// - - - {0xfe , 0x00}, // set page0 - {0xd2 , 0x90}, - - - //-----------GAMMA Select(3)---------------// - {0x9F , 0x10}, - {0xA0 , 0x20}, - {0xA1 , 0x38}, - {0xA2 , 0x4E}, - {0xA3 , 0x63}, - {0xA4 , 0x76}, - {0xA5 , 0x87}, - {0xA6 , 0xA2}, - {0xA7 , 0xB8}, - {0xA8 , 0xCA}, - {0xA9 , 0xD8}, - {0xAA , 0xE3}, - {0xAB , 0xEB}, - {0xAC , 0xF0}, - {0xAD , 0xF8}, - {0xAE , 0xFD}, - {0xAF , 0xFF}, - - /*GC0308_GAMMA_Select, - 1: //smallest gamma curve - {0x9F , 0x0B}, - {0xA0 , 0x16}, - {0xA1 , 0x29}, - {0xA2 , 0x3C}, - {0xA3 , 0x4F}, - {0xA4 , 0x5F}, - {0xA5 , 0x6F}, - {0xA6 , 0x8A}, - {0xA7 , 0x9F}, - {0xA8 , 0xB4}, - {0xA9 , 0xC6}, - {0xAA , 0xD3}, - {0xAB , 0xDD}, - {0xAC , 0xE5}, - {0xAD , 0xF1}, - {0xAE , 0xFA}, - {0xAF , 0xFF}, - - 2: - {0x9F , 0x0E}, - {0xA0 , 0x1C}, - {0xA1 , 0x34}, - {0xA2 , 0x48}, - {0xA3 , 0x5A}, - {0xA4 , 0x6B}, - {0xA5 , 0x7B}, - {0xA6 , 0x95}, - {0xA7 , 0xAB}, - {0xA8 , 0xBF}, - {0xA9 , 0xCE}, - {0xAA , 0xD9}, - {0xAB , 0xE4}, - {0xAC , 0xEC}, - {0xAD , 0xF7}, - {0xAE , 0xFD}, - {0xAF , 0xFF}, - - 3: - {0x9F , 0x10}, - {0xA0 , 0x20}, - {0xA1 , 0x38}, - {0xA2 , 0x4E}, - {0xA3 , 0x63}, - {0xA4 , 0x76}, - {0xA5 , 0x87}, - {0xA6 , 0xA2}, - {0xA7 , 0xB8}, - {0xA8 , 0xCA}, - {0xA9 , 0xD8}, - {0xAA , 0xE3}, - {0xAB , 0xEB}, - {0xAC , 0xF0}, - {0xAD , 0xF8}, - {0xAE , 0xFD}, - {0xAF , 0xFF}, - - 4: - {0x9F , 0x14}, - {0xA0 , 0x28}, - {0xA1 , 0x44}, - {0xA2 , 0x5D}, - {0xA3 , 0x72}, - {0xA4 , 0x86}, - {0xA5 , 0x95}, - {0xA6 , 0xB1}, - {0xA7 , 0xC6}, - {0xA8 , 0xD5}, - {0xA9 , 0xE1}, - {0xAA , 0xEA}, - {0xAB , 0xF1}, - {0xAC , 0xF5}, - {0xAD , 0xFB}, - {0xAE , 0xFE}, - {0xAF , 0xFF}, - - 5: //largest gamma curve - {0x9F , 0x15}, - {0xA0 , 0x2A}, - {0xA1 , 0x4A}, - {0xA2 , 0x67}, - {0xA3 , 0x79}, - {0xA4 , 0x8C}, - {0xA5 , 0x9A}, - {0xA6 , 0xB3}, - {0xA7 , 0xC5}, - {0xA8 , 0xD5}, - {0xA9 , 0xDF}, - {0xAA , 0xE8}, - {0xAB , 0xEE}, - {0xAC , 0xF3}, - {0xAD , 0xFA}, - {0xAE , 0xFD}, - {0xAF , 0xFF}, */ - //-----------GAMMA Select End--------------// - - - - - //-------------H_V_Switch(4)---------------// - {0x14 , 0x10}, //0x10 - - /*GC0308_H_V_Switch, - - 1: // normal - {0x14 , 0x10}, - - 2: // IMAGE_H_MIRROR - {0x14 , 0x11}, - - 3: // IMAGE_V_MIRROR - {0x14 , 0x12}, - - 4: // IMAGE_HV_MIRROR - {0x14 , 0x13}, - */ - //-------------H_V_Select End--------------// - -}; - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {0x00,0x00} -}; - -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - {0x0, 0x0}, -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - {0x17, 0x13}, - {0x18, 0x01}, - {0x32, 0xbf}, - {0x19, 0x03}, - {0x1a, 0x7b}, - {0x03, 0x0a}, - {0x00,0x00} -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {0x00,0x00} -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - {0x00,0x00} -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {0x00,0x00} -}; - - -#endif diff --git a/drivers/media/video/gc0309.c b/drivers/media/video/gc0309.c deleted file mode 100644 index 2bf995317d3c..000000000000 --- a/drivers/media/video/gc0309.c +++ /dev/null @@ -1,1102 +0,0 @@ -/* - * drivers/media/video/gc0309.c - * - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "generic_sensor.h" - -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.0.3: -* add sensor_focus_af_const_pause_usr_cb; -*/ -static int version = KERNEL_VERSION(0,0,3); -module_param(version, int, S_IRUGO); - - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_GC0309 -#define SENSOR_V4L2_IDENT V4L2_IDENT_GC0309 -#define SENSOR_ID 0xa0 -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_PCLK_SAMPLE_RISING|V4L2_MBUS_HSYNC_ACTIVE_HIGH| V4L2_MBUS_VSYNC_ACTIVE_HIGH|\ - V4L2_MBUS_DATA_ACTIVE_HIGH |SOCAM_MCLK_24MHZ) -#define SENSOR_PREVIEW_W 640 -#define SENSOR_PREVIEW_H 480 -#define SENSOR_PREVIEW_FPS 15000 // 15fps -#define SENSOR_FULLRES_L_FPS 7500 // 7.5fps -#define SENSOR_FULLRES_H_FPS 7500 // 7.5fps -#define SENSOR_720P_FPS 0 -#define SENSOR_1080P_FPS 0 - -#define SENSOR_REGISTER_LEN 1 // sensor register address bytes -#define SENSOR_VALUE_LEN 1 // sensor register value bytes -static unsigned int SensorConfiguration = (CFG_WhiteBalance|CFG_Effect|CFG_Scene); -static unsigned int SensorChipID[] = {SENSOR_ID}; -/* Sensor Driver Configuration End */ - - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a,b) CONS4(SensorReg,SENSOR_REGISTER_LEN,Val,SENSOR_VALUE_LEN)(a,b) -#define sensor_write(client,reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_read(client,reg,v) CONS4(sensor_read_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_write_array generic_sensor_write_array - -struct sensor_parameter -{ - unsigned int PreviewDummyPixels; - unsigned int CaptureDummyPixels; - unsigned int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int PreviewPclk; - unsigned short int CapturePclk; - char awb[6]; -}; - -struct specific_sensor{ - struct generic_sensor common_sensor; - //define user data below - struct sensor_parameter parameter; - -}; - -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ - -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_init_data[] ={ - /*init registers code.*/ -#if 1 - {0xfe,0x80}, // soft reset - {0x1a,0x16}, - {0xd2,0x10}, // close AEC - {0x22,0x55}, // close AWB - - {0x5a,0x56}, - {0x5b,0x40}, - {0x5c,0x4a}, - - {0x22,0x57}, - - {0x01,0xfa}, - {0x02,0x70}, - {0x0f,0x01}, - - {0xe2,0x00}, - {0xe3,0x64}, - - {0x03,0x01}, - {0x04,0x2c}, - - {0x05,0x00}, - {0x06,0x00}, - {0x07,0x00}, - {0x08,0x00}, - {0x09,0x01}, - {0x0a,0xe8}, - {0x0b,0x02}, - {0x0c,0x88}, - {0x0d,0x02}, - {0x0e,0x02}, - {0x10,0x22}, - {0x11,0x0d}, - {0x12,0x2a}, - {0x13,0x00}, - {0x14,0x13}, - {0x15,0x0a}, - {0x16,0x05}, - {0x17,0x01}, - - {0x1b,0x03}, - {0x1c,0xc1}, - {0x1d,0x08}, - {0x1e,0x20}, - {0x1f,0x16}, - - {0x20,0xff}, - {0x21,0xf8}, - {0x24,0xa2}, - {0x25,0x0f}, - //output sync_mode - {0x26,0x03}, - {0x2f,0x01}, - ///////////////////////////////////////////////////////////////////// - /////////////////////////// grab_t //////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x30,0xf7}, - {0x31,0x40}, - {0x32,0x00}, - {0x39,0x04}, - {0x3a,0x20}, - {0x3b,0x20}, - {0x3c,0x02}, - {0x3d,0x02}, - {0x3e,0x02}, - {0x3f,0x02}, - - //gain - {0x50,0x24}, - - {0x53,0x82}, - {0x54,0x80}, - {0x55,0x80}, - {0x56,0x82}, - - ///////////////////////////////////////////////////////////////////// - /////////////////////////// LSC_t //////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x8b,0x20}, - {0x8c,0x20}, - {0x8d,0x20}, - {0x8e,0x10}, - {0x8f,0x10}, - {0x90,0x10}, - {0x91,0x3c}, - {0x92,0x50}, - {0x5d,0x12}, - {0x5e,0x1a}, - {0x5f,0x24}, - ///////////////////////////////////////////////////////////////////// - /////////////////////////// DNDD_t /////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x60,0x07}, - {0x61,0x0e}, - {0x62,0x0c}, - {0x64,0x03}, - {0x66,0xe8}, - {0x67,0x86}, - {0x68,0xa2}, - - ///////////////////////////////////////////////////////////////////// - /////////////////////////// asde_t /////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x69,0x20}, - {0x6a,0x0f}, - {0x6b,0x00}, - {0x6c,0x53}, - {0x6d,0x83}, - {0x6e,0xac}, - {0x6f,0xac}, - {0x70,0x15}, - {0x71,0x33}, - ///////////////////////////////////////////////////////////////////// - /////////////////////////// eeintp_t/////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x72,0xdc}, - {0x73,0x80}, - //for high resolution in light scene - {0x74,0x02}, - {0x75,0x3f}, - {0x76,0x02}, - {0x77,0x54}, - {0x78,0x88}, - {0x79,0x81}, - {0x7a,0x81}, - {0x7b,0x22}, - {0x7c,0xff}, - - - ///////////////////////////////////////////////////////////////////// - ///////////////////////////CC_t/////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x93,0x45}, - {0x94,0x00}, - {0x95,0x00}, - {0x96,0x00}, - {0x97,0x45}, - {0x98,0xf0}, - {0x9c,0x00}, - {0x9d,0x03}, - {0x9e,0x00}, - - - - ///////////////////////////////////////////////////////////////////// - ///////////////////////////YCP_t/////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0xb1,0x40}, - {0xb2,0x40}, - {0xb8,0x20}, - {0xbe,0x36}, - {0xbf,0x00}, - ///////////////////////////////////////////////////////////////////// - ///////////////////////////AEC_t/////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0xd0,0xc9}, - {0xd1,0x10}, - // {0xd2,0x90}, - {0xd3,0x80}, - {0xd5,0xf2}, - {0xd6,0x16}, - {0xdb,0x92}, - {0xdc,0xa5}, - {0xdf,0x23}, - {0xd9,0x00}, - {0xda,0x00}, - {0xe0,0x09}, - - {0xec,0x20}, - {0xed,0x04}, - {0xee,0xa0}, - {0xef,0x40}, - - //Y_gamma - {0xc0,0x00}, - {0xc1,0x0B}, - {0xc2,0x15}, - {0xc3,0x27}, - {0xc4,0x39}, - {0xc5,0x49}, - {0xc6,0x5A}, - {0xc7,0x6A}, - {0xc8,0x89}, - {0xc9,0xA8}, - {0xca,0xC6}, - {0xcb,0xE3}, - {0xcc,0xFF}, - - ///////////////////////////////////////////////////////////////// - /////////////////////////// ABS_t /////////////////////////////// - ///////////////////////////////////////////////////////////////// - {0xf0,0x02}, - {0xf1,0x01}, - {0xf2,0x00}, - {0xf3,0x30}, - - ///////////////////////////////////////////////////////////////// - /////////////////////////// Measure Window /////////////////////// - ///////////////////////////////////////////////////////////////// - {0xf7,0x04}, - {0xf8,0x02}, - {0xf9,0x9f}, - {0xfa,0x78}, - -#else - {0xfe,0x80}, // soft reset - - {0x1a,0x16}, - {0xd2,0x10}, // close AEC - {0x22,0x55}, // close AWB - - {0x5a,0x56}, - {0x5b,0x40}, - {0x5c,0x4a}, - - {0x22,0x57}, - - {0x01,0xfa}, - {0x02,0x70}, - {0x0f,0x01}, - - {0xe2,0x00}, - {0xe3,0x64}, - - {0x03,0x01}, - {0x04,0x2c}, - - - {0x05,0x00}, - {0x06,0x00}, - {0x07,0x00}, - {0x08,0x00}, - {0x09,0x01}, - {0x0a,0xe8}, - {0x0b,0x02}, - {0x0c,0x88}, - {0x0d,0x02}, - {0x0e,0x02}, - {0x10,0x22}, - {0x11,0x0d}, - {0x12,0x2a}, - {0x13,0x00}, - - {0x15,0x0a}, - {0x16,0x05}, - {0x17,0x01}, - - {0x1b,0x03}, - {0x1c,0xc1}, - {0x1d,0x08}, - {0x1e,0x20}, - {0x1f,0x16}, - - {0x20,0xff}, - {0x21,0xf8}, - {0x24,0xa2}, - {0x25,0x0f}, - //output sync_mode - {0x26,0x03}, - {0x2f,0x01}, - ///////////////////////////////////////////////////////////////////// - /////////////////////////// grab_t //////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x30,0xf7}, - {0x31,0x40}, - {0x32,0x00}, - {0x39,0x04}, - {0x3a,0x20}, - {0x3b,0x20}, - {0x3c,0x02}, - {0x3d,0x02}, - {0x3e,0x02}, - {0x3f,0x02}, - - //gain - {0x50,0x24}, - - {0x53,0x82}, - {0x54,0x80}, - {0x55,0x80}, - {0x56,0x82}, - - ///////////////////////////////////////////////////////////////////// - /////////////////////////// LSC_t //////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x8b,0x20}, - {0x8c,0x20}, - {0x8d,0x20}, - {0x8e,0x10}, - {0x8f,0x10}, - {0x90,0x10}, - {0x91,0x3c}, - {0x92,0x50}, - {0x5d,0x12}, - {0x5e,0x1a}, - {0x5f,0x24}, - ///////////////////////////////////////////////////////////////////// - /////////////////////////// DNDD_t /////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x60,0x07}, - {0x61,0x0e}, - {0x62,0x0c}, - {0x64,0x03}, - {0x66,0xe8}, - {0x67,0x86}, - {0x68,0xa2}, - - ///////////////////////////////////////////////////////////////////// - /////////////////////////// asde_t /////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x69,0x20}, - {0x6a,0x0f}, - {0x6b,0x00}, - {0x6c,0x53}, - {0x6d,0x83}, - {0x6e,0xac}, - {0x6f,0xac}, - {0x70,0x15}, - {0x71,0x33}, - ///////////////////////////////////////////////////////////////////// - /////////////////////////// eeintp_t/////////////////////////////// -#endif - {0x23,0x00}, - {0x2d,0x0a}, // 0x08 - {0x20,0xff}, - {0xd2,0x90}, - {0x73,0x00}, - {0x77,0x54}, - - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x00}, - {0xbb,0x00}, - SensorEnd -}; -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={ - SensorEnd - -}; -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] ={ - SensorEnd -}; -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data[] = -{ - SensorEnd -}; -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[]={ - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[]={ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_softreset_data[]={ - SensorRegVal(0xfe,80), - SensorWaitMs(5), - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[]={ - SensorRegVal(0x00,0), - SensorEnd -}; -/* -* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx -*/ -static struct rk_sensor_reg sensor_WhiteB_Auto[]= -{ - {0x5a,0x56}, //for AWB can adjust back - {0x5b,0x40}, - {0x5c,0x4a}, - {0x22,0x57}, // Enable AWB - SensorEnd -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[]= -{ - {0x22,0x55}, // Disable AWB - {0x5a,0x8c}, //WB_manual_gain - {0x5b,0x50}, - {0x5c,0x40}, - SensorEnd -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x22,0x55}, - {0x5a,0x74}, - {0x5b,0x52}, - {0x5c,0x40}, - SensorEnd -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]= -{ - //Incandescent - {0x22,0x55}, - {0x5a,0x48}, - {0x5b,0x40}, - {0x5c,0x5c}, - SensorEnd - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]= -{ - //fluorescent - {0x22,0x55}, - {0x5a,0x40}, - {0x5b,0x42}, - {0x5c,0x50}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[]= -{ - // Brightness -2 - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[]= -{ - // Brightness -1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[]= -{ - // Brightness 0 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[]= -{ - // Brightness +1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[]= -{ - // Brightness +2 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[]= -{ - // Brightness +3 - - SensorEnd -}; -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = -{ - {0x23,0x00}, - {0x2d,0x0a}, // 0x08 - {0x20,0xff}, - {0xd2,0x90}, - {0x73,0x00}, - {0x77,0x54}, - - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x00}, - {0xbb,0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = -{ - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0xbf}, - {0xd2,0x10}, - {0x73,0x01}, - - {0x51,0x40}, - {0x52,0x40}, - {0xb3,0x60}, - {0xb4,0x40}, - {0xba,0x00}, - {0xbb,0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = -{ - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0xff}, - {0xd2,0x90}, - {0x73,0x00}, - - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0xd0}, - {0xbb,0x28}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Negative[] = -{ - //Negative - {0x23,0x03}, - {0x2d,0x0a}, - {0x20,0xff}, - {0xd2,0x90}, - {0x73,0x00}, - - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x00}, - {0xbb,0x00}, - SensorEnd -}; -static struct rk_sensor_reg sensor_Effect_Bluish[] = -{ - //Bluish - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0xff}, - {0xd2,0x90}, - {0x73,0x00}, - - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x50}, - {0xbb,0xe0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = -{ - //Greenish - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0xff}, - {0xd2,0x90}, - {0x77,0x88}, - - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0xc0}, - {0xbb,0xc0}, - SensorEnd -}; -#if 0 -static struct rk_sensor_reg sensor_Effect_Grayscale[]= -{ - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0xff}, - {0xd2,0x90}, - {0x73,0x00}, - - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x00}, - {0xbb,0x00}, - {0x00,0x00}, - SensorEnd - -}; -#endif -static struct rk_sensor_reg *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; - -static struct rk_sensor_reg sensor_Exposure0[]= -{ - //-3 - {0xb5, 0xe8}, - {0xd3, 0x38}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure1[]= -{ - //-2 - {0xb5, 0xf0}, - {0xd3, 0x40}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure2[]= -{ - //-1 - {0xb5, 0xf8}, - {0xd3, 0x48}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure3[]= -{ - //default - {0xb5, 0x00}, - {0xd3, 0x50}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure4[]= -{ - // 1 - {0xb5, 0x08}, - {0xd3, 0x58}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure5[]= -{ - // 2 - {0xb5, 0x10}, - {0xd3, 0x60}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure6[]= -{ - // 3 - {0xb5, 0x18}, - {0xd3, 0x68}, - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; - -static struct rk_sensor_reg sensor_Saturation0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -static struct rk_sensor_reg sensor_Contrast0[]= -{ - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast1[]= -{ - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast2[]= -{ - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast3[]= -{ - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast4[]= -{ - - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Contrast5[]= -{ - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast6[]= -{ - - SensorEnd -}; -static struct rk_sensor_reg *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; -static struct rk_sensor_reg sensor_SceneAuto[] = -{ - {0xec, 0x20}, - {0x20, 0x7f}, // close cc - {0x3c, 0x02}, - {0x3d, 0x02}, - {0x3e, 0x02}, - {0x3f, 0x02}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = -{ - //30fps ~ 5fps night mode for 60/50Hz light environment, 24Mhz clock input,36Mzh pclk - {0xec, 0x30}, - {0x20, 0x5f}, // close cc - {0x3c, 0x08}, - {0x3d, 0x08}, - {0x3e, 0x08}, - {0x3f, 0x08}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -static struct rk_sensor_reg sensor_Zoom0[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Zoom3[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; - -/* -* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu -*/ -static struct v4l2_querymenu sensor_menus[] = -{ -}; -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = -{ -}; - -//MUST define the current used format as the first item -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {MEDIA_BUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; -/*static struct soc_camera_ops sensor_ops;*/ - - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - - return 0; -} -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - - return 0; -} -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - - return 0; -} -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh (struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - return 0; -} -static int sensor_try_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf) -{ - return 0; -} - -static int sensor_softrest_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - return 0; -} -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("Suspend"); - - } else { - SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n",pm_msg.event); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - - SENSOR_DG("Resume"); - - return 0; - -} -static int sensor_mirror_cb (struct i2c_client *client, int mirror) -{ - char val; - int err = 0; - SENSOR_DG("mirror: %d",mirror); - if (mirror) { - sensor_write(client, 0xfe, 0); - err = sensor_read(client, 0x14, &val); - if (err == 0) { - if((val & 0x1) == 0) - err = sensor_write(client, 0x14, (val |0x1)); - else - err = sensor_write(client, 0x14, (val & 0xfe)); - } - } else { - //do nothing - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_mirror_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_mirror failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_mirror success, value:0x%x",ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - char val; - int err = 0; - SENSOR_DG("flip: %d",flip); - if (flip) { - sensor_write(client, 0xfe, 0); - err = sensor_read(client, 0x14, &val); - if (err == 0) { - if((val & 0x2) == 0) - err = sensor_write(client, 0x14, (val |0x2)); - else - err = sensor_write(client, 0x14, (val & 0xfc)); - } - } else { - //do nothing - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_flip_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_flip failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_flip success, value:0x%x",ext_ctrl->value); - return 0; -} -/* -* the functions are focus callbacks -*/ -static int sensor_focus_init_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos){ - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client){ - return 0; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos) -{ - return 0; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client,int on){ - return 0; -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor* spsensor,struct soc_camera_device *icd) -{ - return; -} - -/* -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); - - - - diff --git a/drivers/media/video/gc0309_for_td8801.c b/drivers/media/video/gc0309_for_td8801.c deleted file mode 100644 index ebb91e16af78..000000000000 --- a/drivers/media/video/gc0309_for_td8801.c +++ /dev/null @@ -1,2830 +0,0 @@ -/* -o* Driver for MT9M001 CMOS Image Sensor from Micron - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_GC0309 -#define SENSOR_V4L2_IDENT V4L2_IDENT_GC0309 -#define SENSOR_ID 0xa0 -#define SENSOR_MIN_WIDTH 176 -#define SENSOR_MIN_HEIGHT 144 -#define SENSOR_MAX_WIDTH 640 -#define SENSOR_MAX_HEIGHT 480 -#define SENSOR_INIT_WIDTH 640 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 480 -#define SENSOR_INIT_WINSEQADR sensor_vga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_YUYV8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 1 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 0 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 - -#define CONFIG_SENSOR_I2C_SPEED 250000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING|\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) - -struct reginfo -{ - u8 reg; - u8 val; -}; - -/* init SVGA preview */ -static struct reginfo sensor_init_data[] = -{ - /*init registers code.*/ -#if 1 - {0xfe,0x80}, // soft reset - - {0x1a,0x16}, - {0xd2,0x10}, // close AEC - {0x22,0x55}, // close AWB - - {0x5a,0x56}, - {0x5b,0x40}, - {0x5c,0x4a}, - - {0x22,0x57}, - - {0x01,0xfa}, - {0x02,0x70}, - {0x0f,0x01}, - - {0xe2,0x00}, - {0xe3,0x64}, - - {0x03,0x01}, - {0x04,0x2c}, - - {0x05,0x00}, - {0x06,0x00}, - {0x07,0x00}, - {0x08,0x00}, - {0x09,0x01}, - {0x0a,0xe8}, - {0x0b,0x02}, - {0x0c,0x88}, - {0x0d,0x02}, - {0x0e,0x02}, - {0x10,0x22}, - {0x11,0x0d}, - {0x12,0x2a}, - {0x13,0x00}, - {0x14,0x13}, - {0x15,0x0a}, - {0x16,0x05}, - {0x17,0x01}, - - {0x1b,0x03}, - {0x1c,0xc1}, - {0x1d,0x08}, - {0x1e,0x20}, - {0x1f,0x16}, - - {0x20,0xff}, - {0x21,0xf8}, - {0x24,0xa0}, - {0x25,0x0f}, - //output sync_mode - {0x26,0x03}, - {0x2f,0x01}, - ///////////////////////////////////////////////////////////////////// - /////////////////////////// grab_t //////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x30,0xf7}, - {0x31,0x40}, - {0x32,0x00}, - {0x39,0x04}, - {0x3a,0x20}, - {0x3b,0x20}, - {0x3c,0x02}, - {0x3d,0x02}, - {0x3e,0x02}, - {0x3f,0x02}, - - //gain - {0x50,0x24}, - - {0x53,0x82}, - {0x54,0x80}, - {0x55,0x80}, - {0x56,0x82}, - - ///////////////////////////////////////////////////////////////////// - /////////////////////////// LSC_t //////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x8b,0x20}, - {0x8c,0x20}, - {0x8d,0x20}, - {0x8e,0x10}, - {0x8f,0x10}, - {0x90,0x10}, - {0x91,0x3c}, - {0x92,0x50}, - {0x5d,0x12}, - {0x5e,0x1a}, - {0x5f,0x24}, - ///////////////////////////////////////////////////////////////////// - /////////////////////////// DNDD_t /////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x60,0x07}, - {0x61,0x0e}, - {0x62,0x0c}, - {0x64,0x03}, - {0x66,0xe8}, - {0x67,0x86}, - {0x68,0xa2}, - - ///////////////////////////////////////////////////////////////////// - /////////////////////////// asde_t /////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x69,0x20}, - {0x6a,0x0f}, - {0x6b,0x00}, - {0x6c,0x53}, - {0x6d,0x83}, - {0x6e,0xac}, - {0x6f,0xac}, - {0x70,0x15}, - {0x71,0x33}, - ///////////////////////////////////////////////////////////////////// - /////////////////////////// eeintp_t/////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x72,0xdc}, - {0x73,0x80}, - //for high resolution in light scene - {0x74,0x02}, - {0x75,0x3f}, - {0x76,0x02}, - {0x77,0x54}, - {0x78,0x88}, - {0x79,0x81}, - {0x7a,0x81}, - {0x7b,0x22}, - {0x7c,0xff}, - - - ///////////////////////////////////////////////////////////////////// - ///////////////////////////CC_t/////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x93,0x45}, - {0x94,0x00}, - {0x95,0x00}, - {0x96,0x00}, - {0x97,0x45}, - {0x98,0xf0}, - {0x9c,0x00}, - {0x9d,0x03}, - {0x9e,0x00}, - - - - ///////////////////////////////////////////////////////////////////// - ///////////////////////////YCP_t/////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0xb1,0x40}, - {0xb2,0x40}, - {0xb8,0x20}, - {0xbe,0x36}, - {0xbf,0x00}, - ///////////////////////////////////////////////////////////////////// - ///////////////////////////AEC_t/////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0xd0,0xc9}, - {0xd1,0x10}, -// {0xd2,0x90}, - {0xd3,0x80}, - {0xd5,0xf2}, - {0xd6,0x16}, - {0xdb,0x92}, - {0xdc,0xa5}, - {0xdf,0x23}, - {0xd9,0x00}, - {0xda,0x00}, - {0xe0,0x09}, - - {0xec,0x20}, - {0xed,0x04}, - {0xee,0xa0}, - {0xef,0x40}, - - //Y_gamma - {0xc0,0x00}, - {0xc1,0x0B}, - {0xc2,0x15}, - {0xc3,0x27}, - {0xc4,0x39}, - {0xc5,0x49}, - {0xc6,0x5A}, - {0xc7,0x6A}, - {0xc8,0x89}, - {0xc9,0xA8}, - {0xca,0xC6}, - {0xcb,0xE3}, - {0xcc,0xFF}, - - ///////////////////////////////////////////////////////////////// - /////////////////////////// ABS_t /////////////////////////////// - ///////////////////////////////////////////////////////////////// - {0xf0,0x02}, - {0xf1,0x01}, - {0xf2,0x00}, - {0xf3,0x30}, - - ///////////////////////////////////////////////////////////////// - /////////////////////////// Measure Window /////////////////////// - ///////////////////////////////////////////////////////////////// - {0xf7,0x04}, - {0xf8,0x02}, - {0xf9,0x9f}, - {0xfa,0x78}, - -#else - {0xfe,0x80}, // soft reset - - {0x1a,0x16}, - {0xd2,0x10}, // close AEC - {0x22,0x55}, // close AWB - - {0x5a,0x56}, - {0x5b,0x40}, - {0x5c,0x4a}, - - {0x22,0x57}, - - {0x01,0xfa}, - {0x02,0x70}, - {0x0f,0x01}, - - {0xe2,0x00}, - {0xe3,0x64}, - - {0x03,0x01}, - {0x04,0x2c}, - - - {0x05,0x00}, - {0x06,0x00}, - {0x07,0x00}, - {0x08,0x00}, - {0x09,0x01}, - {0x0a,0xe8}, - {0x0b,0x02}, - {0x0c,0x88}, - {0x0d,0x02}, - {0x0e,0x02}, - {0x10,0x22}, - {0x11,0x0d}, - {0x12,0x2a}, - {0x13,0x00}, - - {0x15,0x0a}, - {0x16,0x05}, - {0x17,0x01}, - - {0x1b,0x03}, - {0x1c,0xc1}, - {0x1d,0x08}, - {0x1e,0x20}, - {0x1f,0x16}, - - {0x20,0xff}, - {0x21,0xf8}, - {0x24,0xa2}, - {0x25,0x0f}, - //output sync_mode - {0x26,0x03}, - {0x2f,0x01}, - ///////////////////////////////////////////////////////////////////// - /////////////////////////// grab_t //////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x30,0xf7}, - {0x31,0x40}, - {0x32,0x00}, - {0x39,0x04}, - {0x3a,0x20}, - {0x3b,0x20}, - {0x3c,0x02}, - {0x3d,0x02}, - {0x3e,0x02}, - {0x3f,0x02}, - - //gain - {0x50,0x24}, - - {0x53,0x82}, - {0x54,0x80}, - {0x55,0x80}, - {0x56,0x82}, - - ///////////////////////////////////////////////////////////////////// - /////////////////////////// LSC_t //////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x8b,0x20}, - {0x8c,0x20}, - {0x8d,0x20}, - {0x8e,0x10}, - {0x8f,0x10}, - {0x90,0x10}, - {0x91,0x3c}, - {0x92,0x50}, - {0x5d,0x12}, - {0x5e,0x1a}, - {0x5f,0x24}, - ///////////////////////////////////////////////////////////////////// - /////////////////////////// DNDD_t /////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x60,0x07}, - {0x61,0x0e}, - {0x62,0x0c}, - {0x64,0x03}, - {0x66,0xe8}, - {0x67,0x86}, - {0x68,0xa2}, - - ///////////////////////////////////////////////////////////////////// - /////////////////////////// asde_t /////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x69,0x20}, - {0x6a,0x0f}, - {0x6b,0x00}, - {0x6c,0x53}, - {0x6d,0x83}, - {0x6e,0xac}, - {0x6f,0xac}, - {0x70,0x15}, - {0x71,0x33}, - ///////////////////////////////////////////////////////////////////// - /////////////////////////// eeintp_t/////////////////////////////// -#endif - {0x23,0x00}, - {0x2d,0x0a}, // 0x08 - {0x20,0xff}, - {0xd2,0x90}, - {0x73,0x00}, - {0x77,0x54}, - - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x00}, - {0xbb,0x00}, - {0x00,0x00} -}; - - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - //{0x45 , 0x0f}, //output enable - {0x15 , 0x0a}, //output enable - {0x0,0x0} -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{}; - - -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {0x24,0xa2}, - {0x00, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {0x24,0xa0}, - {0x00, 0x00} -}; - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0x5a,0x56}, //for AWB can adjust back - {0x5b,0x40}, - {0x5c,0x4a}, - {0x22,0x57}, // Enable AWB - {0x00, 0x00} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0x22,0x55}, // Disable AWB - {0x5a,0x8c}, //WB_manual_gain - {0x5b,0x50}, - {0x5c,0x40}, - {0x00, 0x00} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x22,0x55}, - {0x5a,0x74}, - {0x5b,0x52}, - {0x5c,0x40}, - {0x00, 0x00} -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_Incandescent[]= -{ - //Incandescent - {0x22,0x55}, - {0x5a,0x48}, - {0x5b,0x40}, - {0x5c,0x5c}, - {0x00, 0x00} - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_Fluorescent[]= -{ - //fluorescent - {0x22,0x55}, - {0x5a,0x40}, - {0x5b,0x42}, - {0x5c,0x50}, - {0x00, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_Incandescent,sensor_WhiteB_Fluorescent, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - // Brightness -2 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness1[]= -{ - // Brightness -1 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - // Brightness 0 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - // Brightness +1 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - // Brightness +2 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - // Brightness +3 - - {0x00, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x23,0x00}, - {0x2d,0x0a}, // 0x08 - {0x20,0xff}, - {0xd2,0x90}, - {0x73,0x00}, - {0x77,0x54}, - - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x00}, - {0xbb,0x00}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0xbf}, - {0xd2,0x10}, - {0x73,0x01}, - - {0x51,0x40}, - {0x52,0x40}, - {0xb3,0x60}, - {0xb4,0x40}, - {0xba,0x00}, - {0xbb,0x00}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0xff}, - {0xd2,0x90}, - {0x73,0x00}, - - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0xd0}, - {0xbb,0x28}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - //Negative - {0x23,0x03}, - {0x2d,0x0a}, - {0x20,0xff}, - {0xd2,0x90}, - {0x73,0x00}, - - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x00}, - {0xbb,0x00}, - {0x00, 0x00} -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - // Bluish - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0xff}, - {0xd2,0x90}, - {0x73,0x00}, - - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x50}, - {0xbb,0xe0}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0xff}, - {0xd2,0x90}, - {0x77,0x88}, - - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0xc0}, - {0xbb,0xc0}, - {0x00, 0x00} -}; - - -static struct reginfo sensor_Effect_Grayscale[]= -{ - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0xff}, - {0xd2,0x90}, - {0x73,0x00}, - - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x00}, - {0xbb,0x00}, - {0x00, 0x00} -}; - -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,sensor_Effect_Grayscale,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - //-3 - -}; - -static struct reginfo sensor_Exposure1[]= -{ - //-2 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - //-0.3EV - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - //default - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - // 1 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - // 2 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - // 3 - - {0x00, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - - {0x00, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - //Contrast -3 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - //Contrast -2 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast2[]= -{ - // Contrast -1 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - //Contrast 0 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - //Contrast +1 - - {0x00, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - //Contrast +2 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - //Contrast +3 - - {0x00, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - - {0x00, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - - {0x00, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ -#if 0 /* ddl@rock-chips.com : */ - {0x3014, 0x04}, - {0x3015, 0x00}, - {0x302e, 0x00}, - {0x302d, 0x00}, - {0x00, 0x00} -#else - {0xec ,0x20}, - {0x20 ,0x7f}, // close cc - {0x3c ,0x02}, - {0x3d ,0x02}, - {0x3e ,0x02}, - {0x3f ,0x02}, - {0x00, 0x00} -#endif -}; - -static struct reginfo sensor_SceneNight[] = -{ -#if 1 - //30fps ~ 5fps night mode for 60/50Hz light environment, 24Mhz clock input,36Mzh pclk - {0xec ,0x30}, - {0x20 ,0x5f}, // close cc - {0x3c ,0x08}, - {0x3d ,0x08}, - {0x3e ,0x08}, - {0x3f ,0x08}, - {0x00, 0x00} -#else - //15fps ~ 5fps night mode for 60/50Hz light environment, 24Mhz clock input,18Mhz pclk - {0x300e, 0x34}, - {0x3011, 0x01}, - {0x302c, 0x00}, - {0x3071, 0x00}, - {0x3070, 0x5d}, - {0x301c, 0x05}, - {0x3073, 0x00}, - {0x3072, 0x4d}, - {0x301d, 0x07}, - {0x3014, 0x0c}, - {0x3015, 0x50}, - {0x302e, 0x00}, - {0x302d, 0x00}, -#endif -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom1[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom2[] = -{ - {0x0, 0x0}, -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {0x0, 0x0}, -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif -static const struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 6, .name = "grayscale", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static const struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - unsigned int winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int funmodule_state; -} sensor_info_priv_t; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - -#if 0 -/* sensor register */ -static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) -{ - int ret = 0; - - ret = i2c_master_reg8_recv(client, reg, val, 1, CONFIG_SENSOR_I2C_SPEED); - - return (ret > 0)? 0 : ret; -} - -static int sensor_write(struct i2c_client *client, u8 reg, u8 val) -{ - int ret = 0; - - ret = i2c_master_reg8_send(client, reg, &val, 1, CONFIG_SENSOR_I2C_SPEED); - - return (ret > 0)? 0 : ret; -} -#else -static int sensor_write(struct i2c_client *client, u8 reg, u8 val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[1]; - - buf[0] = reg; - buf[1] = val; - - if (reg == 0xfe) - mdelay(10); - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) -{ - int err,cnt; - u8 buf[1]; - struct i2c_msg msg[2]; - - buf[0] = reg ; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -#endif - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_I2C_RDWRCHK - int j = 0; - char valchk; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - while (regarray[i].reg != 0) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - //mdelay(5); - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - i++; - } - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != 0) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_power_end: - return ret; -} -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - char value; - int ret; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - ret = sensor_write(client, 0xfe, 0x80); - if (ret != 0) - { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); //delay 5 microseconds - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x00, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - if (value == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), value); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - - sensor->info_priv.winseqe_cur_addr = (int)SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - //sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - #endif - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} - -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - sensor_ioctrl(icd, Sensor_PowerDown, 1); - msleep(100); - - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - - return 0; -} - -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - - return 0; - -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - int ret=0, set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) { - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - } else { /* ddl@rock-chips.com : Video */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - } - #endif - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - - sensor->info_priv.winseqe_cur_addr = (int)winseqe_set_addr; - - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - if (sensor->info_priv.whiteBalance != 0) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - sensor->info_priv.snap2preview = true; - } else if (sensor_fmt_videochk(sd,mf) == true) { /* ddl@rock-chips.com : Video */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - sensor->info_priv.video2preview = true; - } else if ((sensor->info_priv.snap2preview == true) || (sensor->info_priv.video2preview == true)) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - sensor->info_priv.video2preview = false; - sensor->info_priv.snap2preview = false; - } - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } else { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; - -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - set_w = 640; - set_h = 480; - } - - else - { - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - mf->width = set_w; - mf->height = set_h; - mf->colorspace = fmt->colorspace; - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV2655 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value > 0) && ((digitalzoom_cur + value) > digitalzoom_total)) - { - value = digitalzoom_total - digitalzoom_cur; - } - - if ((value < 0) && ((digitalzoom_cur + value) < 0)) - { - value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char value; - int ret; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - - /* soft reset */ - ret = sensor_write(client, 0xfe, 0x80); - if (ret != 0) - { - SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); - return -ENODEV; - } - mdelay(5); //delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x00, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - if (value == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - SENSOR_TR("chip id:0x%x\n",value); - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), value); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - - return ret; -} -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0; -#if CONFIG_SENSOR_Flash - int i; -#endif - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - sensor->sensor_gpio_res = NULL; - #if CONFIG_SENSOR_Flash - for (i=0; isensor_io_request->gpio_res[i].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[i].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[i]; - } - } - #endif - if (sensor->sensor_gpio_res == NULL) { - SENSOR_TR("%s %s obtain gpio resource failed when RK29_CAM_SUBDEV_IOREQUEST \n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - - sensor->info_priv.fmt = sensor_colour_fmts[0]; - - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - - - diff --git a/drivers/media/video/gc0309_old.c b/drivers/media/video/gc0309_old.c deleted file mode 100755 index ddc21d9086f6..000000000000 --- a/drivers/media/video/gc0309_old.c +++ /dev/null @@ -1,2862 +0,0 @@ -/* -o* Driver for MT9M001 CMOS Image Sensor from Micron - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_GC0309 -#define SENSOR_V4L2_IDENT V4L2_IDENT_GC0309 -#define SENSOR_ID 0xa0 -#define SENSOR_MIN_WIDTH 176 -#define SENSOR_MIN_HEIGHT 144 -#define SENSOR_MAX_WIDTH 640 -#define SENSOR_MAX_HEIGHT 480 -#define SENSOR_INIT_WIDTH 640 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 480 -#define SENSOR_INIT_WINSEQADR sensor_vga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_YUYV8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 1 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 1 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 - -#define CONFIG_SENSOR_I2C_SPEED 250000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING|\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) - -struct reginfo -{ - u8 reg; - u8 val; -}; -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); - -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_GC0309_USER_DEFINED_SERIES -#include "gc0309_user_series.c" -#else -/* init SVGA preview */ -static struct reginfo sensor_init_data[] = -{ - /*init registers code.*/ -#if 1 - {0xfe,0x80}, // soft reset - - {0x1a,0x16}, - {0xd2,0x10}, // close AEC - {0x22,0x55}, // close AWB - - {0x5a,0x56}, - {0x5b,0x40}, - {0x5c,0x4a}, - - {0x22,0x57}, - - {0x01,0xfa}, - {0x02,0x70}, - {0x0f,0x01}, - - {0xe2,0x00}, - {0xe3,0x64}, - - {0x03,0x01}, - {0x04,0x2c}, - - {0x05,0x00}, - {0x06,0x00}, - {0x07,0x00}, - {0x08,0x00}, - {0x09,0x01}, - {0x0a,0xe8}, - {0x0b,0x02}, - {0x0c,0x88}, - {0x0d,0x02}, - {0x0e,0x02}, - {0x10,0x22}, - {0x11,0x0d}, - {0x12,0x2a}, - {0x13,0x00}, - {0x14,0x11}, - {0x15,0x0a}, - {0x16,0x05}, - {0x17,0x01}, - - {0x1b,0x03}, - {0x1c,0xc1}, - {0x1d,0x08}, - {0x1e,0x20}, - {0x1f,0x16}, - - {0x20,0xff}, - {0x21,0xf8}, - {0x24,0xa0}, - {0x25,0x0f}, - //output sync_mode - {0x26,0x03}, - {0x2f,0x01}, - ///////////////////////////////////////////////////////////////////// - /////////////////////////// grab_t //////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x30,0xf7}, - {0x31,0x40}, - {0x32,0x00}, - {0x39,0x04}, - {0x3a,0x20}, - {0x3b,0x20}, - {0x3c,0x02}, - {0x3d,0x02}, - {0x3e,0x02}, - {0x3f,0x02}, - - //gain - {0x50,0x24}, - - {0x53,0x82}, - {0x54,0x80}, - {0x55,0x80}, - {0x56,0x82}, - - ///////////////////////////////////////////////////////////////////// - /////////////////////////// LSC_t //////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x8b,0x20}, - {0x8c,0x20}, - {0x8d,0x20}, - {0x8e,0x10}, - {0x8f,0x10}, - {0x90,0x10}, - {0x91,0x3c}, - {0x92,0x50}, - {0x5d,0x12}, - {0x5e,0x1a}, - {0x5f,0x24}, - ///////////////////////////////////////////////////////////////////// - /////////////////////////// DNDD_t /////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x60,0x07}, - {0x61,0x0e}, - {0x62,0x0c}, - {0x64,0x03}, - {0x66,0xe8}, - {0x67,0x86}, - {0x68,0xa2}, - - ///////////////////////////////////////////////////////////////////// - /////////////////////////// asde_t /////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x69,0x20}, - {0x6a,0x0f}, - {0x6b,0x00}, - {0x6c,0x53}, - {0x6d,0x83}, - {0x6e,0xac}, - {0x6f,0xac}, - {0x70,0x15}, - {0x71,0x33}, - ///////////////////////////////////////////////////////////////////// - /////////////////////////// eeintp_t/////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x72,0xdc}, - {0x73,0x80}, - //for high resolution in light scene - {0x74,0x02}, - {0x75,0x3f}, - {0x76,0x02}, - {0x77,0x54}, - {0x78,0x88}, - {0x79,0x81}, - {0x7a,0x81}, - {0x7b,0x22}, - {0x7c,0xff}, - - - ///////////////////////////////////////////////////////////////////// - ///////////////////////////CC_t/////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x93,0x45}, - {0x94,0x00}, - {0x95,0x00}, - {0x96,0x00}, - {0x97,0x45}, - {0x98,0xf0}, - {0x9c,0x00}, - {0x9d,0x03}, - {0x9e,0x00}, - - - - ///////////////////////////////////////////////////////////////////// - ///////////////////////////YCP_t/////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0xb1,0x40}, - {0xb2,0x40}, - {0xb8,0x20}, - {0xbe,0x36}, - {0xbf,0x00}, - ///////////////////////////////////////////////////////////////////// - ///////////////////////////AEC_t/////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0xd0,0xc9}, - {0xd1,0x10}, -// {0xd2,0x90}, - {0xd3,0x80}, - {0xd5,0xf2}, - {0xd6,0x16}, - {0xdb,0x92}, - {0xdc,0xa5}, - {0xdf,0x23}, - {0xd9,0x00}, - {0xda,0x00}, - {0xe0,0x09}, - - {0xec,0x20}, - {0xed,0x04}, - {0xee,0xa0}, - {0xef,0x40}, - - //Y_gamma - {0xc0,0x00}, - {0xc1,0x0B}, - {0xc2,0x15}, - {0xc3,0x27}, - {0xc4,0x39}, - {0xc5,0x49}, - {0xc6,0x5A}, - {0xc7,0x6A}, - {0xc8,0x89}, - {0xc9,0xA8}, - {0xca,0xC6}, - {0xcb,0xE3}, - {0xcc,0xFF}, - - ///////////////////////////////////////////////////////////////// - /////////////////////////// ABS_t /////////////////////////////// - ///////////////////////////////////////////////////////////////// - {0xf0,0x02}, - {0xf1,0x01}, - {0xf2,0x00}, - {0xf3,0x30}, - - ///////////////////////////////////////////////////////////////// - /////////////////////////// Measure Window /////////////////////// - ///////////////////////////////////////////////////////////////// - {0xf7,0x04}, - {0xf8,0x02}, - {0xf9,0x9f}, - {0xfa,0x78}, - -#else - {0xfe,0x80}, // soft reset - - {0x1a,0x16}, - {0xd2,0x10}, // close AEC - {0x22,0x55}, // close AWB - - {0x5a,0x56}, - {0x5b,0x40}, - {0x5c,0x4a}, - - {0x22,0x57}, - - {0x01,0xfa}, - {0x02,0x70}, - {0x0f,0x01}, - - {0xe2,0x00}, - {0xe3,0x64}, - - {0x03,0x01}, - {0x04,0x2c}, - - - {0x05,0x00}, - {0x06,0x00}, - {0x07,0x00}, - {0x08,0x00}, - {0x09,0x01}, - {0x0a,0xe8}, - {0x0b,0x02}, - {0x0c,0x88}, - {0x0d,0x02}, - {0x0e,0x02}, - {0x10,0x22}, - {0x11,0x0d}, - {0x12,0x2a}, - {0x13,0x00}, - - {0x15,0x0a}, - {0x16,0x05}, - {0x17,0x01}, - - {0x1b,0x03}, - {0x1c,0xc1}, - {0x1d,0x08}, - {0x1e,0x20}, - {0x1f,0x16}, - - {0x20,0xff}, - {0x21,0xf8}, - {0x24,0xa2}, - {0x25,0x0f}, - //output sync_mode - {0x26,0x03}, - {0x2f,0x01}, - ///////////////////////////////////////////////////////////////////// - /////////////////////////// grab_t //////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x30,0xf7}, - {0x31,0x40}, - {0x32,0x00}, - {0x39,0x04}, - {0x3a,0x20}, - {0x3b,0x20}, - {0x3c,0x02}, - {0x3d,0x02}, - {0x3e,0x02}, - {0x3f,0x02}, - - //gain - {0x50,0x24}, - - {0x53,0x82}, - {0x54,0x80}, - {0x55,0x80}, - {0x56,0x82}, - - ///////////////////////////////////////////////////////////////////// - /////////////////////////// LSC_t //////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x8b,0x20}, - {0x8c,0x20}, - {0x8d,0x20}, - {0x8e,0x10}, - {0x8f,0x10}, - {0x90,0x10}, - {0x91,0x3c}, - {0x92,0x50}, - {0x5d,0x12}, - {0x5e,0x1a}, - {0x5f,0x24}, - ///////////////////////////////////////////////////////////////////// - /////////////////////////// DNDD_t /////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x60,0x07}, - {0x61,0x0e}, - {0x62,0x0c}, - {0x64,0x03}, - {0x66,0xe8}, - {0x67,0x86}, - {0x68,0xa2}, - - ///////////////////////////////////////////////////////////////////// - /////////////////////////// asde_t /////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x69,0x20}, - {0x6a,0x0f}, - {0x6b,0x00}, - {0x6c,0x53}, - {0x6d,0x83}, - {0x6e,0xac}, - {0x6f,0xac}, - {0x70,0x15}, - {0x71,0x33}, - ///////////////////////////////////////////////////////////////////// - /////////////////////////// eeintp_t/////////////////////////////// -#endif - {0x23,0x00}, - {0x2d,0x0a}, // 0x08 - {0x20,0xff}, - {0xd2,0x90}, - {0x73,0x00}, - {0x77,0x54}, - - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x00}, - {0xbb,0x00}, - {0x00,0x00} -}; - - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - //{0x45 , 0x0f}, //output enable - {0x15 , 0x0a}, //output enable - {0x0,0x0} -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{}; -#endif - -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {0x24,0xa2}, - {0x00, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {0x24,0xa0}, - {0x00, 0x00} -}; - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0x5a,0x56}, //for AWB can adjust back - {0x5b,0x40}, - {0x5c,0x4a}, - {0x22,0x57}, // Enable AWB - {0x00, 0x00} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0x22,0x55}, // Disable AWB - {0x5a,0x8c}, //WB_manual_gain - {0x5b,0x50}, - {0x5c,0x40}, - {0x00, 0x00} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x22,0x55}, - {0x5a,0x74}, - {0x5b,0x52}, - {0x5c,0x40}, - {0x00, 0x00} -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_Incandescent[]= -{ - //Incandescent - {0x22,0x55}, - {0x5a,0x48}, - {0x5b,0x40}, - {0x5c,0x5c}, - {0x00, 0x00} - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_Fluorescent[]= -{ - //fluorescent - {0x22,0x55}, - {0x5a,0x40}, - {0x5b,0x42}, - {0x5c,0x50}, - {0x00, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_Incandescent,sensor_WhiteB_Fluorescent, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - // Brightness -2 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness1[]= -{ - // Brightness -1 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - // Brightness 0 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - // Brightness +1 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - // Brightness +2 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - // Brightness +3 - - {0x00, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x23,0x00}, - {0x2d,0x0a}, // 0x08 - {0x20,0xff}, - {0xd2,0x90}, - {0x73,0x00}, - {0x77,0x54}, - - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x00}, - {0xbb,0x00}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0xbf}, - {0xd2,0x10}, - {0x73,0x01}, - - {0x51,0x40}, - {0x52,0x40}, - {0xb3,0x60}, - {0xb4,0x40}, - {0xba,0x00}, - {0xbb,0x00}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0xff}, - {0xd2,0x90}, - {0x73,0x00}, - - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0xd0}, - {0xbb,0x28}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - //Negative - {0x23,0x03}, - {0x2d,0x0a}, - {0x20,0xff}, - {0xd2,0x90}, - {0x73,0x00}, - - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x00}, - {0xbb,0x00}, - {0x00, 0x00} -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - // Bluish - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0xff}, - {0xd2,0x90}, - {0x73,0x00}, - - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x50}, - {0xbb,0xe0}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0xff}, - {0xd2,0x90}, - {0x77,0x88}, - - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0xc0}, - {0xbb,0xc0}, - {0x00, 0x00} -}; - - -static struct reginfo sensor_Effect_Grayscale[]= -{ - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0xff}, - {0xd2,0x90}, - {0x73,0x00}, - - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x00}, - {0xbb,0x00}, - {0x00, 0x00} -}; - -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,sensor_Effect_Grayscale,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - //-3 - -}; - -static struct reginfo sensor_Exposure1[]= -{ - //-2 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - //-0.3EV - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - //default - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - // 1 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - // 2 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - // 3 - - {0x00, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - - {0x00, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - //Contrast -3 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - //Contrast -2 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast2[]= -{ - // Contrast -1 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - //Contrast 0 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - //Contrast +1 - - {0x00, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - //Contrast +2 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - //Contrast +3 - - {0x00, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - - {0x00, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - - {0x00, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ -#if 0 /* ddl@rock-chips.com : */ - {0x3014, 0x04}, - {0x3015, 0x00}, - {0x302e, 0x00}, - {0x302d, 0x00}, - {0x00, 0x00} -#else - {0xec ,0x20}, - {0x20 ,0x7f}, // close cc - {0x3c ,0x02}, - {0x3d ,0x02}, - {0x3e ,0x02}, - {0x3f ,0x02}, - {0x00, 0x00} -#endif -}; - -static struct reginfo sensor_SceneNight[] = -{ -#if 1 - //30fps ~ 5fps night mode for 60/50Hz light environment, 24Mhz clock input,36Mzh pclk - {0xec ,0x30}, - {0x20 ,0x5f}, // close cc - {0x3c ,0x08}, - {0x3d ,0x08}, - {0x3e ,0x08}, - {0x3f ,0x08}, - {0x00, 0x00} -#else - //15fps ~ 5fps night mode for 60/50Hz light environment, 24Mhz clock input,18Mhz pclk - {0x300e, 0x34}, - {0x3011, 0x01}, - {0x302c, 0x00}, - {0x3071, 0x00}, - {0x3070, 0x5d}, - {0x301c, 0x05}, - {0x3073, 0x00}, - {0x3072, 0x4d}, - {0x301d, 0x07}, - {0x3014, 0x0c}, - {0x3015, 0x50}, - {0x302e, 0x00}, - {0x302d, 0x00}, -#endif -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom1[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom2[] = -{ - {0x0, 0x0}, -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {0x0, 0x0}, -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif -static const struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 6, .name = "grayscale", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - unsigned int winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int funmodule_state; -} sensor_info_priv_t; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - -#if 0 -/* sensor register */ -static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) -{ - int ret = 0; - - ret = i2c_master_reg8_recv(client, reg, val, 1, CONFIG_SENSOR_I2C_SPEED); - - return (ret > 0)? 0 : ret; -} - -static int sensor_write(struct i2c_client *client, u8 reg, u8 val) -{ - int ret = 0; - - ret = i2c_master_reg8_send(client, reg, &val, 1, CONFIG_SENSOR_I2C_SPEED); - - return (ret > 0)? 0 : ret; -} -#else -static int sensor_write(struct i2c_client *client, u8 reg, u8 val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[1]; - - buf[0] = reg; - buf[1] = val; - - if (reg == 0xfe) - mdelay(10); - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) -{ - int err,cnt; - u8 buf[1]; - struct i2c_msg msg[2]; - - buf[0] = reg ; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -#endif - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_I2C_RDWRCHK - int j = 0; - char valchk; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - while (regarray[i].reg != 0) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - //mdelay(5); - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - i++; - } - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != 0) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_power_end: - return ret; -} - -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - char value; - int ret; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - ret = sensor_write(client, 0xfe, 0x80); - if (ret != 0) - { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); //delay 5 microseconds - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x00, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - if (value == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), value); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - - sensor->info_priv.winseqe_cur_addr = (int)SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - //sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} - -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - sensor_ioctrl(icd, Sensor_PowerDown, 1); - msleep(100); - - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - - return 0; -} - -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - - return 0; - -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - int ret=0, set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) { - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - } else { /* ddl@rock-chips.com : Video */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - } - #endif - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - - sensor->info_priv.winseqe_cur_addr = (int)winseqe_set_addr; - - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - if (sensor->info_priv.whiteBalance != 0) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - sensor->info_priv.snap2preview = true; - } else if (sensor_fmt_videochk(sd,mf) == true) { /* ddl@rock-chips.com : Video */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - sensor->info_priv.video2preview = true; - } else if ((sensor->info_priv.snap2preview == true) || (sensor->info_priv.video2preview == true)) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - sensor->info_priv.video2preview = false; - sensor->info_priv.snap2preview = false; - } - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } else { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; - -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - set_w = 640; - set_h = 480; - } - - else - { - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - mf->width = set_w; - mf->height = set_h; - mf->colorspace = fmt->colorspace; - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV2655 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value > 0) && ((digitalzoom_cur + value) > digitalzoom_total)) - { - value = digitalzoom_total - digitalzoom_cur; - } - - if ((value < 0) && ((digitalzoom_cur + value) < 0)) - { - value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char value; - int ret; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - - /* soft reset */ - ret = sensor_write(client, 0xfe, 0x80); - if (ret != 0) - { - SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); - return -ENODEV; - } - mdelay(5); //delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x00, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - if (value == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - SENSOR_TR("chip id:0x%x\n",value); - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), value); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - - return ret; -} -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0; -#if CONFIG_SENSOR_Flash - int i; -#endif - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - sensor->sensor_gpio_res = NULL; - for (i=0; isensor_io_request->gpio_res[i].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[i].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[i]; - } - } - if (sensor->sensor_gpio_res == NULL) { - SENSOR_TR("%s %s obtain gpio resource failed when RK29_CAM_SUBDEV_IOREQUEST \n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - - sensor->info_priv.fmt = sensor_colour_fmts[0]; - - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - - - diff --git a/drivers/media/video/gc0312.c b/drivers/media/video/gc0312.c deleted file mode 100644 index 09a3ce1d26f9..000000000000 --- a/drivers/media/video/gc0312.c +++ /dev/null @@ -1,1258 +0,0 @@ -/* - * drivers/media/video/gc0312.c - * - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "generic_sensor.h" -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.0.3: -* add sensor_focus_af_const_pause_usr_cb; -*/ -static int version = KERNEL_VERSION(0, 0, 3); -module_param(version, int, S_IRUGO); - -static int debug; -module_param(debug, int, S_IRUGO | S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt, ## arg); \ -} while (0) - -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_GC0312 -#define SENSOR_V4L2_IDENT V4L2_IDENT_GC0312 -#define SENSOR_ID 0xb310 -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_PCLK_SAMPLE_RISING |\ - V4L2_MBUS_HSYNC_ACTIVE_HIGH |\ - V4L2_MBUS_VSYNC_ACTIVE_HIGH |\ - V4L2_MBUS_DATA_ACTIVE_HIGH |\ - SOCAM_MCLK_24MHZ) -#define SENSOR_PREVIEW_W 640 -#define SENSOR_PREVIEW_H 480 -#define SENSOR_PREVIEW_FPS 15000 -#define SENSOR_FULLRES_L_FPS 7500 -#define SENSOR_FULLRES_H_FPS 7500 -#define SENSOR_720P_FPS 0 -#define SENSOR_1080P_FPS 0 - -#define SENSOR_REGISTER_LEN 1 -#define SENSOR_VALUE_LEN 1 - -static unsigned int SensorConfiguration = - (CFG_WhiteBalance | CFG_Effect | CFG_Scene); -static unsigned int SensorChipID[] = { SENSOR_ID }; -/* Sensor Driver Configuration End */ - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a, b) CONS4(SensorReg, SENSOR_REGISTER_LEN, Val, SENSOR_VALUE_LEN)(a, b) -#define sensor_write(client, reg, v) CONS4(sensor_write_reg, SENSOR_REGISTER_LEN, val, SENSOR_VALUE_LEN)(client, (reg), (v)) -#define sensor_read(client, reg, v) CONS4(sensor_read_reg, SENSOR_REGISTER_LEN, val, SENSOR_VALUE_LEN)(client, (reg), (v)) -#define sensor_write_array generic_sensor_write_array - -struct sensor_parameter { - unsigned int PreviewDummyPixels; - unsigned int CaptureDummyPixels; - unsigned int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int PreviewPclk; - unsigned short int CapturePclk; - char awb[6]; -}; - -struct specific_sensor { - struct generic_sensor common_sensor; - /*define user data below*/ - struct sensor_parameter parameter; - -}; - -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ - -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_init_data[] = { - {0xfe, 0xf0}, - {0xfe, 0xf0}, - {0xfe, 0x00}, - {0xfc, 0x0e}, - {0xfc, 0x0e}, - {0xf2, 0x07}, - /*output_disable*/ - {0xf3, 0x00}, - {0xf7, 0x1b}, - {0xf8, 0x04}, - {0xf9, 0x0e}, - {0xfa, 0x11}, - - /*CISCTL reg*/ - {0x00, 0x2f}, - {0x01, 0x0f}, - {0x02, 0x04}, - {0x03, 0x03}, - {0x04, 0x50}, - {0x09, 0x00}, - {0x0a, 0x00}, - {0x0b, 0x00}, - {0x0c, 0x04}, - {0x0d, 0x01}, - {0x0e, 0xe8}, - {0x0f, 0x02}, - {0x10, 0x88}, - {0x16, 0x00}, - {0x17, 0x17}, - {0x18, 0x1a}, - {0x19, 0x14}, - {0x1b, 0x48}, - /*1c travis 20140929 update for lag*/ - {0x1c, 0x6c}, - {0x1e, 0x6b}, - {0x1f, 0x28}, - /*0x89 travis20140801*/ - {0x20, 0x8b}, - {0x21, 0x49}, - /*b0 travis 20140929 update for lag*/ - {0x22, 0xd0}, - {0x23, 0x04}, - {0x24, 0x16}, - {0x34, 0x20}, - - /*BLK*/ - {0x26, 0x23}, - {0x28, 0xff}, - {0x29, 0x00}, - /*{0x32, 0x04},*/ - {0x33, 0x10}, - {0x37, 0x20}, - {0x38, 0x10}, - {0x47, 0x80}, - {0x4e, 0x66}, - {0xa8, 0x02}, - {0xa9, 0x80}, - - /*ISP reg*/ - {0x40, 0xff}, - {0x41, 0x21}, - {0x42, 0xcf}, - {0x44, 0x02}, - {0x45, 0xa8}, - /*sync 02*/ - {0x46, 0x03}, - {0x4a, 0x11}, - {0x4b, 0x01}, - {0x4c, 0x20}, - {0x4d, 0x05}, - {0x4f, 0x01}, - {0x50, 0x01}, - {0x55, 0x01}, - {0x56, 0xe0}, - {0x57, 0x02}, - {0x58, 0x80}, - - /*GAIN*/ - {0x70, 0x70}, - {0x5a, 0x84}, - {0x5b, 0xc9}, - {0x5c, 0xed}, - {0x77, 0x74}, - {0x78, 0x40}, - {0x79, 0x5f}, - - /*DNDD*/ - {0x82, 0x14}, - {0x83, 0x0b}, - {0x89, 0xf0}, - - /*EEINTP*/ - {0x8f, 0xaa}, - {0x90, 0x8c}, - {0x91, 0x90}, - {0x92, 0x03}, - {0x93, 0x03}, - {0x94, 0x05}, - {0x95, 0x66}, - {0x96, 0xf0}, - - /*ASDE*/ - {0xfe, 0x00}, - - {0x9a, 0x20}, - {0x9b, 0x80}, - {0x9c, 0x40}, - {0x9d, 0x80}, - - {0xa1, 0x30}, - {0xa2, 0x32}, - {0xa4, 0x30}, - {0xa5, 0x30}, - {0xaa, 0x10}, - {0xac, 0x22}, - - /*GAMMA*/ - {0xfe, 0x00}, - {0xbf, 0x08}, - {0xc0, 0x16}, - {0xc1, 0x28}, - {0xc2, 0x41}, - {0xc3, 0x5a}, - {0xc4, 0x6c}, - {0xc5, 0x7a}, - {0xc6, 0x96}, - {0xc7, 0xac}, - {0xc8, 0xbc}, - {0xc9, 0xc9}, - {0xca, 0xd3}, - {0xcb, 0xdd}, - {0xcc, 0xe5}, - {0xcd, 0xf1}, - {0xce, 0xfa}, - {0xcf, 0xff}, -#if 0 - /*smallest gamma curve*/ - case GC0312MIPI_RGB_Gamma_m1: - {0xfe, 0x00}, - {0xbf, 0x06}, - {0xc0, 0x12}, - {0xc1, 0x22}, - {0xc2, 0x35}, - {0xc3, 0x4b}, - {0xc4, 0x5f}, - {0xc5, 0x72}, - {0xc6, 0x8d}, - {0xc7, 0xa4}, - {0xc8, 0xb8}, - {0xc9, 0xc8}, - {0xca, 0xd4}, - {0xcb, 0xde}, - {0xcc, 0xe6}, - {0xcd, 0xf1}, - {0xce, 0xf8}, - {0xcf, 0xfd}, - break; - case GC0312MIPI_RGB_Gamma_m2: - {0xBF, 0x08}, - {0xc0, 0x0F}, - {0xc1, 0x21}, - {0xc2, 0x32}, - {0xc3, 0x43}, - {0xc4, 0x50}, - {0xc5, 0x5E}, - {0xc6, 0x78}, - {0xc7, 0x90}, - {0xc8, 0xA6}, - {0xc9, 0xB9}, - {0xcA, 0xC9}, - {0xcB, 0xD6}, - {0xcC, 0xE0}, - {0xcD, 0xEE}, - {0xcE, 0xF8}, - {0xcF, 0xFF}, - break; - - case GC0312MIPI_RGB_Gamma_m3: - {0xBF, 0x0B}, - {0xc0, 0x16}, - {0xc1, 0x29}, - {0xc2, 0x3C}, - {0xc3, 0x4F}, - {0xc4, 0x5F}, - {0xc5, 0x6F}, - {0xc6, 0x8A}, - {0xc7, 0x9F}, - {0xc8, 0xB4}, - {0xc9, 0xC6}, - {0xcA, 0xD3}, - {0xcB, 0xDD}, - {0xcC, 0xE5}, - {0xcD, 0xF1}, - {0xcE, 0xFA}, - {0xcF, 0xFF}, - - - case GC0312MIPI_RGB_Gamma_m4: - {0xBF, 0x0E}, - {0xc0, 0x1C}, - {0xc1, 0x34}, - {0xc2, 0x48}, - {0xc3, 0x5A}, - {0xc4, 0x6B}, - {0xc5, 0x7B}, - {0xc6, 0x95}, - {0xc7, 0xAB}, - {0xc8, 0xBF}, - {0xc9, 0xCE}, - {0xcA, 0xD9}, - {0xcB, 0xE4}, - {0xcC, 0xEC}, - {0xcD, 0xF7}, - {0xcE, 0xFD}, - {0xcF, 0xFF}, - - - case GC0312MIPI_RGB_Gamma_m5: - {0xBF, 0x10}, - {0xc0, 0x20}, - {0xc1, 0x38}, - {0xc2, 0x4E}, - {0xc3, 0x63}, - {0xc4, 0x76}, - {0xc5, 0x87}, - {0xc6, 0xA2}, - {0xc7, 0xB8}, - {0xc8, 0xCA}, - {0xc9, 0xD8}, - {0xcA, 0xE3}, - {0xcB, 0xEB}, - {0xcC, 0xF0}, - {0xcD, 0xF8}, - {0xcE, 0xFD}, - {0xcF, 0xFF}, - - /*largest gamma curve*/ - case GC0312MIPI_RGB_Gamma_m6: - {0xBF, 0x14}, - {0xc0, 0x28}, - {0xc1, 0x44}, - {0xc2, 0x5D}, - {0xc3, 0x72}, - {0xc4, 0x86}, - {0xc5, 0x95}, - {0xc6, 0xB1}, - {0xc7, 0xC6}, - {0xc8, 0xD5}, - {0xc9, 0xE1}, - {0xcA, 0xEA}, - {0xcB, 0xF1}, - {0xcC, 0xF5}, - {0xcD, 0xFB}, - {0xcE, 0xFE}, - {0xcF, 0xFF}, - - /*Gamma for night mode*/ - case GC0312MIPI_RGB_Gamma_night: - {0xBF, 0x0B}, - {0xc0, 0x16}, - {0xc1, 0x29}, - {0xc2, 0x3C}, - {0xc3, 0x4F}, - {0xc4, 0x5F}, - {0xc5, 0x6F}, - {0xc6, 0x8A}, - {0xc7, 0x9F}, - {0xc8, 0xB4}, - {0xc9, 0xC6}, - {0xcA, 0xD3}, - {0xcB, 0xDD}, - {0xcC, 0xE5}, - {0xcD, 0xF1}, - {0xcE, 0xFA}, - {0xcF, 0xFF}, - break; - default: - /*GC0310MIPI_RGB_Gamma_m1*/ - {0xfe, 0x00}, - {0xbf, 0x06}, - {0xc0, 0x12}, - {0xc1, 0x22}, - {0xc2, 0x35}, - {0xc3, 0x4b}, - {0xc4, 0x5f}, - {0xc5, 0x72}, - {0xc6, 0x8d}, - {0xc7, 0xa4}, - {0xc8, 0xb8}, - {0xc9, 0xc8}, - {0xca, 0xd4}, - {0xcb, 0xde}, - {0xcc, 0xe6}, - {0xcd, 0xf1}, - {0xce, 0xf8}, - {0xcf, 0xfd}, -#endif - /*YCP*/ - {0xd0, 0x40}, - {0xd1, 0x34}, - {0xd2, 0x34}, - {0xd3, 0x45}, - {0xd6, 0xf2}, - {0xd7, 0x1b}, - {0xd8, 0x18}, - {0xdd, 0x03}, - - /*AEC*/ - {0xfe, 0x01}, - {0x05, 0x30}, - {0x06, 0x75}, - {0x07, 0x40}, - {0x08, 0xb0}, - {0x0a, 0xc5}, - {0x0b, 0x11}, - {0x0c, 0x00}, - {0x12, 0x52}, - {0x13, 0x40}, - {0x18, 0x95}, - {0x19, 0x96}, - {0x1f, 0x20}, - {0x20, 0xc0}, - {0x3e, 0x40}, - {0x3f, 0x57}, - {0x40, 0x7d}, - {0x03, 0x60}, - {0x44, 0x02}, - - /*AWB*/ - {0x1c, 0x91}, - {0x21, 0x15}, - {0x50, 0x80}, - {0x56, 0x04}, - {0x59, 0x08}, - {0x5b, 0x02}, - {0x61, 0x8d}, - {0x62, 0xa7}, - {0x63, 0xd0}, - {0x65, 0x06}, - {0x66, 0x06}, - {0x67, 0x84}, - {0x69, 0x08}, - {0x6a, 0x25}, - {0x6b, 0x01}, - {0x6c, 0x00}, - {0x6d, 0x02}, - {0x6e, 0xf0}, - {0x6f, 0x80}, - {0x76, 0x80}, - {0x78, 0xaf}, - {0x79, 0x75}, - {0x7a, 0x40}, - {0x7b, 0x50}, - {0x7c, 0x0c}, - - {0xa4, 0xb9}, - {0xa5, 0xa0}, - {0x90, 0xc9}, - {0x91, 0xbe}, - - {0xa6, 0xb8}, - {0xa7, 0x95}, - {0x92, 0xe6}, - {0x93, 0xca}, - - {0xa9, 0xbc}, - {0xaa, 0x95}, - {0x95, 0x23}, - {0x96, 0xe7}, - - {0xab, 0x9d}, - {0xac, 0x80}, - {0x97, 0x43}, - {0x98, 0x24}, - - {0xae, 0xb7}, - {0xaf, 0x9e}, - {0x9a, 0x43}, - {0x9b, 0x24}, - - {0xb0, 0xc8}, - {0xb1, 0x97}, - {0x9c, 0xc4}, - {0x9d, 0x44}, - - {0xb3, 0xb7}, - {0xb4, 0x7f}, - {0x9f, 0xc7}, - {0xa0, 0xc8}, - - {0xb5, 0x00}, - {0xb6, 0x00}, - {0xa1, 0x00}, - {0xa2, 0x00}, - - {0x86, 0x60}, - {0x87, 0x08}, - {0x88, 0x00}, - {0x89, 0x00}, - {0x8b, 0xde}, - {0x8c, 0x80}, - {0x8d, 0x00}, - {0x8e, 0x00}, - - {0x94, 0x55}, - {0x99, 0xa6}, - {0x9e, 0xaa}, - {0xa3, 0x0a}, - {0x8a, 0x0a}, - {0xa8, 0x55}, - {0xad, 0x55}, - {0xb2, 0x55}, - {0xb7, 0x05}, - {0x8f, 0x05}, - - {0xb8, 0xcc}, - {0xb9, 0x9a}, - /*CC*/ - {0xfe, 0x01}, - /*skin white*/ - {0xd0, 0x38}, - {0xd1, 0xfd}, - {0xd2, 0x06}, - {0xd3, 0xf0}, - {0xd4, 0x40}, - {0xd5, 0x08}, - - {0xd6, 0x30}, - {0xd7, 0x00}, - {0xd8, 0x0a}, - {0xd9, 0x16}, - {0xda, 0x39}, - {0xdb, 0xf8}, - - /*LSC*/ - {0xfe, 0x01}, - {0xc1, 0x3c}, - {0xc2, 0x50}, - {0xc3, 0x00}, - {0xc4, 0x40}, - {0xc5, 0x30}, - {0xc6, 0x30}, - {0xc7, 0x10}, - {0xc8, 0x00}, - {0xc9, 0x00}, - {0xdc, 0x20}, - {0xdd, 0x10}, - {0xdf, 0x00}, - {0xde, 0x00}, - - /*Histogram*/ - {0x01, 0x10}, - {0x0b, 0x31}, - {0x0e, 0x50}, - {0x0f, 0x0f}, - {0x10, 0x6e}, - {0x12, 0xa0}, - {0x15, 0x60}, - {0x16, 0x60}, - {0x17, 0xe0}, - - /*Measure Window*/ - {0xcc, 0x0c}, - {0xcd, 0x10}, - {0xce, 0xa0}, - {0xcf, 0xe6}, - - /*dark sun*/ - {0x45, 0xf7}, - {0x46, 0xff}, - {0x47, 0x15}, - {0x48, 0x03}, - {0x4f, 0x60}, - - /*banding*/ - {0xfe, 0x00}, - {0x05, 0x02}, - /*HB*/ - {0x06, 0xd1}, - {0x07, 0x00}, - /*VB*/ - {0x08, 0x22}, - - {0xfe, 0x01}, - /*anti-flicker step [11:8]*/ - {0x25, 0x00}, - /*anti-flicker step [7:0]*/ - {0x26, 0x6a}, - - /*exp level 0 20fps*/ - {0x27, 0x02}, - {0x28, 0x12}, - /*exp level 1 12.50fps*/ - {0x29, 0x02}, - {0x2a, 0x12}, - /*7.14fps*/ - {0x2b, 0x02}, - {0x2c, 0x12}, - /*exp level 3 5.55fps*/ - {0x2d, 0x02}, - {0x2e, 0x12}, - {0x3c, 0x20}, - {0xfe, 0x00}, - - /*DVP*/ - {0xfe, 0x03}, - {0x01, 0x00}, - {0x02, 0x00}, - {0x10, 0x00}, - {0x15, 0x00}, - {0xfe, 0x00}, - /*OUTPUT output_enable*/ - {0xf3, 0xff}, - SensorEnd -}; -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] = { - SensorEnd -}; - -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] = { - SensorEnd -}; -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data[] = { - - SensorEnd -}; -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[] = { - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_softreset_data[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[] = { - SensorRegVal(0xf0, 0), - SensorRegVal(0xf1, 0), - - SensorEnd -}; -/* -* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx -*/ -static struct rk_sensor_reg sensor_WhiteB_Auto[] = { - {0x42, 0x8f}, - - SensorEnd -}; - -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[] = { - {0x42, 0x8d}, - /*WB_manual_gain*/ - {0x77, 0x8c}, - {0x78, 0x50}, - {0x79, 0x40}, - - SensorEnd -}; - -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[] = { - /* - *Sunny - */ - {0x42, 0x8d}, - {0x77, 0x74}, - {0x78, 0x52}, - {0x79, 0x40}, - - SensorEnd -}; - -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[] = { - /* - *Office - */ - {0x42, 0x8d}, - {0x77, 0x48}, - {0x78, 0x40}, - {0x79, 0x5c}, - - SensorEnd -}; - -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[] = { - /* - *Home - */ - {0x42, 0x8d}, - {0x77, 0x40}, - {0x78, 0x42}, - {0x79, 0x50}, - - SensorEnd -}; -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = { - sensor_WhiteB_Auto, - sensor_WhiteB_TungstenLamp1, - sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, - sensor_WhiteB_Cloudy, - NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[] = { - /* - *Brightness -2 - */ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[] = { - /* - *Brightness -1 - */ - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[] = { - /* - *Brightness 0 - */ - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[] = { - /* - *Brightness +1 - */ - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[] = { - /* - *Brightness +2 - */ - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[] = { - /* - *Brightness +3 - */ - - SensorEnd -}; -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = { - sensor_Brightness0, - sensor_Brightness1, - sensor_Brightness2, - sensor_Brightness3, - sensor_Brightness4, - sensor_Brightness5, - NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = { - {0x43, 0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = { - {0x43, 0x02}, - {0xda, 0x00}, - {0xdb, 0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = { - {0x43, 0x02}, - {0xda, 0xd0}, - {0xdb, 0x28}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Negative[] = { - /* - *Negative - */ - {0x43, 0x01}, - SensorEnd -}; -static struct rk_sensor_reg sensor_Effect_Bluish[] = { - {0x43, 0x02}, - {0xda, 0x50}, - {0xdb, 0xe0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = { - /* - *Greenish - */ - {0x43, 0x02}, - {0xda, 0xc0}, - {0xdb, 0xc0}, - - SensorEnd -}; -static struct rk_sensor_reg *sensor_EffectSeqe[] = { - sensor_Effect_Normal, - sensor_Effect_WandB, - sensor_Effect_Negative, - sensor_Effect_Sepia, - sensor_Effect_Bluish, - sensor_Effect_Green, - NULL, -}; - -static struct rk_sensor_reg sensor_Exposure0[] = { - {0xfe, 0x01}, - {0x13, 0x20}, - {0xfe, 0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure1[] = { - {0xfe, 0x01}, - {0x13, 0x28}, - {0xfe, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure2[] = { - {0xfe, 0x01}, - {0x13, 0x30}, - {0xfe, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure3[] = { - {0xfe, 0x01}, - {0x13, 0x35}, - {0xfe, 0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure4[] = { - {0xfe, 0x01}, - {0x13, 0x40}, - {0xfe, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure5[] = { - {0xfe, 0x01}, - {0x13, 0x48}, - {0xfe, 0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure6[] = { - {0xfe, 0x01}, - {0x13, 0x50}, - {0xfe, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = { - sensor_Exposure0, - sensor_Exposure1, - sensor_Exposure2, - sensor_Exposure3, - sensor_Exposure4, - sensor_Exposure5, - sensor_Exposure6, - NULL, -}; - -static struct rk_sensor_reg sensor_Saturation0[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[] = { - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = { - sensor_Saturation0, - sensor_Saturation1, - sensor_Saturation2, - NULL, -}; - -static struct rk_sensor_reg sensor_Contrast0[] = { - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast1[] = { - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast2[] = { - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast3[] = { - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast4[] = { - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast5[] = { - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast6[] = { - - SensorEnd -}; -static struct rk_sensor_reg *sensor_ContrastSeqe[] = { - sensor_Contrast0, - sensor_Contrast1, - sensor_Contrast2, - sensor_Contrast3, - sensor_Contrast4, - sensor_Contrast5, - sensor_Contrast6, - NULL, -}; -static struct rk_sensor_reg sensor_SceneAuto[] = { - {0xfe, 0x01}, - {0x3c, 0x20}, - {0xfe, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = { - {0xfe, 0x01}, - {0x3c, 0x30}, - {0xfe, 0x00}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_SceneSeqe[] = { - sensor_SceneAuto, - sensor_SceneNight, - NULL, -}; - -static struct rk_sensor_reg sensor_Zoom0[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom3[] = { - SensorEnd -}; -static struct rk_sensor_reg *sensor_ZoomSeqe[] = { - sensor_Zoom0, - sensor_Zoom1, - sensor_Zoom2, - sensor_Zoom3, - NULL, -}; - -/* -* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu -*/ -static struct v4l2_querymenu sensor_menus[] = { -}; -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = { -}; - -/* - *MUST define the current used format as the first item - */ -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {MEDIA_BUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - - return 0; -} - -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - - return 0; -} - -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_th(struct i2c_client *client, - struct v4l2_mbus_framefmt *mf, bool capture) -{ - - return 0; -} - -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh(struct i2c_client *client, - struct v4l2_mbus_framefmt *mf, bool capture) -{ - return 0; -} -static int sensor_try_fmt_cb_th(struct i2c_client *client, - struct v4l2_mbus_framefmt *mf) -{ - return 0; -} - -static int sensor_softrest_usr_cb(struct i2c_client *client, - struct rk_sensor_reg *series) -{ - - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client, - struct rk_sensor_reg *series) -{ - return 0; -} -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("Suspend"); - - } else { - SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n", - pm_msg.event); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - - SENSOR_DG("Resume"); - - return 0; - -} -static int sensor_mirror_cb(struct i2c_client *client, int mirror) -{ - char val; - int err = 0; - - SENSOR_DG("mirror: %d", mirror); - if (mirror) { - sensor_write(client, 0xfe, 0); - err = sensor_read(client, 0x17, &val); - if (err == 0) { - if ((val & 0x1) == 0) - err = sensor_write(client, 0x17, (val | 0x1)); - else - err = sensor_write(client, 0x17, (val & 0xfe)); - } - } - - return err; -} - -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, - struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_mirror_cb(client, ext_ctrl->value) != 0) - SENSOR_TR("sensor_mirror failed, value:0x%x", ext_ctrl->value); - - SENSOR_DG("sensor_mirror success, value:0x%x", ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - char val; - int err = 0; - - SENSOR_DG("flip: %d", flip); - if (flip) { - - sensor_write(client, 0xfe, 0); - err = sensor_read(client, 0x17, &val); - if (err == 0) { - if ((val & 0x2) == 0) - err = sensor_write(client, 0x17, (val | 0x2)); - else - err = sensor_write(client, 0x17, (val & 0xfc)); - } - } - - return err; -} - -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, - struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_flip_cb(client, ext_ctrl->value) != 0) - SENSOR_TR("sensor_flip failed, value:0x%x", ext_ctrl->value); - - SENSOR_DG("sensor_flip success, value:0x%x", ext_ctrl->value); - return 0; -} - -/* -* the functions are focus callbacks -*/ -static int sensor_focus_init_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client, int pos) -{ - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, - int *zone_tm_pos) -{ - return 0; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client, int on) -{ - return 0; -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor *spsensor, - struct soc_camera_device *icd) -{ - return; -} - -/* -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); diff --git a/drivers/media/video/gc0328.c b/drivers/media/video/gc0328.c deleted file mode 100644 index d89c97bf9fef..000000000000 --- a/drivers/media/video/gc0328.c +++ /dev/null @@ -1,1020 +0,0 @@ -/* - * drivers/media/video/gc0328.c - * - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "generic_sensor.h" - -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.0.3: -* add sensor_focus_af_const_pause_usr_cb; -*/ -static int version = KERNEL_VERSION(0,0,3); -module_param(version, int, S_IRUGO); -static int debug =1; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_GC0328 -#define SENSOR_V4L2_IDENT V4L2_IDENT_GC0328 -#define SENSOR_ID 0x9d -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_PCLK_SAMPLE_RISING|V4L2_MBUS_HSYNC_ACTIVE_HIGH| V4L2_MBUS_VSYNC_ACTIVE_LOW|\ - V4L2_MBUS_DATA_ACTIVE_HIGH |SOCAM_MCLK_24MHZ) -#define SENSOR_PREVIEW_W 640 -#define SENSOR_PREVIEW_H 480 -#define SENSOR_PREVIEW_FPS 15000 // 15fps -#define SENSOR_FULLRES_L_FPS 7500 // 7.5fps -#define SENSOR_FULLRES_H_FPS 7500 // 7.5fps -#define SENSOR_720P_FPS 0 -#define SENSOR_1080P_FPS 0 - -#define SENSOR_REGISTER_LEN 1 // sensor register address bytes -#define SENSOR_VALUE_LEN 1 // sensor register value bytes -static unsigned int SensorConfiguration = (CFG_WhiteBalance|CFG_Effect|CFG_Scene); -/* Sensor Driver Configuration End */ - - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a,b) CONS4(SensorReg,SENSOR_REGISTER_LEN,Val,SENSOR_VALUE_LEN)(a,b) -#define sensor_write(client,reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_read(client,reg,v) CONS4(sensor_read_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_write_array generic_sensor_write_array - -struct sensor_parameter -{ - unsigned int PreviewDummyPixels; - unsigned int CaptureDummyPixels; - unsigned int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int PreviewPclk; - unsigned short int CapturePclk; - char awb[6]; -}; - -struct specific_sensor{ - struct generic_sensor common_sensor; - //define user data below - struct sensor_parameter parameter; - -}; - -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ -static unsigned int SensorChipID[] = {SENSOR_ID}; -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_init_data[] ={ - {0xfe , 0x80}, - {0xfe , 0x80}, - {0xfc , 0x16}, //clock enable - {0xfc , 0x16}, //clock enable - {0xfc , 0x16}, //clock enable - {0xfc , 0x16}, //clock enable - - {0x42 , 0x02}, - - {0xfe , 0x01}, - {0x4c , 0x01}, //AWB Buffer reset - {0xfe , 0x00}, - - {0xfe , 0x00}, - {0x0d , 0x01}, //{8}cis_win_height 486 1e6 - {0x0e , 0xe8}, //{7:0}cis_win_height - {0x0f , 0x02}, //{9:8}cis_win_width 646 286 - {0x10 , 0x88}, //{7:0}cis_win_width - {0x09 , 0x00}, //row_start - {0x0a , 0x00}, - {0x0b , 0x00}, //col_start - {0x0c , 0x00}, - {0x16 , 0x80}, - {0x17 , 0x14}, //[7]hsync_always, [6]close_2_frame_dbrow, [5:4]CFA_seqence, [3:2]dark_CFA_seqence, [1]updown, [0]mirror - {0x19 , 0x06}, //AD Pipe line number - {0x1f , 0xC8}, //txlow - {0x20 , 0x01}, - {0x21 , 0x78}, //68 - {0x22 , 0xb0}, - {0x24 , 0x16}, - {0x26 , 0x01}, - - {0x50 , 0x01}, //crop mode - - //global gain for range - {0x70 , 0x45}, - - //////////////////////////////////////////////// - //////////// BLK ////////////////////// - //////////////////////////////////////////////// - {0x27 , 0x27}, - {0x28 , 0x7F}, //BLK LIMIT - {0x29 , 0x20}, //global offset - {0x33 , 0x1A},//offset_ratio_G1 - {0x34 , 0x1A}, //offset_ratio_R - {0x35 , 0x1A}, - {0x36 , 0x1A}, - {0x37 , 0x20}, - {0x38 , 0x20}, - {0x39 , 0x20}, - {0x3a , 0x20}, - {0x47 , 0x00}, - {0x48 , 0x75},//00 - - - - //////////////////////////////////////////////// - //////////// block enable ///////////// - //////////////////////////////////////////////// - {0x40 , 0x7f}, // - {0x41 , 0x22},// - - - {0x42 , 0xff},// - {0x45 , 0x00}, - {0x44 , 0x02}, - {0x46 , 0x02}, - {0x4b , 0x01}, - {0x50 , 0x01}, //crop mode - - //DN & EEINTP - {0x7e , 0x0a}, // - {0x7f , 0x03}, //c3 //1D DN - {0x81 , 0x15}, - {0x82 , 0x85}, //8f//bilt_base_b - {0x83 , 0x02}, //02 //DN C weight - {0x84 , 0xe5}, - {0x90 , 0xac}, - {0x92 , 0x02}, //5 - {0x94 , 0x05}, - {0x95 , 0x63}, - - - ///////YCP - {0xd1 , 0x38}, - {0xd2 , 0x38}, // cb,cr saturation - {0xdd , 0x54}, - {0xde , 0x38}, //autogray_mode - {0xe4 , 0x88}, - {0xe5 , 0x40}, - {0xd7 , 0x0e}, - //rgb gamma - {0xBF , 0x0E}, - {0xc0 , 0x1C}, - {0xc1 , 0x34}, - {0xc2 , 0x48}, - {0xc3 , 0x5A}, - {0xc4 , 0x6B}, - {0xc5 , 0x7B}, - {0xc6 , 0x95}, - {0xc7 , 0xAB}, - {0xc8 , 0xBF}, - {0xc9 , 0xCE}, - {0xcA , 0xD9}, - {0xcB , 0xE4}, - {0xcC , 0xEC}, - {0xcD , 0xF7}, - {0xcE , 0xFD}, - {0xcF , 0xFF}, - - ///Y gamma - {0xfe , 0x00}, - {0x63 , 0x00}, - {0x64 , 0x05}, - {0x65 , 0x0b}, - {0x66 , 0x19}, - {0x67 , 0x2e}, - {0x68 , 0x40}, - {0x69 , 0x54}, - {0x6a , 0x66}, - {0x6b , 0x86}, - {0x6c , 0xa7}, - {0x6d , 0xc6}, - {0x6e , 0xe4}, - {0x6f , 0xff}, - - //ASDE - {0xfe , 0x01}, - {0x18 , 0x02}, - {0xfe , 0x00}, - {0x97 , 0x30}, //Y offset TH - {0xa4 , 0x10}, //ASDE auto sa slope - {0xa8 , 0x80}, //ASDE LSC SLOPE - {0x9c , 0x60}, //auto Y offset Slope - {0xa2 , 0x23}, - {0xad , 0x01}, //ASDE ee,ddMODE - {0x9c , 0x01}, //ABS manual K - - {0xfe , 0x01}, - {0x9c , 0x00}, //ABS manual K - {0x08 , 0xa0}, - {0x09 , 0xe8}, - - {0x10 , 0x08},//[7]win_mode,[6]show_mode [3]measure_point - - {0x11 , 0x21}, //[7]fix target - {0x12 , 0x10}, - {0x13 , 0x45}, //AEC Y target - {0x15 , 0xfc}, //high range for count - {0x21 , 0xf0}, //c0 //post_gain limit - {0x22 , 0x60}, - {0x23 , 0x30},//20 //dggain max - {0x25 , 0x00}, - {0x24 , 0x14}, //Max index - - - {0xfe , 0x01}, - {0x51 , 0x20}, - {0x52 , 0x4f}, - {0x53 , 0x40}, - {0x54 , 0x9f}, - {0x55 , 0x01}, - {0x56 , 0x18}, //18 - {0x5b , 0x02}, - {0xb1 , 0xdc}, - {0xb2 , 0xdc}, //R2G STAND - {0x7c , 0x71}, //AWB speed,AWB margin - {0x7d , 0x10}, //AWB every N - {0x76 , 0x8f}, //move mode en,Move mode TH - - - {0x50 , 0x80}, - {0x4f , 0x00}, - {0x4d , 0x01}, - {0x4e , 0x02}, - {0x4d , 0x35}, - {0x4e , 0x01}, - {0x4e , 0x01}, - {0x4e , 0x01}, - {0x4d , 0x44}, - {0x4e , 0x04}, - {0x4e , 0x04}, - {0x4e , 0x02}, - {0x4d , 0x53}, - {0x4e , 0x08}, - {0x4e , 0x00}, - {0x4e , 0x04}, - {0x4d , 0x03}, - {0x4e , 0x08}, - {0x4d , 0x72}, - {0x4e , 0x20}, - {0x4e , 0x20}, - {0x4d , 0x83}, - {0x4e , 0x20}, - {0x4d , 0x92}, - {0x4e , 0x40}, - {0x4e , 0x40}, - {0x4f , 0x01}, - {0xfe , 0x00}, //page0 - - {0xad , 0x00}, - - {0xfe , 0x01}, - {0xc0 , 0x11}, - {0xc1 , 0x0b}, - {0xc2 , 0x09}, - {0xc6 , 0x0f}, - {0xc7 , 0x0a}, - {0xc8 , 0x07}, - {0xba , 0x2d}, - {0xbb , 0x1e}, - {0xbc , 0x1e}, - {0xb4 , 0x38}, - {0xb5 , 0x26}, - {0xb6 , 0x23}, - {0xc3 , 0x00}, - {0xc4 , 0x00}, - {0xc5 , 0x00}, - {0xc9 , 0x00}, - {0xca , 0x00}, - {0xcb , 0x00}, - {0xbd , 0x0a}, - {0xbe , 0x00}, - {0xbf , 0x00}, - {0xb7 , 0x04}, - {0xb8 , 0x00}, - {0xb9 , 0x00}, - {0xa8 , 0x08}, - {0xa9 , 0x00}, - {0xaa , 0x00}, - {0xab , 0x07}, - {0xac , 0x00}, - {0xad , 0x07}, - {0xae , 0x0e}, - {0xaf , 0x03}, - {0xb0 , 0x03}, - {0xb1 , 0x0d}, - {0xb2 , 0x00}, - {0xb3 , 0x08}, - {0xa4 , 0x00}, - {0xa5 , 0x00}, - {0xa6 , 0x00}, - {0xa7 , 0x00}, - {0xa1 , 0x3c}, - {0xa2 , 0x50}, - {0xfe , 0x00}, - - {0xB1 , 0x08},// 40 - {0xB2 , 0x02}, - {0xB3 , 0x07}, - {0xB4 , 0xe0}, - {0xB5 , 0x00},// - {0xB6 , 0xf0}, - - {0xf1 , 0x07}, - {0xf1 , 0x07}, - {0xf2 , 0x01}, - - {0x4f , 0x01}, - - - - {0x05, 0x02}, - {0x06, 0x2c}, - {0x07, 0x00}, - {0x08, 0xb8}, - {0xfe, 0x01}, - //GC0328_SET_PAGE1, - {0x29, 0x00}, //anti-flicker step [11:8] - {0x2a, 0x60}, //anti-flicker step [7:0] - - {0x2b, 0x02}, //exp level 0 14.28fps - {0x2c, 0xa0}, - {0x2d, 0x03}, //exp level 1 12.50fps - {0x2e, 0x00}, - {0x2f, 0x03}, //exp level 2 10.00fps - {0x30, 0xc0}, - {0x31, 0x05}, //exp level 3 7.14fps - {0x32, 0x40}, - - {0xfe, 0x00}, - - - //-------------H_V_Switch(4)---------------// - {0x17 , 0x14}, // - - - /*GC0328_H_V_Switch, - - 1: // normal - {0x17 , 0x14}, - - 2: // IMAGE_H_MIRROR - {0x17 , 0x15}, - - 3: // IMAGE_V_MIRROR - {0x17 , 0x16}, - - 4: // IMAGE_HV_MIRROR - {0x17 , 0x17}, - */ - //-------------H_V_Select End--------------// - SensorEnd -}; -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={ - SensorEnd - -}; - -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] ={ - SensorEnd -}; -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data[] = -{ - - SensorEnd -}; -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[]={ - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[]={ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_softreset_data[]={ - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[]={ - SensorRegVal(0xf0,0), - SensorEnd -}; -/* -* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx -*/ -static struct rk_sensor_reg sensor_WhiteB_Auto[]= -{ - {0xfe, 0x00}, - {0x77, 0x57}, - {0x78, 0x4d}, - {0x79, 0x45}, - {0x42, 0x57}, - SensorEnd -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[]= -{ - {0xfe, 0x00}, - {0x42, 0x55}, // Disable AWB - {0x77, 0x8c}, - {0x78, 0x50}, - {0x79, 0x40}, - SensorEnd -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0xfe, 0x00}, - {0x42, 0x55}, // Disable AWB - {0x77, 0x74}, - {0x78, 0x52}, - {0x79, 0x40}, - SensorEnd -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0xfe, 0x00}, - {0x42, 0x55}, // Disable AWB - {0x77, 0x48}, - {0x78, 0x40}, - {0x79, 0x5c}, - SensorEnd - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0xfe, 0x00}, - {0x42, 0x55}, // Disable AWB - {0x77, 0x40}, - {0x78, 0x42}, - {0x79, 0x50}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[]= -{ - // Brightness -2 - {0xfe, 0x00}, - {0xd5, 0xe0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[]= -{ - // Brightness -1 - {0xfe, 0x00}, - {0xd5, 0xf0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[]= -{ - // Brightness 0 - {0xfe, 0x00}, - {0xd5, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[]= -{ - // Brightness +1 - {0xfe, 0x00}, - {0xd5, 0x20}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[]= -{ - // Brightness +2 - {0xfe, 0x00}, - {0xd5, 0x30}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[]= -{ - // Brightness +3 - {0xfe, 0x00}, - {0xd5, 0x40}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = -{ - {0x43,0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = -{ - {0x43,0x02}, - {0xda,0x00}, - {0xdb,0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = -{ - {0x43,0x02}, - {0xda,0xd0}, - {0xdb,0x28}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Negative[] = -{ - //Negative - {0x43,0x01}, - SensorEnd -}; -static struct rk_sensor_reg sensor_Effect_Bluish[] = -{ - // Bluish - {0x423,0x02}, - {0xda,0x50}, - {0xdb,0xe0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = -{ - // Greenish - {0x43,0x02}, - - {0xda,0xc0}, - {0xdb,0xc0}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; - -static struct rk_sensor_reg sensor_Exposure0[]= -{ - {0xfe, 0x01}, - {0x13, 0x30}, - {0xfe, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure1[]= -{ - {0xfe, 0x01}, - {0x13, 0x38}, - {0xfe, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure2[]= -{ - {0xfe, 0x01}, - {0x13, 0x40}, - {0xfe, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure3[]= -{ - {0xfe, 0x01}, - {0x13, 0x45}, - {0xfe, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure4[]= -{ - {0xfe, 0x01}, - {0x13, 0x50}, - {0xfe, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure5[]= -{ - {0xfe, 0x01}, - {0x13, 0x58}, - {0xfe, 0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure6[]= -{ - {0xfe, 0x01}, - {0x13, 0x60}, - {0xfe, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; - -static struct rk_sensor_reg sensor_Saturation0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -static struct rk_sensor_reg sensor_Contrast0[]= -{ - {0xb3,0x34}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast1[]= -{ - {0xb3,0x38}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast2[]= -{ - {0xb3,0x3d}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast3[]= -{ - {0xb3,0x40}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast4[]= -{ - {0xb3,0x44}, - - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Contrast5[]= -{ - {0xb3,0x48}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast6[]= -{ - {0xb3,0x50}, - - SensorEnd -}; -static struct rk_sensor_reg *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; -static struct rk_sensor_reg sensor_SceneAuto[] = -{ - {0xfe, 0x01}, - {0x33, 0x20}, - {0xfe, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = -{ - {0xfe, 0x01}, - {0x33, 0x30}, - {0xfe, 0x00}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -static struct rk_sensor_reg sensor_Zoom0[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Zoom3[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; - -/* -* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu -*/ -static struct v4l2_querymenu sensor_menus[] = -{ -}; -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = -{ -}; - -//MUST define the current used format as the first item -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {MEDIA_BUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; -/*static struct soc_camera_ops sensor_ops;*/ - - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - - return 0; -} -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - - return 0; -} -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - - return 0; -} -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh (struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - return 0; -} -static int sensor_try_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf) -{ - return 0; -} - -static int sensor_softrest_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - return 0; -} -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("Suspend"); - - } else { - SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n",pm_msg.event); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - - SENSOR_DG("Resume"); - - return 0; - -} -static int sensor_mirror_cb (struct i2c_client *client, int mirror) -{ - char val; - int err = 0; - - SENSOR_DG("mirror: %d",mirror); - if (mirror) { - sensor_write(client, 0xfe, 0); - err = sensor_read(client, 0x17, &val); - val-=4; - if (err == 0) { - if((val & 0x1) == 0){ - err = sensor_write(client, 0x17, ((val |0x1)+4)); - } - else - err = sensor_write(client, 0x17, ((val & 0xfe)+4)); - } - } else { - //do nothing - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_mirror_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_mirror failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_mirror success, value:0x%x",ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - char val; - int err = 0; - - SENSOR_DG("flip: %d",flip); - if (flip) { - - sensor_write(client, 0xfe, 0); - err = sensor_read(client, 0x17, &val); - val-=4; - if (err == 0) { - if((val & 0x2) == 0){ - err = sensor_write(client, 0x17, ((val |0x2)+4)); - } - else { - err = sensor_write(client, 0x17, ((val & 0xfc)+4)); - } - } - } else { - //do nothing - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_flip_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_flip failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_flip success, value:0x%x",ext_ctrl->value); - return 0; -} -/* -* the functions are focus callbacks -*/ -static int sensor_focus_init_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos) -{ - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client){ - return 0; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos) -{ - return 0; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client,int on){ - return 0; -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor* spsensor,struct soc_camera_device *icd) -{ - return; -} - -/* -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); - - - - diff --git a/drivers/media/video/gc0329.c b/drivers/media/video/gc0329.c deleted file mode 100644 index c0926f9b0055..000000000000 --- a/drivers/media/video/gc0329.c +++ /dev/null @@ -1,1128 +0,0 @@ -/* - * drivers/media/video/gc0329.c - * - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "generic_sensor.h" - -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.0.3: -* add sensor_focus_af_const_pause_usr_cb; -*/ -static int version = KERNEL_VERSION(0,0,3); -module_param(version, int, S_IRUGO); - - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_GC0329 -#define SENSOR_V4L2_IDENT V4L2_IDENT_GC0329 -#define SENSOR_ID 0xc0 -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_PCLK_SAMPLE_RISING|V4L2_MBUS_HSYNC_ACTIVE_HIGH| V4L2_MBUS_VSYNC_ACTIVE_HIGH|\ - V4L2_MBUS_DATA_ACTIVE_HIGH |SOCAM_MCLK_24MHZ) -#define SENSOR_PREVIEW_W 640 -#define SENSOR_PREVIEW_H 480 -#define SENSOR_PREVIEW_FPS 15000 // 15fps -#define SENSOR_FULLRES_L_FPS 7500 // 7.5fps -#define SENSOR_FULLRES_H_FPS 7500 // 7.5fps -#define SENSOR_720P_FPS 0 -#define SENSOR_1080P_FPS 0 - -#define SENSOR_REGISTER_LEN 1 // sensor register address bytes -#define SENSOR_VALUE_LEN 1 // sensor register value bytes -static unsigned int SensorConfiguration = (CFG_WhiteBalance|CFG_Effect|CFG_Scene); -static unsigned int SensorChipID[] = {SENSOR_ID}; -/* Sensor Driver Configuration End */ - - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a,b) CONS4(SensorReg,SENSOR_REGISTER_LEN,Val,SENSOR_VALUE_LEN)(a,b) -#define sensor_write(client,reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_read(client,reg,v) CONS4(sensor_read_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_write_array generic_sensor_write_array - -struct sensor_parameter -{ - unsigned int PreviewDummyPixels; - unsigned int CaptureDummyPixels; - unsigned int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int PreviewPclk; - unsigned short int CapturePclk; - char awb[6]; -}; - -struct specific_sensor{ - struct generic_sensor common_sensor; - //define user data below - struct sensor_parameter parameter; - -}; - -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ - -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_init_data[] ={ - // TODO: add initial code here - {0xfe, 0x80}, - {0xfc, 0x12}, - {0xfc, 0x12}, //[4]Clock_en [2] A25_en [1]D18_en [0]Apwdn - {0xfe, 0x00}, - {0xf0, 0x07}, //vsync_en - {0xf1, 0x01}, //data_en - - {0x73, 0x90}, //R channle gain - {0x74, 0x80}, //G1 channle gain - {0x75, 0x80}, //G2 channle gain - {0x76, 0x94}, //B channle gain - - //{0x42, 0x00}, - //{0x77, 0x57}, - //{0x78, 0x4d}, - //{0x79, 0x45}, - //{0x42, 0xfc}, - - ////////////////////analog//////////////////// - {0xfc, 0x16}, - - {0x0a, 0x00}, //row_start_low - {0x0c, 0x00}, //col_start_low - {0x17, 0x14}, //cisctl_mode1//[7]hsync_always },[6] NA}, [5:4] CFA sequence [3:2]NA, [1]upside_down, [0] mirror - //[3:2]NA [1]upside_down}, [0] mirror - - {0x19, 0x05}, //cisctl_mode3 - {0x1b, 0x24}, //rsh_width - {0x1c, 0x04}, //Tsp_width - {0x1e, 0x00}, //Analog_mode1//[7:6]rsv1},rsv0[5:3] Column bias(coln_r)[1] clk_delay_en - {0x1f, 0xc0}, //Analog_mode2//[7:6] comv_r - {0x20, 0x00}, //Analog_mode3//[6:4] cap_low_r for MPW [3:2] da18_r [1] rowclk_mode [0]adclk_mode - {0x21, 0x48}, //Hrst_rsg//[7] hrst[6:4] da_rsg[3]txhigh_en - {0x23, 0x22}, //ADC_r//[6:5]opa_r [1:0]sRef - {0x24, 0x16}, //PAD_drv//[7:6]NA},[5:4]sync_drv [3:2]data_drv [1:0]pclk_drv - - - ////////////////////blk//////////////////// - {0x26, 0xf7}, - {0x32, 0x04}, - {0x33, 0x20}, - {0x34, 0x20}, - {0x35, 0x20}, - {0x36, 0x20}, - - ////////////////////ISP BLOCK ENABLE//////////////////// - {0x40, 0xff}, - {0x41, 0x00}, - {0x42, 0xfe}, - {0x46, 0x03}, //sync mode - {0x4b, 0xcb}, - {0x4d, 0x01}, - {0x4f, 0x01}, - {0x70, 0x48},//global gain - - //{0xb0, 0x00}, - //{0xbc, 0x00}, - //{0xbd, 0x00}, - //{0xbe, 0x00}, - - ////////////////////DNDD//////////////////// - {0x80, 0xe7}, //[7]auto_en [6]one_pixel [5]two_pixel - {0x82, 0x55}, - {0x87, 0x4a}, - - ////////////////////ASDE//////////////////// - {0xfe, 0x01}, - {0x18, 0x22}, //[7:4]AWB LUMA X [3:0]ASDE LUMA X - {0xfe, 0x00},//ASDE dn b slope - {0x9c, 0x0a}, //ASDE dn b slope - {0xa4, 0x50}, // Auto Sa slope - {0xa5, 0x21}, // [7:4]Saturation limit x10 - {0xa7, 0x35}, //low luma value th - {0xdd, 0x54}, //edge dec sat enable & slopes - {0x95, 0x35}, //Edge effect - - ////////////////////RGB gamma//////////////////// - {0xfe, 0x00}, - {0xbf, 0x06}, - {0xc0, 0x14}, - {0xc1, 0x27}, - {0xc2, 0x3b}, - {0xc3, 0x4f}, - {0xc4, 0x62}, - {0xc5, 0x72}, - {0xc6, 0x8d}, - {0xc7, 0xa4}, - {0xc8, 0xb8}, - {0xc9, 0xc9}, - {0xca, 0xd6}, - {0xcb, 0xe0}, - {0xcc, 0xe8}, - {0xcd, 0xf4}, - {0xce, 0xfc}, - {0xcf, 0xff}, - - //////////////////CC/////////////////// - {0xfe, 0x00}, - {0xb3, 0x44}, - {0xb4, 0xfd}, - {0xb5, 0x02}, - {0xb6, 0xfa}, - {0xb7, 0x48}, - {0xb8, 0xf0}, - - //skin - //{0xb3, 0x3c}, - //{0xb4, 0xFF}, - //{0xb5, 0x03}, - //{0xb6, 0x01}, - //{0xb7, 0x3f}, - //{0xb8, 0xF3}, - - // crop - {0x50, 0x01}, - {0x19, 0x05}, - {0x20, 0x01}, - {0x22, 0xba}, - {0x21, 0x48}, - - ////////////////////YCP//////////////////// - {0xfe, 0x00}, - {0xd1, 0x34}, //saturation Cb - {0xd2, 0x34}, //saturation Cr - - ////////////////////AEC//////////////////// - {0xfe, 0x01}, - {0x10, 0x40}, - {0x11, 0x21},//a1 - {0x12, 0x07}, - {0x13, 0x50}, //Y target - {0x17, 0x88}, - {0x21, 0xb0}, - {0x22, 0x48}, - {0x3c, 0x95}, - {0x3d, 0x50}, - {0x3e, 0x48}, - - ////////////////////AWB//////////////////// - {0xfe, 0x01}, - #if 0 - {0x06, 0x06}, - {0x07, 0x06}, - {0x08, 0xa6}, - {0x09, 0xee}, - {0x50, 0xfc}, - {0x51, 0x28}, - {0x52, 0x10}, - {0x53, 0x1d}, - {0x54, 0x16}, - {0x55, 0x20}, - {0x56, 0x60}, - //{0x57, 0x40}, - {0x58, 0x60}, - {0x59, 0x28}, - {0x5a, 0x02}, - {0x5b, 0x63}, - {0x5c, 0x34}, - {0x5d, 0x73}, - {0x5e, 0x11}, - {0x5f, 0x40}, - {0x60, 0x40}, - {0x61, 0xc8}, - {0x62, 0xa0}, - {0x63, 0x40}, - {0x64, 0x50}, - {0x65, 0x98}, - {0x66, 0xfa}, - {0x67, 0x70}, - {0x68, 0x58}, - {0x69, 0x85}, - {0x6a, 0x40}, - {0x6b, 0x39}, - {0x6c, 0x40}, - {0x6d, 0x80}, - {0x6e, 0x41}, - {0x70, 0x50}, - {0x71, 0x00}, - {0x72, 0x10}, - {0x73, 0x40}, - {0x74, 0x32}, - {0x75, 0x40}, - {0x76, 0x30}, - {0x77, 0x48}, - {0x7a, 0x50}, - {0x7b, 0x20}, - {0x80, 0x4a}, - {0x81, 0x43}, - {0x82, 0x43}, - {0x83, 0x40}, - {0x84, 0x40}, - {0x85, 0x40}, - #elif 1 - {0x06, 0x08}, - {0x07, 0x06}, - {0x08, 0xa6}, - {0x09, 0xee}, - {0x50,0xfc}, //RGB high - {0x51,0x28}, //Y2C diff - {0x52,0x10}, //18 - {0x53,0x08},// //1d //20// - {0x54,0x12}, //16 //30//C inter - {0x55,0x10}, //16 - {0x56,0x10}, //20//60 - {0x58,0x80}, //a0//60//number limit X4 - {0x59,0x08}, //0c //08 //AWB adjust temp curve //0c - {0x5a,0x02}, //01 //03//25//[3:0]light gain range x10 - {0x5b,0x63}, //62 - {0x5c,0x34}, //37 //show and mode [2]big C mode [1]dark mode [0] block move mode - {0x5d,0x73}, //72 //52//AWB margin - {0x5e,0x29}, //11 //20 //11 //19//temp curve_enable - {0x5f,0x40}, //5K gain - {0x60,0x40}, //5K gain - {0x61,0xc8}, //sinT - {0x62,0xa0}, //cosT - {0x63,0x40}, //38//30//AWB X1 cut - {0x64,0x38}, //50 //38 //30 //20 //40 //50 //60//AWB X2 cut - {0x65,0x98}, //a0 //98 //a0//AWB Y1 cut - {0x66,0xfa}, //ea//AWB Y2 cut - {0x67,0x80}, //70 //AWB R gain limit - {0x68,0x60}, //58 //58 //AWB G gain Limit - {0x69,0x90}, //85 //7d //AWB B gain limit - {0x6a,0x40}, - {0x6b,0x39}, - {0x6c,0x28}, //40 - {0x6d,0x28}, //40//80 - {0x6e,0x41}, //outdoor gain limit enable [7]use exp or luma value to adjust outdoor - {0x70,0x10}, //50 //10 - {0x71,0x00}, //when outdoor , add high luma gray pixel weight - {0x72,0x08}, //10 - {0x73,0x40}, //95// when exp < th, outdoor mode open - {0x80,0x70}, //R gain high limit - {0x81,0x58}, //G gain high limit - {0x82,0x42}, //B gain high limit - {0x83,0x40}, //R gain low limit - {0x84,0x40}, //G gain low limit - {0x85,0x40}, //B gain low limit - - #else - {0x06, 0x06}, - {0x07, 0x06}, - {0x08, 0xa6}, - {0x09, 0xee}, - {0x50, 0xfc}, - {0x51, 0x30},//28 - {0x52, 0x20},//10 - {0x53, 0x0b}, // 1d - {0x54, 0x0b},// 16 - {0x55, 0x12},//20 - {0x56, 0x10},//60 - //{0x57, 0x40}, - {0x58, 0x80},//60 - {0x59, 0x28}, - {0x5a, 0x02}, - {0x5b, 0x63}, - {0x5c, 0x37},//34 - {0x5d, 0x72},//73 - {0x5e, 0x11}, - {0x5f, 0x40}, - {0x60, 0x40}, - {0x61, 0xc8}, - {0x62, 0xa0}, - {0x63, 0x40}, - {0x64, 0x60},//50 - {0x65, 0x9c},//98 - {0x66, 0xf0},//fa - {0x67, 0x70}, - {0x68, 0x58}, - {0x69, 0x85}, - {0x6a, 0x40}, - {0x6b, 0x39}, - {0x6c, 0x40}, - {0x6d, 0x40},//80 - {0x6e, 0x41}, - {0x70, 0x10},//50 - {0x71, 0x00}, - {0x72, 0x20},//10 - {0x73, 0x40}, - {0x74, 0x32}, - {0x75, 0x40}, - {0x76, 0x30}, - {0x77, 0x48}, - {0x7a, 0x50}, - {0x7b, 0x20}, - {0x80, 0x70},//4// 4a - {0x81, 0x58},//43 - {0x82, 0x42},//43 - {0x83, 0x40}, - {0x84, 0x40}, - {0x85, 0x40}, - - {0x86, 0x50}, - {0x87, 0x50}, - {0x88, 0xd0}, - {0x88, 0x90}, - #endif - - ////////////////////CC-AWB//////////////////// - {0xd0, 0x00}, - {0xd2, 0x2c}, - {0xd3, 0x80}, - - ///////////////////ABS/////////////////////// - {0x9c, 0x02}, - {0x9d, 0x10}, - - ///////////////////LSC ////////////////////// - //// for xuye062d lens setting - {0xfe, 0x01}, - {0xa0, 0x00}, - {0xa1, 0x3c}, - {0xa2, 0x50}, - {0xa3, 0x00}, - {0xa8, 0x0f}, - {0xa9, 0x08}, - {0xaa, 0x00}, - {0xab, 0x04}, - {0xac, 0x00}, - {0xad, 0x07}, - {0xae, 0x0e}, - {0xaf, 0x00}, - {0xb0, 0x00}, - {0xb1, 0x09}, - {0xb2, 0x00}, - {0xb3, 0x00}, - {0xb4, 0x31}, - {0xb5, 0x19}, - {0xb6, 0x24}, - {0xba, 0x3a}, - {0xbb, 0x24}, - {0xbc, 0x2a}, - {0xc0, 0x17}, - {0xc1, 0x13}, - {0xc2, 0x17}, - {0xc6, 0x21}, - {0xc7, 0x1c}, - {0xc8, 0x1c}, - {0xb7, 0x00}, - {0xb8, 0x00}, - {0xb9, 0x00}, - {0xbd, 0x00}, - {0xbe, 0x00}, - {0xbf, 0x00}, - {0xc3, 0x00}, - {0xc4, 0x00}, - {0xc5, 0x00}, - {0xc9, 0x00}, - {0xca, 0x00}, - {0xcb, 0x00}, - {0xa4, 0x00}, - {0xa5, 0x00}, - {0xa6, 0x00}, - {0xa7, 0x00}, - - {0xfe, 0x00}, -//////////////////// flicker /////////////////// - {0x05, 0x02}, - {0x06, 0x2c}, - {0x07, 0x00}, - {0x08, 0xb8}, - - {0xfe, 0x01}, - {0x29, 0x00}, //anti-flicker step [11:8] - {0x2a, 0x60}, //anti-flicker step [7:0] - - {0x2b, 0x02}, //exp level 0 14.28fps - {0x2c, 0xa0}, - {0x2d, 0x02}, //exp level 1 12.50fps - {0x2e, 0xa0}, - {0x2f, 0x02}, //exp level 2 10.00fps - {0x30, 0xa0}, - {0x31, 0x02}, //exp level 3 7.14fps - {0x32, 0xa0}, - {0x33, 0x20}, - {0xfe, 0x00}, -////////////////////asde /////////////////// - {0xa0, 0xaf}, - {0xa2, 0xff}, - - {0x44, 0xa2}, // YUV order - - SensorEnd -}; -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={ - SensorEnd - -}; -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] ={ - SensorEnd -}; -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data[] = -{ - SensorEnd -}; -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[]={ - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[]={ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_softreset_data[]={ - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[]={ - SensorEnd -}; -/* -* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx -*/ -static struct rk_sensor_reg sensor_WhiteB_Auto[]= -{ - {0x77, 0x57}, - {0x78, 0x4d}, - {0x79, 0x45}, - {0x42, 0xfe}, - SensorEnd -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[]= -{ - {0x42, 0xfc}, - {0x77, 0x8c}, //WB_manual_gain - {0x78, 0x50}, - {0x79, 0x40}, - SensorEnd -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x42, 0xfc}, - {0x77, 0x74}, - {0x78, 0x52}, - {0x79, 0x40}, - SensorEnd -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0x42, 0xfc}, - {0x77, 0x40}, - {0x78, 0x42}, - {0x79, 0x50}, - SensorEnd - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x42, 0xfc}, - {0x77, 0x40}, - {0x78, 0x54}, - {0x79, 0x70}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[]= -{ - // Brightness -2 - - {0xfe, 0x01}, - {0x13, 0x40}, - {0xfe, 0x00}, - {0xd5, 0xe0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[]= -{ - // Brightness -1 - - {0xfe, 0x01}, - {0x13, 0x48}, - {0xfe, 0x00}, - {0xd5, 0xf0}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[]= -{ - // Brightness 0 - - - {0xfe, 0x01}, - {0x13, 0x50}, - {0xfe, 0x00}, - {0xd5, 0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[]= -{ - // Brightness +1 - - {0xfe, 0x01}, - {0x13, 0x58}, - {0xfe, 0x00}, - {0xd5, 0x10}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[]= -{ - // Brightness +2 - - {0xfe, 0x01}, - {0x13, 0x60}, - {0xfe, 0x00}, - {0xd5, 0x20}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[]= -{ - // Brightness +3 - - {0xfe, 0x01}, - {0x13, 0x68}, - {0xfe, 0x00}, - {0xd5, 0x30}, - - SensorEnd -}; -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = -{ - {0x43,0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = -{ - {0x43,0x02}, - {0xda,0x00}, - {0xdb,0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = -{ - {0x43,0x02}, - {0xda,0xd0}, - {0xdb,0x28}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Negative[] = -{ - //Negative - {0x43,0x01}, - SensorEnd -}; -static struct rk_sensor_reg sensor_Effect_Bluish[] = -{ - // Bluish - {0x43,0x02}, - {0xda,0x50}, - {0xdb,0xe0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = -{ - // Greenish - {0x43,0x02}, - {0xda,0xc0}, - {0xdb,0xc0}, - SensorEnd -}; -#if 0 -static struct rk_sensor_reg sensor_Effect_Grayscale[]= -{ - {0x23,0x02}, - {0x2d,0x0a}, - {0x20,0xff}, - {0xd2,0x90}, - {0x73,0x00}, - - {0xb3,0x40}, - {0xb4,0x80}, - {0xba,0x00}, - {0xbb,0x00}, - {0x00,0x00} -}; -#endif -static struct rk_sensor_reg *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; - -static struct rk_sensor_reg sensor_Exposure0[]= -{ - //-3 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure1[]= -{ - //-2 - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure2[]= -{ - //-1 - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure3[]= -{ - //default - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure4[]= -{ - // 1 - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure5[]= -{ - // 2 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure6[]= -{ - // 3 - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; - -static struct rk_sensor_reg sensor_Saturation0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -static struct rk_sensor_reg sensor_Contrast0[]= -{ - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast1[]= -{ - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast2[]= -{ - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast3[]= -{ - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast4[]= -{ - - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Contrast5[]= -{ - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast6[]= -{ - - SensorEnd -}; -static struct rk_sensor_reg *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; -static struct rk_sensor_reg sensor_SceneAuto[] = -{ - {0xfe, 0x01}, - {0x33, 0x20}, - {0xfe, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = -{ - {0xfe, 0x01}, - {0x33, 0x30}, - {0xfe, 0x00}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -static struct rk_sensor_reg sensor_Zoom0[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Zoom3[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; - -/* -* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu -*/ -static struct v4l2_querymenu sensor_menus[] = -{ -}; -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = -{ -}; - -//MUST define the current used format as the first item -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {MEDIA_BUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; -//static struct soc_camera_ops sensor_ops; - - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - - return 0; -} -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - - return 0; -} -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - - return 0; -} -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh (struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - return 0; -} -static int sensor_try_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf) -{ - return 0; -} - -static int sensor_softrest_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - char pid = 0; - int ret = 0; - struct generic_sensor *sensor = to_generic_sensor(client); - - /* check if it is an sensor sensor */ - ret = sensor_write(client, 0xfc, 0x16); //before read id should write 0xfc - msleep(20); - ret = sensor_read(client, 0x00, &pid); - if (ret != 0) { - SENSOR_TR("%s read chip id high byte failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - } - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - } - return pid; -} -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("Suspend"); - - } else { - SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n",pm_msg.event); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - - SENSOR_DG("Resume"); - - return 0; - -} -static int sensor_mirror_cb (struct i2c_client *client, int mirror) -{ - char val; - int err = 0; - - SENSOR_DG("mirror: %d",mirror); - if (mirror) { - sensor_write(client, 0xfe, 0); - err = sensor_read(client, 0x17, &val); - if (err == 0) { - if((val & 0x1) == 0) - err = sensor_write(client, 0x17, (val |0x1)); - else - err = sensor_write(client, 0x17, (val & 0xfe)); - } - } else { - //do nothing - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_mirror_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_mirror failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_mirror success, value:0x%x",ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - char val; - int err = 0; - - SENSOR_DG("flip: %d",flip); - if (flip) { - sensor_write(client, 0xfe, 0); - err = sensor_read(client, 0x17, &val); - if (err == 0) { - if((val & 0x2) == 0) - err = sensor_write(client, 0x17, (val |0x2)); - else - err = sensor_write(client, 0x17, (val & 0xfc)); - } - } else { - //do nothing - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_flip_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_flip failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_flip success, value:0x%x",ext_ctrl->value); - return 0; -} -/* -* the functions are focus callbacks -*/ -static int sensor_focus_init_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos){ - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client){ - return 0; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos) -{ - return 0; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client,int on){ - return 0; -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor* spsensor,struct soc_camera_device *icd) -{ - return; -} - -/* -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); - - - - - diff --git a/drivers/media/video/gc0329_old.c b/drivers/media/video/gc0329_old.c deleted file mode 100755 index bc5729971701..000000000000 --- a/drivers/media/video/gc0329_old.c +++ /dev/null @@ -1,3046 +0,0 @@ - -/* -o* Driver for MT9M001 CMOS Image Sensor from Micron - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_GC0329 -#define SENSOR_V4L2_IDENT V4L2_IDENT_GC0329 -#define SENSOR_ID 0xc0 //GC0329 ID -#define SENSOR_MIN_WIDTH 640//176 -#define SENSOR_MIN_HEIGHT 480//144 -#define SENSOR_MAX_WIDTH 640 -#define SENSOR_MAX_HEIGHT 480 -#define SENSOR_INIT_WIDTH 640 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 480 -#define SENSOR_INIT_WINSEQADR sensor_vga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_YUYV8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 1 -#define CONFIG_SENSOR_AntiBanding 0 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 0 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 - -#define CONFIG_SENSOR_I2C_SPEED 100000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH|\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) -struct reginfo -{ - u8 reg; - u8 val; -}; - -/* init 640X480 VGA */ -static struct reginfo sensor_init_data[] = -{ - // TODO: add initial code here - {0xfe, 0x80}, - {0xfe, 0x80}, - {0xfc, 0x16}, - {0xfc, 0x16}, - {0xfc, 0x16}, - {0xfc, 0x16}, - {0xfe, 0x00}, - {0xf0, 0x07}, - {0xf1, 0x01}, - - - - - {0x73, 0x90}, - {0x74, 0x80}, - {0x75, 0x80}, - {0x76, 0x94}, - - {0x42, 0x00}, - {0x77, 0x57}, - {0x78, 0x4d}, - {0x79, 0x45}, - //{0x42, 0xfc}, - - ////////////////////analog//////////////////// - {0x0a, 0x02}, - {0x0c, 0x02}, - {0x17, 0x17}, - {0x19, 0x05}, - {0x1b, 0x24}, - {0x1c, 0x04}, - {0x1e, 0x08}, - {0x1f, 0xc0}, //Analog_mode2//[7:6] comv_r - {0x20, 0x00}, - {0x21, 0x48}, - {0x22, 0xba}, - {0x23, 0x22}, - {0x24, 0x17}, - - ////////////////////blk//////////////////// - {0x26, 0xf7}, - {0x29, 0x80}, - {0x32, 0x04}, - {0x33, 0x20}, - {0x34, 0x20}, - {0x35, 0x20}, - {0x36, 0x20}, - - ////////////////////ISP BLOCK ENABL//////////////////// - {0x40, 0xff}, - {0x41, 0x44}, - {0x42, 0x7e}, - {0x44, 0xa2}, - {0x46, 0x03}, - {0x4b, 0xca}, - {0x4d, 0x01}, - {0x4f, 0x01}, - {0x70, 0x48}, - - //{0xb0, 0x00}, - //{0xbc, 0x00}, - //{0xbd, 0x00}, - //{0xbe, 0x00}, - ////////////////////DNDD//////////////////// - {0x80, 0xe7}, - {0x82, 0x55}, - {0x83, 0x03}, - {0x87, 0x4a}, - - ////////////////////INTPEE//////////////////// - {0x95, 0x45}, - - ////////////////////ASDE//////////////////// - //{0xfe, 0x01}, - //{0x18, 0x22}, - //{0xfe, 0x00); - //{0x9c, 0x0a}, - //{0xa0, 0xaf}, - //{0xa2, 0xff}, - //{0xa4, 0x50}, - //{0xa5, 0x21}, - //{0xa7, 0x35}, - - ////////////////////RGB gamma//////////////////// - //RGB gamma m4' - {0xbf, 0x06}, - {0xc0, 0x14}, - {0xc1, 0x27}, - {0xc2, 0x3b}, - {0xc3, 0x4f}, - {0xc4, 0x62}, - {0xc5, 0x72}, - {0xc6, 0x8d}, - {0xc7, 0xa4}, - {0xc8, 0xb8}, - {0xc9, 0xc9}, - {0xcA, 0xd6}, - {0xcB, 0xe0}, - {0xcC, 0xe8}, - {0xcD, 0xf4}, - {0xcE, 0xFc}, - {0xcF, 0xFF}, - - //////////////////CC/////////////////// - {0xfe, 0x00}, - - {0xb3, 0x44}, - {0xb4, 0xfd}, - {0xb5, 0x02}, - {0xb6, 0xfa}, - {0xb7, 0x48}, - {0xb8, 0xf0}, - - // crop - {0x50, 0x01}, - - ////////////////////YCP//////////////////// - {0xfe, 0x00}, - {0xd1, 0x38}, - {0xd2, 0x38}, - {0xdd, 0x54}, - - ////////////////////AEC//////////////////// - {0xfe, 0x01}, - {0x10, 0x40}, - {0x11, 0x21},//a1 - {0x12, 0x07}, - {0x13, 0x50}, //Y target - {0x17, 0x88}, - {0x21, 0xb0}, - {0x22, 0x48}, - {0x3c, 0x95}, - {0x3d, 0x50}, - {0x3e, 0x48}, - - ////////////////////AWB//////////////////// - {0xfe, 0x01}, - {0x06, 0x16}, - {0x07, 0x06}, - {0x08, 0x98}, - {0x09, 0xee}, - {0x50, 0xfc}, - {0x51, 0x20}, - {0x52, 0x0b}, - {0x53, 0x20}, - {0x54, 0x40}, - {0x55, 0x10}, - {0x56, 0x20}, - //{0x57, 0x40}, - {0x58, 0xa0}, - {0x59, 0x28}, - {0x5a, 0x02}, - {0x5b, 0x63}, - {0x5c, 0x34}, - {0x5d, 0x73}, - {0x5e, 0x11}, - {0x5f, 0x40}, - {0x60, 0x40}, - {0x61, 0xc8}, - {0x62, 0xa0}, - {0x63, 0x40}, - {0x64, 0x50}, - {0x65, 0x98}, - {0x66, 0xfa}, - {0x67, 0x70}, - {0x68, 0x58}, - {0x69, 0x85}, - {0x6a, 0x40}, - {0x6b, 0x39}, - {0x6c, 0x18}, - {0x6d, 0x28}, - {0x6e, 0x41}, - {0x70, 0x02}, - {0x71, 0x00}, - {0x72, 0x10}, - {0x73, 0x40}, - - //{0x74, 0x32}, - //{0x75, 0x40}, - //{0x76, 0x30}, - //{0x77, 0x48}, - //{0x7a, 0x50}, - //{0x7b, 0x20}, - - {0x80, 0x60}, - {0x81, 0x50}, - {0x82, 0x42}, - {0x83, 0x40}, - {0x84, 0x40}, - {0x85, 0x40}, - - {0x74, 0x40}, - {0x75, 0x58}, - {0x76, 0x24}, - {0x77, 0x40}, - {0x78, 0x20}, - {0x79, 0x60}, - {0x7a, 0x58}, - {0x7b, 0x20}, - {0x7c, 0x30}, - {0x7d, 0x35}, - {0x7e, 0x10}, - {0x7f, 0x08}, - - ////////////////////ABS//////////////////// - {0x9c, 0x02}, - {0x9d, 0x20}, - //{0x9f, 0x40}, - - ////////////////////CC-AWB//////////////////// - {0xd0, 0x00}, - {0xd2, 0x2c}, - {0xd3, 0x80}, - - ////////////////////LSC/////////////////// - //// for xuye062d lens setting - {0xfe, 0x01}, - {0xa0, 0x00}, - {0xa1, 0x3c}, - {0xa2, 0x50}, - {0xa3, 0x00}, - {0xa8, 0x0f}, - {0xa9, 0x08}, - {0xaa, 0x00}, - {0xab, 0x04}, - {0xac, 0x00}, - {0xad, 0x07}, - {0xae, 0x0e}, - {0xaf, 0x00}, - {0xb0, 0x00}, - {0xb1, 0x09}, - {0xb2, 0x00}, - {0xb3, 0x00}, - {0xb4, 0x31}, - {0xb5, 0x19}, - {0xb6, 0x24}, - {0xba, 0x3a}, - {0xbb, 0x24}, - {0xbc, 0x2a}, - {0xc0, 0x17}, - {0xc1, 0x13}, - {0xc2, 0x17}, - {0xc6, 0x21}, - {0xc7, 0x1c}, - {0xc8, 0x1c}, - {0xb7, 0x00}, - {0xb8, 0x00}, - {0xb9, 0x00}, - {0xbd, 0x00}, - {0xbe, 0x00}, - {0xbf, 0x00}, - {0xc3, 0x00}, - {0xc4, 0x00}, - {0xc5, 0x00}, - {0xc9, 0x00}, - {0xca, 0x00}, - {0xcb, 0x00}, - {0xa4, 0x00}, - {0xa5, 0x00}, - {0xa6, 0x00}, - {0xa7, 0x00}, - - - {0xfe, 0x00}, - {0x05, 0x00}, - {0x06, 0x6a}, - {0x07, 0x00}, - {0x08, 0x70}, - - {0xfe, 0x01}, - {0x29, 0x00}, - {0x2a, 0x96}, - - {0x2b, 0x02}, - {0x2c, 0x58},//12 fps - {0x2d, 0x02}, - {0x2e, 0x58}, - {0x2f, 0x02},//10 fps - {0x30, 0x58}, - {0x31, 0x07}, - {0x32, 0x08}, - - - - ////////////20120427//////////////// - {0xfe,0x01}, - {0x18,0x22}, - {0x21,0xc0}, - {0x06,0x12}, - {0x08,0x9c}, - {0x51,0x28}, - {0x52,0x10}, - {0x53,0x20}, - {0x54,0x40}, - {0x55,0x16}, - {0x56,0x30}, - {0x58,0x60}, - {0x59,0x08}, - {0x5c,0x35}, - {0x5d,0x72}, - {0x67,0x80}, - {0x68,0x60}, - {0x69,0x90}, - {0x6c,0x30}, - {0x6d,0x60}, - {0x70,0x10}, - - {0xfe,0x00}, - {0x9c,0x0a}, - {0xa0,0xaf}, - {0xa2,0xff}, - {0xa4,0x60}, - {0xa5,0x31}, - {0xa7,0x35}, - {0x42,0xfe}, - {0xd1,0x34}, - {0xd2,0x34}, - {0xfe,0x00}, - - - - - - - - {0xfe, 0x00}, - ////////////////////asde /////////////////// - {0xa0, 0xaf}, - {0xa2, 0xff}, - - {0x44, 0xa2}, // YUV order - {0x00, 0x00}, - -}; -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {0x00,0x00} -}; - -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - {0x0, 0x0}, -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - - - {0xfe, 0x00}, - {0x05, 0x00}, - {0x06, 0x6a}, - {0x07, 0x00}, - {0x08, 0x70}, - - {0xfe, 0x01}, - {0x29, 0x00}, - {0x2a, 0x96}, - - {0x2b, 0x02}, - {0x2c, 0x58},//12 fps - {0x2d, 0x02}, - {0x2e, 0x58}, - {0x2f, 0x02},//10 fps - {0x30, 0x58}, - {0x31, 0x07}, - {0x32, 0x08}, - {0xfe, 0x00}, - - {0x00,0x00} -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {0x00,0x00} -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - {0x00,0x00} -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {0x00,0x00} -}; - -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {0x00, 0x00} -}; - - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - - {0x77, 0x57}, - {0x78, 0x4d}, - {0x79, 0x45}, - {0x42, 0xfe}, - {0x00, 0x00} -}; -/* Office Colour Temperature : 3500K - 5000K [incandesceny]*/ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0x42, 0xfd}, - {0x77, 0x40}, - {0x78, 0x58}, - {0x79, 0x5a}, - {0x00, 0x00} - -}; -/* Home Colour Temperature : 2500K - 3500K [daylight]*/ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x42, 0xfd}, - {0x77, 0x40}, - {0x78, 0x56}, - {0x79, 0x50}, - {0x00, 0x00} -}; - -/* ClearDay Colour Temperature : 5000K - 6500K [fluorescent]*/ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x42, 0xfd}, - {0x77, 0x40}, - {0x78, 0x58}, - {0x79, 0x5a}, - {0x00, 0x00} -}; - -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0x42, 0xfd}, - {0x77, 0x7a}, //WB_manual_gain - {0x78, 0x60}, - {0x79, 0x40}, - {0x00, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - // Brightness -2 - - {0xfe, 0x01}, - {0x13, 0x40}, - {0xfe, 0x00}, - {0xd5, 0xe0}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness1[]= -{ - // Brightness -1 - - {0xfe, 0x01}, - {0x13, 0x48}, - {0xfe, 0x00}, - {0xd5, 0xf0}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - // Brightness 0 - - - {0xfe, 0x01}, - {0x13, 0x50}, - {0xfe, 0x00}, - {0xd5, 0x00}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - // Brightness +1 - - {0xfe, 0x01}, - {0x13, 0x58}, - {0xfe, 0x00}, - {0xd5, 0x10}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - // Brightness +2 - - {0xfe, 0x01}, - {0x13, 0x60}, - {0xfe, 0x00}, - {0xd5, 0x20}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - // Brightness +3 - - {0xfe, 0x01}, - {0x13, 0x68}, - {0xfe, 0x00}, - {0xd5, 0x30}, - {0x00, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0xfe, 0x00}, - {0x43, 0x00}, //special_effect - {0x40, 0xff}, //[7:6]gamma - {0x41, 0x22}, //[1]Y_gamma_en - {0x42, 0xff}, //[2]ABS [1]AWB - - {0x95, 0x64}, //Edge effect - {0x96, 0x82}, //[7:4] edge_max [3:0] edge_th - {0x90, 0xbc}, //EEINTP mode 1 - - {0x4f, 0x01}, //AEC_en - {0xd3, 0x40}, //luma_contrast - {0xd4, 0x80}, //contrast_center - {0xd5, 0x00}, //luma_offset - {0xda, 0x00}, //fixed_Cb - {0xdb, 0x00}, //fixed_Cr - - {0xbf, 0x0e}, //RGB gamma - {0xc0, 0x1c}, - {0xc1, 0x34}, - {0xc2, 0x48}, - {0xc3, 0x5a}, - {0xc4, 0x6b}, - {0xc5, 0x7b}, - {0xc6, 0x95}, - {0xc7, 0xab}, - {0xc8, 0xbf}, - {0xc9, 0xce}, - {0xca, 0xd9}, - {0xcb, 0xe4}, - {0xcc, 0xec}, - {0xcd, 0xf7}, - {0xce, 0xfd}, - {0xcf, 0xff}, - - {0x00,0x00} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {0xfe, 0x00}, - {0x43, 0x02}, //special_effect - {0x40, 0xff}, //[7:6]gamma - {0x41, 0x22}, //[1]Y_gamma_en - {0x42, 0xff}, //[2]ABS [1]AWB - - {0x95, 0x64}, //Edge effect - {0x96, 0x82}, //[7:4] edge_max [3:0] edge_th - {0x90, 0xbc}, //EEINTP mode 1 - - {0x4f, 0x01}, //AEC_en - {0xd3, 0x40}, //luma_contrast - {0xd4, 0x80}, //contrast_center - {0xd5, 0x00}, //luma_offset - {0xda, 0x00}, //fixed_Cb - {0xdb, 0x00}, //fixed_Cr - - {0xbf, 0x0e}, //RGB gamma - {0xc0, 0x1c}, - {0xc1, 0x34}, - {0xc2, 0x48}, - {0xc3, 0x5a}, - {0xc4, 0x6b}, - {0xc5, 0x7b}, - {0xc6, 0x95}, - {0xc7, 0xab}, - {0xc8, 0xbf}, - {0xc9, 0xce}, - {0xca, 0xd9}, - {0xcb, 0xe4}, - {0xcc, 0xec}, - {0xcd, 0xf7}, - {0xce, 0xfd}, - {0xcf, 0xff}, - - {0x00,0x00} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - - {0xfe, 0x00}, - {0x43, 0x02}, //special_effect - {0x40, 0xff}, //[7:6]gamma - {0x41, 0x22}, //[1]Y_gamma_en - {0x42, 0xff}, //[2]ABS [1]AWB - - {0x95, 0x64}, //Edge effect - {0x96, 0x82}, //[7:4] edge_max [3:0] edge_th - {0x90, 0xbc}, //EEINTP mode 1 - - {0x4f, 0x01}, //AEC_en - {0xd3, 0x40}, //luma_contrast - {0xd4, 0x80}, //contrast_center - {0xd5, 0x00}, //luma_offset - {0xda, 0xd0}, //fixed_Cb - {0xdb, 0x28}, //fixed_Cr - - {0xbf, 0x0e}, //RGB gamma - {0xc0, 0x1c}, - {0xc1, 0x34}, - {0xc2, 0x48}, - {0xc3, 0x5a}, - {0xc4, 0x6b}, - {0xc5, 0x7b}, - {0xc6, 0x95}, - {0xc7, 0xab}, - {0xc8, 0xbf}, - {0xc9, 0xce}, - {0xca, 0xd9}, - {0xcb, 0xe4}, - {0xcc, 0xec}, - {0xcd, 0xf7}, - {0xce, 0xfd}, - {0xcf, 0xff}, - {0x00,0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - {0xfe, 0x00}, - {0x43, 0x01}, //special_effect - {0x40, 0xff}, //[7:6]gamma - {0x41, 0x22}, //[1]Y_gamma_en - {0x42, 0xff}, //[2]ABS [1]AWB - - {0x95, 0x64}, //Edge effect - {0x96, 0x82}, //[7:4] edge_max [3:0] edge_th - {0x90, 0xbc}, //EEINTP mode 1 - - {0x4f, 0x01}, //AEC_en - {0xd3, 0x40}, //luma_contrast - {0xd4, 0x80}, //contrast_center - {0xd5, 0x00}, //luma_offset - {0xda, 0x00}, //fixed_Cb - {0xdb, 0x00}, //fixed_Cr - - {0xbf, 0x0e}, //RGB gamma - {0xc0, 0x1c}, - {0xc1, 0x34}, - {0xc2, 0x48}, - {0xc3, 0x5a}, - {0xc4, 0x6b}, - {0xc5, 0x7b}, - {0xc6, 0x95}, - {0xc7, 0xab}, - {0xc8, 0xbf}, - {0xc9, 0xce}, - {0xca, 0xd9}, - {0xcb, 0xe4}, - {0xcc, 0xec}, - {0xcd, 0xf7}, - {0xce, 0xfd}, - {0xcf, 0xff}, - - {0x00,0x00} -}; - -//SOLARIZE -static struct reginfo sensor_Effect_Bluish[] = -{ - {0xfe, 0x00}, - {0x43, 0x00}, //special_effect - {0x40, 0xff}, //[7:6]gamma - {0x41, 0x22}, //[1]Y_gamma_en - {0x42, 0xff}, //[2]ABS [1]AWB - - {0x95, 0x64}, //Edge effect - {0x96, 0x82}, //[7:4] edge_max [3:0] edge_th - {0x90, 0xbc}, //EEINTP mode 1 - - {0x4f, 0x01}, //AEC_en - {0xd3, 0x40}, //luma_contrast - {0xd4, 0x80}, //contrast_center - {0xd5, 0x00}, //luma_offset - {0xda, 0x00}, //fixed_Cb - {0xdb, 0x00}, //fixed_Cr - - {0xbf, 0x10}, //RGB gamma - {0xc0, 0x20}, - {0xc1, 0x38}, - {0xc2, 0x4e}, - {0xc3, 0x63}, - {0xc4, 0x76}, - {0xc5, 0x87}, - {0xc6, 0xa2}, - {0xc7, 0xb4}, - {0xc8, 0xa8}, - {0xc9, 0x91}, - {0xca, 0x7b}, - {0xcb, 0x66}, - {0xcc, 0x4f}, - {0xcd, 0x39}, - {0xce, 0x24}, - {0xcf, 0x12}, - - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - //Greenish - {0x43,0x02}, - {0xda,0xc0}, - {0xdb,0xc0}, - {0x00,0x00} -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure1[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {0x00, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast2[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - - {0x00, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - {0xb3,0x50}, - {0x00, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - - {0x00, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {0x00, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ - {0xfe, 0x01}, - {0x33, 0x20}, - {0xfe, 0x00}, - {0x00, 0x00} -}; - -static struct reginfo sensor_SceneNight[] = -{ - {0xfe, 0x01}, - {0x33, 0x30}, - {0xfe, 0x00}, - {0x00, 0x00} -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif - -#if CONFIG_SENSOR_AntiBanding -static struct reginfo sensor_AntiBanding_50HZ[] = -{ - -{0xfe, 0x00}, - {0x05, 0x00}, - {0x06, 0x6a}, - {0x07, 0x00}, - {0x08, 0x70}, - - {0xfe, 0x01}, - {0x29, 0x00}, - {0x2a, 0x96}, - - {0x2b, 0x02}, - {0x2c, 0x58},//12 fps - {0x2d, 0x02}, - {0x2e, 0x58}, - {0x2f, 0x02},//10 fps - {0x30, 0x58}, - {0x31, 0x07}, - {0x32, 0x08}, - - -{0xfe, 0x00}, - - {0x00, 0x00} -}; - -static struct reginfo sensor_AntiBanding_60HZ[] = -{ - {0xfe, 0x00}, - {0x05, 0x00}, - {0x06, 0x6a}, - {0x07, 0x00}, - {0x08, 0x89}, - - {0xfe, 0x01}, - {0x29, 0x00}, - {0x2a, 0x7d}, - - {0x2b, 0x02}, - {0x2c, 0x71},//12 fps - {0x2d, 0x02}, - {0x2e, 0x71}, - {0x2f, 0x02},//10 fps - {0x30, 0x71}, - {0x31, 0x04}, - {0x32, 0xe2}, - - -{0xfe, 0x00}, - - - {0x00, 0x00} -}; -static struct reginfo *sensor_AntibandingSeqe[] = {sensor_AntiBanding_50HZ, sensor_AntiBanding_60HZ,NULL,}; -#endif - -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom1[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom2[] = -{ - {0x0, 0x0}, -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {0x0, 0x0}, -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif -static const struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,}, //{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,} , - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_AntiBanding - { .id = V4L2_CID_ANTIBANDING, .index = 0, .name = "50hz", .reserved = 0,} ,{ .id = V4L2_CID_ANTIBANDING, .index = 1, .name = "60hz", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static const struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_AntiBanding - { - .id = V4L2_CID_ANTIBANDING, - .type = V4L2_CTRL_TYPE_MENU, - .name = "antibanding Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - //{V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int antibanding; - int digitalzoom; - int focus; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - unsigned int winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int funmodule_state; -} sensor_info_priv_t; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, u8 reg, u8 val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[1]; - - buf[0] = reg & 0xFF; - buf[1] = val; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) -{ - int err,cnt; - //u8 buf[2]; - u8 buf[1]; - struct i2c_msg msg[2]; - - //buf[0] = reg >> 8; - buf[0] = reg; - buf[1] = reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 1; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - - while (regarray[i].reg != 0) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - i++; - } - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -#if CONFIG_SENSOR_I2C_RDWRCHK - - -static int sensor_check_array(struct i2c_client *client, struct reginfo *regarray) -{ - int ret; - int i = 0; - - u8 value; - - for(i=0;ipowerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_power_end: - return ret; -} - -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - const struct sensor_datafmt *fmt; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - int ret; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - /* ret = sensor_write(client, 0x12, 0x80); - if (ret != 0) - { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); */ //delay 5 microseconds - - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - - sensor_task_lock(client,0); - - sensor->info_priv.winseqe_cur_addr = (int)SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - #if CONFIG_SENSOR_AntiBanding - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ANTIBANDING); - if (qctrl) - sensor->info_priv.antibanding = qctrl->default_value; - #endif - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - #endif - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} - -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - //u8 reg_val; - struct sensor *sensor = to_sensor(client); - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - sensor_ioctrl(icd, Sensor_PowerDown, 1); - msleep(10); - - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - - return 0; -} -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - - return 0; - -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -/* -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -*/ -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct sensor *sensor = to_sensor(client); -// const struct v4l2_queryctrl *qctrl; -// struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - int ret=0, set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - winseqe_set_addr = sensor_svga; - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - winseqe_set_addr = sensor_sxga; - set_w = 1280; - set_h = 1024; - } - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) { - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - } else { /* ddl@rock-chips.com : Video */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - } - #endif - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - - sensor->info_priv.winseqe_cur_addr = (int)winseqe_set_addr; - - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; - -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - set_w = 1280; - set_h = 1024; - } - else - { /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - - mf->width = set_w; - mf->height = set_h; - mf->colorspace = fmt->colorspace; - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV9650 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -#if CONFIG_SENSOR_AntiBanding -static int sensor_set_antibanding(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_AntibandingSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_AntibandingSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value > 0) && ((digitalzoom_cur + value) > digitalzoom_total)) - { - value = digitalzoom_total - digitalzoom_cur; - } - - if ((value < 0) && ((digitalzoom_cur + value) < 0)) - { - value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - #if CONFIG_SENSOR_AntiBanding - case V4L2_CID_ANTIBANDING: - { - ext_ctrl->value = sensor->info_priv.antibanding; - break; - } - #endif - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_AntiBanding - case V4L2_CID_ANTIBANDING: - { - if (ext_ctrl->value != sensor->info_priv.antibanding) - { - if (sensor_set_antibanding(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.antibanding = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char pid = 0; - int ret; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - SENSOR_TR("power down %s failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - /* soft reset */ - /* ret = sensor_write(client, 0x12, 0x80); - if (ret != 0) - { - SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); - return -ENODEV; - } - mdelay(50); *///delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_write(client, 0xfc, 0x16); //before read id should write 0xfc - msleep(20); - ret = sensor_read(client, 0x00, &pid); - if (ret != 0) { - SENSOR_TR("%s read chip id high byte failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - - return ret; -} - -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0; -#if CONFIG_SENSOR_Flash - int i; -#endif - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - int j = 0; - for(j = 0;j < RK29_CAM_SUPPORT_NUMS;j++){ - if (sensor->sensor_io_request->gpio_res[j].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[j].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[j]; - break; - } - } - if(j == RK29_CAM_SUPPORT_NUMS){ - SENSOR_TR("%s %s RK_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } - - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} - -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - - sensor->info_priv.fmt = sensor_colour_fmts[0]; - - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - - diff --git a/drivers/media/video/gc2015.c b/drivers/media/video/gc2015.c deleted file mode 100644 index 503a67efd6d9..000000000000 --- a/drivers/media/video/gc2015.c +++ /dev/null @@ -1,1117 +0,0 @@ -/* - * drivers/media/video/gc2015.c - * - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "generic_sensor.h" -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.0.3: -* add sensor_focus_af_const_pause_usr_cb; -*/ -static int version = KERNEL_VERSION(0,0,3); -module_param(version, int, S_IRUGO); - - - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_GC2015 -#define SENSOR_V4L2_IDENT V4L2_IDENT_GC2015 -#define SENSOR_ID 0x2005 -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_PCLK_SAMPLE_RISING|V4L2_MBUS_HSYNC_ACTIVE_HIGH| V4L2_MBUS_VSYNC_ACTIVE_LOW|\ - V4L2_MBUS_DATA_ACTIVE_HIGH |SOCAM_MCLK_24MHZ) -#define SENSOR_PREVIEW_W 800 -#define SENSOR_PREVIEW_H 600 -#define SENSOR_PREVIEW_FPS 15000 // 15fps -#define SENSOR_FULLRES_L_FPS 7500 // 7.5fps -#define SENSOR_FULLRES_H_FPS 7500 // 7.5fps -#define SENSOR_720P_FPS 0 -#define SENSOR_1080P_FPS 0 - -#define SENSOR_REGISTER_LEN 1 // sensor register address bytes -#define SENSOR_VALUE_LEN 1 // sensor register value bytes -static unsigned int SensorConfiguration = (CFG_WhiteBalance|CFG_Effect|CFG_Scene); -static unsigned int SensorChipID[] = {SENSOR_ID}; -/* Sensor Driver Configuration End */ - - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a,b) CONS4(SensorReg,SENSOR_REGISTER_LEN,Val,SENSOR_VALUE_LEN)(a,b) -#define sensor_write(client,reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_read(client,reg,v) CONS4(sensor_read_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_write_array generic_sensor_write_array - -struct sensor_parameter -{ - unsigned int PreviewDummyPixels; - unsigned int CaptureDummyPixels; - unsigned int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int PreviewPclk; - unsigned short int CapturePclk; - char awb[6]; -}; - -struct specific_sensor{ - struct generic_sensor common_sensor; - //define user data below - struct sensor_parameter parameter; - u16 shutter; - -}; - -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ - -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_init_data[] ={ - {0xfe, 0x80}, //soft reset - {0xfe, 0x80}, //soft reset - {0xfe, 0x80}, //soft reset - - {0xfe, 0x00}, //page0 - {0x45, 0x00}, //output_disable - - ////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////preview capture switch ///////////////////////////////////// - ////////////////////////////////////////////////////////////////////////////////////// - //preview - {0x02, 0x01}, //preview mode - {0x2a, 0xca}, //[7]col_binning, 0x[6]even skip - {0x48, 0x40}, //manual_gain - - //////////////////////////////////////////////////////////////////////// - ////////////////////////// preview LSC ///////////////////////////////// - //////////////////////////////////////////////////////////////////////// - {0xfe, 0x01}, //page1 - {0xb0, 0x03}, //[4]Y_LSC_en [3]lsc_compensate [2]signed_b4 [1:0]pixel array select - {0xb1, 0x46}, //P_LSC_red_b2 - {0xb2, 0x40}, //P_LSC_green_b2 - {0xb3, 0x40}, //P_LSC_blue_b2 - {0xb4, 0x24}, //P_LSC_red_b4 - {0xb5, 0x20}, //P_LSC_green_b4 - {0xb6, 0x22}, //P_LSC_blue_b4 - {0xb7, 0x00}, //P_LSC_compensate_b2 - {0xb8, 0x80}, //P_LSC_row_center, 0x344, 0x (1200/2-344)/2=128, 0x, 0x - {0xb9, 0x80}, //P_LSC_col_center, 0x544, 0x (1600/2-544)/2=128 - - - //////////////////////////////////////////////////////////////////////// - ////////////////////////// capture LSC ///////////////////////////////// - //////////////////////////////////////////////////////////////////////// - {0xba, 0x03}, //[4]Y_LSC_en [3]lsc_compensate [2]signed_b4 [1:0]pixel array select - {0xbb, 0x46}, //C_LSC_red_b2 - {0xbc, 0x40}, //C_LSC_green_b2 - {0xbd, 0x40}, //C_LSC_blue_b2 - {0xbe, 0x24}, //C_LSC_red_b4 - {0xbf, 0x20}, //C_LSC_green_b4 - {0xc0, 0x22}, //C_LSC_blue_b4 - {0xc1, 0x00}, //C_Lsc_compensate_b2 - {0xc2, 0x80}, //C_LSC_row_center, 0x344, 0x (1200/2-344)/2=128 - {0xc3, 0x80}, //C_LSC_col_center, 0x544, 0x (1600/2-544)/2=128 - {0xfe, 0x00}, //page0 - - //////////////////////////////////////////////////////////////////////// - ////////////////////////// analog configure /////////////////////////// - //////////////////////////////////////////////////////////////////////// - {0xfe, 0x00}, //page0 - {0x29, 0x00}, //cisctl mode 1 - {0x2b, 0x06}, //cisctl mode 3 - {0x32, 0x1c}, //analog mode 1 - {0x33, 0x0f}, //analog mode 2 - {0x34, 0x30}, //[6:4]da_rsg - - {0x35, 0x88}, //Vref_A25 - {0x37, 0x16}, //Drive Current - - ///////////////////////////////////////////////////////////////////// - /////////////////////////// ISP Related ///////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x40, 0xff}, - {0x41, 0x20}, //[5]skin_detectionenable[2]auto_gray, 0x[1]y_gamma - {0x42, 0xf6}, //[7]auto_sa[6]auto_ee[5]auto_dndd[4]auto_lsc[3]na[2]abs, 0x[1]awb - {0x4b, 0xe8}, //[1]AWB_gain_mode, 0x1:atpregain0:atpostgain - {0x4d, 0x03}, //[1]inbf_en - {0x4f, 0x01}, //AEC enable - - //////////////////////////////////////////////////////////////////// - /////////////////////////// BLK ////////////////////////////////// - //////////////////////////////////////////////////////////////////// - {0x63, 0x77}, //BLK mode 1 - {0x66, 0x00}, //BLK global offset - {0x6d, 0x00}, - {0x6e, 0x1a}, //BLK offset submode,offset R - {0x6f, 0x20}, - {0x70, 0x1a}, - {0x71, 0x20}, - {0x73, 0x00}, - {0x77, 0x80}, - {0x78, 0x80}, - {0x79, 0x90}, - - //////////////////////////////////////////////////////////////////// - /////////////////////////// DNDD /////////////////////////////////// - //////////////////////////////////////////////////////////////////// - {0x80, 0x07}, //[7]dn_inc_or_dec [4]zero_weight_mode[3]share [2]c_weight_adap [1]dn_lsc_mode [0]dn_b - {0x82, 0x0c}, //DN lilat b base - {0x83, 0x03}, - - //////////////////////////////////////////////////////////////////// - /////////////////////////// EEINTP //////////////////////////////// - //////////////////////////////////////////////////////////////////// - {0x8a, 0x7c}, - {0x8c, 0x02}, - {0x8e, 0x02}, - {0x8f, 0x45}, - - - ///////////////////////////////////////////////////////////////////// - /////////////////////////// CC_t //////////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0xb0, 0x40}, // 0x48 - {0xb1, 0xfe}, - {0xb2, 0x00}, - {0xb3, 0xf0}, - {0xb4, 0x50}, - {0xb5, 0xf8}, - {0xb6, 0x00}, - {0xb7, 0x00}, - {0xb8, 0x00}, - - - ///////////////////////////////////////////////////////////////////// - /////////////////////////// GAMMA /////////////////////////////////// - ///////////////////////////////////////////////////////////////////// - //RGB_GAMMA - {0xbf, 0x08}, - {0xc0, 0x1e}, - {0xc1, 0x33}, - {0xc2, 0x47}, - {0xc3, 0x59}, - {0xc4, 0x68}, - {0xc5, 0x74}, - {0xc6, 0x86}, - {0xc7, 0x97}, - {0xc8, 0xA5}, - {0xc9, 0xB1}, - {0xca, 0xBd}, - {0xcb, 0xC8}, - {0xcc, 0xD3}, - {0xcd, 0xE4}, - {0xce, 0xF4}, - {0xcf, 0xff}, - - /*{0xbf, 0x06}, - {0xc0, 0x1f}, - {0xc1, 0x38}, - {0xc2, 0x4c}, - {0xc3, 0x5b}, - {0xc4, 0x6b}, - {0xc5, 0x76}, - {0xc6, 0x8b}, - {0xc7, 0x9b}, - {0xc8, 0xac}, - {0xc9, 0xbb}, - {0xca, 0xc7}, - {0xcb, 0xd2}, - {0xcc, 0xdb}, - {0xcd, 0xea}, - {0xce, 0xf5}, - {0xcf, 0xff}, */ - - ///////////////////////////////////////////////////////////////////// - /////////////////////////// YCP_t /////////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0xd1, 0x40}, //saturation 38 - {0xd2, 0x40}, //saturation 38 - - {0xd3, 0x46}, // 2011-08-11 kim add - - {0xde, 0x21}, //auto_gray - - //////////////////////////////////////////////////////////////////// - /////////////////////////// ASDE /////////////////////////////////// - //////////////////////////////////////////////////////////////////// - {0x98, 0x3a}, - {0x99, 0x60}, - {0x9b, 0x00}, - {0x9f, 0x12}, - {0xa1, 0x80}, - {0xa2, 0x21}, - - {0xfe, 0x01}, //page1 - {0xc5, 0x10}, - {0xc6, 0xff}, - {0xc7, 0xff}, - {0xc8, 0xff}, - - //////////////////////////////////////////////////////////////////// - /////////////////////////// AEC //////////////////////////////////// - //////////////////////////////////////////////////////////////////// - {0x10, 0x09}, //AEC mode 1 - {0x11, 0x92}, //[7]fix target // 0xb2 2011-08-11 kim - {0x12, 0x20}, - {0x13, 0x78}, // 0x78 2011-08-11 kim - {0x17, 0x00}, - {0x1c, 0x96}, - {0x1d, 0x04}, // sunlight step - {0x1e, 0x11}, - {0x21, 0xc0}, //max_post_gain - {0x22, 0x40}, //max_pre_gain // 0x60 2011-08-11 kim - {0x2d, 0x06}, //P_N_AEC_exp_level_1[12:8] - {0x2e, 0x00}, //P_N_AEC_exp_level_1[7:0] - {0x1e, 0x32}, - {0x33, 0x00}, //[6:5]max_exp_level [4:0]min_exp_level - {0x34, 0x04}, // min exp - - //////////////////////////////////////////////////////////////////// - /////////////////////////// Measure Window ///////////////////////// - //////////////////////////////////////////////////////////////////// - {0x06, 0x07}, - {0x07, 0x03}, - {0x08, 0x64}, - {0x09, 0x4a}, - - //////////////////////////////////////////////////////////////////// - /////////////////////////// AWB //////////////////////////////////// - //////////////////////////////////////////////////////////////////// - {0x57, 0x40}, //number limit - {0x5d, 0x44}, // - {0x5c, 0x35}, //show mode,close dark_mode - {0x5e, 0x29}, //close color temp - {0x5f, 0x50}, - {0x60, 0x50}, - {0x65, 0xc0}, - //////////////////////////////////////////////////////////////////// - /////////////////////////// ABS //////////////////////////////////// - //////////////////////////////////////////////////////////////////// - {0x80, 0x82}, - {0x81, 0x00}, - - {0x82, 0x03}, /// - - {0x83, 0x10}, //ABS Y stretch limit - {0xfe, 0x00}, - //////////////////////////////////////////////////////////////////// - /////////////////////////// OUT //////////////////////////////////// - //////////////////////////////////////////////////////////////////// - {0xfe, 0x00}, - //crop - {0x50, 0x01}, - {0x51, 0x00}, - {0x52, 0x00}, - {0x53, 0x00}, - {0x54, 0x00}, - {0x55, 0x02}, - {0x56, 0x58}, - {0x57, 0x03}, - {0x58, 0x20}, - - {0x44, 0xa0}, //YUV sequence - {0x45, 0x0f}, //output enable - {0x46, 0x02}, //sync mode - - /* {0xbF, 0x0B}, - {0xc0, 0x16}, - {0xc1, 0x29}, - {0xc2, 0x3C}, - {0xc3, 0x4F}, - {0xc4, 0x5F}, - {0xc5, 0x6F}, - {0xc6, 0x8A}, - {0xc7, 0x9F}, - {0xc8, 0xB4}, - {0xc9, 0xC6}, - {0xcA, 0xD3}, - {0xcB, 0xDD}, - {0xcC, 0xE5}, - {0xcD, 0xF1}, - {0xcE, 0xFA}, - {0xcF, 0xFF},*/ - - {0x05, 0x01},//HB - {0x06, 0xc1}, - {0x07, 0x00},//VB - {0x08, 0x40}, - - {0xfe, 0x01}, - {0x29, 0x00},//Anti Step 128 - {0x2a, 0x80}, - - {0x2b, 0x05},//Level_0 10.00fps - {0x2c, 0x00}, - {0x2d, 0x06},//Level_1 8.33fps - {0x2e, 0x00}, - {0x2f, 0x08},//Level_2 6.25fps - {0x30, 0x00}, - {0x31, 0x09},//Level_3 5.55fps - {0x32, 0x00}, - {0x33, 0x20}, - {0xfe, 0x00}, - - //--------------------Updated By Mormo 2011/08/08 Start --------------------// - {0xfe, 0x00}, - {0x32, 0x34}, - {0x34, 0x00}, - //--------------------Updated By Mormo 2011/08/08 End ---------------------// - {0x7d, 0x80}, // - {0x7e, 0x80}, - {0x7f, 0x84}, - SensorEnd -}; -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={ - {0xfe, 0x00}, - - {0x48, 0x80}, // 68 - - {0x4f, 0x00}, // aec off - - {0x02, 0x00}, - {0x2a, 0x0a}, - - //subsample 1/1 - {0x59, 0x11}, - {0x5a, 0x06}, - {0x5b, 0x00}, - {0x5c, 0x00}, - {0x5d, 0x00}, - {0x5e , 0x00}, - {0x5f, 0x00}, - {0x60, 0x00}, - {0x61, 0x00}, - {0x62, 0x00}, - - //crop - {0x50, 0x01}, - {0x51, 0x00}, - {0x52, 0x00}, - {0x53, 0x00}, - {0x54, 0x00}, - {0x55, 0x04}, - {0x56, 0xb0}, - {0x57, 0x06}, - {0x58, 0x40}, - SensorEnd - -}; - -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] ={ - SensorEnd -}; -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data[] = -{ - {0xfe, 0x00}, - - {0x48, 0x40}, - {0x4f, 0x01}, // aec on - - {0x02, 0x01}, - {0x2a, 0xca}, - - //subsample 1/1 - {0x59, 0x11}, - {0x5a, 0x06}, - {0x5b, 0x00}, - {0x5c, 0x00}, - {0x5d, 0x00}, - {0x5e , 0x00}, - {0x5f, 0x00}, - {0x60, 0x00}, - {0x61, 0x00}, - {0x62, 0x00}, - - {0x50 , 0x01},//out window - {0x51 , 0x00}, - {0x52 , 0x00}, - {0x53 , 0x00}, - {0x54 , 0x00}, - {0x55 , 0x02}, - {0x56 , 0x58},// 600 - {0x57 , 0x03}, - {0x58 , 0x20},//800 - SensorEnd -}; -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[]={ - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[]={ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_softreset_data[]={ - SensorRegVal(0xfe,80), - SensorWaitMs(5), - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[]={ - SensorRegVal(0x00,0), - SensorRegVal(0x01,0), - SensorEnd -}; -/* -* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx -*/ -static struct rk_sensor_reg sensor_WhiteB_Auto[]= -{ - {0x42,0x76}, - SensorEnd -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[]= -{ - {0x42 , 0x74},// [1] AWB enable ¹¦ÄÜ¿ª¹ØAWB OFF - {0x7a , 0x8c}, //AWB_R_gain - {0x7b , 0x50}, //AWB_G_gain - {0x7c , 0x40}, //AWB_B_gain - SensorEnd -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x42 , 0x74},// [1] AWB enable ¹¦ÄÜ¿ª¹ØAWB OFF - {0x7a , 0x74}, //AWB_R_gain - {0x7b , 0x52}, //AWB_G_gain - {0x7c , 0x40}, //AWB_B_gain - SensorEnd -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0x42 , 0x74},// [1] AWB enable ¹¦ÄÜ¿ª¹ØAWB OFF - {0x7a , 0x48}, //AWB_R_gain - {0x7b , 0x40}, //AWB_G_gain - {0x7c , 0x5c}, //AWB_B_gain - SensorEnd - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x42 , 0x74},// [1] AWB enable ¹¦ÄÜ¿ª¹ØAWB OFF - {0x7a , 0x40}, //AWB_R_gain - {0x7b , 0x54}, //AWB_G_gain - {0x7c , 0x70}, //AWB_B_gain - SensorEnd -}; -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[]= -{ - // Brightness -2 - - {0xfe, 0x01}, - {0x13, 0x68}, //AEC_target_Y - {0xfe, 0x00}, - {0xd5, 0xe0},// Luma_offset - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[]= -{ - // Brightness -1 - {0xfe, 0x01}, - {0x13, 0x70}, //AEC_target_Y - {0xfe, 0x00}, - {0xd5, 0xf0},// Luma_offset - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[]= -{ - // Brightness 0 - - {0xfe, 0x01}, - {0x13, 0x78}, //AEC_target_Y 48 - {0xfe, 0x00}, - {0xd5, 0x00},// Luma_offset c0 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[]= -{ - // Brightness +1 - {0xfe, 0x01}, - {0x13, 0x80}, //AEC_target_Y - {0xfe, 0x00}, - {0xd5, 0x10},// Luma_offset - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[]= -{ - // Brightness +2 - {0xfe, 0x01}, - {0x13, 0x88}, //AEC_target_Y - {0xfe, 0x00}, - {0xd5, 0x20},// Luma_offset - - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[]= -{ - // Brightness +3 - {0xfe, 0x01}, - {0x13, 0x90}, //AEC_target_Y - {0xfe, 0x00}, - {0xd5, 0x30},// Luma_offset - - SensorEnd -}; -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = -{ - {0x43, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = -{ - {0x43, 0x02}, - {0xda, 0x50}, - {0xdb, 0xe0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = -{ - {0x43, 0x02}, - {0xda, 0xd0}, - {0xdb, 0x28}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Negative[] = -{ - //Negative - {0x43, 0x01}, - //{0xda, 0xc0}, - //{0xdb, 0xc0}, - SensorEnd -}; -static struct rk_sensor_reg sensor_Effect_Bluish[] = -{ - // Bluish - {0x43, 0x02}, - {0xda, 0x00}, - {0xdb, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = -{ - // Greenish - {0x43, 0x02}, - {0xda, 0xc0}, - {0xdb, 0xc0}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; - -static struct rk_sensor_reg sensor_Exposure0[]= -{ - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure2[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure3[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure4[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure5[]= -{ - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure6[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; - -static struct rk_sensor_reg sensor_Saturation0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -static struct rk_sensor_reg sensor_Contrast0[]= -{ - //Contrast -3 - {0xfe, 0x00}, - {0xd3, 0x2c}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast1[]= -{ - //Contrast -2 - {0xfe, 0x00}, - {0xd3, 0x30}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast2[]= -{ - // Contrast -1 - {0xfe, 0x00}, - {0xd3, 0x38}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast3[]= -{ - //Contrast 0 - {0xfe, 0x00}, - {0xd3, 0x40}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast4[]= -{ - //Contrast +1 - {0xfe, 0x00}, - {0xd3, 0x48}, - - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Contrast5[]= -{ - //Contrast +2 - {0xfe, 0x00}, - {0xd3, 0x50}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast6[]= -{ - //Contrast +3 - {0xfe, 0x00}, - {0xd3, 0x58}, - - SensorEnd -}; -static struct rk_sensor_reg *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; -static struct rk_sensor_reg sensor_SceneAuto[] = -{ - {0xfe, 0x01}, - {0x33, 0x00}, - {0xfe, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = -{ - //30fps ~ 5fps night mode for 60/50Hz light environment, 24Mhz clock input,36Mzh pclk - {0xfe, 0x01}, - {0x33, 0x20}, - {0xfe, 0x00}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -static struct rk_sensor_reg sensor_Zoom0[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Zoom3[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; - -/* -* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu -*/ -static struct v4l2_querymenu sensor_menus[] = -{ -}; -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = -{ -}; - -//MUST define the current used format as the first item -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {MEDIA_BUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG} -}; -/*static struct soc_camera_ops sensor_ops;*/ - - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ -static u16 GC2015_read_shutter(struct i2c_client *client); // add 2011-08-11 kim -static void GC2015_set_shutter(struct i2c_client *client, u16 shutter); // add 2011-08-11 kim - - -////// add 2011-08-11 kim -static u16 GC2015_read_shutter(struct i2c_client *client) -{ - u8 temp_reg1, temp_reg2; - u16 shutter; - - /* Backup the preview mode last shutter & sensor gain. */ - sensor_read(client, 0x03, &temp_reg1); - sensor_read(client, 0x04, &temp_reg2); - - shutter = (temp_reg1 << 8) | (temp_reg2 & 0xFF); - - return shutter; -} /* GC2015_read_shutter */ - -static void GC2015_set_shutter(struct i2c_client *client, u16 shutter) -{ - u16 temp_reg; - - temp_reg = shutter * 10 / 20; //// - - /*Set Shutter start*/ - if(temp_reg < 1) temp_reg = 1; - sensor_write(client ,0x03 , (temp_reg>>8)&0xff); - sensor_write(client ,0x04 , temp_reg&0xff); - /*Set Shutter end*/ -} -//////// end add kim -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - - return 0; -} -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - - return 0; -} -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - struct generic_sensor *sensor = to_generic_sensor(client); - struct specific_sensor *spsensor = to_specific_sensor(sensor); - spsensor->shutter= GC2015_read_shutter(client); // add 2011-08-11 kim - - return 0; -} -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh (struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - struct generic_sensor *sensor = to_generic_sensor(client); - struct specific_sensor *spsensor = to_specific_sensor(sensor); - if(mf->width >=1024) - GC2015_set_shutter(client, spsensor->shutter); // add 2011-08-11 kim - return 0; -} -static int sensor_try_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf) -{ - return 0; -} - -static int sensor_softrest_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - return 0; -} -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("Suspend"); - - } else { - SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n",pm_msg.event); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - - SENSOR_DG("Resume"); - - return 0; - -} -static int sensor_mirror_cb (struct i2c_client *client, int mirror) -{ - char val; - int err = 0; - - SENSOR_DG("mirror: %d",mirror); - if (mirror) { - sensor_write(client, 0xfe, 0); - err = sensor_read(client, 0x29, &val); - if (err == 0) { - if((val & 0x1) == 0) - err = sensor_write(client, 0x29, (val |0x1)); - else - err = sensor_write(client, 0x29, (val & 0xfe)); - } - } else { - //do nothing - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_mirror_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_mirror failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_mirror success, value:0x%x",ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - char val; - int err = 0; - - SENSOR_DG("flip: %d",flip); - if (flip) { - - sensor_write(client, 0xfe, 0); - err = sensor_read(client, 0x29, &val); - if (err == 0) { - if((val & 0x2) == 0) - err = sensor_write(client, 0x29, (val |0x2)); - else - err = sensor_write(client, 0x29, (val & 0xfc)); - } - } else { - //do nothing - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_flip_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_flip failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_flip success, value:0x%x",ext_ctrl->value); - return 0; -} -/* -* the functions are focus callbacks -*/ -static int sensor_focus_init_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos) { - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client){ - return 0; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos) -{ - return 0; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client,int on){ - return 0; -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor* spsensor,struct soc_camera_device *icd) -{ - return; -} - -/* -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); - - - - diff --git a/drivers/media/video/gc2015_old.c b/drivers/media/video/gc2015_old.c deleted file mode 100755 index 1c3101fd0466..000000000000 --- a/drivers/media/video/gc2015_old.c +++ /dev/null @@ -1,3095 +0,0 @@ -/* -o* Driver for MT9M001 CMOS Image Sensor from Micron - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(0, format, ## __VA_ARGS__) - - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_GC2015 -#define SENSOR_V4L2_IDENT V4L2_IDENT_GC2015 -#define SENSOR_ID 0x2005 -#define SENSOR_MIN_WIDTH 640 -#define SENSOR_MIN_HEIGHT 480 -#define SENSOR_MAX_WIDTH 1600 -#define SENSOR_MAX_HEIGHT 1200 -#define SENSOR_INIT_WIDTH 800//1024 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 600//768 -#define SENSOR_INIT_WINSEQADR sensor_svga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_UYVY8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 1 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 1 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 - -#define CONFIG_SENSOR_I2C_SPEED 100000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING|\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) - -struct reginfo -{ - u8 reg; - u8 val; -}; - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); - -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_GC2015_USER_DEFINED_SERIES -#include "gc2015_user_series.c" -#else -/* init SVGA preview */ -static struct reginfo sensor_init_data[] = - -{ - {0xfe, 0x80}, //soft reset - {0xfe, 0x80}, //soft reset - {0xfe, 0x80}, //soft reset - - {0xfe, 0x00}, //page0 - {0x45, 0x00}, //output_disable - - ////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////preview capture switch ///////////////////////////////////// - ////////////////////////////////////////////////////////////////////////////////////// - //preview - {0x02, 0x01}, //preview mode - {0x2a, 0xca}, //[7]col_binning, 0x[6]even skip - {0x48, 0x40}, //manual_gain - - //////////////////////////////////////////////////////////////////////// - ////////////////////////// preview LSC ///////////////////////////////// - //////////////////////////////////////////////////////////////////////// - {0xfe, 0x01}, //page1 - {0xb0, 0x03}, //[4]Y_LSC_en [3]lsc_compensate [2]signed_b4 [1:0]pixel array select - {0xb1, 0x46}, //P_LSC_red_b2 - {0xb2, 0x40}, //P_LSC_green_b2 - {0xb3, 0x40}, //P_LSC_blue_b2 - {0xb4, 0x24}, //P_LSC_red_b4 - {0xb5, 0x20}, //P_LSC_green_b4 - {0xb6, 0x22}, //P_LSC_blue_b4 - {0xb7, 0x00}, //P_LSC_compensate_b2 - {0xb8, 0x80}, //P_LSC_row_center, 0x344, 0x (1200/2-344)/2=128, 0x, 0x - {0xb9, 0x80}, //P_LSC_col_center, 0x544, 0x (1600/2-544)/2=128 - - - //////////////////////////////////////////////////////////////////////// - ////////////////////////// capture LSC ///////////////////////////////// - //////////////////////////////////////////////////////////////////////// - {0xba, 0x03}, //[4]Y_LSC_en [3]lsc_compensate [2]signed_b4 [1:0]pixel array select - {0xbb, 0x46}, //C_LSC_red_b2 - {0xbc, 0x40}, //C_LSC_green_b2 - {0xbd, 0x40}, //C_LSC_blue_b2 - {0xbe, 0x24}, //C_LSC_red_b4 - {0xbf, 0x20}, //C_LSC_green_b4 - {0xc0, 0x22}, //C_LSC_blue_b4 - {0xc1, 0x00}, //C_Lsc_compensate_b2 - {0xc2, 0x80}, //C_LSC_row_center, 0x344, 0x (1200/2-344)/2=128 - {0xc3, 0x80}, //C_LSC_col_center, 0x544, 0x (1600/2-544)/2=128 - {0xfe, 0x00}, //page0 - - //////////////////////////////////////////////////////////////////////// - ////////////////////////// analog configure /////////////////////////// - //////////////////////////////////////////////////////////////////////// - {0xfe, 0x00}, //page0 - {0x29, 0x00}, //cisctl mode 1 - {0x2b, 0x06}, //cisctl mode 3 - {0x32, 0x1c}, //analog mode 1 - {0x33, 0x0f}, //analog mode 2 - {0x34, 0x30}, //[6:4]da_rsg - - {0x35, 0x88}, //Vref_A25 - {0x37, 0x16}, //Drive Current - - ///////////////////////////////////////////////////////////////////// - /////////////////////////// ISP Related ///////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0x40, 0xff}, - {0x41, 0x20}, //[5]skin_detectionenable[2]auto_gray, 0x[1]y_gamma - {0x42, 0xf6}, //[7]auto_sa[6]auto_ee[5]auto_dndd[4]auto_lsc[3]na[2]abs, 0x[1]awb - {0x4b, 0xe8}, //[1]AWB_gain_mode, 0x1:atpregain0:atpostgain - {0x4d, 0x03}, //[1]inbf_en - {0x4f, 0x01}, //AEC enable - - //////////////////////////////////////////////////////////////////// - /////////////////////////// BLK ////////////////////////////////// - //////////////////////////////////////////////////////////////////// - {0x63, 0x77}, //BLK mode 1 - {0x66, 0x00}, //BLK global offset - {0x6d, 0x00}, - {0x6e, 0x1a}, //BLK offset submode,offset R - {0x6f, 0x20}, - {0x70, 0x1a}, - {0x71, 0x20}, - {0x73, 0x00}, - {0x77, 0x80}, - {0x78, 0x80}, - {0x79, 0x90}, - - //////////////////////////////////////////////////////////////////// - /////////////////////////// DNDD /////////////////////////////////// - //////////////////////////////////////////////////////////////////// - {0x80, 0x07}, //[7]dn_inc_or_dec [4]zero_weight_mode[3]share [2]c_weight_adap [1]dn_lsc_mode [0]dn_b - {0x82, 0x0c}, //DN lilat b base - {0x83, 0x03}, - - //////////////////////////////////////////////////////////////////// - /////////////////////////// EEINTP //////////////////////////////// - //////////////////////////////////////////////////////////////////// - {0x8a, 0x7c}, - {0x8c, 0x02}, - {0x8e, 0x02}, - {0x8f, 0x45}, - - - ///////////////////////////////////////////////////////////////////// - /////////////////////////// CC_t //////////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0xb0, 0x40}, // 0x48 - {0xb1, 0xfe}, - {0xb2, 0x00}, - {0xb3, 0xf0}, - {0xb4, 0x50}, - {0xb5, 0xf8}, - {0xb6, 0x00}, - {0xb7, 0x00}, - {0xb8, 0x00}, - - - ///////////////////////////////////////////////////////////////////// - /////////////////////////// GAMMA /////////////////////////////////// - ///////////////////////////////////////////////////////////////////// - //RGB_GAMMA - {0xbf, 0x08}, - {0xc0, 0x1e}, - {0xc1, 0x33}, - {0xc2, 0x47}, - {0xc3, 0x59}, - {0xc4, 0x68}, - {0xc5, 0x74}, - {0xc6, 0x86}, - {0xc7, 0x97}, - {0xc8, 0xA5}, - {0xc9, 0xB1}, - {0xca, 0xBd}, - {0xcb, 0xC8}, - {0xcc, 0xD3}, - {0xcd, 0xE4}, - {0xce, 0xF4}, - {0xcf, 0xff}, - - /*{0xbf, 0x06}, - {0xc0, 0x1f}, - {0xc1, 0x38}, - {0xc2, 0x4c}, - {0xc3, 0x5b}, - {0xc4, 0x6b}, - {0xc5, 0x76}, - {0xc6, 0x8b}, - {0xc7, 0x9b}, - {0xc8, 0xac}, - {0xc9, 0xbb}, - {0xca, 0xc7}, - {0xcb, 0xd2}, - {0xcc, 0xdb}, - {0xcd, 0xea}, - {0xce, 0xf5}, - {0xcf, 0xff}, */ - - ///////////////////////////////////////////////////////////////////// - /////////////////////////// YCP_t /////////////////////////////////// - ///////////////////////////////////////////////////////////////////// - {0xd1, 0x40}, //saturation 38 - {0xd2, 0x40}, //saturation 38 - - {0xd3, 0x46}, // 2011-08-11 kim add - - {0xde, 0x21}, //auto_gray - - //////////////////////////////////////////////////////////////////// - /////////////////////////// ASDE /////////////////////////////////// - //////////////////////////////////////////////////////////////////// - {0x98, 0x3a}, - {0x99, 0x60}, - {0x9b, 0x00}, - {0x9f, 0x12}, - {0xa1, 0x80}, - {0xa2, 0x21}, - - {0xfe, 0x01}, //page1 - {0xc5, 0x10}, - {0xc6, 0xff}, - {0xc7, 0xff}, - {0xc8, 0xff}, - - //////////////////////////////////////////////////////////////////// - /////////////////////////// AEC //////////////////////////////////// - //////////////////////////////////////////////////////////////////// - {0x10, 0x09}, //AEC mode 1 - {0x11, 0x92}, //[7]fix target // 0xb2 2011-08-11 kim - {0x12, 0x20}, - {0x13, 0x78}, // 0x78 2011-08-11 kim - {0x17, 0x00}, - {0x1c, 0x96}, - {0x1d, 0x04}, // sunlight step - {0x1e, 0x11}, - {0x21, 0xc0}, //max_post_gain - {0x22, 0x40}, //max_pre_gain // 0x60 2011-08-11 kim - {0x2d, 0x06}, //P_N_AEC_exp_level_1[12:8] - {0x2e, 0x00}, //P_N_AEC_exp_level_1[7:0] - {0x1e, 0x32}, - {0x33, 0x00}, //[6:5]max_exp_level [4:0]min_exp_level - {0x34, 0x04}, // min exp - - //////////////////////////////////////////////////////////////////// - /////////////////////////// Measure Window ///////////////////////// - //////////////////////////////////////////////////////////////////// - {0x06, 0x07}, - {0x07, 0x03}, - {0x08, 0x64}, - {0x09, 0x4a}, - - //////////////////////////////////////////////////////////////////// - /////////////////////////// AWB //////////////////////////////////// - //////////////////////////////////////////////////////////////////// - {0x57, 0x40}, //number limit - {0x5d, 0x44}, // - {0x5c, 0x35}, //show mode,close dark_mode - {0x5e, 0x29}, //close color temp - {0x5f, 0x50}, - {0x60, 0x50}, - {0x65, 0xc0}, - //////////////////////////////////////////////////////////////////// - /////////////////////////// ABS //////////////////////////////////// - //////////////////////////////////////////////////////////////////// - {0x80, 0x82}, - {0x81, 0x00}, - - {0x82, 0x03}, /// - - {0x83, 0x10}, //ABS Y stretch limit - {0xfe, 0x00}, - //////////////////////////////////////////////////////////////////// - /////////////////////////// OUT //////////////////////////////////// - //////////////////////////////////////////////////////////////////// - {0xfe, 0x00}, - //crop - {0x50, 0x01}, - {0x51, 0x00}, - {0x52, 0x00}, - {0x53, 0x00}, - {0x54, 0x00}, - {0x55, 0x02}, - {0x56, 0x58}, - {0x57, 0x03}, - {0x58, 0x20}, - - {0x44, 0xa0}, //YUV sequence - {0x45, 0x0f}, //output enable - {0x46, 0x02}, //sync mode - -/* {0xbF, 0x0B}, - {0xc0, 0x16}, - {0xc1, 0x29}, - {0xc2, 0x3C}, - {0xc3, 0x4F}, - {0xc4, 0x5F}, - {0xc5, 0x6F}, - {0xc6, 0x8A}, - {0xc7, 0x9F}, - {0xc8, 0xB4}, - {0xc9, 0xC6}, - {0xcA, 0xD3}, - {0xcB, 0xDD}, - {0xcC, 0xE5}, - {0xcD, 0xF1}, - {0xcE, 0xFA}, - {0xcF, 0xFF},*/ - - {0x05, 0x01},//HB - {0x06, 0xc1}, - {0x07, 0x00},//VB - {0x08, 0x40}, - - {0xfe, 0x01}, - {0x29, 0x00},//Anti Step 128 - {0x2a, 0x80}, - - {0x2b, 0x05},//Level_0 10.00fps - {0x2c, 0x00}, - {0x2d, 0x06},//Level_1 8.33fps - {0x2e, 0x00}, - {0x2f, 0x08},//Level_2 6.25fps - {0x30, 0x00}, - {0x31, 0x09},//Level_3 5.55fps - {0x32, 0x00}, - {0x33, 0x20}, - {0xfe, 0x00}, - -//--------------------Updated By Mormo 2011/08/08 Start --------------------// - {0xfe, 0x00}, - {0x32, 0x34}, - {0x34, 0x00}, -//--------------------Updated By Mormo 2011/08/08 End ---------------------// - {0x7d, 0x80}, // - {0x7e, 0x80}, - {0x7f, 0x84}, - - {0x0,0x0} - -}; - -/* 1600X1200 UXGA capture */ -static struct reginfo sensor_uxga[] = -{ - {0xfe, 0x00}, - - {0x48, 0x80}, // 68 - - {0x4f, 0x00}, // aec off - - {0x02, 0x00}, - {0x2a, 0x0a}, - - //subsample 1/1 - {0x59, 0x11}, - {0x5a, 0x06}, - {0x5b, 0x00}, - {0x5c, 0x00}, - {0x5d, 0x00}, - {0x5e , 0x00}, - {0x5f, 0x00}, - {0x60, 0x00}, - {0x61, 0x00}, - {0x62, 0x00}, - - //crop - {0x50, 0x01}, - {0x51, 0x00}, - {0x52, 0x00}, - {0x53, 0x00}, - {0x54, 0x00}, - {0x55, 0x04}, - {0x56, 0xb0}, - {0x57, 0x06}, - {0x58, 0x40}, - {0x0,0x0} -}; - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {0xfe, 0x00}, - - {0x48, 0x80}, // 68 - - {0x4f, 0x00}, // aec off - - {0x02, 0x00}, - {0x2a, 0x0a}, - - //subsample 1/1 - {0x59, 0x11}, - {0x5a, 0x06}, - {0x5b, 0x00}, - {0x5c, 0x00}, - {0x5d, 0x00}, - {0x5e , 0x00}, - {0x5f, 0x00}, - {0x60, 0x00}, - {0x61, 0x00}, - {0x62, 0x00}, - - //crop - {0x50, 0x01}, - {0x51, 0x00}, - {0x52, 0x00}, - {0x53, 0x00}, - {0x54, 0x00}, - {0x55, 0x04}, - {0x56, 0x00}, - {0x57, 0x05}, - {0x58, 0x00}, - {0x0, 0x0} -}; -/*1024*768*/ -static struct reginfo sensor_xga[] = -{ - {0xfe, 0x00}, - - {0x48, 0x80}, // 68 - - {0x4f, 0x00}, // aec off - - {0x02, 0x00}, - {0x2a, 0x0a}, - //subsample 1600x1200 to 1066x800 - {0x59 , 0x33},//out window - {0x5a , 0x06}, - {0x5b , 0x00}, - {0x5c , 0x00}, - {0x5d , 0x00}, - {0x5e , 0x01}, - {0x5f , 0x00}, - {0x60 , 0x00}, - {0x61 , 0x00}, - {0x62 , 0x01}, - - {0x50 , 0x01},//out window - {0x51 , 0x00}, - {0x52 , 0x10}, - {0x53 , 0x00}, - {0x54 , 0x14}, - {0x55 , 0x03}, - {0x56 , 0x00},// 768 - {0x57 , 0x04}, - {0x58 , 0x00},//1024 - {0x0, 0x0} -}; -/* 800X600 SVGA,30fps*/ -static struct reginfo sensor_svga[] = -{ - {0xfe, 0x00}, - - {0x48, 0x40}, - {0x4f, 0x01}, // aec on - - {0x02, 0x01}, - {0x2a, 0xca}, - - //subsample 1/1 - {0x59, 0x11}, - {0x5a, 0x06}, - {0x5b, 0x00}, - {0x5c, 0x00}, - {0x5d, 0x00}, - {0x5e , 0x00}, - {0x5f, 0x00}, - {0x60, 0x00}, - {0x61, 0x00}, - {0x62, 0x00}, - - {0x50 , 0x01},//out window - {0x51 , 0x00}, - {0x52 , 0x00}, - {0x53 , 0x00}, - {0x54 , 0x00}, - {0x55 , 0x02}, - {0x56 , 0x58},// 600 - {0x57 , 0x03}, - {0x58 , 0x20},//800 - {0x0,0x0} -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - - - {0xfe, 0x00}, - - {0x48, 0x40}, - {0x4f, 0x01}, // aec on - - {0x02, 0x01}, - {0x2a, 0xca}, - //subsample 4/5 - - {0x59 , 0x55},//out window - {0x5a , 0x06}, - {0x5b , 0x00}, - {0x5c , 0x00}, - {0x5d , 0x01}, - {0x5e , 0x23}, - {0x5f , 0x00}, - {0x60 , 0x00}, - {0x61 , 0x01}, - {0x62 , 0x23}, - - {0x50 , 0x01},//out window - {0x51 , 0x00}, - {0x52 , 0x00}, - {0x53 , 0x00}, - {0x54 , 0x00}, - {0x55 , 0x01}, - {0x56 , 0xe0},// 480 - {0x57 , 0x02}, - {0x58 , 0x80},//640 - {0x45 , 0x0f}, //output enable - {0x0,0x0} -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{}; -#endif -#if 0 -/* 160X120 QQVGA*/ -static struct reginfo ov2655_qqvga[] = -{ - {0x00, 0x00}, -}; - - - -static struct reginfo ov2655_Sharpness_auto[] = -{ - - {0x00, 0x00}, -}; - -static struct reginfo ov2655_Sharpness1[] = -{ - - {0x00, 0x00}, -}; - -static struct reginfo ov2655_Sharpness2[][3] = -{ - //Sharpness 2 - - {0x00, 0x00}, -}; - -static struct reginfo ov2655_Sharpness3[] = -{ - //default - - {0x00, 0x00}, -}; -static struct reginfo ov2655_Sharpness4[]= -{ - //Sharpness 4 - - {0x00, 0x00}, -}; - -static struct reginfo ov2655_Sharpness5[] = -{ - //Sharpness 5 - - {0x00, 0x00}, -}; -#endif - -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - - {0x00, 0x00} -}; - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0x42,0x76}, - {0x00, 0x00} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - - {0x42 , 0x74},// [1] AWB enable ¹¦ÄÜ¿ª¹ØAWB OFF - {0x7a , 0x8c}, //AWB_R_gain - {0x7b , 0x50}, //AWB_G_gain - {0x7c , 0x40}, //AWB_B_gain - {0x00, 0x00} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x42 , 0x74},// [1] AWB enable ¹¦ÄÜ¿ª¹ØAWB OFF - {0x7a , 0x74}, //AWB_R_gain - {0x7b , 0x52}, //AWB_G_gain - {0x7c , 0x40}, //AWB_B_gain - {0x00, 0x00} -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0x42 , 0x74},// [1] AWB enable ¹¦ÄÜ¿ª¹ØAWB OFF - {0x7a , 0x48}, //AWB_R_gain - {0x7b , 0x40}, //AWB_G_gain - {0x7c , 0x5c}, //AWB_B_gain - {0x00, 0x00} - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x42 , 0x74},// [1] AWB enable ¹¦ÄÜ¿ª¹ØAWB OFF - {0x7a , 0x40}, //AWB_R_gain - {0x7b , 0x54}, //AWB_G_gain - {0x7c , 0x70}, //AWB_B_gain - {0x00, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - // Brightness -2 - - {0xfe, 0x01}, - {0x13, 0x68}, //AEC_target_Y - {0xfe, 0x00}, - {0xd5, 0xe0},// Luma_offset - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness1[]= -{ - // Brightness -1 - {0xfe, 0x01}, - {0x13, 0x70}, //AEC_target_Y - {0xfe, 0x00}, - {0xd5, 0xf0},// Luma_offset - - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - // Brightness 0 - - {0xfe, 0x01}, - {0x13, 0x78}, //AEC_target_Y 48 - {0xfe, 0x00}, - {0xd5, 0x00},// Luma_offset c0 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - // Brightness +1 - {0xfe, 0x01}, - {0x13, 0x80}, //AEC_target_Y - {0xfe, 0x00}, - {0xd5, 0x10},// Luma_offset - - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - // Brightness +2 - {0xfe, 0x01}, - {0x13, 0x88}, //AEC_target_Y - {0xfe, 0x00}, - {0xd5, 0x20},// Luma_offset - - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - // Brightness +3 - {0xfe, 0x01}, - {0x13, 0x90}, //AEC_target_Y - {0xfe, 0x00}, - {0xd5, 0x30},// Luma_offset - {0x00, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - - {0x43, 0x00}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {0x43, 0x02}, - {0xda, 0x50}, - {0xdb, 0xe0}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x43, 0x02}, - {0xda, 0xd0}, - {0xdb, 0x28}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - //Negative - {0x43, 0x01}, - //{0xda, 0xc0}, - //{0xdb, 0xc0}, - {0x00, 0x00} -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - // Bluish - {0x43, 0x02}, - {0xda, 0x00}, - {0xdb, 0x00}, - - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish - {0x43, 0x02}, - {0xda, 0xc0}, - {0xdb, 0xc0}, - {0x00, 0x00} -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - //-3 - -}; - -static struct reginfo sensor_Exposure1[]= -{ - //-2 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - //-0.3EV - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - //default - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - // 1 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - // 2 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - // 3 - - {0x00, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - - {0x00, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - //Contrast -3 - {0xfe, 0x00}, - {0xd3, 0x2c}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - //Contrast -2 - {0xfe, 0x00}, - {0xd3, 0x30}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast2[]= -{ - // Contrast -1 - {0xfe, 0x00}, - {0xd3, 0x38}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - //Contrast 0 - {0xfe, 0x00}, - {0xd3, 0x40}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - //Contrast +1 - {0xfe, 0x00}, - {0xd3, 0x48}, - {0x00, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - //Contrast +2 - {0xfe, 0x00}, - {0xd3, 0x50}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - //Contrast +3 - {0xfe, 0x00}, - {0xd3, 0x58}, - {0x00, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {0x29 , 0x01}, - {0x00, 0x00} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {0x29 , 0x01}, - {0x00, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {0x29 , 0x02}, - {0x00, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {0x29 , 0x00}, - {0x00, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ - /* ddl@rock-chips.com : */ - {0xfe, 0x01}, - {0x33, 0x00}, - {0xfe, 0x00}, - - {0x00, 0x00} - -}; - -static struct reginfo sensor_SceneNight[] = -{ - - //30fps ~ 5fps night mode for 60/50Hz light environment, 24Mhz clock input,36Mzh pclk - {0xfe, 0x01}, - {0x33, 0x20}, - {0xfe, 0x00}, - {0x00, 0x00} - -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom1[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom2[] = -{ - {0x0, 0x0}, -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {0x0, 0x0}, -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif -static const struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_deactivate(struct i2c_client *client); -static int sensor_write(struct i2c_client *client, u8 reg, u8 val); -static int sensor_read(struct i2c_client *client, u8 reg, u8 *val); - - -static u16 GC2015_read_shutter(struct i2c_client *client); // add 2011-08-11 kim -static void GC2015_set_shutter(struct i2c_client *client, u16 shutter); // add 2011-08-11 kim - - -////// add 2011-08-11 kim -static u16 GC2015_read_shutter(struct i2c_client *client) -{ - u8 temp_reg1, temp_reg2; - u16 shutter; - - /* Backup the preview mode last shutter & sensor gain. */ - sensor_read(client, 0x03, &temp_reg1); - sensor_read(client, 0x04, &temp_reg2); - - shutter = (temp_reg1 << 8) | (temp_reg2 & 0xFF); - - return shutter; -} /* GC2015_read_shutter */ - -static void GC2015_set_shutter(struct i2c_client *client, u16 shutter) -{ - u16 temp_reg; - - temp_reg = shutter * 10 / 20; //// - - /*Set Shutter start*/ - if(temp_reg < 1) temp_reg = 1; - sensor_write(client ,0x03 , (temp_reg>>8)&0xff); - sensor_write(client ,0x04 , temp_reg&0xff); - /*Set Shutter end*/ -} -//////// end add kim - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - unsigned int winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int funmodule_state; -} sensor_info_priv_t; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - -#if 0 -/* sensor register */ -static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) -{ - int ret = 0; - - ret = i2c_master_reg8_recv(client, reg, val, 1, CONFIG_SENSOR_I2C_SPEED); - - return (ret > 0)? 0 : ret; -} - -static int sensor_write(struct i2c_client *client, u8 reg, u8 val) -{ - int ret = 0; - - ret = i2c_master_reg8_send(client, reg, &val, 1, CONFIG_SENSOR_I2C_SPEED); - - return (ret > 0)? 0 : ret; -} -#else -static int sensor_write(struct i2c_client *client, u8 reg, u8 val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[1]; - - buf[0] = reg; - buf[1] = val; - - if (reg == 0xfe) - mdelay(20); - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) -{ - int err,cnt; - u8 buf[1]; - struct i2c_msg msg[2]; - - buf[0] = reg ; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -#endif - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; - #if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; - #endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - while (regarray[i].reg != 0) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - //mdelay(5); - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - i++; - } - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != 0) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_power_end: - return ret; -} - -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - char value; - int ret,pid = 0; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - ret = sensor_write(client, 0xfe, 0x80); - if (ret != 0) - { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); //delay 5 microseconds - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x00, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value << 8); - - ret = sensor_read(client, 0x01, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - - sensor->info_priv.winseqe_cur_addr = (int)SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} - -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - - struct sensor *sensor = to_sensor(client); - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - sensor_ioctrl(icd, Sensor_PowerDown, 1); - msleep(100); - - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - - return 0; -} - -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - - return 0; - -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - int ret=0, set_w,set_h; - - u32 gc2015_shutter; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - winseqe_set_addr = sensor_svga; - set_w = 800-32; - set_h = 600; - } - else if (((set_w <= 1024) && (set_h <= 768)) && sensor_xga[0].reg) - { - gc2015_shutter = GC2015_read_shutter(client); // add 2011-08-11 kim - - winseqe_set_addr = sensor_xga; - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - gc2015_shutter = GC2015_read_shutter(client); // add 2011-08-11 kim - - winseqe_set_addr = sensor_sxga; - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && sensor_uxga[0].reg) - { - - gc2015_shutter = GC2015_read_shutter(client); // add 2011-08-11 kim - - winseqe_set_addr = sensor_uxga; - set_w = 1600-32; - set_h = 1200; - } - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) { - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - } else { /* ddl@rock-chips.com : Video */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - } - #endif - ret |= sensor_write_array(client, winseqe_set_addr); - - if(set_w >= 1024) GC2015_set_shutter(client, gc2015_shutter); // add 2011-08-11 kim - - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - - sensor->info_priv.winseqe_cur_addr = (int)winseqe_set_addr; - - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - if (sensor->info_priv.whiteBalance != 0) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - sensor->info_priv.snap2preview = true; - } else if (sensor_fmt_videochk(sd,mf) == true) { /* ddl@rock-chips.com : Video */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - sensor->info_priv.video2preview = true; - } else if ((sensor->info_priv.snap2preview == true) || (sensor->info_priv.video2preview == true)) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - sensor->info_priv.video2preview = false; - sensor->info_priv.snap2preview = false; - } - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; - -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - set_w = 800-32; - set_h = 600; - } - else if (((set_w <= 1024) && (set_h <= 768)) && sensor_xga[0].reg) - { - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && sensor_uxga[0].reg) - { - set_w = 1600-32; - set_h = 1200; - } - else - { - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - mf->width = set_w; - mf->height = set_h; - mf->colorspace = fmt->colorspace; - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV2655 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value > 0) && ((digitalzoom_cur + value) > digitalzoom_total)) - { - value = digitalzoom_total - digitalzoom_cur; - } - - if ((value < 0) && ((digitalzoom_cur + value) < 0)) - { - value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char value; - int ret,pid=0; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - - /* soft reset */ - ret = sensor_write(client, 0xfe, 0x80); - if (ret != 0) - { - SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); - return -ENODEV; - } - mdelay(5); //delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x00, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid |= (value << 8); - - ret = sensor_read(client, 0x01, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - - return ret; -} -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0; -#if CONFIG_SENSOR_Flash - int i; -#endif - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - sensor->sensor_gpio_res = NULL; - for (i=0; isensor_io_request->gpio_res[i].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[i].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[i]; - } - } - if (sensor->sensor_gpio_res == NULL) { - SENSOR_TR("%s %s obtain gpio resource failed when RK29_CAM_SUBDEV_IOREQUEST \n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - - sensor->info_priv.fmt = sensor_colour_fmts[0]; - - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - - diff --git a/drivers/media/video/gc2035.c b/drivers/media/video/gc2035.c deleted file mode 100644 index cd3516468f46..000000000000 --- a/drivers/media/video/gc2035.c +++ /dev/null @@ -1,1463 +0,0 @@ -/* - * drivers/media/video/gc2035.c - * - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "generic_sensor.h" - -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.0.3: -* add sensor_focus_af_const_pause_usr_cb; -*/ -static int version = KERNEL_VERSION(0,0,3); -module_param(version, int, S_IRUGO); - - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_GC2035 -#define SENSOR_V4L2_IDENT V4L2_IDENT_GC2035 -#define SENSOR_ID 0x2035 -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_PCLK_SAMPLE_RISING|V4L2_MBUS_HSYNC_ACTIVE_HIGH| V4L2_MBUS_VSYNC_ACTIVE_HIGH|\ - V4L2_MBUS_DATA_ACTIVE_HIGH |SOCAM_MCLK_24MHZ) -#define SENSOR_PREVIEW_W 800 -#define SENSOR_PREVIEW_H 600 -#define SENSOR_PREVIEW_FPS 15000 // 15fps -#define SENSOR_FULLRES_L_FPS 7500 // 7.5fps -#define SENSOR_FULLRES_H_FPS 7500 // 7.5fps -#define SENSOR_720P_FPS 0 -#define SENSOR_1080P_FPS 0 - -#define SENSOR_REGISTER_LEN 1 // sensor register address bytes -#define SENSOR_VALUE_LEN 1 // sensor register value bytes -static unsigned int SensorConfiguration = (CFG_WhiteBalance|CFG_Effect|CFG_Scene); -static unsigned int SensorChipID[] = {SENSOR_ID}; -/* Sensor Driver Configuration End */ - - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a,b) CONS4(SensorReg,SENSOR_REGISTER_LEN,Val,SENSOR_VALUE_LEN)(a,b) -#define sensor_write(client,reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_read(client,reg,v) CONS4(sensor_read_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_write_array generic_sensor_write_array - -struct sensor_parameter -{ - unsigned int PreviewDummyPixels; - unsigned int CaptureDummyPixels; - unsigned int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int PreviewPclk; - unsigned short int CapturePclk; - char awb[6]; -}; - -struct specific_sensor{ - struct generic_sensor common_sensor; - //define user data below - struct sensor_parameter parameter; - u16 shutter; - -}; - -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ - -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_init_data[] = -{ - {0xfe , 0x80}, - {0xfe , 0x80}, - {0xfe , 0x80}, - {0xfc , 0x06}, - {0xf2 , 0x00}, - {0xf3 , 0x00}, - {0xf4 , 0x00}, - {0xf5 , 0x00}, - {0xf9 , 0xfe}, //[0] pll enable - {0xfa , 0x00}, - {0xf6 , 0x00}, - {0xf7 , 0x15}, //pll enable - - {0xf8 , 0x85}, - {0xfe , 0x00}, - {0x82 , 0x00}, - {0xb3 , 0x60}, - {0xb4 , 0x40}, - {0xb5 , 0x60}, - - {0x03 , 0x02}, - {0x04 , 0x80}, - - //////////measure window /////////// - {0xfe , 0x00}, - {0xec , 0x06},//04 - {0xed , 0x06},//04 - {0xee , 0x62},//60 - {0xef , 0x92},//90 - - ///////////analog///////////// - {0x0a , 0x00}, //row start - {0x0c , 0x00}, //col start - {0x0d , 0x04}, - {0x0e , 0xc0}, - {0x0f , 0x06}, //Window setting - {0x10 , 0x58}, - {0x17 , 0x14}, //[0]mirror [1]flip - - - {0x18 , 0x0e}, //sdark 4 row in even frame?? - {0x19 , 0x0c}, //AD pipe number - - /* - /// ë´Ì ÏÖÏó - {0x18 , 0x0a}, //sdark 4 row in even frame?? - {0x19 , 0x0a}, //AD pipe number - */ - - {0x1a , 0x01}, //CISCTL mode4 - {0x1b , 0x8b}, - {0x1e , 0x88}, //analog mode1 [7] tx-high en [5:3]COL_bias - {0x1f , 0x08}, //[3] tx-low en// - {0x20 , 0x05}, //[0]adclk mode , 0x[1]rowclk_MODE [2]rsthigh_en - {0x21 , 0x0f}, //[6:4]rsg - {0x22 , 0xf0}, //[3:0]vref - {0x23 , 0xc3}, //f3//ADC_r - {0x24 , 0x17}, //pad drive 16 - - //AEC - {0xfe , 0x01}, - {0x11 , 0x20},//AEC_out_slope , 0x - {0x1f , 0xc0},//max_post_gain - {0x20 , 0x60},//max_pre_gain - {0x47 , 0x30},//AEC_outdoor_th - {0x0b , 0x10},// - {0x13 , 0x75},//y_target - {0xfe , 0x00}, - - - {0x05 , 0x01},//hb - {0x06 , 0x11}, - {0x07 , 0x00},//vb - {0x08 , 0x50}, - {0xfe , 0x01}, - {0x27 , 0x00},//step - {0x28 , 0xa0}, - {0x29 , 0x05},//level1 - {0x2a , 0x00}, - {0x2b , 0x05},//level2 - {0x2c , 0x00}, - {0x2d , 0x06},//6e8//level3 - {0x2e , 0xe0}, - {0x2f , 0x0a},//level4 - {0x30 , 0x00}, - {0x3e , 0x40}, - {0xfe , 0x00}, - {0xfe , 0x00}, //0x , 0x , 0x , 0x , 0x - {0xb6 , 0x03}, //AEC enable - {0xfe , 0x00}, - - /////////BLK////// - {0x3f , 0x00}, //prc close - {0x40 , 0x77},// - {0x42 , 0x7f}, - {0x43 , 0x30}, - {0x5c , 0x08}, - {0x5e , 0x20}, - {0x5f , 0x20}, - {0x60 , 0x20}, - {0x61 , 0x20}, - {0x62 , 0x20}, - {0x63 , 0x20}, - {0x64 , 0x20}, - {0x65 , 0x20}, - - ///block//////////// - {0x80 , 0xff}, - {0x81 , 0x26},//38 , 0x//skin_Y 8c_debug - {0x87 , 0x90}, //[7]middle gamma - {0x84 , 0x00}, //output put foramat - {0x86 , 0x07}, //02 //sync plority - {0x8b , 0xbc}, - {0xb0 , 0x80}, //globle gain - {0xc0 , 0x40},//Yuv bypass - - //////lsc///////////// - {0xfe , 0x01}, - {0xc2 , 0x38}, - {0xc3 , 0x25}, - {0xc4 , 0x21}, - {0xc8 , 0x19}, - {0xc9 , 0x12}, - {0xca , 0x0e}, - {0xbc , 0x43}, - {0xbd , 0x18}, - {0xbe , 0x1b}, - {0xb6 , 0x40}, - {0xb7 , 0x2e}, - {0xb8 , 0x26}, - {0xc5 , 0x05}, - {0xc6 , 0x03}, - {0xc7 , 0x04}, - {0xcb , 0x00}, - {0xcc , 0x00}, - {0xcd , 0x00}, - {0xbf , 0x14}, - {0xc0 , 0x22}, - {0xc1 , 0x1b}, - {0xb9 , 0x00}, - {0xba , 0x05}, - {0xbb , 0x05}, - {0xaa , 0x35}, - {0xab , 0x33}, - {0xac , 0x33}, - {0xad , 0x25}, - {0xae , 0x22}, - {0xaf , 0x27}, - {0xb0 , 0x1d}, - {0xb1 , 0x20}, - {0xb2 , 0x22}, - {0xb3 , 0x14}, - {0xb4 , 0x15}, - {0xb5 , 0x16}, - {0xd0 , 0x00}, - {0xd2 , 0x07}, - {0xd3 , 0x08}, - {0xd8 , 0x00}, - {0xda , 0x13}, - {0xdb , 0x17}, - {0xdc , 0x00}, - {0xde , 0x0a}, - {0xdf , 0x08}, - {0xd4 , 0x00}, - {0xd6 , 0x00}, - {0xd7 , 0x0c}, - {0xa4 , 0x00}, - {0xa5 , 0x00}, - {0xa6 , 0x00}, - {0xa7 , 0x00}, - {0xa8 , 0x00}, - {0xa9 , 0x00}, - {0xa1 , 0x80}, - {0xa2 , 0x80}, - - //////////cc////////////// - {0xfe , 0x02}, - {0xc0 , 0x01}, - {0xc1 , 0x40}, //Green_cc for d - {0xc2 , 0xfc}, - {0xc3 , 0x05}, - {0xc4 , 0xec}, - {0xc5 , 0x42}, - {0xc6 , 0xf8}, - {0xc7 , 0x40},//for cwf - {0xc8 , 0xf8}, - {0xc9 , 0x06}, - {0xca , 0xfd}, - {0xcb , 0x3e}, - {0xcc , 0xf3}, - {0xcd , 0x36},//for A - {0xce , 0xf6}, - {0xcf , 0x04}, - {0xe3 , 0x0c}, - {0xe4 , 0x44}, - {0xe5 , 0xe5}, - {0xfe , 0x00}, - - ///////awb start //////////////// - //AWB clear - {0xfe , 0x01}, - {0x4f , 0x00}, - {0x4d , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0x10}, // 10 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0x20}, // 20 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0x30}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, // 30 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0x40}, // 40 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0x50}, // 50 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0x60}, // 60 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0x70}, // 70 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0x80}, // 80 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0x90}, // 90 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0xa0}, // a0 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0xb0}, // b0 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0xc0}, // c0 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0xd0}, // d0 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4f , 0x01}, - /////// awb value//////// - {0xfe , 0x01}, - {0x4f , 0x00}, - {0x4d , 0x30}, - {0x4e , 0x00}, - {0x4e , 0x80}, - {0x4e , 0x80}, - {0x4e , 0x02}, - {0x4e , 0x02}, - {0x4d , 0x40}, - {0x4e , 0x00}, - {0x4e , 0x80}, - {0x4e , 0x80}, - {0x4e , 0x02}, - {0x4e , 0x02}, - {0x4e , 0x02}, - {0x4d , 0x53}, - {0x4e , 0x08}, - {0x4e , 0x04}, - {0x4d , 0x62}, - {0x4e , 0x10}, - {0x4d , 0x72}, - {0x4e , 0x20}, - {0x4f , 0x01}, - - /////awb//// - {0xfe , 0x01}, - {0x50 , 0x88},//c0//[6]green mode - {0x52 , 0x40}, - {0x54 , 0x60}, - {0x56 , 0x06}, - {0x57 , 0x20}, //pre adjust - {0x58 , 0x01}, - {0x5b , 0x02}, //AWB_gain_delta - {0x61 , 0xaa},//R/G stand - {0x62 , 0xaa},//R/G stand - {0x71 , 0x00}, - {0x74 , 0x10}, //0x//AWB_C_max - {0x77 , 0x08}, // 0x//AWB_p2_x - {0x78 , 0xfd}, //AWB_p2_y - {0x86 , 0x30}, - {0x87 , 0x00}, - {0x88 , 0x04},//06 , 0x//[1]dark mode - {0x8a , 0xc0},//awb move mode - {0x89 , 0x75}, - {0x84 , 0x08}, //0x//auto_window - {0x8b , 0x00}, // 0x//awb compare luma - {0x8d , 0x70}, //awb gain limit R - {0x8e , 0x70},//G - {0x8f , 0xf4},//B - {0xfe , 0x00}, - {0x82 , 0x02},//awb_en - /////////awb end ///////////// - - ///==========asde - {0xfe , 0x01}, - {0x21 , 0xbf}, - {0xfe , 0x02}, - {0xa4 , 0x00},// - {0xa5 , 0x40}, //lsc_th - {0xa2 , 0xa0}, //lsc_dec_slope - {0xa6 , 0x80}, //dd_th - {0xa7 , 0x80}, //ot_th - {0xab , 0x31}, // - {0xa9 , 0x6f}, // - {0xb0 , 0x99}, //0x//edge effect slope low - {0xb1 , 0x34},//edge effect slope low - {0xb3 , 0x80}, //saturation dec slope - {0xde , 0xb6}, // - {0x38 , 0x0f}, // - {0x39 , 0x60}, // - {0xfe , 0x00}, - {0x81 , 0x26}, - {0xfe , 0x02}, - {0x83 , 0x00},// - {0x84 , 0x45},// - ////////////YCP////////// - {0xd1 , 0x38},//saturation_cb - {0xd2 , 0x38},//saturation_Cr - {0xd3 , 0x40},//contrast ? - {0xd4 , 0x80},//contrast center - {0xd5 , 0x00},//luma_offset - {0xdc , 0x30}, - {0xdd , 0xb8},//edge_sa_g,b - {0xfe , 0x00}, - ///////dndd/////////// - {0xfe , 0x02}, - {0x88 , 0x15},//dn_b_base - {0x8c , 0xf6}, //[2]b_in_dark_inc - {0x89 , 0x03}, //dn_c_weight - ////////EE /////////// - {0xfe , 0x02}, - {0x90 , 0x6c},// EEINTP mode1 - {0x97 , 0x45},// edge effect - ////==============RGB Gamma - {0xfe , 0x02}, - {0x15 , 0x0a}, - {0x16 , 0x12}, - {0x17 , 0x19}, - {0x18 , 0x1f}, - {0x19 , 0x2c}, - {0x1a , 0x38}, - {0x1b , 0x42}, - {0x1c , 0x4e}, - {0x1d , 0x63}, - {0x1e , 0x76}, - {0x1f , 0x87}, - {0x20 , 0x96}, - {0x21 , 0xa2}, - {0x22 , 0xb8}, - {0x23 , 0xca}, - {0x24 , 0xd8}, - {0x25 , 0xe3}, - {0x26 , 0xf0}, - {0x27 , 0xf8}, - {0x28 , 0xfd}, - {0x29 , 0xff}, - - ///=================y gamma - {0xfe , 0x02}, - {0x2b , 0x00}, - {0x2c , 0x04}, - {0x2d , 0x09}, - {0x2e , 0x18}, - {0x2f , 0x27}, - {0x30 , 0x37}, - {0x31 , 0x49}, - {0x32 , 0x5c}, - {0x33 , 0x7e}, - {0x34 , 0xa0}, - {0x35 , 0xc0}, - {0x36 , 0xe0}, - {0x37 , 0xff}, - /////1600x1200size// - {0xfe , 0x00},// - {0x90 , 0x01}, //0x//crop enable - {0x95 , 0x04}, //0x//1600x1200 - {0x96 , 0xb0}, - {0x97 , 0x06}, - {0x98 , 0x40}, - - {0xfe , 0x03}, - {0x42 , 0x40}, - {0x43 , 0x06}, //output buf width - {0x41 , 0x02}, // Pclk_polarity - {0x40 , 0x40}, //00 - {0x17 , 0x00}, //widv - {0xfe , 0x00}, - ////output DVP///// - {0xfe , 0x00}, - {0xb6 , 0x03}, - {0xf7 , 0x15}, - - {0xc8 , 0x00},//close scaler - {0x99 , 0x22},// 1/2 subsample - {0x9a , 0x06}, - {0x9b , 0x00}, - {0x9c , 0x00}, - {0x9d , 0x00}, - {0x9e , 0x00}, - {0x9f , 0x00}, - {0xa0 , 0x00}, - {0xa1 , 0x00}, - {0xa2 ,0x00}, - - {0x90 , 0x01}, //crop enable - {0x94 , 0x02}, - {0x95 , 0x02}, - {0x96 , 0x58}, - {0x97 , 0x03}, - {0x98 , 0x20}, - {0xfe , 0x00}, - {0x82 , 0xfe}, // fe - {0xf2 , 0x70}, - {0xf3 , 0xff}, - {0xf4 , 0x00}, - {0xf5 , 0x30}, - - #if 0 - ///////// re zao/// - {0xfe,0x00}, - {0x22,0xd0}, - {0xfe,0x01}, - {0x21,0xff}, - {0xfe,0x02}, - {0x8a,0x33}, - {0x8c,0x76}, - {0x8d,0x85}, - {0xa6,0xf0}, - {0xae,0x9f}, - {0xa2,0x90}, - {0xa5,0x40}, - {0xa7,0x30}, - {0xb0,0x88}, - {0x38,0x0b}, - {0x39,0x30}, - {0xfe,0x00}, - {0x87,0xb0}, - - //// small RGB gamma//// - {0xfe , 0x02}, - {0x15 , 0x0b}, - {0x16 , 0x0e}, - {0x17 , 0x10}, - {0x18 , 0x12}, - {0x19 , 0x19}, - {0x1a , 0x21}, - {0x1b , 0x29}, - {0x1c , 0x31}, - {0x1d , 0x41}, - {0x1e , 0x50}, - {0x1f , 0x5f}, - {0x20 , 0x6d}, - {0x21 , 0x79}, - {0x22 , 0x91}, - {0x23 , 0xa5}, - {0x24 , 0xb9}, - {0x25 , 0xc9}, - {0x26 , 0xe1}, - {0x27 , 0xee}, - {0x28 , 0xf7}, - {0x29 , 0xff}, - - ////dark sun///// - {0xfe , 0x02}, - {0x40 , 0x06}, - {0x41 , 0x23}, - {0x42 , 0x3f}, - {0x43 , 0x06}, - {0x44 , 0x00}, - {0x45 , 0x00}, - {0x46 , 0x14}, - {0x47 , 0x09}, - - #endif - SensorEnd -}; -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={ - - - {0xfe , 0x00}, - {0xc8 , 0x00}, - {0xf7 , 0x17}, - - {0x99 , 0x11}, // disable sambsample - {0x9a , 0x06}, - {0x9b , 0x00}, - {0x9c , 0x00}, - {0x9d , 0x00}, - {0x9e , 0x00}, - {0x9f , 0x00}, - {0xa0 , 0x00}, - {0xa1 , 0x00}, - {0xa2 , 0x00}, - - {0x90 , 0x01}, - {0x95 , 0x04}, - {0x96 , 0xb0}, - {0x97 , 0x06}, - {0x98 , 0x40}, - - SensorEnd - - -}; - -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] ={ - SensorEnd -}; -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data[] = -{ - {0xfe , 0x00}, - {0xb6 , 0x03}, - {0xf7 , 0x15}, - - {0xc8 , 0x00},//close scaler - {0x99 , 0x22},// 1/2 subsample - {0x9a , 0x06}, - {0x9b , 0x00}, - {0x9c , 0x00}, - {0x9d , 0x00}, - {0x9e , 0x00}, - {0x9f , 0x00}, - {0xa0 , 0x00}, - {0xa1 , 0x00}, - {0xa2 , 0x00}, - - {0x90 , 0x01}, //crop enable - {0x94 , 0x02}, - {0x95 , 0x02}, - {0x96 , 0x58}, - {0x97 , 0x03}, - {0x98 , 0x20}, - SensorEnd -}; -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[]={ - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[]={ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_softreset_data[]={ - SensorRegVal(0xfe,80), - SensorWaitMs(5), - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[]={ - SensorRegVal(0xf0,0), - SensorRegVal(0xf1,0), - SensorEnd -}; -/* -* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx -*/ -static struct rk_sensor_reg sensor_WhiteB_Auto[]= -{ - {0xb3, 0x61}, - {0xb4, 0x40}, - {0xb5, 0x61}, - {0x82, 0xfe}, - SensorEnd -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[]= -{ - {0x82, 0xfc}, - {0xb3, 0x58}, - {0xb4, 0x40}, - {0xb5, 0x50}, - SensorEnd -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x82, 0xfc}, - {0xb3, 0x58}, - {0xb4, 0x40}, - {0xb5, 0x50}, - SensorEnd -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0x82, 0xfc}, - {0xb3, 0x50}, - {0xb4, 0x40}, - {0xb5, 0xa8}, - SensorEnd - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x82, 0xfc}, - {0xb3, 0xa0}, - {0xb4, 0x45}, - {0xb5, 0x40}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[]= -{ - // Brightness -2 - - {0xfe, 0x01}, - {0x13, 0x40}, - {0xfe, 0x02}, - {0xd5, 0xe0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[]= -{ - // Brightness -1 - - {0xfe, 0x01}, - {0x13, 0x48}, - {0xfe, 0x02}, - {0xd5, 0xf0}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[]= -{ - // Brightness 0 - - {0xfe, 0x01}, - {0x13, 0x58}, - {0xfe, 0x02}, - {0xd5, 0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[]= -{ - // Brightness +1 - {0xfe, 0x01}, - {0x13, 0x60}, - {0xfe, 0x02}, - {0xd5, 0x10}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[]= -{ - // Brightness +2 - {0xfe, 0x01}, - {0x13, 0x68}, - {0xfe, 0x02}, - {0xd5, 0x20}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[]= -{ - // Brightness +3 - {0xfe, 0x01}, - {0x13, 0x78}, - {0xfe, 0x02}, - {0xd5, 0x30}, - - SensorEnd -}; -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = -{ - {0xfe, 0x00}, - {0x83, 0xe0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = -{ - {0xfe, 0x00}, - {0x83, 0x12}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = -{ - {0xfe, 0x00}, - {0x83, 0x82}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Negative[] = -{ - //Negative - {0xfe, 0x00}, - {0x83, 0x01}, - SensorEnd -}; -static struct rk_sensor_reg sensor_Effect_Bluish[] = -{ - // Bluish - {0xfe, 0x00}, - {0x83, 0x62}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = -{ - // Greenish - {0xfe, 0x00}, - {0x83, 0x52}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; - -static struct rk_sensor_reg sensor_Exposure0[]= -{ - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure2[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure3[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure4[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure5[]= -{ - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure6[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; - -static struct rk_sensor_reg sensor_Saturation0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -static struct rk_sensor_reg sensor_Contrast0[]= -{ - //Contrast -3 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast1[]= -{ - //Contrast -2 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast2[]= -{ - // Contrast -1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast3[]= -{ - //Contrast 0 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast4[]= -{ - //Contrast +1 - - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Contrast5[]= -{ - //Contrast +2 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast6[]= -{ - //Contrast +3 - - SensorEnd -}; -static struct rk_sensor_reg *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; -static struct rk_sensor_reg sensor_SceneAuto[] = -{ - {0xfe,0x01}, - - {0x3e,0x40}, - {0xfe,0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = -{ - {0xfe,0x01}, - - {0x3e,0x60}, - {0xfe,0x00}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -static struct rk_sensor_reg sensor_Zoom0[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Zoom3[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; - -/* -* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu -*/ -static struct v4l2_querymenu sensor_menus[] = -{ -}; -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = -{ -}; - -//MUST define the current used format as the first item -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {MEDIA_BUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG} -}; -/*static struct soc_camera_ops sensor_ops;*/ - - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - - return 0; -} -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - - return 0; -} -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - char value; - unsigned int pid=0,shutter,temp_reg; - if(mf->width == 1600 && mf->height == 1200){ - sensor_write(client, 0xfe, 0x00); - sensor_write(client, 0xb6, 0x02); - - - sensor_read(client, 0x03, &value); - pid |= (value << 8); - sensor_read(client, 0x04, &value); - pid |= (value & 0xff); - shutter=pid; - - - temp_reg= shutter /2; // 2 - - if(temp_reg < 1) temp_reg = 1; - - - sensor_write(client, 0x03, ((temp_reg>>8)&0xff)); - sensor_write(client, 0x04, (temp_reg&0xff)); - } - - return 0; -} -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh (struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - /* add delay for rk312x*/ - msleep(300); - return 0; -} -static int sensor_softrest_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - return 0; -} -static int sensor_try_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf) -{ - return 0; -} -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("Suspend"); - - } else { - SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n",pm_msg.event); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - - SENSOR_DG("Resume"); - - return 0; - -} -static int sensor_mirror_cb (struct i2c_client *client, int mirror) -{ - char val; - int err = 0; - - SENSOR_DG("mirror: %d",mirror); - if (mirror) { - sensor_write(client, 0xfe, 0); - err = sensor_read(client, 0x17, &val); - val-=4; - if (err == 0) { - if((val & 0x1) == 0){ - err = sensor_write(client, 0x17, ((val |0x1)+4)); - } - else - err = sensor_write(client, 0x17, ((val & 0xfe)+4)); - } - } else { - //do nothing - } - return err; -} -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_mirror_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_mirror failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_mirror success, value:0x%x",ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - char val; - int err = 0; - - SENSOR_DG("flip: %d",flip); - if (flip) { - - sensor_write(client, 0xfe, 0); - err = sensor_read(client, 0x17, &val); - val-=4; - if (err == 0) { - if((val & 0x2) == 0){ - err = sensor_write(client, 0x17, ((val |0x2)+4)); - } - else { - err = sensor_write(client, 0x17, ((val & 0xfc)+4)); - } - } - } else { - //do nothing - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_flip_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_flip failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_flip success, value:0x%x",ext_ctrl->value); - return 0; -} -/* -* the functions are focus callbacks -*/ -static int sensor_focus_init_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos){ - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client){ - return 0; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos) -{ - return 0; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client,int on){ - return 0; -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor* spsensor,struct soc_camera_device *icd) -{ - return; -} - -/* -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); - - - - - diff --git a/drivers/media/video/gc2035_old.c b/drivers/media/video/gc2035_old.c deleted file mode 100755 index 68bd09274fc4..000000000000 --- a/drivers/media/video/gc2035_old.c +++ /dev/null @@ -1,3267 +0,0 @@ -/* -o* Driver for MT9M001 CMOS Image Sensor from Micron - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_GC2035 -#define SENSOR_V4L2_IDENT V4L2_IDENT_GC2035 -#define SENSOR_ID 0x2035 -#define SENSOR_MIN_WIDTH 800 -#define SENSOR_MIN_HEIGHT 600 -#define SENSOR_MAX_WIDTH 1600 -#define SENSOR_MAX_HEIGHT 1200 -#define SENSOR_INIT_WIDTH 800 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 600 -#define SENSOR_INIT_WINSEQADR sensor_svga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_YUYV8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 1 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 1 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 - -#define CONFIG_SENSOR_I2C_SPEED 100000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) - -struct reginfo -{ - u8 reg; - u8 val; -}; - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); - -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc - -/* init 352X288 SVGA */ -static struct reginfo sensor_init_data[] ={ - {0xfe , 0x80}, - {0xfe , 0x80}, - {0xfe , 0x80}, - {0xfc , 0x06}, - {0xf2 , 0x00}, - {0xf3 , 0x00}, - {0xf4 , 0x00}, - {0xf5 , 0x00}, - {0xf9 , 0xfe}, //[0] pll enable - {0xfa , 0x00}, - {0xf6 , 0x00}, - {0xf7 , 0x15}, //pll enable - - {0xf8 , 0x85}, - {0xfe , 0x00}, - {0x82 , 0x00}, - {0xb3 , 0x60}, - {0xb4 , 0x40}, - {0xb5 , 0x60}, - - {0x03 , 0x02}, - {0x04 , 0x80}, - - //////////measure window /////////// - {0xfe , 0x00}, - {0xec , 0x06},//04 - {0xed , 0x06},//04 - {0xee , 0x62},//60 - {0xef , 0x92},//90 - - ///////////analog///////////// - {0x0a , 0x00}, //row start - {0x0c , 0x00}, //col start - {0x0d , 0x04}, - {0x0e , 0xc0}, - {0x0f , 0x06}, //Window setting - {0x10 , 0x58}, - {0x17 , 0x14}, //[0]mirror [1]flip - - - {0x18 , 0x0e}, //sdark 4 row in even frame?? - {0x19 , 0x0c}, //AD pipe number - - /* - /// ë´Ì ÏÖÏó - {0x18 , 0x0a}, //sdark 4 row in even frame?? - {0x19 , 0x0a}, //AD pipe number - */ - - {0x1a , 0x01}, //CISCTL mode4 - {0x1b , 0x8b}, - {0x1e , 0x88}, //analog mode1 [7] tx-high en [5:3]COL_bias - {0x1f , 0x08}, //[3] tx-low en// - {0x20 , 0x05}, //[0]adclk mode , 0x[1]rowclk_MODE [2]rsthigh_en - {0x21 , 0x0f}, //[6:4]rsg - {0x22 , 0xf0}, //[3:0]vref - {0x23 , 0xc3}, //f3//ADC_r - {0x24 , 0x17}, //pad drive 16 - - //AEC - {0xfe , 0x01}, - {0x11 , 0x20},//AEC_out_slope , 0x - {0x1f , 0xc0},//max_post_gain - {0x20 , 0x60},//max_pre_gain - {0x47 , 0x30},//AEC_outdoor_th - {0x0b , 0x10},// - {0x13 , 0x75},//y_target - {0xfe , 0x00}, - - - {0x05 , 0x01},//hb - {0x06 , 0x11}, - {0x07 , 0x00},//vb - {0x08 , 0x50}, - {0xfe , 0x01}, - {0x27 , 0x00},//step - {0x28 , 0xa0}, - {0x29 , 0x05},//level1 - {0x2a , 0x00}, - {0x2b , 0x05},//level2 - {0x2c , 0x00}, - {0x2d , 0x06},//6e8//level3 - {0x2e , 0xe0}, - {0x2f , 0x0a},//level4 - {0x30 , 0x00}, - {0x3e , 0x40}, - {0xfe , 0x00}, - {0xfe , 0x00}, //0x , 0x , 0x , 0x , 0x - {0xb6 , 0x03}, //AEC enable - {0xfe , 0x00}, - - /////////BLK////// - {0x3f , 0x00}, //prc close - {0x40 , 0x77},// - {0x42 , 0x7f}, - {0x43 , 0x30}, - {0x5c , 0x08}, - {0x5e , 0x20}, - {0x5f , 0x20}, - {0x60 , 0x20}, - {0x61 , 0x20}, - {0x62 , 0x20}, - {0x63 , 0x20}, - {0x64 , 0x20}, - {0x65 , 0x20}, - - ///block//////////// - {0x80 , 0xff}, - {0x81 , 0x26},//38 , 0x//skin_Y 8c_debug - {0x87 , 0x90}, //[7]middle gamma - {0x84 , 0x00}, //output put foramat - {0x86 , 0x07}, //02 //sync plority - {0x8b , 0xbc}, - {0xb0 , 0x80}, //globle gain - {0xc0 , 0x40},//Yuv bypass - - //////lsc///////////// - {0xfe , 0x01}, - {0xc2 , 0x38}, - {0xc3 , 0x25}, - {0xc4 , 0x21}, - {0xc8 , 0x19}, - {0xc9 , 0x12}, - {0xca , 0x0e}, - {0xbc , 0x43}, - {0xbd , 0x18}, - {0xbe , 0x1b}, - {0xb6 , 0x40}, - {0xb7 , 0x2e}, - {0xb8 , 0x26}, - {0xc5 , 0x05}, - {0xc6 , 0x03}, - {0xc7 , 0x04}, - {0xcb , 0x00}, - {0xcc , 0x00}, - {0xcd , 0x00}, - {0xbf , 0x14}, - {0xc0 , 0x22}, - {0xc1 , 0x1b}, - {0xb9 , 0x00}, - {0xba , 0x05}, - {0xbb , 0x05}, - {0xaa , 0x35}, - {0xab , 0x33}, - {0xac , 0x33}, - {0xad , 0x25}, - {0xae , 0x22}, - {0xaf , 0x27}, - {0xb0 , 0x1d}, - {0xb1 , 0x20}, - {0xb2 , 0x22}, - {0xb3 , 0x14}, - {0xb4 , 0x15}, - {0xb5 , 0x16}, - {0xd0 , 0x00}, - {0xd2 , 0x07}, - {0xd3 , 0x08}, - {0xd8 , 0x00}, - {0xda , 0x13}, - {0xdb , 0x17}, - {0xdc , 0x00}, - {0xde , 0x0a}, - {0xdf , 0x08}, - {0xd4 , 0x00}, - {0xd6 , 0x00}, - {0xd7 , 0x0c}, - {0xa4 , 0x00}, - {0xa5 , 0x00}, - {0xa6 , 0x00}, - {0xa7 , 0x00}, - {0xa8 , 0x00}, - {0xa9 , 0x00}, - {0xa1 , 0x80}, - {0xa2 , 0x80}, - - //////////cc////////////// - {0xfe , 0x02}, - {0xc0 , 0x01}, - {0xc1 , 0x40}, //Green_cc for d - {0xc2 , 0xfc}, - {0xc3 , 0x05}, - {0xc4 , 0xec}, - {0xc5 , 0x42}, - {0xc6 , 0xf8}, - {0xc7 , 0x40},//for cwf - {0xc8 , 0xf8}, - {0xc9 , 0x06}, - {0xca , 0xfd}, - {0xcb , 0x3e}, - {0xcc , 0xf3}, - {0xcd , 0x36},//for A - {0xce , 0xf6}, - {0xcf , 0x04}, - {0xe3 , 0x0c}, - {0xe4 , 0x44}, - {0xe5 , 0xe5}, - {0xfe , 0x00}, - - ///////awb start //////////////// - //AWB clear - {0xfe , 0x01}, - {0x4f , 0x00}, - {0x4d , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0x10}, // 10 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0x20}, // 20 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0x30}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, // 30 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0x40}, // 40 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0x50}, // 50 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0x60}, // 60 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0x70}, // 70 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0x80}, // 80 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0x90}, // 90 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0xa0}, // a0 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0xb0}, // b0 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0xc0}, // c0 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4d , 0xd0}, // d0 - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4e , 0x00}, - {0x4f , 0x01}, - /////// awb value//////// - {0xfe , 0x01}, - {0x4f , 0x00}, - {0x4d , 0x30}, - {0x4e , 0x00}, - {0x4e , 0x80}, - {0x4e , 0x80}, - {0x4e , 0x02}, - {0x4e , 0x02}, - {0x4d , 0x40}, - {0x4e , 0x00}, - {0x4e , 0x80}, - {0x4e , 0x80}, - {0x4e , 0x02}, - {0x4e , 0x02}, - {0x4e , 0x02}, - {0x4d , 0x53}, - {0x4e , 0x08}, - {0x4e , 0x04}, - {0x4d , 0x62}, - {0x4e , 0x10}, - {0x4d , 0x72}, - {0x4e , 0x20}, - {0x4f , 0x01}, - - /////awb//// - {0xfe , 0x01}, - {0x50 , 0x88},//c0//[6]green mode - {0x52 , 0x40}, - {0x54 , 0x60}, - {0x56 , 0x06}, - {0x57 , 0x20}, //pre adjust - {0x58 , 0x01}, - {0x5b , 0x02}, //AWB_gain_delta - {0x61 , 0xaa},//R/G stand - {0x62 , 0xaa},//R/G stand - {0x71 , 0x00}, - {0x74 , 0x10}, //0x//AWB_C_max - {0x77 , 0x08}, // 0x//AWB_p2_x - {0x78 , 0xfd}, //AWB_p2_y - {0x86 , 0x30}, - {0x87 , 0x00}, - {0x88 , 0x04},//06 , 0x//[1]dark mode - {0x8a , 0xc0},//awb move mode - {0x89 , 0x75}, - {0x84 , 0x08}, //0x//auto_window - {0x8b , 0x00}, // 0x//awb compare luma - {0x8d , 0x70}, //awb gain limit R - {0x8e , 0x70},//G - {0x8f , 0xf4},//B - {0xfe , 0x00}, - {0x82 , 0x02},//awb_en - /////////awb end ///////////// - - ///==========asde - {0xfe , 0x01}, - {0x21 , 0xbf}, - {0xfe , 0x02}, - {0xa4 , 0x00},// - {0xa5 , 0x40}, //lsc_th - {0xa2 , 0xa0}, //lsc_dec_slope - {0xa6 , 0x80}, //dd_th - {0xa7 , 0x80}, //ot_th - {0xab , 0x31}, // - {0xa9 , 0x6f}, // - {0xb0 , 0x99}, //0x//edge effect slope low - {0xb1 , 0x34},//edge effect slope low - {0xb3 , 0x80}, //saturation dec slope - {0xde , 0xb6}, // - {0x38 , 0x0f}, // - {0x39 , 0x60}, // - {0xfe , 0x00}, - {0x81 , 0x26}, - {0xfe , 0x02}, - {0x83 , 0x00},// - {0x84 , 0x45},// - ////////////YCP////////// - {0xd1 , 0x38},//saturation_cb - {0xd2 , 0x38},//saturation_Cr - {0xd3 , 0x40},//contrast ? - {0xd4 , 0x80},//contrast center - {0xd5 , 0x00},//luma_offset - {0xdc , 0x30}, - {0xdd , 0xb8},//edge_sa_g,b - {0xfe , 0x00}, - ///////dndd/////////// - {0xfe , 0x02}, - {0x88 , 0x15},//dn_b_base - {0x8c , 0xf6}, //[2]b_in_dark_inc - {0x89 , 0x03}, //dn_c_weight - ////////EE /////////// - {0xfe , 0x02}, - {0x90 , 0x6c},// EEINTP mode1 - {0x97 , 0x45},// edge effect - ////==============RGB Gamma - {0xfe , 0x02}, - {0x15 , 0x0a}, - {0x16 , 0x12}, - {0x17 , 0x19}, - {0x18 , 0x1f}, - {0x19 , 0x2c}, - {0x1a , 0x38}, - {0x1b , 0x42}, - {0x1c , 0x4e}, - {0x1d , 0x63}, - {0x1e , 0x76}, - {0x1f , 0x87}, - {0x20 , 0x96}, - {0x21 , 0xa2}, - {0x22 , 0xb8}, - {0x23 , 0xca}, - {0x24 , 0xd8}, - {0x25 , 0xe3}, - {0x26 , 0xf0}, - {0x27 , 0xf8}, - {0x28 , 0xfd}, - {0x29 , 0xff}, - - ///=================y gamma - {0xfe , 0x02}, - {0x2b , 0x00}, - {0x2c , 0x04}, - {0x2d , 0x09}, - {0x2e , 0x18}, - {0x2f , 0x27}, - {0x30 , 0x37}, - {0x31 , 0x49}, - {0x32 , 0x5c}, - {0x33 , 0x7e}, - {0x34 , 0xa0}, - {0x35 , 0xc0}, - {0x36 , 0xe0}, - {0x37 , 0xff}, - /////1600x1200size// - {0xfe , 0x00},// - {0x90 , 0x01}, //0x//crop enable - {0x95 , 0x04}, //0x//1600x1200 - {0x96 , 0xb0}, - {0x97 , 0x06}, - {0x98 , 0x40}, - - {0xfe , 0x03}, - {0x42 , 0x40}, - {0x43 , 0x06}, //output buf width - {0x41 , 0x02}, // Pclk_polarity - {0x40 , 0x40}, //00 - {0x17 , 0x00}, //widv - {0xfe , 0x00}, - ////output DVP///// - {0xfe , 0x00}, - {0xb6 , 0x03}, - {0xf7 , 0x15}, - - {0xc8 , 0x00},//close scaler - {0x99 , 0x22},// 1/2 subsample - {0x9a , 0x06}, - {0x9b , 0x00}, - {0x9c , 0x00}, - {0x9d , 0x00}, - {0x9e , 0x00}, - {0x9f , 0x00}, - {0xa0 , 0x00}, - {0xa1 , 0x00}, - {0xa2 ,0x00}, - - {0x90 , 0x01}, //crop enable - {0x94 , 0x02}, - {0x95 , 0x02}, - {0x96 , 0x58}, - {0x97 , 0x03}, - {0x98 , 0x20}, - {0xfe , 0x00}, - {0x82 , 0xfe}, // fe - {0xf2 , 0x70}, - {0xf3 , 0xff}, - {0xf4 , 0x00}, - {0xf5 , 0x30}, - - #if 0 - ///////// re zao/// - {0xfe,0x00}, - {0x22,0xd0}, - {0xfe,0x01}, - {0x21,0xff}, - {0xfe,0x02}, - {0x8a,0x33}, - {0x8c,0x76}, - {0x8d,0x85}, - {0xa6,0xf0}, - {0xae,0x9f}, - {0xa2,0x90}, - {0xa5,0x40}, - {0xa7,0x30}, - {0xb0,0x88}, - {0x38,0x0b}, - {0x39,0x30}, - {0xfe,0x00}, - {0x87,0xb0}, - - //// small RGB gamma//// - {0xfe , 0x02}, - {0x15 , 0x0b}, - {0x16 , 0x0e}, - {0x17 , 0x10}, - {0x18 , 0x12}, - {0x19 , 0x19}, - {0x1a , 0x21}, - {0x1b , 0x29}, - {0x1c , 0x31}, - {0x1d , 0x41}, - {0x1e , 0x50}, - {0x1f , 0x5f}, - {0x20 , 0x6d}, - {0x21 , 0x79}, - {0x22 , 0x91}, - {0x23 , 0xa5}, - {0x24 , 0xb9}, - {0x25 , 0xc9}, - {0x26 , 0xe1}, - {0x27 , 0xee}, - {0x28 , 0xf7}, - {0x29 , 0xff}, - - ////dark sun///// - {0xfe , 0x02}, - {0x40 , 0x06}, - {0x41 , 0x23}, - {0x42 , 0x3f}, - {0x43 , 0x06}, - {0x44 , 0x00}, - {0x45 , 0x00}, - {0x46 , 0x14}, - {0x47 , 0x09}, - - #endif - - {0x00,0x00}, -}; - - - -/* 1600X1200 UXGA */ -static struct reginfo sensor_uxga[] = -{ - - - {0xfe , 0x00}, - {0xc8 , 0x00}, - {0xf7 , 0x17}, - - {0x99 , 0x11}, // disable sambsample - {0x9a , 0x06}, - {0x9b , 0x00}, - {0x9c , 0x00}, - {0x9d , 0x00}, - {0x9e , 0x00}, - {0x9f , 0x00}, - {0xa0 , 0x00}, - {0xa1 , 0x00}, - {0xa2 , 0x00}, - - {0x90 , 0x01}, - {0x95 , 0x04}, - {0x96 , 0xb0}, - {0x97 , 0x06}, - {0x98 , 0x40}, - - {0x00 , 0x00}, - - -}; - - - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - - {0x00,0x00}, -}; - -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - {0xfe , 0x00}, - {0xb6 , 0x03}, - {0xf7 , 0x15}, - - {0xc8 , 0x00},//close scaler - {0x99 , 0x22},// 1/2 subsample - {0x9a , 0x06}, - {0x9b , 0x00}, - {0x9c , 0x00}, - {0x9d , 0x00}, - {0x9e , 0x00}, - {0x9f , 0x00}, - {0xa0 , 0x00}, - {0xa1 , 0x00}, - {0xa2 , 0x00}, - - {0x90 , 0x01}, //crop enable - {0x94 , 0x02}, - {0x95 , 0x02}, - {0x96 , 0x58}, - {0x97 , 0x03}, - {0x98 , 0x20}, - {0x00,0x00}, -}; - - - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - - - {0x00 , 0x00}, -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {0x00,0x00}, -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - - - {0x00,0x00}, -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - - {0x00,0x00}, -}; - -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - - {0x00,0x00}, -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {0x00,0x00}, -}; - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0xfe, 0x00}, - {0xb3, 0x61}, - {0xb4, 0x40}, - {0xb5, 0x61}, - {0x82, 0xfe}, - {0x00,0x00}, -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0xfe, 0x00}, - {0x82, 0xfc}, - {0xb3, 0x58}, - {0xb4, 0x40}, - {0xb5, 0x50}, - {0x00,0x00}, -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0xfe, 0x00}, - {0x82, 0xfc}, - {0xb3, 0x78}, - {0xb4, 0x40}, - {0xb5, 0x50}, - {0x00,0x00}, -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0xfe, 0x00}, - {0x82, 0xfc}, - {0xb3, 0x50}, - {0xb4, 0x40}, - {0xb5, 0xa8}, - {0x00,0x00}, - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0xfe, 0x00}, - {0x82, 0xfc}, - {0xb3, 0xa0}, - {0xb4, 0x45}, - {0xb5, 0x40}, - {0x00, 0x00}, -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - // Brightness -2 - - {0xfe, 0x01}, - {0x13, 0x70}, - {0xfe, 0x02}, - {0xd5, 0xe0}, - {0x00, 0x00}, -}; - -static struct reginfo sensor_Brightness1[]= -{ - // Brightness -1 - - {0xfe, 0x01}, - {0x13, 0x78}, - {0xfe, 0x02}, - {0xd5, 0xf0}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - // Brightness 0 - - {0xfe, 0x01}, - {0x13, 0x80}, - {0xfe, 0x02}, - {0xd5, 0x00}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - // Brightness +1 - {0xfe, 0x01}, - {0x13, 0x88}, - {0xfe, 0x02}, - {0xd5, 0x10}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - // Brightness +2 - {0xfe, 0x01}, - {0x13, 0x90}, - {0xfe, 0x02}, - {0xd5, 0x20}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - // Brightness +3 - {0xfe, 0x01}, - {0x13, 0x98}, - {0xfe, 0x02}, - {0xd5, 0x30}, - - {0x00, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0xfe, 0x00}, - {0x83, 0xe0}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {0xfe, 0x00}, - {0x83, 0x12}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0xfe, 0x00}, - {0x83, 0x82}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - //Negative - {0xfe, 0x00}, - {0x83, 0x01}, - {0x00, 0x00} -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - // Bluish - {0xfe, 0x00}, - {0x83, 0x62}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish - {0xfe, 0x00}, - {0x83, 0x52}, - {0x00, 0x00} -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - //-3 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure1[]= -{ - //-2 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - //-0.3EV - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - //default - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - // 1 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - // 2 - - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - // 3 - - {0x00, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - - {0x00, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {0x00, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - //Contrast -3 - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - //Contrast -2 - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast2[]= -{ - // Contrast -1 - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - //Contrast 0 - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - //Contrast +1 - {0x00, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - //Contrast +2 - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - - //Contrast +3 - {0x00, 0x00} - -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {0x17 , 0x14}, - {0x00 , 0x00} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {0x17 , 0x15}, - {0x00 , 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {0x17 , 0x16}, - {0x00 , 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {0x17 , 0x17}, - {0x00 , 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ -{0xfe,0x01}, -{0x3e,0x40}, -{0xfe,0x00}, - -{0x00,0x00} -}; - -static struct reginfo sensor_SceneNight[] = -{ -{0xfe,0x01}, -{0x3e,0x60}, -{0xfe,0x00}, -{0x00,0x00} - -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom1[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom2[] = -{ - {0x0, 0x0}, -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {0x0, 0x0}, -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif -static const struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - unsigned int winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int funmodule_state; -} sensor_info_priv_t; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, u8 reg, u8 val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[1]; - - buf[0] = reg; - buf[1] = val; - - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) -{ - int err,cnt; - u8 buf[1]; - struct i2c_msg msg[2]; - - buf[0] = reg ; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - - while (regarray[i].reg != 0) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - i++; - } - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} - -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_check_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != 0) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_power_end: - return ret; -} -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - char value; - int ret,pid = 0; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0xf0, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value << 8); - - ret = sensor_read(client, 0xf1, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - ret = sensor_write_array(client, sensor_init_data); - - - mdelay(300); - - - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - - sensor->info_priv.winseqe_cur_addr = (int)SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} - -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - - struct sensor *sensor = to_sensor(client); - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - if (sensor->info_priv.funmodule_state & SENSOR_INIT_IS_OK) { - } - sensor_ioctrl(icd, Sensor_PowerDown, 1); - msleep(100); - - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - - return 0; -} - -static struct reginfo sensor_power_down_sequence[]= -{ - - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - - return 0; - -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static unsigned int shutter_h,shutter_l; -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - int ret1; - - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - int ret=0, set_w,set_h; -#if 1 -char value; -unsigned int pid=0,shutter,temp_reg; - -#endif - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - winseqe_set_addr = sensor_svga; - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - winseqe_set_addr = sensor_sxga; - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && sensor_uxga[0].reg) - { - winseqe_set_addr = sensor_uxga; - set_w = 1600; - set_h = 1200; - } - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) { - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - } else { /* ddl@rock-chips.com : Video */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - } - #endif - - if ((winseqe_set_addr == sensor_svga)||(winseqe_set_addr == sensor_vga) ) - { - sensor_write(client, 0xb6, 0x00); // AEC ON - sensor_write(client, 0x03, shutter_h); - sensor_write(client, 0x04, shutter_l); - msleep(50); - printk("set preview for rewrite 0x03"); - - } - ret |= sensor_write_array(client, winseqe_set_addr); -#if 1 - if (winseqe_set_addr == sensor_uxga) - { - sensor_write(client, 0xfe, 0x00); - sensor_write(client, 0xb6, 0x02); // AEC OFF - sensor_read(client, 0x03, &value); - shutter_h=value; - pid |= (value << 8); - sensor_read(client, 0x04, &value); - shutter_l=value; - pid |= (value & 0xff); - shutter=pid; - temp_reg= shutter /2; - if(temp_reg < 1) temp_reg = 1; - sensor_write(client, 0x03, ((temp_reg>>8)&0xff)); - sensor_write(client, 0x04, (temp_reg&0xff)); - } -#endif - - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - - sensor->info_priv.winseqe_cur_addr = (int)winseqe_set_addr; - - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - if (sensor->info_priv.whiteBalance != 0) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - sensor->info_priv.snap2preview = true; - } else if (sensor_fmt_videochk(sd,mf) == true) { /* ddl@rock-chips.com : Video */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - sensor->info_priv.video2preview = true; - } else if ((sensor->info_priv.snap2preview == true) || (sensor->info_priv.video2preview == true)) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - msleep(600); - sensor->info_priv.video2preview = false; - sensor->info_priv.snap2preview = false; - } - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; - msleep(100); //james added -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && sensor_uxga[0].reg) - { - set_w = 1600; - set_h = 1200; - } - else - { - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - - mf->width = set_w; - mf->height = set_h; - mf->colorspace = fmt->colorspace; - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return gc2035 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value > 0) && ((digitalzoom_cur + value) > digitalzoom_total)) - { - value = digitalzoom_total - digitalzoom_cur; - } - - if ((value < 0) && ((digitalzoom_cur + value) < 0)) - { - value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char value; - int ret,pid = 0; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - - /* soft reset */ - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0xf0, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid |= (value << 8); - - ret = sensor_read(client, 0xf1, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - - return ret; -} -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); -#if CONFIG_SENSOR_Flash - int i; -#endif - int ret = 0; - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - sensor->sensor_gpio_res = NULL; - for (i=0; isensor_io_request->gpio_res[i].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[i].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[i]; - } - } - if (sensor->sensor_gpio_res == NULL) { - SENSOR_TR("%s %s obtain gpio resource failed when RK29_CAM_SUBDEV_IOREQUEST \n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - - sensor->info_priv.fmt = sensor_colour_fmts[0]; - - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - - - - diff --git a/drivers/media/video/gc2145.c b/drivers/media/video/gc2145.c deleted file mode 100644 index 2049e82418c9..000000000000 --- a/drivers/media/video/gc2145.c +++ /dev/null @@ -1,1702 +0,0 @@ -/* - * drivers/media/video/gc2145.c - * - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "generic_sensor.h" - -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.0.3: -* add sensor_focus_af_const_pause_usr_cb; -*v0.0.4: -* camera: rockchip: change the full size of gc2415 fps to 20fps -* for the test of cts/vts -*/ -static int version = KERNEL_VERSION(0, 0, 4); -module_param(version, int, S_IRUGO); - -static int debug; -module_param(debug, int, S_IRUGO | S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt, ## arg); \ -} while (0) - -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_GC2145 -#define SENSOR_V4L2_IDENT V4L2_IDENT_GC2145 -#define SENSOR_ID 0x2145 -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_PCLK_SAMPLE_RISING |\ - V4L2_MBUS_HSYNC_ACTIVE_HIGH |\ - V4L2_MBUS_VSYNC_ACTIVE_LOW |\ - V4L2_MBUS_DATA_ACTIVE_HIGH |\ - SOCAM_MCLK_24MHZ) -#define SENSOR_PREVIEW_W 800 -#define SENSOR_PREVIEW_H 600 -#define SENSOR_PREVIEW_FPS 15000 // 15fps -#define SENSOR_FULLRES_L_FPS 7500 // 7.5fps -#define SENSOR_FULLRES_H_FPS 7500 // 7.5fps -#define SENSOR_720P_FPS 15000 -#define SENSOR_1080P_FPS 0 - -#define SENSOR_REGISTER_LEN 1 // sensor register address bytes -#define SENSOR_VALUE_LEN 1 // sensor register value bytes -static unsigned int SensorConfiguration = - (CFG_WhiteBalance | CFG_Effect | CFG_Scene); -static unsigned int SensorChipID[] = { SENSOR_ID }; -/* Sensor Driver Configuration End */ - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a, b) CONS4(SensorReg, SENSOR_REGISTER_LEN, Val, SENSOR_VALUE_LEN)(a, b) -#define sensor_write(client, reg, v) CONS4(sensor_write_reg, SENSOR_REGISTER_LEN, val, SENSOR_VALUE_LEN)(client, (reg), (v)) -#define sensor_read(client, reg, v) CONS4(sensor_read_reg, SENSOR_REGISTER_LEN, val, SENSOR_VALUE_LEN)(client, (reg), (v)) -#define sensor_write_array generic_sensor_write_array - -struct sensor_parameter { - unsigned int PreviewDummyPixels; - unsigned int CaptureDummyPixels; - unsigned int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int PreviewPclk; - unsigned short int CapturePclk; - char awb[6]; -}; - -struct specific_sensor { - struct generic_sensor common_sensor; - //define user data below - struct sensor_parameter parameter; - u16 shutter; - -}; - -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ - -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_init_data[] = { - //SENSORDB("GC2145_Sensor_Init"}, - {0xfe, 0xf0}, - {0xfe, 0xf0}, - {0xfe, 0xf0}, - {0xfc, 0x06}, - {0xf6, 0x00}, - {0xf7, 0x1d}, - {0xf8, 0x84}, - {0xfa, 0x00}, - {0xf9, 0xfe}, - {0xf2, 0x00}, - ///////////////////////////////////////////////// - //////////////////ISP reg////////////////////// - - //////////////////////////////////////////////////// - {0xfe, 0x00}, - {0x03, 0x04}, - {0x04, 0xe2}, - {0x09, 0x00}, - {0x0a, 0x00}, - {0x0b, 0x00}, - {0x0c, 0x00}, - {0x0d, 0x04}, - {0x0e, 0xc0}, - {0x0f, 0x06}, - {0x10, 0x52}, - {0x12, 0x2e}, - {0x17, 0x14}, //mirror - {0x18, 0x22}, - {0x19, 0x0e}, - {0x1a, 0x01}, - {0x1b, 0x4b}, - {0x1c, 0x07}, - {0x1d, 0x10}, - {0x1e, 0x88}, - {0x1f, 0x78}, - {0x20, 0x03}, - {0x21, 0x40}, - {0x22, 0xa0}, - {0x24, 0x16}, - {0x25, 0x01}, - {0x26, 0x10}, - {0x2d, 0x60}, - {0x30, 0x01}, - {0x31, 0x90}, - {0x33, 0x06}, - {0x34, 0x01}, - ///////////////////////////////////////////////// - //////////////////ISP reg//////////////////// - ///////////////////////////////////////////////// - {0xfe, 0x00}, - {0x80, 0x7f}, - {0x81, 0x26}, - {0x82, 0xfa}, - {0x83, 0x00}, - {0x84, 0x00}, - {0x86, 0x02}, - {0x88, 0x03}, - {0x89, 0x03}, - {0x85, 0x08}, - {0x8a, 0x00}, - {0x8b, 0x00}, - {0xb0, 0x55}, - {0xc3, 0x00}, - {0xc4, 0x80}, - {0xc5, 0x90}, - {0xc6, 0x3b}, - {0xc7, 0x46}, - {0xec, 0x06}, - {0xed, 0x04}, - {0xee, 0x60}, - {0xef, 0x90}, - {0xb6, 0x01}, - {0x90, 0x01}, - {0x91, 0x00}, - {0x92, 0x00}, - {0x93, 0x00}, - {0x94, 0x00}, - {0x95, 0x04}, - {0x96, 0xb0}, - {0x97, 0x06}, - {0x98, 0x40}, - ///////////////////////////////////////// - /////////// BLK //////////////////////// - ///////////////////////////////////////// - {0xfe, 0x00}, - {0x40, 0x42}, - {0x41, 0x00}, - {0x43, 0x5b}, - {0x5e, 0x00}, - {0x5f, 0x00}, - {0x60, 0x00}, - {0x61, 0x00}, - {0x62, 0x00}, - {0x63, 0x00}, - {0x64, 0x00}, - {0x65, 0x00}, - {0x66, 0x20}, - {0x67, 0x20}, - {0x68, 0x20}, - {0x69, 0x20}, - {0x76, 0x00}, - {0x6a, 0x08}, - {0x6b, 0x08}, - {0x6c, 0x08}, - {0x6d, 0x08}, - {0x6e, 0x08}, - {0x6f, 0x08}, - {0x70, 0x08}, - {0x71, 0x08}, - {0x76, 0x00}, - {0x72, 0xf0}, - {0x7e, 0x3c}, - {0x7f, 0x00}, - {0xfe, 0x02}, - {0x48, 0x15}, - {0x49, 0x00}, - {0x4b, 0x0b}, - {0xfe, 0x00}, - //////////////////////////////////////// - /////////// AEC //////////////////////// - //////////////////////////////////////// - {0xfe, 0x01}, - {0x01, 0x04}, - {0x02, 0xc0}, - {0x03, 0x04}, - {0x04, 0x90}, - {0x05, 0x30}, - {0x06, 0x90}, - {0x07, 0x30}, - {0x08, 0x80}, - {0x09, 0x00}, - {0x0a, 0x82}, - {0x0b, 0x11}, - {0x0c, 0x10}, - {0x11, 0x10}, - {0x13, 0x7b}, - {0x17, 0x00}, - {0x1c, 0x11}, - {0x1e, 0x61}, - {0x1f, 0x35}, - {0x20, 0x40}, - {0x22, 0x40}, - {0x23, 0x20}, - {0xfe, 0x02}, - {0x0f, 0x04}, - {0xfe, 0x01}, - {0x12, 0x35}, - {0x15, 0xb0}, - {0x10, 0x31}, - {0x3e, 0x28}, - {0x3f, 0xb0}, - {0x40, 0x90}, - {0x41, 0x0f}, - - ///////////////////////////// - //////// INTPEE ///////////// - ///////////////////////////// - {0xfe, 0x02}, - {0x90, 0x6c}, - {0x91, 0x03}, - {0x92, 0xcb}, - {0x94, 0x33}, - {0x95, 0x84}, - {0x97, 0x45}, //65 kent - {0xa2, 0x11}, - {0xfe, 0x00}, - ///////////////////////////// - //////// DNDD/////////////// - ///////////////////////////// - {0xfe, 0x02}, - {0x80, 0xc1}, - {0x81, 0x08}, - {0x82, 0x1f}, //08 by kent - {0x83, 0x10}, //05 by kent - {0x84, 0x0a}, - {0x86, 0xf0}, - {0x87, 0x50}, - {0x88, 0x15}, - {0x89, 0xb0}, - {0x8a, 0x30}, - {0x8b, 0x10}, - ///////////////////////////////////////// - /////////// ASDE //////////////////////// - ///////////////////////////////////////// - {0xfe, 0x01}, - {0x21, 0x04}, - {0xfe, 0x02}, - {0xa3, 0x50}, - {0xa4, 0x20}, - {0xa5, 0x40}, - {0xa6, 0x80}, - {0xab, 0x40}, - {0xae, 0x0c}, - {0xb3, 0x46}, - {0xb4, 0x64}, - {0xb6, 0x38}, - {0xb7, 0x01}, - {0xb9, 0x2b}, - {0x3c, 0x04}, - {0x3d, 0x15}, - {0x4b, 0x06}, - {0x4c, 0x20}, - {0xfe, 0x00}, - ///////////////////////////////////////// - /////////// GAMMA //////////////////////// - ///////////////////////////////////////// - - ///////////////////gamma1//////////////////// -#if 1 - {0xfe, 0x02}, - {0x10, 0x09}, - {0x11, 0x0d}, - {0x12, 0x13}, - {0x13, 0x19}, - {0x14, 0x27}, - {0x15, 0x37}, - {0x16, 0x45}, - {0x17, 0x53}, - {0x18, 0x69}, - {0x19, 0x7d}, - {0x1a, 0x8f}, - {0x1b, 0x9d}, - {0x1c, 0xa9}, - {0x1d, 0xbd}, - {0x1e, 0xcd}, - {0x1f, 0xd9}, - {0x20, 0xe3}, - {0x21, 0xea}, - {0x22, 0xef}, - {0x23, 0xf5}, - {0x24, 0xf9}, - {0x25, 0xff}, -#else - {0xfe, 0x02}, - {0x10, 0x0a}, - {0x11, 0x12}, - {0x12, 0x19}, - {0x13, 0x1f}, - {0x14, 0x2c}, - {0x15, 0x38}, - {0x16, 0x42}, - {0x17, 0x4e}, - {0x18, 0x63}, - {0x19, 0x76}, - {0x1a, 0x87}, - {0x1b, 0x96}, - {0x1c, 0xa2}, - {0x1d, 0xb8}, - {0x1e, 0xcb}, - {0x1f, 0xd8}, - {0x20, 0xe2}, - {0x21, 0xe9}, - {0x22, 0xf0}, - {0x23, 0xf8}, - {0x24, 0xfd}, - {0x25, 0xff}, - {0xfe, 0x00}, -#endif - {0xfe, 0x00}, - {0xc6, 0x20}, - {0xc7, 0x2b}, - ///////////////////gamma2//////////////////// -#if 1 - {0xfe, 0x02}, - {0x26, 0x0f}, - {0x27, 0x14}, - {0x28, 0x19}, - {0x29, 0x1e}, - {0x2a, 0x27}, - {0x2b, 0x33}, - {0x2c, 0x3b}, - {0x2d, 0x45}, - {0x2e, 0x59}, - {0x2f, 0x69}, - {0x30, 0x7c}, - {0x31, 0x89}, - {0x32, 0x98}, - {0x33, 0xae}, - {0x34, 0xc0}, - {0x35, 0xcf}, - {0x36, 0xda}, - {0x37, 0xe2}, - {0x38, 0xe9}, - {0x39, 0xf3}, - {0x3a, 0xf9}, - {0x3b, 0xff}, -#else - ////Gamma outdoor - {0xfe, 0x02}, - {0x26, 0x17}, - {0x27, 0x18}, - {0x28, 0x1c}, - {0x29, 0x20}, - {0x2a, 0x28}, - {0x2b, 0x34}, - {0x2c, 0x40}, - {0x2d, 0x49}, - {0x2e, 0x5b}, - {0x2f, 0x6d}, - {0x30, 0x7d}, - {0x31, 0x89}, - {0x32, 0x97}, - {0x33, 0xac}, - {0x34, 0xc0}, - {0x35, 0xcf}, - {0x36, 0xda}, - {0x37, 0xe5}, - {0x38, 0xec}, - {0x39, 0xf8}, - {0x3a, 0xfd}, - {0x3b, 0xff}, -#endif - /////////////////////////////////////////////// - ///////////YCP /////////////////////// - /////////////////////////////////////////////// - {0xfe, 0x02}, - {0xd1, 0x40}, //32 kent - {0xd2, 0x40}, //32 - {0xd3, 0x48}, //40 - {0xd6, 0xf0}, - {0xd7, 0x10}, - {0xd8, 0xda}, - {0xdd, 0x14}, - {0xde, 0x86}, - {0xed, 0x80}, - {0xee, 0x00}, - {0xef, 0x3f}, - {0xd8, 0xd8}, - ///////////////////abs///////////////// - {0xfe, 0x01}, - {0x9f, 0x40}, - ///////////////////////////////////////////// - //////////////////////// LSC /////////////// - ////////////////////////////////////////// - {0xfe, 0x01}, - {0xc2, 0x14}, - {0xc3, 0x0d}, - {0xc4, 0x0c}, - {0xc8, 0x15}, - {0xc9, 0x0d}, - {0xca, 0x0a}, - {0xbc, 0x24}, - {0xbd, 0x10}, - {0xbe, 0x0b}, - {0xb6, 0x25}, - {0xb7, 0x16}, - {0xb8, 0x15}, - {0xc5, 0x00}, - {0xc6, 0x00}, - {0xc7, 0x00}, - {0xcb, 0x00}, - {0xcc, 0x00}, - {0xcd, 0x00}, - {0xbf, 0x07}, - {0xc0, 0x00}, - {0xc1, 0x00}, - {0xb9, 0x00}, - {0xba, 0x00}, - {0xbb, 0x00}, - {0xaa, 0x01}, - {0xab, 0x01}, - {0xac, 0x00}, - {0xad, 0x05}, - {0xae, 0x06}, - {0xaf, 0x0e}, - {0xb0, 0x0b}, - {0xb1, 0x07}, - {0xb2, 0x06}, - {0xb3, 0x17}, - {0xb4, 0x0e}, - {0xb5, 0x0e}, - {0xd0, 0x09}, - {0xd1, 0x00}, - {0xd2, 0x00}, - {0xd6, 0x08}, - {0xd7, 0x00}, - {0xd8, 0x00}, - {0xd9, 0x00}, - {0xda, 0x00}, - {0xdb, 0x00}, - {0xd3, 0x0a}, - {0xd4, 0x00}, - {0xd5, 0x00}, - {0xa4, 0x00}, - {0xa5, 0x00}, - {0xa6, 0x77}, - {0xa7, 0x77}, - {0xa8, 0x77}, - {0xa9, 0x77}, - {0xa1, 0x80}, - {0xa2, 0x80}, - - {0xfe, 0x01}, - {0xdf, 0x0d}, - {0xdc, 0x25}, - {0xdd, 0x30}, - {0xe0, 0x77}, - {0xe1, 0x80}, - {0xe2, 0x77}, - {0xe3, 0x90}, - {0xe6, 0x90}, - {0xe7, 0xa0}, - {0xe8, 0x90}, - {0xe9, 0xa0}, - {0xfe, 0x00}, - /////////////////////////////////////////////// - /////////// AWB//////////////////////// - /////////////////////////////////////////////// - {0xfe, 0x01}, - {0x4f, 0x00}, - {0x4f, 0x00}, - {0x4b, 0x01}, - {0x4f, 0x00}, - - {0x4c, 0x01}, // D75 - {0x4d, 0x71}, - {0x4e, 0x01}, - {0x4c, 0x01}, - {0x4d, 0x91}, - {0x4e, 0x01}, - {0x4c, 0x01}, - {0x4d, 0x70}, - {0x4e, 0x01}, - {0x4c, 0x01}, // D65 - {0x4d, 0x90}, - {0x4e, 0x02}, - {0x4c, 0x01}, - {0x4d, 0xb0}, - {0x4e, 0x02}, - {0x4c, 0x01}, - {0x4d, 0x8f}, - {0x4e, 0x02}, - {0x4c, 0x01}, - {0x4d, 0x6f}, - {0x4e, 0x02}, - {0x4c, 0x01}, - {0x4d, 0xaf}, - {0x4e, 0x02}, - {0x4c, 0x01}, - {0x4d, 0xd0}, - {0x4e, 0x02}, - {0x4c, 0x01}, - {0x4d, 0xf0}, - {0x4e, 0x02}, - {0x4c, 0x01}, - {0x4d, 0xcf}, - {0x4e, 0x02}, - {0x4c, 0x01}, - {0x4d, 0xef}, - {0x4e, 0x02}, - {0x4c, 0x01}, //D50 - {0x4d, 0x6e}, - {0x4e, 0x03}, - {0x4c, 0x01}, - {0x4d, 0x8e}, - {0x4e, 0x03}, - {0x4c, 0x01}, - {0x4d, 0xae}, - {0x4e, 0x03}, - {0x4c, 0x01}, - {0x4d, 0xce}, - {0x4e, 0x03}, - {0x4c, 0x01}, - {0x4d, 0x4d}, - {0x4e, 0x03}, - {0x4c, 0x01}, - {0x4d, 0x6d}, - {0x4e, 0x03}, - {0x4c, 0x01}, - {0x4d, 0x8d}, - {0x4e, 0x03}, - {0x4c, 0x01}, - {0x4d, 0xad}, - {0x4e, 0x03}, - {0x4c, 0x01}, - {0x4d, 0xcd}, - {0x4e, 0x03}, - {0x4c, 0x01}, - {0x4d, 0x4c}, - {0x4e, 0x03}, - {0x4c, 0x01}, - {0x4d, 0x6c}, - {0x4e, 0x03}, - {0x4c, 0x01}, - {0x4d, 0x8c}, - {0x4e, 0x03}, - {0x4c, 0x01}, - {0x4d, 0xac}, - {0x4e, 0x03}, - {0x4c, 0x01}, - {0x4d, 0xcc}, - {0x4e, 0x03}, - {0x4c, 0x01}, - {0x4d, 0xcb}, - {0x4e, 0x03}, - {0x4c, 0x01}, - {0x4d, 0x4b}, - {0x4e, 0x03}, - {0x4c, 0x01}, - {0x4d, 0x6b}, - {0x4e, 0x03}, - {0x4c, 0x01}, - {0x4d, 0x8b}, - {0x4e, 0x03}, - {0x4c, 0x01}, - {0x4d, 0xab}, - {0x4e, 0x03}, - {0x4c, 0x01}, //CWF - {0x4d, 0x8a}, - {0x4e, 0x04}, - {0x4c, 0x01}, - {0x4d, 0xaa}, - {0x4e, 0x04}, - {0x4c, 0x01}, - {0x4d, 0xca}, - {0x4e, 0x04}, - {0x4c, 0x01}, - {0x4d, 0xca}, - {0x4e, 0x04}, - {0x4c, 0x01}, - {0x4d, 0xc9}, - {0x4e, 0x04}, - {0x4c, 0x01}, - {0x4d, 0x8a}, - {0x4e, 0x04}, - {0x4c, 0x01}, - {0x4d, 0x89}, - {0x4e, 0x04}, - {0x4c, 0x01}, - {0x4d, 0xa9}, - {0x4e, 0x04}, - {0x4c, 0x02}, //tl84 - {0x4d, 0x0b}, - {0x4e, 0x05}, - {0x4c, 0x02}, - {0x4d, 0x0a}, - {0x4e, 0x05}, - {0x4c, 0x01}, - {0x4d, 0xeb}, - {0x4e, 0x05}, - {0x4c, 0x01}, - {0x4d, 0xea}, - {0x4e, 0x05}, - {0x4c, 0x02}, - {0x4d, 0x09}, - {0x4e, 0x05}, - {0x4c, 0x02}, - {0x4d, 0x29}, - {0x4e, 0x05}, - {0x4c, 0x02}, - {0x4d, 0x2a}, - {0x4e, 0x05}, - {0x4c, 0x02}, - {0x4d, 0x4a}, - {0x4e, 0x05}, - //{0x4c , 0x02}, //A - //{0x4d , 0x6a}, - //{0x4e , 0x06}, - {0x4c, 0x02}, - {0x4d, 0x8a}, - {0x4e, 0x06}, - {0x4c, 0x02}, - {0x4d, 0x49}, - {0x4e, 0x06}, - {0x4c, 0x02}, - {0x4d, 0x69}, - {0x4e, 0x06}, - {0x4c, 0x02}, - {0x4d, 0x89}, - {0x4e, 0x06}, - {0x4c, 0x02}, - {0x4d, 0xa9}, - {0x4e, 0x06}, - {0x4c, 0x02}, - {0x4d, 0x48}, - {0x4e, 0x06}, - {0x4c, 0x02}, - {0x4d, 0x68}, - {0x4e, 0x06}, - {0x4c, 0x02}, - {0x4d, 0x69}, - {0x4e, 0x06}, - {0x4c, 0x02}, //H - {0x4d, 0xca}, - {0x4e, 0x07}, - {0x4c, 0x02}, - {0x4d, 0xc9}, - {0x4e, 0x07}, - {0x4c, 0x02}, - {0x4d, 0xe9}, - {0x4e, 0x07}, - {0x4c, 0x03}, - {0x4d, 0x09}, - {0x4e, 0x07}, - {0x4c, 0x02}, - {0x4d, 0xc8}, - {0x4e, 0x07}, - {0x4c, 0x02}, - {0x4d, 0xe8}, - {0x4e, 0x07}, - {0x4c, 0x02}, - {0x4d, 0xa7}, - {0x4e, 0x07}, - {0x4c, 0x02}, - {0x4d, 0xc7}, - {0x4e, 0x07}, - {0x4c, 0x02}, - {0x4d, 0xe7}, - {0x4e, 0x07}, - {0x4c, 0x03}, - {0x4d, 0x07}, - {0x4e, 0x07}, - - {0x4f, 0x01}, - {0x50, 0x80}, - {0x51, 0xa8}, - {0x52, 0x47}, - {0x53, 0x38}, - {0x54, 0xc7}, - {0x56, 0x0e}, - {0x58, 0x08}, - {0x5b, 0x00}, - {0x5c, 0x74}, - {0x5d, 0x8b}, - {0x61, 0xdb}, - {0x62, 0xb8}, - {0x63, 0x86}, - {0x64, 0xc0}, - {0x65, 0x04}, - {0x67, 0xa8}, - {0x68, 0xb0}, - {0x69, 0x00}, - {0x6a, 0xa8}, - {0x6b, 0xb0}, - {0x6c, 0xaf}, - {0x6d, 0x8b}, - {0x6e, 0x50}, - {0x6f, 0x18}, - {0x73, 0xf0}, - {0x70, 0x0d}, - {0x71, 0x60}, - {0x72, 0x80}, - {0x74, 0x01}, - {0x75, 0x01}, - {0x7f, 0x0c}, - {0x76, 0x70}, - {0x77, 0x58}, - {0x78, 0xa0}, - {0x79, 0x5e}, - {0x7a, 0x54}, - {0x7b, 0x58}, - {0xfe, 0x00}, - ////////////////////////////////////////// - ///////////CC//////////////////////// - ////////////////////////////////////////// - {0xfe, 0x02}, - {0xc0, 0x01}, - {0xc1, 0x44}, - {0xc2, 0xfd}, - {0xc3, 0x04}, - {0xc4, 0xF0}, - {0xc5, 0x48}, - {0xc6, 0xfd}, - {0xc7, 0x46}, - {0xc8, 0xfd}, - {0xc9, 0x02}, - {0xca, 0xe0}, - {0xcb, 0x45}, - {0xcc, 0xec}, - {0xcd, 0x48}, - {0xce, 0xf0}, - {0xcf, 0xf0}, - {0xe3, 0x0c}, - {0xe4, 0x4b}, - {0xe5, 0xe0}, - ////////////////////////////////////////// - ///////////ABS //////////////////// - ////////////////////////////////////////// - {0xfe, 0x01}, - {0x9f, 0x40}, - {0xfe, 0x00}, - ////////////////////////////////////// - /////////// OUTPUT //////////////// - ////////////////////////////////////// - {0xfe, 0x00}, - {0xf2, 0x0f}, - ///////////////dark sun//////////////////// - {0xfe, 0x02}, - {0x40, 0xbf}, - {0x46, 0xcf}, - {0xfe, 0x00}, - - //////////////frame rate 50Hz///////// - {0xfe, 0x00}, - {0x05, 0x01}, - {0x06, 0x56}, - {0x07, 0x00}, - {0x08, 0x32}, - {0xfe, 0x01}, - {0x25, 0x00}, - {0x26, 0xfa}, - - {0x27, 0x04}, - {0x28, 0xe2}, //20fps - {0x29, 0x04}, - {0x2a, 0xe2}, //14fps - {0x2b, 0x04}, - {0x2c, 0xe2}, //12fps - {0x2d, 0x04}, - {0x2e, 0xe2}, //8fps - {0xfe, 0x00}, - - //SENSORDB("GC2145_Sensor_SVGA"}, - - {0xfe, 0x00}, - {0xfd, 0x01}, - {0xfa, 0x00}, - //// crop window - {0xfe, 0x00}, - {0x90, 0x01}, - {0x91, 0x00}, - {0x92, 0x00}, - {0x93, 0x00}, - {0x94, 0x00}, - {0x95, 0x02}, - {0x96, 0x58}, - {0x97, 0x03}, - {0x98, 0x20}, - {0x99, 0x11}, - {0x9a, 0x06}, - //// AWB - {0xfe, 0x00}, - {0xec, 0x02}, - {0xed, 0x02}, - {0xee, 0x30}, - {0xef, 0x48}, - {0xfe, 0x02}, - {0x9d, 0x08}, - {0xfe, 0x01}, - {0x74, 0x00}, - //// AEC - {0xfe, 0x01}, - {0x01, 0x04}, - {0x02, 0x60}, - {0x03, 0x02}, - {0x04, 0x48}, - {0x05, 0x18}, - {0x06, 0x50}, - {0x07, 0x10}, - {0x08, 0x38}, - {0x0a, 0x80}, - {0x21, 0x04}, - {0xfe, 0x00}, - {0x20, 0x03}, - {0xfe, 0x00}, - SensorEnd -}; -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] = { - - //SENSORDB("GC2145_Sensor_2M"}, - {0xfe, 0x00}, - {0xfd, 0x00}, - {0xfa, 0x00}, - //// crop window - {0xfe, 0x00}, - {0x90, 0x01}, - {0x91, 0x00}, - {0x92, 0x00}, - {0x93, 0x00}, - {0x94, 0x00}, - {0x95, 0x04}, - {0x96, 0xb0}, - {0x97, 0x06}, - {0x98, 0x40}, - {0x99, 0x11}, - {0x9a, 0x06}, - //// AWB - {0xfe, 0x00}, - {0xec, 0x06}, - {0xed, 0x04}, - {0xee, 0x60}, - {0xef, 0x90}, - {0xfe, 0x01}, - {0x74, 0x01}, - //// AEC - {0xfe, 0x01}, - {0x01, 0x04}, - {0x02, 0xc0}, - {0x03, 0x04}, - {0x04, 0x90}, - {0x05, 0x30}, - {0x06, 0x90}, - {0x07, 0x30}, - {0x08, 0x80}, - {0x0a, 0x82}, - {0xfe, 0x01}, - {0x21, 0x04}, - {0xfe, 0x00}, - {0x20, 0x15}, //if 0xfa=11,then 0x21=15;else if 0xfa=00,then 0x21=04 - {0xfe, 0x00}, - SensorEnd -}; - -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] = { - SensorEnd -}; -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data[] = { - - //SENSORDB("GC2145_Sensor_SVGA"}, - - {0xfe, 0x00}, - {0xb6, 0x01}, - {0xfd, 0x01}, - {0xfa, 0x00}, - //// crop window - {0xfe, 0x00}, - {0x90, 0x01}, - {0x91, 0x00}, - {0x92, 0x00}, - {0x93, 0x00}, - {0x94, 0x00}, - {0x95, 0x02}, - {0x96, 0x58}, - {0x97, 0x03}, - {0x98, 0x20}, - {0x99, 0x11}, - {0x9a, 0x06}, - //// AWB - {0xfe, 0x00}, - {0xec, 0x02}, - {0xed, 0x02}, - {0xee, 0x30}, - {0xef, 0x48}, - {0xfe, 0x02}, - {0x9d, 0x08}, - {0xfe, 0x01}, - {0x74, 0x00}, - //// AEC - {0xfe, 0x01}, - {0x01, 0x04}, - {0x02, 0x60}, - {0x03, 0x02}, - {0x04, 0x48}, - {0x05, 0x18}, - {0x06, 0x50}, - {0x07, 0x10}, - {0x08, 0x38}, - {0x0a, 0x80}, - {0x21, 0x04}, - {0xfe, 0x00}, - {0x20, 0x03}, - {0xfe, 0x00}, - SensorEnd -}; -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[] = { -#if 0 - {0xfe, 0x00}, - //{0xfa , 0x11}, - {0xb6, 0x01}, - {0xfd, 0x00}, - //// crop window - {0xfe, 0x00}, - {0x99, 0x55}, - {0x9a, 0x06}, - {0x9b, 0x00}, - {0x9c, 0x00}, - {0x9d, 0x01}, - {0x9e, 0x23}, - {0x9f, 0x00}, - {0xa0, 0x00}, - {0xa1, 0x01}, - {0xa2, 0x23}, - - {0x90, 0x01}, - {0x91, 0x00}, - {0x92, 0x78}, - {0x93, 0x00}, - {0x94, 0x00}, - {0x95, 0x02}, - {0x96, 0xd0}, - {0x97, 0x05}, - {0x98, 0x00}, - //// AWB - {0xfe, 0x00}, - {0xec, 0x06}, - {0xed, 0x04}, - {0xee, 0x60}, - {0xef, 0x90}, - {0xfe, 0x01}, - {0x74, 0x01}, - //// AEC - {0xfe, 0x01}, - {0x01, 0x04}, - {0x02, 0xc0}, - {0x03, 0x04}, - {0x04, 0x90}, - {0x05, 0x30}, - {0x06, 0x90}, - {0x07, 0x30}, - {0x08, 0x80}, - {0x0a, 0x82}, - {0xfe, 0x01}, - {0x21, 0x15}, - {0xfe, 0x00}, - {0x20, 0x15}, //if 0xfa=11,then 0x21=15;else if 0xfa=00,then 0x21=04 - {0xfe, 0x00}, -#endif - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_softreset_data[] = { - SensorRegVal(0xfe, 80), - SensorWaitMs(5), - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[] = { - SensorRegVal(0xf0, 0), - SensorRegVal(0xf1, 0), - SensorEnd -}; -/* -* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx -*/ -static struct rk_sensor_reg sensor_WhiteB_Auto[] = { - {0xfe, 0x00}, - {0xb3, 0x61}, - {0xb4, 0x40}, - {0xb5, 0x61}, - {0x82, 0xfe}, - SensorEnd -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[] = { - {0xfe, 0x00}, - {0x82, 0xfc}, - {0xb3, 0x58}, - {0xb4, 0x40}, - {0xb5, 0x50}, - - SensorEnd -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[] = { - //Sunny - {0xfe, 0x00}, - {0x82, 0xfc}, - {0xb3, 0x70}, - {0xb4, 0x40}, - {0xb5, 0x50}, - SensorEnd -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[] = { - //Office - {0xfe, 0x00}, - {0x82, 0xfc}, - {0xb3, 0x50}, - {0xb4, 0x40}, - {0xb5, 0xa8}, - SensorEnd -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[] = { - //Home - {0xfe, 0x00}, - {0x82, 0xfc}, - {0xb3, 0xa0}, - {0xb4, 0x45}, - {0xb5, 0x40}, - SensorEnd -}; - -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = { - sensor_WhiteB_Auto, - sensor_WhiteB_Cloudy, - sensor_WhiteB_ClearDay, - sensor_WhiteB_TungstenLamp1, - sensor_WhiteB_TungstenLamp2, - NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[] = { - // Brightness -2 - - {0xfe, 0x01}, - {0x13, 0x10}, - {0xfe, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[] = { - // Brightness -1 - - {0xfe, 0x01}, - {0x13, 0x20}, - {0xfe, 0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[] = { - // Brightness 0 - - {0xfe, 0x01}, - {0x13, 0x30}, - {0xfe, 0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[] = { - // Brightness +1 - {0xfe, 0x01}, - {0x13, 0x40}, - {0xfe, 0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[] = { - // Brightness +2 - {0xfe, 0x01}, - {0x13, 0x45}, - {0xfe, 0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[] = { - // Brightness +3 - {0xfe, 0x01}, - {0x13, 0x50}, - {0xfe, 0x00}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = { - sensor_Brightness0, - sensor_Brightness1, - sensor_Brightness2, - sensor_Brightness3, - sensor_Brightness4, - sensor_Brightness5, - NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = { - {0xfe, 0x00}, - {0x83, 0xe0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = { - {0xfe, 0x00}, - {0x83, 0x12}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = { - {0xfe, 0x00}, - {0x83, 0x82}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Negative[] = { - //Negative - {0xfe, 0x00}, - {0x83, 0x01}, - SensorEnd -}; -static struct rk_sensor_reg sensor_Effect_Bluish[] = { - // Bluish - {0xfe, 0x00}, - {0x83, 0x62}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = { - // Greenish - {0xfe, 0x00}, - {0x83, 0x52}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_EffectSeqe[] = { - sensor_Effect_Normal, - sensor_Effect_WandB, - sensor_Effect_Negative, - sensor_Effect_Sepia, - sensor_Effect_Bluish, - sensor_Effect_Green, - NULL, -}; - -static struct rk_sensor_reg sensor_Exposure0[] = { - {0xfe, 0x01}, - {0x13, 0x60}, - {0xfe, 0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure1[] = { - {0xfe, 0x01}, - {0x13, 0x65}, - {0xfe, 0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure2[] = { - {0xfe, 0x01}, - {0x13, 0x70}, - {0xfe, 0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure3[] = { - {0xfe, 0x01}, - {0x13, 0x7b}, - {0xfe, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure4[] = { - {0xfe, 0x01}, - {0x13, 0x85}, - {0xfe, 0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure5[] = { - {0xfe, 0x01}, - {0x13, 0x90}, - {0xfe, 0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure6[] = { - {0xfe, 0x01}, - {0x13, 0x95}, - {0xfe, 0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = { - sensor_Exposure0, - sensor_Exposure1, - sensor_Exposure2, - sensor_Exposure3, - sensor_Exposure4, - sensor_Exposure5, - sensor_Exposure6, - NULL, -}; - -static struct rk_sensor_reg sensor_Saturation0[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[] = { - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = { - sensor_Saturation0, - sensor_Saturation1, - sensor_Saturation2, - NULL, -}; - -static struct rk_sensor_reg sensor_Contrast0[] = { - //Contrast -3 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast1[] = { - //Contrast -2 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast2[] = { - // Contrast -1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast3[] = { - //Contrast 0 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast4[] = { - //Contrast +1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast5[] = { - //Contrast +2 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast6[] = { - //Contrast +3 - - SensorEnd -}; -static struct rk_sensor_reg *sensor_ContrastSeqe[] = { - sensor_Contrast0, - sensor_Contrast1, - sensor_Contrast2, - sensor_Contrast3, - sensor_Contrast4, - sensor_Contrast5, - sensor_Contrast6, - NULL, -}; -static struct rk_sensor_reg sensor_SceneAuto[] = { - {0xfe, 0x01}, - - {0x3c, 0x40}, - {0xfe, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = { - {0xfe, 0x01}, - - {0x3c, 0x60}, - {0xfe, 0x00}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_SceneSeqe[] = { - sensor_SceneAuto, - sensor_SceneNight, - NULL, -}; - -static struct rk_sensor_reg sensor_Zoom0[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom3[] = { - SensorEnd -}; -static struct rk_sensor_reg *sensor_ZoomSeqe[] = { - sensor_Zoom0, - sensor_Zoom1, - sensor_Zoom2, - sensor_Zoom3, - NULL, -}; - -/* -* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu -*/ -static struct v4l2_querymenu sensor_menus[] = { -}; -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = { -}; - -//MUST define the current used format as the first item -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {MEDIA_BUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG} -}; -/*static struct soc_camera_ops sensor_ops;*/ - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - - return 0; -} - -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - //sensor_write(client, 0xfe, 0xf0); - //sensor_write(client, 0xfe, 0xf0); - //sensor_write(client, 0xfe, 0xf0); - //sensor_write(client, 0xfa, 0x73); - //sensor_write(client, 0x24, 0x00); - return 0; -} - -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static unsigned int shutter_h, shutter_l, cap; -static int sensor_s_fmt_cb_th(struct i2c_client *client, - struct v4l2_mbus_framefmt *mf, bool capture) -{ - char value; - unsigned int pid = 0, shutter, temp_reg; - - if ((mf->width == 800 && mf->height == 600) && (cap == 1)) { - cap = 0; - sensor_write(client, 0xb6, 0x00); // AEC off - sensor_write(client, 0x03, shutter_h); - sensor_write(client, 0x04, shutter_l); - msleep(50); - printk("set preview for rewrite 0x03"); - } - if (mf->width == 1600 && mf->height == 1200) { - - cap = 1; - sensor_write(client, 0xfe, 0x00); - sensor_write(client, 0xb6, 0x00); - sensor_read(client, 0x03, &value); - shutter_h = value; - pid |= (value << 8); - sensor_read(client, 0x04, &value); - shutter_l = value; - pid |= (value & 0xff); - shutter = pid; - - temp_reg = shutter / 2; - - if (temp_reg < 1) - temp_reg = 1; - - sensor_write(client, 0x03, ((temp_reg >> 8) & 0x1f)); - sensor_write(client, 0x04, (temp_reg & 0xff)); - } - - return 0; -} - -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh(struct i2c_client *client, - struct v4l2_mbus_framefmt *mf, bool capture) -{ - /* add delay for rk312x */ - msleep(300); - return 0; -} -static int sensor_softrest_usr_cb(struct i2c_client *client, - struct rk_sensor_reg *series) -{ - - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client, - struct rk_sensor_reg *series) -{ - return 0; -} -static int sensor_try_fmt_cb_th(struct i2c_client *client, - struct v4l2_mbus_framefmt *mf) -{ - return 0; -} -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("Suspend"); - - } else { - SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n", - pm_msg.event); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - - SENSOR_DG("Resume"); - - return 0; - -} -static int sensor_mirror_cb(struct i2c_client *client, int mirror) -{ - char val; - int err = 0; - - SENSOR_DG("mirror: %d", mirror); - if (mirror) { - sensor_write(client, 0xfe, 0); - err = sensor_read(client, 0x17, &val); - val -= 4; - if (err == 0) { - if ((val & 0x1) == 0) { - err = - sensor_write(client, 0x17, - ((val | 0x1) + 4)); - } else - err = - sensor_write(client, 0x17, - ((val & 0xfe) + 4)); - } - } else { - //do nothing - } - return err; -} - -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, - struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_mirror_cb(client, ext_ctrl->value) != 0) - SENSOR_TR("sensor_mirror failed, value:0x%x", ext_ctrl->value); - - SENSOR_DG("sensor_mirror success, value:0x%x", ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - char val; - int err = 0; - - SENSOR_DG("flip: %d", flip); - if (flip) { - - sensor_write(client, 0xfe, 0); - err = sensor_read(client, 0x17, &val); - val -= 4; - if (err == 0) { - if ((val & 0x2) == 0) { - err = - sensor_write(client, 0x17, - ((val | 0x2) + 4)); - } else { - err = - sensor_write(client, 0x17, - ((val & 0xfc) + 4)); - } - } - } else { - //do nothing - } - - return err; -} - -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, - struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_flip_cb(client, ext_ctrl->value) != 0) - SENSOR_TR("sensor_flip failed, value:0x%x", ext_ctrl->value); - - SENSOR_DG("sensor_flip success, value:0x%x", ext_ctrl->value); - return 0; -} - -/* -* the functions are focus callbacks -*/ -static int sensor_focus_init_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client, int pos) -{ - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, - int *zone_tm_pos) -{ - return 0; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client, int on) -{ - return 0; -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor *spsensor, - struct soc_camera_device *icd) -{ - return; -} - -/* -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); diff --git a/drivers/media/video/gc2155.c b/drivers/media/video/gc2155.c deleted file mode 100644 index 6440a777e8d3..000000000000 --- a/drivers/media/video/gc2155.c +++ /dev/null @@ -1,1622 +0,0 @@ -/* - * drivers/media/video/gc2155.c - * - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "generic_sensor.h" - -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.0.3: -* add sensor_focus_af_const_pause_usr_cb; -*/ -static int version = KERNEL_VERSION(0,0,3); -module_param(version, int, S_IRUGO); - - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_GC2155 -#define SENSOR_V4L2_IDENT V4L2_IDENT_GC2155 -#define SENSOR_ID 0x2155 -#define GC2155_SUBSAMPLE ///subsample for video - -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_PCLK_SAMPLE_RISING|V4L2_MBUS_HSYNC_ACTIVE_HIGH| V4L2_MBUS_VSYNC_ACTIVE_LOW|\ - V4L2_MBUS_DATA_ACTIVE_HIGH |SOCAM_MCLK_24MHZ) -#define SENSOR_PREVIEW_W 800 -#define SENSOR_PREVIEW_H 600 -#define SENSOR_PREVIEW_FPS 15000 // 15fps -#define SENSOR_FULLRES_L_FPS 7500 // 7.5fps -#define SENSOR_FULLRES_H_FPS 7500 // 7.5fps -#define SENSOR_720P_FPS 15000 -#define SENSOR_1080P_FPS 0 - -#define SENSOR_REGISTER_LEN 1 // sensor register address bytes -#define SENSOR_VALUE_LEN 1 // sensor register value bytes -static unsigned int SensorConfiguration = (CFG_WhiteBalance|CFG_Effect|CFG_Scene); -static unsigned int SensorChipID[] = {SENSOR_ID}; -/* Sensor Driver Configuration End */ - - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a,b) CONS4(SensorReg,SENSOR_REGISTER_LEN,Val,SENSOR_VALUE_LEN)(a,b) -#define sensor_write(client,reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_read(client,reg,v) CONS4(sensor_read_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_write_array generic_sensor_write_array - -struct sensor_parameter -{ - unsigned int PreviewDummyPixels; - unsigned int CaptureDummyPixels; - unsigned int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int PreviewPclk; - unsigned short int CapturePclk; - char awb[6]; -}; - -struct specific_sensor{ - struct generic_sensor common_sensor; - //define user data below - struct sensor_parameter parameter; - u16 shutter; - -}; - -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ - -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_init_data[] = -{ - //SENSORDB("GC2155_Sensor_Init"}, - {0xfe , 0xf0}, - {0xfe , 0xf0}, - {0xfe , 0xf0}, - {0xfc , 0x06}, - {0xf6 , 0x00}, - {0xf7 , 0x1d}, - {0xf8 , 0x84}, - {0xfa , 0x00}, - {0xf9 , 0xfe}, - {0xf2 , 0x00}, -///////////////////////////////////////////////// -//////////////////ISP reg////////////////////// -//////////////////////////////////////////////////// - {0xfe , 0x00}, - {0x03 , 0x04}, - {0x04 , 0xe2}, - {0x09 , 0x00}, - {0x0a , 0x00}, - {0x0b , 0x00}, - {0x0c , 0x00}, - {0x0d , 0x04}, - {0x0e , 0xc0}, - {0x0f , 0x06}, - {0x10 , 0x50}, - {0x12 , 0x2e}, - {0x17 , 0x14}, // mirror - {0x18 , 0x02}, - {0x19 , 0x0e}, - {0x1a , 0x01}, - {0x1b , 0x4b}, - {0x1c , 0x07}, - {0x1d , 0x10}, - {0x1e , 0x98}, - {0x1f , 0x78}, - {0x20 , 0x05}, - {0x21 , 0x40}, - {0x22 , 0xf0}, - {0x24 , 0x16}, - {0x25 , 0x01}, - {0x26 , 0x10}, - {0x2d , 0x40}, - {0x30 , 0x01}, - {0x31 , 0x90}, - {0x33 , 0x04}, - {0x34 , 0x01}, - ///////////////////////////////////////////////// - //////////////////ISP reg//////////////////// - ///////////////////////////////////////////////// - {0xfe , 0x00}, - {0x80 , 0xff}, - {0x81 , 0x2c}, - {0x82 , 0xfa}, - {0x83 , 0x00}, - {0x84 , 0x00}, //yuv 01 - {0x85 , 0x08}, - {0x86 , 0x02}, - {0x89 , 0x03}, - {0x8a , 0x00}, - {0x8b , 0x00}, - {0xb0 , 0x55}, - {0xc3 , 0x11}, //00 - {0xc4 , 0x20}, - {0xc5 , 0x30}, - {0xc6 , 0x38}, - {0xc7 , 0x40}, - {0xec , 0x02}, - {0xed , 0x04}, - {0xee , 0x60}, - {0xef , 0x90}, - {0xb6 , 0x01}, - {0x90 , 0x01}, - {0x91 , 0x00}, - {0x92 , 0x00}, - {0x93 , 0x00}, - {0x94 , 0x00}, - {0x95 , 0x04}, - {0x96 , 0xb0}, - {0x97 , 0x06}, - {0x98 , 0x40}, - ///////////////////////////////////////// - /////////// BLK //////////////////////// - ///////////////////////////////////////// - {0xfe , 0x00}, - {0x18 , 0x02}, - {0x40 , 0x42}, - {0x41 , 0x00}, - {0x43 , 0x5b},//0x54 - {0x5e , 0x00}, - {0x5f , 0x00}, - {0x60 , 0x00}, - {0x61 , 0x00}, - {0x62 , 0x00}, - {0x63 , 0x00}, - {0x64 , 0x00}, - {0x65 , 0x00}, - {0x66 , 0x20}, - {0x67 , 0x20}, - {0x68 , 0x20}, - {0x69 , 0x20}, - {0x6a , 0x08}, - {0x6b , 0x08}, - {0x6c , 0x08}, - {0x6d , 0x08}, - {0x6e , 0x08}, - {0x6f , 0x08}, - {0x70 , 0x08}, - {0x71 , 0x08}, - {0x72 , 0xf0}, - {0x7e , 0x3c}, - {0x7f , 0x00}, - {0xfe , 0x00}, - //////////////////////////////////////// - /////////// AEC //////////////////////// - //////////////////////////////////////// - {0xfe , 0x01}, - {0x01 , 0x08}, - {0x02 , 0xc0}, - {0x03 , 0x04}, - {0x04 , 0x90}, - {0x05 , 0x30}, - {0x06 , 0x98}, - {0x07 , 0x28}, - {0x08 , 0x6c}, - {0x09 , 0x00}, - {0x0a , 0xc2}, - {0x0b , 0x11}, - {0x0c , 0x10}, - {0x13 , 0x2d}, - {0x17 , 0x00}, - {0x1c , 0x11}, - {0x1e , 0x61}, - {0x1f , 0x30}, - {0x20 , 0x40}, - {0x22 , 0x80}, - {0x23 , 0x20}, - - {0x12 , 0x35}, - {0x15 , 0x50}, - {0x10 , 0x31}, - {0x3e , 0x28}, - {0x3f , 0xe0}, - {0x40 , 0xe0}, - {0x41 , 0x08}, - - {0xfe , 0x02}, - {0x0f , 0x05}, - ///////////////////////////// - //////// INTPEE ///////////// - ///////////////////////////// - {0xfe , 0x02}, - {0x90 , 0x6c}, - {0x91 , 0x03}, - {0x92 , 0xc4}, - {0x97 , 0x64}, - {0x98 , 0x88}, - {0x9d , 0x08}, - {0xa2 , 0x11}, - {0xfe , 0x00}, - ///////////////////////////// - //////// DNDD/////////////// - ///////////////////////////// - {0xfe , 0x02}, - {0x80 , 0xc1}, - {0x81 , 0x08}, - {0x82 , 0x05}, - {0x83 , 0x04}, - {0x84 , 0x0a}, - {0x86 , 0x80}, - {0x87 , 0x30}, - {0x88 , 0x15}, - {0x89 , 0x80}, - {0x8a , 0x60}, - {0x8b , 0x30}, - ///////////////////////////////////////// - /////////// ASDE //////////////////////// - ///////////////////////////////////////// - {0xfe , 0x01}, - {0x21 , 0x14}, - {0xfe , 0x02}, - {0x3c , 0x06}, - {0x3d , 0x40}, - {0x48 , 0x30}, - {0x49 , 0x06}, - {0x4b , 0x08}, - {0x4c , 0x20}, - {0xa3 , 0x50}, - {0xa4 , 0x30}, - {0xa5 , 0x40}, - {0xa6 , 0x80}, - {0xab , 0x40}, - {0xae , 0x0c}, - {0xb3 , 0x42}, - {0xb4 , 0x24}, - {0xb6 , 0x50}, - {0xb7 , 0x01}, - {0xb9 , 0x28}, - {0xfe , 0x00}, - ///////////////////gamma1//////////////////// - {0xfe , 0x02}, - {0x10 , 0x0d}, - {0x11 , 0x12}, - {0x12 , 0x17}, - {0x13 , 0x1c}, - {0x14 , 0x27}, - {0x15 , 0x34}, - {0x16 , 0x44}, - {0x17 , 0x55}, - {0x18 , 0x6e}, - {0x19 , 0x81}, - {0x1a , 0x91}, - {0x1b , 0x9c}, - {0x1c , 0xaa}, - {0x1d , 0xbb}, - {0x1e , 0xca}, - {0x1f , 0xd5}, - {0x20 , 0xe0}, - {0x21 , 0xe7}, - {0x22 , 0xed}, - {0x23 , 0xf6}, - {0x24 , 0xfb}, - {0x25 , 0xff}, - ///////////////////gamma2//////////////////// - {0xfe , 0x02}, - {0x26 , 0x0d}, - {0x27 , 0x12}, - {0x28 , 0x17}, - {0x29 , 0x1c}, - {0x2a , 0x27}, - {0x2b , 0x34}, - {0x2c , 0x44}, - {0x2d , 0x55}, - {0x2e , 0x6e}, - {0x2f , 0x81}, - {0x30 , 0x91}, - {0x31 , 0x9c}, - {0x32 , 0xaa}, - {0x33 , 0xbb}, - {0x34 , 0xca}, - {0x35 , 0xd5}, - {0x36 , 0xe0}, - {0x37 , 0xe7}, - {0x38 , 0xed}, - {0x39 , 0xf6}, - {0x3a , 0xfb}, - {0x3b , 0xff}, - /////////////////////////////////////////////// - ///////////YCP /////////////////////// - /////////////////////////////////////////////// - {0xfe , 0x02}, - {0xd1 , 0x28}, - {0xd2 , 0x28}, - {0xdd , 0x14}, - {0xde , 0x88}, - {0xed , 0x80}, - //////////////////////////// - //////// LSC /////////////// - //////////////////////////// - {0xfe , 0x01}, - {0xc2 , 0x1f}, - {0xc3 , 0x13}, - {0xc4 , 0x0e}, - {0xc8 , 0x16}, - {0xc9 , 0x0f}, - {0xca , 0x0c}, - {0xbc , 0x52}, - {0xbd , 0x2c}, - {0xbe , 0x27}, - {0xb6 , 0x47}, - {0xb7 , 0x32}, - {0xb8 , 0x30}, - {0xc5 , 0x00}, - {0xc6 , 0x00}, - {0xc7 , 0x00}, - {0xcb , 0x00}, - {0xcc , 0x00}, - {0xcd , 0x00}, - {0xbf , 0x0e}, - {0xc0 , 0x00}, - {0xc1 , 0x00}, - {0xb9 , 0x08}, - {0xba , 0x00}, - {0xbb , 0x00}, - {0xaa , 0x0a}, - {0xab , 0x0c}, - {0xac , 0x0d}, - {0xad , 0x02}, - {0xae , 0x06}, - {0xaf , 0x05}, - {0xb0 , 0x00}, - {0xb1 , 0x05}, - {0xb2 , 0x02}, - {0xb3 , 0x04}, - {0xb4 , 0x04}, - {0xb5 , 0x05}, - {0xd0 , 0x00}, - {0xd1 , 0x00}, - {0xd2 , 0x00}, - {0xd6 , 0x02}, - {0xd7 , 0x00}, - {0xd8 , 0x00}, - {0xd9 , 0x00}, - {0xda , 0x00}, - {0xdb , 0x00}, - {0xd3 , 0x00}, - {0xd4 , 0x00}, - {0xd5 , 0x00}, - {0xa4 , 0x04}, - {0xa5 , 0x00}, - {0xa6 , 0x77}, - {0xa7 , 0x77}, - {0xa8 , 0x77}, - {0xa9 , 0x77}, - {0xa1 , 0x80}, - {0xa2 , 0x80}, - - {0xfe , 0x01}, - {0xdc , 0x35}, - {0xdd , 0x28}, - {0xdf , 0x0d}, - {0xe0 , 0x70}, - {0xe1 , 0x78}, - {0xe2 , 0x70}, - {0xe3 , 0x78}, - {0xe6 , 0x90}, - {0xe7 , 0x70}, - {0xe8 , 0x90}, - {0xe9 , 0x70}, - {0xfe , 0x00}, - /////////////////////////////////////////////// - /////////// AWB//////////////////////// - /////////////////////////////////////////////// - {0xfe , 0x01}, - {0x4f , 0x00}, - {0x4f , 0x00}, - {0x4b , 0x01}, - {0x4f , 0x00}, - {0x4c , 0x01}, - {0x4d , 0x71}, - {0x4e , 0x02}, - {0x4c , 0x01}, - {0x4d , 0x91}, - {0x4e , 0x02}, - {0x4c , 0x01}, - {0x4d , 0x50}, - {0x4e , 0x02}, - {0x4c , 0x01}, - {0x4d , 0x70}, - {0x4e , 0x02}, - {0x4c , 0x01}, - {0x4d , 0x90}, - {0x4e , 0x02}, - {0x4c , 0x01}, - {0x4d , 0xb0}, - {0x4e , 0x02}, - {0x4c , 0x01}, - {0x4d , 0xd0}, - {0x4e , 0x02}, - {0x4c , 0x01}, - {0x4d , 0x4f}, - {0x4e , 0x02}, - {0x4c , 0x01}, - {0x4d , 0x6f}, - {0x4e , 0x02}, - {0x4c , 0x01}, - {0x4d , 0x8f}, - {0x4e , 0x02}, - {0x4c , 0x01}, - {0x4d , 0xaf}, - {0x4e , 0x02}, - {0x4c , 0x01}, - {0x4d , 0xcf}, - {0x4e , 0x02}, - {0x4c , 0x01}, - {0x4d , 0x6e}, - {0x4e , 0x03}, - {0x4c , 0x01}, - {0x4d , 0x8e}, - {0x4e , 0x03}, - {0x4c , 0x01}, - {0x4d , 0xae}, - {0x4e , 0x03}, - {0x4c , 0x01}, - {0x4d , 0xce}, - {0x4e , 0x03}, - {0x4c , 0x01}, - {0x4d , 0x4d}, - {0x4e , 0x03}, - {0x4c , 0x01}, - {0x4d , 0x6d}, - {0x4e , 0x03}, - {0x4c , 0x01}, - {0x4d , 0x8d}, - {0x4e , 0x03}, - {0x4c , 0x01}, - {0x4d , 0xad}, - {0x4e , 0x03}, - {0x4c , 0x01}, - {0x4d , 0xcd}, - {0x4e , 0x03}, - {0x4c , 0x01}, - {0x4d , 0x4c}, - {0x4e , 0x03}, - {0x4c , 0x01}, - {0x4d , 0x6c}, - {0x4e , 0x03}, - {0x4c , 0x01}, - {0x4d , 0x8c}, - {0x4e , 0x03}, - {0x4c , 0x01}, - {0x4d , 0xac}, - {0x4e , 0x03}, - {0x4c , 0x01}, - {0x4d , 0xcc}, - {0x4e , 0x03}, - {0x4c , 0x01}, - {0x4d , 0xec}, - {0x4e , 0x03}, - {0x4c , 0x01}, - {0x4d , 0x4b}, - {0x4e , 0x03}, - {0x4c , 0x01}, - {0x4d , 0x6b}, - {0x4e , 0x03}, - {0x4c , 0x01}, - {0x4d , 0x8b}, - {0x4e , 0x03}, - {0x4c , 0x01}, - {0x4d , 0xab}, - {0x4e , 0x03}, - {0x4c , 0x01}, - {0x4d , 0x8a}, - {0x4e , 0x04}, - {0x4c , 0x01}, - {0x4d , 0xaa}, - {0x4e , 0x04}, - {0x4c , 0x01}, - {0x4d , 0xca}, - {0x4e , 0x04}, - {0x4c , 0x01}, - {0x4d , 0xa9}, - {0x4e , 0x04}, - {0x4c , 0x01}, - {0x4d , 0xc9}, - {0x4e , 0x04}, - {0x4c , 0x01}, - {0x4d , 0xcb}, - {0x4e , 0x05}, - {0x4c , 0x01}, - {0x4d , 0xeb}, - {0x4e , 0x05}, - {0x4c , 0x02}, - {0x4d , 0x0b}, - {0x4e , 0x05}, - {0x4c , 0x02}, - {0x4d , 0x2b}, - {0x4e , 0x05}, - {0x4c , 0x02}, - {0x4d , 0x4b}, - {0x4e , 0x05}, - {0x4c , 0x01}, - {0x4d , 0xea}, - {0x4e , 0x05}, - {0x4c , 0x02}, - {0x4d , 0x0a}, - {0x4e , 0x05}, - {0x4c , 0x02}, - {0x4d , 0x2a}, - {0x4e , 0x05}, - {0x4c , 0x02}, - {0x4d , 0x6a}, - {0x4e , 0x06}, - {0x4c , 0x02}, - {0x4d , 0x29}, - {0x4e , 0x06}, - {0x4c , 0x02}, - {0x4d , 0x49}, - {0x4e , 0x06}, - {0x4c , 0x02}, - {0x4d , 0x69}, - {0x4e , 0x06}, - {0x4c , 0x02}, - {0x4d , 0x89}, - {0x4e , 0x06}, - {0x4c , 0x02}, - {0x4d , 0xa9}, - {0x4e , 0x06}, - {0x4c , 0x02}, - {0x4d , 0xc9}, - {0x4e , 0x06}, - {0x4c , 0x02}, - {0x4d , 0x48}, - {0x4e , 0x06}, - {0x4c , 0x02}, - {0x4d , 0x68}, - {0x4e , 0x06}, - {0x4c , 0x03}, - {0x4d , 0x09}, - {0x4e , 0x07}, - {0x4c , 0x02}, - {0x4d , 0xa8}, - {0x4e , 0x07}, - {0x4c , 0x02}, - {0x4d , 0xc8}, - {0x4e , 0x07}, - {0x4c , 0x02}, - {0x4d , 0xe8}, - {0x4e , 0x07}, - {0x4c , 0x03}, - {0x4d , 0x08}, - {0x4e , 0x07}, - {0x4c , 0x03}, - {0x4d , 0x28}, - {0x4e , 0x07}, - {0x4c , 0x02}, - {0x4d , 0x87}, - {0x4e , 0x07}, - {0x4c , 0x02}, - {0x4d , 0xa7}, - {0x4e , 0x07}, - {0x4c , 0x02}, - {0x4d , 0xc7}, - {0x4e , 0x07}, - {0x4c , 0x02}, - {0x4d , 0xe7}, - {0x4e , 0x07}, - {0x4c , 0x03}, - {0x4d , 0x07}, - {0x4e , 0x07}, - {0x4f , 0x01}, - {0xfe , 0x01}, - - {0x50 , 0x80}, - {0x51 , 0xa8}, - {0x52 , 0x57}, - {0x53 , 0x38}, - {0x54 , 0xc7}, - {0x56 , 0x0e}, - {0x58 , 0x08}, - {0x5b , 0x00}, - {0x5c , 0x74}, - {0x5d , 0x8b}, - {0x61 , 0xd3}, - {0x62 , 0x90}, - {0x63 , 0xaa}, - {0x65 , 0x04}, - {0x67 , 0xb2}, - {0x68 , 0xac}, - {0x69 , 0x00}, - {0x6a , 0xb2}, - {0x6b , 0xac}, - {0x6c , 0xdc}, - {0x6d , 0xb0}, - {0x6e , 0x30}, - {0x6f , 0x40}, - {0x70 , 0x05}, - {0x71 , 0x80}, - {0x72 , 0x80}, - {0x73 , 0x30}, - {0x74 , 0x01}, - {0x75 , 0x01}, - {0x7f , 0x08}, - {0x76 , 0x70}, - {0x77 , 0x48}, - {0x78 , 0xa0}, - {0xfe , 0x00}, - ////////////////////////////////////////// - ///////////CC//////////////////////// - ////////////////////////////////////////// - {0xfe , 0x02}, - {0xc0 , 0x01}, - {0xc1 , 0x4a}, - {0xc2 , 0xf3}, - {0xc3 , 0xfc}, - {0xc4 , 0xe4}, - {0xc5 , 0x48}, - {0xc6 , 0xec}, - {0xc7 , 0x45}, - {0xc8 , 0xf8}, - {0xc9 , 0x02}, - {0xca , 0xfe}, - {0xcb , 0x42}, - {0xcc , 0x00}, - {0xcd , 0x45}, - {0xce , 0xf0}, - {0xcf , 0x00}, - {0xe3 , 0xf0}, - {0xe4 , 0x45}, - {0xe5 , 0xe8}, - ////////////////////////////////////////// - ///////////ABS //////////////////// - ////////////////////////////////////////// - {0xfe , 0x01}, - {0x9f , 0x42}, - {0xfe , 0x00}, - - //////////////frame rate 50Hz///////// -#if 1 - {0xfe , 0x00}, - {0x05 , 0x01}, - {0x06 , 0x56}, - {0x07 , 0x00}, - {0x08 , 0x32}, - {0xfe , 0x01}, - {0x25 , 0x00}, - {0x26 , 0xfa}, - {0x27 , 0x04}, - {0x28 , 0xe2}, //20fps - {0x29 , 0x06}, - {0x2a , 0xd6}, //16fps - {0x2b , 0x07}, - {0x2c , 0xd0}, //12fps - {0x2d , 0x0b}, - {0x2e , 0xb8}, //8fps - {0xfe , 0x00}, -#else - //////////////frame rate 50Hz - {0xfe, 0x00}, - {0x05, 0x02}, - {0x06, 0x2d}, - {0x07, 0x00}, - {0x08, 0xa0}, - {0xfe, 0x01}, - {0x25, 0x00}, - {0x26, 0xd4}, - {0x27, 0x04}, - {0x28, 0xf8}, - {0x29, 0x08}, - {0x2a, 0x48}, - {0x2b, 0x0a}, - {0x2c, 0xc4}, - {0x2d, 0x0f}, - {0x2e, 0xbc}, - {0xfe, 0x00}, -#endif - - ///////GC2155_Sensor_SVGA//// - {0xfe , 0x00}, - {0xfa , 0x00}, - {0xfd , 0x01}, - //// crop window - {0xfe , 0x00}, - {0x90 , 0x01}, - {0x91 , 0x00}, - {0x92 , 0x00}, - {0x93 , 0x00}, - {0x94 , 0x00}, - {0x95 , 0x02}, - {0x96 , 0x58}, - {0x97 , 0x03}, - {0x98 , 0x20}, - {0x99 , 0x11}, - {0x9a , 0x06}, - //// AWB - {0xfe , 0x00}, - {0xec , 0x01}, - {0xed , 0x02}, - {0xee , 0x30}, - {0xef , 0x48}, - {0xfe , 0x01}, - {0x74 , 0x00}, - //// AEC - {0xfe , 0x01}, - {0x01 , 0x04}, - {0x02 , 0x60}, - {0x03 , 0x02}, - {0x04 , 0x48}, - {0x05 , 0x18}, - {0x06 , 0x4c}, - {0x07 , 0x14}, - {0x08 , 0x36}, - {0x0a , 0xc0}, - {0x21 , 0x14}, - {0xfe , 0x00}, - //// gamma - {0xfe , 0x00}, - {0xc3 , 0x11}, - {0xc4 , 0x20}, - {0xc5 , 0x30}, - {0xfe , 0x00}, -////////svga setting end////// - - -////////////////////////////////////////// -///////////OUTPUT //////////////////// -////////////////////////////////////////// - {0xfe , 0x00}, - {0xf2 , 0x0f}, - - SensorEnd -}; -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={ - //SENSORDB("GC2155_Sensor_2M"}, - {0xfe , 0x00}, - {0xb6 , 0x00}, - {0xfa , 0x11}, - {0xfd , 0x00}, - //// crop window - {0xfe , 0x00}, - {0x90 , 0x01}, - {0x91 , 0x00}, - {0x92 , 0x00}, - {0x93 , 0x00}, - {0x94 , 0x00}, - {0x95 , 0x04}, - {0x96 , 0xb0}, - {0x97 , 0x06}, - {0x98 , 0x40}, - {0x99 , 0x11}, - {0x9a , 0x06}, - - {0x9b , 0x00}, - {0x9c , 0x00}, - {0x9d , 0x00}, - {0x9e , 0x00}, - {0x9f , 0x00}, - {0xa0 , 0x00}, - {0xa1 , 0x00}, - {0xa2 ,0x00}, - - //// AWB - {0xfe , 0x00}, - {0xec , 0x02}, - {0xed , 0x04}, - {0xee , 0x60}, - {0xef , 0x90}, - {0xfe , 0x01}, - {0x74 , 0x01}, - //// AEC - {0xfe , 0x01}, - {0x01 , 0x08}, - {0x02 , 0xc0}, - {0x03 , 0x04}, - {0x04 , 0x90}, - {0x05 , 0x30}, - {0x06 , 0x98}, - {0x07 , 0x28}, - {0x08 , 0x6c}, - {0x0a , 0xc2}, - {0x21 , 0x15}, //if 0xfa=11,then 0x21=15;else if 0xfa=00,then 0x21=14 - {0xfe , 0x00}, - //// gamma - {0xfe , 0x00}, - {0xc3 , 0x00}, //if shutter/2 when capture,then exp_gamma_th/2 - {0xc4 , 0x90}, - {0xc5 , 0x98}, - {0xfe , 0x00}, - - SensorEnd -}; - -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] ={ - SensorEnd -}; -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data[] = -{ - //SENSORDB("GC2155_Sensor_SVGA"}, - {0xfe , 0x00}, - {0xb6 , 0x01}, - {0xfa , 0x00}, - {0xfd , 0x01}, - -////window setting///// - {0x09 , 0x00}, - {0x0a , 0x00}, - {0x0b , 0x00}, - {0x0c , 0x00}, - {0x0d , 0x04}, - {0x0e , 0xc0}, - {0x0f , 0x06}, - {0x10 , 0x50}, - - //// crop window - {0xfe , 0x00}, - {0x90 , 0x01}, - {0x91 , 0x00}, - {0x92 , 0x00}, - {0x93 , 0x00}, - {0x94 , 0x00}, - {0x95 , 0x02}, - {0x96 , 0x58}, - {0x97 , 0x03}, - {0x98 , 0x20}, - {0x99 , 0x11}, - {0x9a , 0x06}, - {0x9b , 0x00}, - {0x9c , 0x00}, - {0x9d , 0x00}, - {0x9e , 0x00}, - {0x9f , 0x00}, - {0xa0 , 0x00}, - {0xa1 , 0x00}, - {0xa2 ,0x00}, - - //// AWB - {0xfe , 0x00}, - {0xec , 0x01}, - {0xed , 0x02}, - {0xee , 0x30}, - {0xef , 0x48}, - {0xfe , 0x01}, - {0x74 , 0x00}, - //// AEC - {0xfe , 0x01}, - {0x01 , 0x04}, - {0x02 , 0x60}, - {0x03 , 0x02}, - {0x04 , 0x48}, - {0x05 , 0x18}, - {0x06 , 0x4c}, - {0x07 , 0x14}, - {0x08 , 0x36}, - {0x0a , 0xc0}, - {0x21 , 0x14}, - {0xfe , 0x00}, - //// gamma - {0xfe , 0x00}, - {0xc3 , 0x11}, - {0xc4 , 0x20}, - {0xc5 , 0x30}, - {0xfe , 0x00}, - -//////////////frame rate 50Hz///////// -#if 1 - {0xfe , 0x00}, - {0x05 , 0x01}, - {0x06 , 0x56}, - {0x07 , 0x00}, - {0x08 , 0x32}, - {0xfe , 0x01}, - {0x25 , 0x00}, - {0x26 , 0xfa}, - {0x27 , 0x04}, - {0x28 , 0xe2}, //20fps - {0x29 , 0x06}, - {0x2a , 0xd6}, //16fps - {0x2b , 0x07}, - {0x2c , 0xd0}, //12fps - {0x2d , 0x0b}, - {0x2e , 0xb8}, //8fps - {0xfe , 0x00}, -#else - //////////////frame rate 50Hz - {0xfe, 0x00}, - {0x05, 0x02}, - {0x06, 0x2d}, - {0x07, 0x00}, - {0x08, 0xa0}, - {0xfe, 0x01}, - {0x25, 0x00}, - {0x26, 0xd4}, - {0x27, 0x04}, - {0x28, 0xf8}, - {0x29, 0x08}, - {0x2a, 0x48}, - {0x2b, 0x0a}, - {0x2c, 0xc4}, - {0x2d, 0x0f}, - {0x2e, 0xbc}, - {0xfe, 0x00}, -#endif - SensorEnd - -}; -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[]={ - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[]={ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_softreset_data[]={ - SensorRegVal(0xfe,80), - SensorWaitMs(5), - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[]={ - SensorRegVal(0xf0,0), - SensorRegVal(0xf1,0), - SensorEnd -}; -/* -* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx -*/ -static struct rk_sensor_reg sensor_WhiteB_Auto[]= -{ - {0xfe , 0x00}, - {0x82 , 0xfe}, - SensorEnd -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[]= -{ - {0xfe , 0x00}, - {0x82 , 0xfc}, - {0xb3 , 0x58}, - {0xb4 , 0x40}, - {0xb5 , 0x50}, - SensorEnd -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0xfe , 0x00}, - {0x82 , 0xfc}, - {0xb3 , 0x70}, - {0xb4 , 0x40}, - {0xb5 , 0x50}, - - SensorEnd -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0xfe, 0x00}, - {0x82, 0xfc}, - {0xb3, 0x50}, - {0xb4, 0x40}, - {0xb5, 0xa8}, - SensorEnd - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0xfe, 0x00}, - {0x82, 0xfc}, - {0xb3, 0x50}, - {0xb4, 0x40}, - {0xb5, 0xa8}, - SensorEnd -}; - -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_Cloudy,sensor_WhiteB_ClearDay, - sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2,NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[]= -{ - // Brightness -2 - - {0xfe,0x01}, - {0x13,0x10}, - {0xfe,0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[]= -{ - // Brightness -1 - - {0xfe,0x01}, - {0x13,0x20}, - {0xfe,0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[]= -{ - // Brightness 0 - - {0xfe,0x01}, - {0x13,0x30}, - {0xfe,0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[]= -{ - // Brightness +1 - {0xfe,0x01}, - {0x13,0x40}, - {0xfe,0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[]= -{ - // Brightness +2 - {0xfe,0x01}, - {0x13,0x45}, - {0xfe,0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[]= -{ - // Brightness +3 - {0xfe,0x01}, - {0x13,0x50}, - {0xfe,0x00}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = -{ - {0xfe, 0x00}, - {0x83, 0xe0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = -{ - {0xfe, 0x00}, - {0x83, 0x12}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = -{ - {0xfe, 0x00}, - {0x83, 0x82}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Negative[] = -{ - //Negative - {0xfe, 0x00}, - {0x83, 0x01}, - SensorEnd -}; -static struct rk_sensor_reg sensor_Effect_Bluish[] = -{ - // Bluish - {0xfe, 0x00}, - {0x83, 0x62}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = -{ - // Greenish - {0xfe, 0x00}, - {0x83, 0x52}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; - -static struct rk_sensor_reg sensor_Exposure0[]= -{ - {0xfe,0x01}, - {0x13,0x20}, - {0xfe,0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure1[]= -{ - - {0xfe,0x01}, - {0x13,0x28}, - {0xfe,0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure2[]= -{ - {0xfe,0x01}, - {0x13,0x30}, - {0xfe,0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure3[]= -{ - {0xfe,0x01}, - {0x13,0x35}, - {0xfe,0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure4[]= -{ - {0xfe,0x01}, - {0x13,0x48}, - {0xfe,0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure5[]= -{ - {0xfe,0x01}, - {0x13,0x50}, - {0xfe,0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure6[]= -{ - {0xfe,0x01}, - {0x13,0x58}, - {0xfe,0x00}, - - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; - -static struct rk_sensor_reg sensor_Saturation0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -static struct rk_sensor_reg sensor_Contrast0[]= -{ - //Contrast -3 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast1[]= -{ - //Contrast -2 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast2[]= -{ - // Contrast -1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast3[]= -{ - //Contrast 0 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast4[]= -{ - //Contrast +1 - - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Contrast5[]= -{ - //Contrast +2 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast6[]= -{ - //Contrast +3 - - SensorEnd -}; -static struct rk_sensor_reg *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; -static struct rk_sensor_reg sensor_SceneAuto[] = -{ - {0xfe,0x01}, - - {0x3c,0x40}, - {0xfe,0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = -{ - {0xfe,0x01}, - - {0x3c,0x60}, - {0xfe,0x00}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -static struct rk_sensor_reg sensor_Zoom0[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Zoom3[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; - -/* -* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu -*/ -static struct v4l2_querymenu sensor_menus[] = -{ -}; -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = -{ -}; - -//MUST define the current used format as the first item -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {MEDIA_BUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG} -}; - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - return 0; -} -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - //sensor_write(client, 0xfe, 0xf0); - //sensor_write(client, 0xfe, 0xf0); - //sensor_write(client, 0xfe, 0xf0); - //sensor_write(client, 0xfa, 0x73); - //sensor_write(client, 0x24, 0x00); - return 0; -} -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static unsigned int shutter_h=0,shutter_l=0,cap=0; -static int sensor_s_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - char value; - unsigned int pid=0,shutter,temp_reg; - - if ((mf->width == 800 && mf->height == 600)&&(cap==1)) - { - cap=0; - sensor_write(client, 0xb6, 0x00); // AEC off - sensor_write(client, 0x03, shutter_h); - sensor_write(client, 0x04, shutter_l); - msleep(50); - printk("set preview for rewrite 0x03"); - } - if(mf->width == 1600 && mf->height == 1200){ - cap=1; - sensor_write(client, 0xfe, 0x00); - sensor_write(client, 0xb6, 0x00); - sensor_read(client, 0x03, &value); - shutter_h=value; - pid |= (value << 8); - sensor_read(client, 0x04, &value); - shutter_l=value; - pid |= (value & 0xff); - shutter=pid; - - temp_reg= shutter/2; - - if(temp_reg < 1) temp_reg = 1; - - sensor_write(client, 0x03, ((temp_reg>>8)&0x1f)); - sensor_write(client, 0x04, (temp_reg&0xff)); - } - - return 0; -} -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh (struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - return 0; -} -static int sensor_softrest_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - return 0; -} -static int sensor_try_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf) -{ - return 0; -} -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("Suspend"); - - } else { - SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n",pm_msg.event); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - - SENSOR_DG("Resume"); - - return 0; - -} -static int sensor_mirror_cb (struct i2c_client *client, int mirror) -{ - char val; - int err = 0; - - SENSOR_DG("mirror: %d",mirror); - if (mirror) { - sensor_write(client, 0xfe, 0); - err = sensor_read(client, 0x17, &val); - val-=4; - if (err == 0) { - if((val & 0x1) == 0){ - err = sensor_write(client, 0x17, ((val |0x1)+4)); - } - else - err = sensor_write(client, 0x17, ((val & 0xfe)+4)); - } - } else { - //do nothing - } - return err; -} -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_mirror_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_mirror failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_mirror success, value:0x%x",ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - char val; - int err = 0; - - SENSOR_DG("flip: %d",flip); - if (flip) { - sensor_write(client, 0xfe, 0); - err = sensor_read(client, 0x17, &val); - val-=4; - if (err == 0) { - if((val & 0x2) == 0){ - err = sensor_write(client, 0x17, ((val |0x2)+4)); - } - else { - err = sensor_write(client, 0x17, ((val & 0xfc)+4)); - } - } - } else { - //do nothing - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_flip_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_flip failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_flip success, value:0x%x",ext_ctrl->value); - return 0; -} -/* -* the functions are focus callbacks -*/ -static int sensor_focus_init_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos){ - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client){ - return 0; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos) -{ - return 0; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client,int on){ - return 0; -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor* spsensor,struct soc_camera_device *icd) -{ - return; -} - -/* -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); - - - - - diff --git a/drivers/media/video/generic_sensor.c b/drivers/media/video/generic_sensor.c deleted file mode 100644 index 98875e394d6d..000000000000 --- a/drivers/media/video/generic_sensor.c +++ /dev/null @@ -1,1576 +0,0 @@ -/* - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "generic_sensor.h" -#include - -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.1.1: -* add WqCmd_af_continues_pause; -*v0.1.3: -* add support flash control; -* -*v0.1.5/v0.1.7: -* fix use v4l2_mbus_framefmt.reserved array overflow in generic_sensor_s_fmt; -*v0.1.9: -* fix sensor_find_ctrl may be overflow; -*v0.1.b: -* 1. support sensor driver crop by redefine SENSOR_CROP_PERCENT; -* 2. fix sensor_ops which is independent for driver; -* 3. support cropcap; -*v.0.1.c: -* 1. modify generic_sensor_s_fmt, flash will work everytime when capture -*v.0.1.d: - 1. add some callbacks for icatch -*/ -static int version = KERNEL_VERSION(0,1,0xd); -module_param(version, int, S_IRUGO); - - -static int debug = 0; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define CAMMODULE_NAME "rk_cam_sensor" - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_NAME_STRING() sensor->dev_name - -#undef SENSOR_TR -#undef SENSOR_DG -#define SENSOR_TR(format, ...) printk(KERN_ERR "%s(%s:%d): " format"\n", SENSOR_NAME_STRING(),CAMMODULE_NAME,__LINE__, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, "%s(%s:%d): "format"\n", SENSOR_NAME_STRING(),CAMMODULE_NAME,__LINE__,## __VA_ARGS__) -#define debug_printk(format, ...) dprintk(3, "%s(%s:%d): "format"\n", SENSOR_NAME_STRING(),CAMMODULE_NAME,__LINE__,## __VA_ARGS__) - - -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -static const struct rk_sensor_datafmt *generic_sensor_find_datafmt( - u32 code, const struct rk_sensor_datafmt *fmt, - int n); - -int sensor_write_reg2val1(struct i2c_client *client, u16 reg,u8 val){ - struct rk_sensor_reg tmp_reg; - - tmp_reg.reg_mask = 0xffff; - tmp_reg.val_mask = 0xff; - tmp_reg.reg = reg; - tmp_reg.val = val; - return generic_sensor_write(client, &tmp_reg); -} -int sensor_write_reg2val2(struct i2c_client *client, u16 reg,u16 val){ - struct rk_sensor_reg tmp_reg; - - tmp_reg.reg_mask = 0xffff; - tmp_reg.val_mask = 0xffff; - tmp_reg.reg = reg; - tmp_reg.val = val; - return generic_sensor_write(client, &tmp_reg); -} -int sensor_write_reg1val1(struct i2c_client *client, u8 reg,u8 val){ - struct rk_sensor_reg tmp_reg; - - tmp_reg.reg_mask = 0xff; - tmp_reg.val_mask = 0xff; - tmp_reg.reg = reg; - tmp_reg.val = val; - return generic_sensor_write(client, &tmp_reg); -} -int sensor_write_reg1val2(struct i2c_client *client, u8 reg,u16 val){ - struct rk_sensor_reg tmp_reg; - - tmp_reg.reg_mask = 0xff; - tmp_reg.val_mask = 0xffff; - tmp_reg.reg = reg; - tmp_reg.val = val; - return generic_sensor_write(client, &tmp_reg); -} -int sensor_write_reg0val0(struct i2c_client *client, u8 reg,u16 val) -{ - struct generic_sensor *sensor = to_generic_sensor(client); - - SENSOR_TR("SENSOR_REGISTER_LEN and SENSOR_VALUE_LEN is 0, please use generic_sensor_write directly!"); - return -1; -} -/* sensor register write */ -int generic_sensor_write(struct i2c_client *client,struct rk_sensor_reg* sensor_reg) -{ - int err,cnt = 0,i; - u8 buf[6]; - struct i2c_msg msg[1]; - struct generic_sensor *sensor = to_generic_sensor(client); - - err = 0; - switch(sensor_reg->reg){ - case SEQCMD_WAIT_MS: - if (in_atomic()) - mdelay(sensor_reg->val); - else - msleep(sensor_reg->val); - break; - case SEQCMD_WAIT_US: - udelay(sensor_reg->val); - break; - default: - cnt=0; - for (i=2; i>=0; i--) { - if(((sensor_reg->reg_mask) & (0xff<<(i*8)))) { - buf[cnt++] = ((sensor_reg->reg)>>(i*8))&0xff; - } - } - for (i=2; i>=0; i--) { - if(((sensor_reg->val_mask) & (0xff<<(i*8)))) { - buf[cnt++] = ((sensor_reg->val)>>(i*8))&0xff; - } - } - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - // msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - msg->len = cnt; - cnt = 3; - err = -EAGAIN; - /* - debug_printk( "/___________/msg->addr = %x \n",msg->addr); - debug_printk( "/___________/msg->flags = %x\n",msg->flags); - debug_printk( "/___________/msg->buf = %d\n",msg->buf); - debug_printk( "/___________/msg->len = %d\n",msg->len); - debug_printk( "/___________/client->adapter = %p\n",client->adapter); - */ - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - err = 0; - goto write_end; - } else { - SENSOR_TR("write reg(0x%x, val:0x%x) failed, try to write again!",sensor_reg->reg, sensor_reg->val); - udelay(10); - } - } - - } - -write_end: - return err; -} - -/* sensor register write buffer */ -int generic_sensor_writebuf(struct i2c_client *client, char *buf, int buf_size) -{ - int err=0,cnt = 0; - struct i2c_msg msg[1]; - struct generic_sensor *sensor = to_generic_sensor(client); - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - //msg->read_type = 0; - msg->len = buf_size; - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - err = 0; - goto write_end; - } else { - SENSOR_TR("generic_sensor_writebuf failed!"); - udelay(10); - } - } - - -write_end: - return err; -} -int sensor_read_reg1val1(struct i2c_client *client, u8 reg,u8* val){ - - struct rk_sensor_reg tmp_reg; - - tmp_reg.reg_mask = 0xff; - tmp_reg.val_mask = 0xff; - tmp_reg.reg = reg; - tmp_reg.val = 0; - if(generic_sensor_read(client, &tmp_reg)==0){ - *val = (u8)(tmp_reg.val & tmp_reg.val_mask); - }else{ - return -1; - } - return 0; -} -int sensor_read_reg2val1(struct i2c_client *client, u16 reg,u8* val){ - - struct rk_sensor_reg tmp_reg; - - tmp_reg.reg_mask = 0xffff; - tmp_reg.val_mask = 0xff; - tmp_reg.reg = reg; - tmp_reg.val = 0; - if(generic_sensor_read(client, &tmp_reg)==0){ - *val = (u8)(tmp_reg.val & tmp_reg.val_mask); - }else{ - return -1; - } - return 0; -} -int sensor_read_reg2val2(struct i2c_client *client, u16 reg,u16* val){ - - struct rk_sensor_reg tmp_reg; - - tmp_reg.reg_mask = 0xffff; - tmp_reg.val_mask = 0xffff; - tmp_reg.reg = reg; - tmp_reg.val = 0; - if(generic_sensor_read(client, &tmp_reg)==0){ - *val = (u16)(tmp_reg.val & tmp_reg.val_mask); - }else{ - return -1; - } - return 0; -} -int sensor_read_reg1val2(struct i2c_client *client, u8 reg,u16* val){ - - struct rk_sensor_reg tmp_reg; - - tmp_reg.reg_mask = 0xff; - tmp_reg.val_mask = 0xffff; - tmp_reg.reg = reg; - tmp_reg.val = 0; - if(generic_sensor_read(client, &tmp_reg)==0){ - *val = (u16)(tmp_reg.val & tmp_reg.val_mask); - }else{ - return -1; - } - return 0; -} -int sensor_read_reg0val0(struct i2c_client *client, u8 reg,u16 val) -{ - struct generic_sensor *sensor = to_generic_sensor(client); - - SENSOR_TR("SENSOR_REGISTER_LEN and SENSOR_VALUE_LEN is 0, please use generic_sensor_read directly!"); - return -1; -} -/* sensor register read */ -int generic_sensor_read(struct i2c_client *client, struct rk_sensor_reg* sensor_reg) -{ - int err,cnt = 0,i,bytes; - u8 buf_reg[3]; - u8 buf_val[3]; - struct i2c_msg msg[2]; - struct generic_sensor *sensor = to_generic_sensor(client); - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - cnt=0; - for (i=2; i>=0; i--) { - if((sensor_reg->reg_mask) & (0xff<<(i*8))) { - buf_reg[cnt++] = ((sensor_reg->reg)>>(i*8))&0xff; - } - } - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf_reg; - //msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - msg[0].len = cnt; - - cnt=0; - for (i=2; i>=0; i--) { - if((sensor_reg->val_mask) & (0xff<<(i*8))) { - cnt++; - } - } - memset(buf_val,0x00,sizeof(buf_val)); - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf_val; - msg[1].len = cnt; - //msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 1; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - if (err >= 0) { - sensor_reg->val=0; - bytes = 0x00; - for (i=2; i>=0; i--) { - if((sensor_reg->val_mask) & (0xff<<(i*8))) { - sensor_reg->val |= (buf_val[bytes++]<<(i*8)); - } - } - err = 0; - goto read_end; - } else { - SENSOR_TR("read reg(0x%x val:0x%x) failed, try to read again!",sensor_reg->reg, sensor_reg->val); - udelay(10); - } - } -read_end: - return err; -} - -/* write a array of registers */ - int generic_sensor_write_array(struct i2c_client *client, struct rk_sensor_reg *regarray) -{ - int err = 0, cnt; - int i = 0; - bool streamchk; - -#if CONFIG_SENSOR_I2C_RDWRCHK - struct rk_sensor_reg check_reg; -#endif - struct generic_sensor *sensor = to_generic_sensor(client); - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - if (regarray[0].reg == SEQCMD_STREAMCHK) { - streamchk = true; - i = 1; - } else { - streamchk = false; - i = 0; - } - - cnt = 0; - while ((regarray[i].reg != SEQCMD_END) && (regarray[i].reg != SEQCMD_INTERPOLATION)) - { - if (streamchk) { - if (sensor->info_priv.stream == false) { - err = -1; - SENSOR_DG("sensor is stream off, write array terminated!"); - break; - } - } - - if((sensor->info_priv.gReg_mask != 0) /*&& (regarray[i].reg_mask != 0)*/) - regarray[i].reg_mask = sensor->info_priv.gReg_mask; - if((sensor->info_priv.gVal_mask != 0) /* && (regarray[i].val_mask != 0)*/) - regarray[i].val_mask = sensor->info_priv.gVal_mask; - err = generic_sensor_write(client, &(regarray[i])); - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("write failed current reg:0x%x, Write array again !",regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("write array failed!"); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - check_reg.reg_mask = regarray[i].reg_mask; - check_reg.val_mask = regarray[i].val_mask; - check_reg.reg = regarray[i].reg; - check_reg.val =0; - generic_sensor_read(client, &check_reg); - if (check_reg.val!= regarray[i].val) - SENSOR_TR("Reg:0x%x write(0x%x, 0x%x) fail", regarray[i].reg, regarray[i].val, check_reg.val ); - #endif - } - - i++; - } - - -sensor_write_array_end: - return err; -} -#if CONFIG_SENSOR_I2C_RDWRCHK -int generic_sensor_readchk_array(struct i2c_client *client, struct rk_sensor_reg *regarray) -{ - int cnt; - int i = 0; - struct rk_sensor_reg check_reg; - struct generic_sensor *sensor = to_generic_sensor(client); - - cnt = 0; - while (regarray[i].reg != SEQCMD_END) - { - check_reg.reg_mask = regarray[i].reg_mask; - check_reg.val_mask = regarray[i].val_mask; - check_reg.reg = regarray[i].reg; - check_reg.val =0; - generic_sensor_read(client, &check_reg); - if (check_reg.val!= regarray[i].val) - SENSOR_TR("Reg:0x%x write(0x%x, 0x%x) fail", regarray[i].reg, regarray[i].val, check_reg.val ); - - i++; - } - return 0; -} -#endif - -int generic_sensor_get_max_min_res(struct rk_sensor_sequence* res_array,int num,struct rk_sensor_seq_info * max_real_res, - struct rk_sensor_seq_info * max_res,struct rk_sensor_seq_info *min_res){ - int array_index = 0,err = 0; - - max_real_res->w = max_res->w = 0; - max_real_res->h = max_res->h =0; - min_res->w = min_res->h = 10000; - if(!res_array || num <=0){ - printk("resolution array not valid"); - err = -1; - goto get_end; - } - - //serch min_res - while(array_index data && res_array->data[0].reg != SEQCMD_END){ - if(res_array->gSeq_info.w < min_res->w ||res_array->gSeq_info.h < min_res->h){ - memcpy(min_res,&(res_array->gSeq_info),sizeof(struct rk_sensor_seq_info)); - } - if((res_array->gSeq_info.w > max_real_res->w ||res_array->gSeq_info.h > max_real_res->h) - && (res_array->data[0].reg != SEQCMD_INTERPOLATION)){ - memcpy(max_real_res,&(res_array->gSeq_info),sizeof(struct rk_sensor_seq_info)); - } - if((res_array->gSeq_info.w > max_res->w ||res_array->gSeq_info.h > max_res->h) - && (res_array->data[0].reg == SEQCMD_INTERPOLATION)){ - memcpy(max_res,&(res_array->gSeq_info),sizeof(struct rk_sensor_seq_info)); - } - } - - array_index++; - res_array++; - - } - if((max_res->w < max_real_res->w) || (max_res->h < max_real_res->h)){ - max_res->w = max_real_res->w; - max_res->h = max_real_res->h; - } - printk("min_w = %d,min_h = %d ,max_real_w = %d,max_real_h = %d,max_w = %d,max_h =%d\n", - min_res->w,min_res->h,max_real_res->w,max_real_res->h,max_res->w,max_res->h); - err = 0; -get_end: - return err; -} - - -// return value: -1 means erro; others means res_array array index -//se_w & set_h have been set to between MAX and MIN -static int sensor_try_fmt(struct i2c_client *client,unsigned int *set_w,unsigned int *set_h){ - int array_index = 0; - struct generic_sensor *sensor = to_generic_sensor(client); - struct rk_sensor_sequence* res_array = sensor->info_priv.sensor_series; - int num = sensor->info_priv.num_series; - int tmp_w = 10000,tmp_h = 10000,tmp_index = -1; - int resolution_diff_min=10000*10000,resolution_diff; - - while(array_index < num) { - if ((res_array->data) && (res_array->data[0].reg != SEQCMD_END)) { - - if(res_array->property == SEQUENCE_INIT) { - tmp_index = array_index; - array_index++; - res_array++; - continue; - } - - resolution_diff = abs(res_array->gSeq_info.w*res_array->gSeq_info.h - (*set_w)*(*set_h)); - if (resolution_diffgSeq_info.w; - tmp_h = res_array->gSeq_info.h; - tmp_index = array_index; - - resolution_diff_min = resolution_diff; - } - - } - array_index++; - res_array++; - } - *set_w = tmp_w; - *set_h = tmp_h; - //only has the init array - if((tmp_w == 10000) && (tmp_index != -1)){ - SENSOR_DG("have not other series meet the requirement except init_serie,array_index = %d", tmp_index); - *set_w = sensor->info_priv.sensor_series[tmp_index].gSeq_info.w; - *set_h = sensor->info_priv.sensor_series[tmp_index].gSeq_info.h; - goto try_end; - } - if((*set_w > sensor->info_priv.max_real_res.w) || (*set_h > sensor->info_priv.max_real_res.h)){ - SENSOR_DG("it is a interpolation resolution!(%dx%d:%dx%d)",sensor->info_priv.max_real_res.w - ,sensor->info_priv.max_real_res.h,*set_w,*set_h); - *set_w = sensor->info_priv.max_real_res.w; - *set_h = sensor->info_priv.max_real_res.h; - //find the max_real_res index - res_array = sensor->info_priv.sensor_series; - array_index = 0; - tmp_index = -1; - while(array_index < num){ - if((res_array->data) && (res_array->data[0].reg != SEQCMD_END) && (*set_w ==res_array->gSeq_info.w) && (*set_h ==res_array->gSeq_info.h)){ - if((res_array->property != SEQUENCE_INIT)){ - tmp_index = array_index; - break; - }else{ - tmp_index = array_index; - } - } - array_index++; - res_array++ ; - } - - } -try_end: - return tmp_index; -} -int generic_sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct generic_sensor *sensor = to_generic_sensor(client); - const struct rk_sensor_datafmt *fmt; - int ret = 0; - unsigned int set_w,set_h,ori_w,ori_h; - - ori_w = mf->width; - ori_h = mf->height; - - fmt = generic_sensor_find_datafmt(mf->code, sensor->info_priv.datafmt, - sensor->info_priv.num_datafmt); - if (fmt == NULL) { - fmt = &(sensor->info_priv.curfmt); - mf->code = fmt->code; - } - /* ddl@rock-chips.com : It is query max resolution only. */ - if (mf->reserved[6] == 0xfe5a) { - mf->height = sensor->info_priv.max_res.h; - mf->width = sensor->info_priv.max_res.w; - ret = 0; - SENSOR_DG("Query resolution: %dx%d", mf->width, mf->height); - - goto generic_sensor_try_fmt_end; - } - //use this to filter unsupported resolutions - if (sensor->sensor_cb.sensor_try_fmt_cb_th){ - ret = sensor->sensor_cb.sensor_try_fmt_cb_th(client, mf); - if(ret < 0) - goto generic_sensor_try_fmt_end; - } - if (mf->height > sensor->info_priv.max_res.h) - mf->height = sensor->info_priv.max_res.h; - else if (mf->height < sensor->info_priv.min_res.h) - mf->height = sensor->info_priv.min_res.h; - - if (mf->width > sensor->info_priv.max_res.w) - mf->width = sensor->info_priv.max_res.w; - else if (mf->width < sensor->info_priv.min_res.w) - mf->width = sensor->info_priv.min_res.w; - set_w = mf->width; - set_h = mf->height; - ret = sensor_try_fmt(client,&set_w,&set_h); - mf->width = set_w; - mf->height = set_h; - mf->colorspace = fmt->colorspace; - SENSOR_DG("%dx%d is the closest for %dx%d",ori_w,ori_h,set_w,set_h); -generic_sensor_try_fmt_end: - return ret; -} - -int generic_sensor_cropcap(struct v4l2_subdev *sd, struct v4l2_cropcap *cc) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct generic_sensor *sensor = to_generic_sensor(client); - - cc->bounds.left = 0; - cc->bounds.top = 0; - cc->bounds.width = sensor->info_priv.max_res.w; - cc->bounds.height = sensor->info_priv.max_res.h; - - cc->pixelaspect.denominator = sensor->info_priv.max_res.w; - cc->pixelaspect.numerator = sensor->info_priv.max_res.h; - - return 0; -} - -int generic_sensor_enum_frameintervals(struct v4l2_subdev *sd, struct v4l2_frmivalenum *fival){ - int err = 0,index_tmp; - unsigned int set_w,set_h; - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct generic_sensor *sensor = to_generic_sensor(client); - - if (fival->height > sensor->info_priv.max_res.h|| fival->width > sensor->info_priv.max_res.w){ - SENSOR_DG("this resolution(%dx%d) isn't support!", - fival->width, fival->height); - err = -1; - goto enum_frameintervals_end; - } - set_w = fival->width; - set_h = fival->height; - index_tmp = sensor_try_fmt(client,&set_w,&set_h); - fival->discrete.denominator = sensor->info_priv.sensor_series[index_tmp].gSeq_info.fps; - fival->discrete.numerator = 1000; - fival->reserved[1] = (set_w<<16)|set_h; - fival->type = V4L2_FRMIVAL_TYPE_DISCRETE; - - SENSOR_DG("%dx%d(real:%dx%d) framerate: %d", - fival->width, fival->height, - set_w, set_h, - fival->discrete.denominator); -enum_frameintervals_end: - return err; -} - -static enum hrtimer_restart generic_flash_off_func(struct hrtimer *timer){ - struct rk_flash_timer *fps_timer = container_of(timer, struct rk_flash_timer, timer); - - generic_sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - return 0; -} -/* Find a data format by a pixel code in an array */ -static const struct rk_sensor_datafmt *generic_sensor_find_datafmt( - u32 code, const struct rk_sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} -int generic_sensor_softreset(struct i2c_client *client, struct rk_sensor_reg *series) { - int ret = 0; - struct generic_sensor *sensor = to_generic_sensor(client); - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - debug_printk( "/___________/client->addr = %x \n",client->addr); - - if (sensor->sensor_cb.sensor_softreset_cb) - sensor->sensor_cb.sensor_softreset_cb(client,series); - debug_printk( "/~~~~~~~~~~~~/ %s:%i-------%s()client = %p\n", __FILE__, __LINE__,__FUNCTION__,client); - /* soft reset */ - ret = generic_sensor_write_array(client,series); - if (ret != 0) { - SENSOR_TR("soft reset failed\n"); - ret = -ENODEV; - } - msleep(1); - return ret; - -} -int generic_sensor_check_id(struct i2c_client *client, struct rk_sensor_reg *series) -{ - int ret,pid = 0,i; - struct generic_sensor *sensor = to_generic_sensor(client); - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - if (sensor->sensor_cb.sensor_check_id_cb) - pid = sensor->sensor_cb.sensor_check_id_cb(client,series); - - /* check if it is an sensor sensor */ - while (series->reg != SEQCMD_END) { - - pid <<= 8; - - if (sensor->info_priv.gReg_mask != 0x00) - series->reg_mask = sensor->info_priv.gReg_mask; - if (sensor->info_priv.gVal_mask != 0x00) - series->val_mask = sensor->info_priv.gVal_mask; - - ret = generic_sensor_read(client, series); - if (ret != 0) { - SENSOR_TR("read chip id failed"); - ret = -ENODEV; - goto check_end; - } - - pid |= series->val; - series++; - } - - SENSOR_DG("pid = 0x%x", pid); - - for (i=0; iinfo_priv.chip_id_num; i++) { - if (pid == sensor->info_priv.chip_id[i]) { - sensor->model = sensor->info_priv.chip_ident; - break; - } - } - - if (sensor->model != sensor->info_priv.chip_ident) { - SENSOR_TR("error: mismatched pid = 0x%x\n", pid); - ret = -ENODEV; - goto check_end; - } else { - ret = 0; - } - -check_end: - return ret; -} - -int generic_sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_desc *desc = to_soc_camera_desc(icd); - struct rk29camera_platform_data *pdata = desc->subdev_desc.drv_priv; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct generic_sensor *sensor = to_generic_sensor(client); - int ret = 0; - - SENSOR_DG("%s cmd(%d) on(%d)\n",__FUNCTION__,cmd,on); - switch (cmd) - { - case Sensor_Power: - { - //if (icl->power) { - if(desc->subdev_desc.power) { - ret = desc->subdev_desc.power(icd->pdev, on); - } else { - SENSOR_TR("haven't power callback"); - ret = -EINVAL; - } - break; - } - case Sensor_PowerDown: - { - //if (icl->powerdown) { - if(desc->subdev_desc.powerdown) { - ret = desc->subdev_desc.powerdown(icd->pdev, on); - } else { - SENSOR_TR("haven't power down callback"); - ret = -EINVAL; - } - break; - } - case Sensor_Flash: - { - if (pdata && pdata->sensor_ioctrl) { - pdata->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on==Flash_On){ - mdelay(5); - //flash off after 2 secs - hrtimer_cancel(&(sensor->flash_off_timer.timer)); - hrtimer_start(&(sensor->flash_off_timer.timer),ktime_set(0, 2000*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s cmd(%d) is unknown!",__FUNCTION__,cmd); - break; - } - } - - return ret; -} -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl){ - return 0; -} -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl){ - return 0; -} -int generic_sensor_init(struct v4l2_subdev *sd, u32 val) -{ - int ret = 0; - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_subdev_desc *ssdd = client->dev.platform_data; - struct soc_camera_device *icd = ssdd->socdev; - struct generic_sensor *sensor = to_generic_sensor(client); - int array_index = 0; - int num = sensor->info_priv.num_series; - struct soc_camera_desc *desc = to_soc_camera_desc(icd); - struct rk29camera_platform_data *pdata = desc->subdev_desc.drv_priv; - struct rkcamera_platform_data *sensor_device=NULL,*new_camera; - - new_camera = pdata->register_dev_new; - while(new_camera != NULL){ - if (strcmp(dev_name(icd->pdev), new_camera->dev_name) == 0) { - sensor_device = new_camera; - break; - } - new_camera = new_camera->next_camera; - } - - /* ddl@rock-chips.com : i2c speed is config in new_camera_device_ex macro */ - if (sensor_device) { - sensor->info_priv.mirror = sensor_device->mirror; - } - - if (((sensor_device!=NULL) && Sensor_HasBeen_PwrOff(sensor_device->pwdn_info)) - || (sensor_device == NULL)) { - - //softreset callback - - debug_printk( "/~~~~~~~~~~~~/ %s:%i-------%s()client->adapter = %p\n", __FILE__, __LINE__,__FUNCTION__,client->adapter); - ret = generic_sensor_softreset(client,sensor->info_priv.sensor_SfRstSeqe); - if(ret != 0){ - SENSOR_TR("soft reset failed!"); - goto sensor_INIT_ERR; - } - - while(array_index < num){ - if(sensor->info_priv.sensor_series[array_index].property == SEQUENCE_INIT) - break; - array_index++; - } - if(generic_sensor_write_array(client, sensor->info_priv.sensor_series[array_index].data)!=0){ - SENSOR_TR("write init array failed!"); - ret = -1; - goto sensor_INIT_ERR; - } - if (sensor_device!=NULL) { - sensor_device->pwdn_info &= 0xfe; - if (sensor->sensor_cb.sensor_mirror_cb) - sensor->sensor_cb.sensor_mirror_cb(client, sensor->info_priv.mirror&0x01); - if (sensor->sensor_cb.sensor_flip_cb) - sensor->sensor_cb.sensor_flip_cb(client, sensor->info_priv.mirror&0x02); - } - sensor->info_priv.winseqe_cur_addr = sensor->info_priv.sensor_series + array_index; - - //set focus status ,init focus - sensor->sensor_focus.focus_state = FocusState_Inval; - sensor->sensor_focus.focus_mode = WqCmd_af_invalid; - sensor->sensor_focus.focus_delay = WqCmd_af_invalid; - - } - - if (sensor->sensor_cb.sensor_activate_cb) - sensor->sensor_cb.sensor_activate_cb(client); - - - if (sensor->flash_off_timer.timer.function==NULL) - sensor->flash_off_timer.timer.function = generic_flash_off_func; - - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - if(sensor->sensor_cb.sensor_deactivate_cb) - sensor->sensor_cb.sensor_deactivate_cb(client); - return ret; -} - int generic_sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -unsigned long generic_sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_desc *desc = to_soc_camera_desc(icd); - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct generic_sensor *sensor = to_generic_sensor(client); - struct v4l2_mbus_config cfg; - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - cfg.flags = sensor->info_priv.bus_parameter; - return soc_camera_apply_board_flags(&(desc->subdev_desc), &cfg); -} - -int generic_sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_subdev_desc *ssdd = client->dev.platform_data; - struct soc_camera_device *icd = ssdd->socdev; - struct generic_sensor *sensor = to_generic_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.curfmt.code; - mf->colorspace = sensor->info_priv.curfmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} - -int generic_sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_subdev_desc *ssdd = client->dev.platform_data; - struct soc_camera_device *icd = ssdd->socdev; - const struct rk_sensor_datafmt *fmt=NULL; - struct generic_sensor *sensor = to_generic_sensor(client); - struct rk_sensor_sequence *winseqe_set_addr=NULL; - struct sensor_v4l2ctrl_info_s *v4l2ctrl_info=NULL; - /* ddl@rock-chips.com : v0.1.5 */ - bool is_capture = (mf->reserved[0] == 0xfe5a) ? true : false; - int ret=0; - - fmt =generic_sensor_find_datafmt(mf->code, sensor->info_priv.datafmt, - sensor->info_priv.num_datafmt); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - // get the proper series and write the array - ret =generic_sensor_try_fmt(sd, mf); - winseqe_set_addr = sensor->info_priv.sensor_series+ret; - - ret = 0; - if (sensor->sensor_cb.sensor_s_fmt_cb_th) - ret |= sensor->sensor_cb.sensor_s_fmt_cb_th(client, mf, is_capture); - - v4l2ctrl_info = sensor_find_ctrl(sensor->ctrls,V4L2_CID_FLASH); /* ddl@rock-chips.com: v0.1.3 */ - if (v4l2ctrl_info!=NULL) { - if (is_capture) { - if ((v4l2ctrl_info->cur_value == 2) || (v4l2ctrl_info->cur_value == 1)) { - generic_sensor_ioctrl(icd, Sensor_Flash, 1); - } - } else { - generic_sensor_ioctrl(icd, Sensor_Flash, 0); - } - } - - if(sensor->info_priv.winseqe_cur_addr->data != winseqe_set_addr->data){ - ret |= generic_sensor_write_array(client, winseqe_set_addr->data); - if (ret != 0) { - SENSOR_TR("set format capability failed"); - goto sensor_s_fmt_end; - } - - if (sensor->sensor_cb.sensor_s_fmt_cb_bh) - ret |= sensor->sensor_cb.sensor_s_fmt_cb_bh(client, mf, is_capture); - sensor->info_priv.winseqe_cur_addr = winseqe_set_addr; - SENSOR_DG("Sensor output is changed to %dx%d",winseqe_set_addr->gSeq_info.w,winseqe_set_addr->gSeq_info.h); - } else { - SENSOR_DG("Sensor output is still %dx%d",winseqe_set_addr->gSeq_info.w,winseqe_set_addr->gSeq_info.h); - } - -//video or capture special process -sensor_s_fmt_end: - Sensor_CropSet(mf,sensor->crop_percent); /* ddl@rock-chips.com: v0.1.b */ - return ret; -} - -int generic_sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct generic_sensor *sensor = to_generic_sensor(client); - struct sensor_v4l2ctrl_info_s *ctrl_info; - struct v4l2_ext_control ext_ctrl; - struct soc_camera_subdev_desc *ssdd = client->dev.platform_data; - struct soc_camera_device *icd = ssdd->socdev; - int ret = 0; - - ctrl_info = sensor_find_ctrl(sensor->ctrls,ctrl->id); - if (!ctrl_info) { - SENSOR_TR("v4l2_control id(0x%x) is invalidate",ctrl->id); - ret = -EINVAL; - } else { - ext_ctrl.value = ctrl->value; - ext_ctrl.id = ctrl->id; - - ctrl->value = ctrl_info->cur_value; - - if (ctrl_info->cb) { - ret = (ctrl_info->cb)(icd,ctrl_info, &ext_ctrl,false); - if(ret == 0) - ctrl->value = ctrl_info->cur_value; - } else { - SENSOR_TR("v4l2_control id(0x%x) callback isn't exist",ctrl->id); - ret = -EINVAL; - } - } - - return ret; -} - -int generic_sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct generic_sensor *sensor = to_generic_sensor(client); - struct soc_camera_subdev_desc *ssdd = client->dev.platform_data; - struct soc_camera_device *icd = ssdd->socdev; - struct sensor_v4l2ctrl_info_s *ctrl_info; - struct v4l2_ext_control ext_ctrl; - int ret = 0; - - ctrl_info = sensor_find_ctrl(sensor->ctrls, ctrl->id); - if (!ctrl_info) { - SENSOR_DG("v4l2_control id(0x%x) is invalidate", ctrl->id); - ret = -EINVAL; - } else { - ext_ctrl.id = ctrl->id; - ext_ctrl.value = ctrl->value; - - if (ctrl_info->cb) { - ret = ctrl_info->cb(icd, ctrl_info, &ext_ctrl, true); - } else { - SENSOR_TR("v4l2_control id(0x%x) callback isn't exist", - ctrl->id); - ret = -EINVAL; - } - } - - return ret; -} - -int generic_sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct generic_sensor *sensor = to_generic_sensor(client); - struct sensor_v4l2ctrl_info_s *ctrl_info; - int ret = 0; - - ctrl_info = sensor_find_ctrl(sensor->ctrls,ext_ctrl->id); - if (!ctrl_info) { - SENSOR_TR("v4l2_control id(0x%x) is invalidate",ext_ctrl->id); - ret = -EINVAL; - } else { - ext_ctrl->value = ctrl_info->cur_value; - if (ctrl_info->cb) { - ret = (ctrl_info->cb)(icd,ctrl_info, ext_ctrl,false); - } else { - SENSOR_TR("v4l2_control id(0x%x) callback isn't exist",ext_ctrl->id); - ret = -EINVAL; - } - - } - - return ret; -} - -int generic_sensor_s_ext_control(struct soc_camera_device *icd, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct generic_sensor *sensor = to_generic_sensor(client); - struct sensor_v4l2ctrl_info_s *ctrl_info; - int ret = 0; - - ctrl_info = sensor_find_ctrl(sensor->ctrls, ext_ctrl->id); - if (!ctrl_info) { - SENSOR_DG("v4l2_ext_control id(0x%x) is invalidate", - ext_ctrl->id); - ret = -EINVAL; - } else { - if (ctrl_info->cb) { - ret = ctrl_info->cb(icd, ctrl_info, ext_ctrl, true); - } else { - SENSOR_TR("v4l2_ext_control id(0x%x) callback isn't exist", - ext_ctrl->id); - ret = -EINVAL; - } - } - - return 0; -} - int generic_sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) - { - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_subdev_desc *ssdd = client->dev.platform_data; - struct soc_camera_device *icd = ssdd->socdev; - int i, error_cnt=0, error_idx=-1; - - for (i=0; icount; i++) { - if (generic_sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } - } -int generic_sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_subdev_desc *ssdd = client->dev.platform_data; - struct soc_camera_device *icd = ssdd->socdev; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - - if (generic_sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - - -long generic_sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_subdev_desc *ssdd = client->dev.platform_data; - struct soc_camera_device *icd = ssdd->socdev; - struct generic_sensor*sensor = to_generic_sensor(client); - int ret = 0; - int i; - bool flash_attach=false; - struct rkcamera_platform_data *new_camera; - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - SENSOR_DG("%s cmd: 0x%x ",__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - if(sensor->sensor_cb.sensor_deactivate_cb) - sensor->sensor_cb.sensor_deactivate_cb(client); - break; - } - - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - sensor->sensor_gpio_res = NULL; - - } else { - SENSOR_TR("RK29_CAM_SUBDEV_IOREQUEST fail"); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash) { - flash_attach = false; - } else { - flash_attach = true; - } - } - - new_camera = sensor->sensor_io_request->register_dev_new; - while(new_camera != NULL){ - if (strcmp(dev_name(icd->pdev), new_camera->dev_name) == 0) { - if (new_camera->flash){ - flash_attach = true; - } else { - flash_attach = false; - } - break; - } - new_camera = new_camera->next_camera; - } - - if (flash_attach==false) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - sensor->sensor_controls[i].id |= 0x80000000; - } - } - } else { - for (i = 0; i < icd->ops->num_controls; i++) { - if(V4L2_CID_FLASH == (icd->ops->controls[i].id&0x7fffffff)){ - sensor->sensor_controls[i].id &= 0x7fffffff; - } - } - } - break; - } - - case RK29_CAM_SUBDEV_GET_INTERFACE: - { - memcpy(arg, &sensor->info_priv.dev_sig_cnf, - sizeof(sensor->info_priv.dev_sig_cnf)); - SENSOR_DG("%s ioctl get src fmt: %s", __func__, - (char *)arg); - break; - } - default: - { - SENSOR_DG("%s cmd(0x%x) is unknown !\n",__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; -} - -int generic_sensor_s_power(struct v4l2_subdev *sd, int on) -{ - - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_subdev_desc *ssdd = client->dev.platform_data; - struct soc_camera_device *icd = ssdd->socdev; - struct generic_sensor*sensor = to_generic_sensor(client); - int ret = 0; - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - if(on) - { - ret = soc_camera_power_on(icd->pdev, ssdd, NULL); - if(ret < 0) - SENSOR_TR("%s(%d)power_on fail !\n",__FUNCTION__,__LINE__); - - } - else - { - - v4l2_subdev_call(sd, core, ioctl, RK29_CAM_SUBDEV_DEACTIVATE,NULL); - soc_camera_power_off(icd->pdev, ssdd, NULL); - if(ret < 0) - SENSOR_TR("%s(%d)power_off fail !\n",__FUNCTION__,__LINE__); - - } - return ret; -} - - - -int generic_sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - u32 *code) -{ - - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct generic_sensor*sensor = to_generic_sensor(client); - if (index >= sensor->info_priv.num_datafmt) - return -EINVAL; - - *code = sensor->info_priv.datafmt[index].code; - return 0; -} - static void sensor_af_workqueue(struct work_struct *work) -{ - struct rk_sensor_focus_work *sensor_work = container_of(work, struct rk_sensor_focus_work, dwork.work); - struct i2c_client *client = sensor_work->client; - struct soc_camera_subdev_desc *ssdd = client->dev.platform_data; - struct soc_camera_device *icd = ssdd->socdev; - struct generic_sensor*sensor = to_generic_sensor(client); - int zone_tm_pos[4]; - int ret = 0; - - SENSOR_DG("%s Enter, cmd:0x%x",__FUNCTION__,sensor_work->cmd); - - switch (sensor_work->cmd) - { - case WqCmd_af_init: - { - if (sensor->sensor_focus.focus_state == FocusState_Inval) { - if(sensor->sensor_focus.focus_cb.sensor_focus_init_cb !=NULL) { - ret = (sensor->sensor_focus.focus_cb.sensor_focus_init_cb)(client); - } - if (ret < 0) { - SENSOR_TR("WqCmd_af_init is failed in sensor_af_workqueue!"); - } else { - if(sensor->sensor_focus.focus_delay != WqCmd_af_invalid) { - generic_sensor_af_workqueue_set(icd,sensor->sensor_focus.focus_delay,0,false); - sensor->sensor_focus.focus_delay = WqCmd_af_invalid; - } - sensor->sensor_focus.focus_state = FocusState_Inited; - sensor_work->result = WqRet_success; - } - } else { - sensor_work->result = WqRet_success; - SENSOR_DG("sensor af have been inited, WqCmd_af_init is ignore!"); - } - break; - } - case WqCmd_af_single: - { - if(sensor->sensor_focus.focus_cb.sensor_af_single_cb!=NULL){ - ret = (sensor->sensor_focus.focus_cb.sensor_af_single_cb)(client); - } - if (ret < 0) { - SENSOR_TR("%s Sensor_af_single is failed in sensor_af_workqueue!",SENSOR_NAME_STRING()); - sensor_work->result = WqRet_fail; - } else { - sensor_work->result = WqRet_success; - } - break; - } - case WqCmd_af_near_pos: - { - if(sensor->sensor_focus.focus_cb.sensor_af_near_cb!=NULL){ - ret = (sensor->sensor_focus.focus_cb.sensor_af_near_cb)(client); - } - if (ret < 0) - sensor_work->result = WqRet_fail; - else{ - sensor_work->result = WqRet_success; - } - break; - } - case WqCmd_af_far_pos: - { - if(sensor->sensor_focus.focus_cb.sensor_af_far_cb!=NULL){ - ret = (sensor->sensor_focus.focus_cb.sensor_af_far_cb)(client); - } - if (ret < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_special_pos: - { - if(sensor->sensor_focus.focus_cb.sensor_af_specialpos_cb!=NULL){ - ret = (sensor->sensor_focus.focus_cb.sensor_af_specialpos_cb)(client,sensor_work->var); - } - if (ret < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_continues: - { - if(sensor->sensor_focus.focus_cb.sensor_af_const_cb!=NULL){ - ret = (sensor->sensor_focus.focus_cb.sensor_af_const_cb)(client); - } - if (ret < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_continues_pause: - { - if(sensor->sensor_focus.focus_cb.sensor_af_const_pause_cb!=NULL){ - ret = (sensor->sensor_focus.focus_cb.sensor_af_const_pause_cb)(client); - } - if (ret < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_update_zone: - { - mutex_lock(&sensor->sensor_focus.focus_lock); - zone_tm_pos[0] = sensor->sensor_focus.focus_zone.lx; - zone_tm_pos[1] = sensor->sensor_focus.focus_zone.ty; - zone_tm_pos[2] = sensor->sensor_focus.focus_zone.rx; - zone_tm_pos[3] = sensor->sensor_focus.focus_zone.dy; - mutex_unlock(&sensor->sensor_focus.focus_lock); - - if(sensor->sensor_focus.focus_cb.sensor_af_zoneupdate_cb!=NULL){ - ret = (sensor->sensor_focus.focus_cb.sensor_af_zoneupdate_cb)(client,zone_tm_pos); - } - if (ret < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_close: - { - if(sensor->sensor_focus.focus_cb.sensor_af_close_cb!=NULL){ - ret = (sensor->sensor_focus.focus_cb.sensor_af_close_cb)(client); - } - if (ret < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - default: - SENSOR_TR("Unknow command(%d) in %s af workqueue!",sensor_work->cmd,SENSOR_NAME_STRING()); - break; - } - -//set_end: - if (sensor_work->wait == false) { - kfree((void*)sensor_work); - } else { - wake_up(&sensor_work->done); - } - return; -} - - int generic_sensor_af_workqueue_set(struct soc_camera_device *icd, enum rk_sensor_focus_wq_cmd cmd, int var, bool wait) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct generic_sensor*sensor = to_generic_sensor(client); - struct rk_sensor_focus_work *wk; - int ret=0; - - if (sensor->sensor_focus.sensor_wq == NULL) { - ret = -EINVAL; - goto sensor_af_workqueue_set_end; - } - - wk = kzalloc(sizeof(struct rk_sensor_focus_work), GFP_KERNEL); - if (wk) { - wk->client = client; - INIT_DELAYED_WORK(&wk->dwork, sensor_af_workqueue); - wk->cmd = cmd; - wk->result = WqRet_inval; - wk->wait = wait; - wk->var = var; - init_waitqueue_head(&wk->done); - - SENSOR_DG("generic_sensor_af_workqueue_set: cmd: %d",cmd); - - /* ddl@rock-chips.com: - * video_lock is been locked in v4l2_ioctl function, but auto focus may slow, - * As a result any other ioctl calls will proceed very, very slowly since each call - * will have to wait for the AF to finish. Camera preview is pause,because VIDIOC_QBUF - * and VIDIOC_DQBUF is sched. so unlock video_lock here. - */ - if (wait == true) { - queue_delayed_work(sensor->sensor_focus.sensor_wq,&(wk->dwork),0); - mutex_unlock(&icd->video_lock); - if (wait_event_timeout(wk->done, (wk->result != WqRet_inval), msecs_to_jiffies(5000)) == 0) { - SENSOR_TR("af cmd(%d) is timeout!",cmd); - } - flush_workqueue(sensor->sensor_focus.sensor_wq); - ret = wk->result; - kfree((void*)wk); - mutex_lock(&icd->video_lock); - } else { - queue_delayed_work(sensor->sensor_focus.sensor_wq,&(wk->dwork),msecs_to_jiffies(10)); - } - } else { - SENSOR_TR("af cmd(%d) ingore,because struct sensor_work malloc failed!",cmd); - ret = -1; - } -sensor_af_workqueue_set_end: - return ret; -} - - -int generic_sensor_s_stream(struct v4l2_subdev *sd, int enable) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct generic_sensor *sensor = to_generic_sensor(client); - struct soc_camera_subdev_desc *ssdd = client->dev.platform_data; - struct soc_camera_device *icd = ssdd->socdev; - - SENSOR_DG("s_stream: %d %d",enable,sensor->sensor_focus.focus_state); - if (enable == 1) { - if(sensor->sensor_cb.sensor_s_stream_cb){ - sensor->sensor_cb.sensor_s_stream_cb(sd,enable); - } - sensor->info_priv.stream = true; - if (sensor->sensor_focus.sensor_wq) { - if (sensor->sensor_focus.focus_state == FocusState_Inval) { - generic_sensor_af_workqueue_set(icd, WqCmd_af_init, 0, false); - } - } - } else if (enable == 0) { - sensor->info_priv.stream = false; - if(sensor->sensor_cb.sensor_s_stream_cb){ - sensor->sensor_cb.sensor_s_stream_cb(sd,enable); - } - - if (sensor->sensor_focus.sensor_wq) - flush_workqueue(sensor->sensor_focus.sensor_wq); - - } - return 0; -} - -int generic_sensor_enum_framesizes(struct v4l2_subdev *sd, struct v4l2_frmsizeenum *fsize){ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct generic_sensor *sensor = to_generic_sensor(client); - - if(sensor->sensor_cb.sensor_enum_framesizes){ - return sensor->sensor_cb.sensor_enum_framesizes(sd,fsize); - }else{ - return -1; - } - -} - -static inline int deinit_sensor_gpio(int pltfrm_gpio) -{ - struct rk29_camera_gpio *camera_gpio; - - list_for_each_entry(camera_gpio, &camera_gpios.gpios, gpios) - if (camera_gpio->pltfrm_gpio == pltfrm_gpio) - break; - - if (camera_gpio->pltfrm_gpio == pltfrm_gpio) { - camera_gpio->count--; - - if (!camera_gpio->count) { - gpiod_direction_input(camera_gpio->gpio_desc); - gpiod_put(camera_gpio->gpio_desc); - - list_del(&camera_gpio->gpios); - kfree(camera_gpio); - } - } - - return 0; -} - -void deinit_sensor_gpios(struct soc_camera_device *icd) -{ - struct soc_camera_desc *desc = to_soc_camera_desc(icd); - struct rk29camera_platform_data *pdata = desc->subdev_desc.drv_priv; - struct rkcamera_platform_data *sensor_device = NULL, *new_camera; - struct rk29camera_gpio_res *gpios = NULL; - - new_camera = pdata->register_dev_new; - while (new_camera) { - if (strcmp(dev_name(icd->pdev), new_camera->dev_name) == 0) { - sensor_device = new_camera; - break; - } - new_camera = new_camera->next_camera; - } - if (!sensor_device) { - pr_err("%s(%d): Could not find %s\n", - __func__, __LINE__, dev_name(icd->pdev)); - return; - } - - gpios = &new_camera->io; - - deinit_sensor_gpio(gpios->power); - deinit_sensor_gpio(gpios->powerdown); - deinit_sensor_gpio(gpios->reset); - deinit_sensor_gpio(gpios->af); - deinit_sensor_gpio(gpios->flash); - deinit_sensor_gpio(gpios->irq); - gpios->gpio_power = NULL; - gpios->gpio_powerdown = NULL; - gpios->gpio_reset = NULL; - gpios->gpio_af = NULL; - gpios->gpio_flash = NULL; - gpios->gpio_irq = NULL; - gpios->power = INVALID_GPIO; - gpios->powerdown = INVALID_GPIO; - gpios->reset = INVALID_GPIO; - gpios->af = INVALID_GPIO; - gpios->flash = INVALID_GPIO; - gpios->irq = INVALID_GPIO; -} - diff --git a/drivers/media/video/generic_sensor.h b/drivers/media/video/generic_sensor.h deleted file mode 100644 index 530435a6d6bb..000000000000 --- a/drivers/media/video/generic_sensor.h +++ /dev/null @@ -1,1394 +0,0 @@ -/* - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#ifndef __ASM_ARCH_GENERIC_SENSOR_RK_H_ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "../../soc/rockchip/rk_camera.h" -/* Camera Sensor driver */ - -#define MIN(x, y) ((x < y) ? x : y) -#define MAX(x, y) ((x > y) ? x : y) - -#define SENSOR_TR(format, ...) printk(KERN_ERR "%s(%d): " format"\n", SENSOR_NAME_STRING(), __LINE__, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, "%s(%d): "format"\n", SENSOR_NAME_STRING(), __LINE__, ## __VA_ARGS__) - -/* - *to generic sensor - *a represents a i2c_client type point - */ -#define to_generic_sensor(a) (container_of(i2c_get_clientdata(a), struct generic_sensor, subdev)) - -/* - *to specific sensor - *a represents a generic_sensor type point - */ -#define to_specific_sensor(a) (container_of(a, struct specific_sensor, common_sensor)) - -/* Redefine this macro in sensor driver if user want to crop */ -#define SENSOR_CROP_PERCENT 0 - -#define SENSOR_INIT_IS_ERR (0x00 << 28) -#define SENSOR_INIT_IS_OK (0x01 << 28) - -#define SEQCMD_STREAMCHK 0xFA000000 -#define SEQCMD_INVALIDATE 0xFB000000 -#define SEQCMD_INTERPOLATION 0xFC000000 -#define SEQCMD_WAIT_MS 0xFD000000 -#define SEQCMD_WAIT_US 0xFE000000 -#define SEQCMD_END 0xFF000000 - -#define SensorReg0Val0(a, b) {SEQCMD_INVALIDATE, 0, 0, 0} -#define SensorReg1Val1(a, b) {a, b, 0xff, 0xff} -#define SensorReg2Val1(a, b) {a, b, 0xffff, 0xff} -#define SensorReg2Val2(a, b) {a, b, 0xffff, 0xffff} - -#define SensorStreamChk {SEQCMD_STREAMCHK, 0, 0, 0} -#define SensorWaitMs(a) {SEQCMD_WAIT_MS, a, 0x00, 0x00} -#define SensorWaitUs(a) {SEQCMD_WAIT_US, a, 0x00, 0x00} -#define SensorEnd {SEQCMD_END, 0x00, 0x00, 0x00} - -#define CFG_WhiteBalance BIT(0) -#define CFG_Brightness BIT(1) -#define CFG_Contrast BIT(2) -#define CFG_Saturation BIT(3) -#define CFG_Effect BIT(4) -#define CFG_Scene BIT(5) -#define CFG_DigitalZoom BIT(6) -#define CFG_Focus BIT(7) -#define CFG_FocusContinues BIT(8) -#define CFG_FocusZone BIT(9) -#define CFG_FocusRelative BIT(10) -#define CFG_FocusAbsolute BIT(11) -#define CFG_FACE_DETECT BIT(12) -#define CFG_Exposure BIT(13) -#define CFG_Flash BIT(14) -#define CFG_Mirror BIT(15) -#define CFG_Flip BIT(16) - -#define CFG_FunChk(a, b) ((a & b) == b) -#define CFG_FunDis(a, b) (a &= (~b)) - -extern struct rk29_camera_gpio camera_gpios; - -enum rk_sensor_sequence_property { - SEQUENCE_INIT = 1, - SEQUENCE_PREVIEW, - SEQUENCE_CAPTURE -}; - -struct rk_sensor_reg { - unsigned int reg; - unsigned int val; - unsigned int reg_mask; - unsigned int val_mask; -}; - -struct rk_sensor_seq_info { - unsigned short w; - unsigned short h; - unsigned short fps; -}; - -struct rk_sensor_sequence { - struct rk_sensor_seq_info gSeq_info; - enum rk_sensor_sequence_property property; - struct rk_sensor_reg *data; -}; - -/* only one fixed colorspace per pixelcode */ -struct rk_sensor_datafmt { - u32 code; - enum v4l2_colorspace colorspace; -}; - -/* focus work */ -enum rk_sensor_focus_wq_cmd { - WqCmd_af_invalid = -1, - WqCmd_af_init = 1, - WqCmd_af_single, - WqCmd_af_continues, - WqCmd_af_continues_pause, /* ddl@rock-chips.com: v0.1.1 */ - WqCmd_af_update_zone, - WqCmd_af_close, - WqCmd_af_special_pos, - WqCmd_af_near_pos, - WqCmd_af_far_pos -}; - -enum rk_sensor_focus_sensor_wq_result { - WqRet_success = 0, - WqRet_fail = -1, - WqRet_inval = -2 -}; - -enum rk_sensor_focus_state { - FocusState_Inval, - FocusState_Inited -}; - -struct rk_sensor_focus_work { - struct i2c_client *client; - struct delayed_work dwork; - enum rk_sensor_focus_wq_cmd cmd; - wait_queue_head_t done; - enum rk_sensor_focus_sensor_wq_result result; - bool wait; - int var; -}; - -/* focus structs */ -struct rk_sensor_focus_cb { - int (*sensor_focus_init_cb)(struct i2c_client *client); - int (*sensor_af_single_cb)(struct i2c_client *client); - int (*sensor_af_const_cb)(struct i2c_client *client); - int (*sensor_af_const_pause_cb)(struct i2c_client *client); - int (*sensor_af_zoneupdate_cb)(struct i2c_client *client, int *zone_tm_pos); - int (*sensor_af_close_cb)(struct i2c_client *client); - int (*sensor_af_near_cb)(struct i2c_client *client); - int (*sensor_af_far_cb)(struct i2c_client *client); - int (*sensor_af_specialpos_cb)(struct i2c_client *client, int pos); - -}; - -/* zone from hal is [-1000,-1000,1000,1000],must map to sensor's zone. */ -struct rk_sensor_focus_zone { - int lx; - int ty; - int rx; - int dy; -}; - -struct rk_sensor_focus_op_s { - struct rk_sensor_focus_cb focus_cb; - struct workqueue_struct *sensor_wq; - struct mutex focus_lock; - unsigned int focus_state; - unsigned int focus_mode; /*show the focus mode*/ - struct rk_sensor_focus_zone focus_zone; - enum rk_sensor_focus_wq_cmd focus_delay; -}; - -typedef struct rk_sensor_priv_s { - int mirror; - bool snap2preview; - bool video2preview; - struct rk_sensor_sequence *winseqe_cur_addr; - struct rk_sensor_datafmt *datafmt; - int num_datafmt; - struct rk_sensor_datafmt curfmt; - unsigned int funmodule_state; - - struct rk_sensor_sequence *sensor_series; - int num_series; - - struct rk_sensor_reg *sensor_SfRstSeqe; - struct rk_sensor_reg *sensor_CkIdSeqe; - - struct rk_sensor_seq_info max_res;/*maybe interploted*/ - struct rk_sensor_seq_info max_real_res; - struct rk_sensor_seq_info min_res; - unsigned long bus_parameter; - unsigned int *chip_id; - unsigned int chip_id_num; - int chip_ident; - unsigned int gReg_mask; - unsigned int gVal_mask; - struct rk_camera_device_signal_config dev_sig_cnf; - struct dentry *debugfs_dir; - int video_state; - bool stream; -} rk_sensor_info_priv_t; - -struct sensor_v4l2ctrl_info_s { - struct v4l2_queryctrl *qctrl; - int (*cb)(struct soc_camera_device *icd, - struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl, - bool is_set); - struct rk_sensor_reg **sensor_Seqe; - int cur_value; - int num_ctrls; -}; - -struct sensor_v4l2ctrl_usr_s { - struct v4l2_queryctrl qctrl; - int (*cb)(struct soc_camera_device *icd, - struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl, - bool is_set); - struct rk_sensor_reg **sensor_Seqe; -}; - -struct sensor_ops_cb_s { - int (*sensor_softreset_cb)(struct i2c_client *client, struct rk_sensor_reg *series); - int (*sensor_check_id_cb)(struct i2c_client *client, struct rk_sensor_reg *series); - int (*sensor_activate_cb)(struct i2c_client *client); - int (*sensor_deactivate_cb)(struct i2c_client *client); - int (*sensor_mirror_cb)(struct i2c_client *client, int mirror); - int (*sensor_flip_cb)(struct i2c_client *client, int flip); - int (*sensor_face_detect_cb)(struct i2c_client *client, int on); - - int (*sensor_s_fmt_cb_th)(struct i2c_client *client, struct v4l2_mbus_framefmt *mf, bool capture); - int (*sensor_s_fmt_cb_bh)(struct i2c_client *client, struct v4l2_mbus_framefmt *mf, bool capture); - int (*sensor_try_fmt_cb_th)(struct i2c_client *client, struct v4l2_mbus_framefmt *mf); - int (*sensor_s_stream_cb)(struct v4l2_subdev *sd, int enable); - int (*sensor_enum_framesizes)(struct v4l2_subdev *sd, struct v4l2_frmsizeenum *fsize); -}; - -/*flash off in fixed time to prevent from too hot , zyc */ -struct rk_flash_timer { - struct soc_camera_device *icd; - struct hrtimer timer; -}; - -struct rk_state_check_work { - struct workqueue_struct *state_check_wq; - struct delayed_work work; -}; - -struct generic_sensor { - char dev_name[32]; - struct v4l2_subdev subdev; - struct i2c_client *client; - rk_sensor_info_priv_t info_priv; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ - - int crop_percent; - int irq; - struct rk_state_check_work state_check_work; - int channel_id; - - bool is_need_tasklock; - atomic_t tasklock_cnt; - struct soc_camera_ops *sensor_ops; - struct v4l2_queryctrl *sensor_controls; - struct sensor_v4l2ctrl_info_s *ctrls; - struct rk_flash_timer flash_off_timer; - struct sensor_ops_cb_s sensor_cb; - struct rk_sensor_focus_op_s sensor_focus; - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -extern int generic_sensor_softreset(struct i2c_client *client, struct rk_sensor_reg *series); -extern int generic_sensor_check_id(struct i2c_client *client, struct rk_sensor_reg *series); -extern int sensor_write_reg2val1(struct i2c_client *client, u16 reg, u8 val); -extern int sensor_write_reg2val2(struct i2c_client *client, u16 reg, u16 val); -extern int sensor_write_reg1val1(struct i2c_client *client, u8 reg, u8 val); -extern int sensor_write_reg1val2(struct i2c_client *client, u8 reg, u16 val); -extern int sensor_read_reg1val1(struct i2c_client *client, u8 reg, u8 *val); -extern int sensor_read_reg2val1(struct i2c_client *client, u16 reg, u8 *val); -extern int sensor_read_reg1val2(struct i2c_client *client, u8 reg, u16 *val); -extern int sensor_read_reg2val2(struct i2c_client *client, u16 reg, u16 *val); -extern int generic_sensor_write(struct i2c_client *client, struct rk_sensor_reg *sensor_reg); -extern int generic_sensor_read(struct i2c_client *client, struct rk_sensor_reg *sensor_reg); -extern int generic_sensor_write_array(struct i2c_client *client, struct rk_sensor_reg *regarray); -extern int generic_sensor_get_max_min_res(struct rk_sensor_sequence *res_array, - int num, - struct rk_sensor_seq_info *max_real_res, - struct rk_sensor_seq_info *max_res, - struct rk_sensor_seq_info *min_res); -extern int generic_sensor_init(struct v4l2_subdev *sd, u32 val); -extern int generic_sensor_enum_frameintervals(struct v4l2_subdev *sd, struct v4l2_frmivalenum *fival); -extern int generic_sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf); -extern int generic_sensor_ioctrl(struct soc_camera_device *icd, enum rk29sensor_power_cmd cmd, int on); -extern unsigned long generic_sensor_query_bus_param(struct soc_camera_device *icd); -extern int generic_sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf); -extern int generic_sensor_set_bus_param(struct soc_camera_device *icd, unsigned long flags); -extern int generic_sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -extern int generic_sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -extern int generic_sensor_g_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl); -extern int generic_sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl); -extern int generic_sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -extern int generic_sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -extern long generic_sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg); -extern int generic_sensor_s_power(struct v4l2_subdev *sd, int on);/*yzm*/ -extern int generic_sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, u32 *code); -extern int generic_sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf); -extern int generic_sensor_af_workqueue_set(struct soc_camera_device *icd, enum rk_sensor_focus_wq_cmd cmd, int var, bool wait); -extern int generic_sensor_s_stream(struct v4l2_subdev *sd, int enable); -extern int generic_sensor_writebuf(struct i2c_client *client, char *buf, int buf_size); -extern int generic_sensor_cropcap(struct v4l2_subdev *sd, struct v4l2_cropcap *cc); -extern int generic_sensor_enum_framesizes(struct v4l2_subdev *sd, struct v4l2_frmsizeenum *fsize); -void deinit_sensor_gpios(struct soc_camera_device *icd); - -static inline int sensor_get_full_width_height(int full_resolution, unsigned short *w, unsigned short *h) -{ - switch (full_resolution) - { - case 0x30000: - *w = 640; - *h = 480; - break; - - case 0x100000: - *w = 1024; - *h = 768; - break; - - case 0x130000: - *w = 1280; - *h = 1024; - break; - - case 0x200000: - *w = 1600; - *h = 1200; - break; - - case 0x210000: - *w = 1920; - *h = 1080; - break; - - case 0x300000: - *w = 2048; - *h = 1536; - break; - - case 0x500000: - *w = 2592; - *h = 1944; - break; - - case 0x800000: - *w = 3264; - *h = 2448; - break; - - default: - return -1; - } - - return 0; -} - -static inline int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - int ret; - - struct generic_sensor *sensor = to_generic_sensor(client); - - /* - * We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. - */ - if (!icd->parent || to_soc_camera_host(icd->parent)->nr != icd->iface) { - ret = -ENODEV; - goto sensor_video_probe_end; - } - - generic_sensor_softreset(client, sensor->info_priv.sensor_SfRstSeqe); - ret = generic_sensor_check_id(client, sensor->info_priv.sensor_CkIdSeqe); - -sensor_video_probe_end: - return ret; -} - -static inline int sensor_regarray_check(struct rk_sensor_reg *data, int reg_num) -{ - struct rk_sensor_reg *data_ptr; - - data_ptr = data + reg_num - 1; - if (data_ptr->reg == SEQCMD_END) - return 0; - else - printk(KERN_ERR "%s(%d): data[%d].reg = 0x%x\n", __func__, __LINE__, reg_num - 1, data_ptr->reg); - - return -1; -} - -static inline void sensor_v4l2ctrl_info_init(struct sensor_v4l2ctrl_info_s *ptr, - unsigned int id, - enum v4l2_ctrl_type type, - char *name, - int min, - int max, - int step, - int default_val, - int(*cb)(struct soc_camera_device *icd, - struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl, - bool is_set), - struct rk_sensor_reg **sensor_seqe) -{ - ptr->qctrl->id = id; - ptr->qctrl->type = type; - ptr->qctrl->minimum = min; - ptr->qctrl->maximum = max; - ptr->qctrl->step = step; - ptr->qctrl->default_value = default_val; - ptr->cur_value = default_val; - ptr->cb = cb; - ptr->sensor_Seqe = sensor_seqe; -} - -static inline struct sensor_v4l2ctrl_info_s *sensor_find_ctrl( - struct sensor_v4l2ctrl_info_s *ops, int id) -{ - int i; - - for (i = 0; i < ops[0].num_ctrls; i++) - if (ops[i].qctrl->id == id) - return &ops[i]; - - return NULL; -} - -static inline void v4l2_querymenu_init(struct v4l2_querymenu *ptr, - unsigned int id, - unsigned int index, - char *name, - unsigned int reserved) -{ - ptr->id = id; - ptr->index = index; - strcat(ptr->name, name); - ptr->reserved = reserved; -} - -static inline int sensor_v4l2ctrl_replace_cb(struct generic_sensor *sensor, int id, void *cb) -{ - int i, num; - struct sensor_v4l2ctrl_info_s *ctrls; - - ctrls = sensor->ctrls; - num = ctrls->num_ctrls; - for (i = 0; i < num; i++, ctrls++) { - if (ctrls->qctrl->id == id) { - ctrls->cb = cb; - break; - } - } - - if (i >= num) - printk(KERN_ERR "%s(%d): v4l2_control id(0x%x) isn't exist\n", __func__, __LINE__, id); - else - return 0; -} - -static inline int sensor_v4l2ctrl_default_cb(struct soc_camera_device *icd, - struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl, - bool is_set) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - int value = ext_ctrl->value; - int index; - - if (!is_set) - return 0; - - if ((value < ctrl_info->qctrl->minimum) || (value > ctrl_info->qctrl->maximum)) { - printk(KERN_ERR "%s(%d): value(0x%x) isn't between in (0x%x,0x%x)\n", __func__, __LINE__, value, - ctrl_info->qctrl->minimum, ctrl_info->qctrl->maximum); - return -EINVAL; - } - - index = value - ctrl_info->qctrl->minimum; - if (ctrl_info->sensor_Seqe && ctrl_info->sensor_Seqe[index]) { - if (generic_sensor_write_array(client, ctrl_info->sensor_Seqe[index]) != 0) { - printk(KERN_ERR "%s(%d): sensor write array sensor_Seqe failed\n", __func__, __LINE__); - return -EINVAL; - } - - ctrl_info->cur_value = value; - return 0; - } else { - printk(KERN_ERR "%s(%d): ctrl_info(id=0x%x)'s sensor_Seqe is invalidate\n", __func__, __LINE__, ctrl_info->qctrl->id); - return -EINVAL; - } -} - -static inline int sensor_v4l2ctrl_flash_cb(struct soc_camera_device *icd, - struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl, - bool is_set) -{ - int value = ext_ctrl->value; - - if (value == 0xfefe5a5a) { - if ((ctrl_info->cur_value == 2) || (ctrl_info->cur_value == 1)) - generic_sensor_ioctrl(icd, Sensor_Flash, Flash_On); - - return 0; - } - if ((value < ctrl_info->qctrl->minimum) || (value > ctrl_info->qctrl->maximum)) { - printk(KERN_ERR "%s(%d): value(0x%x) isn't between in (0x%x,0x%x)\n", __func__, __LINE__, value, - ctrl_info->qctrl->minimum, ctrl_info->qctrl->maximum); - return -EINVAL; - } - - if (value == 3) { /* ddl@rock-chips.com: torch */ - generic_sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - generic_sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - - ctrl_info->cur_value = value; /* ddl@rock-chips.com : v0.1.3 */ - - return 0; -} - -static inline int sensor_focus_default_cb(struct soc_camera_device *icd, - struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl, bool is_set) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - int value = ext_ctrl->value; - int ret = 0; - struct generic_sensor *sensor = to_generic_sensor(client); - - if ((value < ctrl_info->qctrl->minimum) || (value > ctrl_info->qctrl->maximum)) { - printk(KERN_ERR "%s(%d): value(0x%x) isn't between in (0x%x,0x%x)\n", __func__, __LINE__, value, - ctrl_info->qctrl->minimum, ctrl_info->qctrl->maximum); - return -EINVAL; - } - - if (sensor->sensor_focus.focus_state == FocusState_Inval) { - printk(KERN_ERR "%s(%d): focus have not been init success yet\n", __func__, __LINE__); - /*set focus delay*/ - - switch (ext_ctrl->id) { - case V4L2_CID_FOCUS_ABSOLUTE: - sensor->sensor_focus.focus_delay = WqCmd_af_special_pos; - break; - case V4L2_CID_FOCUS_RELATIVE: - if (ext_ctrl->value == ctrl_info->qctrl->minimum) - sensor->sensor_focus.focus_delay = WqCmd_af_near_pos; - else - sensor->sensor_focus.focus_delay = WqCmd_af_far_pos; - break; - - case V4L2_CID_FOCUS_AUTO: - sensor->sensor_focus.focus_delay = WqCmd_af_single; - break; - case V4L2_CID_FOCUS_CONTINUOUS: - sensor->sensor_focus.focus_delay = WqCmd_af_continues; - break; - default: - printk(KERN_ERR "%s(%d):not support this focus mode", __func__, __LINE__); - } - return -EINVAL; - } - switch (ext_ctrl->id) { - case V4L2_CID_FOCUS_ABSOLUTE: - if (sensor->sensor_focus.focus_mode == V4L2_CID_FOCUS_CONTINUOUS) - ; /* need do something? */ - - if (ctrl_info->cur_value != value) { - if (ext_ctrl->value == ctrl_info->qctrl->minimum) - ret = generic_sensor_af_workqueue_set(icd, WqCmd_af_near_pos, value, true); - else if (ext_ctrl->value == ctrl_info->qctrl->maximum) - ret = generic_sensor_af_workqueue_set(icd, WqCmd_af_far_pos, value, true); - else - ret = generic_sensor_af_workqueue_set(icd, WqCmd_af_special_pos, value, true); - if (ret == 0) { - ctrl_info->cur_value = value; - } else { - ret = -EINVAL; - printk(KERN_ERR "\n %s valure = %d is invalidate.. \n", __func__, value); - } - } - break; - - case V4L2_CID_FOCUS_RELATIVE: - if (sensor->sensor_focus.focus_mode == V4L2_CID_FOCUS_CONTINUOUS) - ; /* need do something? */ - - if (ctrl_info->cur_value != value) { - if (ext_ctrl->value == ctrl_info->qctrl->minimum) - ret = generic_sensor_af_workqueue_set(icd, WqCmd_af_near_pos, value, true); - else if (ext_ctrl->value == ctrl_info->qctrl->maximum) - ret = generic_sensor_af_workqueue_set(icd, WqCmd_af_far_pos, value, true); - if (ret == 0) { - ctrl_info->cur_value = value; - } else { - ret = -EINVAL; - printk(KERN_ERR "\n %s valure = %d is invalidate.. \n", __func__, value); - } - } - break; - - case V4L2_CID_FOCUS_AUTO: - mutex_lock(&sensor->sensor_focus.focus_lock); - /* get focuszone */ - sensor->sensor_focus.focus_zone.lx = ext_ctrl->rect[0]; - sensor->sensor_focus.focus_zone.ty = ext_ctrl->rect[1]; - sensor->sensor_focus.focus_zone.rx = ext_ctrl->rect[2]; - sensor->sensor_focus.focus_zone.dy = ext_ctrl->rect[3]; - mutex_unlock(&sensor->sensor_focus.focus_lock); - - if (sensor->sensor_focus.focus_mode == V4L2_CID_FOCUS_CONTINUOUS) { - /* - * need do something? - * generic_sensor_af_workqueue_set(icd, WqCmd_af_close, value, true); - */ - } - if ((value == 1) || (sensor->sensor_focus.focus_mode == V4L2_CID_FOCUS_AUTO)) { - ret = generic_sensor_af_workqueue_set(icd, WqCmd_af_update_zone, value, true); - ret = generic_sensor_af_workqueue_set(icd, WqCmd_af_single, value, true); - sensor->sensor_focus.focus_mode = V4L2_CID_FOCUS_AUTO; - } else if (value == 0) { - ret = generic_sensor_af_workqueue_set(icd, WqCmd_af_close, value, true); - } - if (ret != 0) { - ret = -EINVAL; - printk(KERN_ERR"\n %s valure = %d is invalidate.. \n", __func__, value); - } - break; - - case V4L2_CID_FOCUS_CONTINUOUS: - if ((value == 1) && (sensor->sensor_focus.focus_mode != V4L2_CID_FOCUS_CONTINUOUS)) { - /* - * have to close focus firstly? - * generic_sensor_af_workqueue_set(icd, WqCmd_af_close, value, true); - */ - ret = generic_sensor_af_workqueue_set(icd, WqCmd_af_continues, value, true); - - sensor->sensor_focus.focus_mode = V4L2_CID_FOCUS_CONTINUOUS; - } else if (value == 0){ - ret = generic_sensor_af_workqueue_set(icd, WqCmd_af_close, value, true); - } - if (ret != 0) { - ret = -EINVAL; - printk(KERN_ERR"\n %s valure = %d is invalidate.. \n", __func__, value); - } - break; - } - return ret; -} - -static inline int sensor_face_detect_default_cb(struct soc_camera_device *icd, - struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl, bool is_set) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - int value = ext_ctrl->value; - int ret = 0; - struct generic_sensor *sensor = to_generic_sensor(client); - - if ((value < ctrl_info->qctrl->minimum) || (value > ctrl_info->qctrl->maximum)) { - printk(KERN_ERR "%s(%d): value(0x%x) isn't between in (0x%x,0x%x)\n", __func__, __LINE__, value, - ctrl_info->qctrl->minimum, ctrl_info->qctrl->maximum); - return -EINVAL; - } - if (ctrl_info->cur_value != value) { - if (sensor->sensor_cb.sensor_face_detect_cb) - ret = (sensor->sensor_cb.sensor_face_detect_cb)(client, value); - if (ret == 0) - ctrl_info->cur_value = value; - } - return ret; -} - -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, - struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl); - -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, - struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl); - -static inline int sensor_v4l2ctrl_mirror_default_cb(struct soc_camera_device *icd, - struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl, bool is_set) -{ - return sensor_v4l2ctrl_mirror_cb(icd, ctrl_info, ext_ctrl); -} - -static inline int sensor_v4l2ctrl_flip_default_cb(struct soc_camera_device *icd, - struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl, bool is_set) -{ - return sensor_v4l2ctrl_flip_cb(icd, ctrl_info, ext_ctrl); -} - -#define new_user_v4l2ctrl(ctl_id, ctl_type, ctl_name, ctl_min, ctl_max, ctl_step, default_val, callback, seqe)\ -{\ - .qctrl = {\ - .id = ctl_id,\ - .type = ctl_type,\ - .name = ctl_name,\ - .minimum = ctl_min,\ - .maximum = ctl_max,\ - .step = ctl_step,\ - .default_value = default_val,\ - },\ - .cb = callback,\ - .sensor_Seqe = seqe,\ -} - -#define new_usr_v4l2menu(menu_id, menu_idx, menu_name, menu_rev)\ -{\ - .id = menu_id,\ - .index = menu_idx,\ - .name = menu_name,\ - .reserved = menu_rev,\ -} - -#define sensor_init_parameters_default_code() static void sensor_init_parameters(struct specific_sensor *spsensor, struct soc_camera_device *icd)\ -{ \ - int num, i; \ - struct rk_sensor_sequence *sensor_series; \ - struct v4l2_queryctrl *controls, *control; \ - struct sensor_v4l2ctrl_info_s *ctrls; \ - struct v4l2_querymenu *menus, *menu; \ - struct soc_camera_desc *desc = to_soc_camera_desc(icd);\ - struct rk29camera_platform_data *pdata = desc->subdev_desc.drv_priv; \ - struct rkcamera_platform_data *sensor_device = NULL, *new_camera; \ - struct rk_sensor_reg *reg_data; \ - int config_flash = 0;\ - int sensor_config;\ - struct soc_camera_ops *sensor_ops_p = NULL;\ -\ - if (!pdata) {\ - printk(KERN_ERR "WARNING: Camera sensor device is registered in board by CONFIG_SENSOR_XX,\n"\ - "Please register camera sesnor device in struct rkcamera_platform_data new_camera[]\n");\ - BUG();\ - }\ - sensor_config = SensorConfiguration;\ - new_camera = pdata->register_dev_new; \ - while (new_camera) {\ - if (strcmp(dev_name(icd->pdev), new_camera->dev_name) == 0) { \ - sensor_device = new_camera; \ - break; \ - } \ - new_camera = new_camera->next_camera; \ - } \ -\ - if (sensor_device && sensor_device->flash)\ - config_flash = 1;\ - spsensor->common_sensor.info_priv.gReg_mask = 0x00; \ - spsensor->common_sensor.info_priv.gVal_mask = 0x00; \ - for (i = 0; i < SENSOR_REGISTER_LEN; i++) \ - spsensor->common_sensor.info_priv.gReg_mask |= (0xff << (i * 8)); \ - for (i = 0; i < SENSOR_VALUE_LEN; i++) \ - spsensor->common_sensor.info_priv.gVal_mask |= (0xff << (i * 8)); \ - if (sensor_regarray_check(sensor_softreset_data, sizeof(sensor_softreset_data) / sizeof(struct rk_sensor_reg)) == 0) { \ - spsensor->common_sensor.info_priv.sensor_SfRstSeqe = sensor_softreset_data; \ - } else { \ - SENSOR_TR("sensor_softreset_data haven't SensorEnd flag! Please fill SensorEnd in the last of sensor_softreset_data"); \ - BUG(); \ - } \ - if (sensor_regarray_check(sensor_check_id_data, sizeof(sensor_check_id_data) / sizeof(struct rk_sensor_reg)) == 0) { \ - spsensor->common_sensor.info_priv.sensor_CkIdSeqe = sensor_check_id_data; \ - } else { \ - SENSOR_TR("sensor_check_id_data haven't SensorEnd flag! Please fill SensorEnd in the last of sensor_check_id_data"); \ - BUG(); \ - } \ - spsensor->common_sensor.sensor_cb.sensor_activate_cb = sensor_activate_cb; \ - spsensor->common_sensor.sensor_cb.sensor_deactivate_cb = sensor_deactivate_cb; \ - spsensor->common_sensor.sensor_cb.sensor_mirror_cb = sensor_mirror_cb; \ - spsensor->common_sensor.sensor_cb.sensor_flip_cb = sensor_flip_cb; \ - spsensor->common_sensor.sensor_cb.sensor_s_fmt_cb_th = sensor_s_fmt_cb_th; \ - spsensor->common_sensor.sensor_cb.sensor_s_fmt_cb_bh = sensor_s_fmt_cb_bh; \ - spsensor->common_sensor.sensor_cb.sensor_try_fmt_cb_th = sensor_try_fmt_cb_th;\ - spsensor->common_sensor.sensor_cb.sensor_softreset_cb = sensor_softrest_usr_cb;\ - spsensor->common_sensor.sensor_cb.sensor_check_id_cb = sensor_check_id_usr_cb;\ - if (CFG_FunChk(sensor_config, CFG_FACE_DETECT)) \ - spsensor->common_sensor.sensor_cb.sensor_face_detect_cb = sensor_face_detect_usr_cb; \ - else \ - spsensor->common_sensor.sensor_cb.sensor_face_detect_cb = NULL; \ -\ - num = 4; \ - if (sensor_720p[0].reg != SEQCMD_END) { \ - num++; \ - } \ - if (sensor_1080p[0].reg != SEQCMD_END) { \ - num++; \ - } \ -\ - if (sensor_device && (sensor_device->resolution > CONS(SENSOR_NAME, _FULL_RESOLUTION))) \ - num++; \ -\ - sensor_series = (struct rk_sensor_sequence *)kzalloc(sizeof(struct rk_sensor_sequence) * num, GFP_KERNEL); \ - if (!sensor_series) { \ - SENSOR_TR("malloc sensor_series failed! n"); \ - BUG(); \ - } else { \ - spsensor->common_sensor.info_priv.sensor_series = sensor_series; \ - spsensor->common_sensor.info_priv.num_series = num; \ - spsensor->common_sensor.crop_percent = SENSOR_CROP_PERCENT;\ - \ - sensor_series->gSeq_info.w = SENSOR_PREVIEW_W; \ - sensor_series->gSeq_info.h = SENSOR_PREVIEW_H; \ - sensor_series->gSeq_info.fps = SENSOR_PREVIEW_FPS; \ - sensor_series->property = SEQUENCE_INIT; \ - if (sensor_regarray_check(sensor_init_data, sizeof(sensor_init_data) / sizeof(struct rk_sensor_reg)) == 0) { \ - sensor_series->data = sensor_init_data; \ - } else { \ - SENSOR_TR("sensor_init_data haven't SensorEnd flag! Please fill SensorEnd in the last of sensor_int_data"); \ - BUG(); \ - } \ - \ - sensor_series++; \ - sensor_series->gSeq_info.w = SENSOR_PREVIEW_W; \ - sensor_series->gSeq_info.h = SENSOR_PREVIEW_H; \ - sensor_series->gSeq_info.fps = SENSOR_PREVIEW_FPS; \ - sensor_series->property = SEQUENCE_PREVIEW; \ - if (sensor_regarray_check(sensor_preview_data, sizeof(sensor_preview_data) / sizeof(struct rk_sensor_reg)) == 0) { \ - sensor_series->data = sensor_preview_data; \ - } else { \ - SENSOR_TR("sensor_preview_data haven't SensorEnd flag! Please fill SensorEnd in the last of sensor_preview_data"); \ - BUG(); \ - } \ - \ - sensor_series++; \ - if (sensor_get_full_width_height(CONS(SENSOR_NAME, _FULL_RESOLUTION), &sensor_series->gSeq_info.w, &sensor_series->gSeq_info.h) == 0) { \ - sensor_series->gSeq_info.fps = SENSOR_FULLRES_L_FPS; \ - sensor_series->property = SEQUENCE_CAPTURE; \ - if (sensor_regarray_check(sensor_fullres_lowfps_data, sizeof(sensor_fullres_lowfps_data) / sizeof(struct rk_sensor_reg)) == 0) { \ - sensor_series->data = sensor_fullres_lowfps_data; \ - } else { \ - SENSOR_TR("sensor_fullres_lowfps_data haven't SensorEnd flag! Please fill SensorEnd in the last of sensor_fullres_lowfps_data"); \ - BUG(); \ - } \ - } else { \ - SENSOR_TR("generic_sensor_get_width_height failed!"); \ - BUG(); \ - } \ - \ - sensor_series++; \ - sensor_series->gSeq_info.w = (sensor_series - 1)->gSeq_info.w; \ - sensor_series->gSeq_info.h = (sensor_series - 1)->gSeq_info.h; \ - sensor_series->gSeq_info.fps = SENSOR_FULLRES_H_FPS; \ - sensor_series->property = SEQUENCE_PREVIEW; \ - if (sensor_regarray_check(sensor_fullres_highfps_data, sizeof(sensor_fullres_highfps_data) / sizeof(struct rk_sensor_reg)) == 0) { \ - sensor_series->data = sensor_fullres_highfps_data; \ - } else { \ - SENSOR_TR("sensor_fullres_highfps_data haven't SensorEnd flag! Please fill SensorEnd in the last of sensor_fullres_highfps_data"); \ - BUG(); \ - } \ - \ - if (sensor_device && (sensor_device->resolution > CONS(SENSOR_NAME, _FULL_RESOLUTION))) { \ - sensor_series++; \ - if (sensor_get_full_width_height(sensor_device->resolution, &sensor_series->gSeq_info.w, &sensor_series->gSeq_info.h) == 0) { \ - sensor_series->gSeq_info.fps = SENSOR_FULLRES_L_FPS; \ - sensor_series->property = SEQUENCE_CAPTURE; \ - reg_data = kzalloc(sizeof(struct rk_sensor_reg) * 2, GFP_KERNEL); \ - if (!reg_data) { \ - SENSOR_TR("kzalloc interpolate reg_data failed"); \ - } else { \ - sensor_series->data = reg_data; \ - reg_data->reg = SEQCMD_INTERPOLATION; \ - reg_data++; \ - reg_data->reg = SEQCMD_END; \ - } \ - } else { \ - SENSOR_TR("generic_sensor_get_width_height failed!"); \ - BUG(); \ - } \ - } \ - \ - if (sensor_720p[0].reg != SEQCMD_END) { \ - sensor_series++; \ - sensor_series->gSeq_info.w = 1280; \ - sensor_series->gSeq_info.h = 720; \ - sensor_series->gSeq_info.fps = SENSOR_720P_FPS; \ - sensor_series->property = SEQUENCE_PREVIEW; \ - if (sensor_regarray_check(sensor_720p, sizeof(sensor_720p) / sizeof(struct rk_sensor_reg)) == 0) { \ - sensor_series->data = sensor_720p; \ - } else { \ - SENSOR_TR("sensor_720p haven't SensorEnd flag! Please fill SensorEnd in the last of sensor_720p"); \ - BUG(); \ - } \ - } \ - \ - if (sensor_1080p[0].reg != SEQCMD_END) { \ - sensor_series++; \ - sensor_series->gSeq_info.w = 1920; \ - sensor_series->gSeq_info.h = 1080; \ - sensor_series->gSeq_info.fps = SENSOR_1080P_FPS; \ - sensor_series->property = SEQUENCE_PREVIEW; \ - if (sensor_regarray_check(sensor_1080p, sizeof(sensor_1080p) / sizeof(struct rk_sensor_reg)) == 0) { \ - sensor_series->data = sensor_1080p; \ - } else { \ - SENSOR_TR("sensor_1080p haven't SensorEnd flag! Please fill SensorEnd in the last of sensor_1080p"); \ - BUG(); \ - } \ - } \ - } \ -\ - if (CFG_FunChk(sensor_config, CFG_Focus)) { \ - spsensor->common_sensor.sensor_focus.sensor_wq = create_workqueue(SENSOR_NAME_STRING(_af_workqueue)); \ - if (!spsensor->common_sensor.sensor_focus.sensor_wq) {\ - SENSOR_TR("%s create fail, so auto focus is disable!", SENSOR_NAME_STRING(_af_workqueue));\ - CFG_FunDis(sensor_config, CFG_Focus);\ - CFG_FunDis(sensor_config, CFG_FocusContinues);\ - CFG_FunDis(sensor_config, CFG_FocusZone);\ - CFG_FunDis(sensor_config, CFG_FocusRelative);\ - CFG_FunDis(sensor_config, CFG_FocusAbsolute);\ - }\ - } else {\ - spsensor->common_sensor.sensor_focus.sensor_wq = NULL;\ - CFG_FunDis(sensor_config, CFG_FocusContinues);\ - CFG_FunDis(sensor_config, CFG_FocusZone);\ - CFG_FunDis(sensor_config, CFG_FocusRelative);\ - CFG_FunDis(sensor_config, CFG_FocusAbsolute);\ - }\ -\ - spsensor->common_sensor.info_priv.bus_parameter = SENSOR_BUS_PARAM; \ - spsensor->common_sensor.info_priv.chip_ident = SENSOR_V4L2_IDENT; \ - spsensor->common_sensor.info_priv.chip_id = SensorChipID;\ - spsensor->common_sensor.info_priv.chip_id_num = ARRAY_SIZE(SensorChipID);\ -\ - generic_sensor_get_max_min_res(spsensor->common_sensor.info_priv.sensor_series, \ - spsensor->common_sensor.info_priv.num_series, \ - &spsensor->common_sensor.info_priv.max_real_res, \ - &spsensor->common_sensor.info_priv.max_res, \ - &spsensor->common_sensor.info_priv.min_res); \ -\ - num = 0;\ - for (i = 0; i < 32; i++)\ - if (SensorConfiguration & (1 << i))\ - num++;\ - num += sizeof(sensor_controls) / sizeof(struct sensor_v4l2ctrl_usr_s); \ - num += config_flash;\ - controls = (struct v4l2_queryctrl *)kzalloc(sizeof(struct v4l2_queryctrl) * num, GFP_KERNEL); \ - if (!controls) { \ - SENSOR_TR("kzalloc struct v4l2_queryctrl(%d) failed", num); \ - BUG(); \ - } \ - spsensor->common_sensor.sensor_controls = controls; \ - sensor_ops_p = (struct soc_camera_ops *)kzalloc(sizeof(struct soc_camera_ops), GFP_KERNEL); \ - if (!sensor_ops_p) { \ - SENSOR_TR("kzalloc struct soc_camera_ops failed"); \ - BUG(); \ - } \ - sensor_ops_p->controls = controls; \ - sensor_ops_p->num_controls = num; \ -\ - ctrls = (struct sensor_v4l2ctrl_info_s *)kzalloc(sizeof(struct sensor_v4l2ctrl_info_s) * num , GFP_KERNEL); \ - if (!ctrls) { \ - SENSOR_TR("kzalloc struct sensor_v4l2ctrl_info_s(%d) failed", num); \ - BUG(); \ - } \ - spsensor->common_sensor.ctrls = ctrls; \ - for (i = 0; i < num; i++) { \ - ctrls->qctrl = controls; \ - ctrls->num_ctrls = num; \ - ctrls++; \ - controls++; \ - } \ - controls = spsensor->common_sensor.sensor_controls; \ - ctrls = spsensor->common_sensor.ctrls; \ -\ - num = 0; \ - num += (CFG_FunChk(sensor_config, CFG_WhiteBalance) * 5 + CFG_FunChk(sensor_config, CFG_Effect) * 6 + CFG_FunChk(sensor_config, CFG_Scene) * 2 + config_flash * 4); \ - num += sizeof(sensor_menus) / sizeof(struct v4l2_querymenu); \ - menus = (struct v4l2_querymenu *)kzalloc(sizeof(struct v4l2_querymenu) * num, GFP_KERNEL); \ - if (!menus) { \ - SENSOR_TR("kzalloc struct v4l2_querymenu(%d) failed", num); \ - BUG(); \ - } \ - sensor_ops_p->menus = menus; \ - sensor_ops_p->num_menus = num; \ -\ - sensor_ops_p->suspend = sensor_suspend; \ - sensor_ops_p->resume = sensor_resume; \ - sensor_ops_p->set_bus_param = generic_sensor_set_bus_param; \ - sensor_ops_p->query_bus_param = generic_sensor_query_bus_param; \ -\ - if (sizeof(sensor_ZoomSeqe) / sizeof(struct rk_sensor_reg *))\ - sensor_ZoomSeqe[0] = NULL;\ -\ - if (CFG_FunChk(sensor_config, CFG_WhiteBalance)) { \ - sensor_v4l2ctrl_info_init(ctrls, V4L2_CID_DO_WHITE_BALANCE, V4L2_CTRL_TYPE_MENU, \ - "White Balance Control", 0, 4, 1, 0, sensor_v4l2ctrl_default_cb, sensor_WhiteBalanceSeqe); \ - controls++; \ - ctrls++; \ - \ - v4l2_querymenu_init(menus, V4L2_CID_DO_WHITE_BALANCE, 0, "auto", 0); \ - menus++; \ - v4l2_querymenu_init(menus, V4L2_CID_DO_WHITE_BALANCE, 1, "incandescent", 0); \ - menus++; \ - v4l2_querymenu_init(menus, V4L2_CID_DO_WHITE_BALANCE, 2, "fluorescent", 0); \ - menus++; \ - v4l2_querymenu_init(menus, V4L2_CID_DO_WHITE_BALANCE, 3, "daylight", 0); \ - menus++; \ - v4l2_querymenu_init(menus, V4L2_CID_DO_WHITE_BALANCE, 4, "cloudy-daylight", 0); \ - menus++; \ - } \ -\ - if (CFG_FunChk(sensor_config,CFG_Brightness)) { \ - sensor_v4l2ctrl_info_init(ctrls, V4L2_CID_BRIGHTNESS, V4L2_CTRL_TYPE_INTEGER, \ - "Brightness Control", -3, 2, 1, 0, sensor_v4l2ctrl_default_cb, sensor_BrightnessSeqe); \ - controls++; \ - ctrls++; \ - } \ - if (CFG_FunChk(sensor_config, CFG_Effect)) { \ - sensor_v4l2ctrl_info_init(ctrls, V4L2_CID_EFFECT, V4L2_CTRL_TYPE_MENU, \ - "Effect Control", 0, 5, 1, 0, sensor_v4l2ctrl_default_cb, sensor_EffectSeqe); \ - controls++; \ - ctrls++; \ - \ - v4l2_querymenu_init(menus, V4L2_CID_EFFECT, 0, "none", 0); \ - menus++; \ - v4l2_querymenu_init(menus, V4L2_CID_EFFECT, 1, "mono", 0); \ - menus++; \ - v4l2_querymenu_init(menus, V4L2_CID_EFFECT, 2, "negative", 0); \ - menus++; \ - v4l2_querymenu_init(menus, V4L2_CID_EFFECT, 3, "sepia", 0); \ - menus++; \ - v4l2_querymenu_init(menus, V4L2_CID_EFFECT, 4, "posterize", 0); \ - menus++; \ - v4l2_querymenu_init(menus, V4L2_CID_EFFECT, 5, "aqua", 0); \ - menus++; \ - } \ - if (CFG_FunChk(sensor_config, CFG_Exposure)) { \ - sensor_v4l2ctrl_info_init(ctrls, V4L2_CID_EXPOSURE, V4L2_CTRL_TYPE_INTEGER, \ - "Exposure Control", 0, 6, 1, 0, sensor_v4l2ctrl_default_cb, sensor_ExposureSeqe); \ - controls++; \ - ctrls++; \ - } \ - if (CFG_FunChk(sensor_config, CFG_Saturation)) { \ - sensor_v4l2ctrl_info_init(ctrls, V4L2_CID_SATURATION, V4L2_CTRL_TYPE_INTEGER, \ - "Saturation Control", 0, 2, 1, 0, sensor_v4l2ctrl_default_cb, sensor_SaturationSeqe); \ - controls++; \ - ctrls++; \ - } \ - if (CFG_FunChk(sensor_config, CFG_Contrast)) { \ - sensor_v4l2ctrl_info_init(ctrls, V4L2_CID_CONTRAST, V4L2_CTRL_TYPE_INTEGER, \ - "Contrast Control", -3, 3, 1, 0, sensor_v4l2ctrl_default_cb, sensor_ContrastSeqe); \ - controls++; \ - ctrls++; \ - } \ - if (CFG_FunChk(sensor_config, CFG_Mirror)) { \ - sensor_v4l2ctrl_info_init(ctrls, V4L2_CID_HFLIP, V4L2_CTRL_TYPE_BOOLEAN, \ - "Mirror Control", 0, 1, 1, 0, sensor_v4l2ctrl_mirror_default_cb, NULL); \ - controls++; \ - ctrls++; \ - } \ - if (CFG_FunChk(sensor_config, CFG_Flip)) { \ - ctrls->qctrl = controls; \ - sensor_v4l2ctrl_info_init(ctrls, V4L2_CID_VFLIP, V4L2_CTRL_TYPE_BOOLEAN, \ - "Flip Control", 0, 1, 1, 0, sensor_v4l2ctrl_flip_default_cb, NULL); \ - controls++; \ - ctrls++; \ - } \ - if (CFG_FunChk(sensor_config, CFG_Scene)) { \ - sensor_v4l2ctrl_info_init(ctrls, V4L2_CID_SCENE, V4L2_CTRL_TYPE_MENU, \ - "Scene Control", 0, 1, 1, 0, sensor_v4l2ctrl_default_cb, sensor_SceneSeqe); \ - controls++; \ - ctrls++; \ - \ - v4l2_querymenu_init(menus, V4L2_CID_SCENE, 0, "auto", 0); \ - menus++; \ - v4l2_querymenu_init(menus, V4L2_CID_SCENE, 1, "night", 0); \ - menus++; \ - } \ - if (CFG_FunChk(sensor_config, CFG_Focus)) { \ - sensor_v4l2ctrl_info_init(ctrls, V4L2_CID_FOCUS_AUTO, V4L2_CTRL_TYPE_BOOLEAN, \ - "Focus Control", 0, 2, 1, 0, sensor_focus_default_cb, NULL); \ - controls++; \ - ctrls++; \ - } \ -\ - if (CFG_FunChk(sensor_config, CFG_FocusRelative)) { \ - sensor_v4l2ctrl_info_init(ctrls, V4L2_CID_FOCUS_RELATIVE, V4L2_CTRL_TYPE_INTEGER, \ - "Focus Control", -1, 1, 1, 0, sensor_focus_default_cb, NULL); \ - controls++; \ - ctrls++; \ - } \ -\ - if (CFG_FunChk(sensor_config, CFG_FocusAbsolute)) { \ - sensor_v4l2ctrl_info_init(ctrls, V4L2_CID_FOCUS_ABSOLUTE, V4L2_CTRL_TYPE_INTEGER, \ - "Focus Control", 0, 255, 1, 125, sensor_focus_default_cb, NULL); \ - controls++; \ - ctrls++; \ - } \ - if (CFG_FunChk(sensor_config, CFG_FocusZone)) { \ - sensor_v4l2ctrl_info_init(ctrls, V4L2_CID_FOCUSZONE, V4L2_CTRL_TYPE_BOOLEAN, \ - "Focus Control", 0, 1, 1, 0, NULL, NULL); \ - controls++; \ - ctrls++; \ - } \ - if (CFG_FunChk(sensor_config, CFG_FocusContinues)) { \ - sensor_v4l2ctrl_info_init(ctrls, V4L2_CID_FOCUS_CONTINUOUS, V4L2_CTRL_TYPE_BOOLEAN, \ - "Focus Control", 0, 1, 1, 0, sensor_focus_default_cb, NULL); \ - controls++; \ - ctrls++; \ - } \ - if (CFG_FunChk(sensor_config, CFG_FACE_DETECT)) { \ - sensor_v4l2ctrl_info_init(ctrls, V4L2_CID_FACEDETECT, V4L2_CTRL_TYPE_BOOLEAN, \ - "FaceDEt Control", 0, 1, 1, 0, sensor_face_detect_default_cb, NULL); \ - controls++; \ - ctrls++; \ - } \ - if (config_flash) { \ - sensor_v4l2ctrl_info_init(ctrls, V4L2_CID_FLASH, V4L2_CTRL_TYPE_MENU, \ - "Flash Control", 0, 3, 1, 0, sensor_v4l2ctrl_flash_cb, NULL); \ - controls++; \ - ctrls++; \ - \ - v4l2_querymenu_init(menus, V4L2_CID_FLASH, 0, "off", 0); \ - menus++; \ - v4l2_querymenu_init(menus, V4L2_CID_FLASH, 1, "auto", 0); \ - menus++; \ - v4l2_querymenu_init(menus, V4L2_CID_FLASH, 2, "on", 0); \ - menus++; \ - v4l2_querymenu_init(menus, V4L2_CID_FLASH, 3, "torch", 0); \ - menus++; \ - } \ -\ - for (i = 0 ; i < (sizeof(sensor_controls) / sizeof(struct sensor_v4l2ctrl_usr_s)); i++) { \ - \ - control = spsensor->common_sensor.sensor_controls; \ - while (control < controls) {\ - if (control->id == sensor_controls[i].qctrl.id) { \ - control->id = 0xffffffff; \ - } \ - control++; \ - } \ - \ - memcpy(controls, &sensor_controls[i].qctrl, sizeof(struct v4l2_queryctrl)); \ - controls++; \ - \ - ctrls->sensor_Seqe = sensor_controls[i].sensor_Seqe; \ - ctrls->cur_value = sensor_controls[i].qctrl.default_value; \ - ctrls->cb = sensor_controls[i].cb; \ - ctrls++; \ - } \ -\ - for (i = 0; i < (sizeof(sensor_menus) / sizeof(struct v4l2_querymenu)); i++) { \ - num = sensor_ops_p->num_menus - sizeof(sensor_menus) / sizeof(struct v4l2_querymenu); \ - menu = sensor_ops_p->menus; \ - while (num--) { \ - if (menu->id == sensor_menus[i].id) { \ - menu->id = 0xffffffff; \ - } \ - menu++; \ - } \ - \ - memcpy(menus, &sensor_menus[i], sizeof(struct v4l2_querymenu)); \ - menus++; \ - } \ -\ - spsensor->common_sensor.info_priv.datafmt = sensor_colour_fmts; \ - spsensor->common_sensor.info_priv.num_datafmt = ARRAY_SIZE(sensor_colour_fmts); \ - spsensor->common_sensor.sensor_ops = sensor_ops_p; \ - icd->ops = sensor_ops_p; \ - spsensor->common_sensor.info_priv.curfmt= sensor_colour_fmts[0]; \ -\ - if (config_flash) { \ - hrtimer_init(&(spsensor->common_sensor.flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); \ - spsensor->common_sensor.flash_off_timer.icd = icd; \ - } \ - if (CFG_FunChk(sensor_config, CFG_Focus)) { \ - mutex_init(&spsensor->common_sensor.sensor_focus.focus_lock); \ - spsensor->common_sensor.sensor_focus.focus_mode = WqCmd_af_invalid; \ - spsensor->common_sensor.sensor_focus.focus_state = FocusState_Inval;\ - spsensor->common_sensor.sensor_focus.focus_cb.sensor_focus_init_cb = sensor_focus_init_usr_cb; \ - spsensor->common_sensor.sensor_focus.focus_cb.sensor_af_single_cb = sensor_focus_af_single_usr_cb; \ - spsensor->common_sensor.sensor_focus.focus_cb.sensor_af_near_cb = sensor_focus_af_near_usr_cb; \ - spsensor->common_sensor.sensor_focus.focus_cb.sensor_af_far_cb = sensor_focus_af_far_usr_cb; \ - spsensor->common_sensor.sensor_focus.focus_cb.sensor_af_specialpos_cb = sensor_focus_af_specialpos_usr_cb; \ - if (CFG_FunChk(sensor_config, CFG_FocusContinues)) {\ - spsensor->common_sensor.sensor_focus.focus_cb.sensor_af_const_cb = sensor_focus_af_const_usr_cb; \ - spsensor->common_sensor.sensor_focus.focus_cb.sensor_af_const_pause_cb = sensor_focus_af_const_pause_usr_cb; \ - }\ - if (CFG_FunChk(sensor_config, CFG_FocusZone)) \ - spsensor->common_sensor.sensor_focus.focus_cb.sensor_af_zoneupdate_cb = sensor_focus_af_zoneupdate_usr_cb; \ - spsensor->common_sensor.sensor_focus.focus_cb.sensor_af_close_cb = sensor_focus_af_close_usr_cb; \ - } else { \ - spsensor->common_sensor.sensor_focus.focus_cb.sensor_focus_init_cb = NULL; \ - spsensor->common_sensor.sensor_focus.focus_cb.sensor_af_single_cb = NULL; \ - spsensor->common_sensor.sensor_focus.focus_cb.sensor_af_near_cb = NULL; \ - spsensor->common_sensor.sensor_focus.focus_cb.sensor_af_far_cb = NULL; \ - spsensor->common_sensor.sensor_focus.focus_cb.sensor_af_specialpos_cb = NULL; \ - spsensor->common_sensor.sensor_focus.focus_cb.sensor_af_const_cb = NULL; \ - spsensor->common_sensor.sensor_focus.focus_cb.sensor_af_zoneupdate_cb = NULL; \ - spsensor->common_sensor.sensor_focus.focus_cb.sensor_af_close_cb = NULL; \ - } \ -\ - memcpy(spsensor->common_sensor.dev_name, dev_name(icd->pdev), sizeof(spsensor->common_sensor.dev_name) - 1); \ -} - -#define sensor_v4l2_struct_initialization() static struct v4l2_subdev_core_ops sensor_subdev_core_ops = {\ - .init = generic_sensor_init,\ - .g_ctrl = generic_sensor_g_control,\ - .s_ctrl = generic_sensor_s_control,\ - .g_ext_ctrls = generic_sensor_g_ext_controls,\ - .s_ext_ctrls = generic_sensor_s_ext_controls,\ - .ioctl = generic_sensor_ioctl,\ - .s_power = generic_sensor_s_power,\ -};\ -\ -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = {\ - .s_mbus_fmt = generic_sensor_s_fmt,\ - .g_mbus_fmt = generic_sensor_g_fmt,\ - .cropcap = generic_sensor_cropcap,\ - .try_mbus_fmt = generic_sensor_try_fmt,\ - .enum_mbus_fmt = generic_sensor_enum_fmt,\ - .enum_frameintervals = generic_sensor_enum_frameintervals,\ - .s_stream = generic_sensor_s_stream,\ - .enum_framesizes = generic_sensor_enum_framesizes,\ -};\ -static struct v4l2_subdev_ops sensor_subdev_ops = {\ - .core = &sensor_subdev_core_ops,\ - .video = &sensor_subdev_video_ops,\ -};\ -\ -static const struct i2c_device_id sensor_id[] = {\ - {SENSOR_NAME_STRING(), 0 },\ - {"\0",0}\ -};\ -\ -MODULE_DEVICE_TABLE(i2c, sensor_id); - -#define sensor_probe_default_code() static int sensor_probe(struct i2c_client *client,\ - const struct i2c_device_id *did)\ -{\ - struct specific_sensor *spsensor = NULL;\ - struct soc_camera_subdev_desc *ssdd = client->dev.platform_data;\ - struct soc_camera_desc *desc = container_of(ssdd, struct soc_camera_desc, subdev_desc);\ - struct soc_camera_device *icd = ssdd->socdev;\ - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);\ -\ - int ret = 0;\ -\ - if (!icd) {\ - dev_err(&client->dev, "%s: missing soc-camera data!\n", SENSOR_NAME_STRING());\ - ret = -EINVAL;\ - goto sensor_probe_end;\ - }\ -\ - desc = to_soc_camera_desc(icd);\ - if (!desc) {\ - SENSOR_TR("driver needs platform data! But it is failed\n");\ - ret = -EINVAL;\ - goto sensor_probe_end;\ - }\ -\ - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) {\ - SENSOR_TR("I2C-Adapter doesn't support I2C_FUNC_I2C\n");\ - ret = -EIO;\ - goto sensor_probe_end;\ - }\ -\ - spsensor = kzalloc(sizeof(struct specific_sensor), GFP_KERNEL);\ - if (!spsensor) {\ - ret = -ENOMEM;\ - SENSOR_TR("kzalloc failed\n");\ - goto sensor_probe_end;\ - }\ -\ - v4l2_i2c_subdev_init(&spsensor->common_sensor.subdev, client, &sensor_subdev_ops);\ - sensor_init_parameters(spsensor, icd);\ - spsensor->common_sensor.client = client;\ - ret = sensor_video_probe(icd, client);\ - if (IS_ERR_VALUE(ret))\ - deinit_sensor_gpios(icd);\ - else\ - sensor_init_parameters_user(spsensor, icd);\ -\ -sensor_probe_end:\ - if (ret != 0) {\ - if (icd->ops) {\ - if (icd->ops->controls) {\ - kfree(icd->ops->controls);\ - icd->ops->controls = NULL;\ - }\ - if (icd->ops->menus) {\ - kfree(icd->ops->menus);\ - icd->ops->menus = NULL;\ - }\ - kfree(icd->ops);\ - icd->ops = NULL;\ - }\ - i2c_set_clientdata(client, NULL);\ - if (spsensor) {\ - kfree(spsensor);\ - }\ - spsensor = NULL;\ - }\ - return ret;\ -} - -#define sensor_remove_default_code() static int sensor_remove(struct i2c_client *client)\ -{\ - struct generic_sensor *sensor = to_generic_sensor(client);\ - struct soc_camera_subdev_desc *ssdd = client->dev.platform_data;\ - struct soc_camera_device *icd = ssdd->socdev;\ - struct specific_sensor *spsensor = to_specific_sensor(sensor);\ - int sensor_config;\ -\ - sensor_config = SensorConfiguration;\ - if (CFG_FunChk(sensor_config, CFG_Focus)) { \ - if (sensor->sensor_focus.sensor_wq) {\ - destroy_workqueue(sensor->sensor_focus.sensor_wq);\ - sensor->sensor_focus.sensor_wq = NULL;\ - }\ - }\ - if (icd->ops) {\ - if (icd->ops->controls) {\ - kfree(icd->ops->controls);\ - icd->ops->controls = NULL;\ - }\ - if (icd->ops->menus) {\ - kfree(icd->ops->menus);\ - icd->ops->menus = NULL;\ - }\ - kfree(icd->ops);\ - icd->ops = NULL;\ - }\ - i2c_set_clientdata(client, NULL);\ - if (spsensor) {\ - kfree(spsensor);\ - }\ - spsensor = NULL;\ - return 0;\ -} - -#define sensor_driver_default_module_code() static struct i2c_driver sensor_i2c_driver = {\ - .driver = {\ - .name = SENSOR_NAME_STRING(),\ - },\ - .probe = sensor_probe,\ - .remove = sensor_remove,\ - .id_table = sensor_id,\ -};\ -\ -static int __init sensor_mod_init(void)\ -{\ - return i2c_add_driver(&sensor_i2c_driver);\ -}\ -\ -static void __exit sensor_mod_exit(void)\ -{\ - i2c_del_driver(&sensor_i2c_driver);\ -}\ -\ -device_initcall_sync(sensor_mod_init);\ -module_exit(sensor_mod_exit);\ -MODULE_DESCRIPTION(SENSOR_NAME_STRING(sensor driver)); \ -MODULE_AUTHOR("");\ -\ -MODULE_LICENSE("GPL"); -#endif diff --git a/drivers/media/video/gt2005.c b/drivers/media/video/gt2005.c deleted file mode 100644 index 103ad6770dac..000000000000 --- a/drivers/media/video/gt2005.c +++ /dev/null @@ -1,1263 +0,0 @@ -/* - * drivers/media/video/gt2005.c - * - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "generic_sensor.h" -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.0.3: -* add sensor_focus_af_const_pause_usr_cb; -*/ -static int version = KERNEL_VERSION(0,0,3); -module_param(version, int, S_IRUGO); - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_GT2005 -#define SENSOR_V4L2_IDENT V4L2_IDENT_GT2005 -#define SENSOR_ID 0x5138 -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_PCLK_SAMPLE_RISING|V4L2_MBUS_HSYNC_ACTIVE_HIGH| V4L2_MBUS_VSYNC_ACTIVE_HIGH|\ - V4L2_MBUS_DATA_ACTIVE_HIGH |SOCAM_MCLK_24MHZ) -#define SENSOR_PREVIEW_W 640 -#define SENSOR_PREVIEW_H 480 -#define SENSOR_PREVIEW_FPS 15000 // 15fps -#define SENSOR_FULLRES_L_FPS 7500 // 7.5fps -#define SENSOR_FULLRES_H_FPS 7500 // 7.5fps -#define SENSOR_720P_FPS 0 -#define SENSOR_1080P_FPS 0 - -#define SENSOR_REGISTER_LEN 2 // sensor register address bytes -#define SENSOR_VALUE_LEN 1 // sensor register value bytes - -static unsigned int SensorConfiguration = (CFG_WhiteBalance|CFG_Effect|CFG_Scene); -static unsigned int SensorChipID[] = {SENSOR_ID}; -/* Sensor Driver Configuration End */ - - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a,b) CONS4(SensorReg,SENSOR_REGISTER_LEN,Val,SENSOR_VALUE_LEN)(a,b) -#define sensor_write(client,reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_read(client,reg,v) CONS4(sensor_read_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_write_array generic_sensor_write_array - -struct sensor_parameter -{ - unsigned int PreviewDummyPixels; - unsigned int CaptureDummyPixels; - unsigned int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int PreviewPclk; - unsigned short int CapturePclk; - char awb[6]; -}; - -struct specific_sensor{ - struct generic_sensor common_sensor; - //define user data below - struct sensor_parameter parameter; - u16 shutter; - -}; - -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ - -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_init_data[] ={ - {0x0101 , 0x00}, - {0x0103 , 0x00}, - {0x0105 , 0x00}, - {0x0106 , 0xF0}, - {0x0107 , 0x00}, - {0x0108 , 0x1C}, - {0x0109 , 0x01}, - {0x010A , 0x00}, - {0x010B , 0x00}, - {0x010C , 0x00}, - {0x010D , 0x08}, - {0x010E , 0x00}, - {0x010F , 0x08}, - {0x0110 , 0x06}, - {0x0111 , 0x40}, - {0x0112 , 0x04}, - {0x0113 , 0xB0}, - {0x0114 , 0x00}, - {0x0115 , 0x00}, - //{0x0116 , 0x02}, - //{0x0117 , 0x00}, - // {0x0118 , 0x67}, - //{0x0119 , 0x02}, - //{0x011A , 0x04}, - //{0x011B , 0x01}, - {0x011C , 0x00},//0x01 2011 11 04 - {0x011D , 0x02}, - {0x011E , 0x00}, - {0x011F , 0x00}, - {0x0120 , 0x1C}, - {0x0121 , 0x00}, - {0x0122 , 0x04}, - {0x0123 , 0x00}, - {0x0124 , 0x00}, - {0x0125 , 0x00}, - {0x0126 , 0x00}, - {0x0127 , 0x00}, - {0x0128 , 0x00}, - {0x0200 , 0x00}, - {0x0201 , 0x08}, //0x00 - {0x0202 , 0x40}, - {0x0203 , 0x00}, - {0x0204 , 0x78}, - {0x0205 , 0x1F}, - {0x0206 , 0x0B}, - {0x0207 , 0x20}, - {0x0208 , 0x00}, - {0x0209 , 0x2A}, - {0x020A , 0x01}, - {0x020B , 0x48}, - {0x020C , 0x64}, - {0x020D , 0xC8}, - {0x020E , 0xBC}, - {0x020F , 0x08}, - {0x0210 , 0xD6}, - {0x0211 , 0x00}, - {0x0212 , 0x20}, - {0x0213 , 0x81}, - {0x0214 , 0x15}, - {0x0215 , 0x00}, - {0x0216 , 0x00}, - {0x0217 , 0x00}, - {0x0218 , 0x46}, - {0x0219 , 0x30}, - {0x021A , 0x03}, - {0x021B , 0x28}, - {0x021C , 0x02}, - {0x021D , 0x60}, - {0x021E , 0x00}, - {0x021F , 0x00}, - {0x0220 , 0x10}, - {0x0221 , 0x10}, - {0x0222 , 0x10}, - {0x0223 , 0x10}, - {0x0224 , 0x1F}, - {0x0225 , 0x1E}, - {0x0226 , 0x18}, - {0x0227 , 0x1D}, - {0x0228 , 0x1F}, - {0x0229 , 0x1F}, - {0x022A , 0x01}, - {0x022B , 0x04}, - {0x022C , 0x05}, - {0x022D , 0x05}, - {0x022E , 0x04}, - {0x022F , 0x03}, - {0x0230 , 0x02}, - {0x0231 , 0x1F}, - {0x0232 , 0x1A}, - {0x0233 , 0x19}, - {0x0234 , 0x19}, - {0x0235 , 0x1B}, - {0x0236 , 0x1F}, - {0x0237 , 0x04}, - {0x0238 , 0xEE}, - {0x0239 , 0xFF}, - {0x023A , 0x00}, - {0x023B , 0x00}, - {0x023C , 0x00}, - {0x023D , 0x00}, - {0x023E , 0x00}, - {0x023F , 0x00}, - {0x0240 , 0x00}, - {0x0241 , 0x00}, - {0x0242 , 0x00}, - {0x0243 , 0x21}, - {0x0244 , 0x42}, - {0x0245 , 0x53}, - {0x0246 , 0x54}, - {0x0247 , 0x54}, - {0x0248 , 0x54}, - {0x0249 , 0x33}, - {0x024A , 0x11}, - {0x024B , 0x00}, - {0x024C , 0x00}, - {0x024D , 0xFF}, - {0x024E , 0xEE}, - {0x024F , 0xDD}, - {0x0250 , 0x00}, - {0x0251 , 0x00}, - {0x0252 , 0x00}, - {0x0253 , 0x00}, - {0x0254 , 0x00}, - {0x0255 , 0x00}, - {0x0256 , 0x00}, - {0x0257 , 0x00}, - {0x0258 , 0x00}, - {0x0259 , 0x00}, - {0x025A , 0x00}, - {0x025B , 0x00}, - {0x025C , 0x00}, - {0x025D , 0x00}, - {0x025E , 0x00}, - {0x025F , 0x00}, - {0x0260 , 0x00}, - {0x0261 , 0x00}, - {0x0262 , 0x00}, - {0x0263 , 0x00}, - {0x0264 , 0x00}, - {0x0265 , 0x00}, - {0x0266 , 0x00}, - {0x0267 , 0x00}, - {0x0268 , 0x8F}, - {0x0269 , 0xA3}, - {0x026A , 0xB4}, - {0x026B , 0x90}, - {0x026C , 0x00}, - {0x026D , 0xD0}, - {0x026E , 0x60}, - {0x026F , 0xA0}, - {0x0270 , 0x40}, - {0x0300 , 0x81}, - {0x0301 , 0x80}, - {0x0302 , 0x22}, - {0x0303 , 0x06}, - {0x0304 , 0x03}, - {0x0305 , 0x83}, - {0x0306 , 0x00}, - {0x0307 , 0x22}, - {0x0308 , 0x00}, - {0x0309 , 0x55}, - {0x030A , 0x55}, - {0x030B , 0x55}, - {0x030C , 0x54}, - {0x030D , 0x1F}, - {0x030E , 0x13}, - {0x030F , 0x10}, - {0x0310 , 0x04}, - {0x0311 , 0xFF}, - {0x0312 , 0x98}, - {0x0313 , 0x28}, - {0x0314 , 0x66}, - {0x0315 , 0x16}, - {0x0316 , 0x26}, - {0x0317 , 0x02}, - {0x0318 , 0x08}, - {0x0319 , 0x0C}, - {0x031A , 0x81}, - {0x031B , 0x00}, - {0x031C , 0x3D}, - {0x031D , 0x00}, - {0x031E , 0xF9}, - {0x031F , 0x00}, - {0x0320 , 0x24}, - {0x0321 , 0x14}, - {0x0322 , 0x1A}, - {0x0323 , 0x24}, - {0x0324 , 0x08}, - {0x0325 , 0xF0}, - {0x0326 , 0x30}, - {0x0327 , 0x17}, - {0x0328 , 0x11}, - {0x0329 , 0x22}, - {0x032A , 0x2F}, - {0x032B , 0x21}, - {0x032C , 0xDA}, - {0x032D , 0x10}, - {0x032E , 0xEA}, - {0x032F , 0x18}, - {0x0330 , 0x29}, - {0x0331 , 0x25}, - {0x0332 , 0x12}, - {0x0333 , 0x0F}, - {0x0334 , 0xE0}, - {0x0335 , 0x13}, - {0x0336 , 0xFF}, - {0x0337 , 0x20}, - {0x0338 , 0x46}, - {0x0339 , 0x04}, - {0x033A , 0x04}, - {0x033B , 0xFF}, - {0x033C , 0x01}, - {0x033D , 0x00}, - {0x033E , 0x03}, - {0x033F , 0x28}, - {0x0340 , 0x02}, - {0x0341 , 0x60}, - {0x0342 , 0xAC}, - {0x0343 , 0x97}, - {0x0344 , 0x7F}, - {0x0400 , 0xE8}, - {0x0401 , 0x40}, - {0x0402 , 0x00}, - {0x0403 , 0x00}, - {0x0404 , 0xF8}, - {0x0405 , 0x03}, - {0x0406 , 0x03}, - {0x0407 , 0x85}, - {0x0408 , 0x44}, - {0x0409 , 0x1F}, - {0x040A , 0x40}, - {0x040B , 0x33}, - {0x040C , 0xA0}, - {0x040D , 0x00}, - {0x040E , 0x00}, - {0x040F , 0x00}, - {0x0410 , 0x0D}, - {0x0411 , 0x0D}, - {0x0412 , 0x0C}, - {0x0413 , 0x04}, - {0x0414 , 0x00}, - {0x0415 , 0x00}, - {0x0416 , 0x07}, - {0x0417 , 0x09}, - {0x0418 , 0x16}, - {0x0419 , 0x14}, - {0x041A , 0x11}, - {0x041B , 0x14}, - {0x041C , 0x07}, - {0x041D , 0x07}, - {0x041E , 0x06}, - {0x041F , 0x02}, - {0x0420 , 0x42}, - {0x0421 , 0x42}, - {0x0422 , 0x47}, - {0x0423 , 0x39}, - {0x0424 , 0x3E}, - {0x0425 , 0x4D}, - {0x0426 , 0x46}, - {0x0427 , 0x3A}, - {0x0428 , 0x21}, - {0x0429 , 0x21}, - {0x042A , 0x26}, - {0x042B , 0x1C}, - {0x042C , 0x25}, - {0x042D , 0x25}, - {0x042E , 0x28}, - {0x042F , 0x20}, - {0x0430 , 0x3E}, - {0x0431 , 0x3E}, - {0x0432 , 0x33}, - {0x0433 , 0x2E}, - {0x0434 , 0x54}, - {0x0435 , 0x53}, - {0x0436 , 0x3C}, - {0x0437 , 0x51}, - {0x0438 , 0x2B}, - {0x0439 , 0x2B}, - {0x043A , 0x38}, - {0x043B , 0x22}, - {0x043C , 0x3B}, - {0x043D , 0x3B}, - {0x043E , 0x31}, - {0x043F , 0x37}, - {0x0440 , 0x00}, - {0x0441 , 0x4B}, - {0x0442 , 0x00}, - {0x0443 , 0x00}, - {0x0444 , 0x31}, - {0x0445 , 0x00}, - {0x0446 , 0x00}, - {0x0447 , 0x00}, - {0x0448 , 0x00}, - {0x0449 , 0x00}, - {0x044A , 0x00}, - {0x044D , 0xE0}, - {0x044E , 0x05}, - {0x044F , 0x07}, - {0x0450 , 0x00}, - {0x0451 , 0x00}, - {0x0452 , 0x00}, - {0x0453 , 0x00}, - {0x0454 , 0x00}, - {0x0455 , 0x00}, - {0x0456 , 0x00}, - {0x0457 , 0x00}, - {0x0458 , 0x00}, - {0x0459 , 0x00}, - {0x045A , 0x00}, - {0x045B , 0x00}, - {0x045C , 0x00}, - {0x045D , 0x00}, - {0x045E , 0x00}, - {0x045F , 0x00}, - {0x0460 , 0x80}, - {0x0461 , 0x10}, - {0x0462 , 0x10}, - {0x0463 , 0x10}, - {0x0464 , 0x08}, - {0x0465 , 0x08}, - {0x0466 , 0x11}, - {0x0467 , 0x09}, - {0x0468 , 0x23}, - {0x0469 , 0x2A}, - {0x046A , 0x2A}, - {0x046B , 0x47}, - {0x046C , 0x52}, - {0x046D , 0x42}, - {0x046E , 0x36}, - {0x046F , 0x46}, - {0x0470 , 0x3A}, - {0x0471 , 0x32}, - {0x0472 , 0x32}, - {0x0473 , 0x38}, - {0x0474 , 0x3D}, - {0x0475 , 0x2F}, - {0x0476 , 0x29}, - {0x0477 , 0x48}, - {0x0600 , 0x00}, - {0x0601 , 0x24}, - {0x0602 , 0x45}, - {0x0603 , 0x0E}, - {0x0604 , 0x14}, - {0x0605 , 0x2F}, - {0x0606 , 0x01}, - {0x0607 , 0x0E}, - {0x0608 , 0x0E}, - {0x0609 , 0x37}, - {0x060A , 0x18}, - {0x060B , 0xA0}, - {0x060C , 0x20}, - {0x060D , 0x07}, - {0x060E , 0x47}, - {0x060F , 0x90}, - {0x0610 , 0x06}, - {0x0611 , 0x0C}, - {0x0612 , 0x28}, - {0x0613 , 0x13}, - {0x0614 , 0x0B}, - {0x0615 , 0x10}, - {0x0616 , 0x14}, - {0x0617 , 0x19}, - {0x0618 , 0x52}, - {0x0619 , 0xA0}, - {0x061A , 0x11}, - {0x061B , 0x33}, - {0x061C , 0x56}, - {0x061D , 0x20}, - {0x061E , 0x28}, - {0x061F , 0x2B}, - {0x0620 , 0x22}, - {0x0621 , 0x11}, - {0x0622 , 0x75}, - {0x0623 , 0x49}, - {0x0624 , 0x6E}, - {0x0625 , 0x80}, - {0x0626 , 0x02}, - {0x0627 , 0x0C}, - {0x0628 , 0x51}, - {0x0629 , 0x25}, - {0x062A , 0x01}, - {0x062B , 0x3D}, - {0x062C , 0x04}, - {0x062D , 0x01}, - {0x062E , 0x0C}, - {0x062F , 0x2C}, - {0x0630 , 0x0D}, - {0x0631 , 0x14}, - {0x0632 , 0x12}, - {0x0633 , 0x34}, - {0x0634 , 0x00}, - {0x0635 , 0x00}, - {0x0636 , 0x00}, - {0x0637 , 0xB1}, - {0x0638 , 0x22}, - {0x0639 , 0x32}, - {0x063A , 0x0E}, - {0x063B , 0x18}, - {0x063C , 0x88}, - {0x0640 , 0xB2}, - {0x0641 , 0xC0}, - {0x0642 , 0x01}, - {0x0643 , 0x26}, - {0x0644 , 0x13}, - {0x0645 , 0x88}, - {0x0646 , 0x64}, - {0x0647 , 0x00}, - {0x0681 , 0x1B}, - {0x0682 , 0xA0}, - {0x0683 , 0x28}, - {0x0684 , 0x00}, - {0x0685 , 0xB0}, - {0x0686 , 0x6F}, - {0x0687 , 0x33}, - {0x0688 , 0x1F}, - {0x0689 , 0x44}, - {0x068A , 0xA8}, - {0x068B , 0x44}, - {0x068C , 0x08}, - {0x068D , 0x08}, - {0x068E , 0x00}, - {0x068F , 0x00}, - {0x0690 , 0x01}, - {0x0691 , 0x00}, - {0x0692 , 0x01}, - {0x0693 , 0x00}, - {0x0694 , 0x00}, - {0x0695 , 0x00}, - {0x0696 , 0x00}, - {0x0697 , 0x00}, - {0x0698 , 0x2A}, - {0x0699 , 0x80}, - {0x069A , 0x1F}, - {0x069B , 0x00}, - {0x069C , 0x02}, - {0x069D , 0xF5}, - {0x069E , 0x03}, - {0x069F , 0x6D}, - {0x06A0 , 0x0C}, - {0x06A1 , 0xB8}, - {0x06A2 , 0x0D}, - {0x06A3 , 0x74}, - {0x06A4 , 0x00}, - {0x06A5 , 0x2F}, - {0x06A6 , 0x00}, - {0x06A7 , 0x2F}, - {0x0F00 , 0x00}, - {0x0F01 , 0x00}, - {0x0100 , 0x01}, - {0x0102 , 0x02}, - {0x0104 , 0x03}, - - - /////////////////////////// - {0x020B , 0x48}, - {0x020C , 0x64}, - {0x040A , 0x40}, - {0x040B , 0x33}, - {0x0109 , 0x00}, - {0x010A , 0x04}, - {0x010B , 0x03}, - - {0x0110, 0x03}, - {0x0111, 0x20}, - {0x0112, 0x02}, - {0x0113, 0x58}, - - {0x0116 , 0x02}, - {0x0118 , 0x56},//56 0x40 - {0x0119 , 0x02}, - {0x011a , 0x04}, - {0x011B , 0x01}, - {0x0313 , 0x36},//36 - {0x0314 , 0xff},//ff - {0x0315 , 0x16}, - /* - {0x020B , 0x48}, - {0x020C , 0x64}, - {0x040A , 0x40}, - {0x040B , 0x33}, - {0x0109 , 0x00}, - {0x010A , 0x04}, - {0x010B , 0x03}, - {0x010c , 0x00}, - {0x010d , 0xa8}, - {0x010e , 0x00}, - {0x010f , 0x60}, - {0x010a , 0x04}, - - {0x0110 , 0x02}, - {0x0111 , 0x80}, - {0x0112 , 0x01}, - {0x0113 , 0xe0}, - - {0x0116 , 0x02}, - {0x0118 , 0x40}, - {0x0119 , 0x01}, - {0x011a , 0x04}, - {0x011B , 0x00}, - {0x0313 , 0x35}, - {0x0314 , 0x36}, - {0x0315 , 0x16}, */ - SensorEnd -}; -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={ - //Binning&Resoultion - {0x0109 , 0x01},//Fixed the number of lines by VCOUNT setting - {0x010A , 0x00}, - {0x010B , 0x00}, - - {0x0110 , 0x06}, - {0x0111 , 0x40}, - {0x0112 , 0x04}, - {0x0113 , 0xB0}, // 1600*1200 SETTING - SensorEnd - -}; - -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] ={ - SensorEnd -}; -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data[] = -{ - {0x0109 , 0x00}, - {0x010A , 0x04}, - {0x010B , 0x03}, - - {0x0110 , 0x02}, - {0x0111 , 0x80}, - {0x0112 , 0x01}, - {0x0113 , 0xe0}, - SensorEnd -}; -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[]={ - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[]={ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_softreset_data[]={ - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[]={ - SensorRegVal(0x0000,0), - SensorRegVal(0x0001,0), - SensorEnd -}; -/* -* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx -*/ -static struct rk_sensor_reg sensor_WhiteB_Auto[]= -{ - {0x031a , 0x81}, - {0x0320 , 0x24}, - {0x0321 , 0x14}, - {0x0322 , 0x1a}, - {0x0323 , 0x24}, - {0x0441 , 0x4B}, - {0x0442 , 0x00}, - {0x0443 , 0x00}, - {0x0444 , 0x31}, - SensorEnd -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[]= -{ - {0x0320 , 0x02}, - {0x0321 , 0x02}, - {0x0322 , 0x02}, - {0x0323 , 0x02}, - {0x0441 , 0x80}, - {0x0442 , 0x00}, - {0x0443 , 0x00}, - {0x0444 , 0x0D}, - SensorEnd -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x0320 , 0x02}, - {0x0321 , 0x02}, - {0x0322 , 0x02}, - {0x0323 , 0x02}, - {0x0441 , 0x60}, - {0x0442 , 0x00}, - {0x0443 , 0x00}, - {0x0444 , 0x14}, - SensorEnd -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0x0320 , 0x02}, - {0x0321 , 0x02}, - {0x0322 , 0x02}, - {0x0323 , 0x02}, - {0x0441 , 0x50}, - {0x0442 , 0x00}, - {0x0443 , 0x00}, - {0x0444 , 0x30}, - SensorEnd - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x0320 , 0x02}, - {0x0321 , 0x02}, - {0x0322 , 0x02}, - {0x0323 , 0x02}, - {0x0441 , 0x0B}, - {0x0442 , 0x00}, - {0x0443 , 0x00}, - {0x0444 , 0x5E}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[]= -{ - // Brightness -2 - {0x0300 , 0x81}, - {0x0301 , 0x60}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[]= -{ - // Brightness -1 - {0x0300 , 0x81}, - {0x0301 , 0x70}, - - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[]= -{ - // Brightness 0 - {0x0300 , 0x81}, - {0x0301 , 0x80}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[]= -{ - // Brightness +1 - {0x0300 , 0x81}, - {0x0301 , 0x90}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[]= -{ - // Brightness +2 - {0x0300 , 0x81}, - {0x0301 , 0xa0}, - - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[]= -{ - // Brightness +3 - {0x0300 , 0x81}, - {0x0301 , 0xb0}, - - SensorEnd -}; -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = -{ - {0x0115,0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = -{ - {0x0115,0x06}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = -{ - {0x0115,0x0a}, - {0x026e,0x60}, - {0x026f,0xa0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Negative[] = -{ - //Negative - {0x0115,0x09}, //bit[6] negative - SensorEnd -}; -static struct rk_sensor_reg sensor_Effect_Bluish[] = -{ - // Bluish - {0x0115,0x0a}, - {0x026e,0xfb}, - {0x026f,0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = -{ - // Greenish - {0x0115,0x0a}, - {0x026e,0x20}, - {0x026f,0x00}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; - -static struct rk_sensor_reg sensor_Exposure0[]= -{ - //-3 - {0x0300 , 0x81}, - {0x0301 , 0x50}, - {0x0201 , 0xa0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure1[]= -{ - //-2 - {0x0300 , 0x81}, - {0x0301 , 0x60}, - {0x0201 , 0xb0}, - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure2[]= -{ - //-0.3EV - {0x0300 , 0x81}, - {0x0301 , 0x70}, - {0x0201 , 0xd0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure3[]= -{ - //default - {0x0300 , 0x81}, - {0x0301 , 0x80}, - {0x0201 , 0x10},//0c - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure4[]= -{ - // 1 - {0x0300 , 0x81}, - {0x0301 , 0x90}, - {0x0201 , 0x30}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure5[]= -{ - // 2 - {0x0300 , 0x81}, - {0x0301 , 0xa0}, - {0x0201 , 0x50}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure6[]= -{ - // 3 - {0x0300 , 0x81}, - {0x0301 , 0xb0}, - {0x0201 , 0x60}, - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; - -static struct rk_sensor_reg sensor_Saturation0[]= -{ - {0x0202 , 0x40}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[]= -{ - {0x0202 , 0x50}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[]= -{ - {0x0202 , 0x60}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -static struct rk_sensor_reg sensor_Contrast0[]= -{ - //Contrast -3 - {0x0200 , 0xe8}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast1[]= -{ - //Contrast -2 - {0x0200 , 0xf0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast2[]= -{ - // Contrast -1 - {0x0200 , 0xf8}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast3[]= -{ - //Contrast 0 - {0x0200 , 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast4[]= -{ - //Contrast +1 - {0x0200 , 0x10}, - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Contrast5[]= -{ - //Contrast +2 - {0x0200 , 0x20}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast6[]= -{ - //Contrast +3 - {0x0200 , 0x30}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; -static struct rk_sensor_reg sensor_SceneAuto[] = -{ - {0x0312, 0x08}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = -{ - //30fps ~ 5fps night mode for 60/50Hz light environment, 24Mhz clock input,36Mzh pclk - - - {0x0312, 0x98}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -static struct rk_sensor_reg sensor_Zoom0[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Zoom3[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; - -/* -* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu -*/ -static struct v4l2_querymenu sensor_menus[] = -{ -}; -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = -{ -}; - -//MUST define the current used format as the first item -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {MEDIA_BUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG} -}; -/*static struct soc_camera_ops sensor_ops;*/ - - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - - return 0; -} -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - - return 0; -} -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - - return 0; -} -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh (struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - return 0; -} -static int sensor_softrest_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - return 0; -} -static int sensor_try_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf) -{ - return 0; -} -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("Suspend"); - - } else { - SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n",pm_msg.event); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - - SENSOR_DG("Resume"); - - return 0; - -} -static int sensor_mirror_cb (struct i2c_client *client, int mirror) -{ - char val; - int err = 0; - - SENSOR_DG("mirror: %d",mirror); - if (mirror) { - err = sensor_read(client, 0x0101, &val); - if (err == 0) { - if((val & 0x1) == 0){ - err = sensor_write(client, 0x0101, (val |0x1)); - } - else - err = sensor_write(client, 0x0101, (val & 0xfe)); - } - } else { - //do nothing - } - return err; -} -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_mirror_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_mirror failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_mirror success, value:0x%x",ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - char val; - int err = 0; - - SENSOR_DG("flip: %d",flip); - if (flip) { - err = sensor_read(client, 0x0101, &val); - if (err == 0) { - if((val & 0x2) == 0){ - err = sensor_write(client, 0x0101, (val |0x2)); - } - else { - err = sensor_write(client, 0x0101, (val & 0xfc)); - } - } - } else { - //do nothing - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_flip_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_flip failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_flip success, value:0x%x",ext_ctrl->value); - return 0; -} -/* -* the functions are focus callbacks -*/ -static int sensor_focus_init_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos){ - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client){ - return 0; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos) -{ - return 0; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client,int on){ - return 0; -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor* spsensor,struct soc_camera_device *icd) -{ - return; -} - -/* -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); - - - - - - diff --git a/drivers/media/video/gt2005_old.c b/drivers/media/video/gt2005_old.c deleted file mode 100755 index d9915c3aebd1..000000000000 --- a/drivers/media/video/gt2005_old.c +++ /dev/null @@ -1,3727 +0,0 @@ -/* -o* Driver for MT9M001 CMOS Image Sensor from Micron - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_GT2005 -#define SENSOR_V4L2_IDENT V4L2_IDENT_GT2005 -#define SENSOR_ID 0x5138 -#define SENSOR_MIN_WIDTH 640 -#define SENSOR_MIN_HEIGHT 480 -#define SENSOR_MAX_WIDTH 1600 -#define SENSOR_MAX_HEIGHT 1200 -#define SENSOR_INIT_WIDTH 640 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 480 -#define SENSOR_INIT_WINSEQADR sensor_vga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_YUYV8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 1 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 1 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 - -#define CONFIG_SENSOR_I2C_SPEED 250000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) - -struct reginfo -{ - u16 reg; - u8 val; -}; - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); - -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_GT2005_USER_DEFINED_SERIES -#include "gt2005_user_series.c" -#else -/* init 352X288 SVGA */ -static struct reginfo sensor_init_data[] = -{ - {0x0101 , 0x00}, - {0x0103 , 0x00}, - {0x0105 , 0x00}, - {0x0106 , 0xF0}, - {0x0107 , 0x00}, - {0x0108 , 0x1C}, - {0x0109 , 0x01}, - {0x010A , 0x00}, - {0x010B , 0x00}, - {0x010C , 0x00}, - {0x010D , 0x08}, - {0x010E , 0x00}, - {0x010F , 0x08}, - {0x0110 , 0x06}, - {0x0111 , 0x40}, - {0x0112 , 0x04}, - {0x0113 , 0xB0}, -{0x0114 , 0x00}, - {0x0115 , 0x00}, - {0x0116 , 0x02}, - {0x0117 , 0x00}, -{0x0118 , 0x67}, - {0x0119 , 0x02}, - {0x011A , 0x04}, - {0x011B , 0x01}, -{0x011C , 0x01}, -{0x011D , 0x02}, -{0x011E , 0x00}, -{0x011F , 0x00}, -{0x0120 , 0x1C}, -{0x0121 , 0x00}, -{0x0122 , 0x04}, -{0x0123 , 0x00}, -{0x0124 , 0x00}, -{0x0125 , 0x00}, -{0x0126 , 0x00}, -{0x0127 , 0x00}, -{0x0128 , 0x00}, -{0x0200 , 0x00}, -{0x0201 , 0x00}, -{0x0202 , 0x40}, -{0x0203 , 0x00}, -{0x0204 , 0x03}, -{0x0205 , 0x1F}, -{0x0206 , 0x0B}, -{0x0207 , 0x20}, -{0x0208 , 0x00}, -{0x0209 , 0x2A}, -{0x020A , 0x01}, -{0x020B , 0x48}, -{0x020C , 0x64}, -{0x020D , 0xC8}, -{0x020E , 0xBC}, -{0x020F , 0x08}, -{0x0210 , 0xD6}, -{0x0211 , 0x00}, -{0x0212 , 0x20}, -{0x0213 , 0x81}, -{0x0214 , 0x15}, -{0x0215 , 0x00}, -{0x0216 , 0x00}, -{0x0217 , 0x00}, -{0x0218 , 0x46}, -{0x0219 , 0x30}, -{0x021A , 0x03}, -{0x021B , 0x28}, -{0x021C , 0x02}, -{0x021D , 0x60}, -{0x021E , 0x00}, -{0x021F , 0x00}, -{0x0220 , 0x08}, -{0x0221 , 0x08}, -{0x0222 , 0x04}, -{0x0223 , 0x00}, -{0x0224 , 0x1F}, -{0x0225 , 0x1E}, -{0x0226 , 0x18}, -{0x0227 , 0x1D}, -{0x0228 , 0x1F}, -{0x0229 , 0x1F}, -{0x022A , 0x01}, -{0x022B , 0x04}, -{0x022C , 0x05}, -{0x022D , 0x05}, -{0x022E , 0x04}, -{0x022F , 0x03}, -{0x0230 , 0x02}, -{0x0231 , 0x1F}, -{0x0232 , 0x1A}, -{0x0233 , 0x19}, -{0x0234 , 0x19}, -{0x0235 , 0x1B}, -{0x0236 , 0x1F}, -{0x0237 , 0x04}, -{0x0238 , 0xEE}, -{0x0239 , 0xFF}, -{0x023A , 0x00}, -{0x023B , 0x00}, -{0x023C , 0x00}, -{0x023D , 0x00}, -{0x023E , 0x00}, -{0x023F , 0x00}, -{0x0240 , 0x00}, -{0x0241 , 0x00}, -{0x0242 , 0x00}, -{0x0243 , 0x21}, -{0x0244 , 0x42}, -{0x0245 , 0x53}, -{0x0246 , 0x54}, -{0x0247 , 0x54}, -{0x0248 , 0x54}, -{0x0249 , 0x33}, -{0x024A , 0x11}, -{0x024B , 0x00}, -{0x024C , 0x00}, -{0x024D , 0xFF}, -{0x024E , 0xEE}, -{0x024F , 0xDD}, -{0x0250 , 0x00}, -{0x0251 , 0x00}, -{0x0252 , 0x00}, -{0x0253 , 0x00}, -{0x0254 , 0x00}, -{0x0255 , 0x00}, -{0x0256 , 0x00}, -{0x0257 , 0x00}, -{0x0258 , 0x00}, -{0x0259 , 0x00}, -{0x025A , 0x00}, -{0x025B , 0x00}, -{0x025C , 0x00}, -{0x025D , 0x00}, -{0x025E , 0x00}, -{0x025F , 0x00}, -{0x0260 , 0x00}, -{0x0261 , 0x00}, -{0x0262 , 0x00}, -{0x0263 , 0x00}, -{0x0264 , 0x00}, -{0x0265 , 0x00}, -{0x0266 , 0x00}, -{0x0267 , 0x00}, -{0x0268 , 0x8F}, -{0x0269 , 0xA3}, -{0x026A , 0xB4}, -{0x026B , 0x90}, -{0x026C , 0x00}, -{0x026D , 0xD0}, -{0x026E , 0x60}, -{0x026F , 0xA0}, -{0x0270 , 0x40}, -{0x0300 , 0x81}, -{0x0301 , 0x80}, -{0x0302 , 0x22}, -{0x0303 , 0x06}, -{0x0304 , 0x03}, -{0x0305 , 0x83}, -{0x0306 , 0x00}, -{0x0307 , 0x22}, -{0x0308 , 0x00}, -{0x0309 , 0x55}, -{0x030A , 0x55}, -{0x030B , 0x55}, -{0x030C , 0x54}, -{0x030D , 0x1F}, -{0x030E , 0x13}, -{0x030F , 0x10}, -{0x0310 , 0x04}, -{0x0311 , 0xFF}, -{0x0312 , 0x08}, -{0x0313 , 0x28}, -{0x0314 , 0x66}, -{0x0315 , 0x16}, -{0x0316 , 0x26}, -{0x0317 , 0x02}, -{0x0318 , 0x08}, -{0x0319 , 0x0C}, -{0x031A , 0x81}, -{0x031B , 0x00}, -{0x031C , 0x3D}, -{0x031D , 0x00}, -{0x031E , 0xF9}, -{0x031F , 0x00}, -{0x0320 , 0x24}, -{0x0321 , 0x14}, -{0x0322 , 0x1A}, -{0x0323 , 0x24}, -{0x0324 , 0x08}, -{0x0325 , 0xF0}, -{0x0326 , 0x30}, -{0x0327 , 0x17}, -{0x0328 , 0x11}, -{0x0329 , 0x22}, -{0x032A , 0x2F}, -{0x032B , 0x21}, -{0x032C , 0xDA}, -{0x032D , 0x10}, -{0x032E , 0xEA}, -{0x032F , 0x18}, -{0x0330 , 0x29}, -{0x0331 , 0x25}, -{0x0332 , 0x12}, -{0x0333 , 0x0F}, -{0x0334 , 0xE0}, -{0x0335 , 0x13}, -{0x0336 , 0xFF}, -{0x0337 , 0x20}, -{0x0338 , 0x46}, -{0x0339 , 0x04}, -{0x033A , 0x04}, -{0x033B , 0xFF}, -{0x033C , 0x01}, -{0x033D , 0x00}, -{0x033E , 0x03}, -{0x033F , 0x28}, -{0x0340 , 0x02}, -{0x0341 , 0x60}, -{0x0342 , 0xAC}, -{0x0343 , 0x97}, -{0x0344 , 0x7F}, -{0x0400 , 0xE8}, -{0x0401 , 0x40}, -{0x0402 , 0x00}, -{0x0403 , 0x00}, -{0x0404 , 0xF8}, -{0x0405 , 0x03}, -{0x0406 , 0x03}, -{0x0407 , 0x85}, -{0x0408 , 0x44}, -{0x0409 , 0x1F}, -{0x040A , 0x40}, -{0x040B , 0x33}, -{0x040C , 0xA0}, -{0x040D , 0x00}, -{0x040E , 0x00}, -{0x040F , 0x00}, -{0x0410 , 0x0D}, -{0x0411 , 0x0D}, -{0x0412 , 0x0C}, -{0x0413 , 0x04}, -{0x0414 , 0x00}, -{0x0415 , 0x00}, -{0x0416 , 0x07}, -{0x0417 , 0x09}, -{0x0418 , 0x16}, -{0x0419 , 0x14}, -{0x041A , 0x11}, -{0x041B , 0x14}, -{0x041C , 0x07}, -{0x041D , 0x07}, -{0x041E , 0x06}, -{0x041F , 0x02}, -{0x0420 , 0x42}, -{0x0421 , 0x42}, -{0x0422 , 0x47}, -{0x0423 , 0x39}, -{0x0424 , 0x3E}, -{0x0425 , 0x4D}, -{0x0426 , 0x46}, -{0x0427 , 0x3A}, -{0x0428 , 0x21}, -{0x0429 , 0x21}, -{0x042A , 0x26}, -{0x042B , 0x1C}, -{0x042C , 0x25}, -{0x042D , 0x25}, -{0x042E , 0x28}, -{0x042F , 0x20}, -{0x0430 , 0x3E}, -{0x0431 , 0x3E}, -{0x0432 , 0x33}, -{0x0433 , 0x2E}, -{0x0434 , 0x54}, -{0x0435 , 0x53}, -{0x0436 , 0x3C}, -{0x0437 , 0x51}, -{0x0438 , 0x2B}, -{0x0439 , 0x2B}, -{0x043A , 0x38}, -{0x043B , 0x22}, -{0x043C , 0x3B}, -{0x043D , 0x3B}, -{0x043E , 0x31}, -{0x043F , 0x37}, -{0x0440 , 0x00}, -{0x0441 , 0x4B}, -{0x0442 , 0x00}, -{0x0443 , 0x00}, -{0x0444 , 0x31}, -{0x0445 , 0x00}, -{0x0446 , 0x00}, -{0x0447 , 0x00}, -{0x0448 , 0x00}, -{0x0449 , 0x00}, -{0x044A , 0x00}, -{0x044D , 0xE0}, -{0x044E , 0x05}, -{0x044F , 0x07}, -{0x0450 , 0x00}, -{0x0451 , 0x00}, -{0x0452 , 0x00}, -{0x0453 , 0x00}, -{0x0454 , 0x00}, -{0x0455 , 0x00}, -{0x0456 , 0x00}, -{0x0457 , 0x00}, -{0x0458 , 0x00}, -{0x0459 , 0x00}, -{0x045A , 0x00}, -{0x045B , 0x00}, -{0x045C , 0x00}, -{0x045D , 0x00}, -{0x045E , 0x00}, -{0x045F , 0x00}, -{0x0460 , 0x80}, -{0x0461 , 0x10}, -{0x0462 , 0x10}, -{0x0463 , 0x10}, -{0x0464 , 0x08}, -{0x0465 , 0x08}, -{0x0466 , 0x11}, -{0x0467 , 0x09}, -{0x0468 , 0x23}, -{0x0469 , 0x2A}, -{0x046A , 0x2A}, -{0x046B , 0x47}, -{0x046C , 0x52}, -{0x046D , 0x42}, -{0x046E , 0x36}, -{0x046F , 0x46}, -{0x0470 , 0x3A}, -{0x0471 , 0x32}, -{0x0472 , 0x32}, -{0x0473 , 0x38}, -{0x0474 , 0x3D}, -{0x0475 , 0x2F}, -{0x0476 , 0x29}, -{0x0477 , 0x48}, -{0x0600 , 0x00}, -{0x0601 , 0x24}, -{0x0602 , 0x45}, -{0x0603 , 0x0E}, -{0x0604 , 0x14}, -{0x0605 , 0x2F}, -{0x0606 , 0x01}, -{0x0607 , 0x0E}, -{0x0608 , 0x0E}, -{0x0609 , 0x37}, -{0x060A , 0x18}, -{0x060B , 0xA0}, -{0x060C , 0x20}, -{0x060D , 0x07}, -{0x060E , 0x47}, -{0x060F , 0x90}, -{0x0610 , 0x06}, -{0x0611 , 0x0C}, -{0x0612 , 0x28}, -{0x0613 , 0x13}, -{0x0614 , 0x0B}, -{0x0615 , 0x10}, -{0x0616 , 0x14}, -{0x0617 , 0x19}, -{0x0618 , 0x52}, -{0x0619 , 0xA0}, -{0x061A , 0x11}, -{0x061B , 0x33}, -{0x061C , 0x56}, -{0x061D , 0x20}, -{0x061E , 0x28}, -{0x061F , 0x2B}, -{0x0620 , 0x22}, -{0x0621 , 0x11}, -{0x0622 , 0x75}, -{0x0623 , 0x49}, -{0x0624 , 0x6E}, -{0x0625 , 0x80}, -{0x0626 , 0x02}, -{0x0627 , 0x0C}, -{0x0628 , 0x51}, -{0x0629 , 0x25}, -{0x062A , 0x01}, -{0x062B , 0x3D}, -{0x062C , 0x04}, -{0x062D , 0x01}, -{0x062E , 0x0C}, -{0x062F , 0x2C}, -{0x0630 , 0x0D}, -{0x0631 , 0x14}, -{0x0632 , 0x12}, -{0x0633 , 0x34}, -{0x0634 , 0x00}, -{0x0635 , 0x00}, -{0x0636 , 0x00}, -{0x0637 , 0xB1}, -{0x0638 , 0x22}, -{0x0639 , 0x32}, -{0x063A , 0x0E}, -{0x063B , 0x18}, -{0x063C , 0x88}, -{0x0640 , 0xB2}, -{0x0641 , 0xC0}, -{0x0642 , 0x01}, -{0x0643 , 0x26}, -{0x0644 , 0x13}, -{0x0645 , 0x88}, -{0x0646 , 0x64}, -{0x0647 , 0x00}, -{0x0681 , 0x1B}, -{0x0682 , 0xA0}, -{0x0683 , 0x28}, -{0x0684 , 0x00}, -{0x0685 , 0xB0}, -{0x0686 , 0x6F}, -{0x0687 , 0x33}, -{0x0688 , 0x1F}, -{0x0689 , 0x44}, -{0x068A , 0xA8}, -{0x068B , 0x44}, -{0x068C , 0x08}, -{0x068D , 0x08}, -{0x068E , 0x00}, -{0x068F , 0x00}, -{0x0690 , 0x01}, -{0x0691 , 0x00}, -{0x0692 , 0x01}, -{0x0693 , 0x00}, -{0x0694 , 0x00}, -{0x0695 , 0x00}, -{0x0696 , 0x00}, -{0x0697 , 0x00}, -{0x0698 , 0x2A}, -{0x0699 , 0x80}, -{0x069A , 0x1F}, -{0x069B , 0x00}, -{0x069C , 0x02}, -{0x069D , 0xF5}, -{0x069E , 0x03}, -{0x069F , 0x6D}, -{0x06A0 , 0x0C}, -{0x06A1 , 0xB8}, -{0x06A2 , 0x0D}, -{0x06A3 , 0x74}, -{0x06A4 , 0x00}, -{0x06A5 , 0x2F}, -{0x06A6 , 0x00}, -{0x06A7 , 0x2F}, -{0x0F00 , 0x00}, -{0x0F01 , 0x00}, -{0x0100 , 0x01}, -{0x0102 , 0x02}, -{0x0104 , 0x03}, -{0x0101 , 0x02}, - -/////////////////////////// -{0x020B , 0x48}, -{0x020C , 0x64}, -{0x040A , 0x40}, -{0x040B , 0x33}, -{0x0109 , 0x00}, -{0x010A , 0x04}, -{0x010B , 0x03}, -#if 0 -{0x0110 , 0x02}, -{0x0111 , 0x80}, -{0x0112 , 0x01}, -{0x0113 , 0xe0}, -#else -{0x0110, 0x03}, -{0x0111, 0x20}, -{0x0112, 0x02}, -{0x0113, 0x58}, - -#endif -{0x0116 , 0x02}, -{0x0118 , 0x40}, -{0x0119 , 0x01}, -{0x011a , 0x04}, -{0x011B , 0x00}, -{0x0313 , 0x35}, -{0x0314 , 0x36}, -{0x0315 , 0x16}, - -}; - - - -/* 1600X1200 UXGA */ -static struct reginfo sensor_uxga[] = -{ - {0x010c , 0x00}, - {0x010d , 0x08}, - {0x010e , 0x00}, - {0x010f , 0x08}, - {0x010a , 0x00}, - {0x0110 , 0x06}, - {0x0111 , 0x40}, - {0x0112 , 0x04}, - {0x0113 , 0xb0}, - {0x0, 0x0}, -}; - - - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {0x010c , 0x00}, - {0x010d , 0xa8}, - {0x010e , 0x00}, - {0x010f , 0x60}, - {0x010a , 0x00}, - {0x0110 , 0x05}, - {0x0111 , 0x00}, - {0x0112 , 0x04}, - {0x0113 , 0x00}, - {0x00, 0x00}, -}; - -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ -#if 0 - {0x0101, 0x00}, - {0x0103, 0x00}, - {0x0105, 0x00}, - {0x0106, 0xF0}, - {0x0107, 0x00}, - {0x0108, 0x1C}, - {0x0109, 0x01}, - {0x010A, 0x00}, - {0x010B, 0x00}, - {0x010C, 0x00}, - {0x010D, 0x08}, - {0x010E, 0x00}, - {0x010F, 0x08}, - {0x0110, 0x06}, - {0x0111, 0x40}, - {0x0112, 0x04}, - {0x0113, 0xB0}, - {0x0114, 0x04}, - {0x0115, 0x00}, - {0x0116, 0x02}, - {0x0117, 0x00}, - {0x0118, 0x40}, - {0x0119, 0x02}, - {0x011A, 0x04}, - {0x011B, 0x01}, - {0x011C, 0x00}, - {0x011D, 0x01}, - {0x011E, 0x36}, - {0x011F, 0x00}, - {0x0120, 0x1C}, - {0x0121, 0x00}, - {0x0122, 0x04}, - {0x0123, 0x00}, - {0x0124, 0x00}, - {0x0125, 0x00}, - {0x0126, 0x00}, - {0x0127, 0x00}, - {0x0128, 0x00}, - {0x0200, 0x1f}, - {0x0201, 0x0c}, - {0x0202, 0x38}, - {0x0203, 0x00}, - {0x0204, 0x03}, - {0x0205, 0x1F}, - {0x0206, 0x0B}, - {0x0207, 0x20}, - {0x0208, 0x00}, - {0x0209, 0x2A}, - {0x020A, 0x01}, - {0x020B, 0x28}, - {0x020C, 0x44}, - {0x020D, 0xC8}, - {0x020E, 0xBC}, - {0x020F, 0x08}, - {0x0210, 0xD6}, - {0x0211, 0x00}, - {0x0212, 0x20}, - {0x0213, 0x81}, - {0x0214, 0x15}, - {0x0215, 0x00}, - {0x0216, 0x00}, - {0x0217, 0x00}, - {0x0218, 0x46}, - {0x0219, 0x30}, - {0x021A, 0x03}, - {0x021B, 0x28}, - {0x021C, 0x02}, - {0x021D, 0x60}, - {0x021E, 0x00}, - {0x021F, 0x00}, - {0x0220, 0x08}, - {0x0221, 0x08}, - {0x0222, 0x04}, - {0x0223, 0x00}, - {0x0224, 0x1F}, - {0x0225, 0x1E}, - {0x0226, 0x18}, - {0x0227, 0x1D}, - {0x0228, 0x1F}, - {0x0229, 0x1F}, - {0x022A, 0x01}, - {0x022B, 0x04}, - {0x022C, 0x05}, - {0x022D, 0x05}, - {0x022E, 0x04}, - {0x022F, 0x03}, - {0x0230, 0x02}, - {0x0231, 0x1F}, - {0x0232, 0x1A}, - {0x0233, 0x19}, - {0x0234, 0x19}, - {0x0235, 0x1B}, - {0x0236, 0x1F}, - {0x0237, 0x04}, - {0x0238, 0xEE}, - {0x0239, 0xFF}, - {0x023A, 0x00}, - {0x023B, 0x00}, - {0x023C, 0x00}, - {0x023D, 0x00}, - {0x023E, 0x00}, - {0x023F, 0x00}, - {0x0240, 0x00}, - {0x0241, 0x00}, - {0x0242, 0x00}, - {0x0243, 0x21}, - {0x0244, 0x42}, - {0x0245, 0x53}, - {0x0246, 0x54}, - {0x0247, 0x54}, - {0x0248, 0x54}, - {0x0249, 0x33}, - {0x024A, 0x11}, - {0x024B, 0x00}, - {0x024C, 0x00}, - {0x024D, 0xFF}, - {0x024E, 0xEE}, - {0x024F, 0xDD}, - {0x0250, 0x00}, - {0x0251, 0x00}, - {0x0252, 0x00}, - {0x0253, 0x00}, - {0x0254, 0x00}, - {0x0255, 0x00}, - {0x0256, 0x00}, - {0x0257, 0x00}, - {0x0258, 0x00}, - {0x0259, 0x00}, - {0x025A, 0x00}, - {0x025B, 0x00}, - {0x025C, 0x00}, - {0x025D, 0x00}, - {0x025E, 0x00}, - {0x025F, 0x00}, - {0x0260, 0x00}, - {0x0261, 0x00}, - {0x0262, 0x00}, - {0x0263, 0x00}, - {0x0264, 0x00}, - {0x0265, 0x00}, - {0x0266, 0x00}, - {0x0267, 0x00}, - {0x0268, 0x8F}, - {0x0269, 0xA3}, - {0x026A, 0xB4}, - {0x026B, 0x90}, - {0x026C, 0x00}, - {0x026D, 0xD0}, - {0x026E, 0x60}, - {0x026F, 0xA0}, - {0x0270, 0x40}, - {0x0300, 0x81}, - {0x0301, 0x80}, - {0x0302, 0x22}, - {0x0303, 0x06}, - {0x0304, 0x03}, - {0x0305, 0x83}, - {0x0306, 0x00}, - {0x0307, 0x22}, - {0x0308, 0x00}, - {0x0309, 0x55}, - {0x030A, 0x55}, - {0x030B, 0x55}, - {0x030C, 0x54}, - {0x030D, 0x1F}, - {0x030E, 0x0A}, - {0x030F, 0x10}, - {0x0310, 0x04}, - {0x0311, 0xFF}, - {0x0312, 0x08}, - {0x0313, 0x35}, - {0x0314, 0x36}, - {0x0315, 0x15}, - {0x0316, 0x26}, - {0x0317, 0x02}, - {0x0318, 0x08}, - {0x0319, 0x0C}, - {0x031A, 0x81}, - {0x031B, 0x00}, - {0x031C, 0x3D}, - {0x031D, 0x00}, - {0x031E, 0xF9}, - {0x031F, 0x00}, - {0x0320, 0x24}, - {0x0321, 0x14}, - {0x0322, 0x1A}, - {0x0323, 0x24}, - {0x0324, 0x08}, - {0x0325, 0xF0}, - {0x0326, 0x30}, - {0x0327, 0x17}, - {0x0328, 0x11}, - {0x0329, 0x22}, - {0x032A, 0x2F}, - {0x032B, 0x21}, - {0x032C, 0xDA}, - {0x032D, 0x10}, - {0x032E, 0xEA}, - {0x032F, 0x18}, - {0x0330, 0x29}, - {0x0331, 0x25}, - {0x0332, 0x12}, - {0x0333, 0x0F}, - {0x0334, 0xE0}, - {0x0335, 0x13}, - {0x0336, 0xFF}, - {0x0337, 0x20}, - {0x0338, 0x46}, - {0x0339, 0x04}, - {0x033A, 0x04}, - {0x033B, 0xFF}, - {0x033C, 0x01}, - {0x033D, 0x00}, - {0x033E, 0x03}, - {0x033F, 0x28}, - {0x0340, 0x02}, - {0x0341, 0x60}, - {0x0342, 0xAC}, - {0x0343, 0x97}, - {0x0344, 0x7F}, - {0x0400, 0xE8}, - {0x0401, 0x40}, - {0x0402, 0x00}, - {0x0403, 0x00}, - {0x0404, 0xF8}, - {0x0405, 0x03}, - {0x0406, 0x03}, - {0x0407, 0x85}, - {0x0408, 0x44}, - {0x0409, 0x1F}, - {0x040A, 0x40}, - {0x040B, 0x33}, - {0x040C, 0xA0}, - {0x040D, 0x00}, - {0x040E, 0x00}, - {0x040F, 0x00}, - {0x0410, 0x0D}, - {0x0411, 0x0D}, - {0x0412, 0x0C}, - {0x0413, 0x04}, - {0x0414, 0x00}, - {0x0415, 0x00}, - {0x0416, 0x07}, - {0x0417, 0x09}, - {0x0418, 0x16}, - {0x0419, 0x14}, - {0x041A, 0x11}, - {0x041B, 0x14}, - {0x041C, 0x07}, - {0x041D, 0x07}, - {0x041E, 0x06}, - {0x041F, 0x02}, - {0x0420, 0x42}, - {0x0421, 0x42}, - {0x0422, 0x47}, - {0x0423, 0x39}, - {0x0424, 0x3E}, - {0x0425, 0x4D}, - {0x0426, 0x46}, - {0x0427, 0x3A}, - {0x0428, 0x21}, - {0x0429, 0x21}, - {0x042A, 0x26}, - {0x042B, 0x1C}, - {0x042C, 0x25}, - {0x042D, 0x25}, - {0x042E, 0x28}, - {0x042F, 0x20}, - {0x0430, 0x3E}, - {0x0431, 0x3E}, - {0x0432, 0x33}, - {0x0433, 0x2E}, - {0x0434, 0x54}, - {0x0435, 0x53}, - {0x0436, 0x3C}, - {0x0437, 0x51}, - {0x0438, 0x2B}, - {0x0439, 0x2B}, - {0x043A, 0x38}, - {0x043B, 0x22}, - {0x043C, 0x3B}, - {0x043D, 0x3B}, - {0x043E, 0x31}, - {0x043F, 0x37}, - {0x0440, 0x00}, - {0x0441, 0x4B}, - {0x0442, 0x00}, - {0x0443, 0x00}, - {0x0444, 0x31}, - {0x0445, 0x00}, - {0x0446, 0x00}, - {0x0447, 0x00}, - {0x0448, 0x00}, - {0x0449, 0x00}, - {0x044A, 0x00}, - {0x044D, 0xE0}, - {0x044E, 0x05}, - {0x044F, 0x07}, - {0x0450, 0x00}, - {0x0451, 0x00}, - {0x0452, 0x00}, - {0x0453, 0x00}, - {0x0454, 0x00}, - {0x0455, 0x00}, - {0x0456, 0x00}, - {0x0457, 0x00}, - {0x0458, 0x00}, - {0x0459, 0x00}, - {0x045A, 0x00}, - {0x045B, 0x00}, - {0x045C, 0x00}, - {0x045D, 0x00}, - {0x045E, 0x00}, - {0x045F, 0x00}, - {0x0460, 0x80}, - {0x0461, 0x10}, - {0x0462, 0x10}, - {0x0463, 0x10}, - {0x0464, 0x08}, - {0x0465, 0x08}, - {0x0466, 0x11}, - {0x0467, 0x09}, - {0x0468, 0x23}, - {0x0469, 0x2A}, - {0x046A, 0x2A}, - {0x046B, 0x47}, - {0x046C, 0x52}, - {0x046D, 0x42}, - {0x046E, 0x36}, - {0x046F, 0x46}, - {0x0470, 0x3A}, - {0x0471, 0x32}, - {0x0472, 0x32}, - {0x0473, 0x38}, - {0x0474, 0x3D}, - {0x0475, 0x2F}, - {0x0476, 0x29}, - {0x0477, 0x48}, - {0x0600, 0x00}, - {0x0601, 0x24}, - {0x0602, 0x45}, - {0x0603, 0x0E}, - {0x0604, 0x14}, - {0x0605, 0x2F}, - {0x0606, 0x01}, - {0x0607, 0x0E}, - {0x0608, 0x0E}, - {0x0609, 0x37}, - {0x060A, 0x18}, - {0x060B, 0xA0}, - {0x060C, 0x20}, - {0x060D, 0x07}, - {0x060E, 0x47}, - {0x060F, 0x90}, - {0x0610, 0x06}, - {0x0611, 0x0C}, - {0x0612, 0x28}, - {0x0613, 0x13}, - {0x0614, 0x0B}, - {0x0615, 0x10}, - {0x0616, 0x14}, - {0x0617, 0x19}, - {0x0618, 0x52}, - {0x0619, 0xA0}, - {0x061A, 0x11}, - {0x061B, 0x33}, - {0x061C, 0x56}, - {0x061D, 0x20}, - {0x061E, 0x28}, - {0x061F, 0x2B}, - {0x0620, 0x22}, - {0x0621, 0x11}, - {0x0622, 0x75}, - {0x0623, 0x49}, - {0x0624, 0x6E}, - {0x0625, 0x80}, - {0x0626, 0x02}, - {0x0627, 0x0C}, - {0x0628, 0x51}, - {0x0629, 0x25}, - {0x062A, 0x01}, - {0x062B, 0x3D}, - {0x062C, 0x04}, - {0x062D, 0x01}, - {0x062E, 0x0C}, - {0x062F, 0x2C}, - {0x0630, 0x0D}, - {0x0631, 0x14}, - {0x0632, 0x12}, - {0x0633, 0x34}, - {0x0634, 0x00}, - {0x0635, 0x00}, - {0x0636, 0x00}, - {0x0637, 0xB1}, - {0x0638, 0x22}, - {0x0639, 0x32}, - {0x063A, 0x0E}, - {0x063B, 0x18}, - {0x063C, 0x88}, - {0x0640, 0xB2}, - {0x0641, 0xC0}, - {0x0642, 0x01}, - {0x0643, 0x26}, - {0x0644, 0x13}, - {0x0645, 0x88}, - {0x0646, 0x64}, - {0x0647, 0x00}, - {0x0681, 0x1B}, - {0x0682, 0xA0}, - {0x0683, 0x28}, - {0x0684, 0x00}, - {0x0685, 0xB0}, - {0x0686, 0x6F}, - {0x0687, 0x33}, - {0x0688, 0x1F}, - {0x0689, 0x44}, - {0x068A, 0xA8}, - {0x068B, 0x44}, - {0x068C, 0x08}, - {0x068D, 0x08}, - {0x068E, 0x00}, - {0x068F, 0x00}, - {0x0690, 0x01}, - {0x0691, 0x00}, - {0x0692, 0x01}, - {0x0693, 0x00}, - {0x0694, 0x00}, - {0x0695, 0x00}, - {0x0696, 0x00}, - {0x0697, 0x00}, - {0x0698, 0x2A}, - {0x0699, 0x80}, - {0x069A, 0x1F}, - {0x069B, 0x00}, - {0x069C, 0x02}, - {0x069D, 0xF5}, - {0x069E, 0x03}, - {0x069F, 0x6D}, - {0x06A0, 0x0C}, - {0x06A1, 0xB8}, - {0x06A2, 0x0D}, - {0x06A3, 0x74}, - {0x06A4, 0x00}, - {0x06A5, 0x2F}, - {0x06A6, 0x00}, - {0x06A7, 0x2F}, - {0x0F00, 0x00}, - {0x0F01, 0x00}, - {0x0100, 0x01}, - {0x0102, 0x02}, - {0x0104, 0x03}, -#endif - {0x020B, 0x48}, - {0x020C, 0x64}, - {0x040A, 0x40}, - {0x040B, 0x33}, - {0x010c , 0x00}, - {0x010d , 0x08}, - {0x010e , 0x00}, - {0x010f , 0x08}, - {0x010a , 0x00}, - {0x0109, 0x00}, - {0x010A, 0x04}, - {0x010B, 0x03}, - {0x0110, 0x03}, - {0x0111, 0x20}, - {0x0112, 0x02}, - {0x0113, 0x58}, - {0x0116, 0x02}, - {0x0118, 0x40}, - {0x0119, 0x02}, - {0x011a, 0x04}, - {0x011B, 0x01}, - {0x0, 0x0}, -}; - - - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - {0x020B , 0x48}, - {0x020C , 0x64}, - {0x040A , 0x40}, - {0x040B , 0x33}, - {0x0109 , 0x00}, - {0x010A , 0x04}, - {0x010B , 0x03}, - {0x010c , 0x00}, - {0x010d , 0xa8}, - {0x010e , 0x00}, - {0x010f , 0x60}, - {0x010a , 0x04}, - #if 1 - {0x0110 , 0x02}, - {0x0111 , 0x80}, - {0x0112 , 0x01}, - {0x0113 , 0xe0}, - #else - {0x0110, 0x03}, - {0x0111, 0x20}, - {0x0112, 0x02}, - {0x0113, 0x58}, - #endif - {0x0116 , 0x02}, - {0x0118 , 0x40}, - {0x0119 , 0x01}, - {0x011a , 0x04}, - {0x011B , 0x00}, - {0x0313 , 0x35}, - {0x0314 , 0x36}, - {0x0315 , 0x16}, - {0x0, 0x0}, -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {0x0, 0x0}, -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - - - {0x0, 0x0}, -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - - {0x0, 0x0}, -}; -#endif -#if 0 -/* 160X120 QQVGA*/ -static struct reginfo gt2005_qqvga[] = -{ - - {0x300E, 0x34}, - {0x3011, 0x01}, - {0x3012, 0x10}, - {0x302a, 0x02}, - {0x302b, 0xE6}, - {0x306f, 0x14}, - {0x3362, 0x90}, - - {0x3070, 0x5d}, - {0x3072, 0x5d}, - {0x301c, 0x07}, - {0x301d, 0x07}, - - {0x3020, 0x01}, - {0x3021, 0x18}, - {0x3022, 0x00}, - {0x3023, 0x06}, - {0x3024, 0x06}, - {0x3025, 0x58}, - {0x3026, 0x02}, - {0x3027, 0x61}, - {0x3088, 0x00}, - {0x3089, 0xa0}, - {0x308a, 0x00}, - {0x308b, 0x78}, - {0x3316, 0x64}, - {0x3317, 0x25}, - {0x3318, 0x80}, - {0x3319, 0x08}, - {0x331a, 0x0a}, - {0x331b, 0x07}, - {0x331c, 0x80}, - {0x331d, 0x38}, - {0x3100, 0x00}, - {0x3302, 0x11}, - - {0x0, 0x0}, -}; - - - -static struct reginfo gt2005_Sharpness_auto[] = -{ - {0x3306, 0x00}, -}; - -static struct reginfo gt2005_Sharpness1[] = -{ - {0x3306, 0x08}, - {0x3371, 0x00}, -}; - -static struct reginfo gt2005_Sharpness2[][3] = -{ - //Sharpness 2 - {0x3306, 0x08}, - {0x3371, 0x01}, -}; - -static struct reginfo gt2005_Sharpness3[] = -{ - //default - {0x3306, 0x08}, - {0x332d, 0x02}, -}; -static struct reginfo gt2005_Sharpness4[]= -{ - //Sharpness 4 - {0x3306, 0x08}, - {0x332d, 0x03}, -}; - -static struct reginfo gt2005_Sharpness5[] = -{ - //Sharpness 5 - {0x3306, 0x08}, - {0x332d, 0x04}, -}; -#endif - -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - //{0x3400, 0x00}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - //{0x3400, 0x02}, - {0x0000, 0x00} -}; - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0x3306, 0x00}, //AWB auto, bit[1]:0,auto - {0x0000, 0x00} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0x3306, 0x82}, - {0x3337, 0x68}, - {0x3338, 0x40}, - {0x3339, 0x4e}, - {0x0000, 0x00} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x3306, 0x02}, //AWB off - {0x3337, 0x5e}, - {0x3338, 0x40}, - {0x3339, 0x46}, - {0x0000, 0x00} -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0x3306, 0x02}, - {0x3337, 0x52}, - {0x3338, 0x40}, - {0x3339, 0x58}, - {0x0000, 0x00} - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x3306, 0x02}, - {0x3337, 0x44}, - {0x3338, 0x40}, - {0x3339, 0x70}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - // Brightness -2 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x49}, - {0x339a, 0x20}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness1[]= -{ - // Brightness -1 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x49}, - {0x339a, 0x10}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - // Brightness 0 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x00}, - {0x3390, 0x41}, - {0x339a, 0x00}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - // Brightness +1 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x41}, - {0x339a, 0x10}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - // Brightness +2 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x41}, - {0x339a, 0x20}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - // Brightness +3 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, //bit[2] enable - {0x3390, 0x41}, //bit[3] sign of brightness - {0x339a, 0x30}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x3391, 0x00}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {0x3391, 0x20}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x3391, 0x18}, - {0x3396, 0x40}, - {0x3397, 0xa6}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - //Negative - {0x3391, 0x40}, //bit[6] negative - {0x0000, 0x00} -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - // Bluish - {0x3391, 0x18}, - {0x3396, 0xa0}, - {0x3397, 0x40}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish - {0x3391, 0x18}, - {0x3396, 0x60}, - {0x3397, 0x60}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - //-3 - {0x3047, 0x05}, - {0x3018, 0x40}, - {0x3019, 0x30}, - {0x301a, 0x71}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure1[]= -{ - //-2 - {0x3047, 0x05}, - {0x3018, 0x5a}, - {0x3019, 0x4a}, - {0x301a, 0xc2}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - //-0.3EV - {0x3047, 0x05}, - {0x3018, 0x6a}, - {0x3019, 0x5a}, - {0x301a, 0xd4}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - //default - {0x3047, 0x05}, - {0x3018, 0x78}, - {0x3019, 0x68}, - {0x301a, 0xd4}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - // 1 - {0x3047, 0x05}, - {0x3018, 0x88}, - {0x3019, 0x78}, - {0x301a, 0xd5}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - // 2 - {0x3047, 0x05}, - {0x3018, 0xa8}, - {0x3019, 0x98}, - {0x301a, 0xe6}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - // 3 - {0x3047, 0x05}, - {0x3018, 0xc8}, - {0x3019, 0xb8}, - {0x301a, 0xf7}, - {0x0000, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x02}, - {0x3394, 0x40}, - {0x3395, 0x40}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x02}, - {0x3394, 0x50}, - {0x3395, 0x50}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x02}, //enable color saturation - {0x3394, 0x70}, - {0x3395, 0x70}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - //Contrast -3 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x45}, - {0x3398, 0x18}, - {0x3399, 0x18}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - //Contrast -2 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x45}, - {0x3398, 0x18}, - {0x3399, 0x18}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast2[]= -{ - // Contrast -1 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x45}, - {0x3398, 0x1c}, - {0x3399, 0x1c}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - //Contrast 0 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x00}, - {0x3390, 0x41}, - {0x3398, 0x20}, - {0x3399, 0x20}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - //Contrast +1 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x45}, - {0x3398, 0x24}, - {0x3399, 0x24}, - {0x0000, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - //Contrast +2 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x45}, - {0x3398, 0x28}, - {0x3399, 0x28}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - //Contrast +3 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, //bit[2] enable contrast/brightness - {0x3390, 0x45}, //bit[2] Yoffset sign - {0x3398, 0x2c}, - {0x3399, 0x2c}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {0x3069, 0x84}, - {0x307c, 0x13}, - {0x3087, 0x02}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {0x3069, 0x84}, - {0x307c, 0x10}, - {0x3087, 0x02}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {0x300e, 0x34}, - {0x300f, 0xa6}, - {0x3010, 0x81}, - {0x3082, 0x01}, - {0x30f4, 0x01}, - {0x3090, 0x3b}, - {0x3091, 0xc0}, - {0x30ac, 0x42}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {0x300e, 0x34}, - {0x300f, 0xa6}, - {0x3010, 0x81}, - {0x3082, 0x01}, - {0x30f4, 0x01}, - {0x3090, 0x33}, - {0x3091, 0xc0}, - {0x30ac, 0x42}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ -#if 0 /* ddl@rock-chips.com : */ - {0x3014, 0x04}, - {0x3015, 0x00}, - {0x302e, 0x00}, - {0x302d, 0x00}, - {0x0000, 0x00} -#else - {0x3014, 0x84}, - {0x3015, 0x02}, - {0x302e, 0x00}, - {0x302d, 0x00}, - {0x0000, 0x00} -#endif -}; - -static struct reginfo sensor_SceneNight[] = -{ -#if 1 - //30fps ~ 5fps night mode for 60/50Hz light environment, 24Mhz clock input,36Mzh pclk - {0x300e, 0x34}, - {0x3011, 0x00}, - {0x302c, 0x00}, - {0x3071, 0x00}, - {0x3070, 0xb9}, - {0x301c, 0x02}, - {0x3073, 0x00}, - {0x3072, 0x9a}, - {0x301d, 0x03}, - {0x3014, 0x0c}, - {0x3015, 0x50},//add 5 dummy frame - {0x302e, 0x00}, - {0x302d, 0x00}, - {0x0000, 0x00} -#else - //15fps ~ 5fps night mode for 60/50Hz light environment, 24Mhz clock input,18Mhz pclk - {0x300e, 0x34}, - {0x3011, 0x01}, - {0x302c, 0x00}, - {0x3071, 0x00}, - {0x3070, 0x5d}, - {0x301c, 0x05}, - {0x3073, 0x00}, - {0x3072, 0x4d}, - {0x301d, 0x07}, - {0x3014, 0x0c}, - {0x3015, 0x50}, - {0x302e, 0x00}, - {0x302d, 0x00}, -#endif -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom1[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom2[] = -{ - {0x0, 0x0}, -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {0x0, 0x0}, -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif -static const struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - unsigned int winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int funmodule_state; -} sensor_info_priv_t; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, u16 reg, u8 val) -{ - int err,cnt; - u8 buf[3]; - struct i2c_msg msg[1]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - buf[2] = val; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u16 reg, u8 *val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[2]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - - while (regarray[i].reg != 0) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - i++; - } - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} - -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_check_array(struct i2c_client *client, struct reginfo *regarray) -{ - int ret; - int i = 0,j=0; - u8 value; - - SENSOR_DG("%s >>>>>>>>>>>>>>>>>>>>>>\n",__FUNCTION__); - while(regarray[i].reg != 0) - { - ret = sensor_read(client,regarray[i].reg,&value); - if(ret !=0) - { - SENSOR_TR("read value failed\n"); - - } - if(regarray[i].val != value) - { - SENSOR_DG("%s reg[0x%x] check err,writte :0x%x read:0x%x\n",__FUNCTION__,regarray[i].reg,regarray[i].val,value); - } - else - j++; - - i++; - } - if(i==j) - SENSOR_DG("%s check success\n",__FUNCTION__); - - return 0; -} -#endif -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_power_end: - return ret; -} -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - char value; - int ret,pid = 0; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - /* ret = sensor_write(client, 0x3012, 0x80); - if (ret != 0) - { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); */ //delay 5 microseconds - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x0000, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value << 8); - - ret = sensor_read(client, 0x0001, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - - sensor->info_priv.winseqe_cur_addr = (int)SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} - -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - - struct sensor *sensor = to_sensor(client); - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - if (sensor->info_priv.funmodule_state & SENSOR_INIT_IS_OK) { - sensor_write(client, 0x30b0, 0x00); - sensor_write(client, 0x30b1, 0x00); - } - sensor_ioctrl(icd, Sensor_PowerDown, 1); - msleep(100); - - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - - return 0; -} - -static struct reginfo sensor_power_down_sequence[]= -{ - {0x30ab, 0x00}, - {0x30ad, 0x0a}, - {0x30ae,0x27}, - {0x363b,0x01}, - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - - return 0; - -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - int ret=0, set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - winseqe_set_addr = sensor_svga; - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - winseqe_set_addr = sensor_sxga; - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && sensor_uxga[0].reg) - { - winseqe_set_addr = sensor_uxga; - set_w = 1600; - set_h = 1200; - } - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) { - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - } else { /* ddl@rock-chips.com : Video */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - } - #endif - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - - sensor->info_priv.winseqe_cur_addr = (int)winseqe_set_addr; - - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - if (sensor->info_priv.whiteBalance != 0) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - sensor->info_priv.snap2preview = true; - } else if (sensor_fmt_videochk(sd,mf) == true) { /* ddl@rock-chips.com : Video */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - sensor->info_priv.video2preview = true; - } else if ((sensor->info_priv.snap2preview == true) || (sensor->info_priv.video2preview == true)) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - msleep(600); - sensor->info_priv.video2preview = false; - sensor->info_priv.snap2preview = false; - } - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; - -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && sensor_uxga[0].reg) - { - set_w = 1600; - set_h = 1200; - } - else - { - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - - mf->width = set_w; - mf->height = set_h; - mf->colorspace = fmt->colorspace; - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return gt2005 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value > 0) && ((digitalzoom_cur + value) > digitalzoom_total)) - { - value = digitalzoom_total - digitalzoom_cur; - } - - if ((value < 0) && ((digitalzoom_cur + value) < 0)) - { - value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char value; - int ret,pid = 0; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - - /* soft reset */ - /* ret = sensor_write(client, 0x3012, 0x80); - if (ret != 0) - { - SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); - return -ENODEV; - } - mdelay(5); */ //delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x0000, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid |= (value << 8); - - ret = sensor_read(client, 0x0001, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - - return ret; -} -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); -#if CONFIG_SENSOR_Flash - int i; -#endif - int ret = 0; - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - sensor->sensor_gpio_res = NULL; - for (i=0; isensor_io_request->gpio_res[i].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[i].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[i]; - } - } - if (sensor->sensor_gpio_res == NULL) { - SENSOR_TR("%s %s obtain gpio resource failed when RK29_CAM_SUBDEV_IOREQUEST \n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - - sensor->info_priv.fmt = sensor_colour_fmts[0]; - - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - diff --git a/drivers/media/video/gt2005_user_series.c b/drivers/media/video/gt2005_user_series.c deleted file mode 100644 index 41a3fa1f2f03..000000000000 --- a/drivers/media/video/gt2005_user_series.c +++ /dev/null @@ -1,1065 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#if defined(CONFIG_MACH_RK30_PHONE_PAD) - -/* init 352X288 SVGA */ -static struct reginfo sensor_init_data[] = -{ - {0x0101 , 0x00}, - {0x0103 , 0x00}, - {0x0105 , 0x00}, - {0x0106 , 0xF0}, - {0x0107 , 0x00}, - {0x0108 , 0x1C}, - {0x0109 , 0x01}, - {0x010A , 0x00}, - {0x010B , 0x00}, - {0x010C , 0x00}, - {0x010D , 0x08}, - {0x010E , 0x00}, - {0x010F , 0x08}, - {0x0110 , 0x06}, - {0x0111 , 0x40}, - {0x0112 , 0x04}, - {0x0113 , 0xB0}, -{0x0114 , 0x00}, - {0x0115 , 0x00}, - {0x0116 , 0x02}, - {0x0117 , 0x00}, -{0x0118 , 0x67}, - {0x0119 , 0x02}, - {0x011A , 0x04}, - {0x011B , 0x01}, -{0x011C , 0x01}, -{0x011D , 0x02}, -{0x011E , 0x00}, -{0x011F , 0x00}, -{0x0120 , 0x1C}, -{0x0121 , 0x00}, -{0x0122 , 0x04}, -{0x0123 , 0x00}, -{0x0124 , 0x00}, -{0x0125 , 0x00}, -{0x0126 , 0x00}, -{0x0127 , 0x00}, -{0x0128 , 0x00}, -{0x0200 , 0x00}, -{0x0201 , 0x00}, -{0x0202 , 0x40}, -{0x0203 , 0x00}, -{0x0204 , 0x03}, -{0x0205 , 0x1F}, -{0x0206 , 0x0B}, -{0x0207 , 0x20}, -{0x0208 , 0x00}, -{0x0209 , 0x2A}, -{0x020A , 0x01}, -{0x020B , 0x48}, -{0x020C , 0x64}, -{0x020D , 0xC8}, -{0x020E , 0xBC}, -{0x020F , 0x08}, -{0x0210 , 0xD6}, -{0x0211 , 0x00}, -{0x0212 , 0x20}, -{0x0213 , 0x81}, -{0x0214 , 0x15}, -{0x0215 , 0x00}, -{0x0216 , 0x00}, -{0x0217 , 0x00}, -{0x0218 , 0x46}, -{0x0219 , 0x30}, -{0x021A , 0x03}, -{0x021B , 0x28}, -{0x021C , 0x02}, -{0x021D , 0x60}, -{0x021E , 0x00}, -{0x021F , 0x00}, -{0x0220 , 0x08}, -{0x0221 , 0x08}, -{0x0222 , 0x04}, -{0x0223 , 0x00}, -{0x0224 , 0x1F}, -{0x0225 , 0x1E}, -{0x0226 , 0x18}, -{0x0227 , 0x1D}, -{0x0228 , 0x1F}, -{0x0229 , 0x1F}, -{0x022A , 0x01}, -{0x022B , 0x04}, -{0x022C , 0x05}, -{0x022D , 0x05}, -{0x022E , 0x04}, -{0x022F , 0x03}, -{0x0230 , 0x02}, -{0x0231 , 0x1F}, -{0x0232 , 0x1A}, -{0x0233 , 0x19}, -{0x0234 , 0x19}, -{0x0235 , 0x1B}, -{0x0236 , 0x1F}, -{0x0237 , 0x04}, -{0x0238 , 0xEE}, -{0x0239 , 0xFF}, -{0x023A , 0x00}, -{0x023B , 0x00}, -{0x023C , 0x00}, -{0x023D , 0x00}, -{0x023E , 0x00}, -{0x023F , 0x00}, -{0x0240 , 0x00}, -{0x0241 , 0x00}, -{0x0242 , 0x00}, -{0x0243 , 0x21}, -{0x0244 , 0x42}, -{0x0245 , 0x53}, -{0x0246 , 0x54}, -{0x0247 , 0x54}, -{0x0248 , 0x54}, -{0x0249 , 0x33}, -{0x024A , 0x11}, -{0x024B , 0x00}, -{0x024C , 0x00}, -{0x024D , 0xFF}, -{0x024E , 0xEE}, -{0x024F , 0xDD}, -{0x0250 , 0x00}, -{0x0251 , 0x00}, -{0x0252 , 0x00}, -{0x0253 , 0x00}, -{0x0254 , 0x00}, -{0x0255 , 0x00}, -{0x0256 , 0x00}, -{0x0257 , 0x00}, -{0x0258 , 0x00}, -{0x0259 , 0x00}, -{0x025A , 0x00}, -{0x025B , 0x00}, -{0x025C , 0x00}, -{0x025D , 0x00}, -{0x025E , 0x00}, -{0x025F , 0x00}, -{0x0260 , 0x00}, -{0x0261 , 0x00}, -{0x0262 , 0x00}, -{0x0263 , 0x00}, -{0x0264 , 0x00}, -{0x0265 , 0x00}, -{0x0266 , 0x00}, -{0x0267 , 0x00}, -{0x0268 , 0x8F}, -{0x0269 , 0xA3}, -{0x026A , 0xB4}, -{0x026B , 0x90}, -{0x026C , 0x00}, -{0x026D , 0xD0}, -{0x026E , 0x60}, -{0x026F , 0xA0}, -{0x0270 , 0x40}, -{0x0300 , 0x81}, -{0x0301 , 0x80}, -{0x0302 , 0x22}, -{0x0303 , 0x06}, -{0x0304 , 0x03}, -{0x0305 , 0x83}, -{0x0306 , 0x00}, -{0x0307 , 0x22}, -{0x0308 , 0x00}, -{0x0309 , 0x55}, -{0x030A , 0x55}, -{0x030B , 0x55}, -{0x030C , 0x54}, -{0x030D , 0x1F}, -{0x030E , 0x13}, -{0x030F , 0x10}, -{0x0310 , 0x04}, -{0x0311 , 0xFF}, -{0x0312 , 0x08}, -{0x0313 , 0x28}, -{0x0314 , 0x66}, -{0x0315 , 0x16}, -{0x0316 , 0x26}, -{0x0317 , 0x02}, -{0x0318 , 0x08}, -{0x0319 , 0x0C}, -{0x031A , 0x81}, -{0x031B , 0x00}, -{0x031C , 0x3D}, -{0x031D , 0x00}, -{0x031E , 0xF9}, -{0x031F , 0x00}, -{0x0320 , 0x24}, -{0x0321 , 0x14}, -{0x0322 , 0x1A}, -{0x0323 , 0x24}, -{0x0324 , 0x08}, -{0x0325 , 0xF0}, -{0x0326 , 0x30}, -{0x0327 , 0x17}, -{0x0328 , 0x11}, -{0x0329 , 0x22}, -{0x032A , 0x2F}, -{0x032B , 0x21}, -{0x032C , 0xDA}, -{0x032D , 0x10}, -{0x032E , 0xEA}, -{0x032F , 0x18}, -{0x0330 , 0x29}, -{0x0331 , 0x25}, -{0x0332 , 0x12}, -{0x0333 , 0x0F}, -{0x0334 , 0xE0}, -{0x0335 , 0x13}, -{0x0336 , 0xFF}, -{0x0337 , 0x20}, -{0x0338 , 0x46}, -{0x0339 , 0x04}, -{0x033A , 0x04}, -{0x033B , 0xFF}, -{0x033C , 0x01}, -{0x033D , 0x00}, -{0x033E , 0x03}, -{0x033F , 0x28}, -{0x0340 , 0x02}, -{0x0341 , 0x60}, -{0x0342 , 0xAC}, -{0x0343 , 0x97}, -{0x0344 , 0x7F}, -{0x0400 , 0xE8}, -{0x0401 , 0x40}, -{0x0402 , 0x00}, -{0x0403 , 0x00}, -{0x0404 , 0xF8}, -{0x0405 , 0x03}, -{0x0406 , 0x03}, -{0x0407 , 0x85}, -{0x0408 , 0x44}, -{0x0409 , 0x1F}, -{0x040A , 0x40}, -{0x040B , 0x33}, -{0x040C , 0xA0}, -{0x040D , 0x00}, -{0x040E , 0x00}, -{0x040F , 0x00}, -{0x0410 , 0x0D}, -{0x0411 , 0x0D}, -{0x0412 , 0x0C}, -{0x0413 , 0x04}, -{0x0414 , 0x00}, -{0x0415 , 0x00}, -{0x0416 , 0x07}, -{0x0417 , 0x09}, -{0x0418 , 0x16}, -{0x0419 , 0x14}, -{0x041A , 0x11}, -{0x041B , 0x14}, -{0x041C , 0x07}, -{0x041D , 0x07}, -{0x041E , 0x06}, -{0x041F , 0x02}, -{0x0420 , 0x42}, -{0x0421 , 0x42}, -{0x0422 , 0x47}, -{0x0423 , 0x39}, -{0x0424 , 0x3E}, -{0x0425 , 0x4D}, -{0x0426 , 0x46}, -{0x0427 , 0x3A}, -{0x0428 , 0x21}, -{0x0429 , 0x21}, -{0x042A , 0x26}, -{0x042B , 0x1C}, -{0x042C , 0x25}, -{0x042D , 0x25}, -{0x042E , 0x28}, -{0x042F , 0x20}, -{0x0430 , 0x3E}, -{0x0431 , 0x3E}, -{0x0432 , 0x33}, -{0x0433 , 0x2E}, -{0x0434 , 0x54}, -{0x0435 , 0x53}, -{0x0436 , 0x3C}, -{0x0437 , 0x51}, -{0x0438 , 0x2B}, -{0x0439 , 0x2B}, -{0x043A , 0x38}, -{0x043B , 0x22}, -{0x043C , 0x3B}, -{0x043D , 0x3B}, -{0x043E , 0x31}, -{0x043F , 0x37}, -{0x0440 , 0x00}, -{0x0441 , 0x4B}, -{0x0442 , 0x00}, -{0x0443 , 0x00}, -{0x0444 , 0x31}, -{0x0445 , 0x00}, -{0x0446 , 0x00}, -{0x0447 , 0x00}, -{0x0448 , 0x00}, -{0x0449 , 0x00}, -{0x044A , 0x00}, -{0x044D , 0xE0}, -{0x044E , 0x05}, -{0x044F , 0x07}, -{0x0450 , 0x00}, -{0x0451 , 0x00}, -{0x0452 , 0x00}, -{0x0453 , 0x00}, -{0x0454 , 0x00}, -{0x0455 , 0x00}, -{0x0456 , 0x00}, -{0x0457 , 0x00}, -{0x0458 , 0x00}, -{0x0459 , 0x00}, -{0x045A , 0x00}, -{0x045B , 0x00}, -{0x045C , 0x00}, -{0x045D , 0x00}, -{0x045E , 0x00}, -{0x045F , 0x00}, -{0x0460 , 0x80}, -{0x0461 , 0x10}, -{0x0462 , 0x10}, -{0x0463 , 0x10}, -{0x0464 , 0x08}, -{0x0465 , 0x08}, -{0x0466 , 0x11}, -{0x0467 , 0x09}, -{0x0468 , 0x23}, -{0x0469 , 0x2A}, -{0x046A , 0x2A}, -{0x046B , 0x47}, -{0x046C , 0x52}, -{0x046D , 0x42}, -{0x046E , 0x36}, -{0x046F , 0x46}, -{0x0470 , 0x3A}, -{0x0471 , 0x32}, -{0x0472 , 0x32}, -{0x0473 , 0x38}, -{0x0474 , 0x3D}, -{0x0475 , 0x2F}, -{0x0476 , 0x29}, -{0x0477 , 0x48}, -{0x0600 , 0x00}, -{0x0601 , 0x24}, -{0x0602 , 0x45}, -{0x0603 , 0x0E}, -{0x0604 , 0x14}, -{0x0605 , 0x2F}, -{0x0606 , 0x01}, -{0x0607 , 0x0E}, -{0x0608 , 0x0E}, -{0x0609 , 0x37}, -{0x060A , 0x18}, -{0x060B , 0xA0}, -{0x060C , 0x20}, -{0x060D , 0x07}, -{0x060E , 0x47}, -{0x060F , 0x90}, -{0x0610 , 0x06}, -{0x0611 , 0x0C}, -{0x0612 , 0x28}, -{0x0613 , 0x13}, -{0x0614 , 0x0B}, -{0x0615 , 0x10}, -{0x0616 , 0x14}, -{0x0617 , 0x19}, -{0x0618 , 0x52}, -{0x0619 , 0xA0}, -{0x061A , 0x11}, -{0x061B , 0x33}, -{0x061C , 0x56}, -{0x061D , 0x20}, -{0x061E , 0x28}, -{0x061F , 0x2B}, -{0x0620 , 0x22}, -{0x0621 , 0x11}, -{0x0622 , 0x75}, -{0x0623 , 0x49}, -{0x0624 , 0x6E}, -{0x0625 , 0x80}, -{0x0626 , 0x02}, -{0x0627 , 0x0C}, -{0x0628 , 0x51}, -{0x0629 , 0x25}, -{0x062A , 0x01}, -{0x062B , 0x3D}, -{0x062C , 0x04}, -{0x062D , 0x01}, -{0x062E , 0x0C}, -{0x062F , 0x2C}, -{0x0630 , 0x0D}, -{0x0631 , 0x14}, -{0x0632 , 0x12}, -{0x0633 , 0x34}, -{0x0634 , 0x00}, -{0x0635 , 0x00}, -{0x0636 , 0x00}, -{0x0637 , 0xB1}, -{0x0638 , 0x22}, -{0x0639 , 0x32}, -{0x063A , 0x0E}, -{0x063B , 0x18}, -{0x063C , 0x88}, -{0x0640 , 0xB2}, -{0x0641 , 0xC0}, -{0x0642 , 0x01}, -{0x0643 , 0x26}, -{0x0644 , 0x13}, -{0x0645 , 0x88}, -{0x0646 , 0x64}, -{0x0647 , 0x00}, -{0x0681 , 0x1B}, -{0x0682 , 0xA0}, -{0x0683 , 0x28}, -{0x0684 , 0x00}, -{0x0685 , 0xB0}, -{0x0686 , 0x6F}, -{0x0687 , 0x33}, -{0x0688 , 0x1F}, -{0x0689 , 0x44}, -{0x068A , 0xA8}, -{0x068B , 0x44}, -{0x068C , 0x08}, -{0x068D , 0x08}, -{0x068E , 0x00}, -{0x068F , 0x00}, -{0x0690 , 0x01}, -{0x0691 , 0x00}, -{0x0692 , 0x01}, -{0x0693 , 0x00}, -{0x0694 , 0x00}, -{0x0695 , 0x00}, -{0x0696 , 0x00}, -{0x0697 , 0x00}, -{0x0698 , 0x2A}, -{0x0699 , 0x80}, -{0x069A , 0x1F}, -{0x069B , 0x00}, -{0x069C , 0x02}, -{0x069D , 0xF5}, -{0x069E , 0x03}, -{0x069F , 0x6D}, -{0x06A0 , 0x0C}, -{0x06A1 , 0xB8}, -{0x06A2 , 0x0D}, -{0x06A3 , 0x74}, -{0x06A4 , 0x00}, -{0x06A5 , 0x2F}, -{0x06A6 , 0x00}, -{0x06A7 , 0x2F}, -{0x0F00 , 0x00}, -{0x0F01 , 0x00}, -{0x0100 , 0x01}, -{0x0102 , 0x02}, -{0x0104 , 0x03}, -{0x0101 , 0x00}, - -/////////////////////////// -{0x020B , 0x48}, -{0x020C , 0x64}, -{0x040A , 0x40}, -{0x040B , 0x33}, -{0x0109 , 0x00}, -{0x010A , 0x04}, -{0x010B , 0x03}, -#if 0 -{0x0110 , 0x02}, -{0x0111 , 0x80}, -{0x0112 , 0x01}, -{0x0113 , 0xe0}, -#else -{0x0110, 0x03}, -{0x0111, 0x20}, -{0x0112, 0x02}, -{0x0113, 0x58}, - -#endif -{0x0116 , 0x02}, -{0x0118 , 0x40}, -{0x0119 , 0x01}, -{0x011a , 0x04}, -{0x011B , 0x00}, -{0x0313 , 0x35}, -{0x0314 , 0x36}, -{0x0315 , 0x16}, - -}; - - - -/* 1600X1200 UXGA */ -static struct reginfo sensor_uxga[] = -{ - {0x010c , 0x00}, - {0x010d , 0x08}, - {0x010e , 0x00}, - {0x010f , 0x08}, - {0x010a , 0x00}, - {0x0110 , 0x06}, - {0x0111 , 0x40}, - {0x0112 , 0x04}, - {0x0113 , 0xb0}, - {0x0, 0x0}, -}; - - - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {0x010c , 0x00}, - {0x010d , 0xa8}, - {0x010e , 0x00}, - {0x010f , 0x60}, - {0x010a , 0x00}, - {0x0110 , 0x05}, - {0x0111 , 0x00}, - {0x0112 , 0x04}, - {0x0113 , 0x00}, - {0x00, 0x00}, -}; - -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ -#if 0 - {0x0101, 0x00}, - {0x0103, 0x00}, - {0x0105, 0x00}, - {0x0106, 0xF0}, - {0x0107, 0x00}, - {0x0108, 0x1C}, - {0x0109, 0x01}, - {0x010A, 0x00}, - {0x010B, 0x00}, - {0x010C, 0x00}, - {0x010D, 0x08}, - {0x010E, 0x00}, - {0x010F, 0x08}, - {0x0110, 0x06}, - {0x0111, 0x40}, - {0x0112, 0x04}, - {0x0113, 0xB0}, - {0x0114, 0x04}, - {0x0115, 0x00}, - {0x0116, 0x02}, - {0x0117, 0x00}, - {0x0118, 0x40}, - {0x0119, 0x02}, - {0x011A, 0x04}, - {0x011B, 0x01}, - {0x011C, 0x00}, - {0x011D, 0x01}, - {0x011E, 0x36}, - {0x011F, 0x00}, - {0x0120, 0x1C}, - {0x0121, 0x00}, - {0x0122, 0x04}, - {0x0123, 0x00}, - {0x0124, 0x00}, - {0x0125, 0x00}, - {0x0126, 0x00}, - {0x0127, 0x00}, - {0x0128, 0x00}, - {0x0200, 0x1f}, - {0x0201, 0x0c}, - {0x0202, 0x38}, - {0x0203, 0x00}, - {0x0204, 0x03}, - {0x0205, 0x1F}, - {0x0206, 0x0B}, - {0x0207, 0x20}, - {0x0208, 0x00}, - {0x0209, 0x2A}, - {0x020A, 0x01}, - {0x020B, 0x28}, - {0x020C, 0x44}, - {0x020D, 0xC8}, - {0x020E, 0xBC}, - {0x020F, 0x08}, - {0x0210, 0xD6}, - {0x0211, 0x00}, - {0x0212, 0x20}, - {0x0213, 0x81}, - {0x0214, 0x15}, - {0x0215, 0x00}, - {0x0216, 0x00}, - {0x0217, 0x00}, - {0x0218, 0x46}, - {0x0219, 0x30}, - {0x021A, 0x03}, - {0x021B, 0x28}, - {0x021C, 0x02}, - {0x021D, 0x60}, - {0x021E, 0x00}, - {0x021F, 0x00}, - {0x0220, 0x08}, - {0x0221, 0x08}, - {0x0222, 0x04}, - {0x0223, 0x00}, - {0x0224, 0x1F}, - {0x0225, 0x1E}, - {0x0226, 0x18}, - {0x0227, 0x1D}, - {0x0228, 0x1F}, - {0x0229, 0x1F}, - {0x022A, 0x01}, - {0x022B, 0x04}, - {0x022C, 0x05}, - {0x022D, 0x05}, - {0x022E, 0x04}, - {0x022F, 0x03}, - {0x0230, 0x02}, - {0x0231, 0x1F}, - {0x0232, 0x1A}, - {0x0233, 0x19}, - {0x0234, 0x19}, - {0x0235, 0x1B}, - {0x0236, 0x1F}, - {0x0237, 0x04}, - {0x0238, 0xEE}, - {0x0239, 0xFF}, - {0x023A, 0x00}, - {0x023B, 0x00}, - {0x023C, 0x00}, - {0x023D, 0x00}, - {0x023E, 0x00}, - {0x023F, 0x00}, - {0x0240, 0x00}, - {0x0241, 0x00}, - {0x0242, 0x00}, - {0x0243, 0x21}, - {0x0244, 0x42}, - {0x0245, 0x53}, - {0x0246, 0x54}, - {0x0247, 0x54}, - {0x0248, 0x54}, - {0x0249, 0x33}, - {0x024A, 0x11}, - {0x024B, 0x00}, - {0x024C, 0x00}, - {0x024D, 0xFF}, - {0x024E, 0xEE}, - {0x024F, 0xDD}, - {0x0250, 0x00}, - {0x0251, 0x00}, - {0x0252, 0x00}, - {0x0253, 0x00}, - {0x0254, 0x00}, - {0x0255, 0x00}, - {0x0256, 0x00}, - {0x0257, 0x00}, - {0x0258, 0x00}, - {0x0259, 0x00}, - {0x025A, 0x00}, - {0x025B, 0x00}, - {0x025C, 0x00}, - {0x025D, 0x00}, - {0x025E, 0x00}, - {0x025F, 0x00}, - {0x0260, 0x00}, - {0x0261, 0x00}, - {0x0262, 0x00}, - {0x0263, 0x00}, - {0x0264, 0x00}, - {0x0265, 0x00}, - {0x0266, 0x00}, - {0x0267, 0x00}, - {0x0268, 0x8F}, - {0x0269, 0xA3}, - {0x026A, 0xB4}, - {0x026B, 0x90}, - {0x026C, 0x00}, - {0x026D, 0xD0}, - {0x026E, 0x60}, - {0x026F, 0xA0}, - {0x0270, 0x40}, - {0x0300, 0x81}, - {0x0301, 0x80}, - {0x0302, 0x22}, - {0x0303, 0x06}, - {0x0304, 0x03}, - {0x0305, 0x83}, - {0x0306, 0x00}, - {0x0307, 0x22}, - {0x0308, 0x00}, - {0x0309, 0x55}, - {0x030A, 0x55}, - {0x030B, 0x55}, - {0x030C, 0x54}, - {0x030D, 0x1F}, - {0x030E, 0x0A}, - {0x030F, 0x10}, - {0x0310, 0x04}, - {0x0311, 0xFF}, - {0x0312, 0x08}, - {0x0313, 0x35}, - {0x0314, 0x36}, - {0x0315, 0x15}, - {0x0316, 0x26}, - {0x0317, 0x02}, - {0x0318, 0x08}, - {0x0319, 0x0C}, - {0x031A, 0x81}, - {0x031B, 0x00}, - {0x031C, 0x3D}, - {0x031D, 0x00}, - {0x031E, 0xF9}, - {0x031F, 0x00}, - {0x0320, 0x24}, - {0x0321, 0x14}, - {0x0322, 0x1A}, - {0x0323, 0x24}, - {0x0324, 0x08}, - {0x0325, 0xF0}, - {0x0326, 0x30}, - {0x0327, 0x17}, - {0x0328, 0x11}, - {0x0329, 0x22}, - {0x032A, 0x2F}, - {0x032B, 0x21}, - {0x032C, 0xDA}, - {0x032D, 0x10}, - {0x032E, 0xEA}, - {0x032F, 0x18}, - {0x0330, 0x29}, - {0x0331, 0x25}, - {0x0332, 0x12}, - {0x0333, 0x0F}, - {0x0334, 0xE0}, - {0x0335, 0x13}, - {0x0336, 0xFF}, - {0x0337, 0x20}, - {0x0338, 0x46}, - {0x0339, 0x04}, - {0x033A, 0x04}, - {0x033B, 0xFF}, - {0x033C, 0x01}, - {0x033D, 0x00}, - {0x033E, 0x03}, - {0x033F, 0x28}, - {0x0340, 0x02}, - {0x0341, 0x60}, - {0x0342, 0xAC}, - {0x0343, 0x97}, - {0x0344, 0x7F}, - {0x0400, 0xE8}, - {0x0401, 0x40}, - {0x0402, 0x00}, - {0x0403, 0x00}, - {0x0404, 0xF8}, - {0x0405, 0x03}, - {0x0406, 0x03}, - {0x0407, 0x85}, - {0x0408, 0x44}, - {0x0409, 0x1F}, - {0x040A, 0x40}, - {0x040B, 0x33}, - {0x040C, 0xA0}, - {0x040D, 0x00}, - {0x040E, 0x00}, - {0x040F, 0x00}, - {0x0410, 0x0D}, - {0x0411, 0x0D}, - {0x0412, 0x0C}, - {0x0413, 0x04}, - {0x0414, 0x00}, - {0x0415, 0x00}, - {0x0416, 0x07}, - {0x0417, 0x09}, - {0x0418, 0x16}, - {0x0419, 0x14}, - {0x041A, 0x11}, - {0x041B, 0x14}, - {0x041C, 0x07}, - {0x041D, 0x07}, - {0x041E, 0x06}, - {0x041F, 0x02}, - {0x0420, 0x42}, - {0x0421, 0x42}, - {0x0422, 0x47}, - {0x0423, 0x39}, - {0x0424, 0x3E}, - {0x0425, 0x4D}, - {0x0426, 0x46}, - {0x0427, 0x3A}, - {0x0428, 0x21}, - {0x0429, 0x21}, - {0x042A, 0x26}, - {0x042B, 0x1C}, - {0x042C, 0x25}, - {0x042D, 0x25}, - {0x042E, 0x28}, - {0x042F, 0x20}, - {0x0430, 0x3E}, - {0x0431, 0x3E}, - {0x0432, 0x33}, - {0x0433, 0x2E}, - {0x0434, 0x54}, - {0x0435, 0x53}, - {0x0436, 0x3C}, - {0x0437, 0x51}, - {0x0438, 0x2B}, - {0x0439, 0x2B}, - {0x043A, 0x38}, - {0x043B, 0x22}, - {0x043C, 0x3B}, - {0x043D, 0x3B}, - {0x043E, 0x31}, - {0x043F, 0x37}, - {0x0440, 0x00}, - {0x0441, 0x4B}, - {0x0442, 0x00}, - {0x0443, 0x00}, - {0x0444, 0x31}, - {0x0445, 0x00}, - {0x0446, 0x00}, - {0x0447, 0x00}, - {0x0448, 0x00}, - {0x0449, 0x00}, - {0x044A, 0x00}, - {0x044D, 0xE0}, - {0x044E, 0x05}, - {0x044F, 0x07}, - {0x0450, 0x00}, - {0x0451, 0x00}, - {0x0452, 0x00}, - {0x0453, 0x00}, - {0x0454, 0x00}, - {0x0455, 0x00}, - {0x0456, 0x00}, - {0x0457, 0x00}, - {0x0458, 0x00}, - {0x0459, 0x00}, - {0x045A, 0x00}, - {0x045B, 0x00}, - {0x045C, 0x00}, - {0x045D, 0x00}, - {0x045E, 0x00}, - {0x045F, 0x00}, - {0x0460, 0x80}, - {0x0461, 0x10}, - {0x0462, 0x10}, - {0x0463, 0x10}, - {0x0464, 0x08}, - {0x0465, 0x08}, - {0x0466, 0x11}, - {0x0467, 0x09}, - {0x0468, 0x23}, - {0x0469, 0x2A}, - {0x046A, 0x2A}, - {0x046B, 0x47}, - {0x046C, 0x52}, - {0x046D, 0x42}, - {0x046E, 0x36}, - {0x046F, 0x46}, - {0x0470, 0x3A}, - {0x0471, 0x32}, - {0x0472, 0x32}, - {0x0473, 0x38}, - {0x0474, 0x3D}, - {0x0475, 0x2F}, - {0x0476, 0x29}, - {0x0477, 0x48}, - {0x0600, 0x00}, - {0x0601, 0x24}, - {0x0602, 0x45}, - {0x0603, 0x0E}, - {0x0604, 0x14}, - {0x0605, 0x2F}, - {0x0606, 0x01}, - {0x0607, 0x0E}, - {0x0608, 0x0E}, - {0x0609, 0x37}, - {0x060A, 0x18}, - {0x060B, 0xA0}, - {0x060C, 0x20}, - {0x060D, 0x07}, - {0x060E, 0x47}, - {0x060F, 0x90}, - {0x0610, 0x06}, - {0x0611, 0x0C}, - {0x0612, 0x28}, - {0x0613, 0x13}, - {0x0614, 0x0B}, - {0x0615, 0x10}, - {0x0616, 0x14}, - {0x0617, 0x19}, - {0x0618, 0x52}, - {0x0619, 0xA0}, - {0x061A, 0x11}, - {0x061B, 0x33}, - {0x061C, 0x56}, - {0x061D, 0x20}, - {0x061E, 0x28}, - {0x061F, 0x2B}, - {0x0620, 0x22}, - {0x0621, 0x11}, - {0x0622, 0x75}, - {0x0623, 0x49}, - {0x0624, 0x6E}, - {0x0625, 0x80}, - {0x0626, 0x02}, - {0x0627, 0x0C}, - {0x0628, 0x51}, - {0x0629, 0x25}, - {0x062A, 0x01}, - {0x062B, 0x3D}, - {0x062C, 0x04}, - {0x062D, 0x01}, - {0x062E, 0x0C}, - {0x062F, 0x2C}, - {0x0630, 0x0D}, - {0x0631, 0x14}, - {0x0632, 0x12}, - {0x0633, 0x34}, - {0x0634, 0x00}, - {0x0635, 0x00}, - {0x0636, 0x00}, - {0x0637, 0xB1}, - {0x0638, 0x22}, - {0x0639, 0x32}, - {0x063A, 0x0E}, - {0x063B, 0x18}, - {0x063C, 0x88}, - {0x0640, 0xB2}, - {0x0641, 0xC0}, - {0x0642, 0x01}, - {0x0643, 0x26}, - {0x0644, 0x13}, - {0x0645, 0x88}, - {0x0646, 0x64}, - {0x0647, 0x00}, - {0x0681, 0x1B}, - {0x0682, 0xA0}, - {0x0683, 0x28}, - {0x0684, 0x00}, - {0x0685, 0xB0}, - {0x0686, 0x6F}, - {0x0687, 0x33}, - {0x0688, 0x1F}, - {0x0689, 0x44}, - {0x068A, 0xA8}, - {0x068B, 0x44}, - {0x068C, 0x08}, - {0x068D, 0x08}, - {0x068E, 0x00}, - {0x068F, 0x00}, - {0x0690, 0x01}, - {0x0691, 0x00}, - {0x0692, 0x01}, - {0x0693, 0x00}, - {0x0694, 0x00}, - {0x0695, 0x00}, - {0x0696, 0x00}, - {0x0697, 0x00}, - {0x0698, 0x2A}, - {0x0699, 0x80}, - {0x069A, 0x1F}, - {0x069B, 0x00}, - {0x069C, 0x02}, - {0x069D, 0xF5}, - {0x069E, 0x03}, - {0x069F, 0x6D}, - {0x06A0, 0x0C}, - {0x06A1, 0xB8}, - {0x06A2, 0x0D}, - {0x06A3, 0x74}, - {0x06A4, 0x00}, - {0x06A5, 0x2F}, - {0x06A6, 0x00}, - {0x06A7, 0x2F}, - {0x0F00, 0x00}, - {0x0F01, 0x00}, - {0x0100, 0x01}, - {0x0102, 0x02}, - {0x0104, 0x03}, -#endif - {0x020B, 0x48}, - {0x020C, 0x64}, - {0x040A, 0x40}, - {0x040B, 0x33}, - {0x010c , 0x00}, - {0x010d , 0x08}, - {0x010e , 0x00}, - {0x010f , 0x08}, - {0x010a , 0x00}, - {0x0109, 0x00}, - {0x010A, 0x04}, - {0x010B, 0x03}, - {0x0110, 0x03}, - {0x0111, 0x20}, - {0x0112, 0x02}, - {0x0113, 0x58}, - {0x0116, 0x02}, - {0x0118, 0x40}, - {0x0119, 0x02}, - {0x011a, 0x04}, - {0x011B, 0x01}, - {0x0, 0x0}, -}; - - - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - {0x020B , 0x48}, - {0x020C , 0x64}, - {0x040A , 0x40}, - {0x040B , 0x33}, - {0x0109 , 0x00}, - {0x010A , 0x04}, - {0x010B , 0x03}, - {0x010c , 0x00}, - {0x010d , 0xa8}, - {0x010e , 0x00}, - {0x010f , 0x60}, - {0x010a , 0x04}, - #if 1 - {0x0110 , 0x02}, - {0x0111 , 0x80}, - {0x0112 , 0x01}, - {0x0113 , 0xe0}, - #else - {0x0110, 0x03}, - {0x0111, 0x20}, - {0x0112, 0x02}, - {0x0113, 0x58}, - #endif - {0x0116 , 0x02}, - {0x0118 , 0x40}, - {0x0119 , 0x01}, - {0x011a , 0x04}, - {0x011B , 0x00}, - {0x0313 , 0x35}, - {0x0314 , 0x36}, - {0x0315 , 0x16}, - {0x0, 0x0}, -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {0x0, 0x0}, -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - - - {0x0, 0x0}, -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - - {0x0, 0x0}, -}; - -#endif diff --git a/drivers/media/video/hi253.c b/drivers/media/video/hi253.c deleted file mode 100755 index 068afcee1916..000000000000 --- a/drivers/media/video/hi253.c +++ /dev/null @@ -1,3666 +0,0 @@ -/* -o* Driver for MT9M001 CMOS Image Sensor from Micron - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_HI253 -#define SENSOR_V4L2_IDENT V4L2_IDENT_HI253 -#define SENSOR_ID 0x92 -#define SENSOR_MIN_WIDTH 176 -#define SENSOR_MIN_HEIGHT 144 -#define SENSOR_MAX_WIDTH_REAL 1600 -#define SENSOR_MAX_HEIGHT_REAL 1200 -#if defined(CONFIG_SOC_CAMERA_HI253_INTERPOLATION_5M) - #define SENSOR_MAX_WIDTH 2592 - #define SENSOR_MAX_HEIGHT 1944 -#elif defined(CONFIG_SOC_CAMERA_HI253_INTERPOLATION_3M) - #define SENSOR_MAX_WIDTH 2048 - #define SENSOR_MAX_HEIGHT 1536 -#else - #define SENSOR_MAX_WIDTH SENSOR_MAX_WIDTH_REAL - #define SENSOR_MAX_HEIGHT SENSOR_MAX_HEIGHT_REAL -#endif - -#define SENSOR_INIT_WIDTH 1600 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 1200 -#define SENSOR_INIT_WINSEQADR sensor_uxga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_UYVY8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 1 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 0 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 - -#define CONFIG_SENSOR_I2C_SPEED 100000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING|\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) -#define END_REG 0xff - -struct reginfo -{ - u8 reg; - u8 val; -}; - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -#if CONFIG_SENSOR_Flash -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); -#endif -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_HI253_USER_DEFINED_SERIES -#include "hi253_user_series.c" -#else -/* init SVGA preview */ -static struct reginfo sensor_init_data[] = -{ -// {0x01, 0xf9}, - {0x08, 0x0f}, - {0x01, 0xf8}, - - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - - {0x0e, 0x00}, - - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - - {0x0e, 0x00}, - {0x01, 0xf1}, - {0x08, 0x00}, - {0x01, 0xf3}, - {0x01, 0xf1}, - - {0x03, 0x20}, - {0x10, 0x0c}, - {0x03, 0x22}, - {0x10, 0x69}, - - //Page 00 - {0x03, 0x00}, - {0x10, 0x00}, //lxh - {0x11, 0x90}, - {0x12, 0x04}, - {0x0b, 0xaa}, - {0x0c, 0xaa}, - {0x0d, 0xaa}, - {0x20, 0x00}, - {0x21, 0x0a}, //lxh - {0x22, 0x00}, - {0x23, 0x0a}, //lxh - {0x24, 0x04}, - {0x25, 0xb0}, - {0x26, 0x06}, - {0x27, 0x40}, - - {0x40, 0x01}, - {0x41, 0x98},//lxh - {0x42, 0x00}, - {0x43, 0x14},//lxh - - {0x45, 0x04}, - {0x46, 0x18}, - {0x47, 0xd8}, - - {0xe1, 0x0f}, - - //BLC - {0x80, 0x2e}, - {0x81, 0x7e}, - {0x82, 0x90}, - {0x83, 0x00}, - {0x84, 0x0c}, - {0x85, 0x00}, - {0x90, 0x0c}, - {0x91, 0x0c}, - {0x92, 0x78}, - {0x93, 0x70}, - {0x94, 0x75}, - {0x95, 0x70}, - {0x96, 0xdc}, - {0x97, 0xfe}, - {0x98, 0x20}, - - //OutDoor BLC - {0x99,0x42}, - {0x9a,0x42}, - {0x9b,0x42}, - {0x9c,0x42}, - - //Dark BLC - {0xa0, 0x00}, - {0xa2, 0x00}, - {0xa4, 0x00}, - {0xa6, 0x00}, - - //Normal BLC - {0xa8, 0x43}, - {0xaa, 0x43}, - {0xac, 0x43}, - {0xae, 0x43}, - - //Page 02 - {0x03, 0x02}, - {0x12, 0x03}, - {0x13, 0x03}, - {0x16, 0x00}, - {0x17, 0x8C}, - {0x18, 0x4c}, - {0x19, 0x00}, - {0x1a, 0x39}, - {0x1c, 0x09}, - {0x1d, 0x40}, - {0x1e, 0x30}, - {0x1f, 0x10}, - {0x20, 0x77}, - {0x21, 0xde}, - {0x22, 0xa7}, - {0x23, 0x30}, - {0x27, 0x3c}, - {0x2b, 0x80}, - {0x2e, 0x00}, - {0x2f, 0x00}, - {0x30, 0x05}, - {0x50, 0x20}, - {0x52, 0x01}, - {0x53, 0xc1}, - {0x55, 0x1c}, - {0x56, 0x11}, - {0x5d, 0xA2}, - {0x5e, 0x5a}, - {0x60, 0x87}, - {0x61, 0x99}, - {0x62, 0x88}, - {0x63, 0x97}, - {0x64, 0x88}, - {0x65, 0x97}, - {0x67, 0x0c}, - {0x68, 0x0c}, - {0x69, 0x0c}, - {0x72, 0x89}, - {0x73, 0x96}, - {0x74, 0x89}, - {0x75, 0x96}, - {0x76, 0x89}, - {0x77, 0x96}, - {0x7C, 0x85}, - {0x7d, 0xaf}, - {0x80, 0x01}, - {0x81, 0x7f}, - {0x82, 0x13}, - {0x83, 0x24}, - {0x84, 0x7d}, - {0x85, 0x81}, - {0x86, 0x7d}, - {0x87, 0x81}, - {0x92, 0x48}, - {0x93, 0x54}, - {0x94, 0x7d}, - {0x95, 0x81}, - {0x96, 0x7d}, - {0x97, 0x81}, - {0xa0, 0x02}, - {0xa1, 0x7b}, - {0xa2, 0x02}, - {0xa3, 0x7b}, - {0xa4, 0x7b}, - {0xa5, 0x02}, - {0xa6, 0x7b}, - {0xa7, 0x02}, - {0xa8, 0x85}, - {0xa9, 0x8c}, - {0xaa, 0x85}, - {0xab, 0x8c}, - {0xac, 0x10}, - {0xad, 0x16}, - {0xae, 0x10}, - {0xaf, 0x16}, - {0xb0, 0x99}, - {0xb1, 0xa3}, - {0xb2, 0xa4}, - {0xb3, 0xae}, - {0xb4, 0x9b}, - {0xb5, 0xa2}, - {0xb6, 0xa6}, - {0xb7, 0xac}, - {0xb8, 0x9b}, - {0xb9, 0x9f}, - {0xba, 0xa6}, - {0xbb, 0xaa}, - {0xbc, 0x9b}, - {0xbd, 0x9f}, - {0xbe, 0xa6}, - {0xbf, 0xaa}, - {0xc4, 0x2c}, - {0xc5, 0x43}, - {0xc6, 0x63}, - {0xc7, 0x79}, - {0xc8, 0x2d}, - {0xc9, 0x42}, - {0xca, 0x2d}, - {0xcb, 0x42}, - {0xcc, 0x64}, - {0xcd, 0x78}, - {0xce, 0x64}, - {0xcf, 0x78}, - {0xd0, 0x0a}, - {0xd1, 0x09}, - {0xd4, 0x0c}, - {0xd5, 0x0c}, - {0xd6, 0xd8}, - {0xd7, 0xd0},//lxh - {0xe0, 0xc4}, - {0xe1, 0xc4}, - {0xe2, 0xc4}, - {0xe3, 0xc4}, - {0xe4, 0x00}, - {0xe8, 0x80}, - {0xe9, 0x40}, - {0xea, 0x7f}, - {0xf0, 0x01}, - {0xf1, 0x01}, - {0xf2, 0x01}, - {0xf3, 0x01}, - {0xf4, 0x01}, - - //PAGE10 - {0x03, 0x10}, - {0x10, 0x01}, //lxh - {0x11, 0x03}, //lxh,normal - {0x12, 0x00}, - {0x13, 0x00}, - {0x20, 0x00}, - - {0x40, 0x80}, - {0x41, 0x00}, - {0x48, 0x88},// 84 - {0x50, 0x90}, - {0x30, 0x00}, - {0x31, 0x00}, - {0x32, 0x00}, - {0x33, 0x00}, - - {0x34, 0x30}, - {0x35, 0x00}, - {0x36, 0x00}, - {0x38, 0x00}, - {0x3e, 0x58}, - {0x3f, 0x00}, - - //Saturation - {0x60, 0x6f}, - {0x61, 0x95},// 74 - {0x62, 0x95},// 76 - {0x63, 0x30}, - {0x64, 0x41}, - - {0x66, 0x33}, - {0x67, 0x00}, - - {0x6a, 0x90}, - {0x6b, 0x80}, - {0x6c, 0x80}, - {0x6d, 0xa0}, - - {0x76, 0x01}, - {0x74, 0x66}, - {0x79, 0x06}, - - //Page 11 - {0x03, 0x11}, - {0x10, 0x7f},//lxh,3f - {0x11, 0x40}, - {0x12, 0xba}, - {0x13, 0xcb}, - {0x26, 0x20}, - {0x27, 0x22}, - {0x28, 0x0f}, - {0x29, 0x10}, - {0x2b, 0x30}, - {0x2c, 0x32}, - - //Out2 D-LPF th - {0x30, 0x70}, - {0x31, 0x10}, - {0x32, 0x65}, - {0x33, 0x09}, - {0x34, 0x06}, - {0x35, 0x04}, - - //Out1 D-LPF th - {0x36, 0x70}, - {0x37, 0x18}, - {0x38, 0x65}, - {0x39, 0x09}, - {0x3a, 0x06}, - {0x3b, 0x04}, - - //Indoor D-LPF th - {0x3c, 0x80}, - {0x3d, 0x18}, - {0x3e, 0x80}, - {0x3f, 0x0c}, - {0x40, 0x09}, - {0x41, 0x06}, - - {0x42, 0x80}, - {0x43, 0x18}, - {0x44, 0x80}, - {0x45, 0x12}, - {0x46, 0x10}, - {0x47, 0x10}, - {0x48, 0x90}, - {0x49, 0x40}, - {0x4a, 0x80}, - {0x4b, 0x13}, - {0x4c, 0x10}, - {0x4d, 0x11}, - {0x4e, 0x80}, - {0x4f, 0x30}, - {0x50, 0x80}, - {0x51, 0x13}, - {0x52, 0x10}, - {0x53, 0x13}, - {0x54, 0x11}, - {0x55, 0x17}, - {0x56, 0x20}, - {0x57, 0x20}, - {0x58, 0x20}, - {0x59, 0x30}, - {0x5a, 0x18}, - {0x5b, 0x00}, - {0x5c, 0x00}, - {0x60, 0x3f}, - {0x62, 0x50}, - {0x70, 0x06}, - - //Page 12 - {0x03, 0x12}, - {0x20, 0x0f}, - {0x21, 0x0f}, - {0x25, 0x30}, - {0x28, 0x00}, - {0x29, 0x00}, - {0x2a, 0x00}, - {0x30, 0x50}, - {0x31, 0x18}, - {0x32, 0x32}, - {0x33, 0x40}, - {0x34, 0x50}, - {0x35, 0x70}, - {0x36, 0xa0}, - - //Out2 th - {0x40, 0xa0}, - {0x41, 0x40}, - {0x42, 0xa0}, - {0x43, 0x90}, - {0x44, 0x90}, - {0x45, 0x80}, - - //Out1 th - {0x46, 0xb0}, - {0x47, 0x55}, - {0x48, 0xa0}, - {0x49, 0x90}, - {0x4a, 0x90}, - {0x4b, 0x80}, - - //In door th - {0x4c, 0xb0}, - {0x4d, 0x40}, - {0x4e, 0x90}, - {0x4f, 0x90}, - {0x50, 0xe6}, - {0x51, 0x80}, - - //Dark1 th - {0x52, 0xb0}, - {0x53, 0x60}, - {0x54, 0xc0}, - {0x55, 0xc0}, - {0x56, 0xc0}, - {0x57, 0x80}, - - //Dark2 th - {0x58, 0x90}, - {0x59, 0x40}, - {0x5a, 0xd0}, - {0x5b, 0xd0}, - {0x5c, 0xe0}, - {0x5d, 0x80}, - - //Dark3 th - {0x5e, 0x88}, - {0x5f, 0x40}, - {0x60, 0xe0}, - {0x61, 0xe6}, - {0x62, 0xe6}, - {0x63, 0x80}, - - {0x70, 0x15}, - {0x71, 0x01}, - - {0x72, 0x18}, - {0x73, 0x01}, - - {0x74, 0x25}, - {0x75, 0x15}, - {0x80, 0x30}, - {0x81, 0x50}, - {0x82, 0x80}, - {0x85, 0x1a}, - {0x88, 0x00}, - {0x89, 0x00}, - {0x90, 0x5d}, - - {0xc5, 0x30}, - {0xc6, 0x2a}, - - {0xD0, 0x0c}, - {0xD1, 0x80}, - {0xD2, 0x67}, - {0xD3, 0x00}, - {0xD4, 0x00}, - {0xD5, 0x02}, - {0xD6, 0xff}, - {0xD7, 0x18}, - {0x3b, 0x06}, - {0x3c, 0x06}, - - {0xc5, 0x30}, - {0xc6, 0x2a}, - - //Page 13 - {0x03, 0x13}, - {0x10, 0xcb}, - {0x11, 0x7b}, - {0x12, 0x07}, - {0x14, 0x00}, - - {0x20, 0x15}, - {0x21, 0x13}, - {0x22, 0x33}, - {0x23, 0x04}, - {0x24, 0x09}, - {0x25, 0x08}, - {0x26, 0x18}, - {0x27, 0x30}, - {0x29, 0x12}, - {0x2a, 0x50}, - - //Low clip th - {0x2b, 0x06}, - {0x2c, 0x06}, - {0x25, 0x08}, - {0x2d, 0x0c}, - {0x2e, 0x12}, - {0x2f, 0x12}, - - //Out2 Edge - {0x50, 0x10}, - {0x51, 0x14}, - {0x52, 0x10}, - {0x53, 0x0c}, - {0x54, 0x0f}, - {0x55, 0x0c}, - - //Out1 Edge - {0x56, 0x10}, - {0x57, 0x13}, - {0x58, 0x10}, - {0x59, 0x0c}, - {0x5a, 0x0f}, - {0x5b, 0x0c}, - - //Indoor Edge - {0x5c, 0x0a}, - {0x5d, 0x0b}, - {0x5e, 0x0a}, - {0x5f, 0x08}, - {0x60, 0x09}, - {0x61, 0x08}, - - //Dark1 Edge - {0x62, 0x08}, - {0x63, 0x08}, - {0x64, 0x08}, - {0x65, 0x06}, - {0x66, 0x06}, - {0x67, 0x06}, - - //Dark2 Edge - {0x68, 0x07}, - {0x69, 0x07}, - {0x6a, 0x07}, - {0x6b, 0x05}, - {0x6c, 0x05}, - {0x6d, 0x05}, - - //Dark3 Edge - {0x6e, 0x07}, - {0x6f, 0x07}, - {0x70, 0x07}, - {0x71, 0x05}, - {0x72, 0x05}, - {0x73, 0x05}, - - //2DY - {0x80, 0xfd}, - {0x81, 0x1f}, - {0x82, 0x05}, - {0x83, 0x01}, - - {0x90, 0x15}, - {0x91, 0x15}, - {0x92, 0x33}, - {0x93, 0x30}, - {0x94, 0x03}, - {0x95, 0x14}, - {0x97, 0x30}, - {0x99, 0x30}, - - {0xa0, 0x04}, - {0xa1, 0x05}, - {0xa2, 0x04}, - {0xa3, 0x05}, - {0xa4, 0x07}, - {0xa5, 0x08}, - {0xa6, 0x07}, - {0xa7, 0x08}, - {0xa8, 0x07}, - {0xa9, 0x08}, - {0xaa, 0x07}, - {0xab, 0x08}, - - //Out2 - {0xb0, 0x22}, - {0xb1, 0x2a}, - {0xb2, 0x28}, - {0xb3, 0x22}, - {0xb4, 0x2a}, - {0xb5, 0x28}, - - //Out1 - {0xb6, 0x22}, - {0xb7, 0x2a}, - {0xb8, 0x28}, - {0xb9, 0x22}, - {0xba, 0x2a}, - {0xbb, 0x28}, - - {0xbc, 0x17}, - {0xbd, 0x17}, - {0xbe, 0x17}, - {0xbf, 0x17}, - {0xc0, 0x17}, - {0xc1, 0x17}, - - //Dark1 - {0xc2, 0x1e}, - {0xc3, 0x12}, - {0xc4, 0x10}, - {0xc5, 0x1e}, - {0xc6, 0x12}, - {0xc7, 0x10}, - - //Dark2 - {0xc8, 0x18}, - {0xc9, 0x05}, - {0xca, 0x05}, - {0xcb, 0x18}, - {0xcc, 0x05}, - {0xcd, 0x05}, - - //Dark3 - {0xce, 0x18}, - {0xcf, 0x05}, - {0xd0, 0x05}, - {0xd1, 0x18}, - {0xd2, 0x05}, - {0xd3, 0x05}, - - //Page 14 - {0x03, 0x14}, - {0x10, 0x11}, - {0x20, 0x40}, - {0x21, 0x80}, - {0x23, 0x80}, - {0x22, 0x80}, - {0x23, 0x80}, - {0x24, 0x80}, - - {0x30, 0xc8}, - {0x31, 0x2b}, - {0x32, 0x00}, - {0x33, 0x00}, - {0x34, 0x90}, - - {0x40, 0x42}, - {0x50, 0x2d}, - {0x60, 0x28}, - {0x70, 0x2d}, - - //Page 15 - {0x03, 0x15}, - {0x10, 0x0f}, - {0x14, 0x52}, - {0x15, 0x42}, - {0x16, 0x32}, - {0x17, 0x2f}, - - //CMC - {0x30, 0x8f}, - {0x31, 0x59}, - {0x32, 0x0a}, - {0x33, 0x15}, - {0x34, 0x5b}, - {0x35, 0x06}, - {0x36, 0x07}, - {0x37, 0x40}, - {0x38, 0x86}, - - //CMC OFS - {0x40, 0x95}, - {0x41, 0x1f}, - {0x42, 0x8a}, - {0x43, 0x86}, - {0x44, 0x0a}, - {0x45, 0x84}, - {0x46, 0x87}, - {0x47, 0x9b}, - {0x48, 0x23}, - - //CMC POFS - {0x50, 0x8c}, - {0x51, 0x0c}, - {0x52, 0x00}, - {0x53, 0x07}, - {0x54, 0x17}, - {0x55, 0x9d}, - {0x56, 0x00}, - {0x57, 0x0b}, - {0x58, 0x89}, - - {0x80, 0x03}, - {0x85, 0x40}, - {0x87, 0x02}, - {0x88, 0x00}, - {0x89, 0x00}, - {0x8a, 0x00}, - - {0x03, 0x16}, - {0x10, 0x31}, - {0x18, 0x37}, - {0x19, 0x36}, - {0x1a, 0x0e}, - {0x1b, 0x01}, - {0x1c, 0xdc}, - {0x1d, 0xfe}, -/* original - {0x30, 0x00}, - {0x31, 0x06}, - {0x32, 0x1d}, - {0x33, 0x33}, - {0x34, 0x53}, - {0x35, 0x6c}, - {0x36, 0x81}, - {0x37, 0x94}, - {0x38, 0xa4}, - {0x39, 0xb3}, - {0x3a, 0xc0}, - {0x3b, 0xcb}, - {0x3c, 0xd5}, - {0x3d, 0xde}, - {0x3e, 0xe6}, - {0x3f, 0xee}, - {0x40, 0xf5}, - {0x41, 0xfc}, - {0x42, 0xff}, - - {0x50, 0x00}, - {0x51, 0x03}, - {0x52, 0x19}, - {0x53, 0x34}, - {0x54, 0x58}, - {0x55, 0x75}, - {0x56, 0x8d}, - {0x57, 0xa1}, - {0x58, 0xb2}, - {0x59, 0xbe}, - {0x5a, 0xc9}, - {0x5b, 0xd2}, - {0x5c, 0xdb}, - {0x5d, 0xe3}, - {0x5e, 0xeb}, - {0x5f, 0xf0}, - {0x60, 0xf5}, - {0x61, 0xf7}, - {0x62, 0xf8}, - - {0x70, 0x00}, - {0x71, 0x08}, - {0x72, 0x17}, - {0x73, 0x2f}, - {0x74, 0x53}, - {0x75, 0x6c}, - {0x76, 0x81}, - {0x77, 0x94}, - {0x78, 0xa4}, - {0x79, 0xb3}, - {0x7a, 0xc0}, - {0x7b, 0xcb}, - {0x7c, 0xd5}, - {0x7d, 0xde}, - {0x7e, 0xe6}, - {0x7f, 0xee}, - {0x80, 0xf4}, - {0x81, 0xfa}, - {0x82, 0xff}, -*/ - {0x30, 0x00}, - {0x31, 0x08}, - {0x32, 0x1f}, - {0x33, 0x35}, - {0x34, 0x55}, - {0x35, 0x6e}, - {0x36, 0x83}, - {0x37, 0x96}, - {0x38, 0xa6}, - {0x39, 0xb5}, - {0x3a, 0xc2}, - {0x3b, 0xcd}, - {0x3c, 0xd7}, - {0x3d, 0xe0}, - {0x3e, 0xe8}, - {0x3f, 0xf0}, - {0x40, 0xf7}, - {0x41, 0xfe}, - {0x42, 0xff}, - - {0x50, 0x00}, - {0x51, 0x05}, - {0x52, 0x1b}, - {0x53, 0x36}, - {0x54, 0x5a}, - {0x55, 0x77}, - {0x56, 0x8f}, - {0x57, 0xa3}, - {0x58, 0xb4}, - {0x59, 0xc0}, - {0x5a, 0xcb}, - {0x5b, 0xd4}, - {0x5c, 0xde}, - {0x5d, 0xe5}, - {0x5e, 0xed}, - {0x5f, 0xf2}, - {0x60, 0xf7}, - {0x61, 0xf9}, - {0x62, 0xfa}, - - {0x70, 0x00}, - {0x71, 0x0a}, - {0x72, 0x19}, - {0x73, 0x31}, - {0x74, 0x55}, - {0x75, 0x6e}, - {0x76, 0x83}, - {0x77, 0x96}, - {0x78, 0xa6}, - {0x79, 0xb5}, - {0x7a, 0xc2}, - {0x7b, 0xcd}, - {0x7c, 0xd7}, - {0x7d, 0xe0}, - {0x7e, 0xe8}, - {0x7f, 0xf0}, - {0x80, 0xf6}, - {0x81, 0xfc}, - {0x82, 0xff}, - - - {0x03, 0x17}, - {0xc4, 0x6e}, - {0xc5, 0x5c}, - - {0x03, 0x20}, - {0x10, 0x1c}, - {0x18, 0x38}, - {0x20, 0x01}, - {0x21, 0x30}, - {0x22, 0x10}, - {0x23, 0x00}, - {0x24, 0x04}, - - {0x28, 0xff}, - {0x29, 0xad}, - - {0x2a, 0xf0}, - {0x2b, 0x34}, - {0x30, 0x78}, - {0x2c, 0xc3}, - {0x2d, 0x5f}, - {0x2e, 0x33}, - //{0x30, 0xf8}, - {0x32, 0x03}, - {0x33, 0x2e}, - {0x34, 0x30}, - {0x35, 0xd4}, - {0x36, 0xfe}, - {0x37, 0x32}, - {0x38, 0x04}, - {0x47, 0xf0}, - - //Y_Frame TH - {0x50, 0x45}, - {0x51, 0x88}, - - {0x56, 0x10}, - {0x57, 0xb7}, - {0x58, 0x14}, - {0x59, 0x88}, - {0x5a, 0x04}, - - {0x60, 0x55}, - {0x61, 0x55}, - {0x62, 0x6a}, - {0x63, 0xa9}, - {0x64, 0x6a}, - {0x65, 0xa9}, - {0x66, 0x6a}, - {0x67, 0xa9}, - {0x68, 0x6b}, - {0x69, 0xe9}, - {0x6a, 0x6a}, - {0x6b, 0xa9}, - {0x6c, 0x6a}, - {0x6d, 0xa9}, - {0x6e, 0x55}, - {0x6f, 0x55}, - {0x70, 0x42}, - {0x71, 0xBb}, - - // haunting control - {0x76, 0x21}, - {0x77, 0x02}, - {0x78, 0x22}, - {0x79, 0x2a}, - - {0x78, 0x24}, - {0x79, 0x23}, - {0x7a, 0x23}, - {0x7b, 0x22}, - {0x7d, 0x23}, - {0x83, 0x01}, - {0x84, 0x5f}, - {0x85, 0x6c}, - {0x86, 0x02}, - {0x87, 0x00}, - {0x88, 0x05}, - {0x89, 0x7c}, - {0x8a, 0x00}, - {0x8B, 0x75}, - {0x8C, 0x00}, - {0x8D, 0x61}, - {0x8E, 0x00}, - - {0x98, 0xdc}, - {0x99, 0x45}, - {0x9a, 0x0d}, - {0x9b, 0xde}, - {0x9c, 0x08}, - {0x9d, 0x0a}, - {0x9e, 0x01}, - {0x10, 0x9c}, - {0x18, 0x30}, - {0x90, 0x0c}, - {0x91, 0x0c}, - {0x92, 0xd8}, - {0x93, 0xd0}, - - {0x9f, 0x26}, - {0xa0, 0x03}, - {0xa1, 0xa9}, - {0xa2, 0x80}, - {0xb0, 0x1d}, - {0xb1, 0x1a}, - {0xb2, 0x60}, - {0xb3, 0x1a}, - {0xb4, 0x1a}, - {0xb5, 0x44}, - {0xb6, 0x2f}, - {0xb7, 0x28}, - {0xb8, 0x25}, - {0xb9, 0x22}, - {0xba, 0x21}, - {0xbb, 0x20}, - {0xbc, 0x1f}, - {0xbd, 0x1f}, - {0xc0, 0x30}, - {0xc1, 0x20}, - {0xc2, 0x20}, - {0xc3, 0x20}, - {0xc4, 0x08}, - {0xc8, 0x60}, - {0xc9, 0x40}, - - //Page 22 - {0x03, 0x22}, - {0x10, 0x69},//lxh - {0x11, 0x2c}, - {0x19, 0x01}, - {0x20, 0x30}, - {0x21, 0x80}, - {0x23, 0x08}, - {0x24, 0x01}, - - {0x30, 0x80}, - {0x31, 0x80}, - {0x38, 0x11}, - {0x39, 0x34}, - {0x40, 0xf7}, - - {0x41, 0x77}, - {0x42, 0x55}, - {0x43, 0xf0}, - {0x44, 0x43}, - {0x45, 0x33}, - {0x46, 0x00}, - - {0x47, 0x94}, - - {0x50, 0xb2}, - {0x51, 0x81}, - {0x52, 0x98}, - - {0x80, 0x3d},//lxh - {0x81, 0x20}, - {0x82, 0x32},//lxh - - {0x83, 0x50}, - {0x84, 0x20}, - {0x85, 0x50}, - {0x86, 0x20}, - - {0x87, 0x54}, - {0x88, 0x20}, - {0x89, 0x45}, - {0x8a, 0x2a}, - - {0x8b, 0x46}, - {0x8c, 0x3f}, - {0x8d, 0x34}, - {0x8e, 0x2c}, - - {0x8f, 0x60}, - {0x90, 0x5f}, - {0x91, 0x5c}, - {0x92, 0x4C}, - {0x93, 0x41}, - {0x94, 0x3b}, - {0x95, 0x36}, - {0x96, 0x30}, - {0x97, 0x27}, - {0x98, 0x20}, - {0x99, 0x1C}, - {0x9a, 0x19}, - - {0x9b, 0x88}, - {0x9c, 0x88}, - {0x9d, 0x48}, - {0x9e, 0x38}, - {0x9f, 0x30}, - - {0xa0, 0x74}, - {0xa1, 0x35}, - {0xa2, 0xaf}, - {0xa3, 0xf7}, - - {0xa4, 0x10}, - {0xa5, 0x50}, - {0xa6, 0xc4}, - - {0xad, 0x40}, - {0xae, 0x4a}, - - {0xaf, 0x2a}, - {0xb0, 0x29}, - - {0xb1, 0x20}, - {0xb4, 0xff}, - {0xb8, 0x6b}, - {0xb9, 0x00}, - - {0x03, 0x24}, - {0x10, 0x01}, - {0x18, 0x06}, - {0x30, 0x06}, - {0x31, 0x90}, - {0x32, 0x25}, - {0x33, 0xa2}, - {0x34, 0x26}, - {0x35, 0x58}, - {0x36, 0x60}, - {0x37, 0x00}, - {0x38, 0x50}, - {0x39, 0x00}, - - {0x03, 0x20}, - {0x10, 0x9c}, - {0x03, 0x22}, - {0x10, 0xe9}, - - //Page 00 - {0x03, 0x00}, - {0x0e, 0x03}, - {0x0e, 0x73}, - - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - {0x03, 0x00}, - - {0x03, 0x00}, - {0x01, 0xf8}, - - {END_REG, END_REG}, - -}; - - -/* 1600X1200 UXGA capture */ -static struct reginfo sensor_uxga[] = -{ - {0x03, 0x00}, - //{0x11, 0xa0}, - - {0x20, 0x00}, - {0x21, 0x0a}, - {0x22, 0x00}, - {0x23, 0x0a}, - - {0x03, 0x10}, - {0x3f, 0x00}, - - //Page12 - {0x03, 0x12}, - {0x20, 0x0f}, - {0x21, 0x0f}, - {0x90, 0x5d}, - - //Page13 - {0x03, 0x13}, - {0x80, 0xfd}, - - // 1600*1200 - {0x03,0x00}, - {0x10,0x00}, - - {END_REG, END_REG}, -}; - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {END_REG, END_REG}, -}; -static struct reginfo sensor_xga[] = -{ - //{0x01, 0xf8}, - {END_REG, END_REG}, -}; -/* 800X600 SVGA,30fps*/ -static struct reginfo sensor_svga[] = -{ -#if 1 - {0x03, 0x10}, - {0x3f, 0x00}, - - - //Page12 - {0x03, 0x12}, //Function - {0x20, 0x0f}, - {0x21, 0x0f}, - {0x90, 0x5d}, - - //Page13 - {0x03, 0x13}, //Function - {0x80, 0xfd}, //Function - - // 800*600 - {0x03,0x00}, - {0x10,0x91},//11 - {0x20, 0x00}, - {0x21, 0x04}, - {0x22, 0x00}, - {0x23, 0x07}, - {0x24, 0x04}, - {0x25, 0xb0}, - {0x26, 0x06}, - {0x27, 0x40}, - - {0x03, 0x20}, - {0x8b, 0x1d}, - {0x8c, 0x4c}, - {0x8d, 0x18}, - {0x8e, 0x6a}, - - {0x03, 0x20}, - {0x03, 0x20}, -#endif - {END_REG, END_REG}, -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - {END_REG, END_REG}, -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {END_REG, END_REG}, -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - {END_REG, END_REG}, -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {END_REG, END_REG}, -}; - -#endif -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - - //{0x00, 0x00} - {END_REG, END_REG}, -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - - //{0x00, 0x00} - {END_REG, END_REG}, -}; - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0x03, 0x22}, - {0x10, 0x69}, - {0x80, 0x3d}, - {0x81, 0x20}, - {0x82, 0x32}, - {0x83, 0x50}, - {0x84, 0x20}, - {0x85, 0x50}, - {0x86, 0x20}, - {0x10, 0xe9}, - {END_REG, END_REG}, -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0x03, 0x22}, - {0x10, 0x69}, - {0x80, 0x49}, - {0x81, 0x20}, - {0x82, 0x24}, - {0x83, 0x50}, - {0x84, 0x45}, - {0x85, 0x24}, - {0x86, 0x1e}, - {0x10, 0xe9}, - {END_REG, END_REG}, -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x03, 0x22}, - {0x10, 0x69}, - {0x80, 0x45}, - {0x81, 0x20}, - {0x82, 0x27}, - {0x83, 0x44}, - {0x84, 0x3f}, - {0x85, 0x29}, - {0x86, 0x23}, - {END_REG, END_REG}, -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - //incandescense - {0x03, 0x22}, - {0x10, 0x69}, - {0x80, 0x33}, - {0x81, 0x20}, - {0x82, 0x3d}, - {0x83, 0x2e}, - {0x84, 0x24}, - {0x85, 0x43}, - {0x86, 0x3d}, - {END_REG, END_REG}, - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x03, 0x22}, - {0x10, 0x69}, - {0x80, 0x45}, - {0x81, 0x20}, - {0x82, 0x2f}, - {0x83, 0x38}, - {0x84, 0x32}, - {0x85, 0x39}, - {0x86, 0x33}, - {END_REG, END_REG}, -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - // Brightness -2 - {0x03, 0x10}, - {0x40, 0xa0}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Brightness1[]= -{ - // Brightness -1 - {0x03, 0x10}, - {0x40, 0x90}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Brightness2[]= -{ - // Brightness 0 - {0x03, 0x10}, - {0x40, 0x00}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Brightness3[]= -{ - // Brightness +1 - {0x03, 0x10}, - {0x40, 0x10}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Brightness4[]= -{ - // Brightness +2 - {0x03, 0x10}, - {0x40, 0x20}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Brightness5[]= -{ - // Brightness +3 - {0x03, 0x10}, - {0x40, 0x30}, - {END_REG, END_REG}, -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x03, 0x10}, - {0x11, 0x03}, - {0x12, 0x00}, - {0x13, 0x00}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {0x03, 0x10}, - {0x11, 0x03}, - {0x12, 0x03}, - {0x13, 0x02}, - {0x44, 0x80}, - {0x45, 0x80}, - {0x47, 0x7f}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x03, 0x10}, - {0x11, 0x03}, - {0x12, 0x23}, - {0x13, 0x00}, - {0x44, 0x70}, - {0x45, 0x98}, - {0x47, 0x7f}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - //Negative - {0x03, 0x10}, - {0x11, 0x03}, - {0x12, 0x08}, - {0x13, 0x02}, - {0x14, 0x00}, - {0x44, 0x80}, - {0x45, 0x80}, - {0x47, 0x7f}, - {END_REG, END_REG}, -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - // Bluish - {0x03, 0x10}, - {0x11, 0x03}, - {0x12, 0x03}, - {0x13, 0x02}, - {0x44, 0xb0}, - {0x45, 0x40}, - {0x47, 0x7f}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish - {0x03, 0x10}, - {0x11, 0x03}, - {0x12, 0x03}, - {0x13, 0x02}, - {0x44, 0x30}, - {0x45, 0x50}, - {0x47, 0x7f}, - {END_REG, END_REG}, -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - //-3 - -}; - -static struct reginfo sensor_Exposure1[]= -{ - //-2 - - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Exposure2[]= -{ - //-0.3EV - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Exposure3[]= -{ - //default - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Exposure4[]= -{ - // 1 - - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Exposure5[]= -{ - // 2 - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Exposure6[]= -{ - // 3 - - {END_REG, END_REG}, -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Saturation1[]= -{ - - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Saturation2[]= -{ - {END_REG, END_REG}, -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - //Contrast -3 - - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Contrast1[]= -{ - //Contrast -2 - - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Contrast2[]= -{ - // Contrast -1 - - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Contrast3[]= -{ - //Contrast 0 - - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Contrast4[]= -{ - //Contrast +1 - - {END_REG, END_REG}, -}; - - -static struct reginfo sensor_Contrast5[]= -{ - //Contrast +2 - - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Contrast6[]= -{ - //Contrast +3 - - {END_REG, END_REG}, -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - - {END_REG, END_REG}, -}; - -static struct reginfo sensor_MirrorOff[]= -{ - - {END_REG, END_REG}, -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - - {END_REG, END_REG}, -}; - -static struct reginfo sensor_FlipOff[]= -{ - - {END_REG, END_REG}, -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ - - {END_REG, END_REG}, -}; - -static struct reginfo sensor_SceneNight[] = -{ - - {END_REG, END_REG}, -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Zoom1[] = -{ - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Zoom2[] = -{ - {END_REG, END_REG}, -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {END_REG, END_REG}, -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif -static struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - unsigned int winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int funmodule_state; - -} sensor_info_priv_t; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif -} - -static int sensor_write(struct i2c_client *client, u8 reg, u8 val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[1]; - - buf[0] = reg; - buf[1] = val; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) -{ - int err,cnt; - u8 buf[1]; - struct i2c_msg msg[2]; - - buf[0] = reg ; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - while (regarray[i].reg != END_REG) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - //mdelay(5); - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - i++; - } - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != 0) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_power_end: - return ret; -} -#if CONFIG_SENSOR_Flash -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} -#endif -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - char value; - int ret; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; -#if 1 - ret = sensor_write(client, 0x01, 0xF9); - if (ret != 0) - { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); //delay 5 microseconds - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x04, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), value); - if (value == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), value); - ret = -ENODEV; - goto sensor_INIT_ERR; - } -#endif - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - sensor->info_priv.winseqe_cur_addr = (int)SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} - -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - sensor_ioctrl(icd, Sensor_PowerDown, 1); - - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - msleep(100); - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - return 0; -} - -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - - return 0; - -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - const struct v4l2_queryctrl *qctrl; - struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - int ret=0, set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg != END_REG)) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg != END_REG)) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg != END_REG)) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg != END_REG)) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && (sensor_svga[0].reg != END_REG)) - { - winseqe_set_addr = sensor_svga; - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1024) && (set_h <= 768)) && (sensor_xga[0].reg != END_REG)) - { - winseqe_set_addr = sensor_xga; - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg != END_REG)) - { - winseqe_set_addr = sensor_sxga; - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg != END_REG)) - { - winseqe_set_addr = sensor_uxga; - set_w = 1600; - set_h = 1200; - } -#if defined(CONFIG_SOC_CAMERA_HI253_INTERPOLATION) - else if (((set_w <= SENSOR_MAX_WIDTH) && (set_h <= SENSOR_MAX_HEIGHT)) ) - { - winseqe_set_addr = sensor_uxga; - set_w = SENSOR_MAX_WIDTH_REAL; - set_h = SENSOR_MAX_HEIGHT_REAL; - } -#endif - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) { - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - } else { /* ddl@rock-chips.com : Video */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - } - #endif - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,f) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - - sensor->info_priv.winseqe_cur_addr = (int)winseqe_set_addr; - - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - #if CONFIG_SENSOR_Effect - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - #endif - #if CONFIG_SENSOR_WhiteBalance - if (sensor->info_priv.whiteBalance != 0) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - #endif - sensor->info_priv.snap2preview = true; - } else if (sensor_fmt_videochk(sd,mf) == true) { /* ddl@rock-chips.com : Video */ - #if CONFIG_SENSOR_Effect - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - #endif - #if CONFIG_SENSOR_WhiteBalance - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - #endif - sensor->info_priv.video2preview = true; - } else if ((sensor->info_priv.snap2preview == true) || (sensor->info_priv.video2preview == true)) { - #if CONFIG_SENSOR_Effect - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - #endif - #if CONFIG_SENSOR_WhiteBalance - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - #endif - sensor->info_priv.video2preview = false; - sensor->info_priv.snap2preview = false; - } - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; - -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h;; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - /* ddl@rock-chips.com : It is query max resolution only. */ - if (mf->reserved[6] == 0xfefe5a5a) { - mf->height = SENSOR_MAX_HEIGHT; - mf->width = SENSOR_MAX_WIDTH; - ret = 0; - goto sensor_try_fmt_end; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - set_w = 1280; - set_h = 1024; - } -#if defined(CONFIG_SOC_CAMERA_HI253_INTERPOLATION) - else if (((set_w <= SENSOR_MAX_WIDTH) && (set_h <= SENSOR_MAX_HEIGHT)) ) - { - set_w = SENSOR_MAX_WIDTH_REAL; - set_h = SENSOR_MAX_HEIGHT_REAL; - } -#endif - - else - { - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - - mf->width = set_w; - mf->height = set_h; - - mf->colorspace = fmt->colorspace; -sensor_try_fmt_end: - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV2655 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value > 0) && ((digitalzoom_cur + value) > digitalzoom_total)) - { - *value = digitalzoom_total - digitalzoom_cur; - } - - if ((value < 0) && ((digitalzoom_cur + value) < 0)) - { - value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char value; - int ret; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - - /* soft reset */ - ret = sensor_write(client, 0x01, 0xf9); - if (ret != 0) - { - SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); - return -ENODEV; - } - mdelay(5); //delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x04, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), value); - if (value == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), value); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - - return ret; -} -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0; -#if CONFIG_SENSOR_Flash - int i; -#endif - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - if (sensor->sensor_io_request->gpio_res[0].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[0].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[0]; - } else if (sensor->sensor_io_request->gpio_res[1].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[1].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[1]; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - sensor->info_priv.fmt = sensor_colour_fmts[0]; - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("lxh@wisky.com.cn"); -MODULE_LICENSE("GPL"); - - - diff --git a/drivers/media/video/hi704.c b/drivers/media/video/hi704.c deleted file mode 100755 index d12c5eeec1b5..000000000000 --- a/drivers/media/video/hi704.c +++ /dev/null @@ -1,3034 +0,0 @@ -/* -o* Driver for MT9M001 CMOS Image Sensor from Micron - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_HI704 -#define SENSOR_V4L2_IDENT V4L2_IDENT_HI704 -#define SENSOR_ID 0x96 -#define SENSOR_MIN_WIDTH 176 -#define SENSOR_MIN_HEIGHT 144 -#define SENSOR_MAX_WIDTH 640 -#define SENSOR_MAX_HEIGHT 480 -#define SENSOR_INIT_WIDTH 640 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 480 -#define SENSOR_INIT_WINSEQADR sensor_vga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_UYVY8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 1 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 0 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 - -#define CONFIG_SENSOR_I2C_SPEED 100000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING|\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) -//lxh end of reg flag -#define END_REG 0xff - -struct reginfo -{ - u8 reg; - u8 val; -}; - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -#if CONFIG_SENSOR_Flash -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); -#endif -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_HI704_USER_DEFINED_SERIES -#include "hi704_user_series.c" -#else -/* init SVGA preview */ -static struct reginfo sensor_init_data[] = -{ - //PAGE 0 - //Image Size/Windowing/HSYNC/VSYNC[Type1] -{0x03, 0x00}, //PAGEMODE(0x03) -{0x01, 0xf1}, -{0x01, 0xf3}, //PWRCTL(0x01[P0])Bit[1]:Software Reset. -{0x01, 0xf1}, -{0x10, 0x00},//vga mode -{0x11, 0x90}, //For No Fixed Framerate Bit[2] -{0x12, 0x04}, - -{0x20, 0x00}, -{0x21, 0x04}, -{0x22, 0x00}, -{0x23, 0x04}, - -{0x24, 0x01}, -{0x25, 0xe0}, -{0x26, 0x02}, -{0x27, 0x80}, - -{0x40, 0x00}, //HBLANK: 0x70 = 112 -{0x41, 0x70}, -{0x42, 0x00}, //VBLANK: 0x40 = 64 -{0x43, 0x40}, //0x04 -> 0x40: For Max Framerate = 30fps - -//BLC -{0x80, 0x2e}, -{0x81, 0x7e}, -{0x82, 0x90}, -{0x83, 0x30}, -{0x84, 0x2c}, -{0x85, 0x4b}, -{0x89, 0x48}, - -{0x90, 0x0c}, -{0x91, 0x0c}, -{0x92, 0x78}, -{0x93, 0x70}, -{0x98, 0x38}, -{0x99, 0x40}, -{0xa0, 0x40}, -{0xa8, 0x40}, - -//PAGE 2 -//Analog Circuit -{0x03, 0x02}, -{0x13, 0x40}, -{0x14, 0x04}, -{0x1a, 0x00}, -{0x1b, 0x08}, - -{0x20, 0x33}, -{0x21, 0xaa}, -{0x22, 0xa7}, -{0x23, 0xb1}, //For Sun Pot - -{0x3b, 0x48}, - -{0x50, 0x21}, -{0x52, 0xa2}, -{0x53, 0x0a}, -{0x54, 0x30}, -{0x55, 0x10}, -{0x56, 0x0c}, -{0x59, 0x0F}, - -{0x60, 0x54}, -{0x61, 0x5d}, -{0x62, 0x56}, -{0x63, 0x5c}, -{0x64, 0x56}, -{0x65, 0x5c}, -{0x72, 0x57}, -{0x73, 0x5b}, -{0x74, 0x57}, -{0x75, 0x5b}, -{0x80, 0x02}, -{0x81, 0x46}, -{0x82, 0x07}, -{0x83, 0x10}, -{0x84, 0x07}, -{0x85, 0x10}, -{0x92, 0x24}, -{0x93, 0x30}, -{0x94, 0x24}, -{0x95, 0x30}, -{0xa0, 0x03}, -{0xa1, 0x45}, -{0xa4, 0x45}, -{0xa5, 0x03}, -{0xa8, 0x12}, -{0xa9, 0x20}, -{0xaa, 0x34}, -{0xab, 0x40}, -{0xb8, 0x55}, -{0xb9, 0x59}, -{0xbc, 0x05}, -{0xbd, 0x09}, -{0xc0, 0x5f}, -{0xc1, 0x67}, -{0xc2, 0x5f}, -{0xc3, 0x67}, -{0xc4, 0x60}, -{0xc5, 0x66}, -{0xc6, 0x60}, -{0xc7, 0x66}, -{0xc8, 0x61}, -{0xc9, 0x65}, -{0xca, 0x61}, -{0xcb, 0x65}, -{0xcc, 0x62}, -{0xcd, 0x64}, -{0xce, 0x62}, -{0xcf, 0x64}, -{0xd0, 0x53}, -{0xd1, 0x68}, - - //PAGE 10 - //Image Format, Image Effect -{0x03, 0x10}, -{0x10, 0x01},//lxh -{0x11, 0x43}, -{0x12, 0x30}, - -{0x40, 0x00},//brightness +1 -{0x41, 0x02}, -{0x48, 0x98},//contrast level +1 - -{0x50, 0x48}, - -{0x60, 0x7f}, -{0x61, 0x00}, //Use default -{0x62, 0xa0}, //SATB (1.4x) -{0x63, 0xa0}, //SATR (1.2x) -{0x64, 0x48}, //AGSAT -{0x66, 0x90}, //wht_th2 -{0x67, 0x36}, //wht_gain Dark (0.4x), Normal (0.75x) - -//LPF -{0x03, 0x11}, -{0x10, 0x25}, -{0x11, 0x1f}, - -{0x20, 0x00}, -{0x21, 0x38}, -{0x23, 0x0a}, - -{0x60, 0x10}, -{0x61, 0x82}, -{0x62, 0x00}, -{0x63, 0x83}, -{0x64, 0x83}, -{0x67, 0xF0}, -{0x68, 0x20},//30 -{0x69, 0x10}, - - //PAGE 12 - //2D -{0x03, 0x12}, - -{0x40, 0xe9}, -{0x41, 0x09}, - -{0x50, 0x18}, -{0x51, 0x24}, - -{0x70, 0x1f}, -{0x71, 0x00}, -{0x72, 0x00}, -{0x73, 0x00}, -{0x74, 0x10}, -{0x75, 0x10}, -{0x76, 0x20}, -{0x77, 0x80}, -{0x78, 0x88}, -{0x79, 0x18}, - -{0xb0, 0x7d}, - -//Edge -{0x03, 0x13}, -{0x10, 0x01}, -{0x11, 0x89}, -{0x12, 0x14}, -{0x13, 0x19}, -{0x14, 0x08}, //Test Setting -{0x20, 0x06}, //SHARP_Negative -{0x21, 0x03}, //SHARP_Positive -{0x23, 0x30}, //SHARP_DY_CTL -{0x24, 0x33}, //40->33 -{0x25, 0x08}, //SHARP_PGA_TH -{0x26, 0x18}, //Test Setting -{0x27, 0x00}, //Test Setting -{0x28, 0x08}, //Test Setting -{0x29, 0x50}, //AG_TH -{0x2a, 0xe0}, //region ratio -{0x2b, 0x10}, //Test Setting -{0x2c, 0x28}, //Test Setting -{0x2d, 0x40}, //Test Setting -{0x2e, 0x00}, //Test Setting -{0x2f, 0x00}, //Test Setting -{0x30, 0x11}, //Test Setting -{0x80, 0x03}, //SHARP2D_CTL -{0x81, 0x07}, //Test Setting -{0x90, 0x04}, //SHARP2D_SLOPE -{0x91, 0x02}, //SHARP2D_DIFF_CTL -{0x92, 0x00}, //SHARP2D_HI_CLIP -{0x93, 0x20}, //SHARP2D_DY_CTL -{0x94, 0x42}, //Test Setting -{0x95, 0x60}, //Test Setting - -//Shading -{0x03, 0x14}, -{0x10, 0x01}, -{0x20, 0x60}, //XCEN -{0x21, 0x60}, //YCEN 80 -{0x22, 0x66}, //76, 34, 2b -{0x23, 0x50}, //4b, 15, 0d -{0x24, 0x44}, //3b, 10, 0b - -//Page 15 CMC -{0x03, 0x15}, -{0x10, 0x03}, - -{0x14, 0x3c}, -{0x16, 0x2c}, -{0x17, 0x2f}, - -{0x30, 0xcb}, -{0x31, 0x61}, -{0x32, 0x16}, -{0x33, 0x23}, -{0x34, 0xce}, -{0x35, 0x2b}, -{0x36, 0x01}, -{0x37, 0x34}, -{0x38, 0x75}, - -{0x40, 0x87}, -{0x41, 0x18}, -{0x42, 0x91}, -{0x43, 0x94}, -{0x44, 0x9f}, -{0x45, 0x33}, -{0x46, 0x00}, -{0x47, 0x94}, -{0x48, 0x14}, - -//Gamma -//normal -{0x03,0x16}, -{0x30,0x00}, -{0x31,0x0a}, -{0x32,0x1b}, -{0x33,0x2e}, -{0x34,0x5c}, -{0x35,0x79}, -{0x36,0x95}, -{0x37,0xa4}, -{0x38,0xb1}, -{0x39,0xbd}, -{0x3a,0xc8}, -{0x3b,0xd9}, -{0x3c,0xe5}, -{0x3d,0xf5}, -{0x3e,0xff}, - //0930 -//{0x03,0x16}, -//{0x30,0x00}, -//{0x31,0x08}, -//{0x32,0x0e}, -//{0x33,0x1b}, -//{0x34,0x33}, -//{0x35,0x4d}, -//{0x36,0x66}, -//{0x37,0x7e}, -//{0x38,0x95}, -//{0x39,0xa9}, -//{0x3a,0xbb}, -//{0x3b,0xd7}, -//{0x3c,0xeb}, -//{0x3d,0xf7}, -//{0x3e,0xff}, - -//night mode -//{0x03,0x16}, -//{0x30,0x00}, -//{0x31,0x1c}, -//{0x32,0x2d}, -//{0x33,0x4e}, -//{0x34,0x6d}, -//{0x35,0x8b}, -//{0x36,0xa2}, -//{0x37,0xb5}, -//{0x38,0xc4}, -//{0x39,0xd0}, -//{0x3a,0xda}, -//{0x3b,0xea}, -//{0x3c,0xf4}, -//{0x3d,0xfb}, -//{0x3e,0xff}, - -//Page 17 AE -{0x03, 0x17}, -{0xc4, 0x3c}, -{0xc5, 0x32}, - -//Page 20 AE -{0x03, 0x20}, -{0x10, 0x0c}, -{0x11, 0x04}, - -{0x20, 0x01}, -{0x28, 0x27}, -{0x29, 0xa1}, - -{0x2a, 0xf0}, -{0x2b, 0x34}, -{0x2c, 0x2b}, //23->2b 2010_04_06 hhzin - -{0x30, 0xf8}, - -{0x39, 0x22}, -{0x3a, 0xde}, -{0x3b, 0x22}, //23->22 _10_04_06 hhzin -{0x3c, 0xde}, - -{0x60, 0x95}, //d5, 99 -{0x68, 0x3c}, -{0x69, 0x64}, -{0x6A, 0x28}, -{0x6B, 0xc8}, - -{0x70, 0x38},//Y Target 42 - -{0x76, 0x22}, //Unlock bnd1 -{0x77, 0x02}, //Unlock bnd2 02->a2 _10_04_06 hhzin - -{0x78, 0x12}, //Yth 1 -{0x79, 0x27}, //Yth 2 26->27 _10_04_06 hhzin -{0x7a, 0x23}, //Yth 3 - -{0x7c, 0x1d}, //1c->1d _10_04_06 hhzin -{0x7d, 0x22}, - -//50Hz -{0x83, 0x00},//ExpTime 30fps -{0x84, 0xaf}, -{0x85, 0xc8}, - -//60Hz -//{0x83, 0x00},//ExpTime 30fps -//{0x84, 0xc3}, -//{0x85, 0x50}, - -{0x86, 0x00},//ExpMin -{0x87, 0xfa}, - -//50Hz_8fps -{0x88, 0x02},//ExpMax 8fps(8fps) -{0x89, 0xbf}, -{0x8a, 0x20}, - -//50Hz_5fps -//{0x88, 0x04},//ExpMax 8fps(8fps) -//{0x89, 0x93}, -//{0x8a, 0xe0}, - -//60Hz_8fps -//{0x88, 0x02},//ExpMax 8fps(8fps) -//{0x89, 0xdc}, -//{0x8a, 0x6c}, - -{0x8b, 0x3a},//Exp100 -{0x8c, 0x98}, - -{0x8d, 0x30},//Exp120 -{0x8e, 0xd4}, - -{0x91, 0x02}, -{0x92, 0xdc}, -{0x93, 0x6c}, - -{0x94, 0x01}, //fix_step -{0x95, 0xb7}, -{0x96, 0x74}, - -{0x98, 0x8C}, -{0x99, 0x23}, - -{0x9c, 0x0b}, //4shared limit_10_04_06 hhzin -{0x9d, 0xb8}, // 0x06d3 --> 0x0b3b -{0x9e, 0x00}, //4shared Unit_10_04_06 hhzin -{0x9f, 0xfa}, // 0x01f4 --> 0xfa - -{0xb1, 0x14}, -{0xb2, 0x30}, -{0xb4, 0x14}, -{0xb5, 0x38}, -{0xb6, 0x26}, -{0xb7, 0x20}, -{0xb8, 0x1d}, -{0xb9, 0x1b}, -{0xba, 0x1a}, -{0xbb, 0x19}, -{0xbc, 0x19}, -{0xbd, 0x18}, - -{0xc0, 0x1a}, -{0xc3, 0x48}, -{0xc4, 0x48}, - - -//Page 22 AWB -{0x03, 0x22}, -{0x10, 0xe2}, -{0x11, 0x26}, -{0x21, 0x40}, - -{0x30, 0x80}, -{0x31, 0x80}, -{0x38, 0x12}, -{0x39, 0x33}, -{0x40, 0xf0}, -{0x41, 0x33}, -{0x42, 0x33}, -{0x43, 0xf3}, -{0x44, 0x55}, -{0x45, 0x44}, -{0x46, 0x02}, - -{0x80, 0x45}, -{0x81, 0x20}, -{0x82, 0x48}, -{0x83, 0x52}, //RMAX Default : 50 -> 48 -> 52 -{0x84, 0x1b}, //RMIN Default : 20 -{0x85, 0x50}, //BMAX Default : 50, 5a -> 58 -> 55 -{0x86, 0x25}, //BMIN Default : 20 -{0x87, 0x4d}, //RMAXB Default : 50, 4d -{0x88, 0x38}, //RMINB Default : 3e, 45 --> 42 -{0x89, 0x3e}, //BMAXB Default : 2e, 2d --> 30 -{0x8a, 0x29}, //BMINB Default : 20, 22 --> 26 --> 29 -{0x8b, 0x02}, //OUT TH -{0x8d, 0x22}, -{0x8e, 0x71}, - -{0x8f, 0x63}, -{0x90, 0x60}, -{0x91, 0x5c}, -{0x92, 0x56}, -{0x93, 0x52}, -{0x94, 0x4c}, -{0x95, 0x36}, -{0x96, 0x31}, -{0x97, 0x2e}, -{0x98, 0x2a}, -{0x99, 0x29}, -{0x9a, 0x26}, -{0x9b, 0x09}, - -{0x03, 0x22}, -{0x10, 0xfb}, - -//PAGE 20 -{0x03, 0x20}, -{0x10, 0x9c}, - -{0x01, 0xf0}, - -//PAGE 0 -{0x03, 0x00}, -{0x01, 0x90}, //0xf1 ->0x41 : For Preview Green/Red Line. -{0xff, 0xff} //End of Initial Setting -}; - - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ -{0x03, 0x00}, -{0x10, 0x00}, //VGA Size - -{0x20, 0x00}, -{0x21, 0x04}, - -{0x40, 0x01}, //HBLANK: 0x70 = 112 -{0x41, 0x58}, -{0x42, 0x00}, //VBLANK: 0x04 = 4 -{0x43, 0x64}, - -{0x03, 0x11}, -{0x10, 0x25}, - -{0x03, 0x20}, -{0x83, 0x00}, -{0x84, 0xaf}, -{0x85, 0xc8}, -{0x86, 0x00}, -{0x87, 0xf0}, - -{0x8b, 0x3a}, -{0x8c, 0x98}, -{0x8d, 0x30}, -{0x8e, 0xd4}, - -{0x9c, 0x0b}, -{0x9d, 0xb8}, -{0x9e, 0x00}, -{0x9f, 0xfa}, -{END_REG, END_REG}, -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {END_REG, END_REG}, -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ -{0x03, 0x00}, -{0x10, 0x01}, //QVGA Size: 0x10 -> 0x01 - -{0x20, 0x00}, -{0x21, 0x02}, - -{0x40, 0x01}, //HBLANK: 0x0158 = 344 -{0x41, 0x58}, -{0x42, 0x00}, //VBLANK: 0x14 = 20 -{0x43, 0x64}, - -{0x03, 0x11}, //QVGA Fixframerate -{0x10, 0x21}, - -{0x03, 0x20}, - -{0x83, 0x00}, -{0x84, 0xaf}, -{0x85, 0xc8}, -{0x86, 0x00}, -{0x87, 0xfa}, - -{0x8b, 0x3a}, -{0x8c, 0x98}, -{0x8d, 0x30}, -{0x8e, 0xd4}, - -{0x9c, 0x0b}, -{0x9d, 0xb8}, -{0x9e, 0x00}, -{0x9f, 0xfa}, -{END_REG, END_REG}, -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {END_REG, END_REG}, -}; - -#endif -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - - {END_REG, END_REG}, -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - - {END_REG, END_REG}, -}; - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0x03, 0x22}, - {0x10, 0x6a}, - {0x80, 0x48}, - {0x81, 0x20}, - {0x82, 0x40}, - {0x83, 0x58}, - {0x84, 0x10}, - {0x85, 0x70}, - {0x86, 0x10}, - {0x10, 0xea}, - {END_REG, END_REG}, -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0x03, 0x22}, - {0x10, 0x6a}, - {0x80, 0x62}, - {0x81, 0x20}, - {0x82, 0x2e}, - {0x83, 0x6d}, - {0x84, 0x65}, - {0x85, 0x30}, - {0x86, 0x25}, - {END_REG, END_REG}, -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x03, 0x22}, - {0x10, 0x6a}, - {0x80, 0x50}, - {0x81, 0x20}, - {0x82, 0x2d}, - {0x83, 0x52}, - {0x84, 0x40}, - {0x85, 0x30}, - {0x86, 0x1c}, - {END_REG, END_REG}, -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - //Office£¬Ó«¹âµÆ - {0x03, 0x22}, - {0x10, 0x6a}, - {0x80, 0x40}, - {0x81, 0x20}, - {0x82, 0x4f}, - {0x83, 0x44}, - {0x84, 0x3a}, - {0x85, 0x47}, - {0x86, 0x3a}, - {END_REG, END_REG}, - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - //Home,°×³ãµÆ - {0x03, 0x22}, - {0x10, 0x6a}, - {0x80, 0x26}, - {0x81, 0x20}, - {0x82, 0x55}, - {0x83, 0x24}, - {0x84, 0x1e}, - {0x85, 0x58}, - {0x86, 0x4a}, - {END_REG, END_REG}, -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - // Brightness -2 - {0x03, 0x10}, - {0x40, 0xa0}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Brightness1[]= -{ - // Brightness -1 - {0x03, 0x10}, - {0x40, 0x90}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Brightness2[]= -{ - // Brightness 0 - {0x03, 0x10}, - {0x40, 0x00}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Brightness3[]= -{ - // Brightness +1 - {0x03, 0x10}, - {0x40, 0x10}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Brightness4[]= -{ - // Brightness +2 - {0x03, 0x10}, - {0x40, 0x20}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Brightness5[]= -{ - // Brightness +3 - {0x03, 0x10}, - {0x40, 0x30}, - {END_REG, END_REG}, -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x03, 0x10}, - {0x11, 0x03}, - {0x12, 0x30}, - {0x13, 0x00}, - {0x44, 0x80}, - {0x45, 0x80}, - {0x47, 0x7f}, - {0x03, 0x13}, - {0x20, 0x06}, - {0x21, 0x04}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {0x03, 0x10}, - {0x11, 0x03}, - {0x12, 0x30}, - {0x13, 0x00}, - {0x44, 0x80}, - {0x45, 0x80}, - {0x47, 0x7f}, - {0x03, 0x13}, - {0x20, 0x06}, - {0x21, 0x04}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x03, 0x10}, - {0x11, 0x03}, - {0x12, 0x23}, - {0x13, 0x00}, - {0x44, 0x70}, - {0x45, 0x98}, - {0x47, 0x7f}, - {0x03, 0x13}, - {0x20, 0x07}, - {0x21, 0x03}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - //Negative - {0x03, 0x10}, - {0x11, 0x03}, - {0x12, 0x28}, - {0x13, 0x00}, - {0x44, 0x80}, - {0x45, 0x80}, - {0x47, 0x7f}, - {0x03, 0x13}, - {0x20, 0x07}, - {0x21, 0x03}, - {END_REG, END_REG}, -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - // Bluish - {0x03, 0x10}, - {0x11, 0x03}, - {0x12, 0x33}, - {0x13, 0x00}, - {0x44, 0xb0}, - {0x45, 0x40}, - {0x47, 0x7f}, - {0x03, 0x13}, - {0x20, 0x07}, - {0x21, 0x03}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish - {0x03, 0x10}, - {0x11, 0x03}, - {0x12, 0x33}, - {0x13, 0x00}, - {0x44, 0x60}, - {0x45, 0x60}, - {0x47, 0x7f}, - {0x03, 0x13}, - {0x20, 0x07}, - {0x21, 0x03}, - {END_REG, END_REG}, -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - //-3 - -}; - -static struct reginfo sensor_Exposure1[]= -{ - //-2 - - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Exposure2[]= -{ - //-0.3EV - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Exposure3[]= -{ - //default - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Exposure4[]= -{ - // 1 - - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Exposure5[]= -{ - // 2 - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Exposure6[]= -{ - // 3 - - {END_REG, END_REG}, -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - //-3 level - {0x03, 0x10}, - {0x62, 0x60}, - {0x63, 0x60}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Saturation1[]= -{ - //00 level - {0x03, 0x10}, - {0x62, 0x80}, - {0x63, 0x80}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Saturation2[]= -{ - //+3 level - {0x03, 0x10}, - {0x62, 0xc0}, - {0x63, 0xc0}, - {END_REG, END_REG}, -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - //Contrast -3 - {0x03, 0x10}, - {0x48, 0x54}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Contrast1[]= -{ - //Contrast -2 - {0x03, 0x10}, - {0x48, 0x64}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Contrast2[]= -{ - // Contrast -1 - {0x03, 0x10}, - {0x48, 0x74}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Contrast3[]= -{ - //Contrast 0 - {0x03, 0x10}, - {0x48, 0x80}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Contrast4[]= -{ - //Contrast +1 - {0x03, 0x10}, - {0x48, 0x94}, - {END_REG, END_REG}, -}; - - -static struct reginfo sensor_Contrast5[]= -{ - //Contrast +2 - {0x03, 0x10}, - {0x48, 0xa4}, - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Contrast6[]= -{ - //Contrast +3 - {0x03, 0x10}, - {0x48, 0xb4}, - {END_REG, END_REG}, -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - - {END_REG, END_REG}, -}; - -static struct reginfo sensor_MirrorOff[]= -{ - - {END_REG, END_REG}, -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - - {END_REG, END_REG}, -}; - -static struct reginfo sensor_FlipOff[]= -{ - - {END_REG, END_REG}, -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ - -}; - -static struct reginfo sensor_SceneNight[] = -{ - -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Zoom1[] = -{ - {END_REG, END_REG}, -}; - -static struct reginfo sensor_Zoom2[] = -{ - {END_REG, END_REG}, -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {END_REG, END_REG}, -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif -static struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - unsigned int winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int funmodule_state; - -} sensor_info_priv_t; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif -} - -#if 0 -/* sensor register */ -static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) -{ - int ret = 0; - - ret = i2c_master_reg8_recv(client, reg, val, 1, CONFIG_SENSOR_I2C_SPEED); - - return (ret > 0)? 0 : ret; -} - -static int sensor_write(struct i2c_client *client, u8 reg, u8 val) -{ - int ret = 0; - - ret = i2c_master_reg8_send(client, reg, &val, 1, CONFIG_SENSOR_I2C_SPEED); - - return (ret > 0)? 0 : ret; -} -#else -static int sensor_write(struct i2c_client *client, u8 reg, u8 val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[1]; - - buf[0] = reg; - buf[1] = val; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) -{ - int err,cnt; - u8 buf[1]; - struct i2c_msg msg[2]; - - buf[0] = reg ; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -#endif - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - while (regarray[i].reg != END_REG) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - //mdelay(5); - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - i++; - } - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != 0) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_power_end: - return ret; -} -#if CONFIG_SENSOR_Flash -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} -#endif -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - char value; - int ret; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; -#if 1 - ret = sensor_write(client, 0x01, 0xF3); - if (ret != 0) - { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); //delay 5 microseconds - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x04, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), value); - if (value == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), value); - ret = -ENODEV; - goto sensor_INIT_ERR; - } -#endif - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - sensor->info_priv.winseqe_cur_addr = (int)SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} - -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - sensor_ioctrl(icd, Sensor_PowerDown, 1); - - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - msleep(100); - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - return 0; -} - -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - - return 0; - -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - const struct v4l2_queryctrl *qctrl; - struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - int ret=0, set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg != END_REG)) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg != END_REG)) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg != END_REG)) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg != END_REG)) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) { - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - } else { /* ddl@rock-chips.com : Video */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - } - #endif - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - - sensor->info_priv.winseqe_cur_addr = (int)winseqe_set_addr; - - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - #if CONFIG_SENSOR_Effect - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - #endif - #if CONFIG_SENSOR_WhiteBalance - if (sensor->info_priv.whiteBalance != 0) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - #endif - sensor->info_priv.snap2preview = true; - } else if (sensor_fmt_videochk(sd,mf) == true) { /* ddl@rock-chips.com : Video */ - #if CONFIG_SENSOR_Effect - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - #endif - #if CONFIG_SENSOR_WhiteBalance - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - #endif - sensor->info_priv.video2preview = true; - } else if ((sensor->info_priv.snap2preview == true) || (sensor->info_priv.video2preview == true)) { - #if CONFIG_SENSOR_Effect - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - #endif - #if CONFIG_SENSOR_WhiteBalance - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - #endif - sensor->info_priv.video2preview = false; - sensor->info_priv.snap2preview = false; - } - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; - -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - mf->colorspace = fmt->colorspace; - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV2655 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value > 0) && ((digitalzoom_cur + value) > digitalzoom_total)) - { - value = digitalzoom_total - digitalzoom_cur; - } - - if ((value < 0) && ((digitalzoom_cur + value) < 0)) - { - value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char value; - int ret; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - - /* soft reset */ - ret = sensor_write(client, 0x01, 0xf3); - if (ret != 0) - { - SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); - return -ENODEV; - } - mdelay(5); //delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x04, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), value); - - if (value == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), value); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - - return ret; -} -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0; -#if CONFIG_SENSOR_Flash - int i; -#endif - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - if (sensor->sensor_io_request->gpio_res[0].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[0].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[0]; - } else if (sensor->sensor_io_request->gpio_res[1].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[1].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[1]; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - sensor->info_priv.fmt = sensor_colour_fmts[0]; - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("lxh@wisky.com.cn"); -MODULE_LICENSE("GPL"); - - - diff --git a/drivers/media/video/hm2057.c b/drivers/media/video/hm2057.c deleted file mode 100644 index 3ecd7c9109c0..000000000000 --- a/drivers/media/video/hm2057.c +++ /dev/null @@ -1,1261 +0,0 @@ -/* - * drivers/media/video/hm2057.c - * - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "generic_sensor.h" - -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.1.1: -* add sensor_focus_af_const_pause_usr_cb; -*/ -static int version = KERNEL_VERSION(0,1,1); -module_param(version, int, S_IRUGO); - - - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - - -#define dprintk(level, fmt, arg...) do { \ - if (debug > level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_HM2057 -#define SENSOR_V4L2_IDENT V4L2_IDENT_HM2057 -#define SENSOR_ID 0x2056 -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_PCLK_SAMPLE_RISING|V4L2_MBUS_HSYNC_ACTIVE_HIGH| V4L2_MBUS_VSYNC_ACTIVE_LOW|\ - V4L2_MBUS_DATA_ACTIVE_HIGH |SOCAM_MCLK_24MHZ) -#define SENSOR_PREVIEW_W 800 -#define SENSOR_PREVIEW_H 600 -#define SENSOR_PREVIEW_FPS 15000 // 15fps -#define SENSOR_FULLRES_L_FPS 7500 // 7.5fps -#define SENSOR_FULLRES_H_FPS 7500 // 7.5fps -#define SENSOR_720P_FPS 0 -#define SENSOR_1080P_FPS 0 - -#define SENSOR_REGISTER_LEN 2 // sensor register address bytes -#define SENSOR_VALUE_LEN 1 // sensor register value bytes - -static unsigned int SensorConfiguration = (CFG_WhiteBalance|CFG_Effect); -static unsigned int SensorChipID[] = {SENSOR_ID,0x2057}; - -/* Sensor Driver Configuration End */ - - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a,b) CONS4(SensorReg,SENSOR_REGISTER_LEN,Val,SENSOR_VALUE_LEN)(a,b) -#define sensor_write(client,reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_read(client,reg,v) CONS4(sensor_read_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_write_array generic_sensor_write_array - -#define SENSOR_PLL_ENABLE 1 -//ͬÑùµÄÖ¡ÂÊ bypass PLLµÄÆØ¹âʱ¼äÊÇEnalble PLLµÄ2±¶ -//Enable PLL: 0x0025=0x00 -//bypass PLL: 0x0025=0x80 - - -#define SENSOR_FAST_MODE 1 -//¿ìËÙģʽ£¬Ö¡ÂÊÔ½¿ì£¬Ôëµã»áÔ½´ó£¬ÇåÎú¶È»áÔ½²î -//ËٶȺÍÇåÎú¶ÈÁ½Õß²»ÄܼæµÃ - -struct specific_sensor{ - struct generic_sensor common_sensor; - //define user data below - - -}; - -/* -* Local define -*/ - - -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ - -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_init_data[] = { -{0x0022,0x00}, -{0x0004,0x10}, -{0x0006,0x00}, -{0x000D,0x11}, -{0x000E,0x11}, -{0x000F,0x10},//00 -{0x0011,0x02}, -{0x0012,0x1C}, -{0x0013,0x01}, -{0x0015,0x02}, -{0x0016,0x80}, -{0x0018,0x00}, -{0x001D,0x40}, -{0x0020,0x40}, - -#if SENSOR_PLL_ENABLE - {0x0025,0x00}, -#else - {0x0025,0x80}, -#endif - -{0x0026,0x87}, -{0x0027,0x10},//0x30}, -{0x0040,0x20}, -{0x0053,0x0A}, -{0x0044,0x06}, -{0x0046,0xD8}, -{0x004A,0x0A}, -{0x004B,0x72}, -{0x0075,0x01}, -{0x002A,0x1F}, -{0x0070,0x5F}, -{0x0071,0xFF}, -{0x0072,0x55}, -{0x0073,0x50}, -{0x0080,0xC8}, -{0x0082,0xA2}, -{0x0083,0xF0}, -{0x0085,0x11},//0x12 HMAX Ô­³§½¨Òé ADC POWER ÒÔǰÊÇ75%µÄÏÖÔÚÒªÉ趨³É100% -{0x0086,0x02}, -{0x0087,0x80}, -{0x0088,0x6C}, -{0x0089,0x2E}, -{0x008A,0x7D}, -{0x008D,0x20}, -{0x0090,0x00}, -{0x0091,0x10}, -{0x0092,0x11}, -{0x0093,0x12}, -{0x0094,0x16}, -{0x0095,0x08}, -{0x0096,0x00}, -{0x0097,0x10}, -{0x0098,0x11}, -{0x0099,0x12}, -{0x009A,0x06}, -{0x009B,0x34}, -{0x00A0,0x00}, -{0x00A1,0x04}, -{0x011F,0xF7}, -{0x0120,0x36}, -{0x0121,0x83}, -{0x0122,0x7B}, -{0x0123,0xC2}, -{0x0124,0xDE}, -{0x0125,0xDF}, -{0x0126,0x70}, -{0x0128,0x1F}, -{0x0132,0x10}, -{0x0131,0xBD}, -{0x0140,0x14}, -{0x0141,0x0A}, -{0x0142,0x14}, -{0x0143,0x0A}, -{0x0144,0x04}, -{0x0145,0x00}, -{0x0146,0x20}, -{0x0147,0x0A}, -{0x0148,0x10}, -{0x0149,0x0C}, -{0x014A,0x80}, -{0x014B,0x80}, -{0x014C,0x2E}, -{0x014D,0x2E}, -{0x014E,0x05}, -{0x014F,0x05}, -{0x0150,0x0D}, -{0x0155,0x00}, -{0x0156,0x10}, -{0x0157,0x0A}, -{0x0158,0x0A}, -{0x0159,0x0A}, -{0x015A,0x05}, -{0x015B,0x05}, -{0x015C,0x05}, -{0x015D,0x05}, -{0x015E,0x08}, -{0x015F,0xFF}, -{0x0160,0x50}, -{0x0161,0x20}, -{0x0162,0x14}, -{0x0163,0x0A}, -{0x0164,0x10}, -{0x0165,0x0A}, -{0x0166,0x0A}, -{0x018C,0x24}, -{0x018D,0x04}, -{0x018E,0x00}, -{0x018F,0x11}, -{0x0190,0x80}, -{0x0191,0x47}, -{0x0192,0x48}, -{0x0193,0x64}, -{0x0194,0x32}, -{0x0195,0xc8}, -{0x0196,0x96}, -{0x0197,0x64}, -{0x0198,0x32}, -{0x0199,0x14}, -{0x019A,0x20}, -{0x019B,0x14}, -{0x01B0,0x55}, -{0x01B1,0x0C}, -{0x01B2,0x0A}, -{0x01B3,0x10}, -{0x01B4,0x0E}, -{0x01BA,0x10}, -{0x01BB,0x04}, -{0x01D8,0x40}, -{0x01DE,0x60}, -{0x01E4,0x10}, -{0x01E5,0x10}, -{0x01F2,0x0C}, -{0x01F3,0x14}, -{0x01F8,0x04}, -{0x01F9,0x0C}, -{0x01FE,0x02}, -{0x01FF,0x04}, -{0x0220,0x00}, -{0x0221,0xB0}, -{0x0222,0x00}, -{0x0223,0x80}, -{0x0224,0x8E}, -{0x0225,0x00}, -{0x0226,0x88}, -{0x022A,0x88}, -{0x022B,0x00}, -{0x022C,0x8C}, -{0x022D,0x13}, -{0x022E,0x0B}, -{0x022F,0x13}, -{0x0230,0x0B}, -{0x0233,0x13}, -{0x0234,0x0B}, -{0x0235,0x28}, -{0x0236,0x03}, -{0x0237,0x28}, -{0x0238,0x03}, -{0x023B,0x28}, -{0x023C,0x03}, -{0x023D,0x5C}, -{0x023E,0x02}, -{0x023F,0x5C}, -{0x0240,0x02}, -{0x0243,0x5C}, -{0x0244,0x02}, -{0x0251,0x0E}, -{0x0252,0x00}, -{0x0280,0x0A}, -{0x0282,0x14}, -{0x0284,0x2A}, -{0x0286,0x50}, -{0x0288,0x60}, -{0x028A,0x6D}, -{0x028C,0x79}, -{0x028E,0x82}, -{0x0290,0x8A}, -{0x0292,0x91}, -{0x0294,0x9C}, -{0x0296,0xA7}, -{0x0298,0xBA}, -{0x029A,0xCD}, -{0x029C,0xE0}, -{0x029E,0x2D}, -{0x02A0,0x06}, -{0x02E0,0x04}, -{0x02C0,0x8F}, -{0x02C1,0x01}, -{0x02C2,0x8F}, -{0x02C3,0x07}, -{0x02C4,0xE3}, -{0x02C5,0x07}, -{0x02C6,0xC1}, -{0x02C7,0x07}, -{0x02C8,0x70}, -{0x02C9,0x01}, -{0x02CA,0xD0}, -{0x02CB,0x07}, -{0x02CC,0xF7}, -{0x02CD,0x07}, -{0x02CE,0x5A}, -{0x02CF,0x07}, -{0x02D0,0xB0}, -{0x02D1,0x01}, -{0x0302,0x00}, -{0x0303,0x00}, -{0x0304,0x00}, -{0x02F0,0x80}, -{0x02F1,0x07}, -{0x02F2,0x8E}, -{0x02F3,0x00}, -{0x02F4,0xF2}, -{0x02F5,0x07}, -{0x02F6,0xCC}, -{0x02F7,0x07}, -{0x02F8,0x16}, -{0x02F9,0x00}, -{0x02FA,0x1E}, -{0x02FB,0x00}, -{0x02FC,0x9D}, -{0x02FD,0x07}, -{0x02FE,0xA6}, -{0x02FF,0x07}, -{0x0300,0xBD}, -{0x0301,0x00}, -{0x0305,0x00}, -{0x0306,0x00}, -{0x0307,0x00}, -{0x032D,0x00}, -{0x032E,0x01}, -{0x032F,0x00}, -{0x0330,0x01}, -{0x0331,0x00}, -{0x0332,0x01}, -{0x0333,0x82}, -{0x0334,0x00}, -{0x0335,0x84}, -{0x0336,0x00}, -{0x0337,0x01}, -{0x0338,0x00}, -{0x0339,0x01}, -{0x033A,0x00}, -{0x033B,0x01}, -{0x033E,0x04}, -{0x033F,0x86}, -{0x0340,0x30}, -{0x0341,0x44}, -{0x0342,0x4A}, -{0x0343,0x42}, -{0x0344,0x74}, -{0x0345,0x4F}, -{0x0346,0x67}, -{0x0347,0x5C}, -{0x0348,0x59}, -{0x0349,0x67}, -{0x034A,0x4D}, -{0x034B,0x6E}, -{0x034C,0x44}, -{0x0350,0x80}, -{0x0351,0x80}, -{0x0352,0x18}, -{0x0353,0x18}, -{0x0354,0x6E}, -{0x0355,0x4A}, -{0x0356,0x73}, -{0x0357,0xC0}, -{0x0358,0x06}, -{0x035A,0x06}, -{0x035B,0xA0}, -{0x035C,0x73}, -{0x035D,0x50}, -{0x035E,0xC0}, -{0x035F,0xA0}, -{0x0360,0x02}, -{0x0361,0x18}, -{0x0362,0x80}, -{0x0363,0x6C}, -{0x0364,0x00}, -{0x0365,0xF0}, -{0x0366,0x20}, -{0x0367,0x0C}, -{0x0369,0x00}, -{0x036A,0x10}, -{0x036B,0x10}, -{0x036E,0x20}, -{0x036F,0x00}, -{0x0370,0x10}, -{0x0371,0x18}, -{0x0372,0x0C}, -{0x0373,0x38}, -{0x0374,0x3A}, -{0x0375,0x13}, -{0x0376,0x22}, -{0x0380,0xFF}, -{0x0381,0x4c}, -{0x0382,0x3c}, -{0x038A,0x40}, -{0x038B,0x08}, -{0x038C,0xC1}, -{0x038E,0x44}, - -#if SENSOR_PLL_ENABLE - //10 fps - {0x038F,0x07}, - {0x0390,0x5c}, -#else - #if SENSOR_FAST_MODE - //10 fps - {0x038F,0x03}, - {0x0390,0xae}, - #else - //7.5 fps - {0x038F,0x04}, //09 - {0x0390,0xE8}, //18 - #endif -#endif - -{0x0391,0x05}, -{0x0393,0x80}, -{0x0395,0x21}, -{0x0398,0x02}, -{0x0399,0x84}, -{0x039A,0x03}, -{0x039B,0x25}, -{0x039C,0x03}, -{0x039D,0xC6}, -{0x039E,0x05}, -{0x039F,0x08}, -{0x03A0,0x06}, -{0x03A1,0x4A}, -{0x03A2,0x07}, -{0x03A3,0x8C}, -{0x03A4,0x0A}, -{0x03A5,0x10}, -{0x03A6,0x0C}, -{0x03A7,0x0E}, -{0x03A8,0x10}, -{0x03A9,0x18}, -{0x03AA,0x20}, -{0x03AB,0x28}, -{0x03AC,0x1E}, -{0x03AD,0x1A}, -{0x03AE,0x13}, -{0x03AF,0x0C}, -{0x03B0,0x0B}, -{0x03B1,0x09}, -{0x03B3,0x10}, -{0x03B4,0x00}, -{0x03B5,0x10}, -{0x03B6,0x00}, -{0x03B7,0xEA}, -{0x03B8,0x00}, -{0x03B9,0x3A}, -{0x03BA,0x01}, -{0x03BB,0x9F}, -{0x03BC,0xCF}, -{0x03BD,0xE7}, -{0x03BE,0xF3}, -{0x03BF,0x01}, -{0x03D0,0xF8}, -{0x03E0,0x04}, -{0x03E1,0x01}, -{0x03E2,0x04}, -{0x03E4,0x10}, -{0x03E5,0x12}, -{0x03E6,0x00}, -{0x03E8,0x21}, -{0x03E9,0x23}, -{0x03EA,0x01}, -{0x03EC,0x21}, -{0x03ED,0x23}, -{0x03EE,0x01}, -{0x03F0,0x20}, -{0x03F1,0x22}, -{0x03F2,0x00}, -{0x0420,0x84}, -{0x0421,0x00}, -{0x0422,0x00}, -{0x0423,0x83}, -{0x0430,0x08}, -{0x0431,0x28}, -{0x0432,0x10}, -{0x0433,0x08}, -{0x0435,0x0C}, -{0x0450,0xFF}, -{0x0451,0xE8}, -{0x0452,0xC4}, -{0x0453,0x88}, -{0x0454,0x00}, -{0x0458,0x70}, -{0x0459,0x03}, -{0x045A,0x00}, -{0x045B,0x30}, -{0x045C,0x00}, -{0x045D,0x70}, -{0x0466,0x14}, -{0x047A,0x00}, -{0x047B,0x00}, -{0x0480,0x58}, -{0x0481,0x06}, -{0x0482,0x0C}, -{0x04B0,0x50}, -{0x04B6,0x30}, -{0x04B9,0x10}, -{0x04B3,0x10}, -{0x04B1,0x8E}, -{0x04B4,0x20}, -{0x0540,0x00}, -{0x0541,0x60},//9D -{0x0542,0x00}, -{0x0543,0x73},//BC -{0x0580,0x01}, -{0x0581,0x0F}, -{0x0582,0x04}, -{0x0594,0x00}, -{0x0595,0x04}, -{0x05A9,0x03}, -{0x05AA,0x40}, -{0x05AB,0x80}, -{0x05AC,0x0A}, -{0x05AD,0x10}, -{0x05AE,0x0C}, -{0x05AF,0x0C}, -{0x05B0,0x03}, -{0x05B1,0x03}, -{0x05B2,0x1C}, -{0x05B3,0x02}, -{0x05B4,0x00}, -{0x05B5,0x0C}, -{0x05B8,0x80}, -{0x05B9,0x32}, -{0x05BA,0x00}, -{0x05BB,0x80}, -{0x05BC,0x03}, -{0x05BD,0x00}, -{0x05BF,0x05}, -{0x05C0,0x10}, -{0x05C3,0x00}, -{0x05C4,0x0C}, -{0x05C5,0x20}, -{0x05C7,0x01}, -{0x05C8,0x14}, -{0x05C9,0x54}, -{0x05CA,0x14}, -{0x05CB,0xE0}, -{0x05CC,0x20}, -{0x05CD,0x00}, -{0x05CE,0x08}, -{0x05CF,0x60}, -{0x05D0,0x10}, -{0x05D1,0x05}, -{0x05D2,0x03}, -{0x05D4,0x00}, -{0x05D5,0x05}, -{0x05D6,0x05}, -{0x05D7,0x05}, -{0x05D8,0x08}, -{0x05DC,0x0C}, -{0x05D9,0x00}, -{0x05DB,0x00}, -{0x05DD,0x0F}, -{0x05DE,0x00}, -{0x05DF,0x0A}, -{0x05E0,0xA0}, -{0x05E1,0x00}, -{0x05E2,0xA0}, -{0x05E3,0x00}, -{0x05E4,0x05}, -{0x05E5,0x00}, -{0x05E6,0x24}, -{0x05E7,0x03}, -{0x05E8,0x07}, -{0x05E9,0x00}, -{0x05EA,0x5E}, -{0x05EB,0x02}, -{0x0660,0x04}, -{0x0661,0x16}, -{0x0662,0x04}, -{0x0663,0x28}, -{0x0664,0x04}, -{0x0665,0x18}, -{0x0666,0x04}, -{0x0667,0x21}, -{0x0668,0x04}, -{0x0669,0x0C}, -{0x066A,0x04}, -{0x066B,0x25}, -{0x066C,0x00}, -{0x066D,0x12}, -{0x066E,0x00}, -{0x066F,0x80}, -{0x0670,0x00}, -{0x0671,0x0A}, -{0x0672,0x04}, -{0x0673,0x1D}, -{0x0674,0x04}, -{0x0675,0x1D}, -{0x0676,0x00}, -{0x0677,0x7E}, -{0x0678,0x01}, -{0x0679,0x47}, -{0x067A,0x00}, -{0x067B,0x73}, -{0x067C,0x04}, -{0x067D,0x14}, -{0x067E,0x04}, -{0x067F,0x28}, -{0x0680,0x00}, -{0x0681,0x22}, -{0x0682,0x00}, -{0x0683,0xA5}, -{0x0684,0x00}, -{0x0685,0x1E}, -{0x0686,0x04}, -{0x0687,0x1D}, -{0x0688,0x04}, -{0x0689,0x19}, -{0x068A,0x04}, -{0x068B,0x21}, -{0x068C,0x04}, -{0x068D,0x0A}, -{0x068E,0x04}, -{0x068F,0x25}, -{0x0690,0x04}, -{0x0691,0x15}, -{0x0698,0x20}, -{0x0699,0x20}, -{0x069A,0x01}, -{0x069C,0x22}, -{0x069D,0x10}, -{0x069E,0x10}, -{0x069F,0x08}, -{0x0000,0x01}, -{0x0100,0x01}, -{0x0101,0x01}, -{0x0005,0x01}, - -SensorEnd - -}; -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={ -{0x0380,0xFE}, -{0x000D,0x00}, -{0x000E,0x00}, -{0x011F,0x88}, -{0x0125,0xDF}, -{0x0126,0x70}, -{0x0131,0xAC}, -{0x0366,0x20}, -{0x0433,0x40}, -{0x0435,0x50}, -{0x05E4,0x0A}, -{0x05E5,0x00}, -{0x05E6,0x49}, -{0x05E7,0x06}, -{0x05E8,0x0A}, -{0x05E9,0x00}, -{0x05EA,0xB9}, -{0x05EB,0x04}, -{0x0000,0x01}, -{0x0100,0x01}, -{0x0101,0x01}, -{0x0005,0x01}, - - SensorEnd -}; -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] ={ - SensorEnd -}; -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data[] = -{ -/*¼ÏñÍêºóÔÚ·µ»Øµ½Ô¤ÀÀ£¬Ô¤ÀÀʱÓÐË®²¨ÎƵÄbugÐÞ¸Ä<2012.11.22>*/ - {0x0380,0xFF}, -{0x0006,0x00}, -{0x000D,0x11}, -{0x000E,0x11}, -//{0x0012,0x1C}, -//{0x0013,0x01}, -//{{0x0027,0x18}, -{0x002A,0x1F}, -//{0x0071,0xFF}, -{0x0082,0xA2}, -{0x011F,0x80}, -{0x0125,0xDF}, -{0x0126,0x70}, -{0x0131,0xAD}, -{0x0144,0x04}, -{0x0190,0x80}, -{0x0192,0x48}, -//{0x0541,0x9D},// 0541ºÍ0543ÊDZíʾflicker step -//{0x0543,0xBC}, -{0x05E0,0xA0}, -{0x05E1,0x00}, -{0x05E2,0xA0}, -{0x05E3,0x00}, -{0x05E4,0x05}, -{0x05E5,0x00}, -{0x05E6,0x24}, -{0x05E7,0x03}, -{0x05E8,0x08}, -{0x05E9,0x00}, -{0x05EA,0x5F}, -{0x05EB,0x02}, -{0x0000,0x01}, -{0x0100,0x01}, -{0x0101,0x01}, - - SensorEnd -}; -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[]={ - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[]={ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_softreset_data[]={ - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[]={ - SensorRegVal(0x0001,0), - SensorRegVal(0x0002,0), - SensorEnd -}; -/* -* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx -*/ -static struct rk_sensor_reg sensor_WhiteB_Auto[]= -{ - {0x0380, 0xFF}, //AWB auto - {0x0000, 0x01}, - {0x0100, 0x01}, - {0x0101, 0x01}, - SensorEnd -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[]= -{ - {0x0380, 0xFD}, - {0x032D, 0x70}, - {0x032E, 0x01}, - {0x032F, 0x00}, - {0x0330, 0x01}, - {0x0331, 0x08}, - {0x0332, 0x01}, - {0x0101, 0xFF}, - SensorEnd -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[]= -{ - {0x0380, 0xFD}, - {0x032D, 0x60}, - {0x032E, 0x01}, - {0x032F, 0x00}, - {0x0330, 0x01}, - {0x0331, 0x20}, - {0x0332, 0x01}, - {0x0101, 0xFF}, - SensorEnd -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]= -{ - {0x0380, 0xFD}, - {0x032D, 0x50}, - {0x032E, 0x01}, - {0x032F, 0x00}, - {0x0330, 0x01}, - {0x0331, 0x30}, - {0x0332, 0x01}, - {0x0101, 0xFF}, - SensorEnd - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]= -{ - {0x0380, 0xFD}, - {0x032D, 0x10}, - {0x032E, 0x01}, - {0x032F, 0x00}, - {0x0330, 0x01}, - {0x0331, 0xA0}, - {0x0332, 0x01}, - {0x0101, 0xFF}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[]= -{ - // Brightness -2 - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[]= -{ - // Brightness -1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[]= -{ - // Brightness 0 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[]= -{ - // Brightness +1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[]= -{ - // Brightness +2 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[]= -{ - // Brightness +3 - - SensorEnd -}; -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = -{ - {0x0488, 0x10}, - {0x0486, 0x00}, - {0x0487, 0xFF}, - {0x0101, 0xFF}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = -{ - {0x0488, 0x12}, - {0x0486, 0x00}, - {0x0487, 0xFF}, - {0x0101, 0xFF}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = -{ - {0x0488, 0x11}, - {0x0486, 0x40}, - {0x0487, 0x90}, - {0x0101, 0xFF}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Negative[] = -{ - {0x0488, 0x12}, - {0x0486, 0x00}, - {0x0487, 0xFF}, - {0x0101, 0xFF}, - SensorEnd -}; -static struct rk_sensor_reg sensor_Effect_Bluish[] = -{ - {0x0488, 0x11}, - {0x0486, 0xB0}, - {0x0487, 0x80}, - {0x0101, 0xFF}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = -{ - {0x0488, 0x11}, - {0x0486, 0x60}, - {0x0487, 0x60}, - {0x0101, 0xFF}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; - -static struct rk_sensor_reg sensor_Exposure0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure2[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure3[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure4[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure5[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure6[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; - -static struct rk_sensor_reg sensor_Saturation0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -static struct rk_sensor_reg sensor_Contrast0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast2[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast3[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast4[]= -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Contrast5[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast6[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; -static struct rk_sensor_reg sensor_SceneAuto[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -static struct rk_sensor_reg sensor_Zoom0[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Zoom3[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; - -/* -* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu -*/ -static struct v4l2_querymenu sensor_menus[] = -{ -}; -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = -{ -}; - -//MUST define the current used format as the first item -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {MEDIA_BUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG} -}; -/*static struct soc_camera_ops sensor_ops;*/ - - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ - -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - - SENSOR_DG("%s",__FUNCTION__); - - - return 0; -} -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - //struct generic_sensor *sensor = to_generic_sensor(client); - - SENSOR_DG("%s",__FUNCTION__); - - return 0; -} -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - return 0; -} -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh (struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - return 0; -} -static int sensor_softrest_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - return 0; -} -static int sensor_try_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf) -{ - return 0; -} - -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("Suspend"); - - } else { - SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n",pm_msg.event); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - - SENSOR_DG("Resume"); - - return 0; - -} -static int sensor_mirror_cb (struct i2c_client *client, int mirror) -{ - int err = 0; - - SENSOR_DG("mirror: %d",mirror); - - - return err; -} -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_mirror_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_mirror failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_mirror success, value:0x%x",ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - int err = 0; - - SENSOR_DG("flip: %d",flip); - - return err; -} -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_flip_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_flip failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_flip success, value:0x%x",ext_ctrl->value); - return 0; -} -/* -* the functions are focus callbacks -*/ -static int sensor_focus_init_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos) { - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client){ - return 0; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos) -{ - return 0; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client,int on){ - return 0; -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor* spsensor,struct soc_camera_device *icd) -{ - return; -} - -/* -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); - - - - diff --git a/drivers/media/video/hm5065.c b/drivers/media/video/hm5065.c deleted file mode 100644 index 7746993ccc7d..000000000000 --- a/drivers/media/video/hm5065.c +++ /dev/null @@ -1,3188 +0,0 @@ - /* - * drivers/media/video/hm5065.c - * - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - - #include "generic_sensor.h" - -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.1.1: -* add sensor_focus_af_const_pause_usr_cb; -*/ -static int version = KERNEL_VERSION(0,1,1); -module_param(version, int, S_IRUGO); - - -static int debug=1; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_HM5065 -#define SENSOR_V4L2_IDENT V4L2_IDENT_HM5065 -#define SENSOR_ID 0x039E -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_PCLK_SAMPLE_RISING|V4L2_MBUS_HSYNC_ACTIVE_HIGH| V4L2_MBUS_VSYNC_ACTIVE_LOW|\ - V4L2_MBUS_DATA_ACTIVE_HIGH |SOCAM_MCLK_24MHZ) -#define SENSOR_PREVIEW_W 1280 //800 -#define SENSOR_PREVIEW_H 960//600 -#define SENSOR_PREVIEW_FPS 15000 // 15fps -#define SENSOR_FULLRES_L_FPS 7500 // 7.5fps -#define SENSOR_FULLRES_H_FPS 7500 // 7.5fps -#define SENSOR_720P_FPS 30000 -#define SENSOR_1080P_FPS 15000 - -#define SENSOR_REGISTER_LEN 2 // sensor register address bytes -#define SENSOR_VALUE_LEN 1 // sensor register value bytes - -#define SENSOR_AF_CONFIG 1 - -#ifdef SENSOR_AF_CONFIG -static unsigned int SensorConfiguration = (CFG_WhiteBalance|CFG_Effect - |CFG_Scene|CFG_Focus|CFG_FocusContinues - |CFG_FocusZone); - -#else -static unsigned int SensorConfiguration = (CFG_WhiteBalance|CFG_Effect - |CFG_Scene); -#endif - -static unsigned int SensorChipID[] = {SENSOR_ID}; -/* Sensor Driver Configuration End */ - - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a,b) CONS4(SensorReg,SENSOR_REGISTER_LEN,Val,SENSOR_VALUE_LEN)(a,b) -#define sensor_write(client,reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_read(client,reg,v) CONS4(sensor_read_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_write_array generic_sensor_write_array - - -/* hm5065 VCM Command and Status Registers */ -#define AF_TARGETPOS_REG_H 0x0700 -#define AF_TARGETPOS_REG_L 0x0701 - -#define AF_MODES_REG 0x070A -#define AF_AUTOCMDS_REG 0x070b -#define AF_LENSPOS_REG_H 0x06F0 -#define AF_LENSPOS_REG_L 0x06F1 -#define AF_MANUCMDS_REG 0x070c -#define AF_FINISHCHK_REG 0x07ae //[0]: false [1] : true - -#define FACE_LC 0x0714 //[0] : focus , [1] : AE “„Ó -#define FACE_START_XH 0x0715 -#define FACE_START_XL 0x0716 -#define FACE_SIZE_XH 0x0717 -#define FACE_SIZE_XL 0x0718 -#define FACE_START_YH 0x0719 -#define FACE_START_YL 0x071A -#define FACE_SIZE_YH 0x071B -#define FACE_SIZE_YL 0x071C - - -#define AF_ZONE0_WEIGHT 0x0808 -#define AF_ZONE1_WEIGHT 0x0809 -#define AF_ZONE2_WEIGHT 0x080A -#define AF_ZONE3_WEIGHT 0x080B -#define AF_ZONE4_WEIGHT 0x080C -#define AF_ZONE5_WEIGHT 0x080D -#define AF_ZONE6_WEIGHT 0x080E - - -struct sensor_parameter -{ - int af_pos[2]; -}; - -struct specific_sensor{ - struct generic_sensor common_sensor; - //define user data below - struct sensor_parameter parameter; - -}; - -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ - -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_init_data[] = { - - {0xffff,0x01}, // 2013-03-01 Start new patch - {0x9000,0x03}, - {0xA000,0x90}, - {0xA001,0x0C}, - {0xA002,0x56}, - {0xA003,0xE0}, - {0xA004,0xFE}, - {0xA005,0xA3}, - {0xA006,0xE0}, - {0xA007,0xFF}, - {0xA008,0x12}, - {0xA009,0x42}, - {0xA00A,0x85}, - {0xA00B,0x90}, - {0xA00C,0x01}, - {0xA00D,0xB7}, - {0xA00E,0xEE}, - {0xA00F,0xF0}, - {0xA010,0xFC}, - {0xA011,0xA3}, - {0xA012,0xEF}, - {0xA013,0xF0}, - {0xA014,0xFD}, - {0xA015,0x90}, - {0xA016,0x06}, - {0xA017,0x05}, - {0xA018,0xE0}, - {0xA019,0x75}, - {0xA01A,0xF0}, - {0xA01B,0x02}, - {0xA01C,0xA4}, - {0xA01D,0x2D}, - {0xA01E,0xFF}, - {0xA01F,0xE5}, - {0xA020,0xF0}, - {0xA021,0x3C}, - {0xA022,0xFE}, - {0xA023,0xAB}, - {0xA024,0x07}, - {0xA025,0xFA}, - {0xA026,0x33}, - {0xA027,0x95}, - {0xA028,0xE0}, - {0xA029,0xF9}, - {0xA02A,0xF8}, - {0xA02B,0x90}, - {0xA02C,0x0B}, - {0xA02D,0x4B}, - {0xA02E,0xE0}, - {0xA02F,0xFE}, - {0xA030,0xA3}, - {0xA031,0xE0}, - {0xA032,0xFF}, - {0xA033,0xEE}, - {0xA034,0x33}, - {0xA035,0x95}, - {0xA036,0xE0}, - {0xA037,0xFD}, - {0xA038,0xFC}, - {0xA039,0x12}, - {0xA03A,0x0C}, - {0xA03B,0x7B}, - {0xA03C,0x90}, - {0xA03D,0x01}, - {0xA03E,0xB9}, - {0xA03F,0x12}, - {0xA040,0x0E}, - {0xA041,0x05}, - {0xA042,0x90}, - {0xA043,0x01}, - {0xA044,0xB9}, - {0xA045,0xE0}, - {0xA046,0xFC}, - {0xA047,0xA3}, - {0xA048,0xE0}, - {0xA049,0xFD}, - {0xA04A,0xA3}, - {0xA04B,0xE0}, - {0xA04C,0xFE}, - {0xA04D,0xA3}, - {0xA04E,0xE0}, - {0xA04F,0xFF}, - {0xA050,0x78}, - {0xA051,0x08}, - {0xA052,0x12}, - {0xA053,0x0D}, - {0xA054,0xBF}, - {0xA055,0xA8}, - {0xA056,0x04}, - {0xA057,0xA9}, - {0xA058,0x05}, - {0xA059,0xAA}, - {0xA05A,0x06}, - {0xA05B,0xAB}, - {0xA05C,0x07}, - {0xA05D,0x90}, - {0xA05E,0x0B}, - {0xA05F,0x49}, - {0xA060,0xE0}, - {0xA061,0xFE}, - {0xA062,0xA3}, - {0xA063,0xE0}, - {0xA064,0xFF}, - {0xA065,0xEE}, - {0xA066,0x33}, - {0xA067,0x95}, - {0xA068,0xE0}, - {0xA069,0xFD}, - {0xA06A,0xFC}, - {0xA06B,0xC3}, - {0xA06C,0xEF}, - {0xA06D,0x9B}, - {0xA06E,0xFF}, - {0xA06F,0xEE}, - {0xA070,0x9A}, - {0xA071,0xFE}, - {0xA072,0xED}, - {0xA073,0x99}, - {0xA074,0xFD}, - {0xA075,0xEC}, - {0xA076,0x98}, - {0xA077,0xFC}, - {0xA078,0x78}, - {0xA079,0x01}, - {0xA07A,0x12}, - {0xA07B,0x0D}, - {0xA07C,0xBF}, - {0xA07D,0x90}, - {0xA07E,0x0C}, - {0xA07F,0x4A}, - {0xA080,0xE0}, - {0xA081,0xFC}, - {0xA082,0xA3}, - {0xA083,0xE0}, - {0xA084,0xF5}, - {0xA085,0x82}, - {0xA086,0x8C}, - {0xA087,0x83}, - {0xA088,0xC0}, - {0xA089,0x83}, - {0xA08A,0xC0}, - {0xA08B,0x82}, - {0xA08C,0x90}, - {0xA08D,0x0B}, - {0xA08E,0x48}, - {0xA08F,0xE0}, - {0xA090,0xD0}, - {0xA091,0x82}, - {0xA092,0xD0}, - {0xA093,0x83}, - {0xA094,0x75}, - {0xA095,0xF0}, - {0xA096,0x02}, - {0xA097,0x12}, - {0xA098,0x0E}, - {0xA099,0x45}, - {0xA09A,0xEE}, - {0xA09B,0xF0}, - {0xA09C,0xA3}, - {0xA09D,0xEF}, - {0xA09E,0xF0}, - {0xA09F,0x02}, - {0xA0A0,0xBA}, - {0xA0A1,0xD8}, - {0xA0A2,0x90}, - {0xA0A3,0x30}, - {0xA0A4,0x18}, - {0xA0A5,0xe4}, - {0xA0A6,0xf0}, - {0xA0A7,0x74}, - {0xA0A8,0x3f}, - {0xA0A9,0xf0}, - {0xA0AA,0x22}, - {0xA0BF,0x90}, - {0xA0C0,0x00}, - {0xA0C1,0x5E}, - {0xA0C2,0xE0}, - {0xA0C3,0xFF}, - {0xA0C4,0x70}, - {0xA0C5,0x20}, - {0xA0C6,0x90}, - {0xA0C7,0x47}, - {0xA0C8,0x04}, - {0xA0C9,0x74}, - {0xA0CA,0x0A}, - {0xA0CB,0xF0}, - {0xA0CC,0xA3}, - {0xA0CD,0x74}, - {0xA0CE,0x30}, - {0xA0CF,0xF0}, - {0xA0D0,0x90}, - {0xA0D1,0x47}, - {0xA0D2,0x0C}, - {0xA0D3,0x74}, - {0xA0D4,0x07}, - {0xA0D5,0xF0}, - {0xA0D6,0xA3}, - {0xA0D7,0x74}, - {0xA0D8,0xA8}, - {0xA0D9,0xF0}, - {0xA0DA,0x90}, - {0xA0DB,0x47}, - {0xA0DC,0xA4}, - {0xA0DD,0x74}, - {0xA0DE,0x01}, - {0xA0DF,0xF0}, - {0xA0E0,0x90}, - {0xA0E1,0x47}, - {0xA0E2,0xA8}, - {0xA0E3,0xF0}, - {0xA0E4,0x80}, - {0xA0E5,0x50}, - {0xA0E6,0xEF}, - {0xA0E7,0x64}, - {0xA0E8,0x01}, - {0xA0E9,0x60}, - {0xA0EA,0x04}, - {0xA0EB,0xEF}, - {0xA0EC,0xB4}, - {0xA0ED,0x03}, - {0xA0EE,0x20}, - {0xA0EF,0x90}, - {0xA0F0,0x47}, - {0xA0F1,0x04}, - {0xA0F2,0x74}, - {0xA0F3,0x05}, - {0xA0F4,0xF0}, - {0xA0F5,0xA3}, - {0xA0F6,0x74}, - {0xA0F7,0x18}, - {0xA0F8,0xF0}, - {0xA0F9,0x90}, - {0xA0FA,0x47}, - {0xA0FB,0x0C}, - {0xA0FC,0x74}, - {0xA0FD,0x03}, - {0xA0FE,0xF0}, - {0xA0FF,0xA3}, - {0xA100,0x74}, - {0xA101,0xD4}, - {0xA102,0xF0}, - {0xA103,0x90}, - {0xA104,0x47}, - {0xA105,0xA4}, - {0xA106,0x74}, - {0xA107,0x02}, - {0xA108,0xF0}, - {0xA109,0x90}, - {0xA10A,0x47}, - {0xA10B,0xA8}, - {0xA10C,0xF0}, - {0xA10D,0x80}, - {0xA10E,0x27}, - {0xA10F,0xEF}, - {0xA110,0x64}, - {0xA111,0x02}, - {0xA112,0x60}, - {0xA113,0x04}, - {0xA114,0xEF}, - {0xA115,0xB4}, - {0xA116,0x04}, - {0xA117,0x1E}, - {0xA118,0x90}, - {0xA119,0x47}, - {0xA11A,0x04}, - {0xA11B,0x74}, - {0xA11C,0x02}, - {0xA11D,0xF0}, - {0xA11E,0xA3}, - {0xA11F,0x74}, - {0xA120,0x8C}, - {0xA121,0xF0}, - {0xA122,0x90}, - {0xA123,0x47}, - {0xA124,0x0C}, - {0xA125,0x74}, - {0xA126,0x01}, - {0xA127,0xF0}, - {0xA128,0xA3}, - {0xA129,0x74}, - {0xA12A,0xEA}, - {0xA12B,0xF0}, - {0xA12C,0x90}, - {0xA12D,0x47}, - {0xA12E,0xA4}, - {0xA12F,0x74}, - {0xA130,0x04}, - {0xA131,0xF0}, - {0xA132,0x90}, - {0xA133,0x47}, - {0xA134,0xA8}, - {0xA135,0xF0}, - {0xA136,0x22}, - {0xA137,0x74}, - {0xA138,0x04}, - {0xA139,0xF0}, - {0xA13A,0xA3}, - {0xA13B,0x74}, - {0xA13C,0x20}, - {0xA13D,0xF0}, - {0xA13E,0xE4}, - {0xA13F,0xF5}, - {0xA140,0x22}, - {0xA141,0xE5}, - {0xA142,0x22}, - {0xA143,0xC3}, - {0xA144,0x94}, - {0xA145,0x40}, - {0xA146,0x40}, - {0xA147,0x03}, - {0xA148,0x02}, - {0xA149,0xF1}, - {0xA14A,0xFD}, - {0xA14B,0x90}, - {0xA14C,0x0A}, - {0xA14D,0xBA}, - {0xA14E,0xE0}, - {0xA14F,0xFE}, - {0xA150,0xA3}, - {0xA151,0xE0}, - {0xA152,0xFF}, - {0xA153,0xF5}, - {0xA154,0x82}, - {0xA155,0x8E}, - {0xA156,0x83}, - {0xA157,0xE0}, - {0xA158,0x54}, - {0xA159,0x70}, - {0xA15A,0xFD}, - {0xA15B,0xC4}, - {0xA15C,0x54}, - {0xA15D,0x0F}, - {0xA15E,0xFD}, - {0xA15F,0x90}, - {0xA160,0x0A}, - {0xA161,0xBC}, - {0xA162,0xE0}, - {0xA163,0xFA}, - {0xA164,0xA3}, - {0xA165,0xE0}, - {0xA166,0xF5}, - {0xA167,0x82}, - {0xA168,0x8A}, - {0xA169,0x83}, - {0xA16A,0xED}, - {0xA16B,0xF0}, - {0xA16C,0x90}, - {0xA16D,0x0A}, - {0xA16E,0xBD}, - {0xA16F,0xE0}, - {0xA170,0x04}, - {0xA171,0xF0}, - {0xA172,0x70}, - {0xA173,0x06}, - {0xA174,0x90}, - {0xA175,0x0A}, - {0xA176,0xBC}, - {0xA177,0xE0}, - {0xA178,0x04}, - {0xA179,0xF0}, - {0xA17A,0x8F}, - {0xA17B,0x82}, - {0xA17C,0x8E}, - {0xA17D,0x83}, - {0xA17E,0xA3}, - {0xA17F,0xE0}, - {0xA180,0xFF}, - {0xA181,0x90}, - {0xA182,0x0A}, - {0xA183,0xBC}, - {0xA184,0xE0}, - {0xA185,0xFC}, - {0xA186,0xA3}, - {0xA187,0xE0}, - {0xA188,0xF5}, - {0xA189,0x82}, - {0xA18A,0x8C}, - {0xA18B,0x83}, - {0xA18C,0xEF}, - {0xA18D,0xF0}, - {0xA18E,0x90}, - {0xA18F,0x0A}, - {0xA190,0xBD}, - {0xA191,0xE0}, - {0xA192,0x04}, - {0xA193,0xF0}, - {0xA194,0x70}, - {0xA195,0x06}, - {0xA196,0x90}, - {0xA197,0x0A}, - {0xA198,0xBC}, - {0xA199,0xE0}, - {0xA19A,0x04}, - {0xA19B,0xF0}, - {0xA19C,0x90}, - {0xA19D,0x0A}, - {0xA19E,0xBA}, - {0xA19F,0xE0}, - {0xA1A0,0xFE}, - {0xA1A1,0xA3}, - {0xA1A2,0xE0}, - {0xA1A3,0xFF}, - {0xA1A4,0xF5}, - {0xA1A5,0x82}, - {0xA1A6,0x8E}, - {0xA1A7,0x83}, - {0xA1A8,0xE0}, - {0xA1A9,0x54}, - {0xA1AA,0x07}, - {0xA1AB,0xFD}, - {0xA1AC,0x90}, - {0xA1AD,0x0A}, - {0xA1AE,0xBC}, - {0xA1AF,0xE0}, - {0xA1B0,0xFA}, - {0xA1B1,0xA3}, - {0xA1B2,0xE0}, - {0xA1B3,0xF5}, - {0xA1B4,0x82}, - {0xA1B5,0x8A}, - {0xA1B6,0x83}, - {0xA1B7,0xED}, - {0xA1B8,0xF0}, - {0xA1B9,0x90}, - {0xA1BA,0x0A}, - {0xA1BB,0xBD}, - {0xA1BC,0xE0}, - {0xA1BD,0x04}, - {0xA1BE,0xF0}, - {0xA1BF,0x70}, - {0xA1C0,0x06}, - {0xA1C1,0x90}, - {0xA1C2,0x0A}, - {0xA1C3,0xBC}, - {0xA1C4,0xE0}, - {0xA1C5,0x04}, - {0xA1C6,0xF0}, - {0xA1C7,0x8F}, - {0xA1C8,0x82}, - {0xA1C9,0x8E}, - {0xA1CA,0x83}, - {0xA1CB,0xA3}, - {0xA1CC,0xA3}, - {0xA1CD,0xE0}, - {0xA1CE,0xFF}, - {0xA1CF,0x90}, - {0xA1D0,0x0A}, - {0xA1D1,0xBC}, - {0xA1D2,0xE0}, - {0xA1D3,0xFC}, - {0xA1D4,0xA3}, - {0xA1D5,0xE0}, - {0xA1D6,0xF5}, - {0xA1D7,0x82}, - {0xA1D8,0x8C}, - {0xA1D9,0x83}, - {0xA1DA,0xEF}, - {0xA1DB,0xF0}, - {0xA1DC,0x90}, - {0xA1DD,0x0A}, - {0xA1DE,0xBD}, - {0xA1DF,0xE0}, - {0xA1E0,0x04}, - {0xA1E1,0xF0}, - {0xA1E2,0x70}, - {0xA1E3,0x06}, - {0xA1E4,0x90}, - {0xA1E5,0x0A}, - {0xA1E6,0xBC}, - {0xA1E7,0xE0}, - {0xA1E8,0x04}, - {0xA1E9,0xF0}, - {0xA1EA,0x90}, - {0xA1EB,0x0A}, - {0xA1EC,0xBB}, - {0xA1ED,0xE0}, - {0xA1EE,0x24}, - {0xA1EF,0x03}, - {0xA1F0,0xF0}, - {0xA1F1,0x90}, - {0xA1F2,0x0A}, - {0xA1F3,0xBA}, - {0xA1F4,0xE0}, - {0xA1F5,0x34}, - {0xA1F6,0x00}, - {0xA1F7,0xF0}, - {0xA1F8,0x05}, - {0xA1F9,0x22}, - {0xA1FA,0x02}, - {0xA1FB,0xF1}, - {0xA1FC,0x41}, - {0xA1FD,0x90}, - {0xA1FE,0x0A}, - {0xA1FF,0xBA}, - {0xA200,0x74}, - {0xA201,0x0E}, - {0xA202,0xF0}, - {0xA203,0xA3}, - {0xA204,0x74}, - {0xA205,0xDC}, - {0xA206,0xF0}, - {0xA207,0xA3}, - {0xA208,0x74}, - {0xA209,0x05}, - {0xA20A,0xF0}, - {0xA20B,0xA3}, - {0xA20C,0x74}, - {0xA20D,0x61}, - {0xA20E,0xF0}, - {0xA20F,0x90}, - {0xA210,0x0A}, - {0xA211,0xBA}, - {0xA212,0xE0}, - {0xA213,0xFE}, - {0xA214,0xA3}, - {0xA215,0xE0}, - {0xA216,0xAA}, - {0xA217,0x06}, - {0xA218,0xF9}, - {0xA219,0x7B}, - {0xA21A,0x01}, - {0xA21B,0xC0}, - {0xA21C,0x02}, - {0xA21D,0xA3}, - {0xA21E,0xE0}, - {0xA21F,0xFE}, - {0xA220,0xA3}, - {0xA221,0xE0}, - {0xA222,0xAA}, - {0xA223,0x06}, - {0xA224,0xF8}, - {0xA225,0xAC}, - {0xA226,0x02}, - {0xA227,0x7D}, - {0xA228,0x01}, - {0xA229,0xD0}, - {0xA22A,0x02}, - {0xA22B,0x7E}, - {0xA22C,0x00}, - {0xA22D,0x7F}, - {0xA22E,0x04}, - {0xA22F,0x12}, - {0xA230,0x0F}, - {0xA231,0x6F}, - {0xA232,0x02}, - {0xA233,0x66}, - {0xA234,0xD9}, - {0xA235,0x90}, - {0xA236,0x07}, - {0xA237,0xD0}, - {0xA238,0x02}, - {0xA239,0xA2}, - {0xA23A,0x69}, - {0xA240,0x02}, - {0xA241,0x21}, - {0xA242,0x7F}, - {0xA243,0x02}, - {0xA244,0x21}, - {0xA245,0xF4}, - {0xA246,0x02}, - {0xA247,0xA6}, - {0xA248,0x15}, - {0xA249,0x60}, - {0xA24A,0x0A}, - {0xA24B,0xEF}, - {0xA24C,0xB4}, - {0xA24D,0x01}, - {0xA24E,0x16}, - {0xA24F,0x90}, - {0xA250,0x00}, - {0xA251,0x5D}, - {0xA252,0xE0}, - {0xA253,0x70}, - {0xA254,0x10}, - {0xA255,0x12}, - {0xA256,0x26}, - {0xA257,0xC8}, - {0xA258,0x90}, - {0xA259,0x00}, - {0xA25A,0x11}, - {0xA25B,0x74}, - {0xA25C,0x30}, - {0xA25D,0xF0}, - {0xA25E,0x90}, - {0xA25F,0x00}, - {0xA260,0x10}, - {0xA261,0x74}, - {0xA262,0x01}, - {0xA263,0xF0}, - {0xA264,0x22}, - {0xA265,0x12}, - {0xA266,0x25}, - {0xA267,0xA8}, - {0xA268,0x02}, - {0xA269,0x29}, - {0xA26A,0xFC}, - {0xA26B,0x44}, - {0xA26C,0x18}, - {0xA26D,0xF0}, - {0xA26E,0x90}, - {0xA26F,0x72}, - {0xA270,0x18}, - {0xA271,0xE0}, - {0xA272,0x44}, - {0xA273,0x18}, - {0xA274,0xF0}, - {0xA275,0x00}, - {0xA276,0x00}, - {0xA277,0x00}, - {0xA278,0x00}, - {0xA279,0x00}, - {0xA27A,0x00}, - {0xA27B,0x90}, - {0xA27C,0x72}, - {0xA27D,0x08}, - {0xA27E,0xE0}, - {0xA27F,0x44}, - {0xA280,0x10}, - {0xA281,0xF0}, - {0xA282,0x90}, - {0xA283,0x72}, - {0xA284,0x14}, - {0xA285,0xE0}, - {0xA286,0x54}, - {0xA287,0xFD}, - {0xA288,0xF0}, - {0xA289,0x22}, - {0xA29B,0xF0}, - {0xA29C,0xD3}, - {0xA29D,0x90}, - {0xA29E,0x07}, - {0xA29F,0x91}, - {0xA2A0,0xE0}, - {0xA2A1,0x94}, - {0xA2A2,0x21}, - {0xA2A3,0x90}, - {0xA2A4,0x07}, - {0xA2A5,0x90}, - {0xA2A6,0xE0}, - {0xA2A7,0x64}, - {0xA2A8,0x80}, - {0xA2A9,0x94}, - {0xA2AA,0x81}, - {0xA2AB,0x40}, - {0xA2AC,0x08}, - {0xA2AD,0x90}, - {0xA2AE,0x07}, - {0xA2AF,0xCB}, - {0xA2B0,0x74}, - {0xA2B1,0xFF}, - {0xA2B2,0xF0}, - {0xA2B3,0x80}, - {0xA2B4,0x06}, - {0xA2B5,0x90}, - {0xA2B6,0x07}, - {0xA2B7,0xCB}, - {0xA2B8,0x74}, - {0xA2B9,0x01}, - {0xA2BA,0xF0}, - {0xA2BB,0x02}, - {0xA2BC,0xB5}, - {0xA2BD,0xC3}, - {0xA2BE,0x90}, - {0xA2BF,0x08}, - {0xA2C0,0x34}, - {0xA2C1,0xE0}, - {0xA2C2,0xFC}, - {0xA2C3,0xA3}, - {0xA2C4,0xE0}, - {0xA2C5,0xFD}, - {0xA2C6,0xA3}, - {0xA2C7,0xE0}, - {0xA2C8,0xFE}, - {0xA2C9,0xA3}, - {0xA2CA,0xE0}, - {0xA2CB,0xFF}, - {0xA2CC,0x90}, - {0xA2CD,0x07}, - {0xA2CE,0xD0}, - {0xA2CF,0xE0}, - {0xA2D0,0xF8}, - {0xA2D1,0xA3}, - {0xA2D2,0xE0}, - {0xA2D3,0xF9}, - {0xA2D4,0xA3}, - {0xA2D5,0xE0}, - {0xA2D6,0xFA}, - {0xA2D7,0xA3}, - {0xA2D8,0xE0}, - {0xA2D9,0xFB}, - {0xA2DA,0xD3}, - {0xA2DB,0x12}, - {0xA2DC,0x0D}, - {0xA2DD,0xAE}, - {0xA2DE,0x40}, - {0xA2DF,0x0B}, - {0xA2E0,0x12}, - {0xA2E1,0xB5}, - {0xA2E2,0x49}, - {0xA2E3,0x90}, - {0xA2E4,0x07}, - {0xA2E5,0xA4}, - {0xA2E6,0x74}, - {0xA2E7,0x02}, - {0xA2E8,0xF0}, - {0xA2E9,0x80}, - {0xA2EA,0x09}, - {0xA2EB,0x12}, - {0xA2EC,0xB7}, - {0xA2ED,0x51}, - {0xA2EE,0x90}, - {0xA2EF,0x07}, - {0xA2F0,0xA4}, - {0xA2F1,0x74}, - {0xA2F2,0x05}, - {0xA2F3,0xF0}, - {0xA2F4,0x02}, - {0xA2F5,0xA2}, - {0xA2F6,0xDA}, - {0xA2F7,0x90}, - {0xA2F8,0x0E}, - {0xA2F9,0xE0}, - {0xA2FA,0xE0}, - {0xA2FB,0xFD}, - {0xA2FC,0xA3}, - {0xA2FD,0xE0}, - {0xA2FE,0x90}, - {0xA2FF,0x02}, - {0xA300,0xA2}, - {0xA301,0xCD}, - {0xA302,0xF0}, - {0xA303,0xA3}, - {0xA304,0xED}, - {0xA305,0xF0}, - {0xA306,0x90}, - {0xA307,0x0E}, - {0xA308,0xE2}, - {0xA309,0xE0}, - {0xA30A,0xFD}, - {0xA30B,0xA3}, - {0xA30C,0xE0}, - {0xA30D,0x90}, - {0xA30E,0x02}, - {0xA30F,0xA8}, - {0xA310,0xCD}, - {0xA311,0xF0}, - {0xA312,0xA3}, - {0xA313,0xED}, - {0xA314,0xF0}, - {0xA315,0xE4}, - {0xA316,0x90}, - {0xA317,0x06}, - {0xA318,0x38}, - {0xA319,0xF0}, - {0xA31A,0x02}, - {0xA31B,0x67}, - {0xA31C,0x63}, - {0xA31D,0x90}, - {0xA31E,0x0E}, - {0xA31F,0xE8}, - {0xA320,0xE0}, - {0xA321,0x90}, - {0xA322,0x02}, - {0xA323,0x62}, - {0xA324,0xF0}, - {0xA325,0x90}, - {0xA326,0x0E}, - {0xA327,0xE9}, - {0xA328,0xE0}, - {0xA329,0x90}, - {0xA32A,0x02}, - {0xA32B,0x63}, - {0xA32C,0xF0}, - {0xA32D,0x02}, - {0xA32E,0x67}, - {0xA32F,0x1F}, - {0xA33B,0x90}, - {0xA33C,0x0E}, - {0xA33D,0x14}, - {0xA33E,0xE0}, - {0xA33F,0xFE}, - {0xA340,0xA3}, - {0xA341,0xE0}, - {0xA342,0xFF}, - {0xA343,0x90}, - {0xA344,0x06}, - {0xA345,0xD9}, - {0xA346,0xEE}, - {0xA347,0xF0}, - {0xA348,0xA3}, - {0xA349,0xEF}, - {0xA34A,0xF0}, - {0xA34B,0x90}, - {0xA34C,0x0E}, - {0xA34D,0x18}, - {0xA34E,0xE0}, - {0xA34F,0xFD}, - {0xA350,0x7C}, - {0xA351,0x00}, - {0xA352,0xC3}, - {0xA353,0xEF}, - {0xA354,0x9D}, - {0xA355,0xEE}, - {0xA356,0x9C}, - {0xA357,0x50}, - {0xA358,0x09}, - {0xA359,0xE4}, - {0xA35A,0x90}, - {0xA35B,0x06}, - {0xA35C,0xD7}, - {0xA35D,0xF0}, - {0xA35E,0xA3}, - {0xA35F,0xF0}, - {0xA360,0x80}, - {0xA361,0x13}, - {0xA362,0xC3}, - {0xA363,0x90}, - {0xA364,0x06}, - {0xA365,0xDA}, - {0xA366,0xE0}, - {0xA367,0x9D}, - {0xA368,0xFE}, - {0xA369,0x90}, - {0xA36A,0x06}, - {0xA36B,0xD9}, - {0xA36C,0xE0}, - {0xA36D,0x9C}, - {0xA36E,0x90}, - {0xA36F,0x06}, - {0xA370,0xD7}, - {0xA371,0xF0}, - {0xA372,0xA3}, - {0xA373,0xCE}, - {0xA374,0xF0}, - {0xA375,0x90}, - {0xA376,0x0E}, - {0xA377,0x18}, - {0xA378,0xE0}, - {0xA379,0xF9}, - {0xA37A,0xFF}, - {0xA37B,0x90}, - {0xA37C,0x06}, - {0xA37D,0xC2}, - {0xA37E,0xE0}, - {0xA37F,0xFC}, - {0xA380,0xA3}, - {0xA381,0xE0}, - {0xA382,0xFD}, - {0xA383,0xC3}, - {0xA384,0x9F}, - {0xA385,0xFF}, - {0xA386,0xEC}, - {0xA387,0x94}, - {0xA388,0x00}, - {0xA389,0xFE}, - {0xA38A,0x90}, - {0xA38B,0x0E}, - {0xA38C,0x16}, - {0xA38D,0xE0}, - {0xA38E,0xFA}, - {0xA38F,0xA3}, - {0xA390,0xE0}, - {0xA391,0xFB}, - {0xA392,0xD3}, - {0xA393,0x9F}, - {0xA394,0xEA}, - {0xA395,0x9E}, - {0xA396,0x40}, - {0xA397,0x0A}, - {0xA398,0x90}, - {0xA399,0x06}, - {0xA39A,0xD5}, - {0xA39B,0xEC}, - {0xA39C,0xF0}, - {0xA39D,0xA3}, - {0xA39E,0xED}, - {0xA39F,0xF0}, - {0xA3A0,0x80}, - {0xA3A1,0x0E}, - {0xA3A2,0xE9}, - {0xA3A3,0x7E}, - {0xA3A4,0x00}, - {0xA3A5,0x2B}, - {0xA3A6,0xFF}, - {0xA3A7,0xEE}, - {0xA3A8,0x3A}, - {0xA3A9,0x90}, - {0xA3AA,0x06}, - {0xA3AB,0xD5}, - {0xA3AC,0xF0}, - {0xA3AD,0xA3}, - {0xA3AE,0xEF}, - {0xA3AF,0xF0}, - {0xA3B0,0xE9}, - {0xA3B1,0xFB}, - {0xA3B2,0x7A}, - {0xA3B3,0x00}, - {0xA3B4,0x90}, - {0xA3B5,0x0E}, - {0xA3B6,0x15}, - {0xA3B7,0xE0}, - {0xA3B8,0x2B}, - {0xA3B9,0xFE}, - {0xA3BA,0x90}, - {0xA3BB,0x0E}, - {0xA3BC,0x14}, - {0xA3BD,0xE0}, - {0xA3BE,0x3A}, - {0xA3BF,0x90}, - {0xA3C0,0x06}, - {0xA3C1,0xE1}, - {0xA3C2,0xF0}, - {0xA3C3,0xA3}, - {0xA3C4,0xCE}, - {0xA3C5,0xF0}, - {0xA3C6,0xC3}, - {0xA3C7,0x90}, - {0xA3C8,0x0E}, - {0xA3C9,0x17}, - {0xA3CA,0xE0}, - {0xA3CB,0x9B}, - {0xA3CC,0xFE}, - {0xA3CD,0x90}, - {0xA3CE,0x0E}, - {0xA3CF,0x16}, - {0xA3D0,0x02}, - {0xA3D1,0x20}, - {0xA3D2,0xD5}, - {0xA3D3,0x90}, - {0xA3d4,0x0E}, - {0xA3d5,0xE4}, - {0xA3d6,0xE0}, - {0xA3d7,0x90}, - {0xA3d8,0x02}, - {0xA3d9,0x66}, - {0xA3da,0xF0}, - {0xA3DB,0x90}, - {0xA3dc,0x0E}, - {0xA3dd,0xE5}, - {0xA3de,0xE0}, - {0xA3df,0x90}, - {0xA3e0,0x02}, - {0xA3e1,0x64}, - {0xA3e2,0xF0}, - {0xA3e3,0x90}, - {0xA3e4,0x0E}, - {0xA3e5,0xE6}, - {0xA3e6,0xE0}, - {0xA3e7,0x90}, - {0xA3e8,0x02}, - {0xA3e9,0x65}, - {0xA3ea,0xF0}, - {0xA3eb,0x02}, - {0xA3ec,0x67}, - {0xA3ed,0xA5}, - {0xA3f0,0x12}, - {0xA3f1,0x47}, - {0xA3f2,0x59}, - {0xA3f3,0x90}, - {0xA3f4,0x00}, - {0xA3f5,0xB5}, - {0xA3f6,0xE0}, - {0xA3f7,0xB4}, - {0xA3f8,0x02}, - {0xA3f9,0x03}, - {0xA3fa,0x12}, - {0xA3fb,0x47}, - {0xA3fc,0x59}, - {0xA3fd,0x02}, - {0xA3fe,0xC5}, - {0xA3ff,0xC3}, - {0xA400,0x90}, - {0xA401,0x00}, - {0xA402,0x3D}, - {0xA403,0xF0}, - {0xA404,0x90}, - {0xA405,0x00}, - {0xA406,0x84}, - {0xA407,0xE0}, - {0xA408,0xFE}, - {0xA409,0x90}, - {0xA40A,0x00}, - {0xA40B,0x3E}, - {0xA40C,0xF0}, - {0xA40D,0xEF}, - {0xA40E,0x70}, - {0xA40F,0x03}, - {0xA410,0xEE}, - {0xA411,0x60}, - {0xA412,0x04}, - {0xA413,0x7F}, - {0xA414,0x01}, - {0xA415,0x80}, - {0xA416,0x02}, - {0xA417,0x7F}, - {0xA418,0x00}, - {0xA419,0x90}, - {0xA41A,0x00}, - {0xA41B,0x3F}, - {0xA41C,0xEF}, - {0xA41D,0xF0}, - {0xA41E,0x02}, - {0xA41F,0x89}, - {0xA420,0xD3}, - {0xA421,0x90}, - {0xA422,0x00}, - {0xA423,0x12}, - {0xA424,0xE0}, - {0xA425,0xFF}, - {0xA426,0x70}, - {0xA427,0x0C}, - {0xA428,0x90}, - {0xA429,0x00}, - {0xA42A,0x46}, - {0xA42B,0xE0}, - {0xA42C,0xC3}, - {0xA42D,0x94}, - {0xA42E,0x07}, - {0xA42F,0x40}, - {0xA430,0x03}, - {0xA431,0x75}, - {0xA432,0x2E}, - {0xA433,0x02}, - {0xA434,0xEF}, - {0xA435,0xB4}, - {0xA436,0x01}, - {0xA437,0x0C}, - {0xA438,0x90}, - {0xA439,0x00}, - {0xA43A,0x66}, - {0xA43B,0xE0}, - {0xA43C,0xC3}, - {0xA43D,0x94}, - {0xA43E,0x07}, - {0xA43F,0x40}, - {0xA440,0x03}, - {0xA441,0x75}, - {0xA442,0x2E}, - {0xA443,0x02}, - {0xA444,0x02}, - {0xA445,0xA7}, - {0xA446,0x9E}, - {0xA447,0xC3}, - {0xA448,0x90}, - {0xA449,0x0B}, - {0xA44A,0x8F}, - {0xA44B,0xE0}, - {0xA44C,0x94}, - {0xA44D,0x00}, - {0xA44E,0x90}, - {0xA44F,0x0B}, - {0xA450,0x8E}, - {0xA451,0xE0}, - {0xA452,0x94}, - {0xA453,0x41}, - {0xA454,0x40}, - {0xA455,0x22}, - {0xA456,0x90}, - {0xA457,0x0B}, - {0xA458,0x91}, - {0xA459,0xE0}, - {0xA45A,0x94}, - {0xA45B,0x00}, - {0xA45C,0x90}, - {0xA45D,0x0B}, - {0xA45E,0x90}, - {0xA45F,0xE0}, - {0xA460,0x94}, - {0xA461,0x41}, - {0xA462,0x40}, - {0xA463,0x14}, - {0xA464,0x90}, - {0xA465,0x0B}, - {0xA466,0x93}, - {0xA467,0xE0}, - {0xA468,0x94}, - {0xA469,0x00}, - {0xA46A,0x90}, - {0xA46B,0x0B}, - {0xA46C,0x92}, - {0xA46D,0xE0}, - {0xA46E,0x94}, - {0xA46F,0x41}, - {0xA470,0x40}, - {0xA471,0x06}, - {0xA472,0x90}, - {0xA473,0x01}, - {0xA474,0xA4}, - {0xA475,0x02}, - {0xA476,0x86}, - {0xA477,0x57}, - {0xA478,0x02}, - {0xA479,0x86}, - {0xA47A,0x5C}, - {0xA500,0xF5}, - {0xA501,0x3B}, - {0xA502,0x90}, - {0xA503,0x06}, - {0xA504,0x6C}, - {0xA505,0xE0}, - {0xA506,0xFF}, - {0xA507,0xE5}, - {0xA508,0x3B}, - {0xA509,0xC3}, - {0xA50A,0x9F}, - {0xA50B,0x40}, - {0xA50C,0x03}, - {0xA50D,0x02}, - {0xA50E,0xF6}, - {0xA50F,0x0E}, - {0xA510,0x90}, - {0xA511,0x0B}, - {0xA512,0xC6}, - {0xA513,0xE0}, - {0xA514,0x14}, - {0xA515,0x60}, - {0xA516,0x3C}, - {0xA517,0x14}, - {0xA518,0x60}, - {0xA519,0x6B}, - {0xA51A,0x24}, - {0xA51B,0x02}, - {0xA51C,0x60}, - {0xA51D,0x03}, - {0xA51E,0x02}, - {0xA51F,0xF5}, - {0xA520,0xB5}, - {0xA521,0x90}, - {0xA522,0x0A}, - {0xA523,0x9A}, - {0xA524,0xE0}, - {0xA525,0xFB}, - {0xA526,0xA3}, - {0xA527,0xE0}, - {0xA528,0xFA}, - {0xA529,0xA3}, - {0xA52A,0xE0}, - {0xA52B,0xF9}, - {0xA52C,0x85}, - {0xA52D,0x3B}, - {0xA52E,0x82}, - {0xA52F,0x75}, - {0xA530,0x83}, - {0xA531,0x00}, - {0xA532,0x12}, - {0xA533,0x0A}, - {0xA534,0xB8}, - {0xA535,0xFF}, - {0xA536,0x74}, - {0xA537,0xAB}, - {0xA538,0x25}, - {0xA539,0x3B}, - {0xA53A,0xF5}, - {0xA53B,0x82}, - {0xA53C,0xE4}, - {0xA53D,0x34}, - {0xA53E,0x0A}, - {0xA53F,0xF5}, - {0xA540,0x83}, - {0xA541,0xE0}, - {0xA542,0xFD}, - {0xA543,0xC3}, - {0xA544,0xEF}, - {0xA545,0x9D}, - {0xA546,0xFE}, - {0xA547,0xE4}, - {0xA548,0x94}, - {0xA549,0x00}, - {0xA54A,0x90}, - {0xA54B,0x0B}, - {0xA54C,0xCA}, - {0xA54D,0xF0}, - {0xA54E,0xA3}, - {0xA54F,0xCE}, - {0xA550,0xF0}, - {0xA551,0x80}, - {0xA552,0x62}, - {0xA553,0x90}, - {0xA554,0x0A}, - {0xA555,0x9A}, - {0xA556,0xE0}, - {0xA557,0xFB}, - {0xA558,0xA3}, - {0xA559,0xE0}, - {0xA55A,0xFA}, - {0xA55B,0xA3}, - {0xA55C,0xE0}, - {0xA55D,0xF9}, - {0xA55E,0x85}, - {0xA55F,0x3B}, - {0xA560,0x82}, - {0xA561,0x75}, - {0xA562,0x83}, - {0xA563,0x00}, - {0xA564,0x12}, - {0xA565,0x0A}, - {0xA566,0xB8}, - {0xA567,0xFF}, - {0xA568,0x74}, - {0xA569,0x9D}, - {0xA56A,0x25}, - {0xA56B,0x3B}, - {0xA56C,0xF5}, - {0xA56D,0x82}, - {0xA56E,0xE4}, - {0xA56F,0x34}, - {0xA570,0x0A}, - {0xA571,0xF5}, - {0xA572,0x83}, - {0xA573,0xE0}, - {0xA574,0xFD}, - {0xA575,0xC3}, - {0xA576,0xEF}, - {0xA577,0x9D}, - {0xA578,0xFE}, - {0xA579,0xE4}, - {0xA57A,0x94}, - {0xA57B,0x00}, - {0xA57C,0x90}, - {0xA57D,0x0B}, - {0xA57E,0xCA}, - {0xA57F,0xF0}, - {0xA580,0xA3}, - {0xA581,0xCE}, - {0xA582,0xF0}, - {0xA583,0x80}, - {0xA584,0x30}, - {0xA585,0x90}, - {0xA586,0x0A}, - {0xA587,0x9A}, - {0xA588,0xE0}, - {0xA589,0xFB}, - {0xA58A,0xA3}, - {0xA58B,0xE0}, - {0xA58C,0xFA}, - {0xA58D,0xA3}, - {0xA58E,0xE0}, - {0xA58F,0xF9}, - {0xA590,0x85}, - {0xA591,0x3B}, - {0xA592,0x82}, - {0xA593,0x75}, - {0xA594,0x83}, - {0xA595,0x00}, - {0xA596,0x12}, - {0xA597,0x0A}, - {0xA598,0xB8}, - {0xA599,0xFF}, - {0xA59A,0x74}, - {0xA59B,0xA4}, - {0xA59C,0x25}, - {0xA59D,0x3B}, - {0xA59E,0xF5}, - {0xA59F,0x82}, - {0xA5A0,0xE4}, - {0xA5A1,0x34}, - {0xA5A2,0x0A}, - {0xA5A3,0xF5}, - {0xA5A4,0x83}, - {0xA5A5,0xE0}, - {0xA5A6,0xFD}, - {0xA5A7,0xC3}, - {0xA5A8,0xEF}, - {0xA5A9,0x9D}, - {0xA5AA,0xFE}, - {0xA5AB,0xE4}, - {0xA5AC,0x94}, - {0xA5AD,0x00}, - {0xA5AE,0x90}, - {0xA5AF,0x0B}, - {0xA5B0,0xCA}, - {0xA5B1,0xF0}, - {0xA5B2,0xA3}, - {0xA5B3,0xCE}, - {0xA5B4,0xF0}, - {0xA5B5,0x90}, - {0xA5B6,0x07}, - {0xA5B7,0x83}, - {0xA5B8,0xE0}, - {0xA5B9,0xFF}, - {0xA5BA,0x7E}, - {0xA5BB,0x00}, - {0xA5BC,0x90}, - {0xA5BD,0x0D}, - {0xA5BE,0xF6}, - {0xA5BF,0xEE}, - {0xA5C0,0xF0}, - {0xA5C1,0xA3}, - {0xA5C2,0xEF}, - {0xA5C3,0xF0}, - {0xA5C4,0x90}, - {0xA5C5,0x0B}, - {0xA5C6,0xCA}, - {0xA5C7,0xE0}, - {0xA5C8,0xFC}, - {0xA5C9,0xA3}, - {0xA5CA,0xE0}, - {0xA5CB,0xFD}, - {0xA5CC,0xD3}, - {0xA5CD,0x9F}, - {0xA5CE,0x74}, - {0xA5CF,0x80}, - {0xA5D0,0xF8}, - {0xA5D1,0xEC}, - {0xA5D2,0x64}, - {0xA5D3,0x80}, - {0xA5D4,0x98}, - {0xA5D5,0x40}, - {0xA5D6,0x0C}, - {0xA5D7,0x90}, - {0xA5D8,0x0B}, - {0xA5D9,0xC8}, - {0xA5DA,0xE0}, - {0xA5DB,0x04}, - {0xA5DC,0xF0}, - {0xA5DD,0xA3}, - {0xA5DE,0xE0}, - {0xA5DF,0x04}, - {0xA5E0,0xF0}, - {0xA5E1,0x80}, - {0xA5E2,0x26}, - {0xA5E3,0x90}, - {0xA5E4,0x0D}, - {0xA5E5,0xF6}, - {0xA5E6,0xE0}, - {0xA5E7,0xFE}, - {0xA5E8,0xA3}, - {0xA5E9,0xE0}, - {0xA5EA,0xFF}, - {0xA5EB,0xC3}, - {0xA5EC,0xE4}, - {0xA5ED,0x9F}, - {0xA5EE,0xFF}, - {0xA5EF,0xE4}, - {0xA5F0,0x9E}, - {0xA5F1,0xFE}, - {0xA5F2,0xC3}, - {0xA5F3,0xED}, - {0xA5F4,0x9F}, - {0xA5F5,0xEE}, - {0xA5F6,0x64}, - {0xA5F7,0x80}, - {0xA5F8,0xF8}, - {0xA5F9,0xEC}, - {0xA5FA,0x64}, - {0xA5FB,0x80}, - {0xA5FC,0x98}, - {0xA5FD,0x50}, - {0xA5FE,0x0A}, - {0xA5FF,0x90}, - {0xA600,0x0B}, - {0xA601,0xC8}, - {0xA602,0xE0}, - {0xA603,0x14}, - {0xA604,0xF0}, - {0xA605,0xA3}, - {0xA606,0xE0}, - {0xA607,0x04}, - {0xA608,0xF0}, - {0xA609,0x05}, - {0xA60A,0x3B}, - {0xA60B,0x02}, - {0xA60C,0xF5}, - {0xA60D,0x02}, - {0xA60E,0x90}, - {0xA60F,0x08}, - {0xA610,0x58}, - {0xA611,0x02}, - {0xA612,0x9D}, - {0xA613,0x50}, - {0x9006,0xBA}, - {0x9007,0x75}, - {0x9008,0x00}, - {0x9009,0x00}, - {0x900A,0x02}, - {0x900D,0x01}, - {0x900E,0xA2}, - {0x900F,0x8F}, - {0x9010,0x00}, - {0x9011,0xCB}, - {0x9012,0x03}, - {0x9016,0xE6}, - {0x9017,0x6B}, - {0x9018,0x02}, - {0x9019,0x6B}, - {0x901A,0x02}, - {0x901D,0x01}, - {0x901E,0xAC}, - {0x901F,0x70}, - {0x9020,0x00}, - {0x9021,0xC5}, - {0x9022,0x03}, - {0x9026,0x9C}, - {0x9027,0x5B}, - {0x9028,0x00}, - {0x9029,0xBF}, - {0x902A,0x02}, - {0x902E,0x60}, - {0x902F,0x1C}, - {0x9030,0x01}, - {0x9031,0x37}, - {0x9032,0x02}, - {0x9035,0x01}, - {0x9036,0xBA}, - {0x9037,0x70}, - {0x9038,0x00}, - {0x9039,0x00}, - {0x903A,0x03}, - {0x903E,0x21}, - {0x903F,0x3F}, - {0x9040,0x02}, - {0x9041,0x40}, - {0x9042,0x02}, - {0x9046,0x21}, - {0x9047,0xEA}, - {0x9048,0x02}, - {0x9049,0x43}, - {0x904A,0x02}, - {0x904E,0xA6}, - {0x904F,0x12}, - {0x9050,0x02}, - {0x9051,0x46}, - {0x9052,0x02}, - {0x9056,0x29}, - {0x9057,0xE3}, - {0x9058,0x02}, - {0x9059,0x49}, - {0x905A,0x02}, - {0x905D,0x01}, - {0x905E,0x9C}, - {0x905F,0x6E}, - {0x9060,0x05}, - {0x9061,0x00}, - {0x9062,0x02}, - {0x9065,0x01}, - {0x9066,0xA2}, - {0x9067,0x66}, - {0x9068,0x02}, - {0x9069,0x35}, - {0x906A,0x02}, - {0x906D,0x01}, - {0x906E,0xB5}, - {0x906F,0xC2}, - {0x9070,0x02}, - {0x9071,0x9B}, - {0x9072,0x02}, - {0x9075,0x01}, - {0x9076,0xA2}, - {0x9077,0xD4}, - {0x9078,0x02}, - {0x9079,0xBE}, - {0x907A,0x02}, - {0x907D,0x01}, - {0x907E,0xB7}, - {0x907F,0xEA}, - {0x9080,0x00}, - {0x9081,0x02}, - {0x9082,0x03}, - {0x9086,0x67}, - {0x9087,0x31}, - {0x9088,0x02}, - {0x9089,0xF7}, - {0x908A,0x02}, - {0x908E,0x66}, - {0x908F,0xED}, - {0x9090,0x03}, - {0x9091,0x1D}, - {0x9092,0x02}, - {0x9096,0x67}, - {0x9097,0x73}, - {0x9098,0x03}, - {0x9099,0xD3}, - {0x909A,0x02}, - {0x909E,0x20}, - {0x909F,0x40}, - {0x90A0,0x03}, - {0x90A1,0x3B}, - {0x90A2,0x02}, - {0x90A6,0xC5}, - {0x90A7,0xC0}, - {0x90A8,0x03}, - {0x90A9,0xF0}, - {0x90AA,0x02}, - {0x90AE,0x41}, - {0x90AF,0xB3}, - {0x90B0,0x00}, - {0x90B1,0xA2}, - {0x90B2,0x02}, - {0x90B6,0x44}, - {0x90B7,0xBA}, - {0x90B8,0x00}, - {0x90B9,0xF0}, - {0x90BA,0x03}, - {0x90BE,0x89}, - {0x90BF,0x99}, - {0x90C0,0x04}, - {0x90C1,0x00}, - {0x90C2,0x02}, - {0x90C6,0xA7}, - {0x90C7,0x91}, - {0x90C8,0x04}, - {0x90C9,0x21}, - {0x90CA,0x02}, - {0x90CE,0x3A}, - {0x90CF,0x51}, - {0x90D0,0x00}, - {0x90D1,0xA2}, - {0x90D2,0x02}, - {0x90D6,0x86}, - {0x90D7,0x54}, - {0x90D8,0x04}, - {0x90D9,0x47}, - {0x90DA,0x02}, - {0x9000,0x01}, - {0xffff,0x00}, // 2013-03-01 end - SensorWaitMs(200), - {0x0009,0x16}, //10 - {0x0085,0x00}, - {0x0040,0x00}, - {0x0016,0x00}, - {0x0046,0x00}, - {0x0041,0x00}, - // {0x00B5,0x02}, - {0x7101,0x44}, - {0x00ED,0x0d}, - {0x00EE,0x1E}, - //{0x00B3,0x80}, - {0x7104,0x00}, - {0x7105,0x80}, - {0x019C,0x4B}, - {0x019D,0x20}, - {0x0129,0x02}, - {0x0130,0x00}, - {0x0083,0x00}, - {0x0084,0x00}, - {0x01A1,0x80}, - {0x01A2,0x80}, - {0x01A3,0x80}, - {0x01A0,0x01}, - {0x0021,0x00}, - {0x0022,0x01}, - - {0x0040,0x00}, //00 - {0x0060,0x00}, - {0x0013,0x00}, - {0x0041,0x00},//00:5M 03:SVGA - - {0x0061,0x00}, - {0x0046,0x02}, - {0x0066,0x02}, - {0x0012,0x00}, - {0x7102,0x09}, - {0x7103,0x00}, - {0x7158,0x00}, - {0x00E8,0x01}, - {0x7000,0x2C}, - {0x5200,0x01}, - {0x7000,0x0C}, - {0x0143,0x5F}, - {0x0144,0x0D}, - {0x02C2,0x00}, - {0x02C3,0xc0}, - {0x015E,0x40}, - {0x015F,0x00}, - {0x0390,0x01}, - {0x0391,0x00}, - {0x0392,0x00}, - {0x03A0,0x14}, - {0x03A1,0x00}, - {0x03A2,0x5A}, - {0x03A3,0xEE}, - {0x03A4,0x69}, - {0x03A5,0x49}, - {0x03A6,0x3E}, - {0x03A7,0x00}, - {0x03A8,0x39}, - {0x03A9,0x33}, - {0x03B0,0x60}, - {0x03B1,0x00}, - {0x03B2,0x5A}, - {0x03B3,0xEE}, - {0x03B4,0x69}, - {0x03B5,0x49}, - {0x03B6,0x3E}, - {0x03B7,0x00}, - {0x03B8,0x3D}, - {0x03B9,0x20}, - {0x03C0,0x10}, - {0x03C1,0x00}, - {0x03C2,0x5A}, - {0x03C3,0xEE}, - {0x03C4,0x69}, - {0x03C5,0x49}, - {0x03C6,0x3A}, - {0x03C7,0x80}, - {0x03D0,0x64}, - {0x03D1,0x00}, - {0x03D2,0x5A}, - {0x03D3,0xEE}, - {0x03D4,0x69}, - {0x03D5,0x49}, - {0x03D6,0x34}, - {0x03D7,0xD1}, - {0x004C,0x0D},//enoch - {0x006C,0x08}, - {0x0350,0x00}, - {0x0351,0x5A}, - {0x0352,0xEE}, - {0x0353,0x69}, - {0x0354,0x49}, - {0x0355,0x39}, - {0x0356,0x6D}, - {0x0357,0x3c}, - {0x0358,0x00}, - {0x0359,0x3C}, - {0x035A,0x5A}, - {0x035B,0xEE}, - {0x035C,0x69}, - {0x035D,0x49}, - {0x035E,0x39}, - {0x035F,0x85}, - {0x0049,0x14}, // PipeSetupBank0 bGammaGain - {0x004A,0x0E}, // PipeSetupBank0 bGammaInterpolationGain - {0x0069,0x14}, // PipeSetupBank1 bGammaGain - {0x006A,0x0E}, // PipeSetupBank1 bGammaInterpolationGain - {0x0090,0x5A}, // GammaGainDamperControl fpX1 {MSB} //24000 - {0x0091,0xEE}, // GammaGainDamperControl fpX1 {LSB} - {0x0092,0x3E}, // GammaGainDamperControl fpY1 {MSB} //1 - {0x0093,0x00}, // GammaGainDamperControl fpY1 {LSB} - {0x0094,0x69}, // GammaGainDamperControl fpX2 {MSB} //3444736 - {0x0095,0x49}, // GammaGainDamperControl fpX2 {LSB} - {0x0096,0x39}, // GammaGainDamperControl fpY2 {MSB} //0.238 - {0x0097,0xCF}, // GammaGainDamperControl fpY2 {LSB} - {0x0098,0x01}, // GammaGainDamperControl fDisable - {0x00A0,0x5A}, // GammaInterpolationDamperControl fpX1 {MSB} //24000 - {0x00A1,0xEE}, // GammaInterpolationDamperControl fpX1 {LSB} - {0x00A2,0x3E}, // GammaInterpolationDamperControl fpY1 {MSB} //1 - {0x00A3,0x00}, // GammaInterpolationDamperControl fpY1 {LSB} - {0x00A4,0x69}, // GammaInterpolationDamperControl fpX2 {MSB} //3444736 - {0x00A5,0x49}, // GammaInterpolationDamperControl fpX2 {LSB} - {0x00A6,0x3B}, // GammaInterpolationDamperControl fpY2 {MSB} //0.4375 - {0x00A7,0x80}, // GammaInterpolationDamperControl fpY2 {LSB} - {0x00A8,0x01}, // GammaInterpolationDamperControl fDisable -#if 0 - {0x0420,0x00}, //new LSC start - 0306 - {0x0421,0x26}, - {0x0422,0xff}, - {0x0423,0x03}, - {0x0424,0x00}, - {0x0425,0x63}, - {0x0426,0x00}, - {0x0427,0x8e}, - {0x0428,0xff}, - {0x0429,0xf3}, - {0x042A,0x00}, - {0x042B,0x26}, - {0x042C,0xff}, - {0x042D,0xc8}, - {0x042E,0xff}, - {0x042F,0x5f}, - {0x0430,0x00}, - {0x0431,0x10}, - {0x0432,0xfe}, - {0x0433,0xcf}, - {0x0434,0x00}, - {0x0435,0xc2}, - {0x0436,0x00}, - {0x0437,0xf2}, - {0x0438,0xff}, - {0x0439,0xd0}, - {0x043A,0x00}, - {0x043B,0xa1}, - {0x043C,0x00}, - {0x043D,0x2f}, - {0x043E,0xfe}, - {0x043F,0xdc}, - {0x0450,0x00}, - {0x0451,0x36}, - {0x0452,0xff}, - {0x0453,0x60}, - {0x0454,0x00}, - {0x0455,0x43}, - {0x0456,0x00}, - {0x0457,0x6b}, - {0x0458,0xff}, - {0x0459,0xdf}, - {0x045A,0x00}, - {0x045B,0x83}, - {0x045C,0xff}, - {0x045D,0xeb}, - {0x045E,0xff}, - {0x045F,0x5f}, - {0x0440,0x00}, - {0x0441,0x36}, - {0x0442,0xff}, - {0x0443,0x3e}, - {0x0444,0x00}, - {0x0445,0x6d}, - {0x0446,0x00}, - {0x0447,0x87}, - {0x0448,0x00}, - {0x0449,0x0f}, - {0x044A,0xff}, - {0x044B,0xd3}, - {0x044C,0x00}, - {0x044D,0x18}, - {0x044E,0xff}, - {0x044F,0x4f}, - {0x0561,0x08}, - {0x0460,0x00}, - {0x0461,0x22}, - {0x0462,0xff}, - {0x0463,0x0a}, - {0x0464,0x00}, - {0x0465,0x63}, - {0x0466,0x00}, - {0x0467,0x8b}, - {0x0468,0xff}, - {0x0469,0xf9}, - {0x046A,0x00}, - {0x046B,0x17}, - {0x046C,0xff}, - {0x046D,0xbd}, - {0x046E,0xff}, - {0x046F,0x65}, - {0x0470,0x00}, - {0x0471,0x15}, - {0x0472,0xfe}, - {0x0473,0xd7}, - {0x0474,0x00}, - {0x0475,0xb6}, - {0x0476,0x00}, - {0x0477,0xe5}, - {0x0478,0xff}, - {0x0479,0xd0}, - {0x047A,0x00}, - {0x047B,0xb2}, - {0x047C,0x00}, - {0x047D,0x2c}, - {0x047E,0xfe}, - {0x047F,0xe6}, - {0x0490,0x00}, - {0x0491,0x2b}, - {0x0492,0xff}, - {0x0493,0x71}, - {0x0494,0x00}, - {0x0495,0x43}, - {0x0496,0x00}, - {0x0497,0x69}, - {0x0498,0xff}, - {0x0499,0xd7}, - {0x049A,0x00}, - {0x049B,0x59}, - {0x049C,0xff}, - {0x049D,0xde}, - {0x049E,0xff}, - {0x049F,0x76}, - {0x0480,0x00}, - {0x0481,0x38}, - {0x0482,0xff}, - {0x0483,0x3a}, - {0x0484,0x00}, - {0x0485,0x6b}, - {0x0486,0x00}, - {0x0487,0x86}, - {0x0488,0x00}, - {0x0489,0x14}, - {0x048A,0xff}, - {0x048B,0xd7}, - {0x048C,0x00}, - {0x048D,0x13}, - {0x048E,0xff}, - {0x048F,0x58}, - {0x0562,0x08}, - {0x04A0,0x00}, - {0x04A1,0x17}, - {0x04A2,0xff}, - {0x04A3,0x2e}, - {0x04A4,0x00}, - {0x04A5,0x5d}, - {0x04A6,0x00}, - {0x04A7,0x7a}, - {0x04A8,0xff}, - {0x04A9,0xf9}, - {0x04AA,0xff}, - {0x04AB,0xc0}, - {0x04AC,0xff}, - {0x04AD,0xc7}, - {0x04AE,0xff}, - {0x04AF,0x7d}, - {0x04B0,0x00}, - {0x04B1,0x13}, - {0x04B2,0xff}, - {0x04B3,0x45}, - {0x04B4,0x00}, - {0x04B5,0x70}, - {0x04B6,0x00}, - {0x04B7,0x96}, - {0x04B8,0xff}, - {0x04B9,0xde}, - {0x04BA,0x00}, - {0x04BB,0x17}, - {0x04BC,0x00}, - {0x04BD,0x23}, - {0x04BE,0xff}, - {0x04BF,0x46}, - {0x04D0,0x00}, - {0x04D1,0x17}, - {0x04D2,0xff}, - {0x04D3,0x99}, - {0x04D4,0x00}, - {0x04D5,0x3d}, - {0x04D6,0x00}, - {0x04D7,0x5f}, - {0x04D8,0xff}, - {0x04D9,0xd1}, - {0x04DA,0xff}, - {0x04DB,0xe2}, - {0x04DC,0xff}, - {0x04DD,0xc6}, - {0x04DE,0xff}, - {0x04DF,0x9c}, - {0x04C0,0x00}, - {0x04C1,0x32}, - {0x04C2,0xff}, - {0x04C3,0x4e}, - {0x04C4,0x00}, - {0x04C5,0x5e}, - {0x04C6,0x00}, - {0x04C7,0x7c}, - {0x04C8,0x00}, - {0x04C9,0x17}, - {0x04CA,0xff}, - {0x04CB,0x9b}, - {0x04CC,0x00}, - {0x04CD,0x06}, - {0x04CE,0xff}, - {0x04CF,0x70}, - {0x0563,0x05}, - {0x04E0,0x00}, - {0x04E1,0x11}, - {0x04E2,0xff}, - {0x04E3,0x20}, - {0x04E4,0x00}, - {0x04E5,0x5f}, - {0x04E6,0x00}, - {0x04E7,0x7b}, - {0x04E8,0x00}, - {0x04E9,0x02}, - {0x04EA,0xff}, - {0x04EB,0xf1}, - {0x04EC,0xff}, - {0x04ED,0xb7}, - {0x04EE,0xff}, - {0x04EF,0x7b}, - {0x04F0,0x00}, - {0x04F1,0x1c}, - {0x04F2,0xff}, - {0x04F3,0x08}, - {0x04F4,0x00}, - {0x04F5,0x7e}, - {0x04F6,0x00}, - {0x04F7,0xac}, - {0x04F8,0xff}, - {0x04F9,0xeb}, - {0x04FA,0x00}, - {0x04FB,0x93}, - {0x04FC,0x00}, - {0x04FD,0x1b}, - {0x04FE,0xff}, - {0x04FF,0x11}, - {0x0510,0xff}, - {0x0511,0xfe}, - {0x0512,0xff}, - {0x0513,0x8e}, - {0x0514,0x00}, - {0x0515,0x4a}, - {0x0516,0x00}, - {0x0517,0x6e}, - {0x0518,0xff}, - {0x0519,0xbb}, - {0x051A,0xff}, - {0x051B,0xcc}, - {0x051C,0xff}, - {0x051D,0x9a}, - {0x051E,0xff}, - {0x051F,0xa2}, - {0x0500,0x00}, - {0x0501,0x30}, - {0x0502,0xff}, - {0x0503,0x36}, - {0x0504,0x00}, - {0x0505,0x5d}, - {0x0506,0x00}, - {0x0507,0x81}, - {0x0508,0x00}, - {0x0509,0x1f}, - {0x050A,0xff}, - {0x050B,0xd4}, - {0x050C,0xff}, - {0x050D,0xfe}, - {0x050E,0xff}, - {0x050F,0x75}, - {0x0564,0x00}, //new LSC end -#else - -{0x0420,0x00}, //C0_GreenRed_X -{0x0421,0x1E}, //C0_GreenRed_X LSB -{0x0422,0xFF}, //C0_GreenRed_Y -{0x0423,0xF3}, //C0_GreenRed_Y LSB -{0x0424,0x00}, //C0_GreenRed_X2 -{0x0425,0x6E}, //C0_GreenRed_X2 LSB -{0x0426,0x00}, //C0_GreenRed_Y2 -{0x0427,0x96}, //C0_GreenRed_Y2 LSB -{0x0428,0x00}, //C0_GreenRed_XY -{0x0429,0x40}, //C0_GreenRed_XY LSB -{0x042A,0x00}, //C0_GreenRed_X2Y -{0x042B,0x3F}, //C0_GreenRed_X2Y LSB -{0x042C,0x00}, //C0_GreenRed_XY2 -{0x042D,0x99}, //C0_GreenRed_XY2 LSB -{0x042E,0xFF}, //C0_GreenRed_X2Y2 -{0x042F,0xCD}, //C0_GreenRed_X2Y2 LSB -{0x0430,0xFF}, //C0_Red_X -{0x0431,0xC1}, //C0_Red_X LSB -{0x0432,0xFF}, //C0_Red_Y -{0x0433,0x8C}, //C0_Red_Y LSB -{0x0434,0x00}, //C0_Red_X2 -{0x0435,0xD1}, //C0_Red_X2 LSB -{0x0436,0x00}, //C0_Red_Y2 -{0x0437,0xF9}, //C0_Red_Y2 LSB -{0x0438,0xFF}, //C0_Red_XY -{0x0439,0xD0}, //C0_Red_XY LSB -{0x043A,0xFF}, //C0_Red_X2Y -{0x043B,0xD4}, //C0_Red_X2Y LSB -{0x043C,0x00}, //C0_Red_XY2 -{0x043D,0x46}, //C0_Red_XY2 LSB -{0x043E,0xFF}, //C0_Red_X2Y2 -{0x043F,0x1F}, //C0_Red_X2Y2 LSB -{0x0440,0x00}, //C0_GreenBlue_X -{0x0441,0x00}, //C0_GreenBlue_X LSB -{0x0442,0xFF}, //C0_GreenBlue_Y -{0x0443,0xEC}, //C0_GreenBlue_Y LSB -{0x0444,0x00}, //C0_GreenBlue_X2 -{0x0445,0x7D}, //C0_GreenBlue_X2 LSB -{0x0446,0x00}, //C0_GreenBlue_Y2 -{0x0447,0x89}, //C0_GreenBlue_Y2 LSB -{0x0448,0x00}, //C0_GreenBlue_XY -{0x0449,0x4A}, //C0_GreenBlue_XY LSB -{0x044A,0x00}, //C0_GreenBlue_X2Y -{0x044B,0x00}, //C0_GreenBlue_X2Y LSB -{0x044C,0x00}, //C0_GreenBlue_XY2 -{0x044D,0x6C}, //C0_GreenBlue_XY2 LSB -{0x044E,0xFF}, //C0_GreenBlue_X2Y2 -{0x044F,0xB5}, //C0_GreenBlue_X2Y2 LSB // C9 -{0x0450,0x00}, //C0_Blue_X -{0x0451,0x03}, //C0_Blue_X LSB -{0x0452,0xFF}, //C0_Blue_Y -{0x0453,0xC8}, //C0_Blue_Y LSB -{0x0454,0x00}, //C0_Blue_X2 -{0x0455,0x5D}, //C0_Blue_X2 LSB -{0x0456,0x00}, //C0_Blue_Y2 -{0x0457,0x7F}, //C0_Blue_Y2 LSB -{0x0458,0xFF}, //C0_Blue_XY -{0x0459,0xD0}, //C0_Blue_XY LSB -{0x045A,0x00}, //C0_Blue_X2Y -{0x045B,0x1A}, //C0_Blue_X2Y LSB -{0x045C,0xFF}, //C0_Blue_XY2 -{0x045D,0xC8}, //C0_Blue_XY2 LSB -{0x045E,0xFF}, //C0_Blue_X2Y2 -{0x045F,0xDA}, //C0_Blue_X2Y2 LSB -{0x0460,0x00}, //C1_GreenRed_X -{0x0461,0x25}, //C1_GreenRed_X LSB -{0x0462,0x00}, //C1_GreenRed_Y -{0x0463,0x00}, //C1_GreenRed_Y LSB -{0x0464,0x00}, //C1_GreenRed_X2 -{0x0465,0x65}, //C1_GreenRed_X2 LSB -{0x0466,0x00}, //C1_GreenRed_Y2 -{0x0467,0x85}, //C1_GreenRed_Y2 LSB -{0x0468,0x00}, //C1_GreenRed_XY -{0x0469,0x41}, //C1_GreenRed_XY LSB -{0x046A,0x00}, //C1_GreenRed_X2Y -{0x046B,0x42}, //C1_GreenRed_X2Y LSB -{0x046C,0x00}, //C1_GreenRed_XY2 -{0x046D,0x91}, //C1_GreenRed_XY2 LSB -{0x046E,0xFF}, //C1_GreenRed_X2Y2 -{0x046F,0xDA}, //C1_GreenRed_X2Y2 LSB // F0 -{0x0470,0xFF}, //C1_Red_X -{0x0471,0xD7}, //C1_Red_X LSB -{0x0472,0xFF}, //C1_Red_Y -{0x0473,0xA0}, //C1_Red_Y LSB -{0x0474,0x00}, //C1_Red_X2 -{0x0475,0x8C}, //C1_Red_X2 LSB -{0x0476,0x00}, //C1_Red_Y2 -{0x0477,0xA5}, //C1_Red_Y2 LSB -{0x0478,0xFF}, //C1_Red_XY -{0x0479,0xD6}, //C1_Red_XY LSB -{0x047A,0xFF}, //C1_Red_X2Y -{0x047B,0xDA}, //C1_Red_X2Y LSB -{0x047C,0x00}, //C1_Red_XY2 -{0x047D,0x58}, //C1_Red_XY2 LSB -{0x047E,0xFF}, //C1_Red_X2Y2 -{0x047F,0xC4}, //C1_Red_X2Y2 LSB -{0x0480,0x00}, //C1_GreenBlue_X -{0x0481,0x04}, //C1_GreenBlue_X LSB -{0x0482,0xFF}, //C1_GreenBlue_Y -{0x0483,0xFA}, //C1_GreenBlue_Y LSB -{0x0484,0x00}, //C1_GreenBlue_X2 -{0x0485,0x70}, //C1_GreenBlue_X2 LSB -{0x0486,0x00}, //C1_GreenBlue_Y2 -{0x0487,0x7B}, //C1_GreenBlue_Y2 LSB -{0x0488,0x00}, //C1_GreenBlue_XY -{0x0489,0x4E}, //C1_GreenBlue_XY LSB -{0x048A,0x00}, //C1_GreenBlue_X2Y -{0x048B,0x00}, //C1_GreenBlue_X2Y LSB -{0x048C,0x00}, //C1_GreenBlue_XY2 -{0x048D,0x8F}, //C1_GreenBlue_XY2 LSB -{0x048E,0xFF}, //C1_GreenBlue_X2Y2 -{0x048F,0xEC}, //C1_GreenBlue_X2Y2 LSB -{0x0490,0x00}, //C1_Blue_X -{0x0491,0x08}, //C1_Blue_X LSB -{0x0492,0xFF}, //C1_Blue_Y -{0x0493,0xD0}, //C1_Blue_Y LSB -{0x0494,0x00}, //C1_Blue_X2 -{0x0495,0x55}, //C1_Blue_X2 LSB -{0x0496,0x00}, //C1_Blue_Y2 -{0x0497,0x70}, //C1_Blue_Y2 LSB -{0x0498,0xFF}, //C1_Blue_XY -{0x0499,0xC4}, //C1_Blue_XY LSB -{0x049A,0x00}, //C1_Blue_X2Y -{0x049B,0x03}, //C1_Blue_X2Y LSB -{0x049C,0xFF}, //C1_Blue_XY2 -{0x049D,0xD2}, //C1_Blue_XY2 LSB -{0x049E,0x00}, //C1_Blue_X2Y2 -{0x049F,0x04}, //C1_Blue_X2Y2 LSB -{0x04A0,0x00}, //C2_GreenRed_X -{0x04A1,0x28}, //C2_GreenRed_X LSB -{0x04A2,0xFF}, //C2_GreenRed_Y -{0x04A3,0xFA}, //C2_GreenRed_Y LSB -{0x04A4,0x00}, //C2_GreenRed_X2 -{0x04A5,0x69}, //C2_GreenRed_X2 LSB -{0x04A6,0x00}, //C2_GreenRed_Y2 -{0x04A7,0x88}, //C2_GreenRed_Y2 LSB -{0x04A8,0x00}, //C2_GreenRed_XY -{0x04A9,0x47}, //C2_GreenRed_XY LSB -{0x04AA,0x00}, //C2_GreenRed_X2Y -{0x04AB,0x46}, //C2_GreenRed_X2Y LSB -{0x04AC,0x00}, //C2_GreenRed_XY2 -{0x04AD,0xA2}, //C2_GreenRed_XY2 LSB -{0x04AE,0xFF}, //C2_GreenRed_X2Y2 -{0x04AF,0xCF}, //C2_GreenRed_X2Y2 LSB // EA -{0x04B0,0xFF}, //C2_Red_X -{0x04B1,0xDC}, //C2_Red_X LSB -{0x04B2,0xFF}, //C2_Red_Y -{0x04B3,0xA4}, //C2_Red_Y LSB -{0x04B4,0x00}, //C2_Red_X2 -{0x04B5,0x93}, //C2_Red_X2 LSB -{0x04B6,0x00}, //C2_Red_Y2 -{0x04B7,0xB2}, //C2_Red_Y2 LSB -{0x04B8,0xFF}, //C2_Red_XY -{0x04B9,0xD8}, //C2_Red_XY LSB -{0x04BA,0xFF}, //C2_Red_X2Y -{0x04BB,0xCD}, //C2_Red_X2Y LSB -{0x04BC,0x00}, //C2_Red_XY2 -{0x04BD,0x48}, //C2_Red_XY2 LSB -{0x04BE,0xFF}, //C2_Red_X2Y2 -{0x04BF,0x9B}, //C2_Red_X2Y2 LSB -{0x04C0,0x00}, //C2_GreenBlue_X -{0x04C1,0x08}, //C2_GreenBlue_X LSB -{0x04C2,0x00}, //C2_GreenBlue_Y -{0x04C3,0x00}, //C2_GreenBlue_Y LSB -{0x04C4,0x00}, //C2_GreenBlue_X2 -{0x04C5,0x73}, //C2_GreenBlue_X2 LSB -{0x04C6,0x00}, //C2_GreenBlue_Y2 -{0x04C7,0x80}, //C2_GreenBlue_Y2 LSB -{0x04C8,0x00}, //C2_GreenBlue_XY -{0x04C9,0x4F}, //C2_GreenBlue_XY LSB -{0x04CA,0xFF}, //C2_GreenBlue_X2Y -{0x04CB,0xEF}, //C2_GreenBlue_X2Y LSB -{0x04CC,0x00}, //C2_GreenBlue_XY2 -{0x04CD,0x89}, //C2_GreenBlue_XY2 LSB -{0x04CE,0xFF}, //C2_GreenBlue_X2Y2 -{0x04CF,0xE2}, //C2_GreenBlue_X2Y2 LSB -{0x04D0,0x00}, //C2_Blue_X -{0x04D1,0x0C}, //C2_Blue_X LSB -{0x04D2,0xFF}, //C2_Blue_Y -{0x04D3,0xCE}, //C2_Blue_Y LSB -{0x04D4,0x00}, //C2_Blue_X2 -{0x04D5,0x57}, //C2_Blue_X2 LSB -{0x04D6,0x00}, //C2_Blue_Y2 -{0x04D7,0x72}, //C2_Blue_Y2 LSB -{0x04D8,0xFF}, //C2_Blue_XY -{0x04D9,0xC4}, //C2_Blue_XY LSB -{0x04DA,0x00}, //C2_Blue_X2Y -{0x04DB,0x09}, //C2_Blue_X2Y LSB -{0x04DC,0xFF}, //C2_Blue_XY2 -{0x04DD,0xD2}, //C2_Blue_XY2 LSB -{0x04DE,0xFF}, //C2_Blue_X2Y2 -{0x04DF,0xFC}, //C2_Blue_X2Y2 LSB -{0x04E0,0x00}, //C3_GreenRed_X -{0x04E1,0x2C}, //C3_GreenRed_X LSB -{0x04E2,0xFF}, //C3_GreenRed_Y -{0x04E3,0xFB}, //C3_GreenRed_Y LSB -{0x04E4,0x00}, //C3_GreenRed_X2 -{0x04E5,0x69}, //C3_GreenRed_X2 LSB -{0x04E6,0x00}, //C3_GreenRed_Y2 -{0x04E7,0x87}, //C3_GreenRed_Y2 LSB -{0x04E8,0x00}, //C3_GreenRed_XY -{0x04E9,0x4A}, //C3_GreenRed_XY LSB -{0x04EA,0x00}, //C3_GreenRed_X2Y -{0x04EB,0x56}, //C3_GreenRed_X2Y LSB -{0x04EC,0x00}, //C3_GreenRed_XY2 -{0x04ED,0x9A}, //C3_GreenRed_XY2 LSB -{0x04EE,0xFF}, //C3_GreenRed_X2Y2 -{0x04EF,0xBE}, //C3_GreenRed_X2Y2 LSB // DC -{0x04F0,0xFF}, //C3_Red_X -{0x04F1,0xEB}, //C3_Red_X LSB -{0x04F2,0xFF}, //C3_Red_Y -{0x04F3,0x9B}, //C3_Red_Y LSB -{0x04F4,0x00}, //C3_Red_X2 -{0x04F5,0xA5}, //C3_Red_X2 LSB -{0x04F6,0x00}, //C3_Red_Y2 -{0x04F7,0xCC}, //C3_Red_Y2 LSB -{0x04F8,0xFF}, //C3_Red_XY -{0x04F9,0xE1}, //C3_Red_XY LSB -{0x04FA,0xFF}, //C3_Red_X2Y -{0x04FB,0xD9}, //C3_Red_X2Y LSB -{0x04FC,0x00}, //C3_Red_XY2 -{0x04FD,0x6A}, //C3_Red_XY2 LSB -{0x04FE,0xFF}, //C3_Red_X2Y2 -{0x04FF,0x5E}, //C3_Red_X2Y2 LSB -{0x0500,0x00}, //C3_GreenBlue_X -{0x0501,0x06}, //C3_GreenBlue_X LSB -{0x0502,0xFF}, //C3_GreenBlue_Y -{0x0503,0xFC}, //C3_GreenBlue_Y LSB -{0x0504,0x00}, //C3_GreenBlue_X2 -{0x0505,0x6F}, //C3_GreenBlue_X2 LSB -{0x0506,0x00}, //C3_GreenBlue_Y2 -{0x0507,0x83}, //C3_GreenBlue_Y2 LSB -{0x0508,0x00}, //C3_GreenBlue_XY -{0x0509,0x5A}, //C3_GreenBlue_XY LSB -{0x050A,0xFF}, //C3_GreenBlue_X2Y -{0x050B,0xF7}, //C3_GreenBlue_X2Y LSB -{0x050C,0x00}, //C3_GreenBlue_XY2 -{0x050D,0x80}, //C3_GreenBlue_XY2 LSB -{0x050E,0xFF}, //C3_GreenBlue_X2Y2 -{0x050F,0xD3}, //C3_GreenBlue_X2Y2 LSB -{0x0510,0x00}, //C3_Blue_X -{0x0511,0x0B}, //C3_Blue_X LSB -{0x0512,0xFF}, //C3_Blue_Y -{0x0513,0xCE}, //C3_Blue_Y LSB -{0x0514,0x00}, //C3_Blue_X2 -{0x0515,0x58}, //C3_Blue_X2 LSB -{0x0516,0x00}, //C3_Blue_Y2 -{0x0517,0x73}, //C3_Blue_Y2 LSB -{0x0518,0xFF}, //C3_Blue_XY -{0x0519,0xBE}, //C3_Blue_XY LSB -{0x051A,0xFF}, //C3_Blue_X2Y -{0x051B,0xFB}, //C3_Blue_X2Y LSB -{0x051C,0xFF}, //C3_Blue_XY2 -{0x051D,0xD2}, //C3_Blue_XY2 LSB -{0x051E,0xFF}, //C3_Blue_X2Y2 -{0x051F,0xFA}, //C3_Blue_X2Y2 LSB -{0x0561,0x05}, //C0 Unity -{0x0562,0x01}, //C1 Unity -{0x0563,0x01}, //C2 Unity -{0x0564,0x09}, //C3 Unity - - -#endif - - {0x0324,0x39}, - {0x0325,0xAE}, - {0x0326,0x3A}, - {0x0327,0x29}, - {0x0328,0x3B}, - {0x0329,0x0A}, - {0x032A,0x3B}, - {0x032B,0x62}, - {0x0320,0x01}, - {0x0321,0x04}, - {0x0322,0x01}, - {0x0323,0x01}, - {0x0330,0x01}, - {0x0384,0x00}, - {0x0337,0x01}, - {0x03EC,0x39}, - {0x03ED,0x85}, - {0x03FC,0x3A}, - {0x03FD,0x14}, - {0x040C,0x3A}, - {0x040D,0xF6}, - {0x041C,0x3B}, - {0x041D,0x9A}, - {0x03E0,0xB6}, - {0x03E1,0x04}, - {0x03E2,0xBB}, - {0x03E3,0xE9}, - {0x03E4,0xBC}, - {0x03E5,0x70}, - {0x03E6,0x37}, - {0x03E7,0x02}, - {0x03E8,0xBC}, - {0x03E9,0x00}, - {0x03EA,0xBF}, - {0x03EB,0x12}, - {0x03F0,0xBA}, - {0x03F1,0x7B}, - {0x03F2,0xBA}, - {0x03F3,0x83}, - {0x03F4,0xBB}, - {0x03F5,0xBC}, - {0x03F6,0x38}, - {0x03F7,0x2D}, - {0x03F8,0xBB}, - {0x03F9,0x23}, - {0x03FA,0xBD}, - {0x03FB,0xAC}, - {0x0400,0xBE}, - {0x0401,0x96}, - {0x0402,0xB9}, - {0x0403,0xBE}, - {0x0404,0xBB}, - {0x0405,0x57}, - {0x0406,0x3A}, - {0x0407,0xBB}, - {0x0408,0xB3}, - {0x0409,0x17}, - {0x040A,0xBE}, - {0x040B,0x66}, - {0x0410,0xBB}, - {0x0411,0x2A}, - {0x0412,0xBA}, - {0x0413,0x00}, - {0x0414,0xBB}, - {0x0415,0x10}, - {0x0416,0xB8}, - {0x0417,0xCD}, - {0x0418,0xB7}, - {0x0419,0x5C}, - {0x041A,0xBB}, - {0x041B,0x6C}, - {0x01f8,0x3c}, - {0x01f9,0x00}, - {0x01fa,0x00}, - {0x02a2,0x3e}, - {0x02a3,0x00}, - {0x02a4,0x3e}, - {0x02a5,0x00}, - {0x02a6,0x3e}, - {0x02a7,0x00}, - {0x02a8,0x3e}, - {0x02a9,0x00}, - {0x056c,0x42}, - {0x056d,0x00}, - {0x056e,0x42}, - {0x056f,0x00}, - {0x0570,0x42}, - {0x0571,0x00}, - {0x0572,0x42}, - {0x0573,0x10}, - {0x0081,0x64}, //6E->55 - {0x0588,0x00}, - {0x0589,0x5A}, - {0x058A,0xEE}, - {0x058B,0x69}, - {0x058C,0x49}, - {0x058D,0x3D}, - {0x058E,0x3D}, - {0x0080,0x64}, - {0x0082,0x5a}, - // {0x0010,0x01}, - - // SensorWaitMs(200), - - {0x4708,0x00}, - {0x4709,0x00}, - {0x4710,0x00}, - {0x4711,0x00}, - //AF intial setting - {0x0659,0x01},//03-06 new af @ vcm - {0x065A,0x00}, - {0x06C9,0x01}, - {0x06CD,0x01}, - {0x06CE,0xBD}, - {0x06CF,0x00}, - {0x06D0,0x60}, - {0x06D1,0x02}, - {0x06D2,0x30}, - {0x06D3,0xD4}, - {0x06D4,0x01}, - {0x06D5,0x01}, - {0x06D6,0xBD},//60->BC->66 - {0x06D7,0x00}, - {0x06D8,0x60},//93 - {0x06D9,0x00}, - {0x06DA,0x60},//93 - {0x06DB,0x59}, - {0x06DC,0x0d}, - {0x0730,0x00}, - {0x0731,0x00}, - {0x0732,0x03}, - {0x0733,0xFF}, - {0x0734,0x03}, - {0x0735,0x70}, - {0x0755,0x01}, - {0x0756,0x00}, - {0x075A,0x00}, - {0x075B,0x01}, - {0x075E,0x00}, - {0x0764,0x01}, - {0x0766,0x01}, - {0x0768,0x01}, - {0x076A,0x00}, - {0x0758,0x01}, - {0x075C,0x01}, - {0x0770,0x98}, - {0x0771,0x19}, - {0x0772,0x1B}, - {0x0774,0x01}, - {0x0775,0x4a}, - {0x0777,0x00}, - {0x0778,0x45}, - {0x0779,0x00}, - {0x077A,0x02}, - {0x077D,0x01}, - {0x077E,0x03}, - {0x0783,0x10}, - {0x0785,0x14}, - {0x0788,0x04}, - {0x0846,0x06}, - {0x0847,0x05}, - {0xC41A,0x05}, - {0xC423,0x11}, - {0xC427,0x11}, - {0x300B,0x09}, - - {0x7000,0x08}, - {0x5200,0x09}, - {0x00B2,0x50}, - {0x00B3,0x80}, - {0x00B5,0x02}, - {0x0030,0x11}, - // {0x0040,0x01}, //AB2 - // {0x0041,0x03}, //SVGA mode - {0x0040,0x01}, - {0x0041,0x0A}, - {0x0042,0x05}, - {0x0043,0x00}, - {0x0044,0x03}, - {0x0045,0xC0}, - - {0x0010,0x01}, - SensorWaitMs(150), - SensorEnd -}; -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={ - - // {0x0010,0x02}, - // SensorWaitMs(100), - //{0x00B5, 0x02}, - //{0x0030, 0x11}, - {0x0040, 0x00}, - {0x0041, 0x00}, - {0x004c, 0x12}, - //{0x0010, 0x01}, - // SensorWaitMs(150), - - SensorEnd -}; -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] ={ - SensorEnd -}; -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data[] = -{ - - // {0x0010,0x02}, - // SensorWaitMs(100), - // {0x00B5, 0x01}, - // {0x0030, 0x12}, - {0x0040,0x01}, - {0x0041,0x0A}, - {0x0042,0x05}, - {0x0043,0x00}, - {0x0044,0x03}, - {0x0045,0xC0}, - {0x004c,0x0e}, - //{0x00ed,0x0d}, - //{0x0010, 0x01}, - // SensorWaitMs(150), - - SensorEnd -}; -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[]={ - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[]={ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_softreset_data[]={ - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[]={ - SensorRegVal(0x0000,0), - SensorRegVal(0x0001,0), - SensorEnd -}; -/* -* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx -*/ -static struct rk_sensor_reg sensor_WhiteB_Auto[]= -{ - {0x01A0,0x01}, - SensorEnd -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[]= -{ - {0x01A0,0x04}, - SensorEnd -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[]= -{ - {0x01A0,0x05}, - SensorEnd -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]= -{ - {0x01A0,0x07}, - SensorEnd - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]= -{ - {0x01A0,0x08}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[]= -{ - // Brightness -2 - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[]= -{ - // Brightness -1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[]= -{ - // Brightness 0 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[]= -{ - // Brightness +1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[]= -{ - // Brightness +2 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[]= -{ - // Brightness +3 - - SensorEnd -}; -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = -{ - {0x0380,0x0}, - {0x0381,0x0}, - {0x0382,0x0}, - {0x0384,0x0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = -{ - {0x0380,0x0}, - {0x0381,0x0}, - {0x0382,0x0}, - {0x0384,0x5}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = -{ - {0x0380,0x0}, - {0x0381,0x0}, - {0x0382,0x0}, - {0x0384,0x6}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Negative[] = -{ - //Negative - {0x0380,0x0}, - {0x0381,0x0}, - {0x0382,0x0}, - {0x0384,0x8}, - SensorEnd -}; -static struct rk_sensor_reg sensor_Effect_Bluish[] = -{ - // Bluish - {0x0380,0x0}, - {0x0381,0x0}, - {0x0382,0x0}, - {0x0384,0x4}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = -{ - // Greenish - {0x0380,0x0}, - {0x0381,0x0}, - {0x0382,0x0}, - {0x0384,0x3}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; - -static struct rk_sensor_reg sensor_Exposure0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure2[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure3[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure4[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure5[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure6[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; - -static struct rk_sensor_reg sensor_Saturation0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -static struct rk_sensor_reg sensor_Contrast0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast2[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast3[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast4[]= -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Contrast5[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast6[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; -static struct rk_sensor_reg sensor_SceneAuto[] = -{ - {0x3a00, 0x78}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -static struct rk_sensor_reg sensor_Zoom0[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Zoom3[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; - -/* -* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu -*/ -static struct v4l2_querymenu sensor_menus[] = -{ -}; -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = -{ -}; - -//MUST define the current used format as the first item -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {MEDIA_BUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG} -}; - - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ - - -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ - -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - SENSOR_DG("%s",__FUNCTION__); - return 0; -} -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - SENSOR_DG("%s",__FUNCTION__); - return 0; -} -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - //struct generic_sensor*sensor = to_generic_sensor(client); - - - return 0; -} -static int sensor_softrest_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - return 0; -} - -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh (struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - struct soc_camera_subdev_desc *ssdd = client->dev.platform_data; - struct soc_camera_device *icd = ssdd->socdev; - struct generic_sensor *gsensor = to_generic_sensor(client); - - if (capture) { - generic_sensor_af_workqueue_set(icd, WqCmd_af_special_pos,0,true); - } else { - if (gsensor->sensor_focus.focus_mode == V4L2_CID_FOCUS_AUTO) { - generic_sensor_af_workqueue_set(icd, WqCmd_af_close,0,false); - } else if (gsensor->sensor_focus.focus_mode == V4L2_CID_FOCUS_CONTINUOUS) { - generic_sensor_af_workqueue_set(icd,WqCmd_af_continues,0,false); - } - } - return 0; -} -static int sensor_try_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf) -{ - struct soc_camera_subdev_desc *ssdd = client->dev.platform_data; - struct soc_camera_device *icd = ssdd->socdev; - struct generic_sensor *gsensor = to_generic_sensor(client); - - if (gsensor->sensor_focus.focus_mode == V4L2_CID_FOCUS_CONTINUOUS) { - generic_sensor_af_workqueue_set(icd,WqCmd_af_continues_pause,0,true); - } - return 0; -} - -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("Suspend"); - - } else { - SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n",pm_msg.event); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - - SENSOR_DG("Resume"); - - return 0; - -} -static int sensor_mirror_cb (struct i2c_client *client, int mirror) -{ - - SENSOR_DG("mirror: %d",mirror); - - return 0; -} -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_mirror_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_mirror failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_mirror success, value:0x%x",ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - SENSOR_DG("flip: %d",flip); - - return 0; -} -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_flip_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_flip failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_flip success, value:0x%x",ext_ctrl->value); - return 0; -} -/* -* the functions are focus callbacks -*/ -static int sensor_focus_af_single_usr_cb(struct i2c_client *client); - -static int sensor_focus_init_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client) -{ - int ret = 0; - -#ifdef SENSOR_AF_CONFIG //xhh - struct generic_sensor *sensor = to_generic_sensor(client); - struct specific_sensor *ssensor = to_specific_sensor(sensor); - - sensor_write(client,0x0751,0x00);//add by jink 20141127 - ret |= sensor_write(client,AF_MODES_REG,0x03); - msleep(200); //add by jink 20141127 - ret |= sensor_write(client,AF_AUTOCMDS_REG,0x01); - msleep(200);//add by jink 20141127 - ret |= sensor_write(client,AF_AUTOCMDS_REG,0x02); - msleep(300); - - // do { - // msleep(20); - // sensor_read(client,AF_FINISHCHK_REG,&state); - // cnt++; - // }while ((state != 1) && (cnt<100)); - - // if (state == 1) { - sensor_read(client, AF_LENSPOS_REG_H,(char*)&ssensor->parameter.af_pos[0]); - sensor_read(client, AF_LENSPOS_REG_L,(char*)&ssensor->parameter.af_pos[1]); - // } - - //SENSOR_DG("single focus, state: %d cnt: %d",state,cnt); -#endif -//sensor_af_single_end: - return ret; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client) -{ - - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos) -{ - struct generic_sensor *sensor = to_generic_sensor(client); - struct specific_sensor *ssensor = to_specific_sensor(sensor); - #ifdef SENSOR_AF_CONFIG //xhh - sensor_write(client,0x070A, 0x00); - sensor_write(client,0x0734, ssensor->parameter.af_pos[0]& 0xFF); - sensor_write(client,0x0735, ssensor->parameter.af_pos[1] & 0xFF); - sensor_write(client,0x070C, 0x00); - mdelay(100); - sensor_write(client,0x070C, 0x05); -#endif - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client) -{ - int ret; - #ifdef SENSOR_AF_CONFIG //xhh - sensor_write(client,0x0751,0x00);//add by jink 20141127 - ret = sensor_write(client, AF_MODES_REG, 0x01); - #endif -//sensor_af_const_end: - return ret; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - int ret = 0; - #ifdef SENSOR_AF_CONFIG //xhh - char status = 0; - struct generic_sensor *sensor = to_generic_sensor(client); - struct specific_sensor *ssensor = to_specific_sensor(sensor); - - sensor_read(client, 0x07ae, &status); //add by jink 20141127 - - if (status == 1) { - sensor_read(client, AF_LENSPOS_REG_H,(char*)&ssensor->parameter.af_pos[0]); - sensor_read(client, AF_LENSPOS_REG_L,(char*)&ssensor->parameter.af_pos[1]); - } else { - sensor_focus_af_single_usr_cb(client); - } - #endif - return ret; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client) -{ - int ret =0; - #ifdef SENSOR_AF_CONFIG //xhh - sensor_write(client,0x0751,0x01);//add by jink 20141127 - /* - ret |= sensor_write(client,0x070A, 0x00); - ret |= sensor_write(client,0x0700, 0x03); - ret |= sensor_write(client,0x0701, 0xFF); - ret |= sensor_write(client,0x070C, 0x00); - ret |= sensor_write(client,0x070C, 0x07); - */ - #endif - SENSOR_DG("%s",__FUNCTION__); - return ret; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos) -{ - int ret = 0; - #ifdef SENSOR_AF_CONFIG //xhh - int xstart,ystart; - - *zone_tm_pos += 1000; - *(zone_tm_pos+1) += 1000; - *(zone_tm_pos+2) += 1000; - *(zone_tm_pos+3) += 1000; - - xstart = ((*zone_tm_pos + *(zone_tm_pos+2))>>1)*800/2000; - ystart = ((*(zone_tm_pos+1) + *(zone_tm_pos+3))>>1)*600/2000; - - if (xstart>0xa0) { - xstart -= 0xa0; - } else { - xstart = 0; - } - - if (ystart>0xa0) { - ystart -= 0xa0; - } else { - ystart = 0; - } - - ret |= sensor_write(client, AF_ZONE0_WEIGHT,0x01); - ret |= sensor_write(client, AF_ZONE1_WEIGHT,0x00); - ret |= sensor_write(client, AF_ZONE2_WEIGHT,0x00); - ret |= sensor_write(client, AF_ZONE3_WEIGHT,0x00); - ret |= sensor_write(client, AF_ZONE4_WEIGHT,0x00); - ret |= sensor_write(client, AF_ZONE5_WEIGHT,0x00); - ret |= sensor_write(client, AF_ZONE6_WEIGHT,0x00); - ret |= sensor_write(client, FACE_LC,0x01); - - ret |= sensor_write(client, FACE_START_XH, ((xstart&0xff00)>>8)); - ret |= sensor_write(client, FACE_START_XL, xstart&0xff); - ret |= sensor_write(client, FACE_START_YH, ((ystart&0xff00)>>8)); - ret |= sensor_write(client, FACE_START_YL, ystart&0xff); - - ret |= sensor_write(client, FACE_SIZE_XH, 0x01); - ret |= sensor_write(client, FACE_SIZE_XL, 0x40); - ret |= sensor_write(client, FACE_SIZE_YH, 0x01); - ret |= sensor_write(client, FACE_SIZE_YL, 0x40); - #endif -//sensor_af_zone_end: - return ret; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client,int on){ - return 0; -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor* spsensor,struct soc_camera_device *icd) -{ - return; -} - -/* -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); - - - - diff --git a/drivers/media/video/hm5065.h b/drivers/media/video/hm5065.h deleted file mode 100644 index 9cc20a727c51..000000000000 --- a/drivers/media/video/hm5065.h +++ /dev/null @@ -1,12 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __HM5065_H__ -#define __HM5065_H__ - - -#define SEQUENCE_INIT 0x00 -#define SEQUENCE_NORMAL 0x01 - -#define SEQUENCE_PROPERTY 0xFFFD -#define SEQUENCE_WAIT_MS 0xFFFE -#define SEQUENCE_END 0xFFFC -#endif diff --git a/drivers/media/video/hm5065_old.c b/drivers/media/video/hm5065_old.c deleted file mode 100755 index ac0017a30944..000000000000 --- a/drivers/media/video/hm5065_old.c +++ /dev/null @@ -1,5870 +0,0 @@ -/* - * Driver for HM5065 CMOS Image Sensor from Himax - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "hm5065.h" -//#include -struct reginfo -{ - u16 reg; - u8 val; -}; -static int debug=1; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_HM5065 -#define SENSOR_V4L2_IDENT V4L2_IDENT_HM5065 -#define SENSOR_ID 0x039E -#define SENSOR_MIN_WIDTH 176 -#define SENSOR_MIN_HEIGHT 144 -#define SENSOR_MAX_WIDTH 2592 -#define SENSOR_MAX_HEIGHT 1944 -#define SENSOR_INIT_WIDTH 800 //640/* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 600 //480 -#define SENSOR_INIT_WINSEQADR sensor_svga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_YUYV8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 1 -#define CONFIG_SENSOR_Contrast 1 -#define CONFIG_SENSOR_Saturation 1 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 1 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 1 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 -#define CONFIG_SENSOR_Focus 1 - -#define CONFIG_SENSOR_I2C_SPEED 100000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define CONFIG_SENSOR_WRITE_REGS 1 -#define WRITE_REGS_NUM 3 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\ - SOCAM_HSYNC_ACTIVE_HIGH| SOCAM_VSYNC_ACTIVE_LOW |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) - -#if CONFIG_SENSOR_Focus -/*#define SENSOR_AF_MODE_INFINITY 0 -#define SENSOR_AF_MODE_MACRO 1 -#define SENSOR_AF_MODE_FIXED 2 -#define SENSOR_AF_MODE_AUTO 3 -#define SENSOR_AF_MODE_CONTINUOUS 4 -#define SENSOR_AF_MODE_CLOSE 5*/ -#define SENSOR_AF_MODE_AUTO 0 -#define SENSOR_AF_MODE_CLOSE 1 -#define SENSOR_AF_MODE_CONTINUOUS 2 -#endif - -#if CONFIG_SENSOR_Focus -/* hm5065 VCM Command and Status Registers */ -#define AF_TARGETPOS_REG_H 0x0700 -#define AF_TARGETPOS_REG_L 0x0701 - -#define AF_MODES_REG 0x070A -#define AF_AUTOCMDS_REG 0x070b -#define AF_LENSPOS_REG_H 0x06F0 -#define AF_LENSPOS_REG_L 0x06F1 -#define AF_MANUCMDS_REG 0x070c -#define AF_FINISHCHK_REG 0x07ae //[0]: false [1] : true - -#define FACE_LC 0x0714 //[0] : focus , [1] : AE “„Ó -#define FACE_START_XH 0x0715 -#define FACE_START_XL 0x0716 -#define FACE_SIZE_XH 0x0717 -#define FACE_SIZE_XL 0x0718 -#define FACE_START_YH 0x0719 -#define FACE_START_YL 0x071A -#define FACE_SIZE_YH 0x071B -#define FACE_SIZE_YL 0x071C - - -#define AF_ZONE0_WEIGHT 0x0808 -#define AF_ZONE1_WEIGHT 0x0809 -#define AF_ZONE2_WEIGHT 0x080A -#define AF_ZONE3_WEIGHT 0x080B -#define AF_ZONE4_WEIGHT 0x080C -#define AF_ZONE5_WEIGHT 0x080D -#define AF_ZONE6_WEIGHT 0x080E - -#endif - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); - -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_HM5065_USER_DEFINED_SERIES -#include "hm5065_user_series.c" -#else - - -static struct reginfo sensor_init_data[] = -{ -#if 1 - {0xffff,0x01}, // 2013-03-01 Start new patch - {0x9000,0x03}, - {0xA000,0x90}, - {0xA001,0x0C}, - {0xA002,0x56}, - {0xA003,0xE0}, - {0xA004,0xFE}, - {0xA005,0xA3}, - {0xA006,0xE0}, - {0xA007,0xFF}, - {0xA008,0x12}, - {0xA009,0x42}, - {0xA00A,0x85}, - {0xA00B,0x90}, - {0xA00C,0x01}, - {0xA00D,0xB7}, - {0xA00E,0xEE}, - {0xA00F,0xF0}, - {0xA010,0xFC}, - {0xA011,0xA3}, - {0xA012,0xEF}, - {0xA013,0xF0}, - {0xA014,0xFD}, - {0xA015,0x90}, - {0xA016,0x06}, - {0xA017,0x05}, - {0xA018,0xE0}, - {0xA019,0x75}, - {0xA01A,0xF0}, - {0xA01B,0x02}, - {0xA01C,0xA4}, - {0xA01D,0x2D}, - {0xA01E,0xFF}, - {0xA01F,0xE5}, - {0xA020,0xF0}, - {0xA021,0x3C}, - {0xA022,0xFE}, - {0xA023,0xAB}, - {0xA024,0x07}, - {0xA025,0xFA}, - {0xA026,0x33}, - {0xA027,0x95}, - {0xA028,0xE0}, - {0xA029,0xF9}, - {0xA02A,0xF8}, - {0xA02B,0x90}, - {0xA02C,0x0B}, - {0xA02D,0x4B}, - {0xA02E,0xE0}, - {0xA02F,0xFE}, - {0xA030,0xA3}, - {0xA031,0xE0}, - {0xA032,0xFF}, - {0xA033,0xEE}, - {0xA034,0x33}, - {0xA035,0x95}, - {0xA036,0xE0}, - {0xA037,0xFD}, - {0xA038,0xFC}, - {0xA039,0x12}, - {0xA03A,0x0C}, - {0xA03B,0x7B}, - {0xA03C,0x90}, - {0xA03D,0x01}, - {0xA03E,0xB9}, - {0xA03F,0x12}, - {0xA040,0x0E}, - {0xA041,0x05}, - {0xA042,0x90}, - {0xA043,0x01}, - {0xA044,0xB9}, - {0xA045,0xE0}, - {0xA046,0xFC}, - {0xA047,0xA3}, - {0xA048,0xE0}, - {0xA049,0xFD}, - {0xA04A,0xA3}, - {0xA04B,0xE0}, - {0xA04C,0xFE}, - {0xA04D,0xA3}, - {0xA04E,0xE0}, - {0xA04F,0xFF}, - {0xA050,0x78}, - {0xA051,0x08}, - {0xA052,0x12}, - {0xA053,0x0D}, - {0xA054,0xBF}, - {0xA055,0xA8}, - {0xA056,0x04}, - {0xA057,0xA9}, - {0xA058,0x05}, - {0xA059,0xAA}, - {0xA05A,0x06}, - {0xA05B,0xAB}, - {0xA05C,0x07}, - {0xA05D,0x90}, - {0xA05E,0x0B}, - {0xA05F,0x49}, - {0xA060,0xE0}, - {0xA061,0xFE}, - {0xA062,0xA3}, - {0xA063,0xE0}, - {0xA064,0xFF}, - {0xA065,0xEE}, - {0xA066,0x33}, - {0xA067,0x95}, - {0xA068,0xE0}, - {0xA069,0xFD}, - {0xA06A,0xFC}, - {0xA06B,0xC3}, - {0xA06C,0xEF}, - {0xA06D,0x9B}, - {0xA06E,0xFF}, - {0xA06F,0xEE}, - {0xA070,0x9A}, - {0xA071,0xFE}, - {0xA072,0xED}, - {0xA073,0x99}, - {0xA074,0xFD}, - {0xA075,0xEC}, - {0xA076,0x98}, - {0xA077,0xFC}, - {0xA078,0x78}, - {0xA079,0x01}, - {0xA07A,0x12}, - {0xA07B,0x0D}, - {0xA07C,0xBF}, - {0xA07D,0x90}, - {0xA07E,0x0C}, - {0xA07F,0x4A}, - {0xA080,0xE0}, - {0xA081,0xFC}, - {0xA082,0xA3}, - {0xA083,0xE0}, - {0xA084,0xF5}, - {0xA085,0x82}, - {0xA086,0x8C}, - {0xA087,0x83}, - {0xA088,0xC0}, - {0xA089,0x83}, - {0xA08A,0xC0}, - {0xA08B,0x82}, - {0xA08C,0x90}, - {0xA08D,0x0B}, - {0xA08E,0x48}, - {0xA08F,0xE0}, - {0xA090,0xD0}, - {0xA091,0x82}, - {0xA092,0xD0}, - {0xA093,0x83}, - {0xA094,0x75}, - {0xA095,0xF0}, - {0xA096,0x02}, - {0xA097,0x12}, - {0xA098,0x0E}, - {0xA099,0x45}, - {0xA09A,0xEE}, - {0xA09B,0xF0}, - {0xA09C,0xA3}, - {0xA09D,0xEF}, - {0xA09E,0xF0}, - {0xA09F,0x02}, - {0xA0A0,0xBA}, - {0xA0A1,0xD8}, - {0xA0A2,0x90}, - {0xA0A3,0x30}, - {0xA0A4,0x18}, - {0xA0A5,0xe4}, - {0xA0A6,0xf0}, - {0xA0A7,0x74}, - {0xA0A8,0x3f}, - {0xA0A9,0xf0}, - {0xA0AA,0x22}, - {0xA0BF,0x90}, - {0xA0C0,0x00}, - {0xA0C1,0x5E}, - {0xA0C2,0xE0}, - {0xA0C3,0xFF}, - {0xA0C4,0x70}, - {0xA0C5,0x20}, - {0xA0C6,0x90}, - {0xA0C7,0x47}, - {0xA0C8,0x04}, - {0xA0C9,0x74}, - {0xA0CA,0x0A}, - {0xA0CB,0xF0}, - {0xA0CC,0xA3}, - {0xA0CD,0x74}, - {0xA0CE,0x30}, - {0xA0CF,0xF0}, - {0xA0D0,0x90}, - {0xA0D1,0x47}, - {0xA0D2,0x0C}, - {0xA0D3,0x74}, - {0xA0D4,0x07}, - {0xA0D5,0xF0}, - {0xA0D6,0xA3}, - {0xA0D7,0x74}, - {0xA0D8,0xA8}, - {0xA0D9,0xF0}, - {0xA0DA,0x90}, - {0xA0DB,0x47}, - {0xA0DC,0xA4}, - {0xA0DD,0x74}, - {0xA0DE,0x01}, - {0xA0DF,0xF0}, - {0xA0E0,0x90}, - {0xA0E1,0x47}, - {0xA0E2,0xA8}, - {0xA0E3,0xF0}, - {0xA0E4,0x80}, - {0xA0E5,0x50}, - {0xA0E6,0xEF}, - {0xA0E7,0x64}, - {0xA0E8,0x01}, - {0xA0E9,0x60}, - {0xA0EA,0x04}, - {0xA0EB,0xEF}, - {0xA0EC,0xB4}, - {0xA0ED,0x03}, - {0xA0EE,0x20}, - {0xA0EF,0x90}, - {0xA0F0,0x47}, - {0xA0F1,0x04}, - {0xA0F2,0x74}, - {0xA0F3,0x05}, - {0xA0F4,0xF0}, - {0xA0F5,0xA3}, - {0xA0F6,0x74}, - {0xA0F7,0x18}, - {0xA0F8,0xF0}, - {0xA0F9,0x90}, - {0xA0FA,0x47}, - {0xA0FB,0x0C}, - {0xA0FC,0x74}, - {0xA0FD,0x03}, - {0xA0FE,0xF0}, - {0xA0FF,0xA3}, - {0xA100,0x74}, - {0xA101,0xD4}, - {0xA102,0xF0}, - {0xA103,0x90}, - {0xA104,0x47}, - {0xA105,0xA4}, - {0xA106,0x74}, - {0xA107,0x02}, - {0xA108,0xF0}, - {0xA109,0x90}, - {0xA10A,0x47}, - {0xA10B,0xA8}, - {0xA10C,0xF0}, - {0xA10D,0x80}, - {0xA10E,0x27}, - {0xA10F,0xEF}, - {0xA110,0x64}, - {0xA111,0x02}, - {0xA112,0x60}, - {0xA113,0x04}, - {0xA114,0xEF}, - {0xA115,0xB4}, - {0xA116,0x04}, - {0xA117,0x1E}, - {0xA118,0x90}, - {0xA119,0x47}, - {0xA11A,0x04}, - {0xA11B,0x74}, - {0xA11C,0x02}, - {0xA11D,0xF0}, - {0xA11E,0xA3}, - {0xA11F,0x74}, - {0xA120,0x8C}, - {0xA121,0xF0}, - {0xA122,0x90}, - {0xA123,0x47}, - {0xA124,0x0C}, - {0xA125,0x74}, - {0xA126,0x01}, - {0xA127,0xF0}, - {0xA128,0xA3}, - {0xA129,0x74}, - {0xA12A,0xEA}, - {0xA12B,0xF0}, - {0xA12C,0x90}, - {0xA12D,0x47}, - {0xA12E,0xA4}, - {0xA12F,0x74}, - {0xA130,0x04}, - {0xA131,0xF0}, - {0xA132,0x90}, - {0xA133,0x47}, - {0xA134,0xA8}, - {0xA135,0xF0}, - {0xA136,0x22}, - {0xA137,0x74}, - {0xA138,0x04}, - {0xA139,0xF0}, - {0xA13A,0xA3}, - {0xA13B,0x74}, - {0xA13C,0x20}, - {0xA13D,0xF0}, - {0xA13E,0xE4}, - {0xA13F,0xF5}, - {0xA140,0x22}, - {0xA141,0xE5}, - {0xA142,0x22}, - {0xA143,0xC3}, - {0xA144,0x94}, - {0xA145,0x40}, - {0xA146,0x40}, - {0xA147,0x03}, - {0xA148,0x02}, - {0xA149,0xF1}, - {0xA14A,0xFD}, - {0xA14B,0x90}, - {0xA14C,0x0A}, - {0xA14D,0xBA}, - {0xA14E,0xE0}, - {0xA14F,0xFE}, - {0xA150,0xA3}, - {0xA151,0xE0}, - {0xA152,0xFF}, - {0xA153,0xF5}, - {0xA154,0x82}, - {0xA155,0x8E}, - {0xA156,0x83}, - {0xA157,0xE0}, - {0xA158,0x54}, - {0xA159,0x70}, - {0xA15A,0xFD}, - {0xA15B,0xC4}, - {0xA15C,0x54}, - {0xA15D,0x0F}, - {0xA15E,0xFD}, - {0xA15F,0x90}, - {0xA160,0x0A}, - {0xA161,0xBC}, - {0xA162,0xE0}, - {0xA163,0xFA}, - {0xA164,0xA3}, - {0xA165,0xE0}, - {0xA166,0xF5}, - {0xA167,0x82}, - {0xA168,0x8A}, - {0xA169,0x83}, - {0xA16A,0xED}, - {0xA16B,0xF0}, - {0xA16C,0x90}, - {0xA16D,0x0A}, - {0xA16E,0xBD}, - {0xA16F,0xE0}, - {0xA170,0x04}, - {0xA171,0xF0}, - {0xA172,0x70}, - {0xA173,0x06}, - {0xA174,0x90}, - {0xA175,0x0A}, - {0xA176,0xBC}, - {0xA177,0xE0}, - {0xA178,0x04}, - {0xA179,0xF0}, - {0xA17A,0x8F}, - {0xA17B,0x82}, - {0xA17C,0x8E}, - {0xA17D,0x83}, - {0xA17E,0xA3}, - {0xA17F,0xE0}, - {0xA180,0xFF}, - {0xA181,0x90}, - {0xA182,0x0A}, - {0xA183,0xBC}, - {0xA184,0xE0}, - {0xA185,0xFC}, - {0xA186,0xA3}, - {0xA187,0xE0}, - {0xA188,0xF5}, - {0xA189,0x82}, - {0xA18A,0x8C}, - {0xA18B,0x83}, - {0xA18C,0xEF}, - {0xA18D,0xF0}, - {0xA18E,0x90}, - {0xA18F,0x0A}, - {0xA190,0xBD}, - {0xA191,0xE0}, - {0xA192,0x04}, - {0xA193,0xF0}, - {0xA194,0x70}, - {0xA195,0x06}, - {0xA196,0x90}, - {0xA197,0x0A}, - {0xA198,0xBC}, - {0xA199,0xE0}, - {0xA19A,0x04}, - {0xA19B,0xF0}, - {0xA19C,0x90}, - {0xA19D,0x0A}, - {0xA19E,0xBA}, - {0xA19F,0xE0}, - {0xA1A0,0xFE}, - {0xA1A1,0xA3}, - {0xA1A2,0xE0}, - {0xA1A3,0xFF}, - {0xA1A4,0xF5}, - {0xA1A5,0x82}, - {0xA1A6,0x8E}, - {0xA1A7,0x83}, - {0xA1A8,0xE0}, - {0xA1A9,0x54}, - {0xA1AA,0x07}, - {0xA1AB,0xFD}, - {0xA1AC,0x90}, - {0xA1AD,0x0A}, - {0xA1AE,0xBC}, - {0xA1AF,0xE0}, - {0xA1B0,0xFA}, - {0xA1B1,0xA3}, - {0xA1B2,0xE0}, - {0xA1B3,0xF5}, - {0xA1B4,0x82}, - {0xA1B5,0x8A}, - {0xA1B6,0x83}, - {0xA1B7,0xED}, - {0xA1B8,0xF0}, - {0xA1B9,0x90}, - {0xA1BA,0x0A}, - {0xA1BB,0xBD}, - {0xA1BC,0xE0}, - {0xA1BD,0x04}, - {0xA1BE,0xF0}, - {0xA1BF,0x70}, - {0xA1C0,0x06}, - {0xA1C1,0x90}, - {0xA1C2,0x0A}, - {0xA1C3,0xBC}, - {0xA1C4,0xE0}, - {0xA1C5,0x04}, - {0xA1C6,0xF0}, - {0xA1C7,0x8F}, - {0xA1C8,0x82}, - {0xA1C9,0x8E}, - {0xA1CA,0x83}, - {0xA1CB,0xA3}, - {0xA1CC,0xA3}, - {0xA1CD,0xE0}, - {0xA1CE,0xFF}, - {0xA1CF,0x90}, - {0xA1D0,0x0A}, - {0xA1D1,0xBC}, - {0xA1D2,0xE0}, - {0xA1D3,0xFC}, - {0xA1D4,0xA3}, - {0xA1D5,0xE0}, - {0xA1D6,0xF5}, - {0xA1D7,0x82}, - {0xA1D8,0x8C}, - {0xA1D9,0x83}, - {0xA1DA,0xEF}, - {0xA1DB,0xF0}, - {0xA1DC,0x90}, - {0xA1DD,0x0A}, - {0xA1DE,0xBD}, - {0xA1DF,0xE0}, - {0xA1E0,0x04}, - {0xA1E1,0xF0}, - {0xA1E2,0x70}, - {0xA1E3,0x06}, - {0xA1E4,0x90}, - {0xA1E5,0x0A}, - {0xA1E6,0xBC}, - {0xA1E7,0xE0}, - {0xA1E8,0x04}, - {0xA1E9,0xF0}, - {0xA1EA,0x90}, - {0xA1EB,0x0A}, - {0xA1EC,0xBB}, - {0xA1ED,0xE0}, - {0xA1EE,0x24}, - {0xA1EF,0x03}, - {0xA1F0,0xF0}, - {0xA1F1,0x90}, - {0xA1F2,0x0A}, - {0xA1F3,0xBA}, - {0xA1F4,0xE0}, - {0xA1F5,0x34}, - {0xA1F6,0x00}, - {0xA1F7,0xF0}, - {0xA1F8,0x05}, - {0xA1F9,0x22}, - {0xA1FA,0x02}, - {0xA1FB,0xF1}, - {0xA1FC,0x41}, - {0xA1FD,0x90}, - {0xA1FE,0x0A}, - {0xA1FF,0xBA}, - {0xA200,0x74}, - {0xA201,0x0E}, - {0xA202,0xF0}, - {0xA203,0xA3}, - {0xA204,0x74}, - {0xA205,0xDC}, - {0xA206,0xF0}, - {0xA207,0xA3}, - {0xA208,0x74}, - {0xA209,0x05}, - {0xA20A,0xF0}, - {0xA20B,0xA3}, - {0xA20C,0x74}, - {0xA20D,0x61}, - {0xA20E,0xF0}, - {0xA20F,0x90}, - {0xA210,0x0A}, - {0xA211,0xBA}, - {0xA212,0xE0}, - {0xA213,0xFE}, - {0xA214,0xA3}, - {0xA215,0xE0}, - {0xA216,0xAA}, - {0xA217,0x06}, - {0xA218,0xF9}, - {0xA219,0x7B}, - {0xA21A,0x01}, - {0xA21B,0xC0}, - {0xA21C,0x02}, - {0xA21D,0xA3}, - {0xA21E,0xE0}, - {0xA21F,0xFE}, - {0xA220,0xA3}, - {0xA221,0xE0}, - {0xA222,0xAA}, - {0xA223,0x06}, - {0xA224,0xF8}, - {0xA225,0xAC}, - {0xA226,0x02}, - {0xA227,0x7D}, - {0xA228,0x01}, - {0xA229,0xD0}, - {0xA22A,0x02}, - {0xA22B,0x7E}, - {0xA22C,0x00}, - {0xA22D,0x7F}, - {0xA22E,0x04}, - {0xA22F,0x12}, - {0xA230,0x0F}, - {0xA231,0x6F}, - {0xA232,0x02}, - {0xA233,0x66}, - {0xA234,0xD9}, - {0xA235,0x90}, - {0xA236,0x07}, - {0xA237,0xD0}, - {0xA238,0x02}, - {0xA239,0xA2}, - {0xA23A,0x69}, - {0xA240,0x02}, - {0xA241,0x21}, - {0xA242,0x7F}, - {0xA243,0x02}, - {0xA244,0x21}, - {0xA245,0xF4}, - {0xA246,0x02}, - {0xA247,0xA6}, - {0xA248,0x15}, - {0xA249,0x60}, - {0xA24A,0x0A}, - {0xA24B,0xEF}, - {0xA24C,0xB4}, - {0xA24D,0x01}, - {0xA24E,0x16}, - {0xA24F,0x90}, - {0xA250,0x00}, - {0xA251,0x5D}, - {0xA252,0xE0}, - {0xA253,0x70}, - {0xA254,0x10}, - {0xA255,0x12}, - {0xA256,0x26}, - {0xA257,0xC8}, - {0xA258,0x90}, - {0xA259,0x00}, - {0xA25A,0x11}, - {0xA25B,0x74}, - {0xA25C,0x30}, - {0xA25D,0xF0}, - {0xA25E,0x90}, - {0xA25F,0x00}, - {0xA260,0x10}, - {0xA261,0x74}, - {0xA262,0x01}, - {0xA263,0xF0}, - {0xA264,0x22}, - {0xA265,0x12}, - {0xA266,0x25}, - {0xA267,0xA8}, - {0xA268,0x02}, - {0xA269,0x29}, - {0xA26A,0xFC}, - {0xA26B,0x44}, - {0xA26C,0x18}, - {0xA26D,0xF0}, - {0xA26E,0x90}, - {0xA26F,0x72}, - {0xA270,0x18}, - {0xA271,0xE0}, - {0xA272,0x44}, - {0xA273,0x18}, - {0xA274,0xF0}, - {0xA275,0x00}, - {0xA276,0x00}, - {0xA277,0x00}, - {0xA278,0x00}, - {0xA279,0x00}, - {0xA27A,0x00}, - {0xA27B,0x90}, - {0xA27C,0x72}, - {0xA27D,0x08}, - {0xA27E,0xE0}, - {0xA27F,0x44}, - {0xA280,0x10}, - {0xA281,0xF0}, - {0xA282,0x90}, - {0xA283,0x72}, - {0xA284,0x14}, - {0xA285,0xE0}, - {0xA286,0x54}, - {0xA287,0xFD}, - {0xA288,0xF0}, - {0xA289,0x22}, - {0xA29B,0xF0}, - {0xA29C,0xD3}, - {0xA29D,0x90}, - {0xA29E,0x07}, - {0xA29F,0x91}, - {0xA2A0,0xE0}, - {0xA2A1,0x94}, - {0xA2A2,0x21}, - {0xA2A3,0x90}, - {0xA2A4,0x07}, - {0xA2A5,0x90}, - {0xA2A6,0xE0}, - {0xA2A7,0x64}, - {0xA2A8,0x80}, - {0xA2A9,0x94}, - {0xA2AA,0x81}, - {0xA2AB,0x40}, - {0xA2AC,0x08}, - {0xA2AD,0x90}, - {0xA2AE,0x07}, - {0xA2AF,0xCB}, - {0xA2B0,0x74}, - {0xA2B1,0xFF}, - {0xA2B2,0xF0}, - {0xA2B3,0x80}, - {0xA2B4,0x06}, - {0xA2B5,0x90}, - {0xA2B6,0x07}, - {0xA2B7,0xCB}, - {0xA2B8,0x74}, - {0xA2B9,0x01}, - {0xA2BA,0xF0}, - {0xA2BB,0x02}, - {0xA2BC,0xB5}, - {0xA2BD,0xC3}, - {0xA2BE,0x90}, - {0xA2BF,0x08}, - {0xA2C0,0x34}, - {0xA2C1,0xE0}, - {0xA2C2,0xFC}, - {0xA2C3,0xA3}, - {0xA2C4,0xE0}, - {0xA2C5,0xFD}, - {0xA2C6,0xA3}, - {0xA2C7,0xE0}, - {0xA2C8,0xFE}, - {0xA2C9,0xA3}, - {0xA2CA,0xE0}, - {0xA2CB,0xFF}, - {0xA2CC,0x90}, - {0xA2CD,0x07}, - {0xA2CE,0xD0}, - {0xA2CF,0xE0}, - {0xA2D0,0xF8}, - {0xA2D1,0xA3}, - {0xA2D2,0xE0}, - {0xA2D3,0xF9}, - {0xA2D4,0xA3}, - {0xA2D5,0xE0}, - {0xA2D6,0xFA}, - {0xA2D7,0xA3}, - {0xA2D8,0xE0}, - {0xA2D9,0xFB}, - {0xA2DA,0xD3}, - {0xA2DB,0x12}, - {0xA2DC,0x0D}, - {0xA2DD,0xAE}, - {0xA2DE,0x40}, - {0xA2DF,0x0B}, - {0xA2E0,0x12}, - {0xA2E1,0xB5}, - {0xA2E2,0x49}, - {0xA2E3,0x90}, - {0xA2E4,0x07}, - {0xA2E5,0xA4}, - {0xA2E6,0x74}, - {0xA2E7,0x02}, - {0xA2E8,0xF0}, - {0xA2E9,0x80}, - {0xA2EA,0x09}, - {0xA2EB,0x12}, - {0xA2EC,0xB7}, - {0xA2ED,0x51}, - {0xA2EE,0x90}, - {0xA2EF,0x07}, - {0xA2F0,0xA4}, - {0xA2F1,0x74}, - {0xA2F2,0x05}, - {0xA2F3,0xF0}, - {0xA2F4,0x02}, - {0xA2F5,0xA2}, - {0xA2F6,0xDA}, - {0xA2F7,0x90}, - {0xA2F8,0x0E}, - {0xA2F9,0xE0}, - {0xA2FA,0xE0}, - {0xA2FB,0xFD}, - {0xA2FC,0xA3}, - {0xA2FD,0xE0}, - {0xA2FE,0x90}, - {0xA2FF,0x02}, - {0xA300,0xA2}, - {0xA301,0xCD}, - {0xA302,0xF0}, - {0xA303,0xA3}, - {0xA304,0xED}, - {0xA305,0xF0}, - {0xA306,0x90}, - {0xA307,0x0E}, - {0xA308,0xE2}, - {0xA309,0xE0}, - {0xA30A,0xFD}, - {0xA30B,0xA3}, - {0xA30C,0xE0}, - {0xA30D,0x90}, - {0xA30E,0x02}, - {0xA30F,0xA8}, - {0xA310,0xCD}, - {0xA311,0xF0}, - {0xA312,0xA3}, - {0xA313,0xED}, - {0xA314,0xF0}, - {0xA315,0xE4}, - {0xA316,0x90}, - {0xA317,0x06}, - {0xA318,0x38}, - {0xA319,0xF0}, - {0xA31A,0x02}, - {0xA31B,0x67}, - {0xA31C,0x63}, - {0xA31D,0x90}, - {0xA31E,0x0E}, - {0xA31F,0xE8}, - {0xA320,0xE0}, - {0xA321,0x90}, - {0xA322,0x02}, - {0xA323,0x62}, - {0xA324,0xF0}, - {0xA325,0x90}, - {0xA326,0x0E}, - {0xA327,0xE9}, - {0xA328,0xE0}, - {0xA329,0x90}, - {0xA32A,0x02}, - {0xA32B,0x63}, - {0xA32C,0xF0}, - {0xA32D,0x02}, - {0xA32E,0x67}, - {0xA32F,0x1F}, - {0xA33B,0x90}, - {0xA33C,0x0E}, - {0xA33D,0x14}, - {0xA33E,0xE0}, - {0xA33F,0xFE}, - {0xA340,0xA3}, - {0xA341,0xE0}, - {0xA342,0xFF}, - {0xA343,0x90}, - {0xA344,0x06}, - {0xA345,0xD9}, - {0xA346,0xEE}, - {0xA347,0xF0}, - {0xA348,0xA3}, - {0xA349,0xEF}, - {0xA34A,0xF0}, - {0xA34B,0x90}, - {0xA34C,0x0E}, - {0xA34D,0x18}, - {0xA34E,0xE0}, - {0xA34F,0xFD}, - {0xA350,0x7C}, - {0xA351,0x00}, - {0xA352,0xC3}, - {0xA353,0xEF}, - {0xA354,0x9D}, - {0xA355,0xEE}, - {0xA356,0x9C}, - {0xA357,0x50}, - {0xA358,0x09}, - {0xA359,0xE4}, - {0xA35A,0x90}, - {0xA35B,0x06}, - {0xA35C,0xD7}, - {0xA35D,0xF0}, - {0xA35E,0xA3}, - {0xA35F,0xF0}, - {0xA360,0x80}, - {0xA361,0x13}, - {0xA362,0xC3}, - {0xA363,0x90}, - {0xA364,0x06}, - {0xA365,0xDA}, - {0xA366,0xE0}, - {0xA367,0x9D}, - {0xA368,0xFE}, - {0xA369,0x90}, - {0xA36A,0x06}, - {0xA36B,0xD9}, - {0xA36C,0xE0}, - {0xA36D,0x9C}, - {0xA36E,0x90}, - {0xA36F,0x06}, - {0xA370,0xD7}, - {0xA371,0xF0}, - {0xA372,0xA3}, - {0xA373,0xCE}, - {0xA374,0xF0}, - {0xA375,0x90}, - {0xA376,0x0E}, - {0xA377,0x18}, - {0xA378,0xE0}, - {0xA379,0xF9}, - {0xA37A,0xFF}, - {0xA37B,0x90}, - {0xA37C,0x06}, - {0xA37D,0xC2}, - {0xA37E,0xE0}, - {0xA37F,0xFC}, - {0xA380,0xA3}, - {0xA381,0xE0}, - {0xA382,0xFD}, - {0xA383,0xC3}, - {0xA384,0x9F}, - {0xA385,0xFF}, - {0xA386,0xEC}, - {0xA387,0x94}, - {0xA388,0x00}, - {0xA389,0xFE}, - {0xA38A,0x90}, - {0xA38B,0x0E}, - {0xA38C,0x16}, - {0xA38D,0xE0}, - {0xA38E,0xFA}, - {0xA38F,0xA3}, - {0xA390,0xE0}, - {0xA391,0xFB}, - {0xA392,0xD3}, - {0xA393,0x9F}, - {0xA394,0xEA}, - {0xA395,0x9E}, - {0xA396,0x40}, - {0xA397,0x0A}, - {0xA398,0x90}, - {0xA399,0x06}, - {0xA39A,0xD5}, - {0xA39B,0xEC}, - {0xA39C,0xF0}, - {0xA39D,0xA3}, - {0xA39E,0xED}, - {0xA39F,0xF0}, - {0xA3A0,0x80}, - {0xA3A1,0x0E}, - {0xA3A2,0xE9}, - {0xA3A3,0x7E}, - {0xA3A4,0x00}, - {0xA3A5,0x2B}, - {0xA3A6,0xFF}, - {0xA3A7,0xEE}, - {0xA3A8,0x3A}, - {0xA3A9,0x90}, - {0xA3AA,0x06}, - {0xA3AB,0xD5}, - {0xA3AC,0xF0}, - {0xA3AD,0xA3}, - {0xA3AE,0xEF}, - {0xA3AF,0xF0}, - {0xA3B0,0xE9}, - {0xA3B1,0xFB}, - {0xA3B2,0x7A}, - {0xA3B3,0x00}, - {0xA3B4,0x90}, - {0xA3B5,0x0E}, - {0xA3B6,0x15}, - {0xA3B7,0xE0}, - {0xA3B8,0x2B}, - {0xA3B9,0xFE}, - {0xA3BA,0x90}, - {0xA3BB,0x0E}, - {0xA3BC,0x14}, - {0xA3BD,0xE0}, - {0xA3BE,0x3A}, - {0xA3BF,0x90}, - {0xA3C0,0x06}, - {0xA3C1,0xE1}, - {0xA3C2,0xF0}, - {0xA3C3,0xA3}, - {0xA3C4,0xCE}, - {0xA3C5,0xF0}, - {0xA3C6,0xC3}, - {0xA3C7,0x90}, - {0xA3C8,0x0E}, - {0xA3C9,0x17}, - {0xA3CA,0xE0}, - {0xA3CB,0x9B}, - {0xA3CC,0xFE}, - {0xA3CD,0x90}, - {0xA3CE,0x0E}, - {0xA3CF,0x16}, - {0xA3D0,0x02}, - {0xA3D1,0x20}, - {0xA3D2,0xD5}, - {0xA3D3,0x90}, - {0xA3d4,0x0E}, - {0xA3d5,0xE4}, - {0xA3d6,0xE0}, - {0xA3d7,0x90}, - {0xA3d8,0x02}, - {0xA3d9,0x66}, - {0xA3da,0xF0}, - {0xA3DB,0x90}, - {0xA3dc,0x0E}, - {0xA3dd,0xE5}, - {0xA3de,0xE0}, - {0xA3df,0x90}, - {0xA3e0,0x02}, - {0xA3e1,0x64}, - {0xA3e2,0xF0}, - {0xA3e3,0x90}, - {0xA3e4,0x0E}, - {0xA3e5,0xE6}, - {0xA3e6,0xE0}, - {0xA3e7,0x90}, - {0xA3e8,0x02}, - {0xA3e9,0x65}, - {0xA3ea,0xF0}, - {0xA3eb,0x02}, - {0xA3ec,0x67}, - {0xA3ed,0xA5}, - {0xA3f0,0x12}, - {0xA3f1,0x47}, - {0xA3f2,0x59}, - {0xA3f3,0x90}, - {0xA3f4,0x00}, - {0xA3f5,0xB5}, - {0xA3f6,0xE0}, - {0xA3f7,0xB4}, - {0xA3f8,0x02}, - {0xA3f9,0x03}, - {0xA3fa,0x12}, - {0xA3fb,0x47}, - {0xA3fc,0x59}, - {0xA3fd,0x02}, - {0xA3fe,0xC5}, - {0xA3ff,0xC3}, - {0xA400,0x90}, - {0xA401,0x00}, - {0xA402,0x3D}, - {0xA403,0xF0}, - {0xA404,0x90}, - {0xA405,0x00}, - {0xA406,0x84}, - {0xA407,0xE0}, - {0xA408,0xFE}, - {0xA409,0x90}, - {0xA40A,0x00}, - {0xA40B,0x3E}, - {0xA40C,0xF0}, - {0xA40D,0xEF}, - {0xA40E,0x70}, - {0xA40F,0x03}, - {0xA410,0xEE}, - {0xA411,0x60}, - {0xA412,0x04}, - {0xA413,0x7F}, - {0xA414,0x01}, - {0xA415,0x80}, - {0xA416,0x02}, - {0xA417,0x7F}, - {0xA418,0x00}, - {0xA419,0x90}, - {0xA41A,0x00}, - {0xA41B,0x3F}, - {0xA41C,0xEF}, - {0xA41D,0xF0}, - {0xA41E,0x02}, - {0xA41F,0x89}, - {0xA420,0xD3}, - {0xA421,0x90}, - {0xA422,0x00}, - {0xA423,0x12}, - {0xA424,0xE0}, - {0xA425,0xFF}, - {0xA426,0x70}, - {0xA427,0x0C}, - {0xA428,0x90}, - {0xA429,0x00}, - {0xA42A,0x46}, - {0xA42B,0xE0}, - {0xA42C,0xC3}, - {0xA42D,0x94}, - {0xA42E,0x07}, - {0xA42F,0x40}, - {0xA430,0x03}, - {0xA431,0x75}, - {0xA432,0x2E}, - {0xA433,0x02}, - {0xA434,0xEF}, - {0xA435,0xB4}, - {0xA436,0x01}, - {0xA437,0x0C}, - {0xA438,0x90}, - {0xA439,0x00}, - {0xA43A,0x66}, - {0xA43B,0xE0}, - {0xA43C,0xC3}, - {0xA43D,0x94}, - {0xA43E,0x07}, - {0xA43F,0x40}, - {0xA440,0x03}, - {0xA441,0x75}, - {0xA442,0x2E}, - {0xA443,0x02}, - {0xA444,0x02}, - {0xA445,0xA7}, - {0xA446,0x9E}, - {0xA447,0xC3}, - {0xA448,0x90}, - {0xA449,0x0B}, - {0xA44A,0x8F}, - {0xA44B,0xE0}, - {0xA44C,0x94}, - {0xA44D,0x00}, - {0xA44E,0x90}, - {0xA44F,0x0B}, - {0xA450,0x8E}, - {0xA451,0xE0}, - {0xA452,0x94}, - {0xA453,0x41}, - {0xA454,0x40}, - {0xA455,0x22}, - {0xA456,0x90}, - {0xA457,0x0B}, - {0xA458,0x91}, - {0xA459,0xE0}, - {0xA45A,0x94}, - {0xA45B,0x00}, - {0xA45C,0x90}, - {0xA45D,0x0B}, - {0xA45E,0x90}, - {0xA45F,0xE0}, - {0xA460,0x94}, - {0xA461,0x41}, - {0xA462,0x40}, - {0xA463,0x14}, - {0xA464,0x90}, - {0xA465,0x0B}, - {0xA466,0x93}, - {0xA467,0xE0}, - {0xA468,0x94}, - {0xA469,0x00}, - {0xA46A,0x90}, - {0xA46B,0x0B}, - {0xA46C,0x92}, - {0xA46D,0xE0}, - {0xA46E,0x94}, - {0xA46F,0x41}, - {0xA470,0x40}, - {0xA471,0x06}, - {0xA472,0x90}, - {0xA473,0x01}, - {0xA474,0xA4}, - {0xA475,0x02}, - {0xA476,0x86}, - {0xA477,0x57}, - {0xA478,0x02}, - {0xA479,0x86}, - {0xA47A,0x5C}, - {0xA500,0xF5}, - {0xA501,0x3B}, - {0xA502,0x90}, - {0xA503,0x06}, - {0xA504,0x6C}, - {0xA505,0xE0}, - {0xA506,0xFF}, - {0xA507,0xE5}, - {0xA508,0x3B}, - {0xA509,0xC3}, - {0xA50A,0x9F}, - {0xA50B,0x40}, - {0xA50C,0x03}, - {0xA50D,0x02}, - {0xA50E,0xF6}, - {0xA50F,0x0E}, - {0xA510,0x90}, - {0xA511,0x0B}, - {0xA512,0xC6}, - {0xA513,0xE0}, - {0xA514,0x14}, - {0xA515,0x60}, - {0xA516,0x3C}, - {0xA517,0x14}, - {0xA518,0x60}, - {0xA519,0x6B}, - {0xA51A,0x24}, - {0xA51B,0x02}, - {0xA51C,0x60}, - {0xA51D,0x03}, - {0xA51E,0x02}, - {0xA51F,0xF5}, - {0xA520,0xB5}, - {0xA521,0x90}, - {0xA522,0x0A}, - {0xA523,0x9A}, - {0xA524,0xE0}, - {0xA525,0xFB}, - {0xA526,0xA3}, - {0xA527,0xE0}, - {0xA528,0xFA}, - {0xA529,0xA3}, - {0xA52A,0xE0}, - {0xA52B,0xF9}, - {0xA52C,0x85}, - {0xA52D,0x3B}, - {0xA52E,0x82}, - {0xA52F,0x75}, - {0xA530,0x83}, - {0xA531,0x00}, - {0xA532,0x12}, - {0xA533,0x0A}, - {0xA534,0xB8}, - {0xA535,0xFF}, - {0xA536,0x74}, - {0xA537,0xAB}, - {0xA538,0x25}, - {0xA539,0x3B}, - {0xA53A,0xF5}, - {0xA53B,0x82}, - {0xA53C,0xE4}, - {0xA53D,0x34}, - {0xA53E,0x0A}, - {0xA53F,0xF5}, - {0xA540,0x83}, - {0xA541,0xE0}, - {0xA542,0xFD}, - {0xA543,0xC3}, - {0xA544,0xEF}, - {0xA545,0x9D}, - {0xA546,0xFE}, - {0xA547,0xE4}, - {0xA548,0x94}, - {0xA549,0x00}, - {0xA54A,0x90}, - {0xA54B,0x0B}, - {0xA54C,0xCA}, - {0xA54D,0xF0}, - {0xA54E,0xA3}, - {0xA54F,0xCE}, - {0xA550,0xF0}, - {0xA551,0x80}, - {0xA552,0x62}, - {0xA553,0x90}, - {0xA554,0x0A}, - {0xA555,0x9A}, - {0xA556,0xE0}, - {0xA557,0xFB}, - {0xA558,0xA3}, - {0xA559,0xE0}, - {0xA55A,0xFA}, - {0xA55B,0xA3}, - {0xA55C,0xE0}, - {0xA55D,0xF9}, - {0xA55E,0x85}, - {0xA55F,0x3B}, - {0xA560,0x82}, - {0xA561,0x75}, - {0xA562,0x83}, - {0xA563,0x00}, - {0xA564,0x12}, - {0xA565,0x0A}, - {0xA566,0xB8}, - {0xA567,0xFF}, - {0xA568,0x74}, - {0xA569,0x9D}, - {0xA56A,0x25}, - {0xA56B,0x3B}, - {0xA56C,0xF5}, - {0xA56D,0x82}, - {0xA56E,0xE4}, - {0xA56F,0x34}, - {0xA570,0x0A}, - {0xA571,0xF5}, - {0xA572,0x83}, - {0xA573,0xE0}, - {0xA574,0xFD}, - {0xA575,0xC3}, - {0xA576,0xEF}, - {0xA577,0x9D}, - {0xA578,0xFE}, - {0xA579,0xE4}, - {0xA57A,0x94}, - {0xA57B,0x00}, - {0xA57C,0x90}, - {0xA57D,0x0B}, - {0xA57E,0xCA}, - {0xA57F,0xF0}, - {0xA580,0xA3}, - {0xA581,0xCE}, - {0xA582,0xF0}, - {0xA583,0x80}, - {0xA584,0x30}, - {0xA585,0x90}, - {0xA586,0x0A}, - {0xA587,0x9A}, - {0xA588,0xE0}, - {0xA589,0xFB}, - {0xA58A,0xA3}, - {0xA58B,0xE0}, - {0xA58C,0xFA}, - {0xA58D,0xA3}, - {0xA58E,0xE0}, - {0xA58F,0xF9}, - {0xA590,0x85}, - {0xA591,0x3B}, - {0xA592,0x82}, - {0xA593,0x75}, - {0xA594,0x83}, - {0xA595,0x00}, - {0xA596,0x12}, - {0xA597,0x0A}, - {0xA598,0xB8}, - {0xA599,0xFF}, - {0xA59A,0x74}, - {0xA59B,0xA4}, - {0xA59C,0x25}, - {0xA59D,0x3B}, - {0xA59E,0xF5}, - {0xA59F,0x82}, - {0xA5A0,0xE4}, - {0xA5A1,0x34}, - {0xA5A2,0x0A}, - {0xA5A3,0xF5}, - {0xA5A4,0x83}, - {0xA5A5,0xE0}, - {0xA5A6,0xFD}, - {0xA5A7,0xC3}, - {0xA5A8,0xEF}, - {0xA5A9,0x9D}, - {0xA5AA,0xFE}, - {0xA5AB,0xE4}, - {0xA5AC,0x94}, - {0xA5AD,0x00}, - {0xA5AE,0x90}, - {0xA5AF,0x0B}, - {0xA5B0,0xCA}, - {0xA5B1,0xF0}, - {0xA5B2,0xA3}, - {0xA5B3,0xCE}, - {0xA5B4,0xF0}, - {0xA5B5,0x90}, - {0xA5B6,0x07}, - {0xA5B7,0x83}, - {0xA5B8,0xE0}, - {0xA5B9,0xFF}, - {0xA5BA,0x7E}, - {0xA5BB,0x00}, - {0xA5BC,0x90}, - {0xA5BD,0x0D}, - {0xA5BE,0xF6}, - {0xA5BF,0xEE}, - {0xA5C0,0xF0}, - {0xA5C1,0xA3}, - {0xA5C2,0xEF}, - {0xA5C3,0xF0}, - {0xA5C4,0x90}, - {0xA5C5,0x0B}, - {0xA5C6,0xCA}, - {0xA5C7,0xE0}, - {0xA5C8,0xFC}, - {0xA5C9,0xA3}, - {0xA5CA,0xE0}, - {0xA5CB,0xFD}, - {0xA5CC,0xD3}, - {0xA5CD,0x9F}, - {0xA5CE,0x74}, - {0xA5CF,0x80}, - {0xA5D0,0xF8}, - {0xA5D1,0xEC}, - {0xA5D2,0x64}, - {0xA5D3,0x80}, - {0xA5D4,0x98}, - {0xA5D5,0x40}, - {0xA5D6,0x0C}, - {0xA5D7,0x90}, - {0xA5D8,0x0B}, - {0xA5D9,0xC8}, - {0xA5DA,0xE0}, - {0xA5DB,0x04}, - {0xA5DC,0xF0}, - {0xA5DD,0xA3}, - {0xA5DE,0xE0}, - {0xA5DF,0x04}, - {0xA5E0,0xF0}, - {0xA5E1,0x80}, - {0xA5E2,0x26}, - {0xA5E3,0x90}, - {0xA5E4,0x0D}, - {0xA5E5,0xF6}, - {0xA5E6,0xE0}, - {0xA5E7,0xFE}, - {0xA5E8,0xA3}, - {0xA5E9,0xE0}, - {0xA5EA,0xFF}, - {0xA5EB,0xC3}, - {0xA5EC,0xE4}, - {0xA5ED,0x9F}, - {0xA5EE,0xFF}, - {0xA5EF,0xE4}, - {0xA5F0,0x9E}, - {0xA5F1,0xFE}, - {0xA5F2,0xC3}, - {0xA5F3,0xED}, - {0xA5F4,0x9F}, - {0xA5F5,0xEE}, - {0xA5F6,0x64}, - {0xA5F7,0x80}, - {0xA5F8,0xF8}, - {0xA5F9,0xEC}, - {0xA5FA,0x64}, - {0xA5FB,0x80}, - {0xA5FC,0x98}, - {0xA5FD,0x50}, - {0xA5FE,0x0A}, - {0xA5FF,0x90}, - {0xA600,0x0B}, - {0xA601,0xC8}, - {0xA602,0xE0}, - {0xA603,0x14}, - {0xA604,0xF0}, - {0xA605,0xA3}, - {0xA606,0xE0}, - {0xA607,0x04}, - {0xA608,0xF0}, - {0xA609,0x05}, - {0xA60A,0x3B}, - {0xA60B,0x02}, - {0xA60C,0xF5}, - {0xA60D,0x02}, - {0xA60E,0x90}, - {0xA60F,0x08}, - {0xA610,0x58}, - {0xA611,0x02}, - {0xA612,0x9D}, - {0xA613,0x50}, - {0x9006,0xBA}, - {0x9007,0x75}, - {0x9008,0x00}, - {0x9009,0x00}, - {0x900A,0x02}, - {0x900D,0x01}, - {0x900E,0xA2}, - {0x900F,0x8F}, - {0x9010,0x00}, - {0x9011,0xCB}, - {0x9012,0x03}, - {0x9016,0xE6}, - {0x9017,0x6B}, - {0x9018,0x02}, - {0x9019,0x6B}, - {0x901A,0x02}, - {0x901D,0x01}, - {0x901E,0xAC}, - {0x901F,0x70}, - {0x9020,0x00}, - {0x9021,0xC5}, - {0x9022,0x03}, - {0x9026,0x9C}, - {0x9027,0x5B}, - {0x9028,0x00}, - {0x9029,0xBF}, - {0x902A,0x02}, - {0x902E,0x60}, - {0x902F,0x1C}, - {0x9030,0x01}, - {0x9031,0x37}, - {0x9032,0x02}, - {0x9035,0x01}, - {0x9036,0xBA}, - {0x9037,0x70}, - {0x9038,0x00}, - {0x9039,0x00}, - {0x903A,0x03}, - {0x903E,0x21}, - {0x903F,0x3F}, - {0x9040,0x02}, - {0x9041,0x40}, - {0x9042,0x02}, - {0x9046,0x21}, - {0x9047,0xEA}, - {0x9048,0x02}, - {0x9049,0x43}, - {0x904A,0x02}, - {0x904E,0xA6}, - {0x904F,0x12}, - {0x9050,0x02}, - {0x9051,0x46}, - {0x9052,0x02}, - {0x9056,0x29}, - {0x9057,0xE3}, - {0x9058,0x02}, - {0x9059,0x49}, - {0x905A,0x02}, - {0x905D,0x01}, - {0x905E,0x9C}, - {0x905F,0x6E}, - {0x9060,0x05}, - {0x9061,0x00}, - {0x9062,0x02}, - {0x9065,0x01}, - {0x9066,0xA2}, - {0x9067,0x66}, - {0x9068,0x02}, - {0x9069,0x35}, - {0x906A,0x02}, - {0x906D,0x01}, - {0x906E,0xB5}, - {0x906F,0xC2}, - {0x9070,0x02}, - {0x9071,0x9B}, - {0x9072,0x02}, - {0x9075,0x01}, - {0x9076,0xA2}, - {0x9077,0xD4}, - {0x9078,0x02}, - {0x9079,0xBE}, - {0x907A,0x02}, - {0x907D,0x01}, - {0x907E,0xB7}, - {0x907F,0xEA}, - {0x9080,0x00}, - {0x9081,0x02}, - {0x9082,0x03}, - {0x9086,0x67}, - {0x9087,0x31}, - {0x9088,0x02}, - {0x9089,0xF7}, - {0x908A,0x02}, - {0x908E,0x66}, - {0x908F,0xED}, - {0x9090,0x03}, - {0x9091,0x1D}, - {0x9092,0x02}, - {0x9096,0x67}, - {0x9097,0x73}, - {0x9098,0x03}, - {0x9099,0xD3}, - {0x909A,0x02}, - {0x909E,0x20}, - {0x909F,0x40}, - {0x90A0,0x03}, - {0x90A1,0x3B}, - {0x90A2,0x02}, - {0x90A6,0xC5}, - {0x90A7,0xC0}, - {0x90A8,0x03}, - {0x90A9,0xF0}, - {0x90AA,0x02}, - {0x90AE,0x41}, - {0x90AF,0xB3}, - {0x90B0,0x00}, - {0x90B1,0xA2}, - {0x90B2,0x02}, - {0x90B6,0x44}, - {0x90B7,0xBA}, - {0x90B8,0x00}, - {0x90B9,0xF0}, - {0x90BA,0x03}, - {0x90BE,0x89}, - {0x90BF,0x99}, - {0x90C0,0x04}, - {0x90C1,0x00}, - {0x90C2,0x02}, - {0x90C6,0xA7}, - {0x90C7,0x91}, - {0x90C8,0x04}, - {0x90C9,0x21}, - {0x90CA,0x02}, - {0x90CE,0x3A}, - {0x90CF,0x51}, - {0x90D0,0x00}, - {0x90D1,0xA2}, - {0x90D2,0x02}, - {0x90D6,0x86}, - {0x90D7,0x54}, - {0x90D8,0x04}, - {0x90D9,0x47}, - {0x90DA,0x02}, - {0x9000,0x01}, - {0xffff,0x00}, // 2013-03-01 end - {SEQUENCE_END, 0x00} -#endif -}; -static struct reginfo sensor_init_data1[] = -{ -{0x0009,0x16}, //10 -{0x0085,0x00}, -{0x0040,0x00}, -{0x0016,0x00}, -{0x0046,0x00}, -{0x0041,0x00}, -{0x00B5,0x02}, -{0x7101,0x44}, -{0x00ED,0x0A}, -{0x00EE,0x1E}, -{0x00B3,0x80}, -{0x7104,0x00}, -{0x7105,0x80}, -{0x019C,0x4B}, -{0x019D,0x20}, -{0x0129,0x00}, -{0x0130,0x00}, -{0x0083,0x01}, -{0x0084,0x01}, -{0x01A1,0x80}, -{0x01A2,0x80}, -{0x01A3,0x80}, -{0x01A0,0x01}, -{0x0021,0x00}, -{0x0022,0x01}, - -{0x0040,0x00}, //00 -{0x0060,0x00}, -{0x0013,0x00}, -{0x0041,0x00},//00:5M 03:SVGA - -{0x0061,0x00}, -{0x0046,0x02}, -{0x0066,0x02}, -{0x0012,0x00}, -{0x7102,0x09}, -{0x7103,0x00}, -{0x7158,0x00}, -{0x00E8,0x01}, -{0x7000,0x2C}, -{0x5200,0x01}, -{0x7000,0x0C}, -{0x0143,0x5F}, -{0x0144,0x0D}, -{0x02C2,0x00}, -{0x02C3,0xC0}, -{0x015E,0x40}, -{0x015F,0x00}, -{0x0390,0x01}, -{0x0391,0x00}, -{0x0392,0x00}, -{0x03A0,0x14}, -{0x03A1,0x00}, -{0x03A2,0x5A}, -{0x03A3,0xEE}, -{0x03A4,0x69}, -{0x03A5,0x49}, -{0x03A6,0x3E}, -{0x03A7,0x00}, -{0x03A8,0x39}, -{0x03A9,0x33}, -{0x03B0,0x60}, -{0x03B1,0x00}, -{0x03B2,0x5A}, -{0x03B3,0xEE}, -{0x03B4,0x69}, -{0x03B5,0x49}, -{0x03B6,0x3E}, -{0x03B7,0x00}, -{0x03B8,0x3D}, -{0x03B9,0x20}, -{0x03C0,0x10}, -{0x03C1,0x00}, -{0x03C2,0x5A}, -{0x03C3,0xEE}, -{0x03C4,0x69}, -{0x03C5,0x49}, -{0x03C6,0x3A}, -{0x03C7,0x80}, -{0x03D0,0x64}, -{0x03D1,0x00}, -{0x03D2,0x5A}, -{0x03D3,0xEE}, -{0x03D4,0x69}, -{0x03D5,0x49}, -{0x03D6,0x34}, -{0x03D7,0xD1}, -{0x004C,0x08}, -{0x006C,0x08}, -{0x0350,0x00}, -{0x0351,0x5A}, -{0x0352,0xEE}, -{0x0353,0x69}, -{0x0354,0x49}, -{0x0355,0x39}, -{0x0356,0x6D}, -{0x0357,0x19}, -{0x0358,0x00}, -{0x0359,0x3C}, -{0x035A,0x5A}, -{0x035B,0xEE}, -{0x035C,0x69}, -{0x035D,0x49}, -{0x035E,0x39}, -{0x035F,0x85}, -{0x0049,0x14}, -{0x004A,0x0D}, -{0x0069,0x14}, -{0x006A,0x0D}, -{0x0090,0x00}, -{0x0091,0x5A}, -{0x0092,0xEE}, -{0x0093,0x3E}, -{0x0094,0x00}, -{0x0095,0x69}, -{0x0096,0x49}, -{0x0097,0x39}, -{0x0098,0xCF}, -{0x00A0,0x00}, -{0x00A1,0x5A}, -{0x00A2,0xEE}, -{0x00A3,0x3E}, -{0x00A4,0x00}, -{0x00A5,0x69}, -{0x00A6,0x49}, -{0x00A7,0x3B}, -{0x00A8,0x80}, -#if 0 // 03-06 old LSC -{0x0420,0x00}, -{0x0421,0x09}, -{0x0422,0xff}, -{0x0423,0x9e}, -{0x0424,0x00}, -{0x0425,0x89}, -{0x0426,0x00}, -{0x0427,0xab}, -{0x0428,0xff}, -{0x0429,0xe9}, -{0x042a,0xff}, -{0x042b,0x8b}, -{0x042c,0x00}, -{0x042d,0x73}, -{0x042e,0xff}, -{0x042f,0xb6}, -{0x0430,0x00}, -{0x0431,0x54}, -{0x0432,0xff}, -{0x0433,0x43}, -{0x0434,0x01}, -{0x0435,0x04}, -{0x0436,0x01}, -{0x0437,0x34}, -{0x0438,0xff}, -{0x0439,0x7c}, -{0x043a,0xfe}, -{0x043b,0xd2}, -{0x043c,0x00}, -{0x043d,0x63}, -{0x043e,0xff}, -{0x043f,0x15}, -{0x0450,0x00}, -{0x0451,0x3b}, -{0x0452,0xff}, -{0x0453,0x98}, -{0x0454,0x00}, -{0x0455,0x6f}, -{0x0456,0x00}, -{0x0457,0x93}, -{0x0458,0xff}, -{0x0459,0xad}, -{0x045a,0xff}, -{0x045b,0x87}, -{0x045c,0x00}, -{0x045d,0x52}, -{0x045e,0xff}, -{0x045f,0xa7}, -{0x0440,0xff}, -{0x0441,0xfd}, -{0x0442,0xff}, -{0x0443,0x6c}, -{0x0444,0x00}, -{0x0445,0x90}, -{0x0446,0x00}, -{0x0447,0xa1}, -{0x0448,0x00}, -{0x0449,0x02}, -{0x044a,0xff}, -{0x044b,0x48}, -{0x044c,0x00}, -{0x044d,0x5b}, -{0x044e,0xff}, -{0x044f,0xb4}, -{0x0460,0xff}, -{0x0461,0x69}, -{0x0462,0xff}, -{0x0463,0xbb}, -{0x0464,0x00}, -{0x0465,0x84}, -{0x0466,0x00}, -{0x0467,0xa3}, -{0x0468,0x00}, -{0x0469,0x0e}, -{0x046a,0x00}, -{0x046b,0x76}, -{0x046c,0xff}, -{0x046d,0xaf}, -{0x046e,0xff}, -{0x046f,0xf5}, -{0x0470,0xff}, -{0x0471,0x8a}, -{0x0472,0xff}, -{0x0473,0x5a}, -{0x0474,0x00}, -{0x0475,0xef}, -{0x0476,0x01}, -{0x0477,0x16}, -{0x0478,0xff}, -{0x0479,0xd4}, -{0x047a,0x00}, -{0x047b,0x02}, -{0x047c,0x00}, -{0x047d,0x2c}, -{0x047e,0xff}, -{0x047f,0x95}, -{0x0490,0xff}, -{0x0491,0x9b}, -{0x0492,0xff}, -{0x0493,0x91}, -{0x0494,0x00}, -{0x0495,0x6f}, -{0x0496,0x00}, -{0x0497,0x95}, -{0x0498,0xff}, -{0x0499,0xd5}, -{0x049a,0x01}, -{0x049b,0x20}, -{0x049c,0xff}, -{0x049d,0xfb}, -{0x049e,0xff}, -{0x049f,0xe1}, -{0x0480,0xff}, -{0x0481,0x5a}, -{0x0482,0xff}, -{0x0483,0x91}, -{0x0484,0x00}, -{0x0485,0x8c}, -{0x0486,0x00}, -{0x0487,0x9f}, -{0x0488,0x00}, -{0x0489,0x29}, -{0x048a,0x00}, -{0x048b,0x53}, -{0x048c,0xff}, -{0x048d,0x80}, -{0x048e,0xff}, -{0x048f,0xf7}, -{0x04a0,0xff}, -{0x04a1,0x6c}, -{0x04a2,0xff}, -{0x04a3,0xb9}, -{0x04a4,0x00}, -{0x04a5,0x81}, -{0x04a6,0x00}, -{0x04a7,0x93}, -{0x04a8,0x00}, -{0x04a9,0x1c}, -{0x04aa,0x00}, -{0x04ab,0x39}, -{0x04ac,0xff}, -{0x04ad,0x9f}, -{0x04ae,0x00}, -{0x04af,0x0e}, -{0x04b0,0xff}, -{0x04b1,0xe0}, -{0x04b2,0xff}, -{0x04b3,0x7b}, -{0x04b4,0x00}, -{0x04b5,0xaa}, -{0x04b6,0x00}, -{0x04b7,0xc8}, -{0x04b8,0xff}, -{0x04b9,0xe1}, -{0x04ba,0x00}, -{0x04bb,0x0e}, -{0x04bc,0x00}, -{0x04bd,0x0b}, -{0x04be,0xff}, -{0x04bf,0xff}, -{0x04d0,0xff}, -{0x04d1,0xac}, -{0x04d2,0xff}, -{0x04d3,0x93}, -{0x04d4,0x00}, -{0x04d5,0x64}, -{0x04d6,0x00}, -{0x04d7,0x83}, -{0x04d8,0xff}, -{0x04d9,0xdb}, -{0x04da,0x00}, -{0x04db,0xa8}, -{0x04dc,0xff}, -{0x04dd,0xf5}, -{0x04de,0x00}, -{0x04df,0x15}, -{0x04c0,0xff}, -{0x04c1,0x5d}, -{0x04c2,0xff}, -{0x04c3,0x9c}, -{0x04c4,0x00}, -{0x04c5,0x82}, -{0x04c6,0x00}, -{0x04c7,0x96}, -{0x04c8,0x00}, -{0x04c9,0x33}, -{0x04ca,0x00}, -{0x04cb,0x07}, -{0x04cc,0xff}, -{0x04cd,0x71}, -{0x04ce,0x00}, -{0x04cf,0x11}, -{0x04e0,0xff}, -{0x04e1,0x6d}, -{0x04e2,0xff}, -{0x04e3,0xb8}, -{0x04e4,0x00}, -{0x04e5,0x84}, -{0x04e6,0x00}, -{0x04e7,0x96}, -{0x04e8,0xff}, -{0x04e9,0xc0}, -{0x04ea,0x00}, -{0x04eb,0x6d}, -{0x04ec,0xff}, -{0x04ed,0xbb}, -{0x04ee,0x00}, -{0x04ef,0x00}, -{0x04f0,0xff}, -{0x04f1,0xe0}, -{0x04f2,0xff}, -{0x04f3,0x95}, -{0x04f4,0x00}, -{0x04f5,0xa7}, -{0x04f6,0x00}, -{0x04f7,0xc8}, -{0x04f8,0xff}, -{0x04f9,0xde}, -{0x04fa,0x00}, -{0x04fb,0x7e}, -{0x04fc,0x00}, -{0x04fd,0x36}, -{0x04fe,0x00}, -{0x04ff,0x10}, -{0x0510,0xff}, -{0x0511,0xc1}, -{0x0512,0xff}, -{0x0513,0x9f}, -{0x0514,0x00}, -{0x0515,0x6a}, -{0x0516,0x00}, -{0x0517,0x89}, -{0x0518,0xff}, -{0x0519,0xdc}, -{0x051a,0x00}, -{0x051b,0x55}, -{0x051c,0x00}, -{0x051d,0x09}, -{0x051e,0x00}, -{0x051f,0x0d}, -{0x0500,0xff}, -{0x0501,0x60}, -{0x0502,0xff}, -{0x0503,0x9e}, -{0x0504,0x00}, -{0x0505,0x81}, -{0x0506,0x00}, -{0x0507,0x9c}, -{0x0508,0xff}, -{0x0509,0xc0}, -{0x050a,0x00}, -{0x050b,0x40}, -{0x050c,0xff}, -{0x050d,0x8e}, -{0x050e,0x00}, -{0x050f,0x00}, -{0x0561,0x0e}, -{0x0562,0x01}, -{0x0563,0x01}, -{0x0564,0x06}, -#endif // LSC end -#if 1 //new LSC start - 0306 -{0x0420,0x00}, -{0x0421,0x26}, -{0x0422,0xff}, -{0x0423,0x03}, -{0x0424,0x00}, -{0x0425,0x63}, -{0x0426,0x00}, -{0x0427,0x8e}, -{0x0428,0xff}, -{0x0429,0xf3}, -{0x042A,0x00}, -{0x042B,0x26}, -{0x042C,0xff}, -{0x042D,0xc8}, -{0x042E,0xff}, -{0x042F,0x5f}, -{0x0430,0x00}, -{0x0431,0x10}, -{0x0432,0xfe}, -{0x0433,0xcf}, -{0x0434,0x00}, -{0x0435,0xc2}, -{0x0436,0x00}, -{0x0437,0xf2}, -{0x0438,0xff}, -{0x0439,0xd0}, -{0x043A,0x00}, -{0x043B,0xa1}, -{0x043C,0x00}, -{0x043D,0x2f}, -{0x043E,0xfe}, -{0x043F,0xdc}, -{0x0450,0x00}, -{0x0451,0x36}, -{0x0452,0xff}, -{0x0453,0x60}, -{0x0454,0x00}, -{0x0455,0x43}, -{0x0456,0x00}, -{0x0457,0x6b}, -{0x0458,0xff}, -{0x0459,0xdf}, -{0x045A,0x00}, -{0x045B,0x83}, -{0x045C,0xff}, -{0x045D,0xeb}, -{0x045E,0xff}, -{0x045F,0x5f}, -{0x0440,0x00}, -{0x0441,0x36}, -{0x0442,0xff}, -{0x0443,0x3e}, -{0x0444,0x00}, -{0x0445,0x6d}, -{0x0446,0x00}, -{0x0447,0x87}, -{0x0448,0x00}, -{0x0449,0x0f}, -{0x044A,0xff}, -{0x044B,0xd3}, -{0x044C,0x00}, -{0x044D,0x18}, -{0x044E,0xff}, -{0x044F,0x4f}, -{0x0561,0x08}, -{0x0460,0x00}, -{0x0461,0x22}, -{0x0462,0xff}, -{0x0463,0x0a}, -{0x0464,0x00}, -{0x0465,0x63}, -{0x0466,0x00}, -{0x0467,0x8b}, -{0x0468,0xff}, -{0x0469,0xf9}, -{0x046A,0x00}, -{0x046B,0x17}, -{0x046C,0xff}, -{0x046D,0xbd}, -{0x046E,0xff}, -{0x046F,0x65}, -{0x0470,0x00}, -{0x0471,0x15}, -{0x0472,0xfe}, -{0x0473,0xd7}, -{0x0474,0x00}, -{0x0475,0xb6}, -{0x0476,0x00}, -{0x0477,0xe5}, -{0x0478,0xff}, -{0x0479,0xd0}, -{0x047A,0x00}, -{0x047B,0xb2}, -{0x047C,0x00}, -{0x047D,0x2c}, -{0x047E,0xfe}, -{0x047F,0xe6}, -{0x0490,0x00}, -{0x0491,0x2b}, -{0x0492,0xff}, -{0x0493,0x71}, -{0x0494,0x00}, -{0x0495,0x43}, -{0x0496,0x00}, -{0x0497,0x69}, -{0x0498,0xff}, -{0x0499,0xd7}, -{0x049A,0x00}, -{0x049B,0x59}, -{0x049C,0xff}, -{0x049D,0xde}, -{0x049E,0xff}, -{0x049F,0x76}, -{0x0480,0x00}, -{0x0481,0x38}, -{0x0482,0xff}, -{0x0483,0x3a}, -{0x0484,0x00}, -{0x0485,0x6b}, -{0x0486,0x00}, -{0x0487,0x86}, -{0x0488,0x00}, -{0x0489,0x14}, -{0x048A,0xff}, -{0x048B,0xd7}, -{0x048C,0x00}, -{0x048D,0x13}, -{0x048E,0xff}, -{0x048F,0x58}, -{0x0562,0x08}, -{0x04A0,0x00}, -{0x04A1,0x17}, -{0x04A2,0xff}, -{0x04A3,0x2e}, -{0x04A4,0x00}, -{0x04A5,0x5d}, -{0x04A6,0x00}, -{0x04A7,0x7a}, -{0x04A8,0xff}, -{0x04A9,0xf9}, -{0x04AA,0xff}, -{0x04AB,0xc0}, -{0x04AC,0xff}, -{0x04AD,0xc7}, -{0x04AE,0xff}, -{0x04AF,0x7d}, -{0x04B0,0x00}, -{0x04B1,0x13}, -{0x04B2,0xff}, -{0x04B3,0x45}, -{0x04B4,0x00}, -{0x04B5,0x70}, -{0x04B6,0x00}, -{0x04B7,0x96}, -{0x04B8,0xff}, -{0x04B9,0xde}, -{0x04BA,0x00}, -{0x04BB,0x17}, -{0x04BC,0x00}, -{0x04BD,0x23}, -{0x04BE,0xff}, -{0x04BF,0x46}, -{0x04D0,0x00}, -{0x04D1,0x17}, -{0x04D2,0xff}, -{0x04D3,0x99}, -{0x04D4,0x00}, -{0x04D5,0x3d}, -{0x04D6,0x00}, -{0x04D7,0x5f}, -{0x04D8,0xff}, -{0x04D9,0xd1}, -{0x04DA,0xff}, -{0x04DB,0xe2}, -{0x04DC,0xff}, -{0x04DD,0xc6}, -{0x04DE,0xff}, -{0x04DF,0x9c}, -{0x04C0,0x00}, -{0x04C1,0x32}, -{0x04C2,0xff}, -{0x04C3,0x4e}, -{0x04C4,0x00}, -{0x04C5,0x5e}, -{0x04C6,0x00}, -{0x04C7,0x7c}, -{0x04C8,0x00}, -{0x04C9,0x17}, -{0x04CA,0xff}, -{0x04CB,0x9b}, -{0x04CC,0x00}, -{0x04CD,0x06}, -{0x04CE,0xff}, -{0x04CF,0x70}, -{0x0563,0x05}, -{0x04E0,0x00}, -{0x04E1,0x11}, -{0x04E2,0xff}, -{0x04E3,0x20}, -{0x04E4,0x00}, -{0x04E5,0x5f}, -{0x04E6,0x00}, -{0x04E7,0x7b}, -{0x04E8,0x00}, -{0x04E9,0x02}, -{0x04EA,0xff}, -{0x04EB,0xf1}, -{0x04EC,0xff}, -{0x04ED,0xb7}, -{0x04EE,0xff}, -{0x04EF,0x7b}, -{0x04F0,0x00}, -{0x04F1,0x1c}, -{0x04F2,0xff}, -{0x04F3,0x08}, -{0x04F4,0x00}, -{0x04F5,0x7e}, -{0x04F6,0x00}, -{0x04F7,0xac}, -{0x04F8,0xff}, -{0x04F9,0xeb}, -{0x04FA,0x00}, -{0x04FB,0x93}, -{0x04FC,0x00}, -{0x04FD,0x1b}, -{0x04FE,0xff}, -{0x04FF,0x11}, -{0x0510,0xff}, -{0x0511,0xfe}, -{0x0512,0xff}, -{0x0513,0x8e}, -{0x0514,0x00}, -{0x0515,0x4a}, -{0x0516,0x00}, -{0x0517,0x6e}, -{0x0518,0xff}, -{0x0519,0xbb}, -{0x051A,0xff}, -{0x051B,0xcc}, -{0x051C,0xff}, -{0x051D,0x9a}, -{0x051E,0xff}, -{0x051F,0xa2}, -{0x0500,0x00}, -{0x0501,0x30}, -{0x0502,0xff}, -{0x0503,0x36}, -{0x0504,0x00}, -{0x0505,0x5d}, -{0x0506,0x00}, -{0x0507,0x81}, -{0x0508,0x00}, -{0x0509,0x1f}, -{0x050A,0xff}, -{0x050B,0xd4}, -{0x050C,0xff}, -{0x050D,0xfe}, -{0x050E,0xff}, -{0x050F,0x75}, -{0x0564,0x00}, -#endif //new LSC end -{0x0324,0x39}, -{0x0325,0xAE}, -{0x0326,0x3A}, -{0x0327,0x29}, -{0x0328,0x3B}, -{0x0329,0x0A}, -{0x032A,0x3B}, -{0x032B,0x62}, -{0x0320,0x01}, -{0x0321,0x04}, -{0x0322,0x01}, -{0x0323,0x01}, -{0x0330,0x01}, -{0x0384,0x00}, -{0x0337,0x01}, -{0x03EC,0x39}, -{0x03ED,0x85}, -{0x03FC,0x3A}, -{0x03FD,0x14}, -{0x040C,0x3A}, -{0x040D,0xF6}, -{0x041C,0x3B}, -{0x041D,0x9A}, -{0x03E0,0xB6}, -{0x03E1,0x04}, -{0x03E2,0xBB}, -{0x03E3,0xE9}, -{0x03E4,0xBC}, -{0x03E5,0x70}, -{0x03E6,0x37}, -{0x03E7,0x02}, -{0x03E8,0xBC}, -{0x03E9,0x00}, -{0x03EA,0xBF}, -{0x03EB,0x12}, -{0x03F0,0xBA}, -{0x03F1,0x7B}, -{0x03F2,0xBA}, -{0x03F3,0x83}, -{0x03F4,0xBB}, -{0x03F5,0xBC}, -{0x03F6,0x38}, -{0x03F7,0x2D}, -{0x03F8,0xBB}, -{0x03F9,0x23}, -{0x03FA,0xBD}, -{0x03FB,0xAC}, -{0x0400,0xBE}, -{0x0401,0x96}, -{0x0402,0xB9}, -{0x0403,0xBE}, -{0x0404,0xBB}, -{0x0405,0x57}, -{0x0406,0x3A}, -{0x0407,0xBB}, -{0x0408,0xB3}, -{0x0409,0x17}, -{0x040A,0xBE}, -{0x040B,0x66}, -{0x0410,0xBB}, -{0x0411,0x2A}, -{0x0412,0xBA}, -{0x0413,0x00}, -{0x0414,0xBB}, -{0x0415,0x10}, -{0x0416,0xB8}, -{0x0417,0xCD}, -{0x0418,0xB7}, -{0x0419,0x5C}, -{0x041A,0xBB}, -{0x041B,0x6C}, -{0x01f8,0x3c}, -{0x01f9,0x00}, -{0x01fa,0x00}, -{0x02a2,0x3e}, -{0x02a3,0x00}, -{0x02a4,0x3e}, -{0x02a5,0x00}, -{0x02a6,0x3e}, -{0x02a7,0x00}, -{0x02a8,0x3e}, -{0x02a9,0x00}, -{0x056c,0x42}, -{0x056d,0x00}, -{0x056e,0x42}, -{0x056f,0x00}, -{0x0570,0x42}, -{0x0571,0x00}, -{0x0572,0x42}, -{0x0573,0x00}, -{0x0081,0x55}, //6E->55 -{0x0588,0x00}, -{0x0589,0x5A}, -{0x058A,0xEE}, -{0x058B,0x69}, -{0x058C,0x49}, -{0x058D,0x3D}, -{0x058E,0x3D}, -{0x0080,0x6C}, -{0x0082,0x5A}, -{0x0010,0x01}, - - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_init_data2[] = -{ -{0x4708,0x00}, -{0x4709,0x00}, -{0x4710,0x00}, -{0x4711,0x00}, -//AF intial setting -#if 0 -{0x065A,0x00}, -{0x06C9,0x01}, -{0x06CD,0x01}, -{0x06CE,0xBD}, -{0x06CF,0x00}, -{0x06D0,0x93}, -{0x06D1,0x02}, -{0x06D2,0x30}, -{0x06D3,0xD4}, -{0x06D4,0x01}, -{0x06DB,0x59}, -{0x06DC,0x0D}, -{0x0730,0x00}, -{0x0731,0x00}, -{0x0732,0x03}, -{0x0733,0xFF}, -{0x0734,0x03}, -{0x0735,0xff}, -{0x0755,0x01}, -{0x0756,0x00},//03->00 -{0x075B,0x01},//00 -{0x075E,0x00}, -{0x0764,0x01}, -{0x0766,0x01},//00 -{0x0768,0x01}, -{0x076A,0x00},//01 -{0x0758,0x01}, -{0x075C,0x01}, -{0x0770,0x98}, -{0x0771,0x19}, -{0x0772,0x1B}, -{0x0774,0x01}, -{0x0775,0x4A}, -{0x0777,0x00}, -{0x0778,0x45}, -{0x0779,0x00}, -{0x077A,0x02}, -{0x077D,0x01}, -{0x077E,0x03}, -{0x0783,0x10}, -{0x0785,0x14}, -{0x0846,0x06}, -{0x0847,0x05}, -#endif // old af @ vcm end -03-06 -#if 1 //03-06 new af @ vcm -{0x0659,0x01}, -{0x065A,0x00}, -{0x06C9,0x01}, -{0x06CD,0x01}, -{0x06CE,0xBD}, -{0x06CF,0x00}, -{0x06D0,0x93}, -{0x06D1,0x02}, -{0x06D2,0x30}, -{0x06D3,0xD4}, -{0x06D4,0x01}, -{0x06DB,0x59}, -{0x06DC,0x0d}, -{0x0730,0x00}, -{0x0731,0x00}, -{0x0732,0x03}, -{0x0733,0xFF}, -{0x0734,0x03}, -{0x0735,0x70}, -{0x0755,0x01}, -{0x0756,0x00}, -{0x075A,0x00}, -{0x075B,0x01}, -{0x075E,0x00}, -{0x0764,0x01}, -{0x0766,0x01}, -{0x0768,0x01}, -{0x076A,0x00}, -{0x0758,0x01}, -{0x075C,0x01}, -{0x0770,0x98}, -{0x0771,0x19}, -{0x0772,0x1B}, -{0x0774,0x01}, -{0x0775,0x4a}, -{0x0777,0x00}, -{0x0778,0x45}, -{0x0779,0x00}, -{0x077A,0x02}, -{0x077D,0x01}, -{0x077E,0x03}, -{0x0783,0x10}, -{0x0785,0x14}, -{0x0788,0x04}, -{0x0846,0x06}, -{0x0847,0x05}, -#endif -{0xC41A,0x05}, -{0xC423,0x11}, -{0xC427,0x11}, -{0x300B,0x09}, - -{0x7000,0x08}, -{0x5200,0x09}, -{0x00B2,0x50}, -{0x00B3,0x80}, -{0x00B5,0x01}, -{0x0030,0x14}, -{0x0040,0x01}, //AB2 -{0x0041,0x03}, //SVGA mode - -{0x0010,0x01}, - - {SEQUENCE_END, 0x00} -}; //sensor_init_data2 end - - - -/* 720p 15fps @ 1280x720 */ - -static struct reginfo sensor_720p[]= -{ - - {SEQUENCE_END, 0x00} -}; - -/* 1080p, 0x15fps, 0xyuv @1920x1080 */ - -static struct reginfo sensor_1080p[]= -{ - - {SEQUENCE_END, 0x00} -}; - -/* 2592X1944 QSXGA */ -static struct reginfo sensor_qsxga[] = -{ - -//{0x0010,0x02}, - -{0x7000,0x08}, -{0x5200,0x09}, -//{0x00B2,0x50}, -//{0x00B3,0x80}, -//{0x00B5,0x02}, -//{0x0030,0x11}, -{0x0040,0x00}, -{0x0041,0x00}, -{0x0010,0x01}, - - {SEQUENCE_END, 0x00} -}; -/* 2048*1536 QXGA */ -static struct reginfo sensor_qxga[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 1600X1200 UXGA */ -static struct reginfo sensor_uxga[] = -{ -#if 0 -{0x7000,0x08}, -{0x5200,0x09}, -//{0x00B2,0x50}, -//{0x00B3,0x80}, -//{0x00B5,0x02}, -//{0x0030,0x14}, -{0x0040,0x00}, -{0x0041,0x01}, -{0x0010,0x01}, -#endif - {SEQUENCE_END, 0x00} -}; - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ -#if 0 -{0x7000,0x08}, -{0x5200,0x09}, -//{0x00B2,0x50}, -//{0x00B3,0x80}, -//{0x00B5,0x02}, -//{0x0030,0x14}, -{0x0040,0x00}, -{0x0041,0x02}, -{0x0010,0x01}, -#endif - {SEQUENCE_END, 0x00} -}; -/* 1024X768 XGA */ -static struct reginfo sensor_xga[] = -{ -#if 0 -{0x7000,0x08}, -{0x5200,0x09}, -//{0x00B2,0x50}, -//{0x00B3,0x80}, -//{0x00B5,0x02}, -//{0x0030,0x11}, -{0x0040,0x01}, -{0x0041,0x0a}, -{0x0042,0x05}, -{0x0043,0x00}, -{0x0044,0x03}, -{0x0045,0x20}, -{0x0010,0x01}, -#endif - {SEQUENCE_END, 0x00} -}; -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ -//{0x0010,0x02}, - -//{0x7000,0x08}, -//{0x5200,0x09}, -//{0x00B2,0x50}, -//{0x00B3,0x80}, -//{0x00B5,0x02}, -//{0x0030,0x14}, -{0x0040,0x01}, -{0x0041,0x03}, - -{0x00ed,0x0A}, -{0x00ee,0x1E}, - -//{0x0010,0x01}, - - {SEQUENCE_END, 0x00} -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - - -{0x7000,0x08}, -{0x5200,0x09}, -{0x0040,0x01}, -{0x0041,0x04}, -{0x00ed,0x1E}, -{0x00ee,0x1E}, -{0x331e,0x00}, - - {SEQUENCE_END, 0x00} -}; -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - - {SEQUENCE_END, 0x00} -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - - {SEQUENCE_END, 0x00} -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - - {SEQUENCE_END, 0x00} -}; -#endif -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - - {SEQUENCE_END, 0x00} -}; - - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0x01A0,0x01}, - {SEQUENCE_END, 0x00} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0x01A0,0x04}, - {SEQUENCE_END, 0x00} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - {0x01A0,0x05}, - {SEQUENCE_END, 0x00} -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - {0x01A0,0x07}, - {SEQUENCE_END, 0x00} -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - {0x01A0,0x08}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - {0x082,0x34}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Brightness1[]= -{ - {0x082,0x44}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - {0x082,0x54}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Brightness3[]= -{ - {0x082,0x64}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Brightness4[]= -{ - {0x082,0x74}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - {0x082,0x84}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x0380,0x0}, - {0x0381,0x0}, - {0x0382,0x0}, - {0x0384,0x0}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Effect_WandB[] = -{ - {0x0380,0x0}, - {0x0381,0x0}, - {0x0382,0x0}, - {0x0384,0x5}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x0380,0x0}, - {0x0381,0x0}, - {0x0382,0x0}, - {0x0384,0x6}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - //Negative - {0x0380,0x0}, - {0x0381,0x0}, - {0x0382,0x0}, - {0x0384,0x8}, - {SEQUENCE_END, 0x00} -};static struct reginfo sensor_Effect_Bluish[] = -{ - // Bluish -{0x0380,0x0}, - {0x0381,0x0}, - {0x0382,0x0}, - {0x0384,0x4}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish - {0x0380,0x0}, - {0x0381,0x0}, - {0x0382,0x0}, - {0x0384,0x3}, - {SEQUENCE_END, 0x00} -}; -/*static struct reginfo sensor_Effect_Reddish[] = -{ - // Greenish - - {SEQUENCE_END, 0x00} -};*/ - -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Exposure1[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Exposure2[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Exposure4[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Exposure5[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Exposure6[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {0x081,0x34}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {0x081,0x44}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {0x081,0x54}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Saturation3[]= -{ - {0x081,0x64}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Saturation4[]= -{ - {0x081,0x74}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Saturation5[]= -{ - {0x081,0x84}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Saturation6[]= -{ - {0x081,0x94}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2,sensor_Saturation3, sensor_Saturation4, sensor_Saturation5,sensor_Saturation6, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - {0x080,0x34}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - {0x080,0x44}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Contrast2[]= -{ - {0x080,0x54}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - {0x080,0x64}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - {0x080,0x74}, - {SEQUENCE_END, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - {0x080,0x84}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - {0x080,0x94}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_MirrorOff[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ - - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_SceneNight[] = -{ - //15fps ~ 3.75fps night mode for 60/50Hz light environment, 24Mhz clock input,24Mzh pclk - - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Zoom1[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Zoom2[] = -{ - {SEQUENCE_END, 0x00} -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL}; -#endif -static const struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - /*{ - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - },*/ - { - .id = V4L2_CID_FOCUSZONE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "FocusZone Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - },{ - .id = V4L2_CID_FOCUS_AUTO, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Focus Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - },{ - .id = V4L2_CID_FOCUS_CONTINUOUS, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Focus Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -static int sensor_deactivate(struct i2c_client *client); -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf); -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; -enum sensor_wq_cmd -{ - WqCmd_af_init, - WqCmd_af_single, - WqCmd_af_special_pos, - WqCmd_af_far_pos, - WqCmd_af_near_pos, - WqCmd_af_continues, - WqCmd_af_continues_pause, - WqCmd_af_return_idle, -}; -enum sensor_wq_result -{ - WqRet_success = 0, - WqRet_fail = -1, - WqRet_inval = -2 -}; -struct sensor_work -{ - struct i2c_client *client; - struct delayed_work dwork; - enum sensor_wq_cmd cmd; - wait_queue_head_t done; - enum sensor_wq_result result; - bool wait; - int var; - int zone_pos[4]; -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int auto_focus; - int affm_reinit; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - struct reginfo *winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int enable; - unsigned int funmodule_state; -} sensor_info_priv_t; - - - -struct sensor_parameter -{ - char af_pos[2]; -}; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - struct sensor_parameter parameter; - struct workqueue_struct *sensor_wq; - struct mutex wq_lock; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - - -#if CONFIG_SENSOR_WRITE_REGS -static int sensor_write_regs(struct i2c_client *client, u8 *reg_info, int num) -{ - int err=0,cnt; - struct i2c_msg msg[1]; - - msg->len = num; - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = reg_info; - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - - cnt= 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg failed, try to write again!\n", SENSOR_NAME_STRING()); - udelay(10); - } - } - - return err; - -} - -#endif - - - - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, u16 reg, u8 val) -{ - int err,cnt; - u8 buf[3]; - struct i2c_msg msg[1]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - buf[2] = val; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u16 reg, u8 *val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[2]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_Focus - struct sensor *sensor = to_sensor(client); -#endif -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif -#if CONFIG_SENSOR_WRITE_REGS - int j = 0, reg_num; - u8 *ptemp, *phead; - int reg_length; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - while (regarray[i].reg != SEQUENCE_END) { - - #if 0 - if ((regarray == sensor_af_firmware) && (sensor->info_priv.enable == 0)) { - SENSOR_DG("%s disable, Download af firmware terminated!\n",SENSOR_NAME_STRING()); - err = -EINVAL; - goto sensor_write_array_end; - } - #endif - -#if CONFIG_SENSOR_WRITE_REGS - - j = i; - reg_num = 2; - reg_length = 0x0001; - - while((regarray[i].reg + reg_length) == regarray[i+1].reg) { - i++; - reg_num++; - if(reg_num >= WRITE_REGS_NUM) - break; - } - - if(reg_num > 2) { - - int size_num; - size_num = reg_num + 1; - - ptemp = phead = (u8*)kmalloc((size_num+10)*sizeof(u8),GFP_KERNEL); - if (!phead) { - SENSOR_DG("-------------write registers allocate memory fail!!!\n"); - i = j; - err = sensor_write(client, regarray[i].reg, regarray[i].val); - } else { - *phead = regarray[j].reg >> 8; - *(ptemp+1) = regarray[j].reg & 0xFF; - ptemp += 2; - for( ; reg_num > 0; reg_num --, j++) { - *ptemp ++ = regarray[j].val; - } - - ptemp = phead; - err = sensor_write_regs(client, ptemp,size_num); - kfree(phead); - } - }else{ - err = sensor_write(client, regarray[i].reg, regarray[i].val); - } -#else - err = sensor_write(client, regarray[i].reg, regarray[i].val); -#endif - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - i++; - } - - #if CONFIG_SENSOR_Focus - if (((regarray->reg == SEQUENCE_PROPERTY) && (regarray->val == SEQUENCE_INIT)) - || (regarray == sensor_init_data)) { - sensor->info_priv.affm_reinit = 1; - } - #endif - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != 0) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif -#if CONFIG_SENSOR_Focus -struct af_cmdinfo -{ - char cmd_tag; - char cmd_para[4]; - char validate_bit; -}; -static int sensor_af_cmdset(struct i2c_client *client, int cmd_main, struct af_cmdinfo *cmdinfo) -{ - - return 0; -sensor_af_cmdset_err: - return -1; -} - -static int sensor_af_idlechk(struct i2c_client *client) -{ - int ret = 0; - - sensor_write(client,0x070A, 0x00); - sensor_write(client,0x0700, 0x03); - sensor_write(client,0x0701, 0xFF); - sensor_write(client,0x070C, 0x00); - sensor_write(client,0x070C, 0x07); - -sensor_af_idlechk_end: - return ret; -} -static int sensor_af_touch_zone(struct i2c_client *client, int *zone_pos) -{ - int ret = 0; - int xstart,ystart; - - *zone_pos += 1000; - *(zone_pos+1) += 1000; - *(zone_pos+2) += 1000; - *(zone_pos+3) += 1000; - - xstart = ((*zone_pos + *(zone_pos+2))>>1)*800/2000; - ystart = ((*(zone_pos+1) + *(zone_pos+3))>>1)*600/2000; - - if (xstart>0xa0) { - xstart -= 0xa0; - } else { - xstart = 0; - } - - if (ystart>0xa0) { - ystart -= 0xa0; - } else { - ystart = 0; - } - - ret |= sensor_write(client, AF_ZONE0_WEIGHT,0x01); - ret |= sensor_write(client, AF_ZONE1_WEIGHT,0x00); - ret |= sensor_write(client, AF_ZONE2_WEIGHT,0x00); - ret |= sensor_write(client, AF_ZONE3_WEIGHT,0x00); - ret |= sensor_write(client, AF_ZONE4_WEIGHT,0x00); - ret |= sensor_write(client, AF_ZONE5_WEIGHT,0x00); - ret |= sensor_write(client, AF_ZONE6_WEIGHT,0x00); - ret |= sensor_write(client, FACE_LC,0x03); - - ret |= sensor_write(client, FACE_START_XH, ((xstart&0xff00)>>8)); - ret |= sensor_write(client, FACE_START_XL, xstart&0xff); - ret |= sensor_write(client, FACE_START_YH, ((ystart&0xff00)>>8)); - ret |= sensor_write(client, FACE_START_YL, ystart&0xff); - - ret |= sensor_write(client, FACE_SIZE_XH, 0x01); - ret |= sensor_write(client, FACE_SIZE_XL, 0x40); - ret |= sensor_write(client, FACE_SIZE_YH, 0x01); - ret |= sensor_write(client, FACE_SIZE_YL, 0x40); - - SENSOR_DG("%s touch focus zone at (%d,%d)\n",SENSOR_NAME_STRING(), xstart,ystart); - msleep(10); -sensor_af_zone_end: - return ret; -} -static int sensor_af_single(struct i2c_client *client) -{ - int ret = 0; - char state,cnt=0; - struct sensor *sensor = to_sensor(client); - - ret |= sensor_write(client,AF_MODES_REG,0x03); - ret |= sensor_write(client,AF_AUTOCMDS_REG,0x01); - msleep(200); - ret |= sensor_write(client,AF_AUTOCMDS_REG,0x02); - - do { - msleep(20); - sensor_read(client,AF_FINISHCHK_REG,&state); - cnt++; - }while ((state != 1) && (cnt<100)); - - if (state == 1) { - sensor_read(client, AF_LENSPOS_REG_H,&sensor->parameter.af_pos[0]); - sensor_read(client, AF_LENSPOS_REG_L,&sensor->parameter.af_pos[1]); - } - - SENSOR_DG("%s single focus, state: %d cnt: %d\n",SENSOR_NAME_STRING(),state,cnt); -sensor_af_single_end: - return ret; -} - -static int sensor_af_const(struct i2c_client *client) -{ - int ret = 0; - - ret = sensor_write(client, AF_MODES_REG, 0x01); - - SENSOR_DG("%s const focus\n",SENSOR_NAME_STRING()); - return ret; -} -static int sensor_af_const_pause (struct i2c_client *client) -{ - int ret = 0; - char status; - struct sensor *sensor = to_sensor(client); - - sensor_read(client, 0x07ae, &status); - - if (status == 1) { - sensor_read(client, AF_LENSPOS_REG_H,&sensor->parameter.af_pos[0]); - sensor_read(client, AF_LENSPOS_REG_L,&sensor->parameter.af_pos[1]); - } else { - sensor_af_single(client); - } - - SENSOR_DG("%s const focus pause\n",SENSOR_NAME_STRING()); - -} -static int sensor_af_special_pos (struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - char status=0; - - sensor_write(client,0x070A, 0x00); - sensor_write(client,0x0734, sensor->parameter.af_pos[0]& 0xFF); - sensor_write(client,0x0735, sensor->parameter.af_pos[1] & 0xFF); - sensor_write(client,0x070C, 0x00); - mdelay(100); - sensor_write(client,0x070C, 0x05); - return 0; -} - -static int sensor_af_init(struct i2c_client *client) -{ - int ret = 0; - char state,cnt; - -sensor_af_init_end: - SENSOR_DG("%s %s ret:0x%x \n",SENSOR_NAME_STRING(),__FUNCTION__,ret); - return ret; -} - -static int sensor_af_downfirmware(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - int ret=0; - struct soc_camera_device *icd = client->dev.platform_data; - struct v4l2_mbus_framefmt mf; - - SENSOR_DG("%s %s Enter\n",SENSOR_NAME_STRING(), __FUNCTION__); - - if (sensor_af_init(client)) { - sensor->info_priv.funmodule_state &= (~SENSOR_AF_IS_OK); - ret = -1; - } else { - sensor->info_priv.funmodule_state |= SENSOR_AF_IS_OK; - - mf.width = icd->user_width; - mf.height = icd->user_height; - mf.code = sensor->info_priv.fmt.code; - mf.colorspace = sensor->info_priv.fmt.colorspace; - mf.field = V4L2_FIELD_NONE; - - if (sensor_fmt_videochk(NULL, &mf) == true) { /* ddl@rock-chips.com: focus mode fix const auto focus in video */ - ret = sensor_af_const(client); - } else { - switch (sensor->info_priv.auto_focus) - { - case SENSOR_AF_MODE_AUTO: - { - ret = sensor_af_single(client); - break; - } - case SENSOR_AF_MODE_CLOSE: - { - ret = 0; - break; - } - case SENSOR_AF_MODE_CONTINUOUS: - { - ret = sensor_af_const(client); - break; - } - default: - { - SENSOR_DG("%s focus mode(0x%x) is unkonwn\n",SENSOR_NAME_STRING(),sensor->info_priv.auto_focus); - goto sensor_af_downfirmware_end; - } - } - } - SENSOR_DG("%s sensor_af_downfirmware set focus mode(0x%x) ret:0x%x\n",SENSOR_NAME_STRING(), sensor->info_priv.auto_focus,ret); - } - -sensor_af_downfirmware_end: - - return ret; -} -static void sensor_af_workqueue(struct work_struct *work) -{ - struct sensor_work *sensor_work = container_of(work, struct sensor_work, dwork.work); - struct i2c_client *client = sensor_work->client; - struct sensor *sensor = to_sensor(client); - struct af_cmdinfo cmdinfo; - - SENSOR_DG("%s %s Enter, cmd:0x%x \n",SENSOR_NAME_STRING(), __FUNCTION__,sensor_work->cmd); - - mutex_lock(&sensor->wq_lock); - - switch (sensor_work->cmd) - { - case WqCmd_af_init: - { - if (sensor_af_downfirmware(client) < 0) { - SENSOR_TR("%s Sensor_af_init is failed in sensor_af_workqueue!\n",SENSOR_NAME_STRING()); - } - break; - } - case WqCmd_af_single: - { - sensor_af_touch_zone(client,sensor_work->zone_pos); - - if (sensor_af_single(client) < 0) { - SENSOR_TR("%s Sensor_af_single is failed in sensor_af_workqueue!\n",SENSOR_NAME_STRING()); - sensor_work->result = WqRet_fail; - } else { - sensor_work->result = WqRet_success; - } - break; - } - - case WqCmd_af_special_pos: - { - if (sensor_af_special_pos(client)< 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - #if 0 - case WqCmd_af_near_pos: - { - sensor_af_idlechk(client); - cmdinfo.cmd_tag = StepFocus_Near_Tag; - cmdinfo.validate_bit = 0x80; - if (sensor_af_cmdset(client, StepMode_Cmd, &cmdinfo) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_far_pos: - { - sensor_af_idlechk(client); - cmdinfo.cmd_tag = StepFocus_Far_Tag; - cmdinfo.validate_bit = 0x80; - if (sensor_af_cmdset(client, StepMode_Cmd, &cmdinfo) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - #endif - case WqCmd_af_continues: - { - if (sensor_af_const(client) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_continues_pause: - { - if (sensor_af_const_pause(client) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_return_idle: - { - if (sensor_af_idlechk(client) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - default: - SENSOR_TR("Unknow command(%d) in %s af workqueue!",sensor_work->cmd,SENSOR_NAME_STRING()); - break; - } -set_end: - if (sensor_work->wait == false) { - kfree((void*)sensor_work); - } else { - wake_up(&sensor_work->done); - } - mutex_unlock(&sensor->wq_lock); - return; -} - -static int sensor_af_workqueue_set(struct soc_camera_device *icd, enum sensor_wq_cmd cmd, int var, bool wait, int *zone_pos) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - struct sensor_work *wk; - int ret=0; - - if (sensor->sensor_wq == NULL) { - ret = -EINVAL; - goto sensor_af_workqueue_set_end; - } - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) != SENSOR_AF_IS_OK) { - if (cmd != WqCmd_af_init) { - SENSOR_TR("%s %s cmd(%d) ingore,because af module isn't ready!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - ret = -1; - goto sensor_af_workqueue_set_end; - } - } - - wk = kzalloc(sizeof(struct sensor_work), GFP_KERNEL); - if (wk) { - wk->client = client; - INIT_WORK(&(wk->dwork.work), sensor_af_workqueue); - wk->cmd = cmd; - wk->result = WqRet_inval; - wk->wait = wait; - wk->var = var; - init_waitqueue_head(&wk->done); - - if (zone_pos) { - if (*zone_pos || *(zone_pos+1) || *(zone_pos+2) || *(zone_pos+3)) { - memcpy(wk->zone_pos,zone_pos, sizeof(wk->zone_pos)); - } - } - - queue_delayed_work(sensor->sensor_wq,&(wk->dwork),0); - - /* ddl@rock-chips.com: - * video_lock is been locked in v4l2_ioctl function, but auto focus may slow, - * As a result any other ioctl calls will proceed very, very slowly since each call - * will have to wait for the AF to finish. Camera preview is pause,because VIDIOC_QBUF - * and VIDIOC_DQBUF is sched. so unlock video_lock here. - */ - if (wait == true) { - mutex_unlock(&icd->video_lock); - if (wait_event_timeout(wk->done, (wk->result != WqRet_inval), msecs_to_jiffies(2500)) == 0) { - SENSOR_TR("%s %s cmd(%d) is timeout!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - } - ret = wk->result; - kfree((void*)wk); - mutex_lock(&icd->video_lock); - } - - } else { - SENSOR_TR("%s %s cmd(%d) ingore,because struct sensor_work malloc failed!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - ret = -1; - } -sensor_af_workqueue_set_end: - return ret; -} -#endif -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - - switch (cmd) - { - #if 1 //derek - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - //printk("=============================<<<<222RK30_PIN1_PB7's value is %d\n",gpio_get_value(RK30_PIN1_PB7)); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - #endif - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),cmd); - break; - } - } - -sensor_power_end: - return ret; -} - -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} - -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - char value; - int ret,pid = 0; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); -#if 1 //derek - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { -//if (sensor_ioctrl(icd, Sensor_PowerDown, 1) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } -#endif - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - /* - ret = sensor_write(client, 0x3008, 0x80); - if (ret != 0) { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } -*/ - mdelay(5); //delay 5 microseconds - /* check if it is an sensor sensor */ - - ret = sensor_read(client, 0x0000, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - printk("jzw 5065:value=0x%02x\n",value); - pid |= (value << 8); - - ret = sensor_read(client, 0x0001, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - printk("jzw 506522:value=0x%02x\n",value); - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x \n", SENSOR_NAME_STRING(), pid); - - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - // 写两次init_date,尽é‡é¿å…打开摄åƒå¤´ç»¿å±çš„问题,Edit by zhansb@20120524 - SENSOR_DG("write 1 time\n"); - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - msleep(200); - ret = sensor_write_array(client, sensor_init_data1); - if (ret != 0) { - SENSOR_TR("error: %s initial1 failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - msleep(200); - ret = sensor_write_array(client, sensor_init_data2); - if (ret != 0) { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - msleep(200); -// sensor_write(client, 0x070a, 0x01); - ret = sensor_read(client, 0x0010, &value); - if (ret != 0) { - ret = -ENODEV; - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - printk("<<<info_priv.winseqe_cur_addr = SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - -#if 1 - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - - // 解决进摄åƒå¤´åŽç¬¬ä¸€æ¬¡æ‹çš„照片跟åŽç»­çš„æ‹çš„ç…§ç‰‡ç™½å¹³è¡¡ç›¸å·®è¾ƒå¤§çš„é—®é¢˜ï¼Œadd by zhansb@120614 -#if CONFIG_SENSOR_WhiteBalance - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); -#endif - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - - sensor->info_priv.funmodule_state = SENSOR_INIT_IS_OK; -#endif - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - printk("init error============================================================\n"); - return ret; -} -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - if (sensor->info_priv.funmodule_state & SENSOR_INIT_IS_OK) { - - } - #if 1 //derek - sensor_ioctrl(icd, Sensor_PowerDown, 1); - #endif - - msleep(100); - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - return 0; -} - -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00} -}; - -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - #if 0 //derek - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - #endif - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; -#if 0 //derek - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } -#endif - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - return 0; -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ //capture mode - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ // video mode - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static int sensor_s_fmt(struct v4l2_subdev *sd,struct v4l2_mbus_framefmt *mf) -{ - char value,af_status=0,af_pos_h=0,af_pos_l=0; - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - int ret = 0, set_w,set_h; - int i=0; - - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && (sensor_svga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_svga; - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1024) && (set_h <= 768)) && (sensor_xga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_xga; - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 720)) && (sensor_720p[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_720p; - set_w = 1280; - set_h = 720; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_sxga; - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_uxga; - set_w = 1600; - set_h = 1200; - } - else if (((set_w <= 1920) && (set_h <= 1080)) && (sensor_1080p[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_1080p; - set_w = 1920; - set_h = 1080; - } - else if (((set_w <= 2048) && (set_h <= 1536)) && (sensor_qxga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_qxga; - set_w = 2048; - set_h = 1536; - } - else if (((set_w <= 2592) && (set_h <= 1944)) && (sensor_qsxga[0].reg!=SEQUENCE_END)) - { - - winseqe_set_addr = sensor_qsxga; - set_w = 2592; - set_h = 1944; - } - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if (winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) - { - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - - #if CONFIG_SENSOR_Flash - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - printk("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - #endif - }else { /* ddl@rock-chips.com : Video */ - #if CONFIG_SENSOR_Flash - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - printk("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - #endif - } - - #if CONFIG_SENSOR_Focus - if (sensor->info_priv.auto_focus == SENSOR_AF_MODE_CONTINUOUS) { - sensor_af_workqueue_set(icd,WqCmd_af_continues_pause,0,true,NULL); - } - #endif - - if ((sensor->info_priv.winseqe_cur_addr->reg == SEQUENCE_PROPERTY) && (sensor->info_priv.winseqe_cur_addr->val == SEQUENCE_INIT)) { - if (((winseqe_set_addr->reg == SEQUENCE_PROPERTY) && (winseqe_set_addr->val == SEQUENCE_NORMAL)) - || (winseqe_set_addr->reg != SEQUENCE_PROPERTY)) { - ret |= sensor_write_array(client,sensor_init_data); - SENSOR_DG("\n%s reinit ret:0x%x \n",SENSOR_NAME_STRING(), ret); - } - } - - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - sensor->info_priv.winseqe_cur_addr = winseqe_set_addr; - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - #if CONFIG_SENSOR_Focus - sensor_af_workqueue_set(icd,WqCmd_af_special_pos,0,true,NULL); - #endif - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - if (sensor->info_priv.whiteBalance != 0) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - sensor->info_priv.snap2preview = true; - } else if (sensor_fmt_videochk(sd,mf) == true) { /* ddl@rock-chips.com : Video */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - - sensor->info_priv.video2preview = true; - - } else if ((sensor->info_priv.snap2preview == true) || (sensor->info_priv.video2preview == true)) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - - if (sensor->info_priv.snap2preview == true) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - #if CONFIG_SENSOR_Focus - if (sensor->info_priv.auto_focus == SENSOR_AF_MODE_AUTO) { - sensor_af_workqueue_set(icd,WqCmd_af_return_idle,0,false,NULL); - } else if (sensor->info_priv.auto_focus == SENSOR_AF_MODE_CONTINUOUS) { - sensor_af_workqueue_set(icd,WqCmd_af_continues,0,false,NULL); - } - #else - msleep(500); - #endif - sensor->info_priv.video2preview = false; - sensor->info_priv.snap2preview = false; - } - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { // preview size @ video preview - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg!=SEQUENCE_END)) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg!=SEQUENCE_END)) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=SEQUENCE_END)) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=SEQUENCE_END)) - { - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && (sensor_svga[0].reg!=SEQUENCE_END)) - { - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1024) && (set_h <= 768)) && (sensor_xga[0].reg!=SEQUENCE_END)) - { - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 720)) && (sensor_720p[0].reg!=SEQUENCE_END)) - { - set_w = 1280; - set_h = 720; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=SEQUENCE_END)) - { - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=SEQUENCE_END)) - { - set_w = 1600; - set_h = 1200; - } - else if (((set_w <= 1920) && (set_h <= 1080)) && (sensor_1080p[0].reg!=SEQUENCE_END)) - { - set_w = 1920; - set_h = 1080; - } - else if (((set_w <= 2048) && (set_h <= 1536)) && (sensor_qxga[0].reg!=SEQUENCE_END)) - { - set_w = 2048; - set_h = 1536; - } - else if (((set_w <= 2592) && (set_h <= 1944)) && (sensor_qsxga[0].reg!=SEQUENCE_END)) - { - set_w = 2592; - set_h = 1944; - } - else - { - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - - mf->width = set_w; - mf->height = set_h; - - mf->colorspace = fmt->colorspace; - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV2655 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n%s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((*value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value > 0) && ((digitalzoom_cur + *value) > digitalzoom_total)) - { - *value = digitalzoom_total - digitalzoom_cur; - } - - if ((*value < 0) && ((digitalzoom_cur + *value) < 0)) - { - *value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += *value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, *value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Focus -static int sensor_set_focus_absolute(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int ret = 0; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (!qctrl_info) - return -EINVAL; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - if ((value >= qctrl_info->minimum) && (value <= qctrl_info->maximum)) { - ret = sensor_af_workqueue_set(icd, WqCmd_af_special_pos, value, true,NULL); - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EINVAL; - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - } - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - - return ret; -} -static int sensor_set_focus_relative(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int ret = 0; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_RELATIVE); - if (!qctrl_info) - return -EINVAL; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - if ((value >= qctrl_info->minimum) && (value <= qctrl_info->maximum)) { - if (value > 0) { - ret = sensor_af_workqueue_set(icd, WqCmd_af_near_pos, 0, true,NULL); - } else { - ret = sensor_af_workqueue_set(icd, WqCmd_af_far_pos, 0, true,NULL); - } - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EINVAL; - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - } - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - return ret; -} - -static int sensor_set_focus_mode(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value, int *zone_pos) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int ret = 0; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - switch (value) - { - case SENSOR_AF_MODE_AUTO: - { - ret = sensor_af_workqueue_set(icd, WqCmd_af_single, 0, true, zone_pos); - break; - } - - /*case SENSOR_AF_MODE_MACRO: - { - ret = sensor_set_focus_absolute(icd, qctrl, 0xff); - break; - } - - case SENSOR_AF_MODE_INFINITY: - { - ret = sensor_set_focus_absolute(icd, qctrl, 0x00); - break; - } - */ - case SENSOR_AF_MODE_CONTINUOUS: - { - ret = sensor_af_workqueue_set(icd, WqCmd_af_continues, 0, true,NULL); - break; - } - default: - SENSOR_TR("\n %s..%s AF value(0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__,value); - break; - - } - - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - - return ret; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %d\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset,ret; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - sensor_set_focus_relative(icd, qctrl,ext_ctrl->value); - break; - } - case V4L2_CID_FOCUS_AUTO: - { - printk("AF: %d\n",ext_ctrl->value); - if (ext_ctrl->value) { - if ((ext_ctrl->value==1) || (SENSOR_AF_MODE_AUTO == sensor->info_priv.auto_focus)) { - if (sensor_set_focus_mode(icd, qctrl,SENSOR_AF_MODE_AUTO,ext_ctrl->rect) != 0) { - if(0 == (sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK)) { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_AUTO; - } - return -EINVAL; - } - } - if (ext_ctrl->value == 1) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_AUTO; - } else if (SENSOR_AF_MODE_AUTO == sensor->info_priv.auto_focus){ - if (ext_ctrl->value == 0) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CLOSE; - } - break; - } - case V4L2_CID_FOCUS_CONTINUOUS: - { - if (SENSOR_AF_MODE_CONTINUOUS != sensor->info_priv.auto_focus) { - if (ext_ctrl->value == 1) { - if (sensor_set_focus_mode(icd, qctrl,SENSOR_AF_MODE_CONTINUOUS,NULL) != 0) { - if(0 == (sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK)) { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CONTINUOUS; - } - return -EINVAL; - } - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CONTINUOUS; - } - } else { - if (ext_ctrl->value == 0) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CLOSE; - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_stream(struct v4l2_subdev *sd, int enable) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - #if CONFIG_SENSOR_Focus - struct soc_camera_device *icd = client->dev.platform_data; - struct v4l2_mbus_framefmt mf; - #endif - - if (enable == 1) { - sensor->info_priv.enable = 1; - #if CONFIG_SENSOR_Focus - mf.width = icd->user_width; - mf.height = icd->user_height; - mf.code = sensor->info_priv.fmt.code; - mf.colorspace = sensor->info_priv.fmt.colorspace; - mf.field = V4L2_FIELD_NONE; - /* If auto focus firmware haven't download success, must download firmware again when in video or preview stream on */ - if (sensor_fmt_capturechk(sd, &mf) == false) { - if ((sensor->info_priv.affm_reinit == 1) || ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK)==0)) { - sensor_af_workqueue_set(icd, WqCmd_af_init, 0, false,NULL); - sensor->info_priv.affm_reinit = 0; - } - } - #endif - } else if (enable == 0) { - sensor->info_priv.enable = 0; - #if CONFIG_SENSOR_Focus - flush_workqueue(sensor->sensor_wq); - #endif - } - return 0; -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char value; - int ret,pid = 0; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; -#if 1 //derek - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } -#endif - /* soft reset */ - /* - ret = sensor_write(client, 0x3008, 0x80); - if (ret != 0) { - SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - mdelay(5); //delay 5 microseconds -*/ - printk("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); - mdelay(5000); //jzw modify - - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x0000, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - printk("jzw:%s:0x%02x\n",__FUNCTION__,value); - pid |= (value << 8); - - ret = sensor_read(client, 0x0001, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - printk("jzw:%s:0x%02x\n",__FUNCTION__,value); - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - return ret; -} -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0,i; - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - sensor->sensor_gpio_res = NULL; - for (i=0; isensor_io_request->gpio_res[i].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[i].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[i]; - } - } - if (sensor->sensor_gpio_res == NULL) { - SENSOR_TR("%s %s obtain gpio resource failed when RK29_CAM_SUBDEV_IOREQUEST \n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - printk("flash io:%d\n",sensor->sensor_gpio_res->gpio_flash); - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } - -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, - .s_stream = sensor_s_stream, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - sensor->info_priv.fmt = sensor_colour_fmts[0]; - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } else { - #if CONFIG_SENSOR_Focus - sensor->sensor_wq = create_workqueue(SENSOR_NAME_STRING(_af_workqueue)); - if (sensor->sensor_wq == NULL) - SENSOR_TR("%s create fail!", SENSOR_NAME_STRING(_af_workqueue)); - mutex_init(&sensor->wq_lock); - #endif - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - #if CONFIG_SENSOR_Focus - if (sensor->sensor_wq) { - destroy_workqueue(sensor->sensor_wq); - sensor->sensor_wq = NULL; - } - #endif - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - // if (!tcsi_get_value(WESI_CAMERA_HM5065)) //add by caixx - // return 0; - - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - //if (!tcsi_get_value(WESI_CAMERA_HM5065)) //add by caixx - // return; - - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); diff --git a/drivers/media/video/mt9d112.c b/drivers/media/video/mt9d112.c deleted file mode 100755 index 4812dd227c2a..000000000000 --- a/drivers/media/video/mt9d112.c +++ /dev/null @@ -1,3405 +0,0 @@ -/* - * Driver for mt9d112 CMOS Image Sensor from Aptina(micron) - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "mt9d112.h" - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_MT9D112 -#define SENSOR_V4L2_IDENT V4L2_IDENT_MT9D112 -#define SENSOR_ID 0x1580 -#define SENSOR_ID_REG 0x3000 -#define SENSOR_RESET_REG SEQUENCE_END -#define SENSOR_RESET_VAL 0x00 -#define SENSOR_MIN_WIDTH 320 -#define SENSOR_MIN_HEIGHT 240 -#define SENSOR_MAX_WIDTH 1600 -#define SENSOR_MAX_HEIGHT 1200 -#define SENSOR_INIT_WIDTH 640 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 480 -#define SENSOR_INIT_WINSEQADR sensor_vga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_UYVY8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 1 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 1 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 -#define CONFIG_SENSOR_Focus 0 - - -#define CONFIG_SENSOR_I2C_SPEED 250000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) - -#if CONFIG_SENSOR_Focus -#define SENSOR_AF_MODE_INFINITY 0 -#define SENSOR_AF_MODE_MACRO 1 -#define SENSOR_AF_MODE_FIXED 2 -#define SENSOR_AF_MODE_AUTO 3 -#define SENSOR_AF_MODE_CONTINUOUS 4 -#define SENSOR_AF_MODE_CLOSE 5 -#endif -#define SENSOR_CCM_ONLY - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); - -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_MT9D112_USER_DEFINED_SERIES -#include "mt9d112_user_series.c" -#else - - -/* init 640X480 VGA */ -static struct reginfo sensor_init_data[] = -{ - {0x301A, 0x0ACC}, // RESET_REGISTER - {0x3202, 0x0008}, // STANDBY_CONTROL - {SEQUENCE_WAIT_MS, 10}, - {0x341E, 0x8F09}, // PLL_CLK_IN_CONTROL - {0x341C, 0x0218}, // PLL_DIVIDERS1 - {SEQUENCE_WAIT_MS, 1}, - {0x341E, 0x8F09}, // PLL_CLK_IN_CONTROL - {0x341E, 0x8F08}, // PLL_CLK_IN_CONTROL - {0x3044, 0x0540}, // DARK_CONTROL - {0x3216, 0x02CF}, // INTERNAL_CLOCK_CONTROL - {0x321C, 0x0402}, // OF_CONTROL_STATUS - {0x3212, 0x0001}, // FACTORY_BYPASS - {0x341E, 0x8F09}, // PLL_CLK_IN_CONTROL - {0x341C, 0x0120}, // PLL_DIVIDERS1 - {0x341E, 0x8F09}, // PLL_CLK_IN_CONTROL - {0x341E, 0x8F08}, // PLL_CLK_IN_CONTROL - {0x3044, 0x0540}, // DARK_CONTROL - {0x3216, 0x02CF}, // INTERNAL_CLOCK_CONTROL - {0x321C, 0x0402}, // OF_CONTROL_STATUS - {0x3212, 0x0001}, // FACTORY_BYPASS//¹©Æ·¸ÉÈųÌÐòÀûÓÃ֮ǰµÄ07005 -#ifdef SENSOR_CCM_ONLY - {0x338C, 0x2703}, - {0x3390, 0x0320}, - {0x338C, 0x2705}, - {0x3390, 0x0258}, - {0x338C, 0x2707}, - {0x3390, 0x0640}, - {0x338C, 0x2709}, - {0x3390, 0x04B0}, - {0x338C, 0x270D}, - {0x3390, 0x0000}, - {0x338C, 0x270F}, - {0x3390, 0x0000}, - {0x338C, 0x2711}, - {0x3390, 0x4BD}, - {0x338C, 0x2713}, - {0x3390, 0x64D}, - {0x3390, 0x411}, -#else - {0x338C, 0x2703}, // MCU_ADDRESS - {0x3390, 0x0140}, // MCU_DATA_0 - {0x338C, 0x2705}, // MCU_ADDRESS - {0x3390, 0x00F0}, // MCU_DATA_0 - {0x338C, 0x2707}, // MCU_ADDRESS - {0x3390, 0x0640}, // MCU_DATA_0 - {0x338C, 0x2709}, // MCU_ADDRESS - {0x3390, 0x04B0}, // MCU_DATA_0 - {0x338C, 0x270D}, // MCU_ADDRESS - {0x3390, 0x0000}, // MCU_DATA_0 - {0x338C, 0x270F}, // MCU_ADDRESS - {0x3390, 0x0000}, // MCU_DATA_0 - {0x338C, 0x2711}, // MCU_ADDRESS - {0x3390, 0x04BD}, // MCU_DATA_0 - {0x338C, 0x2713}, // MCU_ADDRESS - {0x3390, 0x064D}, // MCU_DATA_0 - {0x338C, 0x2715}, // MCU_ADDRESS - {0x3390, 0x0022}, // MCU_DATA_0 -#endif - {0x338C, 0x2717}, // MCU_ADDRESS - {0x3390, 0x2111}, // MCU_DATA_0 - {0x338C, 0x2719}, // MCU_ADDRESS - {0x3390, 0x046C}, // MCU_DATA_0 - {0x338C, 0x271B}, // MCU_ADDRESS - {0x3390, 0x024F}, // MCU_DATA_0 - {0x338C, 0x271D}, // MCU_ADDRESS - {0x3390, 0x0102}, // MCU_DATA_0 - {0x338C, 0x271F}, // MCU_ADDRESS - {0x3390, 0x0279}, // MCU_DATA_0 - {0x338C, 0x2721}, // MCU_ADDRESS - {0x3390, 0x0155}, // MCU_DATA_0 - {0x338C, 0x2723}, // MCU_ADDRESS - {0x3390, 0x0293}, // MCU_DATA_0 - {0x338C, 0x2725}, // MCU_ADDRESS - {0x3390, 0x0824}, // MCU_DATA_0 - {0x338C, 0x2727}, // MCU_ADDRESS - {0x3390, 0x2020}, // MCU_DATA_0 - {0x338C, 0x2729}, // MCU_ADDRESS - {0x3390, 0x2020}, // MCU_DATA_0 - {0x338C, 0x272B}, // MCU_ADDRESS - {0x3390, 0x1020}, // MCU_DATA_0 - {0x338C, 0x272D}, // MCU_ADDRESS - {0x3390, 0x2007}, // MCU_DATA_0 - {0x338C, 0x272F}, // MCU_ADDRESS - {0x3390, 0x0004}, // MCU_DATA_0 - {0x338C, 0x2731}, // MCU_ADDRESS - {0x3390, 0x0004}, // MCU_DATA_0 - {0x338C, 0x2733}, // MCU_ADDRESS - {0x3390, 0x04BB}, // MCU_DATA_0 - {0x338C, 0x2735}, // MCU_ADDRESS - {0x3390, 0x064B}, // MCU_DATA_0 - {0x338C, 0x2737}, // MCU_ADDRESS - {0x3390, 0x0000}, // MCU_DATA_0 - {0x338C, 0x2739}, // MCU_ADDRESS - {0x3390, 0x2111}, // MCU_DATA_0 - {0x338C, 0x273B}, // MCU_ADDRESS - {0x3390, 0x0024}, // MCU_DATA_0 - {0x338C, 0x273D}, // MCU_ADDRESS - {0x3390, 0x0120}, // MCU_DATA_0 - {0x338C, 0x273F}, // MCU_ADDRESS - {0x3390, 0x00A4}, // MCU_DATA_0 - {0x338C, 0x2741}, // MCU_ADDRESS - {0x3390, 0x0169}, // MCU_DATA_0 - {0x338C, 0x2743}, // MCU_ADDRESS - {0x3390, 0x00A4}, // MCU_DATA_0 - {0x338C, 0x2745}, // MCU_ADDRESS - {0x3390, 0x04ED}, // MCU_DATA_0 - {0x338C, 0x2747}, // MCU_ADDRESS - {0x3390, 0x0824}, // MCU_DATA_0 - {0x338C, 0x2751}, // MCU_ADDRESS - {0x3390, 0x0000}, // MCU_DATA_0 - {0x338C, 0x2753}, // MCU_ADDRESS - {0x3390, 0x0320}, // MCU_DATA_0 - {0x338C, 0x2755}, // MCU_ADDRESS - {0x3390, 0x0000}, // MCU_DATA_0 - {0x338C, 0x2757}, // MCU_ADDRESS - {0x3390, 0x0258}, // MCU_DATA_0 - {0x338C, 0x275F}, // MCU_ADDRESS - {0x3390, 0x0000}, // MCU_DATA_0 - {0x338C, 0x2761}, // MCU_ADDRESS - {0x3390, 0x0640}, // MCU_DATA_0 - {0x338C, 0x2763}, // MCU_ADDRESS - {0x3390, 0x0000}, // MCU_DATA_0 - {0x338C, 0x2765}, // MCU_ADDRESS - {0x3390, 0x04B0}, // MCU_DATA_0 - {0x338C, 0x222E}, // MCU_ADDRESS - {0x3390, 0x0060}, // MCU_DATA_0 - {0x338C, 0xA408}, // MCU_ADDRESS - {0x3390, 0x0017}, // MCU_DATA_0 - {0x338C, 0xA409}, // MCU_ADDRESS - {0x3390, 0x001A}, // MCU_DATA_0 - {0x338C, 0xA40A}, // MCU_ADDRESS - {0x3390, 0x001B}, // MCU_DATA_0 - {0x338C, 0xA40B}, // MCU_ADDRESS - {0x3390, 0x001E}, // MCU_DATA_0 - {0x338C, 0x2411}, // MCU_ADDRESS - {0x3390, 0x0060}, // MCU_DATA_0 - {0x338C, 0x2413}, // MCU_ADDRESS - {0x3390, 0x0073}, // MCU_DATA_0 - {0x338C, 0x2415}, // MCU_ADDRESS - {0x3390, 0x0060}, // MCU_DATA_0 - {0x338C, 0x2417}, // MCU_ADDRESS - {0x3390, 0x0073}, // MCU_DATA_0 - {0x338C, 0xA40D}, // MCU_ADDRESS - {0x3390, 0x0002}, // MCU_DATA_0 - {0x338C, 0xA410}, // MCU_ADDRESS - {0x3390, 0x0001}, // MCU_DATA_0 - {0x338C, 0xA103}, // MCU_ADDRESS - {0x3390, 0x0006}, // MCU_DATA_0 - {0x338C, 0xA103}, // MCU_ADDRESS - {0x3390, 0x0005}, // MCU_DATA_0 - {0x338C, 0x2703}, // MCU_ADDRESS - {0x3390, 0x0140}, // MCU_DATA_0 - {0x338C, 0x2705}, // MCU_ADDRESS - {0x3390, 0x00F0}, // MCU_DATA_0 - {0x338C, 0x2707}, // MCU_ADDRESS - {0x3390, 0x0640}, // MCU_DATA_0 - {0x338C, 0x2709}, // MCU_ADDRESS - {0x3390, 0x04B0}, // MCU_DATA_0 - {0x338C, 0x270D}, // MCU_ADDRESS - {0x3390, 0x0000}, // MCU_DATA_0 - {0x338C, 0x270F}, // MCU_ADDRESS - {0x3390, 0x0000}, // MCU_DATA_0 - {0x338C, 0x2711}, // MCU_ADDRESS - {0x3390, 0x04BD}, // MCU_DATA_0 - {0x338C, 0x2713}, // MCU_ADDRESS - {0x3390, 0x064D}, // MCU_DATA_0 - {0x338C, 0x2715}, // MCU_ADDRESS - {0x3390, 0x0022}, // MCU_DATA_0 - {0x338C, 0x2717}, // MCU_ADDRESS - {0x3390, 0x2111}, // MCU_DATA_0 - {0x338C, 0x2719}, // MCU_ADDRESS - {0x3390, 0x046C}, // MCU_DATA_0 - {0x338C, 0x271B}, // MCU_ADDRESS - {0x3390, 0x024F}, // MCU_DATA_0 - {0x338C, 0x271D}, // MCU_ADDRESS - {0x3390, 0x0102}, // MCU_DATA_0 - {0x338C, 0x271F}, // MCU_ADDRESS - {0x3390, 0x0279}, // MCU_DATA_0 - {0x338C, 0x2721}, // MCU_ADDRESS - {0x3390, 0x0155}, // MCU_DATA_0 - {0x338C, 0x2723}, // MCU_ADDRESS - {0x3390, 0x0293}, // MCU_DATA_0 - {0x338C, 0x2725}, // MCU_ADDRESS - {0x3390, 0x0824}, // MCU_DATA_0 - {0x338C, 0x2727}, // MCU_ADDRESS - {0x3390, 0x2020}, // MCU_DATA_0 - {0x338C, 0x2729}, // MCU_ADDRESS - {0x3390, 0x2020}, // MCU_DATA_0 - {0x338C, 0x272B}, // MCU_ADDRESS - {0x3390, 0x1020}, // MCU_DATA_0 - {0x338C, 0x272D}, // MCU_ADDRESS - {0x3390, 0x2007}, // MCU_DATA_0 - {0x338C, 0x272F}, // MCU_ADDRESS - {0x3390, 0x0004}, // MCU_DATA_0 - {0x338C, 0x2731}, // MCU_ADDRESS - {0x3390, 0x0004}, // MCU_DATA_0 - {0x338C, 0x2733}, // MCU_ADDRESS - {0x3390, 0x04BB}, // MCU_DATA_0 - {0x338C, 0x2735}, // MCU_ADDRESS - {0x3390, 0x064B}, // MCU_DATA_0 - {0x338C, 0x2737}, // MCU_ADDRESS - {0x3390, 0x0000}, // MCU_DATA_0 - {0x338C, 0x2739}, // MCU_ADDRESS - {0x3390, 0x2111}, // MCU_DATA_0 - {0x338C, 0x273B}, // MCU_ADDRESS - {0x3390, 0x0024}, // MCU_DATA_0 - {0x338C, 0x273D}, // MCU_ADDRESS - {0x3390, 0x0120}, // MCU_DATA_0 - {0x338C, 0x273F}, // MCU_ADDRESS - {0x3390, 0x00A4}, // MCU_DATA_0 - {0x338C, 0x2741}, // MCU_ADDRESS - {0x3390, 0x0169}, // MCU_DATA_0 - {0x338C, 0x2743}, // MCU_ADDRESS - {0x3390, 0x00A4}, // MCU_DATA_0 - {0x338C, 0x2745}, // MCU_ADDRESS - {0x3390, 0x04ED}, // MCU_DATA_0 - {0x338C, 0x2747}, // MCU_ADDRESS - {0x3390, 0x0824}, // MCU_DATA_0 - {0x338C, 0x2751}, // MCU_ADDRESS - {0x3390, 0x0000}, // MCU_DATA_0 - {0x338C, 0x2753}, // MCU_ADDRESS - {0x3390, 0x0320}, // MCU_DATA_0 - {0x338C, 0x2755}, // MCU_ADDRESS - {0x3390, 0x0000}, // MCU_DATA_0 - {0x338C, 0x2757}, // MCU_ADDRESS - {0x3390, 0x0258}, // MCU_DATA_0 - {0x338C, 0x275F}, // MCU_ADDRESS - {0x3390, 0x0000}, // MCU_DATA_0 - {0x338C, 0x2761}, // MCU_ADDRESS - {0x3390, 0x0640}, // MCU_DATA_0 - {0x338C, 0x2763}, // MCU_ADDRESS - {0x3390, 0x0000}, // MCU_DATA_0 - {0x338C, 0x2765}, // MCU_ADDRESS - {0x3390, 0x04B0}, // MCU_DATA_0 - {0x338C, 0x222E}, // MCU_ADDRESS - {0x3390, 0x0060}, // MCU_DATA_0 - {0x338C, 0xA408}, // MCU_ADDRESS - {0x3390, 0x0017}, // MCU_DATA_0 - {0x338C, 0xA409}, // MCU_ADDRESS - {0x3390, 0x001A}, // MCU_DATA_0 - {0x338C, 0xA40A}, // MCU_ADDRESS - {0x3390, 0x001B}, // MCU_DATA_0 - {0x338C, 0xA40B}, // MCU_ADDRESS - {0x3390, 0x001E}, // MCU_DATA_0 - {0x338C, 0x2411}, // MCU_ADDRESS - {0x3390, 0x0060}, // MCU_DATA_0 - {0x338C, 0x2413}, // MCU_ADDRESS - {0x3390, 0x0073}, // MCU_DATA_0 - {0x338C, 0x2415}, // MCU_ADDRESS - {0x3390, 0x0060}, // MCU_DATA_0 - {0x338C, 0x2417}, // MCU_ADDRESS - {0x3390, 0x0073}, // MCU_DATA_0 - {0x338C, 0xA40D}, // MCU_ADDRESS - {0x3390, 0x0002}, // MCU_DATA_0 - {0x338C, 0xA410}, // MCU_ADDRESS - {0x3390, 0x0001}, // MCU_DATA_0 - {0x338C, 0xA103}, // MCU_ADDRESS - {0x3390, 0x0006}, // MCU_DATA_0 - {SEQUENCE_WAIT_MS, 100}, - {0x338C, 0xA103}, // MCU_ADDRESS - {0x3390, 0x0005}, // MCU_DATA_0 - {SEQUENCE_WAIT_MS, 100}, - - - //[Lens Correction 01/04/07 20:07:28] - {0x34CE, 0x01A0}, //LENS_CORRECTION_CONTROL - {0x34D0, 0x6532}, //ZONE_BOUNDS_X1_X2 - {0x34D2, 0x3297}, //ZONE_BOUNDS_X0_X3 - {0x34D4, 0x9664}, //ZONE_BOUNDS_X4_X5 - {0x34D6, 0x4B25}, //ZONE_BOUNDS_Y1_Y2 - {0x34D8, 0x2670}, //ZONE_BOUNDS_Y0_Y3 - {0x34DA, 0x724C}, //ZONE_BOUNDS_Y4_Y5 - {0x34DC, 0xFF01}, //CENTER_OFFSET - {0x34DE, 0x011F}, //FX_RED - {0x34E6, 0x00B3}, //FY_RED - {0x34EE, 0x0D8F}, //DF_DX_RED - {0x34F6, 0x0D6E}, //DF_DY_RED - {0x3500, 0xF51C}, //SECOND_DERIV_ZONE_0_RED - {0x3508, 0xFEF8}, //SECOND_DERIV_ZONE_1_RED - {0x3510, 0x212D}, //SECOND_DERIV_ZONE_2_RED - {0x3518, 0x212B}, //SECOND_DERIV_ZONE_3_RED - {0x3520, 0x1F2A}, //SECOND_DERIV_ZONE_4_RED - {0x3528, 0x2934}, //SECOND_DERIV_ZONE_5_RED - {0x3530, 0x17DB}, //SECOND_DERIV_ZONE_6_RED - {0x3538, 0xE7D6}, //SECOND_DERIV_ZONE_7_RED - {0x354C, 0x07C6}, //K_FACTOR_IN_K_FX_FY_R_TL - {0x3544, 0x07FF}, //K_FACTOR_IN_K_FX_FY_R_TR - {0x355C, 0x051C}, //K_FACTOR_IN_K_FX_FY_R_BL - {0x3554, 0x07FF}, //K_FACTOR_IN_K_FX_FY_R_BR - {0x34E0, 0x0137}, //FX_GREEN - {0x34E8, 0x00A8}, //FY_GREEN - {0x34F0, 0x0E3E}, //DF_DX_GREEN - {0x34F8, 0x0DCB}, //DF_DY_GREEN - {0x3502, 0xF20A}, //SECOND_DERIV_ZONE_0_GREEN - {0x350A, 0xFBE1}, //SECOND_DERIV_ZONE_1_GREEN - {0x3512, 0x1C26}, //SECOND_DERIV_ZONE_2_GREEN - {0x351A, 0x232B}, //SECOND_DERIV_ZONE_3_GREEN - {0x3522, 0x312E}, //SECOND_DERIV_ZONE_4_GREEN - {0x352A, 0x2121}, //SECOND_DERIV_ZONE_5_GREEN - {0x3532, 0xF106}, //SECOND_DERIV_ZONE_6_GREEN - {0x353A, 0x0C0D}, //SECOND_DERIV_ZONE_7_GREEN - {0x354E, 0x07FF}, //K_FACTOR_IN_K_FX_FY_G1_TL - {0x3546, 0x0638}, //K_FACTOR_IN_K_FX_FY_G1_TR - {0x355E, 0x07FF}, //K_FACTOR_IN_K_FX_FY_G1_BL - {0x3556, 0x0155}, //K_FACTOR_IN_K_FX_FY_G1_BR - {0x34E4, 0x0107}, //FX_BLUE - {0x34EC, 0x0079}, //FY_BLUE - {0x34F4, 0x0E19}, //DF_DX_BLUE - {0x34FC, 0x0D35}, //DF_DY_BLUE - {0x3506, 0x111C}, //SECOND_DERIV_ZONE_0_BLUE - {0x350E, 0x02E6}, //SECOND_DERIV_ZONE_1_BLUE - {0x3516, 0x2521}, //SECOND_DERIV_ZONE_2_BLUE - {0x351E, 0x2620}, //SECOND_DERIV_ZONE_3_BLUE - {0x3526, 0x1A25}, //SECOND_DERIV_ZONE_4_BLUE - {0x352E, 0x0B1D}, //SECOND_DERIV_ZONE_5_BLUE - {0x3536, 0xFD03}, //SECOND_DERIV_ZONE_6_BLUE - {0x353E, 0xB315}, //SECOND_DERIV_ZONE_7_BLUE - {0x3552, 0x06D0}, //K_FACTOR_IN_K_FX_FY_B_TL - {0x354A, 0x03FF}, //K_FACTOR_IN_K_FX_FY_B_TR - {0x3562, 0x07FF}, //K_FACTOR_IN_K_FX_FY_B_BL - {0x355A, 0x057B}, //K_FACTOR_IN_K_FX_FY_B_BR - {0x34E2, 0x011E}, //FX_GREEN2 - {0x34EA, 0x008A}, //FY_GREEN2 - {0x34F2, 0x0D6E}, //DF_DX_GREEN2 - {0x34FA, 0x0D7F}, //DF_DY_GREEN2 - {0x3504, 0xF822}, //SECOND_DERIV_ZONE_0_GREEN2 - {0x350C, 0x0DFC}, //SECOND_DERIV_ZONE_1_GREEN2 - {0x3514, 0x1F25}, //SECOND_DERIV_ZONE_2_GREEN2 - {0x351C, 0x3032}, //SECOND_DERIV_ZONE_3_GREEN2 - {0x3524, 0x2628}, //SECOND_DERIV_ZONE_4_GREEN2 - {0x352C, 0x1523}, //SECOND_DERIV_ZONE_5_GREEN2 - {0x3534, 0xFADF}, //SECOND_DERIV_ZONE_6_GREEN2 - {0x353C, 0xDEF7}, //SECOND_DERIV_ZONE_7_GREEN2 - {0x3550, 0x0109}, //K_FACTOR_IN_K_FX_FY_G2_TL - {0x3548, 0x0638}, //K_FACTOR_IN_K_FX_FY_G2_TR - {0x3560, 0x0638}, //K_FACTOR_IN_K_FX_FY_G2_BL - {0x3558, 0x07FF}, //K_FACTOR_IN_K_FX_FY_G2_BR - {0x3540, 0x0000}, //X2_FACTORS - {0x3542, 0x0000}, //GLOBAL_OFFSET_FXY_FUNCTION - {0x3210, 0x01FC}, // COLOR_PIPELINE_CONTROL - //CCM - //CCM - {0x338C, 0xA364}, // MCU_ADDRESS [AWB_KR_L] - {0x3390, 0x0080}, // MCU_DATA_0 - {0x338C, 0xA364}, // MCU_ADDRESS [AWB_KR_L] - {0x3390, 0x0080}, // MCU_DATA_0 - {0x338C, 0xA365}, // MCU_ADDRESS [AWB_KG_L] - {0x3390, 0x008C}, // MCU_DATA_0 - {0x338C, 0xA365}, // MCU_ADDRESS [AWB_KG_L] - {0x3390, 0x008C}, // MCU_DATA_0 - {0x338C, 0xA366}, // MCU_ADDRESS [AWB_KB_L] - {0x3390, 0x0082}, // MCU_DATA_0 - {0x338C, 0xA366}, // MCU_ADDRESS [AWB_KB_L] - {0x3390, 0x0082}, // MCU_DATA_0 - {0x338C, 0x2306}, // MCU_ADDRESS [AWB_CCM_L_0] - {0x3390, 0x0619}, // MCU_DATA_0 - {0x338C, 0x2308}, // MCU_ADDRESS [AWB_CCM_L_1] - {0x3390, 0xFC80}, // MCU_DATA_0 - {0x338C, 0x230A}, // MCU_ADDRESS [AWB_CCM_L_2] - {0x3390, 0xFEFB}, // MCU_DATA_0 - {0x338C, 0x230C}, // MCU_ADDRESS [AWB_CCM_L_3] - {0x3390, 0xFEEE}, // MCU_DATA_0 - {0x338C, 0x230E}, // MCU_ADDRESS [AWB_CCM_L_4] - {0x3390, 0x0571}, // MCU_DATA_0 - {0x338C, 0x2310}, // MCU_ADDRESS [AWB_CCM_L_5] - {0x3390, 0xFE26}, // MCU_DATA_0 - {0x338C, 0x2312}, // MCU_ADDRESS [AWB_CCM_L_6] - {0x3390, 0xFF0C}, // MCU_DATA_0 - {0x338C, 0x2314}, // MCU_ADDRESS [AWB_CCM_L_7] - {0x3390, 0xFE48}, // MCU_DATA_0 - {0x338C, 0x2316}, // MCU_ADDRESS [AWB_CCM_L_8] - {0x3390, 0x04A2}, // MCU_DATA_0 - {0x338C, 0x2318}, // MCU_ADDRESS [AWB_CCM_L_9] - {0x3390, 0x0024}, // MCU_DATA_0 - {0x338C, 0x231A}, // MCU_ADDRESS [AWB_CCM_L_10] - {0x3390, 0x003F}, // MCU_DATA_0 - {0x338C, 0x231C}, // MCU_ADDRESS [AWB_CCM_RL_0] - {0x3390, 0xFDA7}, // MCU_DATA_0 - {0x338C, 0x231E}, // MCU_ADDRESS [AWB_CCM_RL_1] - {0x3390, 0x0158}, // MCU_DATA_0 - {0x338C, 0x2320}, // MCU_ADDRESS [AWB_CCM_RL_2] - {0x3390, 0x00EE}, // MCU_DATA_0 - {0x338C, 0x2322}, // MCU_ADDRESS [AWB_CCM_RL_3] - {0x3390, 0x00D3}, // MCU_DATA_0 - {0x338C, 0x2324}, // MCU_ADDRESS [AWB_CCM_RL_4] - {0x3390, 0xFC74}, // MCU_DATA_0 - {0x338C, 0x2326}, // MCU_ADDRESS [AWB_CCM_RL_5] - {0x3390, 0x01A9}, // MCU_DATA_0 - {0x338C, 0x2328}, // MCU_ADDRESS [AWB_CCM_RL_6] - {0x3390, 0x014B}, // MCU_DATA_0 - {0x338C, 0x232A}, // MCU_ADDRESS [AWB_CCM_RL_7] - {0x3390, 0xFE9D}, // MCU_DATA_0 - {0x338C, 0x232C}, // MCU_ADDRESS [AWB_CCM_RL_8] - {0x3390, 0xFF69}, // MCU_DATA_0 - {0x338C, 0x232E}, // MCU_ADDRESS [AWB_CCM_RL_9] - {0x3390, 0x0018}, // MCU_DATA_0 - {0x338C, 0x2330}, // MCU_ADDRESS [AWB_CCM_RL_10] - {0x3390, 0xFFEC}, // MCU_DATA_0 - {0x338C, 0xA348}, // MCU_ADDRESS [AWB_GAIN_BUFFER_SPEED] - {0x3390, 0x0008}, // MCU_DATA_0 - {0x338C, 0xA349}, // MCU_ADDRESS [AWB_JUMP_DIVISOR] - {0x3390, 0x0002}, // MCU_DATA_0 - {0x338C, 0xA34A}, // MCU_ADDRESS [AWB_GAIN_MIN] - {0x3390, 0x0059}, // MCU_DATA_0 - {0x338C, 0xA34B}, // MCU_ADDRESS [AWB_GAIN_MAX] - {0x3390, 0x00A6}, // MCU_DATA_0 - {0x338C, 0xA34F}, // MCU_ADDRESS [AWB_CCM_POSITION_MIN] - {0x3390, 0x0000}, // MCU_DATA_0 - {0x338C, 0xA350}, // MCU_ADDRESS [AWB_CCM_POSITION_MAX] - {0x3390, 0x007F}, // MCU_DATA_0 - {0x338C, 0xA353}, // MCU_ADDRESS [AWB_MODE] - {0x3390, 0x0002}, // MCU_DATA_0 - {0x338C, 0xA35B}, // MCU_ADDRESS [AWB_STEADY_BGAIN_OUT_MIN] - {0x3390, 0x0078}, // MCU_DATA_0 - {0x338C, 0xA35C}, // MCU_ADDRESS [AWB_STEADY_BGAIN_OUT_MAX] - {0x3390, 0x0086}, // MCU_DATA_0 - {0x338C, 0xA35D}, // MCU_ADDRESS [AWB_STEADY_BGAIN_IN_MIN] - {0x3390, 0x007E}, // MCU_DATA_0 - {0x338C, 0xA35E}, // MCU_ADDRESS [AWB_STEADY_BGAIN_IN_MAX] - {0x3390, 0x0082}, // MCU_DATA_0 - {0x338C, 0x235F}, // MCU_ADDRESS [AWB_CNT_PXL_TH] - {0x3390, 0x0040}, // MCU_DATA_0 - {0x338C, 0xA361}, // MCU_ADDRESS [AWB_TG_MIN0] - {0x3390, 0x00C8}, // MCU_DATA_0 - {0x338C, 0xA362}, // MCU_ADDRESS [AWB_TG_MAX0] - {0x3390, 0x00E1}, // MCU_DATA_0 - {0x338C, 0xA302}, // MCU_ADDRESS [AWB_WINDOW_POS] - {0x3390, 0x0000}, // MCU_DATA_0 - {0x338C, 0xA303}, // MCU_ADDRESS [AWB_WINDOW_SIZE] - {0x3390, 0x00EF}, // MCU_DATA_0 - {0x338C, 0xA352}, // MCU_ADDRESS [AWB_SATURATION] - {0x3390, 0x001E}, // MCU_DATA_0 - {0x338C, 0xA118}, // MCU_ADDRESS [SEQ_LLSAT1] - {0x3390, 0x001E}, // MCU_DATA_0 - {0x338C, 0xA103}, // MCU_ADDRESS [SEQ_CMD] - {0x3390, 0x0005}, // MCU_DATA_0 - //Contrast - {0x338C, 0xA76D}, // MCU_ADDRESS [MODE_GAM_CONT_A] - {0x3390, 0x0003}, // MCU_DATA_0 - {0x338C, 0xA76F}, // MCU_ADDRESS [MODE_GAM_TABLE_A_0] - {0x3390, 0x0000}, // MCU_DATA_0 - {0x338C, 0xA770}, // MCU_ADDRESS [MODE_GAM_TABLE_A_1] - {0x3390, 0x000B}, // MCU_DATA_0 - {0x338C, 0xA771}, // MCU_ADDRESS [MODE_GAM_TABLE_A_2] - {0x3390, 0x0023}, // MCU_DATA_0 - {0x338C, 0xA772}, // MCU_ADDRESS [MODE_GAM_TABLE_A_3] - {0x3390, 0x0043}, // MCU_DATA_0 - {0x338C, 0xA773}, // MCU_ADDRESS [MODE_GAM_TABLE_A_4] - {0x3390, 0x006E}, // MCU_DATA_0 - {0x338C, 0xA774}, // MCU_ADDRESS [MODE_GAM_TABLE_A_5] - {0x3390, 0x0090}, // MCU_DATA_0 - {0x338C, 0xA775}, // MCU_ADDRESS [MODE_GAM_TABLE_A_6] - {0x3390, 0x00A8}, // MCU_DATA_0 - {0x338C, 0xA776}, // MCU_ADDRESS [MODE_GAM_TABLE_A_7] - {0x3390, 0x00B9}, // MCU_DATA_0 - {0x338C, 0xA777}, // MCU_ADDRESS [MODE_GAM_TABLE_A_8] - {0x3390, 0x00C6}, // MCU_DATA_0 - {0x338C, 0xA778}, // MCU_ADDRESS [MODE_GAM_TABLE_A_9] - {0x3390, 0x00D0}, // MCU_DATA_0 - {0x338C, 0xA779}, // MCU_ADDRESS [MODE_GAM_TABLE_A_10] - {0x3390, 0x00D9}, // MCU_DATA_0 - {0x338C, 0xA77A}, // MCU_ADDRESS [MODE_GAM_TABLE_A_11] - {0x3390, 0x00E0}, // MCU_DATA_0 - {0x338C, 0xA77B}, // MCU_ADDRESS [MODE_GAM_TABLE_A_12] - {0x3390, 0x00E6}, // MCU_DATA_0 - {0x338C, 0xA77C}, // MCU_ADDRESS [MODE_GAM_TABLE_A_13] - {0x3390, 0x00EB}, // MCU_DATA_0 - {0x338C, 0xA77D}, // MCU_ADDRESS [MODE_GAM_TABLE_A_14] - {0x3390, 0x00F0}, // MCU_DATA_0 - {0x338C, 0xA77E}, // MCU_ADDRESS [MODE_GAM_TABLE_A_15] - {0x3390, 0x00F4}, // MCU_DATA_0 - {0x338C, 0xA77F}, // MCU_ADDRESS [MODE_GAM_TABLE_A_16] - {0x3390, 0x00F8}, // MCU_DATA_0 - {0x338C, 0xA780}, // MCU_ADDRESS [MODE_GAM_TABLE_A_17] - {0x3390, 0x00FC}, // MCU_DATA_0 - {0x338C, 0xA781}, // MCU_ADDRESS [MODE_GAM_TABLE_A_18] - {0x3390, 0x00FF}, // MCU_DATA_0 - // into outdoor mode - {0x338C, 0xA102}, // MCU_ADDRESS - {0x3390, 0x002F}, // MCU_DATA_0 - {0x338C, 0xA114}, // MCU_ADDRESS - {0x3390, 0x0005}, // MCU_DATA_0 - {SEQUENCE_WAIT_MS, 20}, - {0x338C, 0xA103}, // MCU_ADDRESS - {0x3390, 0x0005}, // MCU_DATA_0 - //Exposure - {0x338C, 0xA206}, // MCU_ADDRESS [AE_TARGET] - {0x3390, 0x003C}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; - -/* 720p 15fps @ 1280x720 */ - -static struct reginfo sensor_720p[]= -{ - {SEQUENCE_END, 0x00} -}; - -/* 1080p, 0x15fps, 0xyuv @1920x1080 */ - -static struct reginfo sensor_1080p[]= -{ - {SEQUENCE_END, 0x00} -}; - -/* 2592X1944 QSXGA */ -static struct reginfo sensor_qsxga[] = -{ - {SEQUENCE_END, 0x00} -}; -/* 2048*1536 QXGA */ -static struct reginfo sensor_qxga[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 1600X1200 UXGA */ -static struct reginfo sensor_uxga[] = -{ - {SEQUENCE_PROPERTY, SEQUENCE_CAPTURE}, - {0x338C, 0x275F}, - {0x3390, 0x0000}, - {0x338C, 0x2761}, - {0x3390, 0x0640}, - {0x338C, 0x2763}, - {0x3390, 0x0000}, - {0x338C, 0x2765}, - {0x3390, 0x04B0}, - {0x338C, 0x2707}, - {0x3390, 0x0640}, - {0x338C, 0x2709}, - {0x3390, 0x04B0}, - {0x338C, 0xA103}, - {0x3390, 0x0005}, - {SEQUENCE_END, 0x00} -}; -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {SEQUENCE_PROPERTY, SEQUENCE_CAPTURE}, - {0x338C, 0x275F}, - {0x3390, 0x0000}, - {0x338C, 0x2761}, - {0x3390, 0x0640}, - {0x338C, 0x2763}, - {0x3390, 0x0000}, - {0x338C, 0x2765}, - {0x3390, 0x04B0}, - {0x338C, 0x2707}, - {0x3390, 0x0500}, - {0x338C, 0x2709}, - {0x3390, 0x0400}, - {0x338C, 0xA103}, - {0x3390, 0x0005}, - {SEQUENCE_END, 0x00} -}; -/* 1024X768 XGA */ -static struct reginfo sensor_xga[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {SEQUENCE_END, 0x00} -}; - -#endif -#if 0 -/* 160X120 QQVGA*/ -static struct reginfo ov2655_qqvga[] = -{ - - {0x300E, 0x34}, - {0x3011, 0x01}, - {0x3012, 0x10}, - {0x302a, 0x02}, - {0x302b, 0xE6}, - {0x306f, 0x14}, - {0x3362, 0x90}, - - {0x3070, 0x5d}, - {0x3072, 0x5d}, - {0x301c, 0x07}, - {0x301d, 0x07}, - - {0x3020, 0x01}, - {0x3021, 0x18}, - {0x3022, 0x00}, - {0x3023, 0x06}, - {0x3024, 0x06}, - {0x3025, 0x58}, - {0x3026, 0x02}, - {0x3027, 0x61}, - {0x3088, 0x00}, - {0x3089, 0xa0}, - {0x308a, 0x00}, - {0x308b, 0x78}, - {0x3316, 0x64}, - {0x3317, 0x25}, - {0x3318, 0x80}, - {0x3319, 0x08}, - {0x331a, 0x0a}, - {0x331b, 0x07}, - {0x331c, 0x80}, - {0x331d, 0x38}, - {0x3100, 0x00}, - {0x3302, 0x11}, - - {0x0, 0x0}, -}; - - - -static struct reginfo ov2655_Sharpness_auto[] = -{ - {0x3306, 0x00}, -}; - -static struct reginfo ov2655_Sharpness1[] = -{ - {0x3306, 0x08}, - {0x3371, 0x00}, -}; - -static struct reginfo ov2655_Sharpness2[][3] = -{ - //Sharpness 2 - {0x3306, 0x08}, - {0x3371, 0x01}, -}; - -static struct reginfo ov2655_Sharpness3[] = -{ - //default - {0x3306, 0x08}, - {0x332d, 0x02}, -}; -static struct reginfo ov2655_Sharpness4[]= -{ - //Sharpness 4 - {0x3306, 0x08}, - {0x332d, 0x03}, -}; - -static struct reginfo ov2655_Sharpness5[] = -{ - //Sharpness 5 - {0x3306, 0x08}, - {0x332d, 0x04}, -}; -#endif - -static struct reginfo sensor_Preview2Capture[]= -{ - {0x338C, 0xA120}, // MCU_ADDRESS [SEQ_CAP_MODE] - {0x3390, 0x0002}, // MCU_DATA_0 - {0x338C, 0xA103}, // MCU_ADDRESS [SEQ_CMD] - {0x3390, 0x0002}, // MCU_DATA_0 - {0x338C, 0xA102}, // MCU_ADDRESS [SEQ_CMD] cgz oppo 2008-09-26 - {0x3390, 0x000E}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Capture2Preview[]= -{ - {0x338C, 0xA120}, // MCU_ADDRESS [SEQ_CAP_MODE] - {0x3390, 0x0000}, // MCU_DATA_0 - {0x338C, 0xA103}, // MCU_ADDRESS [SEQ_CMD] - {0x3390, 0x0001}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {SEQUENCE_END, 0x00} -}; - - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - //Auto - {0x338C, 0xA34A}, // MCU_ADDRESS [AWB_GAIN_MIN] - {0x3390, 0x0059}, // MCU_DATA_0 - {0x338C, 0xA34B}, // MCU_ADDRESS [AWB_GAIN_MAX] - {0x3390, 0x00A6}, // MCU_DATA_0 - {0x338C, 0xA34F}, // MCU_ADDRESS [AWB_CCM_POSITION_MIN] - {0x3390, 0x0000}, // MCU_DATA_0 - {0x338C, 0xA350}, // MCU_ADDRESS [AWB_CCM_POSITION_MAX] - {0x3390, 0x007F}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - //[V. DL 7500] - {0x338C, 0xA34B}, // MCU_ADDRESS [AWB_GAIN_MAX] - {0x3390, 0x0080}, // MCU_DATA_0 - {0x338C, 0xA34F}, // MCU_ADDRESS [AWB_CCM_POSITION_MIN] - {0x3390, 0x007F}, // MCU_DATA_0 - {0x338C, 0xA350}, // MCU_ADDRESS [AWB_CCM_POSITION_MAX] - {0x3390, 0x007F}, // MCU_DATA_ - {SEQUENCE_END, 0x00} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //[IV Day Light] - {0x338C, 0xA34A}, // MCU_ADDRESS [AWB_GAIN_MIN] - {0x3390, 0x0080}, // MCU_DATA_0 - {0x338C, 0xA34B}, // MCU_ADDRESS [AWB_GAIN_MAX] - {0x3390, 0x0080}, // MCU_DATA_0 - {0x338C, 0xA34F}, // MCU_ADDRESS [AWB_CCM_POSITION_MIN] - {0x3390, 0x007E}, // MCU_DATA_0 - {0x338C, 0xA350}, // MCU_ADDRESS [AWB_CCM_POSITION_MAX] - {0x3390, 0x007E}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - //[III Fluorescent] - {0x338C, 0xA34A}, // MCU_ADDRESS [AWB_GAIN_MIN] - {0x3390, 0x0080}, // MCU_DATA_0 - {0x338C, 0xA34B}, // MCU_ADDRESS [AWB_GAIN_MAX] - {0x3390, 0x0080}, // MCU_DATA_0 - {0x338C, 0xA34F}, // MCU_ADDRESS [AWB_CCM_POSITION_MIN] - {0x3390, 0x0030}, // MCU_DATA_0 - {0x338C, 0xA350}, // MCU_ADDRESS [AWB_CCM_POSITION_MAX] - {0x3390, 0x0030}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - //[II. Incandescent] - {0x338C, 0xA34A}, // MCU_ADDRESS [AWB_GAIN_MIN] - {0x3390, 0x0080}, // MCU_DATA_0 - {0x338C, 0xA34B}, // MCU_ADDRESS [AWB_GAIN_MAX] - {0x3390, 0x0080}, // MCU_DATA_0 - {0x338C, 0xA34F}, // MCU_ADDRESS [AWB_CCM_POSITION_MIN] - {0x3390, 0x0032}, // MCU_DATA_0 - {0x338C, 0xA350}, // MCU_ADDRESS [AWB_CCM_POSITION_MAX] - {0x3390, 0x0032}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x338C, 0x2799}, // MCU_ADDRESS [MODE_SPEC_EFFECTS_A] - {0x3390, 0x6408}, // MCU_DATA_0 - {0x338C, 0x279B}, // MCU_ADDRESS [MODE_SPEC_EFFECTS_B] - {0x3390, 0x6408}, // MCU_DATA_0 - {0x338C, 0xA103}, // MCU_ADDRESS [SEQ_CMD] - {0x3390, 0x0005}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {0x338C, 0x2799}, // MCU_ADDRESS [MODE_SPEC_EFFECTS_A] - {0x3390, 0x6409}, // MCU_DATA_0 - {0x338C, 0x279B}, // MCU_ADDRESS [MODE_SPEC_EFFECTS_B] - {0x3390, 0x6409}, // MCU_DATA_0 - {0x338C, 0xA103}, // MCU_ADDRESS [SEQ_CMD] - {0x3390, 0x0005}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x338C, 0x2799}, // MCU_ADDRESS [MODE_SPEC_EFFECTS_A] - {0x3390, 0x640A}, // MCU_DATA_0 - {0x338C, 0x279B}, // MCU_ADDRESS [MODE_SPEC_EFFECTS_B] - {0x3390, 0x640A}, // MCU_DATA_0 - {0x338C, 0xA103}, // MCU_ADDRESS [SEQ_CMD] - {0x3390, 0x0005}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - {0x338C, 0x2799}, // MCU_ADDRESS [MODE_SPEC_EFFECTS_A] - {0x3390, 0x640B}, // MCU_DATA_0 - {0x338C, 0x279B}, // MCU_ADDRESS [MODE_SPEC_EFFECTS_B] - {0x3390, 0x640B}, // MCU_DATA_0 - {0x338C, 0xA103}, // MCU_ADDRESS [SEQ_CMD] - {0x3390, 0x0005}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Solarize[] = -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Sepia,sensor_Effect_Negative, - NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast2[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - {SEQUENCE_END, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ - {0x338C, 0xA102}, // MCU_ADDRESS - {0x3390, 0x002F}, // MCU_DATA_0 - {0x338C, 0xA114}, // MCU_ADDRESS - {0x3390, 0x0005}, // MCU_DATA_0 - {SEQUENCE_WAIT_MS, 20}, - {0x338C, 0xA103}, // MCU_ADDRESS - {0x3390, 0x0005}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_SceneNight[] = -{ - {0x338C, 0xA102}, // MCU_ADDRESS - {0x3390, 0x000F}, // MCU_DATA_0 - {SEQUENCE_WAIT_MS, 20}, - {0x338C, 0xA103}, // MCU_ADDRESS - {0x3390, 0x0005}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Zoom1[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Zoom2[] = -{ - {SEQUENCE_END, 0x00} -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL}; -#endif -static const struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - { - .id = V4L2_CID_FOCUS_AUTO, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Focus Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - },{ - .id = V4L2_CID_FOCUS_CONTINUOUS, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Focus Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -static int sensor_deactivate(struct i2c_client *client); -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; -enum sensor_work_state -{ - sensor_work_ready = 0, - sensor_working, -}; -struct sensor_work -{ - struct i2c_client *client; - struct delayed_work dwork; - enum sensor_work_state state; -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int auto_focus; - int affm_reinit; - int flash; - int exposure; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - bool snap2preview; - bool video2preview; - int capture_w; - int capture_h; - int preview_w; - int preview_h; - struct reginfo *winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int enable; - unsigned int funmodule_state; -} sensor_info_priv_t; - - - -struct sensor_parameter -{ - unsigned short int preview_maxlines; - unsigned short int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int capture_framerate; - unsigned short int preview_framerate; -}; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - struct sensor_parameter parameter; - struct workqueue_struct *sensor_wq; - struct sensor_work sensor_wk; - struct mutex wq_lock; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, u16 reg, u16 val) -{ - int err=0,cnt; - u8 buf[4]; - struct i2c_msg msg[1]; - - switch (reg) - { - case SEQUENCE_WAIT_MS: - { - msleep(val); - break; - } - - case SEQUENCE_WAIT_US: - { - udelay(val); - break; - } - - case SEQUENCE_PROPERTY: - { - break; - } - default: - { - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - buf[2] = val >> 8; - buf[3] = val & 0xFF; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - } - } - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u16 reg, u16 *val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[2]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 2; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - while (regarray[i].reg != SEQUENCE_END) - { - - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - - i++; - } - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != SEQUENCE_END) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif -#if CONFIG_SENSOR_Focus - -static int sensor_af_single(struct i2c_client *client) -{ - int ret = 0; - - -sensor_af_single_end: - return ret; -} - -static int sensor_af_const(struct i2c_client *client) -{ - int ret = 0; - -sensor_af_const_end: - return ret; -} - -static int sensor_af_zoneupdate(struct i2c_client *client) -{ - int ret = 0; - -sensor_af_zoneupdate_end: - return ret; -} - -static int sensor_af_init(struct i2c_client *client) -{ - int ret = 0; - - return ret; -} -#endif - -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } - -sensor_power_end: - return ret; -} - -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} - -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - int ret; -#if (SENSOR_ID_REG != SEQUENCE_END) - u16 pid = 0; -#endif - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - -#if (SENSOR_RESET_REG != SEQUENCE_END) - ret = sensor_write(client, SENSOR_RESET_REG, SENSOR_RESET_VAL); - if (ret != 0) { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); //delay 5 microseconds -#endif - - /* check if it is an sensor sensor */ -#if (SENSOR_ID_REG != SEQUENCE_END) - ret = sensor_read(client, SENSOR_ID_REG, &pid); - if (ret != 0) { - SENSOR_TR("read chip id failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - SENSOR_DG("\n %s pid = 0x%x \n", SENSOR_NAME_STRING(), pid); -#else - pid = SENSOR_ID; -#endif - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - sensor->info_priv.preview_w = SENSOR_INIT_WIDTH; - sensor->info_priv.preview_h = SENSOR_INIT_HEIGHT; - sensor->info_priv.capture_w = SENSOR_MAX_WIDTH; - sensor->info_priv.capture_h = SENSOR_MAX_HEIGHT; - sensor->info_priv.winseqe_cur_addr = SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - - return 0; -sensor_INIT_ERR: - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - sensor_task_lock(client, 1); - sensor_ioctrl(icd, Sensor_PowerDown, 1); - - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - msleep(100); - return 0; -} -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - return 0; -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - struct reginfo *winseqe_set_addr=NULL; - int ret = 0, set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && (sensor_svga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_svga; - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1024) && (set_h <= 768)) && (sensor_xga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_xga; - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 720)) && (sensor_720p[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_720p; - set_w = 1280; - set_h = 720; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_sxga; - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_uxga; - set_w = 1600; - set_h = 1200; - } - else if (((set_w <= 1920) && (set_h <= 1080)) && (sensor_1080p[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_1080p; - set_w = 1920; - set_h = 1080; - } - else if (((set_w <= 2048) && (set_h <= 1536)) && (sensor_qxga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_qxga; - set_w = 2048; - set_h = 1536; - } - else if (((set_w <= 2592) && (set_h <= 1944)) && (sensor_qsxga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_qsxga; - set_w = 2592; - set_h = 1944; - } - - if ((winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) && winseqe_set_addr) { - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - goto sensor_s_fmt_end; - } - sensor->info_priv.winseqe_cur_addr = winseqe_set_addr; - if ((winseqe_set_addr[0].reg==SEQUENCE_PROPERTY) && (winseqe_set_addr[0].val==SEQUENCE_CAPTURE)) { - SENSOR_DG("\n%s..%s..Capture icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } else { - SENSOR_DG("\n%s..%s..Video icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - } - - if (winseqe_set_addr && (winseqe_set_addr[0].reg==SEQUENCE_PROPERTY) && (winseqe_set_addr[0].val==SEQUENCE_CAPTURE)) { - ret |= sensor_write_array(client, sensor_Preview2Capture); - if (ret != 0) { - SENSOR_TR("%s Preview 2 Capture failed\n", SENSOR_NAME_STRING()); - goto sensor_s_fmt_end; - } - sensor->info_priv.capture_w = set_w; - sensor->info_priv.capture_h = set_h; - sensor->info_priv.snap2preview = true; - } else if (sensor->info_priv.snap2preview == true) { - if (winseqe_set_addr || ((sensor->info_priv.preview_w == mf->width) && (sensor->info_priv.preview_h == mf->height))) { - ret |= sensor_write_array(client, sensor_Capture2Preview); - if (ret != 0) { - SENSOR_TR("%s Capture 2 Preview failed\n", SENSOR_NAME_STRING()); - goto sensor_s_fmt_end; - } - sensor->info_priv.preview_w = mf->width; - sensor->info_priv.preview_h = mf->height; - sensor->info_priv.snap2preview = false; - } else { - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - } - - mf->width = set_w; - mf->height = set_h; -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg!=SEQUENCE_END)) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg!=SEQUENCE_END)) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=SEQUENCE_END)) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=SEQUENCE_END)) - { - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && (sensor_svga[0].reg!=SEQUENCE_END)) - { - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1024) && (set_h <= 768)) && (sensor_xga[0].reg!=SEQUENCE_END)) - { - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 720)) && (sensor_720p[0].reg!=SEQUENCE_END)) - { - set_w = 1280; - set_h = 720; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=SEQUENCE_END)) - { - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=SEQUENCE_END)) - { - set_w = 1600; - set_h = 1200; - } - else if (((set_w <= 1920) && (set_h <= 1080)) && (sensor_1080p[0].reg!=SEQUENCE_END)) - { - set_w = 1920; - set_h = 1080; - } - else if (((set_w <= 2048) && (set_h <= 1536)) && (sensor_qxga[0].reg!=SEQUENCE_END)) - { - set_w = 2048; - set_h = 1536; - } - else if (((set_w <= 2592) && (set_h <= 1944)) && (sensor_qsxga[0].reg!=SEQUENCE_END)) - { - set_w = 2592; - set_h = 1944; - } - - mf->width = set_w; - mf->height = set_h; - - mf->colorspace = fmt->colorspace; - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV2655 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((*value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value > 0) && ((digitalzoom_cur + *value) > digitalzoom_total)) - { - *value = digitalzoom_total - digitalzoom_cur; - } - - if ((*value < 0) && ((digitalzoom_cur + *value) < 0)) - { - *value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += *value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, *value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Focus -static int sensor_set_focus_absolute(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int ret = 0; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (!qctrl_info) - return -EINVAL; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - if ((value >= qctrl_info->minimum) && (value <= qctrl_info->maximum)) { - - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EINVAL; - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - } - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - -sensor_set_focus_absolute_end: - return ret; -} -static int sensor_set_focus_relative(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int ret = 0; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_RELATIVE); - if (!qctrl_info) - return -EINVAL; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - if ((value >= qctrl_info->minimum) && (value <= qctrl_info->maximum)) { - - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EINVAL; - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - } - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } -sensor_set_focus_relative_end: - return ret; -} - -static int sensor_set_focus_mode(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int ret = 0; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - switch (value) - { - case SENSOR_AF_MODE_AUTO: - { - ret = sensor_af_single(client); - break; - } - - case SENSOR_AF_MODE_MACRO: - { - ret = sensor_set_focus_absolute(icd, qctrl, 0xff); - break; - } - - case SENSOR_AF_MODE_INFINITY: - { - ret = sensor_set_focus_absolute(icd, qctrl, 0x00); - break; - } - - case SENSOR_AF_MODE_CONTINUOUS: - { - ret = sensor_af_const(client); - break; - } - default: - SENSOR_TR("\n %s..%s AF value(0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__,value); - break; - - } - - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - - return ret; -} -#endif -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (sensor_set_focus_absolute(icd, qctrl,ext_ctrl->value) == 0) { - if (ext_ctrl->value == qctrl->minimum) { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_INFINITY; - } else if (ext_ctrl->value == qctrl->maximum) { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_MACRO; - } else { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_FIXED; - } - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - sensor_set_focus_relative(icd, qctrl,ext_ctrl->value); - break; - } - case V4L2_CID_FOCUS_AUTO: - { - if (ext_ctrl->value == 1) { - if (sensor_set_focus_mode(icd, qctrl,SENSOR_AF_MODE_AUTO) != 0) - return -EINVAL; - sensor->info_priv.auto_focus = SENSOR_AF_MODE_AUTO; - } else if (SENSOR_AF_MODE_AUTO == sensor->info_priv.auto_focus){ - if (ext_ctrl->value == 0) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CLOSE; - } - break; - } - case V4L2_CID_FOCUS_CONTINUOUS: - { - if (SENSOR_AF_MODE_CONTINUOUS != sensor->info_priv.auto_focus) { - if (ext_ctrl->value == 1) { - if (sensor_set_focus_mode(icd, qctrl,SENSOR_AF_MODE_CONTINUOUS) != 0) - return -EINVAL; - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CONTINUOUS; - } - } else { - if (ext_ctrl->value == 0) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CLOSE; - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_stream(struct v4l2_subdev *sd, int enable) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - - if (enable == 1) { - sensor->info_priv.enable = 1; - } else if (enable == 0) { - sensor->info_priv.enable = 0; - } - - return 0; -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - int ret; -#if (SENSOR_ID_REG != SEQUENCE_END) - u16 pid = 0; -#endif - - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - - /* soft reset */ -#if (SENSOR_RESET_REG != SEQUENCE_END) - ret = sensor_write(client, SENSOR_RESET_REG, SENSOR_RESET_VAL); - if (ret != 0) { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); //delay 5 microseconds -#endif - - /* check if it is an sensor sensor */ -#if (SENSOR_ID_REG != SEQUENCE_END) - ret = sensor_read(client, SENSOR_ID_REG, &pid); - if (ret != 0) { - SENSOR_TR("read chip id failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - SENSOR_DG("\n %s pid = 0x%x \n", SENSOR_NAME_STRING(), pid); -#else - pid = SENSOR_ID; -#endif - - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - - return 0; - -sensor_video_probe_err: - return ret; -} -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0; -#if CONFIG_SENSOR_Flash - int i; -#endif - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - sensor->sensor_gpio_res = NULL; - for (i=0; isensor_io_request->gpio_res[i].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[i].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[i]; - } - } - if (sensor->sensor_gpio_res == NULL) { - SENSOR_TR("%s %s obtain gpio resource failed when RK29_CAM_SUBDEV_IOREQUEST \n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - sensor->info_priv.fmt = sensor_colour_fmts[0]; - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - - - diff --git a/drivers/media/video/mt9d112.h b/drivers/media/video/mt9d112.h deleted file mode 100755 index ab301c910f07..000000000000 --- a/drivers/media/video/mt9d112.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Driver for MT9P111 CMOS Image Sensor from Aptina - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#ifndef __MT9D112_H__ -#define __MT9D112_H__ -struct reginfo -{ - u16 reg; - u16 val; -}; - -#define SEQUENCE_INIT 0x00 -#define SEQUENCE_NORMAL 0x01 -#define SEQUENCE_CAPTURE 0x02 -#define SEQUENCE_PREVIEW 0x03 - -#define SEQUENCE_PROPERTY 0xFFFC -#define SEQUENCE_WAIT_MS 0xFFFD -#define SEQUENCE_WAIT_US 0xFFFE -#define SEQUENCE_END 0xFFFF -#endif - diff --git a/drivers/media/video/mt9d113.c b/drivers/media/video/mt9d113.c deleted file mode 100755 index eea39a2955ea..000000000000 --- a/drivers/media/video/mt9d113.c +++ /dev/null @@ -1,3155 +0,0 @@ -/* - * Driver for OV5642 CMOS Image Sensor from OmniVision - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "mt9d113.h" - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_MT9D113 -#define SENSOR_V4L2_IDENT V4L2_IDENT_MT9D113 -#define SENSOR_ID 0x2580 -#define SENSOR_ID_REG 0x00 -#define SENSOR_RESET_REG SEQUENCE_END -#define SENSOR_RESET_VAL 0 -#define SENSOR_DERESET_VAL 0 -#define SENSOR_RESET_REG_LEN WORD_LEN -#define SENSOR_MIN_WIDTH 800 -#define SENSOR_MIN_HEIGHT 600 -#define SENSOR_MAX_WIDTH 1600 -#define SENSOR_MAX_HEIGHT 1200 -#define SENSOR_INIT_WIDTH 800 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 600 -#define SENSOR_INIT_WINSEQADR sensor_init_data -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_UYVY8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 0 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 0 -#define CONFIG_SENSOR_Scene 0 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 1 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 -#define CONFIG_SENSOR_Focus 0 - -#define CONFIG_SENSOR_I2C_SPEED 100000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 1 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_FALLING |\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) - -#if CONFIG_SENSOR_Focus -#define SENSOR_AF_MODE_INFINITY 0 -#define SENSOR_AF_MODE_MACRO 1 -#define SENSOR_AF_MODE_FIXED 2 -#define SENSOR_AF_MODE_AUTO 3 -#define SENSOR_AF_MODE_CONTINUOUS 4 -#define SENSOR_AF_MODE_CLOSE 5 -#endif - - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); - -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_MT9D113_USER_DEFINED_SERIES -#include "mt9d113_user_series.c" -#else -/* init 800x600 SVGA */ -static struct reginfo sensor_init_data[] = -{ - #if 0 - //[Step2-PLL_Timing] - //for 24MHz input, VCO=MAX PCLK=76.8MHz - { 0x0014, 0x21F9, WORD_LEN, 0}, //PLL Control: BYPASS PLL = 8697 - { 0x0010, 0x0110, WORD_LEN, 0}, //PLL Dividers = 272 - { 0x0012, 0x1FF7, WORD_LEN, 0}, //PLL P Dividers = 8183 - { 0x0014, 0x21FB, WORD_LEN, 0}, //PLL Control: PLL_ENABLE on = 8699 - { 0x0014, 0x20FB, WORD_LEN, 0}, //PLL Control: SEL_LOCK_DET on = 8443 - - { SEQUENCE_WAIT_US, 1, WORD_LEN, 0}, // Allow PLL to lock - - { 0x0014, 0x20FA, WORD_LEN, 0}, //PLL Control: PLL_BYPASS off = 8442 - { 0x0018, 0x402D, WORD_LEN, 0}, - - //GO - { 0x0018, 0x402C, WORD_LEN, 0}, - - { SEQUENCE_WAIT_US, 100, WORD_LEN, 0}, - - { 0x321C, 0x0003, WORD_LEN, 0}, //By Pass TxFIFO = 3 - { 0x098C, 0x2703, WORD_LEN, 0}, //Output Width (A) - { 0x0990, 0x0320, WORD_LEN, 0}, // = 800 - { 0x98C, 0x2705, WORD_LEN, 0}, //Output Height (A) - { 0x990, 0x0258 , WORD_LEN, 0}, // = 600 - { 0x98C, 0x2707, WORD_LEN, 0}, //Output Width (B) - { 0x990, 0x0640 , WORD_LEN, 0}, // = 1600 - { 0x98C, 0x2709 , WORD_LEN, 0}, //Output Height (B) - { 0x990, 0x04B0 , WORD_LEN, 0}, // = 1200 - { 0x98C, 0x270D , WORD_LEN, 0}, //Row Start (A) - { 0x990, 0x000 , WORD_LEN, 0}, // = 0 - { 0x98C, 0x270F , WORD_LEN, 0}, //Column Start (A) - { 0x990, 0x000 , WORD_LEN, 0}, // = 0 - { 0x98C, 0x2711 , WORD_LEN, 0}, //Row End (A) - { 0x990, 0x4BD , WORD_LEN, 0}, // = 1213 - { 0x98C, 0x2713 , WORD_LEN, 0}, //Column End (A) - { 0x990, 0x64D , WORD_LEN, 0}, // = 1613 - { 0x98C, 0x2715 , WORD_LEN, 0}, //Row Speed (A) - { 0x990, 0x0111 , WORD_LEN, 0}, // = 273 - { 0x98C, 0x2717 , WORD_LEN, 0}, //Read Mode (A) -//miaozh modify - { 0x0990, 0x046C , WORD_LEN, 0}, // MCU_DATA_0 -// { 0x0990, 0x046E , WORD_LEN, 0}, // MCU_DATA_0 -// { 0x098C, 0xA103 , WORD_LEN, 0}, // MCU_ADDRESS [SEQ_CMD] -// { 0x0990, 0x0006 , WORD_LEN, 0}, // MCU_DATA_0 - - { 0x98C, 0x2719 , WORD_LEN, 0}, //sensor_fine_correction (A) - { 0x990, 0x005A , WORD_LEN, 0}, // = 90 - { 0x98C, 0x271B , WORD_LEN, 0}, //sensor_fine_IT_min (A) - { 0x990, 0x01BE , WORD_LEN, 0}, // = 446 - { 0x98C, 0x271D , WORD_LEN, 0}, //sensor_fine_IT_max_margin (A) - { 0x990, 0x0131 , WORD_LEN, 0}, // = 305 - { 0x98C, 0x271F , WORD_LEN, 0}, //Frame Lines (A) - { 0x990, 0x02B3 , WORD_LEN, 0}, // = 691 - { 0x98C, 0x2721 , WORD_LEN, 0}, //Line Length (A) - { 0x990, 0x056D , WORD_LEN, 0}, // = 1389 - { 0x98C, 0x2723 , WORD_LEN, 0}, //Row Start (B) - { 0x990, 0x004 , WORD_LEN, 0}, // = 4 - { 0x98C, 0x2725 , WORD_LEN, 0}, //Column Start (B) - { 0x990, 0x004 , WORD_LEN, 0}, // = 4 - { 0x98C, 0x2727 , WORD_LEN, 0}, //Row End (B) - { 0x990, 0x4BB , WORD_LEN, 0}, // = 1211 - { 0x98C, 0x2729 , WORD_LEN, 0}, //Column End (B) - { 0x990, 0x64B , WORD_LEN, 0}, // = 1611 - { 0x98C, 0x272B , WORD_LEN, 0}, //Row Speed (B) - { 0x990, 0x0111 , WORD_LEN, 0}, // = 273 - { 0x98C, 0x272D , WORD_LEN, 0}, //Read Mode (B) - { 0x990, 0x0024 , WORD_LEN, 0}, // = 36 - { 0x98C, 0x272F , WORD_LEN, 0}, //sensor_fine_correction (B) - { 0x990, 0x003A , WORD_LEN, 0}, // = 58 - { 0x98C, 0x2731 , WORD_LEN, 0}, //sensor_fine_IT_min (B) - { 0x990, 0x00F6 , WORD_LEN, 0}, // = 246 - { 0x98C, 0x2733 , WORD_LEN, 0}, //sensor_fine_IT_max_margin (B) - { 0x990, 0x008B , WORD_LEN, 0}, // = 139 - { 0x98C, 0x2735 , WORD_LEN, 0}, //Frame Lines (B) - { 0x990, 0x050D , WORD_LEN, 0}, // = 1293 - { 0x98C, 0x2737 , WORD_LEN, 0}, //Line Length (B) - { 0x990, 0x0894 , WORD_LEN, 0}, // = 2196 - { 0x98C, 0x2739 , WORD_LEN, 0}, //Crop_X0 (A) - { 0x990, 0x0000 , WORD_LEN, 0}, // = 0 - { 0x98C, 0x273B , WORD_LEN, 0}, //Crop_X1 (A) - { 0x990, 0x031F , WORD_LEN, 0}, // = 799 - { 0x98C, 0x273D , WORD_LEN, 0}, //Crop_Y0 (A) - { 0x990, 0x0000 , WORD_LEN, 0}, // = 0 - { 0x98C, 0x273F , WORD_LEN, 0}, //Crop_Y1 (A) - { 0x990, 0x0257 , WORD_LEN, 0}, // = 599 - { 0x98C, 0x2747 , WORD_LEN, 0}, //Crop_X0 (B) - { 0x990, 0x0000 , WORD_LEN, 0}, // = 0 - { 0x98C, 0x2749 , WORD_LEN, 0}, //Crop_X1 (B) - { 0x990, 0x063F , WORD_LEN, 0}, // = 1599 - { 0x98C, 0x274B , WORD_LEN, 0}, //Crop_Y0 (B) - { 0x990, 0x0000 , WORD_LEN, 0}, // = 0 - { 0x98C, 0x274D , WORD_LEN, 0}, //Crop_Y1 (B) - { 0x990, 0x04AF , WORD_LEN, 0}, // = 1199 - { 0x98C, 0x222D , WORD_LEN, 0}, //R9 Step - { 0x990, 0x0090 , WORD_LEN, 0}, // = 144 - { 0x98C, 0xA408 , WORD_LEN, 0}, //search_f1_50 - { 0x990, 0x23 , WORD_LEN, 0}, // = 35 - { 0x98C, 0xA409 , WORD_LEN, 0}, //search_f2_50 - { 0x990, 0x25 , WORD_LEN, 0}, // = 37 - { 0x98C, 0xA40A , WORD_LEN, 0}, //search_f1_60 - { 0x990, 0x2A , WORD_LEN, 0}, // = 42 - { 0x98C, 0xA40B , WORD_LEN, 0}, //search_f2_60 - { 0x990, 0x2C , WORD_LEN, 0}, // = 44 - { 0x98C, 0x2411 , WORD_LEN, 0}, //R9_Step_60 (A) - { 0x990, 0x0090 , WORD_LEN, 0}, // = 144 - { 0x98C, 0x2413 , WORD_LEN, 0}, //R9_Step_50 (A) - { 0x990, 0x00AD , WORD_LEN, 0}, // = 173 - { 0x98C, 0x2415 , WORD_LEN, 0}, //R9_Step_60 (B) - { 0x990, 0x005B , WORD_LEN, 0}, // = 91 - { 0x98C, 0x2417 , WORD_LEN, 0}, //R9_Step_50 (B) - { 0x990, 0x006D , WORD_LEN, 0}, // = 109 - { 0x98C, 0xA404 , WORD_LEN, 0}, //FD Mode - { 0x990, 0x10 , WORD_LEN, 0}, // = 16 - { 0x98C, 0xA40D , WORD_LEN, 0}, //Stat_min - { 0x990, 0x02 , WORD_LEN, 0}, // = 2 - { 0x98C, 0xA40E , WORD_LEN, 0}, //Stat_max - { 0x990, 0x03 , WORD_LEN, 0}, // = 3 - { 0x98C, 0xA410 , WORD_LEN, 0}, //Min_amplitude - { 0x990, 0x0A , WORD_LEN, 0}, // = 10 - { 0x98C, 0xA103 , WORD_LEN, 0}, //Refresh Sequencer Mode - { 0x990, 0x06 , WORD_LEN, 0}, // = 6 - //POLL_FIELD=SEQ_CMD, !=0, DELAY=10, TIMEOUT=100 // wait for command to be processed - - { SEQUENCE_WAIT_US, 100, WORD_LEN, 0}, - - { 0x98C, 0xA103 , WORD_LEN, 0}, //Refresh Sequencer - { 0x990, 0x05 , WORD_LEN, 0}, // = 5 - - { SEQUENCE_WAIT_US, 100, WORD_LEN, 0}, - - //POLL_FIELD=SEQ_CMD, !=0, DELAY=10, TIMEOUT=100 // wait for command to be processed - {SEQUENCE_END, 0x00} -#else - //[Step2-PLL_Timing] - //for 24MHz input, VCO=MAX PCLK=76.8MHz - { 0x001A, 0x0051, WORD_LEN, 0}, // RESET_AND_MISC_CONTROL - { 0x001A, 0x0050, WORD_LEN, 0}, // RESET_AND_MISC_CONTROL - { 0x0014, 0x2545, WORD_LEN, 0}, // PLL_CONTROL - { 0x0010, 0x011C, WORD_LEN, 0}, // PLL_DIVIDERS - { 0x0012, 0x1FF7, WORD_LEN, 0}, // PLL_P_DIVIDERS - { 0x0014, 0x2547, WORD_LEN, 0}, // PLL_CONTROL - { 0x0014, 0x2447, WORD_LEN, 0}, // PLL_CONTROL - { 0x0014, 0x2047, WORD_LEN, 0}, // PLL_CONTROL - { 0x0014, 0x2046, WORD_LEN, 0}, // PLL_CONTROL - { 0x001A, 0x0050, WORD_LEN, 0}, // RESET_AND_MISC_CONTROL - { 0x0018, 0x4028 , WORD_LEN, 0}, // STANDBY_CONTROL - { 0x321C, 0x0003 , WORD_LEN, 0}, // OFIFO_CONTROL_STATUS - { 0x098C, 0x2703 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0320 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2705 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0258 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2707 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0640 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2709 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x04B0 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x270D , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0000 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x270F , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0000 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2711 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x04BD , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2713 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x064D , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2715 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0111 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2717 , WORD_LEN, 0}, // MCU_ADDRESS -//miaozh modify - { 0x0990, 0x046C , WORD_LEN, 0}, // MCU_DATA_0 -// { 0x0990, 0x046E , WORD_LEN, 0}, // MCU_DATA_0 -// { 0x098C, 0xA103 , WORD_LEN, 0}, // MCU_ADDRESS [SEQ_CMD] -// { 0x0990, 0x0006 , WORD_LEN, 0}, // MCU_DATA_0 - - { 0x098C, 0x2719 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x005A , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x271B , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x01BE , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x271D , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0131 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x271F , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x02B3 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2721 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x09B0 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2723 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0004 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2725 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0004 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2727 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x04BB , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2729 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x064B , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x272B , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0111 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x272D , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0024 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x272F , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x003A , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2731 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x00F6 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2733 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x008B , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2735 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x050D , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2737 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0807 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2739 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0000 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x273B , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x031F , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x273D , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0000 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x273F , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0257 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2747 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0000 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2749 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x063F , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x274B , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0000 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x274D , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x04AF , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x222D , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x008D , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0xA408 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0022 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0xA409 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0024 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0xA40A , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0029 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0xA40B , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x002B , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2411 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x008D , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2413 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x00A9 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2415 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x00AA , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2417 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x00CC , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0xA404 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0010 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0xA40D , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0002 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0xA40E , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0003 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0xA410 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x000A , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0xA103 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0006 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0xA103 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0005 , WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -#endif -}; - -/* 720p 15fps @ 1280x720 */ - -static struct reginfo sensor_720p[]= -{ - {SEQUENCE_END, 0x00} -}; - -/* 1080p, 0x15fps, 0xyuv @1920x1080 */ - -static struct reginfo sensor_1080p[]= -{ - {SEQUENCE_END, 0x00} -}; - -/* 2592X1944 QSXGA */ -static struct reginfo sensor_qsxga[] = -{ - {SEQUENCE_END, 0x00} -}; -/* 2048*1536 QXGA */ -static struct reginfo sensor_qxga[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 1600X1200 UXGA */ -static struct reginfo sensor_uxga[] = -{ - //capture2preview - { 0x098C, 0xA115, WORD_LEN, 0}, // MCU_ADDRESS [SEQ_CAP_MODE] - { 0x0990, 0x0002, WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0xA103, WORD_LEN, 0}, // MCU_ADDRESS [SEQ_CMD] - { 0x0990, 0x0002, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ -#if 0 - { 0x098C, 0xA115, WORD_LEN, 0}, // MCU_ADDRESS [SEQ_CAP_MODE] - { 0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0xA103, WORD_LEN, 0}, // MCU_ADDRESS [SEQ_CMD] - { 0x0990, 0x0001, WORD_LEN, 0}, // MCU_DATA_0 - -//miaozh add -// { 0x098C, 0x2717 , WORD_LEN, 0}, // MCU_ADDRESS -// { 0x0990, 0x046E , WORD_LEN, 0}, // MCU_DATA_0 -// { 0x098C, 0xA103 , WORD_LEN, 0}, // MCU_ADDRESS [SEQ_CMD] -// { 0x0990, 0x0006 , WORD_LEN, 0}, // MCU_DATA_0 - - { 0x098C, 0x2747, WORD_LEN, 0}, // MCU_ADDRESS [MODE_CROP_X0_B] - { 0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2749, WORD_LEN, 0}, // MCU_ADDRESS [MODE_CROP_X1_B] - { 0x0990, 0x063F, WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x274B, WORD_LEN, 0}, // MCU_ADDRESS [MODE_CROP_Y0_B] - { 0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x274D, WORD_LEN, 0}, // MCU_ADDRESS [MODE_CROP_Y1_B] - { 0x0990, 0x04AF, WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2707, WORD_LEN, 0}, // MCU_ADDRESS [MODE_OUTPUT_WIDTH_B] - { 0x0990, 0x0500, WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2709, WORD_LEN, 0}, // MCU_ADDRESS [MODE_OUTPUT_HEIGHT_B] - { 0x0990, 0x0400, WORD_LEN, 0}, // MCU_DATA_0 - - { 0x098C, 0xA103, WORD_LEN, 0}, // MCU_ADDRESS [SEQ_CMD] - { 0x0990, 0x0005, WORD_LEN, 0}, // MCU_DATA_0 - - { 0x098C, 0xA115, WORD_LEN, 0}, // MCU_ADDRESS [SEQ_CAP_MODE] - { 0x0990, 0x0002, WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0xA103, WORD_LEN, 0}, // MCU_ADDRESS [SEQ_CMD] - { 0x0990, 0x0002, WORD_LEN, 0}, // MCU_DATA_0 - -#endif - {SEQUENCE_END, 0x00} -}; -/* 1024X768 XGA */ -static struct reginfo sensor_xga[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - //[Step2-PLL_Timing] - //for 24MHz input, VCO=MAX PCLK=76.8MHz - { 0x001A, 0x0051, WORD_LEN, 0}, // RESET_AND_MISC_CONTROL - { 0x001A, 0x0050, WORD_LEN, 0}, // RESET_AND_MISC_CONTROL - { 0x0014, 0x2545, WORD_LEN, 0}, // PLL_CONTROL - { 0x0010, 0x011C, WORD_LEN, 0}, // PLL_DIVIDERS - { 0x0012, 0x1FF7, WORD_LEN, 0}, // PLL_P_DIVIDERS - { 0x0014, 0x2547, WORD_LEN, 0}, // PLL_CONTROL - { 0x0014, 0x2447, WORD_LEN, 0}, // PLL_CONTROL - { 0x0014, 0x2047, WORD_LEN, 0}, // PLL_CONTROL - { 0x0014, 0x2046, WORD_LEN, 0}, // PLL_CONTROL - { 0x001A, 0x0050, WORD_LEN, 0}, // RESET_AND_MISC_CONTROL - { 0x0018, 0x4028 , WORD_LEN, 0}, // STANDBY_CONTROL - { 0x321C, 0x0003 , WORD_LEN, 0}, // OFIFO_CONTROL_STATUS - { 0x098C, 0x2703 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0320 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2705 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0258 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2707 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0640 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2709 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x04B0 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x270D , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0000 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x270F , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0000 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2711 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x04BD , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2713 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x064D , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2715 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0111 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2717 , WORD_LEN, 0}, // MCU_ADDRESS -//miaozh modify - { 0x0990, 0x046C , WORD_LEN, 0}, // MCU_DATA_0 -// { 0x0990, 0x046E , WORD_LEN, 0}, // MCU_DATA_0 -// { 0x098C, 0xA103 , WORD_LEN, 0}, // MCU_ADDRESS [SEQ_CMD] -// { 0x0990, 0x0006 , WORD_LEN, 0}, // MCU_DATA_0 - - - { 0x098C, 0x2719 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x005A , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x271B , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x01BE , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x271D , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0131 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x271F , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x02B3 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2721 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x09B0 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2723 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0004 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2725 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0004 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2727 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x04BB , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2729 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x064B , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x272B , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0111 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x272D , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0024 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x272F , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x003A , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2731 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x00F6 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2733 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x008B , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2735 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x050D , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2737 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0807 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2739 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0000 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x273B , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x031F , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x273D , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0000 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x273F , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0257 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2747 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0000 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2749 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x063F , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x274B , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0000 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x274D , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x04AF , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x222D , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x008D , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0xA408 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0022 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0xA409 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0024 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0xA40A , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0029 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0xA40B , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x002B , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2411 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x008D , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2413 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x00A9 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2415 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x00AA , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0x2417 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x00CC , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0xA404 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0010 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0xA40D , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0002 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0xA40E , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0003 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0xA410 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x000A , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0xA103 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0006 , WORD_LEN, 0}, // MCU_DATA_0 - { 0x098C, 0xA103 , WORD_LEN, 0}, // MCU_ADDRESS - { 0x0990, 0x0005 , WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {SEQUENCE_END, 0x00} -}; - -#endif -static struct reginfo sensor_Preview2Capture[]= -{ - //capture2preview - {0x098E, 0x843C, WORD_LEN, 0}, // LOGICAL_ADDRESS_ACCESS [SEQ_STATE_CFG_5_MAX_FRAME_CNT] - {0x843C, 0xFF, BYTE_LEN, 0 }, // SEQ_STATE_CFG_5_MAX_FRAME_CNT - {0x8404, 0x02, BYTE_LEN, 0 }, // SEQ_CMD - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Capture2Preview[]= -{ - //snap2preview - {0x098E, 0x843C, WORD_LEN, 0}, // LOGICAL_ADDRESS_ACCESS [SEQ_STATE_CFG_5_MAX_FRAME_CNT] - {0x843C, 0x01, BYTE_LEN, 0 }, // SEQ_STATE_CFG_5_MAX_FRAME_CNT - {0x8404, 0x01, BYTE_LEN, 0 }, // SEQ_CMD - {0x0016, 0x0047, WORD_LEN, 0}, // CLOCKS_CONTRO - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {SEQUENCE_END, 0x00} -}; - - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - //Auto - {SEQUENCE_END, 0x00} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - //[V. DL 7500] - {SEQUENCE_END, 0x00} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //[IV Day Light] - {SEQUENCE_END, 0x00} -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - //[III Fluorescent] - {SEQUENCE_END, 0x00} -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - //[II. Incandescent] - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Solarize[] = -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Solarize,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast2[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - {SEQUENCE_END, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_SceneNight[] = -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Zoom1[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Zoom2[] = -{ - {SEQUENCE_END, 0x00} -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL}; -#endif -static const struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "negative", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "sepia", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "solarize", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - { - .id = V4L2_CID_FOCUS_AUTO, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Focus Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - },{ - .id = V4L2_CID_FOCUS_CONTINUOUS, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Focus Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; -enum sensor_work_state -{ - sensor_work_ready = 0, - sensor_working, -}; -struct sensor_work -{ - struct i2c_client *client; - struct delayed_work dwork; - enum sensor_work_state state; -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int auto_focus; - int affm_reinit; - int flash; - int exposure; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - bool snap2preview; - bool video2preview; - int capture_w; - int capture_h; - int preview_w; - int preview_h; - struct reginfo *winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int enable; - unsigned int funmodule_state; -} sensor_info_priv_t; - - - -struct sensor_parameter -{ - unsigned short int preview_maxlines; - unsigned short int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int capture_framerate; - unsigned short int preview_framerate; -}; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - struct sensor_parameter parameter; - struct workqueue_struct *sensor_wq; - struct sensor_work sensor_wk; - struct mutex wq_lock; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif -} - -static int sensor_read(struct i2c_client *client, u16 reg, u16 *val); - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, struct reginfo *reg_info) -{ - int err=0,cnt; - u8 buf[4]; - struct i2c_msg msg[1]; - - switch (reg_info->reg) - { - case SEQUENCE_WAIT_MS: - { - if (in_atomic()) - mdelay(reg_info->val); - else - msleep(reg_info->val); - break; - } - - case SEQUENCE_WAIT_US: - { - udelay(reg_info->val); - break; - } - - case SEQUENCE_PROPERTY: - { - break; - } - default: - { - buf[0] = reg_info->reg >> 8; - buf[1] = reg_info->reg & 0xFF; - if (reg_info->reg_len == WORD_LEN) { - buf[2] = reg_info->val >> 8; - buf[3] = reg_info->val & 0xFF; - - msg->len = 4; - } else if (reg_info->reg_len == BYTE_LEN) { - buf[2] = reg_info->val; - msg->len = 3; - } - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg_info->reg, reg_info->val); - udelay(10); - } - } - } - } - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u16 reg, u16 *val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[2]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 2; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]<<8 | buf[1]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_I2C_RDWRCHK - u16 valchk; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - while (regarray[i].reg != SEQUENCE_END) { - err = sensor_write(client, ®array[i]); - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - - i++; - } - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - u16 valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != SEQUENCE_END) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif -#if CONFIG_SENSOR_Focus -static struct reginfo sensor_af_init0[] = -{ - - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_af_init1[] = -{ - {SEQUENCE_END, 0x00} -}; - - -static struct reginfo sensor_af_trigger[] = -{ - {SEQUENCE_END, 0x00} -}; -static int sensor_af_single(struct i2c_client *client) -{ - int ret = 0; - - ret = sensor_write_array(client, sensor_af_trigger); - if (ret<0) - SENSOR_TR("%s sensor auto focus trigger fail!!\n",SENSOR_NAME_STRING()); - else - SENSOR_DG("%s sensor auto focus trigger success!\n",SENSOR_NAME_STRING()); -sensor_af_single_end: - return ret; -} - -static int sensor_af_const(struct i2c_client *client) -{ - int ret = 0; - -sensor_af_const_end: - return ret; -} - -static int sensor_af_zoneupdate(struct i2c_client *client) -{ - int ret = 0; - struct i2c_msg msg[2]; - u8 buf[2][6] = - { - {0xb0,0x08,0x00,0x03,0xff,0xff}, - {0xb0,0x0c,0xff,0xff,0xff,0xff}, - }; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf[0]; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags; - msg[1].buf = buf[1]; - msg[1].len = sizeof(buf); - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - ret = i2c_transfer(client->adapter, &msg[0], 1); - ret |= i2c_transfer(client->adapter, &msg[1], 1); - if (ret >= 0) { - return 0; - } else { - SENSOR_TR("\n %s sensor auto focus zone set fail!!\n",SENSOR_NAME_STRING()); - } - -sensor_af_zoneupdate_end: - return ret; -} - -static int sensor_af_init(struct i2c_client *client) -{ - int ret = 0; - - ret = sensor_write_array(client, sensor_af_init0); - if (ret<0) { - SENSOR_TR("%s sensor auto focus init_0 fail!!",SENSOR_NAME_STRING()); - } else { - if (sensor_af_zoneupdate(client) == 0) { - ret = sensor_write_array(client, sensor_af_init1); - if (ret<0) { - SENSOR_TR("%s sensor auto focus init_1 fail!!",SENSOR_NAME_STRING()); - } - } - } - - return ret; -} -#endif - -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } - -sensor_power_end: - return ret; -} - -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} - -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - int ret; - u16 pid = 0; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - mdelay(100); - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - -#if (SENSOR_RESET_REG != SEQUENCE_END) - struct reginfo reg_info; - reg_info.reg = SENSOR_RESET_REG; - reg_info.val = SENSOR_RESET_VAL; - reg_info.reg_len = SENSOR_RESET_REG_LEN; - ret = sensor_write(client, ®_info); - if (ret != 0) { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - mdelay(5); //delay 5 microseconds - reg_info.val = SENSOR_DERESET_VAL; - ret = sensor_write(client, ®_info); - if (ret != 0) { - SENSOR_TR("%s soft dereset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } -#endif - - /* check if it is an sensor sensor */ -#if (SENSOR_ID_REG != SEQUENCE_END) - ret = sensor_read(client, SENSOR_ID_REG, &pid); - if (ret != 0) { - SENSOR_TR("read chip id failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - SENSOR_DG("\n %s pid = 0x%x \n", SENSOR_NAME_STRING(), pid); -#else - pid = SENSOR_ID; -#endif - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - sensor->info_priv.preview_w = SENSOR_INIT_WIDTH; - sensor->info_priv.preview_h = SENSOR_INIT_HEIGHT; - sensor->info_priv.capture_w = SENSOR_MAX_WIDTH; - sensor->info_priv.capture_h = SENSOR_MAX_HEIGHT; - sensor->info_priv.winseqe_cur_addr = SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #if CONFIG_SENSOR_Focus - if (sensor_af_init(client) < 0) { - sensor->info_priv.funmodule_state &= ~SENSOR_AF_IS_OK; - SENSOR_TR("%s auto focus module init is fail!\n",SENSOR_NAME_STRING()); - } else { - sensor->info_priv.funmodule_state |= SENSOR_AF_IS_OK; - SENSOR_DG("%s auto focus module init is success!\n",SENSOR_NAME_STRING()); - } - #endif - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - - return 0; -sensor_INIT_ERR: - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - sensor_ioctrl(icd, Sensor_PowerDown, 1); - - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - msleep(100); - return 0; -} -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - return 0; -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static struct reginfo* sensor_fmt_catch(int set_w, int set_h, int *ret_w, int *ret_h) -{ - struct reginfo *winseqe_set_addr = NULL; - - if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qcif; - *ret_w = 176; - *ret_h = 144; - } else if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qvga; - *ret_w = 320; - *ret_h = 240; - } else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_cif; - *ret_w = 352; - *ret_h = 288; - } else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_vga; - *ret_w = 640; - *ret_h = 480; - } else if (((set_w <= 800) && (set_h <= 600)) && (sensor_svga[0].reg!=SEQUENCE_END)) { - printk("enter 800x600\n"); - winseqe_set_addr = sensor_svga; - *ret_w = 800; - *ret_h = 600; - } else if (((set_w <= 1024) && (set_h <= 768)) && (sensor_xga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_xga; - *ret_w = 1024; - *ret_h = 768; - } else if (((set_w <= 1280) && (set_h <= 720)) && (sensor_720p[0].reg!=SEQUENCE_END)) { - printk("enter 1280X720\n"); - winseqe_set_addr = sensor_720p; - *ret_w = 1280; - *ret_h = 720; - } else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=SEQUENCE_END)) { - printk("enter 1280X1024\n"); - winseqe_set_addr = sensor_sxga; - *ret_w = 1280; - *ret_h = 1024; - } else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_uxga; - *ret_w = 1600; - *ret_h = 1200; - } else if (((set_w <= 1920) && (set_h <= 1080)) && (sensor_1080p[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_1080p; - *ret_w = 1920; - *ret_h = 1080; - } else if (((set_w <= 2048) && (set_h <= 1536)) && (sensor_qxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qxga; - *ret_w = 2048; - *ret_h = 1536; - } else if (((set_w <= 2592) && (set_h <= 1944)) && (sensor_qsxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qsxga; - *ret_w = 2592; - *ret_h = 1944; - } - - return winseqe_set_addr; -} - -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - struct reginfo *winseqe_set_addr=NULL; - int ret = 0, set_w,set_h; - - SENSOR_TR("%s pix->width=%d,pix->height=%d\n",__FUNCTION__,mf->width,mf->height); - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - winseqe_set_addr = sensor_fmt_catch(set_w, set_h, &set_w, &set_h); - - if ((winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) && winseqe_set_addr) { - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - goto sensor_s_fmt_end; - } - sensor->info_priv.winseqe_cur_addr = winseqe_set_addr; - if ((winseqe_set_addr[0].reg==SEQUENCE_PROPERTY) && (winseqe_set_addr[0].val==SEQUENCE_CAPTURE)) { - SENSOR_DG("\n%s..%s..Capture icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } else { - SENSOR_DG("\n%s..%s..Video icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - sensor->info_priv.preview_w = mf->width; - sensor->info_priv.preview_h = mf->height; - } - } - - if (winseqe_set_addr && (winseqe_set_addr[0].reg==SEQUENCE_PROPERTY) && (winseqe_set_addr[0].val==SEQUENCE_CAPTURE)) { - ret |= sensor_write_array(client, sensor_Preview2Capture); - if (ret != 0) { - SENSOR_TR("%s Preview 2 Capture failed\n", SENSOR_NAME_STRING()); - goto sensor_s_fmt_end; - } - sensor->info_priv.capture_w = set_w; - sensor->info_priv.capture_h = set_h; - sensor->info_priv.snap2preview = true; - } else if (sensor->info_priv.snap2preview == true) { - if (winseqe_set_addr || ((sensor->info_priv.preview_w == mf->width) && (sensor->info_priv.preview_h == mf->height))) { - ret |= sensor_write_array(client, sensor_Capture2Preview); - if (ret != 0) { - SENSOR_TR("%s Capture 2 Preview failed\n", SENSOR_NAME_STRING()); - goto sensor_s_fmt_end; - } - sensor->info_priv.preview_w = mf->width; - sensor->info_priv.preview_h = mf->height; - sensor->info_priv.snap2preview = false; - } else { - SENSOR_TR("\n %s..%s Format is Invalidate. mf->width = %d.. mf->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - } - - mf->width = set_w; - mf->height = set_h; -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - int ret = 0; - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - SENSOR_TR("%s pix->width=%d,pix->height=%d\n",__FUNCTION__,mf->width,mf->height); - - /* - * With Bayer format enforce even side lengths, but let the user play - * with the starting pixel - */ - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - if (sensor_fmt_catch(mf->width, mf->height, &mf->width, &mf->height) == NULL) { - printk("%s[%d] ERR!!!!!!",__FUNCTION__,__LINE__); - mf->width = 0; - mf->height = 0; - } - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV2655 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((*value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value > 0) && ((digitalzoom_cur + *value) > digitalzoom_total)) - { - *value = digitalzoom_total - digitalzoom_cur; - } - - if ((*value < 0) && ((digitalzoom_cur + *value) < 0)) - { - *value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += *value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, *value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Focus -static int sensor_set_focus_absolute(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int ret = 0; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (!qctrl_info) - return -EINVAL; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - if ((value >= qctrl_info->minimum) && (value <= qctrl_info->maximum)) { - - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EINVAL; - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - } - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - -sensor_set_focus_absolute_end: - return ret; -} -static int sensor_set_focus_relative(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int ret = 0; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_RELATIVE); - if (!qctrl_info) - return -EINVAL; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - if ((value >= qctrl_info->minimum) && (value <= qctrl_info->maximum)) { - - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EINVAL; - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - } - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } -sensor_set_focus_relative_end: - return ret; -} - -static int sensor_set_focus_mode(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int ret = 0; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - switch (value) - { - case SENSOR_AF_MODE_AUTO: - { - ret = sensor_af_single(client); - break; - } - - case SENSOR_AF_MODE_MACRO: - { - ret = sensor_set_focus_absolute(icd, qctrl, 0xff); - break; - } - - case SENSOR_AF_MODE_INFINITY: - { - ret = sensor_set_focus_absolute(icd, qctrl, 0x00); - break; - } - - case SENSOR_AF_MODE_CONTINUOUS: - { - ret = sensor_af_const(client); - break; - } - default: - SENSOR_TR("\n %s..%s AF value(0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__,value); - break; - - } - - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - - return ret; -} -#endif -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct v4l2_queryctrl *qctrl; - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (sensor_set_focus_absolute(icd, qctrl,ext_ctrl->value) == 0) { - if (ext_ctrl->value == qctrl->minimum) { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_INFINITY; - } else if (ext_ctrl->value == qctrl->maximum) { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_MACRO; - } else { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_FIXED; - } - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - sensor_set_focus_relative(icd, qctrl,ext_ctrl->value); - break; - } - case V4L2_CID_FOCUS_AUTO: - { - if (ext_ctrl->value == 1) { - if (sensor_set_focus_mode(icd, qctrl,SENSOR_AF_MODE_AUTO) != 0) - return -EINVAL; - sensor->info_priv.auto_focus = SENSOR_AF_MODE_AUTO; - } else if (SENSOR_AF_MODE_AUTO == sensor->info_priv.auto_focus){ - if (ext_ctrl->value == 0) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CLOSE; - } - break; - } - case V4L2_CID_FOCUS_CONTINUOUS: - { - if (SENSOR_AF_MODE_CONTINUOUS != sensor->info_priv.auto_focus) { - if (ext_ctrl->value == 1) { - if (sensor_set_focus_mode(icd, qctrl,SENSOR_AF_MODE_CONTINUOUS) != 0) - return -EINVAL; - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CONTINUOUS; - } - } else { - if (ext_ctrl->value == 0) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CLOSE; - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_stream(struct v4l2_subdev *sd, int enable) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - - if (enable == 1) { - sensor->info_priv.enable = 1; - } else if (enable == 0) { - sensor->info_priv.enable = 0; - } - - return 0; -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - int ret=0; - struct sensor *sensor = to_sensor(client); -#if (SENSOR_ID_REG != SEQUENCE_END) - u16 pid; -#endif - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - - /* soft reset */ -#if (SENSOR_RESET_REG != SEQUENCE_END) - struct reginfo reg_info; - reg_info.reg = SENSOR_RESET_REG; - reg_info.val = SENSOR_RESET_VAL; - reg_info.reg_len = SENSOR_RESET_REG_LEN; - ret = sensor_write(client, ®_info); - if (ret != 0) { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - mdelay(5); //delay 5 microseconds -#endif - - /* check if it is an sensor sensor */ -#if (SENSOR_ID_REG != SEQUENCE_END) - ret = sensor_read(client, SENSOR_ID_REG, &pid); - if (ret != 0) { - SENSOR_TR("read chip id failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - SENSOR_DG("\n %s pid = 0x%x \n", SENSOR_NAME_STRING(), pid); -#else - pid = SENSOR_ID; -#endif - - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - - - return 0; - -sensor_video_probe_err: - - return ret; -} -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0,i; - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - sensor->sensor_gpio_res = NULL; - for (i=0; isensor_io_request->gpio_res[i].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[i].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[i]; - } - } - if (sensor->sensor_gpio_res == NULL) { - SENSOR_TR("%s %s obtain gpio resource failed when RK29_CAM_SUBDEV_IOREQUEST \n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - int i; - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, -}; -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - sensor->info_priv.fmt = sensor_colour_fmts[0]; - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - #if CONFIG_SENSOR_Focus - if (sensor->sensor_wq) { - destroy_workqueue(sensor->sensor_wq); - sensor->sensor_wq = NULL; - } - #endif - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - - diff --git a/drivers/media/video/mt9d113.h b/drivers/media/video/mt9d113.h deleted file mode 100755 index dfd51a7f32a9..000000000000 --- a/drivers/media/video/mt9d113.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Driver for OV5642 CMOS Image Sensor from OmniVision - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#ifndef __MT9D113_H__ -#define __MT9D113_H__ -struct reginfo -{ - u16 reg; - u16 val; - u16 reg_len; - u16 rev; -}; - -#define WORD_LEN 0x04 -#define BYTE_LEN 0x02 - -#define SEQUENCE_INIT 0x00 -#define SEQUENCE_NORMAL 0x01 -#define SEQUENCE_CAPTURE 0x02 -#define SEQUENCE_PREVIEW 0x03 - -#define SEQUENCE_PROPERTY 0xFFFC -#define SEQUENCE_WAIT_MS 0xFFFD -#define SEQUENCE_WAIT_US 0xFFFE -#define SEQUENCE_END 0xFFFF -#endif diff --git a/drivers/media/video/mt9m112.c b/drivers/media/video/mt9m112.c deleted file mode 100755 index bfa12354e1bb..000000000000 --- a/drivers/media/video/mt9m112.c +++ /dev/null @@ -1,2820 +0,0 @@ -/* - * Driver for OV5642 CMOS Image Sensor from OmniVision - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "mt9m112.h" - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(0, format, ## __VA_ARGS__) - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME mt9m112 -#define SENSOR_V4L2_IDENT V4L2_IDENT_MT9M112 -#define SENSOR_ID SEQUENCE_END -#define SENSOR_ID_REG SEQUENCE_END -#define SENSOR_RESET_REG SEQUENCE_END -#define SENSOR_RESET_VAL SEQUENCE_END -#define SENSOR_RESET_REG_LEN WORD_LEN -#define SENSOR_MIN_WIDTH 640 -#define SENSOR_MIN_HEIGHT 480 -#define SENSOR_MAX_WIDTH 1280 -#define SENSOR_MAX_HEIGHT 1024 -#define SENSOR_INIT_WIDTH 640 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 480 -#define SENSOR_INIT_WINSEQADR sensor_vga -#define SENSOR_INIT_PIXFMT V4L2_PIX_FMT_UYVY - -#define CONFIG_SENSOR_WhiteBalance 0 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 0 -#define CONFIG_SENSOR_Scene 0 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 0 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 -#define CONFIG_SENSOR_Focus 0 - - -#define CONFIG_SENSOR_I2C_SPEED 100000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) - -#if CONFIG_SENSOR_Focus -#define SENSOR_AF_MODE_INFINITY 0 -#define SENSOR_AF_MODE_MACRO 1 -#define SENSOR_AF_MODE_FIXED 2 -#define SENSOR_AF_MODE_AUTO 3 -#define SENSOR_AF_MODE_CONTINUOUS 4 -#define SENSOR_AF_MODE_CLOSE 5 -#endif - -/* init 640X480 VGA */ -static struct reginfo sensor_init_data[] = -{ - {0xf0, 0x0000}, - {0x35, 0x0022}, - //0x20, 0x0103, // mirror - {0x0c, 0x0000}, - {0x21, 0x8400}, - - {0x05,0x022e}, - // 0x06,0x0300, - - {0xf0, 0x0001}, - {0x06,0x708e}, - {0x05,0x000e}, - - { 0xf0, 0x0002}, - {0xCB, 0x0001}, // PROGRAM_ADVANCE - {0xCC, 0x0004}, // PROGRAM_SELECT - {0xD2, 0x0000}, // DEFAULT_CONFIG - {0x5B, 0x0001}, - - {0xf0, 0x0001}, - - //[Lens Correction 05/16/08 11:19:07] - {0x80, 0x000A }, //LENS_CORRECT_CONTROL - {0x81, 0xED0F }, //LENS_ADJ_VERT_RED_0 - {0x82, 0xF8F1 }, //LENS_ADJ_VERT_RED_1_2 - {0x83, 0x00FD }, //LENS_ADJ_VERT_RED_3_4 - {0x84, 0xEF0D }, //LENS_ADJ_VERT_GREEN_0 - {0x85, 0xF9F3 }, //LENS_ADJ_VERT_GREEN_1_2 - {0x86, 0x00FD }, //LENS_ADJ_VERT_GREEN_3_4 - {0x87, 0xF30C }, //LENS_ADJ_VERT_BLUE_0 - {0x88, 0xF9F3 }, //LENS_ADJ_VERT_BLUE_1_2 - {0x89, 0x00FD }, //LENS_ADJ_VERT_BLUE_3_4 - {0x8A, 0xE616 }, //LENS_ADJ_HORIZ_RED_0 - {0x8B, 0xF5F0 }, //LENS_ADJ_HORIZ_RED_1_2 - {0x8C, 0xFDF9 }, //LENS_ADJ_HORIZ_RED_3_4 - {0x8D, 0x0002 }, //LENS_ADJ_HORIZ_RED_5 - {0x8E, 0xE714 }, //LENS_ADJ_HORIZ_GREEN_0 - {0x8F, 0xF5F1 }, //LENS_ADJ_HORIZ_GREEN_1_2 - {0x90, 0xFEFA }, //LENS_ADJ_HORIZ_GREEN_3_4 - {0x91, 0x0001} , //LENS_ADJ_HORIZ_GREEN_5 - {0x92, 0xE913} , //LENS_ADJ_HORIZ_BLUE_0 - {0x93, 0xF7F2 }, //LENS_ADJ_HORIZ_BLUE_1_2 - {0x94, 0xFEFB }, //LENS_ADJ_HORIZ_BLUE_3_4 - {0x95, 0x0002} , //LENS_ADJ_HORIZ_BLUE_5 - {0xB6, 0x0904} , //LENS_ADJ_VERT_RED_5_6 - {0xB7, 0x1E0C }, //LENS_ADJ_VERT_RED_7_8 - {0xB8, 0x0904 }, //LENS_ADJ_VERT_GREEN_5_6 - {0xB9, 0x1B0A} , //LENS_ADJ_VERT_GREEN_7_8 - {0xBA, 0x0704} , //LENS_ADJ_VERT_BLUE_5_6 - {0xBB, 0x1A0A} , //LENS_ADJ_VERT_BLUE_7_8 - {0xBC, 0x0906 }, //LENS_ADJ_HORIZ_RED_6_7 - {0xBD, 0x1410} , //LENS_ADJ_HORIZ_RED_8_9 - {0xBE, 0x0026 }, //LENS_ADJ_HORIZ_RED_10 - {0xBF, 0x0806}, //LENS_ADJ_HORIZ_GREEN_6_7 - {0xC0, 0x110E} , //LENS_ADJ_HORIZ_GREEN_8_9 - {0xC1, 0x0024} , //LENS_ADJ_HORIZ_GREEN_10 - {0xC2, 0x0A05} , //LENS_ADJ_HORIZ_BLUE_6_7 - {0xC3, 0x100F} , //LENS_ADJ_HORIZ_BLUE_8_9 - {0xC4, 0x0027} , //LENS_ADJ_HORIZ_BLUE_10 - {0x06, 0x640e}, //LENS_CORRECTION - - {0x53,0x0602}, - {0x54,0x4416}, - {0x55,0xb68a}, - {0x56,0xe0cf}, - {0x57,0xf7e0}, - {0x58,0xff00}, - - //Êä³ö´°¿Ú´óС - {0xA7, 640}, - {0xaa, 512}, - - //±³¹â³õʼ»¯ - {0xf0, 0x0002}, - {0x37, 0x0080},//0x0300, - {0x2f, 0x9100}, - {0x2e, 0x0c44},//0x0c30, // - //0x39, 0x03D2, // AE Line size Context A d:6A6 - //0x3A, 0x03D2, // AE Line size Context B d:6A6 - //0x3B, 0x055B, // AE shutter delay limit Context A - //0x3C, 0x055B, // AE shutter delay limit Context B - {0x57, 0x2CA}, // Context A Flicker full frame time (60Hz) - {0x58, 0x2CA}, //0x01E9, // Context A Flicker full frame time (50Hz) - {0x59, 0x2CA}, // Context B Flicker full frame time (60Hz) - {0x5A, 0x2CA}, //0x01E9, // Context B Flicker full frame time (50Hz) - {0x5C, 0x0E0A}, // 60Hz Flicker Search Range - {0x5D, 0x120E}, // 50Hz Flicker Search Range - {0x64, 0x5E1C}, // Flicker parameter - {0x5B, 0x0001}, - - {SEQUENCE_END, 0x00} -}; - -/* 720p 15fps @ 1280x720 */ - -static struct reginfo sensor_720p[]= -{ - {SEQUENCE_END, 0x00} -}; - -/* 1080p, 0x15fps, 0xyuv @1920x1080 */ - -static struct reginfo sensor_1080p[]= -{ - {SEQUENCE_END, 0x00} -}; - -/* 2592X1944 QSXGA */ -static struct reginfo sensor_qsxga[] = -{ - {SEQUENCE_END, 0x00} -}; -/* 2048*1536 QXGA */ -static struct reginfo sensor_qxga[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 1600X1200 UXGA */ -static struct reginfo sensor_uxga[] = -{ - {SEQUENCE_END, 0x00} -}; -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {SEQUENCE_PROPERTY,SEQUENCE_CAPTURE}, - {SEQUENCE_END, 0x00} -}; -/* 1024X768 XGA */ -static struct reginfo sensor_xga[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - {0xf0, 0x0000}, - {0x35, 0x0022}, - //0x20, 0x0103, // mirror - {0x0c, 0x0000}, - {0x21, 0x8400}, - - {0x05,0x022e}, - // 0x06,0x0300, - - {0xf0, 0x0001}, - {0x06,0x708e}, - {0x05,0x000e}, - - { 0xf0, 0x0002}, - {0xCB, 0x0001}, // PROGRAM_ADVANCE - {0xCC, 0x0004}, // PROGRAM_SELECT - {0xD2, 0x0000}, // DEFAULT_CONFIG - {0x5B, 0x0001}, - - {0xf0, 0x0001}, - - //[Lens Correction 05/16/08 11:19:07] - {0x80, 0x000A }, //LENS_CORRECT_CONTROL - {0x81, 0xED0F }, //LENS_ADJ_VERT_RED_0 - {0x82, 0xF8F1 }, //LENS_ADJ_VERT_RED_1_2 - {0x83, 0x00FD }, //LENS_ADJ_VERT_RED_3_4 - {0x84, 0xEF0D }, //LENS_ADJ_VERT_GREEN_0 - {0x85, 0xF9F3 }, //LENS_ADJ_VERT_GREEN_1_2 - {0x86, 0x00FD }, //LENS_ADJ_VERT_GREEN_3_4 - {0x87, 0xF30C }, //LENS_ADJ_VERT_BLUE_0 - {0x88, 0xF9F3 }, //LENS_ADJ_VERT_BLUE_1_2 - {0x89, 0x00FD }, //LENS_ADJ_VERT_BLUE_3_4 - {0x8A, 0xE616 }, //LENS_ADJ_HORIZ_RED_0 - {0x8B, 0xF5F0 }, //LENS_ADJ_HORIZ_RED_1_2 - {0x8C, 0xFDF9 }, //LENS_ADJ_HORIZ_RED_3_4 - {0x8D, 0x0002 }, //LENS_ADJ_HORIZ_RED_5 - {0x8E, 0xE714 }, //LENS_ADJ_HORIZ_GREEN_0 - {0x8F, 0xF5F1 }, //LENS_ADJ_HORIZ_GREEN_1_2 - {0x90, 0xFEFA }, //LENS_ADJ_HORIZ_GREEN_3_4 - {0x91, 0x0001} , //LENS_ADJ_HORIZ_GREEN_5 - {0x92, 0xE913} , //LENS_ADJ_HORIZ_BLUE_0 - {0x93, 0xF7F2 }, //LENS_ADJ_HORIZ_BLUE_1_2 - {0x94, 0xFEFB }, //LENS_ADJ_HORIZ_BLUE_3_4 - {0x95, 0x0002} , //LENS_ADJ_HORIZ_BLUE_5 - {0xB6, 0x0904} , //LENS_ADJ_VERT_RED_5_6 - {0xB7, 0x1E0C }, //LENS_ADJ_VERT_RED_7_8 - {0xB8, 0x0904 }, //LENS_ADJ_VERT_GREEN_5_6 - {0xB9, 0x1B0A} , //LENS_ADJ_VERT_GREEN_7_8 - {0xBA, 0x0704} , //LENS_ADJ_VERT_BLUE_5_6 - {0xBB, 0x1A0A} , //LENS_ADJ_VERT_BLUE_7_8 - {0xBC, 0x0906 }, //LENS_ADJ_HORIZ_RED_6_7 - {0xBD, 0x1410} , //LENS_ADJ_HORIZ_RED_8_9 - {0xBE, 0x0026 }, //LENS_ADJ_HORIZ_RED_10 - {0xBF, 0x0806}, //LENS_ADJ_HORIZ_GREEN_6_7 - {0xC0, 0x110E} , //LENS_ADJ_HORIZ_GREEN_8_9 - {0xC1, 0x0024} , //LENS_ADJ_HORIZ_GREEN_10 - {0xC2, 0x0A05} , //LENS_ADJ_HORIZ_BLUE_6_7 - {0xC3, 0x100F} , //LENS_ADJ_HORIZ_BLUE_8_9 - {0xC4, 0x0027} , //LENS_ADJ_HORIZ_BLUE_10 - {0x06, 0x640e}, //LENS_CORRECTION - - {0x53,0x0602}, - {0x54,0x4416}, - {0x55,0xb68a}, - {0x56,0xe0cf}, - {0x57,0xf7e0}, - {0x58,0xff00}, - - //Êä³ö´°¿Ú´óС - {0xA7, 640}, - {0xaa, 512}, - - //±³¹â³õʼ»¯ - {0xf0, 0x0002}, - {0x37, 0x0080},//0x0300, - {0x2f, 0x9100}, - {0x2e, 0x0c44},//0x0c30, // - //0x39, 0x03D2, // AE Line size Context A d:6A6 - //0x3A, 0x03D2, // AE Line size Context B d:6A6 - //0x3B, 0x055B, // AE shutter delay limit Context A - //0x3C, 0x055B, // AE shutter delay limit Context B - {0x57, 0x2CA}, // Context A Flicker full frame time (60Hz) - {0x58, 0x2CA}, //0x01E9, // Context A Flicker full frame time (50Hz) - {0x59, 0x2CA}, // Context B Flicker full frame time (60Hz) - {0x5A, 0x2CA}, //0x01E9, // Context B Flicker full frame time (50Hz) - {0x5C, 0x0E0A}, // 60Hz Flicker Search Range - {0x5D, 0x120E}, // 50Hz Flicker Search Range - {0x64, 0x5E1C}, // Flicker parameter - {0x5B, 0x0001}, - {SEQUENCE_END, 0x00} -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {SEQUENCE_END, 0x00} -}; -#if 0 -/* 160X120 QQVGA*/ -static struct reginfo ov2655_qqvga[] = -{ - - {0x300E, 0x34}, - {0x3011, 0x01}, - {0x3012, 0x10}, - {0x302a, 0x02}, - {0x302b, 0xE6}, - {0x306f, 0x14}, - {0x3362, 0x90}, - - {0x3070, 0x5d}, - {0x3072, 0x5d}, - {0x301c, 0x07}, - {0x301d, 0x07}, - - {0x3020, 0x01}, - {0x3021, 0x18}, - {0x3022, 0x00}, - {0x3023, 0x06}, - {0x3024, 0x06}, - {0x3025, 0x58}, - {0x3026, 0x02}, - {0x3027, 0x61}, - {0x3088, 0x00}, - {0x3089, 0xa0}, - {0x308a, 0x00}, - {0x308b, 0x78}, - {0x3316, 0x64}, - {0x3317, 0x25}, - {0x3318, 0x80}, - {0x3319, 0x08}, - {0x331a, 0x0a}, - {0x331b, 0x07}, - {0x331c, 0x80}, - {0x331d, 0x38}, - {0x3100, 0x00}, - {0x3302, 0x11}, - - {0x0, 0x0}, -}; - - - -static struct reginfo ov2655_Sharpness_auto[] = -{ - {0x3306, 0x00}, -}; - -static struct reginfo ov2655_Sharpness1[] = -{ - {0x3306, 0x08}, - {0x3371, 0x00}, -}; - -static struct reginfo ov2655_Sharpness2[][3] = -{ - //Sharpness 2 - {0x3306, 0x08}, - {0x3371, 0x01}, -}; - -static struct reginfo ov2655_Sharpness3[] = -{ - //default - {0x3306, 0x08}, - {0x332d, 0x02}, -}; -static struct reginfo ov2655_Sharpness4[]= -{ - //Sharpness 4 - {0x3306, 0x08}, - {0x332d, 0x03}, -}; - -static struct reginfo ov2655_Sharpness5[] = -{ - //Sharpness 5 - {0x3306, 0x08}, - {0x332d, 0x04}, -}; -#endif -static struct reginfo sensor_Preview2Capture[]= -{ - //capture2preview - {0xf0, 0x0002}, - {0xCB, 0x0001}, // PROGRAM_ADVANCE - {0xCC, 0x0004}, // PROGRAM_SELECT - {0xD2, 0x007f}, // DEFAULT_CONFIG - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Capture2Preview[]= -{ - //snap2preview - {0xf0, 0x0002}, - {0xCB, 0x0001}, // PROGRAM_ADVANCE - {0xCC, 0x0004}, // PROGRAM_SELECT - {0xD2, 0x0000}, // DEFAULT_CONFIG - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {SEQUENCE_END, 0x00} -}; - - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - //Auto - {SEQUENCE_END, 0x00} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {SEQUENCE_END, 0x00} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - {SEQUENCE_END, 0x00} -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - {SEQUENCE_END, 0x00} -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Solarize[] = -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Solarize,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast2[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - {SEQUENCE_END, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_SceneNight[] = -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Zoom1[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Zoom2[] = -{ - {SEQUENCE_END, 0x00} -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL}; -#endif -static const struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "negative", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "sepia", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "solarize", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static const struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - { - .id = V4L2_CID_FOCUS_AUTO, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Focus Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - },{ - .id = V4L2_CID_FOCUS_CONTINUOUS, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Focus Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -#define COL_FMT(_name, _depth, _fourcc, _colorspace) \ - { .name = _name, .depth = _depth, .fourcc = _fourcc, \ - .colorspace = _colorspace } - -#define JPG_FMT(_name, _depth, _fourcc) \ - COL_FMT(_name, _depth, _fourcc, V4L2_COLORSPACE_JPEG) - -static const struct soc_camera_data_format sensor_colour_formats[] = { - JPG_FMT(SENSOR_NAME_STRING(UYVY), 16, V4L2_PIX_FMT_UYVY), - JPG_FMT(SENSOR_NAME_STRING(YUYV), 16, V4L2_PIX_FMT_YUYV), -}; -enum sensor_work_state -{ - sensor_work_ready = 0, - sensor_working, -}; -struct sensor_work -{ - struct i2c_client *client; - struct delayed_work dwork; - enum sensor_work_state state; -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int auto_focus; - int affm_reinit; - int flash; - int exposure; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - bool snap2preview; - bool video2preview; - int capture_w; - int capture_h; - int preview_w; - int preview_h; - struct reginfo *winseqe_cur_addr; - unsigned int pixfmt; - unsigned int enable; - unsigned int funmodule_state; -} sensor_info_priv_t; - - - -struct sensor_parameter -{ - unsigned short int preview_maxlines; - unsigned short int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int capture_framerate; - unsigned short int preview_framerate; -}; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - struct sensor_parameter parameter; - struct workqueue_struct *sensor_wq; - struct sensor_work sensor_wk; - struct mutex wq_lock; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } -#endif - return 0; -sensor_task_lock_err: - return -1; -} - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, struct reginfo *reg_info) -{ - int err=0,cnt; - u8 buf[3]; - struct i2c_msg msg[1]; - - switch (reg_info->reg) - { - case SEQUENCE_WAIT_MS: - { - if (in_atomic()) - mdelay(reg_info->val); - else - msleep(reg_info->val); - break; - } - - case SEQUENCE_WAIT_US: - { - udelay(reg_info->val); - break; - } - - case SEQUENCE_PROPERTY: - { - break; - } - default: - { - buf[0] = reg_info->reg & 0xFF; - buf[1] = reg_info->val >> 8; - buf[2] = reg_info->val & 0xFF; - msg->len = 3; - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg_info->reg, reg_info->val); - udelay(10); - } - } - } - } - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u16 reg, u16 *val) -{ - int err,cnt; - u8 buf[1]; - struct i2c_msg msg[2]; - - buf[0] = reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - while (regarray[i].reg != SEQUENCE_END) { - err = sensor_write(client, ®array[i]); - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - - i++; - } - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != SEQUENCE_END) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif -#if CONFIG_SENSOR_Focus -static struct reginfo sensor_af_init0[] = -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_af_init1[] = -{ - {SEQUENCE_END, 0x00} -}; - - -static struct reginfo sensor_af_trigger[] = -{ - {SEQUENCE_END, 0x00} -}; -static int sensor_af_single(struct i2c_client *client) -{ - int ret = 0; - - ret = sensor_write_array(client, sensor_af_trigger); - if (ret<0) - SENSOR_TR("%s sensor auto focus trigger fail!!\n",SENSOR_NAME_STRING()); - else - SENSOR_DG("%s sensor auto focus trigger success!\n",SENSOR_NAME_STRING()); -sensor_af_single_end: - return ret; -} - -static int sensor_af_const(struct i2c_client *client) -{ - int ret = 0; - -sensor_af_const_end: - return ret; -} - -static int sensor_af_zoneupdate(struct i2c_client *client) -{ - int ret = 0; - -sensor_af_zoneupdate_end: - return ret; -} - -static int sensor_af_init(struct i2c_client *client) -{ - int ret = 0; - - ret = sensor_write_array(client, sensor_af_init0); - if (ret<0) { - SENSOR_TR("%s sensor auto focus init_0 fail!!",SENSOR_NAME_STRING()); - } else { - if (sensor_af_zoneupdate(client) == 0) { - ret = sensor_write_array(client, sensor_af_init1); - if (ret<0) { - SENSOR_TR("%s sensor auto focus init_1 fail!!",SENSOR_NAME_STRING()); - } - } - } - - return ret; -} -#endif - -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - } - break; - } - default: - { - SENSOR_TR("%s power cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),cmd); - break; - } - } - -sensor_power_end: - return ret; -} -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = sd->priv; - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - int ret,pid = 0; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - -#if (SENSOR_RESET_REG != SEQUENCE_END) - struct reginfo reg_info; - reg_info.reg = SENSOR_RESET_REG; - reg_info.val = SENSOR_RESET_VAL; - reg_info.reg_len = SENSOR_RESET_REG_LEN; - ret = sensor_write(client, ®_info); - if (ret != 0) { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); //delay 5 microseconds -#endif - - /* check if it is an sensor sensor */ -#if (SENSOR_ID_REG != SEQUENCE_END) - ret = sensor_read(client, SENSOR_ID_REG, &pid); - if (ret != 0) { - SENSOR_TR("read chip id failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - SENSOR_DG("\n %s pid = 0x%x \n", SENSOR_NAME_STRING(), pid); -#else - pid = SENSOR_ID; -#endif - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - sensor->info_priv.preview_w = SENSOR_INIT_WIDTH; - sensor->info_priv.preview_h = SENSOR_INIT_HEIGHT; - sensor->info_priv.capture_w = SENSOR_MAX_WIDTH; - sensor->info_priv.capture_h = SENSOR_MAX_HEIGHT; - sensor->info_priv.winseqe_cur_addr = SENSOR_INIT_WINSEQADR; - sensor->info_priv.pixfmt = SENSOR_INIT_PIXFMT; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #if CONFIG_SENSOR_Focus - if (sensor_af_init(client) < 0) { - sensor->info_priv.funmodule_state &= ~SENSOR_AF_IS_OK; - SENSOR_TR("%s auto focus module init is fail!\n",SENSOR_NAME_STRING()); - } else { - sensor->info_priv.funmodule_state |= SENSOR_AF_IS_OK; - SENSOR_DG("%s auto focus module init is success!\n",SENSOR_NAME_STRING()); - } - #endif - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - #endif - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - - return 0; -sensor_INIT_ERR: - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - - - sensor_ioctrl(icd, Sensor_PowerDown, 1); - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - - return 0; -} -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - return 0; -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_format *f) -{ - struct i2c_client *client = sd->priv; - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - struct v4l2_pix_format *pix = &f->fmt.pix; - - pix->width = icd->user_width; - pix->height = icd->user_height; - pix->pixelformat = sensor->info_priv.pixfmt; - pix->field = V4L2_FIELD_NONE; - pix->colorspace = V4L2_COLORSPACE_JPEG; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_format *f) -{ - bool ret = false; - - if ((f->fmt.pix.width == 1024) && (f->fmt.pix.height == 768)) { - ret = true; - } else if ((f->fmt.pix.width == 1280) && (f->fmt.pix.height == 1024)) { - ret = true; - } else if ((f->fmt.pix.width == 1600) && (f->fmt.pix.height == 1200)) { - ret = true; - } else if ((f->fmt.pix.width == 2048) && (f->fmt.pix.height == 1536)) { - ret = true; - } else if ((f->fmt.pix.width == 2592) && (f->fmt.pix.height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, f->fmt.pix.width, f->fmt.pix.height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_format *f) -{ - bool ret = false; - - if ((f->fmt.pix.width == 1280) && (f->fmt.pix.height == 720)) { - ret = true; - } else if ((f->fmt.pix.width == 1920) && (f->fmt.pix.height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, f->fmt.pix.width, f->fmt.pix.height); - return ret; -} -static struct reginfo* sensor_fmt_catch(int set_w, int set_h, int *ret_w, int *ret_h) -{ - struct reginfo *winseqe_set_addr = NULL; - - if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qcif; - *ret_w = 176; - *ret_h = 144; - } else if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qvga; - *ret_w = 320; - *ret_h = 240; - } else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_cif; - *ret_w = 352; - *ret_h = 288; - } else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_vga; - *ret_w = 640; - *ret_h = 480; - } else if (((set_w <= 800) && (set_h <= 600)) && (sensor_svga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_svga; - *ret_w = 800; - *ret_h = 600; - } else if (((set_w <= 1024) && (set_h <= 768)) && (sensor_xga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_xga; - *ret_w = 1024; - *ret_h = 768; - } else if (((set_w <= 1280) && (set_h <= 720)) && (sensor_720p[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_720p; - *ret_w = 1280; - *ret_h = 720; - } else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_sxga; - *ret_w = 1280; - *ret_h = 1024; - } else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_uxga; - *ret_w = 1600; - *ret_h = 1200; - } else if (((set_w <= 1920) && (set_h <= 1080)) && (sensor_1080p[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_1080p; - *ret_w = 1920; - *ret_h = 1080; - } else if (((set_w <= 2048) && (set_h <= 1536)) && (sensor_qxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qxga; - *ret_w = 2048; - *ret_h = 1536; - } else if (((set_w <= 2592) && (set_h <= 1944)) && (sensor_qsxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qsxga; - *ret_w = 2592; - *ret_h = 1944; - } - - return winseqe_set_addr; -} - -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f) -{ - struct i2c_client *client = sd->priv; - struct sensor *sensor = to_sensor(client); - struct v4l2_pix_format *pix = &f->fmt.pix; - struct reginfo *winseqe_set_addr=NULL; - int ret = 0, set_w,set_h; - - if (sensor->info_priv.pixfmt != pix->pixelformat) { - switch (pix->pixelformat) - { - case V4L2_PIX_FMT_YUYV: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_PIX_FMT_UYVY: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.pixfmt = pix->pixelformat; - - SENSOR_DG("%s Pixelformat(0x%x) set success!\n", SENSOR_NAME_STRING(),pix->pixelformat); - } else { - SENSOR_TR("%s Pixelformat(0x%x) is invalidate!\n", SENSOR_NAME_STRING(),pix->pixelformat); - } - } - - set_w = pix->width; - set_h = pix->height; - - winseqe_set_addr = sensor_fmt_catch(set_w, set_h, &set_w, &set_h); - - if ((winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) && winseqe_set_addr) { - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - goto sensor_s_fmt_end; - } - sensor->info_priv.winseqe_cur_addr = winseqe_set_addr; - if ((winseqe_set_addr[0].reg==SEQUENCE_PROPERTY) && (winseqe_set_addr[0].val==SEQUENCE_CAPTURE)) { - SENSOR_DG("\n%s..%s..Capture icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } else { - SENSOR_DG("\n%s..%s..Video icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - sensor->info_priv.preview_w = pix->width; - sensor->info_priv.preview_h = pix->height; - } - } - - if (winseqe_set_addr && (winseqe_set_addr[0].reg==SEQUENCE_PROPERTY) && (winseqe_set_addr[0].val==SEQUENCE_CAPTURE)) { - ret |= sensor_write_array(client, sensor_Preview2Capture); - if (ret != 0) { - SENSOR_TR("%s Preview 2 Capture failed\n", SENSOR_NAME_STRING()); - goto sensor_s_fmt_end; - } - sensor->info_priv.capture_w = set_w; - sensor->info_priv.capture_h = set_h; - sensor->info_priv.snap2preview = true; - } else if (sensor->info_priv.snap2preview == true) { - if (winseqe_set_addr || ((sensor->info_priv.preview_w == pix->width) && (sensor->info_priv.preview_h == pix->height))) { - ret |= sensor_write_array(client, sensor_Capture2Preview); - if (ret != 0) { - SENSOR_TR("%s Capture 2 Preview failed\n", SENSOR_NAME_STRING()); - goto sensor_s_fmt_end; - } - sensor->info_priv.preview_w = pix->width; - sensor->info_priv.preview_h = pix->height; - sensor->info_priv.snap2preview = false; - } else { - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,pix->width,pix->height); - } - } - - pix->width = set_w; - pix->height = set_h; -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_format *f) -{ - int ret = 0; - struct v4l2_pix_format *pix = &f->fmt.pix; - bool bayer = pix->pixelformat == V4L2_PIX_FMT_UYVY || - pix->pixelformat == V4L2_PIX_FMT_YUYV; - - /* - * With Bayer format enforce even side lengths, but let the user play - * with the starting pixel - */ - - if (pix->height > SENSOR_MAX_HEIGHT) - pix->height = SENSOR_MAX_HEIGHT; - else if (pix->height < SENSOR_MIN_HEIGHT) - pix->height = SENSOR_MIN_HEIGHT; - else if (bayer) - pix->height = ALIGN(pix->height, 2); - - if (pix->width > SENSOR_MAX_WIDTH) - pix->width = SENSOR_MAX_WIDTH; - else if (pix->width < SENSOR_MIN_WIDTH) - pix->width = SENSOR_MIN_WIDTH; - else if (bayer) - pix->width = ALIGN(pix->width, 2); - - if (sensor_fmt_catch(pix->width, pix->height, &pix->width, &pix->height) == NULL) { - pix->width = 0; - pix->height = 0; - } - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = sd->priv; - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV2655 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((*value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value > 0) && ((digitalzoom_cur + *value) > digitalzoom_total)) - { - *value = digitalzoom_total - digitalzoom_cur; - } - - if ((*value < 0) && ((digitalzoom_cur + *value) < 0)) - { - *value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += *value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, *value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Focus -static int sensor_set_focus_absolute(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int ret = 0; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (!qctrl_info) - return -EINVAL; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - if ((value >= qctrl_info->minimum) && (value <= qctrl_info->maximum)) { - - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EINVAL; - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - } - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - -sensor_set_focus_absolute_end: - return ret; -} -static int sensor_set_focus_relative(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int ret = 0; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_RELATIVE); - if (!qctrl_info) - return -EINVAL; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - if ((value >= qctrl_info->minimum) && (value <= qctrl_info->maximum)) { - - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EINVAL; - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - } - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } -sensor_set_focus_relative_end: - return ret; -} - -static int sensor_set_focus_mode(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int ret = 0; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - switch (value) - { - case SENSOR_AF_MODE_AUTO: - { - ret = sensor_af_single(client); - break; - } - - case SENSOR_AF_MODE_MACRO: - { - ret = sensor_set_focus_absolute(icd, qctrl, 0xff); - break; - } - - case SENSOR_AF_MODE_INFINITY: - { - ret = sensor_set_focus_absolute(icd, qctrl, 0x00); - break; - } - - case SENSOR_AF_MODE_CONTINUOUS: - { - ret = sensor_af_const(client); - break; - } - default: - SENSOR_TR("\n %s..%s AF value(0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__,value); - break; - - } - - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - - return ret; -} -#endif -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = sd->priv; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = sd->priv; - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (sensor_set_focus_absolute(icd, qctrl,ext_ctrl->value) == 0) { - if (ext_ctrl->value == qctrl->minimum) { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_INFINITY; - } else if (ext_ctrl->value == qctrl->maximum) { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_MACRO; - } else { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_FIXED; - } - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - sensor_set_focus_relative(icd, qctrl,ext_ctrl->value); - break; - } - case V4L2_CID_FOCUS_AUTO: - { - if (ext_ctrl->value == 1) { - if (sensor_set_focus_mode(icd, qctrl,SENSOR_AF_MODE_AUTO) != 0) - return -EINVAL; - sensor->info_priv.auto_focus = SENSOR_AF_MODE_AUTO; - } else if (SENSOR_AF_MODE_AUTO == sensor->info_priv.auto_focus){ - if (ext_ctrl->value == 0) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CLOSE; - } - break; - } - case V4L2_CID_FOCUS_CONTINUOUS: - { - if (SENSOR_AF_MODE_CONTINUOUS != sensor->info_priv.auto_focus) { - if (ext_ctrl->value == 1) { - if (sensor_set_focus_mode(icd, qctrl,SENSOR_AF_MODE_CONTINUOUS) != 0) - return -EINVAL; - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CONTINUOUS; - } - } else { - if (ext_ctrl->value == 0) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CLOSE; - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = sd->priv; - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = sd->priv; - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_stream(struct v4l2_subdev *sd, int enable) -{ - struct i2c_client *client = sd->priv; - struct sensor *sensor = to_sensor(client); - - if (enable == 1) { - sensor->info_priv.enable = 1; - } else if (enable == 0) { - sensor->info_priv.enable = 0; - } - -sensor_s_stream_end: - return 0; -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - int ret,pid = 0; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - - /* soft reset */ -#if (SENSOR_RESET_REG != SEQUENCE_END) - struct reginfo reg_info; - reg_info.reg = SENSOR_RESET_REG; - reg_info.val = SENSOR_RESET_VAL; - reg_info.reg_len = SENSOR_RESET_REG_LEN; - ret = sensor_write(client, ®_info); - if (ret != 0) { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - mdelay(5); //delay 5 microseconds -#endif - - /* check if it is an sensor sensor */ -#if (SENSOR_ID_REG != SEQUENCE_END) - ret = sensor_read(client, SENSOR_ID_REG, &pid); - if (ret != 0) { - SENSOR_TR("read chip id failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - SENSOR_DG("\n %s pid = 0x%x \n", SENSOR_NAME_STRING(), pid); -#else - pid = SENSOR_ID; -#endif - - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - icd->formats = sensor_colour_formats; - icd->num_formats = ARRAY_SIZE(sensor_colour_formats); - - return 0; - -sensor_video_probe_err: - - return ret; -} -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = sd->priv; - struct sensor *sensor = to_sensor(client); - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } - - return 0; - -} - -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_fmt = sensor_s_fmt, - .g_fmt = sensor_g_fmt, - .try_fmt = sensor_try_fmt, - .s_stream = sensor_s_stream, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - icd->y_skip_top = 0; - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - #if CONFIG_SENSOR_Focus - if (sensor->sensor_wq) { - destroy_workqueue(sensor->sensor_wq); - sensor->sensor_wq = NULL; - } - #endif - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - - diff --git a/drivers/media/video/mt9m112.h b/drivers/media/video/mt9m112.h deleted file mode 100755 index 066aba40f369..000000000000 --- a/drivers/media/video/mt9m112.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Driver for MT9P111 CMOS Image Sensor from Aptina - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#ifndef __MT9M112_H__ -#define __MT9M112_H__ -struct reginfo -{ - u8 reg; - u16 val; -}; - -#define WORD_LEN 0x04 -#define BYTE_LEN 0x02 - -#define SEQUENCE_INIT 0x00 -#define SEQUENCE_NORMAL 0x01 -#define SEQUENCE_CAPTURE 0x02 -#define SEQUENCE_PREVIEW 0x03 - -#define SEQUENCE_PROPERTY 0xFC -#define SEQUENCE_WAIT_MS 0xFD -#define SEQUENCE_WAIT_US 0xFE -#define SEQUENCE_END 0xFF -#endif diff --git a/drivers/media/video/mt9p111.c b/drivers/media/video/mt9p111.c deleted file mode 100644 index efb7c1c571a8..000000000000 --- a/drivers/media/video/mt9p111.c +++ /dev/null @@ -1,2377 +0,0 @@ -/* - * drivers/media/video/mt9p111.c - * - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "generic_sensor.h" -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.1.1: -* add sensor_focus_af_const_pause_usr_cb; -*/ -static int version = KERNEL_VERSION(0,1,1); -module_param(version, int, S_IRUGO); - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_MT9P111 -#define SENSOR_V4L2_IDENT V4L2_IDENT_MT9P111 -#define SENSOR_ID 0x00 -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_PCLK_SAMPLE_RISING|V4L2_MBUS_HSYNC_ACTIVE_HIGH| V4L2_MBUS_VSYNC_ACTIVE_HIGH|\ - V4L2_MBUS_DATA_ACTIVE_HIGH |SOCAM_MCLK_24MHZ) -#define SENSOR_PREVIEW_W 576 -#define SENSOR_PREVIEW_H 432 -#define SENSOR_PREVIEW_FPS 15000 // 15fps -#define SENSOR_FULLRES_L_FPS 7500 // 7.5fps -#define SENSOR_FULLRES_H_FPS 7500 // 7.5fps -#define SENSOR_720P_FPS 30000 -#define SENSOR_1080P_FPS 0 - -#define SENSOR_REGISTER_LEN 0 // sensor register address bytes -#define SENSOR_VALUE_LEN 0 // sensor register value bytes - -static unsigned int SensorConfiguration = CFG_Focus|CFG_FocusZone; -static unsigned int SensorChipID[] = {SENSOR_ID}; -/* Sensor Driver Configuration End */ - - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a,b) CONS4(SensorReg,SENSOR_REGISTER_LEN,Val,SENSOR_VALUE_LEN)(a,b) -#define sensor_write(client,reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_read(client,reg,v) CONS4(sensor_read_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_write_array generic_sensor_write_array - -struct sensor_parameter -{ - -}; - -struct specific_sensor{ - struct generic_sensor common_sensor; - //define user data below - struct sensor_parameter parameter; - -}; - -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ - -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_init_data[] = { -{ 0x0010, 0x0340, 0xffff,0xffff }, - - -{ 0x0010, 0x0340, 0xffff,0xffff }, // PLL_DIVIDERS -{ 0x0012, 0x0080, 0xffff,0xffff }, // PLL_P_DIVIDERS -{ 0x0014, 0x2025, 0xffff,0xffff }, // PLL_CONTROL -{ 0x001E, 0x0565, 0xffff,0xffff }, // PAD_SLEW_PAD_CONFIG -{ 0x0022, 0x0030, 0xffff,0xffff }, // VDD_DIS_COUNTER -{ 0x002A, 0x7FFF, 0xffff,0xffff }, // PLL_P4_P5_P6_DIVIDERS -{ 0x002C, 0x0000, 0xffff,0xffff }, // PLL_P7_DIVIDER -{ 0x002E, 0x0000, 0xffff,0xffff }, // SENSOR_CLOCK_DIVIDER -{ 0x0018, 0x400c, 0xffff,0xffff }, // STANDBY_CONTROL_AND_STATUS -//delay = 100 -SensorWaitMs(300), -{ 0x098E, 0x483A, 0xffff,0xffff }, // LOGICAL_ADDRESS_ACCESS -{ 0xC83A, 0x000C, 0xffff,0xffff }, // CAM_CORE_A_Y_ADDR_START -{ 0xC83C, 0x0018, 0xffff,0xffff }, // CAM_CORE_A_X_ADDR_START -{ 0xC83E, 0x07B1, 0xffff,0xffff }, // CAM_CORE_A_Y_ADDR_END -{ 0xC840, 0x0A45, 0xffff,0xffff }, // CAM_CORE_A_X_ADDR_END -{ 0xC842, 0x0001, 0xffff,0xffff }, // CAM_CORE_A_ROW_SPEED -{ 0xC844, 0x0103, 0xffff,0xffff }, // CAM_CORE_A_SKIP_X_CORE -{ 0xC846, 0x0103, 0xffff,0xffff }, // CAM_CORE_A_SKIP_Y_CORE -{ 0xC848, 0x0103, 0xffff,0xffff }, // CAM_CORE_A_SKIP_X_PIPE -{ 0xC84A, 0x0103, 0xffff,0xffff }, // CAM_CORE_A_SKIP_Y_PIPE -{ 0xC84C, 0x00F6, 0xffff,0xffff }, // CAM_CORE_A_POWER_MODE -{ 0xC84E, 0x0001, 0xffff,0xffff }, // CAM_CORE_A_BIN_MODE -{ 0xC850, 0x00, 0xffff,0xff}, // CAM_CORE_A_ORIENTATION -{ 0xC851, 0x00, 0xffff,0xff}, // CAM_CORE_A_PIXEL_ORDER -{ 0xC852, 0x019C, 0xffff,0xffff }, // CAM_CORE_A_FINE_CORRECTION -{ 0xC854, 0x0732, 0xffff,0xffff }, // CAM_CORE_A_FINE_ITMIN -{ 0xC858, 0x0000, 0xffff,0xffff }, // CAM_CORE_A_COARSE_ITMIN -{ 0xC85A, 0x0001, 0xffff,0xffff }, // CAM_CORE_A_COARSE_ITMAX_MARGIN -{ 0xC85C, 0x0423, 0xffff,0xffff }, // CAM_CORE_A_MIN_FRAME_LENGTH_LINES -{ 0xC85E, 0xFFFF, 0xffff,0xffff }, // CAM_CORE_A_MAX_FRAME_LENGTH_LINES -{ 0xC860, 0x0423, 0xffff,0xffff }, // CAM_CORE_A_BASE_FRAME_LENGTH_LINES -{ 0xC862, 0x1194, 0xffff,0xffff }, // CAM_CORE_A_MIN_LINE_LENGTH_PCLK -{ 0xC864, 0xFFFE, 0xffff,0xffff }, // CAM_CORE_A_MAX_LINE_LENGTH_PCLK -{ 0xC866, 0x7F7F, 0xffff,0xffff }, // CAM_CORE_A_P4_5_6_DIVIDER -{ 0xC868, 0x0423, 0xffff,0xffff }, // CAM_CORE_A_FRAME_LENGTH_LINES -{ 0xC86A, 0x1194, 0xffff,0xffff }, // CAM_CORE_A_LINE_LENGTH_PCK -{ 0xC86C, 0x0518, 0xffff,0xffff }, // CAM_CORE_A_OUTPUT_SIZE_WIDTH -{ 0xC86E, 0x03D4, 0xffff,0xffff }, // CAM_CORE_A_OUTPUT_SIZE_HEIGHT -{ 0xC870, 0x0014, 0xffff,0xffff }, // CAM_CORE_A_RX_FIFO_TRIGGER_MARK -{ 0xC858, 0x0003, 0xffff,0xffff }, // CAM_CORE_A_COARSE_ITMIN -{ 0xC8B8, 0x0004, 0xffff,0xffff }, // CAM_OUTPUT_0_JPEG_CONTROL -{ 0xC8AE, 0x0001, 0xffff,0xffff }, // CAM_OUTPUT_0_OUTPUT_FORMAT -{ 0xC8AA, 0x0280, 0xffff,0xffff }, // CAM_OUTPUT_0_IMAGE_WIDTH -{ 0xC8AC, 0x01E0, 0xffff,0xffff }, // CAM_OUTPUT_0_IMAGE_HEIGHT -{ 0xC872, 0x0010, 0xffff,0xffff }, // CAM_CORE_B_Y_ADDR_START -{ 0xC874, 0x001C, 0xffff,0xffff }, // CAM_CORE_B_X_ADDR_START -{ 0xC876, 0x07AF, 0xffff,0xffff }, // CAM_CORE_B_Y_ADDR_END -{ 0xC878, 0x0A43, 0xffff,0xffff }, // CAM_CORE_B_X_ADDR_END -{ 0xC87A, 0x0001, 0xffff,0xffff }, // CAM_CORE_B_ROW_SPEED -{ 0xC87C, 0x0101, 0xffff,0xffff }, // CAM_CORE_B_SKIP_X_CORE -{ 0xC87E, 0x0101, 0xffff,0xffff }, // CAM_CORE_B_SKIP_Y_CORE -{ 0xC880, 0x0101, 0xffff,0xffff }, // CAM_CORE_B_SKIP_X_PIPE -{ 0xC882, 0x0101, 0xffff,0xffff }, // CAM_CORE_B_SKIP_Y_PIPE -{ 0xC884, 0x00F2, 0xffff,0xffff }, // CAM_CORE_B_POWER_MODE -{ 0xC886, 0x0000, 0xffff,0xffff }, // CAM_CORE_B_BIN_MODE -{ 0xC888, 0x00, 0xffff,0xff}, // CAM_CORE_B_ORIENTATION -{ 0xC889, 0x00, 0xffff,0xff}, // CAM_CORE_B_PIXEL_ORDER -{ 0xC88A, 0x009C, 0xffff,0xffff }, // CAM_CORE_B_FINE_CORRECTION -{ 0xC88C, 0x034A, 0xffff,0xffff }, // CAM_CORE_B_FINE_ITMIN -{ 0xC890, 0x0000, 0xffff,0xffff }, // CAM_CORE_B_COARSE_ITMIN -{ 0xC892, 0x0001, 0xffff,0xffff }, // CAM_CORE_B_COARSE_ITMAX_MARGIN -{ 0xC894, 0x07EF, 0xffff,0xffff }, // CAM_CORE_B_MIN_FRAME_LENGTH_LINES -{ 0xC896, 0xFFFF, 0xffff,0xffff }, // CAM_CORE_B_MAX_FRAME_LENGTH_LINES -{ 0xC898, 0x082F, 0xffff,0xffff }, // CAM_CORE_B_BASE_FRAME_LENGTH_LINES -{ 0xC89A, 0x1964, 0xffff,0xffff }, // CAM_CORE_B_MIN_LINE_LENGTH_PCLK -{ 0xC89C, 0xFFFE, 0xffff,0xffff }, // CAM_CORE_B_MAX_LINE_LENGTH_PCLK -{ 0xC89E, 0x7F7F, 0xffff,0xffff }, // CAM_CORE_B_P4_5_6_DIVIDER -{ 0xC8A0, 0x07EF, 0xffff,0xffff }, // CAM_CORE_B_FRAME_LENGTH_LINES -{ 0xC8A2, 0x1964, 0xffff,0xffff }, // CAM_CORE_B_LINE_LENGTH_PCK -{ 0xC8A4, 0x0A28, 0xffff,0xffff }, // CAM_CORE_B_OUTPUT_SIZE_WIDTH -{ 0xC8A6, 0x07A0, 0xffff,0xffff }, // CAM_CORE_B_OUTPUT_SIZE_HEIGHT -{ 0xC8A8, 0x0124, 0xffff,0xffff }, // CAM_CORE_B_RX_FIFO_TRIGGER_MARK -{ 0xC890, 0x0003, 0xffff,0xffff }, // CAM_CORE_B_COARSE_ITMIN -{ 0xC8C0, 0x0A20, 0xffff,0xffff }, // CAM_OUTPUT_1_IMAGE_WIDTH -{ 0xC8C2, 0x0798, 0xffff,0xffff }, // CAM_OUTPUT_1_IMAGE_HEIGHT -{ 0xC89A, 0x1964, 0xffff,0xffff }, // CAM_CORE_B_MIN_LINE_LENGTH_PCLK -{ 0xC8A2, 0x1964, 0xffff,0xffff }, // CAM_CORE_B_LINE_LENGTH_PCK -{ 0xC8C4, 0x0001, 0xffff,0xffff }, // CAM_OUTPUT_1_OUTPUT_FORMAT -{ 0xC8C6, 0x0000, 0xffff,0xffff }, // CAM_OUTPUT_1_OUTPUT_FORMAT_ORDER -{ 0xC8CE, 0x0014, 0xffff,0xffff }, // CAM_OUTPUT_1_JPEG_CONTROL -{ 0xD822, 0x4610, 0xffff,0xffff }, // JPEG_JPSS_CTRL_VAR -{ 0x3330, 0x0000, 0xffff,0xffff }, // OUTPUT_FORMAT_TEST -{ 0x098E, 0xA00E, 0xffff,0xffff }, // LOGICAL_ADDRESS_ACCESS -{ 0xA00E, 0x32, 0xffff,0xff}, // FD_MAX_NUM_AUTOCOR_FUNC_VALUES_TO_CHECK -{ 0xA010, 0x00CC, 0xffff,0xffff }, // FD_MIN_EXPECTED50HZ_FLICKER_PERIOD -{ 0xA012, 0x00E0, 0xffff,0xffff }, // FD_MAX_EXPECTED50HZ_FLICKER_PERIOD -{ 0xA014, 0x00A8, 0xffff,0xffff }, // FD_MIN_EXPECTED60HZ_FLICKER_PERIOD -{ 0xA016, 0x00BC, 0xffff,0xffff }, // FD_MAX_EXPECTED60HZ_FLICKER_PERIOD -{ 0xA018, 0x00D6, 0xffff,0xffff }, // FD_EXPECTED50HZ_FLICKER_PERIOD_IN_CONTEXT_A -{ 0xA01A, 0x0075, 0xffff,0xffff }, // FD_EXPECTED50HZ_FLICKER_PERIOD_IN_CONTEXT_B -{ 0xA01C, 0x00B2, 0xffff,0xffff }, // FD_EXPECTED60HZ_FLICKER_PERIOD_IN_CONTEXT_A -{ 0xA01E, 0x0062, 0xffff,0xffff }, // FD_EXPECTED60HZ_FLICKER_PERIOD_IN_CONTEXT_B -{ 0xA000, 0x10, 0xffff,0xff}, // FD_STATUS -{ 0x8417, 0x02, 0xffff,0xff}, // SEQ_STATE_CFG_1_FD -//delay = 100 -SensorWaitMs(100), - -//[Step2-Fixups] -// Default variable access mode is always logical. - - -{ 0x098E, 0x0000, 0xffff,0xffff}, // LOGICAL_ADDRESS_ACCESS -{ 0x301A, 0x0030, 0xffff,0xffff}, // RESET_REGISTER -{ 0x316C, 0xB430, 0xffff,0xffff}, // DAC_TXLO -{ 0x31E0, 0x0003, 0xffff,0xffff}, // PIX_DEF_ID -{ 0x3E2E, 0xF319, 0xffff,0xffff}, // SAMP_SPARE -{ 0x3EE6, 0xA7C1, 0xffff,0xffff}, // DAC_LD_26_27 -{ 0x301E, 0x00A8, 0xffff,0xffff}, // DATA_PEDESTAL -{ 0xDC33, 0x2A, 0xffff,0xff}, // SYS_FIRST_BLACK_LEVEL -{ 0x3812, 0x212C, 0xffff,0xffff}, // OTPM_CFG -{ 0x0982, 0x0000, 0xffff,0xffff}, // ACCESS_CTL_STAT -{ 0x098A, 0x0000, 0xffff,0xffff}, // PHYSICAL_ADDRESS_ACCESS -{ 0x886C, 0xC0F1, 0xffff,0xffff}, -{ 0x886E, 0xC5E1, 0xffff,0xffff}, -{ 0x8870, 0x246A, 0xffff,0xffff}, -{ 0x8872, 0x1280, 0xffff,0xffff}, -{ 0x8874, 0xC4E1, 0xffff,0xffff}, -{ 0x8876, 0xD20F, 0xffff,0xffff}, -{ 0x8878, 0x2069, 0xffff,0xffff}, -{ 0x887A, 0x0000, 0xffff,0xffff}, -{ 0x887C, 0x6A62, 0xffff,0xffff}, -{ 0x887E, 0x1303, 0xffff,0xffff}, -{ 0x8880, 0x0084, 0xffff,0xffff}, -{ 0x8882, 0x1734, 0xffff,0xffff}, -{ 0x8884, 0x7005, 0xffff,0xffff}, -{ 0x8886, 0xD801, 0xffff,0xffff}, -{ 0x8888, 0x8A41, 0xffff,0xffff}, -{ 0x888A, 0xD900, 0xffff,0xffff}, -{ 0x888C, 0x0D5A, 0xffff,0xffff}, -{ 0x888E, 0x0664, 0xffff,0xffff}, -{ 0x8890, 0x8B61, 0xffff,0xffff}, -{ 0x8892, 0xE80B, 0xffff,0xffff}, -{ 0x8894, 0x000D, 0xffff,0xffff}, -{ 0x8896, 0x0020, 0xffff,0xffff}, -{ 0x8898, 0xD508, 0xffff,0xffff}, -{ 0x889A, 0x1504, 0xffff,0xffff}, -{ 0x889C, 0x1400, 0xffff,0xffff}, -{ 0x889E, 0x7840, 0xffff,0xffff}, -{ 0x88A0, 0xD007, 0xffff,0xffff}, -{ 0x88A2, 0x0DFB, 0xffff,0xffff}, -{ 0x88A4, 0x9004, 0xffff,0xffff}, -{ 0x88A6, 0xC4C1, 0xffff,0xffff}, -{ 0x88A8, 0x2029, 0xffff,0xffff}, -{ 0x88AA, 0x0300, 0xffff,0xffff}, -{ 0x88AC, 0x0219, 0xffff,0xffff}, -{ 0x88AE, 0x06C4, 0xffff,0xffff}, -{ 0x88B0, 0xFF80, 0xffff,0xffff}, -{ 0x88B2, 0x08D4, 0xffff,0xffff}, -{ 0x88B4, 0xFF80, 0xffff,0xffff}, -{ 0x88B6, 0x086C, 0xffff,0xffff}, -{ 0x88B8, 0xFF80, 0xffff,0xffff}, -{ 0x88BA, 0x08C0, 0xffff,0xffff}, -{ 0x88BC, 0xFF80, 0xffff,0xffff}, -{ 0x88BE, 0x08D4, 0xffff,0xffff}, -{ 0x88C0, 0xFF80, 0xffff,0xffff}, -{ 0x88C2, 0x08DC, 0xffff,0xffff}, -{ 0x88C4, 0xFF80, 0xffff,0xffff}, -{ 0x88C6, 0x0F58, 0xffff,0xffff}, -{ 0x88C8, 0xFF80, 0xffff,0xffff}, -{ 0x88CA, 0x0920, 0xffff,0xffff}, -{ 0x88CC, 0xFF80, 0xffff,0xffff}, -{ 0x88CE, 0x1010, 0xffff,0xffff}, -{ 0x88D0, 0xFF80, 0xffff,0xffff}, -{ 0x88D2, 0x1030, 0xffff,0xffff}, -{ 0x88D4, 0x0010, 0xffff,0xffff}, -{ 0x88D6, 0x0008, 0xffff,0xffff}, -{ 0x88D8, 0x0000, 0xffff,0xffff}, -{ 0x88DA, 0x0000, 0xffff,0xffff}, -{ 0x88DC, 0xD102, 0xffff,0xffff}, -{ 0x88DE, 0xD003, 0xffff,0xffff}, -{ 0x88E0, 0x7FE0, 0xffff,0xffff}, -{ 0x88E2, 0xB035, 0xffff,0xffff}, -{ 0x88E4, 0xFF80, 0xffff,0xffff}, -{ 0x88E6, 0x10C8, 0xffff,0xffff}, -{ 0x88E8, 0xFF80, 0xffff,0xffff}, -{ 0x88EA, 0x0118, 0xffff,0xffff}, -{ 0x88EC, 0xC0F1, 0xffff,0xffff}, -{ 0x88EE, 0xC5E1, 0xffff,0xffff}, -{ 0x88F0, 0xD5EC, 0xffff,0xffff}, -{ 0x88F2, 0x8D04, 0xffff,0xffff}, -{ 0x88F4, 0x8D25, 0xffff,0xffff}, -{ 0x88F6, 0xB808, 0xffff,0xffff}, -{ 0x88F8, 0x7825, 0xffff,0xffff}, -{ 0x88FA, 0x0821, 0xffff,0xffff}, -{ 0x88FC, 0x01DE, 0xffff,0xffff}, -{ 0x88FE, 0xD0EA, 0xffff,0xffff}, -{ 0x8900, 0x8000, 0xffff,0xffff}, -{ 0x8902, 0x8008, 0xffff,0xffff}, -{ 0x8904, 0x7840, 0xffff,0xffff}, -{ 0x8906, 0x8D04, 0xffff,0xffff}, -{ 0x8908, 0x8D25, 0xffff,0xffff}, -{ 0x890A, 0xB808, 0xffff,0xffff}, -{ 0x890C, 0x7825, 0xffff,0xffff}, -{ 0x890E, 0xB8A7, 0xffff,0xffff}, -{ 0x8910, 0x2841, 0xffff,0xffff}, -{ 0x8912, 0x0201, 0xffff,0xffff}, -{ 0x8914, 0xAD24, 0xffff,0xffff}, -{ 0x8916, 0xAD05, 0xffff,0xffff}, -{ 0x8918, 0x09A6, 0xffff,0xffff}, -{ 0x891A, 0x0104, 0xffff,0xffff}, -{ 0x891C, 0x01A9, 0xffff,0xffff}, -{ 0x891E, 0x06C4, 0xffff,0xffff}, -{ 0x8920, 0xC0F1, 0xffff,0xffff}, -{ 0x8922, 0x0932, 0xffff,0xffff}, -{ 0x8924, 0x06E4, 0xffff,0xffff}, -{ 0x8926, 0xDA38, 0xffff,0xffff}, -{ 0x8928, 0xD1E0, 0xffff,0xffff}, -{ 0x892A, 0xD5E1, 0xffff,0xffff}, -{ 0x892C, 0x76A9, 0xffff,0xffff}, -{ 0x892E, 0x0EC6, 0xffff,0xffff}, -{ 0x8930, 0x06A4, 0xffff,0xffff}, -{ 0x8932, 0x70C9, 0xffff,0xffff}, -{ 0x8934, 0xD0DF, 0xffff,0xffff}, -{ 0x8936, 0xA501, 0xffff,0xffff}, -{ 0x8938, 0xD0DF, 0xffff,0xffff}, -{ 0x893A, 0xA503, 0xffff,0xffff}, -{ 0x893C, 0xD0DF, 0xffff,0xffff}, -{ 0x893E, 0xA506, 0xffff,0xffff}, -{ 0x8940, 0xD0DF, 0xffff,0xffff}, -{ 0x8942, 0xA509, 0xffff,0xffff}, -{ 0x8944, 0xD0D8, 0xffff,0xffff}, -{ 0x8946, 0xA0C0, 0xffff,0xffff}, -{ 0x8948, 0xD0DE, 0xffff,0xffff}, -{ 0x894A, 0x802E, 0xffff,0xffff}, -{ 0x894C, 0x9117, 0xffff,0xffff}, -{ 0x894E, 0x0171, 0xffff,0xffff}, -{ 0x8950, 0x06E4, 0xffff,0xffff}, -{ 0x8952, 0xB10E, 0xffff,0xffff}, -{ 0x8954, 0xC0F1, 0xffff,0xffff}, -{ 0x8956, 0xD0D3, 0xffff,0xffff}, -{ 0x8958, 0x8806, 0xffff,0xffff}, -{ 0x895A, 0x080F, 0xffff,0xffff}, -{ 0x895C, 0x0051, 0xffff,0xffff}, -{ 0x895E, 0xD0D2, 0xffff,0xffff}, -{ 0x8960, 0x8000, 0xffff,0xffff}, -{ 0x8962, 0x8008, 0xffff,0xffff}, -{ 0x8964, 0x7840, 0xffff,0xffff}, -{ 0x8966, 0x0A1E, 0xffff,0xffff}, -{ 0x8968, 0x0104, 0xffff,0xffff}, -{ 0x896A, 0xC0D1, 0xffff,0xffff}, -{ 0x896C, 0x7EE0, 0xffff,0xffff}, -{ 0x896E, 0x78E0, 0xffff,0xffff}, -{ 0x8970, 0xC0F1, 0xffff,0xffff}, -{ 0x8972, 0x08D6, 0xffff,0xffff}, -{ 0x8974, 0x06C4, 0xffff,0xffff}, -{ 0x8976, 0xD7CC, 0xffff,0xffff}, -{ 0x8978, 0x8700, 0xffff,0xffff}, -{ 0x897A, 0x8009, 0xffff,0xffff}, -{ 0x897C, 0x7840, 0xffff,0xffff}, -{ 0x897E, 0xE080, 0xffff,0xffff}, -{ 0x8980, 0x0276, 0xffff,0xffff}, -{ 0x8982, 0x0002, 0xffff,0xffff}, -{ 0x8984, 0xD5C7, 0xffff,0xffff}, -{ 0x8986, 0xD6D0, 0xffff,0xffff}, -{ 0x8988, 0x1530, 0xffff,0xffff}, -{ 0x898A, 0x1081, 0xffff,0xffff}, -{ 0x898C, 0x1531, 0xffff,0xffff}, -{ 0x898E, 0x1080, 0xffff,0xffff}, -{ 0x8990, 0xB908, 0xffff,0xffff}, -{ 0x8992, 0x7905, 0xffff,0xffff}, -{ 0x8994, 0x2941, 0xffff,0xffff}, -{ 0x8996, 0x0200, 0xffff,0xffff}, -{ 0x8998, 0x1D32, 0xffff,0xffff}, -{ 0x899A, 0x1002, 0xffff,0xffff}, -{ 0x899C, 0x1D33, 0xffff,0xffff}, -{ 0x899E, 0x1042, 0xffff,0xffff}, -{ 0x89A0, 0x962D, 0xffff,0xffff}, -{ 0x89A2, 0x2540, 0xffff,0xffff}, -{ 0x89A4, 0x15D1, 0xffff,0xffff}, -{ 0x89A6, 0x2941, 0xffff,0xffff}, -{ 0x89A8, 0x0200, 0xffff,0xffff}, -{ 0x89AA, 0x1D30, 0xffff,0xffff}, -{ 0x89AC, 0x1002, 0xffff,0xffff}, -{ 0x89AE, 0x8D06, 0xffff,0xffff}, -{ 0x89B0, 0x2540, 0xffff,0xffff}, -{ 0x89B2, 0x1610, 0xffff,0xffff}, -{ 0x89B4, 0x1D31, 0xffff,0xffff}, -{ 0x89B6, 0x1042, 0xffff,0xffff}, -{ 0x89B8, 0x081B, 0xffff,0xffff}, -{ 0x89BA, 0x0051, 0xffff,0xffff}, -{ 0x89BC, 0x8700, 0xffff,0xffff}, -{ 0x89BE, 0x8008, 0xffff,0xffff}, -{ 0x89C0, 0x7840, 0xffff,0xffff}, -{ 0x89C2, 0xD900, 0xffff,0xffff}, -{ 0x89C4, 0x2941, 0xffff,0xffff}, -{ 0x89C6, 0x0200, 0xffff,0xffff}, -{ 0x89C8, 0xAD00, 0xffff,0xffff}, -{ 0x89CA, 0xAD21, 0xffff,0xffff}, -{ 0x89CC, 0xD801, 0xffff,0xffff}, -{ 0x89CE, 0x1D4D, 0xffff,0xffff}, -{ 0x89D0, 0x1002, 0xffff,0xffff}, -{ 0x89D2, 0x154D, 0xffff,0xffff}, -{ 0x89D4, 0x1080, 0xffff,0xffff}, -{ 0x89D6, 0xB861, 0xffff,0xffff}, -{ 0x89D8, 0xE085, 0xffff,0xffff}, -{ 0x89DA, 0x0218, 0xffff,0xffff}, -{ 0x89DC, 0x000D, 0xffff,0xffff}, -{ 0x89DE, 0x2740, 0xffff,0xffff}, -{ 0x89E0, 0x7381, 0xffff,0xffff}, -{ 0x89E2, 0x2132, 0xffff,0xffff}, -{ 0x89E4, 0x0000, 0xffff,0xffff}, -{ 0x89E6, 0x7914, 0xffff,0xffff}, -{ 0x89E8, 0x7900, 0xffff,0xffff}, -{ 0x89EA, 0x0323, 0xffff,0xffff}, -{ 0x89EC, 0x67BB, 0xffff,0xffff}, -{ 0x89EE, 0xD62E, 0xffff,0xffff}, -{ 0x89F0, 0x8D11, 0xffff,0xffff}, -{ 0x89F2, 0xD1B6, 0xffff,0xffff}, -{ 0x89F4, 0x8924, 0xffff,0xffff}, -{ 0x89F6, 0x2032, 0xffff,0xffff}, -{ 0x89F8, 0x2000, 0xffff,0xffff}, -{ 0x89FA, 0xDE02, 0xffff,0xffff}, -{ 0x89FC, 0x082B, 0xffff,0xffff}, -{ 0x89FE, 0x0040, 0xffff,0xffff}, -{ 0x8A00, 0x8D20, 0xffff,0xffff}, -{ 0x8A02, 0x8D41, 0xffff,0xffff}, -{ 0x8A04, 0xB908, 0xffff,0xffff}, -{ 0x8A06, 0x7945, 0xffff,0xffff}, -{ 0x8A08, 0xB983, 0xffff,0xffff}, -{ 0x8A0A, 0x2941, 0xffff,0xffff}, -{ 0x8A0C, 0x0202, 0xffff,0xffff}, -{ 0x8A0E, 0xAD40, 0xffff,0xffff}, -{ 0x8A10, 0xAD21, 0xffff,0xffff}, -{ 0x8A12, 0xD1AF, 0xffff,0xffff}, -{ 0x8A14, 0x8120, 0xffff,0xffff}, -{ 0x8A16, 0x8121, 0xffff,0xffff}, -{ 0x8A18, 0x7940, 0xffff,0xffff}, -{ 0x8A1A, 0x8D06, 0xffff,0xffff}, -{ 0x8A1C, 0xE001, 0xffff,0xffff}, -{ 0x8A1E, 0xAD06, 0xffff,0xffff}, -{ 0x8A20, 0x1D4D, 0xffff,0xffff}, -{ 0x8A22, 0x1382, 0xffff,0xffff}, -{ 0x8A24, 0xF0E9, 0xffff,0xffff}, -{ 0x8A26, 0x8D06, 0xffff,0xffff}, -{ 0x8A28, 0x1D4D, 0xffff,0xffff}, -{ 0x8A2A, 0x1382, 0xffff,0xffff}, -{ 0x8A2C, 0xE001, 0xffff,0xffff}, -{ 0x8A2E, 0xAD06, 0xffff,0xffff}, -{ 0x8A30, 0x8D00, 0xffff,0xffff}, -{ 0x8A32, 0x8D21, 0xffff,0xffff}, -{ 0x8A34, 0xB808, 0xffff,0xffff}, -{ 0x8A36, 0x7825, 0xffff,0xffff}, -{ 0x8A38, 0xB885, 0xffff,0xffff}, -{ 0x8A3A, 0x2841, 0xffff,0xffff}, -{ 0x8A3C, 0x0201, 0xffff,0xffff}, -{ 0x8A3E, 0xAD20, 0xffff,0xffff}, -{ 0x8A40, 0xAD01, 0xffff,0xffff}, -{ 0x8A42, 0x8D31, 0xffff,0xffff}, -{ 0x8A44, 0xF01A, 0xffff,0xffff}, -{ 0x8A46, 0x8D31, 0xffff,0xffff}, -{ 0x8A48, 0x8D12, 0xffff,0xffff}, -{ 0x8A4A, 0x8D46, 0xffff,0xffff}, -{ 0x8A4C, 0x7822, 0xffff,0xffff}, -{ 0x8A4E, 0x0863, 0xffff,0xffff}, -{ 0x8A50, 0x0082, 0xffff,0xffff}, -{ 0x8A52, 0x1532, 0xffff,0xffff}, -{ 0x8A54, 0x1080, 0xffff,0xffff}, -{ 0x8A56, 0x1533, 0xffff,0xffff}, -{ 0x8A58, 0x1081, 0xffff,0xffff}, -{ 0x8A5A, 0x1531, 0xffff,0xffff}, -{ 0x8A5C, 0x1082, 0xffff,0xffff}, -{ 0x8A5E, 0xB808, 0xffff,0xffff}, -{ 0x8A60, 0x7825, 0xffff,0xffff}, -{ 0x8A62, 0x1530, 0xffff,0xffff}, -{ 0x8A64, 0x1081, 0xffff,0xffff}, -{ 0x8A66, 0xB908, 0xffff,0xffff}, -{ 0x8A68, 0x7945, 0xffff,0xffff}, -{ 0x8A6A, 0xD29A, 0xffff,0xffff}, -{ 0x8A6C, 0x0992, 0xffff,0xffff}, -{ 0x8A6E, 0x0020, 0xffff,0xffff}, -{ 0x8A70, 0x8A40, 0xffff,0xffff}, -{ 0x8A72, 0x8D31, 0xffff,0xffff}, -{ 0x8A74, 0x081F, 0xffff,0xffff}, -{ 0x8A76, 0x0051, 0xffff,0xffff}, -{ 0x8A78, 0x8D06, 0xffff,0xffff}, -{ 0x8A7A, 0x6038, 0xffff,0xffff}, -{ 0x8A7C, 0xD194, 0xffff,0xffff}, -{ 0x8A7E, 0x8120, 0xffff,0xffff}, -{ 0x8A80, 0x8121, 0xffff,0xffff}, -{ 0x8A82, 0x7960, 0xffff,0xffff}, -{ 0x8A84, 0x2132, 0xffff,0xffff}, -{ 0x8A86, 0x2000, 0xffff,0xffff}, -{ 0x8A88, 0x8D06, 0xffff,0xffff}, -{ 0x8A8A, 0xE001, 0xffff,0xffff}, -{ 0x8A8C, 0xAD06, 0xffff,0xffff}, -{ 0x8A8E, 0xD806, 0xffff,0xffff}, -{ 0x8A90, 0xF0B1, 0xffff,0xffff}, -{ 0x8A92, 0xE88F, 0xffff,0xffff}, -{ 0x8A94, 0x8D66, 0xffff,0xffff}, -{ 0x8A96, 0x633B, 0xffff,0xffff}, -{ 0x8A98, 0x63BB, 0xffff,0xffff}, -{ 0x8A9A, 0xD08D, 0xffff,0xffff}, -{ 0x8A9C, 0x8000, 0xffff,0xffff}, -{ 0x8A9E, 0x8021, 0xffff,0xffff}, -{ 0x8AA0, 0x7960, 0xffff,0xffff}, -{ 0x8AA2, 0x8B17, 0xffff,0xffff}, -{ 0x8AA4, 0x8D06, 0xffff,0xffff}, -{ 0x8AA6, 0xE001, 0xffff,0xffff}, -{ 0x8AA8, 0xAD06, 0xffff,0xffff}, -{ 0x8AAA, 0xD803, 0xffff,0xffff}, -{ 0x8AAC, 0xF0A3, 0xffff,0xffff}, -{ 0x8AAE, 0x2032, 0xffff,0xffff}, -{ 0x8AB0, 0x2040, 0xffff,0xffff}, -{ 0x8AB2, 0xAD07, 0xffff,0xffff}, -{ 0x8AB4, 0xD804, 0xffff,0xffff}, -{ 0x8AB6, 0xF09F, 0xffff,0xffff}, -{ 0x8AB8, 0x1532, 0xffff,0xffff}, -{ 0x8ABA, 0x1080, 0xffff,0xffff}, -{ 0x8ABC, 0x1533, 0xffff,0xffff}, -{ 0x8ABE, 0x1081, 0xffff,0xffff}, -{ 0x8AC0, 0x1531, 0xffff,0xffff}, -{ 0x8AC2, 0x1082, 0xffff,0xffff}, -{ 0x8AC4, 0xB808, 0xffff,0xffff}, -{ 0x8AC6, 0x7825, 0xffff,0xffff}, -{ 0x8AC8, 0x1530, 0xffff,0xffff}, -{ 0x8ACA, 0x1081, 0xffff,0xffff}, -{ 0x8ACC, 0xB908, 0xffff,0xffff}, -{ 0x8ACE, 0x7945, 0xffff,0xffff}, -{ 0x8AD0, 0xD280, 0xffff,0xffff}, -{ 0x8AD2, 0x092E, 0xffff,0xffff}, -{ 0x8AD4, 0x0020, 0xffff,0xffff}, -{ 0x8AD6, 0x8A41, 0xffff,0xffff}, -{ 0x8AD8, 0x8D51, 0xffff,0xffff}, -{ 0x8ADA, 0x8D32, 0xffff,0xffff}, -{ 0x8ADC, 0x8DC6, 0xffff,0xffff}, -{ 0x8ADE, 0x7942, 0xffff,0xffff}, -{ 0x8AE0, 0x62DB, 0xffff,0xffff}, -{ 0x8AE2, 0x091F, 0xffff,0xffff}, -{ 0x8AE4, 0x03A2, 0xffff,0xffff}, -{ 0x8AE6, 0x63BB, 0xffff,0xffff}, -{ 0x8AE8, 0xE88B, 0xffff,0xffff}, -{ 0x8AEA, 0x8D00, 0xffff,0xffff}, -{ 0x8AEC, 0x8D21, 0xffff,0xffff}, -{ 0x8AEE, 0xB808, 0xffff,0xffff}, -{ 0x8AF0, 0x7825, 0xffff,0xffff}, -{ 0x8AF2, 0xB885, 0xffff,0xffff}, -{ 0x8AF4, 0x2841, 0xffff,0xffff}, -{ 0x8AF6, 0x0201, 0xffff,0xffff}, -{ 0x8AF8, 0xAD20, 0xffff,0xffff}, -{ 0x8AFA, 0xAD01, 0xffff,0xffff}, -{ 0x8AFC, 0xF1CF, 0xffff,0xffff}, -{ 0x8AFE, 0xDF04, 0xffff,0xffff}, -{ 0x8B00, 0x092B, 0xffff,0xffff}, -{ 0x8B02, 0x03A3, 0xffff,0xffff}, -{ 0x8B04, 0x1D4D, 0xffff,0xffff}, -{ 0x8B06, 0x13C2, 0xffff,0xffff}, -{ 0x8B08, 0x1530, 0xffff,0xffff}, -{ 0x8B0A, 0x108E, 0xffff,0xffff}, -{ 0x8B0C, 0x1531, 0xffff,0xffff}, -{ 0x8B0E, 0x1081, 0xffff,0xffff}, -{ 0x8B10, 0x1533, 0xffff,0xffff}, -{ 0x8B12, 0x108F, 0xffff,0xffff}, -{ 0x8B14, 0xBE08, 0xffff,0xffff}, -{ 0x8B16, 0x7E25, 0xffff,0xffff}, -{ 0x8B18, 0x1532, 0xffff,0xffff}, -{ 0x8B1A, 0x1081, 0xffff,0xffff}, -{ 0x8B1C, 0xB908, 0xffff,0xffff}, -{ 0x8B1E, 0x79E5, 0xffff,0xffff}, -{ 0x8B20, 0x0907, 0xffff,0xffff}, -{ 0x8B22, 0x0382, 0xffff,0xffff}, -{ 0x8B24, 0xE883, 0xffff,0xffff}, -{ 0x8B26, 0x8B16, 0xffff,0xffff}, -{ 0x8B28, 0xF002, 0xffff,0xffff}, -{ 0x8B2A, 0x8B15, 0xffff,0xffff}, -{ 0x8B2C, 0x8D22, 0xffff,0xffff}, -{ 0x8B2E, 0xAD07, 0xffff,0xffff}, -{ 0x8B30, 0x8D03, 0xffff,0xffff}, -{ 0x8B32, 0xD367, 0xffff,0xffff}, -{ 0x8B34, 0xB908, 0xffff,0xffff}, -{ 0x8B36, 0x8DC1, 0xffff,0xffff}, -{ 0x8B38, 0x7905, 0xffff,0xffff}, -{ 0x8B3A, 0x8D00, 0xffff,0xffff}, -{ 0x8B3C, 0xB808, 0xffff,0xffff}, -{ 0x8B3E, 0x78C5, 0xffff,0xffff}, -{ 0x8B40, 0x0921, 0xffff,0xffff}, -{ 0x8B42, 0x011E, 0xffff,0xffff}, -{ 0x8B44, 0xB883, 0xffff,0xffff}, -{ 0x8B46, 0x2841, 0xffff,0xffff}, -{ 0x8B48, 0x0201, 0xffff,0xffff}, -{ 0x8B4A, 0xAD20, 0xffff,0xffff}, -{ 0x8B4C, 0x8320, 0xffff,0xffff}, -{ 0x8B4E, 0xAD01, 0xffff,0xffff}, -{ 0x8B50, 0x8121, 0xffff,0xffff}, -{ 0x8B52, 0x7960, 0xffff,0xffff}, -{ 0x8B54, 0x2032, 0xffff,0xffff}, -{ 0x8B56, 0x2080, 0xffff,0xffff}, -{ 0x8B58, 0x8D06, 0xffff,0xffff}, -{ 0x8B5A, 0xE001, 0xffff,0xffff}, -{ 0x8B5C, 0xAD06, 0xffff,0xffff}, -{ 0x8B5E, 0xF04D, 0xffff,0xffff}, -{ 0x8B60, 0x8D00, 0xffff,0xffff}, -{ 0x8B62, 0x8D21, 0xffff,0xffff}, -{ 0x8B64, 0xB808, 0xffff,0xffff}, -{ 0x8B66, 0x7825, 0xffff,0xffff}, -{ 0x8B68, 0xB886, 0xffff,0xffff}, -{ 0x8B6A, 0x2841, 0xffff,0xffff}, -{ 0x8B6C, 0x0201, 0xffff,0xffff}, -{ 0x8B6E, 0xAD20, 0xffff,0xffff}, -{ 0x8B70, 0xAD01, 0xffff,0xffff}, -{ 0x8B72, 0xD057, 0xffff,0xffff}, -{ 0x8B74, 0x8000, 0xffff,0xffff}, -{ 0x8B76, 0x8021, 0xffff,0xffff}, -{ 0x8B78, 0x7960, 0xffff,0xffff}, -{ 0x8B7A, 0x8D07, 0xffff,0xffff}, -{ 0x8B7C, 0x1545, 0xffff,0xffff}, -{ 0x8B7E, 0x1080, 0xffff,0xffff}, -{ 0x8B80, 0x1546, 0xffff,0xffff}, -{ 0x8B82, 0x1081, 0xffff,0xffff}, -{ 0x8B84, 0xB808, 0xffff,0xffff}, -{ 0x8B86, 0x7825, 0xffff,0xffff}, -{ 0x8B88, 0x085D, 0xffff,0xffff}, -{ 0x8B8A, 0x005E, 0xffff,0xffff}, -{ 0x8B8C, 0x8D06, 0xffff,0xffff}, -{ 0x8B8E, 0xE001, 0xffff,0xffff}, -{ 0x8B90, 0xAD06, 0xffff,0xffff}, -{ 0x8B92, 0xD805, 0xffff,0xffff}, -{ 0x8B94, 0xF02F, 0xffff,0xffff}, -{ 0x8B96, 0x1530, 0xffff,0xffff}, -{ 0x8B98, 0x1082, 0xffff,0xffff}, -{ 0x8B9A, 0x1531, 0xffff,0xffff}, -{ 0x8B9C, 0x1080, 0xffff,0xffff}, -{ 0x8B9E, 0xD14D, 0xffff,0xffff}, -{ 0x8BA0, 0xBA08, 0xffff,0xffff}, -{ 0x8BA2, 0x7A05, 0xffff,0xffff}, -{ 0x8BA4, 0x8903, 0xffff,0xffff}, -{ 0x8BA6, 0x080F, 0xffff,0xffff}, -{ 0x8BA8, 0x0083, 0xffff,0xffff}, -{ 0x8BAA, 0x8902, 0xffff,0xffff}, -{ 0x8BAC, 0x8E44, 0xffff,0xffff}, -{ 0x8BAE, 0x0839, 0xffff,0xffff}, -{ 0x8BB0, 0x0082, 0xffff,0xffff}, -{ 0x8BB2, 0x1545, 0xffff,0xffff}, -{ 0x8BB4, 0x1082, 0xffff,0xffff}, -{ 0x8BB6, 0x1546, 0xffff,0xffff}, -{ 0x8BB8, 0x1080, 0xffff,0xffff}, -{ 0x8BBA, 0xBA08, 0xffff,0xffff}, -{ 0x8BBC, 0x7A05, 0xffff,0xffff}, -{ 0x8BBE, 0x0A29, 0xffff,0xffff}, -{ 0x8BC0, 0x005E, 0xffff,0xffff}, -{ 0x8BC2, 0x8D00, 0xffff,0xffff}, -{ 0x8BC4, 0x8D21, 0xffff,0xffff}, -{ 0x8BC6, 0xB808, 0xffff,0xffff}, -{ 0x8BC8, 0x7825, 0xffff,0xffff}, -{ 0x8BCA, 0xB88D, 0xffff,0xffff}, -{ 0x8BCC, 0x2841, 0xffff,0xffff}, -{ 0x8BCE, 0x0201, 0xffff,0xffff}, -{ 0x8BD0, 0xAD20, 0xffff,0xffff}, -{ 0x8BD2, 0xAD01, 0xffff,0xffff}, -{ 0x8BD4, 0x0A11, 0xffff,0xffff}, -{ 0x8BD6, 0x009E, 0xffff,0xffff}, -{ 0x8BD8, 0xD03D, 0xffff,0xffff}, -{ 0x8BDA, 0x8000, 0xffff,0xffff}, -{ 0x8BDC, 0x8021, 0xffff,0xffff}, -{ 0x8BDE, 0x7960, 0xffff,0xffff}, -{ 0x8BE0, 0x1550, 0xffff,0xffff}, -{ 0x8BE2, 0x1080, 0xffff,0xffff}, -{ 0x8BE4, 0xD800, 0xffff,0xffff}, -{ 0x8BE6, 0x09AA, 0xffff,0xffff}, -{ 0x8BE8, 0x0164, 0xffff,0xffff}, -{ 0x8BEA, 0x1D4D, 0xffff,0xffff}, -{ 0x8BEC, 0x1002, 0xffff,0xffff}, -{ 0x8BEE, 0xF005, 0xffff,0xffff}, -{ 0x8BF0, 0xD800, 0xffff,0xffff}, -{ 0x8BF2, 0x1D4D, 0xffff,0xffff}, -{ 0x8BF4, 0x1002, 0xffff,0xffff}, -{ 0x8BF6, 0x06B1, 0xffff,0xffff}, -{ 0x8BF8, 0x0684, 0xffff,0xffff}, -{ 0x8BFA, 0x78E0, 0xffff,0xffff}, -{ 0x8BFC, 0xC0F1, 0xffff,0xffff}, -{ 0x8BFE, 0x0E4E, 0xffff,0xffff}, -{ 0x8C00, 0x06A4, 0xffff,0xffff}, -{ 0x8C02, 0x7308, 0xffff,0xffff}, -{ 0x8C04, 0x0919, 0xffff,0xffff}, -{ 0x8C06, 0x0023, 0xffff,0xffff}, -{ 0x8C08, 0x721A, 0xffff,0xffff}, -{ 0x8C0A, 0xD026, 0xffff,0xffff}, -{ 0x8C0C, 0x1030, 0xffff,0xffff}, -{ 0x8C0E, 0x0082, 0xffff,0xffff}, -{ 0x8C10, 0x1031, 0xffff,0xffff}, -{ 0x8C12, 0x0081, 0xffff,0xffff}, -{ 0x8C14, 0xBA08, 0xffff,0xffff}, -{ 0x8C16, 0x7A25, 0xffff,0xffff}, -{ 0x8C18, 0xDD00, 0xffff,0xffff}, -{ 0x8C1A, 0xF005, 0xffff,0xffff}, -{ 0x8C1C, 0xDD01, 0xffff,0xffff}, -{ 0x8C1E, 0x7268, 0xffff,0xffff}, -{ 0x8C20, 0x7328, 0xffff,0xffff}, -{ 0x8C22, 0x2302, 0xffff,0xffff}, -{ 0x8C24, 0x0080, 0xffff,0xffff}, -{ 0x8C26, 0x2885, 0xffff,0xffff}, -{ 0x8C28, 0x0901, 0xffff,0xffff}, -{ 0x8C2A, 0x702F, 0xffff,0xffff}, -{ 0x8C2C, 0x0EFA, 0xffff,0xffff}, -{ 0x8C2E, 0x06A4, 0xffff,0xffff}, -{ 0x8C30, 0x7168, 0xffff,0xffff}, -{ 0x8C32, 0xD31C, 0xffff,0xffff}, -{ 0x8C34, 0x8BC6, 0xffff,0xffff}, -{ 0x8C36, 0x8B31, 0xffff,0xffff}, -{ 0x8C38, 0x780F, 0xffff,0xffff}, -{ 0x8C3A, 0xD226, 0xffff,0xffff}, -{ 0x8C3C, 0x663E, 0xffff,0xffff}, -{ 0x8C3E, 0xD123, 0xffff,0xffff}, -{ 0x8C40, 0xBE62, 0xffff,0xffff}, -{ 0x8C42, 0x7ECF, 0xffff,0xffff}, -{ 0x8C44, 0x89E4, 0xffff,0xffff}, -{ 0x8C46, 0x2214, 0xffff,0xffff}, -{ 0x8C48, 0x0381, 0xffff,0xffff}, -{ 0x8C4A, 0xED07, 0xffff,0xffff}, -{ 0x8C4C, 0x2840, 0xffff,0xffff}, -{ 0x8C4E, 0x020E, 0xffff,0xffff}, -{ 0x8C50, 0x7EE5, 0xffff,0xffff}, -{ 0x8C52, 0xB1CC, 0xffff,0xffff}, -{ 0x8C54, 0xF007, 0xffff,0xffff}, -{ 0x8C56, 0x7E12, 0xffff,0xffff}, -{ 0x8C58, 0xE601, 0xffff,0xffff}, -{ 0x8C5A, 0x7ECF, 0xffff,0xffff}, -{ 0x8C5C, 0xBE08, 0xffff,0xffff}, -{ 0x8C5E, 0x7FC5, 0xffff,0xffff}, -{ 0x8C60, 0xB1EC, 0xffff,0xffff}, -{ 0x8C62, 0x080D, 0xffff,0xffff}, -{ 0x8C64, 0x2003, 0xffff,0xffff}, -{ 0x8C66, 0xED0D, 0xffff,0xffff}, -{ 0x8C68, 0xD800, 0xffff,0xffff}, -{ 0x8C6A, 0xF01A, 0xffff,0xffff}, -{ 0x8C6C, 0x134D, 0xffff,0xffff}, -{ 0x8C6E, 0x0080, 0xffff,0xffff}, -{ 0x8C70, 0x080B, 0xffff,0xffff}, -{ 0x8C72, 0x0190, 0xffff,0xffff}, -{ 0x8C74, 0x8A0E, 0xffff,0xffff}, -{ 0x8C76, 0x080B, 0xffff,0xffff}, -{ 0x8C78, 0x0291, 0xffff,0xffff}, -{ 0x8C7A, 0xD801, 0xffff,0xffff}, -{ 0x8C7C, 0xF010, 0xffff,0xffff}, -{ 0x8C7E, 0x1330, 0xffff,0xffff}, -{ 0x8C80, 0x0081, 0xffff,0xffff}, -{ 0x8C82, 0x1331, 0xffff,0xffff}, -{ 0x8C84, 0x008D, 0xffff,0xffff}, -{ 0x8C86, 0xD802, 0xffff,0xffff}, -{ 0x8C88, 0xB908, 0xffff,0xffff}, -{ 0x8C8A, 0x79A5, 0xffff,0xffff}, -{ 0x8C8C, 0xB22A, 0xffff,0xffff}, -{ 0x8C8E, 0x1332, 0xffff,0xffff}, -{ 0x8C90, 0x0081, 0xffff,0xffff}, -{ 0x8C92, 0x1333, 0xffff,0xffff}, -{ 0x8C94, 0x008D, 0xffff,0xffff}, -{ 0x8C96, 0xB908, 0xffff,0xffff}, -{ 0x8C98, 0x79A5, 0xffff,0xffff}, -{ 0x8C9A, 0xB22B, 0xffff,0xffff}, -{ 0x8C9C, 0x0611, 0xffff,0xffff}, -{ 0x8C9E, 0x0684, 0xffff,0xffff}, -{ 0x8CA0, 0xFF80, 0xffff,0xffff}, -{ 0x8CA2, 0x0290, 0xffff,0xffff}, -{ 0x8CA4, 0x8000, 0xffff,0xffff}, -{ 0x8CA6, 0x008C, 0xffff,0xffff}, -{ 0x8CA8, 0x0000, 0xffff,0xffff}, -{ 0x8CAA, 0xF3BC, 0xffff,0xffff}, -{ 0x8CAC, 0xFF80, 0xffff,0xffff}, -{ 0x8CAE, 0x1120, 0xffff,0xffff}, -{ 0x8CB0, 0xFF80, 0xffff,0xffff}, -{ 0x8CB2, 0x08EC, 0xffff,0xffff}, -{ 0x8CB4, 0xFF80, 0xffff,0xffff}, -{ 0x8CB6, 0x0954, 0xffff,0xffff}, -{ 0x8CB8, 0xFF80, 0xffff,0xffff}, -{ 0x8CBA, 0x0970, 0xffff,0xffff}, -{ 0x8CBC, 0xFF80, 0xffff,0xffff}, -{ 0x8CBE, 0x0CD4, 0xffff,0xffff}, -{ 0x8CC0, 0xFF80, 0xffff,0xffff}, -{ 0x8CC2, 0x06C8, 0xffff,0xffff}, -{ 0x8CC4, 0xFF80, 0xffff,0xffff}, -{ 0x8CC6, 0x050C, 0xffff,0xffff}, -{ 0x8CC8, 0xFF80, 0xffff,0xffff}, -{ 0x8CCA, 0x0158, 0xffff,0xffff}, -{ 0x8CCC, 0x8000, 0xffff,0xffff}, -{ 0x8CCE, 0x0008, 0xffff,0xffff}, -{ 0x8CD0, 0xFF80, 0xffff,0xffff}, -{ 0x8CD2, 0x10C8, 0xffff,0xffff}, -{ 0x8CD4, 0xC0F1, 0xffff,0xffff}, -{ 0x8CD6, 0x0D7E, 0xffff,0xffff}, -{ 0x8CD8, 0x0684, 0xffff,0xffff}, -{ 0x8CDA, 0x17C8, 0xffff,0xffff}, -{ 0x8CDC, 0xF00D, 0xffff,0xffff}, -{ 0x8CDE, 0x1545, 0xffff,0xffff}, -{ 0x8CE0, 0x1080, 0xffff,0xffff}, -{ 0x8CE2, 0x1546, 0xffff,0xffff}, -{ 0x8CE4, 0x1081, 0xffff,0xffff}, -{ 0x8CE6, 0xB808, 0xffff,0xffff}, -{ 0x8CE8, 0x7825, 0xffff,0xffff}, -{ 0x8CEA, 0xB8E0, 0xffff,0xffff}, -{ 0x8CEC, 0xDE00, 0xffff,0xffff}, -{ 0x8CEE, 0xF208, 0xffff,0xffff}, -{ 0x8CF0, 0x8D00, 0xffff,0xffff}, -{ 0x8CF2, 0x8D21, 0xffff,0xffff}, -{ 0x8CF4, 0xB808, 0xffff,0xffff}, -{ 0x8CF6, 0x7825, 0xffff,0xffff}, -{ 0x8CF8, 0x2044, 0xffff,0xffff}, -{ 0x8CFA, 0x020E, 0xffff,0xffff}, -{ 0x8CFC, 0x8D00, 0xffff,0xffff}, -{ 0x8CFE, 0x8D21, 0xffff,0xffff}, -{ 0x8D00, 0xB808, 0xffff,0xffff}, -{ 0x8D02, 0x7825, 0xffff,0xffff}, -{ 0x8D04, 0x082F, 0xffff,0xffff}, -{ 0x8D06, 0x00DE, 0xffff,0xffff}, -{ 0x8D08, 0x7108, 0xffff,0xffff}, -{ 0x8D0A, 0x2186, 0xffff,0xffff}, -{ 0x8D0C, 0x0FFE, 0xffff,0xffff}, -{ 0x8D0E, 0x262F, 0xffff,0xffff}, -{ 0x8D10, 0xF04A, 0xffff,0xffff}, -{ 0x8D12, 0xF211, 0xffff,0xffff}, -{ 0x8D14, 0x17BC, 0xffff,0xffff}, -{ 0x8D16, 0xF002, 0xffff,0xffff}, -{ 0x8D18, 0x8A25, 0xffff,0xffff}, -{ 0x8D1A, 0xE906, 0xffff,0xffff}, -{ 0x8D1C, 0xB961, 0xffff,0xffff}, -{ 0x8D1E, 0xAA25, 0xffff,0xffff}, -{ 0x8D20, 0xD806, 0xffff,0xffff}, -{ 0x8D22, 0xF01E, 0xffff,0xffff}, -{ 0x8D24, 0x8A24, 0xffff,0xffff}, -{ 0x8D26, 0xB8A3, 0xffff,0xffff}, -{ 0x8D28, 0xAA25, 0xffff,0xffff}, -{ 0x8D2A, 0x2841, 0xffff,0xffff}, -{ 0x8D2C, 0x0201, 0xffff,0xffff}, -{ 0x8D2E, 0xAD20, 0xffff,0xffff}, -{ 0x8D30, 0xAD01, 0xffff,0xffff}, -{ 0x8D32, 0x0D56, 0xffff,0xffff}, -{ 0x8D34, 0x0144, 0xffff,0xffff}, -{ 0x8D36, 0x1545, 0xffff,0xffff}, -{ 0x8D38, 0x1081, 0xffff,0xffff}, -{ 0x8D3A, 0x1546, 0xffff,0xffff}, -{ 0x8D3C, 0x1082, 0xffff,0xffff}, -{ 0x8D3E, 0xB908, 0xffff,0xffff}, -{ 0x8D40, 0x7945, 0xffff,0xffff}, -{ 0x8D42, 0xB9E0, 0xffff,0xffff}, -{ 0x8D44, 0x26CC, 0xffff,0xffff}, -{ 0x8D46, 0x9022, 0xffff,0xffff}, -{ 0x8D48, 0xF20A, 0xffff,0xffff}, -{ 0x8D4A, 0x8D20, 0xffff,0xffff}, -{ 0x8D4C, 0x8D41, 0xffff,0xffff}, -{ 0x8D4E, 0xB908, 0xffff,0xffff}, -{ 0x8D50, 0x7945, 0xffff,0xffff}, -{ 0x8D52, 0xB983, 0xffff,0xffff}, -{ 0x8D54, 0x2941, 0xffff,0xffff}, -{ 0x8D56, 0x0202, 0xffff,0xffff}, -{ 0x8D58, 0xAD40, 0xffff,0xffff}, -{ 0x8D5A, 0xAD21, 0xffff,0xffff}, -{ 0x8D5C, 0x0561, 0xffff,0xffff}, -{ 0x8D5E, 0x0684, 0xffff,0xffff}, -{ 0x8D60, 0xC0F1, 0xffff,0xffff}, -{ 0x8D62, 0x0CEE, 0xffff,0xffff}, -{ 0x8D64, 0x06A4, 0xffff,0xffff}, -{ 0x8D66, 0x7098, 0xffff,0xffff}, -{ 0x8D68, 0xD284, 0xffff,0xffff}, -{ 0x8D6A, 0x1206, 0xffff,0xffff}, -{ 0x8D6C, 0x0086, 0xffff,0xffff}, -{ 0x8D6E, 0x2240, 0xffff,0xffff}, -{ 0x8D70, 0x0205, 0xffff,0xffff}, -{ 0x8D72, 0x264C, 0xffff,0xffff}, -{ 0x8D74, 0x8000, 0xffff,0xffff}, -{ 0x8D76, 0x20CA, 0xffff,0xffff}, -{ 0x8D78, 0x0101, 0xffff,0xffff}, -{ 0x8D7A, 0xF237, 0xffff,0xffff}, -{ 0x8D7C, 0x8AA7, 0xffff,0xffff}, -{ 0x8D7E, 0x6D69, 0xffff,0xffff}, -{ 0x8D80, 0x7B6D, 0xffff,0xffff}, -{ 0x8D82, 0x0B3F, 0xffff,0xffff}, -{ 0x8D84, 0x0012, 0xffff,0xffff}, -{ 0x8D86, 0x7068, 0xffff,0xffff}, -{ 0x8D88, 0x780D, 0xffff,0xffff}, -{ 0x8D8A, 0x2040, 0xffff,0xffff}, -{ 0x8D8C, 0x007C, 0xffff,0xffff}, -{ 0x8D8E, 0x20A8, 0xffff,0xffff}, -{ 0x8D90, 0x0640, 0xffff,0xffff}, -{ 0x8D92, 0x71CF, 0xffff,0xffff}, -{ 0x8D94, 0xFF80, 0xffff,0xffff}, -{ 0x8D96, 0x0158, 0xffff,0xffff}, -{ 0x8D98, 0x8924, 0xffff,0xffff}, -{ 0x8D9A, 0x2532, 0xffff,0xffff}, -{ 0x8D9C, 0x00C0, 0xffff,0xffff}, -{ 0x8D9E, 0xBD61, 0xffff,0xffff}, -{ 0x8DA0, 0x0819, 0xffff,0xffff}, -{ 0x8DA2, 0x0063, 0xffff,0xffff}, -{ 0x8DA4, 0x7DAF, 0xffff,0xffff}, -{ 0x8DA6, 0x76CF, 0xffff,0xffff}, -{ 0x8DA8, 0xFF80, 0xffff,0xffff}, -{ 0x8DAA, 0x0290, 0xffff,0xffff}, -{ 0x8DAC, 0x8EF1, 0xffff,0xffff}, -{ 0x8DAE, 0x2640, 0xffff,0xffff}, -{ 0x8DB0, 0x1601, 0xffff,0xffff}, -{ 0x8DB2, 0x61E9, 0xffff,0xffff}, -{ 0x8DB4, 0x090F, 0xffff,0xffff}, -{ 0x8DB6, 0x0002, 0xffff,0xffff}, -{ 0x8DB8, 0xAAA7, 0xffff,0xffff}, -{ 0x8DBA, 0xBB61, 0xffff,0xffff}, -{ 0x8DBC, 0x7B6D, 0xffff,0xffff}, -{ 0x8DBE, 0x7088, 0xffff,0xffff}, -{ 0x8DC0, 0xF005, 0xffff,0xffff}, -{ 0x8DC2, 0x8E26, 0xffff,0xffff}, -{ 0x8DC4, 0xAAA7, 0xffff,0xffff}, -{ 0x8DC6, 0xB961, 0xffff,0xffff}, -{ 0x8DC8, 0xAE26, 0xffff,0xffff}, -{ 0x8DCA, 0x0B1F, 0xffff,0xffff}, -{ 0x8DCC, 0x0013, 0xffff,0xffff}, -{ 0x8DCE, 0x1A07, 0xffff,0xffff}, -{ 0x8DD0, 0x0182, 0xffff,0xffff}, -{ 0x8DD2, 0xD26B, 0xffff,0xffff}, -{ 0x8DD4, 0x8A20, 0xffff,0xffff}, -{ 0x8DD6, 0x8A61, 0xffff,0xffff}, -{ 0x8DD8, 0xB908, 0xffff,0xffff}, -{ 0x8DDA, 0x7965, 0xffff,0xffff}, -{ 0x8DDC, 0xB9A3, 0xffff,0xffff}, -{ 0x8DDE, 0x2941, 0xffff,0xffff}, -{ 0x8DE0, 0x020C, 0xffff,0xffff}, -{ 0x8DE2, 0xAA80, 0xffff,0xffff}, -{ 0x8DE4, 0xAA21, 0xffff,0xffff}, -{ 0x8DE6, 0x04D1, 0xffff,0xffff}, -{ 0x8DE8, 0x0684, 0xffff,0xffff}, -{ 0x8DEA, 0x78E0, 0xffff,0xffff}, -{ 0x8DEC, 0xC0F1, 0xffff,0xffff}, -{ 0x8DEE, 0xC5E1, 0xffff,0xffff}, -{ 0x8DF0, 0xD363, 0xffff,0xffff}, -{ 0x8DF2, 0x8B24, 0xffff,0xffff}, -{ 0x8DF4, 0x8B45, 0xffff,0xffff}, -{ 0x8DF6, 0xB908, 0xffff,0xffff}, -{ 0x8DF8, 0x7945, 0xffff,0xffff}, -{ 0x8DFA, 0xE188, 0xffff,0xffff}, -{ 0x8DFC, 0x21CC, 0xffff,0xffff}, -{ 0x8DFE, 0x8422, 0xffff,0xffff}, -{ 0x8E00, 0xF41F, 0xffff,0xffff}, -{ 0x8E02, 0x8B26, 0xffff,0xffff}, -{ 0x8E04, 0x093B, 0xffff,0xffff}, -{ 0x8E06, 0x0051, 0xffff,0xffff}, -{ 0x8E08, 0xD15C, 0xffff,0xffff}, -{ 0x8E0A, 0xD80A, 0xffff,0xffff}, -{ 0x8E0C, 0xA90E, 0xffff,0xffff}, -{ 0x8E0E, 0xD05D, 0xffff,0xffff}, -{ 0x8E10, 0x8804, 0xffff,0xffff}, -{ 0x8E12, 0x1330, 0xffff,0xffff}, -{ 0x8E14, 0x0082, 0xffff,0xffff}, -{ 0x8E16, 0x1331, 0xffff,0xffff}, -{ 0x8E18, 0x008D, 0xffff,0xffff}, -{ 0x8E1A, 0xBA08, 0xffff,0xffff}, -{ 0x8E1C, 0x7AA5, 0xffff,0xffff}, -{ 0x8E1E, 0xB148, 0xffff,0xffff}, -{ 0x8E20, 0x8952, 0xffff,0xffff}, -{ 0x8E22, 0xA90F, 0xffff,0xffff}, -{ 0x8E24, 0x0813, 0xffff,0xffff}, -{ 0x8E26, 0x00A2, 0xffff,0xffff}, -{ 0x8E28, 0x132C, 0xffff,0xffff}, -{ 0x8E2A, 0x0083, 0xffff,0xffff}, -{ 0x8E2C, 0xDA00, 0xffff,0xffff}, -{ 0x8E2E, 0xA953, 0xffff,0xffff}, -{ 0x8E30, 0x7862, 0xffff,0xffff}, -{ 0x8E32, 0x780F, 0xffff,0xffff}, -{ 0x8E34, 0xF005, 0xffff,0xffff}, -{ 0x8E36, 0xDA01, 0xffff,0xffff}, -{ 0x8E38, 0xA953, 0xffff,0xffff}, -{ 0x8E3A, 0x6078, 0xffff,0xffff}, -{ 0x8E3C, 0x780F, 0xffff,0xffff}, -{ 0x8E3E, 0x080E, 0xffff,0xffff}, -{ 0x8E40, 0x0000, 0xffff,0xffff}, -{ 0x8E42, 0x0485, 0xffff,0xffff}, -{ 0x8E44, 0x0684, 0xffff,0xffff}, -{ 0x8E46, 0x78E0, 0xffff,0xffff}, -{ 0x8E48, 0xC0F1, 0xffff,0xffff}, -{ 0x8E4A, 0x0BFE, 0xffff,0xffff}, -{ 0x8E4C, 0x0684, 0xffff,0xffff}, -{ 0x8E4E, 0xD64D, 0xffff,0xffff}, -{ 0x8E50, 0x7508, 0xffff,0xffff}, -{ 0x8E52, 0x8E01, 0xffff,0xffff}, -{ 0x8E54, 0xD14A, 0xffff,0xffff}, -{ 0x8E56, 0x2046, 0xffff,0xffff}, -{ 0x8E58, 0x00C0, 0xffff,0xffff}, -{ 0x8E5A, 0xAE01, 0xffff,0xffff}, -{ 0x8E5C, 0x1145, 0xffff,0xffff}, -{ 0x8E5E, 0x0080, 0xffff,0xffff}, -{ 0x8E60, 0x1146, 0xffff,0xffff}, -{ 0x8E62, 0x0082, 0xffff,0xffff}, -{ 0x8E64, 0xB808, 0xffff,0xffff}, -{ 0x8E66, 0x7845, 0xffff,0xffff}, -{ 0x8E68, 0x0817, 0xffff,0xffff}, -{ 0x8E6A, 0x001E, 0xffff,0xffff}, -{ 0x8E6C, 0x8900, 0xffff,0xffff}, -{ 0x8E6E, 0x8941, 0xffff,0xffff}, -{ 0x8E70, 0xB808, 0xffff,0xffff}, -{ 0x8E72, 0x7845, 0xffff,0xffff}, -{ 0x8E74, 0x080B, 0xffff,0xffff}, -{ 0x8E76, 0x00DE, 0xffff,0xffff}, -{ 0x8E78, 0x70A9, 0xffff,0xffff}, -{ 0x8E7A, 0xFFBA, 0xffff,0xffff}, -{ 0x8E7C, 0x7508, 0xffff,0xffff}, -{ 0x8E7E, 0x1604, 0xffff,0xffff}, -{ 0x8E80, 0x1090, 0xffff,0xffff}, -{ 0x8E82, 0x0D93, 0xffff,0xffff}, -{ 0x8E84, 0x1400, 0xffff,0xffff}, -{ 0x8E86, 0x8EEA, 0xffff,0xffff}, -{ 0x8E88, 0x8E0B, 0xffff,0xffff}, -{ 0x8E8A, 0x214A, 0xffff,0xffff}, -{ 0x8E8C, 0x2040, 0xffff,0xffff}, -{ 0x8E8E, 0x8E2D, 0xffff,0xffff}, -{ 0x8E90, 0xBF08, 0xffff,0xffff}, -{ 0x8E92, 0x7F05, 0xffff,0xffff}, -{ 0x8E94, 0x8E0C, 0xffff,0xffff}, -{ 0x8E96, 0xB808, 0xffff,0xffff}, -{ 0x8E98, 0x7825, 0xffff,0xffff}, -{ 0x8E9A, 0x7710, 0xffff,0xffff}, -{ 0x8E9C, 0x21C2, 0xffff,0xffff}, -{ 0x8E9E, 0x244C, 0xffff,0xffff}, -{ 0x8EA0, 0x081D, 0xffff,0xffff}, -{ 0x8EA2, 0x03E3, 0xffff,0xffff}, -{ 0x8EA4, 0xD9FF, 0xffff,0xffff}, -{ 0x8EA6, 0x2702, 0xffff,0xffff}, -{ 0x8EA8, 0x1002, 0xffff,0xffff}, -{ 0x8EAA, 0x2A05, 0xffff,0xffff}, -{ 0x8EAC, 0x037E, 0xffff,0xffff}, -{ 0x8EAE, 0x0C7A, 0xffff,0xffff}, -{ 0x8EB0, 0x06A4, 0xffff,0xffff}, -{ 0x8EB2, 0x702F, 0xffff,0xffff}, -{ 0x8EB4, 0x7810, 0xffff,0xffff}, -{ 0x8EB6, 0x7F02, 0xffff,0xffff}, -{ 0x8EB8, 0x7FF0, 0xffff,0xffff}, -{ 0x8EBA, 0xF00B, 0xffff,0xffff}, -{ 0x8EBC, 0x78E2, 0xffff,0xffff}, -{ 0x8EBE, 0x2805, 0xffff,0xffff}, -{ 0x8EC0, 0x037E, 0xffff,0xffff}, -{ 0x8EC2, 0x0C66, 0xffff,0xffff}, -{ 0x8EC4, 0x06A4, 0xffff,0xffff}, -{ 0x8EC6, 0x702F, 0xffff,0xffff}, -{ 0x8EC8, 0x7810, 0xffff,0xffff}, -{ 0x8ECA, 0x671F, 0xffff,0xffff}, -{ 0x8ECC, 0x7FF0, 0xffff,0xffff}, -{ 0x8ECE, 0x7FEF, 0xffff,0xffff}, -{ 0x8ED0, 0x8E08, 0xffff,0xffff}, -{ 0x8ED2, 0xBF06, 0xffff,0xffff}, -{ 0x8ED4, 0xD12C, 0xffff,0xffff}, -{ 0x8ED6, 0xB8C3, 0xffff,0xffff}, -{ 0x8ED8, 0x78E5, 0xffff,0xffff}, -{ 0x8EDA, 0xB88F, 0xffff,0xffff}, -{ 0x8EDC, 0x1908, 0xffff,0xffff}, -{ 0x8EDE, 0x0024, 0xffff,0xffff}, -{ 0x8EE0, 0x2841, 0xffff,0xffff}, -{ 0x8EE2, 0x0201, 0xffff,0xffff}, -{ 0x8EE4, 0x1E26, 0xffff,0xffff}, -{ 0x8EE6, 0x1042, 0xffff,0xffff}, -{ 0x8EE8, 0x0D15, 0xffff,0xffff}, -{ 0x8EEA, 0x1423, 0xffff,0xffff}, -{ 0x8EEC, 0x1E27, 0xffff,0xffff}, -{ 0x8EEE, 0x1002, 0xffff,0xffff}, -{ 0x8EF0, 0x214C, 0xffff,0xffff}, -{ 0x8EF2, 0xA000, 0xffff,0xffff}, -{ 0x8EF4, 0x214A, 0xffff,0xffff}, -{ 0x8EF6, 0x2040, 0xffff,0xffff}, -{ 0x8EF8, 0x21C2, 0xffff,0xffff}, -{ 0x8EFA, 0x2442, 0xffff,0xffff}, -{ 0x8EFC, 0x8E21, 0xffff,0xffff}, -{ 0x8EFE, 0x214F, 0xffff,0xffff}, -{ 0x8F00, 0x0040, 0xffff,0xffff}, -{ 0x8F02, 0x090F, 0xffff,0xffff}, -{ 0x8F04, 0x2010, 0xffff,0xffff}, -{ 0x8F06, 0x2145, 0xffff,0xffff}, -{ 0x8F08, 0x0181, 0xffff,0xffff}, -{ 0x8F0A, 0xAE21, 0xffff,0xffff}, -{ 0x8F0C, 0xF003, 0xffff,0xffff}, -{ 0x8F0E, 0xB8A2, 0xffff,0xffff}, -{ 0x8F10, 0xAE01, 0xffff,0xffff}, -{ 0x8F12, 0x0FFE, 0xffff,0xffff}, -{ 0x8F14, 0xFFA3, 0xffff,0xffff}, -{ 0x8F16, 0x70A9, 0xffff,0xffff}, -{ 0x8F18, 0x038D, 0xffff,0xffff}, -{ 0x8F1A, 0x0684, 0xffff,0xffff}, -{ 0x8F1C, 0xC0F1, 0xffff,0xffff}, -{ 0x8F1E, 0xC5E1, 0xffff,0xffff}, -{ 0x8F20, 0xD518, 0xffff,0xffff}, -{ 0x8F22, 0x8D00, 0xffff,0xffff}, -{ 0x8F24, 0xB8E7, 0xffff,0xffff}, -{ 0x8F26, 0x20D1, 0xffff,0xffff}, -{ 0x8F28, 0x80E2, 0xffff,0xffff}, -{ 0x8F2A, 0xF20D, 0xffff,0xffff}, -{ 0x8F2C, 0xD117, 0xffff,0xffff}, -{ 0x8F2E, 0xB8A7, 0xffff,0xffff}, -{ 0x8F30, 0xAD00, 0xffff,0xffff}, -{ 0x8F32, 0xD017, 0xffff,0xffff}, -{ 0x8F34, 0x7228, 0xffff,0xffff}, -{ 0x8F36, 0x8123, 0xffff,0xffff}, -{ 0x8F38, 0xA040, 0xffff,0xffff}, -{ 0x8F3A, 0x7960, 0xffff,0xffff}, -{ 0x8F3C, 0xD801, 0xffff,0xffff}, -{ 0x8F3E, 0xD800, 0xffff,0xffff}, -{ 0x8F40, 0xAD05, 0xffff,0xffff}, -{ 0x8F42, 0x0F56, 0xffff,0xffff}, -{ 0x8F44, 0xFF83, 0xffff,0xffff}, -{ 0x8F46, 0x0381, 0xffff,0xffff}, -{ 0x8F48, 0x0684, 0xffff,0xffff}, -{ 0x8F4A, 0x78E0, 0xffff,0xffff}, -{ 0x8F4C, 0xD20D, 0xffff,0xffff}, -{ 0x8F4E, 0x8A21, 0xffff,0xffff}, -{ 0x8F50, 0xB9A1, 0xffff,0xffff}, -{ 0x8F52, 0x782F, 0xffff,0xffff}, -{ 0x8F54, 0x7FE0, 0xffff,0xffff}, -{ 0x8F56, 0xAA21, 0xffff,0xffff}, -{ 0x8F58, 0xD00E, 0xffff,0xffff}, -{ 0x8F5A, 0xD10C, 0xffff,0xffff}, -{ 0x8F5C, 0xA100, 0xffff,0xffff}, -{ 0x8F5E, 0xD00E, 0xffff,0xffff}, -{ 0x8F60, 0xA101, 0xffff,0xffff}, -{ 0x8F62, 0xD00E, 0xffff,0xffff}, -{ 0x8F64, 0xA102, 0xffff,0xffff}, -{ 0x8F66, 0xD00E, 0xffff,0xffff}, -{ 0x8F68, 0xA103, 0xffff,0xffff}, -{ 0x8F6A, 0xD009, 0xffff,0xffff}, -{ 0x8F6C, 0xA020, 0xffff,0xffff}, -{ 0x8F6E, 0xD005, 0xffff,0xffff}, -{ 0x8F70, 0xD988, 0xffff,0xffff}, -{ 0x8F72, 0xA820, 0xffff,0xffff}, -{ 0x8F74, 0xF1D4, 0xffff,0xffff}, -{ 0x8F76, 0x78E0, 0xffff,0xffff}, -{ 0x8F78, 0xFF80, 0xffff,0xffff}, -{ 0x8F7A, 0x10C8, 0xffff,0xffff}, -{ 0x8F7C, 0xFF80, 0xffff,0xffff}, -{ 0x8F7E, 0x0290, 0xffff,0xffff}, -{ 0x8F80, 0xFF80, 0xffff,0xffff}, -{ 0x8F82, 0x0158, 0xffff,0xffff}, -{ 0x8F84, 0xFF00, 0xffff,0xffff}, -{ 0x8F86, 0x0618, 0xffff,0xffff}, -{ 0x8F88, 0xFF80, 0xffff,0xffff}, -{ 0x8F8A, 0x1158, 0xffff,0xffff}, -{ 0x8F8C, 0x8000, 0xffff,0xffff}, -{ 0x8F8E, 0x0008, 0xffff,0xffff}, -{ 0x8F90, 0xFF80, 0xffff,0xffff}, -{ 0x8F92, 0x0F1C, 0xffff,0xffff}, -{ 0x8F94, 0xFF80, 0xffff,0xffff}, -{ 0x8F96, 0x0DEC, 0xffff,0xffff}, -{ 0x8F98, 0xFF80, 0xffff,0xffff}, -{ 0x8F9A, 0x0F4C, 0xffff,0xffff}, -{ 0x8F9C, 0x0000, 0xffff,0xffff}, -{ 0x8F9E, 0x0998, 0xffff,0xffff}, -{ 0x8FA0, 0xC0F1, 0xffff,0xffff}, -{ 0x8FA2, 0xC5E1, 0xffff,0xffff}, -{ 0x8FA4, 0xD02C, 0xffff,0xffff}, -{ 0x8FA6, 0x0982, 0xffff,0xffff}, -{ 0x8FA8, 0x0664, 0xffff,0xffff}, -{ 0x8FAA, 0x88AE, 0xffff,0xffff}, -{ 0x8FAC, 0x0D23, 0xffff,0xffff}, -{ 0x8FAE, 0x1051, 0xffff,0xffff}, -{ 0x8FB0, 0xD12A, 0xffff,0xffff}, -{ 0x8FB2, 0x1145, 0xffff,0xffff}, -{ 0x8FB4, 0x0080, 0xffff,0xffff}, -{ 0x8FB6, 0x1146, 0xffff,0xffff}, -{ 0x8FB8, 0x0082, 0xffff,0xffff}, -{ 0x8FBA, 0xB808, 0xffff,0xffff}, -{ 0x8FBC, 0x7845, 0xffff,0xffff}, -{ 0x8FBE, 0x0813, 0xffff,0xffff}, -{ 0x8FC0, 0x00DE, 0xffff,0xffff}, -{ 0x8FC2, 0xD027, 0xffff,0xffff}, -{ 0x8FC4, 0x8000, 0xffff,0xffff}, -{ 0x8FC6, 0x8041, 0xffff,0xffff}, -{ 0x8FC8, 0x7A60, 0xffff,0xffff}, -{ 0x8FCA, 0x1150, 0xffff,0xffff}, -{ 0x8FCC, 0x0080, 0xffff,0xffff}, -{ 0x8FCE, 0x02F9, 0xffff,0xffff}, -{ 0x8FD0, 0x0684, 0xffff,0xffff}, -{ 0x8FD2, 0x78E0, 0xffff,0xffff}, -{ 0x8FD4, 0xC0F1, 0xffff,0xffff}, -{ 0x8FD6, 0x0A7E, 0xffff,0xffff}, -{ 0x8FD8, 0x0684, 0xffff,0xffff}, -{ 0x8FDA, 0xD622, 0xffff,0xffff}, -{ 0x8FDC, 0x8EA9, 0xffff,0xffff}, -{ 0x8FDE, 0x8E2A, 0xffff,0xffff}, -{ 0x8FE0, 0xBD08, 0xffff,0xffff}, -{ 0x8FE2, 0x7D25, 0xffff,0xffff}, -{ 0x8FE4, 0x2550, 0xffff,0xffff}, -{ 0x8FE6, 0x10C2, 0xffff,0xffff}, -{ 0x8FE8, 0x2A41, 0xffff,0xffff}, -{ 0x8FEA, 0x0201, 0xffff,0xffff}, -{ 0x8FEC, 0xAE29, 0xffff,0xffff}, -{ 0x8FEE, 0x0F9A, 0xffff,0xffff}, -{ 0x8FF0, 0x05A4, 0xffff,0xffff}, -{ 0x8FF2, 0xAE4A, 0xffff,0xffff}, -{ 0x8FF4, 0x0D17, 0xffff,0xffff}, -{ 0x8FF6, 0x10DE, 0xffff,0xffff}, -{ 0x8FF8, 0x8E09, 0xffff,0xffff}, -{ 0x8FFA, 0x8E2A, 0xffff,0xffff}, -{ 0x8FFC, 0xB808, 0xffff,0xffff}, -{ 0x8FFE, 0x7825, 0xffff,0xffff}, -{ 0x9000, 0xB883, 0xffff,0xffff}, -{ 0x9002, 0x2841, 0xffff,0xffff}, -{ 0x9004, 0x0201, 0xffff,0xffff}, -{ 0x9006, 0xAE29, 0xffff,0xffff}, -{ 0x9008, 0xAE0A, 0xffff,0xffff}, -{ 0x900A, 0x02B5, 0xffff,0xffff}, -{ 0x900C, 0x0684, 0xffff,0xffff}, -{ 0x900E, 0x78E0, 0xffff,0xffff}, -{ 0x9010, 0xC0F1, 0xffff,0xffff}, -{ 0x9012, 0x0A42, 0xffff,0xffff}, -{ 0x9014, 0x06A4, 0xffff,0xffff}, -{ 0x9016, 0xDA34, 0xffff,0xffff}, -{ 0x9018, 0xD113, 0xffff,0xffff}, -{ 0x901A, 0xD514, 0xffff,0xffff}, -{ 0x901C, 0x76A9, 0xffff,0xffff}, -{ 0x901E, 0x0FD6, 0xffff,0xffff}, -{ 0x9020, 0x0664, 0xffff,0xffff}, -{ 0x9022, 0x70C9, 0xffff,0xffff}, -{ 0x9024, 0xD012, 0xffff,0xffff}, -{ 0x9026, 0xA504, 0xffff,0xffff}, -{ 0x9028, 0xD012, 0xffff,0xffff}, -{ 0x902A, 0x0295, 0xffff,0xffff}, -{ 0x902C, 0x06A4, 0xffff,0xffff}, -{ 0x902E, 0xA0C0, 0xffff,0xffff}, -{ 0x9030, 0xC0F1, 0xffff,0xffff}, -{ 0x9032, 0xC5E1, 0xffff,0xffff}, -{ 0x9034, 0xD50D, 0xffff,0xffff}, -{ 0x9036, 0xD110, 0xffff,0xffff}, -{ 0x9038, 0x2540, 0xffff,0xffff}, -{ 0x903A, 0x1D00, 0xffff,0xffff}, -{ 0x903C, 0x0FB6, 0xffff,0xffff}, -{ 0x903E, 0x0664, 0xffff,0xffff}, -{ 0x9040, 0xDA50, 0xffff,0xffff}, -{ 0x9042, 0xD00E, 0xffff,0xffff}, -{ 0x9044, 0x2540, 0xffff,0xffff}, -{ 0x9046, 0x1D01, 0xffff,0xffff}, -{ 0x9048, 0xA517, 0xffff,0xffff}, -{ 0x904A, 0xD00D, 0xffff,0xffff}, -{ 0x904C, 0x0279, 0xffff,0xffff}, -{ 0x904E, 0x06A4, 0xffff,0xffff}, -{ 0x9050, 0xA020, 0xffff,0xffff}, -{ 0x9052, 0x78E0, 0xffff,0xffff}, -{ 0x9054, 0xFF80, 0xffff,0xffff}, -{ 0x9056, 0x07A8, 0xffff,0xffff}, -{ 0x9058, 0xFF80, 0xffff,0xffff}, -{ 0x905A, 0x0290, 0xffff,0xffff}, -{ 0x905C, 0x8000, 0xffff,0xffff}, -{ 0x905E, 0x0008, 0xffff,0xffff}, -{ 0x9060, 0xFF80, 0xffff,0xffff}, -{ 0x9062, 0x02CC, 0xffff,0xffff}, -{ 0x9064, 0x0000, 0xffff,0xffff}, -{ 0x9066, 0xFA88, 0xffff,0xffff}, -{ 0x9068, 0xFF80, 0xffff,0xffff}, -{ 0x906A, 0x1168, 0xffff,0xffff}, -{ 0x906C, 0xFF80, 0xffff,0xffff}, -{ 0x906E, 0x0FD4, 0xffff,0xffff}, -{ 0x9070, 0x8000, 0xffff,0xffff}, -{ 0x9072, 0x0194, 0xffff,0xffff}, -{ 0x9074, 0x0000, 0xffff,0xffff}, -{ 0x9076, 0xFB08, 0xffff,0xffff}, -{ 0x9078, 0xFF80, 0xffff,0xffff}, -{ 0x907A, 0x0FA0, 0xffff,0xffff}, -{ 0x907C, 0x8000, 0xffff,0xffff}, -{ 0x907E, 0x01A0, 0xffff,0xffff}, -{ 0x9080, 0xE280, 0xffff,0xffff}, -{ 0x9082, 0x24CA, 0xffff,0xffff}, -{ 0x9084, 0x7082, 0xffff,0xffff}, -{ 0x9086, 0x78E0, 0xffff,0xffff}, -{ 0x9088, 0x20E8, 0xffff,0xffff}, -{ 0x908A, 0x01A2, 0xffff,0xffff}, -{ 0x908C, 0x1002, 0xffff,0xffff}, -{ 0x908E, 0x0D02, 0xffff,0xffff}, -{ 0x9090, 0x1902, 0xffff,0xffff}, -{ 0x9092, 0x0094, 0xffff,0xffff}, -{ 0x9094, 0x7FE0, 0xffff,0xffff}, -{ 0x9096, 0x7028, 0xffff,0xffff}, -{ 0x9098, 0x7308, 0xffff,0xffff}, -{ 0x909A, 0x1000, 0xffff,0xffff}, -{ 0x909C, 0x0900, 0xffff,0xffff}, -{ 0x909E, 0x7904, 0xffff,0xffff}, -{ 0x90A0, 0x7947, 0xffff,0xffff}, -{ 0x90A2, 0x1B00, 0xffff,0xffff}, -{ 0x90A4, 0x0064, 0xffff,0xffff}, -{ 0x90A6, 0x7EE0, 0xffff,0xffff}, -{ 0x90A8, 0xE280, 0xffff,0xffff}, -{ 0x90AA, 0x24CA, 0xffff,0xffff}, -{ 0x90AC, 0x7082, 0xffff,0xffff}, -{ 0x90AE, 0x78E0, 0xffff,0xffff}, -{ 0x90B0, 0x20E8, 0xffff,0xffff}, -{ 0x90B2, 0x01A2, 0xffff,0xffff}, -{ 0x90B4, 0x1102, 0xffff,0xffff}, -{ 0x90B6, 0x0502, 0xffff,0xffff}, -{ 0x90B8, 0x1802, 0xffff,0xffff}, -{ 0x90BA, 0x00B4, 0xffff,0xffff}, -{ 0x90BC, 0x7FE0, 0xffff,0xffff}, -{ 0x90BE, 0x7028, 0xffff,0xffff}, -{ 0x90C0, 0x0000, 0xffff,0xffff}, -{ 0x90C2, 0x0000, 0xffff,0xffff}, -{ 0x90C4, 0x0000, 0xffff,0xffff}, -{ 0x90C6, 0x0000, 0xffff,0xffff}, -{ 0x098E, 0x0000, 0xffff,0xffff}, // LOGICAL_ADDRESS_ACCESS -{ 0x8016, 0x086C, 0xffff,0xffff}, // MON_ADDRESS_LO -{ 0x8018, 0xFF80, 0xffff,0xffff}, // MON_ADDRESS_HI -{ 0x8002, 0x0001, 0xffff,0xffff}, // MON_CMD -//delay = 100 -SensorWaitMs(100), -//[Lens Correction 90% 02/04/13 18:03:18] -//BITFIELD= 0x3210, 0x0008, 0 //PGA_ENABLE -{ 0x3210, 0x0008, 0xffff,0xffff}, -{ 0x3210, 0x49B0, 0xffff,0xffff}, // COLOR_PIPELINE_CONTROL -{ 0x3640, 0x0170, 0xffff,0xffff}, // P_G1_P0Q0 -{ 0x3642, 0x0BCC, 0xffff,0xffff}, // P_G1_P0Q1 -{ 0x3644, 0x7210, 0xffff,0xffff}, // P_G1_P0Q2 -{ 0x3646, 0x4C8D, 0xffff,0xffff}, // P_G1_P0Q3 -{ 0x3648, 0xF58D, 0xffff,0xffff}, // P_G1_P0Q4 -{ 0x364A, 0x0610, 0xffff,0xffff}, // P_R_P0Q0 -{ 0x364C, 0x8D6E, 0xffff,0xffff}, // P_R_P0Q1 -{ 0x364E, 0x6E90, 0xffff,0xffff}, // P_R_P0Q2 -{ 0x3650, 0x088F, 0xffff,0xffff}, // P_R_P0Q3 -{ 0x3652, 0xA890, 0xffff,0xffff}, // P_R_P0Q4 -{ 0x3654, 0x0550, 0xffff,0xffff}, // P_B_P0Q0 -{ 0x3656, 0x764C, 0xffff,0xffff}, // P_B_P0Q1 -{ 0x3658, 0x0FB0, 0xffff,0xffff}, // P_B_P0Q2 -{ 0x365A, 0x9A0D, 0xffff,0xffff}, // P_B_P0Q3 -{ 0x365C, 0xF4AD, 0xffff,0xffff}, // P_B_P0Q4 -{ 0x365E, 0x02F0, 0xffff,0xffff}, // P_G2_P0Q0 -{ 0x3660, 0x9A0E, 0xffff,0xffff}, // P_G2_P0Q1 -{ 0x3662, 0x77B0, 0xffff,0xffff}, // P_G2_P0Q2 -{ 0x3664, 0x416D, 0xffff,0xffff}, // P_G2_P0Q3 -{ 0x3666, 0xF24D, 0xffff,0xffff}, // P_G2_P0Q4 -{ 0x3680, 0x018A, 0xffff,0xffff}, // P_G1_P1Q0 -{ 0x3682, 0xD0AD, 0xffff,0xffff}, // P_G1_P1Q1 -{ 0x3684, 0xC62E, 0xffff,0xffff}, // P_G1_P1Q2 -{ 0x3686, 0x736D, 0xffff,0xffff}, // P_G1_P1Q3 -{ 0x3688, 0x0130, 0xffff,0xffff}, // P_G1_P1Q4 -{ 0x368A, 0x52ED, 0xffff,0xffff}, // P_R_P1Q0 -{ 0x368C, 0x682D, 0xffff,0xffff}, // P_R_P1Q1 -{ 0x368E, 0xF02B, 0xffff,0xffff}, // P_R_P1Q2 -{ 0x3690, 0xB68E, 0xffff,0xffff}, // P_R_P1Q3 -{ 0x3692, 0xF4AD, 0xffff,0xffff}, // P_R_P1Q4 -{ 0x3694, 0xC68D, 0xffff,0xffff}, // P_B_P1Q0 -{ 0x3696, 0x440D, 0xffff,0xffff}, // P_B_P1Q1 -{ 0x3698, 0x416E, 0xffff,0xffff}, // P_B_P1Q2 -{ 0x369A, 0xC0CE, 0xffff,0xffff}, // P_B_P1Q3 -{ 0x369C, 0xB46D, 0xffff,0xffff}, // P_B_P1Q4 -{ 0x369E, 0xD90A, 0xffff,0xffff}, // P_G2_P1Q0 -{ 0x36A0, 0xD76D, 0xffff,0xffff}, // P_G2_P1Q1 -{ 0x36A2, 0xFE0D, 0xffff,0xffff}, // P_G2_P1Q2 -{ 0x36A4, 0x0E0D, 0xffff,0xffff}, // P_G2_P1Q3 -{ 0x36A6, 0x0890, 0xffff,0xffff}, // P_G2_P1Q4 -{ 0x36C0, 0x70D0, 0xffff,0xffff}, // P_G1_P2Q0 -{ 0x36C2, 0x10CF, 0xffff,0xffff}, // P_G1_P2Q1 -{ 0x36C4, 0x4592, 0xffff,0xffff}, // P_G1_P2Q2 -{ 0x36C6, 0xB74D, 0xffff,0xffff}, // P_G1_P2Q3 -{ 0x36C8, 0xEEB3, 0xffff,0xffff}, // P_G1_P2Q4 -{ 0x36CA, 0x1991, 0xffff,0xffff}, // P_R_P2Q0 -{ 0x36CC, 0x9B8E, 0xffff,0xffff}, // P_R_P2Q1 -{ 0x36CE, 0x5DCD, 0xffff,0xffff}, // P_R_P2Q2 -{ 0x36D0, 0x1C8D, 0xffff,0xffff}, // P_R_P2Q3 -{ 0x36D2, 0x8C71, 0xffff,0xffff}, // P_R_P2Q4 -{ 0x36D4, 0x00F1, 0xffff,0xffff}, // P_B_P2Q0 -{ 0x36D6, 0x480F, 0xffff,0xffff}, // P_B_P2Q1 -{ 0x36D8, 0x26AF, 0xffff,0xffff}, // P_B_P2Q2 -{ 0x36DA, 0xC2EF, 0xffff,0xffff}, // P_B_P2Q3 -{ 0x36DC, 0xFC8F, 0xffff,0xffff}, // P_B_P2Q4 -{ 0x36DE, 0x0071, 0xffff,0xffff}, // P_G2_P2Q0 -{ 0x36E0, 0x8230, 0xffff,0xffff}, // P_G2_P2Q1 -{ 0x36E2, 0x60B2, 0xffff,0xffff}, // P_G2_P2Q2 -{ 0x36E4, 0x3E51, 0xffff,0xffff}, // P_G2_P2Q3 -{ 0x36E6, 0x8C74, 0xffff,0xffff}, // P_G2_P2Q4 -{ 0x3700, 0x492E, 0xffff,0xffff}, // P_G1_P3Q0 -{ 0x3702, 0x7FAD, 0xffff,0xffff}, // P_G1_P3Q1 -{ 0x3704, 0x93CE, 0xffff,0xffff}, // P_G1_P3Q2 -{ 0x3706, 0xC86F, 0xffff,0xffff}, // P_G1_P3Q3 -{ 0x3708, 0xC830, 0xffff,0xffff}, // P_G1_P3Q4 -{ 0x370A, 0x610E, 0xffff,0xffff}, // P_R_P3Q0 -{ 0x370C, 0x8EC8, 0xffff,0xffff}, // P_R_P3Q1 -{ 0x370E, 0xA930, 0xffff,0xffff}, // P_R_P3Q2 -{ 0x3710, 0xE88D, 0xffff,0xffff}, // P_R_P3Q3 -{ 0x3712, 0x2B51, 0xffff,0xffff}, // P_R_P3Q4 -{ 0x3714, 0xDECD, 0xffff,0xffff}, // P_B_P3Q0 -{ 0x3716, 0xBD8E, 0xffff,0xffff}, // P_B_P3Q1 -{ 0x3718, 0x2E50, 0xffff,0xffff}, // P_B_P3Q2 -{ 0x371A, 0x60AF, 0xffff,0xffff}, // P_B_P3Q3 -{ 0x371C, 0xBB11, 0xffff,0xffff}, // P_B_P3Q4 -{ 0x371E, 0x22CB, 0xffff,0xffff}, // P_G2_P3Q0 -{ 0x3720, 0xEEEC, 0xffff,0xffff}, // P_G2_P3Q1 -{ 0x3722, 0x0251, 0xffff,0xffff}, // P_G2_P3Q2 -{ 0x3724, 0x142D, 0xffff,0xffff}, // P_G2_P3Q3 -{ 0x3726, 0xE271, 0xffff,0xffff}, // P_G2_P3Q4 -{ 0x3740, 0x1D10, 0xffff,0xffff}, // P_G1_P4Q0 -{ 0x3742, 0xE94F, 0xffff,0xffff}, // P_G1_P4Q1 -{ 0x3744, 0x8735, 0xffff,0xffff}, // P_G1_P4Q2 -{ 0x3746, 0xC2CC, 0xffff,0xffff}, // P_G1_P4Q3 -{ 0x3748, 0x23F6, 0xffff,0xffff}, // P_G1_P4Q4 -{ 0x374A, 0xE90F, 0xffff,0xffff}, // P_R_P4Q0 -{ 0x374C, 0x1A30, 0xffff,0xffff}, // P_R_P4Q1 -{ 0x374E, 0xAEF3, 0xffff,0xffff}, // P_R_P4Q2 -{ 0x3750, 0xB2F2, 0xffff,0xffff}, // P_R_P4Q3 -{ 0x3752, 0x2195, 0xffff,0xffff}, // P_R_P4Q4 -{ 0x3754, 0xFFEE, 0xffff,0xffff}, // P_B_P4Q0 -{ 0x3756, 0xD8D0, 0xffff,0xffff}, // P_B_P4Q1 -{ 0x3758, 0xCC92, 0xffff,0xffff}, // P_B_P4Q2 -{ 0x375A, 0x0451, 0xffff,0xffff}, // P_B_P4Q3 -{ 0x375C, 0x5814, 0xffff,0xffff}, // P_B_P4Q4 -{ 0x375E, 0x2470, 0xffff,0xffff}, // P_G2_P4Q0 -{ 0x3760, 0x6151, 0xffff,0xffff}, // P_G2_P4Q1 -{ 0x3762, 0x9555, 0xffff,0xffff}, // P_G2_P4Q2 -{ 0x3764, 0xD5D3, 0xffff,0xffff}, // P_G2_P4Q3 -{ 0x3766, 0x3B56, 0xffff,0xffff}, // P_G2_P4Q4 -{ 0x3782, 0x03DC, 0xffff,0xffff}, // CENTER_ROW -{ 0x3784, 0x04E0, 0xffff,0xffff}, // CENTER_COLUMN -{ 0x3210, 0x49B8, 0xffff,0xffff}, // COLOR_PIPELINE_CONTROL -//BITFIELD= 0x3210, 0x0008, 1 //PGA_ENABLE -//{ 0x3210, 0x0008, 0xffff,0xffff}, - - - -//[*********Step6************] -//[Step6-AWB_CCM] -//[AWB_setup] - -{ 0xAC01, 0xBB, 0xffff,0xff}, // AWB_MODE -//[CCM] -{ 0xAC46, 0x0221, 0xffff,0xffff}, // AWB_LEFT_CCM_0 -{ 0xAC48, 0xFEAE, 0xffff,0xffff}, // AWB_LEFT_CCM_1 -{ 0xAC4A, 0x0032, 0xffff,0xffff}, // AWB_LEFT_CCM_2 -{ 0xAC4C, 0xFFC5, 0xffff,0xffff}, // AWB_LEFT_CCM_3 -{ 0xAC4E, 0x0154, 0xffff,0xffff}, // AWB_LEFT_CCM_4 -{ 0xAC50, 0xFFE7, 0xffff,0xffff}, // AWB_LEFT_CCM_5 -{ 0xAC52, 0xFFB1, 0xffff,0xffff}, // AWB_LEFT_CCM_6 -{ 0xAC54, 0xFEC5, 0xffff,0xffff}, // AWB_LEFT_CCM_7 -{ 0xAC56, 0x028A, 0xffff,0xffff}, // AWB_LEFT_CCM_8 -{ 0xAC58, 0x00C6, 0xffff,0xffff}, // AWB_LEFT_CCM_R2BRATIO -{ 0xAC5C, 0x01CD, 0xffff,0xffff}, // AWB_RIGHT_CCM_0 -{ 0xAC5E, 0xFF63, 0xffff,0xffff}, // AWB_RIGHT_CCM_1 -{ 0xAC60, 0xFFD0, 0xffff,0xffff}, // AWB_RIGHT_CCM_2 -{ 0xAC62, 0xFFCD, 0xffff,0xffff}, // AWB_RIGHT_CCM_3 -{ 0xAC64, 0x013B, 0xffff,0xffff}, // AWB_RIGHT_CCM_4 -{ 0xAC66, 0xFFF8, 0xffff,0xffff}, // AWB_RIGHT_CCM_5 -{ 0xAC68, 0xFFFB, 0xffff,0xffff}, // AWB_RIGHT_CCM_6 -{ 0xAC6A, 0xFF78, 0xffff,0xffff}, // AWB_RIGHT_CCM_7 -{ 0xAC6C, 0x018D, 0xffff,0xffff}, // AWB_RIGHT_CCM_8 -{ 0xAC6E, 0x0055, 0xffff,0xffff}, // AWB_RIGHT_CCM_R2BRATIO - -//[AWB] -{ 0xB842, 0x0037, 0xffff,0xffff}, // STAT_AWB_GRAY_CHECKER_OFFSET_X -{ 0xB844, 0x0044, 0xffff,0xffff}, // STAT_AWB_GRAY_CHECKER_OFFSET_Y -{ 0x3240, 0x0024, 0xffff,0xffff}, // AWB_XY_SCALE -{ 0x3240, 0x0024, 0xffff,0xffff}, // AWB_XY_SCALE -{ 0x3242, 0x0000, 0xffff,0xffff}, // AWB_WEIGHT_R0 -{ 0x3244, 0x0000, 0xffff,0xffff}, // AWB_WEIGHT_R1 -{ 0x3246, 0x0000, 0xffff,0xffff}, // AWB_WEIGHT_R2 -{ 0x3248, 0x7F00, 0xffff,0xffff}, // AWB_WEIGHT_R3 -{ 0x324A, 0xA500, 0xffff,0xffff}, // AWB_WEIGHT_R4 -{ 0x324C, 0x1540, 0xffff,0xffff}, // AWB_WEIGHT_R5 -{ 0x324E, 0x01AC, 0xffff,0xffff}, // AWB_WEIGHT_R6 -{ 0x3250, 0x003E, 0xffff,0xffff}, // AWB_WEIGHT_R7 - -//[Preawb_params] -{ 0xACB0, 0x32, 0xffff,0xff}, // AWB_RG_MIN -{ 0xACB1, 0x5A, 0xffff,0xff}, // AWB_RG_MAX -{ 0xACB2, 0x32, 0xffff,0xff}, // AWB_RG_MIN_BRIGHT -{ 0xACB3, 0x5A, 0xffff,0xff}, // AWB_RG_MAX_BRIGHT -{ 0xACB4, 0x23, 0xffff,0xff}, // AWB_BG_MIN -{ 0xACB5, 0x55, 0xffff,0xff}, // AWB_BG_MAX -{ 0xACB6, 0x49, 0xffff,0xff}, // AWB_BG_MIN_BRIGHT -{ 0xACB7, 0x55, 0xffff,0xff}, // AWB_BG_MAX_BRIGHT - -//[**********Step7*************] -//[Step7-CPIPE_Calibration] - -//[jpeg_setup] - -{ 0xD80F, 0x04, 0xffff,0xff}, // JPEG_QSCALE_0 -{ 0xD810, 0x08, 0xffff,0xff}, // JPEG_QSCALE_1 -{ 0xC8D2, 0x04, 0xffff,0xff}, // CAM_OUTPUT_1_JPEG_QSCALE_0 -{ 0xC8D3, 0x08, 0xffff,0xff}, // CAM_OUTPUT_1_JPEG_QSCALE_1 -{ 0xC8BC, 0x04, 0xffff,0xff}, // CAM_OUTPUT_0_JPEG_QSCALE_0 -{ 0xC8BD, 0x08, 0xffff,0xff}, // CAM_OUTPUT_0_JPEG_QSCALE_1 - -//[Sys_Settings] -{ 0xDC35, 0x04, 0xffff,0xff}, // SYS_UV_COLOR_BOOST -{ 0x326E, 0x0006, 0xffff,0xffff}, // RESERVED_SOC1_326E -{ 0xDC37, 0x62, 0xffff,0xff}, // SYS_BRIGHT_COLORKILL -{ 0x35A4, 0x0596, 0xffff,0xffff}, // BRIGHT_COLOR_KILL_CONTROLS -{ 0x35A2, 0x0094, 0xffff,0xffff}, // DARK_COLOR_KILL_CONTROLS -{ 0xDC36, 0x23, 0xffff,0xff}, // SYS_DARK_COLOR_KILL - -//[Gamma_Curves_REV3] -{ 0xBC18, 0x00, 0xffff,0xff}, // LL_GAMMA_CONTRAST_CURVE_0 -{ 0xBC19, 0x11, 0xffff,0xff}, // LL_GAMMA_CONTRAST_CURVE_1 -{ 0xBC1A, 0x23, 0xffff,0xff}, // LL_GAMMA_CONTRAST_CURVE_2 -{ 0xBC1B, 0x3F, 0xffff,0xff}, // LL_GAMMA_CONTRAST_CURVE_3 -{ 0xBC1C, 0x67, 0xffff,0xff}, // LL_GAMMA_CONTRAST_CURVE_4 -{ 0xBC1D, 0x85, 0xffff,0xff}, // LL_GAMMA_CONTRAST_CURVE_5 -{ 0xBC1E, 0x9B, 0xffff,0xff}, // LL_GAMMA_CONTRAST_CURVE_6 -{ 0xBC1F, 0xAD, 0xffff,0xff}, // LL_GAMMA_CONTRAST_CURVE_7 -{ 0xBC20, 0xBB, 0xffff,0xff}, // LL_GAMMA_CONTRAST_CURVE_8 -{ 0xBC21, 0xC7, 0xffff,0xff}, // LL_GAMMA_CONTRAST_CURVE_9 -{ 0xBC22, 0xD1, 0xffff,0xff}, // LL_GAMMA_CONTRAST_CURVE_10 -{ 0xBC23, 0xDA, 0xffff,0xff}, // LL_GAMMA_CONTRAST_CURVE_11 -{ 0xBC24, 0xE1, 0xffff,0xff}, // LL_GAMMA_CONTRAST_CURVE_12 -{ 0xBC25, 0xE8, 0xffff,0xff}, // LL_GAMMA_CONTRAST_CURVE_13 -{ 0xBC26, 0xEE, 0xffff,0xff}, // LL_GAMMA_CONTRAST_CURVE_14 -{ 0xBC27, 0xF3, 0xffff,0xff}, // LL_GAMMA_CONTRAST_CURVE_15 -{ 0xBC28, 0xF7, 0xffff,0xff}, // LL_GAMMA_CONTRAST_CURVE_16 -{ 0xBC29, 0xFB, 0xffff,0xff}, // LL_GAMMA_CONTRAST_CURVE_17 -{ 0xBC2A, 0xFF, 0xffff,0xff}, // LL_GAMMA_CONTRAST_CURVE_18 -{ 0xBC2B, 0x00, 0xffff,0xff}, // LL_GAMMA_NEUTRAL_CURVE_0 -{ 0xBC2C, 0x11, 0xffff,0xff}, // LL_GAMMA_NEUTRAL_CURVE_1 -{ 0xBC2D, 0x23, 0xffff,0xff}, // LL_GAMMA_NEUTRAL_CURVE_2 -{ 0xBC2E, 0x3F, 0xffff,0xff}, // LL_GAMMA_NEUTRAL_CURVE_3 -{ 0xBC2F, 0x67, 0xffff,0xff}, // LL_GAMMA_NEUTRAL_CURVE_4 -{ 0xBC30, 0x85, 0xffff,0xff}, // LL_GAMMA_NEUTRAL_CURVE_5 -{ 0xBC31, 0x9B, 0xffff,0xff}, // LL_GAMMA_NEUTRAL_CURVE_6 -{ 0xBC32, 0xAD, 0xffff,0xff}, // LL_GAMMA_NEUTRAL_CURVE_7 -{ 0xBC33, 0xBB, 0xffff,0xff}, // LL_GAMMA_NEUTRAL_CURVE_8 -{ 0xBC34, 0xC7, 0xffff,0xff}, // LL_GAMMA_NEUTRAL_CURVE_9 -{ 0xBC35, 0xD1, 0xffff,0xff}, // LL_GAMMA_NEUTRAL_CURVE_10 -{ 0xBC36, 0xDA, 0xffff,0xff}, // LL_GAMMA_NEUTRAL_CURVE_11 -{ 0xBC37, 0xE1, 0xffff,0xff}, // LL_GAMMA_NEUTRAL_CURVE_12 -{ 0xBC38, 0xE8, 0xffff,0xff}, // LL_GAMMA_NEUTRAL_CURVE_13 -{ 0xBC39, 0xEE, 0xffff,0xff}, // LL_GAMMA_NEUTRAL_CURVE_14 -{ 0xBC3A, 0xF3, 0xffff,0xff}, // LL_GAMMA_NEUTRAL_CURVE_15 -{ 0xBC3B, 0xF7, 0xffff,0xff}, // LL_GAMMA_NEUTRAL_CURVE_16 -{ 0xBC3C, 0xFB, 0xffff,0xff}, // LL_GAMMA_NEUTRAL_CURVE_17 -{ 0xBC3D, 0xFF, 0xffff,0xff}, // LL_GAMMA_NEUTRAL_CURVE_18 -{ 0xBC3E, 0x00, 0xffff,0xff}, // LL_GAMMA_NR_CURVE_0 -{ 0xBC3F, 0x05, 0xffff,0xff}, // LL_GAMMA_NR_CURVE_1 -{ 0xBC40, 0x0F, 0xffff,0xff}, // LL_GAMMA_NR_CURVE_2 -{ 0xBC41, 0x21, 0xffff,0xff}, // LL_GAMMA_NR_CURVE_3 -{ 0xBC42, 0x3C, 0xffff,0xff}, // LL_GAMMA_NR_CURVE_4 -{ 0xBC43, 0x52, 0xffff,0xff}, // LL_GAMMA_NR_CURVE_5 -{ 0xBC44, 0x67, 0xffff,0xff}, // LL_GAMMA_NR_CURVE_6 -{ 0xBC45, 0x7B, 0xffff,0xff}, // LL_GAMMA_NR_CURVE_7 -{ 0xBC46, 0x8D, 0xffff,0xff}, // LL_GAMMA_NR_CURVE_8 -{ 0xBC47, 0x9E, 0xffff,0xff}, // LL_GAMMA_NR_CURVE_9 -{ 0xBC48, 0xAD, 0xffff,0xff}, // LL_GAMMA_NR_CURVE_10 -{ 0xBC49, 0xBA, 0xffff,0xff}, // LL_GAMMA_NR_CURVE_11 -{ 0xBC4A, 0xC6, 0xffff,0xff}, // LL_GAMMA_NR_CURVE_12 -{ 0xBC4B, 0xD1, 0xffff,0xff}, // LL_GAMMA_NR_CURVE_13 -{ 0xBC4C, 0xDC, 0xffff,0xff}, // LL_GAMMA_NR_CURVE_14 -{ 0xBC4D, 0xE5, 0xffff,0xff}, // LL_GAMMA_NR_CURVE_15 -{ 0xBC4E, 0xEE, 0xffff,0xff}, // LL_GAMMA_NR_CURVE_16 -{ 0xBC4F, 0xF7, 0xffff,0xff}, // LL_GAMMA_NR_CURVE_17 -{ 0xBC50, 0xFF, 0xffff,0xff}, // LL_GAMMA_NR_CURVE_18 - -//[BM_Dampening] -{ 0xB801, 0xE0, 0xffff,0xff}, // STAT_MODE -{ 0xB862, 0x04, 0xffff,0xff}, // STAT_BMTRACKING_SPEED - -//[AE] -{ 0xB829, 0x02, 0xffff,0xff}, // STAT_LL_BRIGHTNESS_METRIC_DIVISOR -{ 0xB863, 0x02, 0xffff,0xff}, // STAT_BM_MUL -{ 0xB827, 0x0F, 0xffff,0xff}, // STAT_AE_EV_SHIFT -{ 0xA409, 0x42, 0xffff,0xff}, // AE_RULE_BASE_TARGET - -//[BM_GM_Start_Stop] -{ 0xBC52, 0x00C8, 0xffff,0xffff}, // LL_START_BRIGHTNESS_METRIC -{ 0xBC54, 0x0A28, 0xffff,0xffff}, // LL_END_BRIGHTNESS_METRIC -{ 0xBC58, 0x00C8, 0xffff,0xffff}, // LL_START_GAIN_METRIC -{ 0xBC5A, 0x12C0, 0xffff,0xffff}, // LL_END_GAIN_METRIC -{ 0xBC5E, 0x00FA, 0xffff,0xffff}, // LL_START_APERTURE_GAIN_BM -{ 0xBC60, 0x0258, 0xffff,0xffff}, // LL_END_APERTURE_GAIN_BM -{ 0xBC66, 0x00FA, 0xffff,0xffff}, // LL_START_APERTURE_GM -{ 0xBC68, 0x0258, 0xffff,0xffff}, // LL_END_APERTURE_GM -{ 0xBC86, 0x00C8, 0xffff,0xffff}, // LL_START_FFNR_GM -{ 0xBC88, 0x0640, 0xffff,0xffff}, // LL_END_FFNR_GM -{ 0xBCBC, 0x0040, 0xffff,0xffff}, // LL_SFFB_START_GAIN -{ 0xBCBE, 0x01FC, 0xffff,0xffff}, // LL_SFFB_END_GAIN -{ 0xBCCC, 0x00C8, 0xffff,0xffff}, // LL_SFFB_START_MAX_GM -{ 0xBCCE, 0x0640, 0xffff,0xffff}, // LL_SFFB_END_MAX_GM -{ 0xBC90, 0x00C8, 0xffff,0xffff}, // LL_START_GRB_GM -{ 0xBC92, 0x0640, 0xffff,0xffff}, // LL_END_GRB_GM -{ 0xBC0E, 0x0001, 0xffff,0xffff}, // LL_GAMMA_CURVE_ADJ_START_POS -{ 0xBC10, 0x0002, 0xffff,0xffff}, // LL_GAMMA_CURVE_ADJ_MID_POS -{ 0xBC12, 0x02BC, 0xffff,0xffff}, // LL_GAMMA_CURVE_ADJ_END_POS -{ 0xBCAA, 0x044C, 0xffff,0xffff}, // LL_CDC_THR_ADJ_START_POS -{ 0xBCAC, 0x00AF, 0xffff,0xffff}, // LL_CDC_THR_ADJ_MID_POS -{ 0xBCAE, 0x0009, 0xffff,0xffff}, // LL_CDC_THR_ADJ_END_POS -{ 0xBCD8, 0x00C8, 0xffff,0xffff}, // LL_PCR_START_BM -{ 0xBCDA, 0x0A28, 0xffff,0xffff}, // LL_PCR_END_BM - -//[Kernel] -{ 0x3380, 0x0504, 0xffff,0xffff}, // KERNEL_CONFIG - -//[GRB] -{ 0xBC94, 0x0C, 0xffff,0xff}, // LL_GB_START_THRESHOLD_0 -{ 0xBC95, 0x08, 0xffff,0xff}, // LL_GB_START_THRESHOLD_1 -{ 0xBC9C, 0x3C, 0xffff,0xff}, // RESERVED_LL_9C -{ 0xBC9D, 0x28, 0xffff,0xff}, // RESERVED_LL_9D - -//[Demosaic_REV3] -{ 0x33B0, 0x2A16, 0xffff,0xffff}, // FFNR_ALPHA_BETA -{ 0xBC8A, 0x02, 0xffff,0xff}, // LL_START_FF_MIX_THRESH_Y -{ 0xBC8B, 0x0F, 0xffff,0xff}, // LL_END_FF_MIX_THRESH_Y -{ 0xBC8C, 0xFF, 0xffff,0xff}, // LL_START_FF_MIX_THRESH_YGAIN -{ 0xBC8D, 0xFF, 0xffff,0xff}, // LL_END_FF_MIX_THRESH_YGAIN -{ 0xBC8E, 0xFF, 0xffff,0xff}, // LL_START_FF_MIX_THRESH_GAIN -{ 0xBC8F, 0x00, 0xffff,0xff}, // LL_END_FF_MIX_THRESH_GAIN - -//[CDC] -{ 0xBCB2, 0x20, 0xffff,0xff}, // LL_CDC_DARK_CLUS_SLOPE -{ 0xBCB3, 0x3A, 0xffff,0xff}, // LL_CDC_DARK_CLUS_SATUR -{ 0xBCB4, 0x39, 0xffff,0xff}, // RESERVED_LL_B4 -{ 0xBCB7, 0x39, 0xffff,0xff}, // RESERVED_LL_B7 -{ 0xBCB5, 0x20, 0xffff,0xff}, // RESERVED_LL_B5 -{ 0xBCB8, 0x3A, 0xffff,0xff}, // RESERVED_LL_B8 -{ 0xBCB6, 0x80, 0xffff,0xff}, // RESERVED_LL_B6 -{ 0xBCB9, 0x24, 0xffff,0xff}, // RESERVED_LL_B9 -{ 0xBCAA, 0x03E8, 0xffff,0xffff}, // LL_CDC_THR_ADJ_START_POS -{ 0xBCAC, 0x012C, 0xffff,0xffff}, // LL_CDC_THR_ADJ_MID_POS -{ 0xBCAE, 0x0009, 0xffff,0xffff}, // LL_CDC_THR_ADJ_END_POS - -//[Aperture_calib] -{ 0x33BA, 0x0084, 0xffff,0xffff}, // APEDGE_CONTROL -{ 0x33BE, 0x0000, 0xffff,0xffff}, // UA_KNEE_L -{ 0x33C2, 0x8800, 0xffff,0xffff}, // UA_WEIGHTS -{ 0xBC5E, 0x0154, 0xffff,0xffff}, // LL_START_APERTURE_GAIN_BM -{ 0xBC60, 0x0640, 0xffff,0xffff}, // LL_END_APERTURE_GAIN_BM -{ 0xBC62, 0x0E, 0xffff,0xff}, // LL_START_APERTURE_KPGAIN -{ 0xBC63, 0x14, 0xffff,0xff}, // LL_END_APERTURE_KPGAIN -{ 0xBC64, 0x0E, 0xffff,0xff}, // LL_START_APERTURE_KNGAIN -{ 0xBC65, 0x14, 0xffff,0xff}, // LL_END_APERTURE_KNGAIN -{ 0xBCE2, 0x0A, 0xffff,0xff}, // LL_START_POS_KNEE -{ 0xBCE3, 0x2B, 0xffff,0xff}, // LL_END_POS_KNEE -{ 0xBCE4, 0x0A, 0xffff,0xff}, // LL_START_NEG_KNEE -{ 0xBCE5, 0x2B, 0xffff,0xff}, // LL_END_NEG_KNEE -{ 0x3210, 0x49B8, 0xffff,0xffff}, // COLOR_PIPELINE_CONTROL - -//[SFFB_REV3_noisemodel] -{ 0xBCC0, 0x1F, 0xffff,0xff}, // LL_SFFB_RAMP_START -{ 0xBCC1, 0x03, 0xffff,0xff}, // LL_SFFB_RAMP_STOP -{ 0xBCC2, 0x2C, 0xffff,0xff}, // LL_SFFB_SLOPE_START -{ 0xBCC3, 0x10, 0xffff,0xff}, // LL_SFFB_SLOPE_STOP -{ 0xBCC4, 0x07, 0xffff,0xff}, // LL_SFFB_THSTART -{ 0xBCC5, 0x0B, 0xffff,0xff}, // LL_SFFB_THSTOP -{ 0xBCBA, 0x0009, 0xffff,0xffff}, // LL_SFFB_CONFIG - -//[**********Step8*************] -//[FTB_Off] -{ 0xBC14, 0xFFFE, 0xffff,0xffff}, // LL_GAMMA_FADE_TO_BLACK_START_POS -{ 0xBC16, 0xFFFE, 0xffff,0xffff}, // LL_GAMMA_FADE_TO_BLACK_END_POS - -//[Aperture_preference] -{ 0xBC66, 0x0154, 0xffff,0xffff}, // LL_START_APERTURE_GM -{ 0xBC68, 0x07D0, 0xffff,0xffff}, // LL_END_APERTURE_GM -{ 0xBC6A, 0x04, 0xffff,0xff}, // LL_START_APERTURE_INTEGER_GAIN -{ 0xBC6B, 0x00, 0xffff,0xff}, // LL_END_APERTURE_INTEGER_GAIN -{ 0xBC6C, 0x00, 0xffff,0xff}, // LL_START_APERTURE_EXP_GAIN -{ 0xBC6D, 0x00, 0xffff,0xff}, // LL_END_APERTURE_EXP_GAIN - -//[Gain_max] -{ 0xA81C, 0x0040, 0xffff,0xffff}, // AE_TRACK_MIN_AGAIN -{ 0xA820, 0x012C, 0xffff,0xffff}, // AE_TRACK_MAX_AGAIN -{ 0xA822, 0x0060, 0xffff,0xffff}, // AE_TRACK_MIN_DGAIN -{ 0xA824, 0x00E5, 0xffff,0xffff}, // AE_TRACK_MAX_DGAIN - -//[Saturation_REV3] -{ 0xBC56, 0x64, 0xffff,0xff}, // LL_START_CCM_SATURATION -{ 0xBC57, 0x1E, 0xffff,0xff}, // LL_END_CCM_SATURATION - -//[DCCM_REV3] -{ 0xBCDE, 0x03, 0xffff,0xff}, // LL_START_SYS_THRESHOLD -{ 0xBCDF, 0x50, 0xffff,0xff}, // LL_STOP_SYS_THRESHOLD -{ 0xBCE0, 0x08, 0xffff,0xff}, // LL_START_SYS_GAIN -{ 0xBCE1, 0x03, 0xffff,0xff}, // LL_STOP_SYS_GAIN - -//[Sobel_REV3] -{ 0xBCD0, 0x000A, 0xffff,0xffff}, // LL_SFFB_SOBEL_FLAT_START -{ 0xBCD2, 0x00FE, 0xffff,0xffff}, // LL_SFFB_SOBEL_FLAT_STOP -{ 0xBCD4, 0x001E, 0xffff,0xffff}, // LL_SFFB_SOBEL_SHARP_START -{ 0xBCD6, 0x00FF, 0xffff,0xffff}, // LL_SFFB_SOBEL_SHARP_STOP -{ 0xBCC6, 0x00, 0xffff,0xff}, // LL_SFFB_SHARPENING_START -{ 0xBCC7, 0x00, 0xffff,0xff}, // LL_SFFB_SHARPENING_STOP -{ 0xBCC8, 0x20, 0xffff,0xff}, // LL_SFFB_FLATNESS_START -{ 0xBCC9, 0x40, 0xffff,0xff}, // LL_SFFB_FLATNESS_STOP -{ 0xBCCA, 0x04, 0xffff,0xff}, // LL_SFFB_TRANSITION_START -{ 0xBCCB, 0x00, 0xffff,0xff}, // LL_SFFB_TRANSITION_STOP - -//[SFFB_slope_zero_enable] -{ 0xBCE6, 0x03, 0xffff,0xff}, // LL_SFFB_ZERO_ENABLE -{ 0xBCE6, 0x03, 0xffff,0xff}, // LL_SFFB_ZERO_ENABLE - - -//[AE_preference] -{ 0xA410, 0x04, 0xffff,0xff}, // AE_RULE_TARGET_AE_6 -{ 0xA411, 0x06, 0xffff,0xff}, // AE_RULE_TARGET_AE_7 - - -//[**********Step9*************] -//[JPEG Quantization] -//[Sepia effect] -{ 0xDC3A, 0x23, 0xffff,0xff}, // SYS_SEPIA_CR -{ 0xDC3B, 0xB2, 0xffff,0xff}, // SYS_SEPIA_CB - - -//[Touch Focus + Fast Focus AF_AFM_INIT] -{ 0x8411, 0x00, 0xffff,0xff}, // SEQ_STATE_CFG_0_AF -{ 0x8419, 0x04, 0xffff,0xff}, // SEQ_STATE_CFG_1_AF - -{ 0xB002, 0x0002, 0xffff,0xffff}, // AF_MODE -{ 0xC40A, 0x0030, 0xffff,0xffff}, // AFM_POS_MIN -{ 0xC40C, 0x00A0, 0xffff,0xffff}, // AFM_POS_MAX -{ 0xB045, 0x000C, 0xffff,0xffff}, // AF_MODE_EX - - -//AF Window size -{ 0xB854, 0x60, 0xffff,0xff}, // STAT_SM_WINDOW_POS_X -{ 0xB855, 0x60, 0xffff,0xff}, // STAT_SM_WINDOW_POS_Y -{ 0xB856, 0x40, 0xffff,0xff}, // STAT_SM_WINDOW_SIZE_X -{ 0xB857, 0x40, 0xffff,0xff}, // STAT_SM_WINDOW_SIZE_Y -{ 0xB012, 0x0A, 0xffff,0xff}, // AF_FS_NUM_STEPS -{ 0xB018, 0x00, 0xffff,0xff}, // AF_FS_POS_0 -{ 0xB019, 0x30, 0xffff,0xff}, // AF_FS_POS_1 -{ 0xB01A, 0x48, 0xffff,0xff}, // AF_FS_POS_2 -{ 0xB01B, 0x60, 0xffff,0xff}, // AF_FS_POS_3 -{ 0xB01C, 0x78, 0xffff,0xff}, // AF_FS_POS_4 -{ 0xB01D, 0x90, 0xffff,0xff}, // AF_FS_POS_5 -{ 0xB01E, 0xA8, 0xffff,0xff}, // AF_FS_POS_6 -{ 0xB01F, 0xC0, 0xffff,0xff}, // AF_FS_POS_7 -{ 0xB020, 0xE0, 0xffff,0xff}, // AF_FS_POS_8 -{ 0xB021, 0xFF, 0xffff,0xff}, // AF_FS_POS_9 -{ 0xB022, 0x00, 0xffff,0xff}, // AF_FS_POS_10 -{ 0xB011, 0x00, 0xffff,0xff}, // AF_FS_INIT_POS - -//INIT PATCH PAGE used in FF -{ 0x098E, 0xD40E, 0xffff,0xffff}, // LOGICAL_ADDRESS_ACCESS -{ 0xD40E, 0x0000, 0xffff,0xffff}, -{ 0xD40F, 0x0000, 0xffff,0xffff}, -{ 0xD410, 0x0000, 0xffff,0xffff}, -{ 0xD411, 0x0000, 0xffff,0xffff}, -{ 0xD412, 0x0000, 0xffff,0xffff}, -{ 0xD413, 0x0000, 0xffff,0xffff}, -{ 0xD414, 0x0000, 0xffff,0xffff}, -{ 0xD415, 0x0000, 0xffff,0xffff}, -{ 0xD416, 0x0000, 0xffff,0xffff}, -{ 0xD417, 0x0000, 0xffff,0xffff}, -{ 0xD418, 0x0000, 0xffff,0xffff}, -{ 0xD418, 0x0000, 0xffff,0xffff}, -{ 0xD419, 0x0000, 0xffff,0xffff}, -{ 0xD41A, 0x0000, 0xffff,0xffff}, -{ 0xD41B, 0x0000, 0xffff,0xffff}, -{ 0xD41C, 0x0000, 0xffff,0xffff}, -{ 0xD41D, 0x0000, 0xffff,0xffff}, -{ 0xD41E, 0x0000, 0xffff,0xffff}, -{ 0xD420, 0x0000, 0xffff,0xffff}, -{ 0xD406, 0x0000, 0xffff,0xffff}, -{ 0xD407, 0x0000, 0xffff,0xffff}, -{ 0xD422, 0x0000, 0xffff,0xffff}, -{ 0xD423, 0x0000, 0xffff,0xffff}, -{ 0xD424, 0x0000, 0xffff,0xffff}, -{ 0xD425, 0x0000, 0xffff,0xffff}, -{ 0xD426, 0x0000, 0xffff,0xffff}, -{ 0xD427, 0x0000, 0xffff,0xffff}, -{ 0xD428, 0x0000, 0xffff,0xffff}, -{ 0xD429, 0x0000, 0xffff,0xffff}, -{ 0xD42A, 0x0000, 0xffff,0xffff}, -{ 0xD42B, 0x0000, 0xffff,0xffff}, -{ 0xD400, 0x0001, 0xffff,0xffff}, -{ 0xD401, 0x0000, 0xffff,0xffff}, -{ 0xD402, 0x0028, 0xffff,0xffff}, -{ 0xD403, 0x0080, 0xffff,0xffff}, -{ 0xD404, 0x0000, 0xffff,0xffff}, -{ 0xD405, 0x0000, 0xffff,0xffff}, -{ 0xD406, 0x0000, 0xffff,0xffff}, -{ 0xD407, 0x0000, 0xffff,0xffff}, -{ 0xD408, 0x0030, 0xffff,0xffff}, -{ 0xD409, 0x0040, 0xffff,0xffff}, -{ 0xD40A, 0x0050, 0xffff,0xffff}, -{ 0xD40B, 0x0070, 0xffff,0xffff}, -{ 0xD40C, 0x0080, 0xffff,0xffff}, -{ 0xD40D, 0x0090, 0xffff,0xffff}, - -{ 0x0018, 0x2008, 0xffff,0xffff}, // STANDBY_CONTROL_AND_STATUS - -SensorWaitMs(100), -SensorEnd - - - -}; -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={ - //capture2preview - {0x098E, 0x843C, 0xffff, 0xffff}, // LOGICAL_ADDRESS_ACCESS [SEQ_STATE_CFG_5_MAX_FRAME_CNT] - {0x843C, 0xFF, 0xffff, 0xff}, // SEQ_STATE_CFG_5_MAX_FRAME_CNT - {0x8404, 0x02, 0xffff, 0xff}, // SEQ_CMD - SensorWaitMs(200), - SensorEnd -}; -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] ={ - SensorEnd -}; -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data[] = -{ - // Set resolution vga - {0xC83A, 0x000C, 0xffff,0xffff}, // CAM_CORE_A_Y_ADDR_START - {0xC83C, 0x0018, 0xffff,0xffff}, // CAM_CORE_A_X_ADDR_START - {0xC83E, 0x07B1, 0xffff,0xffff }, // CAM_CORE_A_Y_ADDR_END - {0xC840, 0x0A45, 0xffff,0xffff}, // CAM_CORE_A_X_ADDR_END - {0xC868, 0x0423, 0xffff,0xffff}, // CAM_CORE_A_FRAME_LENGTH_LINES - {0xC86A, 0x1194, 0xffff,0xffff}, // CAM_CORE_A_LINE_LENGTH_PCK - {0xC86C, 0x0518, 0xffff,0xffff}, // CAM_CORE_A_OUTPUT_SIZE_WIDTH - {0xC86E, 0x03D4, 0xffff,0xffff}, // CAM_CORE_A_OUTPUT_SIZE_HEIGHT - {0xC870, 0x0014, 0xffff,0xffff}, // CAM_CORE_A_RX_FIFO_TRIGGER_MARK - {0xC858, 0x0003, 0xffff,0xffff}, // CAM_CORE_A_COARSE_ITMIN - {0xC8A4, 0x0A28, 0xffff,0xffff}, // CAM_CORE_B_OUTPUT_SIZE_WIDTH - {0xC8A6, 0x07A0, 0xffff,0xffff }, // CAM_CORE_B_OUTPUT_SIZE_HEIGHT - {0xC8AA, 0x0280, 0xffff,0xffff }, // CAM_OUTPUT_0_IMAGE_WIDTH - {0xC8AC, 0x01E0, 0xffff,0xffff }, // CAM_OUTPUT_0_IMAGE_HEIGHT - {0xC8AE, 0x0001, 0xffff,0xffff }, // CAM_OUTPUT_0_OUTPUT_FORMAT - {0x8404, 0x06, 0xffff,0xff }, // SEQ_CMD - SensorWaitMs(100), - - //snap2preview - {0x098E, 0x843C,0xffff, 0xffff}, // LOGICAL_ADDRESS_ACCESS [SEQ_STATE_CFG_5_MAX_FRAME_CNT] - {0x843C, 0x01, 0xffff, 0xff}, // SEQ_STATE_CFG_5_MAX_FRAME_CNT - {0x8404, 0x01, 0xffff, 0xff}, // SEQ_CMD - {0x0016, 0x0447,0xffff, 0xffff}, // CLOCKS_CONTRO - SensorEnd -}; -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[]={ - - {0x098E, 0x843C, 0xffff,0xffff}, // LOGICAL_ADDRESS_ACCESS [CAM_CORE_A_Y_ADDR_START] - {0x843C, 0x01, 0xffff,0xff }, // SEQ_STATE_CFG_5_MAX_FRAME_CNT - {0x8404, 0x01, 0xffff,0xff }, // SEQ_CMD - {0x0016, 0x0447, 0xffff,0xffff}, // CLOCKS_CONTROL - {0xC83A, 0x0106, 0xffff,0xffff}, // CAM_CORE_A_Y_ADDR_START - {0xC83C, 0x0018, 0xffff,0xffff}, // CAM_CORE_A_X_ADDR_START - {0xC83E, 0x06B7, 0xffff,0xffff}, // CAM_CORE_A_Y_ADDR_END - {0xC840, 0x0A45, 0xffff,0xffff}, // CAM_CORE_A_X_ADDR_END - {0xC86C, 0x0518, 0xffff,0xffff}, // CAM_CORE_A_OUTPUT_SIZE_WIDTH - {0xC86E, 0x02D8, 0xffff,0xffff}, // CAM_CORE_A_OUTPUT_SIZE_HEIGHT - {0xC870, 0x0014, 0xffff,0xffff}, // CAM_CORE_A_RX_FIFO_TRIGGER_MARK - {0xC858, 0x0003, 0xffff,0xffff}, // CAM_CORE_A_COARSE_ITMIN - {0xC8B8, 0x0004, 0xffff,0xffff}, // CAM_OUTPUT_0_JPEG_CONTROL - {0xC8AA, 0x0500, 0xffff,0xffff}, // CAM_OUTPUT_0_IMAGE_WIDTH - {0xC8AC, 0x02D1, 0xffff,0xffff}, // CAM_OUTPUT_0_IMAGE_HEIGHT - {0xC8AE, 0x0001, 0xffff,0xffff}, // CAM_OUTPUT_0_OUTPUT_FORMAT - {0x8404, 0x06, 0xffff,0xff }, // SEQ_CMD - SensorWaitMs(100), - - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[]={ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_softreset_data[]={ - {0x0010,0x0115,0xffff,0xffff}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[]={ - SensorEnd -}; -/* -* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx -*/ -static struct rk_sensor_reg sensor_WhiteB_Auto[]= -{ - SensorEnd -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[]= -{ - - SensorEnd -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[]= -{ - SensorEnd -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]= -{ - SensorEnd - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[]= -{ - // Brightness -2 - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[]= -{ - // Brightness -1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[]= -{ - // Brightness 0 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[]= -{ - // Brightness +1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[]= -{ - // Brightness +2 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[]= -{ - // Brightness +3 - - SensorEnd -}; -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Negative[] = -{ - SensorEnd -}; -static struct rk_sensor_reg sensor_Effect_Bluish[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; - -static struct rk_sensor_reg sensor_Exposure0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure2[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure3[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure4[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure5[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure6[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; - -static struct rk_sensor_reg sensor_Saturation0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -static struct rk_sensor_reg sensor_Contrast0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast2[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast3[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast4[]= -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Contrast5[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast6[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; -static struct rk_sensor_reg sensor_SceneAuto[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -static struct rk_sensor_reg sensor_Zoom0[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Zoom3[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; - -/* -* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu -*/ -static struct v4l2_querymenu sensor_menus[] = -{ -}; -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = -{ -}; - -//MUST define the current used format as the first item -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {MEDIA_BUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {MEDIA_BUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; -/*static struct soc_camera_ops sensor_ops;*/ - - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ - -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - SENSOR_DG("%s",__FUNCTION__); - return 0; -} -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - SENSOR_DG("%s",__FUNCTION__); - return 0; -} -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - - return 0; -} -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh (struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - int i,cnt,time,ret=0; - char seq_state; - - if ((mf->width == 2592) && (mf->height == 1944)) { - - /*check state of register 0x8405 to make sure set is successful*/ - /*set sensor_Preview2Capture more times to make sure set go into effect */ - cnt = 0; - time =0; - do{ - ret = 0; - msleep(50); - ret = sensor_read_reg2val1(client,0x8405, &seq_state); - if (ret<0) { - SENSOR_TR("read register(0x8405) failed"); - goto sensor_s_fmt_cb_bh_end; - } - - if(cnt++ > 9) { - time++; - cnt = 0; - ret = sensor_write_array(client, sensor_fullres_lowfps_data); - if (ret != 0||time >2) { - SENSOR_TR("switch preview to capture failed 0x%x %d",ret,time); - goto sensor_s_fmt_cb_bh_end; - } - } - } while((seq_state != 0x07) && (time < 4)); - } else if ((mf->width == 1280) && (mf->height == 720)) { - for (i=0;i<3;i++) - generic_sensor_write_array(client, sensor_720p); - } - -sensor_s_fmt_cb_bh_end: - return ret; -} -static int sensor_try_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf) -{ - return 0; -} -static int sensor_softrest_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - return 0; -} - -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("Suspend"); - - } else { - SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n",pm_msg.event); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - - SENSOR_DG("Resume"); - - return 0; - -} -static int sensor_mirror_cb (struct i2c_client *client, int mirror) -{ - int err =0; - SENSOR_DG("mirror: %d",mirror); - - - return err; -} -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_mirror_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_mirror failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_mirror success, value:0x%x",ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - int err =0; - SENSOR_DG("flip: %d",flip); - - return err; -} -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_flip_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_flip failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_flip success, value:0x%x",ext_ctrl->value); - return 0; -} -/* -* the functions are focus callbacks -*/ - -static int sensor_focus_init_usr_cb(struct i2c_client *client) -{ - return 0; -} -static struct rk_sensor_reg sensor_af_trigger[] = -{ - { 0xB854, 0x4040, 0xffff, 0xffff}, // STAT_SM_WINDOW_POS_X; POS_Y - { 0xB856, 0x4040, 0xffff, 0xffff}, // STAT_SM_WINDOW_SIZE_X; SIZE_Y - { 0xB006, 0x01, 0xffff, 0xff}, //run AF - af.progress - SensorEnd -}; -static int sensor_focus_af_single_usr_cb(struct i2c_client *client){ - int ret = 0; - char cnt=0; - struct rk_sensor_reg reg; - - ret = sensor_write_array(client, sensor_af_trigger); - if (ret<0) { - SENSOR_TR("%s sensor auto focus trigger fail!!\n",SENSOR_NAME_STRING()); - } else { - reg.reg = 0xb006; - reg.val = 0x01; - reg.reg_mask = 0xffff; - reg.val_mask = 0xff; - do { - msleep(30); - generic_sensor_read(client,®); - } while ((reg.val != 0) && (cnt++ < 50)); - - SENSOR_DG("%s sensor auto focus trigger(0x%x) success! state: %d, cnt: %d\n",SENSOR_NAME_STRING(), - sensor_af_trigger[0].val,reg.val,cnt); - } -//sensor_af_single_end: - return ret; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos) { - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client){ - return 0; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client,int *zone_tm_pos){ - int ret = 0; - int zone_center_pos[2]; - - zone_tm_pos[0] += 1000; - zone_tm_pos[1] += 1000; - zone_tm_pos[2] += 1000; - zone_tm_pos[3] += 1000; - zone_center_pos[0] = ((zone_tm_pos[0] + zone_tm_pos[2])>>1); - zone_center_pos[1] = ((zone_tm_pos[1] + zone_tm_pos[3])>>1); - - zone_center_pos[0] = zone_center_pos[0]*0x100/2000; - zone_center_pos[1] = zone_center_pos[1]*0x100/2000; - - zone_center_pos[0] = zone_center_pos[0]/0x40*0x40; - zone_center_pos[1] = zone_center_pos[1]/0x40*0x40; - - sensor_af_trigger[0].val = (zone_center_pos[0]<<8)|zone_center_pos[1]; - -//sensor_af_zone_end: - return ret; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client,int on){ - return 0; -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor* spsensor,struct soc_camera_device *icd) -{ - return; -} - -/* -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); - diff --git a/drivers/media/video/mt9p111.h b/drivers/media/video/mt9p111.h deleted file mode 100644 index d75be009b0e8..000000000000 --- a/drivers/media/video/mt9p111.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Driver for MT9P111 CMOS Image Sensor from Aptina - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#ifndef __MT9P111_H__ -#define __MT9P111_H__ -struct reginfo -{ - u16 reg; - u16 val; - u16 reg_len; - u16 rev; -}; - -#define WORD_LEN 0x04 -#define BYTE_LEN 0x02 - -#define SEQUENCE_INIT 0x00 -#define SEQUENCE_NORMAL 0x01 -#define SEQUENCE_CAPTURE 0x02 -#define SEQUENCE_PREVIEW 0x03 - -#define SEQUENCE_PROPERTY 0xFFFC -#define SEQUENCE_WAIT_MS 0xFFFD -#define SEQUENCE_WAIT_US 0xFFFE -#define SEQUENCE_END 0xFFFF - -/*configure register for flipe and mirror during initial*/ -#define CONFIG_SENSOR_FLIPE 0 -#define CONFIG_SENSOR_MIRROR 0 -#define CONFIG_SENSOR_MIRROR_AND_FLIPE 1 -#define CONFIG_SENSOR_NONE_FLIP_MIRROR 0 -/**adjust part parameter to solve bug******/ -#define ADJUST_FOR_720P_FALG 1 -#define ADJUST_FOR_VGA_FALG 1 -#define ADJUST_FOR_CAPTURE_FALG 1 -#define ADJUST_PCLK_FRE_FALG 1 -/**optimize code to shoten open time******/ -#define ADJUST_OPTIMIZE_TIME_FALG 1 - - -#endif diff --git a/drivers/media/video/mt9p111_old.c b/drivers/media/video/mt9p111_old.c deleted file mode 100755 index 5d8ef04b7897..000000000000 --- a/drivers/media/video/mt9p111_old.c +++ /dev/null @@ -1,5587 +0,0 @@ -/* - * Driver for OV5642 CMOS Image Sensor from OmniVision - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include "mt9p111.h" - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_MT9P111 -#define SENSOR_V4L2_IDENT V4L2_IDENT_MT9P111 -#define SENSOR_ID SEQUENCE_END -#define SENSOR_ID_REG SEQUENCE_END -#define SENSOR_RESET_REG 0x0010 -#define SENSOR_RESET_VAL 0x0115 -#define SENSOR_RESET_REG_LEN WORD_LEN -#define SENSOR_MIN_WIDTH 176 -#define SENSOR_MIN_HEIGHT 144 -#define SENSOR_MAX_WIDTH 2592 -#define SENSOR_MAX_HEIGHT 1944 -#define SENSOR_INIT_WIDTH 640 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 480 -#define SENSOR_INIT_WINSEQADR sensor_vga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_UYVY8_2X8 -#define YUV420_BUFFER_MAX_SIZE 7558272 /* 2592*1944*1.5*/ - -#define CONFIG_SENSOR_WhiteBalance 0 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 0 -#define CONFIG_SENSOR_Scene 0 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 0 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 -#define CONFIG_SENSOR_Focus 1 - - -#define CONFIG_SENSOR_I2C_SPEED 100000 /* Hz */ -//#define CONFIG_SENSOR_I2C_SPEED 350000 /* Hz */ - -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING|\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH|\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) - - - -#if CONFIG_SENSOR_Focus -/*#define SENSOR_AF_MODE_INFINITY 0 -#define SENSOR_AF_MODE_MACRO 1 -#define SENSOR_AF_MODE_FIXED 2 -#define SENSOR_AF_MODE_AUTO 3 -#define SENSOR_AF_MODE_CONTINUOUS 4 -#define SENSOR_AF_MODE_CLOSE 5*/ -#define SENSOR_AF_MODE_AUTO 0 -#define SENSOR_AF_MODE_CLOSE 1 -#define SENSOR_AF_MODE_CONTINUOUS 2 -#endif - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - int status; - struct soc_camera_device *icd; - struct hrtimer timer; -}; -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); - -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_MT9P111_USER_DEFINED_SERIES -#include "mt9p111_user_series.c" -#else - -/* init 640X480 VGA */ -static struct reginfo sensor_init_data[] = -{ -{ 0x0010, 0x0340, WORD_LEN, 0 }, - - -{ 0x0010, 0x0340, WORD_LEN, 0 }, // PLL_DIVIDERS -{ 0x0012, 0x0080, WORD_LEN, 0 }, // PLL_P_DIVIDERS -{ 0x0014, 0x2025, WORD_LEN, 0 }, // PLL_CONTROL -{ 0x001E, 0x0565, WORD_LEN, 0 }, // PAD_SLEW_PAD_CONFIG -{ 0x0022, 0x0030, WORD_LEN, 0 }, // VDD_DIS_COUNTER -{ 0x002A, 0x7FFF, WORD_LEN, 0 }, // PLL_P4_P5_P6_DIVIDERS -{ 0x002C, 0x0000, WORD_LEN, 0 }, // PLL_P7_DIVIDER -{ 0x002E, 0x0000, WORD_LEN, 0 }, // SENSOR_CLOCK_DIVIDER -{ 0x0018, 0x400c, WORD_LEN, 0 }, // STANDBY_CONTROL_AND_STATUS -//delay = 100 -{SEQUENCE_WAIT_MS,300,WORD_LEN,0}, -{ 0x098E, 0x483A, WORD_LEN, 0 }, // LOGICAL_ADDRESS_ACCESS -{ 0xC83A, 0x000C, WORD_LEN, 0 }, // CAM_CORE_A_Y_ADDR_START -{ 0xC83C, 0x0018, WORD_LEN, 0 }, // CAM_CORE_A_X_ADDR_START -{ 0xC83E, 0x07B1, WORD_LEN, 0 }, // CAM_CORE_A_Y_ADDR_END -{ 0xC840, 0x0A45, WORD_LEN, 0 }, // CAM_CORE_A_X_ADDR_END -{ 0xC842, 0x0001, WORD_LEN, 0 }, // CAM_CORE_A_ROW_SPEED -{ 0xC844, 0x0103, WORD_LEN, 0 }, // CAM_CORE_A_SKIP_X_CORE -{ 0xC846, 0x0103, WORD_LEN, 0 }, // CAM_CORE_A_SKIP_Y_CORE -{ 0xC848, 0x0103, WORD_LEN, 0 }, // CAM_CORE_A_SKIP_X_PIPE -{ 0xC84A, 0x0103, WORD_LEN, 0 }, // CAM_CORE_A_SKIP_Y_PIPE -{ 0xC84C, 0x00F6, WORD_LEN, 0 }, // CAM_CORE_A_POWER_MODE -{ 0xC84E, 0x0001, WORD_LEN, 0 }, // CAM_CORE_A_BIN_MODE -{ 0xC850, 0x00, BYTE_LEN, 0}, // CAM_CORE_A_ORIENTATION -{ 0xC851, 0x00, BYTE_LEN, 0}, // CAM_CORE_A_PIXEL_ORDER -{ 0xC852, 0x019C, WORD_LEN, 0 }, // CAM_CORE_A_FINE_CORRECTION -{ 0xC854, 0x0732, WORD_LEN, 0 }, // CAM_CORE_A_FINE_ITMIN -{ 0xC858, 0x0000, WORD_LEN, 0 }, // CAM_CORE_A_COARSE_ITMIN -{ 0xC85A, 0x0001, WORD_LEN, 0 }, // CAM_CORE_A_COARSE_ITMAX_MARGIN -{ 0xC85C, 0x0423, WORD_LEN, 0 }, // CAM_CORE_A_MIN_FRAME_LENGTH_LINES -{ 0xC85E, 0xFFFF, WORD_LEN, 0 }, // CAM_CORE_A_MAX_FRAME_LENGTH_LINES -{ 0xC860, 0x0423, WORD_LEN, 0 }, // CAM_CORE_A_BASE_FRAME_LENGTH_LINES -{ 0xC862, 0x1194, WORD_LEN, 0 }, // CAM_CORE_A_MIN_LINE_LENGTH_PCLK -{ 0xC864, 0xFFFE, WORD_LEN, 0 }, // CAM_CORE_A_MAX_LINE_LENGTH_PCLK -{ 0xC866, 0x7F7F, WORD_LEN, 0 }, // CAM_CORE_A_P4_5_6_DIVIDER -{ 0xC868, 0x0423, WORD_LEN, 0 }, // CAM_CORE_A_FRAME_LENGTH_LINES -{ 0xC86A, 0x1194, WORD_LEN, 0 }, // CAM_CORE_A_LINE_LENGTH_PCK -{ 0xC86C, 0x0518, WORD_LEN, 0 }, // CAM_CORE_A_OUTPUT_SIZE_WIDTH -{ 0xC86E, 0x03D4, WORD_LEN, 0 }, // CAM_CORE_A_OUTPUT_SIZE_HEIGHT -{ 0xC870, 0x0014, WORD_LEN, 0 }, // CAM_CORE_A_RX_FIFO_TRIGGER_MARK -{ 0xC858, 0x0003, WORD_LEN, 0 }, // CAM_CORE_A_COARSE_ITMIN -{ 0xC8B8, 0x0004, WORD_LEN, 0 }, // CAM_OUTPUT_0_JPEG_CONTROL -{ 0xC8AE, 0x0001, WORD_LEN, 0 }, // CAM_OUTPUT_0_OUTPUT_FORMAT -{ 0xC8AA, 0x0280, WORD_LEN, 0 }, // CAM_OUTPUT_0_IMAGE_WIDTH -{ 0xC8AC, 0x01E0, WORD_LEN, 0 }, // CAM_OUTPUT_0_IMAGE_HEIGHT -{ 0xC872, 0x0010, WORD_LEN, 0 }, // CAM_CORE_B_Y_ADDR_START -{ 0xC874, 0x001C, WORD_LEN, 0 }, // CAM_CORE_B_X_ADDR_START -{ 0xC876, 0x07AF, WORD_LEN, 0 }, // CAM_CORE_B_Y_ADDR_END -{ 0xC878, 0x0A43, WORD_LEN, 0 }, // CAM_CORE_B_X_ADDR_END -{ 0xC87A, 0x0001, WORD_LEN, 0 }, // CAM_CORE_B_ROW_SPEED -{ 0xC87C, 0x0101, WORD_LEN, 0 }, // CAM_CORE_B_SKIP_X_CORE -{ 0xC87E, 0x0101, WORD_LEN, 0 }, // CAM_CORE_B_SKIP_Y_CORE -{ 0xC880, 0x0101, WORD_LEN, 0 }, // CAM_CORE_B_SKIP_X_PIPE -{ 0xC882, 0x0101, WORD_LEN, 0 }, // CAM_CORE_B_SKIP_Y_PIPE -{ 0xC884, 0x00F2, WORD_LEN, 0 }, // CAM_CORE_B_POWER_MODE -{ 0xC886, 0x0000, WORD_LEN, 0 }, // CAM_CORE_B_BIN_MODE -{ 0xC888, 0x00, BYTE_LEN, 0}, // CAM_CORE_B_ORIENTATION -{ 0xC889, 0x00, BYTE_LEN, 0}, // CAM_CORE_B_PIXEL_ORDER -{ 0xC88A, 0x009C, WORD_LEN, 0 }, // CAM_CORE_B_FINE_CORRECTION -{ 0xC88C, 0x034A, WORD_LEN, 0 }, // CAM_CORE_B_FINE_ITMIN -{ 0xC890, 0x0000, WORD_LEN, 0 }, // CAM_CORE_B_COARSE_ITMIN -{ 0xC892, 0x0001, WORD_LEN, 0 }, // CAM_CORE_B_COARSE_ITMAX_MARGIN -{ 0xC894, 0x07EF, WORD_LEN, 0 }, // CAM_CORE_B_MIN_FRAME_LENGTH_LINES -{ 0xC896, 0xFFFF, WORD_LEN, 0 }, // CAM_CORE_B_MAX_FRAME_LENGTH_LINES -{ 0xC898, 0x082F, WORD_LEN, 0 }, // CAM_CORE_B_BASE_FRAME_LENGTH_LINES -{ 0xC89A, 0x1964, WORD_LEN, 0 }, // CAM_CORE_B_MIN_LINE_LENGTH_PCLK -{ 0xC89C, 0xFFFE, WORD_LEN, 0 }, // CAM_CORE_B_MAX_LINE_LENGTH_PCLK -{ 0xC89E, 0x7F7F, WORD_LEN, 0 }, // CAM_CORE_B_P4_5_6_DIVIDER -{ 0xC8A0, 0x07EF, WORD_LEN, 0 }, // CAM_CORE_B_FRAME_LENGTH_LINES -{ 0xC8A2, 0x1964, WORD_LEN, 0 }, // CAM_CORE_B_LINE_LENGTH_PCK -{ 0xC8A4, 0x0A28, WORD_LEN, 0 }, // CAM_CORE_B_OUTPUT_SIZE_WIDTH -{ 0xC8A6, 0x07A0, WORD_LEN, 0 }, // CAM_CORE_B_OUTPUT_SIZE_HEIGHT -{ 0xC8A8, 0x0124, WORD_LEN, 0 }, // CAM_CORE_B_RX_FIFO_TRIGGER_MARK -{ 0xC890, 0x0003, WORD_LEN, 0 }, // CAM_CORE_B_COARSE_ITMIN -{ 0xC8C0, 0x0A20, WORD_LEN, 0 }, // CAM_OUTPUT_1_IMAGE_WIDTH -{ 0xC8C2, 0x0798, WORD_LEN, 0 }, // CAM_OUTPUT_1_IMAGE_HEIGHT -{ 0xC89A, 0x1964, WORD_LEN, 0 }, // CAM_CORE_B_MIN_LINE_LENGTH_PCLK -{ 0xC8A2, 0x1964, WORD_LEN, 0 }, // CAM_CORE_B_LINE_LENGTH_PCK -{ 0xC8C4, 0x0001, WORD_LEN, 0 }, // CAM_OUTPUT_1_OUTPUT_FORMAT -{ 0xC8C6, 0x0000, WORD_LEN, 0 }, // CAM_OUTPUT_1_OUTPUT_FORMAT_ORDER -{ 0xC8CE, 0x0014, WORD_LEN, 0 }, // CAM_OUTPUT_1_JPEG_CONTROL -{ 0xD822, 0x4610, WORD_LEN, 0 }, // JPEG_JPSS_CTRL_VAR -{ 0x3330, 0x0000, WORD_LEN, 0 }, // OUTPUT_FORMAT_TEST -{ 0x098E, 0xA00E, WORD_LEN, 0 }, // LOGICAL_ADDRESS_ACCESS -{ 0xA00E, 0x32, BYTE_LEN, 0}, // FD_MAX_NUM_AUTOCOR_FUNC_VALUES_TO_CHECK -{ 0xA010, 0x00CC, WORD_LEN, 0 }, // FD_MIN_EXPECTED50HZ_FLICKER_PERIOD -{ 0xA012, 0x00E0, WORD_LEN, 0 }, // FD_MAX_EXPECTED50HZ_FLICKER_PERIOD -{ 0xA014, 0x00A8, WORD_LEN, 0 }, // FD_MIN_EXPECTED60HZ_FLICKER_PERIOD -{ 0xA016, 0x00BC, WORD_LEN, 0 }, // FD_MAX_EXPECTED60HZ_FLICKER_PERIOD -{ 0xA018, 0x00D6, WORD_LEN, 0 }, // FD_EXPECTED50HZ_FLICKER_PERIOD_IN_CONTEXT_A -{ 0xA01A, 0x0075, WORD_LEN, 0 }, // FD_EXPECTED50HZ_FLICKER_PERIOD_IN_CONTEXT_B -{ 0xA01C, 0x00B2, WORD_LEN, 0 }, // FD_EXPECTED60HZ_FLICKER_PERIOD_IN_CONTEXT_A -{ 0xA01E, 0x0062, WORD_LEN, 0 }, // FD_EXPECTED60HZ_FLICKER_PERIOD_IN_CONTEXT_B -{ 0xA000, 0x10, BYTE_LEN, 0}, // FD_STATUS -{ 0x8417, 0x02, BYTE_LEN, 0}, // SEQ_STATE_CFG_1_FD -//delay = 100 -{ SEQUENCE_WAIT_MS,100, BYTE_LEN, 0}, - - -//[Step2-Fixups] -// Default variable access mode is always logical. - - -{ 0x098E, 0x0000, WORD_LEN, 0}, // LOGICAL_ADDRESS_ACCESS -{ 0x301A, 0x0030, WORD_LEN, 0}, // RESET_REGISTER -{ 0x316C, 0xB430, WORD_LEN, 0}, // DAC_TXLO -{ 0x31E0, 0x0003, WORD_LEN, 0}, // PIX_DEF_ID -{ 0x3E2E, 0xF319, WORD_LEN, 0}, // SAMP_SPARE -{ 0x3EE6, 0xA7C1, WORD_LEN, 0}, // DAC_LD_26_27 -{ 0x301E, 0x00A8, WORD_LEN, 0}, // DATA_PEDESTAL -{ 0xDC33, 0x2A, BYTE_LEN, 0}, // SYS_FIRST_BLACK_LEVEL -{ 0x3812, 0x212C, WORD_LEN, 0}, // OTPM_CFG -{ 0x0982, 0x0000, WORD_LEN, 0}, // ACCESS_CTL_STAT -{ 0x098A, 0x0000, WORD_LEN, 0}, // PHYSICAL_ADDRESS_ACCESS -{ 0x886C, 0xC0F1, WORD_LEN, 0}, -{ 0x886E, 0xC5E1, WORD_LEN, 0}, -{ 0x8870, 0x246A, WORD_LEN, 0}, -{ 0x8872, 0x1280, WORD_LEN, 0}, -{ 0x8874, 0xC4E1, WORD_LEN, 0}, -{ 0x8876, 0xD20F, WORD_LEN, 0}, -{ 0x8878, 0x2069, WORD_LEN, 0}, -{ 0x887A, 0x0000, WORD_LEN, 0}, -{ 0x887C, 0x6A62, WORD_LEN, 0}, -{ 0x887E, 0x1303, WORD_LEN, 0}, -{ 0x8880, 0x0084, WORD_LEN, 0}, -{ 0x8882, 0x1734, WORD_LEN, 0}, -{ 0x8884, 0x7005, WORD_LEN, 0}, -{ 0x8886, 0xD801, WORD_LEN, 0}, -{ 0x8888, 0x8A41, WORD_LEN, 0}, -{ 0x888A, 0xD900, WORD_LEN, 0}, -{ 0x888C, 0x0D5A, WORD_LEN, 0}, -{ 0x888E, 0x0664, WORD_LEN, 0}, -{ 0x8890, 0x8B61, WORD_LEN, 0}, -{ 0x8892, 0xE80B, WORD_LEN, 0}, -{ 0x8894, 0x000D, WORD_LEN, 0}, -{ 0x8896, 0x0020, WORD_LEN, 0}, -{ 0x8898, 0xD508, WORD_LEN, 0}, -{ 0x889A, 0x1504, WORD_LEN, 0}, -{ 0x889C, 0x1400, WORD_LEN, 0}, -{ 0x889E, 0x7840, WORD_LEN, 0}, -{ 0x88A0, 0xD007, WORD_LEN, 0}, -{ 0x88A2, 0x0DFB, WORD_LEN, 0}, -{ 0x88A4, 0x9004, WORD_LEN, 0}, -{ 0x88A6, 0xC4C1, WORD_LEN, 0}, -{ 0x88A8, 0x2029, WORD_LEN, 0}, -{ 0x88AA, 0x0300, WORD_LEN, 0}, -{ 0x88AC, 0x0219, WORD_LEN, 0}, -{ 0x88AE, 0x06C4, WORD_LEN, 0}, -{ 0x88B0, 0xFF80, WORD_LEN, 0}, -{ 0x88B2, 0x08D4, WORD_LEN, 0}, -{ 0x88B4, 0xFF80, WORD_LEN, 0}, -{ 0x88B6, 0x086C, WORD_LEN, 0}, -{ 0x88B8, 0xFF80, WORD_LEN, 0}, -{ 0x88BA, 0x08C0, WORD_LEN, 0}, -{ 0x88BC, 0xFF80, WORD_LEN, 0}, -{ 0x88BE, 0x08D4, WORD_LEN, 0}, -{ 0x88C0, 0xFF80, WORD_LEN, 0}, -{ 0x88C2, 0x08DC, WORD_LEN, 0}, -{ 0x88C4, 0xFF80, WORD_LEN, 0}, -{ 0x88C6, 0x0F58, WORD_LEN, 0}, -{ 0x88C8, 0xFF80, WORD_LEN, 0}, -{ 0x88CA, 0x0920, WORD_LEN, 0}, -{ 0x88CC, 0xFF80, WORD_LEN, 0}, -{ 0x88CE, 0x1010, WORD_LEN, 0}, -{ 0x88D0, 0xFF80, WORD_LEN, 0}, -{ 0x88D2, 0x1030, WORD_LEN, 0}, -{ 0x88D4, 0x0010, WORD_LEN, 0}, -{ 0x88D6, 0x0008, WORD_LEN, 0}, -{ 0x88D8, 0x0000, WORD_LEN, 0}, -{ 0x88DA, 0x0000, WORD_LEN, 0}, -{ 0x88DC, 0xD102, WORD_LEN, 0}, -{ 0x88DE, 0xD003, WORD_LEN, 0}, -{ 0x88E0, 0x7FE0, WORD_LEN, 0}, -{ 0x88E2, 0xB035, WORD_LEN, 0}, -{ 0x88E4, 0xFF80, WORD_LEN, 0}, -{ 0x88E6, 0x10C8, WORD_LEN, 0}, -{ 0x88E8, 0xFF80, WORD_LEN, 0}, -{ 0x88EA, 0x0118, WORD_LEN, 0}, -{ 0x88EC, 0xC0F1, WORD_LEN, 0}, -{ 0x88EE, 0xC5E1, WORD_LEN, 0}, -{ 0x88F0, 0xD5EC, WORD_LEN, 0}, -{ 0x88F2, 0x8D04, WORD_LEN, 0}, -{ 0x88F4, 0x8D25, WORD_LEN, 0}, -{ 0x88F6, 0xB808, WORD_LEN, 0}, -{ 0x88F8, 0x7825, WORD_LEN, 0}, -{ 0x88FA, 0x0821, WORD_LEN, 0}, -{ 0x88FC, 0x01DE, WORD_LEN, 0}, -{ 0x88FE, 0xD0EA, WORD_LEN, 0}, -{ 0x8900, 0x8000, WORD_LEN, 0}, -{ 0x8902, 0x8008, WORD_LEN, 0}, -{ 0x8904, 0x7840, WORD_LEN, 0}, -{ 0x8906, 0x8D04, WORD_LEN, 0}, -{ 0x8908, 0x8D25, WORD_LEN, 0}, -{ 0x890A, 0xB808, WORD_LEN, 0}, -{ 0x890C, 0x7825, WORD_LEN, 0}, -{ 0x890E, 0xB8A7, WORD_LEN, 0}, -{ 0x8910, 0x2841, WORD_LEN, 0}, -{ 0x8912, 0x0201, WORD_LEN, 0}, -{ 0x8914, 0xAD24, WORD_LEN, 0}, -{ 0x8916, 0xAD05, WORD_LEN, 0}, -{ 0x8918, 0x09A6, WORD_LEN, 0}, -{ 0x891A, 0x0104, WORD_LEN, 0}, -{ 0x891C, 0x01A9, WORD_LEN, 0}, -{ 0x891E, 0x06C4, WORD_LEN, 0}, -{ 0x8920, 0xC0F1, WORD_LEN, 0}, -{ 0x8922, 0x0932, WORD_LEN, 0}, -{ 0x8924, 0x06E4, WORD_LEN, 0}, -{ 0x8926, 0xDA38, WORD_LEN, 0}, -{ 0x8928, 0xD1E0, WORD_LEN, 0}, -{ 0x892A, 0xD5E1, WORD_LEN, 0}, -{ 0x892C, 0x76A9, WORD_LEN, 0}, -{ 0x892E, 0x0EC6, WORD_LEN, 0}, -{ 0x8930, 0x06A4, WORD_LEN, 0}, -{ 0x8932, 0x70C9, WORD_LEN, 0}, -{ 0x8934, 0xD0DF, WORD_LEN, 0}, -{ 0x8936, 0xA501, WORD_LEN, 0}, -{ 0x8938, 0xD0DF, WORD_LEN, 0}, -{ 0x893A, 0xA503, WORD_LEN, 0}, -{ 0x893C, 0xD0DF, WORD_LEN, 0}, -{ 0x893E, 0xA506, WORD_LEN, 0}, -{ 0x8940, 0xD0DF, WORD_LEN, 0}, -{ 0x8942, 0xA509, WORD_LEN, 0}, -{ 0x8944, 0xD0D8, WORD_LEN, 0}, -{ 0x8946, 0xA0C0, WORD_LEN, 0}, -{ 0x8948, 0xD0DE, WORD_LEN, 0}, -{ 0x894A, 0x802E, WORD_LEN, 0}, -{ 0x894C, 0x9117, WORD_LEN, 0}, -{ 0x894E, 0x0171, WORD_LEN, 0}, -{ 0x8950, 0x06E4, WORD_LEN, 0}, -{ 0x8952, 0xB10E, WORD_LEN, 0}, -{ 0x8954, 0xC0F1, WORD_LEN, 0}, -{ 0x8956, 0xD0D3, WORD_LEN, 0}, -{ 0x8958, 0x8806, WORD_LEN, 0}, -{ 0x895A, 0x080F, WORD_LEN, 0}, -{ 0x895C, 0x0051, WORD_LEN, 0}, -{ 0x895E, 0xD0D2, WORD_LEN, 0}, -{ 0x8960, 0x8000, WORD_LEN, 0}, -{ 0x8962, 0x8008, WORD_LEN, 0}, -{ 0x8964, 0x7840, WORD_LEN, 0}, -{ 0x8966, 0x0A1E, WORD_LEN, 0}, -{ 0x8968, 0x0104, WORD_LEN, 0}, -{ 0x896A, 0xC0D1, WORD_LEN, 0}, -{ 0x896C, 0x7EE0, WORD_LEN, 0}, -{ 0x896E, 0x78E0, WORD_LEN, 0}, -{ 0x8970, 0xC0F1, WORD_LEN, 0}, -{ 0x8972, 0x08D6, WORD_LEN, 0}, -{ 0x8974, 0x06C4, WORD_LEN, 0}, -{ 0x8976, 0xD7CC, WORD_LEN, 0}, -{ 0x8978, 0x8700, WORD_LEN, 0}, -{ 0x897A, 0x8009, WORD_LEN, 0}, -{ 0x897C, 0x7840, WORD_LEN, 0}, -{ 0x897E, 0xE080, WORD_LEN, 0}, -{ 0x8980, 0x0276, WORD_LEN, 0}, -{ 0x8982, 0x0002, WORD_LEN, 0}, -{ 0x8984, 0xD5C7, WORD_LEN, 0}, -{ 0x8986, 0xD6D0, WORD_LEN, 0}, -{ 0x8988, 0x1530, WORD_LEN, 0}, -{ 0x898A, 0x1081, WORD_LEN, 0}, -{ 0x898C, 0x1531, WORD_LEN, 0}, -{ 0x898E, 0x1080, WORD_LEN, 0}, -{ 0x8990, 0xB908, WORD_LEN, 0}, -{ 0x8992, 0x7905, WORD_LEN, 0}, -{ 0x8994, 0x2941, WORD_LEN, 0}, -{ 0x8996, 0x0200, WORD_LEN, 0}, -{ 0x8998, 0x1D32, WORD_LEN, 0}, -{ 0x899A, 0x1002, WORD_LEN, 0}, -{ 0x899C, 0x1D33, WORD_LEN, 0}, -{ 0x899E, 0x1042, WORD_LEN, 0}, -{ 0x89A0, 0x962D, WORD_LEN, 0}, -{ 0x89A2, 0x2540, WORD_LEN, 0}, -{ 0x89A4, 0x15D1, WORD_LEN, 0}, -{ 0x89A6, 0x2941, WORD_LEN, 0}, -{ 0x89A8, 0x0200, WORD_LEN, 0}, -{ 0x89AA, 0x1D30, WORD_LEN, 0}, -{ 0x89AC, 0x1002, WORD_LEN, 0}, -{ 0x89AE, 0x8D06, WORD_LEN, 0}, -{ 0x89B0, 0x2540, WORD_LEN, 0}, -{ 0x89B2, 0x1610, WORD_LEN, 0}, -{ 0x89B4, 0x1D31, WORD_LEN, 0}, -{ 0x89B6, 0x1042, WORD_LEN, 0}, -{ 0x89B8, 0x081B, WORD_LEN, 0}, -{ 0x89BA, 0x0051, WORD_LEN, 0}, -{ 0x89BC, 0x8700, WORD_LEN, 0}, -{ 0x89BE, 0x8008, WORD_LEN, 0}, -{ 0x89C0, 0x7840, WORD_LEN, 0}, -{ 0x89C2, 0xD900, WORD_LEN, 0}, -{ 0x89C4, 0x2941, WORD_LEN, 0}, -{ 0x89C6, 0x0200, WORD_LEN, 0}, -{ 0x89C8, 0xAD00, WORD_LEN, 0}, -{ 0x89CA, 0xAD21, WORD_LEN, 0}, -{ 0x89CC, 0xD801, WORD_LEN, 0}, -{ 0x89CE, 0x1D4D, WORD_LEN, 0}, -{ 0x89D0, 0x1002, WORD_LEN, 0}, -{ 0x89D2, 0x154D, WORD_LEN, 0}, -{ 0x89D4, 0x1080, WORD_LEN, 0}, -{ 0x89D6, 0xB861, WORD_LEN, 0}, -{ 0x89D8, 0xE085, WORD_LEN, 0}, -{ 0x89DA, 0x0218, WORD_LEN, 0}, -{ 0x89DC, 0x000D, WORD_LEN, 0}, -{ 0x89DE, 0x2740, WORD_LEN, 0}, -{ 0x89E0, 0x7381, WORD_LEN, 0}, -{ 0x89E2, 0x2132, WORD_LEN, 0}, -{ 0x89E4, 0x0000, WORD_LEN, 0}, -{ 0x89E6, 0x7914, WORD_LEN, 0}, -{ 0x89E8, 0x7900, WORD_LEN, 0}, -{ 0x89EA, 0x0323, WORD_LEN, 0}, -{ 0x89EC, 0x67BB, WORD_LEN, 0}, -{ 0x89EE, 0xD62E, WORD_LEN, 0}, -{ 0x89F0, 0x8D11, WORD_LEN, 0}, -{ 0x89F2, 0xD1B6, WORD_LEN, 0}, -{ 0x89F4, 0x8924, WORD_LEN, 0}, -{ 0x89F6, 0x2032, WORD_LEN, 0}, -{ 0x89F8, 0x2000, WORD_LEN, 0}, -{ 0x89FA, 0xDE02, WORD_LEN, 0}, -{ 0x89FC, 0x082B, WORD_LEN, 0}, -{ 0x89FE, 0x0040, WORD_LEN, 0}, -{ 0x8A00, 0x8D20, WORD_LEN, 0}, -{ 0x8A02, 0x8D41, WORD_LEN, 0}, -{ 0x8A04, 0xB908, WORD_LEN, 0}, -{ 0x8A06, 0x7945, WORD_LEN, 0}, -{ 0x8A08, 0xB983, WORD_LEN, 0}, -{ 0x8A0A, 0x2941, WORD_LEN, 0}, -{ 0x8A0C, 0x0202, WORD_LEN, 0}, -{ 0x8A0E, 0xAD40, WORD_LEN, 0}, -{ 0x8A10, 0xAD21, WORD_LEN, 0}, -{ 0x8A12, 0xD1AF, WORD_LEN, 0}, -{ 0x8A14, 0x8120, WORD_LEN, 0}, -{ 0x8A16, 0x8121, WORD_LEN, 0}, -{ 0x8A18, 0x7940, WORD_LEN, 0}, -{ 0x8A1A, 0x8D06, WORD_LEN, 0}, -{ 0x8A1C, 0xE001, WORD_LEN, 0}, -{ 0x8A1E, 0xAD06, WORD_LEN, 0}, -{ 0x8A20, 0x1D4D, WORD_LEN, 0}, -{ 0x8A22, 0x1382, WORD_LEN, 0}, -{ 0x8A24, 0xF0E9, WORD_LEN, 0}, -{ 0x8A26, 0x8D06, WORD_LEN, 0}, -{ 0x8A28, 0x1D4D, WORD_LEN, 0}, -{ 0x8A2A, 0x1382, WORD_LEN, 0}, -{ 0x8A2C, 0xE001, WORD_LEN, 0}, -{ 0x8A2E, 0xAD06, WORD_LEN, 0}, -{ 0x8A30, 0x8D00, WORD_LEN, 0}, -{ 0x8A32, 0x8D21, WORD_LEN, 0}, -{ 0x8A34, 0xB808, WORD_LEN, 0}, -{ 0x8A36, 0x7825, WORD_LEN, 0}, -{ 0x8A38, 0xB885, WORD_LEN, 0}, -{ 0x8A3A, 0x2841, WORD_LEN, 0}, -{ 0x8A3C, 0x0201, WORD_LEN, 0}, -{ 0x8A3E, 0xAD20, WORD_LEN, 0}, -{ 0x8A40, 0xAD01, WORD_LEN, 0}, -{ 0x8A42, 0x8D31, WORD_LEN, 0}, -{ 0x8A44, 0xF01A, WORD_LEN, 0}, -{ 0x8A46, 0x8D31, WORD_LEN, 0}, -{ 0x8A48, 0x8D12, WORD_LEN, 0}, -{ 0x8A4A, 0x8D46, WORD_LEN, 0}, -{ 0x8A4C, 0x7822, WORD_LEN, 0}, -{ 0x8A4E, 0x0863, WORD_LEN, 0}, -{ 0x8A50, 0x0082, WORD_LEN, 0}, -{ 0x8A52, 0x1532, WORD_LEN, 0}, -{ 0x8A54, 0x1080, WORD_LEN, 0}, -{ 0x8A56, 0x1533, WORD_LEN, 0}, -{ 0x8A58, 0x1081, WORD_LEN, 0}, -{ 0x8A5A, 0x1531, WORD_LEN, 0}, -{ 0x8A5C, 0x1082, WORD_LEN, 0}, -{ 0x8A5E, 0xB808, WORD_LEN, 0}, -{ 0x8A60, 0x7825, WORD_LEN, 0}, -{ 0x8A62, 0x1530, WORD_LEN, 0}, -{ 0x8A64, 0x1081, WORD_LEN, 0}, -{ 0x8A66, 0xB908, WORD_LEN, 0}, -{ 0x8A68, 0x7945, WORD_LEN, 0}, -{ 0x8A6A, 0xD29A, WORD_LEN, 0}, -{ 0x8A6C, 0x0992, WORD_LEN, 0}, -{ 0x8A6E, 0x0020, WORD_LEN, 0}, -{ 0x8A70, 0x8A40, WORD_LEN, 0}, -{ 0x8A72, 0x8D31, WORD_LEN, 0}, -{ 0x8A74, 0x081F, WORD_LEN, 0}, -{ 0x8A76, 0x0051, WORD_LEN, 0}, -{ 0x8A78, 0x8D06, WORD_LEN, 0}, -{ 0x8A7A, 0x6038, WORD_LEN, 0}, -{ 0x8A7C, 0xD194, WORD_LEN, 0}, -{ 0x8A7E, 0x8120, WORD_LEN, 0}, -{ 0x8A80, 0x8121, WORD_LEN, 0}, -{ 0x8A82, 0x7960, WORD_LEN, 0}, -{ 0x8A84, 0x2132, WORD_LEN, 0}, -{ 0x8A86, 0x2000, WORD_LEN, 0}, -{ 0x8A88, 0x8D06, WORD_LEN, 0}, -{ 0x8A8A, 0xE001, WORD_LEN, 0}, -{ 0x8A8C, 0xAD06, WORD_LEN, 0}, -{ 0x8A8E, 0xD806, WORD_LEN, 0}, -{ 0x8A90, 0xF0B1, WORD_LEN, 0}, -{ 0x8A92, 0xE88F, WORD_LEN, 0}, -{ 0x8A94, 0x8D66, WORD_LEN, 0}, -{ 0x8A96, 0x633B, WORD_LEN, 0}, -{ 0x8A98, 0x63BB, WORD_LEN, 0}, -{ 0x8A9A, 0xD08D, WORD_LEN, 0}, -{ 0x8A9C, 0x8000, WORD_LEN, 0}, -{ 0x8A9E, 0x8021, WORD_LEN, 0}, -{ 0x8AA0, 0x7960, WORD_LEN, 0}, -{ 0x8AA2, 0x8B17, WORD_LEN, 0}, -{ 0x8AA4, 0x8D06, WORD_LEN, 0}, -{ 0x8AA6, 0xE001, WORD_LEN, 0}, -{ 0x8AA8, 0xAD06, WORD_LEN, 0}, -{ 0x8AAA, 0xD803, WORD_LEN, 0}, -{ 0x8AAC, 0xF0A3, WORD_LEN, 0}, -{ 0x8AAE, 0x2032, WORD_LEN, 0}, -{ 0x8AB0, 0x2040, WORD_LEN, 0}, -{ 0x8AB2, 0xAD07, WORD_LEN, 0}, -{ 0x8AB4, 0xD804, WORD_LEN, 0}, -{ 0x8AB6, 0xF09F, WORD_LEN, 0}, -{ 0x8AB8, 0x1532, WORD_LEN, 0}, -{ 0x8ABA, 0x1080, WORD_LEN, 0}, -{ 0x8ABC, 0x1533, WORD_LEN, 0}, -{ 0x8ABE, 0x1081, WORD_LEN, 0}, -{ 0x8AC0, 0x1531, WORD_LEN, 0}, -{ 0x8AC2, 0x1082, WORD_LEN, 0}, -{ 0x8AC4, 0xB808, WORD_LEN, 0}, -{ 0x8AC6, 0x7825, WORD_LEN, 0}, -{ 0x8AC8, 0x1530, WORD_LEN, 0}, -{ 0x8ACA, 0x1081, WORD_LEN, 0}, -{ 0x8ACC, 0xB908, WORD_LEN, 0}, -{ 0x8ACE, 0x7945, WORD_LEN, 0}, -{ 0x8AD0, 0xD280, WORD_LEN, 0}, -{ 0x8AD2, 0x092E, WORD_LEN, 0}, -{ 0x8AD4, 0x0020, WORD_LEN, 0}, -{ 0x8AD6, 0x8A41, WORD_LEN, 0}, -{ 0x8AD8, 0x8D51, WORD_LEN, 0}, -{ 0x8ADA, 0x8D32, WORD_LEN, 0}, -{ 0x8ADC, 0x8DC6, WORD_LEN, 0}, -{ 0x8ADE, 0x7942, WORD_LEN, 0}, -{ 0x8AE0, 0x62DB, WORD_LEN, 0}, -{ 0x8AE2, 0x091F, WORD_LEN, 0}, -{ 0x8AE4, 0x03A2, WORD_LEN, 0}, -{ 0x8AE6, 0x63BB, WORD_LEN, 0}, -{ 0x8AE8, 0xE88B, WORD_LEN, 0}, -{ 0x8AEA, 0x8D00, WORD_LEN, 0}, -{ 0x8AEC, 0x8D21, WORD_LEN, 0}, -{ 0x8AEE, 0xB808, WORD_LEN, 0}, -{ 0x8AF0, 0x7825, WORD_LEN, 0}, -{ 0x8AF2, 0xB885, WORD_LEN, 0}, -{ 0x8AF4, 0x2841, WORD_LEN, 0}, -{ 0x8AF6, 0x0201, WORD_LEN, 0}, -{ 0x8AF8, 0xAD20, WORD_LEN, 0}, -{ 0x8AFA, 0xAD01, WORD_LEN, 0}, -{ 0x8AFC, 0xF1CF, WORD_LEN, 0}, -{ 0x8AFE, 0xDF04, WORD_LEN, 0}, -{ 0x8B00, 0x092B, WORD_LEN, 0}, -{ 0x8B02, 0x03A3, WORD_LEN, 0}, -{ 0x8B04, 0x1D4D, WORD_LEN, 0}, -{ 0x8B06, 0x13C2, WORD_LEN, 0}, -{ 0x8B08, 0x1530, WORD_LEN, 0}, -{ 0x8B0A, 0x108E, WORD_LEN, 0}, -{ 0x8B0C, 0x1531, WORD_LEN, 0}, -{ 0x8B0E, 0x1081, WORD_LEN, 0}, -{ 0x8B10, 0x1533, WORD_LEN, 0}, -{ 0x8B12, 0x108F, WORD_LEN, 0}, -{ 0x8B14, 0xBE08, WORD_LEN, 0}, -{ 0x8B16, 0x7E25, WORD_LEN, 0}, -{ 0x8B18, 0x1532, WORD_LEN, 0}, -{ 0x8B1A, 0x1081, WORD_LEN, 0}, -{ 0x8B1C, 0xB908, WORD_LEN, 0}, -{ 0x8B1E, 0x79E5, WORD_LEN, 0}, -{ 0x8B20, 0x0907, WORD_LEN, 0}, -{ 0x8B22, 0x0382, WORD_LEN, 0}, -{ 0x8B24, 0xE883, WORD_LEN, 0}, -{ 0x8B26, 0x8B16, WORD_LEN, 0}, -{ 0x8B28, 0xF002, WORD_LEN, 0}, -{ 0x8B2A, 0x8B15, WORD_LEN, 0}, -{ 0x8B2C, 0x8D22, WORD_LEN, 0}, -{ 0x8B2E, 0xAD07, WORD_LEN, 0}, -{ 0x8B30, 0x8D03, WORD_LEN, 0}, -{ 0x8B32, 0xD367, WORD_LEN, 0}, -{ 0x8B34, 0xB908, WORD_LEN, 0}, -{ 0x8B36, 0x8DC1, WORD_LEN, 0}, -{ 0x8B38, 0x7905, WORD_LEN, 0}, -{ 0x8B3A, 0x8D00, WORD_LEN, 0}, -{ 0x8B3C, 0xB808, WORD_LEN, 0}, -{ 0x8B3E, 0x78C5, WORD_LEN, 0}, -{ 0x8B40, 0x0921, WORD_LEN, 0}, -{ 0x8B42, 0x011E, WORD_LEN, 0}, -{ 0x8B44, 0xB883, WORD_LEN, 0}, -{ 0x8B46, 0x2841, WORD_LEN, 0}, -{ 0x8B48, 0x0201, WORD_LEN, 0}, -{ 0x8B4A, 0xAD20, WORD_LEN, 0}, -{ 0x8B4C, 0x8320, WORD_LEN, 0}, -{ 0x8B4E, 0xAD01, WORD_LEN, 0}, -{ 0x8B50, 0x8121, WORD_LEN, 0}, -{ 0x8B52, 0x7960, WORD_LEN, 0}, -{ 0x8B54, 0x2032, WORD_LEN, 0}, -{ 0x8B56, 0x2080, WORD_LEN, 0}, -{ 0x8B58, 0x8D06, WORD_LEN, 0}, -{ 0x8B5A, 0xE001, WORD_LEN, 0}, -{ 0x8B5C, 0xAD06, WORD_LEN, 0}, -{ 0x8B5E, 0xF04D, WORD_LEN, 0}, -{ 0x8B60, 0x8D00, WORD_LEN, 0}, -{ 0x8B62, 0x8D21, WORD_LEN, 0}, -{ 0x8B64, 0xB808, WORD_LEN, 0}, -{ 0x8B66, 0x7825, WORD_LEN, 0}, -{ 0x8B68, 0xB886, WORD_LEN, 0}, -{ 0x8B6A, 0x2841, WORD_LEN, 0}, -{ 0x8B6C, 0x0201, WORD_LEN, 0}, -{ 0x8B6E, 0xAD20, WORD_LEN, 0}, -{ 0x8B70, 0xAD01, WORD_LEN, 0}, -{ 0x8B72, 0xD057, WORD_LEN, 0}, -{ 0x8B74, 0x8000, WORD_LEN, 0}, -{ 0x8B76, 0x8021, WORD_LEN, 0}, -{ 0x8B78, 0x7960, WORD_LEN, 0}, -{ 0x8B7A, 0x8D07, WORD_LEN, 0}, -{ 0x8B7C, 0x1545, WORD_LEN, 0}, -{ 0x8B7E, 0x1080, WORD_LEN, 0}, -{ 0x8B80, 0x1546, WORD_LEN, 0}, -{ 0x8B82, 0x1081, WORD_LEN, 0}, -{ 0x8B84, 0xB808, WORD_LEN, 0}, -{ 0x8B86, 0x7825, WORD_LEN, 0}, -{ 0x8B88, 0x085D, WORD_LEN, 0}, -{ 0x8B8A, 0x005E, WORD_LEN, 0}, -{ 0x8B8C, 0x8D06, WORD_LEN, 0}, -{ 0x8B8E, 0xE001, WORD_LEN, 0}, -{ 0x8B90, 0xAD06, WORD_LEN, 0}, -{ 0x8B92, 0xD805, WORD_LEN, 0}, -{ 0x8B94, 0xF02F, WORD_LEN, 0}, -{ 0x8B96, 0x1530, WORD_LEN, 0}, -{ 0x8B98, 0x1082, WORD_LEN, 0}, -{ 0x8B9A, 0x1531, WORD_LEN, 0}, -{ 0x8B9C, 0x1080, WORD_LEN, 0}, -{ 0x8B9E, 0xD14D, WORD_LEN, 0}, -{ 0x8BA0, 0xBA08, WORD_LEN, 0}, -{ 0x8BA2, 0x7A05, WORD_LEN, 0}, -{ 0x8BA4, 0x8903, WORD_LEN, 0}, -{ 0x8BA6, 0x080F, WORD_LEN, 0}, -{ 0x8BA8, 0x0083, WORD_LEN, 0}, -{ 0x8BAA, 0x8902, WORD_LEN, 0}, -{ 0x8BAC, 0x8E44, WORD_LEN, 0}, -{ 0x8BAE, 0x0839, WORD_LEN, 0}, -{ 0x8BB0, 0x0082, WORD_LEN, 0}, -{ 0x8BB2, 0x1545, WORD_LEN, 0}, -{ 0x8BB4, 0x1082, WORD_LEN, 0}, -{ 0x8BB6, 0x1546, WORD_LEN, 0}, -{ 0x8BB8, 0x1080, WORD_LEN, 0}, -{ 0x8BBA, 0xBA08, WORD_LEN, 0}, -{ 0x8BBC, 0x7A05, WORD_LEN, 0}, -{ 0x8BBE, 0x0A29, WORD_LEN, 0}, -{ 0x8BC0, 0x005E, WORD_LEN, 0}, -{ 0x8BC2, 0x8D00, WORD_LEN, 0}, -{ 0x8BC4, 0x8D21, WORD_LEN, 0}, -{ 0x8BC6, 0xB808, WORD_LEN, 0}, -{ 0x8BC8, 0x7825, WORD_LEN, 0}, -{ 0x8BCA, 0xB88D, WORD_LEN, 0}, -{ 0x8BCC, 0x2841, WORD_LEN, 0}, -{ 0x8BCE, 0x0201, WORD_LEN, 0}, -{ 0x8BD0, 0xAD20, WORD_LEN, 0}, -{ 0x8BD2, 0xAD01, WORD_LEN, 0}, -{ 0x8BD4, 0x0A11, WORD_LEN, 0}, -{ 0x8BD6, 0x009E, WORD_LEN, 0}, -{ 0x8BD8, 0xD03D, WORD_LEN, 0}, -{ 0x8BDA, 0x8000, WORD_LEN, 0}, -{ 0x8BDC, 0x8021, WORD_LEN, 0}, -{ 0x8BDE, 0x7960, WORD_LEN, 0}, -{ 0x8BE0, 0x1550, WORD_LEN, 0}, -{ 0x8BE2, 0x1080, WORD_LEN, 0}, -{ 0x8BE4, 0xD800, WORD_LEN, 0}, -{ 0x8BE6, 0x09AA, WORD_LEN, 0}, -{ 0x8BE8, 0x0164, WORD_LEN, 0}, -{ 0x8BEA, 0x1D4D, WORD_LEN, 0}, -{ 0x8BEC, 0x1002, WORD_LEN, 0}, -{ 0x8BEE, 0xF005, WORD_LEN, 0}, -{ 0x8BF0, 0xD800, WORD_LEN, 0}, -{ 0x8BF2, 0x1D4D, WORD_LEN, 0}, -{ 0x8BF4, 0x1002, WORD_LEN, 0}, -{ 0x8BF6, 0x06B1, WORD_LEN, 0}, -{ 0x8BF8, 0x0684, WORD_LEN, 0}, -{ 0x8BFA, 0x78E0, WORD_LEN, 0}, -{ 0x8BFC, 0xC0F1, WORD_LEN, 0}, -{ 0x8BFE, 0x0E4E, WORD_LEN, 0}, -{ 0x8C00, 0x06A4, WORD_LEN, 0}, -{ 0x8C02, 0x7308, WORD_LEN, 0}, -{ 0x8C04, 0x0919, WORD_LEN, 0}, -{ 0x8C06, 0x0023, WORD_LEN, 0}, -{ 0x8C08, 0x721A, WORD_LEN, 0}, -{ 0x8C0A, 0xD026, WORD_LEN, 0}, -{ 0x8C0C, 0x1030, WORD_LEN, 0}, -{ 0x8C0E, 0x0082, WORD_LEN, 0}, -{ 0x8C10, 0x1031, WORD_LEN, 0}, -{ 0x8C12, 0x0081, WORD_LEN, 0}, -{ 0x8C14, 0xBA08, WORD_LEN, 0}, -{ 0x8C16, 0x7A25, WORD_LEN, 0}, -{ 0x8C18, 0xDD00, WORD_LEN, 0}, -{ 0x8C1A, 0xF005, WORD_LEN, 0}, -{ 0x8C1C, 0xDD01, WORD_LEN, 0}, -{ 0x8C1E, 0x7268, WORD_LEN, 0}, -{ 0x8C20, 0x7328, WORD_LEN, 0}, -{ 0x8C22, 0x2302, WORD_LEN, 0}, -{ 0x8C24, 0x0080, WORD_LEN, 0}, -{ 0x8C26, 0x2885, WORD_LEN, 0}, -{ 0x8C28, 0x0901, WORD_LEN, 0}, -{ 0x8C2A, 0x702F, WORD_LEN, 0}, -{ 0x8C2C, 0x0EFA, WORD_LEN, 0}, -{ 0x8C2E, 0x06A4, WORD_LEN, 0}, -{ 0x8C30, 0x7168, WORD_LEN, 0}, -{ 0x8C32, 0xD31C, WORD_LEN, 0}, -{ 0x8C34, 0x8BC6, WORD_LEN, 0}, -{ 0x8C36, 0x8B31, WORD_LEN, 0}, -{ 0x8C38, 0x780F, WORD_LEN, 0}, -{ 0x8C3A, 0xD226, WORD_LEN, 0}, -{ 0x8C3C, 0x663E, WORD_LEN, 0}, -{ 0x8C3E, 0xD123, WORD_LEN, 0}, -{ 0x8C40, 0xBE62, WORD_LEN, 0}, -{ 0x8C42, 0x7ECF, WORD_LEN, 0}, -{ 0x8C44, 0x89E4, WORD_LEN, 0}, -{ 0x8C46, 0x2214, WORD_LEN, 0}, -{ 0x8C48, 0x0381, WORD_LEN, 0}, -{ 0x8C4A, 0xED07, WORD_LEN, 0}, -{ 0x8C4C, 0x2840, WORD_LEN, 0}, -{ 0x8C4E, 0x020E, WORD_LEN, 0}, -{ 0x8C50, 0x7EE5, WORD_LEN, 0}, -{ 0x8C52, 0xB1CC, WORD_LEN, 0}, -{ 0x8C54, 0xF007, WORD_LEN, 0}, -{ 0x8C56, 0x7E12, WORD_LEN, 0}, -{ 0x8C58, 0xE601, WORD_LEN, 0}, -{ 0x8C5A, 0x7ECF, WORD_LEN, 0}, -{ 0x8C5C, 0xBE08, WORD_LEN, 0}, -{ 0x8C5E, 0x7FC5, WORD_LEN, 0}, -{ 0x8C60, 0xB1EC, WORD_LEN, 0}, -{ 0x8C62, 0x080D, WORD_LEN, 0}, -{ 0x8C64, 0x2003, WORD_LEN, 0}, -{ 0x8C66, 0xED0D, WORD_LEN, 0}, -{ 0x8C68, 0xD800, WORD_LEN, 0}, -{ 0x8C6A, 0xF01A, WORD_LEN, 0}, -{ 0x8C6C, 0x134D, WORD_LEN, 0}, -{ 0x8C6E, 0x0080, WORD_LEN, 0}, -{ 0x8C70, 0x080B, WORD_LEN, 0}, -{ 0x8C72, 0x0190, WORD_LEN, 0}, -{ 0x8C74, 0x8A0E, WORD_LEN, 0}, -{ 0x8C76, 0x080B, WORD_LEN, 0}, -{ 0x8C78, 0x0291, WORD_LEN, 0}, -{ 0x8C7A, 0xD801, WORD_LEN, 0}, -{ 0x8C7C, 0xF010, WORD_LEN, 0}, -{ 0x8C7E, 0x1330, WORD_LEN, 0}, -{ 0x8C80, 0x0081, WORD_LEN, 0}, -{ 0x8C82, 0x1331, WORD_LEN, 0}, -{ 0x8C84, 0x008D, WORD_LEN, 0}, -{ 0x8C86, 0xD802, WORD_LEN, 0}, -{ 0x8C88, 0xB908, WORD_LEN, 0}, -{ 0x8C8A, 0x79A5, WORD_LEN, 0}, -{ 0x8C8C, 0xB22A, WORD_LEN, 0}, -{ 0x8C8E, 0x1332, WORD_LEN, 0}, -{ 0x8C90, 0x0081, WORD_LEN, 0}, -{ 0x8C92, 0x1333, WORD_LEN, 0}, -{ 0x8C94, 0x008D, WORD_LEN, 0}, -{ 0x8C96, 0xB908, WORD_LEN, 0}, -{ 0x8C98, 0x79A5, WORD_LEN, 0}, -{ 0x8C9A, 0xB22B, WORD_LEN, 0}, -{ 0x8C9C, 0x0611, WORD_LEN, 0}, -{ 0x8C9E, 0x0684, WORD_LEN, 0}, -{ 0x8CA0, 0xFF80, WORD_LEN, 0}, -{ 0x8CA2, 0x0290, WORD_LEN, 0}, -{ 0x8CA4, 0x8000, WORD_LEN, 0}, -{ 0x8CA6, 0x008C, WORD_LEN, 0}, -{ 0x8CA8, 0x0000, WORD_LEN, 0}, -{ 0x8CAA, 0xF3BC, WORD_LEN, 0}, -{ 0x8CAC, 0xFF80, WORD_LEN, 0}, -{ 0x8CAE, 0x1120, WORD_LEN, 0}, -{ 0x8CB0, 0xFF80, WORD_LEN, 0}, -{ 0x8CB2, 0x08EC, WORD_LEN, 0}, -{ 0x8CB4, 0xFF80, WORD_LEN, 0}, -{ 0x8CB6, 0x0954, WORD_LEN, 0}, -{ 0x8CB8, 0xFF80, WORD_LEN, 0}, -{ 0x8CBA, 0x0970, WORD_LEN, 0}, -{ 0x8CBC, 0xFF80, WORD_LEN, 0}, -{ 0x8CBE, 0x0CD4, WORD_LEN, 0}, -{ 0x8CC0, 0xFF80, WORD_LEN, 0}, -{ 0x8CC2, 0x06C8, WORD_LEN, 0}, -{ 0x8CC4, 0xFF80, WORD_LEN, 0}, -{ 0x8CC6, 0x050C, WORD_LEN, 0}, -{ 0x8CC8, 0xFF80, WORD_LEN, 0}, -{ 0x8CCA, 0x0158, WORD_LEN, 0}, -{ 0x8CCC, 0x8000, WORD_LEN, 0}, -{ 0x8CCE, 0x0008, WORD_LEN, 0}, -{ 0x8CD0, 0xFF80, WORD_LEN, 0}, -{ 0x8CD2, 0x10C8, WORD_LEN, 0}, -{ 0x8CD4, 0xC0F1, WORD_LEN, 0}, -{ 0x8CD6, 0x0D7E, WORD_LEN, 0}, -{ 0x8CD8, 0x0684, WORD_LEN, 0}, -{ 0x8CDA, 0x17C8, WORD_LEN, 0}, -{ 0x8CDC, 0xF00D, WORD_LEN, 0}, -{ 0x8CDE, 0x1545, WORD_LEN, 0}, -{ 0x8CE0, 0x1080, WORD_LEN, 0}, -{ 0x8CE2, 0x1546, WORD_LEN, 0}, -{ 0x8CE4, 0x1081, WORD_LEN, 0}, -{ 0x8CE6, 0xB808, WORD_LEN, 0}, -{ 0x8CE8, 0x7825, WORD_LEN, 0}, -{ 0x8CEA, 0xB8E0, WORD_LEN, 0}, -{ 0x8CEC, 0xDE00, WORD_LEN, 0}, -{ 0x8CEE, 0xF208, WORD_LEN, 0}, -{ 0x8CF0, 0x8D00, WORD_LEN, 0}, -{ 0x8CF2, 0x8D21, WORD_LEN, 0}, -{ 0x8CF4, 0xB808, WORD_LEN, 0}, -{ 0x8CF6, 0x7825, WORD_LEN, 0}, -{ 0x8CF8, 0x2044, WORD_LEN, 0}, -{ 0x8CFA, 0x020E, WORD_LEN, 0}, -{ 0x8CFC, 0x8D00, WORD_LEN, 0}, -{ 0x8CFE, 0x8D21, WORD_LEN, 0}, -{ 0x8D00, 0xB808, WORD_LEN, 0}, -{ 0x8D02, 0x7825, WORD_LEN, 0}, -{ 0x8D04, 0x082F, WORD_LEN, 0}, -{ 0x8D06, 0x00DE, WORD_LEN, 0}, -{ 0x8D08, 0x7108, WORD_LEN, 0}, -{ 0x8D0A, 0x2186, WORD_LEN, 0}, -{ 0x8D0C, 0x0FFE, WORD_LEN, 0}, -{ 0x8D0E, 0x262F, WORD_LEN, 0}, -{ 0x8D10, 0xF04A, WORD_LEN, 0}, -{ 0x8D12, 0xF211, WORD_LEN, 0}, -{ 0x8D14, 0x17BC, WORD_LEN, 0}, -{ 0x8D16, 0xF002, WORD_LEN, 0}, -{ 0x8D18, 0x8A25, WORD_LEN, 0}, -{ 0x8D1A, 0xE906, WORD_LEN, 0}, -{ 0x8D1C, 0xB961, WORD_LEN, 0}, -{ 0x8D1E, 0xAA25, WORD_LEN, 0}, -{ 0x8D20, 0xD806, WORD_LEN, 0}, -{ 0x8D22, 0xF01E, WORD_LEN, 0}, -{ 0x8D24, 0x8A24, WORD_LEN, 0}, -{ 0x8D26, 0xB8A3, WORD_LEN, 0}, -{ 0x8D28, 0xAA25, WORD_LEN, 0}, -{ 0x8D2A, 0x2841, WORD_LEN, 0}, -{ 0x8D2C, 0x0201, WORD_LEN, 0}, -{ 0x8D2E, 0xAD20, WORD_LEN, 0}, -{ 0x8D30, 0xAD01, WORD_LEN, 0}, -{ 0x8D32, 0x0D56, WORD_LEN, 0}, -{ 0x8D34, 0x0144, WORD_LEN, 0}, -{ 0x8D36, 0x1545, WORD_LEN, 0}, -{ 0x8D38, 0x1081, WORD_LEN, 0}, -{ 0x8D3A, 0x1546, WORD_LEN, 0}, -{ 0x8D3C, 0x1082, WORD_LEN, 0}, -{ 0x8D3E, 0xB908, WORD_LEN, 0}, -{ 0x8D40, 0x7945, WORD_LEN, 0}, -{ 0x8D42, 0xB9E0, WORD_LEN, 0}, -{ 0x8D44, 0x26CC, WORD_LEN, 0}, -{ 0x8D46, 0x9022, WORD_LEN, 0}, -{ 0x8D48, 0xF20A, WORD_LEN, 0}, -{ 0x8D4A, 0x8D20, WORD_LEN, 0}, -{ 0x8D4C, 0x8D41, WORD_LEN, 0}, -{ 0x8D4E, 0xB908, WORD_LEN, 0}, -{ 0x8D50, 0x7945, WORD_LEN, 0}, -{ 0x8D52, 0xB983, WORD_LEN, 0}, -{ 0x8D54, 0x2941, WORD_LEN, 0}, -{ 0x8D56, 0x0202, WORD_LEN, 0}, -{ 0x8D58, 0xAD40, WORD_LEN, 0}, -{ 0x8D5A, 0xAD21, WORD_LEN, 0}, -{ 0x8D5C, 0x0561, WORD_LEN, 0}, -{ 0x8D5E, 0x0684, WORD_LEN, 0}, -{ 0x8D60, 0xC0F1, WORD_LEN, 0}, -{ 0x8D62, 0x0CEE, WORD_LEN, 0}, -{ 0x8D64, 0x06A4, WORD_LEN, 0}, -{ 0x8D66, 0x7098, WORD_LEN, 0}, -{ 0x8D68, 0xD284, WORD_LEN, 0}, -{ 0x8D6A, 0x1206, WORD_LEN, 0}, -{ 0x8D6C, 0x0086, WORD_LEN, 0}, -{ 0x8D6E, 0x2240, WORD_LEN, 0}, -{ 0x8D70, 0x0205, WORD_LEN, 0}, -{ 0x8D72, 0x264C, WORD_LEN, 0}, -{ 0x8D74, 0x8000, WORD_LEN, 0}, -{ 0x8D76, 0x20CA, WORD_LEN, 0}, -{ 0x8D78, 0x0101, WORD_LEN, 0}, -{ 0x8D7A, 0xF237, WORD_LEN, 0}, -{ 0x8D7C, 0x8AA7, WORD_LEN, 0}, -{ 0x8D7E, 0x6D69, WORD_LEN, 0}, -{ 0x8D80, 0x7B6D, WORD_LEN, 0}, -{ 0x8D82, 0x0B3F, WORD_LEN, 0}, -{ 0x8D84, 0x0012, WORD_LEN, 0}, -{ 0x8D86, 0x7068, WORD_LEN, 0}, -{ 0x8D88, 0x780D, WORD_LEN, 0}, -{ 0x8D8A, 0x2040, WORD_LEN, 0}, -{ 0x8D8C, 0x007C, WORD_LEN, 0}, -{ 0x8D8E, 0x20A8, WORD_LEN, 0}, -{ 0x8D90, 0x0640, WORD_LEN, 0}, -{ 0x8D92, 0x71CF, WORD_LEN, 0}, -{ 0x8D94, 0xFF80, WORD_LEN, 0}, -{ 0x8D96, 0x0158, WORD_LEN, 0}, -{ 0x8D98, 0x8924, WORD_LEN, 0}, -{ 0x8D9A, 0x2532, WORD_LEN, 0}, -{ 0x8D9C, 0x00C0, WORD_LEN, 0}, -{ 0x8D9E, 0xBD61, WORD_LEN, 0}, -{ 0x8DA0, 0x0819, WORD_LEN, 0}, -{ 0x8DA2, 0x0063, WORD_LEN, 0}, -{ 0x8DA4, 0x7DAF, WORD_LEN, 0}, -{ 0x8DA6, 0x76CF, WORD_LEN, 0}, -{ 0x8DA8, 0xFF80, WORD_LEN, 0}, -{ 0x8DAA, 0x0290, WORD_LEN, 0}, -{ 0x8DAC, 0x8EF1, WORD_LEN, 0}, -{ 0x8DAE, 0x2640, WORD_LEN, 0}, -{ 0x8DB0, 0x1601, WORD_LEN, 0}, -{ 0x8DB2, 0x61E9, WORD_LEN, 0}, -{ 0x8DB4, 0x090F, WORD_LEN, 0}, -{ 0x8DB6, 0x0002, WORD_LEN, 0}, -{ 0x8DB8, 0xAAA7, WORD_LEN, 0}, -{ 0x8DBA, 0xBB61, WORD_LEN, 0}, -{ 0x8DBC, 0x7B6D, WORD_LEN, 0}, -{ 0x8DBE, 0x7088, WORD_LEN, 0}, -{ 0x8DC0, 0xF005, WORD_LEN, 0}, -{ 0x8DC2, 0x8E26, WORD_LEN, 0}, -{ 0x8DC4, 0xAAA7, WORD_LEN, 0}, -{ 0x8DC6, 0xB961, WORD_LEN, 0}, -{ 0x8DC8, 0xAE26, WORD_LEN, 0}, -{ 0x8DCA, 0x0B1F, WORD_LEN, 0}, -{ 0x8DCC, 0x0013, WORD_LEN, 0}, -{ 0x8DCE, 0x1A07, WORD_LEN, 0}, -{ 0x8DD0, 0x0182, WORD_LEN, 0}, -{ 0x8DD2, 0xD26B, WORD_LEN, 0}, -{ 0x8DD4, 0x8A20, WORD_LEN, 0}, -{ 0x8DD6, 0x8A61, WORD_LEN, 0}, -{ 0x8DD8, 0xB908, WORD_LEN, 0}, -{ 0x8DDA, 0x7965, WORD_LEN, 0}, -{ 0x8DDC, 0xB9A3, WORD_LEN, 0}, -{ 0x8DDE, 0x2941, WORD_LEN, 0}, -{ 0x8DE0, 0x020C, WORD_LEN, 0}, -{ 0x8DE2, 0xAA80, WORD_LEN, 0}, -{ 0x8DE4, 0xAA21, WORD_LEN, 0}, -{ 0x8DE6, 0x04D1, WORD_LEN, 0}, -{ 0x8DE8, 0x0684, WORD_LEN, 0}, -{ 0x8DEA, 0x78E0, WORD_LEN, 0}, -{ 0x8DEC, 0xC0F1, WORD_LEN, 0}, -{ 0x8DEE, 0xC5E1, WORD_LEN, 0}, -{ 0x8DF0, 0xD363, WORD_LEN, 0}, -{ 0x8DF2, 0x8B24, WORD_LEN, 0}, -{ 0x8DF4, 0x8B45, WORD_LEN, 0}, -{ 0x8DF6, 0xB908, WORD_LEN, 0}, -{ 0x8DF8, 0x7945, WORD_LEN, 0}, -{ 0x8DFA, 0xE188, WORD_LEN, 0}, -{ 0x8DFC, 0x21CC, WORD_LEN, 0}, -{ 0x8DFE, 0x8422, WORD_LEN, 0}, -{ 0x8E00, 0xF41F, WORD_LEN, 0}, -{ 0x8E02, 0x8B26, WORD_LEN, 0}, -{ 0x8E04, 0x093B, WORD_LEN, 0}, -{ 0x8E06, 0x0051, WORD_LEN, 0}, -{ 0x8E08, 0xD15C, WORD_LEN, 0}, -{ 0x8E0A, 0xD80A, WORD_LEN, 0}, -{ 0x8E0C, 0xA90E, WORD_LEN, 0}, -{ 0x8E0E, 0xD05D, WORD_LEN, 0}, -{ 0x8E10, 0x8804, WORD_LEN, 0}, -{ 0x8E12, 0x1330, WORD_LEN, 0}, -{ 0x8E14, 0x0082, WORD_LEN, 0}, -{ 0x8E16, 0x1331, WORD_LEN, 0}, -{ 0x8E18, 0x008D, WORD_LEN, 0}, -{ 0x8E1A, 0xBA08, WORD_LEN, 0}, -{ 0x8E1C, 0x7AA5, WORD_LEN, 0}, -{ 0x8E1E, 0xB148, WORD_LEN, 0}, -{ 0x8E20, 0x8952, WORD_LEN, 0}, -{ 0x8E22, 0xA90F, WORD_LEN, 0}, -{ 0x8E24, 0x0813, WORD_LEN, 0}, -{ 0x8E26, 0x00A2, WORD_LEN, 0}, -{ 0x8E28, 0x132C, WORD_LEN, 0}, -{ 0x8E2A, 0x0083, WORD_LEN, 0}, -{ 0x8E2C, 0xDA00, WORD_LEN, 0}, -{ 0x8E2E, 0xA953, WORD_LEN, 0}, -{ 0x8E30, 0x7862, WORD_LEN, 0}, -{ 0x8E32, 0x780F, WORD_LEN, 0}, -{ 0x8E34, 0xF005, WORD_LEN, 0}, -{ 0x8E36, 0xDA01, WORD_LEN, 0}, -{ 0x8E38, 0xA953, WORD_LEN, 0}, -{ 0x8E3A, 0x6078, WORD_LEN, 0}, -{ 0x8E3C, 0x780F, WORD_LEN, 0}, -{ 0x8E3E, 0x080E, WORD_LEN, 0}, -{ 0x8E40, 0x0000, WORD_LEN, 0}, -{ 0x8E42, 0x0485, WORD_LEN, 0}, -{ 0x8E44, 0x0684, WORD_LEN, 0}, -{ 0x8E46, 0x78E0, WORD_LEN, 0}, -{ 0x8E48, 0xC0F1, WORD_LEN, 0}, -{ 0x8E4A, 0x0BFE, WORD_LEN, 0}, -{ 0x8E4C, 0x0684, WORD_LEN, 0}, -{ 0x8E4E, 0xD64D, WORD_LEN, 0}, -{ 0x8E50, 0x7508, WORD_LEN, 0}, -{ 0x8E52, 0x8E01, WORD_LEN, 0}, -{ 0x8E54, 0xD14A, WORD_LEN, 0}, -{ 0x8E56, 0x2046, WORD_LEN, 0}, -{ 0x8E58, 0x00C0, WORD_LEN, 0}, -{ 0x8E5A, 0xAE01, WORD_LEN, 0}, -{ 0x8E5C, 0x1145, WORD_LEN, 0}, -{ 0x8E5E, 0x0080, WORD_LEN, 0}, -{ 0x8E60, 0x1146, WORD_LEN, 0}, -{ 0x8E62, 0x0082, WORD_LEN, 0}, -{ 0x8E64, 0xB808, WORD_LEN, 0}, -{ 0x8E66, 0x7845, WORD_LEN, 0}, -{ 0x8E68, 0x0817, WORD_LEN, 0}, -{ 0x8E6A, 0x001E, WORD_LEN, 0}, -{ 0x8E6C, 0x8900, WORD_LEN, 0}, -{ 0x8E6E, 0x8941, WORD_LEN, 0}, -{ 0x8E70, 0xB808, WORD_LEN, 0}, -{ 0x8E72, 0x7845, WORD_LEN, 0}, -{ 0x8E74, 0x080B, WORD_LEN, 0}, -{ 0x8E76, 0x00DE, WORD_LEN, 0}, -{ 0x8E78, 0x70A9, WORD_LEN, 0}, -{ 0x8E7A, 0xFFBA, WORD_LEN, 0}, -{ 0x8E7C, 0x7508, WORD_LEN, 0}, -{ 0x8E7E, 0x1604, WORD_LEN, 0}, -{ 0x8E80, 0x1090, WORD_LEN, 0}, -{ 0x8E82, 0x0D93, WORD_LEN, 0}, -{ 0x8E84, 0x1400, WORD_LEN, 0}, -{ 0x8E86, 0x8EEA, WORD_LEN, 0}, -{ 0x8E88, 0x8E0B, WORD_LEN, 0}, -{ 0x8E8A, 0x214A, WORD_LEN, 0}, -{ 0x8E8C, 0x2040, WORD_LEN, 0}, -{ 0x8E8E, 0x8E2D, WORD_LEN, 0}, -{ 0x8E90, 0xBF08, WORD_LEN, 0}, -{ 0x8E92, 0x7F05, WORD_LEN, 0}, -{ 0x8E94, 0x8E0C, WORD_LEN, 0}, -{ 0x8E96, 0xB808, WORD_LEN, 0}, -{ 0x8E98, 0x7825, WORD_LEN, 0}, -{ 0x8E9A, 0x7710, WORD_LEN, 0}, -{ 0x8E9C, 0x21C2, WORD_LEN, 0}, -{ 0x8E9E, 0x244C, WORD_LEN, 0}, -{ 0x8EA0, 0x081D, WORD_LEN, 0}, -{ 0x8EA2, 0x03E3, WORD_LEN, 0}, -{ 0x8EA4, 0xD9FF, WORD_LEN, 0}, -{ 0x8EA6, 0x2702, WORD_LEN, 0}, -{ 0x8EA8, 0x1002, WORD_LEN, 0}, -{ 0x8EAA, 0x2A05, WORD_LEN, 0}, -{ 0x8EAC, 0x037E, WORD_LEN, 0}, -{ 0x8EAE, 0x0C7A, WORD_LEN, 0}, -{ 0x8EB0, 0x06A4, WORD_LEN, 0}, -{ 0x8EB2, 0x702F, WORD_LEN, 0}, -{ 0x8EB4, 0x7810, WORD_LEN, 0}, -{ 0x8EB6, 0x7F02, WORD_LEN, 0}, -{ 0x8EB8, 0x7FF0, WORD_LEN, 0}, -{ 0x8EBA, 0xF00B, WORD_LEN, 0}, -{ 0x8EBC, 0x78E2, WORD_LEN, 0}, -{ 0x8EBE, 0x2805, WORD_LEN, 0}, -{ 0x8EC0, 0x037E, WORD_LEN, 0}, -{ 0x8EC2, 0x0C66, WORD_LEN, 0}, -{ 0x8EC4, 0x06A4, WORD_LEN, 0}, -{ 0x8EC6, 0x702F, WORD_LEN, 0}, -{ 0x8EC8, 0x7810, WORD_LEN, 0}, -{ 0x8ECA, 0x671F, WORD_LEN, 0}, -{ 0x8ECC, 0x7FF0, WORD_LEN, 0}, -{ 0x8ECE, 0x7FEF, WORD_LEN, 0}, -{ 0x8ED0, 0x8E08, WORD_LEN, 0}, -{ 0x8ED2, 0xBF06, WORD_LEN, 0}, -{ 0x8ED4, 0xD12C, WORD_LEN, 0}, -{ 0x8ED6, 0xB8C3, WORD_LEN, 0}, -{ 0x8ED8, 0x78E5, WORD_LEN, 0}, -{ 0x8EDA, 0xB88F, WORD_LEN, 0}, -{ 0x8EDC, 0x1908, WORD_LEN, 0}, -{ 0x8EDE, 0x0024, WORD_LEN, 0}, -{ 0x8EE0, 0x2841, WORD_LEN, 0}, -{ 0x8EE2, 0x0201, WORD_LEN, 0}, -{ 0x8EE4, 0x1E26, WORD_LEN, 0}, -{ 0x8EE6, 0x1042, WORD_LEN, 0}, -{ 0x8EE8, 0x0D15, WORD_LEN, 0}, -{ 0x8EEA, 0x1423, WORD_LEN, 0}, -{ 0x8EEC, 0x1E27, WORD_LEN, 0}, -{ 0x8EEE, 0x1002, WORD_LEN, 0}, -{ 0x8EF0, 0x214C, WORD_LEN, 0}, -{ 0x8EF2, 0xA000, WORD_LEN, 0}, -{ 0x8EF4, 0x214A, WORD_LEN, 0}, -{ 0x8EF6, 0x2040, WORD_LEN, 0}, -{ 0x8EF8, 0x21C2, WORD_LEN, 0}, -{ 0x8EFA, 0x2442, WORD_LEN, 0}, -{ 0x8EFC, 0x8E21, WORD_LEN, 0}, -{ 0x8EFE, 0x214F, WORD_LEN, 0}, -{ 0x8F00, 0x0040, WORD_LEN, 0}, -{ 0x8F02, 0x090F, WORD_LEN, 0}, -{ 0x8F04, 0x2010, WORD_LEN, 0}, -{ 0x8F06, 0x2145, WORD_LEN, 0}, -{ 0x8F08, 0x0181, WORD_LEN, 0}, -{ 0x8F0A, 0xAE21, WORD_LEN, 0}, -{ 0x8F0C, 0xF003, WORD_LEN, 0}, -{ 0x8F0E, 0xB8A2, WORD_LEN, 0}, -{ 0x8F10, 0xAE01, WORD_LEN, 0}, -{ 0x8F12, 0x0FFE, WORD_LEN, 0}, -{ 0x8F14, 0xFFA3, WORD_LEN, 0}, -{ 0x8F16, 0x70A9, WORD_LEN, 0}, -{ 0x8F18, 0x038D, WORD_LEN, 0}, -{ 0x8F1A, 0x0684, WORD_LEN, 0}, -{ 0x8F1C, 0xC0F1, WORD_LEN, 0}, -{ 0x8F1E, 0xC5E1, WORD_LEN, 0}, -{ 0x8F20, 0xD518, WORD_LEN, 0}, -{ 0x8F22, 0x8D00, WORD_LEN, 0}, -{ 0x8F24, 0xB8E7, WORD_LEN, 0}, -{ 0x8F26, 0x20D1, WORD_LEN, 0}, -{ 0x8F28, 0x80E2, WORD_LEN, 0}, -{ 0x8F2A, 0xF20D, WORD_LEN, 0}, -{ 0x8F2C, 0xD117, WORD_LEN, 0}, -{ 0x8F2E, 0xB8A7, WORD_LEN, 0}, -{ 0x8F30, 0xAD00, WORD_LEN, 0}, -{ 0x8F32, 0xD017, WORD_LEN, 0}, -{ 0x8F34, 0x7228, WORD_LEN, 0}, -{ 0x8F36, 0x8123, WORD_LEN, 0}, -{ 0x8F38, 0xA040, WORD_LEN, 0}, -{ 0x8F3A, 0x7960, WORD_LEN, 0}, -{ 0x8F3C, 0xD801, WORD_LEN, 0}, -{ 0x8F3E, 0xD800, WORD_LEN, 0}, -{ 0x8F40, 0xAD05, WORD_LEN, 0}, -{ 0x8F42, 0x0F56, WORD_LEN, 0}, -{ 0x8F44, 0xFF83, WORD_LEN, 0}, -{ 0x8F46, 0x0381, WORD_LEN, 0}, -{ 0x8F48, 0x0684, WORD_LEN, 0}, -{ 0x8F4A, 0x78E0, WORD_LEN, 0}, -{ 0x8F4C, 0xD20D, WORD_LEN, 0}, -{ 0x8F4E, 0x8A21, WORD_LEN, 0}, -{ 0x8F50, 0xB9A1, WORD_LEN, 0}, -{ 0x8F52, 0x782F, WORD_LEN, 0}, -{ 0x8F54, 0x7FE0, WORD_LEN, 0}, -{ 0x8F56, 0xAA21, WORD_LEN, 0}, -{ 0x8F58, 0xD00E, WORD_LEN, 0}, -{ 0x8F5A, 0xD10C, WORD_LEN, 0}, -{ 0x8F5C, 0xA100, WORD_LEN, 0}, -{ 0x8F5E, 0xD00E, WORD_LEN, 0}, -{ 0x8F60, 0xA101, WORD_LEN, 0}, -{ 0x8F62, 0xD00E, WORD_LEN, 0}, -{ 0x8F64, 0xA102, WORD_LEN, 0}, -{ 0x8F66, 0xD00E, WORD_LEN, 0}, -{ 0x8F68, 0xA103, WORD_LEN, 0}, -{ 0x8F6A, 0xD009, WORD_LEN, 0}, -{ 0x8F6C, 0xA020, WORD_LEN, 0}, -{ 0x8F6E, 0xD005, WORD_LEN, 0}, -{ 0x8F70, 0xD988, WORD_LEN, 0}, -{ 0x8F72, 0xA820, WORD_LEN, 0}, -{ 0x8F74, 0xF1D4, WORD_LEN, 0}, -{ 0x8F76, 0x78E0, WORD_LEN, 0}, -{ 0x8F78, 0xFF80, WORD_LEN, 0}, -{ 0x8F7A, 0x10C8, WORD_LEN, 0}, -{ 0x8F7C, 0xFF80, WORD_LEN, 0}, -{ 0x8F7E, 0x0290, WORD_LEN, 0}, -{ 0x8F80, 0xFF80, WORD_LEN, 0}, -{ 0x8F82, 0x0158, WORD_LEN, 0}, -{ 0x8F84, 0xFF00, WORD_LEN, 0}, -{ 0x8F86, 0x0618, WORD_LEN, 0}, -{ 0x8F88, 0xFF80, WORD_LEN, 0}, -{ 0x8F8A, 0x1158, WORD_LEN, 0}, -{ 0x8F8C, 0x8000, WORD_LEN, 0}, -{ 0x8F8E, 0x0008, WORD_LEN, 0}, -{ 0x8F90, 0xFF80, WORD_LEN, 0}, -{ 0x8F92, 0x0F1C, WORD_LEN, 0}, -{ 0x8F94, 0xFF80, WORD_LEN, 0}, -{ 0x8F96, 0x0DEC, WORD_LEN, 0}, -{ 0x8F98, 0xFF80, WORD_LEN, 0}, -{ 0x8F9A, 0x0F4C, WORD_LEN, 0}, -{ 0x8F9C, 0x0000, WORD_LEN, 0}, -{ 0x8F9E, 0x0998, WORD_LEN, 0}, -{ 0x8FA0, 0xC0F1, WORD_LEN, 0}, -{ 0x8FA2, 0xC5E1, WORD_LEN, 0}, -{ 0x8FA4, 0xD02C, WORD_LEN, 0}, -{ 0x8FA6, 0x0982, WORD_LEN, 0}, -{ 0x8FA8, 0x0664, WORD_LEN, 0}, -{ 0x8FAA, 0x88AE, WORD_LEN, 0}, -{ 0x8FAC, 0x0D23, WORD_LEN, 0}, -{ 0x8FAE, 0x1051, WORD_LEN, 0}, -{ 0x8FB0, 0xD12A, WORD_LEN, 0}, -{ 0x8FB2, 0x1145, WORD_LEN, 0}, -{ 0x8FB4, 0x0080, WORD_LEN, 0}, -{ 0x8FB6, 0x1146, WORD_LEN, 0}, -{ 0x8FB8, 0x0082, WORD_LEN, 0}, -{ 0x8FBA, 0xB808, WORD_LEN, 0}, -{ 0x8FBC, 0x7845, WORD_LEN, 0}, -{ 0x8FBE, 0x0813, WORD_LEN, 0}, -{ 0x8FC0, 0x00DE, WORD_LEN, 0}, -{ 0x8FC2, 0xD027, WORD_LEN, 0}, -{ 0x8FC4, 0x8000, WORD_LEN, 0}, -{ 0x8FC6, 0x8041, WORD_LEN, 0}, -{ 0x8FC8, 0x7A60, WORD_LEN, 0}, -{ 0x8FCA, 0x1150, WORD_LEN, 0}, -{ 0x8FCC, 0x0080, WORD_LEN, 0}, -{ 0x8FCE, 0x02F9, WORD_LEN, 0}, -{ 0x8FD0, 0x0684, WORD_LEN, 0}, -{ 0x8FD2, 0x78E0, WORD_LEN, 0}, -{ 0x8FD4, 0xC0F1, WORD_LEN, 0}, -{ 0x8FD6, 0x0A7E, WORD_LEN, 0}, -{ 0x8FD8, 0x0684, WORD_LEN, 0}, -{ 0x8FDA, 0xD622, WORD_LEN, 0}, -{ 0x8FDC, 0x8EA9, WORD_LEN, 0}, -{ 0x8FDE, 0x8E2A, WORD_LEN, 0}, -{ 0x8FE0, 0xBD08, WORD_LEN, 0}, -{ 0x8FE2, 0x7D25, WORD_LEN, 0}, -{ 0x8FE4, 0x2550, WORD_LEN, 0}, -{ 0x8FE6, 0x10C2, WORD_LEN, 0}, -{ 0x8FE8, 0x2A41, WORD_LEN, 0}, -{ 0x8FEA, 0x0201, WORD_LEN, 0}, -{ 0x8FEC, 0xAE29, WORD_LEN, 0}, -{ 0x8FEE, 0x0F9A, WORD_LEN, 0}, -{ 0x8FF0, 0x05A4, WORD_LEN, 0}, -{ 0x8FF2, 0xAE4A, WORD_LEN, 0}, -{ 0x8FF4, 0x0D17, WORD_LEN, 0}, -{ 0x8FF6, 0x10DE, WORD_LEN, 0}, -{ 0x8FF8, 0x8E09, WORD_LEN, 0}, -{ 0x8FFA, 0x8E2A, WORD_LEN, 0}, -{ 0x8FFC, 0xB808, WORD_LEN, 0}, -{ 0x8FFE, 0x7825, WORD_LEN, 0}, -{ 0x9000, 0xB883, WORD_LEN, 0}, -{ 0x9002, 0x2841, WORD_LEN, 0}, -{ 0x9004, 0x0201, WORD_LEN, 0}, -{ 0x9006, 0xAE29, WORD_LEN, 0}, -{ 0x9008, 0xAE0A, WORD_LEN, 0}, -{ 0x900A, 0x02B5, WORD_LEN, 0}, -{ 0x900C, 0x0684, WORD_LEN, 0}, -{ 0x900E, 0x78E0, WORD_LEN, 0}, -{ 0x9010, 0xC0F1, WORD_LEN, 0}, -{ 0x9012, 0x0A42, WORD_LEN, 0}, -{ 0x9014, 0x06A4, WORD_LEN, 0}, -{ 0x9016, 0xDA34, WORD_LEN, 0}, -{ 0x9018, 0xD113, WORD_LEN, 0}, -{ 0x901A, 0xD514, WORD_LEN, 0}, -{ 0x901C, 0x76A9, WORD_LEN, 0}, -{ 0x901E, 0x0FD6, WORD_LEN, 0}, -{ 0x9020, 0x0664, WORD_LEN, 0}, -{ 0x9022, 0x70C9, WORD_LEN, 0}, -{ 0x9024, 0xD012, WORD_LEN, 0}, -{ 0x9026, 0xA504, WORD_LEN, 0}, -{ 0x9028, 0xD012, WORD_LEN, 0}, -{ 0x902A, 0x0295, WORD_LEN, 0}, -{ 0x902C, 0x06A4, WORD_LEN, 0}, -{ 0x902E, 0xA0C0, WORD_LEN, 0}, -{ 0x9030, 0xC0F1, WORD_LEN, 0}, -{ 0x9032, 0xC5E1, WORD_LEN, 0}, -{ 0x9034, 0xD50D, WORD_LEN, 0}, -{ 0x9036, 0xD110, WORD_LEN, 0}, -{ 0x9038, 0x2540, WORD_LEN, 0}, -{ 0x903A, 0x1D00, WORD_LEN, 0}, -{ 0x903C, 0x0FB6, WORD_LEN, 0}, -{ 0x903E, 0x0664, WORD_LEN, 0}, -{ 0x9040, 0xDA50, WORD_LEN, 0}, -{ 0x9042, 0xD00E, WORD_LEN, 0}, -{ 0x9044, 0x2540, WORD_LEN, 0}, -{ 0x9046, 0x1D01, WORD_LEN, 0}, -{ 0x9048, 0xA517, WORD_LEN, 0}, -{ 0x904A, 0xD00D, WORD_LEN, 0}, -{ 0x904C, 0x0279, WORD_LEN, 0}, -{ 0x904E, 0x06A4, WORD_LEN, 0}, -{ 0x9050, 0xA020, WORD_LEN, 0}, -{ 0x9052, 0x78E0, WORD_LEN, 0}, -{ 0x9054, 0xFF80, WORD_LEN, 0}, -{ 0x9056, 0x07A8, WORD_LEN, 0}, -{ 0x9058, 0xFF80, WORD_LEN, 0}, -{ 0x905A, 0x0290, WORD_LEN, 0}, -{ 0x905C, 0x8000, WORD_LEN, 0}, -{ 0x905E, 0x0008, WORD_LEN, 0}, -{ 0x9060, 0xFF80, WORD_LEN, 0}, -{ 0x9062, 0x02CC, WORD_LEN, 0}, -{ 0x9064, 0x0000, WORD_LEN, 0}, -{ 0x9066, 0xFA88, WORD_LEN, 0}, -{ 0x9068, 0xFF80, WORD_LEN, 0}, -{ 0x906A, 0x1168, WORD_LEN, 0}, -{ 0x906C, 0xFF80, WORD_LEN, 0}, -{ 0x906E, 0x0FD4, WORD_LEN, 0}, -{ 0x9070, 0x8000, WORD_LEN, 0}, -{ 0x9072, 0x0194, WORD_LEN, 0}, -{ 0x9074, 0x0000, WORD_LEN, 0}, -{ 0x9076, 0xFB08, WORD_LEN, 0}, -{ 0x9078, 0xFF80, WORD_LEN, 0}, -{ 0x907A, 0x0FA0, WORD_LEN, 0}, -{ 0x907C, 0x8000, WORD_LEN, 0}, -{ 0x907E, 0x01A0, WORD_LEN, 0}, -{ 0x9080, 0xE280, WORD_LEN, 0}, -{ 0x9082, 0x24CA, WORD_LEN, 0}, -{ 0x9084, 0x7082, WORD_LEN, 0}, -{ 0x9086, 0x78E0, WORD_LEN, 0}, -{ 0x9088, 0x20E8, WORD_LEN, 0}, -{ 0x908A, 0x01A2, WORD_LEN, 0}, -{ 0x908C, 0x1002, WORD_LEN, 0}, -{ 0x908E, 0x0D02, WORD_LEN, 0}, -{ 0x9090, 0x1902, WORD_LEN, 0}, -{ 0x9092, 0x0094, WORD_LEN, 0}, -{ 0x9094, 0x7FE0, WORD_LEN, 0}, -{ 0x9096, 0x7028, WORD_LEN, 0}, -{ 0x9098, 0x7308, WORD_LEN, 0}, -{ 0x909A, 0x1000, WORD_LEN, 0}, -{ 0x909C, 0x0900, WORD_LEN, 0}, -{ 0x909E, 0x7904, WORD_LEN, 0}, -{ 0x90A0, 0x7947, WORD_LEN, 0}, -{ 0x90A2, 0x1B00, WORD_LEN, 0}, -{ 0x90A4, 0x0064, WORD_LEN, 0}, -{ 0x90A6, 0x7EE0, WORD_LEN, 0}, -{ 0x90A8, 0xE280, WORD_LEN, 0}, -{ 0x90AA, 0x24CA, WORD_LEN, 0}, -{ 0x90AC, 0x7082, WORD_LEN, 0}, -{ 0x90AE, 0x78E0, WORD_LEN, 0}, -{ 0x90B0, 0x20E8, WORD_LEN, 0}, -{ 0x90B2, 0x01A2, WORD_LEN, 0}, -{ 0x90B4, 0x1102, WORD_LEN, 0}, -{ 0x90B6, 0x0502, WORD_LEN, 0}, -{ 0x90B8, 0x1802, WORD_LEN, 0}, -{ 0x90BA, 0x00B4, WORD_LEN, 0}, -{ 0x90BC, 0x7FE0, WORD_LEN, 0}, -{ 0x90BE, 0x7028, WORD_LEN, 0}, -{ 0x90C0, 0x0000, WORD_LEN, 0}, -{ 0x90C2, 0x0000, WORD_LEN, 0}, -{ 0x90C4, 0x0000, WORD_LEN, 0}, -{ 0x90C6, 0x0000, WORD_LEN, 0}, -{ 0x098E, 0x0000, WORD_LEN, 0}, // LOGICAL_ADDRESS_ACCESS -{ 0x8016, 0x086C, WORD_LEN, 0}, // MON_ADDRESS_LO -{ 0x8018, 0xFF80, WORD_LEN, 0}, // MON_ADDRESS_HI -{ 0x8002, 0x0001, WORD_LEN, 0}, // MON_CMD -//delay = 100 -{ SEQUENCE_WAIT_MS,100, BYTE_LEN, 0}, - -//[Lens Correction 90% 02/04/13 18:03:18] -//BITFIELD= 0x3210, 0x0008, 0 //PGA_ENABLE -{ 0x3210, 0x0008, WORD_LEN, 0}, -{ 0x3210, 0x49B0, WORD_LEN, 0}, // COLOR_PIPELINE_CONTROL -{ 0x3640, 0x0170, WORD_LEN, 0}, // P_G1_P0Q0 -{ 0x3642, 0x0BCC, WORD_LEN, 0}, // P_G1_P0Q1 -{ 0x3644, 0x7210, WORD_LEN, 0}, // P_G1_P0Q2 -{ 0x3646, 0x4C8D, WORD_LEN, 0}, // P_G1_P0Q3 -{ 0x3648, 0xF58D, WORD_LEN, 0}, // P_G1_P0Q4 -{ 0x364A, 0x0610, WORD_LEN, 0}, // P_R_P0Q0 -{ 0x364C, 0x8D6E, WORD_LEN, 0}, // P_R_P0Q1 -{ 0x364E, 0x6E90, WORD_LEN, 0}, // P_R_P0Q2 -{ 0x3650, 0x088F, WORD_LEN, 0}, // P_R_P0Q3 -{ 0x3652, 0xA890, WORD_LEN, 0}, // P_R_P0Q4 -{ 0x3654, 0x0550, WORD_LEN, 0}, // P_B_P0Q0 -{ 0x3656, 0x764C, WORD_LEN, 0}, // P_B_P0Q1 -{ 0x3658, 0x0FB0, WORD_LEN, 0}, // P_B_P0Q2 -{ 0x365A, 0x9A0D, WORD_LEN, 0}, // P_B_P0Q3 -{ 0x365C, 0xF4AD, WORD_LEN, 0}, // P_B_P0Q4 -{ 0x365E, 0x02F0, WORD_LEN, 0}, // P_G2_P0Q0 -{ 0x3660, 0x9A0E, WORD_LEN, 0}, // P_G2_P0Q1 -{ 0x3662, 0x77B0, WORD_LEN, 0}, // P_G2_P0Q2 -{ 0x3664, 0x416D, WORD_LEN, 0}, // P_G2_P0Q3 -{ 0x3666, 0xF24D, WORD_LEN, 0}, // P_G2_P0Q4 -{ 0x3680, 0x018A, WORD_LEN, 0}, // P_G1_P1Q0 -{ 0x3682, 0xD0AD, WORD_LEN, 0}, // P_G1_P1Q1 -{ 0x3684, 0xC62E, WORD_LEN, 0}, // P_G1_P1Q2 -{ 0x3686, 0x736D, WORD_LEN, 0}, // P_G1_P1Q3 -{ 0x3688, 0x0130, WORD_LEN, 0}, // P_G1_P1Q4 -{ 0x368A, 0x52ED, WORD_LEN, 0}, // P_R_P1Q0 -{ 0x368C, 0x682D, WORD_LEN, 0}, // P_R_P1Q1 -{ 0x368E, 0xF02B, WORD_LEN, 0}, // P_R_P1Q2 -{ 0x3690, 0xB68E, WORD_LEN, 0}, // P_R_P1Q3 -{ 0x3692, 0xF4AD, WORD_LEN, 0}, // P_R_P1Q4 -{ 0x3694, 0xC68D, WORD_LEN, 0}, // P_B_P1Q0 -{ 0x3696, 0x440D, WORD_LEN, 0}, // P_B_P1Q1 -{ 0x3698, 0x416E, WORD_LEN, 0}, // P_B_P1Q2 -{ 0x369A, 0xC0CE, WORD_LEN, 0}, // P_B_P1Q3 -{ 0x369C, 0xB46D, WORD_LEN, 0}, // P_B_P1Q4 -{ 0x369E, 0xD90A, WORD_LEN, 0}, // P_G2_P1Q0 -{ 0x36A0, 0xD76D, WORD_LEN, 0}, // P_G2_P1Q1 -{ 0x36A2, 0xFE0D, WORD_LEN, 0}, // P_G2_P1Q2 -{ 0x36A4, 0x0E0D, WORD_LEN, 0}, // P_G2_P1Q3 -{ 0x36A6, 0x0890, WORD_LEN, 0}, // P_G2_P1Q4 -{ 0x36C0, 0x70D0, WORD_LEN, 0}, // P_G1_P2Q0 -{ 0x36C2, 0x10CF, WORD_LEN, 0}, // P_G1_P2Q1 -{ 0x36C4, 0x4592, WORD_LEN, 0}, // P_G1_P2Q2 -{ 0x36C6, 0xB74D, WORD_LEN, 0}, // P_G1_P2Q3 -{ 0x36C8, 0xEEB3, WORD_LEN, 0}, // P_G1_P2Q4 -{ 0x36CA, 0x1991, WORD_LEN, 0}, // P_R_P2Q0 -{ 0x36CC, 0x9B8E, WORD_LEN, 0}, // P_R_P2Q1 -{ 0x36CE, 0x5DCD, WORD_LEN, 0}, // P_R_P2Q2 -{ 0x36D0, 0x1C8D, WORD_LEN, 0}, // P_R_P2Q3 -{ 0x36D2, 0x8C71, WORD_LEN, 0}, // P_R_P2Q4 -{ 0x36D4, 0x00F1, WORD_LEN, 0}, // P_B_P2Q0 -{ 0x36D6, 0x480F, WORD_LEN, 0}, // P_B_P2Q1 -{ 0x36D8, 0x26AF, WORD_LEN, 0}, // P_B_P2Q2 -{ 0x36DA, 0xC2EF, WORD_LEN, 0}, // P_B_P2Q3 -{ 0x36DC, 0xFC8F, WORD_LEN, 0}, // P_B_P2Q4 -{ 0x36DE, 0x0071, WORD_LEN, 0}, // P_G2_P2Q0 -{ 0x36E0, 0x8230, WORD_LEN, 0}, // P_G2_P2Q1 -{ 0x36E2, 0x60B2, WORD_LEN, 0}, // P_G2_P2Q2 -{ 0x36E4, 0x3E51, WORD_LEN, 0}, // P_G2_P2Q3 -{ 0x36E6, 0x8C74, WORD_LEN, 0}, // P_G2_P2Q4 -{ 0x3700, 0x492E, WORD_LEN, 0}, // P_G1_P3Q0 -{ 0x3702, 0x7FAD, WORD_LEN, 0}, // P_G1_P3Q1 -{ 0x3704, 0x93CE, WORD_LEN, 0}, // P_G1_P3Q2 -{ 0x3706, 0xC86F, WORD_LEN, 0}, // P_G1_P3Q3 -{ 0x3708, 0xC830, WORD_LEN, 0}, // P_G1_P3Q4 -{ 0x370A, 0x610E, WORD_LEN, 0}, // P_R_P3Q0 -{ 0x370C, 0x8EC8, WORD_LEN, 0}, // P_R_P3Q1 -{ 0x370E, 0xA930, WORD_LEN, 0}, // P_R_P3Q2 -{ 0x3710, 0xE88D, WORD_LEN, 0}, // P_R_P3Q3 -{ 0x3712, 0x2B51, WORD_LEN, 0}, // P_R_P3Q4 -{ 0x3714, 0xDECD, WORD_LEN, 0}, // P_B_P3Q0 -{ 0x3716, 0xBD8E, WORD_LEN, 0}, // P_B_P3Q1 -{ 0x3718, 0x2E50, WORD_LEN, 0}, // P_B_P3Q2 -{ 0x371A, 0x60AF, WORD_LEN, 0}, // P_B_P3Q3 -{ 0x371C, 0xBB11, WORD_LEN, 0}, // P_B_P3Q4 -{ 0x371E, 0x22CB, WORD_LEN, 0}, // P_G2_P3Q0 -{ 0x3720, 0xEEEC, WORD_LEN, 0}, // P_G2_P3Q1 -{ 0x3722, 0x0251, WORD_LEN, 0}, // P_G2_P3Q2 -{ 0x3724, 0x142D, WORD_LEN, 0}, // P_G2_P3Q3 -{ 0x3726, 0xE271, WORD_LEN, 0}, // P_G2_P3Q4 -{ 0x3740, 0x1D10, WORD_LEN, 0}, // P_G1_P4Q0 -{ 0x3742, 0xE94F, WORD_LEN, 0}, // P_G1_P4Q1 -{ 0x3744, 0x8735, WORD_LEN, 0}, // P_G1_P4Q2 -{ 0x3746, 0xC2CC, WORD_LEN, 0}, // P_G1_P4Q3 -{ 0x3748, 0x23F6, WORD_LEN, 0}, // P_G1_P4Q4 -{ 0x374A, 0xE90F, WORD_LEN, 0}, // P_R_P4Q0 -{ 0x374C, 0x1A30, WORD_LEN, 0}, // P_R_P4Q1 -{ 0x374E, 0xAEF3, WORD_LEN, 0}, // P_R_P4Q2 -{ 0x3750, 0xB2F2, WORD_LEN, 0}, // P_R_P4Q3 -{ 0x3752, 0x2195, WORD_LEN, 0}, // P_R_P4Q4 -{ 0x3754, 0xFFEE, WORD_LEN, 0}, // P_B_P4Q0 -{ 0x3756, 0xD8D0, WORD_LEN, 0}, // P_B_P4Q1 -{ 0x3758, 0xCC92, WORD_LEN, 0}, // P_B_P4Q2 -{ 0x375A, 0x0451, WORD_LEN, 0}, // P_B_P4Q3 -{ 0x375C, 0x5814, WORD_LEN, 0}, // P_B_P4Q4 -{ 0x375E, 0x2470, WORD_LEN, 0}, // P_G2_P4Q0 -{ 0x3760, 0x6151, WORD_LEN, 0}, // P_G2_P4Q1 -{ 0x3762, 0x9555, WORD_LEN, 0}, // P_G2_P4Q2 -{ 0x3764, 0xD5D3, WORD_LEN, 0}, // P_G2_P4Q3 -{ 0x3766, 0x3B56, WORD_LEN, 0}, // P_G2_P4Q4 -{ 0x3782, 0x03DC, WORD_LEN, 0}, // CENTER_ROW -{ 0x3784, 0x04E0, WORD_LEN, 0}, // CENTER_COLUMN -{ 0x3210, 0x49B8, WORD_LEN, 0}, // COLOR_PIPELINE_CONTROL -//BITFIELD= 0x3210, 0x0008, 1 //PGA_ENABLE -//{ 0x3210, 0x0008, WORD_LEN, 0}, - - - -//[*********Step6************] -//[Step6-AWB_CCM] -//[AWB_setup] - -{ 0xAC01, 0xBB, BYTE_LEN, 0}, // AWB_MODE -//[CCM] -{ 0xAC46, 0x0221, WORD_LEN, 0}, // AWB_LEFT_CCM_0 -{ 0xAC48, 0xFEAE, WORD_LEN, 0}, // AWB_LEFT_CCM_1 -{ 0xAC4A, 0x0032, WORD_LEN, 0}, // AWB_LEFT_CCM_2 -{ 0xAC4C, 0xFFC5, WORD_LEN, 0}, // AWB_LEFT_CCM_3 -{ 0xAC4E, 0x0154, WORD_LEN, 0}, // AWB_LEFT_CCM_4 -{ 0xAC50, 0xFFE7, WORD_LEN, 0}, // AWB_LEFT_CCM_5 -{ 0xAC52, 0xFFB1, WORD_LEN, 0}, // AWB_LEFT_CCM_6 -{ 0xAC54, 0xFEC5, WORD_LEN, 0}, // AWB_LEFT_CCM_7 -{ 0xAC56, 0x028A, WORD_LEN, 0}, // AWB_LEFT_CCM_8 -{ 0xAC58, 0x00C6, WORD_LEN, 0}, // AWB_LEFT_CCM_R2BRATIO -{ 0xAC5C, 0x01CD, WORD_LEN, 0}, // AWB_RIGHT_CCM_0 -{ 0xAC5E, 0xFF63, WORD_LEN, 0}, // AWB_RIGHT_CCM_1 -{ 0xAC60, 0xFFD0, WORD_LEN, 0}, // AWB_RIGHT_CCM_2 -{ 0xAC62, 0xFFCD, WORD_LEN, 0}, // AWB_RIGHT_CCM_3 -{ 0xAC64, 0x013B, WORD_LEN, 0}, // AWB_RIGHT_CCM_4 -{ 0xAC66, 0xFFF8, WORD_LEN, 0}, // AWB_RIGHT_CCM_5 -{ 0xAC68, 0xFFFB, WORD_LEN, 0}, // AWB_RIGHT_CCM_6 -{ 0xAC6A, 0xFF78, WORD_LEN, 0}, // AWB_RIGHT_CCM_7 -{ 0xAC6C, 0x018D, WORD_LEN, 0}, // AWB_RIGHT_CCM_8 -{ 0xAC6E, 0x0055, WORD_LEN, 0}, // AWB_RIGHT_CCM_R2BRATIO - -//[AWB] -{ 0xB842, 0x0037, WORD_LEN, 0}, // STAT_AWB_GRAY_CHECKER_OFFSET_X -{ 0xB844, 0x0044, WORD_LEN, 0}, // STAT_AWB_GRAY_CHECKER_OFFSET_Y -{ 0x3240, 0x0024, WORD_LEN, 0}, // AWB_XY_SCALE -{ 0x3240, 0x0024, WORD_LEN, 0}, // AWB_XY_SCALE -{ 0x3242, 0x0000, WORD_LEN, 0}, // AWB_WEIGHT_R0 -{ 0x3244, 0x0000, WORD_LEN, 0}, // AWB_WEIGHT_R1 -{ 0x3246, 0x0000, WORD_LEN, 0}, // AWB_WEIGHT_R2 -{ 0x3248, 0x7F00, WORD_LEN, 0}, // AWB_WEIGHT_R3 -{ 0x324A, 0xA500, WORD_LEN, 0}, // AWB_WEIGHT_R4 -{ 0x324C, 0x1540, WORD_LEN, 0}, // AWB_WEIGHT_R5 -{ 0x324E, 0x01AC, WORD_LEN, 0}, // AWB_WEIGHT_R6 -{ 0x3250, 0x003E, WORD_LEN, 0}, // AWB_WEIGHT_R7 - -//[Preawb_params] -{ 0xACB0, 0x32, BYTE_LEN, 0}, // AWB_RG_MIN -{ 0xACB1, 0x5A, BYTE_LEN, 0}, // AWB_RG_MAX -{ 0xACB2, 0x32, BYTE_LEN, 0}, // AWB_RG_MIN_BRIGHT -{ 0xACB3, 0x5A, BYTE_LEN, 0}, // AWB_RG_MAX_BRIGHT -{ 0xACB4, 0x23, BYTE_LEN, 0}, // AWB_BG_MIN -{ 0xACB5, 0x55, BYTE_LEN, 0}, // AWB_BG_MAX -{ 0xACB6, 0x49, BYTE_LEN, 0}, // AWB_BG_MIN_BRIGHT -{ 0xACB7, 0x55, BYTE_LEN, 0}, // AWB_BG_MAX_BRIGHT - -//[**********Step7*************] -//[Step7-CPIPE_Calibration] - -//[jpeg_setup] - -{ 0xD80F, 0x04, BYTE_LEN, 0}, // JPEG_QSCALE_0 -{ 0xD810, 0x08, BYTE_LEN, 0}, // JPEG_QSCALE_1 -{ 0xC8D2, 0x04, BYTE_LEN, 0}, // CAM_OUTPUT_1_JPEG_QSCALE_0 -{ 0xC8D3, 0x08, BYTE_LEN, 0}, // CAM_OUTPUT_1_JPEG_QSCALE_1 -{ 0xC8BC, 0x04, BYTE_LEN, 0}, // CAM_OUTPUT_0_JPEG_QSCALE_0 -{ 0xC8BD, 0x08, BYTE_LEN, 0}, // CAM_OUTPUT_0_JPEG_QSCALE_1 - -//[Sys_Settings] -{ 0xDC35, 0x04, BYTE_LEN, 0}, // SYS_UV_COLOR_BOOST -{ 0x326E, 0x0006, WORD_LEN, 0}, // RESERVED_SOC1_326E -{ 0xDC37, 0x62, BYTE_LEN, 0}, // SYS_BRIGHT_COLORKILL -{ 0x35A4, 0x0596, WORD_LEN, 0}, // BRIGHT_COLOR_KILL_CONTROLS -{ 0x35A2, 0x0094, WORD_LEN, 0}, // DARK_COLOR_KILL_CONTROLS -{ 0xDC36, 0x23, BYTE_LEN, 0}, // SYS_DARK_COLOR_KILL - -//[Gamma_Curves_REV3] -{ 0xBC18, 0x00, BYTE_LEN, 0}, // LL_GAMMA_CONTRAST_CURVE_0 -{ 0xBC19, 0x11, BYTE_LEN, 0}, // LL_GAMMA_CONTRAST_CURVE_1 -{ 0xBC1A, 0x23, BYTE_LEN, 0}, // LL_GAMMA_CONTRAST_CURVE_2 -{ 0xBC1B, 0x3F, BYTE_LEN, 0}, // LL_GAMMA_CONTRAST_CURVE_3 -{ 0xBC1C, 0x67, BYTE_LEN, 0}, // LL_GAMMA_CONTRAST_CURVE_4 -{ 0xBC1D, 0x85, BYTE_LEN, 0}, // LL_GAMMA_CONTRAST_CURVE_5 -{ 0xBC1E, 0x9B, BYTE_LEN, 0}, // LL_GAMMA_CONTRAST_CURVE_6 -{ 0xBC1F, 0xAD, BYTE_LEN, 0}, // LL_GAMMA_CONTRAST_CURVE_7 -{ 0xBC20, 0xBB, BYTE_LEN, 0}, // LL_GAMMA_CONTRAST_CURVE_8 -{ 0xBC21, 0xC7, BYTE_LEN, 0}, // LL_GAMMA_CONTRAST_CURVE_9 -{ 0xBC22, 0xD1, BYTE_LEN, 0}, // LL_GAMMA_CONTRAST_CURVE_10 -{ 0xBC23, 0xDA, BYTE_LEN, 0}, // LL_GAMMA_CONTRAST_CURVE_11 -{ 0xBC24, 0xE1, BYTE_LEN, 0}, // LL_GAMMA_CONTRAST_CURVE_12 -{ 0xBC25, 0xE8, BYTE_LEN, 0}, // LL_GAMMA_CONTRAST_CURVE_13 -{ 0xBC26, 0xEE, BYTE_LEN, 0}, // LL_GAMMA_CONTRAST_CURVE_14 -{ 0xBC27, 0xF3, BYTE_LEN, 0}, // LL_GAMMA_CONTRAST_CURVE_15 -{ 0xBC28, 0xF7, BYTE_LEN, 0}, // LL_GAMMA_CONTRAST_CURVE_16 -{ 0xBC29, 0xFB, BYTE_LEN, 0}, // LL_GAMMA_CONTRAST_CURVE_17 -{ 0xBC2A, 0xFF, BYTE_LEN, 0}, // LL_GAMMA_CONTRAST_CURVE_18 -{ 0xBC2B, 0x00, BYTE_LEN, 0}, // LL_GAMMA_NEUTRAL_CURVE_0 -{ 0xBC2C, 0x11, BYTE_LEN, 0}, // LL_GAMMA_NEUTRAL_CURVE_1 -{ 0xBC2D, 0x23, BYTE_LEN, 0}, // LL_GAMMA_NEUTRAL_CURVE_2 -{ 0xBC2E, 0x3F, BYTE_LEN, 0}, // LL_GAMMA_NEUTRAL_CURVE_3 -{ 0xBC2F, 0x67, BYTE_LEN, 0}, // LL_GAMMA_NEUTRAL_CURVE_4 -{ 0xBC30, 0x85, BYTE_LEN, 0}, // LL_GAMMA_NEUTRAL_CURVE_5 -{ 0xBC31, 0x9B, BYTE_LEN, 0}, // LL_GAMMA_NEUTRAL_CURVE_6 -{ 0xBC32, 0xAD, BYTE_LEN, 0}, // LL_GAMMA_NEUTRAL_CURVE_7 -{ 0xBC33, 0xBB, BYTE_LEN, 0}, // LL_GAMMA_NEUTRAL_CURVE_8 -{ 0xBC34, 0xC7, BYTE_LEN, 0}, // LL_GAMMA_NEUTRAL_CURVE_9 -{ 0xBC35, 0xD1, BYTE_LEN, 0}, // LL_GAMMA_NEUTRAL_CURVE_10 -{ 0xBC36, 0xDA, BYTE_LEN, 0}, // LL_GAMMA_NEUTRAL_CURVE_11 -{ 0xBC37, 0xE1, BYTE_LEN, 0}, // LL_GAMMA_NEUTRAL_CURVE_12 -{ 0xBC38, 0xE8, BYTE_LEN, 0}, // LL_GAMMA_NEUTRAL_CURVE_13 -{ 0xBC39, 0xEE, BYTE_LEN, 0}, // LL_GAMMA_NEUTRAL_CURVE_14 -{ 0xBC3A, 0xF3, BYTE_LEN, 0}, // LL_GAMMA_NEUTRAL_CURVE_15 -{ 0xBC3B, 0xF7, BYTE_LEN, 0}, // LL_GAMMA_NEUTRAL_CURVE_16 -{ 0xBC3C, 0xFB, BYTE_LEN, 0}, // LL_GAMMA_NEUTRAL_CURVE_17 -{ 0xBC3D, 0xFF, BYTE_LEN, 0}, // LL_GAMMA_NEUTRAL_CURVE_18 -{ 0xBC3E, 0x00, BYTE_LEN, 0}, // LL_GAMMA_NR_CURVE_0 -{ 0xBC3F, 0x05, BYTE_LEN, 0}, // LL_GAMMA_NR_CURVE_1 -{ 0xBC40, 0x0F, BYTE_LEN, 0}, // LL_GAMMA_NR_CURVE_2 -{ 0xBC41, 0x21, BYTE_LEN, 0}, // LL_GAMMA_NR_CURVE_3 -{ 0xBC42, 0x3C, BYTE_LEN, 0}, // LL_GAMMA_NR_CURVE_4 -{ 0xBC43, 0x52, BYTE_LEN, 0}, // LL_GAMMA_NR_CURVE_5 -{ 0xBC44, 0x67, BYTE_LEN, 0}, // LL_GAMMA_NR_CURVE_6 -{ 0xBC45, 0x7B, BYTE_LEN, 0}, // LL_GAMMA_NR_CURVE_7 -{ 0xBC46, 0x8D, BYTE_LEN, 0}, // LL_GAMMA_NR_CURVE_8 -{ 0xBC47, 0x9E, BYTE_LEN, 0}, // LL_GAMMA_NR_CURVE_9 -{ 0xBC48, 0xAD, BYTE_LEN, 0}, // LL_GAMMA_NR_CURVE_10 -{ 0xBC49, 0xBA, BYTE_LEN, 0}, // LL_GAMMA_NR_CURVE_11 -{ 0xBC4A, 0xC6, BYTE_LEN, 0}, // LL_GAMMA_NR_CURVE_12 -{ 0xBC4B, 0xD1, BYTE_LEN, 0}, // LL_GAMMA_NR_CURVE_13 -{ 0xBC4C, 0xDC, BYTE_LEN, 0}, // LL_GAMMA_NR_CURVE_14 -{ 0xBC4D, 0xE5, BYTE_LEN, 0}, // LL_GAMMA_NR_CURVE_15 -{ 0xBC4E, 0xEE, BYTE_LEN, 0}, // LL_GAMMA_NR_CURVE_16 -{ 0xBC4F, 0xF7, BYTE_LEN, 0}, // LL_GAMMA_NR_CURVE_17 -{ 0xBC50, 0xFF, BYTE_LEN, 0}, // LL_GAMMA_NR_CURVE_18 - -//[BM_Dampening] -{ 0xB801, 0xE0, BYTE_LEN, 0}, // STAT_MODE -{ 0xB862, 0x04, BYTE_LEN, 0}, // STAT_BMTRACKING_SPEED - -//[AE] -{ 0xB829, 0x02, BYTE_LEN, 0}, // STAT_LL_BRIGHTNESS_METRIC_DIVISOR -{ 0xB863, 0x02, BYTE_LEN, 0}, // STAT_BM_MUL -{ 0xB827, 0x0F, BYTE_LEN, 0}, // STAT_AE_EV_SHIFT -{ 0xA409, 0x42, BYTE_LEN, 0}, // AE_RULE_BASE_TARGET - -//[BM_GM_Start_Stop] -{ 0xBC52, 0x00C8, WORD_LEN, 0}, // LL_START_BRIGHTNESS_METRIC -{ 0xBC54, 0x0A28, WORD_LEN, 0}, // LL_END_BRIGHTNESS_METRIC -{ 0xBC58, 0x00C8, WORD_LEN, 0}, // LL_START_GAIN_METRIC -{ 0xBC5A, 0x12C0, WORD_LEN, 0}, // LL_END_GAIN_METRIC -{ 0xBC5E, 0x00FA, WORD_LEN, 0}, // LL_START_APERTURE_GAIN_BM -{ 0xBC60, 0x0258, WORD_LEN, 0}, // LL_END_APERTURE_GAIN_BM -{ 0xBC66, 0x00FA, WORD_LEN, 0}, // LL_START_APERTURE_GM -{ 0xBC68, 0x0258, WORD_LEN, 0}, // LL_END_APERTURE_GM -{ 0xBC86, 0x00C8, WORD_LEN, 0}, // LL_START_FFNR_GM -{ 0xBC88, 0x0640, WORD_LEN, 0}, // LL_END_FFNR_GM -{ 0xBCBC, 0x0040, WORD_LEN, 0}, // LL_SFFB_START_GAIN -{ 0xBCBE, 0x01FC, WORD_LEN, 0}, // LL_SFFB_END_GAIN -{ 0xBCCC, 0x00C8, WORD_LEN, 0}, // LL_SFFB_START_MAX_GM -{ 0xBCCE, 0x0640, WORD_LEN, 0}, // LL_SFFB_END_MAX_GM -{ 0xBC90, 0x00C8, WORD_LEN, 0}, // LL_START_GRB_GM -{ 0xBC92, 0x0640, WORD_LEN, 0}, // LL_END_GRB_GM -{ 0xBC0E, 0x0001, WORD_LEN, 0}, // LL_GAMMA_CURVE_ADJ_START_POS -{ 0xBC10, 0x0002, WORD_LEN, 0}, // LL_GAMMA_CURVE_ADJ_MID_POS -{ 0xBC12, 0x02BC, WORD_LEN, 0}, // LL_GAMMA_CURVE_ADJ_END_POS -{ 0xBCAA, 0x044C, WORD_LEN, 0}, // LL_CDC_THR_ADJ_START_POS -{ 0xBCAC, 0x00AF, WORD_LEN, 0}, // LL_CDC_THR_ADJ_MID_POS -{ 0xBCAE, 0x0009, WORD_LEN, 0}, // LL_CDC_THR_ADJ_END_POS -{ 0xBCD8, 0x00C8, WORD_LEN, 0}, // LL_PCR_START_BM -{ 0xBCDA, 0x0A28, WORD_LEN, 0}, // LL_PCR_END_BM - -//[Kernel] -{ 0x3380, 0x0504, WORD_LEN, 0}, // KERNEL_CONFIG - -//[GRB] -{ 0xBC94, 0x0C, BYTE_LEN, 0}, // LL_GB_START_THRESHOLD_0 -{ 0xBC95, 0x08, BYTE_LEN, 0}, // LL_GB_START_THRESHOLD_1 -{ 0xBC9C, 0x3C, BYTE_LEN, 0}, // RESERVED_LL_9C -{ 0xBC9D, 0x28, BYTE_LEN, 0}, // RESERVED_LL_9D - -//[Demosaic_REV3] -{ 0x33B0, 0x2A16, WORD_LEN, 0}, // FFNR_ALPHA_BETA -{ 0xBC8A, 0x02, BYTE_LEN, 0}, // LL_START_FF_MIX_THRESH_Y -{ 0xBC8B, 0x0F, BYTE_LEN, 0}, // LL_END_FF_MIX_THRESH_Y -{ 0xBC8C, 0xFF, BYTE_LEN, 0}, // LL_START_FF_MIX_THRESH_YGAIN -{ 0xBC8D, 0xFF, BYTE_LEN, 0}, // LL_END_FF_MIX_THRESH_YGAIN -{ 0xBC8E, 0xFF, BYTE_LEN, 0}, // LL_START_FF_MIX_THRESH_GAIN -{ 0xBC8F, 0x00, BYTE_LEN, 0}, // LL_END_FF_MIX_THRESH_GAIN - -//[CDC] -{ 0xBCB2, 0x20, BYTE_LEN, 0}, // LL_CDC_DARK_CLUS_SLOPE -{ 0xBCB3, 0x3A, BYTE_LEN, 0}, // LL_CDC_DARK_CLUS_SATUR -{ 0xBCB4, 0x39, BYTE_LEN, 0}, // RESERVED_LL_B4 -{ 0xBCB7, 0x39, BYTE_LEN, 0}, // RESERVED_LL_B7 -{ 0xBCB5, 0x20, BYTE_LEN, 0}, // RESERVED_LL_B5 -{ 0xBCB8, 0x3A, BYTE_LEN, 0}, // RESERVED_LL_B8 -{ 0xBCB6, 0x80, BYTE_LEN, 0}, // RESERVED_LL_B6 -{ 0xBCB9, 0x24, BYTE_LEN, 0}, // RESERVED_LL_B9 -{ 0xBCAA, 0x03E8, WORD_LEN, 0}, // LL_CDC_THR_ADJ_START_POS -{ 0xBCAC, 0x012C, WORD_LEN, 0}, // LL_CDC_THR_ADJ_MID_POS -{ 0xBCAE, 0x0009, WORD_LEN, 0}, // LL_CDC_THR_ADJ_END_POS - -//[Aperture_calib] -{ 0x33BA, 0x0084, WORD_LEN, 0}, // APEDGE_CONTROL -{ 0x33BE, 0x0000, WORD_LEN, 0}, // UA_KNEE_L -{ 0x33C2, 0x8800, WORD_LEN, 0}, // UA_WEIGHTS -{ 0xBC5E, 0x0154, WORD_LEN, 0}, // LL_START_APERTURE_GAIN_BM -{ 0xBC60, 0x0640, WORD_LEN, 0}, // LL_END_APERTURE_GAIN_BM -{ 0xBC62, 0x0E, BYTE_LEN, 0}, // LL_START_APERTURE_KPGAIN -{ 0xBC63, 0x14, BYTE_LEN, 0}, // LL_END_APERTURE_KPGAIN -{ 0xBC64, 0x0E, BYTE_LEN, 0}, // LL_START_APERTURE_KNGAIN -{ 0xBC65, 0x14, BYTE_LEN, 0}, // LL_END_APERTURE_KNGAIN -{ 0xBCE2, 0x0A, BYTE_LEN, 0}, // LL_START_POS_KNEE -{ 0xBCE3, 0x2B, BYTE_LEN, 0}, // LL_END_POS_KNEE -{ 0xBCE4, 0x0A, BYTE_LEN, 0}, // LL_START_NEG_KNEE -{ 0xBCE5, 0x2B, BYTE_LEN, 0}, // LL_END_NEG_KNEE -{ 0x3210, 0x49B8, WORD_LEN, 0}, // COLOR_PIPELINE_CONTROL - -//[SFFB_REV3_noisemodel] -{ 0xBCC0, 0x1F, BYTE_LEN, 0}, // LL_SFFB_RAMP_START -{ 0xBCC1, 0x03, BYTE_LEN, 0}, // LL_SFFB_RAMP_STOP -{ 0xBCC2, 0x2C, BYTE_LEN, 0}, // LL_SFFB_SLOPE_START -{ 0xBCC3, 0x10, BYTE_LEN, 0}, // LL_SFFB_SLOPE_STOP -{ 0xBCC4, 0x07, BYTE_LEN, 0}, // LL_SFFB_THSTART -{ 0xBCC5, 0x0B, BYTE_LEN, 0}, // LL_SFFB_THSTOP -{ 0xBCBA, 0x0009, WORD_LEN, 0}, // LL_SFFB_CONFIG - -//[**********Step8*************] -//[FTB_Off] -{ 0xBC14, 0xFFFE, WORD_LEN, 0}, // LL_GAMMA_FADE_TO_BLACK_START_POS -{ 0xBC16, 0xFFFE, WORD_LEN, 0}, // LL_GAMMA_FADE_TO_BLACK_END_POS - -//[Aperture_preference] -{ 0xBC66, 0x0154, WORD_LEN, 0}, // LL_START_APERTURE_GM -{ 0xBC68, 0x07D0, WORD_LEN, 0}, // LL_END_APERTURE_GM -{ 0xBC6A, 0x04, BYTE_LEN, 0}, // LL_START_APERTURE_INTEGER_GAIN -{ 0xBC6B, 0x00, BYTE_LEN, 0}, // LL_END_APERTURE_INTEGER_GAIN -{ 0xBC6C, 0x00, BYTE_LEN, 0}, // LL_START_APERTURE_EXP_GAIN -{ 0xBC6D, 0x00, BYTE_LEN, 0}, // LL_END_APERTURE_EXP_GAIN - -//[Gain_max] -{ 0xA81C, 0x0040, WORD_LEN, 0}, // AE_TRACK_MIN_AGAIN -{ 0xA820, 0x012C, WORD_LEN, 0}, // AE_TRACK_MAX_AGAIN -{ 0xA822, 0x0060, WORD_LEN, 0}, // AE_TRACK_MIN_DGAIN -{ 0xA824, 0x00E5, WORD_LEN, 0}, // AE_TRACK_MAX_DGAIN - -//[Saturation_REV3] -{ 0xBC56, 0x64, BYTE_LEN, 0}, // LL_START_CCM_SATURATION -{ 0xBC57, 0x1E, BYTE_LEN, 0}, // LL_END_CCM_SATURATION - -//[DCCM_REV3] -{ 0xBCDE, 0x03, BYTE_LEN, 0}, // LL_START_SYS_THRESHOLD -{ 0xBCDF, 0x50, BYTE_LEN, 0}, // LL_STOP_SYS_THRESHOLD -{ 0xBCE0, 0x08, BYTE_LEN, 0}, // LL_START_SYS_GAIN -{ 0xBCE1, 0x03, BYTE_LEN, 0}, // LL_STOP_SYS_GAIN - -//[Sobel_REV3] -{ 0xBCD0, 0x000A, WORD_LEN, 0}, // LL_SFFB_SOBEL_FLAT_START -{ 0xBCD2, 0x00FE, WORD_LEN, 0}, // LL_SFFB_SOBEL_FLAT_STOP -{ 0xBCD4, 0x001E, WORD_LEN, 0}, // LL_SFFB_SOBEL_SHARP_START -{ 0xBCD6, 0x00FF, WORD_LEN, 0}, // LL_SFFB_SOBEL_SHARP_STOP -{ 0xBCC6, 0x00, BYTE_LEN, 0}, // LL_SFFB_SHARPENING_START -{ 0xBCC7, 0x00, BYTE_LEN, 0}, // LL_SFFB_SHARPENING_STOP -{ 0xBCC8, 0x20, BYTE_LEN, 0}, // LL_SFFB_FLATNESS_START -{ 0xBCC9, 0x40, BYTE_LEN, 0}, // LL_SFFB_FLATNESS_STOP -{ 0xBCCA, 0x04, BYTE_LEN, 0}, // LL_SFFB_TRANSITION_START -{ 0xBCCB, 0x00, BYTE_LEN, 0}, // LL_SFFB_TRANSITION_STOP - -//[SFFB_slope_zero_enable] -{ 0xBCE6, 0x03, BYTE_LEN, 0}, // LL_SFFB_ZERO_ENABLE -{ 0xBCE6, 0x03, BYTE_LEN, 0}, // LL_SFFB_ZERO_ENABLE - - -//[AE_preference] -{ 0xA410, 0x04, BYTE_LEN, 0}, // AE_RULE_TARGET_AE_6 -{ 0xA411, 0x06, BYTE_LEN, 0}, // AE_RULE_TARGET_AE_7 - - -//[**********Step9*************] -//[JPEG Quantization] -//[Sepia effect] -{ 0xDC3A, 0x23, BYTE_LEN, 0}, // SYS_SEPIA_CR -{ 0xDC3B, 0xB2, BYTE_LEN, 0}, // SYS_SEPIA_CB - - -//[Touch Focus + Fast Focus AF_AFM_INIT] -{ 0x8411, 0x00, BYTE_LEN, 0}, // SEQ_STATE_CFG_0_AF -{ 0x8419, 0x04, BYTE_LEN, 0}, // SEQ_STATE_CFG_1_AF - -{ 0xB002, 0x0002, WORD_LEN, 0}, // AF_MODE -{ 0xC40A, 0x0030, WORD_LEN, 0}, // AFM_POS_MIN -{ 0xC40C, 0x00A0, WORD_LEN, 0}, // AFM_POS_MAX -{ 0xB045, 0x000C, WORD_LEN, 0}, // AF_MODE_EX - - -//AF Window size -{ 0xB854, 0x60, BYTE_LEN, 0}, // STAT_SM_WINDOW_POS_X -{ 0xB855, 0x60, BYTE_LEN, 0}, // STAT_SM_WINDOW_POS_Y -{ 0xB856, 0x40, BYTE_LEN, 0}, // STAT_SM_WINDOW_SIZE_X -{ 0xB857, 0x40, BYTE_LEN, 0}, // STAT_SM_WINDOW_SIZE_Y -{ 0xB012, 0x0A, BYTE_LEN, 0}, // AF_FS_NUM_STEPS -{ 0xB018, 0x00, BYTE_LEN, 0}, // AF_FS_POS_0 -{ 0xB019, 0x30, BYTE_LEN, 0}, // AF_FS_POS_1 -{ 0xB01A, 0x48, BYTE_LEN, 0}, // AF_FS_POS_2 -{ 0xB01B, 0x60, BYTE_LEN, 0}, // AF_FS_POS_3 -{ 0xB01C, 0x78, BYTE_LEN, 0}, // AF_FS_POS_4 -{ 0xB01D, 0x90, BYTE_LEN, 0}, // AF_FS_POS_5 -{ 0xB01E, 0xA8, BYTE_LEN, 0}, // AF_FS_POS_6 -{ 0xB01F, 0xC0, BYTE_LEN, 0}, // AF_FS_POS_7 -{ 0xB020, 0xE0, BYTE_LEN, 0}, // AF_FS_POS_8 -{ 0xB021, 0xFF, BYTE_LEN, 0}, // AF_FS_POS_9 -{ 0xB022, 0x00, BYTE_LEN, 0}, // AF_FS_POS_10 -{ 0xB011, 0x00, BYTE_LEN, 0}, // AF_FS_INIT_POS - -//INIT PATCH PAGE used in FF -{ 0x098E, 0xD40E, WORD_LEN, 0}, // LOGICAL_ADDRESS_ACCESS -{ 0xD40E, 0x0000, WORD_LEN, 0}, -{ 0xD40F, 0x0000, WORD_LEN, 0}, -{ 0xD410, 0x0000, WORD_LEN, 0}, -{ 0xD411, 0x0000, WORD_LEN, 0}, -{ 0xD412, 0x0000, WORD_LEN, 0}, -{ 0xD413, 0x0000, WORD_LEN, 0}, -{ 0xD414, 0x0000, WORD_LEN, 0}, -{ 0xD415, 0x0000, WORD_LEN, 0}, -{ 0xD416, 0x0000, WORD_LEN, 0}, -{ 0xD417, 0x0000, WORD_LEN, 0}, -{ 0xD418, 0x0000, WORD_LEN, 0}, -{ 0xD418, 0x0000, WORD_LEN, 0}, -{ 0xD419, 0x0000, WORD_LEN, 0}, -{ 0xD41A, 0x0000, WORD_LEN, 0}, -{ 0xD41B, 0x0000, WORD_LEN, 0}, -{ 0xD41C, 0x0000, WORD_LEN, 0}, -{ 0xD41D, 0x0000, WORD_LEN, 0}, -{ 0xD41E, 0x0000, WORD_LEN, 0}, -{ 0xD420, 0x0000, WORD_LEN, 0}, -{ 0xD406, 0x0000, WORD_LEN, 0}, -{ 0xD407, 0x0000, WORD_LEN, 0}, -{ 0xD422, 0x0000, WORD_LEN, 0}, -{ 0xD423, 0x0000, WORD_LEN, 0}, -{ 0xD424, 0x0000, WORD_LEN, 0}, -{ 0xD425, 0x0000, WORD_LEN, 0}, -{ 0xD426, 0x0000, WORD_LEN, 0}, -{ 0xD427, 0x0000, WORD_LEN, 0}, -{ 0xD428, 0x0000, WORD_LEN, 0}, -{ 0xD429, 0x0000, WORD_LEN, 0}, -{ 0xD42A, 0x0000, WORD_LEN, 0}, -{ 0xD42B, 0x0000, WORD_LEN, 0}, -{ 0xD400, 0x0001, WORD_LEN, 0}, -{ 0xD401, 0x0000, WORD_LEN, 0}, -{ 0xD402, 0x0028, WORD_LEN, 0}, -{ 0xD403, 0x0080, WORD_LEN, 0}, -{ 0xD404, 0x0000, WORD_LEN, 0}, -{ 0xD405, 0x0000, WORD_LEN, 0}, -{ 0xD406, 0x0000, WORD_LEN, 0}, -{ 0xD407, 0x0000, WORD_LEN, 0}, -{ 0xD408, 0x0030, WORD_LEN, 0}, -{ 0xD409, 0x0040, WORD_LEN, 0}, -{ 0xD40A, 0x0050, WORD_LEN, 0}, -{ 0xD40B, 0x0070, WORD_LEN, 0}, -{ 0xD40C, 0x0080, WORD_LEN, 0}, -{ 0xD40D, 0x0090, WORD_LEN, 0}, - -{ 0x0018, 0x2008, WORD_LEN, 0}, // STANDBY_CONTROL_AND_STATUS - -{SEQUENCE_WAIT_MS,100, WORD_LEN, 0}, - - { SEQUENCE_END, 0x00, 0, 0} - - - -}; - -/* 720p 15fps @ 1280x720 */ -static struct reginfo sensor_720p[]= -{ - //{SEQUENCE_END, 0x00}, - {0x098E, 0x843C, WORD_LEN, 0}, // LOGICAL_ADDRESS_ACCESS [CAM_CORE_A_Y_ADDR_START] - {0x843C, 0x01, BYTE_LEN, 0 }, // SEQ_STATE_CFG_5_MAX_FRAME_CNT - {0x8404, 0x01, BYTE_LEN, 0 }, // SEQ_CMD - {0x0016, 0x0447, WORD_LEN, 0}, // CLOCKS_CONTROL - {0xC83A, 0x0106, WORD_LEN, 0}, // CAM_CORE_A_Y_ADDR_START - {0xC83C, 0x0018, WORD_LEN, 0}, // CAM_CORE_A_X_ADDR_START - {0xC83E, 0x06B7, WORD_LEN, 0}, // CAM_CORE_A_Y_ADDR_END - {0xC840, 0x0A45, WORD_LEN, 0}, // CAM_CORE_A_X_ADDR_END - {0xC86C, 0x0518, WORD_LEN, 0}, // CAM_CORE_A_OUTPUT_SIZE_WIDTH - {0xC86E, 0x02D8, WORD_LEN, 0}, // CAM_CORE_A_OUTPUT_SIZE_HEIGHT - {0xC870, 0x0014, WORD_LEN, 0}, // CAM_CORE_A_RX_FIFO_TRIGGER_MARK - {0xC858, 0x0003, WORD_LEN, 0}, // CAM_CORE_A_COARSE_ITMIN - {0xC8B8, 0x0004, WORD_LEN, 0}, // CAM_OUTPUT_0_JPEG_CONTROL -/****bug:part pixsels data not to be aquired *****/ -#if ADJUST_FOR_720P_FALG - {0xC8AA, 0x0500, WORD_LEN, 0}, // CAM_OUTPUT_0_IMAGE_WIDTH - {0xC8AC, 0x02D1, WORD_LEN, 0}, // CAM_OUTPUT_0_IMAGE_HEIGHT -#else - {0xC8AA, 0x0500, WORD_LEN, 0}, // CAM_OUTPUT_0_IMAGE_WIDTH - {0xC8AC, 0x02D0, WORD_LEN, 0}, // CAM_OUTPUT_0_IMAGE_HEIGHT -#endif - {0xC8AE, 0x0001, WORD_LEN, 0}, // CAM_OUTPUT_0_OUTPUT_FORMAT - {0x8404, 0x06, BYTE_LEN, 0 }, // SEQ_CMD - - {SEQUENCE_WAIT_MS,100, WORD_LEN, 0}, - - { SEQUENCE_END, 0x00, 0, 0} -}; - -/* 1080p, 0x15fps, 0xyuv @1920x1080 */ -static struct reginfo sensor_1080p[]= -{ -{ SEQUENCE_END, 0x00, 0, 0} -}; - -/* 2592X1944 QSXGA */ -#if ADJUST_FOR_CAPTURE_FALG -static struct reginfo sensor_qsxga[] = -{ - - {0x098E, 0x48C0,WORD_LEN,0}, // LOGICAL_ADDRESS_ACCESS [CAM_OUTPUT_1_IMAGE_WIDTH] - {0xC8C0, 0x0A20,WORD_LEN,0}, // CAM_OUTPUT_1_IMAGE_WIDTH - {0xC8C2, 0x0798,WORD_LEN,0}, // CAM_OUTPUT_1_IMAGE_HEIGHT - {0x8404, 0x06 ,BYTE_LEN,0}, // SEQ_CMD - {SEQUENCE_WAIT_MS,100,WORD_LEN,0}, - - {SEQUENCE_END, 0x00, 0, 0} -}; -#else -static struct reginfo sensor_qsxga[] = -{ - {SEQUENCE_PROPERTY,SEQUENCE_CAPTURE}, - { SEQUENCE_END, 0x00, 0, 0} -}; -#endif - -/* 2048*1536 QXGA */ -#if ADJUST_FOR_CAPTURE_FALG -// send extra two lines to forbid to be captured error -static struct reginfo sensor_qxga[] = -{ - {0x098E, 0x48C0,WORD_LEN,0}, // LOGICAL_ADDRESS_ACCESS [CAM_OUTPUT_1_IMAGE_WIDTH] - {0xC8C0, 0x0800,WORD_LEN,0}, // CAM_OUTPUT_1_IMAGE_WIDTH - {0xC8C2, 0x0602,WORD_LEN,0}, // CAM_OUTPUT_1_IMAGE_HEIGHT - {0x8404, 0x06 ,BYTE_LEN,0}, // SEQ_CMD - {SEQUENCE_WAIT_MS,100,WORD_LEN,0}, - - {SEQUENCE_END, 0x00, 0, 0} -}; -#else -static struct reginfo sensor_qxga[] = -{ -{ SEQUENCE_END, 0x00, 0, 0} -}; -#endif - -/* 1600X1200 UXGA */ -#if ADJUST_FOR_CAPTURE_FALG -static struct reginfo sensor_uxga[] = -{ - {0x098E, 0x48C0,WORD_LEN,0}, // LOGICAL_ADDRESS_ACCESS [CAM_OUTPUT_1_IMAGE_WIDTH] - {0xC8C0, 0x0640,WORD_LEN,0}, // CAM_OUTPUT_1_IMAGE_WIDTH - {0xC8C2, 0x04b2,WORD_LEN,0}, // CAM_OUTPUT_1_IMAGE_HEIGHT - {0x8404, 0x06 ,BYTE_LEN,0}, // SEQ_CMD - {SEQUENCE_WAIT_MS,100,WORD_LEN,0}, - - {SEQUENCE_END, 0x00, 0, 0} -}; -#else -static struct reginfo sensor_uxga[] = -{ - { SEQUENCE_END, 0x00, 0, 0} -}; -#endif - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 1024X768 XGA */ -#if ADJUST_FOR_CAPTURE_FALG -static struct reginfo sensor_xga[] = -{ - {0x098E, 0x48C0,WORD_LEN,0}, // LOGICAL_ADDRESS_ACCESS [CAM_OUTPUT_1_IMAGE_WIDTH] - {0xC8C0, 0x0403,WORD_LEN,0}, // CAM_OUTPUT_1_IMAGE_WIDTH - {0xC8C2, 0x0302,WORD_LEN,0}, // CAM_OUTPUT_1_IMAGE_HEIGHT - {0x8404, 0x06 ,BYTE_LEN,0}, // SEQ_CMD - {SEQUENCE_WAIT_MS,100,WORD_LEN,0}, - - {SEQUENCE_END, 0x00, 0, 0} -}; -#else -static struct reginfo sensor_xga[] = -{ - {SEQUENCE_END, 0x00, 0, 0} -}; -#endif - - -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - { SEQUENCE_END, 0x00, 0, 0} -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - //720p2vga - {0xC83A, 0x000C, WORD_LEN, 0}, // CAM_CORE_A_Y_ADDR_START - {0xC83C, 0x0018, WORD_LEN, 0}, // CAM_CORE_A_X_ADDR_START - {0xC83E, 0x07B1, WORD_LEN, 0 }, // CAM_CORE_A_Y_ADDR_END - {0xC840, 0x0A45, WORD_LEN, 0}, // CAM_CORE_A_X_ADDR_END - {0xC868, 0x0423, WORD_LEN, 0}, // CAM_CORE_A_FRAME_LENGTH_LINES - {0xC86A, 0x1194, WORD_LEN, 0}, // CAM_CORE_A_LINE_LENGTH_PCK - {0xC86C, 0x0518, WORD_LEN, 0}, // CAM_CORE_A_OUTPUT_SIZE_WIDTH - {0xC86E, 0x03D4, WORD_LEN, 0}, // CAM_CORE_A_OUTPUT_SIZE_HEIGHT - {0xC870, 0x0014, WORD_LEN, 0}, // CAM_CORE_A_RX_FIFO_TRIGGER_MARK - {0xC858, 0x0003, WORD_LEN, 0}, // CAM_CORE_A_COARSE_ITMIN - {0xC8A4, 0x0A28, WORD_LEN, 0}, // CAM_CORE_B_OUTPUT_SIZE_WIDTH - {0xC8A6, 0x07A0, WORD_LEN, 0 }, // CAM_CORE_B_OUTPUT_SIZE_HEIGHT - {0xC8AA, 0x0280, WORD_LEN, 0 }, // CAM_OUTPUT_0_IMAGE_WIDTH - {0xC8AC, 0x01E0, WORD_LEN, 0 }, // CAM_OUTPUT_0_IMAGE_HEIGHT - {0xC8AE, 0x0001, WORD_LEN, 0 }, // CAM_OUTPUT_0_OUTPUT_FORMAT - {0x8404, 0x06, BYTE_LEN, 0 }, // SEQ_CMD - {SEQUENCE_WAIT_MS,100, WORD_LEN, 0}, - {SEQUENCE_END, 0x00, 0, 0} - -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {SEQUENCE_END, 0x00} -}; -#endif -static struct reginfo sensor_Preview2Capture[]= -{ - //capture2preview - {0x098E, 0x843C, WORD_LEN, 0}, // LOGICAL_ADDRESS_ACCESS [SEQ_STATE_CFG_5_MAX_FRAME_CNT] - {0x843C, 0xFF, BYTE_LEN, 0 }, // SEQ_STATE_CFG_5_MAX_FRAME_CNT - {0x8404, 0x02, BYTE_LEN, 0 }, // SEQ_CMD - {SEQUENCE_END, 0x00, 0, 0} - -}; - -static struct reginfo sensor_Capture2Preview[]= -{ - //snap2preview - {0x098E, 0x843C, WORD_LEN, 0}, // LOGICAL_ADDRESS_ACCESS [SEQ_STATE_CFG_5_MAX_FRAME_CNT] - {0x843C, 0x01, BYTE_LEN, 0 }, // SEQ_STATE_CFG_5_MAX_FRAME_CNT - {0x8404, 0x01, BYTE_LEN, 0 }, // SEQ_CMD - {0x0016, 0x0447, WORD_LEN, 0}, // CLOCKS_CONTRO - {SEQUENCE_END, 0x00, 0, 0} - -}; -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {SEQUENCE_END, 0x00} -}; - - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - //Auto - {0x098E, 0xACB0, WORD_LEN, 0}, // LOGICAL_ADDRESS_ACCESS [AWB_MIN_ACCEPTED_PRE_AWB_R2G_RATIO] - {0xACB0, 0x31, BYTE_LEN, 0 }, // AWB_RG_MIN - {0xACB1, 0x5B, BYTE_LEN, 0 }, // AWB_RG_MAX - {0xACB4, 0x2A, BYTE_LEN, 0 }, // AWB_BG_MIN - {0xACB5, 0x5B, BYTE_LEN, 0 }, // AWB_BG_MAX - {0xACB2, 0x40, BYTE_LEN, 0 }, // AWB_RG_MIN_BRIGHT - {0xACB3, 0x48, BYTE_LEN, 0 }, // AWB_RG_MAX_BRIGHT - {0xACB6, 0x3f, BYTE_LEN, 0 }, // AWB_BG_MIN_BRIGHT - {0xACB7, 0x48, BYTE_LEN, 0 }, // AWB_BG_MAX_BRIGHT - {0xAC44, 0x00, BYTE_LEN, 0 }, // AWB_LEFT_CCM_POS_RANGE_LIMIT - {0xAC45, 0x7F, BYTE_LEN, 0 }, // AWB_RIGHT_CCM_POS_RANGE_LIMIT - {SEQUENCE_END, 0x00, 0, 0} - -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - //[V. DL 7500] - { 0x098E, 0xACB0, WORD_LEN, 0}, // LOGICAL_ADDRESS_ACCESS [AWB_MIN_ACCEPTED_PRE_AWB_R2G_RATIO] - {0xACB0, 0x38, BYTE_LEN, 0 }, // AWB_RG_MIN - {0xACB1, 0x42, BYTE_LEN, 0 }, // AWB_RG_MAX - {0xACB4, 0x44, BYTE_LEN, 0 }, // AWB_BG_MIN - {0xACB5, 0x4C, BYTE_LEN, 0 }, // AWB_BG_MAX - {0xACB2, 0x38, BYTE_LEN, 0 }, // AWB_RG_MIN_BRIGHT - {0xACB3, 0x42, BYTE_LEN, 0 }, // AWB_RG_MAX_BRIGHT - {0xACB6, 0x44, BYTE_LEN, 0 }, // AWB_BG_MIN_BRIGHT - {0xACB7, 0x4C, BYTE_LEN, 0 }, // AWB_BG_MAX_BRIGHT - {0xAC44, 0x7C, BYTE_LEN, 0 }, // AWB_LEFT_CCM_POS_RANGE_LIMIT - {0xAC45, 0x7F, BYTE_LEN, 0 }, // AWB_RIGHT_CCM_POS_RANGE_LIMIT - {0xAC04, 0x3E, BYTE_LEN, 0 }, // AWB_PRE_AWB_R2G_RATIO - {0xAC05, 0x48, BYTE_LEN, 0 }, // AWB_PRE_AWB_B2G_RATIO - {0xAC08, 0x7F, BYTE_LEN, 0 }, // AWB_CUR_CCM_POS - {SEQUENCE_END, 0x00, 0, 0} - -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //[IV Day Light] - { 0x098E, 0xACB0, WORD_LEN, 0}, // LOGICAL_ADDRESS_ACCESS [AWB_MIN_ACCEPTED_PRE_AWB_R2G_RATIO] - {0xACB0, 0x3A, BYTE_LEN, 0 }, // AWB_RG_MIN - {0xACB1, 0x44, BYTE_LEN, 0 }, // AWB_RG_MAX - {0xACB4, 0x40, BYTE_LEN, 0 }, // AWB_BG_MIN - {0xACB5, 0x4A, BYTE_LEN, 0 }, // AWB_BG_MAX - {0xACB2, 0x3A, BYTE_LEN, 0 }, // AWB_RG_MIN_BRIGHT - {0xACB3, 0x44, BYTE_LEN, 0 }, // AWB_RG_MAX_BRIGHT - {0xACB6, 0x40, BYTE_LEN, 0 }, // AWB_BG_MIN_BRIGHT - {0xACB7, 0x4A, BYTE_LEN, 0 }, // AWB_BG_MAX_BRIGHT - {0xAC44, 0x7C, BYTE_LEN, 0 }, // AWB_LEFT_CCM_POS_RANGE_LIMIT - {0xAC45, 0x7F, BYTE_LEN, 0 }, // AWB_RIGHT_CCM_POS_RANGE_LIMIT - {0xAC04, 0x40, BYTE_LEN, 0 }, // AWB_PRE_AWB_R2G_RATIO - {0xAC05, 0x48, BYTE_LEN, 0 }, // AWB_PRE_AWB_B2G_RATIO - {0xAC08, 0x7F, BYTE_LEN, 0 }, // AWB_CUR_CCM_POS - {SEQUENCE_END, 0x00, 0, 0} - -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - //[III Fluorescent] - { 0x098E, 0xACB0, WORD_LEN, 0}, // LOGICAL_ADDRESS_ACCESS [AWB_MIN_ACCEPTED_PRE_AWB_R2G_RATIO] - {0xACB0, 0x44, BYTE_LEN, 0 }, // AWB_RG_MIN - {0xACB1, 0x4B, BYTE_LEN, 0 }, // AWB_RG_MAX - {0xACB4, 0x2C, BYTE_LEN, 0 }, // AWB_BG_MIN - {0xACB5, 0x34, BYTE_LEN, 0 }, // AWB_BG_MAX - {0xACB2, 0x44, BYTE_LEN, 0 }, // AWB_RG_MIN_BRIGHT - {0xACB3, 0x4B, BYTE_LEN, 0 }, // AWB_RG_MAX_BRIGHT - {0xACB6, 0x2C, BYTE_LEN, 0 }, // AWB_BG_MIN_BRIGHT - {0xACB7, 0x34, BYTE_LEN, 0 }, // AWB_BG_MAX_BRIGHT - {0xAC44, 0x40, BYTE_LEN, 0 }, // AWB_LEFT_CCM_POS_RANGE_LIMIT - {0xAC45, 0x4A, BYTE_LEN, 0 }, // AWB_RIGHT_CCM_POS_RANGE_LIMIT - {0xAC04, 0x47, BYTE_LEN, 0 }, // AWB_PRE_AWB_R2G_RATIO - {0xAC05, 0x30, BYTE_LEN, 0 }, // AWB_PRE_AWB_B2G_RATIO - {0xAC08, 0x45, BYTE_LEN, 0 }, // AWB_CUR_CCM_POS - {SEQUENCE_END, 0x00, 0, 0} -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - //[II. Incandescent] - { 0x098E, 0xACB0, WORD_LEN, 0}, // LOGICAL_ADDRESS_ACCESS [AWB_MIN_ACCEPTED_PRE_AWB_R2G_RATIO] - {0xACB0, 0x57, BYTE_LEN, 0 }, // AWB_RG_MIN - {0xACB1, 0x5F, BYTE_LEN, 0 }, // AWB_RG_MAX - {0xACB4, 0x26, BYTE_LEN, 0 }, // AWB_BG_MIN - {0xACB5, 0x2E, BYTE_LEN, 0 }, // AWB_BG_MAX - {0xACB2, 0x57, BYTE_LEN, 0 }, // AWB_RG_MIN_BRIGHT - {0xACB3, 0x5F, BYTE_LEN, 0 }, // AWB_RG_MAX_BRIGHT - {0xACB6, 0x26, BYTE_LEN, 0 }, // AWB_BG_MIN_BRIGHT - {0xACB7, 0x2E, BYTE_LEN, 0 }, // AWB_BG_MAX_BRIGHT - {0xAC44, 0x00, BYTE_LEN, 0 }, // AWB_LEFT_CCM_POS_RANGE_LIMIT - {0xAC45, 0x08, BYTE_LEN, 0 }, // AWB_RIGHT_CCM_POS_RANGE_LIMIT - {0xAC04, 0x5B, BYTE_LEN, 0 }, // AWB_PRE_AWB_R2G_RATIO - {0xAC05, 0x2A, BYTE_LEN, 0 }, // AWB_PRE_AWB_B2G_RATIO - {0xAC08, 0x00, BYTE_LEN, 0 }, // AWB_CUR_CCM_POS - {SEQUENCE_END, 0x00, 0, 0} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x098e,0xdc38, WORD_LEN, 0}, - {0xdc38,0x00, BYTE_LEN, 0 }, - {0x8404,0x06, BYTE_LEN, 0 }, - {SEQUENCE_END, 0x00, 0, 0} -}; -#if 0 -static struct reginfo sensor_Effect_WandB[] = -{ - {SEQUENCE_END, 0x00, 0, 0} -}; -#endif -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x098e,0xdc38, WORD_LEN, 0}, - {0xdc38,0x02, BYTE_LEN, 0 }, - {0xdc3a,0x10, BYTE_LEN, 0 }, - {0xdc3b,0xe0, BYTE_LEN, 0 }, - {0x8404,0x06, BYTE_LEN, 0 }, - {SEQUENCE_END, 0x00, 0, 0} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - {0x098e,0xdc38, WORD_LEN, 0}, - {0xdc38,0x03, BYTE_LEN, 0 }, - {0x8404,0x06, BYTE_LEN, 0 }, - {SEQUENCE_END, 0x00, 0, 0} -}; -#if 0 -static struct reginfo sensor_Effect_Bluish[] = -{ - {SEQUENCE_END, 0x00, 0, 0} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - {SEQUENCE_END, 0x00, 0, 0} -}; -#endif -static struct reginfo sensor_Effect_Solarize[] = -{ - {0x098e,0xdc38, WORD_LEN, 0}, - {0xdc38,0x05, BYTE_LEN, 0 }, - {0xdc39,0x20, BYTE_LEN, 0 }, - {0x8404,0x06, BYTE_LEN, 0 }, - {SEQUENCE_END, 0x00, 0, 0} -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Solarize,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast2[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - {SEQUENCE_END, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {SEQUENCE_END, 0x00, 0, 0} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {SEQUENCE_END, 0x00, 0, 0} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {SEQUENCE_END, 0x00, 0, 0} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {SEQUENCE_END, 0x00, 0, 0} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif - -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ - {SEQUENCE_END, 0x00, 0, 0} -}; - -static struct reginfo sensor_SceneNight[] = -{ - {SEQUENCE_END, 0x00, 0, 0} -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif - -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {SEQUENCE_END, 0x00, 0, 0} -}; - -static struct reginfo sensor_Zoom1[] = -{ - {SEQUENCE_END, 0x00, 0, 0} -}; - -static struct reginfo sensor_Zoom2[] = -{ - {SEQUENCE_END, 0x00, 0, 0} -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {SEQUENCE_END, 0x00, 0, 0} -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL}; -#endif -static const struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "negative", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "sepia", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "solarize", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - { - .id = V4L2_CID_FOCUSZONE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "FocusZone Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - },{ - .id = V4L2_CID_FOCUS_AUTO, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Focus Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - },/*{ - .id = V4L2_CID_FOCUS_CONTINUOUS, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Focus Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - },*/ - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 2, - //.maximum = 3 - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; -enum sensor_wq_cmd -{ - WqCmd_af_init, - WqCmd_af_single, - WqCmd_af_special_pos, - WqCmd_af_far_pos, - WqCmd_af_near_pos, - WqCmd_af_continues, - WqCmd_af_return_idle, -}; -enum sensor_wq_result -{ - WqRet_success = 0, - WqRet_fail = -1, - WqRet_inval = -2 -}; -struct sensor_work -{ - struct i2c_client *client; - struct delayed_work dwork; - enum sensor_wq_cmd cmd; - wait_queue_head_t done; - enum sensor_wq_result result; - bool wait; - int var; - int zone_center_pos[2]; -}; -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int auto_focus; - int affm_reinit; - int flash; - int exposure; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - bool snap2preview; - bool video2preview; - int capture_w; - int capture_h; - int preview_w; - int preview_h; - struct reginfo *winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int enable; - unsigned int funmodule_state; -} sensor_info_priv_t; - - - -struct sensor_parameter -{ - unsigned short int preview_maxlines; - unsigned short int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int capture_framerate; - unsigned short int preview_framerate; -}; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - struct sensor_parameter parameter; - struct workqueue_struct *sensor_wq; - struct sensor_work sensor_wk; - struct mutex wq_lock; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf); - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif -} -/*sensor register write */ -static int sensor_write(struct i2c_client *client, struct reginfo *reg_info) -{ - int err=0,cnt; - u8 buf[4]; - struct i2c_msg msg[1]; - - switch (reg_info->reg) - { - case SEQUENCE_WAIT_MS: - { - if (in_atomic()) - mdelay(reg_info->val); - else - msleep(reg_info->val); - break; - } - - case SEQUENCE_WAIT_US: - { - udelay(reg_info->val); - break; - } - case SEQUENCE_PROPERTY: - { - break; - } - default: - { - buf[0] = reg_info->reg >> 8; - buf[1] = reg_info->reg & 0xFF; - if (reg_info->reg_len == WORD_LEN) { - buf[2] = reg_info->val >> 8; - buf[3] = reg_info->val & 0xFF; - msg->len = 4; - } else if (reg_info->reg_len == BYTE_LEN) { - buf[2] = reg_info->val; - msg->len = 3; - } - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg_info->reg, reg_info->val); - udelay(10); - } - } - } - } - return err; -} - -/** - *sensor_write_Multiple_data - sensor register write with Multiple data - * @i2c_client: - * @reg_info: the first register address - * @count: data number - * - * Returns negative errno, else the number of messages executed. - * - * Note that it - */ -static int sensor_write_Multiple_data(struct i2c_client *client, struct reginfo *reg_info, int count) -{ - int err=0,cnt; - int i=0; - int sum =0; - struct reginfo *tmpval = NULL; - u8 *buf; - struct i2c_msg msg[1]; - tmpval = reg_info; - - if(count < 1 || tmpval==NULL||tmpval->reg==0x0000) - return -EINVAL; - - memset((char*)&msg[0],0,sizeof(struct i2c_msg)); - buf = kmalloc((count*2+10)*sizeof(u8),GFP_KERNEL); - if (buf == NULL) { - SENSOR_TR("%s %s fail,because kmalloc failed",SENSOR_NAME_STRING(),__FUNCTION__); - err = -1; - goto sensor_write_Multiple_data_end; - } - memset(buf,0,sizeof(buf)); - - switch (reg_info->reg) - { - case SEQUENCE_WAIT_MS: - { - if (in_atomic()) - mdelay(reg_info->val); - else - msleep(reg_info->val); - break; - } - - case SEQUENCE_WAIT_US: - { - udelay(reg_info->val); - break; - } - - case SEQUENCE_PROPERTY: - { - break; - } - default: - { - - buf[0] = tmpval->reg >> 8; - buf[1] = tmpval->reg & 0xFF; - i= 2; - if (tmpval->reg_len == WORD_LEN) - { - sum = (count+1)*2; - while(ival >> 8; - buf[i+1] = tmpval->val & 0xFF; - i=i+2; - tmpval++; - } - msg->len = sum; - } else if (tmpval->reg_len == BYTE_LEN) { - sum = count+2; - while(ival; - i++; - tmpval++; - } - msg->len = sum; - } - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg_info->reg, reg_info->val); - udelay(10); - } - } - } - } -sensor_write_Multiple_data_end: - if (buf) { - kfree(buf); - buf = NULL; - } - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u16 reg, u16 *val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[2]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 2; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -static int sensor_read1(struct i2c_client *client, struct reginfo *reg_info) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[2]; - - buf[0] = reg_info->reg >> 8; - buf[1] = reg_info->reg & 0xFF; - - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - if (reg_info->reg_len == WORD_LEN) { - msg[1].len = 2; - } else if (reg_info->reg_len == BYTE_LEN) { - msg[1].len = 1; - } - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - if (reg_info->reg_len == WORD_LEN) { - reg_info->val = buf[0]; - reg_info->val <<= 8; - reg_info->val |= buf[1]; - } else if (reg_info->reg_len == BYTE_LEN) { - reg_info->val = buf[0]; - } - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg_info->reg, reg_info->val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0,j=0; - int num = 0; - u16 temp = 0; - -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif - cnt = 0; - - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - - // SENSOR_TR("%s ..%s..\n",SENSOR_NAME_STRING(),__FUNCTION__); - - while (regarray[i].reg != SEQUENCE_END) { - num =1; - j= i+1; - #if 0 - while((regarray[j].reg_len ==regarray[i].reg_len)&®array[j].reg != SEQUENCE_END) - { - temp = regarray[j].reg - regarray[j-1].reg; - if((regarray[j].reg_len==WORD_LEN && temp!=0x0002)||(regarray[j].reg_len==BYTE_LEN && temp!=0x0001)) - break; - num++; - j++; - } - #endif - err = sensor_write_Multiple_data(client, ®array[i], num) ; - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - - i=i+num; - } -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} - -/* write sensor initial data */ -static int sensor_write_init_data(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; - int num = 0; -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif - int ti=0; - int table[167] = { /*written data numbers every time*/ - 3,1,1,3,1,1,1,1,11,2,2,13,1,1,1,2,11,2,2,13, - 1,2,1,1,2,1,1,1,1,1,8,1,1,1,1,1,1,714,1,1, - 1,1,1,1,1,42,1,3,9,1,1,2,2,1,1,1,1,3,1,1, - 1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,8,2,2,2, - 2,2,1,1,1,1,10,10,9,6,4,2,9,2,2,2,1,1,1,1, - 1,1,1,1,1,1,1,1,58,1,1,1,1,1,1,1,1,1,1,1, - 2,2,2,2,2,2,2,2,2,3,3,2,1,1,1,1,1, 2,2,1, - 6,3,1,1,1,1,1,6,1,2,4,4,1,1,1,4,5,2,2,4, - 4,6,1,1,1,1,1 - }; - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - - while (regarray[i].reg != SEQUENCE_END) { - #if 0 - if(ti < 167){ - num = table[ti]; - ti++; - } - #else - num = 1; - #endif - err = sensor_write_Multiple_data(client, ®array[i], num) ; - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - i=i+num; - } -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} - -#if 0 -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - - while (regarray[i].reg != SEQUENCE_END) { - - err = sensor_write(client, ®array[i]); - - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - i++; - } -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -#endif -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != SEQUENCE_END) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif - -#if CONFIG_SENSOR_Focus - -static struct reginfo sensor_af_trigger[] = -{ - { 0xB854, 0x4040, WORD_LEN, 0}, // STAT_SM_WINDOW_POS_X; POS_Y - { 0xB856, 0x4040, WORD_LEN, 0}, // STAT_SM_WINDOW_SIZE_X; SIZE_Y - { 0xB006, 0x01, BYTE_LEN, 0}, //run AF - af.progress - {SEQUENCE_END, 0x00, 0, 0} -}; -static int sensor_af_touch_zone(struct i2c_client *client, int *zone_center_pos) -{ - int ret = 0; - - zone_center_pos[0] = zone_center_pos[0]*0x100/2000; - zone_center_pos[1] = zone_center_pos[1]*0x100/2000; - - zone_center_pos[0] = zone_center_pos[0]/0x40*0x40; - zone_center_pos[1] = zone_center_pos[1]/0x40*0x40; - - sensor_af_trigger[0].val = (zone_center_pos[0]<<8)|zone_center_pos[1]; - -sensor_af_zone_end: - return ret; -} -static int sensor_af_single(struct i2c_client *client) -{ - int ret = 0; - char cnt=0; - struct reginfo reg; - - ret = sensor_write_array(client, sensor_af_trigger); - if (ret<0) { - SENSOR_TR("%s sensor auto focus trigger fail!!\n",SENSOR_NAME_STRING()); - } else { - - reg.reg_len = BYTE_LEN; - reg.reg = 0xb006; - reg.val = 0x01; - - do { - msleep(30); - sensor_read1(client,®); - - } while ((reg.val != 0) && (cnt++ < 50)); - - SENSOR_DG("%s sensor auto focus trigger(0x%x) success! state: %d, cnt: %d\n",SENSOR_NAME_STRING(), - sensor_af_trigger[0].val,reg.val,cnt); - } - - -sensor_af_single_end: - return ret; -} - -static int sensor_af_const(struct i2c_client *client) -{ - int ret = 0; - -sensor_af_const_end: - return ret; -} - -static int sensor_af_init(struct i2c_client *client) -{ - int ret = 0; - return 0; -} -static int sensor_af_downfirmware(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - int ret=0; - struct soc_camera_device *icd = client->dev.platform_data; - struct v4l2_mbus_framefmt mf; - - SENSOR_DG("%s %s Enter\n",SENSOR_NAME_STRING(), __FUNCTION__); - - if (sensor_af_init(client)) { - sensor->info_priv.funmodule_state &= (~SENSOR_AF_IS_OK); - ret = -1; - } else { - sensor->info_priv.funmodule_state |= SENSOR_AF_IS_OK; - - mf.width = icd->user_width; - mf.height = icd->user_height; - mf.code = sensor->info_priv.fmt.code; - mf.colorspace = sensor->info_priv.fmt.colorspace; - mf.field = V4L2_FIELD_NONE; - if (sensor_fmt_videochk(NULL, &mf) == true) { /* ddl@rock-chips.com: focus mode fix const auto focus in video */ - ret = sensor_af_const(client); - } else { - switch (sensor->info_priv.auto_focus) - { - case SENSOR_AF_MODE_AUTO: - { - ret = sensor_af_single(client); - break; - } - case SENSOR_AF_MODE_CLOSE: - { - ret = 0; - break; - } - case SENSOR_AF_MODE_CONTINUOUS: - { - ret = sensor_af_const(client); - break; - } - default: - { - SENSOR_DG("%s focus mode(0x%x) is unkonwn\n",SENSOR_NAME_STRING(),sensor->info_priv.auto_focus); - goto sensor_af_downfirmware_end; - } - } - } - SENSOR_DG("%s sensor_af_downfirmware set focus mode(0x%x) ret:0x%x\n",SENSOR_NAME_STRING(), sensor->info_priv.auto_focus,ret); - } - -sensor_af_downfirmware_end: - - return ret; -} -static void sensor_af_workqueue(struct work_struct *work) -{ - struct sensor_work *sensor_work = container_of(work, struct sensor_work, dwork.work); - struct i2c_client *client = sensor_work->client; - struct sensor *sensor = to_sensor(client); - //struct af_cmdinfo cmdinfo; - - SENSOR_DG("%s %s Enter, cmd:0x%x \n",SENSOR_NAME_STRING(), __FUNCTION__,sensor_work->cmd); - - mutex_lock(&sensor->wq_lock); - - switch (sensor_work->cmd) - { - case WqCmd_af_init: - { - if (sensor_af_downfirmware(client) < 0) { - SENSOR_TR("%s Sensor_af_init is failed in sensor_af_workqueue!\n",SENSOR_NAME_STRING()); - } - break; - } - case WqCmd_af_single: - { - if ((sensor_work->zone_center_pos[0] >=0) && (sensor_work->zone_center_pos[1]>=0)) - sensor_af_touch_zone(client,sensor_work->zone_center_pos); - - if (sensor_af_single(client) < 0) { - SENSOR_TR("%s Sensor_af_single is failed in sensor_af_workqueue!\n",SENSOR_NAME_STRING()); - sensor_work->result = WqRet_fail; - } else { - sensor_work->result = WqRet_success; - } - break; - } - #if 0 - case WqCmd_af_special_pos: - { - sensor_af_idlechk(client); - - cmdinfo.cmd_tag = StepFocus_Spec_Tag; - cmdinfo.cmd_para[0] = sensor_work->var; - cmdinfo.validate_bit = 0x81; - if (sensor_af_cmdset(client, StepMode_Cmd, &cmdinfo) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_near_pos: - { - sensor_af_idlechk(client); - cmdinfo.cmd_tag = StepFocus_Near_Tag; - cmdinfo.validate_bit = 0x80; - if (sensor_af_cmdset(client, StepMode_Cmd, &cmdinfo) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_far_pos: - { - sensor_af_idlechk(client); - cmdinfo.cmd_tag = StepFocus_Far_Tag; - cmdinfo.validate_bit = 0x80; - if (sensor_af_cmdset(client, StepMode_Cmd, &cmdinfo) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - #endif - case WqCmd_af_continues: - { - if (sensor_af_const(client) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - #if 0 - case WqCmd_af_return_idle: - { - if (sensor_af_idlechk(client) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - #endif - default: - SENSOR_TR("Unknow command(%d) in %s af workqueue!",sensor_work->cmd,SENSOR_NAME_STRING()); - break; - } -set_end: - if (sensor_work->wait == false) { - kfree((void*)sensor_work); - } else { - wake_up(&sensor_work->done); - } - mutex_unlock(&sensor->wq_lock); - return; -} - -static int sensor_af_workqueue_set(struct soc_camera_device *icd, enum sensor_wq_cmd cmd, int var, bool wait, int *zone_pos) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - struct sensor_work *wk; - int ret=0; - - if (sensor->sensor_wq == NULL) { - ret = -EINVAL; - goto sensor_af_workqueue_set_end; - } - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) != SENSOR_AF_IS_OK) { - if (cmd != WqCmd_af_init) { - SENSOR_TR("%s %s cmd(%d) ingore,because af module isn't ready!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - ret = -1; - goto sensor_af_workqueue_set_end; - } - } - - wk = kzalloc(sizeof(struct sensor_work), GFP_KERNEL); - if (wk) { - wk->client = client; - INIT_DELAYED_WORK(&wk->dwork, sensor_af_workqueue); - wk->cmd = cmd; - wk->result = WqRet_inval; - wk->wait = wait; - wk->var = var; - - if (zone_pos) { - *zone_pos += 1000; - *(zone_pos+1) += 1000; - *(zone_pos+2) += 1000; - *(zone_pos+3) += 1000; - wk->zone_center_pos[0] = ((*zone_pos + *(zone_pos+2))>>1); - wk->zone_center_pos[1] = ((*(zone_pos+1) + *(zone_pos+3))>>1); - } - - init_waitqueue_head(&wk->done); - - /* ddl@rock-chips.com: - * video_lock is been locked in v4l2_ioctl function, but auto focus may slow, - * As a result any other ioctl calls will proceed very, very slowly since each call - * will have to wait for the AF to finish. Camera preview is pause,because VIDIOC_QBUF - * and VIDIOC_DQBUF is sched. so unlock video_lock here. - */ - if (wait == true) { - queue_delayed_work(sensor->sensor_wq,&(wk->dwork),0); - mutex_unlock(&icd->video_lock); - if (wait_event_timeout(wk->done, (wk->result != WqRet_inval), msecs_to_jiffies(5000)) == 0) { //hhb - SENSOR_TR("%s %s cmd(%d) is timeout!\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - } - ret = wk->result; - kfree((void*)wk); - mutex_lock(&icd->video_lock); - } else { - queue_delayed_work(sensor->sensor_wq,&(wk->dwork),msecs_to_jiffies(10)); - } - - } else { - SENSOR_TR("%s %s cmd(%d) ingore,because struct sensor_work malloc failed!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - ret = -1; - } -sensor_af_workqueue_set_end: - return ret; -} -#endif - -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - printk( "Sensor_Flash on = %d\n", on ); -#if 0 - if(on){ - //flash off after 2 secs - if ( flash_off_timer.status ){ - hrtimer_cancel(&(flash_off_timer.timer)); - } - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - flash_off_timer.status = 1; - }else{ - flash_off_timer.status = 0; - } -#endif - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } - -sensor_power_end: - return ret; -} - -static enum hrtimer_restart flash_off_func(struct hrtimer *hrtimer){ - struct flash_timer *fps_timer = container_of(hrtimer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - printk("%s %s = 0x%x !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__, fps_timer ); - return 0; -} - -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); -#if (ADJUST_OPTIMIZE_TIME_FALG == 0) - const struct v4l2_queryctrl *qctrl; -#endif - const struct sensor_datafmt *fmt; - int ret,pid = 0; - int index =0 ; -#if (SENSOR_RESET_REG != SEQUENCE_END) - struct reginfo reg_info; -#endif - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - SENSOR_DG("\n soft reset..%s.\n",SENSOR_NAME_STRING()); - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - -#if (SENSOR_RESET_REG != SEQUENCE_END) - reg_info.reg = SENSOR_RESET_REG; - reg_info.val = SENSOR_RESET_VAL; - reg_info.reg_len = SENSOR_RESET_REG_LEN; - ret = sensor_write(client, ®_info); - if (ret != 0) { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - mdelay(5); //delay 5 microseconds -#endif - - /* check if it is an sensor sensor */ -#if (SENSOR_ID_REG != SEQUENCE_END) - ret = sensor_read(client, SENSOR_ID_REG, &pid); - if (ret != 0) { - SENSOR_TR("read chip id failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - SENSOR_DG("\n %s pid = 0x%x \n", SENSOR_NAME_STRING(), pid); -#else - pid = SENSOR_ID; -#endif - - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - SENSOR_DG("\n sensor_init_data..%s.\n",SENSOR_NAME_STRING()); - - ret =sensor_write_init_data(client, sensor_init_data); - if (ret != 0) { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - sensor->info_priv.preview_w = SENSOR_INIT_WIDTH; - sensor->info_priv.preview_h = SENSOR_INIT_HEIGHT; - sensor->info_priv.capture_w = SENSOR_MAX_WIDTH; - sensor->info_priv.capture_h = SENSOR_MAX_HEIGHT; - sensor->info_priv.winseqe_cur_addr = SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ -#if ADJUST_OPTIMIZE_TIME_FALG - SENSOR_DG("\n optimize code..%s.\n",SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_WhiteBalance - sensor->info_priv.whiteBalance = 0; - #endif - #if CONFIG_SENSOR_Brightness - sensor->info_priv.brightness = 0; - #endif - #if CONFIG_SENSOR_Effect - sensor->info_priv.effect = 0; - #endif - #if CONFIG_SENSOR_Exposure - sensor->info_priv.exposure = 0; - #endif - #if CONFIG_SENSOR_Saturation - sensor->info_priv.saturation = 0; - #endif - #if CONFIG_SENSOR_Contrast - sensor->info_priv.contrast = 0; - #endif - #if CONFIG_SENSOR_Mirror - sensor->info_priv.mirror = 1; - #endif - #if CONFIG_SENSOR_Flip - sensor->info_priv.flip = 1; - index++; - #endif - #if CONFIG_SENSOR_Scene - sensor->info_priv.scene = 0; - index++; - #endif - #if CONFIG_SENSOR_DigitalZoom - sensor->info_priv.digitalzoom = 0; - #endif - #if CONFIG_SENSOR_Focus - sensor->info_priv.focus = 125 ; - if (sensor_af_init(client) < 0) { - sensor->info_priv.funmodule_state &= ~SENSOR_AF_IS_OK; - SENSOR_TR("%s auto focus module init is fail!\n",SENSOR_NAME_STRING()); - } else { - sensor->info_priv.funmodule_state |= SENSOR_AF_IS_OK; - SENSOR_DG("%s auto focus module init is success!\n",SENSOR_NAME_STRING()); - } - #endif - #if CONFIG_SENSOR_Flash - sensor->info_priv.flash = 0 ; - #endif - -#else - SENSOR_DG("\n origin code..%s.\n",SENSOR_NAME_STRING()); - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - - #if CONFIG_SENSOR_Focus - if (sensor_af_init(client) < 0) { - sensor->info_priv.funmodule_state &= ~SENSOR_AF_IS_OK; - SENSOR_TR("%s auto focus module init is fail!\n",SENSOR_NAME_STRING()); - } else { - sensor->info_priv.funmodule_state |= SENSOR_AF_IS_OK; - SENSOR_DG("%s auto focus module init is success!\n",SENSOR_NAME_STRING()); - } - #endif - #ifdef CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - printk( "flash_off_timer.timer.function\n" ); - - #endif -#endif - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - - - sensor_ioctrl(icd, Sensor_PowerDown, 1); - msleep(100); - - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - - return 0; -} -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend..pm_msg.event=%d \n", SENSOR_NAME_STRING(),pm_msg.event); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - return 0; -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static struct reginfo* sensor_fmt_catch(int set_w, int set_h, int *ret_w, int *ret_h) -{ - struct reginfo *winseqe_set_addr = NULL; - - if (set_w*240 == set_h*320) { - if (((set_w >= 320) && (set_h >= 240)) && (sensor_qvga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qvga; - *ret_w = 320; - *ret_h = 240; - } - -#if ADJUST_FOR_VGA_FALG - // to forbid preview err - if (((set_w >= 576) && (set_h >= 432)) && (sensor_vga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_vga; - *ret_w = 576; - *ret_h = 432; - } -#else - if (((set_w >= 640) && (set_h >= 480)) && (sensor_vga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_vga; - *ret_w = 640; - *ret_h = 480; - } - -#endif - - if (((set_w >= 800) && (set_h >= 600)) && (sensor_svga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_svga; - *ret_w = 800; - *ret_h = 600; - } - - if (((set_w >= 1024) && (set_h >= 768)) && (sensor_xga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_xga; - *ret_w = 1024; - *ret_h = 768; - } - - if (((set_w >= 1280) && (set_h >= 1024)) && (sensor_sxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_sxga; - *ret_w = 1280; - *ret_h = 1024; - } - - if (((set_w >= 1600) && (set_h >= 1200)) && (sensor_uxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_uxga; - *ret_w = 1600; - *ret_h = 1200; - } - - if (((set_w >= 2048) && (set_h >= 1536)) && (sensor_qxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qxga; - *ret_w = 2048; - *ret_h = 1536; - } - - if (((set_w >= 2592) && (set_h >= 1944)) && (sensor_qsxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qsxga; - *ret_w = 2592; - *ret_h = 1944; - } - - if (winseqe_set_addr == NULL) { - if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qcif; - *ret_w = 176; - *ret_h = 144; - } else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_cif; - *ret_w = 352; - *ret_h = 288; - } - - if (((set_w <= 1280) && (set_h <= 720)) && (sensor_720p[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_720p; - *ret_w = 1280; - *ret_h = 720; - } else if (((set_w <= 1920) && (set_h <= 1080)) && (sensor_1080p[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_1080p; - *ret_w = 1920; - *ret_h = 1080; - } - } - - } else if (set_w*288 == set_h*352) { - if (((set_w >= 176) && (set_h >= 144)) && (sensor_qcif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qcif; - *ret_w = 176; - *ret_h = 144; - } else if (((set_w >= 352) && (set_h >= 288)) && (sensor_cif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_cif; - *ret_w = 352; - *ret_h = 288; - } - - if (winseqe_set_addr == NULL) { - if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qvga; - *ret_w = 320; - *ret_h = 240; - } else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_vga; - *ret_w = 640; - *ret_h = 480; - } else if (((set_w <= 800) && (set_h <= 600)) && (sensor_svga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_svga; - *ret_w = 800; - *ret_h = 600; - } else if (((set_w <= 1024) && (set_h <= 768)) && (sensor_xga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_xga; - *ret_w = 1024; - *ret_h = 768; - } else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_sxga; - *ret_w = 1280; - *ret_h = 1024; - } else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_uxga; - *ret_w = 1600; - *ret_h = 1200; - } else if (((set_w <= 2048) && (set_h <= 1536)) && (sensor_qxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qxga; - *ret_w = 2048; - *ret_h = 1536; - } else if (((set_w <= 2592) && (set_h <= 1944)) && (sensor_qsxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qsxga; - *ret_w = 2592; - *ret_h = 1944; - } - - - if (((set_w <= 1280) && (set_h <= 720)) && (sensor_720p[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_720p; - *ret_w = 1280; - *ret_h = 720; - } else if (((set_w <= 1920) && (set_h <= 1080)) && (sensor_1080p[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_1080p; - *ret_w = 1920; - *ret_h = 1080; - } - } - } else if (set_w*720 == set_h*1280) { - if (((set_w >= 1280) && (set_h >= 720)) && (sensor_720p[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_720p; - *ret_w = 1280; - *ret_h = 720; - } else if (((set_w >= 1920) && (set_h >= 1080)) && (sensor_1080p[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_1080p; - *ret_w = 1920; - *ret_h = 1080; - } - - if (winseqe_set_addr == NULL) { - - if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qcif; - *ret_w = 176; - *ret_h = 144; - } else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_cif; - *ret_w = 352; - *ret_h = 288; - } - - if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qvga; - *ret_w = 320; - *ret_h = 240; - } else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_vga; - *ret_w = 640; - *ret_h = 480; - } else if (((set_w <= 800) && (set_h <= 600)) && (sensor_svga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_svga; - *ret_w = 800; - *ret_h = 600; - } else if (((set_w <= 1024) && (set_h <= 768)) && (sensor_xga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_xga; - *ret_w = 1024; - *ret_h = 768; - } else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_sxga; - *ret_w = 1280; - *ret_h = 1024; - } else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_uxga; - *ret_w = 1600; - *ret_h = 1200; - } else if (((set_w <= 2048) && (set_h <= 1536)) && (sensor_qxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qxga; - *ret_w = 2048; - *ret_h = 1536; - } else if (((set_w <= 2592) && (set_h <= 1944)) && (sensor_qsxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qsxga; - *ret_w = 2592; - *ret_h = 1944; - } - } - } else { - if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qcif; - *ret_w = 176; - *ret_h = 144; - } else if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qvga; - *ret_w = 320; - *ret_h = 240; - } else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_cif; - *ret_w = 352; - *ret_h = 288; - } else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_vga; - *ret_w = 640; - *ret_h = 480; - } else if (((set_w <= 800) && (set_h <= 600)) && (sensor_svga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_svga; - *ret_w = 800; - *ret_h = 600; - } else if (((set_w <= 1024) && (set_h <= 768)) && (sensor_xga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_xga; - *ret_w = 1024; - *ret_h = 768; - } else if (((set_w <= 1280) && (set_h <= 720)) && (sensor_720p[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_720p; - *ret_w = 1280; - *ret_h = 720; - } else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_sxga; - *ret_w = 1280; - *ret_h = 1024; - } else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_uxga; - *ret_w = 1600; - *ret_h = 1200; - } else if (((set_w <= 1920) && (set_h <= 1080)) && (sensor_1080p[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_1080p; - *ret_w = 1920; - *ret_h = 1080; - } else if (((set_w <= 2048) && (set_h <= 1536)) && (sensor_qxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qxga; - *ret_w = 2048; - *ret_h = 1536; - } else if (((set_w <= 2592) && (set_h <= 1944)) && (sensor_qsxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qsxga; - *ret_w = 2592; - *ret_h = 1944; - } - } - - return winseqe_set_addr; -} - -/*modify image with resolution 2592*1944;solve bug that the first 32 pixel data*/ -/*in the first line have misplace with the last 32 pixel data in the last line*/ -static int sensor_cb(void *arg) -{ - void __iomem *vbpmem; - struct videobuf_buffer *buffer; - char *imagey_addr =NULL; - char *imageuv_addr = NULL; - char *tempaddr = NULL; - int tempsize = 0; - - buffer = (struct videobuf_buffer*)arg; - if(buffer->width!=SENSOR_MAX_WIDTH||buffer->height!=SENSOR_MAX_HEIGHT||buffer==NULL) - return -EINVAL; - - if (buffer->bsize< YUV420_BUFFER_MAX_SIZE) //yuv420 format size - return -EINVAL; - - - vbpmem = ioremap(buffer->boff,buffer->bsize); - if(vbpmem == NULL) { - SENSOR_DG("\n%s..%s..ioremap fail\n",__FUNCTION__,SENSOR_NAME_STRING()); - return -ENXIO; - } - - imagey_addr = (char*)vbpmem; // y data to be dealed with - imageuv_addr = imagey_addr+buffer->width*buffer->height; - - tempaddr = imageuv_addr - 32; - memcpy(tempaddr,imagey_addr,32); - - tempaddr = imagey_addr+32; - memcpy(imagey_addr,tempaddr,32); - - //uv data to be dealed with - tempsize = YUV420_BUFFER_MAX_SIZE-32; - tempaddr = imagey_addr+tempsize; - memcpy(tempaddr,imageuv_addr,32); - - tempaddr = imageuv_addr+32; - memcpy(imageuv_addr,tempaddr,32); - return 0; -} -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - struct reginfo *winseqe_set_addr=NULL; - int ret = 0, set_w,set_h,cnt; - u16 seq_state=0; - int time = 0; - u16 targetbrightness,realbrightness; - - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - winseqe_set_addr = sensor_fmt_catch(set_w, set_h, &set_w, &set_h); - - if ((winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) && winseqe_set_addr) - { - /*solve bug that video set is ineffective */ - /*set five times to make sure sensor_720p set go into effect*/ - if(winseqe_set_addr==sensor_720p) - { - time = 5; - }else{ - time = 1; - } - - while(time > 0) - { - time--; - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - goto sensor_s_fmt_end; - } - udelay(10); - } - sensor->info_priv.winseqe_cur_addr = winseqe_set_addr; - if (winseqe_set_addr==sensor_qxga ||winseqe_set_addr==sensor_qsxga||winseqe_set_addr==sensor_uxga ||winseqe_set_addr==sensor_xga) - { - SENSOR_DG("\n%s..%s..Capture icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } else { - SENSOR_DG("\n%s..%s..Video icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - sensor->info_priv.preview_w = mf->width; - sensor->info_priv.preview_h = mf->height; - } - } - - if (winseqe_set_addr && (winseqe_set_addr==sensor_qxga ||winseqe_set_addr==sensor_qsxga||winseqe_set_addr==sensor_uxga ||winseqe_set_addr==sensor_xga)) - { - ret |= sensor_write_array(client, sensor_Preview2Capture); - if (ret != 0) { - SENSOR_TR("%s Preview 2 Capture failed\n", SENSOR_NAME_STRING()); - goto sensor_s_fmt_end; - } - - /*check state of register 0x8405 to make sure set is successful*/ - /*set sensor_Preview2Capture more times to make sure set go into effect */ - cnt = 0; - time =0; - do{ - ret = 0; - msleep(50); - ret =sensor_read(client,0x8405, &seq_state); - if (ret < 0) - goto sensor_s_fmt_end; - cnt++; - if(cnt > 9) - { - time++; - cnt = 0; - ret |= sensor_write_array(client, sensor_Preview2Capture); - if (ret != 0||time >2) { - SENSOR_TR("%s Preview 2 Capture failed\n", SENSOR_NAME_STRING()); - goto sensor_s_fmt_end; - } - SENSOR_DG("mt9p111 Preview 2 Capture again\n"); - } - SENSOR_DG("mt9p111 Preview 2 Capture count = %d;seq_state = 0x%x\n",cnt,seq_state); - } while((seq_state != 0x07) && (time < 4)); - - SENSOR_TR("%s Preview 2 Capture successs\n", SENSOR_NAME_STRING()); - - #if CONFIG_SENSOR_Flash - /*The 0xA409 is AE target register address.*/ - /*The 0xB804 is currently total brightness Y value of sensor.*/ - targetbrightness = 0; - realbrightness =0; - if((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) - { - if(sensor->info_priv.flash == 1) - { - ret =sensor_read(client,0xA409, &targetbrightness); - if (ret < 0) - SENSOR_DG("%s ..%s..get targetbrightness fail\n", SENSOR_NAME_STRING(),__FUNCTION__); - - ret =sensor_read(client, 0xB804, &realbrightness); - if (ret < 0) - SENSOR_DG("%s ..%s..get realbrightness fail\n", SENSOR_NAME_STRING(),__FUNCTION__); - } - - if((realbrightness < targetbrightness)|| (sensor->info_priv.flash == 2)) - { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on,realbrightness=%d,targetbrightness=%d\n", SENSOR_NAME_STRING(),realbrightness,targetbrightness); - }else{ - SENSOR_DG("%s not need to flash in capture!\n", SENSOR_NAME_STRING()); - } - } - #endif - sensor->info_priv.capture_w = set_w; - sensor->info_priv.capture_h = set_h; - sensor->info_priv.snap2preview = true; - } else if (sensor->info_priv.snap2preview == true) { - if (winseqe_set_addr || ((sensor->info_priv.preview_w == mf->width) && (sensor->info_priv.preview_h == mf->height))) { - ret |= sensor_write_array(client, sensor_Capture2Preview); - if (ret != 0) { - SENSOR_TR("%s Capture 2 Preview success\n", SENSOR_NAME_STRING()); - goto sensor_s_fmt_end; - } - - cnt = 0; - do{ //check state of register 0x8405 to make sure set is successful - ret = 0; - msleep(50); - ret =sensor_read(client,0x8405, &seq_state); - if (ret < 0) - goto sensor_s_fmt_end; - SENSOR_DG("mt9p111 Capture 2 Preview seq_state = 0x%x\n",seq_state); - } while((seq_state != 0x03) && (cnt < 20)); - - SENSOR_TR("%s Capture 2 Preview success\n", SENSOR_NAME_STRING()); - - #if CONFIG_SENSOR_Flash - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - #endif - sensor->info_priv.preview_w = mf->width; - sensor->info_priv.preview_h = mf->height; - sensor->info_priv.snap2preview = false; - } else { - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - } - - mf->width = set_w; - mf->height = set_h; -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - if (sensor_fmt_catch(mf->width, mf->height, &mf->width, &mf->height) == NULL) { - mf->width = 0; - mf->height = 0; - } - mf->colorspace = fmt->colorspace; - - return ret; -} - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV2655 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - int time =5; - int ret =0 ; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - /*set five times to make sure the set go into effect*/ - /*solve bug for setting invalidate during changing from preview to video*/ - while(time >0) - { - time--; - ret |=sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]); - if(ret != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - msleep(50); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value > 0) && ((digitalzoom_cur + value) > digitalzoom_total)) - { - value = digitalzoom_total - digitalzoom_cur; - } - - if ((value < 0) && ((digitalzoom_cur + value) < 0)) - { - value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - printk("=====sensor_set_flash====== Flash On\n"); - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - printk("=====sensor_set_flash====== Flash off\n"); - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Focus -static int sensor_set_focus_absolute(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int ret = 0; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (!qctrl_info) - return -EINVAL; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - if ((value >= qctrl_info->minimum) && (value <= qctrl_info->maximum)) { - - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EINVAL; - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - } - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - -sensor_set_focus_absolute_end: - return ret; -} -static int sensor_set_focus_relative(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int ret = 0; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_RELATIVE); - if (!qctrl_info) - return -EINVAL; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - if ((value >= qctrl_info->minimum) && (value <= qctrl_info->maximum)) { - - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EINVAL; - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - } - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } -sensor_set_focus_relative_end: - return ret; -} - -static int sensor_set_focus_mode(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value, int *zone_pos) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int ret = 0; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - switch (value) - { - case SENSOR_AF_MODE_AUTO: - { - ret = sensor_af_workqueue_set(icd, WqCmd_af_single, 0, true, zone_pos); - break; - } - - /*case SENSOR_AF_MODE_MACRO: - { - ret = sensor_set_focus_absolute(icd, qctrl, 0xff); - break; - } - - case SENSOR_AF_MODE_INFINITY: - { - ret = sensor_set_focus_absolute(icd, qctrl, 0x00); - break; - } - */ - case SENSOR_AF_MODE_CONTINUOUS: - { - ret = sensor_af_workqueue_set(icd, WqCmd_af_continues, 0, true,NULL); - break; - } - default: - SENSOR_TR("\n %s..%s AF value(0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__,value); - break; - - } - - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - - return ret; - -} -#endif -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - #if 0 - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (sensor_set_focus_absolute(icd, qctrl,ext_ctrl->value) == 0) { - if (ext_ctrl->value == qctrl->minimum) { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_INFINITY; - } else if (ext_ctrl->value == qctrl->maximum) { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_MACRO; - } else { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_FIXED; - } - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - sensor_set_focus_relative(icd, qctrl,ext_ctrl->value); - break; - } - #endif - case V4L2_CID_FOCUS_AUTO: - { - if (ext_ctrl->value) { - if ((ext_ctrl->value==1) || (SENSOR_AF_MODE_AUTO == sensor->info_priv.auto_focus)) { - if (sensor_set_focus_mode(icd, qctrl,SENSOR_AF_MODE_AUTO,ext_ctrl->rect) != 0) { - if(0 == (sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK)) { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_AUTO; - } - return -EINVAL; - } - } - if (ext_ctrl->value == 1) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_AUTO; - } else if (SENSOR_AF_MODE_AUTO == sensor->info_priv.auto_focus){ - if (ext_ctrl->value == 0) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CLOSE; - } - break; - } - case V4L2_CID_FOCUS_CONTINUOUS: - { - if (SENSOR_AF_MODE_CONTINUOUS != sensor->info_priv.auto_focus) { - if (ext_ctrl->value == 1) { - if (sensor_set_focus_mode(icd, qctrl,SENSOR_AF_MODE_CONTINUOUS,NULL) != 0) { - if(0 == (sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK)) { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CONTINUOUS; - } - return -EINVAL; - } - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CONTINUOUS; - } - } else { - if (ext_ctrl->value == 0) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CLOSE; - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_stream(struct v4l2_subdev *sd, int enable) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - #if CONFIG_SENSOR_Focus - struct soc_camera_device *icd = client->dev.platform_data; - struct v4l2_mbus_framefmt mf; - #endif - - if (enable == 1) { - sensor->info_priv.enable = 1; - #if CONFIG_SENSOR_Focus - mf.width = icd->user_width; - mf.height = icd->user_height; - mf.code = sensor->info_priv.fmt.code; - mf.colorspace = sensor->info_priv.fmt.colorspace; - mf.field = V4L2_FIELD_NONE; - /* If auto focus firmware haven't download success, must download firmware again when in video or preview stream on */ - if (sensor_fmt_capturechk(sd, &mf) == false) { - if ((sensor->info_priv.affm_reinit == 1) || ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK)==0)) { - sensor_af_workqueue_set(icd, WqCmd_af_init, 0, false,NULL); - sensor->info_priv.affm_reinit = 0; - } - } - #endif - } else if (enable == 0) { - sensor->info_priv.enable = 0; - #if CONFIG_SENSOR_Focus - flush_workqueue(sensor->sensor_wq); - #endif - } - return 0; -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - int ret,pid = 0; - struct sensor *sensor = to_sensor(client); -#if (SENSOR_RESET_REG != SEQUENCE_END) - struct reginfo reg_info; -#endif - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - - /* soft reset */ -#if (SENSOR_RESET_REG != SEQUENCE_END) - reg_info.reg = SENSOR_RESET_REG; - reg_info.val = SENSOR_RESET_VAL; - reg_info.reg_len = SENSOR_RESET_REG_LEN; - ret = sensor_write(client, ®_info); - if (ret != 0) { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - mdelay(5); //delay 5 microseconds -#endif - - /* check if it is an sensor sensor */ -#if (SENSOR_ID_REG != SEQUENCE_END) - ret = sensor_read(client, SENSOR_ID_REG, &pid); - if (ret != 0) { - SENSOR_TR("read chip id failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - SENSOR_DG("\n %s pid = 0x%x \n", SENSOR_NAME_STRING(), pid); -#else - pid = SENSOR_ID; -#endif - - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - - return ret; -} -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); -//#if CONFIG_SENSOR_Flash - int i; -//#endif - int ret = 0; - - rk29_camera_sensor_cb_s *icd_cb =NULL; - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - sensor->sensor_gpio_res = NULL; - for (i=0; isensor_io_request->gpio_res[i].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[i].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[i]; - } - } - if (sensor->sensor_gpio_res == NULL) { - SENSOR_TR("%s %s obtain gpio resource failed when RK29_CAM_SUBDEV_IOREQUEST \n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - case RK29_CAM_SUBDEV_CB_REGISTER: - { - icd_cb = (rk29_camera_sensor_cb_s*)(arg); - icd_cb->sensor_cb = sensor_cb; - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, - .s_stream = sensor_s_stream, -}; -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - sensor->info_priv.fmt = sensor_colour_fmts[0]; - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } else { - #if CONFIG_SENSOR_Focus - sensor->sensor_wq = create_singlethread_workqueue(SENSOR_NAME_STRING(_af_workqueue)); - if (sensor->sensor_wq == NULL) - SENSOR_TR("%s create fail!", SENSOR_NAME_STRING(_af_workqueue)); - mutex_init(&sensor->wq_lock); - #endif - } - flash_off_timer.status = 0; - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - #if CONFIG_SENSOR_Focus - if (sensor->sensor_wq) { - destroy_workqueue(sensor->sensor_wq); - sensor->sensor_wq = NULL; - } - #endif - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - - diff --git a/drivers/media/video/mt9t111.c b/drivers/media/video/mt9t111.c deleted file mode 100755 index 1fce584f3a56..000000000000 --- a/drivers/media/video/mt9t111.c +++ /dev/null @@ -1,8490 +0,0 @@ -/* - * Driver for OV5642 CMOS Image Sensor from OmniVision - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "mt9t111.h" - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_MT9T111 -#define SENSOR_V4L2_IDENT V4L2_IDENT_MT9T111 -#define SENSOR_ID SEQUENCE_END -#define SENSOR_ID_REG SEQUENCE_END -#define SENSOR_RESET_REG 0x001a -#define SENSOR_RESET_VAL 0x0018 -#define SENSOR_RESET_REG_LEN WORD_LEN -#define SENSOR_MIN_WIDTH 176 -#define SENSOR_MIN_HEIGHT 144 -#define SENSOR_MAX_WIDTH 2048 -#define SENSOR_MAX_HEIGHT 1536 -#define SENSOR_INIT_WIDTH 640 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 480 -#define SENSOR_INIT_WINSEQADR sensor_vga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_UYVY8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 1 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Exposure 1 -#define CONFIG_SENSOR_Flash 1 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 1 -#define CONFIG_SENSOR_Focus 1 - -/*Sensor write registers at a time*/ -#define CONFIG_SENSOR_WRITE_REGS 1 - - -#define CONFIG_SENSOR_I2C_SPEED 350000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - - -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_PCLK_SAMPLE_RISING|V4L2_MBUS_HSYNC_ACTIVE_HIGH| V4L2_MBUS_VSYNC_ACTIVE_HIGH|\ - V4L2_MBUS_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) - -#if CONFIG_SENSOR_Focus -#define SENSOR_AF_MODE_INFINITY 0 -#define SENSOR_AF_MODE_MACRO 1 -#define SENSOR_AF_MODE_FIXED 2 -#define SENSOR_AF_MODE_AUTO 3 -#define SENSOR_AF_MODE_CONTINUOUS 4 -#define SENSOR_AF_MODE_CLOSE 5 -#endif - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); - -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_MT9T111_USER_DEFINED_SERIES -#include "mt9t111_user_series.c" -#else - -/* init 640X480 VGA */ -static struct reginfo sensor_init_data[] = -{ -//[Step2-PLL_Timing] -//for 24MHz input, VCO=MAX PCLK=76.8MHz -#if 0 -{ 0x001A, 0x0019, WORD_LEN, 0 }, // RESET_AND_MISC_CONTROL -{ 0x001A, 0x0018, WORD_LEN, 0 }, // RESET_AND_MISC_CONTROL -{ 0x0014, 0x2425, WORD_LEN, 0 }, // PLL_CONTROL -{ 0x0014, 0x2425, WORD_LEN, 0 }, // PLL_CONTROL -{ 0x0014, 0x2145, WORD_LEN, 0 }, // PLL_CONTROL -{ 0x0010, 0x0110, WORD_LEN, 0 }, // PLL_DIVIDERS -{ 0x0012, 0x0070, WORD_LEN, 0 }, // PLL_P_DIVIDERS -{ 0x002A, 0x77CC, WORD_LEN, 0 }, // PLL_P4_P5_P6_DIVIDERS -{ 0x001A, 0x0218, WORD_LEN, 0 }, // RESET_AND_MISC_CONTROL -{ 0x0014, 0x2545, WORD_LEN, 0 }, // PLL_CONTROL -{ 0x0014, 0x2547, WORD_LEN, 0 }, // PLL_CONTROL -{ 0x0014, 0x2447, WORD_LEN, 0 }, // PLL_CONTROL -{ 0x0014, 0x2047, WORD_LEN, 0 }, // PLL_CONTROL - -{ SEQUENCE_WAIT_MS,10, WORD_LEN, 0}, - -{ 0x0014, 0x2046, WORD_LEN, 0 }, // PLL_CONTROL -{ 0x0022, 0x01E0, WORD_LEN, 0 }, // VDD_DIS_COUNTER -{ 0x001E, 0x0777, WORD_LEN, 0 }, // PAD_SLEW_PAD_CONFIG -{ 0x0016, 0x0400, WORD_LEN, 0 }, // CLOCKS_CONTROL -{ 0x3B84, 0x0127, WORD_LEN, 0 }, // I2C_MASTER_FREQUENCY_DIVIDER -{ 0x001E, 0x0777, WORD_LEN, 0 }, // PAD_SLEW_PAD_CONFIG -{ 0x0018, 0x402D, WORD_LEN, 0 }, // STANDBY_CONTROL_AND_STATUS -{ 0x0018, 0x402C, WORD_LEN, 0 }, // STANDBY_CONTROL_AND_STATUS - -{ SEQUENCE_WAIT_MS,50, WORD_LEN, 0}, - -{ 0x098E, 0x6800, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0280, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x6802, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x01E0, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xE88E, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x68A0, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x082D, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4802, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4804, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4806, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x060D, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4808, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x080D, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x480A, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0111, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x480C, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x046C, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x480F, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x00CC, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4811, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0381, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4813, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x024F, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x481D, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x03EA, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x481F, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x05D0, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4825, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x07AC, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x482B, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0408, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x482D, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0308, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x6C00, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0800, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x6C02, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0600, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xEC8E, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x6CA0, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x082D, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x484A, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0004, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x484C, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0004, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x484E, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x060B, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4850, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x080B, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4852, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0111, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4854, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0024, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4857, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x008C, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4859, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x01F1, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x485B, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x00FF, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4865, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0857, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4867, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0378, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x486D, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0ACE, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4873, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0808, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4875, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0608, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC8A5, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x001E, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC8A6, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0021, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC8A7, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0024, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC8A8, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0027, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC844, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0096, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC92F, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC845, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x007D, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC92D, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC88C, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x006B, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC930, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC88D, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0059, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC92E, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xA002, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0010, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xA009, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0002, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xA00A, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0003, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xA00C, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x000A, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4846, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0014, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x68AA, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x02EE, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x6815, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0007, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x6817, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0008, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x682D, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0007, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x488E, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0014, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x6CAA, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x01A2, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x8400, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0006, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x8400, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0005, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x3C20, 0x0000, WORD_LEN, 0 }, // TX_SS_CONTROL - -//[LensShading TL84] -{ 0x364A, 0x00F0, WORD_LEN, 0 }, // P_R_P0Q0 -{ 0x364C, 0x1B2D, WORD_LEN, 0 }, // P_R_P0Q1 -{ 0x364E, 0x6491, WORD_LEN, 0 }, // P_R_P0Q2 -{ 0x3650, 0x2210, WORD_LEN, 0 }, // P_R_P0Q3 -{ 0x3652, 0xCD30, WORD_LEN, 0 }, // P_R_P0Q4 -{ 0x368A, 0x368B, WORD_LEN, 0 }, // P_R_P1Q0 -{ 0x368C, 0x3A6E, WORD_LEN, 0 }, // P_R_P1Q1 -{ 0x368E, 0x0B8F, WORD_LEN, 0 }, // P_R_P1Q2 -{ 0x3690, 0x974F, WORD_LEN, 0 }, // P_R_P1Q3 -{ 0x3692, 0xD5B0, WORD_LEN, 0 }, // P_R_P1Q4 -{ 0x36CA, 0x0C32, WORD_LEN, 0 }, // P_R_P2Q0 -{ 0x36CC, 0x33B0, WORD_LEN, 0 }, // P_R_P2Q1 -{ 0x36CE, 0x6413, WORD_LEN, 0 }, // P_R_P2Q2 -{ 0x36D0, 0xF130, WORD_LEN, 0 }, // P_R_P2Q3 -{ 0x36D2, 0x8EF6, WORD_LEN, 0 }, // P_R_P2Q4 -{ 0x370A, 0x50CA, WORD_LEN, 0 }, // P_R_P3Q0 -{ 0x370C, 0x2570, WORD_LEN, 0 }, // P_R_P3Q1 -{ 0x370E, 0xFDEE, WORD_LEN, 0 }, // P_R_P3Q2 -{ 0x3710, 0xEDB1, WORD_LEN, 0 }, // P_R_P3Q3 -{ 0x3712, 0x68EF, WORD_LEN, 0 }, // P_R_P3Q4 -{ 0x374A, 0x1E50, WORD_LEN, 0 }, // P_R_P4Q0 -{ 0x374C, 0xB9D0, WORD_LEN, 0 }, // P_R_P4Q1 -{ 0x374E, 0x82B7, WORD_LEN, 0 }, // P_R_P4Q2 -{ 0x3750, 0x550E, WORD_LEN, 0 }, // P_R_P4Q3 -{ 0x3752, 0x1FF9, WORD_LEN, 0 }, // P_R_P4Q4 -{ 0x3640, 0x0750, WORD_LEN, 0 }, // P_G1_P0Q0 -{ 0x3642, 0x36CD, WORD_LEN, 0 }, // P_G1_P0Q1 -{ 0x3644, 0x5DB1, WORD_LEN, 0 }, // P_G1_P0Q2 -{ 0x3646, 0x23F0, WORD_LEN, 0 }, // P_G1_P0Q3 -{ 0x3648, 0xB9F1, WORD_LEN, 0 }, // P_G1_P0Q4 -{ 0x3680, 0x5C8B, WORD_LEN, 0 }, // P_G1_P1Q0 -{ 0x3682, 0x8F6F, WORD_LEN, 0 }, // P_G1_P1Q1 -{ 0x3684, 0x53AA, WORD_LEN, 0 }, // P_G1_P1Q2 -{ 0x3686, 0x2B6C, WORD_LEN, 0 }, // P_G1_P1Q3 -{ 0x3688, 0x9D70, WORD_LEN, 0 }, // P_G1_P1Q4 -{ 0x36C0, 0x2D12, WORD_LEN, 0 }, // P_G1_P2Q0 -{ 0x36C2, 0x0D11, WORD_LEN, 0 }, // P_G1_P2Q1 -{ 0x36C4, 0xAD4D, WORD_LEN, 0 }, // P_G1_P2Q2 -{ 0x36C6, 0x9872, WORD_LEN, 0 }, // P_G1_P2Q3 -{ 0x36C8, 0xC9B4, WORD_LEN, 0 }, // P_G1_P2Q4 -{ 0x3700, 0x920F, WORD_LEN, 0 }, // P_G1_P3Q0 -{ 0x3702, 0x8A4E, WORD_LEN, 0 }, // P_G1_P3Q1 -{ 0x3704, 0x502F, WORD_LEN, 0 }, // P_G1_P3Q2 -{ 0x3706, 0x7951, WORD_LEN, 0 }, // P_G1_P3Q3 -{ 0x3708, 0x0013, WORD_LEN, 0 }, // P_G1_P3Q4 -{ 0x3740, 0xDC12, WORD_LEN, 0 }, // P_G1_P4Q0 -{ 0x3742, 0xEA52, WORD_LEN, 0 }, // P_G1_P4Q1 -{ 0x3744, 0xC735, WORD_LEN, 0 }, // P_G1_P4Q2 -{ 0x3746, 0x2F94, WORD_LEN, 0 }, // P_G1_P4Q3 -{ 0x3748, 0x6C18, WORD_LEN, 0 }, // P_G1_P4Q4 -{ 0x3654, 0x0210, WORD_LEN, 0 }, // P_B_P0Q0 -{ 0x3656, 0x384D, WORD_LEN, 0 }, // P_B_P0Q1 -{ 0x3658, 0x27D1, WORD_LEN, 0 }, // P_B_P0Q2 -{ 0x365A, 0x02F0, WORD_LEN, 0 }, // P_B_P0Q3 -{ 0x365C, 0xC530, WORD_LEN, 0 }, // P_B_P0Q4 -{ 0x3694, 0x70AA, WORD_LEN, 0 }, // P_B_P1Q0 -{ 0x3696, 0x964D, WORD_LEN, 0 }, // P_B_P1Q1 -{ 0x3698, 0xA58B, WORD_LEN, 0 }, // P_B_P1Q2 -{ 0x369A, 0xA88F, WORD_LEN, 0 }, // P_B_P1Q3 -{ 0x369C, 0xA90F, WORD_LEN, 0 }, // P_B_P1Q4 -{ 0x36D4, 0x07D2, WORD_LEN, 0 }, // P_B_P2Q0 -{ 0x36D6, 0x10F0, WORD_LEN, 0 }, // P_B_P2Q1 -{ 0x36D8, 0xDDA7, WORD_LEN, 0 }, // P_B_P2Q2 -{ 0x36DA, 0xE9B1, WORD_LEN, 0 }, // P_B_P2Q3 -{ 0x36DC, 0x9AF4, WORD_LEN, 0 }, // P_B_P2Q4 -{ 0x3714, 0x02EE, WORD_LEN, 0 }, // P_B_P3Q0 -{ 0x3716, 0xB250, WORD_LEN, 0 }, // P_B_P3Q1 -{ 0x3718, 0x770B, WORD_LEN, 0 }, // P_B_P3Q2 -{ 0x371A, 0x6BB2, WORD_LEN, 0 }, // P_B_P3Q3 -{ 0x371C, 0x57F0, WORD_LEN, 0 }, // P_B_P3Q4 -{ 0x3754, 0xCEB2, WORD_LEN, 0 }, // P_B_P4Q0 -{ 0x3756, 0xC730, WORD_LEN, 0 }, // P_B_P4Q1 -{ 0x3758, 0xBC34, WORD_LEN, 0 }, // P_B_P4Q2 -{ 0x375A, 0x0C14, WORD_LEN, 0 }, // P_B_P4Q3 -{ 0x375C, 0x2F18, WORD_LEN, 0 }, // P_B_P4Q4 -{ 0x365E, 0x0130, WORD_LEN, 0 }, // P_G2_P0Q0 -{ 0x3660, 0x1C2D, WORD_LEN, 0 }, // P_G2_P0Q1 -{ 0x3662, 0x5031, WORD_LEN, 0 }, // P_G2_P0Q2 -{ 0x3664, 0x1670, WORD_LEN, 0 }, // P_G2_P0Q3 -{ 0x3666, 0x9B71, WORD_LEN, 0 }, // P_G2_P0Q4 -{ 0x369E, 0x5BAB, WORD_LEN, 0 }, // P_G2_P1Q0 -{ 0x36A0, 0x054F, WORD_LEN, 0 }, // P_G2_P1Q1 -{ 0x36A2, 0x2589, WORD_LEN, 0 }, // P_G2_P1Q2 -{ 0x36A4, 0xF54F, WORD_LEN, 0 }, // P_G2_P1Q3 -{ 0x36A6, 0xCFAE, WORD_LEN, 0 }, // P_G2_P1Q4 -{ 0x36DE, 0x2A92, WORD_LEN, 0 }, // P_G2_P2Q0 -{ 0x36E0, 0x0311, WORD_LEN, 0 }, // P_G2_P2Q1 -{ 0x36E2, 0x832F, WORD_LEN, 0 }, // P_G2_P2Q2 -{ 0x36E4, 0xA232, WORD_LEN, 0 }, // P_G2_P2Q3 -{ 0x36E6, 0xCB34, WORD_LEN, 0 }, // P_G2_P2Q4 -{ 0x371E, 0xFA6E, WORD_LEN, 0 }, // P_G2_P3Q0 -{ 0x3720, 0x712F, WORD_LEN, 0 }, // P_G2_P3Q1 -{ 0x3722, 0x5A31, WORD_LEN, 0 }, // P_G2_P3Q2 -{ 0x3724, 0xAC52, WORD_LEN, 0 }, // P_G2_P3Q3 -{ 0x3726, 0xB751, WORD_LEN, 0 }, // P_G2_P3Q4 -{ 0x375E, 0xDFF2, WORD_LEN, 0 }, // P_G2_P4Q0 -{ 0x3760, 0xEE32, WORD_LEN, 0 }, // P_G2_P4Q1 -{ 0x3762, 0x9FF5, WORD_LEN, 0 }, // P_G2_P4Q2 -{ 0x3764, 0x7154, WORD_LEN, 0 }, // P_G2_P4Q3 -{ 0x3766, 0x50D8, WORD_LEN, 0 }, // P_G2_P4Q4 -{ 0x3784, 0x0400, WORD_LEN, 0 }, // CENTER_COLUMN -{ 0x3782, 0x0300, WORD_LEN, 0 }, // CENTER_ROW -{ 0x3210, 0x01B8, WORD_LEN, 0 }, // COLOR_PIPELINE_CONTROL -{ 0x098E, 0xC913, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_STAT_BRIGHTNESS_METRIC_PREDIVIDER] -{ 0x0990, 0x000A, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x686B, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_LL_START_BRIGHTNESS] -{ 0x0990, 0x05DC, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x686D, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_LL_STOP_BRIGHTNESS] -{ 0x0990, 0x0BB8, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x6C6B, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_LL_START_BRIGHTNESS] -{ 0x0990, 0x05DC, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x6C6D, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_LL_STOP_BRIGHTNESS] -{ 0x0990, 0x0BB8, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x3439, WORD_LEN, 0 }, // MCU_ADDRESS [AS_ASSTART_BRIGHTNESS] -{ 0x0990, 0x05DC, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x343B, WORD_LEN, 0 }, // MCU_ADDRESS [AS_ASSTOP_BRIGHTNESS] -{ 0x0990, 0x0BB8, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4926, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_START_GAMMA_BM] -{ 0x0990, 0x0001, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4928, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_MID_GAMMA_BM] -{ 0x0990, 0x0002, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x492A, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_STOP_GAMMA_BM] -{ 0x0990, 0x0656, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4D26, WORD_LEN, 0 }, // MCU_ADDRESS [CAM2_LL_START_GAMMA_BM] -{ 0x0990, 0x0001, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4D28, WORD_LEN, 0 }, // MCU_ADDRESS [CAM2_LL_MID_GAMMA_BM] -{ 0x0990, 0x0002, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4D2A, WORD_LEN, 0 }, // MCU_ADDRESS [CAM2_LL_STOP_GAMMA_BM] -{ 0x0990, 0x0656, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x33F4, 0x040B, WORD_LEN, 0 }, // KERNEL_CONFIG -{ 0x098E, 0xC916, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_LL_START_0] -{ 0x0990, 0x0014, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC919, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_LL_STOP_0] -{ 0x0990, 0x0028, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC917, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_LL_START_1] -{ 0x0990, 0x0004, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC918, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_LL_START_2] -{ 0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC91A, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_LL_STOP_1] -{ 0x0990, 0x0001, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC91B, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_LL_STOP_2] -{ 0x0990, 0x0009, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x326C, 0x0C00, WORD_LEN, 0 }, // APERTURE_PARAMETERS_2D -{ 0x098E, 0x494B, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_START_GAIN_METRIC] -{ 0x0990, 0x0042, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x494D, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_STOP_GAIN_METRIC] -{ 0x0990, 0x012C, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC91E, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_START_0] -{ 0x0990, 0x0012, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC91F, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_START_1] -{ 0x0990, 0x000A, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC920, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_START_2] -{ 0x0990, 0x0012, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC921, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_START_3] -{ 0x0990, 0x000A, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC922, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_STOP_0] -{ 0x0990, 0x0026, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC923, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_STOP_1] -{ 0x0990, 0x001E, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC924, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_STOP_2] -{ 0x0990, 0x0026, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC925, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_STOP_3] -{ 0x0990, 0x0026, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC02, WORD_LEN, 0 }, // MCU_ADDRESS [LL_MODE] -{ 0x0990, 0x0003, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC05, WORD_LEN, 0 }, // MCU_ADDRESS [LL_CLUSTER_DC_TH] -{ 0x0990, 0x000E, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x316C, 0x350F, WORD_LEN, 0 }, // DAC_TXLO -{ 0x098E, 0xC950, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_1] -{ 0x0990, 0x0064, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC94F, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_0] -{ 0x0990, 0x0038, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC952, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_3] -{ 0x0990, 0x0064, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC951, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_2] -{ 0x0990, 0x0051, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC954, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_5] -{ 0x0990, 0x0010, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC953, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_4] -{ 0x0990, 0x0020, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC956, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_7] -{ 0x0990, 0x0010, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC955, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_6] -{ 0x0990, 0x0020, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC958, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_1] -{ 0x0990, 0x0020, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC957, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_0] -{ 0x0990, 0x0014, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC95A, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_3] -{ 0x0990, 0x001D, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC959, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_2] -{ 0x0990, 0x0020, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC95C, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_5] -{ 0x0990, 0x000C, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC95B, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_4] -{ 0x0990, 0x0008, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC95E, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_7] -{ 0x0990, 0x000C, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC95D, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_6] -{ 0x0990, 0x0008, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC95F, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_WINDOW_PERCENT] -{ 0x0990, 0x0064, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48DC, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_0] -{ 0x0990, 0x004D, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48DE, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_1] -{ 0x0990, 0x0096, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48E0, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_2] -{ 0x0990, 0x001D, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48E2, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_3] -{ 0x0990, 0x004D, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48E4, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_4] -{ 0x0990, 0x0096, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48E6, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_5] -{ 0x0990, 0x001D, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48E8, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_6] -{ 0x0990, 0x004D, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48EA, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_7] -{ 0x0990, 0x0096, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48EC, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_8] -{ 0x0990, 0x001D, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xDC2A, WORD_LEN, 0 }, // MCU_ADDRESS [SYS_DELTA_GAIN] -{ 0x0990, 0x000B, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xDC2B, WORD_LEN, 0 }, // MCU_ADDRESS [SYS_DELTA_THRESH] -{ 0x0990, 0x0017, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC0B, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_0] -{ 0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC0C, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_1] -{ 0x0990, 0x001B, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC0D, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_2] -{ 0x0990, 0x002A, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC0E, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_3] -{ 0x0990, 0x003E, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC0F, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_4] -{ 0x0990, 0x005A, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC10, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_5] -{ 0x0990, 0x0070, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC11, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_6] -{ 0x0990, 0x0081, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC12, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_7] -{ 0x0990, 0x0090, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC13, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_8] -{ 0x0990, 0x009E, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC14, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_9] -{ 0x0990, 0x00AB, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC15, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_10] -{ 0x0990, 0x00B6, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC16, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_11] -{ 0x0990, 0x00C1, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC17, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_12] -{ 0x0990, 0x00CB, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC18, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_13] -{ 0x0990, 0x00D5, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC19, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_14] -{ 0x0990, 0x00DE, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC1A, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_15] -{ 0x0990, 0x00E7, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC1B, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_16] -{ 0x0990, 0x00EF, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC1C, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_17] -{ 0x0990, 0x00F7, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC1D, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_18] -{ 0x0990, 0x00FF, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC1E, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_0] -{ 0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC1F, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_1] -{ 0x0990, 0x001B, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC20, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_2] -{ 0x0990, 0x002A, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC21, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_3] -{ 0x0990, 0x003E, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC22, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_4] -{ 0x0990, 0x005A, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC23, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_5] -{ 0x0990, 0x0070, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC24, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_6] -{ 0x0990, 0x0081, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC25, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_7] -{ 0x0990, 0x0090, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC26, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_8] -{ 0x0990, 0x009E, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC27, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_9] -{ 0x0990, 0x00AB, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC28, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_10] -{ 0x0990, 0x00B6, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC29, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_11] -{ 0x0990, 0x00C1, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC2A, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_12] -{ 0x0990, 0x00CB, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC2B, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_13] -{ 0x0990, 0x00D5, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC2C, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_14] -{ 0x0990, 0x00DE, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC2D, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_15] -{ 0x0990, 0x00E7, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC2E, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_16] -{ 0x0990, 0x00EF, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC2F, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_17] -{ 0x0990, 0x00F7, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC30, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_18] -{ 0x0990, 0x00FF, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC31, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_0] -{ 0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC32, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_1] -{ 0x0990, 0x000D, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC33, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_2] -{ 0x0990, 0x0019, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC34, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_3] -{ 0x0990, 0x0030, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC35, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_4] -{ 0x0990, 0x0056, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC36, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_5] -{ 0x0990, 0x0070, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC37, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_6] -{ 0x0990, 0x0081, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC38, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_7] -{ 0x0990, 0x0090, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC39, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_8] -{ 0x0990, 0x009E, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC3A, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_9] -{ 0x0990, 0x00AB, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC3B, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_10] -{ 0x0990, 0x00B6, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC3C, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_11] -{ 0x0990, 0x00C1, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC3D, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_12] -{ 0x0990, 0x00CB, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC3E, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_13] -{ 0x0990, 0x00D5, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC3F, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_14] -{ 0x0990, 0x00DE, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC40, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_15] -{ 0x0990, 0x00E7, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC41, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_16] -{ 0x0990, 0x00EF, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC42, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_17] -{ 0x0990, 0x00F7, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC43, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_18] -{ 0x0990, 0x00FF, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x6865, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_LL_ALGO_ENTER] -{ 0x0990, 0x00E0, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x6867, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_LL_ALGO_RUN] -{ 0x0990, 0x00F4, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x8400, WORD_LEN, 0 }, // MCU_ADDRESS [SEQ_CMD] -{ 0x0990, 0x0006, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC4A, WORD_LEN, 0 }, // MCU_ADDRESS [LL_TONAL_CURVE_HIGH] -{ 0x0990, 0x007F, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC4B, WORD_LEN, 0 }, // MCU_ADDRESS [LL_TONAL_CURVE_MED] -{ 0x0990, 0x007F, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC4C, WORD_LEN, 0 }, // MCU_ADDRESS [LL_TONAL_CURVE_LOW] -{ 0x0990, 0x007F, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x3542, 0x0010, WORD_LEN, 0 }, // TONAL_X0 -{ 0x3544, 0x0030, WORD_LEN, 0 }, // TONAL_X1 -{ 0x3546, 0x0040, WORD_LEN, 0 }, // TONAL_X2 -{ 0x3548, 0x0080, WORD_LEN, 0 }, // TONAL_X3 -{ 0x354A, 0x0100, WORD_LEN, 0 }, // TONAL_X4 -{ 0x354C, 0x0200, WORD_LEN, 0 }, // TONAL_X5 -{ 0x354E, 0x0300, WORD_LEN, 0 }, // TONAL_X6 -{ 0x3550, 0x0010, WORD_LEN, 0 }, // TONAL_Y0 -{ 0x3552, 0x0030, WORD_LEN, 0 }, // TONAL_Y1 -{ 0x3554, 0x0040, WORD_LEN, 0 }, // TONAL_Y2 -{ 0x3556, 0x0080, WORD_LEN, 0 }, // TONAL_Y3 -{ 0x3558, 0x012C, WORD_LEN, 0 }, // TONAL_Y4 -{ 0x355A, 0x0320, WORD_LEN, 0 }, // TONAL_Y5 -{ 0x355C, 0x03E8, WORD_LEN, 0 }, // TONAL_Y6 -{ 0x3560, 0x0040, WORD_LEN, 0 }, // RECIPROCAL_OF_X0_MINUS_ZERO -{ 0x3562, 0x0020, WORD_LEN, 0 }, // RECIPROCAL_OF_X1_MINUS_X0 -{ 0x3564, 0x0040, WORD_LEN, 0 }, // RECIPROCAL_OF_X2_MINUS_X1 -{ 0x3566, 0x0010, WORD_LEN, 0 }, // RECIPROCAL_OF_X3_MINUS_X2 -{ 0x3568, 0x0008, WORD_LEN, 0 }, // RECIPROCAL_OF_X4_MINUS_X3 -{ 0x356A, 0x0004, WORD_LEN, 0 }, // RECIPROCAL_OF_X5_MINUS_X4 -{ 0x356C, 0x0004, WORD_LEN, 0 }, // RECIPROCAL_OF_X6_MINUS_X5 -{ 0x356E, 0x0004, WORD_LEN, 0 }, // RECIPROCAL_OF_400_MINUS_X6 -{ 0x098E, 0x3C4D, WORD_LEN, 0 }, // MCU_ADDRESS [LL_START_GAMMA_FTB] -{ 0x0990, 0x0DAC, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x3C4F, WORD_LEN, 0 }, // MCU_ADDRESS [LL_STOP_GAMMA_FTB] -{ 0x0990, 0x148A, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC911, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_STAT_LUMA_THRESH_HIGH] -{ 0x0990, 0x00C8, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC8F4, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_XSCALE] -{ 0x0990, 0x0004, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC8F5, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_YSCALE] -{ 0x0990, 0x0002, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48F6, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_0] -{ 0x0990, 0x3B4D, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48F8, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_1] -{ 0x0990, 0x6380, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48FA, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_2] -{ 0x0990, 0x9B18, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48FC, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_3] -{ 0x0990, 0x5D51, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48FE, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_4] -{ 0x0990, 0xEDE8, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4900, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_5] -{ 0x0990, 0xE515, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4902, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_6] -{ 0x0990, 0xBFF4, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4904, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_7] -{ 0x0990, 0x001E, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4906, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_XSHIFT_PRE_ADJ] -{ 0x0990, 0x0026, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x4908, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_YSHIFT_PRE_ADJ] -{ 0x0990, 0x0033, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xE84A, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AWB_K_R_L] -{ 0x0990, 0x0083, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xE84D, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AWB_K_R_R] -{ 0x0990, 0x0083, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xE84C, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AWB_K_B_L] -{ 0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xE84F, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AWB_K_B_R] -{ 0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x8400, WORD_LEN, 0 }, // MCU_ADDRESS [SEQ_CMD] -{ 0x0990, 0x0006, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48B0, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_0] -{ 0x0990, 0x0180, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48B2, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_1] -{ 0x0990, 0xFF7A, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48B4, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_2] -{ 0x0990, 0x0018, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48B6, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_3] -{ 0x0990, 0xFFCA, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48B8, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_4] -{ 0x0990, 0x017C, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48BA, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_5] -{ 0x0990, 0xFFCC, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48BC, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_6] -{ 0x0990, 0x000C, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48BE, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_7] -{ 0x0990, 0xFF1F, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48C0, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_8] -{ 0x0990, 0x01E8, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48C2, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_9] -{ 0x0990, 0x0020, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48C4, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_10] -{ 0x0990, 0x0044, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48C6, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_0] -{ 0x0990, 0x0079, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48C8, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_1] -{ 0x0990, 0xFFAD, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48CA, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_2] -{ 0x0990, 0xFFE2, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48CC, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_3] -{ 0x0990, 0x0033, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48CE, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_4] -{ 0x0990, 0x002A, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48D0, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_5] -{ 0x0990, 0xFFAA, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48D2, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_6] -{ 0x0990, 0x0017, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48D4, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_7] -{ 0x0990, 0x004B, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48D6, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_8] -{ 0x0990, 0xFFA5, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48D8, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_9] -{ 0x0990, 0x0015, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x48DA, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_10] -{ 0x0990, 0xFFE2, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x35A2, 0x0014, WORD_LEN, 0 }, // DARK_COLOR_KILL_CONTROLS -{ 0x098E, 0xC949, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_SYS_DARK_COLOR_KILL] -{ 0x0990, 0x0024, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x35A4, 0x0596, WORD_LEN, 0 }, // BRIGHT_COLOR_KILL_CONTROLS -{ 0x098E, 0xC94A, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_SYS_BRIGHT_COLORKILL] -{ 0x0990, 0x0062, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC948, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_SYS_UV_COLOR_BOOST] -{ 0x0990, 0x0006, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC914, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_START_DESATURATION] -{ 0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xC915, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_END_DESATURATION] -{ 0x0990, 0x00FF, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xE86F, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_LL_START_SATURATION] -{ 0x0990, 0x0060, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xE870, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_LL_END_SATURATION] -{ 0x0990, 0x003C, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xEC6F, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_LL_START_SATURATION] -{ 0x0990, 0x0060, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xEC70, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_LL_END_SATURATION] -{ 0x0990, 0x003C, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xE883, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SELECT_FX] -{ 0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xEC83, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SELECT_FX] -{ 0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x8400, WORD_LEN, 0 }, // MCU_ADDRESS [SEQ_CMD] -{ 0x0990, 0x0006, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xE885, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SEPIA_CR] -{ 0x0990, 0x001E, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xE886, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SEPIA_CB] -{ 0x0990, 0x00D8, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xEC85, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SEPIA_CR] -{ 0x0990, 0x001E, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xEC86, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SEPIA_CB] -{ 0x0990, 0x00D8, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xE884, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SOLARIZATION_TH] -{ 0x0990, 0x005C, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xEC84, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SOLARIZATION_TH] -{ 0x0990, 0x005C, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x490A, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AS_INTEG_SCALE_FIRST_PASS] -{ 0x0990, 0x0666, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x490C, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AS_MIN_INT_TIME_FIRST_PASS] -{ 0x0990, 0x0140, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x6857, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_IS_FEATURE_THRESHOLD] -{ 0x0990, 0x0014, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x685C, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_IS_BLUR_INPUT_PARAMETER] -{ 0x0990, 0x0005, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x490E, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AS_MAX_DIGITAL_GAIN_ALLOWED] -{ 0x0990, 0x00A4, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xB43D, WORD_LEN, 0 }, // MCU_ADDRESS [AS_START_ASVALUES_0] -{ 0x0990, 0x0031, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xB43E, WORD_LEN, 0 }, // MCU_ADDRESS [AS_START_ASVALUES_1] -{ 0x0990, 0x001B, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xB43F, WORD_LEN, 0 }, // MCU_ADDRESS [AS_START_ASVALUES_2] -{ 0x0990, 0x0028, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xB440, WORD_LEN, 0 }, // MCU_ADDRESS [AS_START_ASVALUES_3] -{ 0x0990, 0x0003, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xB441, WORD_LEN, 0 }, // MCU_ADDRESS [AS_STOP_ASVALUES_0] -{ 0x0990, 0x00CD, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xB442, WORD_LEN, 0 }, // MCU_ADDRESS [AS_STOP_ASVALUES_1] -{ 0x0990, 0x0064, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xB443, WORD_LEN, 0 }, // MCU_ADDRESS [AS_STOP_ASVALUES_2] -{ 0x0990, 0x000F, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xB444, WORD_LEN, 0 }, // MCU_ADDRESS [AS_STOP_ASVALUES_3] -{ 0x0990, 0x0007, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x300D, WORD_LEN, 0 }, // MCU_ADDRESS [AF_FILTERS] -{ 0x0990, 0x000F, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x3017, WORD_LEN, 0 }, // MCU_ADDRESS [AF_THRESHOLDS] -{ 0x0990, 0x0F0F, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x8400, WORD_LEN, 0 }, // MCU_ADDRESS [SEQ_CMD] -{ 0x0990, 0x0006, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xE81F, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AE_RULE_BASE_TARGET] -{ 0x0990, 0x0020, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x68A0, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_JPEG_OB_TX_CONTROL_VAR] -{ 0x0990, 0x082E, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x6CA0, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_JPEG_OB_TX_CONTROL_VAR] -{ 0x0990, 0x082E, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x70A0, WORD_LEN, 0 }, // MCU_ADDRESS [SEC_A_CONFIG_JPEG_OB_TX_CONTROL_VAR] -{ 0x0990, 0x082E, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x74A0, WORD_LEN, 0 }, // MCU_ADDRESS [SEC_B_CONFIG_JPEG_OB_TX_CONTROL_VAR] -{ 0x0990, 0x082E, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x3C52, 0x082E, WORD_LEN, 0 }, // RESERVED_TX_SS_3C52 -{ 0x098E, 0x488E, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_CTX_B_RX_FIFO_TRIGGER_MARK] -{ 0x0990, 0x0020, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xECAC, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_IO_OB_MANUAL_FLAG] -{ 0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x3084, 0x2409, WORD_LEN, 0 }, // RESERVED_CORE_3084 -{ 0x3092, 0x0A49, WORD_LEN, 0 }, // RESERVED_CORE_3092 -{ 0x3094, 0x4949, WORD_LEN, 0 }, // RESERVED_CORE_3094 -{ 0x3096, 0x4950, WORD_LEN, 0 }, // RESERVED_CORE_3096 -{ 0x0982, 0x0000, WORD_LEN, 0 }, // ACCESS_CTL_STAT -{ 0x098A, 0x0CFB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x3C3C, WORD_LEN, 0 }, -{ 0x0992, 0x3C3C, WORD_LEN, 0 }, -{ 0x0994, 0x3C3C, WORD_LEN, 0 }, -{ 0x0996, 0x5F4F, WORD_LEN, 0 }, -{ 0x0998, 0x30ED, WORD_LEN, 0 }, -{ 0x099A, 0x0AED, WORD_LEN, 0 }, -{ 0x099C, 0x08BD, WORD_LEN, 0 }, -{ 0x099E, 0x61D5, WORD_LEN, 0 }, -{ 0x098A, 0x0D0B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xCE04, WORD_LEN, 0 }, -{ 0x0992, 0xCD1F, WORD_LEN, 0 }, -{ 0x0994, 0x1702, WORD_LEN, 0 }, -{ 0x0996, 0x11CC, WORD_LEN, 0 }, -{ 0x0998, 0x332E, WORD_LEN, 0 }, -{ 0x099A, 0x30ED, WORD_LEN, 0 }, -{ 0x099C, 0x02CC, WORD_LEN, 0 }, -{ 0x099E, 0xFFFD, WORD_LEN, 0 }, -{ 0x098A, 0x0D1B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xED00, WORD_LEN, 0 }, -{ 0x0992, 0xCC00, WORD_LEN, 0 }, -{ 0x0994, 0x02BD, WORD_LEN, 0 }, -{ 0x0996, 0x706D, WORD_LEN, 0 }, -{ 0x0998, 0x18DE, WORD_LEN, 0 }, -{ 0x099A, 0x1F18, WORD_LEN, 0 }, -{ 0x099C, 0x1F8E, WORD_LEN, 0 }, -{ 0x099E, 0x0110, WORD_LEN, 0 }, -{ 0x098A, 0x0D2B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xCC3C, WORD_LEN, 0 }, -{ 0x0992, 0x5230, WORD_LEN, 0 }, -{ 0x0994, 0xED00, WORD_LEN, 0 }, -{ 0x0996, 0x18EC, WORD_LEN, 0 }, -{ 0x0998, 0xA0C4, WORD_LEN, 0 }, -{ 0x099A, 0xFDBD, WORD_LEN, 0 }, -{ 0x099C, 0x7021, WORD_LEN, 0 }, -{ 0x099E, 0x201E, WORD_LEN, 0 }, -{ 0x098A, 0x0D3B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xCC3C, WORD_LEN, 0 }, -{ 0x0992, 0x5230, WORD_LEN, 0 }, -{ 0x0994, 0xED00, WORD_LEN, 0 }, -{ 0x0996, 0xDE1F, WORD_LEN, 0 }, -{ 0x0998, 0xECA0, WORD_LEN, 0 }, -{ 0x099A, 0xBD70, WORD_LEN, 0 }, -{ 0x099C, 0x21CC, WORD_LEN, 0 }, -{ 0x099E, 0x3C52, WORD_LEN, 0 }, -{ 0x098A, 0x0D4B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x30ED, WORD_LEN, 0 }, -{ 0x0992, 0x02CC, WORD_LEN, 0 }, -{ 0x0994, 0xFFFC, WORD_LEN, 0 }, -{ 0x0996, 0xED00, WORD_LEN, 0 }, -{ 0x0998, 0xCC00, WORD_LEN, 0 }, -{ 0x099A, 0x02BD, WORD_LEN, 0 }, -{ 0x099C, 0x706D, WORD_LEN, 0 }, -{ 0x099E, 0xFC04, WORD_LEN, 0 }, -{ 0x098A, 0x0D5B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xE11A, WORD_LEN, 0 }, -{ 0x0992, 0x8300, WORD_LEN, 0 }, -{ 0x0994, 0x0127, WORD_LEN, 0 }, -{ 0x0996, 0x201A, WORD_LEN, 0 }, -{ 0x0998, 0x8300, WORD_LEN, 0 }, -{ 0x099A, 0x0427, WORD_LEN, 0 }, -{ 0x099C, 0x221A, WORD_LEN, 0 }, -{ 0x099E, 0x8300, WORD_LEN, 0 }, -{ 0x098A, 0x0D6B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x0827, WORD_LEN, 0 }, -{ 0x0992, 0x241A, WORD_LEN, 0 }, -{ 0x0994, 0x8300, WORD_LEN, 0 }, -{ 0x0996, 0x1027, WORD_LEN, 0 }, -{ 0x0998, 0x261A, WORD_LEN, 0 }, -{ 0x099A, 0x8300, WORD_LEN, 0 }, -{ 0x099C, 0x2027, WORD_LEN, 0 }, -{ 0x099E, 0x281A, WORD_LEN, 0 }, -{ 0x098A, 0x0D7B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x8300, WORD_LEN, 0 }, -{ 0x0992, 0x4027, WORD_LEN, 0 }, -{ 0x0994, 0x2A20, WORD_LEN, 0 }, -{ 0x0996, 0x2ECC, WORD_LEN, 0 }, -{ 0x0998, 0x001E, WORD_LEN, 0 }, -{ 0x099A, 0x30ED, WORD_LEN, 0 }, -{ 0x099C, 0x0A20, WORD_LEN, 0 }, -{ 0x099E, 0x26CC, WORD_LEN, 0 }, -{ 0x098A, 0x0D8B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x0022, WORD_LEN, 0 }, -{ 0x0992, 0x30ED, WORD_LEN, 0 }, -{ 0x0994, 0x0A20, WORD_LEN, 0 }, -{ 0x0996, 0x1ECC, WORD_LEN, 0 }, -{ 0x0998, 0x0021, WORD_LEN, 0 }, -{ 0x099A, 0x30ED, WORD_LEN, 0 }, -{ 0x099C, 0x0A20, WORD_LEN, 0 }, -{ 0x099E, 0x16CC, WORD_LEN, 0 }, -{ 0x098A, 0x0D9B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x0020, WORD_LEN, 0 }, -{ 0x0992, 0x30ED, WORD_LEN, 0 }, -{ 0x0994, 0x0A20, WORD_LEN, 0 }, -{ 0x0996, 0x0ECC, WORD_LEN, 0 }, -{ 0x0998, 0x002A, WORD_LEN, 0 }, -{ 0x099A, 0x30ED, WORD_LEN, 0 }, -{ 0x099C, 0x0A20, WORD_LEN, 0 }, -{ 0x099E, 0x06CC, WORD_LEN, 0 }, -{ 0x098A, 0x0DAB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x002B, WORD_LEN, 0 }, -{ 0x0992, 0x30ED, WORD_LEN, 0 }, -{ 0x0994, 0x0ACC, WORD_LEN, 0 }, -{ 0x0996, 0x3400, WORD_LEN, 0 }, -{ 0x0998, 0x30ED, WORD_LEN, 0 }, -{ 0x099A, 0x0034, WORD_LEN, 0 }, -{ 0x099C, 0xBD6F, WORD_LEN, 0 }, -{ 0x099E, 0xD184, WORD_LEN, 0 }, -{ 0x098A, 0x0DBB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x0330, WORD_LEN, 0 }, -{ 0x0992, 0xED07, WORD_LEN, 0 }, -{ 0x0994, 0xA60C, WORD_LEN, 0 }, -{ 0x0996, 0x4848, WORD_LEN, 0 }, -{ 0x0998, 0x5FED, WORD_LEN, 0 }, -{ 0x099A, 0x05EC, WORD_LEN, 0 }, -{ 0x099C, 0x07EA, WORD_LEN, 0 }, -{ 0x099E, 0x06AA, WORD_LEN, 0 }, -{ 0x098A, 0x0DCB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x0531, WORD_LEN, 0 }, -{ 0x0992, 0xBD70, WORD_LEN, 0 }, -{ 0x0994, 0x21DE, WORD_LEN, 0 }, -{ 0x0996, 0x1F1F, WORD_LEN, 0 }, -{ 0x0998, 0x8E01, WORD_LEN, 0 }, -{ 0x099A, 0x08EC, WORD_LEN, 0 }, -{ 0x099C, 0x9B05, WORD_LEN, 0 }, -{ 0x099E, 0x30ED, WORD_LEN, 0 }, -{ 0x098A, 0x0DDB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x0820, WORD_LEN, 0 }, -{ 0x0992, 0x3BDE, WORD_LEN, 0 }, -{ 0x0994, 0x1FEC, WORD_LEN, 0 }, -{ 0x0996, 0x0783, WORD_LEN, 0 }, -{ 0x0998, 0x0040, WORD_LEN, 0 }, -{ 0x099A, 0x2628, WORD_LEN, 0 }, -{ 0x099C, 0x7F30, WORD_LEN, 0 }, -{ 0x099E, 0xC4CC, WORD_LEN, 0 }, -{ 0x098A, 0x0DEB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x3C68, WORD_LEN, 0 }, -{ 0x0992, 0xBD6F, WORD_LEN, 0 }, -{ 0x0994, 0xD1FD, WORD_LEN, 0 }, -{ 0x0996, 0x30C5, WORD_LEN, 0 }, -{ 0x0998, 0xCC01, WORD_LEN, 0 }, -{ 0x099A, 0xF4FD, WORD_LEN, 0 }, -{ 0x099C, 0x30C7, WORD_LEN, 0 }, -{ 0x099E, 0xC640, WORD_LEN, 0 }, -{ 0x098A, 0x0DFB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xF730, WORD_LEN, 0 }, -{ 0x0992, 0xC4CC, WORD_LEN, 0 }, -{ 0x0994, 0x0190, WORD_LEN, 0 }, -{ 0x0996, 0xFD30, WORD_LEN, 0 }, -{ 0x0998, 0xC501, WORD_LEN, 0 }, -{ 0x099A, 0x0101, WORD_LEN, 0 }, -{ 0x099C, 0xFC30, WORD_LEN, 0 }, -{ 0x099E, 0xC230, WORD_LEN, 0 }, -{ 0x098A, 0x0E0B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xED08, WORD_LEN, 0 }, -{ 0x0992, 0x200A, WORD_LEN, 0 }, -{ 0x0994, 0xCC3C, WORD_LEN, 0 }, -{ 0x0996, 0x68BD, WORD_LEN, 0 }, -{ 0x0998, 0x6FD1, WORD_LEN, 0 }, -{ 0x099A, 0x0530, WORD_LEN, 0 }, -{ 0x099C, 0xED08, WORD_LEN, 0 }, -{ 0x099E, 0xCC34, WORD_LEN, 0 }, -{ 0x098A, 0x0E1B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x08ED, WORD_LEN, 0 }, -{ 0x0992, 0x00EC, WORD_LEN, 0 }, -{ 0x0994, 0x08BD, WORD_LEN, 0 }, -{ 0x0996, 0x7021, WORD_LEN, 0 }, -{ 0x0998, 0x30C6, WORD_LEN, 0 }, -{ 0x099A, 0x0C3A, WORD_LEN, 0 }, -{ 0x099C, 0x3539, WORD_LEN, 0 }, -{ 0x099E, 0x373C, WORD_LEN, 0 }, -{ 0x098A, 0x0E2B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x3C3C, WORD_LEN, 0 }, -{ 0x0992, 0x34DE, WORD_LEN, 0 }, -{ 0x0994, 0x2FEE, WORD_LEN, 0 }, -{ 0x0996, 0x0EAD, WORD_LEN, 0 }, -{ 0x0998, 0x007D, WORD_LEN, 0 }, -{ 0x099A, 0x13EF, WORD_LEN, 0 }, -{ 0x099C, 0x277C, WORD_LEN, 0 }, -{ 0x099E, 0xCE13, WORD_LEN, 0 }, -{ 0x098A, 0x0E3B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xE01E, WORD_LEN, 0 }, -{ 0x0992, 0x0510, WORD_LEN, 0 }, -{ 0x0994, 0x60E6, WORD_LEN, 0 }, -{ 0x0996, 0x0E4F, WORD_LEN, 0 }, -{ 0x0998, 0xC313, WORD_LEN, 0 }, -{ 0x099A, 0xF08F, WORD_LEN, 0 }, -{ 0x099C, 0xE600, WORD_LEN, 0 }, -{ 0x099E, 0x30E1, WORD_LEN, 0 }, -{ 0x098A, 0x0E4B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x0722, WORD_LEN, 0 }, -{ 0x0992, 0x16F6, WORD_LEN, 0 }, -{ 0x0994, 0x13EE, WORD_LEN, 0 }, -{ 0x0996, 0x4FC3, WORD_LEN, 0 }, -{ 0x0998, 0x13F3, WORD_LEN, 0 }, -{ 0x099A, 0x8FE6, WORD_LEN, 0 }, -{ 0x099C, 0x0030, WORD_LEN, 0 }, -{ 0x099E, 0xE107, WORD_LEN, 0 }, -{ 0x098A, 0x0E5B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x2507, WORD_LEN, 0 }, -{ 0x0992, 0xF613, WORD_LEN, 0 }, -{ 0x0994, 0xEEC1, WORD_LEN, 0 }, -{ 0x0996, 0x0325, WORD_LEN, 0 }, -{ 0x0998, 0x3C7F, WORD_LEN, 0 }, -{ 0x099A, 0x13EE, WORD_LEN, 0 }, -{ 0x099C, 0xF613, WORD_LEN, 0 }, -{ 0x099E, 0xEFE7, WORD_LEN, 0 }, -{ 0x098A, 0x0E6B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x06CC, WORD_LEN, 0 }, -{ 0x0992, 0x13F0, WORD_LEN, 0 }, -{ 0x0994, 0xED04, WORD_LEN, 0 }, -{ 0x0996, 0xCC13, WORD_LEN, 0 }, -{ 0x0998, 0xF320, WORD_LEN, 0 }, -{ 0x099A, 0x0F7C, WORD_LEN, 0 }, -{ 0x099C, 0x13EE, WORD_LEN, 0 }, -{ 0x099E, 0xEC04, WORD_LEN, 0 }, -{ 0x098A, 0x0E7B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xC300, WORD_LEN, 0 }, -{ 0x0992, 0x01ED, WORD_LEN, 0 }, -{ 0x0994, 0x04EC, WORD_LEN, 0 }, -{ 0x0996, 0x02C3, WORD_LEN, 0 }, -{ 0x0998, 0x0001, WORD_LEN, 0 }, -{ 0x099A, 0xED02, WORD_LEN, 0 }, -{ 0x099C, 0xF613, WORD_LEN, 0 }, -{ 0x099E, 0xEEE1, WORD_LEN, 0 }, -{ 0x098A, 0x0E8B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x0624, WORD_LEN, 0 }, -{ 0x0992, 0x12EE, WORD_LEN, 0 }, -{ 0x0994, 0x04E6, WORD_LEN, 0 }, -{ 0x0996, 0x0030, WORD_LEN, 0 }, -{ 0x0998, 0xE107, WORD_LEN, 0 }, -{ 0x099A, 0x22DF, WORD_LEN, 0 }, -{ 0x099C, 0xEE02, WORD_LEN, 0 }, -{ 0x099E, 0xE600, WORD_LEN, 0 }, -{ 0x098A, 0x0E9B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x30E1, WORD_LEN, 0 }, -{ 0x0992, 0x0725, WORD_LEN, 0 }, -{ 0x0994, 0xD6DE, WORD_LEN, 0 }, -{ 0x0996, 0x49EE, WORD_LEN, 0 }, -{ 0x0998, 0x08AD, WORD_LEN, 0 }, -{ 0x099A, 0x00CC, WORD_LEN, 0 }, -{ 0x099C, 0x13F6, WORD_LEN, 0 }, -{ 0x099E, 0x30ED, WORD_LEN, 0 }, -{ 0x098A, 0x0EAB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x00DE, WORD_LEN, 0 }, -{ 0x0992, 0x2FEE, WORD_LEN, 0 }, -{ 0x0994, 0x10CC, WORD_LEN, 0 }, -{ 0x0996, 0x13FA, WORD_LEN, 0 }, -{ 0x0998, 0xAD00, WORD_LEN, 0 }, -{ 0x099A, 0x3838, WORD_LEN, 0 }, -{ 0x099C, 0x3838, WORD_LEN, 0 }, -{ 0x099E, 0x3937, WORD_LEN, 0 }, -{ 0x098A, 0x0EBB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x363C, WORD_LEN, 0 }, -{ 0x0992, 0x3C3C, WORD_LEN, 0 }, -{ 0x0994, 0x5F4F, WORD_LEN, 0 }, -{ 0x0996, 0x30ED, WORD_LEN, 0 }, -{ 0x0998, 0x04EC, WORD_LEN, 0 }, -{ 0x099A, 0x06ED, WORD_LEN, 0 }, -{ 0x099C, 0x008F, WORD_LEN, 0 }, -{ 0x099E, 0xC300, WORD_LEN, 0 }, -{ 0x098A, 0x0ECB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x04BD, WORD_LEN, 0 }, -{ 0x0992, 0x0F43, WORD_LEN, 0 }, -{ 0x0994, 0x30EC, WORD_LEN, 0 }, -{ 0x0996, 0x04BD, WORD_LEN, 0 }, -{ 0x0998, 0x0F76, WORD_LEN, 0 }, -{ 0x099A, 0x30ED, WORD_LEN, 0 }, -{ 0x099C, 0x0238, WORD_LEN, 0 }, -{ 0x099E, 0x3838, WORD_LEN, 0 }, -{ 0x098A, 0x0EDB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x3839, WORD_LEN, 0 }, -{ 0x0992, 0x373C, WORD_LEN, 0 }, -{ 0x0994, 0x3C3C, WORD_LEN, 0 }, -{ 0x0996, 0x3C30, WORD_LEN, 0 }, -{ 0x0998, 0xE608, WORD_LEN, 0 }, -{ 0x099A, 0x2712, WORD_LEN, 0 }, -{ 0x099C, 0xC101, WORD_LEN, 0 }, -{ 0x099E, 0x2713, WORD_LEN, 0 }, -{ 0x098A, 0x0EEB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xC102, WORD_LEN, 0 }, -{ 0x0992, 0x2714, WORD_LEN, 0 }, -{ 0x0994, 0xC103, WORD_LEN, 0 }, -{ 0x0996, 0x2715, WORD_LEN, 0 }, -{ 0x0998, 0xC104, WORD_LEN, 0 }, -{ 0x099A, 0x2716, WORD_LEN, 0 }, -{ 0x099C, 0x2019, WORD_LEN, 0 }, -{ 0x099E, 0xCC30, WORD_LEN, 0 }, -{ 0x098A, 0x0EFB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x5E20, WORD_LEN, 0 }, -{ 0x0992, 0x12CC, WORD_LEN, 0 }, -{ 0x0994, 0x305A, WORD_LEN, 0 }, -{ 0x0996, 0x200D, WORD_LEN, 0 }, -{ 0x0998, 0xCC30, WORD_LEN, 0 }, -{ 0x099A, 0x5620, WORD_LEN, 0 }, -{ 0x099C, 0x08CC, WORD_LEN, 0 }, -{ 0x099E, 0x305C, WORD_LEN, 0 }, -{ 0x098A, 0x0F0B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x2003, WORD_LEN, 0 }, -{ 0x0992, 0xCC30, WORD_LEN, 0 }, -{ 0x0994, 0x58ED, WORD_LEN, 0 }, -{ 0x0996, 0x065F, WORD_LEN, 0 }, -{ 0x0998, 0x4FED, WORD_LEN, 0 }, -{ 0x099A, 0x04EC, WORD_LEN, 0 }, -{ 0x099C, 0x0BED, WORD_LEN, 0 }, -{ 0x099E, 0x008F, WORD_LEN, 0 }, -{ 0x098A, 0x0F1B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xC300, WORD_LEN, 0 }, -{ 0x0992, 0x04BD, WORD_LEN, 0 }, -{ 0x0994, 0x0F43, WORD_LEN, 0 }, -{ 0x0996, 0x30EC, WORD_LEN, 0 }, -{ 0x0998, 0x048A, WORD_LEN, 0 }, -{ 0x099A, 0x02ED, WORD_LEN, 0 }, -{ 0x099C, 0x02EC, WORD_LEN, 0 }, -{ 0x099E, 0x06ED, WORD_LEN, 0 }, -{ 0x098A, 0x0F2B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x008F, WORD_LEN, 0 }, -{ 0x0992, 0xC300, WORD_LEN, 0 }, -{ 0x0994, 0x02DE, WORD_LEN, 0 }, -{ 0x0996, 0x0EAD, WORD_LEN, 0 }, -{ 0x0998, 0x0030, WORD_LEN, 0 }, -{ 0x099A, 0xEC04, WORD_LEN, 0 }, -{ 0x099C, 0xBD0F, WORD_LEN, 0 }, -{ 0x099E, 0x7630, WORD_LEN, 0 }, -{ 0x098A, 0x0F3B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xED02, WORD_LEN, 0 }, -{ 0x0992, 0x3838, WORD_LEN, 0 }, -{ 0x0994, 0x3838, WORD_LEN, 0 }, -{ 0x0996, 0x3139, WORD_LEN, 0 }, -{ 0x0998, 0x3736, WORD_LEN, 0 }, -{ 0x099A, 0x30EC, WORD_LEN, 0 }, -{ 0x099C, 0x041A, WORD_LEN, 0 }, -{ 0x099E, 0x8300, WORD_LEN, 0 }, -{ 0x098A, 0x0F4B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x4025, WORD_LEN, 0 }, -{ 0x0992, 0x22EC, WORD_LEN, 0 }, -{ 0x0994, 0x041A, WORD_LEN, 0 }, -{ 0x0996, 0x8300, WORD_LEN, 0 }, -{ 0x0998, 0x8024, WORD_LEN, 0 }, -{ 0x099A, 0x0504, WORD_LEN, 0 }, -{ 0x099C, 0xCA40, WORD_LEN, 0 }, -{ 0x099E, 0x2015, WORD_LEN, 0 }, -{ 0x098A, 0x0F5B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xEC04, WORD_LEN, 0 }, -{ 0x0992, 0x1A83, WORD_LEN, 0 }, -{ 0x0994, 0x0100, WORD_LEN, 0 }, -{ 0x0996, 0x2406, WORD_LEN, 0 }, -{ 0x0998, 0x0404, WORD_LEN, 0 }, -{ 0x099A, 0xCA80, WORD_LEN, 0 }, -{ 0x099C, 0x2007, WORD_LEN, 0 }, -{ 0x099E, 0xEC04, WORD_LEN, 0 }, -{ 0x098A, 0x0F6B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x0404, WORD_LEN, 0 }, -{ 0x0992, 0x04CA, WORD_LEN, 0 }, -{ 0x0994, 0xC0EE, WORD_LEN, 0 }, -{ 0x0996, 0x00ED, WORD_LEN, 0 }, -{ 0x0998, 0x0038, WORD_LEN, 0 }, -{ 0x099A, 0x3937, WORD_LEN, 0 }, -{ 0x099C, 0x363C, WORD_LEN, 0 }, -{ 0x099E, 0x301F, WORD_LEN, 0 }, -{ 0x098A, 0x0F7B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x0340, WORD_LEN, 0 }, -{ 0x0992, 0x0E1F, WORD_LEN, 0 }, -{ 0x0994, 0x0380, WORD_LEN, 0 }, -{ 0x0996, 0x0AEC, WORD_LEN, 0 }, -{ 0x0998, 0x02C4, WORD_LEN, 0 }, -{ 0x099A, 0x3F4F, WORD_LEN, 0 }, -{ 0x099C, 0x0505, WORD_LEN, 0 }, -{ 0x099E, 0x0520, WORD_LEN, 0 }, -{ 0x098A, 0x0F8B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x1B1F, WORD_LEN, 0 }, -{ 0x0992, 0x0380, WORD_LEN, 0 }, -{ 0x0994, 0x09EC, WORD_LEN, 0 }, -{ 0x0996, 0x02C4, WORD_LEN, 0 }, -{ 0x0998, 0x3F4F, WORD_LEN, 0 }, -{ 0x099A, 0x0505, WORD_LEN, 0 }, -{ 0x099C, 0x200E, WORD_LEN, 0 }, -{ 0x099E, 0x1F03, WORD_LEN, 0 }, -{ 0x098A, 0x0F9B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x4008, WORD_LEN, 0 }, -{ 0x0992, 0xEC02, WORD_LEN, 0 }, -{ 0x0994, 0xC43F, WORD_LEN, 0 }, -{ 0x0996, 0x4F05, WORD_LEN, 0 }, -{ 0x0998, 0x2002, WORD_LEN, 0 }, -{ 0x099A, 0xEC02, WORD_LEN, 0 }, -{ 0x099C, 0xED00, WORD_LEN, 0 }, -{ 0x099E, 0x3838, WORD_LEN, 0 }, -{ 0x098A, 0x8FAB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x0039, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098A, 0x1000, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xCC10, WORD_LEN, 0 }, -{ 0x0992, 0x09BD, WORD_LEN, 0 }, -{ 0x0994, 0x4224, WORD_LEN, 0 }, -{ 0x0996, 0x7E10, WORD_LEN, 0 }, -{ 0x0998, 0x09C6, WORD_LEN, 0 }, -{ 0x099A, 0x01F7, WORD_LEN, 0 }, -{ 0x099C, 0x018A, WORD_LEN, 0 }, -{ 0x099E, 0xC609, WORD_LEN, 0 }, -{ 0x098A, 0x1010, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xF701, WORD_LEN, 0 }, -{ 0x0992, 0x8BDE, WORD_LEN, 0 }, -{ 0x0994, 0x3F18, WORD_LEN, 0 }, -{ 0x0996, 0xCE0B, WORD_LEN, 0 }, -{ 0x0998, 0xF3CC, WORD_LEN, 0 }, -{ 0x099A, 0x0011, WORD_LEN, 0 }, -{ 0x099C, 0xBDD7, WORD_LEN, 0 }, -{ 0x099E, 0x00CC, WORD_LEN, 0 }, -{ 0x098A, 0x1020, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x0BF3, WORD_LEN, 0 }, -{ 0x0992, 0xDD3F, WORD_LEN, 0 }, -{ 0x0994, 0xDE35, WORD_LEN, 0 }, -{ 0x0996, 0x18CE, WORD_LEN, 0 }, -{ 0x0998, 0x0C05, WORD_LEN, 0 }, -{ 0x099A, 0xCC00, WORD_LEN, 0 }, -{ 0x099C, 0x3FBD, WORD_LEN, 0 }, -{ 0x099E, 0xD700, WORD_LEN, 0 }, -{ 0x098A, 0x1030, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xCC0C, WORD_LEN, 0 }, -{ 0x0992, 0x05DD, WORD_LEN, 0 }, -{ 0x0994, 0x35DE, WORD_LEN, 0 }, -{ 0x0996, 0x4718, WORD_LEN, 0 }, -{ 0x0998, 0xCE0C, WORD_LEN, 0 }, -{ 0x099A, 0x45CC, WORD_LEN, 0 }, -{ 0x099C, 0x0015, WORD_LEN, 0 }, -{ 0x099E, 0xBDD7, WORD_LEN, 0 }, -{ 0x098A, 0x1040, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x00CC, WORD_LEN, 0 }, -{ 0x0992, 0x0C45, WORD_LEN, 0 }, -{ 0x0994, 0xDD47, WORD_LEN, 0 }, -{ 0x0996, 0xFE00, WORD_LEN, 0 }, -{ 0x0998, 0x3318, WORD_LEN, 0 }, -{ 0x099A, 0xCE0C, WORD_LEN, 0 }, -{ 0x099C, 0x5BCC, WORD_LEN, 0 }, -{ 0x099E, 0x0009, WORD_LEN, 0 }, -{ 0x098A, 0x1050, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xBDD7, WORD_LEN, 0 }, -{ 0x0992, 0x00CC, WORD_LEN, 0 }, -{ 0x0994, 0x0C5B, WORD_LEN, 0 }, -{ 0x0996, 0xFD00, WORD_LEN, 0 }, -{ 0x0998, 0x33DE, WORD_LEN, 0 }, -{ 0x099A, 0x3118, WORD_LEN, 0 }, -{ 0x099C, 0xCE0C, WORD_LEN, 0 }, -{ 0x099E, 0x65CC, WORD_LEN, 0 }, -{ 0x098A, 0x1060, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x0029, WORD_LEN, 0 }, -{ 0x0992, 0xBDD7, WORD_LEN, 0 }, -{ 0x0994, 0x00CC, WORD_LEN, 0 }, -{ 0x0996, 0x0C65, WORD_LEN, 0 }, -{ 0x0998, 0xDD31, WORD_LEN, 0 }, -{ 0x099A, 0xDE39, WORD_LEN, 0 }, -{ 0x099C, 0x18CE, WORD_LEN, 0 }, -{ 0x099E, 0x0C8F, WORD_LEN, 0 }, -{ 0x098A, 0x1070, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xCC00, WORD_LEN, 0 }, -{ 0x0992, 0x23BD, WORD_LEN, 0 }, -{ 0x0994, 0xD700, WORD_LEN, 0 }, -{ 0x0996, 0xCC0C, WORD_LEN, 0 }, -{ 0x0998, 0x8FDD, WORD_LEN, 0 }, -{ 0x099A, 0x39DE, WORD_LEN, 0 }, -{ 0x099C, 0x4918, WORD_LEN, 0 }, -{ 0x099E, 0xCE0C, WORD_LEN, 0 }, -{ 0x098A, 0x1080, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xB3CC, WORD_LEN, 0 }, -{ 0x0992, 0x000D, WORD_LEN, 0 }, -{ 0x0994, 0xBDD7, WORD_LEN, 0 }, -{ 0x0996, 0x00CC, WORD_LEN, 0 }, -{ 0x0998, 0x0CB3, WORD_LEN, 0 }, -{ 0x099A, 0xDD49, WORD_LEN, 0 }, -{ 0x099C, 0xFC04, WORD_LEN, 0 }, -{ 0x099E, 0xC2FD, WORD_LEN, 0 }, -{ 0x098A, 0x1090, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x0BF1, WORD_LEN, 0 }, -{ 0x0992, 0x18FE, WORD_LEN, 0 }, -{ 0x0994, 0x0BF1, WORD_LEN, 0 }, -{ 0x0996, 0xCDEE, WORD_LEN, 0 }, -{ 0x0998, 0x1518, WORD_LEN, 0 }, -{ 0x099A, 0xCE0C, WORD_LEN, 0 }, -{ 0x099C, 0xC1CC, WORD_LEN, 0 }, -{ 0x099E, 0x0029, WORD_LEN, 0 }, -{ 0x098A, 0x10A0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xBDD7, WORD_LEN, 0 }, -{ 0x0992, 0x00FE, WORD_LEN, 0 }, -{ 0x0994, 0x0BF1, WORD_LEN, 0 }, -{ 0x0996, 0xCC0C, WORD_LEN, 0 }, -{ 0x0998, 0xC1ED, WORD_LEN, 0 }, -{ 0x099A, 0x15CC, WORD_LEN, 0 }, -{ 0x099C, 0x11A5, WORD_LEN, 0 }, -{ 0x099E, 0xFD0B, WORD_LEN, 0 }, -{ 0x098A, 0x10B0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xFFCC, WORD_LEN, 0 }, -{ 0x0992, 0x0CFB, WORD_LEN, 0 }, -{ 0x0994, 0xFD0C, WORD_LEN, 0 }, -{ 0x0996, 0x21CC, WORD_LEN, 0 }, -{ 0x0998, 0x128F, WORD_LEN, 0 }, -{ 0x099A, 0xFD0C, WORD_LEN, 0 }, -{ 0x099C, 0x53CC, WORD_LEN, 0 }, -{ 0x099E, 0x114E, WORD_LEN, 0 }, -{ 0x098A, 0x10C0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xFD0C, WORD_LEN, 0 }, -{ 0x0992, 0x5DCC, WORD_LEN, 0 }, -{ 0x0994, 0x10E2, WORD_LEN, 0 }, -{ 0x0996, 0xFD0C, WORD_LEN, 0 }, -{ 0x0998, 0x6FCC, WORD_LEN, 0 }, -{ 0x099A, 0x0EDD, WORD_LEN, 0 }, -{ 0x099C, 0xFD0C, WORD_LEN, 0 }, -{ 0x099E, 0xD7CC, WORD_LEN, 0 }, -{ 0x098A, 0x10D0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x0EBA, WORD_LEN, 0 }, -{ 0x0992, 0xFD0C, WORD_LEN, 0 }, -{ 0x0994, 0xE9CC, WORD_LEN, 0 }, -{ 0x0996, 0x1350, WORD_LEN, 0 }, -{ 0x0998, 0xFD0C, WORD_LEN, 0 }, -{ 0x099A, 0x9BCC, WORD_LEN, 0 }, -{ 0x099C, 0x0E29, WORD_LEN, 0 }, -{ 0x099E, 0xFD0C, WORD_LEN, 0 }, -{ 0x098A, 0x10E0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xBF39, WORD_LEN, 0 }, -{ 0x0992, 0x373C, WORD_LEN, 0 }, -{ 0x0994, 0x3CDE, WORD_LEN, 0 }, -{ 0x0996, 0x1DEC, WORD_LEN, 0 }, -{ 0x0998, 0x0C5F, WORD_LEN, 0 }, -{ 0x099A, 0x8402, WORD_LEN, 0 }, -{ 0x099C, 0x4416, WORD_LEN, 0 }, -{ 0x099E, 0x4FF7, WORD_LEN, 0 }, -{ 0x098A, 0x10F0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x0CEB, WORD_LEN, 0 }, -{ 0x0992, 0xE60B, WORD_LEN, 0 }, -{ 0x0994, 0xC407, WORD_LEN, 0 }, -{ 0x0996, 0xF70C, WORD_LEN, 0 }, -{ 0x0998, 0xEC7F, WORD_LEN, 0 }, -{ 0x099A, 0x30C4, WORD_LEN, 0 }, -{ 0x099C, 0xEC25, WORD_LEN, 0 }, -{ 0x099E, 0xFD30, WORD_LEN, 0 }, -{ 0x098A, 0x1100, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xC5FC, WORD_LEN, 0 }, -{ 0x0992, 0x06D6, WORD_LEN, 0 }, -{ 0x0994, 0xFD30, WORD_LEN, 0 }, -{ 0x0996, 0xC701, WORD_LEN, 0 }, -{ 0x0998, 0xFC30, WORD_LEN, 0 }, -{ 0x099A, 0xC0FD, WORD_LEN, 0 }, -{ 0x099C, 0x0BED, WORD_LEN, 0 }, -{ 0x099E, 0xFC30, WORD_LEN, 0 }, -{ 0x098A, 0x1110, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xC2FD, WORD_LEN, 0 }, -{ 0x0992, 0x0BEF, WORD_LEN, 0 }, -{ 0x0994, 0xFC04, WORD_LEN, 0 }, -{ 0x0996, 0xC283, WORD_LEN, 0 }, -{ 0x0998, 0xFFFF, WORD_LEN, 0 }, -{ 0x099A, 0x2728, WORD_LEN, 0 }, -{ 0x099C, 0xDE06, WORD_LEN, 0 }, -{ 0x099E, 0xEC22, WORD_LEN, 0 }, -{ 0x098A, 0x1120, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x8322, WORD_LEN, 0 }, -{ 0x0992, 0x0026, WORD_LEN, 0 }, -{ 0x0994, 0x1FCC, WORD_LEN, 0 }, -{ 0x0996, 0x3064, WORD_LEN, 0 }, -{ 0x0998, 0x30ED, WORD_LEN, 0 }, -{ 0x099A, 0x008F, WORD_LEN, 0 }, -{ 0x099C, 0xC300, WORD_LEN, 0 }, -{ 0x099E, 0x02DE, WORD_LEN, 0 }, -{ 0x098A, 0x1130, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x0CAD, WORD_LEN, 0 }, -{ 0x0992, 0x0030, WORD_LEN, 0 }, -{ 0x0994, 0x1D02, WORD_LEN, 0 }, -{ 0x0996, 0x01CC, WORD_LEN, 0 }, -{ 0x0998, 0x3064, WORD_LEN, 0 }, -{ 0x099A, 0xED00, WORD_LEN, 0 }, -{ 0x099C, 0x8FC3, WORD_LEN, 0 }, -{ 0x099E, 0x0002, WORD_LEN, 0 }, -{ 0x098A, 0x1140, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xDE0E, WORD_LEN, 0 }, -{ 0x0992, 0xAD00, WORD_LEN, 0 }, -{ 0x0994, 0x30E6, WORD_LEN, 0 }, -{ 0x0996, 0x04BD, WORD_LEN, 0 }, -{ 0x0998, 0x5203, WORD_LEN, 0 }, -{ 0x099A, 0x3838, WORD_LEN, 0 }, -{ 0x099C, 0x3139, WORD_LEN, 0 }, -{ 0x099E, 0x3C3C, WORD_LEN, 0 }, -{ 0x098A, 0x1150, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x3C21, WORD_LEN, 0 }, -{ 0x0992, 0x01CC, WORD_LEN, 0 }, -{ 0x0994, 0x0018, WORD_LEN, 0 }, -{ 0x0996, 0xBD6F, WORD_LEN, 0 }, -{ 0x0998, 0xD1C5, WORD_LEN, 0 }, -{ 0x099A, 0x0426, WORD_LEN, 0 }, -{ 0x099C, 0xF5DC, WORD_LEN, 0 }, -{ 0x099E, 0x2530, WORD_LEN, 0 }, -{ 0x098A, 0x1160, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xED04, WORD_LEN, 0 }, -{ 0x0992, 0x2012, WORD_LEN, 0 }, -{ 0x0994, 0xEE04, WORD_LEN, 0 }, -{ 0x0996, 0x3C18, WORD_LEN, 0 }, -{ 0x0998, 0x38E6, WORD_LEN, 0 }, -{ 0x099A, 0x2118, WORD_LEN, 0 }, -{ 0x099C, 0xE7BE, WORD_LEN, 0 }, -{ 0x099E, 0x30EE, WORD_LEN, 0 }, -{ 0x098A, 0x1170, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x04EC, WORD_LEN, 0 }, -{ 0x0992, 0x1D30, WORD_LEN, 0 }, -{ 0x0994, 0xED04, WORD_LEN, 0 }, -{ 0x0996, 0xEC04, WORD_LEN, 0 }, -{ 0x0998, 0x26EA, WORD_LEN, 0 }, -{ 0x099A, 0xCC00, WORD_LEN, 0 }, -{ 0x099C, 0x1AED, WORD_LEN, 0 }, -{ 0x099E, 0x02CC, WORD_LEN, 0 }, -{ 0x098A, 0x1180, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xFBFF, WORD_LEN, 0 }, -{ 0x0992, 0xED00, WORD_LEN, 0 }, -{ 0x0994, 0xCC04, WORD_LEN, 0 }, -{ 0x0996, 0x00BD, WORD_LEN, 0 }, -{ 0x0998, 0x706D, WORD_LEN, 0 }, -{ 0x099A, 0xCC00, WORD_LEN, 0 }, -{ 0x099C, 0x1A30, WORD_LEN, 0 }, -{ 0x099E, 0xED02, WORD_LEN, 0 }, -{ 0x098A, 0x1190, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xCCFB, WORD_LEN, 0 }, -{ 0x0992, 0xFFED, WORD_LEN, 0 }, -{ 0x0994, 0x005F, WORD_LEN, 0 }, -{ 0x0996, 0x4FBD, WORD_LEN, 0 }, -{ 0x0998, 0x706D, WORD_LEN, 0 }, -{ 0x099A, 0x5FBD, WORD_LEN, 0 }, -{ 0x099C, 0x5B17, WORD_LEN, 0 }, -{ 0x099E, 0xBD55, WORD_LEN, 0 }, -{ 0x098A, 0x11A0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x8B38, WORD_LEN, 0 }, -{ 0x0992, 0x3838, WORD_LEN, 0 }, -{ 0x0994, 0x393C, WORD_LEN, 0 }, -{ 0x0996, 0x3CC6, WORD_LEN, 0 }, -{ 0x0998, 0x40F7, WORD_LEN, 0 }, -{ 0x099A, 0x30C4, WORD_LEN, 0 }, -{ 0x099C, 0xFC0B, WORD_LEN, 0 }, -{ 0x099E, 0xEDFD, WORD_LEN, 0 }, -{ 0x098A, 0x11B0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x30C0, WORD_LEN, 0 }, -{ 0x0992, 0xFC0B, WORD_LEN, 0 }, -{ 0x0994, 0xEFFD, WORD_LEN, 0 }, -{ 0x0996, 0x30C2, WORD_LEN, 0 }, -{ 0x0998, 0xDE1D, WORD_LEN, 0 }, -{ 0x099A, 0xEC25, WORD_LEN, 0 }, -{ 0x099C, 0xFD30, WORD_LEN, 0 }, -{ 0x099E, 0xC501, WORD_LEN, 0 }, -{ 0x098A, 0x11C0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x0101, WORD_LEN, 0 }, -{ 0x0992, 0xFC30, WORD_LEN, 0 }, -{ 0x0994, 0xC2FD, WORD_LEN, 0 }, -{ 0x0996, 0x06D6, WORD_LEN, 0 }, -{ 0x0998, 0xEC0C, WORD_LEN, 0 }, -{ 0x099A, 0x5F84, WORD_LEN, 0 }, -{ 0x099C, 0x0244, WORD_LEN, 0 }, -{ 0x099E, 0x164F, WORD_LEN, 0 }, -{ 0x098A, 0x11D0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x30E7, WORD_LEN, 0 }, -{ 0x0992, 0x03F1, WORD_LEN, 0 }, -{ 0x0994, 0x0CEB, WORD_LEN, 0 }, -{ 0x0996, 0x2715, WORD_LEN, 0 }, -{ 0x0998, 0xF10C, WORD_LEN, 0 }, -{ 0x099A, 0xEB23, WORD_LEN, 0 }, -{ 0x099C, 0x09FC, WORD_LEN, 0 }, -{ 0x099E, 0x06D6, WORD_LEN, 0 }, -{ 0x098A, 0x11E0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x04FD, WORD_LEN, 0 }, -{ 0x0992, 0x06D6, WORD_LEN, 0 }, -{ 0x0994, 0x2007, WORD_LEN, 0 }, -{ 0x0996, 0xFC06, WORD_LEN, 0 }, -{ 0x0998, 0xD605, WORD_LEN, 0 }, -{ 0x099A, 0xFD06, WORD_LEN, 0 }, -{ 0x099C, 0xD6DE, WORD_LEN, 0 }, -{ 0x099E, 0x1DE6, WORD_LEN, 0 }, -{ 0x098A, 0x11F0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x0BC4, WORD_LEN, 0 }, -{ 0x0992, 0x0730, WORD_LEN, 0 }, -{ 0x0994, 0xE702, WORD_LEN, 0 }, -{ 0x0996, 0xF10C, WORD_LEN, 0 }, -{ 0x0998, 0xEC27, WORD_LEN, 0 }, -{ 0x099A, 0x2C7D, WORD_LEN, 0 }, -{ 0x099C, 0x0CEC, WORD_LEN, 0 }, -{ 0x099E, 0x2727, WORD_LEN, 0 }, -{ 0x098A, 0x1200, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x5D27, WORD_LEN, 0 }, -{ 0x0992, 0x247F, WORD_LEN, 0 }, -{ 0x0994, 0x30C4, WORD_LEN, 0 }, -{ 0x0996, 0xFC06, WORD_LEN, 0 }, -{ 0x0998, 0xD6FD, WORD_LEN, 0 }, -{ 0x099A, 0x30C5, WORD_LEN, 0 }, -{ 0x099C, 0xF60C, WORD_LEN, 0 }, -{ 0x099E, 0xEC4F, WORD_LEN, 0 }, -{ 0x098A, 0x1210, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xFD30, WORD_LEN, 0 }, -{ 0x0992, 0xC7C6, WORD_LEN, 0 }, -{ 0x0994, 0x40F7, WORD_LEN, 0 }, -{ 0x0996, 0x30C4, WORD_LEN, 0 }, -{ 0x0998, 0xE602, WORD_LEN, 0 }, -{ 0x099A, 0x4FFD, WORD_LEN, 0 }, -{ 0x099C, 0x30C5, WORD_LEN, 0 }, -{ 0x099E, 0x0101, WORD_LEN, 0 }, -{ 0x098A, 0x1220, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x01FC, WORD_LEN, 0 }, -{ 0x0992, 0x30C2, WORD_LEN, 0 }, -{ 0x0994, 0xFD06, WORD_LEN, 0 }, -{ 0x0996, 0xD67D, WORD_LEN, 0 }, -{ 0x0998, 0x06CB, WORD_LEN, 0 }, -{ 0x099A, 0x272E, WORD_LEN, 0 }, -{ 0x099C, 0xC640, WORD_LEN, 0 }, -{ 0x099E, 0xF730, WORD_LEN, 0 }, -{ 0x098A, 0x1230, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xC4FC, WORD_LEN, 0 }, -{ 0x0992, 0x06C1, WORD_LEN, 0 }, -{ 0x0994, 0x04F3, WORD_LEN, 0 }, -{ 0x0996, 0x06D6, WORD_LEN, 0 }, -{ 0x0998, 0xED00, WORD_LEN, 0 }, -{ 0x099A, 0x5F6D, WORD_LEN, 0 }, -{ 0x099C, 0x002A, WORD_LEN, 0 }, -{ 0x099E, 0x0153, WORD_LEN, 0 }, -{ 0x098A, 0x1240, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x17FD, WORD_LEN, 0 }, -{ 0x0992, 0x30C0, WORD_LEN, 0 }, -{ 0x0994, 0xEC00, WORD_LEN, 0 }, -{ 0x0996, 0xFD30, WORD_LEN, 0 }, -{ 0x0998, 0xC2FC, WORD_LEN, 0 }, -{ 0x099A, 0x06C1, WORD_LEN, 0 }, -{ 0x099C, 0xFD30, WORD_LEN, 0 }, -{ 0x099E, 0xC501, WORD_LEN, 0 }, -{ 0x098A, 0x1250, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x0101, WORD_LEN, 0 }, -{ 0x0992, 0xFC30, WORD_LEN, 0 }, -{ 0x0994, 0xC2FD, WORD_LEN, 0 }, -{ 0x0996, 0x06C7, WORD_LEN, 0 }, -{ 0x0998, 0x2022, WORD_LEN, 0 }, -{ 0x099A, 0x7F30, WORD_LEN, 0 }, -{ 0x099C, 0xC4DE, WORD_LEN, 0 }, -{ 0x099E, 0x1DEC, WORD_LEN, 0 }, -{ 0x098A, 0x1260, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x25FD, WORD_LEN, 0 }, -{ 0x0992, 0x30C5, WORD_LEN, 0 }, -{ 0x0994, 0xFC06, WORD_LEN, 0 }, -{ 0x0996, 0xD6FD, WORD_LEN, 0 }, -{ 0x0998, 0x30C7, WORD_LEN, 0 }, -{ 0x099A, 0x01FC, WORD_LEN, 0 }, -{ 0x099C, 0x30C0, WORD_LEN, 0 }, -{ 0x099E, 0xFD06, WORD_LEN, 0 }, -{ 0x098A, 0x1270, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xD0FC, WORD_LEN, 0 }, -{ 0x0992, 0x30C2, WORD_LEN, 0 }, -{ 0x0994, 0xFD06, WORD_LEN, 0 }, -{ 0x0996, 0xD2EC, WORD_LEN, 0 }, -{ 0x0998, 0x25FD, WORD_LEN, 0 }, -{ 0x099A, 0x06C3, WORD_LEN, 0 }, -{ 0x099C, 0xBD95, WORD_LEN, 0 }, -{ 0x099E, 0x3CDE, WORD_LEN, 0 }, -{ 0x098A, 0x1280, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x3FEE, WORD_LEN, 0 }, -{ 0x0992, 0x10AD, WORD_LEN, 0 }, -{ 0x0994, 0x00DE, WORD_LEN, 0 }, -{ 0x0996, 0x1DFC, WORD_LEN, 0 }, -{ 0x0998, 0x06CC, WORD_LEN, 0 }, -{ 0x099A, 0xED3E, WORD_LEN, 0 }, -{ 0x099C, 0x3838, WORD_LEN, 0 }, -{ 0x099E, 0x3930, WORD_LEN, 0 }, -{ 0x098A, 0x1290, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x8FC3, WORD_LEN, 0 }, -{ 0x0992, 0xFFEC, WORD_LEN, 0 }, -{ 0x0994, 0x8F35, WORD_LEN, 0 }, -{ 0x0996, 0xBDAD, WORD_LEN, 0 }, -{ 0x0998, 0x15DE, WORD_LEN, 0 }, -{ 0x099A, 0x198F, WORD_LEN, 0 }, -{ 0x099C, 0xC301, WORD_LEN, 0 }, -{ 0x099E, 0x4B8F, WORD_LEN, 0 }, -{ 0x098A, 0x12A0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xEC00, WORD_LEN, 0 }, -{ 0x0992, 0xFD05, WORD_LEN, 0 }, -{ 0x0994, 0x0EEC, WORD_LEN, 0 }, -{ 0x0996, 0x02FD, WORD_LEN, 0 }, -{ 0x0998, 0x0510, WORD_LEN, 0 }, -{ 0x099A, 0x8FC3, WORD_LEN, 0 }, -{ 0x099C, 0xFFCB, WORD_LEN, 0 }, -{ 0x099E, 0x8FE6, WORD_LEN, 0 }, -{ 0x098A, 0x12B0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x00F7, WORD_LEN, 0 }, -{ 0x0992, 0x0514, WORD_LEN, 0 }, -{ 0x0994, 0xE603, WORD_LEN, 0 }, -{ 0x0996, 0xF705, WORD_LEN, 0 }, -{ 0x0998, 0x15FC, WORD_LEN, 0 }, -{ 0x099A, 0x055B, WORD_LEN, 0 }, -{ 0x099C, 0xFD05, WORD_LEN, 0 }, -{ 0x099E, 0x12DE, WORD_LEN, 0 }, -{ 0x098A, 0x12C0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x37EE, WORD_LEN, 0 }, -{ 0x0992, 0x08AD, WORD_LEN, 0 }, -{ 0x0994, 0x00F6, WORD_LEN, 0 }, -{ 0x0996, 0x0516, WORD_LEN, 0 }, -{ 0x0998, 0x4F30, WORD_LEN, 0 }, -{ 0x099A, 0xED04, WORD_LEN, 0 }, -{ 0x099C, 0xDE1F, WORD_LEN, 0 }, -{ 0x099E, 0xEC6B, WORD_LEN, 0 }, -{ 0x098A, 0x12D0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xFD05, WORD_LEN, 0 }, -{ 0x0992, 0x0EEC, WORD_LEN, 0 }, -{ 0x0994, 0x6DFD, WORD_LEN, 0 }, -{ 0x0996, 0x0510, WORD_LEN, 0 }, -{ 0x0998, 0xDE19, WORD_LEN, 0 }, -{ 0x099A, 0x8FC3, WORD_LEN, 0 }, -{ 0x099C, 0x0117, WORD_LEN, 0 }, -{ 0x099E, 0x8FE6, WORD_LEN, 0 }, -{ 0x098A, 0x12E0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x00F7, WORD_LEN, 0 }, -{ 0x0992, 0x0514, WORD_LEN, 0 }, -{ 0x0994, 0xE603, WORD_LEN, 0 }, -{ 0x0996, 0xF705, WORD_LEN, 0 }, -{ 0x0998, 0x15FC, WORD_LEN, 0 }, -{ 0x099A, 0x0559, WORD_LEN, 0 }, -{ 0x099C, 0xFD05, WORD_LEN, 0 }, -{ 0x099E, 0x12DE, WORD_LEN, 0 }, -{ 0x098A, 0x12F0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x37EE, WORD_LEN, 0 }, -{ 0x0992, 0x08AD, WORD_LEN, 0 }, -{ 0x0994, 0x00F6, WORD_LEN, 0 }, -{ 0x0996, 0x0516, WORD_LEN, 0 }, -{ 0x0998, 0x4F30, WORD_LEN, 0 }, -{ 0x099A, 0xED06, WORD_LEN, 0 }, -{ 0x099C, 0xDE1F, WORD_LEN, 0 }, -{ 0x099E, 0xEC6B, WORD_LEN, 0 }, -{ 0x098A, 0x1300, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xFD05, WORD_LEN, 0 }, -{ 0x0992, 0x0EEC, WORD_LEN, 0 }, -{ 0x0994, 0x6DFD, WORD_LEN, 0 }, -{ 0x0996, 0x0510, WORD_LEN, 0 }, -{ 0x0998, 0xDE19, WORD_LEN, 0 }, -{ 0x099A, 0x8FC3, WORD_LEN, 0 }, -{ 0x099C, 0x0118, WORD_LEN, 0 }, -{ 0x099E, 0x8FE6, WORD_LEN, 0 }, -{ 0x098A, 0x1310, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x00F7, WORD_LEN, 0 }, -{ 0x0992, 0x0514, WORD_LEN, 0 }, -{ 0x0994, 0xE603, WORD_LEN, 0 }, -{ 0x0996, 0xF705, WORD_LEN, 0 }, -{ 0x0998, 0x15FC, WORD_LEN, 0 }, -{ 0x099A, 0x0559, WORD_LEN, 0 }, -{ 0x099C, 0xFD05, WORD_LEN, 0 }, -{ 0x099E, 0x12DE, WORD_LEN, 0 }, -{ 0x098A, 0x1320, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x37EE, WORD_LEN, 0 }, -{ 0x0992, 0x08AD, WORD_LEN, 0 }, -{ 0x0994, 0x00F6, WORD_LEN, 0 }, -{ 0x0996, 0x0516, WORD_LEN, 0 }, -{ 0x0998, 0x4F30, WORD_LEN, 0 }, -{ 0x099A, 0xED08, WORD_LEN, 0 }, -{ 0x099C, 0xCC32, WORD_LEN, 0 }, -{ 0x099E, 0x8EED, WORD_LEN, 0 }, -{ 0x098A, 0x1330, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x00EC, WORD_LEN, 0 }, -{ 0x0992, 0x04BD, WORD_LEN, 0 }, -{ 0x0994, 0x7021, WORD_LEN, 0 }, -{ 0x0996, 0xCC32, WORD_LEN, 0 }, -{ 0x0998, 0x6C30, WORD_LEN, 0 }, -{ 0x099A, 0xED02, WORD_LEN, 0 }, -{ 0x099C, 0xCCF8, WORD_LEN, 0 }, -{ 0x099E, 0x00ED, WORD_LEN, 0 }, -{ 0x098A, 0x1340, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x00A6, WORD_LEN, 0 }, -{ 0x0992, 0x07E3, WORD_LEN, 0 }, -{ 0x0994, 0x0884, WORD_LEN, 0 }, -{ 0x0996, 0x07BD, WORD_LEN, 0 }, -{ 0x0998, 0x706D, WORD_LEN, 0 }, -{ 0x099A, 0x30C6, WORD_LEN, 0 }, -{ 0x099C, 0x143A, WORD_LEN, 0 }, -{ 0x099E, 0x3539, WORD_LEN, 0 }, -{ 0x098A, 0x1350, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x3CBD, WORD_LEN, 0 }, -{ 0x0992, 0x776D, WORD_LEN, 0 }, -{ 0x0994, 0xCC32, WORD_LEN, 0 }, -{ 0x0996, 0x5C30, WORD_LEN, 0 }, -{ 0x0998, 0xED00, WORD_LEN, 0 }, -{ 0x099A, 0xFC13, WORD_LEN, 0 }, -{ 0x099C, 0x8683, WORD_LEN, 0 }, -{ 0x099E, 0x0001, WORD_LEN, 0 }, -{ 0x098A, 0x1360, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0xBD70, WORD_LEN, 0 }, -{ 0x0992, 0x21CC, WORD_LEN, 0 }, -{ 0x0994, 0x325E, WORD_LEN, 0 }, -{ 0x0996, 0x30ED, WORD_LEN, 0 }, -{ 0x0998, 0x00FC, WORD_LEN, 0 }, -{ 0x099A, 0x1388, WORD_LEN, 0 }, -{ 0x099C, 0x8300, WORD_LEN, 0 }, -{ 0x099E, 0x01BD, WORD_LEN, 0 }, -{ 0x098A, 0x1370, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{ 0x0990, 0x7021, WORD_LEN, 0 }, -{ 0x0992, 0x3839, WORD_LEN, 0 }, -{ 0x098E, 0x0010, WORD_LEN, 0 }, // MCU_ADDRESS [MON_ADDR] -{ 0x0990, 0x1000, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x0003, WORD_LEN, 0 }, // MCU_ADDRESS [MON_ALGO] -{ 0x0990, 0x0004, WORD_LEN, 0 }, // MCU_DATA_0 - -{ SEQUENCE_WAIT_MS,50, WORD_LEN, 0}, - -{ 0x098E, 0x4815, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0004, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x485D, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x0004, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x0018, 0x0028, WORD_LEN, 0 }, // STANDBY_CONTROL_AND_STATUS - -{ SEQUENCE_WAIT_MS,10, WORD_LEN, 0}, - -//awb -{ 0x098E, 0xAC02, WORD_LEN, 0 }, // MCU_ADDRESS [AWB_MODE] -{ 0x0990, 0x000A, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x2C03, WORD_LEN, 0 }, // MCU_ADDRESS -{ 0x0990, 0x01ff, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x683F, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AWB_ALGO_RUN] -{ 0x0990, 0x01fF, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x8400, WORD_LEN, 0 }, // MCU_ADDRESS [SEQ_CMD] -{ 0x0990, 0x0005, WORD_LEN, 0 }, // MCU_DATA_0 - -{ SEQUENCE_WAIT_MS,10, WORD_LEN, 0}, - -//banding AUTO -{ 0x098E, 0x6811, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_FD_ALGO_RUN] -{ 0x0990, 0x0003, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x8400, WORD_LEN, 0 }, // MCU_ADDRESS [SEQ_CMD] -{ 0x0990, 0x0005, WORD_LEN, 0 }, // MCU_DATA_0 - -{ SEQUENCE_WAIT_MS,10, WORD_LEN, 0}, - -//effect off -{ 0x098E, 0xE883, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SELECT_FX] -{ 0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xEC83, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SELECT_FX] -{ 0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x8400, WORD_LEN, 0 }, // MCU_ADDRESS [SEQ_CMD] -{ 0x0990, 0x0006, WORD_LEN, 0 }, // MCU_DATA_0 - -{ SEQUENCE_WAIT_MS,10, WORD_LEN, 0}, - -//contrast level=3 -{ 0x098E, 0xBC0B, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_0] -{ 0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC0C, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_1] -{ 0x0990, 0x000A, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC0D, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_2] -{ 0x0990, 0x001B, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC0E, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_3] -{ 0x0990, 0x0031, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC0F, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_4] -{ 0x0990, 0x0052, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC10, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_5] -{ 0x0990, 0x006E, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC11, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_6] -{ 0x0990, 0x0089, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC12, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_7] -{ 0x0990, 0x009F, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC13, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_8] -{ 0x0990, 0x00B0, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC14, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_9] -{ 0x0990, 0x00BD, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC15, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_10] -{ 0x0990, 0x00C9, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC16, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_11] -{ 0x0990, 0x00D3, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC17, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_12] -{ 0x0990, 0x00DC, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC18, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_13] -{ 0x0990, 0x00E3, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC19, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_14] -{ 0x0990, 0x00EA, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC1A, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_15] -{ 0x0990, 0x00F0, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC1B, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_16] -{ 0x0990, 0x00F5, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC1C, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_17] -{ 0x0990, 0x00FA, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0xBC1D, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_18] -{ 0x0990, 0x00FF, WORD_LEN, 0 }, // MCU_DATA_0 -{ 0x098E, 0x8400, WORD_LEN, 0 }, // MCU_ADDRESS [SEQ_CMD] -{ 0x0990, 0x0006, WORD_LEN, 0 }, // MCU_DATA_0 - -{ SEQUENCE_WAIT_MS,200, WORD_LEN, 0}, - -{ 0x098E, 0x8400, WORD_LEN, 0 }, // MCU_ADDRESS [SEQ_CMD] -{ 0x0990, 0x0005, WORD_LEN, 0 }, // MCU_DATA_0 - -#else -{0x001A, 0x0219, WORD_LEN, 0 }, // RESET_AND_MISC_CONTROL -{0x001A, 0x0018, WORD_LEN, 0 }, // RESET_AND_MISC_CONTROL -{0x0014, 0x2425, WORD_LEN, 0 }, // PLL_CONTROL -{0x0014, 0x2425, WORD_LEN, 0 }, // PLL_CONTROL -{0x0014, 0x2145, WORD_LEN, 0 }, // PLL_CONTROL - -{0x0010, 0x0110, WORD_LEN, 0 }, // PLL_DIVIDERS//31E -{0x0012, 0x0070, WORD_LEN, 0 }, // PLL_P_DIVIDERS//E0 -{0x002A, 0x77BB, WORD_LEN, 0 }, // PLL_P4_P5_P6_DIVIDERS//7EFF -{0x001A, 0x0218, WORD_LEN, 0 }, // RESET_AND_MISC_CONTROL - -{0x0014, 0x2545, WORD_LEN, 0 }, // PLL_CONTROL -{0x0014, 0x2547, WORD_LEN, 0 }, // PLL_CONTROL -{0x0014, 0x2447, WORD_LEN, 0 }, // PLL_CONTROL -{0x0014, 0x2047, WORD_LEN, 0 }, // PLL_CONTROL - -{SEQUENCE_WAIT_MS,50, WORD_LEN, 0}, -// POLL PLL_CONTROL::PLL_LOCK => 0x01 -{0x0014, 0x2046, WORD_LEN, 0 }, // PLL_CONTROL -{0x0022, 0x01E0, WORD_LEN, 0 }, // VDD_DIS_COUNTER//208 -{0x001E, 0x0777, WORD_LEN, 0 }, // PAD_SLEW_PAD_CONFIG -//{0x001E, 0x0700, WORD_LEN, 0 }, // PAD_SLEW_PAD_CONFIG -{0x0016, 0x0400, WORD_LEN, 0 }, // CLOCKS_CONTROL -{0x001E, 0x0777, WORD_LEN, 0 }, // PAD_SLEW_PAD_CONFIG -//{0x001E, 0x0700, WORD_LEN, 0 }, // PAD_SLEW_PAD_CONFIG -{0x0018, 0x402D, WORD_LEN, 0 }, // STANDBY_CONTROL_AND_STATUS -{0x0018, 0x402C, WORD_LEN, 0 }, // STANDBY_CONTROL_AND_STATUS - -{0x001e,0x0006, WORD_LEN, 0 }, //adjust slew rate to minimize EMI -{SEQUENCE_WAIT_MS,100, WORD_LEN, 0}, - -// POLL STANDBY_CONTROL_AND_STATUS::STANDBY_DONE => 0x00 -//{0x098E, 0x6006, WORD_LEN, 0 }, // MCU_ADDRESS -//{0x0990, 0x007A, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x6800, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0320, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x6802, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0258, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE88E, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x68A0, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x082D, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4802, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4804, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4806, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x060D, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4808, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x080D, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x480A, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0111, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x480C, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x046C, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x480F, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x00CC, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4811, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0381, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4813, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x024F, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x481D, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x03BE, WORD_LEN, 0 }, // MCU_DATA_0//35C -{0x098E, 0x481F, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x05D0, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4825, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x07AC, WORD_LEN, 0 }, // MCU_DATA_0//85E -//{0x098E, 0x482B, WORD_LEN, 0 }, // MCU_ADDRESS// -//{0x0990, 0x0408, WORD_LEN, 0 }, // MCU_DATA_0// -//{0x098E, 0x482D, WORD_LEN, 0 }, // MCU_ADDRESS// -//{0x0990, 0x0308, WORD_LEN, 0 }, // MCU_DATA_0// -/*300w capture*/ -{0x098E, 0x6C00, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0800, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x6C02, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0600, WORD_LEN, 0 }, // MCU_DATA_0 - -{0x098E, 0xEC8E, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x6CA0, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x082D, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x484A, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0004, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x484C, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0004, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x484E, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x060B, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4850, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x080B, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4852, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0111, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4854, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0024, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4857, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x008C, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4859, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x01F1, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x485B, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x00FF, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4865, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x067C, WORD_LEN, 0 }, // MCU_DATA_0//687 -{0x098E, 0x4867, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0378, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x486D, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0BAC, WORD_LEN, 0 }, // MCU_DATA_0//103B -{0x098E, 0x4873, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0808, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4875, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0608, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC8A5, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0021, WORD_LEN, 0 }, // MCU_DATA_0//001E -{0x098E, 0xC8A6, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0023, WORD_LEN, 0 }, // MCU_DATA_0//0020 -{0x098E, 0xC8A7, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0027, WORD_LEN, 0 }, // MCU_DATA_0//25 -{0x098E, 0xC8A8, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0029, WORD_LEN, 0 }, // MCU_DATA_0//27 -{0x098E, 0xC844, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x00A3, WORD_LEN, 0 }, // MCU_DATA_0//72 -{0x098E, 0xC92F, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC845, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0088, WORD_LEN, 0 }, // MCU_DATA_0//5F -{0x098E, 0xC92D, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC88C, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x006B, WORD_LEN, 0 }, // MCU_DATA_0//3B -{0x098E, 0xC930, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC88D, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0059, WORD_LEN, 0 }, // MCU_DATA_0//31 -{0x098E, 0xC92E, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xB825, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0004, WORD_LEN, 0 }, // MCU_DATA_0//0003 -{0x098E, 0xA009, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0002, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xA00A, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0003, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xA00C, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x000A, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4846, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x68AA, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x021E, WORD_LEN, 0 }, // MCU_DATA_0//24C -{0x098E, 0x6815, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0006, WORD_LEN, 0 }, // MCU_DATA_0//0008 -{0x098E, 0x6817, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0007, WORD_LEN, 0 }, // MCU_DATA_0//0009 -{0x098E, 0x682D, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0006, WORD_LEN, 0 }, // MCU_DATA_0//0008 -{0x098E, 0x488E, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x6CAA, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x016E, WORD_LEN, 0 }, // MCU_DATA_0//0058 -{0x098E, 0x8400, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0006, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x8400, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0005, WORD_LEN, 0 }, // MCU_DATA_0 -{0x3C20, 0x0000, WORD_LEN, 0 }, // TX_SS_CONTROL -/* -{0x364A, 0x7D2F, WORD_LEN, 0 }, // P_R_P0Q0 -{0x364C, 0x79EB, WORD_LEN, 0 }, // P_R_P0Q1 -{0x364E, 0x18D2, WORD_LEN, 0 }, // P_R_P0Q2 -{0x3650, 0x9F8F, WORD_LEN, 0 }, // P_R_P0Q3 -{0x3652, 0xA7D2, WORD_LEN, 0 }, // P_R_P0Q4 -{0x368A, 0x460C, WORD_LEN, 0 }, // P_R_P1Q0 -{0x368C, 0x14F0, WORD_LEN, 0 }, // P_R_P1Q1 -{0x368E, 0x946F, WORD_LEN, 0 }, // P_R_P1Q2 -{0x3690, 0xC471, WORD_LEN, 0 }, // P_R_P1Q3 -{0x3692, 0x04B1, WORD_LEN, 0 }, // P_R_P1Q4 -{0x36CA, 0x0433, WORD_LEN, 0 }, // P_R_P2Q0 -{0x36CC, 0x680D, WORD_LEN, 0 }, // P_R_P2Q1 -{0x36CE, 0xEEF3, WORD_LEN, 0 }, // P_R_P2Q2 -{0x36D0, 0x4850, WORD_LEN, 0 }, // P_R_P2Q3 -{0x36D2, 0xF233, WORD_LEN, 0 }, // P_R_P2Q4 -{0x370A, 0xB2AF, WORD_LEN, 0 }, // P_R_P3Q0 -{0x370C, 0x2CF0, WORD_LEN, 0 }, // P_R_P3Q1 -{0x370E, 0x3F10, WORD_LEN, 0 }, // P_R_P3Q2 -{0x3710, 0xC673, WORD_LEN, 0 }, // P_R_P3Q3 -{0x3712, 0xA972, WORD_LEN, 0 }, // P_R_P3Q4 -{0x374A, 0x0590, WORD_LEN, 0 }, // P_R_P4Q0 -{0x374C, 0xAFB3, WORD_LEN, 0 }, // P_R_P4Q1 -{0x374E, 0x93D7, WORD_LEN, 0 }, // P_R_P4Q2 -{0x3750, 0x8D12, WORD_LEN, 0 }, // P_R_P4Q3 -{0x3752, 0x2539, WORD_LEN, 0 }, // P_R_P4Q4 -{0x3640, 0x0350, WORD_LEN, 0 }, // P_G1_P0Q0 -{0x3642, 0x322C, WORD_LEN, 0 }, // P_G1_P0Q1 -{0x3644, 0x77D1, WORD_LEN, 0 }, // P_G1_P0Q2 -{0x3646, 0xA26F, WORD_LEN, 0 }, // P_G1_P0Q3 -{0x3648, 0xC872, WORD_LEN, 0 }, // P_G1_P0Q4 -{0x3680, 0x0C4C, WORD_LEN, 0 }, // P_G1_P1Q0 -{0x3682, 0x9510, WORD_LEN, 0 }, // P_G1_P1Q1 -{0x3684, 0x110E, WORD_LEN, 0 }, // P_G1_P1Q2 -{0x3686, 0x4331, WORD_LEN, 0 }, // P_G1_P1Q3 -{0x3688, 0xC1CF, WORD_LEN, 0 }, // P_G1_P1Q4 -{0x36C0, 0x6152, WORD_LEN, 0 }, // P_G1_P2Q0 -{0x36C2, 0x038E, WORD_LEN, 0 }, // P_G1_P2Q1 -{0x36C4, 0x9AF4, WORD_LEN, 0 }, // P_G1_P2Q2 -{0x36C6, 0xE12F, WORD_LEN, 0 }, // P_G1_P2Q3 -{0x36C8, 0x09F3, WORD_LEN, 0 }, // P_G1_P2Q4 -{0x3700, 0xC5AF, WORD_LEN, 0 }, // P_G1_P3Q0 -{0x3702, 0xCA90, WORD_LEN, 0 }, // P_G1_P3Q1 -{0x3704, 0x5D0F, WORD_LEN, 0 }, // P_G1_P3Q2 -{0x3706, 0x3293, WORD_LEN, 0 }, // P_G1_P3Q3 -{0x3708, 0x2B92, WORD_LEN, 0 }, // P_G1_P3Q4 -{0x3740, 0xC590, WORD_LEN, 0 }, // P_G1_P4Q0 -{0x3742, 0x8133, WORD_LEN, 0 }, // P_G1_P4Q1 -{0x3744, 0xE0F6, WORD_LEN, 0 }, // P_G1_P4Q2 -{0x3746, 0x0254, WORD_LEN, 0 }, // P_G1_P4Q3 -{0x3748, 0x10B9, WORD_LEN, 0 }, // P_G1_P4Q4 -{0x3654, 0x7F8F, WORD_LEN, 0 }, // P_B_P0Q0 -{0x3656, 0x6F6C, WORD_LEN, 0 }, // P_B_P0Q1 -{0x3658, 0x5971, WORD_LEN, 0 }, // P_B_P0Q2 -{0x365A, 0x9A0F, WORD_LEN, 0 }, // P_B_P0Q3 -{0x365C, 0xA1B2, WORD_LEN, 0 }, // P_B_P0Q4 -{0x3694, 0xB00C, WORD_LEN, 0 }, // P_B_P1Q0 -{0x3696, 0xEBCF, WORD_LEN, 0 }, // P_B_P1Q1 -{0x3698, 0x06AD, WORD_LEN, 0 }, // P_B_P1Q2 -{0x369A, 0x4D31, WORD_LEN, 0 }, // P_B_P1Q3 -{0x369C, 0x2A4E, WORD_LEN, 0 }, // P_B_P1Q4 -{0x36D4, 0x4752, WORD_LEN, 0 }, // P_B_P2Q0 -{0x36D6, 0x724D, WORD_LEN, 0 }, // P_B_P2Q1 -{0x36D8, 0xAD34, WORD_LEN, 0 }, // P_B_P2Q2 -{0x36DA, 0x1350, WORD_LEN, 0 }, // P_B_P2Q3 -{0x36DC, 0x4E94, WORD_LEN, 0 }, // P_B_P2Q4 -{0x3714, 0xA06E, WORD_LEN, 0 }, // P_B_P3Q0 -{0x3716, 0x9152, WORD_LEN, 0 }, // P_B_P3Q1 -{0x3718, 0x1F53, WORD_LEN, 0 }, // P_B_P3Q2 -{0x371A, 0x3933, WORD_LEN, 0 }, // P_B_P3Q3 -{0x371C, 0xBA94, WORD_LEN, 0 }, // P_B_P3Q4 -{0x3754, 0x1233, WORD_LEN, 0 }, // P_B_P4Q0 -{0x3756, 0xA032, WORD_LEN, 0 }, // P_B_P4Q1 -{0x3758, 0xE936, WORD_LEN, 0 }, // P_B_P4Q2 -{0x375A, 0xBE34, WORD_LEN, 0 }, // P_B_P4Q3 -{0x375C, 0x02D9, WORD_LEN, 0 }, // P_B_P4Q4 -{0x365E, 0x7DEF, WORD_LEN, 0 }, // P_G2_P0Q0 -{0x3660, 0x434B, WORD_LEN, 0 }, // P_G2_P0Q1 -{0x3662, 0x69F1, WORD_LEN, 0 }, // P_G2_P0Q2 -{0x3664, 0x8A0F, WORD_LEN, 0 }, // P_G2_P0Q3 -{0x3666, 0xBDB2, WORD_LEN, 0 }, // P_G2_P0Q4 -{0x369E, 0x290D, WORD_LEN, 0 }, // P_G2_P1Q0 -{0x36A0, 0x42CF, WORD_LEN, 0 }, // P_G2_P1Q1 -{0x36A2, 0xDC6D, WORD_LEN, 0 }, // P_G2_P1Q2 -{0x36A4, 0x91B1, WORD_LEN, 0 }, // P_G2_P1Q3 -{0x36A6, 0x9DE9, WORD_LEN, 0 }, // P_G2_P1Q4 -{0x36DE, 0x70B2, WORD_LEN, 0 }, // P_G2_P2Q0 -{0x36E0, 0x02AC, WORD_LEN, 0 }, // P_G2_P2Q1 -{0x36E2, 0x9714, WORD_LEN, 0 }, // P_G2_P2Q2 -{0x36E4, 0xF3CF, WORD_LEN, 0 }, // P_G2_P2Q3 -{0x36E6, 0x6BD1, WORD_LEN, 0 }, // P_G2_P2Q4 -{0x371E, 0xE42E, WORD_LEN, 0 }, // P_G2_P3Q0 -{0x3720, 0x1D32, WORD_LEN, 0 }, // P_G2_P3Q1 -{0x3722, 0xCC31, WORD_LEN, 0 }, // P_G2_P3Q2 -{0x3724, 0xAE94, WORD_LEN, 0 }, // P_G2_P3Q3 -{0x3726, 0x6413, WORD_LEN, 0 }, // P_G2_P3Q4 -{0x375E, 0xE290, WORD_LEN, 0 }, // P_G2_P4Q0 -{0x3760, 0x8F53, WORD_LEN, 0 }, // P_G2_P4Q1 -{0x3762, 0xF936, WORD_LEN, 0 }, // P_G2_P4Q2 -{0x3764, 0x4614, WORD_LEN, 0 }, // P_G2_P4Q3 -{0x3766, 0x1B59, WORD_LEN, 0 }, // P_G2_P4Q4 -*/ - -{0x3784, 0x0404, WORD_LEN, 0 }, // CENTER_COLUMN -{0x3782, 0x0304, WORD_LEN, 0 }, // CENTER_ROW -{0x3210, 0x04B8, WORD_LEN, 0 }, // COLOR_PIPELINE_CONTROL -{0x098E, 0xC913, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_STAT_BRIGHTNESS_METRIC_PREDIVIDER] -{0x0990, 0x000A, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x686B, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_LL_START_BRIGHTNESS] -{0x0990, 0x05DC, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x686D, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_LL_STOP_BRIGHTNESS] -{0x0990, 0x0BB8, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x6C6B, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_LL_START_BRIGHTNESS] -{0x0990, 0x05DC, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x6C6D, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_LL_STOP_BRIGHTNESS] -{0x0990, 0x0BB8, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x3439, WORD_LEN, 0 }, // MCU_ADDRESS [AS_ASSTART_BRIGHTNESS] -{0x0990, 0x05DC, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x343B, WORD_LEN, 0 }, // MCU_ADDRESS [AS_ASSTOP_BRIGHTNESS] -{0x0990, 0x0BB8, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4926, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_START_GAMMA_BM] -{0x0990, 0x0001, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4928, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_MID_GAMMA_BM] -{0x0990, 0x0002, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x492A, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_STOP_GAMMA_BM] -{0x0990, 0x0656, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4D26, WORD_LEN, 0 }, // MCU_ADDRESS [CAM2_LL_START_GAMMA_BM] -{0x0990, 0x0001, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4D28, WORD_LEN, 0 }, // MCU_ADDRESS [CAM2_LL_MID_GAMMA_BM] -{0x0990, 0x0002, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4D2A, WORD_LEN, 0 }, // MCU_ADDRESS [CAM2_LL_STOP_GAMMA_BM] -{0x0990, 0x0656, WORD_LEN, 0 }, // MCU_DATA_0 -{0x33F4, 0x040B, WORD_LEN, 0 }, // KERNEL_CONFIG -{0x098E, 0xC916, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_LL_START_0] -{0x0990, 0x0014, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC919, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_LL_STOP_0] -{0x0990, 0x0028, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC917, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_LL_START_1] -{0x0990, 0x0004, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC918, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_LL_START_2] -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC91A, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_LL_STOP_1] -{0x0990, 0x0001, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC91B, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_LL_STOP_2] -{0x0990, 0x0009, WORD_LEN, 0 }, // MCU_DATA_0 -{0x326C, 0x0C00, WORD_LEN, 0 }, // APERTURE_PARAMETERS_2D -{0x098E, 0x494B, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_START_GAIN_METRIC] -{0x0990, 0x0042, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x494D, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_STOP_GAIN_METRIC] -{0x0990, 0x012C, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC91E, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_START_0] -{0x0990, 0x0012, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC91F, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_START_1] -{0x0990, 0x000A, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC920, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_START_2] -{0x0990, 0x0012, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC921, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_START_3] -{0x0990, 0x000A, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC922, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_STOP_0] -{0x0990, 0x0026, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC923, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_STOP_1] -{0x0990, 0x001E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC924, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_STOP_2] -{0x0990, 0x0026, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC925, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_STOP_3] -{0x0990, 0x0026, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC02, WORD_LEN, 0 }, // MCU_ADDRESS [LL_MODE] -{0x0990, 0x0003, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC05, WORD_LEN, 0 }, // MCU_ADDRESS [LL_CLUSTER_DC_TH] -{0x0990, 0x000E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x316C, 0x350F, WORD_LEN, 0 }, // DAC_TXLO -{0x098E, 0xC950, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_1] -{0x0990, 0x0064, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC94F, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_0] -{0x0990, 0x0038, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC952, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_3] -{0x0990, 0x0064, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC951, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_2] -{0x0990, 0x0051, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC954, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_5] -{0x0990, 0x0010, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC953, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_4] -{0x0990, 0x0020, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC956, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_7] -{0x0990, 0x0010, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC955, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_6] -{0x0990, 0x0020, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC958, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_1] -{0x0990, 0x0020, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC957, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_0] -{0x0990, 0x0014, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC95A, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_3] -{0x0990, 0x001D, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC959, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_2] -{0x0990, 0x0020, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC95C, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_5] -{0x0990, 0x000C, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC95B, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_4] -{0x0990, 0x0008, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC95E, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_7] -{0x0990, 0x000C, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC95D, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_6] -{0x0990, 0x0008, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC95F, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_WINDOW_PERCENT] -{0x0990, 0x0064, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48DC, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_0] -{0x0990, 0x004D, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48DE, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_1] -{0x0990, 0x0096, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48E0, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_2] -{0x0990, 0x001D, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48E2, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_3] -{0x0990, 0x004D, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48E4, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_4] -{0x0990, 0x0096, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48E6, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_5] -{0x0990, 0x001D, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48E8, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_6] -{0x0990, 0x004D, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48EA, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_7] -{0x0990, 0x0096, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48EC, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_8] -{0x0990, 0x001D, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xDC2A, WORD_LEN, 0 }, // MCU_ADDRESS [SYS_DELTA_GAIN] -{0x0990, 0x000B, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xDC2B, WORD_LEN, 0 }, // MCU_ADDRESS [SYS_DELTA_THRESH] -{0x0990, 0x0017, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC0B, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_0] -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC0C, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_1] -{0x0990, 0x001B, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC0D, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_2] -{0x0990, 0x002A, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC0E, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_3] -{0x0990, 0x003E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC0F, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_4] -{0x0990, 0x005A, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC10, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_5] -{0x0990, 0x0070, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC11, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_6] -{0x0990, 0x0081, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC12, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_7] -{0x0990, 0x0090, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC13, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_8] -{0x0990, 0x009E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC14, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_9] -{0x0990, 0x00AB, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC15, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_10] -{0x0990, 0x00B6, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC16, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_11] -{0x0990, 0x00C1, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC17, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_12] -{0x0990, 0x00CB, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC18, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_13] -{0x0990, 0x00D5, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC19, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_14] -{0x0990, 0x00DE, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC1A, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_15] -{0x0990, 0x00E7, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC1B, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_16] -{0x0990, 0x00EF, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC1C, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_17] -{0x0990, 0x00F7, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC1D, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_18] -{0x0990, 0x00FF, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC1E, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_0] -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC1F, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_1] -{0x0990, 0x001B, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC20, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_2] -{0x0990, 0x002A, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC21, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_3] -{0x0990, 0x003E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC22, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_4] -{0x0990, 0x005A, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC23, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_5] -{0x0990, 0x0070, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC24, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_6] -{0x0990, 0x0081, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC25, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_7] -{0x0990, 0x0090, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC26, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_8] -{0x0990, 0x009E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC27, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_9] -{0x0990, 0x00AB, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC28, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_10] -{0x0990, 0x00B6, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC29, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_11] -{0x0990, 0x00C1, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC2A, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_12] -{0x0990, 0x00CB, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC2B, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_13] -{0x0990, 0x00D5, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC2C, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_14] -{0x0990, 0x00DE, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC2D, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_15] -{0x0990, 0x00E7, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC2E, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_16] -{0x0990, 0x00EF, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC2F, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_17] -{0x0990, 0x00F7, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC30, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_18] -{0x0990, 0x00FF, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC31, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_0] -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC32, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_1] -{0x0990, 0x000D, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC33, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_2] -{0x0990, 0x0019, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC34, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_3] -{0x0990, 0x0030, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC35, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_4] -{0x0990, 0x0056, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC36, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_5] -{0x0990, 0x0070, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC37, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_6] -{0x0990, 0x0081, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC38, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_7] -{0x0990, 0x0090, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC39, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_8] -{0x0990, 0x009E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC3A, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_9] -{0x0990, 0x00AB, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC3B, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_10] -{0x0990, 0x00B6, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC3C, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_11] -{0x0990, 0x00C1, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC3D, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_12] -{0x0990, 0x00CB, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC3E, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_13] -{0x0990, 0x00D5, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC3F, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_14] -{0x0990, 0x00DE, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC40, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_15] -{0x0990, 0x00E7, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC41, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_16] -{0x0990, 0x00EF, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC42, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_17] -{0x0990, 0x00F7, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC43, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_18] -{0x0990, 0x00FF, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x6865, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_LL_ALGO_ENTER] -{0x0990, 0x00E0, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x6867, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_LL_ALGO_RUN] -{0x0990, 0x00F4, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x8400, WORD_LEN, 0 }, // MCU_ADDRESS [SEQ_CMD] -{0x0990, 0x0006, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC4A, WORD_LEN, 0 }, // MCU_ADDRESS [LL_TONAL_CURVE_HIGH] -{0x0990, 0x007F, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC4B, WORD_LEN, 0 }, // MCU_ADDRESS [LL_TONAL_CURVE_MED] -{0x0990, 0x007F, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC4C, WORD_LEN, 0 }, // MCU_ADDRESS [LL_TONAL_CURVE_LOW] -{0x0990, 0x007F, WORD_LEN, 0 }, // MCU_DATA_0 -{0x3542, 0x0010, WORD_LEN, 0 }, // TONAL_X0 -{0x3544, 0x0030, WORD_LEN, 0 }, // TONAL_X1 -{0x3546, 0x0040, WORD_LEN, 0 }, // TONAL_X2 -{0x3548, 0x0080, WORD_LEN, 0 }, // TONAL_X3 -{0x354A, 0x0100, WORD_LEN, 0 }, // TONAL_X4 -{0x354C, 0x0200, WORD_LEN, 0 }, // TONAL_X5 -{0x354E, 0x0300, WORD_LEN, 0 }, // TONAL_X6 -{0x3550, 0x0010, WORD_LEN, 0 }, // TONAL_Y0 -{0x3552, 0x0030, WORD_LEN, 0 }, // TONAL_Y1 -{0x3554, 0x0040, WORD_LEN, 0 }, // TONAL_Y2 -{0x3556, 0x0080, WORD_LEN, 0 }, // TONAL_Y3 -{0x3558, 0x012C, WORD_LEN, 0 }, // TONAL_Y4 -{0x355A, 0x0320, WORD_LEN, 0 }, // TONAL_Y5 -{0x355C, 0x03E8, WORD_LEN, 0 }, // TONAL_Y6 -{0x3560, 0x0040, WORD_LEN, 0 }, // RECIPROCAL_OF_X0_MINUS_ZERO -{0x3562, 0x0020, WORD_LEN, 0 }, // RECIPROCAL_OF_X1_MINUS_X0 -{0x3564, 0x0040, WORD_LEN, 0 }, // RECIPROCAL_OF_X2_MINUS_X1 -{0x3566, 0x0010, WORD_LEN, 0 }, // RECIPROCAL_OF_X3_MINUS_X2 -{0x3568, 0x0008, WORD_LEN, 0 }, // RECIPROCAL_OF_X4_MINUS_X3 -{0x356A, 0x0004, WORD_LEN, 0 }, // RECIPROCAL_OF_X5_MINUS_X4 -{0x356C, 0x0004, WORD_LEN, 0 }, // RECIPROCAL_OF_X6_MINUS_X5 -{0x356E, 0x0004, WORD_LEN, 0 }, // RECIPROCAL_OF_400_MINUS_X6 -{0x098E, 0x3C4D, WORD_LEN, 0 }, // MCU_ADDRESS [LL_START_GAMMA_FTB] -{0x0990, 0x0DAC, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x3C4F, WORD_LEN, 0 }, // MCU_ADDRESS [LL_STOP_GAMMA_FTB] -{0x0990, 0x148A, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC911, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_STAT_LUMA_THRESH_HIGH] -{0x0990, 0x00C8, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC8F4, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_XSCALE] -{0x0990, 0x0004, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC8F5, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_YSCALE] -{0x0990, 0x0002, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48F6, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_0] -{0x0990, 0x3B4D, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48F8, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_1] -{0x0990, 0x6380, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48FA, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_2] -{0x0990, 0x9B18, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48FC, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_3] -{0x0990, 0x5D51, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48FE, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_4] -{0x0990, 0xEDE8, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4900, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_5] -{0x0990, 0xE515, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4902, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_6] -{0x0990, 0xBFF4, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4904, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_7] -{0x0990, 0x001E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4906, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_XSHIFT_PRE_ADJ] -{0x0990, 0x0026, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4908, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_YSHIFT_PRE_ADJ] -{0x0990, 0x0033, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE84A, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AWB_K_R_L] -{0x0990, 0x0083, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE84D, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AWB_K_R_R] -{0x0990, 0x0083, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE84C, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AWB_K_B_L] -{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE84F, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AWB_K_B_R] -{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x8400, WORD_LEN, 0 }, // MCU_ADDRESS [SEQ_CMD] -{0x0990, 0x0006, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48B0, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_0] -{0x0990, 0x0180, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48B2, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_1] -{0x0990, 0xFF7A, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48B4, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_2] -{0x0990, 0x0018, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48B6, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_3] -{0x0990, 0xFFCA, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48B8, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_4] -{0x0990, 0x017C, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48BA, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_5] -{0x0990, 0xFFCC, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48BC, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_6] -{0x0990, 0x000C, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48BE, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_7] -{0x0990, 0xFF1F, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48C0, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_8] -{0x0990, 0x01E8, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48C2, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_9] -{0x0990, 0x0020, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48C4, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_10] -{0x0990, 0x0044, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48C6, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_0] -{0x0990, 0x0079, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48C8, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_1] -{0x0990, 0xFFAD, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48CA, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_2] -{0x0990, 0xFFE2, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48CC, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_3] -{0x0990, 0x0033, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48CE, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_4] -{0x0990, 0x002A, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48D0, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_5] -{0x0990, 0xFFAA, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48D2, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_6] -{0x0990, 0x0017, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48D4, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_7] -{0x0990, 0x004B, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48D6, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_8] -{0x0990, 0xFFA5, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48D8, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_9] -{0x0990, 0x0015, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48DA, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_10] -{0x0990, 0xFFE2, WORD_LEN, 0 }, // MCU_DATA_0 -{0x35A2, 0x0014, WORD_LEN, 0 }, // DARK_COLOR_KILL_CONTROLS -{0x098E, 0xC949, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_SYS_DARK_COLOR_KILL] -{0x0990, 0x0024, WORD_LEN, 0 }, // MCU_DATA_0 -{0x35A4, 0x0596, WORD_LEN, 0 }, // BRIGHT_COLOR_KILL_CONTROLS -{0x098E, 0xC94A, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_SYS_BRIGHT_COLORKILL] -{0x0990, 0x0062, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC948, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_SYS_UV_COLOR_BOOST] -{0x0990, 0x0006, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC914, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_START_DESATURATION] -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC915, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_END_DESATURATION] -{0x0990, 0x00FF, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE86F, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_LL_START_SATURATION] -{0x0990, 0x0060, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE870, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_LL_END_SATURATION] -{0x0990, 0x003C, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xEC6F, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_LL_START_SATURATION] -{0x0990, 0x0060, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xEC70, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_LL_END_SATURATION] -{0x0990, 0x003C, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE883, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SELECT_FX] -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xEC83, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SELECT_FX] -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x8400, WORD_LEN, 0 }, // MCU_ADDRESS [SEQ_CMD] -{0x0990, 0x0006, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE885, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SEPIA_CR] -{0x0990, 0x001E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE886, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SEPIA_CB] -{0x0990, 0x00D8, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xEC85, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SEPIA_CR] -{0x0990, 0x001E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xEC86, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SEPIA_CB] -{0x0990, 0x00D8, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE884, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SOLARIZATION_TH] -{0x0990, 0x005C, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xEC84, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SOLARIZATION_TH] -{0x0990, 0x005C, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x490A, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AS_INTEG_SCALE_FIRST_PASS] -{0x0990, 0x0666, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x490C, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AS_MIN_INT_TIME_FIRST_PASS] -{0x0990, 0x0140, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x6857, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_IS_FEATURE_THRESHOLD] -{0x0990, 0x0014, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x685C, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_IS_BLUR_INPUT_PARAMETER] -{0x0990, 0x0005, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x490E, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AS_MAX_DIGITAL_GAIN_ALLOWED] -{0x0990, 0x00A4, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xB43D, WORD_LEN, 0 }, // MCU_ADDRESS [AS_START_ASVALUES_0] -{0x0990, 0x0031, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xB43E, WORD_LEN, 0 }, // MCU_ADDRESS [AS_START_ASVALUES_1] -{0x0990, 0x001B, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xB43F, WORD_LEN, 0 }, // MCU_ADDRESS [AS_START_ASVALUES_2] -{0x0990, 0x0028, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xB440, WORD_LEN, 0 }, // MCU_ADDRESS [AS_START_ASVALUES_3] -{0x0990, 0x0003, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xB441, WORD_LEN, 0 }, // MCU_ADDRESS [AS_STOP_ASVALUES_0] -{0x0990, 0x00CD, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xB442, WORD_LEN, 0 }, // MCU_ADDRESS [AS_STOP_ASVALUES_1] -{0x0990, 0x0064, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xB443, WORD_LEN, 0 }, // MCU_ADDRESS [AS_STOP_ASVALUES_2] -{0x0990, 0x000F, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xB444, WORD_LEN, 0 }, // MCU_ADDRESS [AS_STOP_ASVALUES_3] -{0x0990, 0x0007, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x300D, WORD_LEN, 0 }, // MCU_ADDRESS [AF_FILTERS] -{0x0990, 0x000F, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x3017, WORD_LEN, 0 }, // MCU_ADDRESS [AF_THRESHOLDS] -{0x0990, 0x0F0F, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x8400, WORD_LEN, 0 }, // MCU_ADDRESS [SEQ_CMD] -{0x0990, 0x0006, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE81F, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AE_RULE_BASE_TARGET] -{0x0990, 0x0020, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x68A0, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_JPEG_OB_TX_CONTROL_VAR] -{0x0990, 0x082E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x6CA0, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_JPEG_OB_TX_CONTROL_VAR] -{0x0990, 0x082E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x70A0, WORD_LEN, 0 }, // MCU_ADDRESS [SEC_A_CONFIG_JPEG_OB_TX_CONTROL_VAR] -{0x0990, 0x082E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x74A0, WORD_LEN, 0 }, // MCU_ADDRESS [SEC_B_CONFIG_JPEG_OB_TX_CONTROL_VAR] -{0x0990, 0x082E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x3C52, 0x002E, WORD_LEN, 0 }, // RESERVED_TX_SS_3C52//02e -{0x098E, 0x488E, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_CTX_B_RX_FIFO_TRIGGER_MARK] -{0x0990, 0x0020, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xECAC, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_IO_OB_MANUAL_FLAG] -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x3084, 0x2409, WORD_LEN, 0 }, // RESERVED_CORE_3084 -{0x3092, 0x0A49, WORD_LEN, 0 }, // RESERVED_CORE_3092 -{0x3094, 0x4949, WORD_LEN, 0 }, // RESERVED_CORE_3094 -{0x3096, 0x4950, WORD_LEN, 0 }, // RESERVED_CORE_3096 - -{0x0982, 0x0000, WORD_LEN, 0 }, // ACCESS_CTL_STAT -{0x098A, 0x0CFB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x3C3C, WORD_LEN, 0 }, -{0x0992, 0x3C3C, WORD_LEN, 0 }, -{0x0994, 0x3C3C, WORD_LEN, 0 }, -{0x0996, 0x5F4F, WORD_LEN, 0 }, -{0x0998, 0x30ED, WORD_LEN, 0 }, -{0x099A, 0x0AED, WORD_LEN, 0 }, -{0x099C, 0x08BD, WORD_LEN, 0 }, -{0x099E, 0x61D5, WORD_LEN, 0 }, -{0x098A, 0x0D0B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xCE04, WORD_LEN, 0 }, -{0x0992, 0xCD1F, WORD_LEN, 0 }, -{0x0994, 0x1702, WORD_LEN, 0 }, -{0x0996, 0x11CC, WORD_LEN, 0 }, -{0x0998, 0x332E, WORD_LEN, 0 }, -{0x099A, 0x30ED, WORD_LEN, 0 }, -{0x099C, 0x02CC, WORD_LEN, 0 }, -{0x099E, 0xFFFD, WORD_LEN, 0 }, -{0x098A, 0x0D1B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xED00, WORD_LEN, 0 }, -{0x0992, 0xCC00, WORD_LEN, 0 }, -{0x0994, 0x02BD, WORD_LEN, 0 }, -{0x0996, 0x706D, WORD_LEN, 0 }, -{0x0998, 0x18DE, WORD_LEN, 0 }, -{0x099A, 0x1F18, WORD_LEN, 0 }, -{0x099C, 0x1F8E, WORD_LEN, 0 }, -{0x099E, 0x0110, WORD_LEN, 0 }, -{0x098A, 0x0D2B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xCC3C, WORD_LEN, 0 }, -{0x0992, 0x5230, WORD_LEN, 0 }, -{0x0994, 0xED00, WORD_LEN, 0 }, -{0x0996, 0x18EC, WORD_LEN, 0 }, -{0x0998, 0xA0C4, WORD_LEN, 0 }, -{0x099A, 0xFDBD, WORD_LEN, 0 }, -{0x099C, 0x7021, WORD_LEN, 0 }, -{0x099E, 0x201E, WORD_LEN, 0 }, -{0x098A, 0x0D3B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xCC3C, WORD_LEN, 0 }, -{0x0992, 0x5230, WORD_LEN, 0 }, -{0x0994, 0xED00, WORD_LEN, 0 }, -{0x0996, 0xDE1F, WORD_LEN, 0 }, -{0x0998, 0xECA0, WORD_LEN, 0 }, -{0x099A, 0xBD70, WORD_LEN, 0 }, -{0x099C, 0x21CC, WORD_LEN, 0 }, -{0x099E, 0x3C52, WORD_LEN, 0 }, -{0x098A, 0x0D4B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x30ED, WORD_LEN, 0 }, -{0x0992, 0x02CC, WORD_LEN, 0 }, -{0x0994, 0xFFFC, WORD_LEN, 0 }, -{0x0996, 0xED00, WORD_LEN, 0 }, -{0x0998, 0xCC00, WORD_LEN, 0 }, -{0x099A, 0x02BD, WORD_LEN, 0 }, -{0x099C, 0x706D, WORD_LEN, 0 }, -{0x099E, 0xFC04, WORD_LEN, 0 }, -{0x098A, 0x0D5B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xE11A, WORD_LEN, 0 }, -{0x0992, 0x8300, WORD_LEN, 0 }, -{0x0994, 0x0127, WORD_LEN, 0 }, -{0x0996, 0x201A, WORD_LEN, 0 }, -{0x0998, 0x8300, WORD_LEN, 0 }, -{0x099A, 0x0427, WORD_LEN, 0 }, -{0x099C, 0x221A, WORD_LEN, 0 }, -{0x099E, 0x8300, WORD_LEN, 0 }, -{0x098A, 0x0D6B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0827, WORD_LEN, 0 }, -{0x0992, 0x241A, WORD_LEN, 0 }, -{0x0994, 0x8300, WORD_LEN, 0 }, -{0x0996, 0x1027, WORD_LEN, 0 }, -{0x0998, 0x261A, WORD_LEN, 0 }, -{0x099A, 0x8300, WORD_LEN, 0 }, -{0x099C, 0x2027, WORD_LEN, 0 }, -{0x099E, 0x281A, WORD_LEN, 0 }, -{0x098A, 0x0D7B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x8300, WORD_LEN, 0 }, -{0x0992, 0x4027, WORD_LEN, 0 }, -{0x0994, 0x2A20, WORD_LEN, 0 }, -{0x0996, 0x2ECC, WORD_LEN, 0 }, -{0x0998, 0x001E, WORD_LEN, 0 }, -{0x099A, 0x30ED, WORD_LEN, 0 }, -{0x099C, 0x0A20, WORD_LEN, 0 }, -{0x099E, 0x26CC, WORD_LEN, 0 }, -{0x098A, 0x0D8B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0022, WORD_LEN, 0 }, -{0x0992, 0x30ED, WORD_LEN, 0 }, -{0x0994, 0x0A20, WORD_LEN, 0 }, -{0x0996, 0x1ECC, WORD_LEN, 0 }, -{0x0998, 0x0021, WORD_LEN, 0 }, -{0x099A, 0x30ED, WORD_LEN, 0 }, -{0x099C, 0x0A20, WORD_LEN, 0 }, -{0x099E, 0x16CC, WORD_LEN, 0 }, -{0x098A, 0x0D9B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0020, WORD_LEN, 0 }, -{0x0992, 0x30ED, WORD_LEN, 0 }, -{0x0994, 0x0A20, WORD_LEN, 0 }, -{0x0996, 0x0ECC, WORD_LEN, 0 }, -{0x0998, 0x002A, WORD_LEN, 0 }, -{0x099A, 0x30ED, WORD_LEN, 0 }, -{0x099C, 0x0A20, WORD_LEN, 0 }, -{0x099E, 0x06CC, WORD_LEN, 0 }, -{0x098A, 0x0DAB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x002B, WORD_LEN, 0 }, -{0x0992, 0x30ED, WORD_LEN, 0 }, -{0x0994, 0x0ACC, WORD_LEN, 0 }, -{0x0996, 0x3400, WORD_LEN, 0 }, -{0x0998, 0x30ED, WORD_LEN, 0 }, -{0x099A, 0x0034, WORD_LEN, 0 }, -{0x099C, 0xBD6F, WORD_LEN, 0 }, -{0x099E, 0xD184, WORD_LEN, 0 }, -{0x098A, 0x0DBB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0330, WORD_LEN, 0 }, -{0x0992, 0xED07, WORD_LEN, 0 }, -{0x0994, 0xA60C, WORD_LEN, 0 }, -{0x0996, 0x4848, WORD_LEN, 0 }, -{0x0998, 0x5FED, WORD_LEN, 0 }, -{0x099A, 0x05EC, WORD_LEN, 0 }, -{0x099C, 0x07EA, WORD_LEN, 0 }, -{0x099E, 0x06AA, WORD_LEN, 0 }, -{0x098A, 0x0DCB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0531, WORD_LEN, 0 }, -{0x0992, 0xBD70, WORD_LEN, 0 }, -{0x0994, 0x21DE, WORD_LEN, 0 }, -{0x0996, 0x1F1F, WORD_LEN, 0 }, -{0x0998, 0x8E01, WORD_LEN, 0 }, -{0x099A, 0x08EC, WORD_LEN, 0 }, -{0x099C, 0x9B05, WORD_LEN, 0 }, -{0x099E, 0x30ED, WORD_LEN, 0 }, -{0x098A, 0x0DDB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0820, WORD_LEN, 0 }, -{0x0992, 0x3BDE, WORD_LEN, 0 }, -{0x0994, 0x1FEC, WORD_LEN, 0 }, -{0x0996, 0x0783, WORD_LEN, 0 }, -{0x0998, 0x0040, WORD_LEN, 0 }, -{0x099A, 0x2628, WORD_LEN, 0 }, -{0x099C, 0x7F30, WORD_LEN, 0 }, -{0x099E, 0xC4CC, WORD_LEN, 0 }, -{0x098A, 0x0DEB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x3C68, WORD_LEN, 0 }, -{0x0992, 0xBD6F, WORD_LEN, 0 }, -{0x0994, 0xD1FD, WORD_LEN, 0 }, -{0x0996, 0x30C5, WORD_LEN, 0 }, -{0x0998, 0xCC01, WORD_LEN, 0 }, -{0x099A, 0xF4FD, WORD_LEN, 0 }, -{0x099C, 0x30C7, WORD_LEN, 0 }, -{0x099E, 0xC640, WORD_LEN, 0 }, -{0x098A, 0x0DFB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xF730, WORD_LEN, 0 }, -{0x0992, 0xC4CC, WORD_LEN, 0 }, -{0x0994, 0x0190, WORD_LEN, 0 }, -{0x0996, 0xFD30, WORD_LEN, 0 }, -{0x0998, 0xC501, WORD_LEN, 0 }, -{0x099A, 0x0101, WORD_LEN, 0 }, -{0x099C, 0xFC30, WORD_LEN, 0 }, -{0x099E, 0xC230, WORD_LEN, 0 }, -{0x098A, 0x0E0B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xED08, WORD_LEN, 0 }, -{0x0992, 0x200A, WORD_LEN, 0 }, -{0x0994, 0xCC3C, WORD_LEN, 0 }, -{0x0996, 0x68BD, WORD_LEN, 0 }, -{0x0998, 0x6FD1, WORD_LEN, 0 }, -{0x099A, 0x0530, WORD_LEN, 0 }, -{0x099C, 0xED08, WORD_LEN, 0 }, -{0x099E, 0xCC34, WORD_LEN, 0 }, -{0x098A, 0x0E1B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x08ED, WORD_LEN, 0 }, -{0x0992, 0x00EC, WORD_LEN, 0 }, -{0x0994, 0x08BD, WORD_LEN, 0 }, -{0x0996, 0x7021, WORD_LEN, 0 }, -{0x0998, 0x30C6, WORD_LEN, 0 }, -{0x099A, 0x0C3A, WORD_LEN, 0 }, -{0x099C, 0x3539, WORD_LEN, 0 }, -{0x099E, 0x373C, WORD_LEN, 0 }, -{0x098A, 0x0E2B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x3C3C, WORD_LEN, 0 }, -{0x0992, 0x34DE, WORD_LEN, 0 }, -{0x0994, 0x2FEE, WORD_LEN, 0 }, -{0x0996, 0x0EAD, WORD_LEN, 0 }, -{0x0998, 0x007D, WORD_LEN, 0 }, -{0x099A, 0x13EF, WORD_LEN, 0 }, -{0x099C, 0x277C, WORD_LEN, 0 }, -{0x099E, 0xCE13, WORD_LEN, 0 }, -{0x098A, 0x0E3B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xE01E, WORD_LEN, 0 }, -{0x0992, 0x0510, WORD_LEN, 0 }, -{0x0994, 0x60E6, WORD_LEN, 0 }, -{0x0996, 0x0E4F, WORD_LEN, 0 }, -{0x0998, 0xC313, WORD_LEN, 0 }, -{0x099A, 0xF08F, WORD_LEN, 0 }, -{0x099C, 0xE600, WORD_LEN, 0 }, -{0x099E, 0x30E1, WORD_LEN, 0 }, -{0x098A, 0x0E4B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0722, WORD_LEN, 0 }, -{0x0992, 0x16F6, WORD_LEN, 0 }, -{0x0994, 0x13EE, WORD_LEN, 0 }, -{0x0996, 0x4FC3, WORD_LEN, 0 }, -{0x0998, 0x13F3, WORD_LEN, 0 }, -{0x099A, 0x8FE6, WORD_LEN, 0 }, -{0x099C, 0x0030, WORD_LEN, 0 }, -{0x099E, 0xE107, WORD_LEN, 0 }, -{0x098A, 0x0E5B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x2507, WORD_LEN, 0 }, -{0x0992, 0xF613, WORD_LEN, 0 }, -{0x0994, 0xEEC1, WORD_LEN, 0 }, -{0x0996, 0x0325, WORD_LEN, 0 }, -{0x0998, 0x3C7F, WORD_LEN, 0 }, -{0x099A, 0x13EE, WORD_LEN, 0 }, -{0x099C, 0xF613, WORD_LEN, 0 }, -{0x099E, 0xEFE7, WORD_LEN, 0 }, -{0x098A, 0x0E6B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x06CC, WORD_LEN, 0 }, -{0x0992, 0x13F0, WORD_LEN, 0 }, -{0x0994, 0xED04, WORD_LEN, 0 }, -{0x0996, 0xCC13, WORD_LEN, 0 }, -{0x0998, 0xF320, WORD_LEN, 0 }, -{0x099A, 0x0F7C, WORD_LEN, 0 }, -{0x099C, 0x13EE, WORD_LEN, 0 }, -{0x099E, 0xEC04, WORD_LEN, 0 }, -{0x098A, 0x0E7B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xC300, WORD_LEN, 0 }, -{0x0992, 0x01ED, WORD_LEN, 0 }, -{0x0994, 0x04EC, WORD_LEN, 0 }, -{0x0996, 0x02C3, WORD_LEN, 0 }, -{0x0998, 0x0001, WORD_LEN, 0 }, -{0x099A, 0xED02, WORD_LEN, 0 }, -{0x099C, 0xF613, WORD_LEN, 0 }, -{0x099E, 0xEEE1, WORD_LEN, 0 }, -{0x098A, 0x0E8B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0624, WORD_LEN, 0 }, -{0x0992, 0x12EE, WORD_LEN, 0 }, -{0x0994, 0x04E6, WORD_LEN, 0 }, -{0x0996, 0x0030, WORD_LEN, 0 }, -{0x0998, 0xE107, WORD_LEN, 0 }, -{0x099A, 0x22DF, WORD_LEN, 0 }, -{0x099C, 0xEE02, WORD_LEN, 0 }, -{0x099E, 0xE600, WORD_LEN, 0 }, -{0x098A, 0x0E9B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x30E1, WORD_LEN, 0 }, -{0x0992, 0x0725, WORD_LEN, 0 }, -{0x0994, 0xD6DE, WORD_LEN, 0 }, -{0x0996, 0x49EE, WORD_LEN, 0 }, -{0x0998, 0x08AD, WORD_LEN, 0 }, -{0x099A, 0x00CC, WORD_LEN, 0 }, -{0x099C, 0x13F6, WORD_LEN, 0 }, -{0x099E, 0x30ED, WORD_LEN, 0 }, -{0x098A, 0x0EAB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x00DE, WORD_LEN, 0 }, -{0x0992, 0x2FEE, WORD_LEN, 0 }, -{0x0994, 0x10CC, WORD_LEN, 0 }, -{0x0996, 0x13FA, WORD_LEN, 0 }, -{0x0998, 0xAD00, WORD_LEN, 0 }, -{0x099A, 0x3838, WORD_LEN, 0 }, -{0x099C, 0x3838, WORD_LEN, 0 }, -{0x099E, 0x3937, WORD_LEN, 0 }, -{0x098A, 0x0EBB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x363C, WORD_LEN, 0 }, -{0x0992, 0x3C3C, WORD_LEN, 0 }, -{0x0994, 0x5F4F, WORD_LEN, 0 }, -{0x0996, 0x30ED, WORD_LEN, 0 }, -{0x0998, 0x04EC, WORD_LEN, 0 }, -{0x099A, 0x06ED, WORD_LEN, 0 }, -{0x099C, 0x008F, WORD_LEN, 0 }, -{0x099E, 0xC300, WORD_LEN, 0 }, -{0x098A, 0x0ECB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x04BD, WORD_LEN, 0 }, -{0x0992, 0x0F43, WORD_LEN, 0 }, -{0x0994, 0x30EC, WORD_LEN, 0 }, -{0x0996, 0x04BD, WORD_LEN, 0 }, -{0x0998, 0x0F76, WORD_LEN, 0 }, -{0x099A, 0x30ED, WORD_LEN, 0 }, -{0x099C, 0x0238, WORD_LEN, 0 }, -{0x099E, 0x3838, WORD_LEN, 0 }, -{0x098A, 0x0EDB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x3839, WORD_LEN, 0 }, -{0x0992, 0x373C, WORD_LEN, 0 }, -{0x0994, 0x3C3C, WORD_LEN, 0 }, -{0x0996, 0x3C30, WORD_LEN, 0 }, -{0x0998, 0xE608, WORD_LEN, 0 }, -{0x099A, 0x2712, WORD_LEN, 0 }, -{0x099C, 0xC101, WORD_LEN, 0 }, -{0x099E, 0x2713, WORD_LEN, 0 }, -{0x098A, 0x0EEB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xC102, WORD_LEN, 0 }, -{0x0992, 0x2714, WORD_LEN, 0 }, -{0x0994, 0xC103, WORD_LEN, 0 }, -{0x0996, 0x2715, WORD_LEN, 0 }, -{0x0998, 0xC104, WORD_LEN, 0 }, -{0x099A, 0x2716, WORD_LEN, 0 }, -{0x099C, 0x2019, WORD_LEN, 0 }, -{0x099E, 0xCC30, WORD_LEN, 0 }, -{0x098A, 0x0EFB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x5E20, WORD_LEN, 0 }, -{0x0992, 0x12CC, WORD_LEN, 0 }, -{0x0994, 0x305A, WORD_LEN, 0 }, -{0x0996, 0x200D, WORD_LEN, 0 }, -{0x0998, 0xCC30, WORD_LEN, 0 }, -{0x099A, 0x5620, WORD_LEN, 0 }, -{0x099C, 0x08CC, WORD_LEN, 0 }, -{0x099E, 0x305C, WORD_LEN, 0 }, -{0x098A, 0x0F0B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x2003, WORD_LEN, 0 }, -{0x0992, 0xCC30, WORD_LEN, 0 }, -{0x0994, 0x58ED, WORD_LEN, 0 }, -{0x0996, 0x065F, WORD_LEN, 0 }, -{0x0998, 0x4FED, WORD_LEN, 0 }, -{0x099A, 0x04EC, WORD_LEN, 0 }, -{0x099C, 0x0BED, WORD_LEN, 0 }, -{0x099E, 0x008F, WORD_LEN, 0 }, -{0x098A, 0x0F1B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xC300, WORD_LEN, 0 }, -{0x0992, 0x04BD, WORD_LEN, 0 }, -{0x0994, 0x0F43, WORD_LEN, 0 }, -{0x0996, 0x30EC, WORD_LEN, 0 }, -{0x0998, 0x048A, WORD_LEN, 0 }, -{0x099A, 0x02ED, WORD_LEN, 0 }, -{0x099C, 0x02EC, WORD_LEN, 0 }, -{0x099E, 0x06ED, WORD_LEN, 0 }, -{0x098A, 0x0F2B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x008F, WORD_LEN, 0 }, -{0x0992, 0xC300, WORD_LEN, 0 }, -{0x0994, 0x02DE, WORD_LEN, 0 }, -{0x0996, 0x0EAD, WORD_LEN, 0 }, -{0x0998, 0x0030, WORD_LEN, 0 }, -{0x099A, 0xEC04, WORD_LEN, 0 }, -{0x099C, 0xBD0F, WORD_LEN, 0 }, -{0x099E, 0x7630, WORD_LEN, 0 }, -{0x098A, 0x0F3B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xED02, WORD_LEN, 0 }, -{0x0992, 0x3838, WORD_LEN, 0 }, -{0x0994, 0x3838, WORD_LEN, 0 }, -{0x0996, 0x3139, WORD_LEN, 0 }, -{0x0998, 0x3736, WORD_LEN, 0 }, -{0x099A, 0x30EC, WORD_LEN, 0 }, -{0x099C, 0x041A, WORD_LEN, 0 }, -{0x099E, 0x8300, WORD_LEN, 0 }, -{0x098A, 0x0F4B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x4025, WORD_LEN, 0 }, -{0x0992, 0x22EC, WORD_LEN, 0 }, -{0x0994, 0x041A, WORD_LEN, 0 }, -{0x0996, 0x8300, WORD_LEN, 0 }, -{0x0998, 0x8024, WORD_LEN, 0 }, -{0x099A, 0x0504, WORD_LEN, 0 }, -{0x099C, 0xCA40, WORD_LEN, 0 }, -{0x099E, 0x2015, WORD_LEN, 0 }, -{0x098A, 0x0F5B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xEC04, WORD_LEN, 0 }, -{0x0992, 0x1A83, WORD_LEN, 0 }, -{0x0994, 0x0100, WORD_LEN, 0 }, -{0x0996, 0x2406, WORD_LEN, 0 }, -{0x0998, 0x0404, WORD_LEN, 0 }, -{0x099A, 0xCA80, WORD_LEN, 0 }, -{0x099C, 0x2007, WORD_LEN, 0 }, -{0x099E, 0xEC04, WORD_LEN, 0 }, -{0x098A, 0x0F6B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0404, WORD_LEN, 0 }, -{0x0992, 0x04CA, WORD_LEN, 0 }, -{0x0994, 0xC0EE, WORD_LEN, 0 }, -{0x0996, 0x00ED, WORD_LEN, 0 }, -{0x0998, 0x0038, WORD_LEN, 0 }, -{0x099A, 0x3937, WORD_LEN, 0 }, -{0x099C, 0x363C, WORD_LEN, 0 }, -{0x099E, 0x301F, WORD_LEN, 0 }, -{0x098A, 0x0F7B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0340, WORD_LEN, 0 }, -{0x0992, 0x0E1F, WORD_LEN, 0 }, -{0x0994, 0x0380, WORD_LEN, 0 }, -{0x0996, 0x0AEC, WORD_LEN, 0 }, -{0x0998, 0x02C4, WORD_LEN, 0 }, -{0x099A, 0x3F4F, WORD_LEN, 0 }, -{0x099C, 0x0505, WORD_LEN, 0 }, -{0x099E, 0x0520, WORD_LEN, 0 }, -{0x098A, 0x0F8B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x1B1F, WORD_LEN, 0 }, -{0x0992, 0x0380, WORD_LEN, 0 }, -{0x0994, 0x09EC, WORD_LEN, 0 }, -{0x0996, 0x02C4, WORD_LEN, 0 }, -{0x0998, 0x3F4F, WORD_LEN, 0 }, -{0x099A, 0x0505, WORD_LEN, 0 }, -{0x099C, 0x200E, WORD_LEN, 0 }, -{0x099E, 0x1F03, WORD_LEN, 0 }, -{0x098A, 0x0F9B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x4008, WORD_LEN, 0 }, -{0x0992, 0xEC02, WORD_LEN, 0 }, -{0x0994, 0xC43F, WORD_LEN, 0 }, -{0x0996, 0x4F05, WORD_LEN, 0 }, -{0x0998, 0x2002, WORD_LEN, 0 }, -{0x099A, 0xEC02, WORD_LEN, 0 }, -{0x099C, 0xED00, WORD_LEN, 0 }, -{0x099E, 0x3838, WORD_LEN, 0 }, -{0x098A, 0x8FAB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0039, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098A, 0x1000, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xCC10, WORD_LEN, 0 }, -{0x0992, 0x09BD, WORD_LEN, 0 }, -{0x0994, 0x4224, WORD_LEN, 0 }, -{0x0996, 0x7E10, WORD_LEN, 0 }, -{0x0998, 0x09C6, WORD_LEN, 0 }, -{0x099A, 0x01F7, WORD_LEN, 0 }, -{0x099C, 0x018A, WORD_LEN, 0 }, -{0x099E, 0xC609, WORD_LEN, 0 }, -{0x098A, 0x1010, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xF701, WORD_LEN, 0 }, -{0x0992, 0x8BDE, WORD_LEN, 0 }, -{0x0994, 0x3F18, WORD_LEN, 0 }, -{0x0996, 0xCE0B, WORD_LEN, 0 }, -{0x0998, 0xF3CC, WORD_LEN, 0 }, -{0x099A, 0x0011, WORD_LEN, 0 }, -{0x099C, 0xBDD7, WORD_LEN, 0 }, -{0x099E, 0x00CC, WORD_LEN, 0 }, -{0x098A, 0x1020, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0BF3, WORD_LEN, 0 }, -{0x0992, 0xDD3F, WORD_LEN, 0 }, -{0x0994, 0xDE35, WORD_LEN, 0 }, -{0x0996, 0x18CE, WORD_LEN, 0 }, -{0x0998, 0x0C05, WORD_LEN, 0 }, -{0x099A, 0xCC00, WORD_LEN, 0 }, -{0x099C, 0x3FBD, WORD_LEN, 0 }, -{0x099E, 0xD700, WORD_LEN, 0 }, -{0x098A, 0x1030, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xCC0C, WORD_LEN, 0 }, -{0x0992, 0x05DD, WORD_LEN, 0 }, -{0x0994, 0x35DE, WORD_LEN, 0 }, -{0x0996, 0x4718, WORD_LEN, 0 }, -{0x0998, 0xCE0C, WORD_LEN, 0 }, -{0x099A, 0x45CC, WORD_LEN, 0 }, -{0x099C, 0x0015, WORD_LEN, 0 }, -{0x099E, 0xBDD7, WORD_LEN, 0 }, -{0x098A, 0x1040, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x00CC, WORD_LEN, 0 }, -{0x0992, 0x0C45, WORD_LEN, 0 }, -{0x0994, 0xDD47, WORD_LEN, 0 }, -{0x0996, 0xFE00, WORD_LEN, 0 }, -{0x0998, 0x3318, WORD_LEN, 0 }, -{0x099A, 0xCE0C, WORD_LEN, 0 }, -{0x099C, 0x5BCC, WORD_LEN, 0 }, -{0x099E, 0x0009, WORD_LEN, 0 }, -{0x098A, 0x1050, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xBDD7, WORD_LEN, 0 }, -{0x0992, 0x00CC, WORD_LEN, 0 }, -{0x0994, 0x0C5B, WORD_LEN, 0 }, -{0x0996, 0xFD00, WORD_LEN, 0 }, -{0x0998, 0x33DE, WORD_LEN, 0 }, -{0x099A, 0x3118, WORD_LEN, 0 }, -{0x099C, 0xCE0C, WORD_LEN, 0 }, -{0x099E, 0x65CC, WORD_LEN, 0 }, -{0x098A, 0x1060, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0029, WORD_LEN, 0 }, -{0x0992, 0xBDD7, WORD_LEN, 0 }, -{0x0994, 0x00CC, WORD_LEN, 0 }, -{0x0996, 0x0C65, WORD_LEN, 0 }, -{0x0998, 0xDD31, WORD_LEN, 0 }, -{0x099A, 0xDE39, WORD_LEN, 0 }, -{0x099C, 0x18CE, WORD_LEN, 0 }, -{0x099E, 0x0C8F, WORD_LEN, 0 }, -{0x098A, 0x1070, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xCC00, WORD_LEN, 0 }, -{0x0992, 0x23BD, WORD_LEN, 0 }, -{0x0994, 0xD700, WORD_LEN, 0 }, -{0x0996, 0xCC0C, WORD_LEN, 0 }, -{0x0998, 0x8FDD, WORD_LEN, 0 }, -{0x099A, 0x39DE, WORD_LEN, 0 }, -{0x099C, 0x4918, WORD_LEN, 0 }, -{0x099E, 0xCE0C, WORD_LEN, 0 }, -{0x098A, 0x1080, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xB3CC, WORD_LEN, 0 }, -{0x0992, 0x000D, WORD_LEN, 0 }, -{0x0994, 0xBDD7, WORD_LEN, 0 }, -{0x0996, 0x00CC, WORD_LEN, 0 }, -{0x0998, 0x0CB3, WORD_LEN, 0 }, -{0x099A, 0xDD49, WORD_LEN, 0 }, -{0x099C, 0xFC04, WORD_LEN, 0 }, -{0x099E, 0xC2FD, WORD_LEN, 0 }, -{0x098A, 0x1090, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0BF1, WORD_LEN, 0 }, -{0x0992, 0x18FE, WORD_LEN, 0 }, -{0x0994, 0x0BF1, WORD_LEN, 0 }, -{0x0996, 0xCDEE, WORD_LEN, 0 }, -{0x0998, 0x1518, WORD_LEN, 0 }, -{0x099A, 0xCE0C, WORD_LEN, 0 }, -{0x099C, 0xC1CC, WORD_LEN, 0 }, -{0x099E, 0x0029, WORD_LEN, 0 }, -{0x098A, 0x10A0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xBDD7, WORD_LEN, 0 }, -{0x0992, 0x00FE, WORD_LEN, 0 }, -{0x0994, 0x0BF1, WORD_LEN, 0 }, -{0x0996, 0xCC0C, WORD_LEN, 0 }, -{0x0998, 0xC1ED, WORD_LEN, 0 }, -{0x099A, 0x15CC, WORD_LEN, 0 }, -{0x099C, 0x11A5, WORD_LEN, 0 }, -{0x099E, 0xFD0B, WORD_LEN, 0 }, -{0x098A, 0x10B0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xFFCC, WORD_LEN, 0 }, -{0x0992, 0x0CFB, WORD_LEN, 0 }, -{0x0994, 0xFD0C, WORD_LEN, 0 }, -{0x0996, 0x21CC, WORD_LEN, 0 }, -{0x0998, 0x128F, WORD_LEN, 0 }, -{0x099A, 0xFD0C, WORD_LEN, 0 }, -{0x099C, 0x53CC, WORD_LEN, 0 }, -{0x099E, 0x114E, WORD_LEN, 0 }, -{0x098A, 0x10C0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xFD0C, WORD_LEN, 0 }, -{0x0992, 0x5DCC, WORD_LEN, 0 }, -{0x0994, 0x10E2, WORD_LEN, 0 }, -{0x0996, 0xFD0C, WORD_LEN, 0 }, -{0x0998, 0x6FCC, WORD_LEN, 0 }, -{0x099A, 0x0EDD, WORD_LEN, 0 }, -{0x099C, 0xFD0C, WORD_LEN, 0 }, -{0x099E, 0xD7CC, WORD_LEN, 0 }, -{0x098A, 0x10D0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0EBA, WORD_LEN, 0 }, -{0x0992, 0xFD0C, WORD_LEN, 0 }, -{0x0994, 0xE9CC, WORD_LEN, 0 }, -{0x0996, 0x1350, WORD_LEN, 0 }, -{0x0998, 0xFD0C, WORD_LEN, 0 }, -{0x099A, 0x9BCC, WORD_LEN, 0 }, -{0x099C, 0x0E29, WORD_LEN, 0 }, -{0x099E, 0xFD0C, WORD_LEN, 0 }, -{0x098A, 0x10E0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xBF39, WORD_LEN, 0 }, -{0x0992, 0x373C, WORD_LEN, 0 }, -{0x0994, 0x3CDE, WORD_LEN, 0 }, -{0x0996, 0x1DEC, WORD_LEN, 0 }, -{0x0998, 0x0C5F, WORD_LEN, 0 }, -{0x099A, 0x8402, WORD_LEN, 0 }, -{0x099C, 0x4416, WORD_LEN, 0 }, -{0x099E, 0x4FF7, WORD_LEN, 0 }, -{0x098A, 0x10F0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0CEB, WORD_LEN, 0 }, -{0x0992, 0xE60B, WORD_LEN, 0 }, -{0x0994, 0xC407, WORD_LEN, 0 }, -{0x0996, 0xF70C, WORD_LEN, 0 }, -{0x0998, 0xEC7F, WORD_LEN, 0 }, -{0x099A, 0x30C4, WORD_LEN, 0 }, -{0x099C, 0xEC25, WORD_LEN, 0 }, -{0x099E, 0xFD30, WORD_LEN, 0 }, -{0x098A, 0x1100, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xC5FC, WORD_LEN, 0 }, -{0x0992, 0x06D6, WORD_LEN, 0 }, -{0x0994, 0xFD30, WORD_LEN, 0 }, -{0x0996, 0xC701, WORD_LEN, 0 }, -{0x0998, 0xFC30, WORD_LEN, 0 }, -{0x099A, 0xC0FD, WORD_LEN, 0 }, -{0x099C, 0x0BED, WORD_LEN, 0 }, -{0x099E, 0xFC30, WORD_LEN, 0 }, -{0x098A, 0x1110, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xC2FD, WORD_LEN, 0 }, -{0x0992, 0x0BEF, WORD_LEN, 0 }, -{0x0994, 0xFC04, WORD_LEN, 0 }, -{0x0996, 0xC283, WORD_LEN, 0 }, -{0x0998, 0xFFFF, WORD_LEN, 0 }, -{0x099A, 0x2728, WORD_LEN, 0 }, -{0x099C, 0xDE06, WORD_LEN, 0 }, -{0x099E, 0xEC22, WORD_LEN, 0 }, -{0x098A, 0x1120, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x8322, WORD_LEN, 0 }, -{0x0992, 0x0026, WORD_LEN, 0 }, -{0x0994, 0x1FCC, WORD_LEN, 0 }, -{0x0996, 0x3064, WORD_LEN, 0 }, -{0x0998, 0x30ED, WORD_LEN, 0 }, -{0x099A, 0x008F, WORD_LEN, 0 }, -{0x099C, 0xC300, WORD_LEN, 0 }, -{0x099E, 0x02DE, WORD_LEN, 0 }, -{0x098A, 0x1130, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0CAD, WORD_LEN, 0 }, -{0x0992, 0x0030, WORD_LEN, 0 }, -{0x0994, 0x1D02, WORD_LEN, 0 }, -{0x0996, 0x01CC, WORD_LEN, 0 }, -{0x0998, 0x3064, WORD_LEN, 0 }, -{0x099A, 0xED00, WORD_LEN, 0 }, -{0x099C, 0x8FC3, WORD_LEN, 0 }, -{0x099E, 0x0002, WORD_LEN, 0 }, -{0x098A, 0x1140, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xDE0E, WORD_LEN, 0 }, -{0x0992, 0xAD00, WORD_LEN, 0 }, -{0x0994, 0x30E6, WORD_LEN, 0 }, -{0x0996, 0x04BD, WORD_LEN, 0 }, -{0x0998, 0x5203, WORD_LEN, 0 }, -{0x099A, 0x3838, WORD_LEN, 0 }, -{0x099C, 0x3139, WORD_LEN, 0 }, -{0x099E, 0x3C3C, WORD_LEN, 0 }, -{0x098A, 0x1150, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x3C21, WORD_LEN, 0 }, -{0x0992, 0x01CC, WORD_LEN, 0 }, -{0x0994, 0x0018, WORD_LEN, 0 }, -{0x0996, 0xBD6F, WORD_LEN, 0 }, -{0x0998, 0xD1C5, WORD_LEN, 0 }, -{0x099A, 0x0426, WORD_LEN, 0 }, -{0x099C, 0xF5DC, WORD_LEN, 0 }, -{0x099E, 0x2530, WORD_LEN, 0 }, -{0x098A, 0x1160, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xED04, WORD_LEN, 0 }, -{0x0992, 0x2012, WORD_LEN, 0 }, -{0x0994, 0xEE04, WORD_LEN, 0 }, -{0x0996, 0x3C18, WORD_LEN, 0 }, -{0x0998, 0x38E6, WORD_LEN, 0 }, -{0x099A, 0x2118, WORD_LEN, 0 }, -{0x099C, 0xE7BE, WORD_LEN, 0 }, -{0x099E, 0x30EE, WORD_LEN, 0 }, -{0x098A, 0x1170, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x04EC, WORD_LEN, 0 }, -{0x0992, 0x1D30, WORD_LEN, 0 }, -{0x0994, 0xED04, WORD_LEN, 0 }, -{0x0996, 0xEC04, WORD_LEN, 0 }, -{0x0998, 0x26EA, WORD_LEN, 0 }, -{0x099A, 0xCC00, WORD_LEN, 0 }, -{0x099C, 0x1AED, WORD_LEN, 0 }, -{0x099E, 0x02CC, WORD_LEN, 0 }, -{0x098A, 0x1180, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xFBFF, WORD_LEN, 0 }, -{0x0992, 0xED00, WORD_LEN, 0 }, -{0x0994, 0xCC04, WORD_LEN, 0 }, -{0x0996, 0x00BD, WORD_LEN, 0 }, -{0x0998, 0x706D, WORD_LEN, 0 }, -{0x099A, 0xCC00, WORD_LEN, 0 }, -{0x099C, 0x1A30, WORD_LEN, 0 }, -{0x099E, 0xED02, WORD_LEN, 0 }, -{0x098A, 0x1190, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xCCFB, WORD_LEN, 0 }, -{0x0992, 0xFFED, WORD_LEN, 0 }, -{0x0994, 0x005F, WORD_LEN, 0 }, -{0x0996, 0x4FBD, WORD_LEN, 0 }, -{0x0998, 0x706D, WORD_LEN, 0 }, -{0x099A, 0x5FBD, WORD_LEN, 0 }, -{0x099C, 0x5B17, WORD_LEN, 0 }, -{0x099E, 0xBD55, WORD_LEN, 0 }, -{0x098A, 0x11A0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x8B38, WORD_LEN, 0 }, -{0x0992, 0x3838, WORD_LEN, 0 }, -{0x0994, 0x393C, WORD_LEN, 0 }, -{0x0996, 0x3CC6, WORD_LEN, 0 }, -{0x0998, 0x40F7, WORD_LEN, 0 }, -{0x099A, 0x30C4, WORD_LEN, 0 }, -{0x099C, 0xFC0B, WORD_LEN, 0 }, -{0x099E, 0xEDFD, WORD_LEN, 0 }, -{0x098A, 0x11B0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x30C0, WORD_LEN, 0 }, -{0x0992, 0xFC0B, WORD_LEN, 0 }, -{0x0994, 0xEFFD, WORD_LEN, 0 }, -{0x0996, 0x30C2, WORD_LEN, 0 }, -{0x0998, 0xDE1D, WORD_LEN, 0 }, -{0x099A, 0xEC25, WORD_LEN, 0 }, -{0x099C, 0xFD30, WORD_LEN, 0 }, -{0x099E, 0xC501, WORD_LEN, 0 }, -{0x098A, 0x11C0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0101, WORD_LEN, 0 }, -{0x0992, 0xFC30, WORD_LEN, 0 }, -{0x0994, 0xC2FD, WORD_LEN, 0 }, -{0x0996, 0x06D6, WORD_LEN, 0 }, -{0x0998, 0xEC0C, WORD_LEN, 0 }, -{0x099A, 0x5F84, WORD_LEN, 0 }, -{0x099C, 0x0244, WORD_LEN, 0 }, -{0x099E, 0x164F, WORD_LEN, 0 }, -{0x098A, 0x11D0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x30E7, WORD_LEN, 0 }, -{0x0992, 0x03F1, WORD_LEN, 0 }, -{0x0994, 0x0CEB, WORD_LEN, 0 }, -{0x0996, 0x2715, WORD_LEN, 0 }, -{0x0998, 0xF10C, WORD_LEN, 0 }, -{0x099A, 0xEB23, WORD_LEN, 0 }, -{0x099C, 0x09FC, WORD_LEN, 0 }, -{0x099E, 0x06D6, WORD_LEN, 0 }, -{0x098A, 0x11E0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x04FD, WORD_LEN, 0 }, -{0x0992, 0x06D6, WORD_LEN, 0 }, -{0x0994, 0x2007, WORD_LEN, 0 }, -{0x0996, 0xFC06, WORD_LEN, 0 }, -{0x0998, 0xD605, WORD_LEN, 0 }, -{0x099A, 0xFD06, WORD_LEN, 0 }, -{0x099C, 0xD6DE, WORD_LEN, 0 }, -{0x099E, 0x1DE6, WORD_LEN, 0 }, -{0x098A, 0x11F0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0BC4, WORD_LEN, 0 }, -{0x0992, 0x0730, WORD_LEN, 0 }, -{0x0994, 0xE702, WORD_LEN, 0 }, -{0x0996, 0xF10C, WORD_LEN, 0 }, -{0x0998, 0xEC27, WORD_LEN, 0 }, -{0x099A, 0x2C7D, WORD_LEN, 0 }, -{0x099C, 0x0CEC, WORD_LEN, 0 }, -{0x099E, 0x2727, WORD_LEN, 0 }, -{0x098A, 0x1200, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x5D27, WORD_LEN, 0 }, -{0x0992, 0x247F, WORD_LEN, 0 }, -{0x0994, 0x30C4, WORD_LEN, 0 }, -{0x0996, 0xFC06, WORD_LEN, 0 }, -{0x0998, 0xD6FD, WORD_LEN, 0 }, -{0x099A, 0x30C5, WORD_LEN, 0 }, -{0x099C, 0xF60C, WORD_LEN, 0 }, -{0x099E, 0xEC4F, WORD_LEN, 0 }, -{0x098A, 0x1210, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xFD30, WORD_LEN, 0 }, -{0x0992, 0xC7C6, WORD_LEN, 0 }, -{0x0994, 0x40F7, WORD_LEN, 0 }, -{0x0996, 0x30C4, WORD_LEN, 0 }, -{0x0998, 0xE602, WORD_LEN, 0 }, -{0x099A, 0x4FFD, WORD_LEN, 0 }, -{0x099C, 0x30C5, WORD_LEN, 0 }, -{0x099E, 0x0101, WORD_LEN, 0 }, -{0x098A, 0x1220, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x01FC, WORD_LEN, 0 }, -{0x0992, 0x30C2, WORD_LEN, 0 }, -{0x0994, 0xFD06, WORD_LEN, 0 }, -{0x0996, 0xD67D, WORD_LEN, 0 }, -{0x0998, 0x06CB, WORD_LEN, 0 }, -{0x099A, 0x272E, WORD_LEN, 0 }, -{0x099C, 0xC640, WORD_LEN, 0 }, -{0x099E, 0xF730, WORD_LEN, 0 }, -{0x098A, 0x1230, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xC4FC, WORD_LEN, 0 }, -{0x0992, 0x06C1, WORD_LEN, 0 }, -{0x0994, 0x04F3, WORD_LEN, 0 }, -{0x0996, 0x06D6, WORD_LEN, 0 }, -{0x0998, 0xED00, WORD_LEN, 0 }, -{0x099A, 0x5F6D, WORD_LEN, 0 }, -{0x099C, 0x002A, WORD_LEN, 0 }, -{0x099E, 0x0153, WORD_LEN, 0 }, -{0x098A, 0x1240, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x17FD, WORD_LEN, 0 }, -{0x0992, 0x30C0, WORD_LEN, 0 }, -{0x0994, 0xEC00, WORD_LEN, 0 }, -{0x0996, 0xFD30, WORD_LEN, 0 }, -{0x0998, 0xC2FC, WORD_LEN, 0 }, -{0x099A, 0x06C1, WORD_LEN, 0 }, -{0x099C, 0xFD30, WORD_LEN, 0 }, -{0x099E, 0xC501, WORD_LEN, 0 }, -{0x098A, 0x1250, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0101, WORD_LEN, 0 }, -{0x0992, 0xFC30, WORD_LEN, 0 }, -{0x0994, 0xC2FD, WORD_LEN, 0 }, -{0x0996, 0x06C7, WORD_LEN, 0 }, -{0x0998, 0x2022, WORD_LEN, 0 }, -{0x099A, 0x7F30, WORD_LEN, 0 }, -{0x099C, 0xC4DE, WORD_LEN, 0 }, -{0x099E, 0x1DEC, WORD_LEN, 0 }, -{0x098A, 0x1260, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x25FD, WORD_LEN, 0 }, -{0x0992, 0x30C5, WORD_LEN, 0 }, -{0x0994, 0xFC06, WORD_LEN, 0 }, -{0x0996, 0xD6FD, WORD_LEN, 0 }, -{0x0998, 0x30C7, WORD_LEN, 0 }, -{0x099A, 0x01FC, WORD_LEN, 0 }, -{0x099C, 0x30C0, WORD_LEN, 0 }, -{0x099E, 0xFD06, WORD_LEN, 0 }, -{0x098A, 0x1270, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xD0FC, WORD_LEN, 0 }, -{0x0992, 0x30C2, WORD_LEN, 0 }, -{0x0994, 0xFD06, WORD_LEN, 0 }, -{0x0996, 0xD2EC, WORD_LEN, 0 }, -{0x0998, 0x25FD, WORD_LEN, 0 }, -{0x099A, 0x06C3, WORD_LEN, 0 }, -{0x099C, 0xBD95, WORD_LEN, 0 }, -{0x099E, 0x3CDE, WORD_LEN, 0 }, -{0x098A, 0x1280, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x3FEE, WORD_LEN, 0 }, -{0x0992, 0x10AD, WORD_LEN, 0 }, -{0x0994, 0x00DE, WORD_LEN, 0 }, -{0x0996, 0x1DFC, WORD_LEN, 0 }, -{0x0998, 0x06CC, WORD_LEN, 0 }, -{0x099A, 0xED3E, WORD_LEN, 0 }, -{0x099C, 0x3838, WORD_LEN, 0 }, -{0x099E, 0x3930, WORD_LEN, 0 }, -{0x098A, 0x1290, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x8FC3, WORD_LEN, 0 }, -{0x0992, 0xFFEC, WORD_LEN, 0 }, -{0x0994, 0x8F35, WORD_LEN, 0 }, -{0x0996, 0xBDAD, WORD_LEN, 0 }, -{0x0998, 0x15DE, WORD_LEN, 0 }, -{0x099A, 0x198F, WORD_LEN, 0 }, -{0x099C, 0xC301, WORD_LEN, 0 }, -{0x099E, 0x4B8F, WORD_LEN, 0 }, -{0x098A, 0x12A0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xEC00, WORD_LEN, 0 }, -{0x0992, 0xFD05, WORD_LEN, 0 }, -{0x0994, 0x0EEC, WORD_LEN, 0 }, -{0x0996, 0x02FD, WORD_LEN, 0 }, -{0x0998, 0x0510, WORD_LEN, 0 }, -{0x099A, 0x8FC3, WORD_LEN, 0 }, -{0x099C, 0xFFCB, WORD_LEN, 0 }, -{0x099E, 0x8FE6, WORD_LEN, 0 }, -{0x098A, 0x12B0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x00F7, WORD_LEN, 0 }, -{0x0992, 0x0514, WORD_LEN, 0 }, -{0x0994, 0xE603, WORD_LEN, 0 }, -{0x0996, 0xF705, WORD_LEN, 0 }, -{0x0998, 0x15FC, WORD_LEN, 0 }, -{0x099A, 0x055B, WORD_LEN, 0 }, -{0x099C, 0xFD05, WORD_LEN, 0 }, -{0x099E, 0x12DE, WORD_LEN, 0 }, -{0x098A, 0x12C0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x37EE, WORD_LEN, 0 }, -{0x0992, 0x08AD, WORD_LEN, 0 }, -{0x0994, 0x00F6, WORD_LEN, 0 }, -{0x0996, 0x0516, WORD_LEN, 0 }, -{0x0998, 0x4F30, WORD_LEN, 0 }, -{0x099A, 0xED04, WORD_LEN, 0 }, -{0x099C, 0xDE1F, WORD_LEN, 0 }, -{0x099E, 0xEC6B, WORD_LEN, 0 }, -{0x098A, 0x12D0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xFD05, WORD_LEN, 0 }, -{0x0992, 0x0EEC, WORD_LEN, 0 }, -{0x0994, 0x6DFD, WORD_LEN, 0 }, -{0x0996, 0x0510, WORD_LEN, 0 }, -{0x0998, 0xDE19, WORD_LEN, 0 }, -{0x099A, 0x8FC3, WORD_LEN, 0 }, -{0x099C, 0x0117, WORD_LEN, 0 }, -{0x099E, 0x8FE6, WORD_LEN, 0 }, -{0x098A, 0x12E0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x00F7, WORD_LEN, 0 }, -{0x0992, 0x0514, WORD_LEN, 0 }, -{0x0994, 0xE603, WORD_LEN, 0 }, -{0x0996, 0xF705, WORD_LEN, 0 }, -{0x0998, 0x15FC, WORD_LEN, 0 }, -{0x099A, 0x0559, WORD_LEN, 0 }, -{0x099C, 0xFD05, WORD_LEN, 0 }, -{0x099E, 0x12DE, WORD_LEN, 0 }, -{0x098A, 0x12F0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x37EE, WORD_LEN, 0 }, -{0x0992, 0x08AD, WORD_LEN, 0 }, -{0x0994, 0x00F6, WORD_LEN, 0 }, -{0x0996, 0x0516, WORD_LEN, 0 }, -{0x0998, 0x4F30, WORD_LEN, 0 }, -{0x099A, 0xED06, WORD_LEN, 0 }, -{0x099C, 0xDE1F, WORD_LEN, 0 }, -{0x099E, 0xEC6B, WORD_LEN, 0 }, -{0x098A, 0x1300, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xFD05, WORD_LEN, 0 }, -{0x0992, 0x0EEC, WORD_LEN, 0 }, -{0x0994, 0x6DFD, WORD_LEN, 0 }, -{0x0996, 0x0510, WORD_LEN, 0 }, -{0x0998, 0xDE19, WORD_LEN, 0 }, -{0x099A, 0x8FC3, WORD_LEN, 0 }, -{0x099C, 0x0118, WORD_LEN, 0 }, -{0x099E, 0x8FE6, WORD_LEN, 0 }, -{0x098A, 0x1310, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x00F7, WORD_LEN, 0 }, -{0x0992, 0x0514, WORD_LEN, 0 }, -{0x0994, 0xE603, WORD_LEN, 0 }, -{0x0996, 0xF705, WORD_LEN, 0 }, -{0x0998, 0x15FC, WORD_LEN, 0 }, -{0x099A, 0x0559, WORD_LEN, 0 }, -{0x099C, 0xFD05, WORD_LEN, 0 }, -{0x099E, 0x12DE, WORD_LEN, 0 }, -{0x098A, 0x1320, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x37EE, WORD_LEN, 0 }, -{0x0992, 0x08AD, WORD_LEN, 0 }, -{0x0994, 0x00F6, WORD_LEN, 0 }, -{0x0996, 0x0516, WORD_LEN, 0 }, -{0x0998, 0x4F30, WORD_LEN, 0 }, -{0x099A, 0xED08, WORD_LEN, 0 }, -{0x099C, 0xCC32, WORD_LEN, 0 }, -{0x099E, 0x8EED, WORD_LEN, 0 }, -{0x098A, 0x1330, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x00EC, WORD_LEN, 0 }, -{0x0992, 0x04BD, WORD_LEN, 0 }, -{0x0994, 0x7021, WORD_LEN, 0 }, -{0x0996, 0xCC32, WORD_LEN, 0 }, -{0x0998, 0x6C30, WORD_LEN, 0 }, -{0x099A, 0xED02, WORD_LEN, 0 }, -{0x099C, 0xCCF8, WORD_LEN, 0 }, -{0x099E, 0x00ED, WORD_LEN, 0 }, -{0x098A, 0x1340, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x00A6, WORD_LEN, 0 }, -{0x0992, 0x07E3, WORD_LEN, 0 }, -{0x0994, 0x0884, WORD_LEN, 0 }, -{0x0996, 0x07BD, WORD_LEN, 0 }, -{0x0998, 0x706D, WORD_LEN, 0 }, -{0x099A, 0x30C6, WORD_LEN, 0 }, -{0x099C, 0x143A, WORD_LEN, 0 }, -{0x099E, 0x3539, WORD_LEN, 0 }, -{0x098A, 0x1350, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x3CBD, WORD_LEN, 0 }, -{0x0992, 0x776D, WORD_LEN, 0 }, -{0x0994, 0xCC32, WORD_LEN, 0 }, -{0x0996, 0x5C30, WORD_LEN, 0 }, -{0x0998, 0xED00, WORD_LEN, 0 }, -{0x099A, 0xFC13, WORD_LEN, 0 }, -{0x099C, 0x8683, WORD_LEN, 0 }, -{0x099E, 0x0001, WORD_LEN, 0 }, -{0x098A, 0x1360, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xBD70, WORD_LEN, 0 }, -{0x0992, 0x21CC, WORD_LEN, 0 }, -{0x0994, 0x325E, WORD_LEN, 0 }, -{0x0996, 0x30ED, WORD_LEN, 0 }, -{0x0998, 0x00FC, WORD_LEN, 0 }, -{0x099A, 0x1388, WORD_LEN, 0 }, -{0x099C, 0x8300, WORD_LEN, 0 }, -{0x099E, 0x01BD, WORD_LEN, 0 }, -{0x098A, 0x1370, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x7021, WORD_LEN, 0 }, -{0x0992, 0x3839, WORD_LEN, 0 }, -{0x098E, 0x0010, WORD_LEN, 0 }, // MCU_ADDRESS [MON_ADDR] -{0x0990, 0x1000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x0003, WORD_LEN, 0 }, // MCU_ADDRESS [MON_ALGO] -{0x0990, 0x0004, WORD_LEN, 0 }, // MCU_DATA_0 -{ SEQUENCE_WAIT_MS,10, WORD_LEN, 0}, -// POLL MON_PATCH_0 => 0x01 -{0x098E, 0x4815, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0004, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x485D, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0004, WORD_LEN, 0 }, // MCU_DATA_0 -{0x0018, 0x0028, WORD_LEN, 0 }, // STANDBY_CONTROL_AND_STATUS -// POLL SEQ_STATE => 0x01, 0x02, ..., 0x03 (11 reads) -{ SEQUENCE_WAIT_MS,10, WORD_LEN, 0}, - -//af - -{0x098E, 0x4403, WORD_LEN, 0 }, -{0x0990, 0x8001, WORD_LEN, 0 }, -{0x098E, 0x440B, WORD_LEN, 0 }, -{0x0990, 0x0032, WORD_LEN, 0 }, -{0x098E, 0x440D, WORD_LEN, 0 }, -{0x0990, 0x03B6, WORD_LEN, 0 }, -{0x098E, 0x8400, WORD_LEN, 0 }, -{0x0990, 0x0006, WORD_LEN, 0 }, - - -//[Lens Correction 90% 05/09/11 15:36:26] -{0x3640, 0x0790, WORD_LEN, 0 }, // P_G1_P0Q0 -{0x3642, 0x078B, WORD_LEN, 0 }, // P_G1_P0Q1 -{0x3644, 0x3751, WORD_LEN, 0 }, // P_G1_P0Q2 -{0x3646, 0x66ED, WORD_LEN, 0 }, // P_G1_P0Q3 -{0x3648, 0xCB51, WORD_LEN, 0 }, // P_G1_P0Q4 -{0x364A, 0x00B0, WORD_LEN, 0 }, // P_R_P0Q0 -{0x364C, 0x2BCA, WORD_LEN, 0 }, // P_R_P0Q1 -{0x364E, 0x69D1, WORD_LEN, 0 }, // P_R_P0Q2 -{0x3650, 0x140E, WORD_LEN, 0 }, // P_R_P0Q3 -{0x3652, 0x98B1, WORD_LEN, 0 }, // P_R_P0Q4 -{0x3654, 0x00F0, WORD_LEN, 0 }, // P_B_P0Q0 -{0x3656, 0x47A9, WORD_LEN, 0 }, // P_B_P0Q1 -{0x3658, 0x7690, WORD_LEN, 0 }, // P_B_P0Q2 -{0x365A, 0x44CE, WORD_LEN, 0 }, // P_B_P0Q3 -{0x365C, 0x044C, WORD_LEN, 0 }, // P_B_P0Q4 -{0x365E, 0x0170, WORD_LEN, 0 }, // P_G2_P0Q0 -{0x3660, 0x3BAB, WORD_LEN, 0 }, // P_G2_P0Q1 -{0x3662, 0x2F31, WORD_LEN, 0 }, // P_G2_P0Q2 -{0x3664, 0x6A8C, WORD_LEN, 0 }, // P_G2_P0Q3 -{0x3666, 0xC811, WORD_LEN, 0 }, // P_G2_P0Q4 -{0x3680, 0xFD8A, WORD_LEN, 0 }, // P_G1_P1Q0 -{0x3682, 0xAC6F, WORD_LEN, 0 }, // P_G1_P1Q1 -{0x3684, 0x1EEE, WORD_LEN, 0 }, // P_G1_P1Q2 -{0x3686, 0x67B0, WORD_LEN, 0 }, // P_G1_P1Q3 -{0x3688, 0xF30F, WORD_LEN, 0 }, // P_G1_P1Q4 -{0x368A, 0x98CC, WORD_LEN, 0 }, // P_R_P1Q0 -{0x368C, 0x1AEF, WORD_LEN, 0 }, // P_R_P1Q1 -{0x368E, 0x01B0, WORD_LEN, 0 }, // P_R_P1Q2 -{0x3690, 0x3C8C, WORD_LEN, 0 }, // P_R_P1Q3 -{0x3692, 0x93F2, WORD_LEN, 0 }, // P_R_P1Q4 -{0x3694, 0x5808, WORD_LEN, 0 }, // P_B_P1Q0 -{0x3696, 0xA12F, WORD_LEN, 0 }, // P_B_P1Q1 -{0x3698, 0x1B8F, WORD_LEN, 0 }, // P_B_P1Q2 -{0x369A, 0x37D1, WORD_LEN, 0 }, // P_B_P1Q3 -{0x369C, 0xF931, WORD_LEN, 0 }, // P_B_P1Q4 -{0x369E, 0x128A, WORD_LEN, 0 }, // P_G2_P1Q0 -{0x36A0, 0x064F, WORD_LEN, 0 }, // P_G2_P1Q1 -{0x36A2, 0x2AAE, WORD_LEN, 0 }, // P_G2_P1Q2 -{0x36A4, 0xBE0F, WORD_LEN, 0 }, // P_G2_P1Q3 -{0x36A6, 0xEE90, WORD_LEN, 0 }, // P_G2_P1Q4 -{0x36C0, 0x1D12, WORD_LEN, 0 }, // P_G1_P2Q0 -{0x36C2, 0x95AB, WORD_LEN, 0 }, // P_G1_P2Q1 -{0x36C4, 0xDD8B, WORD_LEN, 0 }, // P_G1_P2Q2 -{0x36C6, 0x1EAC, WORD_LEN, 0 }, // P_G1_P2Q3 -{0x36C8, 0xC494, WORD_LEN, 0 }, // P_G1_P2Q4 -{0x36CA, 0x4A32, WORD_LEN, 0 }, // P_R_P2Q0 -{0x36CC, 0xB34E, WORD_LEN, 0 }, // P_R_P2Q1 -{0x36CE, 0x2691, WORD_LEN, 0 }, // P_R_P2Q2 -{0x36D0, 0x1BB1, WORD_LEN, 0 }, // P_R_P2Q3 -{0x36D2, 0xC7D5, WORD_LEN, 0 }, // P_R_P2Q4 -{0x36D4, 0x0EB2, WORD_LEN, 0 }, // P_B_P2Q0 -{0x36D6, 0xB42E, WORD_LEN, 0 }, // P_B_P2Q1 -{0x36D8, 0x0AB2, WORD_LEN, 0 }, // P_B_P2Q2 -{0x36DA, 0x08F1, WORD_LEN, 0 }, // P_B_P2Q3 -{0x36DC, 0xA295, WORD_LEN, 0 }, // P_B_P2Q4 -{0x36DE, 0x2112, WORD_LEN, 0 }, // P_G2_P2Q0 -{0x36E0, 0xBF2D, WORD_LEN, 0 }, // P_G2_P2Q1 -{0x36E2, 0x1E70, WORD_LEN, 0 }, // P_G2_P2Q2 -{0x36E4, 0xB36D, WORD_LEN, 0 }, // P_G2_P2Q3 -{0x36E6, 0x8275, WORD_LEN, 0 }, // P_G2_P2Q4 -{0x3700, 0xA86D, WORD_LEN, 0 }, // P_G1_P3Q0 -{0x3702, 0xF40E, WORD_LEN, 0 }, // P_G1_P3Q1 -{0x3704, 0xDE0F, WORD_LEN, 0 }, // P_G1_P3Q2 -{0x3706, 0x6790, WORD_LEN, 0 }, // P_G1_P3Q3 -{0x3708, 0x2A72, WORD_LEN, 0 }, // P_G1_P3Q4 -{0x370A, 0xE9CF, WORD_LEN, 0 }, // P_R_P3Q0 -{0x370C, 0x6C0F, WORD_LEN, 0 }, // P_R_P3Q1 -{0x370E, 0x2F30, WORD_LEN, 0 }, // P_R_P3Q2 -{0x3710, 0xDD33, WORD_LEN, 0 }, // P_R_P3Q3 -{0x3712, 0x64D1, WORD_LEN, 0 }, // P_R_P3Q4 -{0x3714, 0x974E, WORD_LEN, 0 }, // P_B_P3Q0 -{0x3716, 0x3A0E, WORD_LEN, 0 }, // P_B_P3Q1 -{0x3718, 0x580F, WORD_LEN, 0 }, // P_B_P3Q2 -{0x371A, 0xB0D0, WORD_LEN, 0 }, // P_B_P3Q3 -{0x371C, 0x17B3, WORD_LEN, 0 }, // P_B_P3Q4 -{0x371E, 0xA0CD, WORD_LEN, 0 }, // P_G2_P3Q0 -{0x3720, 0x1070, WORD_LEN, 0 }, // P_G2_P3Q1 -{0x3722, 0xD9D1, WORD_LEN, 0 }, // P_G2_P3Q2 -{0x3724, 0xC733, WORD_LEN, 0 }, // P_G2_P3Q3 -{0x3726, 0x7B93, WORD_LEN, 0 }, // P_G2_P3Q4 -{0x3740, 0xE870, WORD_LEN, 0 }, // P_G1_P4Q0 -{0x3742, 0x854A, WORD_LEN, 0 }, // P_G1_P4Q1 -{0x3744, 0xA936, WORD_LEN, 0 }, // P_G1_P4Q2 -{0x3746, 0xADF2, WORD_LEN, 0 }, // P_G1_P4Q3 -{0x3748, 0x2538, WORD_LEN, 0 }, // P_G1_P4Q4 -{0x374A, 0x9651, WORD_LEN, 0 }, // P_R_P4Q0 -{0x374C, 0x06D1, WORD_LEN, 0 }, // P_R_P4Q1 -{0x374E, 0xE676, WORD_LEN, 0 }, // P_R_P4Q2 -{0x3750, 0xC494, WORD_LEN, 0 }, // P_R_P4Q3 -{0x3752, 0x6318, WORD_LEN, 0 }, // P_R_P4Q4 -{0x3754, 0x0A0F, WORD_LEN, 0 }, // P_B_P4Q0 -{0x3756, 0x1DB2, WORD_LEN, 0 }, // P_B_P4Q1 -{0x3758, 0xBA36, WORD_LEN, 0 }, // P_B_P4Q2 -{0x375A, 0xC5D4, WORD_LEN, 0 }, // P_B_P4Q3 -{0x375C, 0x37B8, WORD_LEN, 0 }, // P_B_P4Q4 -{0x375E, 0x93B1, WORD_LEN, 0 }, // P_G2_P4Q0 -{0x3760, 0xBFAE, WORD_LEN, 0 }, // P_G2_P4Q1 -{0x3762, 0xC1B6, WORD_LEN, 0 }, // P_G2_P4Q2 -{0x3764, 0xB311, WORD_LEN, 0 }, // P_G2_P4Q3 -{0x3766, 0x3E98, WORD_LEN, 0 }, // P_G2_P4Q4 -{0x3782, 0x0304, WORD_LEN, 0 }, // CENTER_ROW -{0x3784, 0x0404, WORD_LEN, 0 }, // CENTER_COLUMN -{0x3210, 0x0008, WORD_LEN, 0 }, //PGA_ENABLE - - - -//[PA Default] -{0x3C20, 0x0000, WORD_LEN, 0 }, // TX_SS_CONTROL -//[Brightness_Metric] -{0x3210, 0x01B8, WORD_LEN, 0 }, // COLOR_PIPELINE_CONTROL -{0x098E, 0xC913, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_STAT_BRIGHTNESS_METRIC_PREDIVIDER] -{0x0990, 0x000A, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x686B, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_LL_START_BRIGHTNESS] -{0x0990, 0x05DC, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x686D, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_LL_STOP_BRIGHTNESS] -{0x0990, 0x0BB8, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x6C6B, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_LL_START_BRIGHTNESS] -{0x0990, 0x05DC, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x6C6D, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_LL_STOP_BRIGHTNESS] -{0x0990, 0x0BB8, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x3439, WORD_LEN, 0 }, // MCU_ADDRESS [AS_ASSTART_BRIGHTNESS] -{0x0990, 0x05DC, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x343B, WORD_LEN, 0 }, // MCU_ADDRESS [AS_ASSTOP_BRIGHTNESS] -{0x0990, 0x0BB8, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4926, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_START_GAMMA_BM] -{0x0990, 0x0001, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4928, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_MID_GAMMA_BM] -{0x0990, 0x0002, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x492A, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_STOP_GAMMA_BM] -{0x0990, 0x0656, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4D26, WORD_LEN, 0 }, // MCU_ADDRESS [CAM2_LL_START_GAMMA_BM] -{0x0990, 0x0001, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4D28, WORD_LEN, 0 }, // MCU_ADDRESS [CAM2_LL_MID_GAMMA_BM] -{0x0990, 0x0002, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4D2A, WORD_LEN, 0 }, // MCU_ADDRESS [CAM2_LL_STOP_GAMMA_BM] -{0x0990, 0x0656, WORD_LEN, 0 }, // MCU_DATA_0 - - -//[FW kernel] -{0x33F4, 0x040B, WORD_LEN, 0 }, // KERNEL_CONFIG - - -//[Demosaic] -{0x098E, 0xC916, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_LL_START_0] -{0x0990, 0x0014, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC919, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_LL_STOP_0] -{0x0990, 0x0028, WORD_LEN, 0 }, // MCU_DATA_0 - - - - -//[Aperture] -{0x098E, 0xC917, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_LL_START_1] -{0x0990, 0x0004, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC918, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_LL_START_2] -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC91A, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_LL_STOP_1] -{0x0990, 0x0001, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC91B, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_LL_STOP_2] -{0x0990, 0x0009, WORD_LEN, 0 }, // MCU_DATA_0 -{0x326C, 0x0C00, WORD_LEN, 0 }, // APERTURE_PARAMETERS_2D - -{0x098E, 0x6865, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_LL_ALGO_ENTER] -{0x0990, 0x00E0, WORD_LEN, 0 }, // MCU_DATA_0 -//{0x098E, 0x6C65, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_LL_ALGO_ENTER] -//{0x0990, 0x00E0, WORD_LEN, 0 }, // MCU_DATA_0 - - - -//Noise reduction RN compensation - -{0x098E, 0x494B, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_START_GAIN_METRIC] -{0x0990, 0x0042, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x494D, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_STOP_GAIN_METRIC] -{0x0990, 0x012C, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC91E, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_START_0] -{0x0990, 0x0012, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC91F, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_START_1] -{0x0990, 0x000A, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC920, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_START_2] -{0x0990, 0x0012, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC921, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_START_3] -{0x0990, 0x000A, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC922, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_STOP_0] -{0x0990, 0x0026, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC923, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_STOP_1] -{0x0990, 0x001E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC924, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_STOP_2] -{0x0990, 0x0026, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC925, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_NR_STOP_3] -{0x0990, 0x0026, WORD_LEN, 0 }, // MCU_DATA_0 -{0x316C, 0x350F, WORD_LEN, 0 }, // DAC_TXLO -//Noise Reduction -{0x098E, 0xBC31, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_0] -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC32, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_1] -{0x0990, 0x000D, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC33, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_2] -{0x0990, 0x0019, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC34, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_3] -{0x0990, 0x0030, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC35, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_4] -{0x0990, 0x0056, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC36, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_5] -{0x0990, 0x0070, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC37, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_6] -{0x0990, 0x0081, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC38, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_7] -{0x0990, 0x0090, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC39, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_8] -{0x0990, 0x009E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC3A, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_9] -{0x0990, 0x00AB, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC3B, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_10] -{0x0990, 0x00B6, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC3C, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_11] -{0x0990, 0x00C1, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC3D, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_12] -{0x0990, 0x00CB, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC3E, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_13] -{0x0990, 0x00D5, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC3F, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_14] -{0x0990, 0x00DE, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC40, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_15] -{0x0990, 0x00E7, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC41, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_16] -{0x0990, 0x00EF, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC42, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_17] -{0x0990, 0x00F7, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC43, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_18] -{0x0990, 0x00FF, WORD_LEN, 0 }, // MCU_DATA_0 - - - - - - - -//[Defect correction] - - -{0x098E, 0xBC02, WORD_LEN, 0 }, // MCU_ADDRESS [LL_MODE] -{0x0990, 0x0003, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x6867, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_LL_ALGO_RUN] -{0x0990, 0x00F4, WORD_LEN, 0 }, // MCU_DATA_0 - -{0x098E, 0xBC05, WORD_LEN, 0 }, // MCU_ADDRESS [LL_CLUSTER_DC_TH] -{0x0990, 0x000E, WORD_LEN, 0 }, // MCU_DATA_0 - -{0x098E, 0x8400, WORD_LEN, 0 }, // MCU_ADDRESS [SEQ_CMD] -{0x0990, 0x0006, WORD_LEN, 0 }, // MCU_DATA_0 - - - -//[Position dependent GRB] -{0x098E, 0xC950, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_1] -{0x0990, 0x0064, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC94F, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_0] -{0x0990, 0x0038, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC952, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_3] -{0x0990, 0x0064, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC951, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_2] -{0x0990, 0x0051, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC954, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_5] -{0x0990, 0x0010, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC953, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_4] -{0x0990, 0x0020, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC956, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_7] -{0x0990, 0x0010, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC955, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_START_6] -{0x0990, 0x0020, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC958, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_1] -{0x0990, 0x0020, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC957, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_0] -{0x0990, 0x0014, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC95A, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_3] -{0x0990, 0x001D, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC959, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_2] -{0x0990, 0x0020, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC95C, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_5] -{0x0990, 0x000C, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC95B, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_4] -{0x0990, 0x0008, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC95E, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_7] -{0x0990, 0x000C, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC95D, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_THRESHOLDS_STOP_6] -{0x0990, 0x0008, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC95F, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_EXT_GRB_WINDOW_PERCENT] -{0x0990, 0x0064, WORD_LEN, 0 }, // MCU_DATA_0 - - -//[dark delta ccm settings] -//[grayscale unity] -{0x098E, 0x48DC, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_0] -{0x0990, 0x004D, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48DE, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_1] -{0x0990, 0x0096, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48E0, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_2] -{0x0990, 0x001D, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48E2, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_3] -{0x0990, 0x004D, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48E4, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_4] -{0x0990, 0x0096, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48E6, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_5] -{0x0990, 0x001D, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48E8, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_6] -{0x0990, 0x004D, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48EA, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_7] -{0x0990, 0x0096, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48EC, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_LL_CCM_8] -{0x0990, 0x001D, WORD_LEN, 0 }, // MCU_DATA_0 - - -//[darkccm_range_rev3] -{0x098E, 0xDC2A, WORD_LEN, 0 }, // MCU_ADDRESS [SYS_DELTA_GAIN] -{0x0990, 0x000B, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xDC2B, WORD_LEN, 0 }, // MCU_ADDRESS [SYS_DELTA_THRESH] -{0x0990, 0x0017, WORD_LEN, 0 }, // MCU_DATA_0 - - - -//[Gamma Correction sRGB] -{0x098E, 0xBC0B, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_0] -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC0C, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_1] -{0x0990, 0x001B, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC0D, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_2] -{0x0990, 0x002A, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC0E, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_3] -{0x0990, 0x003E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC0F, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_4] -{0x0990, 0x005A, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC10, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_5] -{0x0990, 0x0070, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC11, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_6] -{0x0990, 0x0081, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC12, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_7] -{0x0990, 0x0090, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC13, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_8] -{0x0990, 0x009E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC14, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_9] -{0x0990, 0x00AB, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC15, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_10] -{0x0990, 0x00B6, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC16, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_11] -{0x0990, 0x00C1, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC17, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_12] -{0x0990, 0x00CB, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC18, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_13] -{0x0990, 0x00D5, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC19, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_14] -{0x0990, 0x00DE, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC1A, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_15] -{0x0990, 0x00E7, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC1B, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_16] -{0x0990, 0x00EF, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC1C, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_17] -{0x0990, 0x00F7, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC1D, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_CONTRAST_CURVE_18] -{0x0990, 0x00FF, WORD_LEN, 0 }, // MCU_DATA_0 - -{0x098E, 0xBC1E, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_0] -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC1F, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_1] -{0x0990, 0x001B, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC20, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_2] -{0x0990, 0x002A, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC21, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_3] -{0x0990, 0x003E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC22, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_4] -{0x0990, 0x005A, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC23, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_5] -{0x0990, 0x0070, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC24, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_6] -{0x0990, 0x0081, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC25, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_7] -{0x0990, 0x0090, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC26, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_8] -{0x0990, 0x009E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC27, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_9] -{0x0990, 0x00AB, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC28, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_10] -{0x0990, 0x00B6, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC29, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_11] -{0x0990, 0x00C1, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC2A, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_12] -{0x0990, 0x00CB, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC2B, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_13] -{0x0990, 0x00D5, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC2C, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_14] -{0x0990, 0x00DE, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC2D, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_15] -{0x0990, 0x00E7, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC2E, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_16] -{0x0990, 0x00EF, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC2F, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_17] -{0x0990, 0x00F7, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC30, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NEUTRAL_CURVE_18] -{0x0990, 0x00FF, WORD_LEN, 0 }, // MCU_DATA_0 - -{0x098E, 0xBC31, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_0] -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC32, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_1] -{0x0990, 0x000D, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC33, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_2] -{0x0990, 0x0019, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC34, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_3] -{0x0990, 0x0030, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC35, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_4] -{0x0990, 0x0056, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC36, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_5] -{0x0990, 0x0070, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC37, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_6] -{0x0990, 0x0081, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC38, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_7] -{0x0990, 0x0090, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC39, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_8] -{0x0990, 0x009E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC3A, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_9] -{0x0990, 0x00AB, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC3B, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_10] -{0x0990, 0x00B6, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC3C, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_11] -{0x0990, 0x00C1, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC3D, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_12] -{0x0990, 0x00CB, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC3E, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_13] -{0x0990, 0x00D5, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC3F, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_14] -{0x0990, 0x00DE, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC40, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_15] -{0x0990, 0x00E7, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC41, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_16] -{0x0990, 0x00EF, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC42, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_17] -{0x0990, 0x00F7, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC43, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_NRCURVE_18] -{0x0990, 0x00FF, WORD_LEN, 0 }, // MCU_DATA_0 - - - -//[TC Initialize] -{0x098E, 0x6865, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_LL_ALGO_ENTER] -{0x0990, 0x00E0, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x6867, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_LL_ALGO_RUN] -{0x0990, 0x00F4, WORD_LEN, 0 }, // MCU_DATA_0 - -{0x098E, 0x8400, WORD_LEN, 0 }, // MCU_ADDRESS [SEQ_CMD] -{0x0990, 0x0006, WORD_LEN, 0 }, // MCU_DATA_0 - - -{0x098E, 0xBC4A, WORD_LEN, 0 }, // MCU_ADDRESS [LL_TONAL_CURVE_HIGH] -{0x0990, 0x007F, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC4B, WORD_LEN, 0 }, // MCU_ADDRESS [LL_TONAL_CURVE_MED] -{0x0990, 0x007F, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xBC4C, WORD_LEN, 0 }, // MCU_ADDRESS [LL_TONAL_CURVE_LOW] -{0x0990, 0x007F, WORD_LEN, 0 }, // MCU_DATA_0 - - -//[Total Curve] -{0x3542, 0x0010, WORD_LEN, 0 }, // TONAL_X0 -{0x3544, 0x0030, WORD_LEN, 0 }, // TONAL_X1 -{0x3546, 0x0040, WORD_LEN, 0 }, // TONAL_X2 -{0x3548, 0x0080, WORD_LEN, 0 }, // TONAL_X3 -{0x354A, 0x0100, WORD_LEN, 0 }, // TONAL_X4 -{0x354C, 0x0200, WORD_LEN, 0 }, // TONAL_X5 -{0x354E, 0x0300, WORD_LEN, 0 }, // TONAL_X6 -{0x3550, 0x0010, WORD_LEN, 0 }, // TONAL_Y0 -{0x3552, 0x0030, WORD_LEN, 0 }, // TONAL_Y1 -{0x3554, 0x0040, WORD_LEN, 0 }, // TONAL_Y2 -{0x3556, 0x0080, WORD_LEN, 0 }, // TONAL_Y3 -{0x3558, 0x0100, WORD_LEN, 0 }, // TONAL_Y4 -{0x355A, 0x0200, WORD_LEN, 0 }, // TONAL_Y5 -{0x355C, 0x0300, WORD_LEN, 0 }, // TONAL_Y6 -{0x3560, 0x0040, WORD_LEN, 0 }, // RECIPROCAL_OF_X0_MINUS_ZERO -{0x3562, 0x0020, WORD_LEN, 0 }, // RECIPROCAL_OF_X1_MINUS_X0 -{0x3564, 0x0040, WORD_LEN, 0 }, // RECIPROCAL_OF_X2_MINUS_X1 -{0x3566, 0x0010, WORD_LEN, 0 }, // RECIPROCAL_OF_X3_MINUS_X2 -{0x3568, 0x0008, WORD_LEN, 0 }, // RECIPROCAL_OF_X4_MINUS_X3 -{0x356A, 0x0004, WORD_LEN, 0 }, // RECIPROCAL_OF_X5_MINUS_X4 -{0x356C, 0x0004, WORD_LEN, 0 }, // RECIPROCAL_OF_X6_MINUS_X5 -{0x356E, 0x0004, WORD_LEN, 0 }, // RECIPROCAL_OF_400_MINUS_X6 - -//{0x3540, 0x0001, WORD_LEN, 0 }, // ENABLE_TONAL_CURVE - -{0x098E, 0xBC08, WORD_LEN, 0 }, // MCU_ADDRESS [LL_GAMMA_SELECT] -{0x0990, 0x0001, WORD_LEN, 0 }, // MCU_DATA_0 //0000 - - -//[Fade To Black] -{0x098E, 0x3C4D, WORD_LEN, 0 }, // MCU_ADDRESS [LL_START_GAMMA_FTB] -{0x0990, 0x0DAC, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x3C4F, WORD_LEN, 0 }, // MCU_ADDRESS [LL_STOP_GAMMA_FTB] -{0x0990, 0x148A, WORD_LEN, 0 }, // MCU_DATA_0 - -//[awb_stat] -{0x098E, 0xC911, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_STAT_LUMA_THRESH_HIGH] -{0x0990, 0x00C8, WORD_LEN, 0 }, // MCU_DATA_0 - - -//[K26A Rev3 Largan798a weight table] -{0x098E, 0xC8F4, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_XSCALE] -{0x0990, 0x0004, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC8F5, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_YSCALE] -{0x0990, 0x0002, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48F6, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_0] -{0x0990, 0x3B4D, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48F8, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_1] -{0x0990, 0x6380, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48FA, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_2] -{0x0990, 0x9B18, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48FC, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_3] -{0x0990, 0x5D51, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48FE, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_4] -{0x0990, 0xEDE8, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4900, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_5] -{0x0990, 0xE515, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4902, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_6] -{0x0990, 0xBFF4, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4904, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_WEIGHTS_7] -{0x0990, 0x001E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4906, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_XSHIFT_PRE_ADJ] -{0x0990, 0x0026, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4908, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_AWB_YSHIFT_PRE_ADJ] -{0x0990, 0x0033, WORD_LEN, 0 }, // MCU_DATA_0 - -//[AWB_CCM Natural] - -{0x098E, 0x48B0, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_0] -{0x0990, 0x0180, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48B2, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_1] -{0x0990, 0xFF7A, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48B4, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_2] -{0x0990, 0x0018, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48B6, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_3] -{0x0990, 0xFFCA, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48B8, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_4] -{0x0990, 0x017C, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48BA, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_5] -{0x0990, 0xFFCC, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48BC, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_6] -{0x0990, 0x000C, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48BE, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_7] -{0x0990, 0xFF1F, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48C0, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_8] -{0x0990, 0x01E8, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48C2, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_9] -{0x0990, 0x0020, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48C4, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_10] -{0x0990, 0x0044, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48C6, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_0] -{0x0990, 0x0079, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48C8, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_1] -{0x0990, 0xFFAD, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48CA, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_2] -{0x0990, 0xFFE2, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48CC, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_3] -{0x0990, 0x0033, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48CE, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_4] -{0x0990, 0x002A, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48D0, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_5] -{0x0990, 0xFFAA, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48D2, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_6] -{0x0990, 0x0017, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48D4, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_7] -{0x0990, 0x004B, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48D6, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_8] -{0x0990, 0xFFA5, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48D8, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_9] -{0x0990, 0x0015, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48DA, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_10] -{0x0990, 0xFFE2, WORD_LEN, 0 }, // MCU_DATA_0 - -{0x098E, 0xE84A, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AWB_K_R_L] -{0x0990, 0x0083, WORD_LEN, 0 }, // MCU_DATA_0 -//{0x098E, 0xE84B, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AWB_K_G_L] -//{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE84C, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AWB_K_B_L] -{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE84D, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AWB_K_R_R] -{0x0990, 0x0083, WORD_LEN, 0 }, // MCU_DATA_0 -//{0x098E, 0xE84E, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AWB_K_G_R] -//{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE84F, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AWB_K_B_R] -{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 - -{0x098E, 0x8400, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AWB_K_B_R] -{0x0990, 0x0006, WORD_LEN, 0 }, // MCU_DATA_0 - -/* -{0x098E, 0x48B0, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_0] -{0x0990, 0x015F, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48B2, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_1] -{0x0990, 0xFFF8, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48B4, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_2] -{0x0990, 0x001A, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48B6, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_3] -{0x0990, 0xFFBA, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48B8, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_4] -{0x0990, 0x0171, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48BA, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_5] -{0x0990, 0xFFD0, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48BC, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_6] -{0x0990, 0x0023, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48BE, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_7] -{0x0990, 0xFF71, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48C0, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_8] -{0x0990, 0x0185, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48C2, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_9] -{0x0990, 0x0020, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48C4, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_L_10] -{0x0990, 0x0050, WORD_LEN, 0 }, // MCU_DATA_0 - -{0x098E, 0x48C6, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_0] -{0x0990, 0xFEA1, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48C8, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_1] -{0x0990, 0x0008, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48CA, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_2] -{0x0990, 0xFFE6, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48CC, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_3] -{0x0990, 0x0046, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48CE, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_4] -{0x0990, 0xFE8F, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48D0, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_5] -{0x0990, 0x0030, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48D2, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_6] -{0x0990, 0xFFDD, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48D4, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_7] -{0x0990, 0x008F, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48D6, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_8] -{0x0990, 0xFE7B, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48D8, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_9] -{0x0990, 0xFFE0, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x48DA, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_CCM_RL_10] -{0x0990, 0xFFB0, WORD_LEN, 0 }, // MCU_DATA_0 - - -{0x098E, 0xE84A, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AWB_K_R_L] -{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE84B, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AWB_K_G_L] -{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE84C, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AWB_K_B_L] -{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE84D, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AWB_K_R_R] -{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE84E, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AWB_K_G_R] -{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE84F, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AWB_K_B_R] -{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 -*/ -//{0x098E, 0xC8EE, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_DGAIN_MIN_R] -//{0x0990, 0x0064, WORD_LEN, 0 }, // MCU_DATA_0 -//{0x098E, 0xC8EF, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_DGAIN_MAX_R] -//{0x0990, 0x0096, WORD_LEN, 0 }, // MCU_DATA_0 -//{0x098E, 0xC8F0, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_DGAIN_MIN_B] -//{0x0990, 0x0064, WORD_LEN, 0 }, // MCU_DATA_0 -//{0x098E, 0xC8F1, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AWB_DGAIN_MAX_B] -//{0x0990, 0x00DC, WORD_LEN, 0 }, // MCU_DATA_0 - - - -//{0x098E, 0xEC4A, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_AWB_K_R_L] -//{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 -//{0x098E, 0xEC4B, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_AWB_K_G_L] -//{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 -//{0x098E, 0xEC4C, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_AWB_K_B_L] -//{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 -//{0x098E, 0xEC4D, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_AWB_K_R_R] -//{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 -//{0x098E, 0xEC4E, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_AWB_K_G_R] -//{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 -//{0x098E, 0xEC4F, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_AWB_K_B_R] -//{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 - -//[Saturation] -{0x35A2, 0x0014, WORD_LEN, 0 }, // DARK_COLOR_KILL_CONTROLS -{0x098E, 0xC949, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_SYS_DARK_COLOR_KILL] -{0x0990, 0x0024, WORD_LEN, 0 }, // MCU_DATA_0 -{0x35A4, 0x0596, WORD_LEN, 0 }, // BRIGHT_COLOR_KILL_CONTROLS -{0x098E, 0xC94A, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_SYS_BRIGHT_COLORKILL] -{0x0990, 0x0062, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC948, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_SYS_UV_COLOR_BOOST] -{0x0990, 0x0006, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC914, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_START_DESATURATION] -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xC915, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_LL_END_DESATURATION] -{0x0990, 0x00FF, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE86F, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_LL_START_SATURATION] -{0x0990, 0x0060, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE870, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_LL_END_SATURATION] -{0x0990, 0x003C, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xEC6F, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_LL_START_SATURATION] -{0x0990, 0x0060, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xEC70, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_LL_END_SATURATION] -{0x0990, 0x003C, WORD_LEN, 0 }, // MCU_DATA_0 - -//[No Special Effects] -{0x098E, 0xE883, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SELECT_FX] -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xEC83, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SELECT_FX] -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 - -{0x098E, 0x8400, WORD_LEN, 0 }, // MCU_ADDRESS [SEQ_CMD] -{0x0990, 0x0006, WORD_LEN, 0 }, // MCU_DATA_0 - -{0x098E, 0xE885, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SEPIA_CR] -{0x0990, 0x001E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE886, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SEPIA_CB] -{0x0990, 0x00D8, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xEC85, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SEPIA_CR] -{0x0990, 0x001E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xEC86, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SEPIA_CB] -{0x0990, 0x00D8, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xE884, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SOLARIZATION_TH] -{0x0990, 0x005C, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xEC84, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SOLARIZATION_TH] -{0x0990, 0x005C, WORD_LEN, 0 }, // MCU_DATA_0 - - -//[AS Normal] -{0x098E, 0x490A, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AS_INTEG_SCALE_FIRST_PASS] -{0x0990, 0x0666, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x490C, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AS_MIN_INT_TIME_FIRST_PASS] -{0x0990, 0x0140, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x6857, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_IS_FEATURE_THRESHOLD] -{0x0990, 0x0014, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x685C, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_IS_BLUR_INPUT_PARAMETER] -{0x0990, 0x0005, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x490E, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_AS_MAX_DIGITAL_GAIN_ALLOWED] -{0x0990, 0x00A4, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xB43D, WORD_LEN, 0 }, // MCU_ADDRESS [AS_START_ASVALUES_0] -{0x0990, 0x0031, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xB43E, WORD_LEN, 0 }, // MCU_ADDRESS [AS_START_ASVALUES_1] -{0x0990, 0x001B, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xB43F, WORD_LEN, 0 }, // MCU_ADDRESS [AS_START_ASVALUES_2] -{0x0990, 0x0028, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xB440, WORD_LEN, 0 }, // MCU_ADDRESS [AS_START_ASVALUES_3] -{0x0990, 0x0003, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xB441, WORD_LEN, 0 }, // MCU_ADDRESS [AS_STOP_ASVALUES_0] -{0x0990, 0x00CD, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xB442, WORD_LEN, 0 }, // MCU_ADDRESS [AS_STOP_ASVALUES_1] -{0x0990, 0x0064, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xB443, WORD_LEN, 0 }, // MCU_ADDRESS [AS_STOP_ASVALUES_2] -{0x0990, 0x000F, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xB444, WORD_LEN, 0 }, // MCU_ADDRESS [AS_STOP_ASVALUES_3] -{0x0990, 0x0007, WORD_LEN, 0 }, // MCU_DATA_0 - - -//[Auto focus settings] -/*{0x098E, 0x300D, WORD_LEN, 0 }, // MCU_ADDRESS [AF_FILTERS] -{0x0990, 0x000F, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x3017, WORD_LEN, 0 }, // MCU_ADDRESS [AF_THRESHOLDS] -{0x0990, 0x0F0F, WORD_LEN, 0 }, // MCU_DATA_0 - -{0x098E, 0x8400, WORD_LEN, 0 }, // MCU_ADDRESS [SEQ_CMD] -{0x0990, 0x0006, WORD_LEN, 0 }, // MCU_DATA_0 - -{0x098E, 0xE81F, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AE_RULE_BASE_TARGET] -{0x0990, 0x0020, WORD_LEN, 0 }, // MCU_DATA_0 -*/ - -//[High Speed Overrides] -{0x098E, 0x68A0, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_JPEG_OB_TX_CONTROL_VAR] -{0x0990, 0x082E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x6CA0, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_JPEG_OB_TX_CONTROL_VAR] -{0x0990, 0x082E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x70A0, WORD_LEN, 0 }, // MCU_ADDRESS [SEC_A_CONFIG_JPEG_OB_TX_CONTROL_VAR] -{0x0990, 0x082E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x74A0, WORD_LEN, 0 }, // MCU_ADDRESS [SEC_B_CONFIG_JPEG_OB_TX_CONTROL_VAR] -{0x0990, 0x082E, WORD_LEN, 0 }, // MCU_DATA_0 -{0x3C52, 0x082E, WORD_LEN, 0 }, // RESERVED_TX_SS_3C52 -{0x098E, 0x488E, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_CTX_B_RX_FIFO_TRIGGER_MARK] -{0x0990, 0x0020, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xECAC, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_IO_OB_MANUAL_FLAG] -{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0 - - - - -//[VAA_LOW_POWER] -{0x3084, 0x2409, WORD_LEN, 0 }, // RESERVED_CORE_3084 -{0x3092, 0x0A49, WORD_LEN, 0 }, // RESERVED_CORE_3092 -{0x3094, 0x4949, WORD_LEN, 0 }, // RESERVED_CORE_3094 -{0x3096, 0x4950, WORD_LEN, 0 }, // RESERVED_CORE_3096 - - -//[Hot Pixels] -{0x316C, 0x350F, WORD_LEN, 0 }, // RESERVED_CORE_316C - - -//patch rev3 -{0x0982, 0x0000, WORD_LEN, 0 }, // ACCESS_CTL_STAT -{0x098A, 0x0CFB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x3C3C, WORD_LEN, 0 }, -{0x0992, 0x3C3C, WORD_LEN, 0 }, -{0x0994, 0x3C3C, WORD_LEN, 0 }, -{0x0996, 0x5F4F, WORD_LEN, 0 }, -{0x0998, 0x30ED, WORD_LEN, 0 }, -{0x099A, 0x0AED, WORD_LEN, 0 }, -{0x099C, 0x08BD, WORD_LEN, 0 }, -{0x099E, 0x61D5, WORD_LEN, 0 }, -{0x098A, 0x0D0B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xCE04, WORD_LEN, 0 }, -{0x0992, 0xCD1F, WORD_LEN, 0 }, -{0x0994, 0x1702, WORD_LEN, 0 }, -{0x0996, 0x11CC, WORD_LEN, 0 }, -{0x0998, 0x332E, WORD_LEN, 0 }, -{0x099A, 0x30ED, WORD_LEN, 0 }, -{0x099C, 0x02CC, WORD_LEN, 0 }, -{0x099E, 0xFFFD, WORD_LEN, 0 }, -{0x098A, 0x0D1B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xED00, WORD_LEN, 0 }, -{0x0992, 0xCC00, WORD_LEN, 0 }, -{0x0994, 0x02BD, WORD_LEN, 0 }, -{0x0996, 0x706D, WORD_LEN, 0 }, -{0x0998, 0x18DE, WORD_LEN, 0 }, -{0x099A, 0x1F18, WORD_LEN, 0 }, -{0x099C, 0x1F8E, WORD_LEN, 0 }, -{0x099E, 0x0110, WORD_LEN, 0 }, -{0x098A, 0x0D2B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xCC3C, WORD_LEN, 0 }, -{0x0992, 0x5230, WORD_LEN, 0 }, -{0x0994, 0xED00, WORD_LEN, 0 }, -{0x0996, 0x18EC, WORD_LEN, 0 }, -{0x0998, 0xA0C4, WORD_LEN, 0 }, -{0x099A, 0xFDBD, WORD_LEN, 0 }, -{0x099C, 0x7021, WORD_LEN, 0 }, -{0x099E, 0x201E, WORD_LEN, 0 }, -{0x098A, 0x0D3B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xCC3C, WORD_LEN, 0 }, -{0x0992, 0x5230, WORD_LEN, 0 }, -{0x0994, 0xED00, WORD_LEN, 0 }, -{0x0996, 0xDE1F, WORD_LEN, 0 }, -{0x0998, 0xECA0, WORD_LEN, 0 }, -{0x099A, 0xBD70, WORD_LEN, 0 }, -{0x099C, 0x21CC, WORD_LEN, 0 }, -{0x099E, 0x3C52, WORD_LEN, 0 }, -{0x098A, 0x0D4B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x30ED, WORD_LEN, 0 }, -{0x0992, 0x02CC, WORD_LEN, 0 }, -{0x0994, 0xFFFC, WORD_LEN, 0 }, -{0x0996, 0xED00, WORD_LEN, 0 }, -{0x0998, 0xCC00, WORD_LEN, 0 }, -{0x099A, 0x02BD, WORD_LEN, 0 }, -{0x099C, 0x706D, WORD_LEN, 0 }, -{0x099E, 0xFC04, WORD_LEN, 0 }, -{0x098A, 0x0D5B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xE11A, WORD_LEN, 0 }, -{0x0992, 0x8300, WORD_LEN, 0 }, -{0x0994, 0x0127, WORD_LEN, 0 }, -{0x0996, 0x201A, WORD_LEN, 0 }, -{0x0998, 0x8300, WORD_LEN, 0 }, -{0x099A, 0x0427, WORD_LEN, 0 }, -{0x099C, 0x221A, WORD_LEN, 0 }, -{0x099E, 0x8300, WORD_LEN, 0 }, -{0x098A, 0x0D6B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0827, WORD_LEN, 0 }, -{0x0992, 0x241A, WORD_LEN, 0 }, -{0x0994, 0x8300, WORD_LEN, 0 }, -{0x0996, 0x1027, WORD_LEN, 0 }, -{0x0998, 0x261A, WORD_LEN, 0 }, -{0x099A, 0x8300, WORD_LEN, 0 }, -{0x099C, 0x2027, WORD_LEN, 0 }, -{0x099E, 0x281A, WORD_LEN, 0 }, -{0x098A, 0x0D7B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x8300, WORD_LEN, 0 }, -{0x0992, 0x4027, WORD_LEN, 0 }, -{0x0994, 0x2A20, WORD_LEN, 0 }, -{0x0996, 0x2ECC, WORD_LEN, 0 }, -{0x0998, 0x001E, WORD_LEN, 0 }, -{0x099A, 0x30ED, WORD_LEN, 0 }, -{0x099C, 0x0A20, WORD_LEN, 0 }, -{0x099E, 0x26CC, WORD_LEN, 0 }, -{0x098A, 0x0D8B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0022, WORD_LEN, 0 }, -{0x0992, 0x30ED, WORD_LEN, 0 }, -{0x0994, 0x0A20, WORD_LEN, 0 }, -{0x0996, 0x1ECC, WORD_LEN, 0 }, -{0x0998, 0x0021, WORD_LEN, 0 }, -{0x099A, 0x30ED, WORD_LEN, 0 }, -{0x099C, 0x0A20, WORD_LEN, 0 }, -{0x099E, 0x16CC, WORD_LEN, 0 }, -{0x098A, 0x0D9B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0020, WORD_LEN, 0 }, -{0x0992, 0x30ED, WORD_LEN, 0 }, -{0x0994, 0x0A20, WORD_LEN, 0 }, -{0x0996, 0x0ECC, WORD_LEN, 0 }, -{0x0998, 0x002A, WORD_LEN, 0 }, -{0x099A, 0x30ED, WORD_LEN, 0 }, -{0x099C, 0x0A20, WORD_LEN, 0 }, -{0x099E, 0x06CC, WORD_LEN, 0 }, -{0x098A, 0x0DAB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x002B, WORD_LEN, 0 }, -{0x0992, 0x30ED, WORD_LEN, 0 }, -{0x0994, 0x0ACC, WORD_LEN, 0 }, -{0x0996, 0x3400, WORD_LEN, 0 }, -{0x0998, 0x30ED, WORD_LEN, 0 }, -{0x099A, 0x0034, WORD_LEN, 0 }, -{0x099C, 0xBD6F, WORD_LEN, 0 }, -{0x099E, 0xD184, WORD_LEN, 0 }, -{0x098A, 0x0DBB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0330, WORD_LEN, 0 }, -{0x0992, 0xED07, WORD_LEN, 0 }, -{0x0994, 0xA60C, WORD_LEN, 0 }, -{0x0996, 0x4848, WORD_LEN, 0 }, -{0x0998, 0x5FED, WORD_LEN, 0 }, -{0x099A, 0x05EC, WORD_LEN, 0 }, -{0x099C, 0x07EA, WORD_LEN, 0 }, -{0x099E, 0x06AA, WORD_LEN, 0 }, -{0x098A, 0x0DCB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0531, WORD_LEN, 0 }, -{0x0992, 0xBD70, WORD_LEN, 0 }, -{0x0994, 0x21DE, WORD_LEN, 0 }, -{0x0996, 0x1F1F, WORD_LEN, 0 }, -{0x0998, 0x8E01, WORD_LEN, 0 }, -{0x099A, 0x08EC, WORD_LEN, 0 }, -{0x099C, 0x9B05, WORD_LEN, 0 }, -{0x099E, 0x30ED, WORD_LEN, 0 }, -{0x098A, 0x0DDB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0820, WORD_LEN, 0 }, -{0x0992, 0x3BDE, WORD_LEN, 0 }, -{0x0994, 0x1FEC, WORD_LEN, 0 }, -{0x0996, 0x0783, WORD_LEN, 0 }, -{0x0998, 0x0040, WORD_LEN, 0 }, -{0x099A, 0x2628, WORD_LEN, 0 }, -{0x099C, 0x7F30, WORD_LEN, 0 }, -{0x099E, 0xC4CC, WORD_LEN, 0 }, -{0x098A, 0x0DEB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x3C68, WORD_LEN, 0 }, -{0x0992, 0xBD6F, WORD_LEN, 0 }, -{0x0994, 0xD1FD, WORD_LEN, 0 }, -{0x0996, 0x30C5, WORD_LEN, 0 }, -{0x0998, 0xCC01, WORD_LEN, 0 }, -{0x099A, 0xF4FD, WORD_LEN, 0 }, -{0x099C, 0x30C7, WORD_LEN, 0 }, -{0x099E, 0xC640, WORD_LEN, 0 }, -{0x098A, 0x0DFB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xF730, WORD_LEN, 0 }, -{0x0992, 0xC4CC, WORD_LEN, 0 }, -{0x0994, 0x0190, WORD_LEN, 0 }, -{0x0996, 0xFD30, WORD_LEN, 0 }, -{0x0998, 0xC501, WORD_LEN, 0 }, -{0x099A, 0x0101, WORD_LEN, 0 }, -{0x099C, 0xFC30, WORD_LEN, 0 }, -{0x099E, 0xC230, WORD_LEN, 0 }, -{0x098A, 0x0E0B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xED08, WORD_LEN, 0 }, -{0x0992, 0x200A, WORD_LEN, 0 }, -{0x0994, 0xCC3C, WORD_LEN, 0 }, -{0x0996, 0x68BD, WORD_LEN, 0 }, -{0x0998, 0x6FD1, WORD_LEN, 0 }, -{0x099A, 0x0530, WORD_LEN, 0 }, -{0x099C, 0xED08, WORD_LEN, 0 }, -{0x099E, 0xCC34, WORD_LEN, 0 }, -{0x098A, 0x0E1B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x08ED, WORD_LEN, 0 }, -{0x0992, 0x00EC, WORD_LEN, 0 }, -{0x0994, 0x08BD, WORD_LEN, 0 }, -{0x0996, 0x7021, WORD_LEN, 0 }, -{0x0998, 0x30C6, WORD_LEN, 0 }, -{0x099A, 0x0C3A, WORD_LEN, 0 }, -{0x099C, 0x3539, WORD_LEN, 0 }, -{0x099E, 0x373C, WORD_LEN, 0 }, -{0x098A, 0x0E2B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x3C3C, WORD_LEN, 0 }, -{0x0992, 0x34DE, WORD_LEN, 0 }, -{0x0994, 0x2FEE, WORD_LEN, 0 }, -{0x0996, 0x0EAD, WORD_LEN, 0 }, -{0x0998, 0x007D, WORD_LEN, 0 }, -{0x099A, 0x13EF, WORD_LEN, 0 }, -{0x099C, 0x277C, WORD_LEN, 0 }, -{0x099E, 0xCE13, WORD_LEN, 0 }, -{0x098A, 0x0E3B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xE01E, WORD_LEN, 0 }, -{0x0992, 0x0510, WORD_LEN, 0 }, -{0x0994, 0x60E6, WORD_LEN, 0 }, -{0x0996, 0x0E4F, WORD_LEN, 0 }, -{0x0998, 0xC313, WORD_LEN, 0 }, -{0x099A, 0xF08F, WORD_LEN, 0 }, -{0x099C, 0xE600, WORD_LEN, 0 }, -{0x099E, 0x30E1, WORD_LEN, 0 }, -{0x098A, 0x0E4B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0722, WORD_LEN, 0 }, -{0x0992, 0x16F6, WORD_LEN, 0 }, -{0x0994, 0x13EE, WORD_LEN, 0 }, -{0x0996, 0x4FC3, WORD_LEN, 0 }, -{0x0998, 0x13F3, WORD_LEN, 0 }, -{0x099A, 0x8FE6, WORD_LEN, 0 }, -{0x099C, 0x0030, WORD_LEN, 0 }, -{0x099E, 0xE107, WORD_LEN, 0 }, -{0x098A, 0x0E5B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x2507, WORD_LEN, 0 }, -{0x0992, 0xF613, WORD_LEN, 0 }, -{0x0994, 0xEEC1, WORD_LEN, 0 }, -{0x0996, 0x0325, WORD_LEN, 0 }, -{0x0998, 0x3C7F, WORD_LEN, 0 }, -{0x099A, 0x13EE, WORD_LEN, 0 }, -{0x099C, 0xF613, WORD_LEN, 0 }, -{0x099E, 0xEFE7, WORD_LEN, 0 }, -{0x098A, 0x0E6B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x06CC, WORD_LEN, 0 }, -{0x0992, 0x13F0, WORD_LEN, 0 }, -{0x0994, 0xED04, WORD_LEN, 0 }, -{0x0996, 0xCC13, WORD_LEN, 0 }, -{0x0998, 0xF320, WORD_LEN, 0 }, -{0x099A, 0x0F7C, WORD_LEN, 0 }, -{0x099C, 0x13EE, WORD_LEN, 0 }, -{0x099E, 0xEC04, WORD_LEN, 0 }, -{0x098A, 0x0E7B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xC300, WORD_LEN, 0 }, -{0x0992, 0x01ED, WORD_LEN, 0 }, -{0x0994, 0x04EC, WORD_LEN, 0 }, -{0x0996, 0x02C3, WORD_LEN, 0 }, -{0x0998, 0x0001, WORD_LEN, 0 }, -{0x099A, 0xED02, WORD_LEN, 0 }, -{0x099C, 0xF613, WORD_LEN, 0 }, -{0x099E, 0xEEE1, WORD_LEN, 0 }, -{0x098A, 0x0E8B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0624, WORD_LEN, 0 }, -{0x0992, 0x12EE, WORD_LEN, 0 }, -{0x0994, 0x04E6, WORD_LEN, 0 }, -{0x0996, 0x0030, WORD_LEN, 0 }, -{0x0998, 0xE107, WORD_LEN, 0 }, -{0x099A, 0x22DF, WORD_LEN, 0 }, -{0x099C, 0xEE02, WORD_LEN, 0 }, -{0x099E, 0xE600, WORD_LEN, 0 }, -{0x098A, 0x0E9B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x30E1, WORD_LEN, 0 }, -{0x0992, 0x0725, WORD_LEN, 0 }, -{0x0994, 0xD6DE, WORD_LEN, 0 }, -{0x0996, 0x49EE, WORD_LEN, 0 }, -{0x0998, 0x08AD, WORD_LEN, 0 }, -{0x099A, 0x00CC, WORD_LEN, 0 }, -{0x099C, 0x13F6, WORD_LEN, 0 }, -{0x099E, 0x30ED, WORD_LEN, 0 }, -{0x098A, 0x0EAB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x00DE, WORD_LEN, 0 }, -{0x0992, 0x2FEE, WORD_LEN, 0 }, -{0x0994, 0x10CC, WORD_LEN, 0 }, -{0x0996, 0x13FA, WORD_LEN, 0 }, -{0x0998, 0xAD00, WORD_LEN, 0 }, -{0x099A, 0x3838, WORD_LEN, 0 }, -{0x099C, 0x3838, WORD_LEN, 0 }, -{0x099E, 0x3937, WORD_LEN, 0 }, -{0x098A, 0x0EBB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x363C, WORD_LEN, 0 }, -{0x0992, 0x3C3C, WORD_LEN, 0 }, -{0x0994, 0x5F4F, WORD_LEN, 0 }, -{0x0996, 0x30ED, WORD_LEN, 0 }, -{0x0998, 0x04EC, WORD_LEN, 0 }, -{0x099A, 0x06ED, WORD_LEN, 0 }, -{0x099C, 0x008F, WORD_LEN, 0 }, -{0x099E, 0xC300, WORD_LEN, 0 }, -{0x098A, 0x0ECB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x04BD, WORD_LEN, 0 }, -{0x0992, 0x0F43, WORD_LEN, 0 }, -{0x0994, 0x30EC, WORD_LEN, 0 }, -{0x0996, 0x04BD, WORD_LEN, 0 }, -{0x0998, 0x0F76, WORD_LEN, 0 }, -{0x099A, 0x30ED, WORD_LEN, 0 }, -{0x099C, 0x0238, WORD_LEN, 0 }, -{0x099E, 0x3838, WORD_LEN, 0 }, -{0x098A, 0x0EDB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x3839, WORD_LEN, 0 }, -{0x0992, 0x373C, WORD_LEN, 0 }, -{0x0994, 0x3C3C, WORD_LEN, 0 }, -{0x0996, 0x3C30, WORD_LEN, 0 }, -{0x0998, 0xE608, WORD_LEN, 0 }, -{0x099A, 0x2712, WORD_LEN, 0 }, -{0x099C, 0xC101, WORD_LEN, 0 }, -{0x099E, 0x2713, WORD_LEN, 0 }, -{0x098A, 0x0EEB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xC102, WORD_LEN, 0 }, -{0x0992, 0x2714, WORD_LEN, 0 }, -{0x0994, 0xC103, WORD_LEN, 0 }, -{0x0996, 0x2715, WORD_LEN, 0 }, -{0x0998, 0xC104, WORD_LEN, 0 }, -{0x099A, 0x2716, WORD_LEN, 0 }, -{0x099C, 0x2019, WORD_LEN, 0 }, -{0x099E, 0xCC30, WORD_LEN, 0 }, -{0x098A, 0x0EFB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x5E20, WORD_LEN, 0 }, -{0x0992, 0x12CC, WORD_LEN, 0 }, -{0x0994, 0x305A, WORD_LEN, 0 }, -{0x0996, 0x200D, WORD_LEN, 0 }, -{0x0998, 0xCC30, WORD_LEN, 0 }, -{0x099A, 0x5620, WORD_LEN, 0 }, -{0x099C, 0x08CC, WORD_LEN, 0 }, -{0x099E, 0x305C, WORD_LEN, 0 }, -{0x098A, 0x0F0B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x2003, WORD_LEN, 0 }, -{0x0992, 0xCC30, WORD_LEN, 0 }, -{0x0994, 0x58ED, WORD_LEN, 0 }, -{0x0996, 0x065F, WORD_LEN, 0 }, -{0x0998, 0x4FED, WORD_LEN, 0 }, -{0x099A, 0x04EC, WORD_LEN, 0 }, -{0x099C, 0x0BED, WORD_LEN, 0 }, -{0x099E, 0x008F, WORD_LEN, 0 }, -{0x098A, 0x0F1B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xC300, WORD_LEN, 0 }, -{0x0992, 0x04BD, WORD_LEN, 0 }, -{0x0994, 0x0F43, WORD_LEN, 0 }, -{0x0996, 0x30EC, WORD_LEN, 0 }, -{0x0998, 0x048A, WORD_LEN, 0 }, -{0x099A, 0x02ED, WORD_LEN, 0 }, -{0x099C, 0x02EC, WORD_LEN, 0 }, -{0x099E, 0x06ED, WORD_LEN, 0 }, -{0x098A, 0x0F2B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x008F, WORD_LEN, 0 }, -{0x0992, 0xC300, WORD_LEN, 0 }, -{0x0994, 0x02DE, WORD_LEN, 0 }, -{0x0996, 0x0EAD, WORD_LEN, 0 }, -{0x0998, 0x0030, WORD_LEN, 0 }, -{0x099A, 0xEC04, WORD_LEN, 0 }, -{0x099C, 0xBD0F, WORD_LEN, 0 }, -{0x099E, 0x7630, WORD_LEN, 0 }, -{0x098A, 0x0F3B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xED02, WORD_LEN, 0 }, -{0x0992, 0x3838, WORD_LEN, 0 }, -{0x0994, 0x3838, WORD_LEN, 0 }, -{0x0996, 0x3139, WORD_LEN, 0 }, -{0x0998, 0x3736, WORD_LEN, 0 }, -{0x099A, 0x30EC, WORD_LEN, 0 }, -{0x099C, 0x041A, WORD_LEN, 0 }, -{0x099E, 0x8300, WORD_LEN, 0 }, -{0x098A, 0x0F4B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x4025, WORD_LEN, 0 }, -{0x0992, 0x22EC, WORD_LEN, 0 }, -{0x0994, 0x041A, WORD_LEN, 0 }, -{0x0996, 0x8300, WORD_LEN, 0 }, -{0x0998, 0x8024, WORD_LEN, 0 }, -{0x099A, 0x0504, WORD_LEN, 0 }, -{0x099C, 0xCA40, WORD_LEN, 0 }, -{0x099E, 0x2015, WORD_LEN, 0 }, -{0x098A, 0x0F5B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xEC04, WORD_LEN, 0 }, -{0x0992, 0x1A83, WORD_LEN, 0 }, -{0x0994, 0x0100, WORD_LEN, 0 }, -{0x0996, 0x2406, WORD_LEN, 0 }, -{0x0998, 0x0404, WORD_LEN, 0 }, -{0x099A, 0xCA80, WORD_LEN, 0 }, -{0x099C, 0x2007, WORD_LEN, 0 }, -{0x099E, 0xEC04, WORD_LEN, 0 }, -{0x098A, 0x0F6B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0404, WORD_LEN, 0 }, -{0x0992, 0x04CA, WORD_LEN, 0 }, -{0x0994, 0xC0EE, WORD_LEN, 0 }, -{0x0996, 0x00ED, WORD_LEN, 0 }, -{0x0998, 0x0038, WORD_LEN, 0 }, -{0x099A, 0x3937, WORD_LEN, 0 }, -{0x099C, 0x363C, WORD_LEN, 0 }, -{0x099E, 0x301F, WORD_LEN, 0 }, -{0x098A, 0x0F7B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0340, WORD_LEN, 0 }, -{0x0992, 0x0E1F, WORD_LEN, 0 }, -{0x0994, 0x0380, WORD_LEN, 0 }, -{0x0996, 0x0AEC, WORD_LEN, 0 }, -{0x0998, 0x02C4, WORD_LEN, 0 }, -{0x099A, 0x3F4F, WORD_LEN, 0 }, -{0x099C, 0x0505, WORD_LEN, 0 }, -{0x099E, 0x0520, WORD_LEN, 0 }, -{0x098A, 0x0F8B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x1B1F, WORD_LEN, 0 }, -{0x0992, 0x0380, WORD_LEN, 0 }, -{0x0994, 0x09EC, WORD_LEN, 0 }, -{0x0996, 0x02C4, WORD_LEN, 0 }, -{0x0998, 0x3F4F, WORD_LEN, 0 }, -{0x099A, 0x0505, WORD_LEN, 0 }, -{0x099C, 0x200E, WORD_LEN, 0 }, -{0x099E, 0x1F03, WORD_LEN, 0 }, -{0x098A, 0x0F9B, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x4008, WORD_LEN, 0 }, -{0x0992, 0xEC02, WORD_LEN, 0 }, -{0x0994, 0xC43F, WORD_LEN, 0 }, -{0x0996, 0x4F05, WORD_LEN, 0 }, -{0x0998, 0x2002, WORD_LEN, 0 }, -{0x099A, 0xEC02, WORD_LEN, 0 }, -{0x099C, 0xED00, WORD_LEN, 0 }, -{0x099E, 0x3838, WORD_LEN, 0 }, -{0x098A, 0x8FAB, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0039, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098A, 0x1000, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xCC10, WORD_LEN, 0 }, -{0x0992, 0x09BD, WORD_LEN, 0 }, -{0x0994, 0x4224, WORD_LEN, 0 }, -{0x0996, 0x7E10, WORD_LEN, 0 }, -{0x0998, 0x09C6, WORD_LEN, 0 }, -{0x099A, 0x01F7, WORD_LEN, 0 }, -{0x099C, 0x018A, WORD_LEN, 0 }, -{0x099E, 0xC609, WORD_LEN, 0 }, -{0x098A, 0x1010, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xF701, WORD_LEN, 0 }, -{0x0992, 0x8BDE, WORD_LEN, 0 }, -{0x0994, 0x3F18, WORD_LEN, 0 }, -{0x0996, 0xCE0B, WORD_LEN, 0 }, -{0x0998, 0xF3CC, WORD_LEN, 0 }, -{0x099A, 0x0011, WORD_LEN, 0 }, -{0x099C, 0xBDD7, WORD_LEN, 0 }, -{0x099E, 0x00CC, WORD_LEN, 0 }, -{0x098A, 0x1020, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0BF3, WORD_LEN, 0 }, -{0x0992, 0xDD3F, WORD_LEN, 0 }, -{0x0994, 0xDE35, WORD_LEN, 0 }, -{0x0996, 0x18CE, WORD_LEN, 0 }, -{0x0998, 0x0C05, WORD_LEN, 0 }, -{0x099A, 0xCC00, WORD_LEN, 0 }, -{0x099C, 0x3FBD, WORD_LEN, 0 }, -{0x099E, 0xD700, WORD_LEN, 0 }, -{0x098A, 0x1030, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xCC0C, WORD_LEN, 0 }, -{0x0992, 0x05DD, WORD_LEN, 0 }, -{0x0994, 0x35DE, WORD_LEN, 0 }, -{0x0996, 0x4718, WORD_LEN, 0 }, -{0x0998, 0xCE0C, WORD_LEN, 0 }, -{0x099A, 0x45CC, WORD_LEN, 0 }, -{0x099C, 0x0015, WORD_LEN, 0 }, -{0x099E, 0xBDD7, WORD_LEN, 0 }, -{0x098A, 0x1040, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x00CC, WORD_LEN, 0 }, -{0x0992, 0x0C45, WORD_LEN, 0 }, -{0x0994, 0xDD47, WORD_LEN, 0 }, -{0x0996, 0xFE00, WORD_LEN, 0 }, -{0x0998, 0x3318, WORD_LEN, 0 }, -{0x099A, 0xCE0C, WORD_LEN, 0 }, -{0x099C, 0x5BCC, WORD_LEN, 0 }, -{0x099E, 0x0009, WORD_LEN, 0 }, -{0x098A, 0x1050, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xBDD7, WORD_LEN, 0 }, -{0x0992, 0x00CC, WORD_LEN, 0 }, -{0x0994, 0x0C5B, WORD_LEN, 0 }, -{0x0996, 0xFD00, WORD_LEN, 0 }, -{0x0998, 0x33DE, WORD_LEN, 0 }, -{0x099A, 0x3118, WORD_LEN, 0 }, -{0x099C, 0xCE0C, WORD_LEN, 0 }, -{0x099E, 0x65CC, WORD_LEN, 0 }, -{0x098A, 0x1060, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0029, WORD_LEN, 0 }, -{0x0992, 0xBDD7, WORD_LEN, 0 }, -{0x0994, 0x00CC, WORD_LEN, 0 }, -{0x0996, 0x0C65, WORD_LEN, 0 }, -{0x0998, 0xDD31, WORD_LEN, 0 }, -{0x099A, 0xDE39, WORD_LEN, 0 }, -{0x099C, 0x18CE, WORD_LEN, 0 }, -{0x099E, 0x0C8F, WORD_LEN, 0 }, -{0x098A, 0x1070, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xCC00, WORD_LEN, 0 }, -{0x0992, 0x23BD, WORD_LEN, 0 }, -{0x0994, 0xD700, WORD_LEN, 0 }, -{0x0996, 0xCC0C, WORD_LEN, 0 }, -{0x0998, 0x8FDD, WORD_LEN, 0 }, -{0x099A, 0x39DE, WORD_LEN, 0 }, -{0x099C, 0x4918, WORD_LEN, 0 }, -{0x099E, 0xCE0C, WORD_LEN, 0 }, -{0x098A, 0x1080, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xB3CC, WORD_LEN, 0 }, -{0x0992, 0x000D, WORD_LEN, 0 }, -{0x0994, 0xBDD7, WORD_LEN, 0 }, -{0x0996, 0x00CC, WORD_LEN, 0 }, -{0x0998, 0x0CB3, WORD_LEN, 0 }, -{0x099A, 0xDD49, WORD_LEN, 0 }, -{0x099C, 0xFC04, WORD_LEN, 0 }, -{0x099E, 0xC2FD, WORD_LEN, 0 }, -{0x098A, 0x1090, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0BF1, WORD_LEN, 0 }, -{0x0992, 0x18FE, WORD_LEN, 0 }, -{0x0994, 0x0BF1, WORD_LEN, 0 }, -{0x0996, 0xCDEE, WORD_LEN, 0 }, -{0x0998, 0x1518, WORD_LEN, 0 }, -{0x099A, 0xCE0C, WORD_LEN, 0 }, -{0x099C, 0xC1CC, WORD_LEN, 0 }, -{0x099E, 0x0029, WORD_LEN, 0 }, -{0x098A, 0x10A0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xBDD7, WORD_LEN, 0 }, -{0x0992, 0x00FE, WORD_LEN, 0 }, -{0x0994, 0x0BF1, WORD_LEN, 0 }, -{0x0996, 0xCC0C, WORD_LEN, 0 }, -{0x0998, 0xC1ED, WORD_LEN, 0 }, -{0x099A, 0x15CC, WORD_LEN, 0 }, -{0x099C, 0x11A5, WORD_LEN, 0 }, -{0x099E, 0xFD0B, WORD_LEN, 0 }, -{0x098A, 0x10B0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xFFCC, WORD_LEN, 0 }, -{0x0992, 0x0CFB, WORD_LEN, 0 }, -{0x0994, 0xFD0C, WORD_LEN, 0 }, -{0x0996, 0x21CC, WORD_LEN, 0 }, -{0x0998, 0x128F, WORD_LEN, 0 }, -{0x099A, 0xFD0C, WORD_LEN, 0 }, -{0x099C, 0x53CC, WORD_LEN, 0 }, -{0x099E, 0x114E, WORD_LEN, 0 }, -{0x098A, 0x10C0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xFD0C, WORD_LEN, 0 }, -{0x0992, 0x5DCC, WORD_LEN, 0 }, -{0x0994, 0x10E2, WORD_LEN, 0 }, -{0x0996, 0xFD0C, WORD_LEN, 0 }, -{0x0998, 0x6FCC, WORD_LEN, 0 }, -{0x099A, 0x0EDD, WORD_LEN, 0 }, -{0x099C, 0xFD0C, WORD_LEN, 0 }, -{0x099E, 0xD7CC, WORD_LEN, 0 }, -{0x098A, 0x10D0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0EBA, WORD_LEN, 0 }, -{0x0992, 0xFD0C, WORD_LEN, 0 }, -{0x0994, 0xE9CC, WORD_LEN, 0 }, -{0x0996, 0x1350, WORD_LEN, 0 }, -{0x0998, 0xFD0C, WORD_LEN, 0 }, -{0x099A, 0x9BCC, WORD_LEN, 0 }, -{0x099C, 0x0E29, WORD_LEN, 0 }, -{0x099E, 0xFD0C, WORD_LEN, 0 }, -{0x098A, 0x10E0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xBF39, WORD_LEN, 0 }, -{0x0992, 0x373C, WORD_LEN, 0 }, -{0x0994, 0x3CDE, WORD_LEN, 0 }, -{0x0996, 0x1DEC, WORD_LEN, 0 }, -{0x0998, 0x0C5F, WORD_LEN, 0 }, -{0x099A, 0x8402, WORD_LEN, 0 }, -{0x099C, 0x4416, WORD_LEN, 0 }, -{0x099E, 0x4FF7, WORD_LEN, 0 }, -{0x098A, 0x10F0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0CEB, WORD_LEN, 0 }, -{0x0992, 0xE60B, WORD_LEN, 0 }, -{0x0994, 0xC407, WORD_LEN, 0 }, -{0x0996, 0xF70C, WORD_LEN, 0 }, -{0x0998, 0xEC7F, WORD_LEN, 0 }, -{0x099A, 0x30C4, WORD_LEN, 0 }, -{0x099C, 0xEC25, WORD_LEN, 0 }, -{0x099E, 0xFD30, WORD_LEN, 0 }, -{0x098A, 0x1100, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xC5FC, WORD_LEN, 0 }, -{0x0992, 0x06D6, WORD_LEN, 0 }, -{0x0994, 0xFD30, WORD_LEN, 0 }, -{0x0996, 0xC701, WORD_LEN, 0 }, -{0x0998, 0xFC30, WORD_LEN, 0 }, -{0x099A, 0xC0FD, WORD_LEN, 0 }, -{0x099C, 0x0BED, WORD_LEN, 0 }, -{0x099E, 0xFC30, WORD_LEN, 0 }, -{0x098A, 0x1110, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xC2FD, WORD_LEN, 0 }, -{0x0992, 0x0BEF, WORD_LEN, 0 }, -{0x0994, 0xFC04, WORD_LEN, 0 }, -{0x0996, 0xC283, WORD_LEN, 0 }, -{0x0998, 0xFFFF, WORD_LEN, 0 }, -{0x099A, 0x2728, WORD_LEN, 0 }, -{0x099C, 0xDE06, WORD_LEN, 0 }, -{0x099E, 0xEC22, WORD_LEN, 0 }, -{0x098A, 0x1120, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x8322, WORD_LEN, 0 }, -{0x0992, 0x0026, WORD_LEN, 0 }, -{0x0994, 0x1FCC, WORD_LEN, 0 }, -{0x0996, 0x3064, WORD_LEN, 0 }, -{0x0998, 0x30ED, WORD_LEN, 0 }, -{0x099A, 0x008F, WORD_LEN, 0 }, -{0x099C, 0xC300, WORD_LEN, 0 }, -{0x099E, 0x02DE, WORD_LEN, 0 }, -{0x098A, 0x1130, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0CAD, WORD_LEN, 0 }, -{0x0992, 0x0030, WORD_LEN, 0 }, -{0x0994, 0x1D02, WORD_LEN, 0 }, -{0x0996, 0x01CC, WORD_LEN, 0 }, -{0x0998, 0x3064, WORD_LEN, 0 }, -{0x099A, 0xED00, WORD_LEN, 0 }, -{0x099C, 0x8FC3, WORD_LEN, 0 }, -{0x099E, 0x0002, WORD_LEN, 0 }, -{0x098A, 0x1140, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xDE0E, WORD_LEN, 0 }, -{0x0992, 0xAD00, WORD_LEN, 0 }, -{0x0994, 0x30E6, WORD_LEN, 0 }, -{0x0996, 0x04BD, WORD_LEN, 0 }, -{0x0998, 0x5203, WORD_LEN, 0 }, -{0x099A, 0x3838, WORD_LEN, 0 }, -{0x099C, 0x3139, WORD_LEN, 0 }, -{0x099E, 0x3C3C, WORD_LEN, 0 }, -{0x098A, 0x1150, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x3C21, WORD_LEN, 0 }, -{0x0992, 0x01CC, WORD_LEN, 0 }, -{0x0994, 0x0018, WORD_LEN, 0 }, -{0x0996, 0xBD6F, WORD_LEN, 0 }, -{0x0998, 0xD1C5, WORD_LEN, 0 }, -{0x099A, 0x0426, WORD_LEN, 0 }, -{0x099C, 0xF5DC, WORD_LEN, 0 }, -{0x099E, 0x2530, WORD_LEN, 0 }, -{0x098A, 0x1160, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xED04, WORD_LEN, 0 }, -{0x0992, 0x2012, WORD_LEN, 0 }, -{0x0994, 0xEE04, WORD_LEN, 0 }, -{0x0996, 0x3C18, WORD_LEN, 0 }, -{0x0998, 0x38E6, WORD_LEN, 0 }, -{0x099A, 0x2118, WORD_LEN, 0 }, -{0x099C, 0xE7BE, WORD_LEN, 0 }, -{0x099E, 0x30EE, WORD_LEN, 0 }, -{0x098A, 0x1170, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x04EC, WORD_LEN, 0 }, -{0x0992, 0x1D30, WORD_LEN, 0 }, -{0x0994, 0xED04, WORD_LEN, 0 }, -{0x0996, 0xEC04, WORD_LEN, 0 }, -{0x0998, 0x26EA, WORD_LEN, 0 }, -{0x099A, 0xCC00, WORD_LEN, 0 }, -{0x099C, 0x1AED, WORD_LEN, 0 }, -{0x099E, 0x02CC, WORD_LEN, 0 }, -{0x098A, 0x1180, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xFBFF, WORD_LEN, 0 }, -{0x0992, 0xED00, WORD_LEN, 0 }, -{0x0994, 0xCC04, WORD_LEN, 0 }, -{0x0996, 0x00BD, WORD_LEN, 0 }, -{0x0998, 0x706D, WORD_LEN, 0 }, -{0x099A, 0xCC00, WORD_LEN, 0 }, -{0x099C, 0x1A30, WORD_LEN, 0 }, -{0x099E, 0xED02, WORD_LEN, 0 }, -{0x098A, 0x1190, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xCCFB, WORD_LEN, 0 }, -{0x0992, 0xFFED, WORD_LEN, 0 }, -{0x0994, 0x005F, WORD_LEN, 0 }, -{0x0996, 0x4FBD, WORD_LEN, 0 }, -{0x0998, 0x706D, WORD_LEN, 0 }, -{0x099A, 0x5FBD, WORD_LEN, 0 }, -{0x099C, 0x5B17, WORD_LEN, 0 }, -{0x099E, 0xBD55, WORD_LEN, 0 }, -{0x098A, 0x11A0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x8B38, WORD_LEN, 0 }, -{0x0992, 0x3838, WORD_LEN, 0 }, -{0x0994, 0x393C, WORD_LEN, 0 }, -{0x0996, 0x3CC6, WORD_LEN, 0 }, -{0x0998, 0x40F7, WORD_LEN, 0 }, -{0x099A, 0x30C4, WORD_LEN, 0 }, -{0x099C, 0xFC0B, WORD_LEN, 0 }, -{0x099E, 0xEDFD, WORD_LEN, 0 }, -{0x098A, 0x11B0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x30C0, WORD_LEN, 0 }, -{0x0992, 0xFC0B, WORD_LEN, 0 }, -{0x0994, 0xEFFD, WORD_LEN, 0 }, -{0x0996, 0x30C2, WORD_LEN, 0 }, -{0x0998, 0xDE1D, WORD_LEN, 0 }, -{0x099A, 0xEC25, WORD_LEN, 0 }, -{0x099C, 0xFD30, WORD_LEN, 0 }, -{0x099E, 0xC501, WORD_LEN, 0 }, -{0x098A, 0x11C0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0101, WORD_LEN, 0 }, -{0x0992, 0xFC30, WORD_LEN, 0 }, -{0x0994, 0xC2FD, WORD_LEN, 0 }, -{0x0996, 0x06D6, WORD_LEN, 0 }, -{0x0998, 0xEC0C, WORD_LEN, 0 }, -{0x099A, 0x5F84, WORD_LEN, 0 }, -{0x099C, 0x0244, WORD_LEN, 0 }, -{0x099E, 0x164F, WORD_LEN, 0 }, -{0x098A, 0x11D0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x30E7, WORD_LEN, 0 }, -{0x0992, 0x03F1, WORD_LEN, 0 }, -{0x0994, 0x0CEB, WORD_LEN, 0 }, -{0x0996, 0x2715, WORD_LEN, 0 }, -{0x0998, 0xF10C, WORD_LEN, 0 }, -{0x099A, 0xEB23, WORD_LEN, 0 }, -{0x099C, 0x09FC, WORD_LEN, 0 }, -{0x099E, 0x06D6, WORD_LEN, 0 }, -{0x098A, 0x11E0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x04FD, WORD_LEN, 0 }, -{0x0992, 0x06D6, WORD_LEN, 0 }, -{0x0994, 0x2007, WORD_LEN, 0 }, -{0x0996, 0xFC06, WORD_LEN, 0 }, -{0x0998, 0xD605, WORD_LEN, 0 }, -{0x099A, 0xFD06, WORD_LEN, 0 }, -{0x099C, 0xD6DE, WORD_LEN, 0 }, -{0x099E, 0x1DE6, WORD_LEN, 0 }, -{0x098A, 0x11F0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0BC4, WORD_LEN, 0 }, -{0x0992, 0x0730, WORD_LEN, 0 }, -{0x0994, 0xE702, WORD_LEN, 0 }, -{0x0996, 0xF10C, WORD_LEN, 0 }, -{0x0998, 0xEC27, WORD_LEN, 0 }, -{0x099A, 0x2C7D, WORD_LEN, 0 }, -{0x099C, 0x0CEC, WORD_LEN, 0 }, -{0x099E, 0x2727, WORD_LEN, 0 }, -{0x098A, 0x1200, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x5D27, WORD_LEN, 0 }, -{0x0992, 0x247F, WORD_LEN, 0 }, -{0x0994, 0x30C4, WORD_LEN, 0 }, -{0x0996, 0xFC06, WORD_LEN, 0 }, -{0x0998, 0xD6FD, WORD_LEN, 0 }, -{0x099A, 0x30C5, WORD_LEN, 0 }, -{0x099C, 0xF60C, WORD_LEN, 0 }, -{0x099E, 0xEC4F, WORD_LEN, 0 }, -{0x098A, 0x1210, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xFD30, WORD_LEN, 0 }, -{0x0992, 0xC7C6, WORD_LEN, 0 }, -{0x0994, 0x40F7, WORD_LEN, 0 }, -{0x0996, 0x30C4, WORD_LEN, 0 }, -{0x0998, 0xE602, WORD_LEN, 0 }, -{0x099A, 0x4FFD, WORD_LEN, 0 }, -{0x099C, 0x30C5, WORD_LEN, 0 }, -{0x099E, 0x0101, WORD_LEN, 0 }, -{0x098A, 0x1220, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x01FC, WORD_LEN, 0 }, -{0x0992, 0x30C2, WORD_LEN, 0 }, -{0x0994, 0xFD06, WORD_LEN, 0 }, -{0x0996, 0xD67D, WORD_LEN, 0 }, -{0x0998, 0x06CB, WORD_LEN, 0 }, -{0x099A, 0x272E, WORD_LEN, 0 }, -{0x099C, 0xC640, WORD_LEN, 0 }, -{0x099E, 0xF730, WORD_LEN, 0 }, -{0x098A, 0x1230, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xC4FC, WORD_LEN, 0 }, -{0x0992, 0x06C1, WORD_LEN, 0 }, -{0x0994, 0x04F3, WORD_LEN, 0 }, -{0x0996, 0x06D6, WORD_LEN, 0 }, -{0x0998, 0xED00, WORD_LEN, 0 }, -{0x099A, 0x5F6D, WORD_LEN, 0 }, -{0x099C, 0x002A, WORD_LEN, 0 }, -{0x099E, 0x0153, WORD_LEN, 0 }, -{0x098A, 0x1240, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x17FD, WORD_LEN, 0 }, -{0x0992, 0x30C0, WORD_LEN, 0 }, -{0x0994, 0xEC00, WORD_LEN, 0 }, -{0x0996, 0xFD30, WORD_LEN, 0 }, -{0x0998, 0xC2FC, WORD_LEN, 0 }, -{0x099A, 0x06C1, WORD_LEN, 0 }, -{0x099C, 0xFD30, WORD_LEN, 0 }, -{0x099E, 0xC501, WORD_LEN, 0 }, -{0x098A, 0x1250, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x0101, WORD_LEN, 0 }, -{0x0992, 0xFC30, WORD_LEN, 0 }, -{0x0994, 0xC2FD, WORD_LEN, 0 }, -{0x0996, 0x06C7, WORD_LEN, 0 }, -{0x0998, 0x2022, WORD_LEN, 0 }, -{0x099A, 0x7F30, WORD_LEN, 0 }, -{0x099C, 0xC4DE, WORD_LEN, 0 }, -{0x099E, 0x1DEC, WORD_LEN, 0 }, -{0x098A, 0x1260, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x25FD, WORD_LEN, 0 }, -{0x0992, 0x30C5, WORD_LEN, 0 }, -{0x0994, 0xFC06, WORD_LEN, 0 }, -{0x0996, 0xD6FD, WORD_LEN, 0 }, -{0x0998, 0x30C7, WORD_LEN, 0 }, -{0x099A, 0x01FC, WORD_LEN, 0 }, -{0x099C, 0x30C0, WORD_LEN, 0 }, -{0x099E, 0xFD06, WORD_LEN, 0 }, -{0x098A, 0x1270, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xD0FC, WORD_LEN, 0 }, -{0x0992, 0x30C2, WORD_LEN, 0 }, -{0x0994, 0xFD06, WORD_LEN, 0 }, -{0x0996, 0xD2EC, WORD_LEN, 0 }, -{0x0998, 0x25FD, WORD_LEN, 0 }, -{0x099A, 0x06C3, WORD_LEN, 0 }, -{0x099C, 0xBD95, WORD_LEN, 0 }, -{0x099E, 0x3CDE, WORD_LEN, 0 }, -{0x098A, 0x1280, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x3FEE, WORD_LEN, 0 }, -{0x0992, 0x10AD, WORD_LEN, 0 }, -{0x0994, 0x00DE, WORD_LEN, 0 }, -{0x0996, 0x1DFC, WORD_LEN, 0 }, -{0x0998, 0x06CC, WORD_LEN, 0 }, -{0x099A, 0xED3E, WORD_LEN, 0 }, -{0x099C, 0x3838, WORD_LEN, 0 }, -{0x099E, 0x3930, WORD_LEN, 0 }, -{0x098A, 0x1290, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x8FC3, WORD_LEN, 0 }, -{0x0992, 0xFFEC, WORD_LEN, 0 }, -{0x0994, 0x8F35, WORD_LEN, 0 }, -{0x0996, 0xBDAD, WORD_LEN, 0 }, -{0x0998, 0x15DE, WORD_LEN, 0 }, -{0x099A, 0x198F, WORD_LEN, 0 }, -{0x099C, 0xC301, WORD_LEN, 0 }, -{0x099E, 0x4B8F, WORD_LEN, 0 }, -{0x098A, 0x12A0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xEC00, WORD_LEN, 0 }, -{0x0992, 0xFD05, WORD_LEN, 0 }, -{0x0994, 0x0EEC, WORD_LEN, 0 }, -{0x0996, 0x02FD, WORD_LEN, 0 }, -{0x0998, 0x0510, WORD_LEN, 0 }, -{0x099A, 0x8FC3, WORD_LEN, 0 }, -{0x099C, 0xFFCB, WORD_LEN, 0 }, -{0x099E, 0x8FE6, WORD_LEN, 0 }, -{0x098A, 0x12B0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x00F7, WORD_LEN, 0 }, -{0x0992, 0x0514, WORD_LEN, 0 }, -{0x0994, 0xE603, WORD_LEN, 0 }, -{0x0996, 0xF705, WORD_LEN, 0 }, -{0x0998, 0x15FC, WORD_LEN, 0 }, -{0x099A, 0x055B, WORD_LEN, 0 }, -{0x099C, 0xFD05, WORD_LEN, 0 }, -{0x099E, 0x12DE, WORD_LEN, 0 }, -{0x098A, 0x12C0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x37EE, WORD_LEN, 0 }, -{0x0992, 0x08AD, WORD_LEN, 0 }, -{0x0994, 0x00F6, WORD_LEN, 0 }, -{0x0996, 0x0516, WORD_LEN, 0 }, -{0x0998, 0x4F30, WORD_LEN, 0 }, -{0x099A, 0xED04, WORD_LEN, 0 }, -{0x099C, 0xDE1F, WORD_LEN, 0 }, -{0x099E, 0xEC6B, WORD_LEN, 0 }, -{0x098A, 0x12D0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xFD05, WORD_LEN, 0 }, -{0x0992, 0x0EEC, WORD_LEN, 0 }, -{0x0994, 0x6DFD, WORD_LEN, 0 }, -{0x0996, 0x0510, WORD_LEN, 0 }, -{0x0998, 0xDE19, WORD_LEN, 0 }, -{0x099A, 0x8FC3, WORD_LEN, 0 }, -{0x099C, 0x0117, WORD_LEN, 0 }, -{0x099E, 0x8FE6, WORD_LEN, 0 }, -{0x098A, 0x12E0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x00F7, WORD_LEN, 0 }, -{0x0992, 0x0514, WORD_LEN, 0 }, -{0x0994, 0xE603, WORD_LEN, 0 }, -{0x0996, 0xF705, WORD_LEN, 0 }, -{0x0998, 0x15FC, WORD_LEN, 0 }, -{0x099A, 0x0559, WORD_LEN, 0 }, -{0x099C, 0xFD05, WORD_LEN, 0 }, -{0x099E, 0x12DE, WORD_LEN, 0 }, -{0x098A, 0x12F0, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x37EE, WORD_LEN, 0 }, -{0x0992, 0x08AD, WORD_LEN, 0 }, -{0x0994, 0x00F6, WORD_LEN, 0 }, -{0x0996, 0x0516, WORD_LEN, 0 }, -{0x0998, 0x4F30, WORD_LEN, 0 }, -{0x099A, 0xED06, WORD_LEN, 0 }, -{0x099C, 0xDE1F, WORD_LEN, 0 }, -{0x099E, 0xEC6B, WORD_LEN, 0 }, -{0x098A, 0x1300, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xFD05, WORD_LEN, 0 }, -{0x0992, 0x0EEC, WORD_LEN, 0 }, -{0x0994, 0x6DFD, WORD_LEN, 0 }, -{0x0996, 0x0510, WORD_LEN, 0 }, -{0x0998, 0xDE19, WORD_LEN, 0 }, -{0x099A, 0x8FC3, WORD_LEN, 0 }, -{0x099C, 0x0118, WORD_LEN, 0 }, -{0x099E, 0x8FE6, WORD_LEN, 0 }, -{0x098A, 0x1310, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x00F7, WORD_LEN, 0 }, -{0x0992, 0x0514, WORD_LEN, 0 }, -{0x0994, 0xE603, WORD_LEN, 0 }, -{0x0996, 0xF705, WORD_LEN, 0 }, -{0x0998, 0x15FC, WORD_LEN, 0 }, -{0x099A, 0x0559, WORD_LEN, 0 }, -{0x099C, 0xFD05, WORD_LEN, 0 }, -{0x099E, 0x12DE, WORD_LEN, 0 }, -{0x098A, 0x1320, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x37EE, WORD_LEN, 0 }, -{0x0992, 0x08AD, WORD_LEN, 0 }, -{0x0994, 0x00F6, WORD_LEN, 0 }, -{0x0996, 0x0516, WORD_LEN, 0 }, -{0x0998, 0x4F30, WORD_LEN, 0 }, -{0x099A, 0xED08, WORD_LEN, 0 }, -{0x099C, 0xCC32, WORD_LEN, 0 }, -{0x099E, 0x8EED, WORD_LEN, 0 }, -{0x098A, 0x1330, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x00EC, WORD_LEN, 0 }, -{0x0992, 0x04BD, WORD_LEN, 0 }, -{0x0994, 0x7021, WORD_LEN, 0 }, -{0x0996, 0xCC32, WORD_LEN, 0 }, -{0x0998, 0x6C30, WORD_LEN, 0 }, -{0x099A, 0xED02, WORD_LEN, 0 }, -{0x099C, 0xCCF8, WORD_LEN, 0 }, -{0x099E, 0x00ED, WORD_LEN, 0 }, -{0x098A, 0x1340, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x00A6, WORD_LEN, 0 }, -{0x0992, 0x07E3, WORD_LEN, 0 }, -{0x0994, 0x0884, WORD_LEN, 0 }, -{0x0996, 0x07BD, WORD_LEN, 0 }, -{0x0998, 0x706D, WORD_LEN, 0 }, -{0x099A, 0x30C6, WORD_LEN, 0 }, -{0x099C, 0x143A, WORD_LEN, 0 }, -{0x099E, 0x3539, WORD_LEN, 0 }, -{0x098A, 0x1350, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x3CBD, WORD_LEN, 0 }, -{0x0992, 0x776D, WORD_LEN, 0 }, -{0x0994, 0xCC32, WORD_LEN, 0 }, -{0x0996, 0x5C30, WORD_LEN, 0 }, -{0x0998, 0xED00, WORD_LEN, 0 }, -{0x099A, 0xFC13, WORD_LEN, 0 }, -{0x099C, 0x8683, WORD_LEN, 0 }, -{0x099E, 0x0001, WORD_LEN, 0 }, -{0x098A, 0x1360, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0xBD70, WORD_LEN, 0 }, -{0x0992, 0x21CC, WORD_LEN, 0 }, -{0x0994, 0x325E, WORD_LEN, 0 }, -{0x0996, 0x30ED, WORD_LEN, 0 }, -{0x0998, 0x00FC, WORD_LEN, 0 }, -{0x099A, 0x1388, WORD_LEN, 0 }, -{0x099C, 0x8300, WORD_LEN, 0 }, -{0x099E, 0x01BD, WORD_LEN, 0 }, -{0x098A, 0x1370, WORD_LEN, 0 }, // PHYSICAL_ADDR_ACCESS -{0x0990, 0x7021, WORD_LEN, 0 }, -{0x0992, 0x3839, WORD_LEN, 0 }, - -{0x098E, 0x0010, WORD_LEN, 0 }, // MCU_ADDRESS [MON_ADDR] -{0x0990, 0x1000, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x0003, WORD_LEN, 0 }, // MCU_ADDRESS [MON_ALGO] -{0x0990, 0x0004, WORD_LEN, 0 }, // MCU_DATA_0 -{ SEQUENCE_WAIT_MS,10, WORD_LEN, 0}, -// POLL MON_PATCH_0 => 0x01 -{0x098E, 0x4815, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0004, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x485D, WORD_LEN, 0 }, // MCU_ADDRESS -{0x0990, 0x0004, WORD_LEN, 0 }, // MCU_DATA_0 -{0x0018, 0x0028, WORD_LEN, 0 }, // STANDBY_CONTROL_AND_STATUS -// POLL SEQ_STATE => 0x01, 0x02, ..., 0x03 (11 reads) -{ SEQUENCE_WAIT_MS,10, WORD_LEN, 0}, - -//awb saturation -{0x098E, 0xAC31, WORD_LEN, 0 }, -{0x0990, 0x00E8, WORD_LEN, 0 }, - -// Digital Gain(5 times) / Analog Gain(14 times) - -{0x098E, 0x682F, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AE_TRACK_AE_MAX_VIRT_DGAIN] -{0x0990, 0x0040, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x6837, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AE_TRACK_AE_MAX_VIRT_AGAIN] -{0x0990, 0x0040, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x6839, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AE_TRACK_AE_MAX_VIRT_AGAIN] -{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 - -{0x098E, 0x6835, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AE_TRACK_AE_MAX_VIRT_DGAIN] -{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x6833, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_AE_TRACK_AE_MAX_VIRT_DGAIN] -{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 - - -{0x098E, 0x483E, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_CTX_A_DIGITAL_GAIN] -{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x4886, WORD_LEN, 0 }, // MCU_ADDRESS [CAM1_CTX_B_DIGITAL_GAIN] -{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 - -{0x098E, 0x6C35, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_AE_TRACK_AE_MAX_VIRT_DGAIN] -{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0x6C39, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_B_CONFIG_AE_TRACK_AE_MAX_VIRT_AGAIN] -{0x0990, 0x0080, WORD_LEN, 0 }, // MCU_DATA_0 - -{0x098E, 0xE823, WORD_LEN, 0 }, -{0x0990, 0x0083, WORD_LEN, 0 }, - -{0x098E, 0xE824, WORD_LEN, 0 }, -{0x0990, 0x007C, WORD_LEN, 0 }, - -/*{0x098E, 0x6811, WORD_LEN, 0 }, // MCU_ADDRESS [PRI_A_CONFIG_FD_ALGO_RUN] -{0x0990, 0x0002, WORD_LEN, 0 }, // MCU_DATA_0 -{0x098E, 0xA005, WORD_LEN, 0 }, // MCU_ADDRESS [FD_FDPERIOD_SELECT] -{0x0990, 0x0001, WORD_LEN, 0 }, // MCU_DATA_0 - -{0x098E, 0x8400, WORD_LEN, 0 }, // MCU_ADDRESS [SEQ_CMD] -{0x0990, 0x0005, WORD_LEN, 0 }, // MCU_DATA_0 -*/ -#endif -{ SEQUENCE_END, 0x00, WORD_LEN, 0} -}; - -/* 720p 15fps @ 1280x720 */ - -static struct reginfo sensor_720p[]= -{ - - {SEQUENCE_PROPERTY,SEQUENCE_CAPTURE}, - {SEQUENCE_END, 0x00} -}; - -/* 1080p, 0x15fps, 0xyuv @1920x1080 */ - -static struct reginfo sensor_1080p[]= -{ - {SEQUENCE_PROPERTY,SEQUENCE_CAPTURE}, - {SEQUENCE_END, 0x00} -}; - - -/* 2048*1536 QXGA */ -static struct reginfo sensor_qxga[] = -{ - {SEQUENCE_PROPERTY,SEQUENCE_CAPTURE}, - {0x098E, 0x6C00, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_IMAGE_WIDTH] - {0x0990, 0x0800, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x6C02, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_IMAGE_HEIGHT] - {0x0990, 0x0600, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_WAIT_MS,100, WORD_LEN, 0}, - - {SEQUENCE_END, 0x00} -}; - -/* 1600X1200 UXGA */ -static struct reginfo sensor_uxga[] = -{ - {SEQUENCE_PROPERTY,SEQUENCE_CAPTURE}, - {0x098E, 0x6C00, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_IMAGE_WIDTH] - {0x0990, 0x0640, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x6C02, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_IMAGE_HEIGHT] - {0x0990, 0x04B0, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_WAIT_MS,100, WORD_LEN, 0}, - //{SEQUENCE_PROPERTY,SEQUENCE_CAPTURE}, - {SEQUENCE_END, 0x00} -}; -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {SEQUENCE_PROPERTY,SEQUENCE_CAPTURE}, - {SEQUENCE_END, 0x00} -}; -/* 1024X768 XGA */ -static struct reginfo sensor_xga[] = -{ - {SEQUENCE_PROPERTY,SEQUENCE_CAPTURE}, - {0x098E, 0x6C00, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_IMAGE_WIDTH] - {0x0990, 0x0500, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x6C02, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_IMAGE_HEIGHT] - {0x0990, 0x03C0, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_WAIT_MS,100, WORD_LEN, 0}, - //{SEQUENCE_PROPERTY,SEQUENCE_CAPTURE}, - {SEQUENCE_END, 0x00} -}; - -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - {SEQUENCE_PROPERTY,SEQUENCE_CAPTURE}, - {SEQUENCE_END, 0x00} -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - {0x098E, 0x6800, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_IMAGE_WIDTH] - {0x0990, 0x0280, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x6802, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_IMAGE_HEIGHT] - {0x0990, 0x01E0, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x8400, WORD_LEN, 0}, // MCU_ADDRESS [SEQ_CMD] - {0x0990, 0x0006, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_WAIT_MS,100, WORD_LEN, 0}, - {SEQUENCE_END, 0x00} -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - //{SEQUENCE_PROPERTY,SEQUENCE_CAPTURE}, - {SEQUENCE_END, 0x00} -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {SEQUENCE_END, 0x00} -}; -#endif -static struct reginfo sensor_Preview2Capture[]= -{ - //capture2preview - {0x098E, 0xEC05, WORD_LEN, 0}, - {0x0990, 0x0000, WORD_LEN, 0}, - {0x098E, 0x8400, WORD_LEN, 0}, - {0x0990, 0x0002, WORD_LEN, 0}, - - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Capture2Preview[]= -{ - //snap2preview - {0x098E, 0xEC05, WORD_LEN, 0}, - {0x0990, 0x0005, WORD_LEN, 0}, - {0x098E, 0x8400, WORD_LEN, 0}, - {0x0990, 0x0001, WORD_LEN, 0}, - {0x098E, 0x8400, WORD_LEN, 0}, - {0x0990, 0x0006, WORD_LEN, 0}, - - {SEQUENCE_WAIT_MS,50, WORD_LEN, 0}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {SEQUENCE_END, 0x00} -}; - - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - //Auto - {0x098E, 0x2C03, WORD_LEN, 0}, // MCU_ADDRESS [AWB_ALGO] - {0x0990, 0x01FF, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0xAC02, WORD_LEN, 0}, // MCU_ADDRESS [AWB_MODE] - {0x0990, 0x000A, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x683F, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_AWB_ALGO_RUN] - {0x0990, 0x01FF, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0x8400, WORD_LEN, 0}, // MCU_ADDRESS [SEQ_CMD] - {0x0990, 0x0005, WORD_LEN, 0}, // MCU_DATA_0 - - {SEQUENCE_END, 0x00} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - //[V. DL 7500] - {0x098E, 0x48B0, WORD_LEN, 0}, - {0x0990, 0x01F9, WORD_LEN, 0}, - {0x098E, 0x48B2, WORD_LEN, 0}, - {0x0990, 0xFF27, WORD_LEN, 0}, - {0x098E, 0x48B4, WORD_LEN, 0}, - {0x0990, 0xFFFA, WORD_LEN, 0}, - {0x098E, 0x48B6, WORD_LEN, 0}, - {0x0990, 0xFFFD, WORD_LEN, 0}, - {0x098E, 0x48B8, WORD_LEN, 0}, - {0x0990, 0x01A6, WORD_LEN, 0}, - {0x098E, 0x48BA, WORD_LEN, 0}, - {0x0990, 0xFF76, WORD_LEN, 0}, - {0x098E, 0x48BC, WORD_LEN, 0}, - {0x0990, 0x0023, WORD_LEN, 0}, - {0x098E, 0x48BE, WORD_LEN, 0}, - {0x0990, 0xFF6A, WORD_LEN, 0}, - {0x098E, 0x48C0, WORD_LEN, 0}, - {0x0990, 0x018D, WORD_LEN, 0}, - {0x098E, 0x48C6, WORD_LEN, 0}, - {0x0990, 0x0000, WORD_LEN, 0}, - {0x098E, 0x48C8, WORD_LEN, 0}, - {0x0990, 0x0000, WORD_LEN, 0}, - {0x098E, 0x48CA, WORD_LEN, 0}, - {0x0990, 0x0000, WORD_LEN, 0}, - {0x098E, 0x48CC, WORD_LEN, 0}, - {0x0990, 0x0000, WORD_LEN, 0}, - {0x098E, 0x48CE, WORD_LEN, 0}, - {0x0990, 0x0000, WORD_LEN, 0}, - {0x098E, 0x48D0, WORD_LEN, 0}, - {0x0990, 0x0000, WORD_LEN, 0}, - {0x098E, 0x48D2, WORD_LEN, 0}, - {0x0990, 0x0000, WORD_LEN, 0}, - {0x098E, 0x48D4, WORD_LEN, 0}, - {0x0990, 0x0000, WORD_LEN, 0}, - {0x098E, 0x48D6, WORD_LEN, 0}, - {0x0990, 0x0000, WORD_LEN, 0}, - {0x098E, 0xAC02, WORD_LEN, 0}, - {0x0990, 0x0000, WORD_LEN, 0}, - {0x098E, 0x2C03, WORD_LEN, 0}, - {0x0990, 0x0000, WORD_LEN, 0}, - {0x098E, 0x683F, WORD_LEN, 0}, - {0x0990, 0x0000, WORD_LEN, 0}, - {0x098E, 0xAC3C, WORD_LEN, 0}, - {0x0990, 0x0035, WORD_LEN, 0}, - {0x098E, 0xAC3D, WORD_LEN, 0}, - {0x0990, 0x006E, WORD_LEN, 0}, - {0x098E, 0x8400, WORD_LEN, 0}, - {0x0990, 0x0005, WORD_LEN, 0}, - {SEQUENCE_END, 0x00} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //[IV Day Light] - {0x098E, 0x48B0, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_0] - {0x0990, 0x0131, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48B2, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_1] - {0x0990, 0xFFFB, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48B4, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_2] - {0x0990, 0x000E, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48B6, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_3] - {0x0990, 0xFFD1, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48B8, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_4] - {0x0990, 0x018B, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48BA, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_5] - {0x0990, 0xFFE2, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48BC, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_6] - {0x0990, 0x0014, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48BE, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_7] - {0x0990, 0xFFA7, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48C0, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_8] - {0x0990, 0x0180, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0x48C6, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_0] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48C8, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_1] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48CA, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_2] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48CC, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_3] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48CE, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_4] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48D0, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_5] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48D2, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_6] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48D4, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_7] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48D6, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_8] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0xAC02, WORD_LEN, 0}, // MCU_ADDRESS [AWB_MODE] - {0x0990, 0x0010, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x2C03, WORD_LEN, 0}, // MCU_ADDRESS [AWB_ALGO] - {0x0990, 0x0030, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0xAC3C, WORD_LEN, 0}, - {0x0990, 0x0035, WORD_LEN, 0}, - {0x098E, 0xAC3D, WORD_LEN, 0}, - {0x0990, 0x0068, WORD_LEN, 0}, - {0x098E, 0xAC33, WORD_LEN, 0}, - {0x0990, 0x004D, WORD_LEN, 0}, - - {0x098E, 0x683F, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_AWB_ALGO_RUN] - {0x0990, 0x0030, WORD_LEN, 0}, // MCU_DATA_0 - - {SEQUENCE_END, 0x00} -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - //[III Fluorescent] - {0x098E, 0x48B0, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_0] - {0x0990, 0x0119, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48B2, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_1] - {0x0990, 0xFFFD, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48B4, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_2] - {0x0990, 0x000F, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48B6, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_3] - {0x0990, 0xFFCE, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48B8, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_4] - {0x0990, 0x017A, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48BA, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_5] - {0x0990, 0xFFDE, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48BC, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_6] - {0x0990, 0x0017, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48BE, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_7] - {0x0990, 0xFF9F, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48C0, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_8] - {0x0990, 0x016F, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0x48C6, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_0] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48C8, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_1] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48CA, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_2] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48CC, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_3] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48CE, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_4] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48D0, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_5] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48D2, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_6] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48D4, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_7] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48D6, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_8] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0xAC02, WORD_LEN, 0}, // MCU_ADDRESS [AWB_MODE] - {0x0990, 0x0010, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x2C03, WORD_LEN, 0}, // MCU_ADDRESS [AWB_ALGO] - {0x0990, 0x0030, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0xAC3C, WORD_LEN, 0}, - {0x0990, 0x004A, WORD_LEN, 0}, - {0x098E, 0xAC3D, WORD_LEN, 0}, - {0x0990, 0x0045, WORD_LEN, 0}, - {0x098E, 0xAC33, WORD_LEN, 0}, - {0x0990, 0x0034, WORD_LEN, 0}, - - {0x098E, 0x683F, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_AWB_ALGO_RUN] - {0x0990, 0x0030, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - //[II. Incandescent] - {0x098E, 0x48B0, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_0] - {0x0990, 0x010F, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48B2, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_1] - {0x0990, 0xFFFC, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48B4, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_2] - {0x0990, 0x000F, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48B6, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_3] - {0x0990, 0xFFCD, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48B8, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_4] - {0x0990, 0x0172, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48BA, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_5] - {0x0990, 0xFFDC, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48BC, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_6] - {0x0990, 0x0018, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48BE, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_7] - {0x0990, 0xFF9B, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48C0, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_L_8] - {0x0990, 0x0167, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0x48C6, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_0] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48C8, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_1] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48CA, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_2] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48CC, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_3] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48CE, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_4] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48D0, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_5] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48D2, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_6] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48D4, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_7] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x48D6, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_AWB_CCM_RL_8] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0xAC02, WORD_LEN, 0}, // MCU_ADDRESS [AWB_MODE] - {0x0990, 0x0010, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x2C03, WORD_LEN, 0}, // MCU_ADDRESS [AWB_ALGO] - {0x0990, 0x0030, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0xAC3C, WORD_LEN, 0}, - {0x0990, 0x005A, WORD_LEN, 0}, - {0x098E, 0xAC3D, WORD_LEN, 0}, - {0x0990, 0x0037, WORD_LEN, 0}, - {0x098E, 0xAC33, WORD_LEN, 0}, - {0x0990, 0x0027, WORD_LEN, 0}, - - {0x098E, 0x683F, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_AWB_ALGO_RUN] - {0x0990, 0x0030, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x098E, 0xE883, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SELECT_FX] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0xEC83, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SELECT_FX] - {0x0990, 0x0000, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0x8400, WORD_LEN, 0}, // MCU_ADDRESS [SEQ_CMD] - {0x0990, 0x0006, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; - -/*static struct reginfo sensor_Effect_WandB[] = -{ - {SEQUENCE_END, 0x00} -};*/ - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x098E, 0xE886, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SEPIA_CB] - {0x0990, 0x00D9, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0xE885, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SEPIA_CR] - {0x0990, 0x0018, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0xEC86, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SEPIA_CB] - {0x0990, 0x00D9, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0xEC85, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SEPIA_CR] - {0x0990, 0x0018, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0xE883, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SELECT_FX] - {0x0990, 0x0002, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0xEC83, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SELECT_FX] - {0x0990, 0x0002, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0x8400, WORD_LEN, 0}, // MCU_ADDRESS [SEQ_CMD] - {0x0990, 0x0006, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - {0x098E, 0xE883, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SELECT_FX] - {0x0990, 0x0003, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0xEC83, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SELECT_FX] - {0x0990, 0x0003, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0x8400, WORD_LEN, 0}, // MCU_ADDRESS [SEQ_CMD] - {0x0990, 0x0006, WORD_LEN, 0}, // MCU_DATA_0 - - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - {0x098E, 0xE886, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SEPIA_CB] - {0x0990, 0x0039, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0xE885, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SEPIA_CR] - {0x0990, 0x00E8, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0xEC86, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SEPIA_CB] - {0x0990, 0x0039, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0xEC85, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SEPIA_CR] - {0x0990, 0x00E8, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0xE883, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SELECT_FX] - {0x0990, 0x0002, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0xEC83, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SELECT_FX] - {0x0990, 0x0002, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0x8400, WORD_LEN, 0}, // MCU_ADDRESS [SEQ_CMD] - {0x0990, 0x0006, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - {0x098E, 0xE886, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SEPIA_CB] - {0x0990, 0x00D4, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0xE885, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SEPIA_CR] - {0x0990, 0x00E8, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0xEC86, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SEPIA_CB] - {0x0990, 0x00D4, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0xEC85, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SEPIA_CR] - {0x0990, 0x00E8, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0xE883, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SELECT_FX] - {0x0990, 0x0002, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0xEC83, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SELECT_FX] - {0x0990, 0x0002, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0x8400, WORD_LEN, 0}, // MCU_ADDRESS [SEQ_CMD] - {0x0990, 0x0006, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Solarize[] = -{ - {0x098E, 0xE883, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SELECT_FX] - {0x0990, 0x0004, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0xEC83, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SELECT_FX] - {0x0990, 0x0004, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0x8400, WORD_LEN, 0}, // MCU_ADDRESS [SEQ_CMD] - {0x0990, 0x0006, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; - - -static struct reginfo sensor_Effect_Grayscale[] = -{ - {0x098E, 0xE883, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_SYSCTRL_SELECT_FX] - {0x0990, 0x0001, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0xEC83, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_CONFIG_SYSCTRL_SELECT_FX] - {0x0990, 0x0001, WORD_LEN, 0}, // MCU_DATA_0 - - {0x098E, 0x8400, WORD_LEN, 0}, // MCU_ADDRESS [SEQ_CMD] - {0x0990, 0x0006, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; - - -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Solarize,sensor_Effect_Bluish,sensor_Effect_Green,sensor_Effect_Grayscale,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - {0x098E, 0xE81F, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_AE_RULE_BASE_TARGET] - {0x0990, 0x000C, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0xEC1F, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_CONFIG_AE_RULE_BASE_TARGET] - {0x0990, 0x000C, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure1[]= -{ - {0x098E, 0xE81F, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_AE_RULE_BASE_TARGET] - {0x0990, 0x0011, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0xEC1F, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_CONFIG_AE_RULE_BASE_TARGET] - {0x0990, 0x0011, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - {0x098E, 0xE81F, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_AE_RULE_BASE_TARGET] - {0x0990, 0x0016, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0xEC1F, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_CONFIG_AE_RULE_BASE_TARGET] - {0x0990, 0x0016, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - {0x098E, 0xE81F, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_AE_RULE_BASE_TARGET] - {0x0990, 0x001B, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0xEC1F, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_CONFIG_AE_RULE_BASE_TARGET] - {0x0990, 0x001B, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - {0x098E, 0xE81F, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_AE_RULE_BASE_TARGET] - {0x0990, 0x0020, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0xEC1F, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_CONFIG_AE_RULE_BASE_TARGET] - {0x0990, 0x0020, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - {0x098E, 0xE81F, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_AE_RULE_BASE_TARGET] - {0x0990, 0x0025, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0xEC1F, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_CONFIG_AE_RULE_BASE_TARGET] - {0x0990, 0x0025, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - {0x098E, 0xE81F, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_AE_RULE_BASE_TARGET] - {0x0990, 0x002A, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0xEC1F, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_CONFIG_AE_RULE_BASE_TARGET] - {0x0990, 0x002A, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure7[]= -{ - {0x098E, 0xE81F, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_AE_RULE_BASE_TARGET] - {0x0990, 0x002F, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0xEC1F, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_CONFIG_AE_RULE_BASE_TARGET] - {0x0990, 0x002F, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure8[]= -{ - {0x098E, 0xE81F, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_CONFIG_AE_RULE_BASE_TARGET] - {0x0990, 0x0034, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0xEC1F, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_CONFIG_AE_RULE_BASE_TARGET] - {0x0990, 0x0034, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,sensor_Exposure7,sensor_Exposure8,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast2[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - {SEQUENCE_END, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ - {0x098E, 0x483E, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_CTX_A_DIGITAL_GAIN] - {0x0990, 0x0120, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x8400, WORD_LEN, 0}, // MCU_ADDRESS [SEQ_CMD] - {0x0990, 0x0006, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_SceneNight[] = -{ - {0x098E, 0x483E, WORD_LEN, 0}, // MCU_ADDRESS [CAM1_CTX_A_DIGITAL_GAIN] - {0x0990, 0x0080, WORD_LEN, 0}, // MCU_DATA_0 - {0x098E, 0x8400, WORD_LEN, 0}, // MCU_ADDRESS [SEQ_CMD] - {0x0990, 0x0006, WORD_LEN, 0}, // MCU_DATA_0 - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Zoom1[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Zoom2[] = -{ - {SEQUENCE_END, 0x00} -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL}; -#endif -static struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "negative", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "sepia", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "solarize", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "bluish", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 5, .name = "green", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 6, .name = "graycale", .reserved = 0,}, - #endif -#if CONFIG_SENSOR_Exposure - { .id = V4L2_CID_EXPOSURE, .index = 0, .name = "-4", .reserved = 0, }, { .id = V4L2_CID_EXPOSURE, .index = 1, .name = "-3", .reserved = 0,}, - { .id = V4L2_CID_EXPOSURE, .index = 2, .name = "-2", .reserved = 0,}, { .id = V4L2_CID_EXPOSURE, .index = 3, .name = "-1", .reserved = 0,}, - { .id = V4L2_CID_EXPOSURE, .index = 4, .name = "0", .reserved = 0, }, { .id = V4L2_CID_EXPOSURE, .index = 5, .name = "+1", .reserved = 0,}, - { .id = V4L2_CID_EXPOSURE, .index = 6, .name = "+2", .reserved = 0, }, { .id = V4L2_CID_EXPOSURE, .index = 7, .name = "+3", .reserved = 0,}, - { .id = V4L2_CID_EXPOSURE, .index = 8, .name = "+4", .reserved = 0, }, -#endif - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - - //{ .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "on", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 8, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - /*{ - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - { - .id = V4L2_CID_FOCUS_AUTO, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Focus Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - },*/{ - .id = V4L2_CID_FOCUS_CONTINUOUS, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Focus Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - // .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - //.maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; - - -enum sensor_work_state -{ - sensor_work_ready = 0, - sensor_working, -}; -struct sensor_work -{ - struct i2c_client *client; - struct delayed_work dwork; - enum sensor_work_state state; -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int auto_focus; - int affm_reinit; - int flash; - int exposure; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - bool snap2preview; - bool video2preview; - int capture_w; - int capture_h; - int preview_w; - int preview_h; - struct reginfo *winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int enable; - unsigned int funmodule_state; -} sensor_info_priv_t; - - - -struct sensor_parameter -{ - unsigned short int preview_maxlines; - unsigned short int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int capture_framerate; - unsigned short int preview_framerate; -}; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - struct sensor_parameter parameter; - struct workqueue_struct *sensor_wq; - struct sensor_work sensor_wk; - struct mutex wq_lock; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif -} - -/* sensor register write */ - -#if CONFIG_SENSOR_WRITE_REGS -static int sensor_write_regs(struct i2c_client *client, u8 *reg_info, int num) -{ - int err=0,cnt; - struct i2c_msg msg[1]; - - msg->len = num; - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = reg_info; - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - - cnt= 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg failed, try to write again!\n", SENSOR_NAME_STRING()); - udelay(10); - } - } - - return err; - -} - -#endif - -static int sensor_write(struct i2c_client *client, struct reginfo *reg_info) -{ - int err=0,cnt; - u8 buf[4]; - struct i2c_msg msg[1]; - - switch (reg_info->reg) - { - case SEQUENCE_WAIT_MS: - { - if (in_atomic()) - mdelay(reg_info->val); - else - msleep(reg_info->val); - break; - } - - case SEQUENCE_WAIT_US: - { - udelay(reg_info->val); - break; - } - - case SEQUENCE_PROPERTY: - { - break; - } - default: - { - buf[0] = reg_info->reg >> 8; - buf[1] = reg_info->reg & 0xFF; - if (reg_info->reg_len == WORD_LEN) { - buf[2] = reg_info->val >> 8; - buf[3] = reg_info->val & 0xFF; - - msg->len = 4; - } else if (reg_info->reg_len == BYTE_LEN) { - buf[2] = reg_info->val; - msg->len = 3; - } - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg_info->reg, reg_info->val); - udelay(10); - } - } - } - } - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u16 reg, u16 *val) -{ - int err,cnt; - u8 buf[2]; - u16 temp_val; - struct i2c_msg msg[2]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 2; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - temp_val = buf[0]; - temp_val = temp_val << 8; - temp_val = temp_val |buf[1]; - *val = temp_val; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_WRITE_REGS - int j = 0, reg_num; - u8 *ptemp, *phead; - int reg_length = 2; -#endif - -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - while (regarray[i].reg != SEQUENCE_END) { -#if CONFIG_SENSOR_WRITE_REGS - j = i; - reg_num = 1; - - if(WORD_LEN == regarray[i].reg_len) { - reg_length = 0x0002; - } else if (BYTE_LEN == regarray[i].reg_len) { - reg_length = 0x0001; - } - - while((regarray[i].reg + reg_length) == regarray[i+1].reg) { - i++; - reg_num++; - } - - if(reg_num > 1) { - int size_num; - - if(0x0002 == reg_length) { - size_num = 2*(reg_num + 1); - } else { - size_num = reg_num + 1; - } - - ptemp = phead = (u8*)kmalloc(size_num*sizeof(u8),GFP_KERNEL); - if (phead == NULL) { - SENSOR_TR("%s write registers allocate memory fail!!!\n",SENSOR_NAME_STRING()); - i = j; - err = sensor_write(client, ®array[i]); - } else { - *phead = regarray[j].reg >> 8; - *(ptemp+1) = regarray[j].reg & 0xFF; - - ptemp += 2; - - if(0x0002 == reg_length) { - int temp = 0; - for( ; reg_num > 0; reg_num --, j++, temp ++) { - *(ptemp + 2*temp) = regarray[j].val >> 8; - *(ptemp + 2*temp + 1) = regarray[j].val & 0xFF; - } - } else { - for( ; reg_num > 0; reg_num --, j++) - { - *ptemp ++ = regarray[j].val; - } - } - - ptemp = phead; - err = sensor_write_regs(client, ptemp,size_num); - kfree(phead); - } - } else { - err = sensor_write(client, ®array[i]); - } -#else - err = sensor_write(client, ®array[i]); -#endif - if (err < 0) { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - - i++; - } - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != SEQUENCE_END) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif -#if CONFIG_SENSOR_Focus -static struct reginfo sensor_af_init0[] = -{ - {0x098E, 0x4403, WORD_LEN, 0}, - {0x0990, 0x8001, WORD_LEN, 0}, - {0x098E, 0x440B, WORD_LEN, 0}, - {0x0990, 0x0000, WORD_LEN, 0}, //032 - {0x098E, 0x440D, WORD_LEN, 0}, - {0x0990, 0x03B6, WORD_LEN, 0}, - {0x098E, 0x8400, WORD_LEN, 0}, - {0x0990, 0x0006, WORD_LEN, 0}, - - - {0x098E, 0x3003, WORD_LEN, 0}, - {0x0990, 0x0001, WORD_LEN, 0}, - {0x098E, 0xB024, WORD_LEN, 0}, - {0x0990, 0x0000, WORD_LEN, 0}, - {0x098E, 0x3003, WORD_LEN, 0}, - {0x0990, 0x0010, WORD_LEN, 0}, - {0x098E, 0xB019, WORD_LEN, 0}, - {0x0990, 0x0001, WORD_LEN, 0}, - {0x098E, 0xB019, WORD_LEN, 0}, - {0x0990, 0x0001, WORD_LEN, 0}, - {0x098E, 0xB019, WORD_LEN, 0}, - {0x0990, 0x0001, WORD_LEN, 0}, - {SEQUENCE_END, 0x00} -}; - - -static struct reginfo sensor_af_trigger[] = -{ - {SEQUENCE_END, 0x00} -}; -static int sensor_af_single(struct i2c_client *client) -{ - int ret = 0; - - ret = sensor_write_array(client, sensor_af_trigger); - if (ret<0) - { - SENSOR_TR("%s sensor auto focus trigger fail!!\n",SENSOR_NAME_STRING()); - goto sensor_af_single_end; - }else{ - SENSOR_DG("%s sensor auto focus trigger success!\n",SENSOR_NAME_STRING()); - } -sensor_af_single_end: - return ret; -} - -static int sensor_af_const(struct i2c_client *client) -{ - int ret = 0; - -//sensor_af_const_end: - return ret; -} -#if 0 -static int sensor_af_zoneupdate(struct i2c_client *client) -{ - int ret = 0; - - return ret; -} -#endif -static int sensor_af_init(struct i2c_client *client) -{ - int ret = 0; - - ret = sensor_write_array(client, sensor_af_init0); - if (ret<0) { - SENSOR_TR("%s sensor auto focus init_0 fail!!",SENSOR_NAME_STRING()); - } - - return ret; -} -#endif - -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } - -sensor_power_end: - return ret; -} - - -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} - -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - int ret,pid = 0; -#if (SENSOR_RESET_REG != SEQUENCE_END) - struct reginfo reg_info; -#endif - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - -#if (SENSOR_RESET_REG != SEQUENCE_END) - reg_info.reg = SENSOR_RESET_REG; - reg_info.val = SENSOR_RESET_VAL; - reg_info.reg_len = SENSOR_RESET_REG_LEN; - ret = sensor_write(client, ®_info); - if (ret != 0) { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); //delay 5 microseconds -#endif - /* check if it is an sensor sensor */ -#if (SENSOR_ID_REG != SEQUENCE_END) - ret = sensor_read(client, SENSOR_ID_REG, &pid); - if (ret != 0) { - SENSOR_TR("read chip id failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - SENSOR_DG("\n %s pid = 0x%x \n", SENSOR_NAME_STRING(), pid); -#else - pid = SENSOR_ID; -#endif - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - - sensor->info_priv.preview_w = SENSOR_INIT_WIDTH; - sensor->info_priv.preview_h = SENSOR_INIT_HEIGHT; - sensor->info_priv.capture_w = SENSOR_MAX_WIDTH; - sensor->info_priv.capture_h = SENSOR_MAX_HEIGHT; - sensor->info_priv.winseqe_cur_addr = SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #if CONFIG_SENSOR_Focus - if (sensor_af_init(client) < 0) { - sensor->info_priv.funmodule_state &= ~SENSOR_AF_IS_OK; - } else { - sensor->info_priv.funmodule_state |= SENSOR_AF_IS_OK; - } - #endif - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - { - sensor->info_priv.flash = qctrl->default_value; - } - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - - - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - u16 reg_val = 0; - struct sensor *sensor = to_sensor(client); - struct reginfo reg_info; - - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - if (sensor->info_priv.funmodule_state & SENSOR_INIT_IS_OK) { - sensor_task_lock(client, 1); - - sensor_read( client, 0x001a, ®_val); - reg_info.reg = 0x001a; - reg_info.val = reg_val & (~0x0200);//reg_val & (~0x02); - reg_info.reg_len = 0x04; - sensor_write(client, ®_info); - - sensor_task_lock(client, 0); - } - sensor_ioctrl(icd, Sensor_PowerDown, 1); - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - msleep(100); - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - return 0; -} -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - return 0; -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -#if 0 -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - /* - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - */ - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -#endif -static struct reginfo* sensor_fmt_catch(int set_w, int set_h, int *ret_w, int *ret_h) -{ - struct reginfo *winseqe_set_addr = NULL; - - if (set_w*240 == set_h*320) { - if (((set_w >= 320) && (set_h >= 240)) && (sensor_qvga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qvga; - *ret_w = 320; - *ret_h = 240; - } - if (((set_w >= 640) && (set_h >= 480)) && (sensor_vga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_vga; - *ret_w = 640; - *ret_h = 480; - } - if (((set_w >= 800) && (set_h >= 600)) && (sensor_svga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_svga; - *ret_w = 800; - *ret_h = 600; - } - if (((set_w >= 1024) && (set_h >= 768)) && (sensor_xga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_xga; - *ret_w = 1024; - *ret_h = 768; - } - if (((set_w >= 1280) && (set_h >= 1024)) && (sensor_sxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_sxga; - *ret_w = 1280; - *ret_h = 1024; - } - if (((set_w >= 1600) && (set_h >= 1200)) && (sensor_uxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_uxga; - *ret_w = 1600; - *ret_h = 1200; - } - if (((set_w >= 2048) && (set_h >= 1536)) && (sensor_qxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qxga; - *ret_w = 2048; - *ret_h = 1536; - } - - if (winseqe_set_addr == NULL) { - if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qcif; - *ret_w = 176; - *ret_h = 144; - } else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_cif; - *ret_w = 352; - *ret_h = 288; - } - - if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_vga; - *ret_w = 640; - *ret_h = 480; - } else if (((set_w <= 1280) && (set_h <= 720)) && (sensor_720p[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_720p; - *ret_w = 1280; - *ret_h = 720; - } else if (((set_w <= 1920) && (set_h <= 1080)) && (sensor_1080p[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_1080p; - *ret_w = 1920; - *ret_h = 1080; - } - } - - } else if (set_w*288 == set_h*352) { - if (((set_w >= 176) && (set_h >= 144)) && (sensor_qcif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qcif; - *ret_w = 176; - *ret_h = 144; - } else if (((set_w >= 352) && (set_h >= 288)) && (sensor_cif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_cif; - *ret_w = 352; - *ret_h = 288; - } - - if (winseqe_set_addr == NULL) { - if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qvga; - *ret_w = 320; - *ret_h = 240; - } else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_vga; - *ret_w = 640; - *ret_h = 480; - } else if (((set_w <= 800) && (set_h <= 600)) && (sensor_svga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_svga; - *ret_w = 800; - *ret_h = 600; - } else if (((set_w <= 1024) && (set_h <= 768)) && (sensor_xga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_xga; - *ret_w = 1024; - *ret_h = 768; - } else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_sxga; - *ret_w = 1280; - *ret_h = 1024; - } else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_uxga; - *ret_w = 1600; - *ret_h = 1200; - } else if (((set_w <= 2048) && (set_h <= 1536)) && (sensor_qxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qxga; - *ret_w = 2048; - *ret_h = 1536; - } - - - if (((set_w <= 1280) && (set_h <= 720)) && (sensor_720p[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_720p; - *ret_w = 1280; - *ret_h = 720; - } else if (((set_w <= 1920) && (set_h <= 1080)) && (sensor_1080p[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_1080p; - *ret_w = 1920; - *ret_h = 1080; - } - } - } else if (set_w*720 == set_h*1280) { - if (((set_w >= 1280) && (set_h >= 720)) && (sensor_720p[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_720p; - *ret_w = 1280; - *ret_h = 720; - } else if (((set_w >= 1920) && (set_h >= 1080)) && (sensor_1080p[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_1080p; - *ret_w = 1920; - *ret_h = 1080; - } - - if (winseqe_set_addr == NULL) { - - if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qcif; - *ret_w = 176; - *ret_h = 144; - } else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_cif; - *ret_w = 352; - *ret_h = 288; - } - - if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qvga; - *ret_w = 320; - *ret_h = 240; - } else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_vga; - *ret_w = 640; - *ret_h = 480; - } else if (((set_w <= 800) && (set_h <= 600)) && (sensor_svga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_svga; - *ret_w = 800; - *ret_h = 600; - } else if (((set_w <= 1024) && (set_h <= 768)) && (sensor_xga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_xga; - *ret_w = 1024; - *ret_h = 768; - } else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_sxga; - *ret_w = 1280; - *ret_h = 1024; - } else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_uxga; - *ret_w = 1600; - *ret_h = 1200; - } else if (((set_w <= 2048) && (set_h <= 1536)) && (sensor_qxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qxga; - *ret_w = 2048; - *ret_h = 1536; - } - } - } else { - if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qcif; - *ret_w = 176; - *ret_h = 144; - } else if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qvga; - *ret_w = 320; - *ret_h = 240; - } else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_cif; - *ret_w = 352; - *ret_h = 288; - } else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_vga; - *ret_w = 640; - *ret_h = 480; - } else if (((set_w <= 800) && (set_h <= 600)) && (sensor_svga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_svga; - *ret_w = 800; - *ret_h = 600; - } else if (((set_w <= 1024) && (set_h <= 768)) && (sensor_xga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_xga; - *ret_w = 1024; - *ret_h = 768; - } else if (((set_w <= 1280) && (set_h <= 720)) && (sensor_720p[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_720p; - *ret_w = 1280; - *ret_h = 720; - } else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_sxga; - *ret_w = 1280; - *ret_h = 1024; - } else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_uxga; - *ret_w = 1600; - *ret_h = 1200; - } else if (((set_w <= 1920) && (set_h <= 1080)) && (sensor_1080p[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_1080p; - *ret_w = 1920; - *ret_h = 1080; - } else if (((set_w <= 2048) && (set_h <= 1536)) && (sensor_qxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qxga; - *ret_w = 2048; - *ret_h = 1536; - } - } - - return winseqe_set_addr; -} - -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - struct reginfo *winseqe_set_addr=NULL; - int ret = 0, set_w,set_h; - //u16 seq_state=0; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - winseqe_set_addr = sensor_fmt_catch(set_w, set_h, &set_w, &set_h); - - if ((winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) && winseqe_set_addr) { - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - goto sensor_s_fmt_end; - } - - sensor->info_priv.winseqe_cur_addr = winseqe_set_addr; - if ((winseqe_set_addr[0].reg==SEQUENCE_PROPERTY) && (winseqe_set_addr[0].val==SEQUENCE_CAPTURE)) { - - } else { - sensor->info_priv.preview_w = mf->width; - sensor->info_priv.preview_h = mf->height; - } - } - - if (winseqe_set_addr && (winseqe_set_addr[0].reg==SEQUENCE_PROPERTY) && (winseqe_set_addr[0].val==SEQUENCE_CAPTURE)) { - - /*#if CONFIG_SENSOR_Flash - if( (sensor->info_priv.flash == 1)|| (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - //sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); - } - #endif */ - - - ret |= sensor_write_array(client, sensor_Preview2Capture); - if (ret != 0) { - SENSOR_TR("%s Preview 2 Capture failed\n", SENSOR_NAME_STRING()); - goto sensor_s_fmt_end; - } - SENSOR_DG("%s Preview 2 Capture success!\n", SENSOR_NAME_STRING()); - - #if CONFIG_SENSOR_Flash - if( (sensor->info_priv.flash == 1)|| (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - //sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); - //SENSOR_DG("----flash-------%s sensor->info_priv.flash = %d ,flash on in capture!\n", SENSOR_NAME_STRING(),sensor->info_priv.flash); - } - #endif - - sensor->info_priv.capture_w = set_w; - sensor->info_priv.capture_h = set_h; - sensor->info_priv.snap2preview = true; - } else if (sensor->info_priv.snap2preview == true) { - if (winseqe_set_addr || ((sensor->info_priv.preview_w == mf->width) && (sensor->info_priv.preview_h == mf->height))) { - #if CONFIG_SENSOR_Flash - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - #endif - ret |= sensor_write_array(client, sensor_Capture2Preview); - if (ret != 0) { - SENSOR_TR("%s Capture 2 Preview failed !!\n", SENSOR_NAME_STRING()); - goto sensor_s_fmt_end; - } - - mdelay(200); //delay microseconds to forbid invalidate data - - SENSOR_DG("%s Capture 2 Preview success\n", SENSOR_NAME_STRING()); - - /* #if CONFIG_SENSOR_Flash - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - #endif */ - sensor->info_priv.preview_w = mf->width; - sensor->info_priv.preview_h = mf->height; - sensor->info_priv.snap2preview = false; - } else { - SENSOR_TR("\n %s..%s Format is Invalidate. mf->width = %d.. mf->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - } - - mf->width = set_w; - mf->height = set_h; -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - mf->colorspace = fmt->colorspace; - if (sensor_fmt_catch(mf->width, mf->height, &mf->width, &mf->height) == NULL) { - mf->width = 0; - mf->height = 0; - } - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV2655 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((*value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value > 0) && ((digitalzoom_cur + *value) > digitalzoom_total)) - { - *value = digitalzoom_total - digitalzoom_cur; - } - - if ((*value < 0) && ((digitalzoom_cur + *value) < 0)) - { - *value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += *value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, *value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Focus -static int sensor_set_focus_absolute(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int ret = 0; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (!qctrl_info) - { - return -EINVAL; - } - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - if ((value >= qctrl_info->minimum) && (value <= qctrl_info->maximum)) { - - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EINVAL; - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - goto sensor_set_focus_absolute_end; - } - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - -sensor_set_focus_absolute_end: - return ret; -} -static int sensor_set_focus_relative(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int ret = 0; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_RELATIVE); - if (!qctrl_info) - { - ret = -EINVAL; - goto sensor_set_focus_relative_end; - //return -EINVAL; - } - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - if ((value >= qctrl_info->minimum) && (value <= qctrl_info->maximum)) { - - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EINVAL; - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - } - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } -sensor_set_focus_relative_end: - return ret; -} - -static int sensor_set_focus_mode(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int ret = 0; - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - switch (value) - { - case SENSOR_AF_MODE_AUTO: - { - ret = sensor_af_single(client); - break; - } - - case SENSOR_AF_MODE_MACRO: - { - ret = sensor_set_focus_absolute(icd, qctrl, 0xff); - break; - } - - case SENSOR_AF_MODE_INFINITY: - { - ret = sensor_set_focus_absolute(icd, qctrl, 0x00); - break; - } - - case SENSOR_AF_MODE_CONTINUOUS: - { - ret = sensor_af_const(client); - break; - } - default: - SENSOR_TR("\n %s..%s AF value(0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__,value); - break; - - } - - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - - return ret; -} -#endif -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (sensor_set_focus_absolute(icd, qctrl,ext_ctrl->value) == 0) { - if (ext_ctrl->value == qctrl->minimum) { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_INFINITY; - } else if (ext_ctrl->value == qctrl->maximum) { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_MACRO; - } else { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_FIXED; - } - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - sensor_set_focus_relative(icd, qctrl,ext_ctrl->value); - break; - } - case V4L2_CID_FOCUS_AUTO: - { - if (ext_ctrl->value == 1) { - if (sensor_set_focus_mode(icd, qctrl,SENSOR_AF_MODE_AUTO) != 0) - return -EINVAL; - sensor->info_priv.auto_focus = SENSOR_AF_MODE_AUTO; - } else if (SENSOR_AF_MODE_AUTO == sensor->info_priv.auto_focus){ - if (ext_ctrl->value == 0) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CLOSE; - } - break; - } - case V4L2_CID_FOCUS_CONTINUOUS: - { - if (SENSOR_AF_MODE_CONTINUOUS != sensor->info_priv.auto_focus) { - if (ext_ctrl->value == 1) { - if (sensor_set_focus_mode(icd, qctrl,SENSOR_AF_MODE_CONTINUOUS) != 0) - return -EINVAL; - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CONTINUOUS; - } - } else { - if (ext_ctrl->value == 0) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CLOSE; - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_stream(struct v4l2_subdev *sd, int enable) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - - if (enable == 1) { - sensor->info_priv.enable = 1; - } else if (enable == 0) { - sensor->info_priv.enable = 0; - } - - return 0; -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - int ret,pid = 0; - struct sensor *sensor = to_sensor(client); - #if (SENSOR_RESET_REG != SEQUENCE_END) - struct reginfo reg_info; - #endif - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - /* soft reset */ -#if (SENSOR_RESET_REG != SEQUENCE_END) - reg_info.reg = SENSOR_RESET_REG; - reg_info.val = SENSOR_RESET_VAL; - reg_info.reg_len = SENSOR_RESET_REG_LEN; - ret = sensor_write(client, ®_info); - if (ret != 0) { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - mdelay(5); //delay 5 microseconds -#endif - - /* check if it is an sensor sensor */ -#if (SENSOR_ID_REG != SEQUENCE_END) - ret = sensor_read(client, SENSOR_ID_REG, &pid); - if (ret != 0) { - SENSOR_TR("read chip id failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - SENSOR_DG("\n %s pid = 0x%x \n", SENSOR_NAME_STRING(), pid); -#else - pid = SENSOR_ID; -#endif - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - - return 0; - -sensor_video_probe_err: - - return ret; -} -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0; - #if CONFIG_SENSOR_Flash - int i; - #endif - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - sensor->sensor_gpio_res = NULL; - for (i=0; isensor_io_request->gpio_res[i].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[i].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[i]; - } - } - if (sensor->sensor_gpio_res == NULL) { - SENSOR_TR("%s %s obtain gpio resource failed when RK29_CAM_SUBDEV_IOREQUEST \n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, - .s_stream = sensor_s_stream, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - sensor->info_priv.fmt = sensor_colour_fmts[0]; - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - #if CONFIG_SENSOR_Focus - if (sensor->sensor_wq) { - destroy_workqueue(sensor->sensor_wq); - sensor->sensor_wq = NULL; - } - #endif - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - - diff --git a/drivers/media/video/mt9t111.h b/drivers/media/video/mt9t111.h deleted file mode 100755 index 98c0c3011011..000000000000 --- a/drivers/media/video/mt9t111.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Driver for MT9T111 CMOS Image Sensor from Aptina - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#ifndef __MT9T111_H__ -#define __MT9T111_H__ -struct reginfo -{ - u16 reg; - u16 val; - u16 reg_len; - u16 rev; -}; - -#define WORD_LEN 0x04 -#define BYTE_LEN 0x02 - -#define SEQUENCE_INIT 0x00 -#define SEQUENCE_NORMAL 0x01 -#define SEQUENCE_CAPTURE 0x02 -#define SEQUENCE_PREVIEW 0x03 - -#define SEQUENCE_PROPERTY 0xFFFC -#define SEQUENCE_WAIT_MS 0xFFFD -#define SEQUENCE_WAIT_US 0xFFFE -#define SEQUENCE_END 0xFFFF -#endif diff --git a/drivers/media/video/mv9335/Kconfig b/drivers/media/video/mv9335/Kconfig deleted file mode 100644 index 6d0981dd846b..000000000000 --- a/drivers/media/video/mv9335/Kconfig +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# Fujitsu camera isp chip: m6moj. -# -choice - prompt "Camera Sensor attached to mv9335" - depends on SOC_CAMERA_MV9335 - default n -config MV9335_OV5650 - tristate "mv9335 attached ov5650" - help - Choose Y here if you have this this sensor and it is attach to mv9335 -endchoice diff --git a/drivers/media/video/mv9335/Makefile b/drivers/media/video/mv9335/Makefile deleted file mode 100644 index 4ece962a39b5..000000000000 --- a/drivers/media/video/mv9335/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# Makefile for Fujitsu isp driver -# -mv9335_drv-objs += mv9335.o -obj-y += mv9335_drv.o - diff --git a/drivers/media/video/mv9335/mv9335.c b/drivers/media/video/mv9335/mv9335.c deleted file mode 100644 index 70efb0a737f9..000000000000 --- a/drivers/media/video/mv9335/mv9335.c +++ /dev/null @@ -1,2795 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int debug = 3; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_ISP_MTK9335 -#define SENSOR_V4L2_IDENT V4L2_IDENT_MTK9335ISP -#define SENSOR_ID 0x35 -#define SENSOR_MIN_WIDTH 640//176 -#define SENSOR_MIN_HEIGHT 480//144 -#define SENSOR_MAX_WIDTH 2592 -#define SENSOR_MAX_HEIGHT 1944 -#define SENSOR_INIT_WIDTH 640 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 480 -#define SENSOR_INIT_WINSEQADR sensor_vga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_YUYV8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 1 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 1 -#define CONFIG_SENSOR_Exposure 1 -#define CONFIG_SENSOR_Flash 0 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 -#define CONFIG_SENSOR_FOCUS_ZONE 1 -#define CONFIG_SENSOR_FACE_DETECT 1 - -#if CONFIG_SENSOR_Focus -#define SENSOR_AF_MODE_CLOSE 0 -#define SENSOR_AF_SINGLE 1 -#define SENSOR_AF_MACRO 2 -#define SENSOR_AF_CONTINUOUS 5 -#define SENSOR_AF_CONTINUOUS_OFF 6 -static int sensor_set_auto_focus(struct i2c_client *client, int value); -#endif - -#define CONFIG_SENSOR_I2C_SPEED 400000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING|\ - SOCAM_HSYNC_ACTIVE_HIGH| SOCAM_VSYNC_ACTIVE_HIGH|\ - SOCAM_DATA_ACTIVE_HIGH|SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) -// Using define data - -#define I2C_IDLE 1 -#define I2C_STATUS_REG2 0x0D -#define DEV_ID_MV9335_I2CSLAVE_FLASH_PRO (0x40 >> 1) -#define get_lsb(x) (char)((u16)(x)& 0xFF) -#define get_msb(x) (char)(((u16)(x)>>8)& 0xFF) -#define FLASH_ERASE_BY_SECTOR 0 -#define FLASH_ERASE_ALL 1 -#define WRITE_READ_CHECK 0 -#define FLASH_WRITE_CHECK 0 - -#define PRODUCT_ID_VALUE_REG0 0x93 -#define PRODUCT_VERSION_VALUE_REG1 0x35 -#define I2C_CHECKE_VALUE_REG5 0x50 -#define CHECKE_VALUE_REG6 0x80 - -#define FWVERSION (0x09) -#if (FWVERSION == 0x03) -const char fw_name[] = {"mv9335_DS1001B_RK3066_OV5653_v1_0x03.bin"}; -#define FIRMWARE_MAJOR_VERSION_VALUE_REG2 0x01 -#define FIRMWARE_MINOR_VERSION_VALUE_REG3 0x03 -#define CHECKE_VALUE_REG0X90 0x3c -#define CHECKE_VALUE_REG0X91 0x88 -#elif(FWVERSION == 0x04) -const char fw_name[] = {"mv9335_DS1001B_RK3066_OV5653_v1_0x04.bin"}; -#define FIRMWARE_MAJOR_VERSION_VALUE_REG2 0x01 -#define FIRMWARE_MINOR_VERSION_VALUE_REG3 0x04 -#define CHECKE_VALUE_REG0X90 0xa4 -#define CHECKE_VALUE_REG0X91 0x5e -#elif(FWVERSION == 0x05) //no focus -const char fw_name[] = {"mv9335_DS1001B_RK3066_OV5653_v1_0x05.bin"}; -#define FIRMWARE_MAJOR_VERSION_VALUE_REG2 0x01 -#define FIRMWARE_MINOR_VERSION_VALUE_REG3 0x05 -#define CHECKE_VALUE_REG0X90 0x51 -#define CHECKE_VALUE_REG0X91 0x54 -#elif(FWVERSION == 0x06) -const char fw_name[] = {"mv9335_DS1001B_RK3066_OV5653_v1_0x06.bin"}; -#define FIRMWARE_MAJOR_VERSION_VALUE_REG2 0x01 -#define FIRMWARE_MINOR_VERSION_VALUE_REG3 0x06 -#define CHECKE_VALUE_REG0X90 0x90 -#define CHECKE_VALUE_REG0X91 0xe7 -#elif(FWVERSION == 0x07) -const char fw_name[] = {"mv9335_DS1001B_RK3066_OV5653_v1_0x07.bin"}; -#define FIRMWARE_MAJOR_VERSION_VALUE_REG2 0x01 -#define FIRMWARE_MINOR_VERSION_VALUE_REG3 0x07 -#define CHECKE_VALUE_REG0X90 0x22 -#define CHECKE_VALUE_REG0X91 0x8a -#elif(FWVERSION == 0x08) -const char fw_name[] = {"mv9335_DS1001B_RK3066_OV5653_v1_0x08.bin"}; -#define FIRMWARE_MAJOR_VERSION_VALUE_REG2 0x01 -#define FIRMWARE_MINOR_VERSION_VALUE_REG3 0x08 -#define CHECKE_VALUE_REG0X90 0x7a -#define CHECKE_VALUE_REG0X91 0x32 -#elif(FWVERSION == 0x09) -const char fw_name[] = {"mv9335_DS1001B_RK3066_OV5653_v1_0x09.bin"}; -#define FIRMWARE_MAJOR_VERSION_VALUE_REG2 0x01 -#define FIRMWARE_MINOR_VERSION_VALUE_REG3 0x09 -#define CHECKE_VALUE_REG0X90 0x48 -#define CHECKE_VALUE_REG0X91 0x3e - -#else -const char fw_name[] = {"mv9335_DS1001B_RK3066_OV5653_v1_0x09.bin"}; -#define FIRMWARE_MAJOR_VERSION_VALUE_REG2 0x01 -#define FIRMWARE_MINOR_VERSION_VALUE_REG3 0x09 -#define CHECKE_VALUE_REG0X90 0x48 -#define CHECKE_VALUE_REG0X91 0x3e -#endif -struct reginfo -{ - u8 reg; - u8 val; -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -enum ISP_OUTPUT_RES{ - OUTPUT_QCIF =0x0001, // 176*144 - OUTPUT_HQVGA=0x0002,// 240*160 - OUTPUT_QVGA =0x0004, // 320*240 - OUTPUT_CIF =0x0008, // 352*288 - OUTPUT_VGA =0x0010, // 640*480 - OUTPUT_SVGA =0x0020, // 800*600 - OUTPUT_720P =0x0040, // 1280*720 - OUTPUT_XGA =0x0080, // 1024*768 - OUTPUT_SXGA =0x0100, // 1280*1024 - OUTPUT_UXGA =0x0200, // 1600*1200 - OUTPUT_1080P=0x0400, //1920*1080 - OUTPUT_QXGA =0x0800, // 2048*1536 - OUTPUT_QSXGA=0x1000, // 2592*1944 -}; -static u8 sendI2cCmd(struct i2c_client *client,u8 cmd, u8 dat); -static int isp_i2c_read(struct i2c_client *client, u8 reg, u8 *val,u16 ext_addr); -static int flash_read_firmware_data(struct i2c_client *client,u16 addr,u8* rd_data,int readcount); -static int flash_read_data(struct i2c_client *client,u8* rd_data,int readcount); -static int isp_init_check(struct i2c_client *client); -static int isp_init_cmds(struct i2c_client *client); -static struct soc_camera_ops sensor_ops; - -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value); -#endif - - -struct focus_zone_s{ -u8 lx; -u8 ty; -u8 rx; -u8 dy; -}; - -//flash and focus must be considered. - -//soft isp or external isp used -//if soft isp is defined , the value in this sturct is used in cif driver . cif driver use this value to do isp func. -//value of this sturct MUST be defined(initialized) correctly. -struct isp_data{ - - //focus - //flash - int focus; - int auto_focus; - int flash; - //awb - //ae - //scence - //effect - //brightness - //digitalzoom - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int exposure; - int face; - //mirror or flip - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - //preview or capture - int outputSize; // supported resolution - int curRes; - struct focus_zone_s focus_zone; - struct sensor_datafmt fmt; - //mutex for access the isp data - struct mutex access_data_lock; -}; - - -struct isp_func_ops{ - int (*isp_power_on)(void); - int (*isp_power_off)(void); - //realized by isp or external dev - int (*isp_set_focus_mode)(int value,struct isp_data* data); - int (*isp_set_flash_mode)( int value,struct isp_data* data); - - //by soft isp or external isp - int (*isp_set_wb_mode)( int value,struct isp_data* data); - int (*isp_set_effect_mode)( int value,struct isp_data* data); - int (*isp_set_scence_mode)( int value,struct isp_data* data); - int (*isp_set_expose_mode)( int value,struct isp_data* data); - int (*isp_set_digitalzoom_mode)( int value,struct isp_data* data); - int (*isp_set_flip)( int value,struct isp_data* data); - int (*isp_set_mirror)( int value,struct isp_data* data); -}; - -struct isp_dev{ - struct v4l2_subdev subdev; - struct i2c_client *client; - struct workqueue_struct *sensor_wq; - struct mutex wq_lock; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ - struct isp_func_ops* isp_ops; - struct isp_data isp_priv_info; - }; - -static struct isp_dev* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct isp_dev, subdev); -} - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG} -}; - -static int isp_reg_value_check(struct i2c_client *client,u8 checked_reg,u8 checked_value){ - int cnt = 100; - u8 check_val = 0; - // msleep(10); - while((cnt-- > 0) && (isp_i2c_read(client,checked_reg,&check_val,0) || (check_val != checked_value))){ - // SENSOR_TR("error: %s:%d check_val = 0x%x, exp = 0x%x\n", __func__,__LINE__, check_val,checked_value); - mdelay(30); - } - if(cnt <= 0){ - SENSOR_TR("error: %s:%d reg value checked erro,check_val = 0x%x, exp = 0x%x!\n", __func__,__LINE__,check_val,checked_value); - return -1; - } - return 0; - -} - -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - u8 set_val = 0; - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - switch(value){ - case 0: //enable auto - set_val = 0x1; - break; - case 1: //incandescent - set_val = 0x45; - break; - case 2: //fluorescent - set_val = 0x25; - break; - case 3: //daylight - set_val = 0x15; - break; - case 4: //cloudy-daylight - set_val = 0x35; - break; - default: - break; - } - //awb - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x1c, set_val); - isp_reg_value_check(client,0x0E,0xBB); - return 0; - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -1; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - u8 set_val = 0; - printk("set effect,value = %d ......\n",value); - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - switch(value){ - case 0: //none - set_val = 0x00; - break; - case 1: //mono - set_val = 0x01; - break; - case 2: //negative - set_val = 0x02; - break; - case 3: //sepia - set_val = 0x03; - break; - case 4: //aqua - set_val = 0x04; - break; - default: - break; - } - //image effect - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x26, set_val); - isp_reg_value_check(client,0x0E,0xBB); - return 0; - } - SENSOR_TR("\n%s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -1; -} -#endif - -static const struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "normal", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "normal", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_SCENE, .index = 2, .name = "landscape", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 3, .name = "night", .reserved = 0,}, - { .id = V4L2_CID_SCENE, .index = 4, .name = "night_portrait", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 5, .name = "snow", .reserved = 0,}, - { .id = V4L2_CID_SCENE, .index = 6, .name = "sports", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 7, .name = "candlelight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 7, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 100, - .maximum = 275, // app pass 275-25 maximum - .step = 25, - .default_value = 100, - }, - #endif - - #if CONFIG_SENSOR_Focus - /*{ - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, */ - { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 0xff, - .step = 1, - .default_value = 0, - }, - { - .id = V4L2_CID_FOCUS_AUTO, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Focus Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - },{ - .id = V4L2_CID_FOCUS_CONTINUOUS, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Focus Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flash Control Focus", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - #if CONFIG_SENSOR_FOCUS_ZONE - { - .id = V4L2_CID_FOCUSZONE, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Focus Zone support", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - #if CONFIG_SENSOR_FACE_DETECT - { - .id = V4L2_CID_FACEDETECT, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "face dectect support", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - -}; - - -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct isp_dev *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->isp_priv_info.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->isp_priv_info.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->isp_priv_info.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->isp_priv_info.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->isp_priv_info.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->isp_priv_info.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->isp_priv_info.flip; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ctrl->value = sensor->isp_priv_info.digitalzoom; - break; - } - default : - break; - } - return 0; -} -static int sensor_set_face_detect(struct i2c_client *client, int value); -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - u8 set_val = 0x0 ,ac_val = 0x01; - printk("set iso ,value = %d......\n", value); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - switch(value){ - case 0: //iso auto - set_val = 0x0; - break; - case 1: //iso 100 - set_val = 0x1; - break; - case 2: //iso 200 - set_val = 0x2; - break; - case 3: //iso 400 - set_val = 0x3; - break; - case 4: //iso 800 - set_val = 0x4; - break; - case 5: //iso 1600 - set_val = 0x5; - break; - default: - break; - } - - //iso - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x17, set_val); - isp_reg_value_check(client,0x0E,0xBB); - - //AC freq :50Hz - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x16, 0x01); - isp_reg_value_check(client,0x0E,0xBB); - return 0; - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct isp_dev *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->isp_priv_info.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->isp_priv_info.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->isp_priv_info.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->isp_priv_info.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->isp_priv_info.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->isp_priv_info.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->isp_priv_info.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->isp_priv_info.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->isp_priv_info.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->isp_priv_info.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->isp_priv_info.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->isp_priv_info.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->isp_priv_info.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->isp_priv_info.flip = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - int val_offset = 0; - printk("V4L2_CID_ZOOM_ABSOLUTE ...... ctrl->value = %d\n",ctrl->value); - if ((ctrl->value < qctrl->minimum) || (ctrl->value > qctrl->maximum)){ - return -EINVAL; - } - - if (ctrl->value != sensor->isp_priv_info.digitalzoom) - { - val_offset = ctrl->value -sensor->isp_priv_info.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->isp_priv_info.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->isp_priv_info.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ctrl->value) != 0) - return -EINVAL; - sensor->isp_priv_info.digitalzoom += ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->isp_priv_info.digitalzoom); - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct isp_dev *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->isp_priv_info.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->isp_priv_info.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->isp_priv_info.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->isp_priv_info.flash; - break; - } - case V4L2_CID_FACEDETECT: - { - ext_ctrl->value =sensor->isp_priv_info.face ; - break; - } - default : - break; - } - return 0; -} -#if CONFIG_SENSOR_Focus -static int sensor_set_auto_focus(struct i2c_client *client, int value) -{ - struct isp_dev *sensor = to_sensor(client); - u8 zone_x = 0x0,zone_y = 0x0; // 0->0x0f - int ret = 0; -// return 0; - //set the zone - // printk("lx = %x,rx = %x,ty = %x,dy = %x\n",sensor->isp_priv_info.focus_zone.lx,sensor->isp_priv_info.focus_zone.rx,sensor->isp_priv_info.focus_zone.ty,sensor->isp_priv_info.focus_zone.dy); - zone_x = (sensor->isp_priv_info.focus_zone.lx << 4) | (sensor->isp_priv_info.focus_zone.rx & 0x0f); - zone_y = (sensor->isp_priv_info.focus_zone.ty << 4) | (sensor->isp_priv_info.focus_zone.dy & 0x0f); - //auto focus - sendI2cCmd(client, 0x0E, 0x00); - if((zone_x != 0) && (zone_y !=0)){ - sendI2cCmd(client, 0x21, zone_x); - sendI2cCmd(client, 0x22, zone_y); - }else{ - sendI2cCmd(client, 0x21, 0x6a); - sendI2cCmd(client, 0x22, 0x6a); - } - printk("%s:auto focus, val = %d,zone_x = %x, zone_y = %x\n",__func__,value,zone_x,zone_y); - sendI2cCmd(client, 0x23, value); - ret = isp_reg_value_check(client,0x0E,0xBB); - if(ret == 0xCC){ - printk("%s:%d,auto focus failed!\n",__func__,__LINE__); - } - // printk("%s:auto focus done\n",__func__); - return 0; -} - -enum sensor_work_state -{ - sensor_work_ready = 0, - sensor_working, -}; -enum sensor_wq_result -{ - WqRet_success = 0, - WqRet_fail = -1, - WqRet_inval = -2 -}; -enum sensor_wq_cmd -{ - WqCmd_af_init, - WqCmd_af_single, - WqCmd_af_special_pos, - WqCmd_af_far_pos, - WqCmd_af_near_pos, - WqCmd_af_continues, - WqCmd_af_return_idle, -}; -struct sensor_work -{ - struct i2c_client *client; - struct delayed_work dwork; - enum sensor_wq_cmd cmd; - wait_queue_head_t done; - enum sensor_wq_result result; - bool wait; - int var; -}; - -static void sensor_af_workqueue(struct work_struct *work) -{ - struct sensor_work *sensor_work = container_of(work, struct sensor_work, dwork.work); - struct i2c_client *client = sensor_work->client; - struct isp_dev *sensor = to_sensor(client); - - SENSOR_DG("%s %s Enter, cmd:0x%x \n",SENSOR_NAME_STRING(), __FUNCTION__,sensor_work->cmd); - - mutex_lock(&sensor->wq_lock); - -// printk("%s:auto focus, val = %d\n",__func__,sensor_work->var); - //auto focus - if(sensor_set_auto_focus(client,sensor_work->var) == 0){ - sensor_work->result = WqRet_success; - }else{ - printk("%s:auto focus failed\n",__func__); - } -// printk("%s:auto focus done\n",__func__); - -//set_end: - if (sensor_work->wait == false) { - kfree((void*)sensor_work); - } else { - wake_up(&sensor_work->done); - } - mutex_unlock(&sensor->wq_lock); - return; -} - -static int sensor_af_workqueue_set(struct soc_camera_device *icd, enum sensor_wq_cmd cmd, int var, bool wait) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct isp_dev *sensor = to_sensor(client); - struct sensor_work *wk; - int ret=0; - - if (sensor->sensor_wq == NULL) { - ret = -EINVAL; - goto sensor_af_workqueue_set_end; - } - - wk = kzalloc(sizeof(struct sensor_work), GFP_KERNEL); - if (wk) { - wk->client = client; - INIT_WORK(&(wk->dwork.work), sensor_af_workqueue); - wk->cmd = cmd; - wk->result = WqRet_inval; - wk->wait = wait; - wk->var = var; - init_waitqueue_head(&wk->done); - - queue_delayed_work(sensor->sensor_wq,&(wk->dwork),0); - - /* ddl@rock-chips.com: - * video_lock is been locked in v4l2_ioctl function, but auto focus may slow, - * As a result any other ioctl calls will proceed very, very slowly since each call - * will have to wait for the AF to finish. Camera preview is pause,because VIDIOC_QBUF - * and VIDIOC_DQBUF is sched. so unlock video_lock here. - */ - if (wait == true) { - mutex_unlock(&icd->video_lock); - if (wait_event_timeout(wk->done, (wk->result != WqRet_inval), msecs_to_jiffies(5000)) == 0) { //hhb - SENSOR_TR("%s %s cmd(%d) is timeout!\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - } - ret = wk->result; - kfree((void*)wk); - mutex_lock(&icd->video_lock); - } - - } else { - SENSOR_TR("%s %s cmd(%d) ingore,because struct sensor_work malloc failed!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - ret = -1; - } -sensor_af_workqueue_set_end: - return ret; -} -#endif - - -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); -//when scene mod is working , face deteciton and awb and iso are not recomemnded. - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - sendI2cCmd(client, 0x0E, 0x00); - // sendI2cCmd(client, 0x13, value); - isp_reg_value_check(client,0x0E,0xBB); - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -static int sensor_set_face_detect(struct i2c_client *client, int value) -{ - u8 orien, window; - window = (value & 0x100)>>8; - //face detect - switch (value & 0x1f){ - case 0: - orien = 0x02; //off - break; - case 1: - orien = 0x80; //default on - break; - case 2: - orien = 0x90; //90 degree - break; - case 3: - orien = 0xb0; //180 degree - break; - case 4: - orien = 0xa0; //270 degree - break; - default: - orien = 0x02; //off - - } - printk("orien = %x,window = %d \n",orien,window); - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x2a, orien); - isp_reg_value_check(client,0x0E,0xBB); - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x29, window); - isp_reg_value_check(client,0x0E,0xBB); - - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; -} -#if CONFIG_SENSOR_Flip -//off 0x00;mirror 0x01,flip 0x10; -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x28, 0x10); - isp_reg_value_check(client,0x0E,0xBB); - return 0; - -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x28, 0x01); - isp_reg_value_check(client,0x0E,0xBB); - return 0; -} -#endif - -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct isp_dev *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - u8 zoom_val = 0; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (!qctrl_info){ - return -EINVAL; - } - - digitalzoom_cur = sensor->isp_priv_info.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((*value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value > 0) && ((digitalzoom_cur + *value) > digitalzoom_total)) - { - *value = digitalzoom_total - digitalzoom_cur; - } - - if ((*value < 0) && ((digitalzoom_cur + *value) < 0)) - { - *value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += *value; - printk("digitalzoom_cur = %d =====\n",digitalzoom_cur); - switch(digitalzoom_cur){ - case 100 : - zoom_val = 0; - break; - case 125 : - zoom_val = 1; - break; - case 150 : - zoom_val = 2; - break; - case 175 : - zoom_val = 3; - break; - case 200 : - zoom_val = 4; - break; - case 225 : - zoom_val = 5; - break; - case 250 : - zoom_val = 6; - break; - case 275 : - zoom_val = 7; - break; - case 300 : - zoom_val = 8; - break; - } - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x2b, zoom_val); - isp_reg_value_check(client,0x0E,0xBB); - mdelay(5); - return 0; -} -#endif -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct isp_dev *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->isp_priv_info.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->isp_priv_info.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->isp_priv_info.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->isp_priv_info.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - printk("V4L2_CID_ZOOM_ABSOLUTE ...... ext_ctrl->value = %d\n",ext_ctrl->value); - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)){ - return -EINVAL; - } - - if (ext_ctrl->value != sensor->isp_priv_info.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->isp_priv_info.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->isp_priv_info.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->isp_priv_info.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->isp_priv_info.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->isp_priv_info.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - //DO MACRO - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (SENSOR_AF_CONTINUOUS == sensor->isp_priv_info.auto_focus) { - sensor_af_workqueue_set(icd,0,SENSOR_AF_CONTINUOUS_OFF,true); - } - if (ext_ctrl->value == 0xff) { - sensor_af_workqueue_set(icd,0,SENSOR_AF_MACRO,true); - sensor->isp_priv_info.auto_focus = SENSOR_AF_MACRO; - } else if(ext_ctrl->value == 0){ - sensor_af_workqueue_set(icd,0,SENSOR_AF_MODE_CLOSE,true); - sensor->isp_priv_info.auto_focus = SENSOR_AF_MODE_CLOSE; - } - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - // if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - // return -EINVAL; - - // sensor_set_focus_relative(icd, qctrl,ext_ctrl->value); - break; - } - - case V4L2_CID_FOCUS_AUTO: - { - - if (SENSOR_AF_CONTINUOUS == sensor->isp_priv_info.auto_focus) { - sensor_af_workqueue_set(icd,0,SENSOR_AF_CONTINUOUS_OFF,true); - } - if ((ext_ctrl->value == 1)||(sensor->isp_priv_info.auto_focus == SENSOR_AF_SINGLE)) { - sensor_af_workqueue_set(icd,0,SENSOR_AF_SINGLE,true); - sensor->isp_priv_info.auto_focus = SENSOR_AF_SINGLE; - } else if(ext_ctrl->value == 0){ - sensor_af_workqueue_set(icd,0,SENSOR_AF_MODE_CLOSE,true); - sensor->isp_priv_info.auto_focus = SENSOR_AF_MODE_CLOSE; - } - break; - } - case V4L2_CID_FOCUS_CONTINUOUS: - { - if ((ext_ctrl->value == 1) && (SENSOR_AF_CONTINUOUS != sensor->isp_priv_info.auto_focus)) { - sensor_af_workqueue_set(icd,0,SENSOR_AF_MODE_CLOSE,true); - sensor_af_workqueue_set(icd,0,SENSOR_AF_CONTINUOUS,true); - sensor->isp_priv_info.auto_focus = SENSOR_AF_CONTINUOUS; - }else if(ext_ctrl->value == 0){ - sensor_af_workqueue_set(icd,0,SENSOR_AF_CONTINUOUS_OFF,true); - sensor->isp_priv_info.auto_focus = SENSOR_AF_CONTINUOUS_OFF; - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->isp_priv_info.flash); - break; - } -#endif -#if CONFIG_SENSOR_FACE_DETECT - case V4L2_CID_FACEDETECT: - { - if(sensor->isp_priv_info.face != ext_ctrl->value){ - if (sensor_set_face_detect(client, ext_ctrl->value) != 0) - return -EINVAL; - sensor->isp_priv_info.face = ext_ctrl->value; - SENSOR_DG("%s face value is %x\n",SENSOR_NAME_STRING(), sensor->isp_priv_info.face); - } - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct isp_dev *sensor = to_sensor(client); - - int i, error_cnt=0, error_idx=-1; - for (i=0; icount; i++) { - if(ext_ctrl->controls[i].id == V4L2_CID_FOCUS_AUTO){ - int lx,ty,rx,dy; - /* - lx = (s16)((int)(ext_ctrl->reserved[0])>>16); - ty = (s16)(ext_ctrl->reserved[0]); - rx = (s16)((int)(ext_ctrl->reserved[1])>>16); - dy = (s16)(ext_ctrl->reserved[1]); - */ - // - lx = ext_ctrl->controls[i].rect[0]; - ty = ext_ctrl->controls[i].rect[1]; - rx = ext_ctrl->controls[i].rect[2]; - dy = ext_ctrl->controls[i].rect[3]; - printk("lx = %d,ty = %d,rx = %d,dy = %d\n",lx,ty,rx,dy); - sensor->isp_priv_info.focus_zone.lx = (lx+1000)*16/2000; - sensor->isp_priv_info.focus_zone.ty = (ty+1000)*16/2000; - sensor->isp_priv_info.focus_zone.rx = (rx+1000)*16/2000; - sensor->isp_priv_info.focus_zone.dy = (dy+1000)*16/2000; - // printk("lx = %x,ty = %x,rx = %x,dy = %x\n",sensor->isp_priv_info.focus_zone.lx,sensor->isp_priv_info.focus_zone.ty,sensor->isp_priv_info.focus_zone.rx,sensor->isp_priv_info.focus_zone.dy); - if((lx == 0)&&(ty == 0)&&(rx==0)&&(dy==0)){ - sensor->isp_priv_info.focus_zone.lx = 0; - sensor->isp_priv_info.focus_zone.ty = 0; - sensor->isp_priv_info.focus_zone.rx = 0; - sensor->isp_priv_info.focus_zone.dy = 0; - } - if(sensor->isp_priv_info.focus_zone.lx > 0xf){ - sensor->isp_priv_info.focus_zone.lx = 0xf; - } - if(sensor->isp_priv_info.focus_zone.ty > 0xf){ - sensor->isp_priv_info.focus_zone.ty = 0xf; - } - if(sensor->isp_priv_info.focus_zone.rx > 0xf){ - sensor->isp_priv_info.focus_zone.rx = 0xf; - } - if(sensor->isp_priv_info.focus_zone.dy > 0xf){ - sensor->isp_priv_info.focus_zone.dy = 0xf; - } - } - if(ext_ctrl->controls[i].id == V4L2_CID_ZOOM_ABSOLUTE){ - printk("%s: digtal zoom \n",__func__); - } - - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -//640*480 default -static int sensor_set_isp_output_res(struct i2c_client *client,enum ISP_OUTPUT_RES outputSize){ - u8 check_val = 0; - struct isp_dev *sensor = to_sensor(client); - switch(outputSize) - { - case OUTPUT_QCIF: - { - SENSOR_TR(" SET qcif!\n"); - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x10, 0x05); - isp_reg_value_check(client,0x0E,0xBB); - - //isp output 176*144 - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x11, 0x00); - isp_reg_value_check(client,0x0E,0xBB); - - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x07, 0x01); - isp_reg_value_check(client,0x0E,0xBB); - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x08, 0x00); - isp_reg_value_check(client,0x0E,0xBB); - } - break; - case OUTPUT_HQVGA: - { - SENSOR_TR(" SET hqvga !\n"); - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x10, 0x05); - isp_reg_value_check(client,0x0E,0xBB); - - //isp output 240*160 - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x11, 0x01); - isp_reg_value_check(client,0x0E,0xBB); - - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x07, 0x01); - isp_reg_value_check(client,0x0E,0xBB); - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x08, 0x00); - isp_reg_value_check(client,0x0E,0xBB); - break; - } - case OUTPUT_QVGA: - { - SENSOR_TR(" SET qvga RES!\n"); - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x10, 0x05); - isp_reg_value_check(client,0x0E,0xBB); - - //isp output 320*240 - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x11, 0x02); - isp_reg_value_check(client,0x0E,0xBB); - - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x07, 0x01); - isp_reg_value_check(client,0x0E,0xBB); - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x08, 0x00); - isp_reg_value_check(client,0x0E,0xBB); - } - break; - case OUTPUT_CIF: - { - SENSOR_TR(" SET cif RES!\n"); - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x10, 0x05); - isp_reg_value_check(client,0x0E,0xBB); - - //isp output 352*288 - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x11, 0x04); - isp_reg_value_check(client,0x0E,0xBB); - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x07, 0x01); - isp_reg_value_check(client,0x0E,0xBB); - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x08, 0x00); - isp_reg_value_check(client,0x0E,0xBB); - } - - break; - case OUTPUT_VGA: - { - SENSOR_TR(" SET VGA RES!\n"); - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x10, 0x05); - isp_reg_value_check(client,0x0E,0xBB); - - //isp output 640x480 - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x11, 0x03); - isp_reg_value_check(client,0x0E,0xBB); - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x07, 0x01); - isp_reg_value_check(client,0x0E,0xBB); - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x08, 0x00); - isp_reg_value_check(client,0x0E,0xBB); - } - break; - case OUTPUT_SVGA: - { - SENSOR_TR(" SET SVGA RES!\n"); - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x10, 0x05); - isp_reg_value_check(client,0x0E,0xBB); - //isp output 800*600 - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x11, 0x06); - isp_reg_value_check(client,0x0E,0xBB); - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x07, 0x01); - isp_reg_value_check(client,0x0E,0xBB); - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x08, 0x00); - isp_reg_value_check(client,0x0E,0xBB); - } - break; - case OUTPUT_720P: - { - SENSOR_TR(" SET 720P RES!\n"); - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x10, 0x0c); - isp_reg_value_check(client,0x0E,0xBB); - - //isp output 1280*720 - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x11, 0x0c); - isp_reg_value_check(client,0x0E,0xBB); - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x07, 0x01); - isp_reg_value_check(client,0x0E,0xBB); - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x08, 0x00); - isp_reg_value_check(client,0x0E,0xBB); - - } - break; - case OUTPUT_XGA: - { - SENSOR_TR(" SET XGA RES!\n"); - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x08, 0x01); - isp_reg_value_check(client,0x0E,0xBB); - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x10, 0x0E); - isp_reg_value_check(client,0x0E,0xBB); - - //isp output 1024*768 - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x11, 0x07); - isp_reg_value_check(client,0x0E,0xBB); - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x07, 0x01); - isp_reg_value_check(client,0x0E,0xBB); - } - break; - case OUTPUT_SXGA: - break; - case OUTPUT_UXGA: - { - SENSOR_TR(" SET UXGA RES!\n"); - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x08, 0x01); - isp_reg_value_check(client,0x0E,0xBB); - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x10, 0x0E); - isp_reg_value_check(client,0x0E,0xBB); - - //isp output 1600*1200 - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x11, 0x09); - isp_reg_value_check(client,0x0E,0xBB); - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x07, 0x01); - isp_reg_value_check(client,0x0E,0xBB); - } - break; - case OUTPUT_1080P: - break; - case OUTPUT_QXGA: - { - SENSOR_TR(" SET QXGA RES!\n"); - //sensor output 2592*1944 - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x08, 0x01); - isp_reg_value_check(client,0x0E,0xBB); - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x10, 0x0E); - isp_reg_value_check(client,0x0E,0xBB); - - //isp output 2592*1944 - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x11, 0x0D); - isp_reg_value_check(client,0x0E,0xBB); - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x07, 0x01); - isp_reg_value_check(client,0x0E,0xBB); - } - break; - case OUTPUT_QSXGA: - { - SENSOR_TR(" SET QSXGA RES!\n"); - //sensor output 2592*1944 - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x08, 0x01); - isp_reg_value_check(client,0x0E,0xBB); - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x10, 0x0E); - isp_reg_value_check(client,0x0E,0xBB); - - //isp output 2592*1944 - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x11, 0x0E); - isp_reg_value_check(client,0x0E,0xBB); - - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x07, 0x01); - isp_reg_value_check(client,0x0E,0xBB); - } - break; - default: - SENSOR_TR("%s %s isp not support this resolution!\n",SENSOR_NAME_STRING(),__FUNCTION__); - - } - - //AC freq :50Hz - sendI2cCmd(client, 0x0E, 0x00); - sendI2cCmd(client, 0x16, 0x01); - isp_reg_value_check(client,0x0E,0xBB); - - return 0; - -} -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct soc_camera_link *icl = to_soc_camera_link(icd); - struct isp_dev *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - //define the outputsize , qcif - cif is down-scaling from vga , or jaggies is very serious - sensor->isp_priv_info.outputSize = /*OUTPUT_QCIF|OUTPUT_HQVGA|OUTPUT_QVGA |OUTPUT_CIF |*/OUTPUT_VGA | OUTPUT_SVGA|OUTPUT_720P|OUTPUT_XGA|OUTPUT_QXGA|OUTPUT_UXGA|OUTPUT_QSXGA; - sensor->isp_priv_info.curRes = -1; - #if 1 - //reset , reset pin low ,then high - if (icl->reset) - icl->reset(icd->pdev); - #endif - isp_init_cmds(client); - #if 1 - isp_reg_value_check(client,0x01,PRODUCT_VERSION_VALUE_REG1); - printk("init default size :VGA\n"); - sensor->isp_priv_info.curRes = OUTPUT_VGA; - sensor_set_isp_output_res(client,OUTPUT_VGA); - #endif - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->isp_priv_info.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->isp_priv_info.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->isp_priv_info.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl){ - sensor->isp_priv_info.exposure = qctrl->default_value; - //set expose auto - sensor_set_exposure(icd,qctrl,qctrl->default_value); - } - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->isp_priv_info.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->isp_priv_info.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->isp_priv_info.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->isp_priv_info.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl){ - sensor->isp_priv_info.scene = qctrl->default_value; - sensor_set_scene(icd,qctrl,qctrl->default_value); - } - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->isp_priv_info.digitalzoom = qctrl->default_value; - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - //qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_AUTO); - //if (qctrl) - sensor->isp_priv_info.auto_focus = SENSOR_AF_MODE_CLOSE; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FACEDETECT); - if (qctrl) - sensor->isp_priv_info.face = qctrl->default_value; - return 0; -} -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - return 0; -} -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ -#if 0 - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_power_end: - return ret; -#endif -return 0; -} -#if 0 -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} -#endif -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct isp_dev *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->isp_priv_info.fmt.code; - mf->colorspace = sensor->isp_priv_info.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - return 0; -} -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct isp_dev *sensor = to_sensor(client); - //const struct v4l2_queryctrl *qctrl; - //struct soc_camera_device *icd = client->dev.platform_data; - int ret=0; - int set_w,set_h; - int supported_size = sensor->isp_priv_info.outputSize; - int res_set = 0; - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - set_w = mf->width; - set_h = mf->height; - if (((set_w <= 176) && (set_h <= 144)) && (supported_size & OUTPUT_QCIF)) - { - set_w = 176; - set_h = 144; - res_set = OUTPUT_QCIF; - } - else if (((set_w <= 320) && (set_h <= 240)) && (supported_size & OUTPUT_QVGA)) - { - set_w = 320; - set_h = 240; - res_set = OUTPUT_QVGA; - - } - else if (((set_w <= 352) && (set_h<= 288)) && (supported_size & OUTPUT_CIF)) - { - set_w = 352; - set_h = 288; - res_set = OUTPUT_CIF; - - } - else if (((set_w <= 640) && (set_h <= 480)) && (supported_size & OUTPUT_VGA)) - { - set_w = 640; - set_h = 480; - res_set = OUTPUT_VGA; - - } - else if (((set_w <= 800) && (set_h <= 600)) && (supported_size & OUTPUT_SVGA)) - { - set_w = 800; - set_h = 600; - res_set = OUTPUT_SVGA; - - } - else if (((set_w <= 1024) && (set_h <= 768)) && (supported_size & OUTPUT_XGA)) - { - set_w = 1024; - set_h = 768; - res_set = OUTPUT_XGA; - - } - else if (((set_w <= 1280) && (set_h <= 720)) && (supported_size & OUTPUT_720P)) - { - set_w = 1280; - set_h = 720; - res_set = OUTPUT_720P; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && (supported_size & OUTPUT_XGA)) - { - set_w = 1280; - set_h = 1024; - res_set = OUTPUT_XGA; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && (supported_size & OUTPUT_UXGA)) - { - set_w = 1600; - set_h = 1200; - res_set = OUTPUT_UXGA; - } - else if (((set_w <= 1920) && (set_h <= 1080)) && (supported_size & OUTPUT_1080P)) - { - set_w = 1920; - set_h = 1080; - res_set = OUTPUT_1080P; - } - else if (((set_w <= 2048) && (set_h <= 1536)) && (supported_size & OUTPUT_QXGA)) - { - set_w = 2048; - set_h = 1536; - res_set = OUTPUT_QXGA; - } - else if (((set_w <= 2592) && (set_h <= 1944)) && (supported_size & OUTPUT_QSXGA)) - { - set_w = 2592; - set_h = 1944; - res_set = OUTPUT_QSXGA; - } - else - { - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - res_set = OUTPUT_VGA; - } - if(res_set != sensor->isp_priv_info.curRes) - sensor_set_isp_output_res(client,res_set); - sensor->isp_priv_info.curRes = res_set; - mf->width = set_w; - mf->height = set_h; - -sensor_s_fmt_end: - return ret; -} -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct isp_dev *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - int supported_size = sensor->isp_priv_info.outputSize; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->isp_priv_info.fmt; - mf->code = fmt->code; - } - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && (supported_size & OUTPUT_QCIF)) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && (supported_size & OUTPUT_QVGA)) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && (supported_size & OUTPUT_CIF)) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && (supported_size & OUTPUT_VGA)) - { - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && (supported_size & OUTPUT_SVGA)) - { - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1024) && (set_h <= 768)) && (supported_size & OUTPUT_XGA)) - { - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 720)) && (supported_size & OUTPUT_720P)) - { - set_w = 1280; - set_h = 720; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && (supported_size & OUTPUT_XGA)) - { - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && (supported_size & OUTPUT_UXGA)) - { - set_w = 1600; - set_h = 1200; - } - else if (((set_w <= 1920) && (set_h <= 1080)) && (supported_size & OUTPUT_1080P)) - { - set_w = 1920; - set_h = 1080; - } - else if (((set_w <= 2048) && (set_h <= 1536)) && (supported_size & OUTPUT_QXGA)) - { - set_w = 2048; - set_h = 1536; - } - else if (((set_w <= 2592) && (set_h <= 1944)) && (supported_size & OUTPUT_QSXGA)) - { - set_w = 2592; - set_h = 1944; - } - else - { - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - - - mf->width = set_w; - mf->height = set_h; - mf->colorspace = fmt->colorspace; - - return ret; - -} - -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; - -} -static int sensor_s_stream(struct v4l2_subdev *sd, int enable){ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - if(enable == 0){ - // sensor_set_face_detect(client,0); - // sensor_af_workqueue_set(icd,0,0,true); - }else{ - //sensor_set_face_detect(client,1); - } - return 0; -} -static int sensor_g_face_area(struct v4l2_subdev *sd, void* face_data){ - struct i2c_client *client = v4l2_get_subdevdata(sd); - u8 lx_rx = 0,tx_dy = 0; - isp_i2c_read(client,0x2c,&lx_rx,0); - isp_i2c_read(client,0x2d,&tx_dy,0); - // printk("lx_rx = %x, ty_dy = %x\n",lx_rx,tx_dy); - *(u16 *)face_data = ((u16)lx_rx << 8 ) | tx_dy; - -} -static struct v4l2_subdev_core_ops isp_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, -// .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; -static struct v4l2_subdev_video_ops isp_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, - .s_stream = sensor_s_stream, - //.g_face_area = sensor_g_face_area, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &isp_subdev_core_ops, - .video = &isp_subdev_video_ops, -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - return 0; -} -static int sensor_resume(struct soc_camera_device *icd) -{ - return 0; - -} -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - - -/* sensor register read */ -static int isp_i2c_read(struct i2c_client *client, u8 reg, u8 *val,u16 ext_addr) -{ - int err = 0,cnt; - u8 buf[1]; - struct i2c_msg msg[2]; - - buf[0] = reg; - - msg[0].addr = (ext_addr == 0)? client->addr:ext_addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 0; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 50; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, &msg[0], 1); - - if (err >= 0) { - break; - } else { - //SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - if(cnt <=0 ){ - SENSOR_TR("write i2c addr erro!\n"); - return err; - } - - msg[1].addr = (ext_addr == 0)? client->addr:ext_addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 50; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, &msg[1], 1); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -u8 i2cWaitIdle(struct i2c_client *client,u8 timeOut) -{ - u8 ret; - u8 dat = 0; - /* read I2C_IDLE_IDX register until the value I2C_IDLE */ - while(timeOut) - { - ret = isp_i2c_read(client, I2C_STATUS_REG2, &dat,0); - if ((ret >= 0) && ((dat&0x01) == I2C_IDLE)) - break; - udelay(100); - timeOut--; - } - if(!timeOut){ - //SENSOR_TR("wait i2c idle erro!!\n"); - return -1; - } - return 0; -} - -static int isp_write_regs(struct i2c_client *client, u8 *reg_info, u16 num,u16 ext_addr,int seq) -{ - int err=0,cnt; - struct i2c_msg msg; - u16 windex = 0; - - switch(seq){ - case 0 : - { - msg.len = num; - msg.addr = (ext_addr == 0)? client->addr:ext_addr; - msg.flags = client->flags; - msg.buf = reg_info; - msg.scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg.read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - - cnt= 10; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, &msg, 1); - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg failed, try to write again!\n", SENSOR_NAME_STRING()); - mdelay(5); - } - } - break; - } - case 1 : - { - #define TRPERTIME (2) - int remain = 0; - msg.len = TRPERTIME; - msg.addr = (ext_addr == 0)? client->addr:ext_addr; - msg.flags = client->flags; - msg.scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg.read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - err = -EAGAIN; - remain = num % TRPERTIME; - while(windex < num){ - cnt= 10; - msg.buf = reg_info+windex; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, &msg, 1); - if (err >= 0) { - break; - } else { - SENSOR_TR("\n %s write reg failed, try to write again ,index = %d!\n", SENSOR_NAME_STRING(),windex); - udelay(10); - } - } - if(cnt <= 0){ - SENSOR_TR("\n %s write reg failed ,index = %d!\n", SENSOR_NAME_STRING(),windex); - break; - } - windex+= TRPERTIME; - if((windex >= num) && (remain != 0)){ - windex = num - remain; - remain = 0; - } - } - if(err >= 0){ - err = 0; - if(num % TRPERTIME){ - SENSOR_TR("\n %s isp_write_regs sucess ,index = %d, val = %x!!\n",SENSOR_NAME_STRING(),(windex - (TRPERTIME - num % TRPERTIME) -1),*((u8*)(reg_info+(windex - (TRPERTIME - num % TRPERTIME) -1)))); - } - else{ - SENSOR_TR("\n %s isp_write_regs sucess ,index = %d, val = %x!!\n",SENSOR_NAME_STRING(),windex - 1,*((u8*)(reg_info+windex - 1))); - } - } - - break; - } - default: - SENSOR_TR("\n %s isp_write_regs erro\n",SENSOR_NAME_STRING()); - } - - return err; - -} - -static u8 sendI2cCmd(struct i2c_client *client,u8 cmd, u8 dat) -{ - u8 buf[2]; - buf[0] = cmd & 0xFF; - buf[1] = dat; - if (i2cWaitIdle(client,100) < 0){ - SENSOR_TR("%s:%d,send i2c command erro!",__func__,__LINE__); - return -1; - } - if (isp_write_regs(client,buf,2,0,0)<0) - { - SENSOR_TR("%s:%d,send i2c command erro!",__func__,__LINE__); - return -1; - } - //check the write - #if WRITE_READ_CHECK - if(cmd != 0xE){// no need to check if 0x0e - buf[1] = 0xff; - isp_i2c_read(client,cmd,&buf[1],0); - if(buf[1]!=dat){ - SENSOR_TR("%s:%d,send i2c command check erro,reg %x:(%x:%x)\n!",__func__,__LINE__,cmd,buf[1],dat); - } - } - #endif - return 0; -} - -static int flash_program_mode(struct i2c_client *client,bool enable){ - u8 ss_array[2] = {0x5b,enable}; - u8 mem_choose[2] = {0x80,0x2}; // 0x2 ,flash ;0x0 sdram - if(enable == true){ - //select flash mem - if(isp_write_regs(client,(u8*)mem_choose,sizeof(mem_choose),0,0)){ - SENSOR_TR("%s:%d,enter_program_mode %d erro!",__func__,__LINE__,enable); - return -1; - } - //enter pro mode - if(isp_write_regs(client,(u8*)ss_array,sizeof(ss_array),0,0)){ - SENSOR_TR("%s:%d,enter_program_mode %d erro!",__func__,__LINE__,enable); - return -1; - } - mdelay(10); - }else{ - //exit promode - mem_choose[1] = 0x0; - if(isp_write_regs(client,(u8*)ss_array,sizeof(ss_array),0,0)){ - SENSOR_TR("%s:%d,enter_program_mode %d erro!",__func__,__LINE__,enable); - return -1; - } - //select sdram mem - mdelay(10); - if(isp_write_regs(client,(u8*)mem_choose,sizeof(mem_choose),0,0)){ - SENSOR_TR("%s:%d,enter_program_mode %d erro!",__func__,__LINE__,enable); - return -1; - } - } - return 0; -} -static int flash_mem_erase(struct i2c_client *client,u8 sector){ - //default is chip erase. - u8 ss_array[3] = {0x00,sector,0x02}; - - if(sector == 0xFF){ - if(isp_write_regs(client,(u8*)ss_array,sizeof(ss_array),DEV_ID_MV9335_I2CSLAVE_FLASH_PRO,0)){ - SENSOR_TR("%s:%d,chip_erase erro!",__func__,__LINE__); - return -1; - } - //delay 120ms - mdelay(120); - }else{ - ss_array[2] = 0x05; - if(isp_write_regs(client,(u8*)ss_array,sizeof(ss_array),DEV_ID_MV9335_I2CSLAVE_FLASH_PRO,0)){ - SENSOR_TR("%s:%d,sector_erase erro\n!",__func__,__LINE__); - return -1; - } - mdelay(120); - } - - return 0; -} -static int flash_write_read_addr(struct i2c_client *client,u16 addr,u8 commd){ - //commd :0x50 write, 0x00 read - u8 lsb = get_lsb(addr); - u8 msb = get_msb(addr); - u8 ss_array[3] = {lsb,msb,commd}; - if(isp_write_regs(client,(u8*)ss_array,sizeof(ss_array),DEV_ID_MV9335_I2CSLAVE_FLASH_PRO,0)){ - SENSOR_TR("%s:%d,flash_write_addr erro!",__func__,__LINE__); - return -1; - } - return 0; -} -static int flash_write_data(struct i2c_client *client){ - int ret = 0; - const struct firmware *fw = NULL; - ret = request_firmware(&fw, fw_name, &client->dev); - if(ret){ - SENSOR_TR("%s:%d,request_firmware erro+++++++++++++!\n",__func__,__LINE__); - ret = -1; - goto free_fw_buffer; - } - SENSOR_TR("%s:%d,request_firmware sucess,val = %x!\n",__func__,__LINE__,*((u8*)fw->data+fw->size-1)); - if(isp_write_regs(client,(u8*)fw->data,fw->size,DEV_ID_MV9335_I2CSLAVE_FLASH_PRO,1)){ - SENSOR_TR("%s:%d,flash_write_data erro,size = %d!\n",__func__,__LINE__,fw->size); - ret = -1; - goto free_fw_buffer; - } - #if FLASH_WRITE_CHECK // read all datas back to check - { - flash_write_read_addr(client,0x00,0x00); - u8 rd_data = 0; - u32 i = 0; - for(;isize;i++){ - flash_read_data(client,&rd_data,1); - if(rd_data!= *((u8*)(fw->data+i))) - { - printk("0x%x, ori = 0x%x, rb = 0x%x\n",i,*((u8*)(fw->data+i)),rd_data); - break; - } - rd_data = 0; - udelay(200); - } - } - #endif - -free_fw_buffer: - if(fw) - release_firmware(fw); - return ret; -} -static int flash_read_data(struct i2c_client *client,u8* rd_data,int readcount){ - int err = 0,cnt,i = 0; - //u8 buf[2]; - u8 buf; - struct i2c_msg msg; - - msg.addr = DEV_ID_MV9335_I2CSLAVE_FLASH_PRO; - msg.flags = client->flags|I2C_M_RD; - msg.buf = &buf; - msg.len = 1; - msg.scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg.read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - for(i = 0;i < readcount;i++){ - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, &msg, 1); - - if (err >= 0) { - rd_data[i] = buf; - break; - } else { - //SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - if(cnt <=0 ){ - SENSOR_TR("flash read erro,i = %d ,readcount = %d!\n",i,readcount); - return err; - } - } - return 0; -} -static int isp_load_fw_prepare(struct i2c_client *client){ - //pll start cmd - sendI2cCmd(client, 0x80, 0x0); -// msleep(5); - //flash memory devider - sendI2cCmd(client, 0xD0, 0x30); -// msleep(5); - //pll 1 Conf.command(24MHZ->192MHZ) - sendI2cCmd(client, 0x40, 0x01); - sendI2cCmd(client, 0x41, 0x40); - sendI2cCmd(client, 0x42, 0x05); - sendI2cCmd(client, 0x49, 0x03); - sendI2cCmd(client, 0x80, 0x02); -// sendI2cCmd(client, 0x4A, 0x01); - return 0; -} -static int isp_init_cmds(struct i2c_client *client){ - //pll start cmd - sendI2cCmd(client, 0x80, 0x0); -// msleep(5); - //flash memory devider - sendI2cCmd(client, 0xD0, 0x30); -// msleep(5); - //pll 1 Conf.command(24MHZ->192MHZ) - sendI2cCmd(client, 0x40, 0x01); - sendI2cCmd(client, 0x41, 0x40); - sendI2cCmd(client, 0x42, 0x05); - sendI2cCmd(client, 0x49, 0x03); - isp_reg_value_check(client,0x36,0x03); - sendI2cCmd(client, 0x80, 0x03); -// sendI2cCmd(client, 0x4A, 0x01); - // msleep(100); - return 0; -} -static int isp_init_check(struct i2c_client *client){ - if(!isp_reg_value_check(client,0x00,PRODUCT_ID_VALUE_REG0)){ - SENSOR_TR("%s:%d,check erro!\n", __func__,__LINE__); - return -1; - } - if(!isp_reg_value_check(client,0x01,PRODUCT_VERSION_VALUE_REG1)){ - SENSOR_TR("%s:%d,check erro!\n", __func__,__LINE__); - return -1; - } - - isp_reg_value_check(client,0x02,FIRMWARE_MAJOR_VERSION_VALUE_REG2); - isp_reg_value_check(client,0x03,FIRMWARE_MINOR_VERSION_VALUE_REG3); - isp_reg_value_check(client,0x05,I2C_CHECKE_VALUE_REG5); - // isp_reg_value_check(client,0x06,CHECKE_VALUE_REG6); - //now do not check the two reg. - sendI2cCmd(client, 0x1F, 0x01); - isp_reg_value_check(client,0x90,CHECKE_VALUE_REG0X90); - isp_reg_value_check(client,0x91,CHECKE_VALUE_REG0X91); - SENSOR_TR("%s:%d,check succsess!\n", __func__,__LINE__); - //while(1); - return 0; -} -static int flash_down_load_firmware(struct i2c_client *client,u16 addr){ - struct soc_camera_device *icd = client->dev.platform_data; - struct soc_camera_link *icl = to_soc_camera_link(icd); - isp_load_fw_prepare(client); - // 1.enter pro mode - if(flash_program_mode(client,true)){ - printk("%s:%d erro \n",__func__,__LINE__); - goto erro_quit; - } - // 2. flash erase , chip erase or sector erase - #if FLASH_ERASE_BY_SECTOR - //for test - { - int sect,sectCnt,i; - - sect = 0; - sectCnt = 15; - for(i = 0;i < sectCnt;i++) - { - sect = (i << 4) & 0xF0; - if(flash_mem_erase(client,sect/*+i*/)) - { - printk("%s:%d erro \n",__func__,__LINE__); - goto erro_quit_promode; - } - } - } - #elif FLASH_ERASE_ALL - if(flash_mem_erase(client,0xFF)) - { - printk("%s:%d erro \n",__func__,__LINE__); - goto erro_quit_promode; - } - #endif - - // 3. write addr - if(flash_write_read_addr(client,addr,0x50)){ - printk("%s:%d erro \n",__func__,__LINE__); - goto erro_quit_promode; - } - - // 4. write data ,sequence write - if(flash_write_data(client)){ - printk("%s:%d erro \n",__func__,__LINE__); - goto erro_quit_promode; - } - // 5. quit pro mode - if(flash_program_mode(client,false)){ - printk("%s:%d erro \n",__func__,__LINE__); - goto erro_quit; - } - //reset , reset pin low ,then high - if (icl->reset) - icl->reset(icd->pdev); - mdelay(10); - isp_init_cmds(client); - isp_init_check(client); - return 0; - erro_quit_promode: - flash_program_mode(client,false); - erro_quit: - printk("%s:%d erro \n",__func__,__LINE__); - return -1; -} -static int flash_read_firmware_data(struct i2c_client *client,u16 addr,u8* rd_data,int readcount){ - // 1.enter pro mode - if(flash_program_mode(client,true)){ - printk("%s:%d erro \n",__func__,__LINE__); - goto erro_quit; - } - // 2. write addr - if(flash_write_read_addr(client,addr,0x00)){ - printk("%s:%d erro \n",__func__,__LINE__); - goto erro_quit_promode; - } - // 3. read data - if(flash_read_data(client,rd_data,readcount)){ - printk("%s:%d erro \n",__func__,__LINE__); - goto erro_quit_promode; - } - // 4. quit pro mode - if(flash_program_mode(client,false)){ - printk("%s:%d erro \n",__func__,__LINE__); - goto erro_quit; - } - return 0; - erro_quit_promode: - flash_program_mode(client,false); - erro_quit: - printk("%s:%d erro \n",__func__,__LINE__); - return -1; -} -//power control -//power_up sequence : reset low,no mclk; power up ; supply mclk ; reset high -//power_off sequence: reset low ,mclk off , power off -//power down sequence :as the power up ,then cut off mclk; -//wake up from power down: supply mclk ;reset asserted twice(low - high -low -high) -//soc camera has done the power control -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - //get the pid of sensor - //pll start cmd - - //ISP initialization check -#if 1 - flash_down_load_firmware(client,0x00); - isp_init_cmds(client); - if(!isp_init_check(client)){ - SENSOR_TR("%s:%d,check erro!\n", __func__,__LINE__); - return -1; - } - -#endif - return 0; - -//sensor_video_probe_err: - // return ret; -} -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct isp_dev *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct isp_dev), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - sensor->isp_priv_info.fmt = sensor_colour_fmts[0]; - - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } else { - #if CONFIG_SENSOR_Focus - sensor->sensor_wq = create_workqueue(SENSOR_NAME_STRING(_af_workqueue)); - if (sensor->sensor_wq == NULL) - SENSOR_TR("%s create fail!", SENSOR_NAME_STRING(_af_workqueue)); - mutex_init(&sensor->wq_lock); - #endif - mutex_init(&sensor->isp_priv_info.access_data_lock); - - } - - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} -static int sensor_remove(struct i2c_client *client) -{ - struct isp_dev *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - - return 0; -} -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); diff --git a/drivers/media/video/nt99160_2way.c b/drivers/media/video/nt99160_2way.c deleted file mode 100644 index 27e6f7215c9e..000000000000 --- a/drivers/media/video/nt99160_2way.c +++ /dev/null @@ -1,1283 +0,0 @@ -/* - * drivers/media/video/nt99160_2way.c - * - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "generic_sensor.h" - -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.1.1: -* add sensor_focus_af_const_pause_usr_cb; -*/ -static int version = KERNEL_VERSION(0,1,1); -module_param(version, int, S_IRUGO); - -static int debug =1; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -/* Sensor Driver Configuration Begin */ -//define sensor_i2c_slave_id 0x54 -#define SENSOR_NAME RK29_CAM_SENSOR_NT99160 -#define SENSOR_V4L2_IDENT V4L2_IDENT_NT99160 -#define SENSOR_ID 0x1600 -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_PCLK_SAMPLE_RISING|V4L2_MBUS_HSYNC_ACTIVE_HIGH| V4L2_MBUS_VSYNC_ACTIVE_HIGH|\ - V4L2_MBUS_DATA_ACTIVE_HIGH |SOCAM_MCLK_24MHZ) - -#define SENSOR_PREVIEW_W 800 -#define SENSOR_PREVIEW_H 600 -#define SENSOR_PREVIEW_FPS 15000 // 15fps -#define SENSOR_FULLRES_L_FPS 5000 // 5fps -#define SENSOR_FULLRES_M_FPS 10000 // 5fps -#define SENSOR_FULLRES_H_FPS 15000 // 15-20fps -#define SENSOR_720P_FPS 5000 -#define SENSOR_1080P_FPS 0 - -#define SENSOR_REGISTER_LEN 2 // sensor register address bytes -#define SENSOR_VALUE_LEN 1 // sensor register value bytes - -static unsigned int SensorConfiguration = 0; -static unsigned int SensorChipID[] = {SENSOR_ID}; - -/* Sensor Driver Configuration End */ - - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a,b) CONS4(SensorReg,SENSOR_REGISTER_LEN,Val,SENSOR_VALUE_LEN)(a,b) -#define sensor_write(client,reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_read(client,reg,v) CONS4(sensor_read_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_write_array generic_sensor_write_array - -struct sensor_parameter -{ - unsigned int PreviewDummyPixels; - unsigned int CaptureDummyPixels; - unsigned int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int PreviewPclk; - unsigned short int CapturePclk; - char awb[6]; -}; - -struct specific_sensor{ - struct generic_sensor common_sensor; - //define user data below - struct sensor_parameter parameter; - -}; - -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ - -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_init_data[] ={ - {0x3100, 0x03}, - {0x3101, 0x80}, - {0x3102, 0x09}, - {0x3104, 0x03}, - {0x3105, 0x03}, - {0x3106, 0x05}, - {0x3107, 0x40}, - {0x3108, 0x00}, - {0x3109, 0x82}, - {0x310A, 0x04}, - {0x310B, 0x00}, - {0x310C, 0x00}, - {0x3111, 0x56}, - {0x3113, 0x66}, - {0x3118, 0xA7}, - {0x3119, 0xA7}, - {0x311A, 0xA7}, - {0x311B, 0x1F}, - {0x303f, 0x0e}, - {0x3041, 0x04}, - {0x3051, 0xf4}, - {0x320A, 0x5A}, - {0x3250, 0x80}, - {0x3251, 0x01}, - {0x3252, 0x38}, - {0x3253, 0xA8}, - {0x3254, 0x01}, - {0x3255, 0x00}, - {0x3256, 0x8C}, - {0x3257, 0x70}, - {0x329B, 0x00}, - {0x32A1, 0x00}, - {0x32A2, 0xd8}, - {0x32A3, 0x01}, - {0x32A4, 0x5d}, - {0x32A5, 0x01}, - {0x32A6, 0x0c}, - {0x32A7, 0x01}, - {0x32A8, 0xa8}, - {0x3210, 0x32}, - {0x3211, 0x2a}, - {0x3212, 0x30}, - {0x3213, 0x32}, - {0x3214, 0x2e}, - {0x3215, 0x2e}, - {0x3216, 0x2e}, - {0x3217, 0x2e}, - {0x3218, 0x2c}, - {0x3219, 0x2e}, - {0x321A, 0x2a}, - {0x321B, 0x2a}, - {0x321C, 0x2e}, - {0x321D, 0x2e}, - {0x321E, 0x28}, - {0x321F, 0x2c}, - {0x3220, 0x01}, - {0x3221, 0x48}, - {0x3222, 0x01}, - {0x3223, 0x48}, - {0x3224, 0x01}, - {0x3225, 0x48}, - {0x3226, 0x01}, - {0x3227, 0x48}, - {0x3228, 0x00}, - {0x3229, 0xa4}, - {0x322A, 0x00}, - {0x322B, 0xa4}, - {0x322C, 0x00}, - {0x322D, 0xa4}, - {0x322E, 0x00}, - {0x322F, 0xa4}, - {0x3243, 0xc2}, - {0x3270, 0x10}, - {0x3271, 0x1B}, - {0x3272, 0x26}, - {0x3273, 0x3E}, - {0x3274, 0x4F}, - {0x3275, 0x5E}, - {0x3276, 0x78}, - {0x3277, 0x8F}, - {0x3278, 0xA3}, - {0x3279, 0xB4}, - {0x327A, 0xD2}, - {0x327B, 0xE3}, - {0x327C, 0xF0}, - {0x327D, 0xF7}, - {0x327E, 0xFF}, - {0x32F6, 0x0C}, - {0x33c2, 0xF0}, - {0x3302, 0x00}, - {0x3303, 0x3E}, - {0x3304, 0x00}, - {0x3305, 0xC2}, - {0x3306, 0x00}, - {0x3307, 0x00}, - {0x3308, 0x07}, - {0x3309, 0xC4}, - {0x330A, 0x06}, - {0x330B, 0xED}, - {0x330C, 0x01}, - {0x330D, 0x4F}, - {0x330E, 0x01}, - {0x330F, 0x41}, - {0x3310, 0x06}, - {0x3311, 0xDD}, - {0x3312, 0x07}, - {0x3313, 0xE3}, - {0x3326, 0x14}, - {0x3327, 0x04}, - {0x3328, 0x04}, - {0x3329, 0x02}, - {0x332A, 0x02}, - {0x332B, 0x1D}, - {0x332C, 0x1D}, - {0x332D, 0x04}, - {0x332E, 0x1E}, - {0x332F, 0x1F}, - {0x3331, 0x0a}, - {0x3332, 0x40}, - {0x33C9, 0xD8}, - {0x33C0, 0x01}, - {0x333F, 0x07}, - {0x3360, 0x10}, - {0x3361, 0x18}, - {0x3362, 0x1f}, - {0x3363, 0xb3}, - {0x3368, 0xb0}, - {0x3369, 0xa0}, - {0x336A, 0x90}, - {0x336B, 0x80}, - {0x336C, 0x00}, - {0x3363, 0xB3}, - {0x3364, 0x00}, - {0x3365, 0x10}, - {0x3366, 0x06}, - {0x336d, 0x18}, - {0x336e, 0x18}, - {0x336f, 0x10}, - {0x3370, 0x10}, - {0x3371, 0x3F}, - {0x3372, 0x3F}, - {0x3373, 0x3F}, - {0x3374, 0x3F}, - {0x3375, 0x20}, - {0x3376, 0x20}, - {0x3377, 0x28}, - {0x3378, 0x30}, - {0x32f6, 0x0C}, - {0x33A0, 0xE0}, - {0x33A1, 0x20}, - {0x33A2, 0x00}, - {0x33A3, 0x40}, - {0x33A4, 0x00}, - {0x32BF, 0x60}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={ - {0x32BF, 0x60}, - {0x32C0, 0x84}, - {0x32C1, 0x84}, - {0x32C2, 0x84}, - {0x32C3, 0x00}, - {0x32C4, 0x20}, - {0x32C5, 0x20}, - {0x32C6, 0x20}, - {0x32C7, 0x00}, - {0x32C8, 0x95}, - {0x32C9, 0x84}, - {0x32CA, 0xA4}, - {0x32CB, 0xA4}, - {0x32CC, 0xA4}, - {0x32CD, 0xA4}, - {0x32DB, 0x72}, - {0x3241, 0x8B}, - {0x32F0, 0x00}, - {0x3200, 0x3E}, - {0x3201, 0x0F}, - {0x302A, 0x00}, - {0x302C, 0x07}, - {0x302D, 0x00}, - {0x302E, 0x00}, - {0x302F, 0x02}, - {0x3022, 0x24}, - {0x3023, 0x24}, - {0x3002, 0x00}, - {0x3003, 0x04},//x_start=4 - {0x3004, 0x00}, - {0x3005, 0x04},//y_start=4 - {0x3006, 0x05}, - {0x3007, 0x03},//x_end =1283 - {0x3008, 0x02}, - {0x3009, 0xD3},//y_end =723 - {0x300A, 0x06}, - {0x300B, 0x48},//pixel_num=1608 - {0x300C, 0x0B}, - {0x300D, 0xA9},//line_num=2985 - {0x300E, 0x05}, - {0x300F, 0x00},//x_width = 1280 - {0x3010, 0x02}, - {0x3011, 0xD0},//y_height=720 - {0x32B8, 0x3F}, - {0x32B9, 0x31}, - {0x32BB, 0x87}, - {0x32BC, 0x38}, - {0x32BD, 0x3C}, - {0x32BE, 0x34}, - {0x3201, 0x3F}, - {0x3109, 0x82}, - {0x310B, 0x00}, - {0x3530, 0xC0}, - {0x3021, 0x06}, - {0x3060, 0x01}, - SensorEnd -}; - - -/* Senor full resolution setting: recommand for capture */ -#if 0 -static struct rk_sensor_reg sensor_fullres_midfps_data[] ={ - {0x32BF, 0x60}, - {0x32C0, 0x74}, - {0x32C1, 0x74}, - {0x32C2, 0x74}, - {0x32C3, 0x00}, - {0x32C4, 0x20}, - {0x32C5, 0x20}, - {0x32C6, 0x20}, - {0x32C7, 0x00}, - {0x32C8, 0x95}, - {0x32C9, 0x74}, - {0x32CA, 0x94}, - {0x32CB, 0x94}, - {0x32CC, 0x94}, - {0x32CD, 0x94}, - {0x32DB, 0x72}, - {0x3241, 0x83}, - {0x32F0, 0x00}, - {0x3200, 0x3E}, - {0x3201, 0x0F}, - {0x302A, 0x00}, - {0x302C, 0x07}, - {0x302D, 0x00}, - {0x302E, 0x00}, - {0x302F, 0x02}, - {0x3022, 0x27}, - {0x3023, 0x24}, - {0x3002, 0x00}, - {0x3003, 0x04},//x_start=4 - {0x3004, 0x00}, - {0x3005, 0x04},//y_start=4 - {0x3006, 0x05}, - {0x3007, 0x03},//x_end = 1283 - {0x3008, 0x02}, - {0x3009, 0xD3},//y_end =723 - {0x300A, 0x06}, - {0x300B, 0x48},//pixel_num = 1608 - {0x300C, 0x05}, - {0x300D, 0xD4},//line_num = 1492 - {0x300E, 0x05}, - {0x300F, 0x00},//x_width = 1280 - {0x3010, 0x02}, - {0x3011, 0xD0},//y_height=720 - {0x32B8, 0x3F}, - {0x32B9, 0x31}, - {0x32BB, 0x87}, - {0x32BC, 0x38}, - {0x32BD, 0x3C}, - {0x32BE, 0x34}, - {0x3201, 0x3F}, - {0x3109, 0x82}, - {0x310B, 0x00}, - {0x3530, 0xC0}, - {0x3021, 0x06}, - {0x3060, 0x01}, - SensorEnd -}; -#endif -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] ={ - {0x32BF, 0x60}, - {0x32C0, 0x6A}, - {0x32C1, 0x6A}, - {0x32C2, 0x6A}, - {0x32C3, 0x00}, - {0x32C4, 0x20}, - {0x32C5, 0x20}, - {0x32C6, 0x20}, - {0x32C7, 0x00}, - {0x32C8, 0x95}, - {0x32C9, 0x6A}, - {0x32CA, 0x8A}, - {0x32CB, 0x8A}, - {0x32CC, 0x8A}, - {0x32CD, 0x8A}, - {0x32DB, 0x72}, - {0x3241, 0x7E}, - {0x32F0, 0x00}, - {0x3200, 0x3E}, - {0x3201, 0x0F}, - {0x302A, 0x00}, - {0x302C, 0x07}, - {0x302D, 0x00}, - {0x302E, 0x00}, - {0x302F, 0x02}, - {0x3022, 0x27}, - {0x3023, 0x24}, - {0x3002, 0x00}, - {0x3003, 0x04},//x_start=4 - {0x3004, 0x00}, - {0x3005, 0x04},//y_start=4 - {0x3006, 0x05}, - {0x3007, 0x03},//x_end=1283 x_width=1280 - {0x3008, 0x02}, - {0x3009, 0xD3},//y_end=723 y_height=720 - {0x300A, 0x06}, - {0x300B, 0x48},//line_pixel_num =1608 - {0x300C, 0x02}, - {0x300D, 0xEA},//line_num=746 - {0x300E, 0x05}, - {0x300F, 0x00},//x_width = 1280 - {0x3010, 0x02}, - {0x3011, 0xD0},//y_height = 720 - {0x32B8, 0x3F}, - {0x32B9, 0x31}, - {0x32BB, 0x87}, - {0x32BC, 0x38}, - {0x32BD, 0x3C}, - {0x32BE, 0x34}, - {0x3201, 0x3F}, - {0x3109, 0x82}, - {0x310B, 0x00}, - {0x3530, 0xC0}, - {0x3021, 0x06}, - {0x3060, 0x01}, - SensorEnd -}; -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data[] = -{ - {0x32BF, 0x60}, - {0x32C0, 0x6A}, - {0x32C1, 0x6A}, - {0x32C2, 0x6A}, - {0x32C3, 0x00}, - {0x32C4, 0x20}, - {0x32C5, 0x20}, - {0x32C6, 0x20}, - {0x32C7, 0x00}, - {0x32C8, 0xBA}, - {0x32C9, 0x6A}, - {0x32CA, 0x8A}, - {0x32CB, 0x8A}, - {0x32CC, 0x8A}, - {0x32CD, 0x8A}, - {0x32DB, 0x77}, - {0x3241, 0x80}, - {0x32E0, 0x03}, - {0x32E1, 0x20}, - {0x32E2, 0x02}, - {0x32E3, 0x58}, - {0x32E4, 0x00}, - {0x32E5, 0x33}, - {0x32E6, 0x00}, - {0x32E7, 0x33}, - {0x32E8, 0x01}, - {0x32F0, 0x00}, - {0x3200, 0x3E}, - {0x3201, 0x0F}, - {0x302A, 0x00}, - {0x302C, 0x07}, - {0x302D, 0x00}, - {0x302E, 0x00}, - {0x302F, 0x02}, - {0x3022, 0x24}, - {0x3023, 0x24}, - {0x3002, 0x00}, - {0x3003, 0xA4},//x_start=164 - {0x3004, 0x00}, - {0x3005, 0x04},//y_start=4 - {0x3006, 0x04}, - {0x3007, 0x63},//x_end=1123 - {0x3008, 0x02}, - {0x3009, 0xD3},//y_end=723 - {0x300A, 0x05}, - {0x300B, 0x08},//pixel_num=1288 - {0x300C, 0x02}, - {0x300D, 0xE0},//line_num=736 - {0x300E, 0x03}, - {0x300F, 0xC0},//x_width=960 - {0x3010, 0x02}, - {0x3011, 0xD0},//y_height=720 - {0x32B8, 0x3F}, - {0x32B9, 0x31}, - {0x32BB, 0x87}, - {0x32BC, 0x38}, - {0x32BD, 0x3C}, - {0x32BE, 0x34}, - {0x3201, 0x7F}, - {0x3109, 0x82}, - {0x310B, 0x00}, - {0x3530, 0xC0}, - {0x3021, 0x06}, - {0x3060, 0x01}, - - SensorEnd -}; -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[]={ - - {0x32BF, 0x60}, - {0x32C0, 0x84}, - {0x32C1, 0x84}, - {0x32C2, 0x84}, - {0x32C3, 0x00}, - {0x32C4, 0x20}, - {0x32C5, 0x20}, - {0x32C6, 0x20}, - {0x32C7, 0x00}, - {0x32C8, 0x95}, - {0x32C9, 0x84}, - {0x32CA, 0xA4}, - {0x32CB, 0xA4}, - {0x32CC, 0xA4}, - {0x32CD, 0xA4}, - {0x32DB, 0x72}, - {0x3241, 0x8B}, - {0x32F0, 0x00}, - {0x3200, 0x3E}, - {0x3201, 0x0F}, - {0x302A, 0x00}, - {0x302C, 0x07}, - {0x302D, 0x00}, - {0x302E, 0x00}, - {0x302F, 0x02}, - {0x3022, 0x24}, - {0x3023, 0x24}, - {0x3002, 0x00}, - {0x3003, 0x04},//x_start=4 - {0x3004, 0x00}, - {0x3005, 0x04},//y_start=4 - {0x3006, 0x05}, - {0x3007, 0x03},//x_end =1283 - {0x3008, 0x02}, - {0x3009, 0xD3},//y_end =723 - {0x300A, 0x06}, - {0x300B, 0x48},//pixel_num=1608 - {0x300C, 0x0B}, - {0x300D, 0xA9},//line_num=2985 - {0x300E, 0x05}, - {0x300F, 0x00},//x_width = 1280 - {0x3010, 0x02}, - {0x3011, 0xD0},//y_height=720 - {0x32B8, 0x3F}, - {0x32B9, 0x31}, - {0x32BB, 0x87}, - {0x32BC, 0x38}, - {0x32BD, 0x3C}, - {0x32BE, 0x34}, - {0x3201, 0x3F}, - {0x3109, 0x82}, - {0x310B, 0x00}, - {0x3530, 0xC0}, - {0x3021, 0x06}, - {0x3060, 0x01}, - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[]={ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_softreset_data[]={ - SensorRegVal(0x3021,0x61), - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[]={ - SensorRegVal(0x3000,0), - SensorRegVal(0x3001,0), - SensorEnd -}; -/* -* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx -*/ -static struct rk_sensor_reg sensor_WhiteB_Auto[]= -{ - {0x3201, 0x3F}, - SensorEnd -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[]= -{ - {0x3201, 0x2F}, - {0x3290, 0x01}, - {0x3291, 0x51}, - {0x3296, 0x01}, - {0x3297, 0x00}, - {0x3060, 0x01}, - SensorEnd -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[]= -{ - {0x3201, 0x2F}, - {0x3290, 0x01}, - {0x3291, 0x38}, - {0x3296, 0x01}, - {0x3297, 0x68}, - {0x3060, 0x01}, - SensorEnd -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]= -{ - //INCANDESCENCE - {0x3201, 0x2F}, - {0x3290, 0x01}, - {0x3291, 0x30}, - {0x3296, 0x01}, - {0x3297, 0xCB}, - {0x3060, 0x01}, - SensorEnd -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]= -{ - //FLUORESCENT] - {0x3201, 0x2F}, - {0x3290, 0x01}, - {0x3291, 0x70}, - {0x3296, 0x01}, - {0x3297, 0xFF}, - {0x3060, 0x01}, - SensorEnd -}; - -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp3[]= -{ - //TUNGSTEN] - {0x3201, 0x2F}, - {0x3290, 0x01}, - {0x3291, 0x00}, - {0x3296, 0x02}, - {0x3297, 0x30}, - {0x3060, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,sensor_WhiteB_TungstenLamp3,NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[]= -{ - // Brightness -2 - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[]= -{ - // Brightness -1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[]= -{ - // Brightness 0 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[]= -{ - // Brightness +1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[]= -{ - // Brightness +2 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[]= -{ - // Brightness +3 - - SensorEnd -}; -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = -{ - {0x32F1, 0x00}, - {0x32F4, 0x80}, - {0x32F5, 0x80}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = -{ - //Grayscale - {0x32F1, 0x01}, - {0x32F6, 0X08}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = -{ - //Sepia - {0x32F1, 0x02}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Inverse[] = -{ - //Inverse - {0x32F1, 0x03}, - SensorEnd -}; -static struct rk_sensor_reg sensor_Effect_Bluish[] = -{ - // Bluish - {0x32F1, 0x05}, - {0x32F4, 0xF0}, - {0x32F5, 0x80}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = -{ - //Greenish - {0x32F1, 0x05}, - {0x32F4, 0x60}, - {0x32F5, 0x20}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Solarization[] = -{ - //Solarization - {0x32F1, 0x04}, - SensorEnd -}; - - -static struct rk_sensor_reg *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Inverse,sensor_Effect_Sepia, - sensor_Effect_Bluish,sensor_Effect_Green,sensor_Effect_Solarization, NULL, -}; - -static struct rk_sensor_reg sensor_Exposure04[]= -{ - //[EV-4] - {0x32F6, 0X0C}, - {0x32F2, 0x40}, - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Exposure03[]= -{ - //[EV-3] - {0x32F6, 0X0C}, - {0x32F2, 0x50}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure02[]= -{ - //[EV-2] - {0x32F6, 0X0C}, - {0x32F2, 0x60}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure01[]= -{ - //[EV-1] - {0x32F6, 0X0C}, - {0x32F2, 0x70}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure00[]= -{ - //[EV+0] - {0x32F6, 0X0C}, - {0x32F2, 0x80}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure11[]= -{ - //[EV+1] - {0x32F6, 0X0C}, - {0x32F2, 0x90}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure12[]= -{ - //[EV+2] - {0x32F6, 0X0C}, - {0x32F2, 0xA0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure13[]= -{ - //[EV+3] - {0x32F6, 0X0C}, - {0x32F2, 0xB0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure14[]= -{ - //[EV+4] - {0x32F6, 0X0C}, - {0x32F2, 0xC0}, - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = {sensor_Exposure04,sensor_Exposure03, sensor_Exposure02, sensor_Exposure01, sensor_Exposure00, - sensor_Exposure11, sensor_Exposure12,sensor_Exposure13,sensor_Exposure14,NULL, -}; - -static struct rk_sensor_reg sensor_Saturation0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -static struct rk_sensor_reg sensor_Contrast04[]= -{ - //[Contrast : -4] - {0x32F6, 0x0C}, - {0x32C2, 0x40}, - {0x32F2, 0x40}, - {0x3060, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast03[]= -{ - //[Contrast : -3] - {0x32F6, 0x0C}, - {0x32C2, 0x30}, - {0x32F2, 0x50}, - {0x3060, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast02[]= -{ - //[Contrast : -2] - {0x32F6, 0x0C}, - {0x32C2, 0x20}, - {0x32F2, 0x60}, - {0x3060, 0x01}, - SensorEnd -}; -static struct rk_sensor_reg sensor_Contrast01[]= -{ - //[Contrast : -1] - {0x32F6, 0x0C}, - {0x32C2, 0x10}, - {0x32F2, 0x70}, - {0x3060, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast00[]= -{ - //[Contrast : 0] - {0x32F6, 0x0C}, - {0x32C2, 0x00}, - {0x32F2, 0x80}, - {0x3060, 0x01}, - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Contrast11[]= -{ - //[Contrast : +1] - {0x32F6, 0x0C}, - {0x32C2, 0xF0}, - {0x32F2, 0x90}, - {0x3060, 0x01}, - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Contrast12[]= -{ - //[Contrast : +2] - {0x32F6, 0x0C}, - {0x32C2, 0xE0}, - {0x32F2, 0xA0}, - {0x3060, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast13[]= -{ - //[Contrast : +3] - {0x32F6, 0x0C}, - {0x32C2, 0xD0}, - {0x32F2, 0xB0}, - {0x3060, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast14[]= -{ - //[Contrast : +4] - {0x32F6, 0x0C}, - {0x32C2, 0xC0}, - {0x32F2, 0xC0}, - {0x3060, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ContrastSeqe[] = {sensor_Contrast04, sensor_Contrast03, sensor_Contrast02, sensor_Contrast01, - sensor_Contrast00, sensor_Contrast11, sensor_Contrast12, sensor_Contrast13, sensor_Contrast14,NULL, -}; -static struct rk_sensor_reg sensor_SceneAuto[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -static struct rk_sensor_reg sensor_Zoom0[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Zoom3[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; - -/* -* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu -*/ -static struct v4l2_querymenu sensor_menus[] = -{ - //white balance - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,0,"auto",0), - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,1,"incandescent",0), - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,2,"fluorescent",0), - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,3,"daylight",0), - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,4,"cloudy-daylight",0), - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,5,"tungsten",0), - - //speical effect - new_usr_v4l2menu(V4L2_CID_EFFECT,0,"none",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,1,"mono",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,2,"negative",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,3,"sepia",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,4,"posterize",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,5,"aqua",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,6,"solarize",0), -}; -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = -{ - new_user_v4l2ctrl(V4L2_CID_DO_WHITE_BALANCE,V4L2_CTRL_TYPE_MENU,"White Balance Control", 0, 5, 1, 0,sensor_v4l2ctrl_default_cb, sensor_WhiteBalanceSeqe), - new_user_v4l2ctrl(V4L2_CID_EXPOSURE,V4L2_CTRL_TYPE_INTEGER,"Exposure Control", -4, 4, 1, 0,sensor_v4l2ctrl_default_cb, sensor_ExposureSeqe), - new_user_v4l2ctrl(V4L2_CID_EFFECT,V4L2_CTRL_TYPE_MENU,"Effect Control", 0, 6, 1, 0,sensor_v4l2ctrl_default_cb, sensor_EffectSeqe), - new_user_v4l2ctrl(V4L2_CID_CONTRAST,V4L2_CTRL_TYPE_INTEGER,"Contrast Control", -4, 4, 1, 0,sensor_v4l2ctrl_default_cb, sensor_ContrastSeqe), -}; - - -//MUST define the current used format as the first item -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {MEDIA_BUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {MEDIA_BUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; -/*static struct soc_camera_ops sensor_ops;*/ - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ -#define NT99160_FULL_PERIOD_PIXEL_NUMS (1608) // default pixel#(w/o dummy pixels) in UXGA mode -#define NT99160_FULL_PERIOD_LINE_NUMS (746) // default line#(w/o dummy lines) in UXGA mode -#define NT99160_PV_PERIOD_PIXEL_NUMS (1288) // default pixel#(w/o dummy pixels) in SVGA mode -#define NT99160_PV_PERIOD_LINE_NUMS (736) // default line#(w/o dummy lines) in SVGA mode - -/* SENSOR EXPOSURE LINE LIMITATION */ -#define NT99160_FULL_EXPOSURE_LIMITATION (1492) -#define NT99160_PV_EXPOSURE_LIMITATION (736) - -// SENSOR UXGA SIZE -#define NT99160_IMAGE_SENSOR_FULL_WIDTH (1280) -#define NT99160_IMAGE_SENSOR_FULL_HEIGHT (720) - -#define NT99160_FULL_GRAB_WIDTH (NT99160_IMAGE_SENSOR_FULL_WIDTH - 16) -#define NT99160_FULL_GRAB_HEIGHT (NT99160_IMAGE_SENSOR_FULL_HEIGHT - 12) - -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - SENSOR_DG("%s\n",__FUNCTION__); - - return 0; -} -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - struct generic_sensor *sensor = to_generic_sensor(client); - - SENSOR_DG("%s",__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must switch into Hi-Z */ - - if (sensor->info_priv.funmodule_state & SENSOR_INIT_IS_OK) { - //generic_sensor_ioctrl(icd, Sensor_PowerDown, 1); - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - } - - return 0; -} -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - return 0; -} -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh (struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - return 0; -} - -static int sensor_try_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf) -{ - return 0; -} - -static int sensor_softrest_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - return 0; -} - -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("Suspend"); - - } else { - SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n",pm_msg.event); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret=0; - - SENSOR_DG("Resume"); - //ret = generic_sensor_ioctrl(icd, Sensor_PowerDown, 0); - - return ret; - -} -static int sensor_mirror_cb (struct i2c_client *client, int mirror) -{ - char val; - int err = 0; - - SENSOR_DG("mirror: %d",mirror); - if (mirror) { - err = sensor_read(client, 0x3022, &val); - if (err == 0) { - val |= 0x02; - err = sensor_write(client, 0x3022, val); - } - } else { - err = sensor_read(client, 0x3022, &val); - if (err == 0) { - val &= 0xfd; - err = sensor_write(client, 0x3022, val); - } - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_mirror_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_mirror failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_mirror success, value:0x%x",ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - char val; - int err = 0; - - - SENSOR_DG("flip: %d",flip); - if (flip) { - err = sensor_read(client, 0x3022, &val); - if (err == 0) { - val |= 0x01; - err = sensor_write(client, 0x3022, val); - } - } else { - err = sensor_read(client, 0x3022, &val); - if (err == 0) { - val &= 0xfe; - err = sensor_write(client, 0x3022, val); - } - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_flip_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_flip failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_flip success, value:0x%x",ext_ctrl->value); - return 0; -} - -static int sensor_focus_init_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos){ - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client){ - return 0; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos) -{ - return 0; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client,int on){ - return 0; -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor* spsensor,struct soc_camera_device *icd) -{ - - return; -} - -/* -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); - - - diff --git a/drivers/media/video/nt99240_2way.c b/drivers/media/video/nt99240_2way.c deleted file mode 100644 index 8688150461b8..000000000000 --- a/drivers/media/video/nt99240_2way.c +++ /dev/null @@ -1,1218 +0,0 @@ -/* - * drivers/media/video/nt99240_2way.c - * - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "generic_sensor.h" -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.1.1: -* add sensor_focus_af_const_pause_usr_cb; -*/ -static int version = KERNEL_VERSION(0,1,1); -module_param(version, int, S_IRUGO); - -static int debug =1; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_NT99240 -#define SENSOR_V4L2_IDENT V4L2_IDENT_NT99240 -#define SENSOR_ID 0x2400 -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_PCLK_SAMPLE_RISING|V4L2_MBUS_HSYNC_ACTIVE_HIGH| V4L2_MBUS_VSYNC_ACTIVE_HIGH|\ - V4L2_MBUS_DATA_ACTIVE_HIGH |SOCAM_MCLK_24MHZ) -#define SENSOR_PREVIEW_W 800 -#define SENSOR_PREVIEW_H 600 -#define SENSOR_PREVIEW_FPS 15000 // 15fps -#define SENSOR_FULLRES_L_FPS 5000 // 5fps -#define SENSOR_FULLRES_H_FPS 10000 // 10fps -#define SENSOR_720P_FPS 15000 -#define SENSOR_1080P_FPS 0 - -#define SENSOR_REGISTER_LEN 2 // sensor register address bytes -#define SENSOR_VALUE_LEN 1 // sensor register value bytes - -static unsigned int SensorConfiguration = 0; -static unsigned int SensorChipID[] = {SENSOR_ID}; - -/* Sensor Driver Configuration End */ - - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a,b) CONS4(SensorReg,SENSOR_REGISTER_LEN,Val,SENSOR_VALUE_LEN)(a,b) -#define sensor_write(client,reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_read(client,reg,v) CONS4(sensor_read_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_write_array generic_sensor_write_array - -struct sensor_parameter -{ - unsigned int PreviewDummyPixels; - unsigned int CaptureDummyPixels; - unsigned int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain_dr; - unsigned short int preview_gain_ar; - unsigned short int preview_gain_dgr; - unsigned short int preview_gain_agr; - unsigned short int preview_gain_dgb; - unsigned short int preview_gain_agb; - unsigned short int preview_gain_db; - unsigned short int preview_gain_ab; - unsigned short int preview_gain_dglobal; - unsigned short int preview_gain_aglobal; - unsigned short int preview_awb_r; - unsigned short int preview_awb_b; - - - unsigned short int PreviewPclk; - unsigned short int CapturePclk; - char awb[6]; -}; - -struct specific_sensor{ - struct generic_sensor common_sensor; - //define user data below - struct sensor_parameter parameter; - -}; - -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ - -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_init_data[] ={ - {0x32F0, 0x01}, - {0x3028, 0x07}, - {0x3029, 0x00}, - {0x302a, 0x04}, - {0x3290, 0x01}, - {0x3291, 0x94}, - {0x3296, 0x01}, - {0x3297, 0x6D}, - {0x3210, 0x3A}, - {0x3211, 0x3A}, - {0x3212, 0x3A}, - {0x3213, 0x3A}, - {0x3214, 0x2A}, - {0x3215, 0x2A}, - {0x3216, 0x2A}, - {0x3217, 0x2A}, - {0x3218, 0x2A}, - {0x3219, 0x2A}, - {0x321A, 0x2A}, - {0x321B, 0x2A}, - {0x321C, 0x22}, - {0x321D, 0x22}, - {0x321E, 0x22}, - {0x321F, 0x22}, - {0x3230, 0x30}, - {0x3231, 0x00}, - {0x3232, 0xCF}, - {0x3233, 0x00}, - {0x3234, 0x05}, - {0x3302, 0x00}, - {0x3303, 0x5F}, - {0x3304, 0x00}, - {0x3305, 0x7E}, - {0x3306, 0x00}, - {0x3307, 0x22}, - {0x3308, 0x07}, - {0x3309, 0xC3}, - {0x330A, 0x07}, - {0x330B, 0x33}, - {0x330C, 0x01}, - {0x330D, 0x0A}, - {0x330E, 0x00}, - {0x330F, 0xD3}, - {0x3310, 0x07}, - {0x3311, 0x3B}, - {0x3312, 0x07}, - {0x3313, 0xF2}, - {0x3024, 0x00}, - {0x303E, 0x04}, - {0x303F, 0x02}, - {0x3040, 0xFF}, - {0x3041, 0x02}, - {0x3051, 0xE0}, - {0x3052, 0x10}, - {0x305f, 0x22}, - {0x32b0, 0x00}, - {0x32b1, 0x90}, - {0x32BB, 0x0b}, - {0x32bd, 0x08}, - {0x32be, 0x06}, - {0x32bf, 0x4a}, - {0x32c0, 0x20}, - {0x32C3, 0x06}, - {0x32c5, 0x28}, - {0x32cd, 0x02}, - {0x32d3, 0x12}, - {0x3118, 0xF2}, - {0x3119, 0xF2}, - {0x311A, 0x13}, - {0x3106, 0x03}, - {0x3108, 0x00}, - {0x3112, 0xF1}, - {0x3113, 0x55}, - {0x3114, 0x05}, - {0x3012, 0x03}, - {0x3013, 0xC0}, - {0x3326, 0x02}, - {0x3327, 0x04}, - {0x3328, 0x04}, - {0x3329, 0x02}, - {0x332A, 0x02}, - {0x332B, 0x1D}, - {0x332C, 0x1D}, - {0x332D, 0x04}, - {0x332E, 0x1E}, - {0x332F, 0x1F}, - {0x32f6, 0x0B}, - {0x3343, 0xE0}, - {0x333B, 0x10}, - {0x333C, 0x14}, - {0x333D, 0x30}, - {0x333E, 0x30}, - {0x333F, 0x88}, - {0x3340, 0x84}, - {0x3341, 0x50}, - {0x3342, 0x50}, - {0x3344, 0x20}, - {0x3345, 0x28}, - {0x3346, 0x3F}, - {0x3347, 0x3F}, - {0x3348, 0xF0}, - {0x3349, 0x40}, - {0x334A, 0x40}, - {0x334B, 0x20}, - {0x334C, 0x20}, - {0x334D, 0x00}, - {0x32f6, 0x0B}, - {0x32f9, 0x63}, - {0x32fA, 0x36}, - {0x3338, 0x18}, - {0x3339, 0xC6}, - {0x333A, 0x6C}, - {0x3109, 0x82}, - SensorEnd -}; -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={ - {0x3200, 0x3e}, - {0x3201, 0x0f}, - {0x3028, 0x07}, - {0x3029, 0x00}, - {0x302a, 0x04}, - {0x3022, 0x24}, - {0x3023, 0x24}, - {0x3128, 0x01}, - {0x3002, 0x00}, - {0x3003, 0x04}, - {0x3004, 0x00}, - {0x3005, 0x04}, - {0x3006, 0x06}, - {0x3007, 0x43}, - {0x3008, 0x04}, - {0x3009, 0xb3}, - {0x300a, 0x09}, - {0x300b, 0xc4}, - {0x300c, 0x07}, - {0x300d, 0x80}, - {0x300e, 0x06}, - {0x300f, 0x40}, - {0x3010, 0x04}, - {0x3011, 0xb0}, - {0x3052, 0x10}, - {0x32bb, 0x1b}, - {0x32bc, 0x40}, - {0x32c1, 0x27}, - {0x32c2, 0x80}, - {0x32c8, 0x60}, - {0x32c9, 0x50}, - {0x32c4, 0x00}, - {0x3201, 0x3f}, - {0x3021, 0x06}, - {0x3060, 0x01}, - SensorEnd -}; -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] ={ - {0x3200, 0x3e}, - {0x3201, 0x0f}, - {0x3028, 0x07}, - {0x3029, 0x00}, - {0x302a, 0x04}, - {0x3022, 0x24}, - {0x3023, 0x24}, - {0x3128, 0x01}, - {0x3002, 0x00}, - {0x3003, 0x04}, - {0x3004, 0x00}, - {0x3005, 0x04}, - {0x3006, 0x06}, - {0x3007, 0x43}, - {0x3008, 0x04}, - {0x3009, 0xb3}, - {0x300a, 0x08}, - {0x300b, 0x34}, - {0x300c, 0x04}, - {0x300d, 0xbd}, - {0x300e, 0x06}, - {0x300f, 0x40}, - {0x3010, 0x04}, - {0x3011, 0xb0}, - {0x3052, 0x10}, - {0x32bb, 0x1b}, - {0x32bc, 0x40}, - {0x32c1, 0x24}, - {0x32c2, 0x74}, - {0x32c8, 0x72}, - {0x32c9, 0x5f}, - {0x32c4, 0x00}, - {0x3201, 0x3f}, - {0x3021, 0x16}, - {0x3060, 0x01}, - SensorEnd -}; -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data[] = -{ - {0x32e0, 0x03}, - {0x32e1, 0x20}, - {0x32e2, 0x02}, - {0x32e3, 0x58}, - {0x32e4, 0x01}, - {0x32e5, 0x00}, - {0x32e6, 0x00}, - {0x32e7, 0x00}, - {0x3200, 0x3e}, - {0x3201, 0x0f}, - {0x3028, 0x07}, - {0x3029, 0x00}, - {0x302a, 0x04}, - {0x3022, 0x24}, - {0x3023, 0x64}, - {0x3128, 0x01}, - {0x3002, 0x00}, - {0x3003, 0x04}, - {0x3004, 0x00}, - {0x3005, 0x04}, - {0x3006, 0x06}, - {0x3007, 0x43}, - {0x3008, 0x04}, - {0x3009, 0xb3}, - {0x300a, 0x09}, - {0x300b, 0xc4}, - {0x300c, 0x02}, - {0x300d, 0x80}, - {0x300e, 0x06}, - {0x300f, 0x40}, - {0x3010, 0x02}, - {0x3011, 0x58}, - {0x3052, 0x10}, - {0x32bb, 0x1b}, - {0x32bc, 0x40}, - {0x32c1, 0x22}, - {0x32c2, 0xa0}, - {0x32c8, 0x60}, - {0x32c9, 0x50}, - {0x32c4, 0x00}, - {0x3201, 0x7f}, - {0x3021, 0x06}, - {0x3060, 0x01}, - SensorEnd -}; -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[]={ - {0x3200, 0x3e}, - {0x3201, 0x0f}, - {0x3028, 0x07}, - {0x3029, 0x00}, - {0x302a, 0x04}, - {0x3022, 0x24}, - {0x3023, 0x24}, - {0x3128, 0x01}, - {0x3002, 0x00}, - {0x3003, 0xa4}, - {0x3004, 0x00}, - {0x3005, 0xf4}, - {0x3006, 0x05}, - {0x3007, 0xa3}, - {0x3008, 0x03}, - {0x3009, 0xc3}, - {0x300a, 0x06}, - {0x300b, 0xf4}, - {0x300c, 0x03}, - {0x300d, 0x82}, - {0x300e, 0x05}, - {0x300f, 0x00}, - {0x3010, 0x02}, - {0x3011, 0xd0}, - {0x3052, 0x10}, - {0x32bb, 0x1b}, - {0x32bc, 0x40}, - {0x32c1, 0x23}, - {0x32c2, 0xaa}, - {0x32c8, 0x86}, - {0x32c9, 0x70}, - {0x32c4, 0x00}, - {0x3201, 0x3f}, - {0x3021, 0x16}, - {0x3060, 0x01}, - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[]={ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_softreset_data[]={ - SensorRegVal(0x3021,0x61), - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[]={ - SensorRegVal(0x3000,0), - SensorRegVal(0x3001,0), - SensorEnd -}; -/* -* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx -*/ -static struct rk_sensor_reg sensor_WhiteB_Auto[]= -{ - {0x3201, 0x7F}, - SensorEnd -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[]= -{ - //[WB-CLOUDY] - {0x3201, 0x6F}, - {0x3290, 0x01}, - {0x3291, 0x51}, - {0x3296, 0x01}, - {0x3297, 0x00}, - SensorEnd -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[]= -{ - //[WB-DAYLIGHT] - {0x3201, 0x6F}, - {0x3290, 0x01}, - {0x3291, 0xD8}, - {0x3296, 0x01}, - {0x3297, 0x58}, - SensorEnd -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]= -{ - //[WB-INCANDESCENCE] - {0x3201, 0x6F}, - {0x3290, 0x01}, - {0x3291, 0x30}, - {0x3296, 0x01}, - {0x3297, 0xCB}, - SensorEnd - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]= -{ - //[WB-FLUORESCENT] - {0x3201, 0x6F}, - {0x3290, 0x02}, - {0x3291, 0x00}, - {0x3296, 0x02}, - {0x3297, 0x00}, - SensorEnd -}; -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp3[]= -{ - //[WB-TUNGSTEN] - {0x3201, 0x6F}, - {0x3290, 0x01}, - {0x3291, 0x00}, - {0x3296, 0x02}, - {0x3297, 0x20}, - SensorEnd -}; - -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy, sensor_WhiteB_TungstenLamp3,NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[]= -{ - // Brightness -2 - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[]= -{ - // Brightness -1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[]= -{ - // Brightness 0 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[]= -{ - // Brightness +1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[]= -{ - // Brightness +2 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[]= -{ - // Brightness +3 - - SensorEnd -}; -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = -{ - {0x32F1, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = -{ - //[SE-GrayScale] - {0x32F1, 0x01}, -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = -{ - //[SE-SEPIA] - {0x32F1, 0x02}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Inverse[] = -{ - //[SE-Inverse] - {0x32F1, 0x03}, - SensorEnd -}; -static struct rk_sensor_reg sensor_Effect_Bluish[] = -{ - //[SE-SEPIABlue] - {0x32F1, 0x05}, - {0x32F4, 0xF0}, - {0x32F5, 0x80}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = -{ - //[SE-SEPIAGreen] - {0x32F1, 0x05}, - {0x32F4, 0x60}, - {0x32F5, 0x20}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Solarization[] = -{ - - //[SE-Solarization] - {0x32F1, 0x04}, - SensorEnd -}; - - -static struct rk_sensor_reg *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Inverse,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,sensor_Effect_Solarization,NULL, -}; - -static struct rk_sensor_reg sensor_Exposure04[]= -{ - //[EV-4] - {0x32F6, 0X0C}, - {0x32F2, 0x40}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure03[]= -{ - //[EV-3] - {0x32F6, 0X0C}, - {0x32F2, 0x50}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure02[]= -{ - //[EV-2] - {0x32F6, 0X0C}, - {0x32F2, 0x60}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure01[]= -{ - //[EV-1] - {0x32F6, 0X0C}, - {0x32F2, 0x70}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure00[]= -{ - - //[EV+0] - {0x32F6, 0X0C}, - {0x32F2, 0x80}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure11[]= -{ - //[EV+1] - {0x32F6, 0X0C}, - {0x32F2, 0x90}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure12[]= -{ - //[EV+2] - {0x32F6, 0X0C}, - {0x32F2, 0xA0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure13[]= -{ - //[EV+3] - {0x32F6, 0X0C}, - {0x32F2, 0xB0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure14[]= -{ - //[EV+4] - {0x32F6, 0X0C}, - {0x32F2, 0xC0}, - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = {sensor_Exposure04,sensor_Exposure03, sensor_Exposure02, sensor_Exposure01, sensor_Exposure00, - sensor_Exposure11, sensor_Exposure12,sensor_Exposure13,sensor_Exposure14,NULL, -}; - -static struct rk_sensor_reg sensor_Saturation0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -static struct rk_sensor_reg sensor_Contrast04[]= -{ - //[Contrast : -4] - {0x32F6, 0x0C}, - {0x32C2, 0x40}, - {0x32F2, 0x40}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast03[]= -{ - //[Contrast : -3] - {0x32F6, 0x0C}, - {0x32C2, 0x30}, - {0x32F2, 0x50}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast02[]= -{ - //[Contrast : -2] - {0x32F6, 0x0C}, - {0x32C2, 0x20}, - {0x32F2, 0x60}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast01[]= -{ - //[Contrast : -1] - {0x32F6, 0x0C}, - {0x32C2, 0x10}, - {0x32F2, 0x70}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast00[]= -{ - //[Contrast : 0] - {0x32F6, 0x0C}, - {0x32C2, 0x00}, - {0x32F2, 0x80}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast11[]= -{ - //[Contrast : +1] - {0x32F6, 0x0C}, - {0x32C2, 0xF0}, - {0x32F2, 0x90}, - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Contrast12[]= -{ - //[Contrast : +2] - {0x32F6, 0x0C}, - {0x32C2, 0xE0}, - {0x32F2, 0xA0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast13[]= -{ - //[Contrast : +3] - {0x32F6, 0x0C}, - {0x32C2, 0xD0}, - {0x32F2, 0xB0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast14[]= -{ - //[Contrast : +4] - {0x32F6, 0x0C}, - {0x32C2, 0xC0}, - {0x32F2, 0xC0}, - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ContrastSeqe[] = {sensor_Contrast04, sensor_Contrast03, sensor_Contrast02, sensor_Contrast01, - sensor_Contrast00, sensor_Contrast11, sensor_Contrast12, sensor_Contrast13, sensor_Contrast14,NULL, -}; - -static struct rk_sensor_reg sensor_SceneAuto[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -static struct rk_sensor_reg sensor_Zoom0[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Zoom3[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; - -/* -* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu -*/ -static struct v4l2_querymenu sensor_menus[] = -{ - //white balance - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,0,"auto",0), - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,1,"incandescent",0), - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,2,"fluorescent",0), - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,3,"daylight",0), - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,4,"cloudy-daylight",0), - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,5,"tungsten",0), - - //speical effect - new_usr_v4l2menu(V4L2_CID_EFFECT,0,"none",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,1,"mono",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,2,"negative",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,3,"sepia",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,4,"posterize",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,5,"aqua",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,6,"solarize",0), -}; -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = -{ - new_user_v4l2ctrl(V4L2_CID_DO_WHITE_BALANCE,V4L2_CTRL_TYPE_MENU,"White Balance Control", 0, 5, 1, 0,sensor_v4l2ctrl_default_cb, sensor_WhiteBalanceSeqe), - new_user_v4l2ctrl(V4L2_CID_EXPOSURE,V4L2_CTRL_TYPE_INTEGER,"Exposure Control", -4, 4, 1, 0,sensor_v4l2ctrl_default_cb, sensor_ExposureSeqe), - new_user_v4l2ctrl(V4L2_CID_EFFECT,V4L2_CTRL_TYPE_MENU,"Effect Control", 0, 6, 1, 0,sensor_v4l2ctrl_default_cb, sensor_EffectSeqe), - new_user_v4l2ctrl(V4L2_CID_CONTRAST,V4L2_CTRL_TYPE_INTEGER,"Contrast Control", -4, 4, 1, 0,sensor_v4l2ctrl_default_cb, sensor_ContrastSeqe), -}; - -//MUST define the current used format as the first item -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {MEDIA_BUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG}, - {MEDIA_BUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG} -}; -/*static struct soc_camera_ops sensor_ops;*/ - - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ -static int sensor_parameter_record(struct i2c_client *client) -{ - u8 ret_l,ret_h; - int tp_l,tp_h; - - struct generic_sensor *sensor = to_generic_sensor(client); - struct specific_sensor *spsensor = to_specific_sensor(sensor); - - sensor_read(client, 0x3200, &ret_l); - sensor_write(client, 0x3200, ret_l&0xf9); - sensor_read(client, 0x3201, &ret_l); - sensor_write(client, 0x3201, ret_l&0xcf); //stop ae awb - - //read back ae - sensor_read(client,0x3012,&ret_h); - sensor_read(client,0x3013, &ret_l); - tp_l = ret_l; - tp_h = ret_h; - spsensor->parameter.preview_exposure = ((tp_h<<8) & 0xF0) |((tp_l) & 0x0F); - - //Read back AGC Gain for preview - sensor_read(client,0x3014, &ret_l); - spsensor->parameter.preview_gain_dr = ret_l; - sensor_read(client,0x3015, &ret_l); - spsensor->parameter.preview_gain_ar = ret_l; - sensor_read(client,0x3016, &ret_l); - spsensor->parameter.preview_gain_dgr = ret_l; - sensor_read(client,0x3017, &ret_l); - spsensor->parameter.preview_gain_agr = ret_l; - sensor_read(client,0x3018, &ret_l); - spsensor->parameter.preview_gain_dgb = ret_l; - sensor_read(client,0x3019, &ret_l); - spsensor->parameter.preview_gain_agb = ret_l; - sensor_read(client,0x301a, &ret_l); - spsensor->parameter.preview_gain_db = ret_l; - sensor_read(client,0x301b, &ret_l); - spsensor->parameter.preview_gain_ab = ret_l; - sensor_read(client,0x301c, &ret_l); - spsensor->parameter.preview_gain_dglobal= ret_l; - sensor_read(client,0x301d, &ret_l); - spsensor->parameter.preview_gain_aglobal= ret_l; - - spsensor->parameter.CapturePclk = 48000; - spsensor->parameter.PreviewPclk = 48000; - sensor_read(client,0x300a, &ret_h); - sensor_read(client,0x300b, &ret_l); - tp_l = ret_l; - tp_h = ret_h; - spsensor->parameter.PreviewDummyPixels = (tp_l&0x0F) | ((tp_h<<8)&0xF0); - spsensor->parameter.CaptureDummyPixels = 0; - - #if 0 - sensor_read(client,0x3290, &ret_h); - sensor_read(client,0x3291, &ret_l); - tp_l = ret_l; - tp_h = ret_h; - spsensor->parameter.preview_awb_r = (tp_l&0x0F) | ((tp_h<<8)&0x10); - - sensor_read(client,0x3296, &ret_h); - sensor_read(client,0x3297, &ret_l); - tp_l = ret_l; - tp_h = ret_h; - spsensor->parameter.preview_awb_b = (tp_l&0x0F) | ((tp_h<<8)&0x10); - #endif - return 0; -} -#define OV2659_FULL_PERIOD_PIXEL_NUMS (1940) // default pixel#(w/o dummy pixels) in UXGA mode -#define OV2659_FULL_PERIOD_LINE_NUMS (1238) // default line#(w/o dummy lines) in UXGA mode -#define OV2659_PV_PERIOD_PIXEL_NUMS (970) // default pixel#(w/o dummy pixels) in SVGA mode -#define OV2659_PV_PERIOD_LINE_NUMS (618) // default line#(w/o dummy lines) in SVGA mode - -/* SENSOR EXPOSURE LINE LIMITATION */ -#define OV2659_FULL_EXPOSURE_LIMITATION (1236) -#define OV2659_PV_EXPOSURE_LIMITATION (618) - -// SENSOR UXGA SIZE -#define OV2659_IMAGE_SENSOR_FULL_WIDTH (1600) -#define OV2659_IMAGE_SENSOR_FULL_HEIGHT (1200) - -#define OV2659_FULL_GRAB_WIDTH (OV2659_IMAGE_SENSOR_FULL_WIDTH - 16) -#define OV2659_FULL_GRAB_HEIGHT (OV2659_IMAGE_SENSOR_FULL_HEIGHT - 12) - -static int sensor_ae_transfer(struct i2c_client *client) -{ - //unsigned int prev_line_len,cap_line_len,shutter; - struct generic_sensor *sensor = to_generic_sensor(client); - struct specific_sensor *spsensor = to_specific_sensor(sensor); - int preview_ae_integration, capture_ae_integration; - int capture_pixel; - u8 ret_h,ret_l; - int val_h, val_l; - - mdelay(100); - - sensor_read(client, 0x3200, &ret_h); - val_h=ret_h; - sensor_write(client, 0x3200, ret_h&0xfd); - sensor_read(client, 0x3201, &ret_l); - val_l=ret_l; - sensor_write(client, 0x3201, ret_l&0xdf); //stop ae awb - - sensor_read(client,0x300a, &ret_h); - sensor_read(client,0x300b, &ret_l); - capture_pixel = (ret_l&0x0F) | ((ret_h<<8)&0xF0); - preview_ae_integration = spsensor->parameter.preview_exposure*spsensor->parameter.PreviewDummyPixels; - capture_ae_integration = preview_ae_integration/capture_pixel; - - //write back ae - sensor_write(client,0x3012,(capture_ae_integration>>8)&0x0F); - sensor_write(client,0x3013,capture_ae_integration&0x0F); - - //write back AGC Gain for preview - sensor_write(client,0x3014, spsensor->parameter.preview_gain_dr); - sensor_write(client,0x3015, spsensor->parameter.preview_gain_ar); - sensor_write(client,0x3016, spsensor->parameter.preview_gain_dgr); - sensor_write(client,0x3017, spsensor->parameter.preview_gain_agr); - sensor_write(client,0x3018, spsensor->parameter.preview_gain_dgb); - sensor_write(client,0x3019, spsensor->parameter.preview_gain_agb); - sensor_write(client,0x301a, spsensor->parameter.preview_gain_db); - sensor_write(client,0x301b, spsensor->parameter.preview_gain_ab); - sensor_write(client,0x301c, spsensor->parameter.preview_gain_dglobal); - sensor_write(client,0x301d, spsensor->parameter.preview_gain_aglobal); - - #if 0 - sensor_write(client,0x3290, (spsensor->parameter.preview_awb_r>>8)&0x01); - sensor_write(client,0x3291, spsensor->parameter.preview_awb_r&0x0F); - sensor_write(client,0x3296, (spsensor->parameter.preview_awb_b>>8)&0x01 ); - sensor_write(client,0x3297, spsensor->parameter.preview_awb_b&0x0F ); - #endif - - //sensor_write(client, 0x3200, val_h); - //sensor_write(client, 0x3201, val_l); //enable ae awb - return 0; -} -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - SENSOR_DG("%s",__FUNCTION__); - - - return 0; -} -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - struct generic_sensor *sensor = to_generic_sensor(client); - - SENSOR_DG("%s",__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must switch into Hi-Z */ - if (sensor->info_priv.funmodule_state & SENSOR_INIT_IS_OK) { - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK;; - } - - return 0; -} -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - printk("set fmt set!!!!!!!!!!!!"); - - if (capture) { - sensor_parameter_record(client); - printk("set fmt set!!!!!!!!!!!!"); - } - - - return 0; -} -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh (struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - if (capture) { - sensor_ae_transfer(client); - printk("set fmt set!!!!!!!!!!!!"); - } - - - return 0; -} - -static int sensor_try_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf) -{ - return 0; -} - -static int sensor_softrest_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - return 0; -} - -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("Suspend"); - - } else { - SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n",pm_msg.event); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - - SENSOR_DG("Resume"); - - return 0; - -} -static int sensor_mirror_cb (struct i2c_client *client, int mirror) -{ - char val; - int err = 0; - - SENSOR_DG("mirror: %d",mirror); - if (mirror) { - err = sensor_read(client, 0x3022, &val); - if (err == 0) { - val |= 0x02; - err = sensor_write(client, 0x3022, val); - } - } else { - err = sensor_read(client, 0x3022, &val); - if (err == 0) { - val &= 0xfd; - err = sensor_write(client, 0x3022, val); - } - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_mirror_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_mirror failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_mirror success, value:0x%x",ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - char val; - int err = 0; - - - SENSOR_DG("flip: %d",flip); - if (flip) { - err = sensor_read(client, 0x3022, &val); - if (err == 0) { - val |= 0x01; - err = sensor_write(client, 0x3022, val); - } - } else { - err = sensor_read(client, 0x3022, &val); - if (err == 0) { - val &= 0xfe; - err = sensor_write(client, 0x3022, val); - } - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_flip_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_flip failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_flip success, value:0x%x",ext_ctrl->value); - return 0; -} - -static int sensor_focus_init_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos){ - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client){ - return 0; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos) -{ - return 0; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client,int on){ - return 0; -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor* spsensor,struct soc_camera_device *icd) -{ - return; -} - -/* -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); - - - - diff --git a/drivers/media/video/nt99250.c b/drivers/media/video/nt99250.c deleted file mode 100755 index 7f7fd4f3f86b..000000000000 --- a/drivers/media/video/nt99250.c +++ /dev/null @@ -1,2923 +0,0 @@ -/* -o* Driver for MT9M001 CMOS Image Sensor from Micron - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_NT99250 -#define SENSOR_V4L2_IDENT V4L2_IDENT_NT99250 -#define SENSOR_ID 0x0105 -#define SENSOR_MIN_WIDTH 176 -#define SENSOR_MIN_HEIGHT 144 -#define SENSOR_MAX_WIDTH 1600 -#define SENSOR_MAX_HEIGHT 1200 -#define SENSOR_INIT_WIDTH 800 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 600 -#define SENSOR_INIT_WINSEQADR sensor_svga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_UYVY8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 0 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 0 -#define CONFIG_SENSOR_Scene 0 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 0 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 - -#define CONFIG_SENSOR_I2C_SPEED 250000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) - -struct reginfo -{ - u16 reg; - u8 val; -}; - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -#if CONFIG_SENSOR_Flash -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); -#endif -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_NT99250_USER_DEFINED_SERIES -#include "NT99250_user_series.c" -#else -/* init 352X288 SVGA */ -static struct reginfo sensor_init_data[] = -{ -{0x3024,0x02}, //TG //0x02 -{0x32F0,0x00},//0:UYVY 2:VYUY 1:YUYV 3:YVYU -{0x301e,0x54}, -{0x301f,0x48}, -//gamma ++++ -{0x3270,0x00}, -{0x3271,0x04}, -{0x3272,0x0E}, -{0x3273,0x28}, -{0x3274,0x3F}, -{0x3275,0x50}, -{0x3276,0x6E}, -{0x3277,0x88}, -{0x3278,0xA0}, -{0x3279,0xB3}, -{0x327A,0xD2}, -{0x327B,0xE8}, -{0x327C,0xF5}, -{0x327D,0xFF}, -{0x327E,0xFF}, -//gamma ---- -//CC ++++ -{0x3302,0x00}, -{0x3303,0x2E}, -{0x3304,0x00}, -{0x3305,0xB7}, -{0x3306,0x00}, -{0x3307,0x1A}, -{0x3308,0x07}, -{0x3309,0xE7}, -{0x330A,0x07}, -{0x330B,0x44}, -{0x330C,0x00}, -{0x330D,0xD6}, -{0x330E,0x01}, -{0x330F,0x01}, -{0x3310,0x07}, -{0x3311,0x1A}, -{0x3312,0x07}, -{0x3313,0xE5}, -//CC ---- -//LSC_+++++ -{0x3250,0x01}, -{0x3251,0x87}, -{0x3252,0x01}, -{0x3253,0x88}, -{0x3254,0x01}, -{0x3255,0x89}, -{0x3256,0x01}, -{0x3257,0x33}, -{0x3258,0x01}, -{0x3259,0x34}, -{0x325A,0x01}, -{0x325B,0x35}, -{0x325C,0x00}, -{0x325D,0x00}, -{0x325E,0x00}, -{0x325F,0x00}, -{0x3260,0x00}, -{0x3261,0x00}, -{0x3262,0x09}, -{0x3263,0x08}, -{0x3264,0x08}, -{0x3265,0x17}, -{0x3266,0x00}, -{0x3200,0x3e}, -//LSC_---- -//analog ++++ -{0x3102,0x0b}, -{0x3103,0x46}, -{0x3105,0x33}, -{0x3107,0x32}, -{0x310A,0x03}, -{0x310B,0x18}, -{0x310f,0x08}, -{0x3110,0x03}, -{0x3113,0x0F}, -{0x3119,0x17}, -{0x3114,0x03}, -{0x3117,0x03}, -{0x3118,0x01}, -{0x3380,0x03}, -//analog ---- -//DAC&DPC ++++ -{0x3044,0x02}, -{0x3045,0xd0}, -{0x3046,0x02}, -{0x3047,0xd0}, -{0x3048,0x02}, -{0x3049,0xd0}, -{0x304a,0x02}, -{0x304b,0xd0}, -{0x303e,0x02}, -{0x303f,0x2b}, -{0x3052,0x80}, -{0x3059,0x10}, -{0x305a,0x28}, -{0x305b,0x20}, -{0x305c,0x04}, -{0x305d,0x28}, -{0x305e,0x04}, -{0x305f,0x52}, -{0x3058,0x01}, -//DAC&DPC ---- -{0x3080,0x80}, -{0x3081,0x80}, -{0x3082,0x80}, -{0x3083,0x40}, -{0x3084,0x80}, -{0x3085,0x40}, -//AEC AGC ++++ -{0x32b0,0x00}, -{0x32b1,0x90}, -{0x32BB,0x0b}, -{0x32bd,0x05}, -{0x32be,0x05}, -{0x32cd,0x01}, -{0x32d3,0x13}, -{0x32d7,0x82}, -{0x32d8,0x3F}, -{0x32d9,0x18}, -{0x32c5,0x18}, -//AEC AGC ---- -{0x32f6,0x0c},//effect function -{0x3069, 0x00}, //Pix //01 :for M1002 00 :for other -{0x306d, 0x01}, //pclk //00 :for M1002 01 :for other - - //============================== - //Output size - //============================== - //[800X600] - //edge & denoise +++ - {0x3300,0x30}, - {0x3301,0x80}, - {0x3320,0x28}, - {0x3331,0x04}, - {0x3332,0x40}, - {0x3339,0x10}, - {0x333a,0x1a}, - //edge & denoise --- - //AE AWB mode ++ - {0x329C,0x4b}, - {0x32bf,0x52}, - {0x32c0,0x10}, - {0x3200,0x3e}, - {0x3201,0x3f}, - {0x32b0,0x02}, - {0x32b1,0xc0}, - //AE AWB mode --- - {0x3052,0x80}, //OB - {0x32e0,0x03}, - {0x32e1,0x20}, - {0x32e2,0x02}, - {0x32e3,0x58}, - {0x32e4,0x01}, - {0x32e5,0x00}, - {0x32e6,0x00}, - {0x32e7,0x00}, - {0x301e,0x00}, //pll - {0x301f,0x20}, //pll - {0x3022,0x25}, - {0x3023,0x64}, - {0x3002,0x00}, - {0x3003,0x04}, - {0x3004,0x00}, - {0x3005,0x04}, - {0x3006,0x06}, - {0x3007,0x43}, - {0x3008,0x04}, - {0x3009,0xb3}, - {0x300a,0x09}, - {0x300b,0x91}, - {0x300c,0x02}, - {0x300d,0x64}, - {0x300e,0x06}, - {0x300f,0x40}, - {0x3010,0x02}, - {0x3011,0x58}, - {0x32bb,0x0b}, - {0x32bc,0x3a}, - {0x32c1,0x25}, - {0x32c2,0x5c}, //7.14fps @ 48M - {0x32c8,0x62}, - {0x32c9,0x52}, - {0x32c4,0x00}, - {0x3290,0x01}, //awb init ++++ - {0x3291,0x68}, - {0x3296,0x01}, - {0x3297,0x75}, - {0x32A9,0x11}, - {0x32AA,0x01}, - {0x329b,0x01}, - {0x32a2,0x60}, - {0x32a4,0xa0}, - {0x32a6,0x60}, - {0x32a8,0xa0}, //awb init ---- - {0x3012,0x02}, //AE init +++ - {0x3013,0xae}, - {0x301d,0x08}, - {0x3201,0x7f}, //AE init --- - {0x3021,0x06}, - {0x3060,0x01}, - {0x0, 0x0}, //end flag - -}; - -/* 1600X1200 UXGA */ -static struct reginfo sensor_uxga[] = -{ - //Output format & size - {0x3300, 0x3f}, - {0x3301, 0xa0}, - {0x3331, 0x08}, - {0x3332, 0x80}, //0x20 - {0x3320, 0x20}, //0x28 - - {0x329C, 0x4b}, - {0x32bf, 0x52}, - {0x3200, 0x3e}, - - {0x32e0,0x06}, - {0x32e1,0x40}, - {0x32e2,0x04}, - {0x32e3,0xb0}, - {0x32e4,0x00}, - {0x32e5,0x00}, - {0x32e6,0x00}, - {0x32e7,0x00}, - - {0x301e, 0x00}, - {0x301f, 0x20}, - - {0x3022, 0x25}, - {0x3023, 0x24}, - - //Capture_1600x1200s - {0x3002, 0x00}, - {0x3003, 0x04}, - {0x3004, 0x00}, - {0x3005, 0x04}, - {0x3006, 0x06}, - {0x3007, 0x43}, - {0x3008, 0x00}, - {0x3009, 0xb3}, - {0x300a, 0x09}, - {0x300b, 0x82}, - {0x300c, 0x07}, - {0x300d, 0xb4}, - {0x300e, 0x06}, - {0x300f, 0x40}, - {0x3010, 0x04}, - {0x3011, 0xb0}, - - {0x32bb, 0x0b}, - //{0x32bc, 0x38}, - - {0x32c4, 0x00}, - //{0x3201, 0x3f}, - {0x3021, 0x06}, - {0x3060, 0x01}, - - {0x0, 0x0}, -}; - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {0x3300, 0x3f}, - {0x3301, 0xa0}, - {0x3331, 0x0c}, - {0x3332, 0x80}, - {0x3320, 0x20}, - {0x329C, 0x4b}, - {0x32bf, 0x52}, - {0x3200, 0x3e}, -//1280x1024 - {0x32e0, 0x05}, - {0x32e1, 0x00}, - {0x32e2, 0x04}, - {0x32e3, 0x00}, - {0x32e4, 0x00}, - {0x32e5, 0x40}, - {0x32e6, 0x00}, - {0x32e7, 0x2c}, - - {0x301e, 0x00}, - {0x3022, 0x25}, - {0x3023, 0x24}, - {0x3002, 0x00}, - {0x3003, 0x04}, - {0x3004, 0x00}, - {0x3005, 0x04}, - {0x3006, 0x06}, - {0x3007, 0x43}, - {0x3008, 0x04}, - {0x3009, 0xb3}, - {0x300a, 0x09}, - {0x300b, 0x82}, - {0x300c, 0x07}, - {0x300d, 0xb4}, - {0x300e, 0x06}, - {0x300f, 0x40}, - {0x3010, 0x04}, - {0x3011, 0xb0}, - {0x32bb, 0x0b}, - - //{0x3201, 0x7f}, - {0x3021, 0x06}, - {0x3060, 0x01}, - {0x0, 0x0}, -}; - -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ -//edge & denoise +++ -{0x3300,0x30}, -{0x3301,0x80}, -{0x3320,0x30}, -{0x3331,0x0c}, -{0x3332,0x40}, -{0x3339,0x10}, -{0x333a,0x1a}, -//edge & denoise --- -//AE AWB mode ++ -{0x329C,0x4b}, -{0x32bf,0x52}, -{0x32c0,0x10}, -{0x3200,0x3e}, -//{0x3201,0x3f}, -{0x32b0,0x02}, -{0x32b1,0xc0}, -//AE AWB mode --- -{0x3052,0x80}, //OB - {0x32e0,0x03}, - {0x32e1,0x20}, - {0x32e2,0x02}, - {0x32e3,0x58}, - {0x32e4,0x01}, - {0x32e5,0x00}, - {0x32e6,0x00}, - {0x32e7,0x00}, -{0x301e,0x00}, //pll -{0x301f,0x20}, //pll 0x20 48Mhz 0x24 32Mhz -{0x3022,0x25}, -{0x3023,0x64}, - {0x3002,0x00}, - {0x3003,0x04}, - {0x3004,0x00}, - {0x3005,0x04}, - {0x3006,0x06}, - {0x3007,0x43}, - {0x3008,0x04}, - {0x3009,0xb3}, - {0x300a,0x09}, - {0x300b,0x91}, - {0x300c,0x02}, - {0x300d,0x64}, - {0x300e,0x06}, - {0x300f,0x40}, - {0x3010,0x02}, - {0x3011,0x58}, -{0x32bb,0x0b}, -{0x32bc,0x30}, -{0x32c1,0x25}, -{0x32c2,0x5c}, //7.14fps @ 48M -//{0x32c1,0x23}, -//{0x32c2,0xd4}, //10fps @ 48M -{0x32c8,0x62}, -{0x32c9,0x52}, -{0x32c4,0x00}, -//{0x3290,0x01}, //awb init ++++ -//{0x3291,0x68}, -//{0x3296,0x01}, -//{0x3297,0x75}, -{0x32A9,0x11}, -{0x32AA,0x01}, -{0x329b,0x01}, -{0x32a2,0x60}, -{0x32a4,0xa0}, -{0x32a6,0x60}, -{0x32a8,0xa0}, //awb init ---- -//{0x3012,0x02}, //AE init +++ -//{0x3013,0xae}, -//{0x301d,0x08}, -//{0x3201,0x7f}, //AE init --- -{0x3021,0x06}, -{0x3060,0x01}, - {0x0, 0x0}, - {0x0, 0x0}, -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ -//[640X480] -//edge & denoise +++ -{0x3300,0x30}, -{0x3301,0x80}, -{0x3320,0x28}, -{0x3331,0x04}, -{0x3332,0x40}, -{0x3339,0x10}, -{0x333a,0x1a}, -//edge & denoise --- -//AE AWB mode ++ -{0x329C,0x4b}, -{0x32bf,0x52}, -{0x32c0,0x10}, -{0x3200,0x3e}, -//{0x3201,0x3f}, -{0x32b0,0x02}, -{0x32b1,0xc0}, -//AE AWB mode --- -{0x3052,0x80}, //OB -{0x32e0,0x02}, -{0x32e1,0x80}, -{0x32e2,0x01}, -{0x32e3,0xe0}, -{0x32e4,0x01}, -{0x32e5,0x81}, -{0x32e6,0x00}, -{0x32e7,0x40}, -{0x301e,0x00}, //pll -{0x301f,0x20}, //pll 0x20 48Mhz 0x24 32Mhz -{0x3022,0x25}, -{0x3023,0x64}, -{0x3002,0x00}, -{0x3003,0x04}, -{0x3004,0x00}, -{0x3005,0x04}, -{0x3006,0x06}, -{0x3007,0x43}, -{0x3008,0x04}, -{0x3009,0xb3}, -{0x300a,0x09}, -{0x300b,0x91}, -{0x300c,0x02}, -{0x300d,0x91}, -{0x300e,0x06}, -{0x300f,0x40}, -{0x3010,0x02}, -{0x3011,0x58}, -{0x32bb,0x0b}, -{0x32bc,0x30}, -//{0x32c1,0x25}, -//{0x32c2,0x5c}, //7.14fps @ 48M -{0x32c1,0x23}, -{0x32c2,0xd4}, //10fps @ 48M -{0x32c8,0x62}, -{0x32c9,0x52}, -{0x32c4,0x00}, -//{0x3290,0x01}, //awb init ++++ -//{0x3291,0x68}, -//{0x3296,0x01}, -//{0x3297,0x75}, -{0x32A9,0x11}, -{0x32AA,0x01}, -{0x329b,0x01}, -{0x32a2,0x60}, -{0x32a4,0xa0}, -{0x32a6,0x60}, -{0x32a8,0xa0}, //awb init ---- -//{0x3012,0x02}, //AE init +++ -//{0x3013,0xae}, -//{0x301d,0x08}, -//{0x3201,0x7f}, //AE init --- -{0x3021,0x06}, -{0x3060,0x01}, - {0x0, 0x0}, -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {0x0, 0x0}, -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - {0x0, 0x0}, -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {0x0, 0x0}, -}; -#endif - -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {0x32f0, 0x00}, //0:UYVY 2:VYUY 1:YUYV 3:YVYU - {0x0000, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {0x32F0, 0x00}, //0:UYVY 2:VYUY 1:YUYV 3:YVYU - {0x0000, 0x00} -}; - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0x3201, 0x3f}, //AWB auto, bit[1]:0,auto - {0x0000, 0x00} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0x3201, 0x2f}, - {0x3290, 0x01}, - {0x3291, 0x48}, - {0x3296, 0x01}, - {0x3297, 0x58}, - {0x0000, 0x00} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x3201, 0x2f}, - {0x3290, 0x01}, - {0x3291, 0x38}, - {0x3296, 0x01}, - {0x3297, 0x68}, - {0x0000, 0x00} - -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0x3201, 0x2f}, - {0x3290, 0x01}, - {0x3291, 0x24}, - {0x3296, 0x01}, - {0x3297, 0x78}, - {0x0000, 0x00} - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x3201, 0x2f}, - {0x3290, 0x01}, - {0x3291, 0x30}, - {0x3296, 0x01}, - {0x3297, 0x70}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - // Brightness -2 - {0x32f1, 0x05}, - {0x32f2, 0x60}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness1[]= -{ - // Brightness -1 - {0x32f1, 0x05}, - {0x32f2, 0x70}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - // Brightness 0 - {0x32f1, 0x05}, - {0x32f2, 0x80}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - // Brightness +1 - {0x32f1, 0x05}, - {0x32f2, 0x90}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - // Brightness +2 - {0x32f1, 0x05}, - {0x32f2, 0xa0}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - // Brightness +3 - {0x32f1, 0x05}, - {0x32f2, 0xb0}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x32f1, 0x00}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {0x32f1, 0x01}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x32f1, 0x02}, - {0x32f6, 0x20}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - //Negative - {0x32f1, 0x03}, - {0x32f6, 0x10}, - {0x0000, 0x00} -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - // Bluish - {0x32f1, 0x05}, - {0x32f6, 0x04}, - {0x32f4, 0x80}, - {0x32f6, 0x0c}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish - {0x32f1, 0x05}, - {0x32f4, 0x60}, - {0x32f5, 0x20}, - {0x32f6, 0x0c}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - //-3 - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure1[]= -{ - //-2 - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - //-0.3EV - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - //default - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - // 1 - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - // 2 - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - // 3 - {0x0000, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {0x0000, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - //Contrast -3 - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - //Contrast -2 - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast2[]= -{ - // Contrast -1 - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - //Contrast 0 - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - //Contrast +1 - {0x0000, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - //Contrast +2 - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - //Contrast +3 - {0x0000, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {0x0000, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {0x0000, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ - {0x301e, 0x00}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_SceneNight[] = -{ - //30fps ~ 5fps night mode for 60/50Hz light environment, 24Mhz clock input,36Mzh pclk - {0x301e, 0x04}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom1[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom2[] = -{ - {0x0, 0x0}, -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {0x0, 0x0}, -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif -static struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - unsigned int winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int funmodule_state; - -} sensor_info_priv_t; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, u16 reg, u8 val) -{ - int err,cnt; - u8 buf[3]; - struct i2c_msg msg[1]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - buf[2] = val; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 8; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u16 reg, u8 *val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[2]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - - while (regarray[i].reg != 0) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - i++; - } - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != 0) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_power_end: - return ret; -} -#if CONFIG_SENSOR_Flash -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} -#endif -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - char value; - int ret,pid = 0; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - - ret = sensor_write(client, 0x3021, 0x61); - if (ret != 0) - { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); //delay 5 microseconds - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x307e, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value << 8); - - ret = sensor_read(client, 0x307f, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - #if 1 - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - #endif - - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - - sensor->info_priv.winseqe_cur_addr = (int)SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} - -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - sensor_ioctrl(icd, Sensor_PowerDown, 1); - msleep(100); - - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - - return 0; -} - -static struct reginfo sensor_power_down_sequence[]= -{ - //{0x30ab, 0x00}, - //{0x30ad, 0x0a}, - //{0x30ae,0x27}, - //{0x363b,0x01}, - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - - return 0; - -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -#if 0 -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -#endif -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct sensor *sensor = to_sensor(client); - struct reginfo *winseqe_set_addr=NULL; - int ret=0, set_w,set_h; - u8 reg_1, reg; - u16 shutter; - - //turn on scaler for preivew - sensor_read(client ,0x3201, ®_1); - sensor_write(client, 0x3201, (reg_1|0x40) ); - //for preview - sensor_read(client ,0x32f1, ®); - sensor_write(client, 0x32f1, (reg|0x10) ); - - #if 0 //preview_fastmode - u16 AE_reg, AGC_reg; - u8 temp_reg12,temp_reg13 - // turn off AE for preview - sensor_read(client ,0x3201, &AE_reg); - sensor_write(client, 0x3201, (AE_reg|0x20) ); - // turn off AGC for preview - sensor_read(client ,0x32bb, &AGC_reg); - sensor_write(client, 0x32bb, (AGC_reg|0x01) ); - - sensor_read(client, 0x3012, &temp_reg12); - sensor_read(client, 0x3013, &temp_reg13); - shutter = (temp_reg13 & 0x00FF) | (temp_reg12 << 8); - #endif - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - winseqe_set_addr = sensor_svga; - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - winseqe_set_addr = sensor_sxga; - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && sensor_uxga[0].reg) - { - winseqe_set_addr = sensor_uxga; - set_w = 1600; - set_h = 1200; - } - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) { - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - } else { /* ddl@rock-chips.com : Video */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - } - #endif - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - - sensor->info_priv.winseqe_cur_addr = (int)winseqe_set_addr; - - if ((set_w <= 640) && (set_h <= 480)) - { - shutter = shutter; - } - else - { - //for capture - sensor_read(client ,0x32f1, ®); - sensor_write(client, 0x32f1, (reg&(~0x10)) ); - if ((set_w <= 1600) && (set_h <= 1200)) - { - //turn off scaler for UXGA capture - sensor_read(client ,0x3201, ®_1); - sensor_write(client, 0x3201, (reg_1&(~0x40)) ); - } - #if 0 //preview_fastmode - // turn off AE - sensor_read(client ,0x3201, &AE_reg); - sensor_write(client, 0x3201, (AE_reg&(~0x20)) ); - // turn off AGC - sensor_read(client ,0x32bb, &AGC_reg); - sensor_write(client, 0x32bb, (AGC_reg&(~0x01)) ); - if ((set_w <= 800) && (set_h <= 600)) - { - shutter = shutter*1984/2434; - } - else if ((set_w <= 2434) && (set_h <= 1024)) - { - shutter = shutter*1984/2434; - } - else if ((set_w <= 1600) && (set_h <= 1200)) - { - shutter = shutter*1984/2434; - } - if (shutter < 1) - { - shutter = 1; - } - sensor_write(client, 0x3012, sizeof((shutter >> 8) & 0xff) ); - sensor_write(client, 0x3013, sizeof(shutter & 0xFF) ); - #endif - } - mdelay(250); - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; - -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - mf->colorspace = fmt->colorspace; -/*not support 720p video*/ - if(mf->height == 720 && mf->width == 1280){ - mf->height = 480; - mf->width = 640; - } - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV2655 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value > 0) && ((digitalzoom_cur + value) > digitalzoom_total)) - { - value = digitalzoom_total - digitalzoom_cur; - } - - if ((value < 0) && ((digitalzoom_cur + value) < 0)) - { - value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - //struct i2c_client *client = v4l2_get_subdevdata(sd); - //struct sensor *sensor = to_sensor(client); - //struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - //struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char value; - int ret,pid = 0; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - - /* soft reset */ - ret = sensor_write(client, 0x3021, 0x61); - if (ret != 0) { - SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - mdelay(5); //delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x307e, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid |= (value << 8); - - ret = sensor_read(client, 0x307f, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - - return ret; -} -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0; -#if CONFIG_SENSOR_Flash - int i; -#endif - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - if (sensor->sensor_io_request->gpio_res[0].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[0].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[0]; - } else if (sensor->sensor_io_request->gpio_res[1].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[1].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[1]; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - - sensor->info_priv.fmt = sensor_colour_fmts[0]; - - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); diff --git a/drivers/media/video/nt99252_3way.c b/drivers/media/video/nt99252_3way.c deleted file mode 100644 index f371abadf75c..000000000000 --- a/drivers/media/video/nt99252_3way.c +++ /dev/null @@ -1,1137 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ - -#include "generic_sensor.h" -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.1.1: -* add sensor_focus_af_const_pause_usr_cb; -*/ -static int version = KERNEL_VERSION(0,1,1); -module_param(version, int, S_IRUGO); - -static int debug =1; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_NT99252 -#define SENSOR_V4L2_IDENT V4L2_IDENT_NT99252 -#define SENSOR_ID 0x2520 -#define SENSOR_BUS_PARAM (SOCAM_MASTER |\ - SOCAM_PCLK_SAMPLE_RISING|SOCAM_HSYNC_ACTIVE_HIGH| SOCAM_VSYNC_ACTIVE_HIGH|\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) -#define SENSOR_PREVIEW_W 800 -#define SENSOR_PREVIEW_H 600 -#define SENSOR_PREVIEW_FPS 15000 // 15fps -#define SENSOR_FULLRES_L_FPS 5000 // 7.5fps -#define SENSOR_FULLRES_H_FPS 10000 // 7.5fps -#define SENSOR_720P_FPS 1 -#define SENSOR_1080P_FPS 0 - -#define SENSOR_REGISTER_LEN 2 // sensor register address bytes -#define SENSOR_VALUE_LEN 1 // sensor register value bytes - -static unsigned int SensorConfiguration = 0; -static unsigned int SensorChipID[] = {SENSOR_ID}; -/* Sensor Driver Configuration End */ - - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a,b) CONS4(SensorReg,SENSOR_REGISTER_LEN,Val,SENSOR_VALUE_LEN)(a,b) -#define sensor_write(client,reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_read(client,reg,v) CONS4(sensor_read_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_write_array generic_sensor_write_array - -struct sensor_parameter -{ - unsigned int PreviewDummyPixels; - unsigned int CaptureDummyPixels; - unsigned int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int PreviewPclk; - unsigned short int CapturePclk; - char awb[6]; -}; - -struct specific_sensor{ - struct generic_sensor common_sensor; - //define user data below - struct sensor_parameter parameter; - -}; - -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ - -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_init_data[] ={ - {0x302A, 0x00}, - {0x301F, 0x80}, - {0x303f, 0x0e}, - {0x3051, 0xE8}, - {0x320A, 0x00}, - {0x302E, 0x01}, - {0x3069, 0x04}, - {0x306a, 0x04}, - {0x3101, 0x80}, - {0x3104, 0x03}, - {0x3105, 0x03}, - {0x3106, 0x0D}, - {0x310A, 0x62}, - {0x310D, 0x60}, - {0x3111, 0x5B}, - {0x3131, 0x58}, - {0x3127, 0x01}, - {0x3210, 0x1E}, - {0x3211, 0x1E}, - {0x3212, 0x1E}, - {0x3213, 0x1E}, - {0x3214, 0x17}, - {0x3215, 0x17}, - {0x3216, 0x17}, - {0x3217, 0x17}, - {0x3218, 0x17}, - {0x3219, 0x17}, - {0x321A, 0x17}, - {0x321B, 0x17}, - {0x321C, 0x0F}, - {0x321D, 0x10}, - {0x321E, 0x0F}, - {0x321F, 0x0F}, - {0x3230, 0x00}, - {0x3231, 0x00}, - {0x3232, 0x00}, - {0x3233, 0x00}, - {0x3234, 0x00}, - {0x3235, 0x00}, - {0x3236, 0x00}, - {0x3237, 0x08}, - {0x3238, 0x20}, - {0x3239, 0x20}, - {0x323A, 0x20}, - {0x3243, 0xC3}, - {0x3244, 0x00}, - {0x3245, 0x00}, - {0x3302, 0x00}, - {0x3303, 0x54}, - {0x3304, 0x00}, - {0x3305, 0x91}, - {0x3306, 0x00}, - {0x3307, 0x1A}, - {0x3308, 0x07}, - {0x3309, 0xCD}, - {0x330A, 0x07}, - {0x330B, 0x51}, - {0x330C, 0x00}, - {0x330D, 0xE3}, - {0x330E, 0x00}, - {0x330F, 0xC6}, - {0x3310, 0x07}, - {0x3311, 0x4A}, - {0x3312, 0x07}, - {0x3313, 0xF1}, - {0x3270, 0x00}, - {0x3271, 0x0B}, - {0x3272, 0x16}, - {0x3273, 0x2B}, - {0x3274, 0x3F}, - {0x3275, 0x51}, - {0x3276, 0x72}, - {0x3277, 0x8F}, - {0x3278, 0xA7}, - {0x3279, 0xBC}, - {0x327A, 0xDC}, - {0x327B, 0xF0}, - {0x327C, 0xFA}, - {0x327D, 0xFE}, - {0x327E, 0xFF}, - {0x3327, 0x00}, - {0x3326, 0x1F}, - {0x3360, 0x08}, - {0x3361, 0x0E}, - {0x3362, 0x14}, - {0x3363, 0xB3}, - {0x3331, 0x0C}, - {0x3332, 0x60}, - {0x3365, 0x10}, - {0x3366, 0x10}, - {0x3368, 0x08}, - {0x3369, 0x08}, - {0x336A, 0x06}, - {0x336B, 0x00}, - {0x336d, 0x14}, - {0x336e, 0x14}, - {0x336f, 0x00}, - {0x3370, 0x00}, - {0x3379, 0x0A}, - {0x337A, 0x0A}, - {0x337B, 0x0A}, - {0x337C, 0x0A}, - {0x3371, 0x38}, - {0x3372, 0x38}, - {0x3373, 0x3F}, - {0x3374, 0x3F}, - {0x33A2, 0x00}, - {0x33A3, 0x30}, - {0x33A4, 0x01}, - {0x33c0, 0x03}, - {0x33c9, 0xCF}, - {0x33ca, 0x36}, - SensorEnd -}; -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={ - {0x32BF, 0x60}, - {0x32C0, 0x84}, - {0x32C1, 0x84}, - {0x32C2, 0x84}, - {0x32C3, 0x00}, - {0x32C4, 0x20}, - {0x32C5, 0x10}, - {0x32C6, 0x18}, - {0x32C7, 0x00}, - {0x32C8, 0x7E}, - {0x32C9, 0x84}, - {0x32CA, 0x94}, - {0x32CB, 0x94}, - {0x32CC, 0x9C}, - {0x32CD, 0x9C}, - {0x32DB, 0x6F}, - {0x3241, 0x89}, - {0x33A0, 0xAF}, - {0x33A1, 0x64}, - {0x3200, 0x3E}, - {0x3201, 0x3F}, - {0x302A, 0x00}, - {0x302C, 0x0C}, - {0x302C, 0x0B}, - {0x302D, 0x02}, - {0x3022, 0x24}, - {0x3023, 0x24}, - {0x3002, 0x00}, - {0x3003, 0x04}, - {0x3004, 0x00}, - {0x3005, 0x04}, - {0x3006, 0x06}, - {0x3007, 0x43}, - {0x3008, 0x04}, - {0x3009, 0xCC}, - {0x300A, 0x07}, - {0x300B, 0x6C}, - {0x300C, 0x09}, - {0x300D, 0xDE}, - {0x300E, 0x06}, - {0x300F, 0x40}, - {0x3010, 0x04}, - {0x3011, 0xB0}, - {0x32BB, 0x87}, - {0x32B8, 0x36}, - {0x32B9, 0x2A}, - {0x32BC, 0x30}, - {0x32BD, 0x33}, - {0x32BE, 0x2D}, - {0x325C, 0x03}, - {0x320A, 0x00}, - {0x3021, 0x06}, - {0x334A, 0x34}, - {0x334B, 0x14}, - {0x334C, 0x10}, - {0x3060, 0x01}, - SensorEnd -}; -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] ={ - {0x32BF, 0x60}, - {0x32C0, 0x74}, - {0x32C1, 0x74}, - {0x32C2, 0x74}, - {0x32C3, 0x00}, - {0x32C4, 0x20}, - {0x32C5, 0x10}, - {0x32C6, 0x18}, - {0x32C7, 0x00}, - {0x32C8, 0x7E}, - {0x32C9, 0x74}, - {0x32CA, 0x84}, - {0x32CB, 0x84}, - {0x32CC, 0x8C}, - {0x32CD, 0x8C}, - {0x32DB, 0x6F}, - {0x3241, 0x81}, - {0x33A0, 0xAF}, - {0x33A1, 0x54}, - {0x3200, 0x3E}, - {0x3201, 0x3F}, - {0x302A, 0x00}, - {0x302C, 0x0C}, - {0x302C, 0x0B}, - {0x302D, 0x02}, - {0x3022, 0x24}, - {0x3023, 0x24}, - {0x3002, 0x00}, - {0x3003, 0x04}, - {0x3004, 0x00}, - {0x3005, 0x04}, - {0x3006, 0x06}, - {0x3007, 0x43}, - {0x3008, 0x04}, - {0x3009, 0xCC}, - {0x300A, 0x07}, - {0x300B, 0x6C}, - {0x300C, 0x04}, - {0x300D, 0xEF}, - {0x300E, 0x06}, - {0x300F, 0x40}, - {0x3010, 0x04}, - {0x3011, 0xB0}, - {0x32BB, 0x87}, - {0x32B8, 0x36}, - {0x32B9, 0x2A}, - {0x32BC, 0x30}, - {0x32BD, 0x33}, - {0x32BE, 0x2D}, - {0x325C, 0x03}, - {0x320A, 0x00}, - {0x3021, 0x06}, - {0x334A, 0x34}, - {0x334B, 0x14}, - {0x334C, 0x10}, - {0x3060, 0x01}, - SensorEnd -}; -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data[] ={ - {0x32BF, 0x60}, - {0x32C0, 0x6A}, - {0x32C1, 0x6A}, - {0x32C2, 0x6A}, - {0x32C3, 0x00}, - {0x32C4, 0x20}, - {0x32C5, 0x20}, - {0x32C6, 0x20}, - {0x32C7, 0x00}, - {0x32C8, 0xB9}, - {0x32C9, 0x6A}, - {0x32CA, 0x8A}, - {0x32CB, 0x8A}, - {0x32CC, 0x8A}, - {0x32CD, 0x8A}, - {0x32DB, 0x77}, - {0x3241, 0x80}, - {0x33A0, 0xB7}, - {0x33A1, 0x4A}, - {0x32E0, 0x03}, - {0x32E1, 0x20}, - {0x32E2, 0x02}, - {0x32E3, 0x58}, - {0x32E4, 0x00}, - {0x32E5, 0x00}, - {0x32E6, 0x00}, - {0x32E7, 0x00}, - {0x3200, 0x3E}, - {0x3201, 0x7F}, - {0x302A, 0x00}, - {0x302C, 0x0C}, - {0x302C, 0x0B}, - {0x302D, 0x02}, - {0x3022, 0x24}, - {0x3023, 0x6E}, - {0x3002, 0x00}, - {0x3003, 0x04},//x_start=4 - {0x3004, 0x00}, - {0x3005, 0x04},//y_start=4 - {0x3006, 0x06}, - {0x3007, 0x43},//x_end=1603 - {0x3008, 0x04}, - {0x3009, 0xCC},//y_end=1228 - {0x300A, 0x05}, - {0x300B, 0x14},//pixel=1300 - {0x300C, 0x02}, - {0x300D, 0x67},//line=615 - {0x300E, 0x03}, - {0x300F, 0x20},//x_width=800 - {0x3010, 0x02}, - {0x3011, 0x58},//y_width=600 - {0x32BB, 0x87}, - {0x32B8, 0x36}, - {0x32B9, 0x2A}, - {0x32BC, 0x30}, - {0x32BD, 0x33}, - {0x32BE, 0x2D}, - {0x325C, 0x02}, - {0x320A, 0x00}, - {0x3021, 0x06}, - {0x334A, 0x00}, - {0x334B, 0x7F}, - {0x334C, 0x1F}, - {0x3060, 0x01}, - SensorEnd -}; -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[]={ - {0x32BF, 0x60}, - {0x32C0, 0x6A}, - {0x32C1, 0x6A}, - {0x32C2, 0x6A}, - {0x32C3, 0x00}, - {0x32C4, 0x20}, - {0x32C5, 0x20}, - {0x32C6, 0x20}, - {0x32C7, 0x00}, - {0x32C8, 0x98}, - {0x32C9, 0x6A}, - {0x32CA, 0x8A}, - {0x32CB, 0x8A}, - {0x32CC, 0x8A}, - {0x32CD, 0x8A}, - {0x32DB, 0x73}, - {0x3241, 0x7E}, - {0x33A0, 0xB3}, - {0x33A1, 0x4A}, - {0x3200, 0x3E}, - {0x3201, 0x3F}, - {0x302A, 0x00}, - {0x302C, 0x0C}, - {0x302C, 0x0B}, - {0x302D, 0x02}, - {0x3022, 0x24}, - {0x3023, 0x24}, - {0x3002, 0x00}, - {0x3003, 0xA4}, - {0x3004, 0x00}, - {0x3005, 0xF4}, - {0x3006, 0x05}, - {0x3007, 0xA3}, - {0x3008, 0x04}, - {0x3009, 0xCC}, - {0x300A, 0x06}, - {0x300B, 0x2C}, - {0x300C, 0x02}, - {0x300D, 0xDC}, - {0x300E, 0x05}, - {0x300F, 0x00}, - {0x3010, 0x02}, - {0x3011, 0xD0}, - {0x32BB, 0x87}, - {0x32B8, 0x36}, - {0x32B9, 0x2A}, - {0x32BC, 0x30}, - {0x32BD, 0x33}, - {0x32BE, 0x2D}, - {0x325C, 0x03}, - {0x320A, 0x00}, - {0x3021, 0x06}, - {0x334A, 0x00}, - {0x334B, 0x7F}, - {0x334C, 0x1F}, - {0x3060, 0x01}, - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[]={ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_softreset_data[]={ - SensorRegVal(0x3021,0x61), - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[]={ - SensorRegVal(0x3000,0), - SensorRegVal(0x3001,0), - SensorEnd -}; -/* -* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx -*/ -static struct rk_sensor_reg sensor_WhiteB_Auto[]= -{ - //[WB-AUTO] - {0x3201, 0x7F}, //AWB auto, bit[4]:1,auto - SensorEnd -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[]= -{ - //[WB-CLOUDY] - {0x3201, 0x6F}, - {0x3290, 0x01}, - {0x3291, 0x51}, - {0x3296, 0x01}, - {0x3297, 0x00}, - SensorEnd -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[]= -{ - //[WB-DAYLIGHT] - {0x3201, 0x6F}, - {0x3290, 0x01}, - {0x3291, 0x38}, - {0x3296, 0x01}, - {0x3297, 0x68}, - SensorEnd -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]= -{ - //[WB-INCANDESCENCE] - {0x3201, 0x6F}, - {0x3290, 0x01}, - {0x3291, 0x30}, - {0x3296, 0x01}, - {0x3297, 0xCB}, - SensorEnd - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]= -{ - //[WB-FLUORESCENT] - {0x3201, 0x6F}, - {0x3290, 0x01}, - {0x3291, 0x70}, - {0x3296, 0x01}, - {0x3297, 0xFF}, - SensorEnd -}; -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp3[]= -{ - //[WB-TUNGSTEN] - {0x3201, 0x6F}, - {0x3290, 0x01}, - {0x3291, 0x00}, - {0x3296, 0x02}, - {0x3297, 0x30}, - SensorEnd -}; - -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy, sensor_WhiteB_TungstenLamp3, NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[]= -{ - // Brightness -2 - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[]= -{ - // Brightness -1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[]= -{ - // Brightness 0 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[]= -{ - // Brightness +1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[]= -{ - // Brightness +2 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[]= -{ - // Brightness +3 - - SensorEnd -}; -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = -{ - {0x32f1, 0x00}, - {0x32f8, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = -{ - //[SE-GrayScale] - {0x32f1, 0x01}, - {0x32f8, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = -{ - //[SE-SEPIA] - {0x32f1, 0x02}, - {0x32f8, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Negative[] = -{ - //[SE-Inverse] - {0x32f1, 0x03}, - {0x32f8, 0x01}, - SensorEnd -}; -static struct rk_sensor_reg sensor_Effect_Bluish[] = -{ - //[SE-SEPIABlue] - {0x32f1, 0x05}, - {0x32f4, 0xf0}, - {0x32f5, 0x80}, - {0x32f8, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = -{ - //[SE-SEPIAGreen] - {0x32f1, 0x05}, - {0x32f4, 0x60}, - {0x32f5, 0x20}, - {0x32f8, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Solarization[] = -{ - //[SE-Solarization] - {0x32f1, 0x04}, - {0x32f8, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green, sensor_Effect_Solarization, NULL, -}; - -static struct rk_sensor_reg sensor_Exposure04[]= -{ - //[EV-4] - {0x32F2, 0x40}, - {0x32F8, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure03[]= -{ - //[EV-3] - {0x32F2, 0x50}, - {0x32F8, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure02[]= -{ - //[EV-2] - {0x32F2, 0x60}, - {0x32F8, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure01[]= -{ - //[EV-1] - {0x32F2, 0x70}, - {0x32F8, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure00[]= -{ - //[EV+0] - {0x32F2, 0x80}, - {0x32F8, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure11[]= -{ - //[EV+1] - {0x32F2, 0x90}, - {0x32F8, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure12[]= -{ - //[EV+2] - {0x32F2, 0xA0}, - {0x32F8, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure13[]= -{ - //[EV+3] - {0x32F2, 0xB0}, - {0x32F8, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure14[]= -{ - //[EV+4] - {0x32F2, 0xC0}, - {0x32F8, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = {/*sensor_Exposure04,*/sensor_Exposure03, sensor_Exposure02, sensor_Exposure01, sensor_Exposure00, - sensor_Exposure11, sensor_Exposure12,sensor_Exposure13,/*sensor_Exposure14,*/NULL, -}; - - -static struct rk_sensor_reg sensor_Saturation0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -static struct rk_sensor_reg sensor_Contrast04[]= -{ - //[Contrast : -4] - {0x32FC, 0x40}, - {0x32F2, 0x40}, - {0x32f8, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast03[]= -{ - //[Contrast : -3] - {0x32FC, 0x30}, - {0x32F2, 0x50}, - {0x32f8, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast02[]= -{ - //[Contrast : -2] - {0x32FC, 0x20}, - {0x32F2, 0x60}, - {0x32f8, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast01[]= -{ - //[Contrast : -1] - {0x32FC, 0x10}, - {0x32F2, 0x70}, - {0x32f8, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast00[]= -{ - //[Contrast : 0] - {0x32FC, 0x00}, - {0x32F2, 0x80}, - {0x32f8, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast11[]= -{ - //[Contrast : +1] - {0x32FC, 0xF0}, - {0x32F2, 0x90}, - {0x32f8, 0x01}, - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Contrast12[]= -{ - //[Contrast : +2] - {0x32FC, 0xE0}, - {0x32F2, 0xA0}, - {0x32f8, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast13[]= -{ - //[Contrast : +3] - {0x32FC, 0xD0}, - {0x32F2, 0xB0}, - {0x32f8, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast14[]= -{ - //[Contrast : +4] - {0x32FC, 0xC0}, - {0x32F2, 0xC0}, - {0x32f8, 0x01}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_ContrastSeqe[] = {sensor_Contrast04, sensor_Contrast03, sensor_Contrast02, sensor_Contrast01, - sensor_Contrast00, sensor_Contrast11, sensor_Contrast12, sensor_Contrast13, sensor_Contrast14,NULL, -}; - -static struct rk_sensor_reg sensor_SceneAuto[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -static struct rk_sensor_reg sensor_Zoom0[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Zoom3[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; - -/* -* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu -*/ -static struct v4l2_querymenu sensor_menus[] = -{ - //white balance - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,0,"auto",0), - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,1,"incandescent",0), - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,2,"fluorescent",0), - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,3,"daylight",0), - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,4,"cloudy-daylight",0), - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,5,"tungsten",0), - - //speical effect - new_usr_v4l2menu(V4L2_CID_EFFECT,0,"none",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,1,"mono",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,2,"negative",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,3,"sepia",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,4,"posterize",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,5,"aqua",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,6,"solarize",0), - -}; -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = -{ - new_user_v4l2ctrl(V4L2_CID_DO_WHITE_BALANCE,V4L2_CTRL_TYPE_MENU,"White Balance Control", 0, 5, 1, 0,sensor_v4l2ctrl_default_cb, sensor_WhiteBalanceSeqe), - new_user_v4l2ctrl(V4L2_CID_EXPOSURE,V4L2_CTRL_TYPE_INTEGER,"Exposure Control", -3, 3, 1, 0,sensor_v4l2ctrl_default_cb, sensor_ExposureSeqe), - new_user_v4l2ctrl(V4L2_CID_EFFECT,V4L2_CTRL_TYPE_MENU,"Effect Control", 0, 6, 1, 0,sensor_v4l2ctrl_default_cb, sensor_EffectSeqe), - new_user_v4l2ctrl(V4L2_CID_CONTRAST,V4L2_CTRL_TYPE_INTEGER,"Contrast Control", -4, 4, 1, 0,sensor_v4l2ctrl_default_cb, sensor_ContrastSeqe), -}; - -//MUST define the current used format as the first item -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; -static struct soc_camera_ops sensor_ops; - - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ - -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - SENSOR_DG("%s",__FUNCTION__); - return 0; -} -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - struct generic_sensor *sensor = to_generic_sensor(client); - - SENSOR_DG("%s",__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must switch into Hi-Z */ - if (sensor->info_priv.funmodule_state & SENSOR_INIT_IS_OK) { - //generic_sensor_ioctrl(icd, Sensor_PowerDown, 1); - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - } - return 0; -} -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - if (capture) { - //sensor_parameter_record(client); - } - - return 0; -} -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh (struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - if (capture) { - //sensor_ae_transfer(client); - } - return 0; -} - -static int sensor_try_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf) -{ - return 0; -} - -static int sensor_softrest_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - return 0; -} - -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("Suspend"); - - } else { - SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n",pm_msg.event); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - - SENSOR_DG("Resume"); - - return 0; - -} -static int sensor_mirror_cb (struct i2c_client *client, int mirror) -{ - char val; - int err = 0; - - SENSOR_DG("mirror: %d",mirror); - if (mirror) { - err = sensor_read(client, 0x3022, &val); - if (err == 0) { - val |= 0x02; - err = sensor_write(client, 0x3022, val); - } - } else { - err = sensor_read(client, 0x3022, &val); - if (err == 0) { - val &= 0xfd; - err = sensor_write(client, 0x3022, val); - } - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_mirror_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_mirror failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_mirror success, value:0x%x",ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - char val; - int err = 0; - - SENSOR_DG("flip: %d",flip); - if (flip) { - err = sensor_read(client, 0x3022, &val); - if (err == 0) { - val |= 0x01; - err = sensor_write(client, 0x3022, val); - } - } else { - err = sensor_read(client, 0x3022, &val); - if (err == 0) { - val &= 0xfe; - err = sensor_write(client, 0x3022, val); - } - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_flip_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_flip failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_flip success, value:0x%x",ext_ctrl->value); - return 0; -} -static int sensor_focus_init_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos){ - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client){ - return 0; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos) -{ - return 0; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client,int on){ - return 0; -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor* spsensor,struct soc_camera_device *icd) -{ - return; -} - -/* -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); - - - diff --git a/drivers/media/video/nt99340_2way.c b/drivers/media/video/nt99340_2way.c deleted file mode 100644 index 0c380b6e49f9..000000000000 --- a/drivers/media/video/nt99340_2way.c +++ /dev/null @@ -1,1192 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ - -#include "generic_sensor.h" -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.1.1: -* add sensor_focus_af_const_pause_usr_cb; -*/ -static int version = KERNEL_VERSION(0,1,1); -module_param(version, int, S_IRUGO); - -static int debug =1; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_NT99340 -#define SENSOR_V4L2_IDENT V4L2_IDENT_NT99340 -#define SENSOR_ID 0x3400 -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING|\ - SOCAM_HSYNC_ACTIVE_HIGH| SOCAM_VSYNC_ACTIVE_HIGH|\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define SENSOR_PREVIEW_W 800 -#define SENSOR_PREVIEW_H 600 -#define SENSOR_PREVIEW_FPS 15000 // 15fps -#define SENSOR_FULLRES_L_FPS 5000 // 7.5fps -#define SENSOR_FULLRES_H_FPS 10000 // 7.5fps -#define SENSOR_720P_FPS 15000 -#define SENSOR_1080P_FPS 0 - -#define SENSOR_REGISTER_LEN 2 // sensor register address bytes -#define SENSOR_VALUE_LEN 1 // sensor register value bytes - -static unsigned int SensorConfiguration = 0; -static unsigned int SensorChipID[] = {SENSOR_ID}; - -/* Sensor Driver Configuration End */ - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a,b) CONS4(SensorReg,SENSOR_REGISTER_LEN,Val,SENSOR_VALUE_LEN)(a,b) -#define sensor_write(client,reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_read(client,reg,v) CONS4(sensor_read_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_write_array generic_sensor_write_array - -struct sensor_parameter -{ - unsigned int PreviewDummyPixels; - unsigned int CaptureDummyPixels; - unsigned int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int PreviewPclk; - unsigned short int CapturePclk; - char awb[6]; -}; - -struct specific_sensor{ - struct generic_sensor common_sensor; - //define user data below - struct sensor_parameter parameter; -}; - -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ - -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_init_data[] ={ - {0x32F0, 0x00}, - {0x32FF, 0x00}, - {0x303E, 0x0C}, - {0x303F, 0x02}, - {0x3040, 0xFF}, - {0x3041, 0x00}, - {0x3042, 0x00}, - {0x3051, 0xFC}, - {0x3052, 0x10}, - {0x3069, 0x03}, - {0x306a, 0x03}, - {0x3118, 0xA7}, - {0x3119, 0xA7}, - {0x311A, 0xA7}, - {0x3100, 0x03}, - {0x3101, 0x80}, - {0x3102, 0x09}, - {0x3103, 0x09}, - {0x3104, 0x01}, - {0x3105, 0x01}, - {0x3106, 0x03}, - {0x3107, 0x20}, - {0x3108, 0x00}, - {0x3109, 0x82}, - {0x310A, 0x04}, - {0x3030, 0x0A}, - {0x306C, 0x0C}, - {0x306D, 0x0C}, - {0x3583, 0x18}, - {0x3587, 0x02}, - {0x3584, 0x00}, - {0x3585, 0x00}, - {0x3580, 0xB2}, - {0x3600, 0x66}, - {0x3601, 0x99}, - {0x3604, 0x15}, - {0x3605, 0x13}, - {0x3614, 0x20}, - {0x361A, 0x10}, - {0x3615, 0x24}, - {0x3610, 0x02}, - {0x3290, 0x01}, - {0x3291, 0x80}, - {0x3296, 0x01}, - {0x3297, 0x60}, - {0x3250, 0x80}, - {0x3251, 0x01}, - {0x3252, 0x27}, - {0x3253, 0x9D}, - {0x3254, 0x00}, - {0x3255, 0xE3}, - {0x3256, 0x81}, - {0x3257, 0x70}, - {0x329B, 0x00}, - {0x32A1, 0x00}, - {0x32A2, 0xEC}, - {0x32A3, 0x01}, - {0x32A4, 0x7A}, - {0x32A5, 0x01}, - {0x32A6, 0x14}, - {0x32A7, 0x01}, - {0x32A8, 0xB3}, - {0x3270, 0x00}, - {0x3271, 0x0B}, - {0x3272, 0x16}, - {0x3273, 0x2B}, - {0x3274, 0x3F}, - {0x3275, 0x51}, - {0x3276, 0x72}, - {0x3277, 0x8F}, - {0x3278, 0xA7}, - {0x3279, 0xBC}, - {0x327A, 0xDC}, - {0x327B, 0xF0}, - {0x327C, 0xFA}, - {0x327D, 0xFE}, - {0x327E, 0xFF}, - {0x3302, 0x00}, - {0x3303, 0x4D}, - {0x3304, 0x00}, - {0x3305, 0x96}, - {0x3306, 0x00}, - {0x3307, 0x1D}, - {0x3308, 0x07}, - {0x3309, 0xC7}, - {0x330A, 0x07}, - {0x330B, 0x0A}, - {0x330C, 0x01}, - {0x330D, 0x30}, - {0x330E, 0x01}, - {0x330F, 0x07}, - {0x3310, 0x06}, - {0x3311, 0xFF}, - {0x3312, 0x07}, - {0x3313, 0xFA}, - {0x3210, 0x1E}, - {0x3211, 0x20}, - {0x3212, 0x20}, - {0x3213, 0x1E}, - {0x3214, 0x18}, - {0x3215, 0x1A}, - {0x3216, 0x1A}, - {0x3217, 0x18}, - {0x3218, 0x18}, - {0x3219, 0x1A}, - {0x321A, 0x1A}, - {0x321B, 0x18}, - {0x321C, 0x16}, - {0x321D, 0x1A}, - {0x321E, 0x17}, - {0x321F, 0x15}, - {0x3234, 0x0F}, - {0x3235, 0x0F}, - {0x3236, 0x0F}, - {0x3237, 0x0F}, - {0x3238, 0x40}, - {0x3239, 0x40}, - {0x323A, 0x40}, - {0x3241, 0x40}, - {0x3243, 0x41}, - {0x32F6, 0x0F}, - {0x32F9, 0x42}, - {0x32FA, 0x24}, - {0x3338, 0x18}, - {0x3339, 0xC6}, - {0x333A, 0x6C}, - {0x3335, 0x60}, - {0x3336, 0x20}, - {0x3337, 0x40}, - {0x333B, 0xC6}, - {0x333C, 0x6C}, - {0x3325, 0xAF}, - {0x3326, 0x02}, - {0x3327, 0x00}, - {0x3331, 0x08}, - {0x3332, 0xFF}, - {0x333F, 0x07}, - {0x334A, 0x34}, - {0x334B, 0x14}, - {0x334C, 0x10}, - {0x3363, 0x33}, - {0x3360, 0x08}, - {0x3361, 0x10}, - {0x3362, 0x18}, - {0x3364, 0x88}, - {0x3365, 0x80}, - {0x3366, 0x68}, - {0x3367, 0x40}, - {0x3368, 0x50}, - {0x3369, 0x40}, - {0x336A, 0x30}, - {0x336B, 0x20}, - {0x336C, 0x00}, - {0x336D, 0x1A}, - {0x336E, 0x16}, - {0x336F, 0x14}, - {0x3370, 0x0C}, - {0x3371, 0x3F}, - {0x3372, 0x3F}, - {0x3373, 0x3F}, - {0x3374, 0x3F}, - {0x3375, 0x0E}, - {0x3376, 0x10}, - {0x3377, 0x14}, - {0x3378, 0x20}, - {0x3012, 0x02}, - {0x3013, 0x58}, - {0x301D, 0x01}, - SensorEnd -}; -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={ - {0x32BF, 0x60}, - {0x32C0, 0x84}, - {0x32C1, 0x84}, - {0x32C2, 0x84}, - {0x32C3, 0x00}, - {0x32C4, 0x20}, - {0x32C5, 0x20}, - {0x32C6, 0x20}, - {0x32C7, 0x00}, - {0x32C8, 0x9E}, - {0x32C9, 0x84}, - {0x32CA, 0xA4}, - {0x32CB, 0xA4}, - {0x32CC, 0xA4}, - {0x32CD, 0xA4}, - {0x32DB, 0x73}, - {0x32D0, 0x01}, - {0x3200, 0x3F}, - {0x3201, 0x0F}, - {0x302A, 0x00}, - {0x302B, 0x01}, - {0x302C, 0x0F}, - {0x302D, 0x00}, - {0x302E, 0x00}, - {0x302F, 0x02}, - {0x3022, 0x27}, - {0x3023, 0x24}, - {0x3128, 0x01}, - {0x3002, 0x00}, - {0x3003, 0x04},//x_start=4 - {0x3004, 0x00}, - {0x3005, 0x04},//y_start=4 - {0x3006, 0x08}, - {0x3007, 0x03},//x_end=2051 - {0x3008, 0x06}, - {0x3009, 0x03},//y_end=1539 - {0x300A, 0x0B}, - {0x300B, 0xD0},//pixel=3024 - {0x300C, 0x0C}, - {0x300D, 0x66},//line=3174 - {0x300E, 0x08}, - {0x300F, 0x00},//x=2048 - {0x3010, 0x06}, - {0x3011, 0x00},//y=1536 - {0x3052, 0x10}, - {0x32BB, 0x87}, - {0x32B8, 0x3B}, - {0x32B9, 0x2D}, - {0x32BC, 0x34}, - {0x32BD, 0x38}, - {0x32BE, 0x30}, - {0x3201, 0xBF}, - {0x3109, 0x82}, - {0x3530, 0xC0}, - {0x320A, 0x42}, - {0x3021, 0x06}, - {0x3060, 0x01}, - SensorEnd -}; -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] ={ - {0x32BF, 0x60}, - {0x32C0, 0x74}, - {0x32C1, 0x74}, - {0x32C2, 0x74}, - {0x32C3, 0x00}, - {0x32C4, 0x20}, - {0x32C5, 0x20}, - {0x32C6, 0x20}, - {0x32C7, 0x00}, - {0x32C8, 0x9E}, - {0x32C9, 0x74}, - {0x32CA, 0x94}, - {0x32CB, 0x94}, - {0x32CC, 0x94}, - {0x32CD, 0x94}, - {0x32DB, 0x73}, - {0x32D0, 0x01}, - {0x3200, 0x3F}, - {0x3201, 0x0F}, - {0x302A, 0x00}, - {0x302B, 0x01}, - {0x302C, 0x0F}, - {0x302D, 0x00}, - {0x302E, 0x00}, - {0x302F, 0x02}, - {0x3022, 0x27}, - {0x3023, 0x24}, - {0x3128, 0x01}, - {0x3002, 0x00}, - {0x3003, 0x04},//x_start=4 - {0x3004, 0x00}, - {0x3005, 0x04},//y_start=4 - {0x3006, 0x08}, - {0x3007, 0x03},//x_end=2051 - {0x3008, 0x06}, - {0x3009, 0x03},//y_end=1539 - {0x300A, 0x0B}, - {0x300B, 0xD0},//pixel=3024 - {0x300C, 0x06}, - {0x300D, 0x33},//line=1587 - {0x300E, 0x08}, - {0x300F, 0x00},//x=2048 - {0x3010, 0x06}, - {0x3011, 0x00},//y=1536 - {0x3052, 0x10}, - {0x32BB, 0x87}, - {0x32B8, 0x3B}, - {0x32B9, 0x2D}, - {0x32BC, 0x34}, - {0x32BD, 0x38}, - {0x32BE, 0x30}, - {0x3201, 0xBF}, - {0x3109, 0x82}, - {0x3530, 0xC0}, - {0x320A, 0x42}, - {0x3021, 0x06}, - {0x3060, 0x01}, - SensorEnd -}; -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data[] = -{ - {0x32BF, 0x60}, - {0x32C0, 0x6A}, - {0x32C1, 0x6A}, - {0x32C2, 0x6A}, - {0x32C3, 0x00}, - {0x32C4, 0x20}, - {0x32C5, 0x20}, - {0x32C6, 0x20}, - {0x32C7, 0x00}, - {0x32C8, 0xF0}, - {0x32C9, 0x6A}, - {0x32CA, 0x8A}, - {0x32CB, 0x8A}, - {0x32CC, 0x8A}, - {0x32CD, 0x8A}, - {0x32DB, 0x7E}, - {0x32D0, 0x01}, - {0x32E0, 0x03}, - {0x32E1, 0x20}, - {0x32E2, 0x02}, - {0x32E3, 0x58}, - {0x32E4, 0x00}, - {0x32E5, 0x48}, - {0x32E6, 0x00}, - {0x32E7, 0x48}, - {0x3200, 0x3F}, - {0x3201, 0x0F}, - {0x302A, 0x00}, - {0x302B, 0x01}, - {0x302C, 0x0F}, - {0x302D, 0x00}, - {0x302E, 0x00}, - {0x302F, 0x02}, - {0x3022, 0x27}, - {0x3023, 0x6E}, - {0x3128, 0x01}, - {0x3002, 0x00}, - {0x3003, 0x04},//x_start=4 - {0x3004, 0x00}, - {0x3005, 0x04},//y_start=4 - {0x3006, 0x08}, - {0x3007, 0x03},//x_end=2051 - {0x3008, 0x06}, - {0x3009, 0x03},//y_end=1539 - {0x300A, 0x07}, - {0x300B, 0xD0},//pixel=2000 - {0x300C, 0x03}, - {0x300D, 0x20},//line=800 - {0x300E, 0x04}, - {0x300F, 0x00},//x=1024 - {0x3010, 0x03}, - {0x3011, 0x00},//y=768 - {0x3052, 0x10}, - {0x32BB, 0x87}, - {0x32B8, 0x3B}, - {0x32B9, 0x2D}, - {0x32BC, 0x34}, - {0x32BD, 0x38}, - {0x32BE, 0x30}, - {0x3201, 0xFF}, - {0x3109, 0x82}, - {0x3530, 0xC0}, - {0x320A, 0x42}, - {0x3021, 0x06}, - {0x3060, 0x01}, - SensorEnd -}; -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[]={ - {0x32BF, 0x60}, - {0x32C0, 0x6A}, - {0x32C1, 0x6A}, - {0x32C2, 0x6A}, - {0x32C3, 0x00}, - {0x32C4, 0x20}, - {0x32C5, 0x20}, - {0x32C6, 0x20}, - {0x32C7, 0x40}, - {0x32C8, 0x08}, - {0x32C9, 0x6A}, - {0x32CA, 0x8A}, - {0x32CB, 0x8A}, - {0x32CC, 0x8A}, - {0x32CD, 0x8A}, - {0x32DB, 0x80}, - {0x32D0, 0x01}, - {0x32E0, 0x05}, - {0x32E1, 0x00}, - {0x32E2, 0x02}, - {0x32E3, 0xD0}, - {0x32E4, 0x00}, - {0x32E5, 0x28}, - {0x32E6, 0x00}, - {0x32E7, 0x28}, - {0x3200, 0x3F}, - {0x3201, 0x0F}, - {0x302A, 0x00}, - {0x302B, 0x01}, - {0x302C, 0x0F}, - {0x302D, 0x00}, - {0x302E, 0x00}, - {0x302F, 0x02}, - {0x3022, 0x27}, - {0x3023, 0x24}, - {0x3128, 0x00}, - {0x3002, 0x01}, - {0x3003, 0x20},//x_start=288 - {0x3004, 0x01}, - {0x3005, 0x64},//y_start = 356 - {0x3006, 0x06}, - {0x3007, 0xE7},//x_end = 1767 - {0x3008, 0x04}, - {0x3009, 0xA3},//y_end=1187 - {0x300A, 0x07}, - {0x300B, 0x14},//pixel=1812 - {0x300C, 0x03}, - {0x300D, 0x73},//line=883 - {0x300E, 0x05}, - {0x300F, 0xC8},//x=1480 - {0x3010, 0x03}, - {0x3011, 0x40},//y=832 - {0x3052, 0x10}, - {0x32BB, 0x87}, - {0x32B8, 0x3B}, - {0x32B9, 0x2D}, - {0x32BC, 0x34}, - {0x32BD, 0x38}, - {0x32BE, 0x30}, - {0x3201, 0xFF}, - {0x3109, 0x82}, - {0x3530, 0xC0}, - {0x320A, 0x42}, - {0x3021, 0x06}, - {0x3060, 0x01}, - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[]={ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_softreset_data[]={ - SensorRegVal(0x3021,0x61), - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[]={ - SensorRegVal(0x3000,0), - SensorRegVal(0x3001,0), - SensorEnd -}; -/* -* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx -*/ -static struct rk_sensor_reg sensor_WhiteB_Auto[]= -{ - //[WB-AUTO] - {0x3201, 0xFF}, - SensorEnd -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[]= -{ - //[WB-CLOUDY] - {0x3201, 0xEF}, - {0x3290, 0x01}, - {0x3291, 0x51}, - {0x3296, 0x01}, - {0x3297, 0x00}, - SensorEnd -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[]= -{ - //[WB-DAYLIGHT] - {0x3201, 0xEF}, - {0x3290, 0x01}, - {0x3291, 0x38}, - {0x3296, 0x01}, - {0x3297, 0x68}, - SensorEnd -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]= -{ - //[WB-INCANDESCENCE] - {0x3201, 0xEF}, - {0x3290, 0x01}, - {0x3291, 0x30}, - {0x3296, 0x01}, - {0x3297, 0xCB}, - SensorEnd -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]= -{ - //[WB-FLUORESCENT] - {0x3201, 0xEF}, - {0x3290, 0x01}, - {0x3291, 0x70}, - {0x3296, 0x01}, - {0x3297, 0xFF}, - SensorEnd -}; -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp3[]= -{ - //[WB-TUNGSTEN] - {0x3201, 0xEF}, - {0x3290, 0x01}, - {0x3291, 0x00}, - {0x3296, 0x02}, - {0x3297, 0x30}, - SensorEnd -}; - -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,sensor_WhiteB_TungstenLamp3,NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[]= -{ - // Brightness -2 - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[]= -{ - // Brightness -1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[]= -{ - // Brightness 0 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[]= -{ - // Brightness +1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[]= -{ - // Brightness +2 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[]= -{ - // Brightness +3 - - SensorEnd -}; -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = -{ - //[SE-Normal] - {0x32F1, 0x00}, - {0x32F4, 0x80}, - {0x32F5, 0x80}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = -{ - //[SE-GrayScale] - {0x32F1, 0x01}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = -{ - //[SE-SEPIA] - {0x32F1, 0x02}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Inverse[] = -{ - //[SE-Inverse] - {0x32F1, 0x03}, - SensorEnd -}; -static struct rk_sensor_reg sensor_Effect_Bluish[] = -{ - //[SE-SEPIABlue] - {0x32F1, 0x05}, - {0x32F4, 0xF0}, - {0x32F5, 0x80}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = -{ - //[SE-SEPIAGreen] - {0x32F1, 0x05}, - {0x32F4, 0x60}, - {0x32F5, 0x20}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Solarization[] = -{ - //[SE-Solarization] - {0x32F1, 0x04}, - SensorEnd -}; - -static struct rk_sensor_reg *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Inverse,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,sensor_Effect_Solarization,NULL, -}; - -static struct rk_sensor_reg sensor_Exposure04[]= -{ - //[EV-4] - {0x32F2, 0x40}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure03[]= -{ - //[EV-3] - {0x32F2, 0x50}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure02[]= -{ - //[EV-2] - {0x32F2, 0x60}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure01[]= -{ - //[EV-1] - {0x32F2, 0x70}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure00[]= -{ - //[EV+0] - {0x32F2, 0x80}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure11[]= -{ - //[EV+1] - {0x32F2, 0x90}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure12[]= -{ - //[EV+2] - {0x32F2, 0xA0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure13[]= -{ - //[EV+3] - {0x32F2, 0xB0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure14[]= -{ - //[EV+4] - {0x32F2, 0xC0}, - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = {/*sensor_Exposure04,*/sensor_Exposure03, sensor_Exposure02, sensor_Exposure01, sensor_Exposure00, - sensor_Exposure11, sensor_Exposure12,sensor_Exposure13/*,sensor_Exposure14*/,NULL, -}; - -static struct rk_sensor_reg sensor_Saturation0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -static struct rk_sensor_reg sensor_Contrast04[]= -{ - //[Contrast : -4] - {0x32C2, 0x40}, - {0x32F2, 0x40}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast03[]= -{ - //[Contrast : -3] - {0x32C2, 0x30}, - {0x32F2, 0x50}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast02[]= -{ - //[Contrast : -2] - {0x32C2, 0x20}, - {0x32F2, 0x60}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast01[]= -{ - //[Contrast : -1] - {0x32C2, 0x10}, - {0x32F2, 0x70}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast00[]= -{ - //[Contrast : 0] - {0x32C2, 0x00}, - {0x32F2, 0x80}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast11[]= -{ - //[Contrast : +1] - {0x32C2, 0xF0}, - {0x32F2, 0x90}, - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Contrast12[]= -{ - //[Contrast : +2] - {0x32C2, 0xE0}, - {0x32F2, 0xA0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast13[]= -{ - //[Contrast : +3] - {0x32C2, 0xD0}, - {0x32F2, 0xB0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast14[]= -{ - //[Contrast : +4] - {0x32C2, 0xC0}, - {0x32F2, 0xC0}, - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ContrastSeqe[] = {sensor_Contrast04, sensor_Contrast03, sensor_Contrast02, sensor_Contrast01, - sensor_Contrast00, sensor_Contrast11, sensor_Contrast12, sensor_Contrast13, sensor_Contrast14,NULL, -}; - -static struct rk_sensor_reg sensor_SceneAuto[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -static struct rk_sensor_reg sensor_Zoom0[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Zoom3[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; - - -/* -* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu -*/ -static struct v4l2_querymenu sensor_menus[] = -{ - //white balance - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,0,"auto",0), - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,1,"incandescent",0), - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,2,"fluorescent",0), - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,3,"daylight",0), - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,4,"cloudy-daylight",0), - new_usr_v4l2menu(V4L2_CID_DO_WHITE_BALANCE,5,"tungsten",0), - - //speical effect - new_usr_v4l2menu(V4L2_CID_EFFECT,0,"none",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,1,"mono",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,2,"negative",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,3,"sepia",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,4,"posterize",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,5,"aqua",0), - new_usr_v4l2menu(V4L2_CID_EFFECT,6,"solarize",0), -}; -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = -{ - new_user_v4l2ctrl(V4L2_CID_DO_WHITE_BALANCE,V4L2_CTRL_TYPE_MENU,"White Balance Control", 0, 5, 1, 0,sensor_v4l2ctrl_default_cb, sensor_WhiteBalanceSeqe), - new_user_v4l2ctrl(V4L2_CID_EXPOSURE,V4L2_CTRL_TYPE_INTEGER,"Exposure Control", -3, 3, 1, 0,sensor_v4l2ctrl_default_cb, sensor_ExposureSeqe), - new_user_v4l2ctrl(V4L2_CID_EFFECT,V4L2_CTRL_TYPE_MENU,"Effect Control", 0, 6, 1, 0,sensor_v4l2ctrl_default_cb, sensor_EffectSeqe), - new_user_v4l2ctrl(V4L2_CID_CONTRAST,V4L2_CTRL_TYPE_INTEGER,"Contrast Control", -4, 4, 1, 0,sensor_v4l2ctrl_default_cb, sensor_ContrastSeqe), -}; - -//MUST define the current used format as the first item -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; -static struct soc_camera_ops sensor_ops; - - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - //struct soc_camera_device *icd = client->dev.platform_data; - //generic_sensor_ioctrl(icd, Sensor_PowerDown, 0); - - SENSOR_DG("%s",__FUNCTION__); - - return 0; -} -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - struct generic_sensor *sensor = to_generic_sensor(client); - //struct soc_camera_device *icd = client->dev.platform_data; - - SENSOR_DG("%s",__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must switch into Hi-Z */ - if (sensor->info_priv.funmodule_state & SENSOR_INIT_IS_OK) { - //generic_sensor_ioctrl(icd, Sensor_PowerDown, 1); - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - } - - return 0; -} -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - if (capture) { - // sensor_parameter_record(client); - } - - return 0; -} -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh (struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - if (capture) { - // sensor_ae_transfer(client); - } - return 0; -} - -static int sensor_try_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf) -{ - return 0; -} - -static int sensor_softrest_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - return 0; -} - -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("Suspend"); - - } else { - SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n",pm_msg.event); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - - SENSOR_DG("Resume"); - - return 0; - -} -static int sensor_mirror_cb (struct i2c_client *client, int mirror) -{ - char val; - int err = 0; - - SENSOR_DG("mirror: %d",mirror); - if (mirror) { - err = sensor_read(client, 0x3022, &val); - if (err == 0) { - val |= 0x02; - err = sensor_write(client, 0x3022, val); - } - } else { - err = sensor_read(client, 0x3022, &val); - if (err == 0) { - val &= 0xfd; - err = sensor_write(client, 0x3022, val); - } - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_mirror_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_mirror failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_mirror success, value:0x%x",ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - char val; - int err = 0; - - SENSOR_DG("flip: %d",flip); - if (flip) { - err = sensor_read(client, 0x3022, &val); - if (err == 0) { - val |= 0x01; - err = sensor_write(client, 0x3022, val); - } - } else { - err = sensor_read(client, 0x3022, &val); - if (err == 0) { - val &= 0xfe; - err = sensor_write(client, 0x3022, val); - } - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_flip_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_flip failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_flip success, value:0x%x",ext_ctrl->value); - return 0; -} - -/* -AF call back -*/ -static int sensor_focus_init_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos){ - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client){ - return 0; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos) -{ - return 0; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client,int on){ - return 0; -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor* spsensor,struct soc_camera_device *icd) -{ - return; -} - -/* -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); - - - diff --git a/drivers/media/video/ov2640_rk.c b/drivers/media/video/ov2640_rk.c deleted file mode 100644 index f2c27944878f..000000000000 --- a/drivers/media/video/ov2640_rk.c +++ /dev/null @@ -1,3131 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_OV2640 -#define SENSOR_V4L2_IDENT V4L2_IDENT_OV2640 -#define SENSOR_ID 0x2642 -#define SENSOR_ID1 0x2641 -#define SENSOR_MIN_WIDTH 640 -#define SENSOR_MIN_HEIGHT 480 -#define SENSOR_MAX_WIDTH 1600 -#define SENSOR_MAX_HEIGHT 1200 -#define SENSOR_INIT_WIDTH 640 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 480 -#define SENSOR_INIT_WINSEQADR sensor_vga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_YUYV8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 0 -#define CONFIG_SENSOR_Scene 0 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 1 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 - -#define CONFIG_SENSOR_I2C_SPEED 250000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) -struct reginfo -{ - u8 reg; - u8 val; -}; - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); - -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_OV2640_USER_DEFINED_SERIES -#include "ov2640_user_series.c" -#else -/* init 800*600 SVGA */ -static struct reginfo sensor_init_data[] = -{ -#if 1 - {0xff,0x01}, - {0x12,0x80}, - {0xff,0x00}, - {0x2c,0xff}, - {0x2e,0xdf}, - {0xff,0x01}, - - {0x03,0x4f},// 0x8f peak - {0x0f,0x4b}, - - - {0x3c,0x32}, - {0x11,0x00}, - {0x09,0x02}, - {0x04,0x28},//b7,b6 directs - {0x13,0xe5}, - {0x14,0x28}, //0x48 peak - {0x2c,0x0c}, - {0x33,0x78}, - {0x3a,0x33}, - {0x3b,0xfB}, - {0x3e,0x00}, - {0x43,0x11}, - {0x16,0x10}, - {0x39,0x02}, - {0x35,0x88}, - {0x22,0x09}, - {0x37,0x40}, - {0x23,0x00}, - {0x34,0xa0}, - {0x36,0x1a}, - {0x06,0x02}, - {0x07,0xc0}, - {0x0d,0xb7}, - {0x0e,0x01}, - {0x4c,0x00}, - {0x4a,0x81}, - {0x21,0x99}, - //aec - //{0x24,0x58}, - //{0x25,0x50}, - //{0x26,0x92}, - - //{0x24, 0x70}, - //{0x25, 0x60}, - //{0x26, 0xa4}, - {0x24, 0x48}, - {0x25, 0x38}, - {0x26, 0x82},//82 - - {0x5c,0x00}, - {0x63,0x00}, - {0x46,0x3f}, - {0x0c,0x3c}, - {0x61,0x70}, - {0x62,0x80}, - {0x7c,0x05}, - {0x20,0x80}, - {0x28,0x30}, - {0x6c,0x00}, - {0x6d,0x80}, - {0x6e,0x00}, - {0x70,0x02}, - {0x71,0x94}, - {0x73,0xc1}, - {0x3d,0x34}, - {0x5a,0x57}, - {0x4f,0xbb}, - {0x50,0x9c}, - {0xff,0x00}, - {0xe5,0x7f}, - {0xf9,0xc0}, - {0x41,0x24}, - {0xe0,0x14}, - {0x76,0xff}, - {0x33,0xa0}, - {0x42,0x20}, - {0x43,0x18}, - {0x4c,0x00}, - {0x87,0xd0}, - {0x88,0x3f}, - {0xd7,0x03}, - {0xd9,0x10}, - {0xd3,0x82}, - {0xc8,0x08}, - {0xc9,0x80}, - // - //{0xff,0x00}, //added by peak on 20120409 - {0x7c,0x00}, - {0x7d,0x02},//0x00 peak//0x07,È·±£ÔÚ±ðµÄÎļþÀïû±»¸²¸Ç - {0x7c,0x03}, - {0x7d,0x28},//0x48//0x40 Õâ¸öÖµÒѾ­ºÜСÁË,³ý·ÇÄãÔÚ±ðµÄÎļþÀïÓÖдÁË - {0x7d,0x28},//0x48 peak//0x40 Õâ¸öÖµÒѾ­ºÜСÁË,³ý·ÇÄãÔÚ±ðµÄÎļþÀïÓÖдÁË - - // removed by peak on 20120409 - - {0x7c,0x08}, - {0x7d,0x20}, - {0x7d,0x10},//0x10 - {0x7d,0x0e},//0x0e - -//contrast added by peak on 20120409 - // {0x7c,0x00}, - //{0x7d,0x04},//0x48//0x40 - //{0x7c,0x07},//0x48 peak//0x40 - //{0x7d,0x20}, - //{0x7d,0x28}, - //{0x7d,0x0c},//0x10 - //{0x7d,0x06},//0x0e - - //{0xff, 0x01},// added by peak on 20120409 - - {0x90,0x00}, - {0x91,0x0e}, - {0x91,0x1a},//e3 - {0x91,0x31}, - {0x91,0x5a}, - {0x91,0x69}, - {0x91,0x75}, - {0x91,0x7e}, - {0x91,0x88}, - {0x91,0x8f}, - {0x91,0x96}, - {0x91,0xa3}, - {0x91,0xaf}, - {0x91,0xc4}, - {0x91,0xd7}, - {0x91,0xe8}, - {0x91,0x20}, - - - - - - {0x92,0x00}, - {0x93,0x06}, - {0x93,0xc8},//e3 - {0x93,0x05}, - {0x93,0x05}, - {0x93,0x00}, - {0x93,0x04}, - {0x93,0x00}, - {0x93,0x00}, - {0x93,0x00}, - {0x93,0x00}, - {0x93,0x00}, - {0x93,0x00}, - {0x93,0x00}, - - {0x96,0x00}, - {0x97,0x08}, - {0x97,0x19}, - {0x97,0x02}, - {0x97,0x0c}, - {0x97,0x24}, - {0x97,0x30}, - {0x97,0x28}, - {0x97,0x26}, - {0x97,0x02}, - {0x97,0x98}, - {0x97,0x80}, - {0x97,0x00}, - {0x97,0x00}, - {0xc3,0xef},//ed - {0xa4,0x00}, - {0xa8,0x00}, - - {0xbf, 0x00}, - {0xba, 0xdc}, - {0xbb, 0x08}, - {0xb6, 0x20}, - {0xb8, 0x30}, - {0xb7, 0x20}, - {0xb9, 0x30}, - {0xb3, 0xb4}, - {0xb4, 0xca}, - {0xb5, 0x34}, - {0xb0, 0x46}, - {0xb1, 0x46}, - {0xb2, 0x06}, - {0xc7, 0x00}, - {0xc6, 0x51}, - {0xc5, 0x11}, - {0xc4, 0x9c}, -//// - {0xc0,0xc8}, - {0xc1,0x96}, - {0x86,0x3d}, - {0x50,0x92}, - {0x51,0x90}, - {0x52,0x2c}, - {0x53,0x00}, - {0x54,0x00}, - {0x55,0x88}, - {0x57,0x00}, - {0x5a,0x50}, - {0x5b,0x3c}, - {0x5c,0x00}, - {0xc3,0xed}, - {0x7f,0x00}, - {0xda,0x01}, - {0xe5,0x1f}, - {0xe1,0x67}, - {0xe0,0x00}, - {0xdd,0xff}, - {0x05,0x00}, - -#endif -#if 1 - {0xff, 0x01}, - {0x5d, 0x55},//0x00 - //{0x5e, 0x7d},//0x3c - //{0x5f, 0x7d},//0x28 - //{0x60, 0x55},//0x55 - {0x5e, 0x55},//0x3c - {0x5f, 0x55},//0x28 - {0x60, 0x55},//0x55 - - {0xff, 0x00}, - {0xc3, 0xef}, - {0xa6, 0x00}, - {0xa7, 0x0f}, - {0xa7, 0x4e}, - {0xa7, 0x7a}, - {0xa7, 0x33}, - {0xa7, 0x00}, - {0xa7, 0x23}, - {0xa7, 0x27}, - {0xa7, 0x3a}, - {0xa7, 0x70}, - {0xa7, 0x33}, - {0xa7, 0x00},//L - {0xa7, 0x23}, - {0xa7, 0x20}, - {0xa7, 0x0c}, - {0xa7, 0x66}, - {0xa7, 0x33}, - {0xa7, 0x00}, - {0xa7, 0x23}, - {0xc3, 0xef}, -#endif - - -#if 1 - {0xff,0x00}, - {0x92,0x00}, - {0x93,0x06}, //0x06 peak - {0x93,0xe3},//e - {0x93,0x05}, - {0x93,0x03}, - {0x93,0x00}, - {0x93,0x04}, -#endif - - //{0x03, 0x0f}, - - {0xe0, 0x04}, - {0xc0, 0xc8}, - {0xc1, 0x96}, - {0x86, 0x3d}, - {0x50, 0x89}, - {0x51, 0x90}, - {0x52, 0x2c}, - {0x53, 0x00}, - {0x54, 0x00}, - {0x55, 0x88}, - {0x57, 0x00}, - {0x5a, 0xa0}, - {0x5b, 0x78}, - {0x5c, 0x00}, - {0xd3, 0x04}, - {0xe0, 0x00}, - -/*vga*/ -/*800*600 - {0xff, 0x00}, - {0xe0, 0x04}, - {0xc0, 0xc8}, - {0xc1, 0x96}, - {0x86, 0x3d}, - {0x50, 0x89}, - {0x51, 0x90}, - {0x52, 0x2c}, - {0x53, 0x00}, - {0x54, 0x00}, - {0x55, 0x88}, - {0x57, 0x00}, - {0x5a, 0xc8}, - {0x5b, 0x96}, - {0x5c, 0x00}, - {0xd3, 0x02}, - {0xe0, 0x00}, -*/ - {0x0, 0x0} //end flag - -}; - -/* 1600X1200 UXGA */ -static struct reginfo sensor_uxga[] = -{ - {0xff, 0x00}, - {0xe0, 0x04}, - {0xc0, 0xc8}, - {0xc1, 0x96}, - {0x86, 0x3d}, - {0x50, 0x00}, - {0x51, 0x90}, - {0x52, 0x2c}, - {0x53, 0x00}, - {0x54, 0x00}, - {0x55, 0x88}, - {0x57, 0x00}, - {0x5a, 0x90}, - {0x5b, 0x2c}, - {0x5c, 0x05}, - {0xd3, 0x82}, - {0xe0, 0x00}, - {0x0, 0x0} //end flag -}; - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {0xff, 0x00}, - {0xe0, 0x04}, - {0xc0, 0xc8}, - {0xc1, 0x96}, - {0x86, 0x3d}, - {0x50, 0x00}, - {0x51, 0x90}, - {0x52, 0x2c}, - {0x53, 0x00}, - {0x54, 0x00}, - {0x55, 0x88}, - {0x57, 0x00}, - {0x5a, 0x40}, - {0x5b, 0x00}, - {0x5c, 0x05}, - {0xd3, 0x82}, - {0xe0, 0x00}, - {0x0, 0x0} //end flag -}; - - -static struct reginfo sensor_xga[] = -{ - {0xff, 0x00}, - {0xe0, 0x04}, - {0xc0, 0xc8}, - {0xc1, 0x96}, - {0x86, 0x3d}, - {0x50, 0x00}, - {0x51, 0x90}, - {0x52, 0x2c}, - {0x53, 0x00}, - {0x54, 0x00}, - {0x55, 0x88}, - {0x57, 0x00}, - {0x5a, 0x40}, - {0x5b, 0x00}, - {0x5c, 0x05}, - {0xd3, 0x82}, - {0xe0, 0x00}, - {0x0, 0x0} //end flag - - -}; - - -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - {0x0, 0x0} //end flag -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - {0x0, 0x0} //end flag - }; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {0x0, 0x0} //end flag -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - {0x0, 0x0} //end flag -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {0x0, 0x0} //end flag -}; - -#endif -#if 0 -/* 160X120 QQVGA*/ -static struct reginfo ov2655_qqvga[] = -{ - - {0x300E, 0x34}, - {0x3011, 0x01}, - {0x3012, 0x10}, - {0x302a, 0x02}, - {0x302b, 0xE6}, - {0x306f, 0x14}, - {0x3362, 0x90}, - - {0x3070, 0x5d}, - {0x3072, 0x5d}, - {0x301c, 0x07}, - {0x301d, 0x07}, - - {0x3020, 0x01}, - {0x3021, 0x18}, - {0x3022, 0x00}, - {0x3023, 0x06}, - {0x3024, 0x06}, - {0x3025, 0x58}, - {0x3026, 0x02}, - {0x3027, 0x61}, - {0x3088, 0x00}, - {0x3089, 0xa0}, - {0x308a, 0x00}, - {0x308b, 0x78}, - {0x3316, 0x64}, - {0x3317, 0x25}, - {0x3318, 0x80}, - {0x3319, 0x08}, - {0x331a, 0x0a}, - {0x331b, 0x07}, - {0x331c, 0x80}, - {0x331d, 0x38}, - {0x3100, 0x00}, - {0x3302, 0x11}, - - {0x0, 0x0}, -}; - - - -static struct reginfo ov2655_Sharpness_auto[] = -{ - {0x3306, 0x00}, -}; - -static struct reginfo ov2655_Sharpness1[] = -{ - {0x3306, 0x08}, - {0x3371, 0x00}, -}; - -static struct reginfo ov2655_Sharpness2[][3] = -{ - //Sharpness 2 - {0x3306, 0x08}, - {0x3371, 0x01}, -}; - -static struct reginfo ov2655_Sharpness3[] = -{ - //default - {0x3306, 0x08}, - {0x332d, 0x02}, -}; -static struct reginfo ov2655_Sharpness4[]= -{ - //Sharpness 4 - {0x3306, 0x08}, - {0x332d, 0x03}, -}; - -static struct reginfo ov2655_Sharpness5[] = -{ - //Sharpness 5 - {0x3306, 0x08}, - {0x332d, 0x04}, -}; -#endif - -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - //{0x4300, 0x30}, - {0x00, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - //{0x4300, 0x32}, - {0x00, 0x00} -}; - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - - {0xff, 0x00}, //AWB auto, bit[1]:0,auto - {0xc7, 0x00}, - {0x00, 0x00} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0xff, 0x00}, - {0xc7, 0x40}, - {0xcc, 0x65}, - {0xcd, 0x41}, - {0xce, 0x4f}, - {0x00, 0x00} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //Sunny - - {0xff, 0x00}, - {0xc7, 0x40}, - {0xcc, 0x5e}, - {0xcd, 0x41}, - {0xce, 0x54}, - {0x00, 0x00} -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0xff, 0x00}, - {0xc7, 0x40}, - {0xcc, 0x52}, - {0xcd, 0x41}, - {0xce, 0x66}, - {0x00, 0x00} -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0xff, 0x00}, - {0xc7, 0x40}, - {0xcc, 0x42}, - {0xcd, 0x3f}, - {0xce, 0x71}, - {0x00, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_ClearDay,sensor_WhiteB_Cloudy,sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - // Brightness -2 - {0xff, 0x01}, - {0x24, 0x34}, - {0x25, 0x22}, - {0x26, 0x70}, - {0x0, 0x0} //end flag -}; - -static struct reginfo sensor_Brightness1[]= -{ - // Brightness -1 - - {0xff, 0x01}, - {0x24, 0x58}, - {0x25, 0x50}, - {0x26, 0x92}, - {0x0, 0x0} //end flag -}; - -static struct reginfo sensor_Brightness2[]= -{ - // Brightness 0 - - {0xff, 0x01}, - {0x24, 0xa8}, - {0x25, 0x90}, - {0x26, 0xd6}, - {0x0, 0x0} //end flag -}; - -static struct reginfo sensor_Brightness3[]= -{ - // Brightness +1 - - {0xff, 0x01}, - {0x24, 0x48}, - {0x25, 0x40}, - {0x26, 0x81}, - {0x0, 0x0} //end flag -}; - -static struct reginfo sensor_Brightness4[]= -{ - // Brightness +2 - - {0xff, 0x01}, - {0x24, 0x58}, - {0x25, 0x50}, - {0x26, 0x92}, - {0x0, 0x0} //end flag -}; - -static struct reginfo sensor_Brightness5[]= -{ - // Brightness +3 - {0xff, 0x01}, - {0x24, 0x70}, - {0x25, 0x60}, - {0x26, 0xa4}, - {0x0, 0x0} //end flag -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0xff,0x00}, - {0x7c,0x00}, - {0x7d,0x00}, - {0x7c,0x05}, - {0x7d,0x80}, - {0x7d,0x80}, - {0x0, 0x0} //end flag -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {0xff,0x00}, - {0x7c,0x00}, - {0x7d,0x18}, - {0x7c,0x05}, - {0x7d,0x80}, - {0x7d,0x80}, - {0x0, 0x0} //end flag -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0xff,0x00}, - {0x7c,0x00}, - {0x7d,0x18}, - {0x7c,0x05}, - {0x7d,0x40}, - {0x7d,0xc0}, - {0x0, 0x0} //end flag -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - {0xff,0x00}, - {0x7c,0x00}, - {0x7d,0x40}, - {0x7c,0x05}, - {0x7d,0x80}, - {0x7d,0x80}, - {0x0, 0x0} //end flag -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - {0Xff, 0X00}, - {0X7c, 0X00}, - {0X7d, 0X18}, - {0X7c, 0X05}, - {0X7d, 0Xa0}, - {0X7d, 0X40}, - {0x0, 0x0} //end flag -}; - -static struct reginfo sensor_Effect_Green[] = -{ - {0Xff, 0X00}, - {0X7c, 0X00}, - {0X7d, 0X18}, - {0X7c, 0X05}, - {0X7d, 0X40}, - {0X7d, 0X40}, - {0x0, 0x0} //end flag -}; - -static struct reginfo sensor_Effect_Exp_Windows_Half[] = -{ - {0xff, 0x01}, - {0x5d, 0x00}, - {0x5e, 0x3c}, - {0x5f, 0x28}, - {0x60, 0x55}, - {0x0, 0x0} //end flag -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure1[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {0xff, 0x00}, - {0x90, 0x00}, - {0x91, 0x0e}, - {0x91, 0x1a}, - {0x91, 0x31}, - {0x91, 0x5a}, - {0x91, 0x69}, - {0x91, 0x75}, - {0x91, 0x7e}, - {0x91, 0x88}, - {0x91, 0x8f}, - {0x91, 0x96}, - {0x91, 0xa3}, - {0x91, 0xaf}, - {0x91, 0xc4}, - {0x91, 0xd7}, - {0x91, 0xe8}, - {0x91, 0x20}, - {0x0, 0x0} //end flag -}; - -static struct reginfo sensor_Saturation1[]= -{ - {0xff, 0x00}, - {0x90, 0x00}, - {0x91, 0x03}, - {0x91, 0x0a}, - {0x91, 0x1a}, - {0x91, 0x3f}, - {0x91, 0x4e}, - {0x91, 0x5b}, - {0x91, 0x68}, - {0x91, 0x75}, - {0x91, 0x7f}, - {0x91, 0x89}, - {0x91, 0x9a}, - {0x91, 0xa6}, - {0x91, 0xbd}, - {0x91, 0xd3}, - {0x91, 0xe5}, - {0x91, 0x24}, - {0x0, 0x0} //end flag -}; - -static struct reginfo sensor_Saturation2[]= -{ - {0xff, 0x00}, - {0x90, 0x00}, - {0x91, 0x04}, - {0x91, 0x07}, - {0x91, 0x10}, - {0x91, 0x28}, - {0x91, 0x36}, - {0x91, 0x44}, - {0x91, 0x52}, - {0x91, 0x60}, - {0x91, 0x6c}, - {0x91, 0x78}, - {0x91, 0x8c}, - {0x91, 0x9e}, - {0x91, 0xbb}, - {0x91, 0xd3}, - {0x91, 0xe5}, - {0x91, 0x24}, - {0x0, 0x0} //end flag -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - {0xff, 0x00}, - {0x7c, 0x00}, - {0x7d, 0x04}, - {0x7c, 0x07}, - {0x7d, 0x20}, - {0x7d, 0x10}, - {0x7d, 0x4a}, - {0x7d, 0x06}, - {0x0, 0x0} //end flag - -}; - -static struct reginfo sensor_Contrast1[]= -{ - {0xff, 0x00}, - {0x7c, 0x00}, - {0x7d, 0x04}, - {0x7c, 0x07}, - {0x7d, 0x20}, - {0x7d, 0x14}, - {0x7d, 0x40}, - {0x7d, 0x06}, - {0x0, 0x0} //end flag -}; - -static struct reginfo sensor_Contrast2[]= -{ - {0xff, 0x00}, - {0x7c, 0x00}, - {0x7d, 0x04}, - {0x7c, 0x07}, - {0x7d, 0x20}, - {0x7d, 0x18}, - {0x7d, 0x34}, - {0x7d, 0x06}, - {0x0, 0x0} //end flag -}; - -static struct reginfo sensor_Contrast3[]= -{ - {0xff, 0x00}, - {0x7c, 0x00}, - {0x7d, 0x04}, - {0x7c, 0x07}, - {0x7d, 0x20}, - {0x7d, 0x1c}, - {0x7d, 0x2a}, - {0x7d, 0x06}, - {0x0, 0x0} //end flag -}; - -static struct reginfo sensor_Contrast4[]= -{ - {0xff,0x00}, - {0x7c,0x00}, - {0x7d,0x04}, - {0x7c,0x07}, - {0x7d,0x20}, - {0x7d,0x24}, - {0x7d,0x16}, - {0x7d,0x06}, - {0x0, 0x0} //end flag -}; - - -static struct reginfo sensor_Contrast5[]= -{ - {0xff, 0x00}, - {0x7c, 0x00}, - {0x7d, 0x04}, - {0x7c, 0x07}, - {0x7d, 0x20}, - {0x7d, 0x20}, - {0x7d, 0x20}, - {0x7d, 0x06}, - {0x0, 0x0} //end flag -}; - -static struct reginfo sensor_Contrast6[]= -{ - {0xff, 0x00}, - {0x7c, 0x00}, - {0x7d, 0x04}, - {0x7c, 0x07}, - {0x7d, 0x20}, - {0x7d, 0x24}, - {0x7d, 0x16}, - {0x7d, 0x06}, - {0x0, 0x0} //end flag -}; - - -static struct reginfo sensor_Contrast7[]= -{ - {0xff, 0x00}, - {0x7c, 0x00}, - {0x7d, 0x04}, - {0x7c, 0x07}, - {0x7d, 0x20}, - {0x7d, 0x28}, - {0x7d, 0x0c}, - {0x7d, 0x06}, - {0x0, 0x0} //end flag -}; - -static struct reginfo sensor_Contrast8[]= -{ - {0xff, 0x00}, - {0x7c, 0x00}, - {0x7d, 0x04}, - {0x7c, 0x07}, - {0x7d, 0x20}, - {0x7d, 0x2c}, - {0x7d, 0x02}, - {0x7d, 0x06}, - {0x0, 0x0} //end flag -}; - -static struct reginfo sensor_Contrast9[]= -{ - {0xff, 0x00}, - {0x7c, 0x00}, - {0x7d, 0x04}, - {0x7c, 0x07}, - {0x7d, 0x20}, - {0x7d, 0x30}, - {0x7d, 0x08}, - {0x7d, 0x0e}, - {0x0, 0x0} //end flag -}; - - - -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {0x0000, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {0x0000, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ -/* - {0xff, 0x00}, - {0xc7, 0x00}, - {0x00, 0x00}*/ -}; - -static struct reginfo sensor_SceneNight[] = -{ - /* - {0x3003, 0x80}, - {0x3004, 0x20}, - {0x3005, 0x18}, - {0x3006, 0x0d}, - {0x3a00, 0x7c}, - {0x3a02 ,0x07}, - {0x3a03 ,0x38}, - {0x3a14 ,0x07}, - {0x3a15 ,0x38}, - {0x0000, 0x00} - */ - /* - {0xff, 0x01}, - {0x11, 0x00}, - {0x0f, 0x4b}, - {0x03, 0xcf}, - {0x00, 0x00} -*/ -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom1[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom2[] = -{ - {0x0, 0x0}, -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {0x0, 0x0}, -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif -static const struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - unsigned int winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int funmodule_state; -} sensor_info_priv_t; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} -static int sensor_write(struct i2c_client *client, u8 reg, u8 val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[1]; - - buf[0] = reg & 0xFF; - buf[1] = val; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-->0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) -{ - int err,cnt; - u8 buf[1]; - struct i2c_msg msg[2]; - - buf[0] = reg ;//>> 8; - // buf[1] = 0; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2;//0x55; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-->0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - while (regarray[i].reg != 0) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - i++; - } - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != 0) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_power_end: - return ret; -} - -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} - -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - char value; - int ret,pid = 0; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - ret = sensor_write(client, 0xff, 1); - ret |= sensor_write(client, 0x12, 0x80); - if (ret != 0) - { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); //delay 5 microseconds - /* check if it is an sensor sensor */ - ret = sensor_write(client, 0xff, 1); - ret |= sensor_read(client, 0x0a, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid = value << 8; - ret = sensor_read(client, 0x0b, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value & 0xff); - - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if ((pid == SENSOR_ID)||(pid == SENSOR_ID1)) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - sensor->info_priv.winseqe_cur_addr = (int)SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} - -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - - struct sensor *sensor = to_sensor(client); - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ -#if 0 - sensor_task_lock(client, 1); - sensor_write(client, 0x3000, reg_val&0xfc); - sensor_write(client, 0x3001, 0x00); - sensor_task_lock(client, 0); -#endif - sensor_ioctrl(icd, Sensor_PowerDown, 1); - msleep(100); - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - - return 0; -} - -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - - return 0; - -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - const struct v4l2_queryctrl *qctrl; - struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - int ret=0, set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - winseqe_set_addr = sensor_svga; - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1024) && (set_h <= 768)) && sensor_xga[0].reg) - { - winseqe_set_addr = sensor_xga; - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - winseqe_set_addr = sensor_sxga; - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && sensor_uxga[0].reg) - { - winseqe_set_addr = sensor_uxga; - set_w = 1600; - set_h = 1200; - } - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) { - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - } else { /* ddl@rock-chips.com : Video */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - } - #endif - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - - sensor->info_priv.winseqe_cur_addr = (int)winseqe_set_addr; - - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - #if CONFIG_SENSOR_Effect - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - #endif - #if CONFIG_SENSOR_WhiteBalance - if (sensor->info_priv.whiteBalance != 0) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - #endif - sensor->info_priv.snap2preview = true; - } else if (sensor_fmt_videochk(sd,mf) == true) { /* ddl@rock-chips.com : Video */ - #if CONFIG_SENSOR_Effect - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - #endif - #if CONFIG_SENSOR_WhiteBalance - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - #endif - sensor->info_priv.video2preview = true; - } else if ((sensor->info_priv.snap2preview == true) || (sensor->info_priv.video2preview == true)) { - #if CONFIG_SENSOR_Effect - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - #endif - #if CONFIG_SENSOR_WhiteBalance - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - #endif - sensor->info_priv.video2preview = false; - sensor->info_priv.snap2preview = false; - } - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; - -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1024) && (set_h <= 768)) && sensor_xga[0].reg) - { - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && sensor_uxga[0].reg) - { - set_w = 1600; - set_h = 1200; - } - else - { - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - - mf->width = set_w; - mf->height = set_h; - - mf->colorspace = fmt->colorspace; - - return ret; -} - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV2655 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value > 0) && ((digitalzoom_cur + value) > digitalzoom_total)) - { - value = digitalzoom_total - digitalzoom_cur; - } - - if ((value < 0) && ((digitalzoom_cur + value) < 0)) - { - value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char value; - int ret,pid = 0; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - - /* soft reset */ - ret = sensor_write(client, 0xff, 0x1); - if (ret != 0) { - SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - mdelay(5); //delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x0a, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - pid = value << 8; - - ret = sensor_read(client, 0x0b, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - - if ((pid == SENSOR_ID)||(pid == SENSOR_ID1)) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - - return ret; -} - -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0,i; - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - sensor->sensor_gpio_res = NULL; - for (i=0; isensor_io_request->gpio_res[i].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[i].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[i]; - } - } - if (sensor->sensor_gpio_res == NULL) { - SENSOR_TR("%s %s obtain gpio resource failed when RK29_CAM_SUBDEV_IOREQUEST \n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } - -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - sensor->info_priv.fmt = sensor_colour_fmts[0]; - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); diff --git a/drivers/media/video/ov2655.c b/drivers/media/video/ov2655.c deleted file mode 100755 index 424e26e00969..000000000000 --- a/drivers/media/video/ov2655.c +++ /dev/null @@ -1,3290 +0,0 @@ -/* -o* Driver for MT9M001 CMOS Image Sensor from Micron - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -static int debug ; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_OV2655 -#define SENSOR_V4L2_IDENT V4L2_IDENT_OV2655 -#define SENSOR_ID 0x2656 -#define SENSOR_MIN_WIDTH 176 -#define SENSOR_MIN_HEIGHT 144 -#define SENSOR_MAX_WIDTH 1600 -#define SENSOR_MAX_HEIGHT 1200 -#define SENSOR_INIT_WIDTH sensor_init_width /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT sensor_init_height -#define SENSOR_INIT_WINSEQADR sensor_init_winseq_p -#define SENSOR_INIT_PIXFMT sensor_init_pixelcode -#define SENSOR_BUS_PARAM sensor_init_busparam - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 1 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 1 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 - -#define CONFIG_SENSOR_I2C_SPEED 350000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) -struct reginfo -{ - u16 reg; - u8 val; -}; - - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); - -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_OV2655_USER_DEFINED_SERIES -#include "ov2655_user_series.c" -#else - -/* init 352X288 SVGA */ -static struct reginfo sensor_init_data[] = -{ - {0x308c, 0x80}, - {0x308d, 0x0e}, - {0x360b, 0x00}, - {0x30b0, 0xff}, - {0x30b1, 0xff}, - {0x30b2, 0x24}, - - {0x300e, 0x34}, - {0x300f, 0xa6}, - {0x3010, 0x81}, - {0x3082, 0x01}, - {0x30f4, 0x01}, - {0x3090, 0x33},//0x3b}, - {0x3091, 0xc0}, - {0x30ac, 0x42}, - - {0x30d1, 0x08}, - {0x30a8, 0x56}, - {0x3015, 0x03}, - {0x3093, 0x00}, - {0x307e, 0xe5}, - {0x3079, 0x00}, - {0x30aa, 0x42}, - {0x3017, 0x40}, - {0x30f3, 0x82}, - {0x306a, 0x0c}, - {0x306d, 0x00}, - {0x336a, 0x3c}, - {0x3076, 0x6a}, - {0x30d9, 0x8c}, - {0x3016, 0x82}, - {0x3601, 0x30}, - {0x304e, 0x88}, - {0x30f1, 0x82}, - {0x306f, 0x14}, - - {0x3012, 0x10}, - {0x3011, 0x01}, - {0x302a, 0x02}, - {0x302b, 0xE6}, - {0x3028, 0x07}, - {0x3029, 0x93}, - - {0x3391, 0x06}, - {0x3394, 0x38}, - {0x3395, 0x38}, - - {0x3015, 0x02}, - {0x302d, 0x00}, - {0x302e, 0x00}, - - {0x3013, 0xf7}, - {0x3018, 0x80}, - {0x3019, 0x70}, - {0x301a, 0xd4}, - - {0x30af, 0x00}, - {0x3048, 0x1f}, - {0x3049, 0x4e}, - {0x304a, 0x20}, - {0x304f, 0x20}, - {0x304b, 0x02}, - {0x304c, 0x00}, - {0x304d, 0x02}, - {0x304f, 0x20}, - {0x30a3, 0x10}, - {0x3013, 0xf7}, - {0x3014, 0x84}, - {0x3071, 0x00}, - {0x3070, 0x5d}, - {0x3073, 0x00}, - {0x3072, 0x5d}, - {0x301c, 0x07}, - {0x301d, 0x07}, - {0x304d, 0x42}, - {0x304a, 0x40}, - {0x304f, 0x40}, - {0x3095, 0x07}, - {0x3096, 0x16}, - {0x3097, 0x1d}, - - {0x3020, 0x01}, - {0x3021, 0x18}, - {0x3022, 0x00}, - {0x3023, 0x06}, - {0x3024, 0x06}, - {0x3025, 0x58}, - {0x3026, 0x02}, - {0x3027, 0x61}, - {0x3088, 0x02},//{0x3088, 0x01}, - {0x3089, 0x88},//{0x3089, 0x68}, - {0x308A, 0x01},//{0x308a, 0x01}, - {0x308B, 0xe0},//{0x308b, 0x20}, - - {0x3316, 0x64}, - {0x3317, 0x25}, - {0x3318, 0x80}, - {0x3319, 0x08}, - - {0x331A, 0x28},//{0x331a, 0x16}, - {0x331B, 0x1e},//{0x331b, 0x12}, - {0x331c, 0x08}, - {0x331d, 0x38}, - {0x3100, 0x00}, - - {0x3320, 0xfa}, - {0x3321, 0x11}, - {0x3322, 0x92}, - {0x3323, 0x01}, - {0x3324, 0x97}, - {0x3325, 0x02}, - {0x3326, 0xff}, - {0x3327, 0x0c}, - {0x3328, 0x10}, - {0x3329, 0x10}, - {0x332a, 0x58}, - {0x332b, 0x56}, - {0x332c, 0xbe}, - {0x332d, 0xe1}, - {0x332e, 0x3a}, - {0x332f, 0x36}, - {0x3330, 0x4d}, - {0x3331, 0x44}, - {0x3332, 0xf8}, - {0x3333, 0x0a}, - {0x3334, 0xf0}, - {0x3335, 0xf0}, - {0x3336, 0xf0}, - {0x3337, 0x40}, - {0x3338, 0x40}, - {0x3339, 0x40}, - {0x333a, 0x00}, - {0x333b, 0x00}, - - {0x3380, 0x28}, - {0x3381, 0x48}, - {0x3382, 0x10}, - {0x3383, 0x22}, - {0x3384, 0xc0}, - {0x3385, 0xe2}, - {0x3386, 0xe2}, - {0x3387, 0xf2}, - {0x3388, 0x10}, - {0x3389, 0x98}, - {0x338a, 0x00}, - - {0x3340, 0x04}, - {0x3341, 0x07}, - {0x3342, 0x19}, - {0x3343, 0x34}, - {0x3344, 0x4a}, - {0x3345, 0x5a}, - {0x3346, 0x67}, - {0x3347, 0x71}, - {0x3348, 0x7c}, - {0x3349, 0x8c}, - {0x334a, 0x9b}, - {0x334b, 0xa9}, - {0x334c, 0xc0}, - {0x334d, 0xd5}, - {0x334e, 0xe8}, - {0x334f, 0x20}, - - {0x3350, 0x37},//0x33}, - {0x3351, 0x27},//0x28}, - {0x3352, 0x00}, - {0x3353, 0x16}, - {0x3354, 0x00}, - {0x3355, 0x85}, - {0x3356, 0x35}, - {0x3357, 0x28}, - {0x3358, 0x00}, - {0x3359, 0x13}, - {0x335a, 0x00}, - {0x335b, 0x85}, - {0x335c, 0x37},//0x34}, - {0x335d, 0x28}, - {0x335e, 0x00}, - {0x335f, 0x13}, - {0x3360, 0x00}, - {0x3361, 0x85}, - {0x3363, 0x70}, - {0x3364, 0x7f}, - {0x3365, 0x00}, - {0x3366, 0x00}, - {0x3362, 0x90}, - - {0x3301, 0xff}, - {0x338B, 0x11}, - {0x338c, 0x10}, - {0x338d, 0x40}, - - {0x3370, 0xd0}, - {0x3371, 0x00}, - {0x3372, 0x00}, - {0x3373, 0x30}, - {0x3374, 0x10}, - {0x3375, 0x10}, - {0x3376, 0x04}, - {0x3377, 0x00}, - {0x3378, 0x04}, - {0x3379, 0x80}, - - {0x3069, 0x84}, - {0x307c, 0x10},//0x13}, - {0x3087, 0x02}, - - {0x3300, 0xfc}, - {0x3302, 0x11}, - {0x3400, 0x02}, - {0x3606, 0x20}, - {0x3601, 0x30}, - {0x30f3, 0x83}, - {0x304e, 0x88}, - - {0x30aa, 0x72}, - {0x30a3, 0x80}, - {0x30a1, 0x41}, - - {0x3086, 0x0f}, - {0x3086, 0x00}, - - {0x0, 0x0} //end flag - -}; -static struct reginfo sensor_720p[]= -{ - {0x0, 0x0} //end flag -}; -/* 1600X1200 UXGA */ -static struct reginfo sensor_uxga[] = -{ - - {0x300E, 0x34}, - {0x3011, 0x01}, - {0x3012, 0x00}, - {0x302a, 0x05}, - {0x302b, 0xCB}, - {0x306f, 0x54}, - {0x3362, 0x80}, - - {0x3070, 0x5d}, - {0x3072, 0x5d}, - {0x301c, 0x0f}, - {0x301d, 0x0f}, - - {0x3020, 0x01}, - {0x3021, 0x18}, - {0x3022, 0x00}, - {0x3023, 0x0A}, - {0x3024, 0x06}, - {0x3025, 0x58}, - {0x3026, 0x04}, - {0x3027, 0xbc}, - {0x3088, 0x06}, - {0x3089, 0x40}, - {0x308A, 0x04}, - {0x308B, 0xB0}, - {0x3316, 0x64}, - {0x3317, 0x4B}, - {0x3318, 0x00}, - {0x3319, 0x6C}, - {0x331A, 0x64}, - {0x331B, 0x4B}, - {0x331C, 0x00}, - {0x331D, 0x6C}, - {0x3302, 0x01}, - - {0x0, 0x0}, -}; - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ -#if 1 - // {0x3086,0x01}, //sleep on - {0x300E, 0x34}, - {0x3011, 0x00}, - {0x3012, 0x00}, - {0x302a, 0x05}, - {0x302b, 0xCB}, - {0x306f, 0x54}, - {0x3362, 0x80}, - - {0x3070, 0x5d}, - {0x3072, 0x5d}, - {0x301c, 0x0f}, - {0x301d, 0x0f}, - - {0x3020, 0x01}, - {0x3021, 0x18}, - {0x3022, 0x00}, - {0x3023, 0x0A}, - {0x3024, 0x06}, - {0x3025, 0x58}, - {0x3026, 0x04}, - {0x3027, 0xbc}, - {0x3088, 0x05}, - {0x3089, 0x00}, - {0x308A, 0x04}, - {0x308B, 0x00}, - {0x3316, 0x64}, - {0x3317, 0x4B}, - {0x3318, 0x00}, - {0x3319, 0x6C}, - {0x331A, 0x50}, - {0x331B, 0x40}, - {0x331C, 0x00}, - {0x331D, 0x6C}, - {0x3302, 0x11}, - // {0x3086,0x00}, //sleep off -#endif - {0x0, 0x0}, -}; -static struct reginfo sensor_xga[] = -{ - {0x0, 0x0} -}; -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - // {0x3086,0x01}, //sleep on - {0x300E, 0x34}, - {0x3011, 0x01}, - {0x3012, 0x10}, - {0x302a, 0x02}, - {0x302b, 0xE6}, - {0x306f, 0x14}, - {0x3362, 0x90}, - - {0x3070, 0x5d}, - {0x3072, 0x5d}, - {0x301c, 0x07}, - {0x301d, 0x07}, - - {0x3020, 0x01}, - {0x3021, 0x18}, - {0x3022, 0x00}, - {0x3023, 0x06}, - {0x3024, 0x06}, - {0x3025, 0x58}, - {0x3026, 0x02}, - {0x3027, 0x5E}, - {0x3088, 0x03}, - {0x3089, 0x20}, - {0x308A, 0x02}, - {0x308B, 0x58}, - {0x3316, 0x64}, - {0x3317, 0x25}, - {0x3318, 0x80}, - {0x3319, 0x08}, - {0x331A, 0x64}, - {0x331B, 0x4B}, - {0x331C, 0x00}, - {0x331D, 0x38}, - {0x3302, 0x11}, - // {0x3086,0x00}, //sleep off - {0x0, 0x0}, -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - // {0x3086,0x00}, //sleep off - {0x300E, 0x34}, - {0x3011, 0x01}, - {0x3012, 0x10}, - {0x302a, 0x02}, - {0x302b, 0xE6}, - {0x306f, 0x14}, - {0x3362, 0x90}, - - {0x3070, 0x5D}, - {0x3072, 0x5D}, - {0x301c, 0x07}, - {0x301d, 0x07}, - - {0x3020, 0x01}, - {0x3021, 0x18}, - {0x3022, 0x00}, - {0x3023, 0x06}, - {0x3024, 0x06}, - {0x3025, 0x58}, - {0x3026, 0x02}, - {0x3027, 0x61}, - {0x3088, 0x02}, - {0x3089, 0x88}, - {0x308A, 0x01}, - {0x308B, 0xe0}, - {0x3316, 0x64}, - {0x3317, 0x25}, - {0x3318, 0x80}, - {0x3319, 0x08}, - {0x331A, 0x28}, - {0x331B, 0x1e}, - {0x331C, 0x08}, - {0x331D, 0x38}, - {0x3302, 0x11}, -// {0x3086,0x01}, //sleep on - {0x0, 0x0}, -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {0x300E, 0x34}, - {0x3011, 0x01}, - {0x3012, 0x10}, - {0x302a, 0x02}, - {0x302b, 0xE6}, - {0x306f, 0x14}, - {0x3362, 0x90}, - {0x3070, 0x5d}, - {0x3072, 0x5d}, - {0x301c, 0x07}, - {0x301d, 0x07}, - {0x3020, 0x01}, - {0x3021, 0x18}, - {0x3022, 0x00}, - {0x3023, 0x06}, - { 0x3024, 0x06}, - {0x3025, 0x58}, - {0x3026, 0x02}, - {0x3027, 0x61}, - {0x3088, 0x01}, - {0x3089, 0x68}, - {0x308a, 0x01}, - {0x308b, 0x20}, - {0x3316, 0x64}, - {0x3317, 0x25}, - {0x3318, 0x80}, - {0x3319, 0x08}, - {0x331a, 0x16}, - {0x331b, 0x12}, - {0x331c, 0x08}, - {0x331d, 0x38}, - {0x3100, 0x00}, - {0x3302, 0x11}, - - {0x0, 0x0}, -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - {0x300E, 0x34}, - {0x3011, 0x01}, - {0x3012, 0x10}, - {0x302a, 0x02}, - {0x302b, 0xE6}, - {0x306f, 0x14}, - {0x3362, 0x90}, - - {0x3070, 0x5D}, - {0x3072, 0x5D}, - {0x301c, 0x07}, - {0x301d, 0x07}, - - {0x3020, 0x01}, - {0x3021, 0x18}, - {0x3022, 0x00}, - {0x3023, 0x06}, - {0x3024, 0x06}, - {0x3025, 0x58}, - {0x3026, 0x02}, - {0x3027, 0x61}, - {0x3088, 0x01}, - {0x3089, 0x40}, - {0x308A, 0x00}, - {0x308B, 0xf0}, - {0x3316, 0x64}, - {0x3317, 0x25}, - {0x3318, 0x80}, - {0x3319, 0x08}, - {0x331A, 0x14}, - {0x331B, 0x0f}, - {0x331C, 0x00}, - {0x331D, 0x38}, - {0x3302, 0x11}, - - {0x0, 0x0}, -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {0x300E, 0x34}, - {0x3011, 0x01}, - {0x3012, 0x10}, - {0x302a, 0x02}, - {0x302b, 0xE6}, - {0x306f, 0x14}, - {0x3362, 0x90}, - {0x3070, 0x5d}, - {0x3072, 0x5d}, - {0x301c, 0x07}, - {0x301d, 0x07}, - {0x3020, 0x01}, - {0x3021, 0x18}, - {0x3022, 0x00}, - {0x3023, 0x06}, - {0x3024, 0x06}, - {0x3025, 0x58}, - {0x3026, 0x02}, - {0x3027, 0x61}, - {0x3088, 0x00}, - {0x3089, 0xb8}, - {0x308a, 0x00}, - {0x308b, 0x90}, - {0x3316, 0x64}, - {0x3317, 0x25}, - {0x3318, 0x80}, - {0x3319, 0x08}, - {0x331a, 0x16}, - {0x331b, 0x12}, - {0x331c, 0x08}, - {0x331d, 0x38}, - {0x3100, 0x00}, - {0x3302, 0x11}, - - {0x0, 0x0}, -}; -#endif -#if 0 -/* 160X120 QQVGA*/ -static struct reginfo ov2655_qqvga[] = -{ - - {0x300E, 0x34}, - {0x3011, 0x01}, - {0x3012, 0x10}, - {0x302a, 0x02}, - {0x302b, 0xE6}, - {0x306f, 0x14}, - {0x3362, 0x90}, - - {0x3070, 0x5d}, - {0x3072, 0x5d}, - {0x301c, 0x07}, - {0x301d, 0x07}, - - {0x3020, 0x01}, - {0x3021, 0x18}, - {0x3022, 0x00}, - {0x3023, 0x06}, - {0x3024, 0x06}, - {0x3025, 0x58}, - {0x3026, 0x02}, - {0x3027, 0x61}, - {0x3088, 0x00}, - {0x3089, 0xa0}, - {0x308a, 0x00}, - {0x308b, 0x78}, - {0x3316, 0x64}, - {0x3317, 0x25}, - {0x3318, 0x80}, - {0x3319, 0x08}, - {0x331a, 0x0a}, - {0x331b, 0x07}, - {0x331c, 0x80}, - {0x331d, 0x38}, - {0x3100, 0x00}, - {0x3302, 0x11}, - - {0x0, 0x0}, -}; - - - -static struct reginfo ov2655_Sharpness_auto[] = -{ - {0x3306, 0x00}, -}; - -static struct reginfo ov2655_Sharpness1[] = -{ - {0x3306, 0x08}, - {0x3371, 0x00}, -}; - -static struct reginfo ov2655_Sharpness2[][3] = -{ - //Sharpness 2 - {0x3306, 0x08}, - {0x3371, 0x01}, -}; - -static struct reginfo ov2655_Sharpness3[] = -{ - //default - {0x3306, 0x08}, - {0x332d, 0x02}, -}; -static struct reginfo ov2655_Sharpness4[]= -{ - //Sharpness 4 - {0x3306, 0x08}, - {0x332d, 0x03}, -}; - -static struct reginfo ov2655_Sharpness5[] = -{ - //Sharpness 5 - {0x3306, 0x08}, - {0x332d, 0x04}, -}; -#endif - -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {0x3400, 0x00}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {0x3400, 0x02}, - {0x0000, 0x00} -}; - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0x3306, 0x00}, //AWB auto, bit[1]:0,auto - {0x0000, 0x00} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0x3306, 0x82}, - {0x3337, 0x68}, - {0x3338, 0x40}, - {0x3339, 0x4e}, - {0x0000, 0x00} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x3306, 0x02}, //AWB off - {0x3337, 0x5e}, - {0x3338, 0x40}, - {0x3339, 0x46}, - {0x0000, 0x00} -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0x3306, 0x02}, - {0x3337, 0x52}, - {0x3338, 0x40}, - {0x3339, 0x58}, - {0x0000, 0x00} - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x3306, 0x02}, - {0x3337, 0x44}, - {0x3338, 0x40}, - {0x3339, 0x70}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - // Brightness -2 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x49}, - {0x339a, 0x20}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness1[]= -{ - // Brightness -1 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x49}, - {0x339a, 0x10}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - // Brightness 0 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x00}, - {0x3390, 0x41}, - {0x339a, 0x00}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - // Brightness +1 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x41}, - {0x339a, 0x10}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - // Brightness +2 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x41}, - {0x339a, 0x20}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - // Brightness +3 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, //bit[2] enable - {0x3390, 0x41}, //bit[3] sign of brightness - {0x339a, 0x30}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x3391, 0x00}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {0x3391, 0x20}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x3391, 0x18}, - {0x3396, 0x40}, - {0x3397, 0xa6}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - //Negative - {0x3391, 0x40}, //bit[6] negative - {0x0000, 0x00} -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - // Bluish - {0x3391, 0x18}, - {0x3396, 0xa0}, - {0x3397, 0x40}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish - {0x3391, 0x18}, - {0x3396, 0x60}, - {0x3397, 0x60}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - //-3 - {0x3047, 0x05}, - {0x3018, 0x40}, - {0x3019, 0x30}, - {0x301a, 0x71}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure1[]= -{ - //-2 - {0x3047, 0x05}, - {0x3018, 0x5a}, - {0x3019, 0x4a}, - {0x301a, 0xc2}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - //-0.3EV - {0x3047, 0x05}, - {0x3018, 0x6a}, - {0x3019, 0x5a}, - {0x301a, 0xd4}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - //default - {0x3047, 0x05}, - {0x3018, 0x78}, - {0x3019, 0x68}, - {0x301a, 0xd4}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - // 1 - {0x3047, 0x05}, - {0x3018, 0x88}, - {0x3019, 0x78}, - {0x301a, 0xd5}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - // 2 - {0x3047, 0x05}, - {0x3018, 0xa8}, - {0x3019, 0x98}, - {0x301a, 0xe6}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - // 3 - {0x3047, 0x05}, - {0x3018, 0xc8}, - {0x3019, 0xb8}, - {0x301a, 0xf7}, - {0x0000, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x02}, - {0x3394, 0x40}, - {0x3395, 0x40}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x02}, - {0x3394, 0x50}, - {0x3395, 0x50}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x02}, //enable color saturation - {0x3394, 0x70}, - {0x3395, 0x70}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - //Contrast -3 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x45}, - {0x3398, 0x18}, - {0x3399, 0x18}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - //Contrast -2 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x45}, - {0x3398, 0x18}, - {0x3399, 0x18}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast2[]= -{ - // Contrast -1 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x45}, - {0x3398, 0x1c}, - {0x3399, 0x1c}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - //Contrast 0 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x00}, - {0x3390, 0x41}, - {0x3398, 0x20}, - {0x3399, 0x20}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - //Contrast +1 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x45}, - {0x3398, 0x24}, - {0x3399, 0x24}, - {0x0000, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - //Contrast +2 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x45}, - {0x3398, 0x28}, - {0x3399, 0x28}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - //Contrast +3 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, //bit[2] enable contrast/brightness - {0x3390, 0x45}, //bit[2] Yoffset sign - {0x3398, 0x2c}, - {0x3399, 0x2c}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {0x3069, 0x84}, - {0x307c, 0x13}, - {0x3087, 0x02}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {0x3069, 0x84}, - {0x307c, 0x10}, - {0x3087, 0x02}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {0x300e, 0x34}, - {0x300f, 0xa6}, - {0x3010, 0x81}, - {0x3082, 0x01}, - {0x30f4, 0x01}, - {0x3090, 0x3b}, - {0x3091, 0xc0}, - {0x30ac, 0x42}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {0x300e, 0x34}, - {0x300f, 0xa6}, - {0x3010, 0x81}, - {0x3082, 0x01}, - {0x30f4, 0x01}, - {0x3090, 0x33}, - {0x3091, 0xc0}, - {0x30ac, 0x42}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ -#if 0 /* ddl@rock-chips.com : */ - {0x3014, 0x04}, - {0x3015, 0x00}, - {0x302e, 0x00}, - {0x302d, 0x00}, - {0x0000, 0x00} -#else - {0x3014, 0x84}, - {0x3015, 0x02}, - {0x302e, 0x00}, - {0x302d, 0x00}, - {0x0000, 0x00} -#endif -}; - -static struct reginfo sensor_SceneNight[] = -{ -#if 0 - //30fps ~ 5fps night mode for 60/50Hz light environment, 24Mhz clock input,36Mzh pclk - {0x300e, 0x34}, - {0x3011, 0x00}, - {0x302c, 0x00}, - {0x3071, 0x00}, - {0x3070, 0xb9}, - {0x301c, 0x02}, - {0x3073, 0x00}, - {0x3072, 0x9a}, - {0x301d, 0x03}, - {0x3014, 0x0c}, - {0x3015, 0x50},//add 5 dummy frame - {0x302e, 0x00}, - {0x302d, 0x00}, - {0x0000, 0x00} -#elif 0 - //15fps ~ 5fps night mode for 60/50Hz light environment, 24Mhz clock input,18Mhz pclk - {0x300e, 0x34}, - {0x3011, 0x01}, - {0x302c, 0x00}, - {0x3071, 0x00}, - {0x3070, 0x5d}, - {0x301c, 0x05}, - {0x3073, 0x00}, - {0x3072, 0x4d}, - {0x301d, 0x07}, - {0x3014, 0x0c}, - {0x3015, 0x50}, - {0x302e, 0x00}, - {0x302d, 0x00}, -#elif 1 -// the fixed fps, RK30 CIF can't receive data correctly when taking pic frequently in scene night mode of -// auto fps . Now use this series temporarily until fix the cif bug,zyc - {0x300e, 0x34}, - {0x3011, 0x05}, - {0x302c, 0x00}, - {0x3071, 0x00}, - {0x3070, 0x31}, - {0x301c, 0x13}, - {0x3073, 0x00}, - {0x3072, 0x1a}, - {0x301d, 0x17}, -#endif -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom1[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom2[] = -{ - {0x0, 0x0}, -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {0x0, 0x0}, -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif -static struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - unsigned int winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int funmodule_state; -} sensor_info_priv_t; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, u16 reg, u8 val) -{ - int err,cnt; - u8 buf[3]; - struct i2c_msg msg[1]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - buf[2] = val; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u16 reg, u8 *val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[2]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - while (regarray[i].reg != 0) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - i++; - } - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != 0) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif - -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_power_end: - return ret; -} - -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} - -static s32 sensor_init_width = 640; -static s32 sensor_init_height = 480; -static unsigned long sensor_init_busparam = (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING|SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW |SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ); -static enum v4l2_mbus_pixelcode sensor_init_pixelcode = V4L2_MBUS_FMT_YUYV8_2X8; -static struct reginfo* sensor_init_data_p = sensor_init_data; -static struct reginfo* sensor_init_winseq_p = sensor_vga; -static struct reginfo* sensor_init_winseq_board = NULL; -static struct reginfo* sensor_init_data_board = NULL; -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - char value; - int ret,pid = 0,i = 0,j=0,tmp_winseq_size; - struct rk29camera_platform_data* tmp_plat_data =sensor->sensor_io_request; - - sensor_init_data_p = sensor_init_data; - sensor_init_winseq_p = sensor_vga; - sensor_init_width = 640; - sensor_init_height = 480; - - if (tmp_plat_data != NULL) { - for(i = 0;i < RK_CAM_NUM;i++){ - if ((tmp_plat_data->sensor_init_data[i])&& tmp_plat_data->info[i].dev_name && - (strcmp(tmp_plat_data->info[i].dev_name, dev_name(icd->pdev)) == 0)) { - break; - } - - } - } - if(tmp_plat_data &&(i < RK_CAM_NUM) && tmp_plat_data->sensor_init_data[i]){ - //user has defined the init data - //init reg - int tmp_init_data_size = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_data_size; - if(tmp_init_data_size > 2){//init data is valid - if((sizeof(struct reginfo) != sizeof(struct reginfo_t))){ - if(sensor_init_data_board) { - vfree(sensor_init_data_board); - sensor_init_data_board = NULL; - } - sensor_init_data_board = (struct reginfo*)vmalloc(tmp_init_data_size); - if(!sensor_init_data_board) - SENSOR_TR("%s :vmalloc init data erro !",__FUNCTION__); - for(j = 0;j< tmp_init_data_size;j++) { - sensor_init_data_board[j].reg = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_data[j].reg; - sensor_init_data_board[j].val = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_data[j].val; - } - sensor_init_data_p = sensor_init_data_board; - } else{ - sensor_init_data_p = (struct reginfo*)(tmp_plat_data->sensor_init_data[i]->rk_sensor_init_data); - } - } - //init winseq - tmp_winseq_size = tmp_plat_data->sensor_init_data[i]->rk_sensor_winseq_size; - if(tmp_winseq_size > 2){ - if(sizeof(struct reginfo) != sizeof(struct reginfo_t)){ - if(sensor_init_winseq_board) { - vfree(sensor_init_winseq_board); - sensor_init_winseq_board = NULL; - } - sensor_init_winseq_board = (struct reginfo*)vmalloc(tmp_winseq_size); - if(!sensor_init_winseq_board) - SENSOR_TR("%s :vmalloc erro !",__FUNCTION__); - for(j = 0;j< tmp_winseq_size;j++){ - sensor_init_winseq_board[j].reg = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_winseq[j].reg; - sensor_init_winseq_board[j].val = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_winseq[j].val; - } - sensor_init_winseq_p = sensor_init_winseq_board; - } else{ - sensor_init_winseq_p = (struct reginfo*)(tmp_plat_data->sensor_init_data[i]->rk_sensor_init_winseq); - } - } - //init width,height,bus,pixelcode - if(tmp_plat_data->sensor_init_data[i]->rk_sensor_init_width != INVALID_VALUE) - sensor_init_width = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_width; - if(tmp_plat_data->sensor_init_data[i]->rk_sensor_init_height != INVALID_VALUE) - sensor_init_height = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_height; - if(tmp_plat_data->sensor_init_data[i]->rk_sensor_init_bus_param != INVALID_VALUE) - sensor_init_busparam = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_bus_param; - if(tmp_plat_data->sensor_init_data[i]->rk_sensor_init_pixelcode != INVALID_VALUE) - sensor_init_pixelcode = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_pixelcode; - } - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - sensor_write(client, 0x300F, 0xAE); - mdelay(5); - sensor_write(client, 0x300F, 0xAE); - mdelay(5); - ret = sensor_write(client, 0x3012, 0x80); - if (ret != 0) - { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); //delay 5 microseconds - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x300a, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value << 8); - - ret = sensor_read(client, 0x300b, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - ret = sensor_write_array(client, sensor_init_data_p); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - sensor->info_priv.winseqe_cur_addr = (int)SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} - -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - if (sensor->info_priv.funmodule_state & SENSOR_INIT_IS_OK) { - sensor_task_lock(client, 1); - sensor_write(client, 0x30b0, 0x00); - sensor_write(client, 0x30b1, 0x00); - sensor_task_lock(client, 0); - } - sensor_ioctrl(icd, Sensor_PowerDown, 1); - msleep(100); - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - - return 0; -} - -static struct reginfo sensor_power_down_sequence[]= -{ - {0x30ab, 0x00}, - {0x30ad, 0x0a}, - {0x30ae,0x27}, - {0x363b,0x01}, - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - - return 0; - -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - int ret=0, set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - winseqe_set_addr = sensor_svga; - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 720)) && sensor_720p[0].reg) - { - winseqe_set_addr = sensor_720p; - set_w = 1280; - set_h = 720; - } - else if (((set_w <= 1024) && (set_h <= 768)) && sensor_xga[0].reg) - { - winseqe_set_addr = sensor_xga; - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - winseqe_set_addr = sensor_sxga; - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && sensor_uxga[0].reg) - { - winseqe_set_addr = sensor_uxga; - set_w = 1600; - set_h = 1200; - } - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) { - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - } else { /* ddl@rock-chips.com : Video */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - } - #endif - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - - sensor->info_priv.winseqe_cur_addr = (int)winseqe_set_addr; - - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - if (sensor->info_priv.whiteBalance != 0) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - sensor->info_priv.snap2preview = true; - } else if (sensor_fmt_videochk(sd,mf) == true) { /* ddl@rock-chips.com : Video */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - sensor->info_priv.video2preview = true; - } else if ((sensor->info_priv.snap2preview == true) || (sensor->info_priv.video2preview == true)) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - msleep(600); - sensor->info_priv.video2preview = false; - sensor->info_priv.snap2preview = false; - } - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; - -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 720)) && sensor_720p[0].reg) - { - set_w = 1280; - set_h = 720; - } - else if (((set_w <= 1024) && (set_h <= 768)) && sensor_xga[0].reg) - { - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && sensor_uxga[0].reg) - { - set_w = 1600; - set_h = 1200; - } - else - { /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - - mf->width = set_w; - mf->height = set_h; - mf->colorspace = fmt->colorspace; - - return ret; -} - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV2655 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value > 0) && ((digitalzoom_cur + value) > digitalzoom_total)) - { - value = digitalzoom_total - digitalzoom_cur; - } - - if ((value < 0) && ((digitalzoom_cur + value) < 0)) - { - value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char value; - int ret,pid = 0; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - - /* soft reset */ - ret = sensor_write(client, 0x3012, 0x80); - if (ret != 0) - { - SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - mdelay(5); //delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x300a, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid |= (value << 8); - - ret = sensor_read(client, 0x300b, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - return ret; -} -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0; -#if CONFIG_SENSOR_Flash - int i; -#endif - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - int j = 0; - for(j = 0;j < RK_CAM_NUM;j++){ - if (sensor->sensor_io_request->gpio_res[j].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[j].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[j]; - break; - } - } - if(j == RK_CAM_NUM){ - SENSOR_TR("%s %s RK_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } - -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - sensor->info_priv.fmt = sensor_colour_fmts[0]; - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - diff --git a/drivers/media/video/ov2659.c b/drivers/media/video/ov2659.c deleted file mode 100644 index 305b61b74273..000000000000 --- a/drivers/media/video/ov2659.c +++ /dev/null @@ -1,1152 +0,0 @@ -/* - * drivers/media/video/ov2659.c - * - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "generic_sensor.h" -#include -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.1.1: -* add sensor_focus_af_const_pause_usr_cb; -*/ -static int version = KERNEL_VERSION(0,1,3); -module_param(version, int, S_IRUGO); - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) -#define debug_printk(format, ...) dprintk(1, format, ## __VA_ARGS__) -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_OV2659 -#define SENSOR_V4L2_IDENT V4L2_IDENT_OV2659 -#define SENSOR_ID 0x2656 -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_PCLK_SAMPLE_RISING|V4L2_MBUS_HSYNC_ACTIVE_HIGH| V4L2_MBUS_VSYNC_ACTIVE_LOW|\ - V4L2_MBUS_DATA_ACTIVE_HIGH |SOCAM_MCLK_24MHZ) -#define SENSOR_PREVIEW_W 800 -#define SENSOR_PREVIEW_H 600 -#define SENSOR_PREVIEW_FPS 15000 // 15fps -#define SENSOR_FULLRES_L_FPS 7500 // 7.5fps -#define SENSOR_FULLRES_H_FPS 7500 // 7.5fps -#define SENSOR_720P_FPS 0 -#define SENSOR_1080P_FPS 0 - -#define SENSOR_REGISTER_LEN 2 // sensor register address bytes -#define SENSOR_VALUE_LEN 1 // sensor register value bytes - -static unsigned int SensorConfiguration = (CFG_WhiteBalance|CFG_Effect|CFG_Scene); -static unsigned int SensorChipID[] = {SENSOR_ID}; -/* Sensor Driver Configuration End */ - - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a,b) CONS4(SensorReg,SENSOR_REGISTER_LEN,Val,SENSOR_VALUE_LEN)(a,b) -#define sensor_write(client,reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_read(client,reg,v) CONS4(sensor_read_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_write_array generic_sensor_write_array - -struct sensor_parameter -{ - unsigned int PreviewDummyPixels; - unsigned int CaptureDummyPixels; - unsigned int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int PreviewPclk; - unsigned short int CapturePclk; - char awb[6]; -}; - -struct specific_sensor{ - struct generic_sensor common_sensor; - //define user data below - struct sensor_parameter parameter; - -}; - -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ - -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_init_data[] ={ - {0x3000, 0x0f}, - {0x3001, 0xff}, - {0x3002, 0xff}, - //{0x0100, 0x01}, //software sleep : Sensor vsync singal may not output if haven't sleep the sensor when transfer the array - {0x3633, 0x3d}, - {0x3620, 0x02}, - {0x3631, 0x11}, - {0x3612, 0x04}, - {0x3630, 0x20}, - {0x4702, 0x02}, - {0x370c, 0x34}, - {0x3004, 0x10}, - {0x3005, 0x18}, - {0x3800, 0x00}, - {0x3801, 0x00}, - {0x3802, 0x00}, - {0x3803, 0x00}, - {0x3804, 0x06}, - {0x3805, 0x5f}, - {0x3806, 0x04}, - {0x3807, 0xb7}, - {0x3808, 0x03}, - {0x3809, 0x20}, - {0x380a, 0x02}, - {0x380b, 0x58}, - {0x380c, 0x05}, - {0x380d, 0x14}, - {0x380e, 0x02}, - {0x380f, 0x68}, - {0x3811, 0x08}, - {0x3813, 0x02}, - {0x3814, 0x31}, - {0x3815, 0x31}, - {0x3a02, 0x02}, - {0x3a03, 0x68}, - {0x3a08, 0x00}, - {0x3a09, 0x5c}, - {0x3a0a, 0x00}, - {0x3a0b, 0x4d}, - {0x3a0d, 0x08}, - {0x3a0e, 0x06}, - {0x3a14, 0x02}, - {0x3a15, 0x28}, - {0x4708, 0x01}, - {0x3623, 0x00}, - {0x3634, 0x76}, - {0x3701, 0x44}, - {0x3702, 0x18}, - {0x3703, 0x24}, - {0x3704, 0x24}, - {0x3705, 0x0c}, - {0x3820, 0x81}, - {0x3821, 0x01}, - {0x370a, 0x52}, - {0x4608, 0x00}, - {0x4609, 0x80}, - {0x4300, 0x32}, - {0x5086, 0x02}, - {0x5000, 0xfb}, - {0x5001, 0x1f}, - {0x5002, 0x00}, - {0x5025, 0x0e}, - {0x5026, 0x18}, - {0x5027, 0x34}, - {0x5028, 0x4c}, - {0x5029, 0x62}, - {0x502a, 0x74}, - {0x502b, 0x85}, - {0x502c, 0x92}, - {0x502d, 0x9e}, - {0x502e, 0xb2}, - {0x502f, 0xc0}, - {0x5030, 0xcc}, - {0x5031, 0xe0}, - {0x5032, 0xee}, - {0x5033, 0xf6}, - {0x5034, 0x11}, - {0x5070, 0x1c}, - {0x5071, 0x5b}, - {0x5072, 0x05}, - {0x5073, 0x20}, - {0x5074, 0x94}, - {0x5075, 0xb4}, - {0x5076, 0xb4}, - {0x5077, 0xaf}, - {0x5078, 0x05}, - {0x5079, 0x98}, - {0x507a, 0x21}, - {0x5035, 0x6a}, - {0x5036, 0x11}, - {0x5037, 0x92}, - {0x5038, 0x21}, - - {0x5039, 0xe1}, - {0x503a, 0x01}, - {0x503c, 0x05}, - {0x503d, 0x08}, - {0x503e, 0x08}, - {0x503f, 0x64}, - {0x5040, 0x58}, - {0x5041, 0x2a}, - {0x5042, 0xc5}, - {0x5043, 0x2e}, - {0x5044, 0x3a}, - {0x5045, 0x3c}, - {0x5046, 0x44}, - {0x5047, 0xf8}, - {0x5048, 0x08}, - {0x5049, 0x70}, - {0x504a, 0xf0}, - {0x504b, 0xf0}, - {0x500c, 0x03}, - {0x500d, 0x20}, - {0x500e, 0x02}, - {0x500f, 0x5c}, - {0x5010, 0x48}, - {0x5011, 0x00}, - {0x5012, 0x66}, - {0x5013, 0x03}, - {0x5014, 0x30}, - {0x5015, 0x02}, - {0x5016, 0x7c}, - {0x5017, 0x40}, - {0x5018, 0x00}, - {0x5019, 0x66}, - {0x501a, 0x03}, - {0x501b, 0x10}, - {0x501c, 0x02}, - {0x501d, 0x7c}, - {0x501e, 0x3a}, - {0x501f, 0x00}, - {0x5020, 0x66}, - {0x506e, 0x44}, - {0x5064, 0x08}, - {0x5065, 0x10}, - {0x5066, 0x12}, - {0x5067, 0x02}, - {0x506c, 0x08}, - {0x506d, 0x10}, - {0x506f, 0xa6}, - {0x5068, 0x08}, - - - {0x5069, 0x10}, - {0x506a, 0x04}, - {0x506b, 0x12}, - {0x507e, 0x40}, - {0x507f, 0x20}, - {0x507b, 0x02}, - {0x507a, 0x01}, - {0x5084, 0x0c}, - {0x5085, 0x3e}, - {0x5005, 0x80}, - {0x3a0f, 0x30}, - {0x3a10, 0x28}, - {0x3a1b, 0x32}, - {0x3a1e, 0x26}, - {0x3a11, 0x60}, - {0x3a1f, 0x14}, - {0x5060, 0x69}, - {0x5061, 0x7d}, - {0x5062, 0x7d}, - {0x5063, 0x69}, - {0x3004, 0x20}, - {0x0100, 0x01}, - SensorEnd -}; -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={ - - {0x3503,0x03}, - {0x506e,0x44}, - {0x5064,0x08}, - {0x5065,0x10}, - {0x5066,0x18}, // zenghaihui 20110920 16 - {0x5067,0x10}, - {0x506c,0x08}, - {0x506d,0x10}, - {0x506f,0xa6}, - {0x5068,0x08}, - {0x5069,0x10}, - {0x506a,0x08}, - {0x506b,0x28}, - {0x5084,0x14},//0c - {0x5085,0x3c},//34 - {0x5005,0x80}, - - - - {0x5066, 0x3c}, - {0x5067, 0x1a}, - {0x506a, 0x0e}, - {0x506b, 0x2e}, - - {0x3800, 0x00}, - {0x3801, 0x00}, - {0x3802, 0x00}, - {0x3803, 0x00}, - {0x3804, 0x06}, - {0x3805, 0x5f}, - {0x3806, 0x04}, - {0x3807, 0xbb}, - {0x3808, 0x06}, - {0x3809, 0x40}, - {0x380a, 0x04}, - {0x380b, 0xb0}, - {0x3811, 0x10}, - {0x3813, 0x06}, - {0x3814, 0x11}, - {0x3815, 0x11}, - - {0x3623, 0x00}, - {0x3634, 0x44}, - {0x3701, 0x44}, - {0x3208, 0xa2}, - {0x3705, 0x18}, - {0x3820, 0x80}, - {0x3821, 0x00}, - - {0x3003, 0x80},//10fps - {0x3004, 0x20}, //10 - {0x3005, 0x18}, - {0x3006, 0x0d}, - - {0x380c, 0x07}, - {0x380d, 0x9f}, - {0x380e, 0x04}, - {0x380f, 0xd0}, - - {0x370a, 0x12}, - {0x4608, 0x00}, - {0x4609, 0x80}, - {0x5002, 0x00}, - - {0x3a08, 0x00}, - {0x3a09, 0x3e},//7b - {0x3a0e, 0x13},//0a - - {0x3a0a, 0x00}, - {0x3a0b, 0x3e},//7b - {0x3a0d, 0x13},//0a - - {0x4003, 0x88}, - SensorEnd -}; -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] ={ - SensorEnd -}; -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data[] = -{ - {0x0100, 0x00}, //software sleep : Sensor vsync singal may not output if haven't sleep the sensor when transfer the array, - {0x3800, 0x00}, - {0x3801, 0x00}, - {0x3802, 0x00}, - {0x3803, 0x00}, - {0x3804, 0x06}, - {0x3805, 0x5f}, - {0x3806, 0x04}, - {0x3807, 0xb7}, - {0x3808, 0x03}, - {0x3809, 0x20}, - {0x380a, 0x02}, - {0x380b, 0x58}, - {0x380c, 0x05}, - {0x380d, 0x14}, - {0x380e, 0x02}, - {0x380f, 0x68}, - {0x3811, 0x08}, - {0x3813, 0x02}, - {0x3814, 0x31}, - {0x3815, 0x31}, - {0x3a02, 0x02}, - {0x3a03, 0x68}, - {0x3a08, 0x00}, - {0x3a09, 0x5c}, - {0x3a0a, 0x00}, - {0x3a0b, 0x4d}, - {0x3a0d, 0x08}, - {0x3a0e, 0x06}, - {0x3a14, 0x02}, - {0x3a15, 0x28}, - {0x3623, 0x00}, - {0x3634, 0x76}, - {0x3701, 0x44}, - {0x3702, 0x18}, - {0x3703, 0x24}, - {0x3704, 0x24}, - {0x3705, 0x0c}, - {0x3820, 0x81}, - {0x3821, 0x01}, - {0x370a, 0x52}, - {0x4608, 0x00}, - {0x4609, 0x80}, - {0x5002, 0x10}, - {0x3005, 0x18}, - {0x3004, 0x20}, - {0x3503,0x00}, - {0x0100, 0x01}, //software wake - - SensorEnd -}; -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[]={ - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[]={ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_softreset_data[]={ - SensorRegVal(0x0103,0x01), - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[]={ - SensorRegVal(0x300a,0), - SensorRegVal(0x300b,0), - SensorEnd -}; -/* -* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx -*/ -static struct rk_sensor_reg sensor_WhiteB_Auto[]= -{ - {0x3406, 0x00}, //AWB auto, bit[1]:0,auto - SensorEnd -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[]= -{ - {0x3406, 0x01}, - {0x3400, 0x07}, - {0x3401, 0x08}, - {0x3402, 0x04}, - {0x3403, 0x00}, - {0x3404, 0x05}, - {0x3405, 0x00}, - SensorEnd -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x3406, 0x01}, - {0x3400, 0x07}, - {0x3401, 0x02}, - {0x3402, 0x04}, - {0x3403, 0x00}, - {0x3404, 0x05}, - {0x3405, 0x15}, - SensorEnd -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0x3406, 0x01}, - {0x3400, 0x06}, - {0x3401, 0x2a}, - {0x3402, 0x04}, - {0x3403, 0x00}, - {0x3404, 0x07}, - {0x3405, 0x24}, - SensorEnd - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x3406, 0x01}, - {0x3400, 0x04}, - {0x3401, 0x58}, - {0x3402, 0x04}, - {0x3403, 0x00}, - {0x3404, 0x07}, - {0x3405, 0x24}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[]= -{ - // Brightness -2 - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[]= -{ - // Brightness -1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[]= -{ - // Brightness 0 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[]= -{ - // Brightness +1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[]= -{ - // Brightness +2 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[]= -{ - // Brightness +3 - - SensorEnd -}; -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = -{ - {0x507b, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = -{ - {0x507b, 0x20}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = -{ - {0x507b, 0x18}, - {0x507e, 0x40}, - {0x507f, 0xa0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Negative[] = -{ - //Negative - {0x507b, 0x40}, //bit[6] negative - SensorEnd -}; -static struct rk_sensor_reg sensor_Effect_Bluish[] = -{ - // Bluish - {0x507b, 0x18}, - {0x507e, 0xa0}, - {0x507f, 0x40}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = -{ - // Greenish - {0x507b, 0x18}, - {0x507e, 0x60}, - {0x507f, 0x60}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; - -static struct rk_sensor_reg sensor_Exposure0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure2[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure3[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure4[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure5[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure6[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; - -static struct rk_sensor_reg sensor_Saturation0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -static struct rk_sensor_reg sensor_Contrast0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast2[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast3[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast4[]= -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Contrast5[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast6[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; -static struct rk_sensor_reg sensor_SceneAuto[] = -{ - {0x3a00, 0x78}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = -{ - {0x3003, 0x80}, - {0x3004, 0x20}, - {0x3005, 0x18}, - {0x3006, 0x0d}, - {0x3a00, 0x7c}, - {0x3a02 ,0x07}, - {0x3a03 ,0x38}, - {0x3a14 ,0x07}, - {0x3a15 ,0x38}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -static struct rk_sensor_reg sensor_Zoom0[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Zoom3[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; - -/* -* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu -*/ -static struct v4l2_querymenu sensor_menus[] = -{ -}; -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = -{ -}; - -//MUST define the current used format as the first item -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {MEDIA_BUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {MEDIA_BUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; -//static struct soc_camera_ops sensor_ops;//yzm - - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ -static int sensor_parameter_record(struct i2c_client *client) -{ - u8 ret_l,ret_m,ret_h; - int tp_l,tp_m,tp_h; - - struct generic_sensor *sensor = to_generic_sensor(client); - struct specific_sensor *spsensor = to_specific_sensor(sensor); - - sensor_read(client,0x3a00, &ret_l); - sensor_write(client,0x3a00, ret_l&0xfb); - - sensor_write(client,0x3503,0x07); //stop AE/AG - - sensor_read(client,0x3500,&ret_h); - sensor_read(client,0x3501, &ret_m); - sensor_read(client,0x3502, &ret_l); - tp_l = ret_l; - tp_m = ret_m; - tp_h = ret_h; - spsensor->parameter.preview_exposure = ((tp_h<<12) & 0xF000) | ((tp_m<<4) & 0x0FF0) | ((tp_l>>4) & 0x0F); - - //Read back AGC Gain for preview - sensor_read(client,0x350b, &ret_l); - spsensor->parameter.preview_gain = ret_l; - - spsensor->parameter.CapturePclk = 24000; - spsensor->parameter.PreviewPclk = 24000; - spsensor->parameter.PreviewDummyPixels = 0; - spsensor->parameter.CaptureDummyPixels = 0; - SENSOR_DG("Read 0x350b=0x%02x PreviewExposure:%d 0x3500=0x%02x 0x3501=0x%02x 0x3502=0x%02x", - ret_l,spsensor->parameter.preview_exposure,tp_h, tp_m, tp_l); - return 0; -} -#define OV2659_FULL_PERIOD_PIXEL_NUMS (1940) // default pixel#(w/o dummy pixels) in UXGA mode -#define OV2659_FULL_PERIOD_LINE_NUMS (1238) // default line#(w/o dummy lines) in UXGA mode -#define OV2659_PV_PERIOD_PIXEL_NUMS (970) // default pixel#(w/o dummy pixels) in SVGA mode -#define OV2659_PV_PERIOD_LINE_NUMS (618) // default line#(w/o dummy lines) in SVGA mode - -/* SENSOR EXPOSURE LINE LIMITATION */ -#define OV2659_FULL_EXPOSURE_LIMITATION (1236) -#define OV2659_PV_EXPOSURE_LIMITATION (618) - -// SENSOR UXGA SIZE -#define OV2659_IMAGE_SENSOR_FULL_WIDTH (1600) -#define OV2659_IMAGE_SENSOR_FULL_HEIGHT (1200) - -#define OV2659_FULL_GRAB_WIDTH (OV2659_IMAGE_SENSOR_FULL_WIDTH - 16) -#define OV2659_FULL_GRAB_HEIGHT (OV2659_IMAGE_SENSOR_FULL_HEIGHT - 12) -static void OV2659SetDummy(struct i2c_client *client,unsigned int dummy_pixels, unsigned int dummy_lines) -{ - unsigned char val; - unsigned int temp_reg1, temp_reg2; - unsigned int temp_reg; - - if (dummy_pixels > 0) - { - sensor_read(client,0x380D,&val); // HTS[b7~b0] - temp_reg1 = val; - sensor_read(client,0x380C,&val); // HTS[b15~b8] - temp_reg2 = val; - temp_reg = (temp_reg1 & 0xFF) | (temp_reg2 << 8); - - temp_reg += dummy_pixels; - - sensor_write(client,0x380D,(temp_reg&0xFF)); //HTS[7:0] - sensor_write(client,0x380C,((temp_reg&0xFF00)>>8)); //HTS[15:8] - } - - if (dummy_lines > 0) - { - sensor_read(client,0x380F,&val); // VTS[b7~b0] - temp_reg1 = val; - sensor_read(client,0x380E,&val); // VTS[b15~b8] - temp_reg2 = val; - temp_reg = (temp_reg1 & 0xFF) | (temp_reg2 << 8); - - temp_reg += dummy_lines; - - sensor_write(client,0x380F,(temp_reg&0xFF)); //VTS[7:0] - sensor_write(client,0x380E,((temp_reg&0xFF00)>>8)); //VTS[15:8] - } -} /* OV2659_set_dummy */ - -static void OV2659WriteShutter(struct i2c_client *client,bool is_preview, unsigned int shutter) -{ - unsigned int extra_exposure_lines = 0; - - if (shutter < 1) - { - shutter = 1; - } - - if (is_preview) - { - if (shutter <= OV2659_PV_EXPOSURE_LIMITATION) - { - extra_exposure_lines = 0; - } - else - { - extra_exposure_lines=shutter - OV2659_PV_EXPOSURE_LIMITATION; - } - - } - else - { - if (shutter <= OV2659_FULL_EXPOSURE_LIMITATION) - { - extra_exposure_lines = 0; - } - else - { - extra_exposure_lines = shutter - OV2659_FULL_EXPOSURE_LIMITATION; - } - - } - - //AEC PK EXPOSURE - shutter*=16; - sensor_write(client,0x3502, (shutter & 0x00FF)); //AEC[7:0] - sensor_write(client,0x3501, ((shutter & 0x0FF00) >>8)); //AEC[15:8] - sensor_write(client,0x3500, ((shutter & 0xFF0000) >> 16)); - - if(extra_exposure_lines>0) - { - // set extra exposure line [aec add vts] - sensor_write(client,0x3507, extra_exposure_lines & 0xFF); // EXVTS[b7~b0] - sensor_write(client,0x3506, (extra_exposure_lines & 0xFF00) >> 8); // EXVTS[b15~b8] - } - else - { - // set extra exposure line [aec add vts] - sensor_write(client,0x3507, 0x00); // EXVTS[b7~b0] - sensor_write(client,0x3506, 0x00); // EXVTS[b15~b8] - } - -} /* OV2659_write_shutter */ -static int sensor_ae_transfer(struct i2c_client *client) -{ - unsigned int prev_line_len,cap_line_len,shutter; - struct generic_sensor *sensor = to_generic_sensor(client); - struct specific_sensor *spsensor = to_specific_sensor(sensor); - - mdelay(100); - shutter = spsensor->parameter.preview_exposure; - - OV2659SetDummy(client,600,0); - - prev_line_len = OV2659_PV_PERIOD_PIXEL_NUMS + spsensor->parameter.PreviewDummyPixels; - cap_line_len = OV2659_FULL_PERIOD_PIXEL_NUMS + spsensor->parameter.CaptureDummyPixels; - shutter = (shutter * spsensor->parameter.CapturePclk) / spsensor->parameter.PreviewPclk; - shutter = (shutter * prev_line_len) / cap_line_len; - shutter*=2; - - OV2659WriteShutter(client,0,shutter); - - - return 0; -} -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - u8 reg_val; - - SENSOR_DG("%s",__FUNCTION__); - - sensor_read(client,0x3000,®_val); - sensor_write(client, 0x3000, reg_val|0x03); - sensor_write(client, 0x3001, 0xff); - sensor_read(client,0x3002,®_val); - sensor_write(client, 0x3002, reg_val|0xe0); - - return 0; -} -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - u8 reg_val; - struct generic_sensor *sensor = to_generic_sensor(client); - - SENSOR_DG("%s",__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must switch into Hi-Z */ - if (sensor->info_priv.funmodule_state & SENSOR_INIT_IS_OK) { - sensor_read(client,0x3000,®_val); - sensor_write(client, 0x3000, reg_val&0xfc); - sensor_write(client, 0x3001, 0x00); - sensor_read(client,0x3002,®_val); - sensor_write(client, 0x3002, reg_val&0x1f); - } - - return 0; -} -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - if (capture) { - sensor_parameter_record(client); - } - - return 0; -} -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh (struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - if (capture) { - sensor_ae_transfer(client); - } - return 0; -} -static int sensor_try_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf) -{ - return 0; -} - -static int sensor_softrest_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - return 0; -} - -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("Suspend"); - - } else { - SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n",pm_msg.event); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - - SENSOR_DG("Resume"); - - return 0; - -} -static int sensor_mirror_cb (struct i2c_client *client, int mirror) -{ - char val; - int err = 0; - - SENSOR_DG("mirror: %d",mirror); - if (mirror) { - err = sensor_read(client, 0x3821, &val); - if (err == 0) { - val |= 0x06; - err = sensor_write(client, 0x3821, val); - } - } else { - err = sensor_read(client, 0x3821, &val); - if (err == 0) { - val &= 0xf9; - err = sensor_write(client, 0x3821, val); - } - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_mirror_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_mirror failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_mirror success, value:0x%x",ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - char val; - int err = 0; - - SENSOR_DG("flip: %d",flip); - if (flip) { - err = sensor_read(client, 0x3820, &val); - if (err == 0) { - val |= 0x06; - err = sensor_write(client, 0x3820, val); - } - } else { - err = sensor_read(client, 0x3820, &val); - if (err == 0) { - val &= 0xf9; - err = sensor_write(client, 0x3820, val); - } - } - - return err; -} -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_flip_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_flip failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_flip success, value:0x%x",ext_ctrl->value); - return 0; -} -/* -* the functions are focus callbacks -*/ -static int sensor_focus_init_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos){ - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client){ - return 0; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos) -{ - return 0; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client,int on){ - return 0; -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor* spsensor,struct soc_camera_device *icd) -{ - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - return; -} - -/* -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ -#if 1 -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); -#endif -sensor_driver_default_module_code(); - diff --git a/drivers/media/video/ov2659_old.c b/drivers/media/video/ov2659_old.c deleted file mode 100755 index 9101c7a8eb2a..000000000000 --- a/drivers/media/video/ov2659_old.c +++ /dev/null @@ -1,3372 +0,0 @@ -/* -o* Driver for MT9M001 CMOS Image Sensor from Micron - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_OV2659 -#define SENSOR_V4L2_IDENT V4L2_IDENT_OV2659 -#define SENSOR_ID 0x2656 -#define SENSOR_MIN_WIDTH 800 -#define SENSOR_MIN_HEIGHT 600 -#define SENSOR_MAX_WIDTH 1600 -#define SENSOR_MAX_HEIGHT 1200 -#define SENSOR_INIT_WIDTH sensor_init_width /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT sensor_init_height -#define SENSOR_INIT_WINSEQADR sensor_init_winseq_p -#define SENSOR_INIT_PIXFMT sensor_init_pixelcode -#define SENSOR_BUS_PARAM sensor_init_busparam - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 1 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 1 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 - -#define CONFIG_SENSOR_I2C_SPEED 350000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) - -struct reginfo -{ - u16 reg; - u8 val; -}; -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); - -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_OV2659_USER_DEFINED_SERIES -#include "ov2659_user_series.c" -#else -/* init 800*600 SVGA */ -static struct reginfo sensor_init_data[] = -{ - {0x3000, 0x0f}, - {0x3001, 0xff}, - {0x3002, 0xff}, - //{0x0100, 0x01}, //software sleep : Sensor vsync singal may not output if haven't sleep the sensor when transfer the array - {0x3633, 0x3d}, - {0x3620, 0x02}, - {0x3631, 0x11}, - {0x3612, 0x04}, - {0x3630, 0x20}, - {0x4702, 0x02}, - {0x370c, 0x34}, - {0x3004, 0x10}, - {0x3005, 0x18}, - {0x3800, 0x00}, - {0x3801, 0x00}, - {0x3802, 0x00}, - {0x3803, 0x00}, - {0x3804, 0x06}, - {0x3805, 0x5f}, - {0x3806, 0x04}, - {0x3807, 0xb7}, - {0x3808, 0x03}, - {0x3809, 0x20}, - {0x380a, 0x02}, - {0x380b, 0x58}, - {0x380c, 0x05}, - {0x380d, 0x14}, - {0x380e, 0x02}, - {0x380f, 0x68}, - {0x3811, 0x08}, - {0x3813, 0x02}, - {0x3814, 0x31}, - {0x3815, 0x31}, - {0x3a02, 0x02}, - {0x3a03, 0x68}, - {0x3a08, 0x00}, - {0x3a09, 0x5c}, - {0x3a0a, 0x00}, - {0x3a0b, 0x4d}, - {0x3a0d, 0x08}, - {0x3a0e, 0x06}, - {0x3a14, 0x02}, - {0x3a15, 0x28}, - {0x4708, 0x01}, - {0x3623, 0x00}, - {0x3634, 0x76}, - {0x3701, 0x44}, - {0x3702, 0x18}, - {0x3703, 0x24}, - {0x3704, 0x24}, - {0x3705, 0x0c}, - {0x3820, 0x81}, - {0x3821, 0x01}, - {0x370a, 0x52}, - {0x4608, 0x00}, - {0x4609, 0x80}, - {0x4300, 0x32}, - {0x5086, 0x02}, - {0x5000, 0xfb}, - {0x5001, 0x1f}, - {0x5002, 0x00}, - {0x5025, 0x0e}, - {0x5026, 0x18}, - {0x5027, 0x34}, - {0x5028, 0x4c}, - {0x5029, 0x62}, - {0x502a, 0x74}, - {0x502b, 0x85}, - {0x502c, 0x92}, - {0x502d, 0x9e}, - {0x502e, 0xb2}, - {0x502f, 0xc0}, - {0x5030, 0xcc}, - {0x5031, 0xe0}, - {0x5032, 0xee}, - {0x5033, 0xf6}, - {0x5034, 0x11}, - {0x5070, 0x1c}, - {0x5071, 0x5b}, - {0x5072, 0x05}, - {0x5073, 0x20}, - {0x5074, 0x94}, - {0x5075, 0xb4}, - {0x5076, 0xb4}, - {0x5077, 0xaf}, - {0x5078, 0x05}, - {0x5079, 0x98}, - {0x507a, 0x21}, - {0x5035, 0x6a}, - {0x5036, 0x11}, - {0x5037, 0x92}, - {0x5038, 0x21}, - - {0x5039, 0xe1}, - {0x503a, 0x01}, - {0x503c, 0x05}, - {0x503d, 0x08}, - {0x503e, 0x08}, - {0x503f, 0x64}, - {0x5040, 0x58}, - {0x5041, 0x2a}, - {0x5042, 0xc5}, - {0x5043, 0x2e}, - {0x5044, 0x3a}, - {0x5045, 0x3c}, - {0x5046, 0x44}, - {0x5047, 0xf8}, - {0x5048, 0x08}, - {0x5049, 0x70}, - {0x504a, 0xf0}, - {0x504b, 0xf0}, - {0x500c, 0x03}, - {0x500d, 0x20}, - {0x500e, 0x02}, - {0x500f, 0x5c}, - {0x5010, 0x48}, - {0x5011, 0x00}, - {0x5012, 0x66}, - {0x5013, 0x03}, - {0x5014, 0x30}, - {0x5015, 0x02}, - {0x5016, 0x7c}, - {0x5017, 0x40}, - {0x5018, 0x00}, - {0x5019, 0x66}, - {0x501a, 0x03}, - {0x501b, 0x10}, - {0x501c, 0x02}, - {0x501d, 0x7c}, - {0x501e, 0x3a}, - {0x501f, 0x00}, - {0x5020, 0x66}, - {0x506e, 0x44}, - {0x5064, 0x08}, - {0x5065, 0x10}, - {0x5066, 0x12}, - {0x5067, 0x02}, - {0x506c, 0x08}, - {0x506d, 0x10}, - {0x506f, 0xa6}, - {0x5068, 0x08}, - - - {0x5069, 0x10}, - {0x506a, 0x04}, - {0x506b, 0x12}, - {0x507e, 0x40}, - {0x507f, 0x20}, - {0x507b, 0x02}, - {0x507a, 0x01}, - {0x5084, 0x0c}, - {0x5085, 0x3e}, - {0x5005, 0x80}, - {0x3a0f, 0x30}, - {0x3a10, 0x28}, - {0x3a1b, 0x32}, - {0x3a1e, 0x26}, - {0x3a11, 0x60}, - {0x3a1f, 0x14}, - {0x5060, 0x69}, - {0x5061, 0x7d}, - {0x5062, 0x7d}, - {0x5063, 0x69}, - {0x3004, 0x20}, - {0x0100, 0x01}, - - {0x0000, 0x00} -}; - -/* 1280x720 */ -static struct reginfo sensor_720p[]= -{ - {0x0103, 0x01 }, - {0x3000, 0x0f }, - {0x3001, 0xff }, - {0x3002, 0xff }, - //{0x0100, 0x01 }, //software sleep : Sensor vsync singal may not output if haven't sleep the sensor when transfer the array - {0x3633, 0x3d }, - {0x3620, 0x02 }, - {0x3631, 0x11 }, - {0x3612, 0x04 }, - {0x3630, 0x20 }, - {0x4702, 0x02 }, - {0x370c, 0x34 }, - {0x3004, 0x10 }, - {0x3005, 0x24 }, - {0x3800, 0x00 }, - {0x3801, 0xa0 }, - {0x3802, 0x00 }, - {0x3803, 0xf0 }, - {0x3804, 0x05 }, - {0x3805, 0xbf }, - {0x3806, 0x03 }, - {0x3807, 0xcb }, - {0x3808, 0x05 }, - {0x3809, 0x00 }, - {0x380a, 0x02 }, - {0x380b, 0xd0 }, - {0x380c, 0x06 }, - {0x380d, 0x4c }, - {0x380e, 0x02 }, - {0x380f, 0xe8 }, - {0x3811, 0x10 }, - {0x3813, 0x06 }, - {0x3814, 0x11 }, - {0x3815, 0x11 }, - {0x3a02, 0x02 }, - {0x3a03, 0xe8 }, - {0x3a08, 0x00 }, - {0x3a09, 0x6f }, - {0x3a0a, 0x00 }, - {0x3a0b, 0x5d }, - {0x3a0d, 0x08 }, - {0x3a0e, 0x06 }, - {0x3a14, 0x02 }, - {0x3a15, 0x9a }, - {0x4708, 0x01 }, - {0x3623, 0x02 }, - {0x3634, 0x44 }, - {0x3701, 0x41 }, - {0x3702, 0x30 }, - {0x3703, 0x48 }, - {0x3704, 0x48 }, - {0x3705, 0x18 }, - {0x3820, 0x80 }, - {0x3821, 0x00 }, - {0x370a, 0x12 }, - {0x4608, 0x00 }, - {0x4609, 0x80 }, - {0x4300, 0x32 }, - {0x5086, 0x02 }, - {0x5000, 0xfb }, - {0x5001, 0x1f }, - {0x5002, 0x00 }, - {0x5025, 0x0e }, - {0x5026, 0x18 }, - {0x5027, 0x34 }, - {0x5028, 0x4c }, - {0x5029, 0x62 }, - {0x502a, 0x74 }, - {0x502b, 0x85 }, - {0x502c, 0x92 }, - {0x502d, 0x9e }, - {0x502e, 0xb2 }, - {0x502f, 0xc0 }, - {0x5030, 0xcc }, - {0x5031, 0xe0 }, - {0x5032, 0xee }, - {0x5033, 0xf6 }, - {0x5034, 0x11 }, - {0x5070, 0x1c }, - {0x5071, 0x5b }, - {0x5072, 0x05 }, - {0x5073, 0x20 }, - {0x5074, 0x94 }, - {0x5075, 0xb4 }, - {0x5076, 0xb4 }, - {0x5077, 0xaf }, - {0x5078, 0x05 }, - {0x5079, 0x98 }, - {0x507a, 0x21 }, - {0x5035, 0x6a }, - {0x5036, 0x11 }, - {0x5037, 0x92 }, - {0x5038, 0x21 }, - {0x5039, 0xe1 }, - {0x503a, 0x01 }, - {0x503c, 0x05 }, - {0x503d, 0x08 }, - {0x503e, 0x08 }, - {0x503f, 0x64 }, - {0x5040, 0x58 }, - {0x5041, 0x2a }, - {0x5042, 0xc5 }, - {0x5043, 0x2e }, - {0x5044, 0x3a }, - {0x5045, 0x3c }, - {0x5046, 0x44 }, - {0x5047, 0xf8 }, - {0x5048, 0x08 }, - {0x5049, 0x70 }, - {0x504a, 0xf0 }, - {0x504b, 0xf0 }, - {0x500c, 0x03 }, - {0x500d, 0x20 }, - {0x500e, 0x02 }, - {0x500f, 0x5c }, - {0x5010, 0x48 }, - {0x5011, 0x00 }, - {0x5012, 0x66 }, - {0x5013, 0x03 }, - {0x5014, 0x30 }, - {0x5015, 0x02 }, - {0x5016, 0x7c }, - {0x5017, 0x40 }, - {0x5018, 0x00 }, - {0x5019, 0x66 }, - {0x501a, 0x03 }, - {0x501b, 0x10 }, - {0x501c, 0x02 }, - {0x501d, 0x7c }, - {0x501e, 0x3a }, - {0x501f, 0x00 }, - {0x5020, 0x66 }, - {0x506e, 0x44 }, - {0x5064, 0x08 }, - {0x5065, 0x10 }, - {0x5066, 0x12 }, - {0x5067, 0x02 }, - {0x506c, 0x08 }, - {0x506d, 0x10 }, - {0x506f, 0xa6 }, - {0x5068, 0x08 }, - {0x5069, 0x10 }, - {0x506a, 0x04 }, - {0x506b, 0x12 }, - {0x507e, 0x40 }, - {0x507f, 0x20 }, - {0x507b, 0x02 }, - {0x507a, 0x01 }, - {0x5084, 0x0c }, - {0x5085, 0x3e }, - {0x5005, 0x80 }, - {0x3a0f, 0x30 }, - {0x3a10, 0x28 }, - {0x3a1b, 0x32 }, - {0x3a1e, 0x26 }, - {0x3a11, 0x60 }, - {0x3a1f, 0x14 }, - {0x5060, 0x69 }, - {0x5061, 0x7d }, - {0x5062, 0x7d }, - {0x5063, 0x69 }, - {0x0100, 0x01 }, - {0x0000 ,0x00} - -}; - -/* 1600X1200 UXGA */ -static struct reginfo sensor_uxga[] = -{ -#if 0 - {0x3800, 0x00}, - {0x3801, 0x00}, - {0x3802, 0x00}, - {0x3803, 0x00}, - {0x3804, 0x06}, - {0x3805, 0x5f}, - {0x3806, 0x04}, - {0x3807, 0xbb}, - {0x3808, 0x06}, - {0x3809, 0x40}, - {0x380a, 0x04}, - {0x380b, 0xb0}, - {0x380c, 0x07}, - {0x380d, 0x9f}, - {0x380e, 0x04}, - {0x380f, 0xd0}, - {0x3811, 0x10}, - {0x3813, 0x06}, - {0x3814, 0x11}, - {0x3815, 0x11}, - {0x3a02, 0x04}, - {0x3a03, 0xd0}, - {0x3a08, 0x00}, - {0x3a09, 0xb8}, - {0x3a0a, 0x00}, - {0x3a0b, 0x9a}, - {0x3a0d, 0x08}, - {0x3a0e, 0x06}, - {0x3a14, 0x04}, - {0x3a15, 0x50}, - {0x3623, 0x00}, - {0x3634, 0x44}, - {0x3701, 0x44}, - {0x3702, 0x30}, - {0x3703, 0x48}, - {0x3704, 0x48}, - {0x3705, 0x18}, - {0x3820, 0x80}, - {0x3821, 0x00}, - {0x370a, 0x12}, - {0x4608, 0x00}, - {0x4609, 0x80}, - {0x5002, 0x00}, - {0x3005, 0x24}, - {0x3004, 0x20}, -#else - //{0x3a00,OV2659ReadReg(0x3a00)&0xfb}, - {0x3503,0x03}, - //{0x3406,OV2659ReadReg(0x3406)|0x01}, - - {0x506e,0x44}, - {0x5064,0x08}, - {0x5065,0x10}, - {0x5066,0x18}, // zenghaihui 20110920 16 - {0x5067,0x10}, - {0x506c,0x08}, - {0x506d,0x10}, - {0x506f,0xa6}, - {0x5068,0x08}, - {0x5069,0x10}, - {0x506a,0x08}, - {0x506b,0x28}, - {0x5084,0x14},//0c - {0x5085,0x3c},//34 - {0x5005,0x80}, - - - - {0x5066, 0x3c}, - {0x5067, 0x1a}, - {0x506a, 0x0e}, - {0x506b, 0x2e}, - - {0x3800, 0x00}, - {0x3801, 0x00}, - {0x3802, 0x00}, - {0x3803, 0x00}, - {0x3804, 0x06}, - {0x3805, 0x5f}, - {0x3806, 0x04}, - {0x3807, 0xbb}, - {0x3808, 0x06}, - {0x3809, 0x40}, - {0x380a, 0x04}, - {0x380b, 0xb0}, - {0x3811, 0x10}, - {0x3813, 0x06}, - {0x3814, 0x11}, - {0x3815, 0x11}, - - {0x3623, 0x00}, - {0x3634, 0x44}, - {0x3701, 0x44}, - {0x3208, 0xa2}, - {0x3705, 0x18}, - {0x3820, 0x80}, - {0x3821, 0x00}, - - {0x3003, 0x80},//10fps - {0x3004, 0x20}, //10 - {0x3005, 0x18}, - {0x3006, 0x0d}, - - {0x380c, 0x07}, - {0x380d, 0x9f}, - {0x380e, 0x04}, - {0x380f, 0xd0}, - - {0x370a, 0x12}, - {0x4608, 0x00}, - {0x4609, 0x80}, - {0x5002, 0x00}, - - {0x3a08, 0x00}, - {0x3a09, 0x3e},//7b - {0x3a0e, 0x13},//0a - - {0x3a0a, 0x00}, - {0x3a0b, 0x3e},//7b - {0x3a0d, 0x13},//0a - - {0x4003, 0x88}, -#endif - {0x0000, 0x00} -}; - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {0x0, 0x0} -}; -/* 1024X768 SXGA */ -static struct reginfo sensor_xga[] = -{ - {0x0, 0x0} -}; -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - {0x0100, 0x00}, //software sleep : Sensor vsync singal may not output if haven't sleep the sensor when transfer the array, - {0x3800, 0x00}, - {0x3801, 0x00}, - {0x3802, 0x00}, - {0x3803, 0x00}, - {0x3804, 0x06}, - {0x3805, 0x5f}, - {0x3806, 0x04}, - {0x3807, 0xb7}, - {0x3808, 0x03}, - {0x3809, 0x20}, - {0x380a, 0x02}, - {0x380b, 0x58}, - {0x380c, 0x05}, - {0x380d, 0x14}, - {0x380e, 0x02}, - {0x380f, 0x68}, - {0x3811, 0x08}, - {0x3813, 0x02}, - {0x3814, 0x31}, - {0x3815, 0x31}, - {0x3a02, 0x02}, - {0x3a03, 0x68}, - {0x3a08, 0x00}, - {0x3a09, 0x5c}, - {0x3a0a, 0x00}, - {0x3a0b, 0x4d}, - {0x3a0d, 0x08}, - {0x3a0e, 0x06}, - {0x3a14, 0x02}, - {0x3a15, 0x28}, - {0x3623, 0x00}, - {0x3634, 0x76}, - {0x3701, 0x44}, - {0x3702, 0x18}, - {0x3703, 0x24}, - {0x3704, 0x24}, - {0x3705, 0x0c}, - {0x3820, 0x81}, - {0x3821, 0x01}, - {0x370a, 0x52}, - {0x4608, 0x00}, - {0x4609, 0x80}, - {0x5002, 0x10}, - {0x3005, 0x18}, - {0x3004, 0x20}, - {0x3503,0x00}, - {0x0100, 0x01}, //software wake - {0x0000, 0x00} -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - {0x0, 0x0} -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {0x0, 0x0} -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - {0x0, 0x0} -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {0x0, 0x0} -}; -#endif -#if 0 -/* 160X120 QQVGA*/ -static struct reginfo ov2655_qqvga[] = -{ - - {0x300E, 0x34}, - {0x3011, 0x01}, - {0x3012, 0x10}, - {0x302a, 0x02}, - {0x302b, 0xE6}, - {0x306f, 0x14}, - {0x3362, 0x90}, - - {0x3070, 0x5d}, - {0x3072, 0x5d}, - {0x301c, 0x07}, - {0x301d, 0x07}, - - {0x3020, 0x01}, - {0x3021, 0x18}, - {0x3022, 0x00}, - {0x3023, 0x06}, - {0x3024, 0x06}, - {0x3025, 0x58}, - {0x3026, 0x02}, - {0x3027, 0x61}, - {0x3088, 0x00}, - {0x3089, 0xa0}, - {0x308a, 0x00}, - {0x308b, 0x78}, - {0x3316, 0x64}, - {0x3317, 0x25}, - {0x3318, 0x80}, - {0x3319, 0x08}, - {0x331a, 0x0a}, - {0x331b, 0x07}, - {0x331c, 0x80}, - {0x331d, 0x38}, - {0x3100, 0x00}, - {0x3302, 0x11}, - - {0x0, 0x0}, -}; - - - -static struct reginfo ov2655_Sharpness_auto[] = -{ - {0x3306, 0x00}, -}; - -static struct reginfo ov2655_Sharpness1[] = -{ - {0x3306, 0x08}, - {0x3371, 0x00}, -}; - -static struct reginfo ov2655_Sharpness2[][3] = -{ - //Sharpness 2 - {0x3306, 0x08}, - {0x3371, 0x01}, -}; - -static struct reginfo ov2655_Sharpness3[] = -{ - //default - {0x3306, 0x08}, - {0x332d, 0x02}, -}; -static struct reginfo ov2655_Sharpness4[]= -{ - //Sharpness 4 - {0x3306, 0x08}, - {0x332d, 0x03}, -}; - -static struct reginfo ov2655_Sharpness5[] = -{ - //Sharpness 5 - {0x3306, 0x08}, - {0x332d, 0x04}, -}; -#endif - -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {0x4300, 0x30}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {0x4300, 0x32}, - {0x0000, 0x00} -}; - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0x3406, 0x00}, //AWB auto, bit[1]:0,auto - {0x0000, 0x00} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0x3406, 0x01}, - {0x3400, 0x07}, - {0x3401, 0x08}, - {0x3402, 0x04}, - {0x3403, 0x00}, - {0x3404, 0x05}, - {0x3405, 0x00}, - {0x0000, 0x00} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x3406, 0x01}, - {0x3400, 0x07}, - {0x3401, 0x02}, - {0x3402, 0x04}, - {0x3403, 0x00}, - {0x3404, 0x05}, - {0x3405, 0x15}, - {0x0000, 0x00} -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0x3406, 0x01}, - {0x3400, 0x06}, - {0x3401, 0x2a}, - {0x3402, 0x04}, - {0x3403, 0x00}, - {0x3404, 0x07}, - {0x3405, 0x24}, - {0x0000, 0x00} - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x3406, 0x01}, - {0x3400, 0x04}, - {0x3401, 0x58}, - {0x3402, 0x04}, - {0x3403, 0x00}, - {0x3404, 0x07}, - {0x3405, 0x24}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - // Brightness -2 - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness1[]= -{ - // Brightness -1 - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - // Brightness 0 - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - // Brightness +1 - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - // Brightness +2 - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - // Brightness +3 - - {0x0000, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x507b, 0x00}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {0x507b, 0x20}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x507b, 0x18}, - {0x507e, 0x40}, - {0x507f, 0xa0}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - //Negative - {0x507b, 0x40}, //bit[6] negative - {0x0000, 0x00} -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - // Bluish - {0x507b, 0x18}, - {0x507e, 0xa0}, - {0x507f, 0x40}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish - {0x507b, 0x18}, - {0x507e, 0x60}, - {0x507f, 0x60}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure1[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {0x0000, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast2[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - {0x0000, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - {0x0000, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {0x0000, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {0x0000, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ - {0x3a00, 0x78}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_SceneNight[] = -{ - {0x3003, 0x80}, - {0x3004, 0x20}, - {0x3005, 0x18}, - {0x3006, 0x0d}, - {0x3a00, 0x7c}, - {0x3a02 ,0x07}, - {0x3a03 ,0x38}, - {0x3a14 ,0x07}, - {0x3a15 ,0x38}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom1[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom2[] = -{ - {0x0, 0x0}, -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {0x0, 0x0}, -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif -static const struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - unsigned int winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int funmodule_state; -} sensor_info_priv_t; - -struct sensor_parameter -{ - unsigned int PreviewDummyPixels; - unsigned int CaptureDummyPixels; - unsigned int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int PreviewPclk; - unsigned short int CapturePclk; - char awb[6]; -}; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - struct sensor_parameter parameter; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, u16 reg, u8 val) -{ - int err,cnt; - u8 buf[3]; - struct i2c_msg msg[1]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - buf[2] = val; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u16 reg, u8 *val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[2]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - - while (regarray[i].reg != 0) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - i++; - } - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != 0) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif - -static int sensor_parameter_record(struct i2c_client *client) -{ - u8 ret_l,ret_m,ret_h; - int tp_l,tp_m,tp_h; - struct sensor *sensor = to_sensor(client); - - sensor_read(client,0x3a00, &ret_l); - sensor_write(client,0x3a00, ret_l&0xfb); - - sensor_write(client,0x3503,0x07); //stop AE/AG - - sensor_read(client,0x3500,&ret_h); - sensor_read(client,0x3501, &ret_m); - sensor_read(client,0x3502, &ret_l); - tp_l = ret_l; - tp_m = ret_m; - tp_h = ret_h; - sensor->parameter.preview_exposure = ((tp_h<<12) & 0xF000) | ((tp_m<<4) & 0x0FF0) | ((tp_l>>4) & 0x0F); - - //Read back AGC Gain for preview - sensor_read(client,0x350b, &ret_l); - sensor->parameter.preview_gain = ret_l; - - sensor->parameter.CapturePclk = 24000; - sensor->parameter.PreviewPclk = 24000; - sensor->parameter.PreviewDummyPixels = 0; - sensor->parameter.CaptureDummyPixels = 0; - SENSOR_DG(" %s Read 0x350b=0x%02x PreviewExposure:%d 0x3500=0x%02x 0x3501=0x%02x 0x3502=0x%02x \n", - SENSOR_NAME_STRING(), ret_l,sensor->parameter.preview_exposure,tp_h, tp_m, tp_l); - return 0; -} -#define OV2659_FULL_PERIOD_PIXEL_NUMS (1940) // default pixel#(w/o dummy pixels) in UXGA mode -#define OV2659_FULL_PERIOD_LINE_NUMS (1238) // default line#(w/o dummy lines) in UXGA mode -#define OV2659_PV_PERIOD_PIXEL_NUMS (970) // default pixel#(w/o dummy pixels) in SVGA mode -#define OV2659_PV_PERIOD_LINE_NUMS (618) // default line#(w/o dummy lines) in SVGA mode - -/* SENSOR EXPOSURE LINE LIMITATION */ -#define OV2659_FULL_EXPOSURE_LIMITATION (1236) -#define OV2659_PV_EXPOSURE_LIMITATION (618) - -// SENSOR UXGA SIZE -#define OV2659_IMAGE_SENSOR_FULL_WIDTH (1600) -#define OV2659_IMAGE_SENSOR_FULL_HEIGHT (1200) - -#define OV2659_FULL_GRAB_WIDTH (OV2659_IMAGE_SENSOR_FULL_WIDTH - 16) -#define OV2659_FULL_GRAB_HEIGHT (OV2659_IMAGE_SENSOR_FULL_HEIGHT - 12) - -static void OV2659SetDummy(struct i2c_client *client,unsigned int dummy_pixels, unsigned int dummy_lines) -{ - unsigned char val; - unsigned int temp_reg1, temp_reg2; - unsigned int temp_reg; - - if (dummy_pixels > 0) - { - sensor_read(client,0x380D,&val); // HTS[b7~b0] - temp_reg1 = val; - sensor_read(client,0x380C,&val); // HTS[b15~b8] - temp_reg2 = val; - temp_reg = (temp_reg1 & 0xFF) | (temp_reg2 << 8); - - temp_reg += dummy_pixels; - - sensor_write(client,0x380D,(temp_reg&0xFF)); //HTS[7:0] - sensor_write(client,0x380C,((temp_reg&0xFF00)>>8)); //HTS[15:8] - } - - if (dummy_lines > 0) - { - sensor_read(client,0x380F,&val); // VTS[b7~b0] - temp_reg1 = val; - sensor_read(client,0x380E,&val); // VTS[b15~b8] - temp_reg2 = val; - temp_reg = (temp_reg1 & 0xFF) | (temp_reg2 << 8); - - temp_reg += dummy_lines; - - sensor_write(client,0x380F,(temp_reg&0xFF)); //VTS[7:0] - sensor_write(client,0x380E,((temp_reg&0xFF00)>>8)); //VTS[15:8] - } -} /* OV2659_set_dummy */ -static void OV2659WriteShutter(struct i2c_client *client,bool is_preview, unsigned int shutter) -{ - unsigned int extra_exposure_lines = 0; - - if (shutter < 1) - { - shutter = 1; - } - - if (is_preview) - { - if (shutter <= OV2659_PV_EXPOSURE_LIMITATION) - { - extra_exposure_lines = 0; - } - else - { - extra_exposure_lines=shutter - OV2659_PV_EXPOSURE_LIMITATION; - } - - } - else - { - if (shutter <= OV2659_FULL_EXPOSURE_LIMITATION) - { - extra_exposure_lines = 0; - } - else - { - extra_exposure_lines = shutter - OV2659_FULL_EXPOSURE_LIMITATION; - } - - } - - //AEC PK EXPOSURE - shutter*=16; - sensor_write(client,0x3502, (shutter & 0x00FF)); //AEC[7:0] - sensor_write(client,0x3501, ((shutter & 0x0FF00) >>8)); //AEC[15:8] - sensor_write(client,0x3500, ((shutter & 0xFF0000) >> 16)); - - if(extra_exposure_lines>0) - { - // set extra exposure line [aec add vts] - sensor_write(client,0x3507, extra_exposure_lines & 0xFF); // EXVTS[b7~b0] - sensor_write(client,0x3506, (extra_exposure_lines & 0xFF00) >> 8); // EXVTS[b15~b8] - } - else - { - // set extra exposure line [aec add vts] - sensor_write(client,0x3507, 0x00); // EXVTS[b7~b0] - sensor_write(client,0x3506, 0x00); // EXVTS[b15~b8] - } - -} /* OV2659_write_shutter */ -static int sensor_ae_transfer(struct i2c_client *client) -{ - unsigned int prev_line_len,cap_line_len,shutter; - struct sensor *sensor = to_sensor(client); - - mdelay(100); - shutter = sensor->parameter.preview_exposure; - - OV2659SetDummy(client,600,0); - - prev_line_len = OV2659_PV_PERIOD_PIXEL_NUMS + sensor->parameter.PreviewDummyPixels; - cap_line_len = OV2659_FULL_PERIOD_PIXEL_NUMS + sensor->parameter.CaptureDummyPixels; - shutter = (shutter * sensor->parameter.CapturePclk) / sensor->parameter.PreviewPclk; - shutter = (shutter * prev_line_len) / cap_line_len; - shutter*=2; - - OV2659WriteShutter(client,0,shutter); - - - return 0; -} - - -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_power_end: - return ret; -} - -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} - -static s32 sensor_init_width = 800; -static s32 sensor_init_height = 600; -static unsigned long sensor_init_busparam = (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING|SOCAM_HSYNC_ACTIVE_HIGH| SOCAM_VSYNC_ACTIVE_LOW|SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ); -static enum v4l2_mbus_pixelcode sensor_init_pixelcode = V4L2_MBUS_FMT_YUYV8_2X8; -static struct reginfo* sensor_init_data_p = sensor_init_data; -static struct reginfo* sensor_init_winseq_p = sensor_svga; -static struct reginfo* sensor_init_winseq_board = NULL; -static struct reginfo* sensor_init_data_board = NULL; -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - char value; - int ret,pid = 0,i = 0,j=0; - //if val ==1,mean that sensor need to be reinit - struct rk29camera_platform_data* tmp_plat_data =sensor->sensor_io_request; - - sensor_init_data_p = sensor_init_data; - sensor_init_winseq_p = sensor_svga; - sensor_init_width = 800; - sensor_init_height = 600; - - if (tmp_plat_data != NULL) { - for(i = 0;i < RK_CAM_NUM;i++){ - if ((tmp_plat_data->sensor_init_data[i])&& tmp_plat_data->info[i].dev_name && - (strcmp(tmp_plat_data->info[i].dev_name, dev_name(icd->pdev)) == 0)) { - break; - } - - } - } - if(tmp_plat_data &&(i < RK_CAM_NUM) && tmp_plat_data->sensor_init_data[i]){ - //user has defined the init data - //init reg - int tmp_init_data_size = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_data_size; - if(tmp_init_data_size > 2){//init data is valid - if((sizeof(struct reginfo) != sizeof(struct reginfo_t))){ - if(sensor_init_data_board) { - vfree(sensor_init_data_board); - sensor_init_data_board = NULL; - } - sensor_init_data_board = (struct reginfo*)vmalloc(tmp_init_data_size); - if(!sensor_init_data_board) - SENSOR_TR("%s :vmalloc init data erro !",__FUNCTION__); - for(j = 0;j< tmp_init_data_size;j++) { - sensor_init_data_board[j].reg = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_data[j].reg; - sensor_init_data_board[j].val = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_data[j].val; - } - sensor_init_data_p = sensor_init_data_board; - } else{ - sensor_init_data_p = (struct reginfo*)(tmp_plat_data->sensor_init_data[i]->rk_sensor_init_data); - } - } - //init winseq - int tmp_winseq_size = tmp_plat_data->sensor_init_data[i]->rk_sensor_winseq_size; - if(tmp_winseq_size > 2){ - if(sizeof(struct reginfo) != sizeof(struct reginfo_t)){ - if(sensor_init_winseq_board) { - vfree(sensor_init_winseq_board); - sensor_init_winseq_board = NULL; - } - sensor_init_winseq_board = (struct reginfo*)vmalloc(tmp_winseq_size); - if(!sensor_init_winseq_board) - SENSOR_TR("%s :vmalloc erro !",__FUNCTION__); - for(j = 0;j< tmp_winseq_size;j++){ - sensor_init_winseq_board[j].reg = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_winseq[j].reg; - sensor_init_winseq_board[j].val = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_winseq[j].val; - } - sensor_init_winseq_p = sensor_init_winseq_board; - } else{ - sensor_init_winseq_p = (struct reginfo*)(tmp_plat_data->sensor_init_data[i]->rk_sensor_init_winseq); - } - } - //init width,height,bus,pixelcode - if(tmp_plat_data->sensor_init_data[i]->rk_sensor_init_width != INVALID_VALUE) - sensor_init_width = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_width; - if(tmp_plat_data->sensor_init_data[i]->rk_sensor_init_height != INVALID_VALUE) - sensor_init_height = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_height; - if(tmp_plat_data->sensor_init_data[i]->rk_sensor_init_bus_param != INVALID_VALUE) - sensor_init_busparam = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_bus_param; - if(tmp_plat_data->sensor_init_data[i]->rk_sensor_init_pixelcode != INVALID_VALUE) - sensor_init_pixelcode = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_pixelcode; - } - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - - ret = sensor_write(client, 0x0103, 0x01); - if (ret != 0) - { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - mdelay(5); //delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x300a, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value << 8); - - ret = sensor_read(client, 0x300b, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - ret = sensor_write_array(client, sensor_init_data_p); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - - sensor->info_priv.winseqe_cur_addr = (int)SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - msleep(800); - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} - -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - u8 reg_val; - struct sensor *sensor = to_sensor(client); - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - if (sensor->info_priv.funmodule_state & SENSOR_INIT_IS_OK) { - sensor_task_lock(client, 1); - sensor_read(client,0x3000,®_val); - sensor_write(client, 0x3000, reg_val&0xfc); - sensor_write(client, 0x3001, 0x00); - sensor_read(client,0x3002,®_val); - sensor_write(client, 0x3002, reg_val&0x1f); - sensor_task_lock(client, 0); - } - sensor_ioctrl(icd, Sensor_PowerDown, 1); - msleep(10); - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - - return 0; -} - -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - - return 0; - -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - int ret=0, set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - winseqe_set_addr = sensor_svga; - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 720)) && sensor_720p[0].reg) - { - winseqe_set_addr = sensor_720p; - set_w = 1280; - set_h = 720; - } - else if (((set_w <= 1024) && (set_h <= 768)) && sensor_xga[0].reg) - { - winseqe_set_addr = sensor_xga; - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - winseqe_set_addr = sensor_sxga; - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && sensor_uxga[0].reg) - { - winseqe_set_addr = sensor_uxga; - set_w = 1600; - set_h = 1200; - } - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) { - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - sensor_parameter_record(client); - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - } else { /* ddl@rock-chips.com : Video */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - } - #endif - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - - sensor->info_priv.winseqe_cur_addr = (int)winseqe_set_addr; - - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - sensor_ae_transfer(client); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - if (sensor->info_priv.whiteBalance != 0) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - msleep(600); - sensor->info_priv.snap2preview = true; - } else if (sensor_fmt_videochk(sd,mf) == true) { /* ddl@rock-chips.com : Video */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - sensor->info_priv.video2preview = true; - } else if ((sensor->info_priv.snap2preview == true) || (sensor->info_priv.video2preview == true)) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - msleep(600); - sensor->info_priv.video2preview = false; - sensor->info_priv.snap2preview = false; - } - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; - -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 720)) && sensor_720p[0].reg) - { - set_w = 1280; - set_h = 720; - } - else if (((set_w <= 1024) && (set_h <= 768)) && sensor_xga[0].reg) - { - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && sensor_uxga[0].reg) - { - set_w = 1600; - set_h = 1200; - } - else - { /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - - mf->width = set_w; - mf->height = set_h; - mf->colorspace = fmt->colorspace; - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV2655 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_mirror(struct i2c_client *client, int on) -{ - char val; - int err = 0; - - if (on) { - err = sensor_read(client, 0x3821, &val); - if (err == 0) { - val |= 0x06; - err = sensor_write(client, 0x3821, val); - } - } else { - err = sensor_read(client, 0x3821, &val); - if (err == 0) { - val &= 0xf9; - err = sensor_write(client, 0x3821, val); - } - } - - return err; -} -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_mirror(client,value) != 0) - SENSOR_TR("%s(%d): sensor_mirror failed, value:0x%x",__FUNCTION__, __LINE__,value); - - SENSOR_DG("%s(%d): sensor_mirror success, value:0x%x",__FUNCTION__, __LINE__,value); - return 0; - } - SENSOR_TR("\n %s..%s value = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_flip(struct i2c_client *client, int on) -{ - char val; - int err = 0; - - if (on) { - err = sensor_read(client, 0x3820, &val); - if (err == 0) { - val |= 0x06; - err = sensor_write(client, 0x3820, val); - } - } else { - err = sensor_read(client, 0x3820, &val); - if (err == 0) { - val &= 0xf9; - err = sensor_write(client, 0x3820, val); - } - } - - return err; -} -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_flip(client,value) != 0) - SENSOR_TR("%s(%d): sensor_flip failed, value:0x%x",__FUNCTION__, __LINE__,value); - - SENSOR_DG("%s(%d): sensor_flip success, value:0x%x",__FUNCTION__, __LINE__,value); - return 0; - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value > 0) && ((digitalzoom_cur + value) > digitalzoom_total)) - { - value = digitalzoom_total - digitalzoom_cur; - } - - if ((value < 0) && ((digitalzoom_cur + value) < 0)) - { - value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char value; - int ret,pid = 0; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - SENSOR_TR("power down %s failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - /* soft reset */ - ret = sensor_write(client, 0x0103, 0x01); - if (ret != 0) { - SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - mdelay(5); //delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x300a, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid |= (value << 8); - - ret = sensor_read(client, 0x300b, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - - return ret; -} - -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0; -#if CONFIG_SENSOR_Flash - int i; -#endif - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - int j = 0; - for(j = 0;j < RK_CAM_NUM;j++){ - if (sensor->sensor_io_request->gpio_res[j].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[j].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[j]; - break; - } - } - if(j == RK_CAM_NUM){ - SENSOR_TR("%s %s RK_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } - - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, -}; -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - - sensor->info_priv.fmt = sensor_colour_fmts[0]; - - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - - diff --git a/drivers/media/video/ov3640.c b/drivers/media/video/ov3640.c deleted file mode 100644 index fc5dd0345f45..000000000000 --- a/drivers/media/video/ov3640.c +++ /dev/null @@ -1,4624 +0,0 @@ -/* - * Driver for MT9M001 CMOS Image Sensor from Micron - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "ov3640.h" - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_OV3640 -#define SENSOR_V4L2_IDENT V4L2_IDENT_OV3640 -#define SENSOR_ID 0x364c -#define SENSOR_MIN_WIDTH 176 -#define SENSOR_MIN_HEIGHT 144 -#define SENSOR_MAX_WIDTH 2048 -#define SENSOR_MAX_HEIGHT 1536 -#define SENSOR_INIT_WIDTH 640 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 480 -#define SENSOR_INIT_WINSEQADR sensor_svga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_YUYV8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 1 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 0 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 -#ifdef CONFIG_OV3640_AUTOFOCUS -#define CONFIG_SENSOR_Focus 1 -#include "ov3640_af_firmware.c" -#else -#define CONFIG_SENSOR_Focus 0 -#endif - -#define CONFIG_SENSOR_I2C_SPEED 100000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define CONFIG_SENSOR_WRITE_REGS 1 -#define WRITE_REGS_NUM 3 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) - -#if CONFIG_SENSOR_Focus -/*#define SENSOR_AF_MODE_INFINITY 0 -#define SENSOR_AF_MODE_MACRO 1 -#define SENSOR_AF_MODE_FIXED 2 -#define SENSOR_AF_MODE_AUTO 3 -#define SENSOR_AF_MODE_CONTINUOUS 4 -#define SENSOR_AF_MODE_CLOSE 5*/ -#define SENSOR_AF_MODE_AUTO 0 -#define SENSOR_AF_MODE_CLOSE 1 -#endif - - -#if CONFIG_SENSOR_Focus -/* ov3640 VCM Command and Status Registers */ -#define CMD_MAIN_Reg 0x3F00 -#define CMD_ACK_Reg 0x3F01 -#define CMD_PARA0_Reg 0x3F05 -#define CMD_PARA1_Reg 0x3F04 -#define CMD_PARA2_Reg 0x3F03 -#define CMD_PARA3_Reg 0x3F02 -#define STA_ZONE_Reg 0x3F06 -#define STA_FOCUS_Reg 0x3F07 - -/* ov3640 VCM Command */ -#define OverlayEn_Cmd 0x01 -#define OverlayDis_Cmd 0x02 -#define SingleFocus_Cmd 0x03 -#define ConstFocus_Cmd 0x04 -#define StepMode_Cmd 0x05 -#define PauseFocus_Cmd 0x06 -#define ReturnIdle_Cmd 0x08 -#define SetZone_Cmd 0x10 -#define UpdateZone_Cmd 0x12 -#define SetMotor_Cmd 0x20 - -/* ov3640 Focus State */ -#define S_FIRWRE 0xFF -#define S_STARTUP 0xFA -#define S_ERROR 0xFE -#define S_DRVICERR 0xEE -#define S_IDLE 0x00 -#define S_FOCUSING 0x01 -#define S_FOCUSED 0x02 -#define S_CAPTURE 0x12 -#define S_STEP 0x20 - -/* ovxxxx Zone State */ -#define Zone_Is_Focused(a, zone_val) (zone_val&(1<<(a-3))) -#define Zone_Get_ID(zone_val) (zone_val&0x03) - -#define Zone_CenterMode 0x01 -#define Zone_5xMode 0x02 -#define Zone_5PlusMode 0x03 -#define Zone_4fMode 0x04 - -#define ZoneSel_Auto 0x0b -#define ZoneSel_SemiAuto 0x0c -#define ZoneSel_Manual 0x0d -#define ZoneSel_Rotate 0x0e - -/* ovxxxx Step Focus Commands */ -#define StepFocus_Near_Tag 0x01 -#define StepFocus_Far_Tag 0x02 -#define StepFocus_Furthest_Tag 0x03 -#define StepFocus_Nearest_Tag 0x04 -#define StepFocus_Spec_Tag 0x10 -#endif - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -#if CONFIG_SENSOR_Flash -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); -#endif -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_OV5640_USER_DEFINED_SERIES -#include "ov5640_user_series.c" -#else -/* init VGA 640*480 */ -static struct reginfo sensor_init_data[] = -{ - {0x3078, 0x02}, - {0x304d, 0x45}, - {0x30a7, 0x5e}, - {0x3087, 0x16}, - {0x309C, 0x1a}, - {0x30a2, 0xe4}, - {0x30aa, 0x42}, - {0x30b0, 0xff}, - {0x30b1, 0xff}, - //{0x30b2, 0x10}, - {0x30b2, 0x18}, // by FAE - {0x300e, 0x39}, - {0x300f, 0x21}, - {0x3010, 0x20}, - {0x304c, 0x81}, - {0x30d7, 0x10}, - {0x30d9, 0x0d}, - {0x30db, 0x08}, - {0x3016, 0x82}, - {0x3018, 0x48}, - {0x3019, 0x40}, - {0x301a, 0x82}, - - {0x30a9, 0xbd},//disable internal DVDD, by FAE. - - {0x307d, 0x00}, - {0x3087, 0x02}, - {0x3082, 0x20}, - {0x3015, 0x12}, - {0x3014, 0x84}, - {0x3013, 0xf7}, - {0x303c, 0x08}, - {0x303d, 0x18}, - {0x303e, 0x06}, - {0x303F, 0x0c}, - {0x3030, 0x62}, - {0x3031, 0x26}, - {0x3032, 0xe6}, - {0x3033, 0x6e}, - {0x3034, 0xea}, - {0x3035, 0xae}, - {0x3036, 0xa6}, - {0x3037, 0x6a}, - {0x3104, 0x02}, - {0x3105, 0xfd}, - {0x3106, 0x00}, - {0x3107, 0xff}, - {0x3300, 0x13}, - {0x3301, 0xde}, - {0x3302, 0xcf}, - {0x3312, 0x26}, - {0x3314, 0x42}, - {0x3313, 0x2b}, - {0x3315, 0x42}, - {0x3310, 0xd0}, - {0x3311, 0xbd}, - {0x330c, 0x18}, - {0x330d, 0x18}, - {0x330e, 0x56}, - {0x330f, 0x5c}, - {0x330b, 0x1c}, - {0x3306, 0x5c}, - {0x3307, 0x11}, - {0x336a, 0x52}, - {0x3370, 0x46}, - {0x3376, 0x38}, - {0x30b8, 0x20}, - {0x30b9, 0x17}, - {0x30ba, 0x00}, - {0x30bb, 0x08}, - {0x3507, 0x06}, - {0x350a, 0x4f}, - {0x3100, 0x02}, - {0x3301, 0xde}, - {0x3304, 0xfc}, - {0x3400, 0x00}, - {0x3404, 0x00},//YUV, sequence - {0x3600, 0xc0}, - {0x3088, 0x08}, - {0x3089, 0x00}, - {0x308a, 0x06}, - {0x308b, 0x00}, - {0x308d, 0x04}, - {0x3086, 0x03}, - {0x3086, 0x00}, - {0x30a9, 0xb5}, - {0x3317, 0x04}, - {0x3316, 0xf8}, - {0x3312, 0x31}, - {0x3314, 0x57}, - {0x3313, 0x28}, - {0x3315, 0x3d}, - {0x3311, 0xd0}, - {0x3310, 0xb6}, - {0x330c, 0x16}, - {0x330d, 0x16}, - {0x330e, 0x5f}, - {0x330f, 0x5c}, - {0x330b, 0x18}, - {0x3306, 0x5c}, - {0x3307, 0x11}, - {0x3308, 0x25}, - {0x3340, 0x20}, - {0x3341, 0x58}, - {0x3342, 0x08}, - {0x3343, 0x21}, - {0x3344, 0xbe}, - {0x3345, 0xe0}, - {0x3346, 0xca}, - {0x3347, 0xc6}, - {0x3348, 0x04}, - {0x3349, 0x98}, - {0x3355, 0x02}, - {0x3358, 0x44}, - {0x3359, 0x44}, - {0x3300, 0x13}, - {0x3367, 0x23}, - {0x3368, 0xBB}, - {0x3369, 0xD6}, - {0x336A, 0x2A}, - {0x336B, 0x07}, - {0x336C, 0x00}, - {0x336D, 0x23}, - {0x336E, 0xC3}, - {0x336F, 0xDE}, - {0x3370, 0x2b}, - {0x3371, 0x07}, - {0x3372, 0x00}, - {0x3373, 0x23}, - {0x3374, 0x9e}, - {0x3375, 0xD6}, - {0x3376, 0x29}, - {0x3377, 0x07}, - {0x3378, 0x00}, - {0x332a, 0x1d}, - {0x331b, 0x08}, - {0x331c, 0x16}, - {0x331d, 0x2d}, - {0x331e, 0x54}, - {0x331f, 0x66}, - {0x3320, 0x73}, - {0x3321, 0x80}, - {0x3322, 0x8c}, - {0x3323, 0x95}, - {0x3324, 0x9d}, - {0x3325, 0xac}, - {0x3326, 0xb8}, - {0x3327, 0xcc}, - {0x3328, 0xdd}, - {0x3329, 0xee}, - {0x332e, 0x04}, - {0x332f, 0x06}, - {0x3331, 0x03}, -#ifdef CONFIG_RK29_NEWTON - {0x307c, 0x10}, // flip && mirror ,for newton - {0x3090, 0xc0}, -#else - - //{0x307c, 0x13}, // flip && mirror - {0x307c, 0x10}, // flip && mirror ,by FAE. - {0x3090, 0xc0}, -#endif - - {0x3012, 0x10}, - {0x3366, 0x15}, - {0x3023, 0x06}, - {0x3026, 0x03}, - {0x3027, 0x04}, - {0x302a, 0x03}, - {0x302b, 0x39}, - {0x3075, 0x24}, - {0x300d, 0x01}, - {0x30d7, 0x90}, - {0x3069, 0x04}, - {0x303e, 0x00}, - {0x303f, 0xc0}, - {0x300e, 0x32}, - {0x300f, 0x21}, - {0x3010, 0x20}, - {0x3011, 0x01}, - // XGA-VGA - {0x3302, 0xef}, - {0x335f, 0x34}, - {0x3360, 0x0c}, - {0x3361, 0x04}, - {0x3362, 0x12}, - {0x3363, 0x88}, - {0x3364, 0xe4}, - {0x3403, 0x42}, - {0x3088, 0x02}, - {0x3089, 0x88},// 0x80, by FAE. - {0x308a, 0x01}, - {0x308b, 0xe4},// 0xe0, by FAE. - {0x304c, 0x84}, //0x83, by FAE. - - {0x0000 ,0x00}, -}; - -/* 2048X1536 QXGA */ -static struct reginfo sensor_qxga_preview[] = -{ -#if 1 - {0x3012, 0x00}, - {0x3366, 0x10}, - {0x3020, 0x01}, - {0x3021, 0x1d}, - {0x3022, 0x00}, - {0x3023, 0x0a}, - {0x3024, 0x08}, - {0x3025, 0x18}, - {0x3026, 0x06}, - {0x3027, 0x0c}, - {0x302a, 0x06}, - {0x302b, 0x20}, - {0x3075, 0x44}, - {0x300d, 0x00}, - {0x30d7, 0x10}, - {0x3069, 0x44}, - {0x303e, 0x01}, - {0x303f, 0x80}, - - {0x3302, 0xcf}, - {0x335f, 0x68}, - {0x3360, 0x18}, - {0x3361, 0x0c}, - {0x3362, 0x68}, - {0x3363, 0x08}, - {0x3364, 0x04}, - {0x3366, 0x10}, - {0x3403, 0x42}, - {0x3088, 0x08}, - {0x3089, 0x00}, - {0x308a, 0x06}, - {0x308b, 0x00}, - {0x300e, 0x39}, - {0x300f, 0x21}, - {0x3010, 0x20}, - {0x3011, 0x01}, - {0x304c, 0x81}, - -#else -//[Sensor.YUV.2048x1536] XGA->QXGA - {0x3012, 0x00}, - {0x3020, 0x01}, - {0x3021, 0x1d}, - {0x3022, 0x00}, - {0x3023, 0x0a}, - {0x3024, 0x08}, - {0x3025, 0x18}, - {0x3026, 0x06}, - {0x3027, 0x0c}, - {0x302a, 0x06}, - {0x302b, 0x20}, - {0x3075, 0x44}, - {0x300d, 0x00}, - {0x30d7, 0x10}, - {0x3069, 0x44}, - {0x303e, 0x01}, - {0x303f, 0x80}, - {0x3302, 0xcf}, - {0x335f, 0x68}, - {0x3360, 0x18}, - {0x3361, 0x0c}, - {0x3362, 0x68}, - {0x3363, 0x08}, - {0x3364, 0x04}, - {0x3403, 0x42}, - {0x3088, 0x08}, - {0x3089, 0x00}, - {0x308a, 0x06}, - {0x308b, 0x00}, - {0x300e, 0x39}, - {0x300f, 0x21}, - {0x3010, 0x20}, - {0x3011, 0x01}, - {0x304c, 0x81}, -#endif - {0x0000 ,0x00} -}; -static struct reginfo sensor_qxga_capture[] = { - {0x3012, 0x00}, - {0x3366, 0x10}, - {0x3020, 0x01}, - {0x3021, 0x1d}, - {0x3022, 0x00}, - {0x3023, 0x0a}, - {0x3024, 0x08}, - {0x3025, 0x18}, - {0x3026, 0x06}, - {0x3027, 0x0c}, - {0x302a, 0x06}, - {0x302b, 0x20}, - {0x3075, 0x44}, - {0x300d, 0x00}, - {0x30d7, 0x10}, - {0x3069, 0x44}, - {0x303e, 0x01}, - {0x303f, 0x80}, - - {0x3302, 0xcf}, - {0x335f, 0x68}, - {0x3360, 0x18}, - {0x3361, 0x0c}, - {0x3362, 0x68}, - {0x3363, 0x08}, - {0x3364, 0x04}, - {0x3366, 0x10}, - {0x3403, 0x42}, - {0x3088, 0x08}, - {0x3089, 0x00}, - {0x308a, 0x06}, - {0x308b, 0x00}, - {0x300e, 0x39}, - {0x300f, 0x21}, - {0x3010, 0x20}, - {0x3011, 0x01}, - {0x304c, 0x81}, - - - {0x0000 ,0x00} -}; -static struct reginfo *sensor_qxga[2] = { - sensor_qxga_preview, - sensor_qxga_capture, -}; - - -static struct reginfo sensor_720p[] = { -{SEQUENCE_END, 0x00} -}; - - -/* 1600X1200 UXGA */ -static struct reginfo sensor_uxga_preview[] = -{ - {0x3012, 0x00}, - {0x3366, 0x10}, - {0x3020, 0x01}, - {0x3021, 0x1d}, - {0x3022, 0x00}, - {0x3023, 0x0a}, - {0x3024, 0x08}, - {0x3025, 0x18}, - {0x3026, 0x06}, - {0x3027, 0x0c}, - {0x302a, 0x06}, - {0x302b, 0x20}, - {0x3075, 0x44}, - {0x300d, 0x00}, - {0x30d7, 0x10}, - {0x3069, 0x44}, - {0x303e, 0x01}, - {0x303f, 0x80}, - //qxga -> uxga - {0x300e, 0x39}, - {0x300f, 0x21}, - {0x3010, 0x20}, - {0x3302, 0xef}, - {0x335f, 0x68}, - {0x3360, 0x18}, - {0x3361, 0x0C}, - {0x3362, 0x46}, - {0x3363, 0x48}, - {0x3364, 0xb4}, - {0x3403, 0x22}, - {0x3088, 0x06}, - {0x3089, 0x40}, - {0x308a, 0x04}, - {0x308b, 0xb0}, - {0x304c, 0x81},//56Mhz PCLK output - - {0x0000 ,0x00}, -}; -static struct reginfo sensor_uxga_capture[] = -{ - {0x3302, 0xef}, - {0x335f, 0x68}, - {0x3360, 0x18}, - {0x3361, 0x0C}, - {0x3362, 0x46}, - {0x3363, 0x48}, - {0x3364, 0xb4}, - {0x3403, 0x22}, - {0x3088, 0x06}, - {0x3089, 0x40}, - {0x308a, 0x04}, - {0x308b, 0xb0}, - {0x304c, 0x81},//56Mhz PCLK output - - {0x0000 ,0x00}, -}; -static struct reginfo *sensor_uxga[2] = { - sensor_uxga_preview, - sensor_uxga_capture, -}; - -/* 1280X960 SXGA */ -static struct reginfo sensor_sxga_preview[] = -{ - {0x3012, 0x00}, - {0x3366, 0x10}, - {0x3020, 0x01}, - {0x3021, 0x1d}, - {0x3022, 0x00}, - {0x3023, 0x0a}, - {0x3024, 0x08}, - {0x3025, 0x18}, - {0x3026, 0x06}, - {0x3027, 0x0c}, - {0x302a, 0x06}, - {0x302b, 0x20}, - {0x3075, 0x44}, - {0x300d, 0x00}, - {0x30d7, 0x10}, - {0x3069, 0x44}, - {0x303e, 0x01}, - {0x303f, 0x80}, - //qxga -> sxga - {0x300e, 0x39}, - {0x300f, 0x21}, - {0x3010, 0x20}, - {0x3302, 0xef}, - {0x335f, 0x68}, - {0x3360, 0x18}, - {0x3361, 0x0c}, - {0x3362, 0x35}, - {0x3363, 0x08}, - {0x3364, 0xc4}, - {0x3403, 0x42}, - {0x3088, 0x05}, - {0x3089, 0x00}, - {0x308a, 0x03}, - {0x308b, 0xc0}, - {0x304c, 0x81},//56Mhz PCLK output - - {0x0000 ,0x00}, -}; -/* 1080p, 0x15fps, 0xyuv @1920x1080 */ - -static struct reginfo sensor_1080p[]= -{ - - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_sxga_capture[] = -{ - {0x3302, 0xef}, - {0x335f, 0x68}, - {0x3360, 0x18}, - {0x3361, 0x0c}, - {0x3362, 0x35}, - {0x3363, 0x08}, - {0x3364, 0xc4}, - {0x3403, 0x42}, - {0x3088, 0x05}, - {0x3089, 0x00}, - {0x308a, 0x03}, - {0x308b, 0xc0}, - {0x304c, 0x81},//56Mhz PCLK output - - {0x0000 ,0x00}, -}; -static struct reginfo *sensor_sxga[2] = { - sensor_sxga_preview, - sensor_sxga_capture, -}; - -/* 2592X1944 QSXGA */ -static struct reginfo sensor_qsxga[] = -{ -{SEQUENCE_END, 0x00} -}; -/* 1024*768 XGA */ -static struct reginfo sensor_xga_preview[] = -{ - {0x3012, 0x10}, - {0x3366, 0x15}, - {0x3023, 0x06}, - {0x3026, 0x03}, - {0x3027, 0x04}, - {0x302a, 0x03}, - {0x302b, 0x39}, - {0x3075, 0x24}, - {0x300d, 0x01}, - {0x30d7, 0x90}, - {0x3069, 0x04}, - {0x303e, 0x00}, - {0x303f, 0xc0}, - {0x300e, 0x32}, - {0x300f, 0x21}, - {0x3010, 0x20}, - {0x3011, 0x01}, - //XGA--XGA - {0x3302, 0xef}, - {0x335f, 0x34}, - {0x3360, 0x0c}, - {0x3361, 0x04}, - {0x3362, 0x34}, - {0x3363, 0x08}, - {0x3364, 0x04}, - {0x3403, 0x42}, - {0x3088, 0x04}, - {0x3089, 0x00}, - {0x308a, 0x03}, - {0x308b, 0x00}, - {0x304c, 0x82},//28Mhz PCLK output - - - {0x0000 ,0x00}, -}; -static struct reginfo sensor_xga_capture[] = -{ - {0x3302, 0xef}, - {0x335f, 0x68}, - {0x3360, 0x18}, - {0x3361, 0x0c}, - {0x3362, 0x34}, - {0x3363, 0x08}, - {0x3364, 0x06}, - {0x3403, 0x42}, - {0x3088, 0x04}, - {0x3089, 0x00}, - {0x308a, 0x03}, - {0x308b, 0x00}, - {0x304c, 0x82},//28Mhz PCLK output - - {0x0000 ,0x00}, -}; -static struct reginfo *sensor_xga[2] = { - sensor_xga_preview, - sensor_xga_capture, -}; - -/* 800X600 SVGA*/ -static struct reginfo sensor_svga_preview[] = -{ - {0x3012, 0x10}, - {0x3366, 0x15}, - {0x3023, 0x06}, - {0x3026, 0x03}, - {0x3027, 0x04}, - {0x302a, 0x03}, - {0x302b, 0x39}, - {0x3075, 0x24}, - {0x300d, 0x01}, - {0x30d7, 0x90}, - {0x3069, 0x04}, - {0x303e, 0x00}, - {0x303f, 0xc0}, - {0x300e, 0x32}, - {0x300f, 0x21}, - {0x3010, 0x20}, - {0x3011, 0x01}, - // XGA-SVGA - {0x3302, 0xef}, - {0x335f, 0x34}, - {0x3360, 0x0c}, - {0x3361, 0x04}, - {0x3362, 0x23}, - {0x3363, 0x28}, - {0x3364, 0x5c}, - {0x3403, 0x42}, - {0x3088, 0x03}, - {0x3089, 0x20}, - {0x308a, 0x02}, - {0x308b, 0x58}, - {0x304c, 0x83},//28Mhz PCLK output - - {0x0000 ,0x00}, -}; -static struct reginfo sensor_svga_capture[] = -{ - {0x3302, 0xef}, - {0x335f, 0x68}, - {0x3360, 0x18}, - {0x3361, 0x0c}, - {0x3362, 0x23}, - {0x3363, 0x28}, - {0x3364, 0x5c}, - {0x3403, 0x42}, - {0x3088, 0x03}, - {0x3089, 0x20}, - {0x308a, 0x02}, - {0x308b, 0x58}, - {0x304c, 0x82},//28Mhz PCLK output - - {0x0000 ,0x00}, -}; -static struct reginfo * sensor_svga[2] = { - sensor_svga_preview, - sensor_svga_capture, -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga_preview[] = -{ - {0x3012, 0x10}, - {0x3366, 0x15}, - {0x3023, 0x06}, - {0x3026, 0x03}, - {0x3027, 0x04}, - {0x302a, 0x03}, - {0x302b, 0x39}, - {0x3075, 0x24}, - {0x300d, 0x01}, - {0x30d7, 0x90}, - {0x3069, 0x04}, - {0x303e, 0x00}, - {0x303f, 0xc0}, - {0x300e, 0x32}, - {0x300f, 0x21}, - {0x3010, 0x20}, - {0x3011, 0x01}, - // XGA-VGA - {0x3302, 0xef}, - {0x335f, 0x34}, - {0x3360, 0x0c}, - {0x3361, 0x04}, - {0x3362, 0x12}, - {0x3363, 0x88}, - {0x3364, 0xe4}, - {0x3403, 0x42}, - {0x3088, 0x02}, - {0x3089, 0x88},// 0x80, by FAE. - {0x308a, 0x01}, - {0x308b, 0xe4},// 0xe0, by FAE. - {0x304c, 0x84}, //0x83, by FAE. - -// by FAE. -//AWB short - // {0x33a7, 0x60}, - //{0x33a8, 0x40}, - //{0x33a9, 0x68}, - //{0x332b, 0x08}, - //{0x330a, 0x22}, - - //{0x332b, 0x00}, - //{0x330a, 0x02}, -//end - - - {0x0000 ,0x00}, -}; - -static struct reginfo sensor_vga_capture[] = -{ - {0x3302, 0xef}, - {0x335f, 0x68}, - {0x3360, 0x18}, - {0x3361, 0x0c}, - {0x3362, 0x12}, - {0x3363, 0x88}, - {0x3364, 0xe4}, - {0x3403, 0x42}, - {0x3088, 0x02}, - {0x3089, 0x80}, - {0x308a, 0x01}, - {0x308b, 0xe0}, - {0x304c, 0x82},//14Mhz PCLK output 84 - - {0x0000 ,0x00}, -}; -static struct reginfo *sensor_vga[2] = { - sensor_vga_preview, - sensor_vga_capture, -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif_preview[] = -{ - {0x3012, 0x10}, - {0x3366, 0x15}, - {0x3023, 0x06}, - {0x3026, 0x03}, - {0x3027, 0x04}, - {0x302a, 0x03}, - {0x302b, 0x39}, - {0x3075, 0x24}, - {0x300d, 0x01}, - {0x30d7, 0x90}, - {0x3069, 0x04}, - {0x303e, 0x00}, - {0x303f, 0xc0}, - {0x300e, 0x32}, - {0x300f, 0x21}, - {0x3010, 0x20}, - {0x3011, 0x01}, - //XGA->CIF(352*288) -#if 0 // by FAE. - {0x3302, 0xef}, - {0x335f, 0x34}, - {0x3360, 0x0c}, - {0x3361, 0x04}, - {0x3362, 0x11}, - {0x3363, 0x6c}, - {0x3364, 0x26}, - {0x3403, 0x42}, - {0x3088, 0x01}, - {0x3089, 0x60}, - {0x308a, 0x01}, - {0x308b, 0x20}, - {0x304c, 0x82}, //89 -#else - {0x3302, 0xef}, - {0x335f, 0x34}, - {0x3360, 0x0c}, - {0x3361, 0x04}, - {0x3362, 0x11}, - {0x3363, 0x68}, //? - {0x3364, 0x24},//? - {0x3403, 0x42}, - {0x3088, 0x01}, - {0x3089, 0x68}, - {0x308a, 0x01}, - {0x308b, 0x24}, - {0x304c, 0x85}, //89 -#endif - - {0x0000 ,0x00}, -}; -static struct reginfo sensor_cif_capture[] = -{ - {0x3302, 0xef}, - {0x335f, 0x68}, - {0x3360, 0x18}, - {0x3361, 0x0c}, - {0x3362, 0x11}, - {0x3363, 0x68}, - {0x3364, 0x24}, - {0x3403, 0x42}, - {0x3088, 0x01}, - {0x3089, 0x60}, - {0x308a, 0x01}, - {0x308b, 0x20}, - {0x304c, 0x84},//14Mhz PCLK output - - {0x0000 ,0x00}, -}; -static struct reginfo *sensor_cif[2] = { - sensor_cif_preview, - sensor_cif_capture, -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga_preview[] = -{ - {0x3012, 0x10}, - {0x3366, 0x15}, - {0x3023, 0x06}, - {0x3026, 0x03}, - {0x3027, 0x04}, - {0x302a, 0x03}, - {0x302b, 0x39}, - {0x3075, 0x24}, - {0x300d, 0x01}, - {0x30d7, 0x90}, - {0x3069, 0x04}, - {0x303e, 0x00}, - {0x303f, 0xc0}, - {0x300e, 0x32}, - {0x300f, 0x21}, - {0x3010, 0x20}, - {0x3011, 0x01}, - //XGA->QVGA - {0x3302, 0xef}, - {0x335f, 0x34}, - {0x3360, 0x0c}, - {0x3361, 0x04}, - {0x3362, 0x01}, - {0x3363, 0x48}, - {0x3364, 0xf4}, - {0x3403, 0x42}, - {0x3088, 0x01}, - {0x3089, 0x40}, - {0x308a, 0x00}, - {0x308b, 0xf0}, - {0x304c, 0x89},//14Mhz PCLK output - - {0x0000 ,0x00}, -}; -static struct reginfo sensor_qvga_capture[] = -{ - {0x3302, 0xef}, - {0x335f, 0x68}, - {0x3360, 0x18}, - {0x3361, 0x0c}, - {0x3362, 0x01}, - {0x3363, 0x48}, - {0x3364, 0xf4}, - {0x3403, 0x42}, - {0x3088, 0x01}, - {0x3089, 0x40}, - {0x308a, 0x00}, - {0x308b, 0xf0}, - {0x304c, 0x84},//14Mhz PCLK output - - {0x0000 ,0x00}, -}; -static struct reginfo *sensor_qvga[2] = { - sensor_qvga_preview, - sensor_qvga_capture, -}; - -/* 176*144 QCIF */ -static struct reginfo sensor_qcif_preview[] = -{ - {0x3012, 0x10}, - {0x3366, 0x15}, - {0x3023, 0x06}, - {0x3026, 0x03}, - {0x3027, 0x04}, - {0x302a, 0x03}, - {0x302b, 0x39}, - {0x3075, 0x24}, - {0x300d, 0x01}, - {0x30d7, 0x90}, - {0x3069, 0x04}, - {0x303e, 0x00}, - {0x303f, 0xc0}, - {0x300e, 0x32}, - {0x300f, 0x21}, - {0x3010, 0x20}, - {0x3011, 0x01}, - //XGA->QCIF - {0x3302, 0xef}, - {0x335f, 0x34}, - {0x3360, 0x0c}, - {0x3361, 0x04}, - {0x3362, 0x00}, - {0x3363, 0xb8}, - {0x3364, 0x94}, - {0x3403, 0x42}, - {0x3088, 0x00}, - {0x3089, 0xb0}, - {0x308a, 0x00}, - {0x308b, 0x90}, - {0x304c, 0x82},//14Mhz PCLK output 89 - - {0x0000 ,0x00}, -}; -static struct reginfo sensor_qcif_capture[] = -{ - {0x3302, 0xef}, - {0x335f, 0x68}, - {0x3360, 0x18}, - {0x3361, 0x0c}, - {0x3362, 0x00}, - {0x3363, 0xb8}, - {0x3364, 0x94}, - {0x3403, 0x42}, - {0x3088, 0x00}, - {0x3089, 0xb0}, - {0x308a, 0x00}, - {0x308b, 0x90}, - {0x304c, 0x84},//14Mhz PCLK output - - {0x0000 ,0x00}, -}; -static struct reginfo *sensor_qcif[2] = { - sensor_qcif_preview, - sensor_qcif_capture, -}; - -#endif -#if 0 - -static struct reginfo ov3640_Sharpness_auto[] = -{ - {0x3306, 0x00}, -}; - -static struct reginfo ov3640_Sharpness1[] = -{ - {0x3306, 0x08}, - {0x3371, 0x00}, -}; - -static struct reginfo ov3640_Sharpness2[][3] = -{ - //Sharpness 2 - {0x3306, 0x08}, - {0x3371, 0x01}, -}; - -static struct reginfo ov3640_Sharpness3[] = -{ - //default - {0x3306, 0x08}, - {0x332d, 0x02}, -}; -static struct reginfo ov3640_Sharpness4[]= -{ - //Sharpness 4 - {0x3306, 0x08}, - {0x332d, 0x03}, -}; - -static struct reginfo ov3640_Sharpness5[] = -{ - //Sharpness 5 - {0x3306, 0x08}, - {0x332d, 0x04}, -}; -#endif - -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {0x3400, 0x00}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {0x3400, 0x02}, - {0x0000, 0x00} -}; - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0x332b, 0x00},//AWB auto, bit[3]:0,auto - - {0x0000, 0x00} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0x332b, 0x08}, - {0x33a7, 0x68}, - {0x33a8, 0x40}, - {0x33a9, 0x4e}, - - {0x0000, 0x00} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x332b, 0x08}, //AWB off - {0x33a7, 0x5e}, - {0x33a8, 0x40}, - {0x33a9, 0x46}, - - {0x0000, 0x00} -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0x332b, 0x08}, - {0x33a7, 0x52}, - {0x33a8, 0x40}, - {0x33a9, 0x58}, - - {0x0000, 0x00} -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x332b, 0x08}, - {0x33a7, 0x44}, - {0x33a8, 0x40}, - {0x33a9, 0x70}, - - {0x0000, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - // Brightness -3 - {0x3302, 0xef}, - {0x3355, 0x04}, - {0x3354, 0x09}, - {0x335e, 0x30}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness1[]= -{ - // Brightness -2 - {0x3302, 0xef}, - {0x3355, 0x04}, - {0x3354, 0x09}, - {0x335e, 0x20}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - // Brightness -1 - {0x3302, 0xef}, - {0x3355, 0x04}, - {0x3354, 0x09}, - {0x335e, 0x10}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - // Brightness 0 - {0x3302, 0xef}, - {0x3355, 0x04}, - {0x3354, 0x01}, - {0x335e, 0x00}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - // Brightness +1 - {0x3302, 0xef}, - {0x3355, 0x04}, - {0x3354, 0x01}, - {0x335e, 0x10}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - // Brightness +2 - {0x3302, 0xef}, - {0x3355, 0x04}, - {0x3354, 0x01}, - {0x335e, 0x20}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness6[]= -{ - // Brightness +3 - {0x3302, 0xef}, - {0x3355, 0x04}, //bit[2] enable - {0x3354, 0x01}, //bit[3] sign of brightness - {0x335e, 0x30}, - - {0x0000, 0x00} -}; - -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,sensor_Brightness6,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - // Normal - {0x3302, 0xef}, - {0x3355, 0x00}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - // B&W - {0x3302, 0xef}, - {0x3355, 0x18}, //bit[4]fix u enable, bit[3]fix v enable - {0x335a, 0x80}, - {0x335b, 0x80}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - // Sepia - {0x3302, 0xef}, - {0x3355, 0x18}, - {0x335a, 0x40}, - {0x335b, 0xa6}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - // Negative - {0x3302, 0xef}, - {0x3355, 0x40}, //bit[6] negative - - {0x0000, 0x00} -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - // Bluish - {0x3302, 0xef}, - {0x3355, 0x18}, - {0x335a, 0xa0}, - {0x335b, 0x40}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish - {0x3302, 0xef}, - {0x3355, 0x18}, - {0x335a, 0x60}, - {0x335b, 0x60}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_Red[] = -{ - // Reddish - {0x3302, 0xef}, - {0x3355, 0x18}, - {0x335a, 0x80}, - {0x335b, 0xc0}, - - {0x0000, 0x00} -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,sensor_Effect_Red,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - // -1.7EV - {0x3047, 0x00}, - {0x3018, 0x10}, - {0x3019, 0x08}, - {0x301a, 0x21}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure1[]= -{ - // -1.3EV - {0x3047, 0x00}, - {0x3018, 0x18}, - {0x3019, 0x10}, - {0x301a, 0x31}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - // -1.0EV - {0x3047, 0x00}, - {0x3018, 0x20}, - {0x3019, 0x18}, - {0x301a, 0x41}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - // -0.7EV - {0x3047, 0x00}, - {0x3018, 0x28}, - {0x3019, 0x20}, - {0x301a, 0x51}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - // -0.3EV - {0x3047, 0x00}, - {0x3018, 0x30}, - {0x3019, 0x28}, - {0x301a, 0x61}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - // default - {0x3047, 0x00}, - {0x3018, 0x38}, - {0x3019, 0x30}, - {0x301a, 0x61}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - // +0.3EV - {0x3047, 0x00}, - {0x3018, 0x40}, - {0x3019, 0x38}, - {0x301a, 0x71}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure7[]= -{ - // +0.7EV - {0x3047, 0x00}, - {0x3018, 0x48}, - {0x3019, 0x40}, - {0x301a, 0x81}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure8[]= -{ - // +1.0EV - {0x3047, 0x00}, - {0x3018, 0x50}, - {0x3019, 0x48}, - {0x301a, 0x91}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure9[]= -{ - // 1.3EV - {0x3047, 0x00}, - {0x3018, 0x58}, - {0x3019, 0x50}, - {0x301a, 0x91}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure10[]= -{ - // 1.7EV - {0x3047, 0x00}, - {0x3018, 0x60}, - {0x3019, 0x58}, - {0x301a, 0xa1}, - - {0x0000, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,sensor_Exposure7,sensor_Exposure8,sensor_Exposure9, - sensor_Exposure10,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - // Saturation ¨C 2 - {0x3302, 0xef}, - {0x3355, 0x02}, - {0x3358, 0x10}, - {0x3359, 0x10}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - // Saturation ¨C 1 - {0x3302, 0xef}, - {0x3355, 0x02}, - {0x3358, 0x30}, - {0x3359, 0x30}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - // Saturation 0 - {0x3302, 0xef}, - {0x3355, 0x02}, - {0x3358, 0x40}, - {0x3359, 0x40}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Saturation3[]= -{ - // Saturation +1 - {0x3302, 0xef}, - {0x3355, 0x02}, - {0x3358, 0x50}, - {0x3359, 0x50}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Saturation4[]= -{ - // Saturation +2 - {0x3302, 0xef}, //bit[7]:1, enable SDE - {0x3355, 0x02}, //enable color saturation - {0x3358, 0x70}, - {0x3359, 0x70}, - - {0x0000, 0x00} -}; - -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, - sensor_Saturation3, sensor_Saturation4, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - // Contrast -3 - {0x3302, 0xef}, - {0x3355, 0x04}, - {0x3354, 0x01}, - {0x335c, 0x14}, - {0x335d, 0x14}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - // Contrast -2 - {0x3302, 0xef}, - {0x3355, 0x04}, - {0x3354, 0x01}, - {0x335c, 0x18}, - {0x335d, 0x18}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast2[]= -{ - // Contrast -1 - {0x3302, 0xef}, - {0x3355, 0x04}, - {0x3354, 0x01}, - {0x335c, 0x1c}, - {0x335d, 0x1c}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - // Contrast 0 - {0x3302, 0xef}, - {0x3355, 0x04}, - {0x3354, 0x01}, - {0x335c, 0x20}, - {0x335d, 0x20}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - // Contrast +1 - {0x3302, 0xef}, - {0x3355, 0x04}, - {0x3354, 0x01}, - {0x335c, 0x24}, - {0x335d, 0x24}, - - {0x0000, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - // Contrast +2 - {0x3302, 0xef}, - {0x3355, 0x04}, - {0x3354, 0x01}, - {0x335c, 0x28}, - {0x335d, 0x28}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - // Contrast +3 - {0x3302, 0xef}, - {0x3355, 0x04}, //bit[2] enable contrast/brightness - {0x3354, 0x01}, //bit[2] Yoffset sign - {0x335c, 0x2c}, - {0x335d, 0x2c}, - - {0x0000, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {0x307c, 0x12}, //mirror - {0x3090, 0xc8}, - {0x3023, 0x0a}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {0x307c, 0x10},// no mirror/flip - {0x3090, 0xc0}, - {0x3023, 0x0a}, - - {0x0000, 0x00} -}; - -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {0x307c, 0x11}, //flip - {0x3023, 0x09}, - {0x3090, 0xc0}, - - {0x0000, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {0x307c, 0x10}, // no mirror/flip - {0x3090, 0xc0}, - {0x3023, 0x0a}, - - {0x0000, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ - {0x3014, 0x84},//bit[3]=0 disable auto night mode - {0x3015, 0x12},// or 0x02 - {0x302d, 0x00},//clear dummy frame - {0x302e, 0x00},//clear dummy frame - - {0x0000, 0x00} -}; - -static struct reginfo sensor_SceneNight[] = -{ - {0x3014, 0x8c}, //bit[3] =1 enable auto night mode ¸ù¾Ý¹âÏßÇ¿Èõ×Ô¶¯½µÖ¡ - {0x3015, 0x22},//bit[6:4] ÉèÖò»Í¬,½µµÄÖ¡Âʲ»Ò»Ñù.¿ÉÒÔ¿´datasheet - //bit[6:4] - //000 no dummy frame - //001 1 dummy frame - //010 2 dummy frame - //011 3 dummy frame - //100 7 dummy frame - {0x0000, 0x00} -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom1[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom2[] = -{ - {0x0, 0x0}, -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {0x0, 0x0}, -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif -static struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = -5, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = -2, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - { - .id = V4L2_CID_FOCUS_AUTO, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Focus Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, -#if 0 //IF CONTINOUS IS SUPPORT, SET TO 1 - { - .id = V4L2_CID_FOCUS_CONTINUOUS, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Focus Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, -#endif - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_deactivate(struct i2c_client *client); -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf); -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} , - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG} -}; -enum sensor_wq_cmd -{ - WqCmd_af_init, - WqCmd_af_single, - WqCmd_af_special_pos, - WqCmd_af_far_pos, - WqCmd_af_near_pos, - WqCmd_af_continues, - WqCmd_af_return_idle, -}; -enum sensor_wq_result -{ - WqRet_success = 0, - WqRet_fail = -1, - WqRet_inval = -2 -}; -struct sensor_work -{ - struct i2c_client *client; - struct delayed_work dwork; - enum sensor_wq_cmd cmd; - wait_queue_head_t done; - enum sensor_wq_result result; - bool wait; - int var; -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int auto_focus; - int affm_reinit; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - struct reginfo *winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int enable; - unsigned int funmodule_state; -} sensor_info_priv_t; - - - -struct sensor_parameter -{ - unsigned short int preview_maxlines; - unsigned short int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int capture_framerate; - unsigned short int preview_framerate; - char awb[6]; -}; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - struct sensor_parameter parameter; - struct workqueue_struct *sensor_wq; - struct mutex wq_lock; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - -#if CONFIG_SENSOR_WRITE_REGS -static int sensor_write_regs(struct i2c_client *client, u8 *reg_info, int num) -{ - int err=0,cnt; - struct i2c_msg msg[1]; - - msg->len = num; - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = reg_info; - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - - cnt= 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg failed, try to write again!\n", SENSOR_NAME_STRING()); - udelay(10); - } - } - - return err; - -} - -#endif -/* sensor register write */ -static int sensor_write(struct i2c_client *client, u16 reg, u8 val) -{ - int err,cnt; - u8 buf[3]; - struct i2c_msg msg[1]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - buf[2] = val; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 1; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u16 reg, u8 *val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[2]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:2==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:2==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 1; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err=0, cnt; - int i = 0; -#if CONFIG_SENSOR_Focus - struct sensor *sensor = to_sensor(client); -#endif -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif -#if CONFIG_SENSOR_WRITE_REGS - int j = 0, reg_num; - u8 *ptemp, *phead; - int reg_length; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - while (regarray[i].reg != SEQUENCE_END) { - #if CONFIG_SENSOR_Focus - if ((regarray == sensor_af_firmware) && (sensor->info_priv.enable == 0)) { - SENSOR_DG("%s disable, Download af firmware terminated!\n",SENSOR_NAME_STRING()); - err = -EINVAL; - goto sensor_write_array_end; - } - #endif - -#if CONFIG_SENSOR_WRITE_REGS - - j = i; - reg_num = 2; - reg_length = 0x0001; - - while((regarray[i].reg + reg_length) == regarray[i+1].reg) { - i++; - reg_num++; - if(reg_num >= WRITE_REGS_NUM) - break; - } - - if(reg_num > 2) { - - int size_num; - size_num = reg_num + 1; - - ptemp = phead = (u8*)kmalloc((size_num+10)*sizeof(u8),GFP_KERNEL); - if (!phead) { - SENSOR_DG("-------------write registers allocate memory fail!!!\n"); - i = j; - err = sensor_write(client, regarray[i].reg, regarray[i].val); - } else { - *phead = regarray[j].reg >> 8; - *(ptemp+1) = regarray[j].reg & 0xFF; - ptemp += 2; - for( ; reg_num > 0; reg_num --, j++) { - *ptemp ++ = regarray[j].val; - } - - ptemp = phead; - err = sensor_write_regs(client, ptemp,size_num); - kfree(phead); - } - }else{ - err = sensor_write(client, regarray[i].reg, regarray[i].val); - } -#else - err = sensor_write(client, regarray[i].reg, regarray[i].val); -#endif - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - i++; - } - - #if CONFIG_SENSOR_Focus - if (((regarray->reg == SEQUENCE_PROPERTY) && (regarray->val == SEQUENCE_INIT)) - || (regarray == sensor_init_data)) { - sensor->info_priv.affm_reinit = 1; - } - #endif - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != 0) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif -#if CONFIG_SENSOR_Focus -struct af_cmdinfo -{ - char cmd_tag; - char cmd_para[4]; - char validate_bit; -}; -static int sensor_af_cmdset(struct i2c_client *client, int cmd_main, struct af_cmdinfo *cmdinfo) -{ - int i; - char read_tag=0xff,cnt; - - if (cmdinfo) { - if (cmdinfo->validate_bit & 0x80) { - if (sensor_write(client, CMD_ACK_Reg, cmdinfo->cmd_tag)) { - SENSOR_TR("%s write CMD_ACK_Reg(main:0x%x tag:0x%x) error!\n",SENSOR_NAME_STRING(),cmd_main,cmdinfo->cmd_tag); - goto sensor_af_cmdset_err; - } - SENSOR_DG("%s write CMD_ACK_Reg(main:0x%x tag:0x%x) success!\n",SENSOR_NAME_STRING(),cmd_main,cmdinfo->cmd_tag); - } - for (i=0; i<4; i++) { - if (cmdinfo->validate_bit & (1<cmd_para[i])) { - SENSOR_TR("%s write CMD_PARA_Reg(main:0x%x para%d:0x%x) error!\n",SENSOR_NAME_STRING(),cmd_main,i,cmdinfo->cmd_para[i]); - goto sensor_af_cmdset_err; - } - SENSOR_DG("%s write CMD_PARA_Reg(main:0x%x para%d:0x%x) success!\n",SENSOR_NAME_STRING(),cmd_main,i,cmdinfo->cmd_para[i]); - } - } - } else { - if (sensor_write(client, CMD_ACK_Reg, 0xff)) { - SENSOR_TR("%s write CMD_ACK_Reg(main:0x%x no tag) error!\n",SENSOR_NAME_STRING(),cmd_main); - goto sensor_af_cmdset_err; - } - SENSOR_DG("%s write CMD_ACK_Reg(main:0x%x no tag) success!\n",SENSOR_NAME_STRING(),cmd_main); - } - - if (sensor_write(client, CMD_MAIN_Reg, cmd_main)) { - SENSOR_TR("%s write CMD_MAIN_Reg(main:0x%x) error!\n",SENSOR_NAME_STRING(),cmd_main); - goto sensor_af_cmdset_err; - } - - cnt = 0; - do - { - msleep(5); - if (sensor_read(client,CMD_ACK_Reg,&read_tag)){ - SENSOR_TR("%s[%d] read TAG failed\n",SENSOR_NAME_STRING(),__LINE__); - break; - } - } while((read_tag != 0x00)&& (cnt++<100)); - - SENSOR_DG("%s write CMD_MAIN_Reg(main:0x%x read tag:0x%x) success!\n",SENSOR_NAME_STRING(),cmd_main,read_tag); - return 0; -sensor_af_cmdset_err: - return -1; -} - -static int sensor_af_idlechk(struct i2c_client *client) -{ - int ret = 0; - char state; - struct af_cmdinfo cmdinfo; - - SENSOR_DG("%s , %d\n",__FUNCTION__,__LINE__); - - cmdinfo.cmd_tag = 0x01; - cmdinfo.validate_bit = 0x80; - ret = sensor_af_cmdset(client, ReturnIdle_Cmd, &cmdinfo); - if(0 != ret) { - SENSOR_TR("%s[%d] read focus_status failed\n",SENSOR_NAME_STRING(),__LINE__); - ret = -1; - goto sensor_af_idlechk_end; - } - - - do{ - ret = sensor_read(client, CMD_ACK_Reg, &state); - if (ret != 0){ - SENSOR_TR("%s[%d] read focus_status failed\n",SENSOR_NAME_STRING(),__LINE__); - ret = -1; - goto sensor_af_idlechk_end; - } - }while(0x00 != state); - - -sensor_af_idlechk_end: - return ret; -} - -static int sensor_af_single(struct i2c_client *client) -{ - int ret = 0; - char state,cnt; - struct af_cmdinfo cmdinfo; - - cmdinfo.cmd_tag = 0x01; - cmdinfo.validate_bit = 0x80; - ret = sensor_af_cmdset(client, SingleFocus_Cmd, &cmdinfo); - if(0 != ret) { - SENSOR_TR("%s single focus mode set error!\n",SENSOR_NAME_STRING()); - ret = -1; - goto sensor_af_single_end; - } - - cnt = 0; - do - { - if (cnt != 0) { - msleep(1); - } - cnt++; - ret = sensor_read(client, STA_FOCUS_Reg, &state); - if (ret != 0){ - SENSOR_TR("%s[%d] read focus_status failed\n",SENSOR_NAME_STRING(),__LINE__); - ret = -1; - goto sensor_af_single_end; - } - }while((state == S_FOCUSING) && (cnt<100)); - - if (state != S_FOCUSED) { - SENSOR_TR("%s[%d] focus state(0x%x) is error!\n",SENSOR_NAME_STRING(),__LINE__,state); - ret = -1; - goto sensor_af_single_end; - } - - //sensor_af_cmdset(client, ReturnIdle_Cmd, NULL); // by duanyp. fix af blur when taking pictures -sensor_af_single_end: - return ret; -} - -static int sensor_af_const(struct i2c_client *client) -{ - int ret = 0; - - - return ret; -} - - -static int sensor_af_init(struct i2c_client *client) -{ - int ret = 0; - char state,cnt; - - ret = sensor_write_array(client, sensor_af_firmware); - if (ret != 0) { - SENSOR_TR("%s Download firmware failed\n",SENSOR_NAME_STRING()); - ret = -1; - goto sensor_af_init_end; - } - - cnt = 0; - do - { - if (cnt != 0) { - msleep(1); - } - cnt++; - ret = sensor_read(client, STA_FOCUS_Reg, &state); - if (ret != 0){ - SENSOR_TR("%s[%d] read focus_status failed\n",SENSOR_NAME_STRING(),__LINE__); - ret = -1; - goto sensor_af_init_end; - } - }while((state == S_STARTUP) && (cnt<100)); - - if (state != S_IDLE) { - SENSOR_TR("%s focus state(0x%x) is error!\n",SENSOR_NAME_STRING(),state); - ret = -1; - goto sensor_af_init_end; - } - -sensor_af_init_end: - SENSOR_DG("%s %s ret:0x%x \n",SENSOR_NAME_STRING(),__FUNCTION__,ret); - return ret; -} - -static int sensor_af_downfirmware(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - int ret=0; - struct soc_camera_device *icd = client->dev.platform_data; - struct v4l2_mbus_framefmt mf; - - SENSOR_DG("%s %s Enter\n",SENSOR_NAME_STRING(), __FUNCTION__); - - if (sensor_af_init(client)) { - sensor->info_priv.funmodule_state &= (~SENSOR_AF_IS_OK); - ret = -1; - } else { - sensor->info_priv.funmodule_state |= SENSOR_AF_IS_OK; - - mf.width = icd->user_width; - mf.height = icd->user_height; - mf.code = sensor->info_priv.fmt.code; - mf.colorspace = sensor->info_priv.fmt.colorspace; - mf.field = V4L2_FIELD_NONE; - if (sensor_fmt_videochk(NULL, &mf) == true) { /* ddl@rock-chips.com: focus mode fix const auto focus in video */ - ret = sensor_af_const(client); - } else { - switch (sensor->info_priv.auto_focus) - { - case SENSOR_AF_MODE_AUTO: - { - ret = sensor_af_single(client); - break; - } - case SENSOR_AF_MODE_CLOSE: - { - ret = 0; - break; - } - default: - { - SENSOR_DG("%s focus mode(0x%x) is unkonwn\n",SENSOR_NAME_STRING(),sensor->info_priv.auto_focus); - goto sensor_af_downfirmware_end; - } - } - } - SENSOR_DG("%s sensor_af_downfirmware set focus mode(0x%x) ret:0x%x\n",SENSOR_NAME_STRING(), sensor->info_priv.auto_focus,ret); - } - -sensor_af_downfirmware_end: - - return ret; -} -static void sensor_af_workqueue(struct work_struct *work) -{ - struct sensor_work *sensor_work = container_of(work, struct sensor_work, dwork.work); - struct i2c_client *client = sensor_work->client; - struct sensor *sensor = to_sensor(client); - struct af_cmdinfo cmdinfo; - - SENSOR_DG("%s %s Enter, cmd:0x%x \n",SENSOR_NAME_STRING(), __FUNCTION__,sensor_work->cmd); - - mutex_lock(&sensor->wq_lock); - - switch (sensor_work->cmd) - { - case WqCmd_af_init: - { - if (sensor_af_downfirmware(client) < 0) { - SENSOR_TR("%s Sensor_af_init is failed in sensor_af_workqueue!\n",SENSOR_NAME_STRING()); - } - break; - } - case WqCmd_af_single: - { - if (sensor_af_single(client) < 0) { - SENSOR_TR("%s Sensor_af_single is failed in sensor_af_workqueue!\n",SENSOR_NAME_STRING()); - sensor_work->result = WqRet_fail; - } else { - sensor_work->result = WqRet_success; - } - break; - } - case WqCmd_af_special_pos: - { - sensor_af_idlechk(client); - - cmdinfo.cmd_tag = StepFocus_Spec_Tag; - cmdinfo.cmd_para[0] = sensor_work->var; - cmdinfo.validate_bit = 0x81; - if (sensor_af_cmdset(client, StepMode_Cmd, &cmdinfo) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_near_pos: - { - sensor_af_idlechk(client); - cmdinfo.cmd_tag = StepFocus_Near_Tag; - cmdinfo.validate_bit = 0x80; - if (sensor_af_cmdset(client, StepMode_Cmd, &cmdinfo) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_far_pos: - { - sensor_af_idlechk(client); - cmdinfo.cmd_tag = StepFocus_Far_Tag; - cmdinfo.validate_bit = 0x80; - if (sensor_af_cmdset(client, StepMode_Cmd, &cmdinfo) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_continues: - { - if (sensor_af_const(client) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_return_idle: - { - if (sensor_af_idlechk(client) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - default: - SENSOR_TR("Unknow command(%d) in %s af workqueue!",sensor_work->cmd,SENSOR_NAME_STRING()); - break; - } -//set_end: - if (sensor_work->wait == false) { - kfree((void*)sensor_work); - } else { - wake_up(&sensor_work->done); - } - mutex_unlock(&sensor->wq_lock); - return; -} - -static int sensor_af_workqueue_set(struct soc_camera_device *icd, enum sensor_wq_cmd cmd, int var, bool wait) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - struct sensor_work *wk; - int ret=0; - - if (sensor->sensor_wq == NULL) { - ret = -EINVAL; - goto sensor_af_workqueue_set_end; - } - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) != SENSOR_AF_IS_OK) { - if (cmd != WqCmd_af_init) { - SENSOR_TR("%s %s cmd(%d) ingore,because af module isn't ready!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - ret = -1; - goto sensor_af_workqueue_set_end; - } - } - - wk = kzalloc(sizeof(struct sensor_work), GFP_KERNEL); - if (wk) { - wk->client = client; - INIT_WORK(&(wk->dwork.work), sensor_af_workqueue); - wk->cmd = cmd; - wk->result = WqRet_inval; - wk->wait = wait; - wk->var = var; - init_waitqueue_head(&wk->done); - - queue_delayed_work(sensor->sensor_wq,&(wk->dwork),0); - - /* ddl@rock-chips.com: - * video_lock is been locked in v4l2_ioctl function, but auto focus may slow, - * As a result any other ioctl calls will proceed very, very slowly since each call - * will have to wait for the AF to finish. Camera preview is pause,because VIDIOC_QBUF - * and VIDIOC_DQBUF is sched. so unlock video_lock here. - */ - if (wait == true) { - mutex_unlock(&icd->video_lock); - if (wait_event_timeout(wk->done, (wk->result != WqRet_inval), msecs_to_jiffies(2500)) == 0) { - SENSOR_TR("%s %s cmd(%d) is timeout!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - } - ret = wk->result; - kfree((void*)wk); - mutex_lock(&icd->video_lock); - } - - } else { - SENSOR_TR("%s %s cmd(%d) ingore,because struct sensor_work malloc failed!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - ret = -1; - } -sensor_af_workqueue_set_end: - return ret; -} -#endif -static int sensor_parameter_record(struct i2c_client *client) -{ - u8 ret_l,ret_m,ret_h; - u8 tp_l,tp_m,tp_h; - struct sensor *sensor = to_sensor(client); - - sensor_write(client,0x3503,0x07); //stop AE/AG - sensor_write(client,0x3406,0x01); //stop AWB - - sensor_read(client,0x3500,&ret_h); - sensor_read(client,0x3501, &ret_m); - sensor_read(client,0x3502, &ret_l); - tp_l = ret_l; - tp_m = ret_m; - tp_h = ret_h; - SENSOR_DG(" %s Read 0x3500 = 0x%02x 0x3501 = 0x%02x 0x3502=0x%02x \n",SENSOR_NAME_STRING(), ret_h, ret_m, ret_l); - //sensor->parameter.preview_exposure = (tp_h<<12)+(tp_m<<4)+(tp_l>>4); - sensor->parameter.preview_exposure = ((((tp_h & 0x0f) << 8)+ tp_m) << 4) + (tp_l>>4); - - sensor_read(client,0x350c, &ret_h); - sensor_read(client,0x350d, &ret_l); - sensor->parameter.preview_line_width = ret_h & 0xff; - sensor->parameter.preview_line_width = (sensor->parameter.preview_line_width << 8) +ret_l; - //Read back AGC Gain for preview - sensor_read(client,0x350a, &ret_h); - sensor_read(client,0x350b, &tp_l); - sensor->parameter.preview_gain = ((ret_h & 0x01) << 8) + tp_l; - //preview_maxlines - sensor_read(client,0x380e, &ret_h); - sensor->parameter.preview_maxlines = ret_h; - sensor->parameter.preview_maxlines <<= 8; - sensor_read(client,0x380f, &tp_l); - sensor->parameter.preview_maxlines += tp_l; - - sensor->parameter.capture_framerate = 375; - sensor->parameter.preview_framerate = 1500; - - sensor_read(client,0x3400,&sensor->parameter.awb[0]); //record awb value - sensor_read(client,0x3401,&sensor->parameter.awb[1]); - sensor_read(client,0x3402,&sensor->parameter.awb[2]); - sensor_read(client,0x3403,&sensor->parameter.awb[3]); - sensor_read(client,0x3404,&sensor->parameter.awb[4]); - sensor_read(client,0x3405,&sensor->parameter.awb[5]); - - SENSOR_DG(" %s Read 0x350c = 0x%02x 0x350d = 0x%02x 0x350b=0x%02x \n",SENSOR_NAME_STRING(), ret_h, ret_l, sensor->parameter.preview_gain); - return 0; -} -static int sensor_ae_transfer(struct i2c_client *client) -{ - u8 ExposureLow; - u8 ExposureMid; - u8 ExposureHigh; - u16 ulCapture_Exposure; - u32 ulCapture_Exposure_Gain; - u16 iCapture_Gain; - u8 Lines_10ms; - bool m_60Hz = 0; - u8 reg_l = 0,reg_h =0; - u16 Preview_Maxlines; - u8 Gain; - u32 Capture_MaxLines; - struct sensor *sensor = to_sensor(client); - - //Preview_Maxlines = sensor->parameter.preview_line_width; - Preview_Maxlines = sensor->parameter.preview_maxlines; - Gain = sensor->parameter.preview_gain; - /* - sensor_read(client,0x350c, ®_h); - sensor_read(client,0x350d, ®_l); - Capture_MaxLines = reg_h & 0xff; - Capture_MaxLines = (Capture_MaxLines << 8) + reg_l; - */ - //capture_maxlines - sensor_read(client,0x380e, ®_h); - Capture_MaxLines = reg_h; - Capture_MaxLines <<= 8; - sensor_read(client,0x380f, ®_l); - Capture_MaxLines += reg_l; - - if(m_60Hz== 1) { - Lines_10ms = sensor->parameter.capture_framerate * Capture_MaxLines/12000; - } else { - Lines_10ms = sensor->parameter.capture_framerate * Capture_MaxLines/10000; - } - Lines_10ms = Lines_10ms & 0xffff; - - if(Preview_Maxlines == 0) - Preview_Maxlines = 1; - - //ulCapture_Exposure = - // (sensor->parameter.preview_exposure*(sensor->parameter.capture_framerate)*(Capture_MaxLines))/(((Preview_Maxlines)*(sensor->parameter.preview_framerate))); - - ulCapture_Exposure = - ((sensor->parameter.preview_exposure*(((sensor->parameter.capture_framerate)*(Capture_MaxLines) + 50)/100)) << 1)/(((Preview_Maxlines)*(sensor->parameter.preview_framerate) + 50)/100); - ulCapture_Exposure = ulCapture_Exposure & 0xffff; - - iCapture_Gain = (Gain & 0x0f) + 16; - if (Gain & 0x10) { - iCapture_Gain = iCapture_Gain << 1; - } - if (Gain & 0x20) { - iCapture_Gain = iCapture_Gain << 1; - } - if (Gain & 0x40) { - iCapture_Gain = iCapture_Gain << 1; - } - if (Gain & 0x80) { - iCapture_Gain = iCapture_Gain << 1; - } - - //ulCapture_Exposure_Gain =(u32) (11 * ulCapture_Exposure * iCapture_Gain/5); //0ld value 2.5, ½â¾ö¹ýÁÁ - ulCapture_Exposure_Gain =(u32) (ulCapture_Exposure * iCapture_Gain); - - if(ulCapture_Exposure_Gain < Capture_MaxLines*16) { - ulCapture_Exposure = ulCapture_Exposure_Gain/16; - if (ulCapture_Exposure > Lines_10ms) - { - //ulCapture_Exposure *= 1.7; - ulCapture_Exposure /= Lines_10ms; - ulCapture_Exposure *= Lines_10ms; - } - } else { - ulCapture_Exposure = Capture_MaxLines; - //ulCapture_Exposure_Gain *= 1.5; - } - - if(ulCapture_Exposure == 0) - ulCapture_Exposure = 1; - - iCapture_Gain = ((ulCapture_Exposure_Gain << 1)/ulCapture_Exposure + 1) >> 1; - iCapture_Gain = iCapture_Gain & 0xffff; - - ExposureLow = ((unsigned char)ulCapture_Exposure)<<4; - ExposureMid = (unsigned char)(ulCapture_Exposure >> 4) & 0xff; - ExposureHigh = (unsigned char)(ulCapture_Exposure >> 12); - - //Gain = 0; - Gain = 0x10; - if (iCapture_Gain > 31) { - Gain |= 0x10; - iCapture_Gain = iCapture_Gain >> 1; - } - if (iCapture_Gain > 31) { - Gain |= 0x20; - iCapture_Gain = iCapture_Gain >> 1; - } - if (iCapture_Gain > 31) { - Gain |= 0x40; - iCapture_Gain = iCapture_Gain >> 1; - } - if (iCapture_Gain > 31) { - Gain |= 0x80; - iCapture_Gain = iCapture_Gain >> 1; - } - if (iCapture_Gain > 16) - Gain |= ((iCapture_Gain -16) & 0x0f); - if(Gain == 0x10) - Gain = 0x11; - // write the gain and exposure to 0x350* registers - //m_iWrite0x350b=Gain; - sensor_write(client,0x350b, Gain); - Gain = (Gain >> 8) & 0x01; - sensor_write(client,0x350a, Gain); - //m_iWrite0x3502=ExposureLow; - sensor_write(client,0x3502, ExposureLow); - //m_iWrite0x3501=ExposureMid; - sensor_write(client,0x3501, ExposureMid); - //m_iWrite0x3500=ExposureHigh; - sensor_write(client,0x3500, ExposureHigh); - // SendToFile("Gain = 0x%x\r\n", Gain); - // SendToFile("ExposureLow = 0x%x\r\n", ExposureLow); - // SendToFile("ExposureMid = 0x%x\r\n", ExposureMid); - // SendToFile("ExposureHigh = 0x%x\r\n", ExposureHigh); - //¼Ó³¤ÑÓʱ£¬±ÜÃâ°µ´¦ÅÄÕÕʱµÄÃ÷°µ·Ö½çÎÊÌâ - //camera_timed_wait(200); - //linzhk camera_timed_wait(500); - - sensor_write(client,0x3400,sensor->parameter.awb[0]); // resume awb value - sensor_write(client,0x3401,sensor->parameter.awb[1]); - sensor_write(client,0x3402,sensor->parameter.awb[2]); - sensor_write(client,0x3403,sensor->parameter.awb[3]); - sensor_write(client,0x3404,sensor->parameter.awb[4]); - sensor_write(client,0x3405,sensor->parameter.awb[5]); - - SENSOR_DG(" %s Write 0x350b = 0x%02x 0x3502 = 0x%02x 0x3501=0x%02x 0x3500 = 0x%02x\n",SENSOR_NAME_STRING(), Gain, ExposureLow, ExposureMid, ExposureHigh); - mdelay(100); - return 0; -} -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),cmd); - break; - } - } - -sensor_power_end: - return ret; -} -#if CONFIG_SENSOR_Flash -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} -#endif -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - char value; - int ret,pid = 0; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } -/* ddl@rock-chips.com : ov3640_powerOn have hardware reset */ -#if 0 - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - ret = sensor_write(client, 0x3012, 0x80); - if (ret != 0) - { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); //delay 5 microseconds -#endif - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x300a, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value << 8); - - ret = sensor_read(client, 0x300b, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - - sensor->info_priv.winseqe_cur_addr = (struct reginfo *)SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - // sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE);//?,JYK - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - //sensor_set_flash(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - - sensor->info_priv.funmodule_state = SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - sensor_ioctrl(icd, Sensor_PowerDown, 1); - msleep(100); - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - msleep(100); - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - return 0; -} -static struct reginfo sensor_power_down_sequence[]= -{ - {0x361e, 0x00}, - {0x308d, 0x06}, - {0x30ad, 0x82}, - {0x308d, 0x0f}, - - {0x0000, 0x00}, -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - return 0; -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - int ret = 0, set_w,set_h; - int isCapture = 0; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - isCapture = sensor_fmt_capturechk(sd, mf); - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[isCapture][0].reg) - { - winseqe_set_addr = sensor_qcif[isCapture]; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[isCapture][0].reg) - { - winseqe_set_addr = sensor_qvga[isCapture]; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[isCapture][0].reg) - { - winseqe_set_addr = sensor_cif[isCapture]; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[isCapture][0].reg) - { - winseqe_set_addr = sensor_vga[isCapture]; - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[isCapture][0].reg) - { - winseqe_set_addr = sensor_svga[isCapture]; - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1024) && (set_h <= 768)) && sensor_sxga[isCapture][0].reg) - { - winseqe_set_addr = sensor_xga[isCapture]; - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 960)) && sensor_sxga[isCapture][0].reg) - { - winseqe_set_addr = sensor_sxga[isCapture]; - set_w = 1280; - set_h = 960; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && sensor_uxga[isCapture][0].reg) - { - winseqe_set_addr = sensor_uxga[isCapture]; - set_w = 1600; - set_h = 1200; - } - else if (((set_w <= 2048) && (set_h <= 1536)) && sensor_uxga[isCapture][0].reg) - { - winseqe_set_addr = sensor_qxga[isCapture]; - set_w = 2048; - set_h = 1536; - } - else - { - winseqe_set_addr = (struct reginfo *)SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if (winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) - { - //srt --if capture,then should write sensor_qxga[1] first - if((winseqe_set_addr != sensor_qxga[isCapture]) && isCapture) { - SENSOR_DG("%s write sensor_qxga[1]\n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_qxga[isCapture]); - if (ret != 0) { - SENSOR_TR("%s write sensor_qxga[1] failed\n", SENSOR_NAME_STRING()); - return ret; - } - } - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - sensor_parameter_record(client); - /*#if CONFIG_SENSOR_Focus - sensor_af_idlechk(client); - if (sensor->info_priv.auto_focus == SENSOR_AF_MODE_CONTINUOUS) - sensor_af_cmdset(client, PauseFocus_Cmd, NULL); - #endif*/ - #if CONFIG_SENSOR_Flash - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - #endif - }else { /* ddl@rock-chips.com : Video */ - #if CONFIG_SENSOR_Flash - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - #endif - } - if ((sensor->info_priv.winseqe_cur_addr->reg == SEQUENCE_PROPERTY) && (sensor->info_priv.winseqe_cur_addr->val == SEQUENCE_INIT)) { - if (((winseqe_set_addr->reg == SEQUENCE_PROPERTY) && (winseqe_set_addr->val == SEQUENCE_NORMAL)) - || (winseqe_set_addr->reg != SEQUENCE_PROPERTY)) { - ret |= sensor_write_array(client,sensor_init_data); - SENSOR_DG("\n%s reinit ret:0x%x \n",SENSOR_NAME_STRING(), ret); - } - } - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - sensor->info_priv.winseqe_cur_addr = winseqe_set_addr; - - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - sensor_ae_transfer(client); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - if (sensor->info_priv.whiteBalance != 0) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - sensor->info_priv.snap2preview = true; - } else if (sensor_fmt_videochk(sd,mf) == true) { /* ddl@rock-chips.com : Video */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - - sensor->info_priv.video2preview = true; - } else if ((sensor->info_priv.snap2preview == true) || (sensor->info_priv.video2preview == true)) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - if (sensor->info_priv.snap2preview == true) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - #if CONFIG_SENSOR_Focus - if (sensor->info_priv.auto_focus == SENSOR_AF_MODE_AUTO) { - sensor_af_workqueue_set(icd,WqCmd_af_return_idle,0,true); - msleep(200); - } else { - msleep(500); - } - #else - msleep(500); - #endif - sensor->info_priv.video2preview = false; - sensor->info_priv.snap2preview = false; - } - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - mf->width = set_w; - mf->height = set_h; -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - int isCapture = 0; - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - isCapture = sensor_fmt_capturechk(sd, mf); - if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[isCapture][0].reg!=SEQUENCE_END)) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[isCapture][0].reg!=SEQUENCE_END)) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[isCapture][0].reg!=SEQUENCE_END)) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[isCapture][0].reg!=SEQUENCE_END)) - { - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && (sensor_svga[isCapture][0].reg!=SEQUENCE_END)) - { - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1024) && (set_h <= 768)) && (sensor_xga[isCapture][0].reg!=SEQUENCE_END)) - { - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 720)) && (sensor_720p[0].reg!=SEQUENCE_END)) - { - set_w = 1280; - set_h = 720; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[isCapture][0].reg!=SEQUENCE_END)) - { - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[isCapture][0].reg!=SEQUENCE_END)) - { - set_w = 1600; - set_h = 1200; - } - else if (((set_w <= 1920) && (set_h <= 1080)) && (sensor_1080p[0].reg!=SEQUENCE_END)) - { - set_w = 1920; - set_h = 1080; - } - else if (((set_w <= 2048) && (set_h <= 1536)) && (sensor_qxga[isCapture][0].reg!=SEQUENCE_END)) - { - set_w = 2048; - set_h = 1536; - } - else if (((set_w <= 2592) && (set_h <= 1944)) && (sensor_qsxga[0].reg!=SEQUENCE_END)) - { - set_w = 2592; - set_h = 1944; - } - else - { - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - - mf->width = set_w; - mf->height = set_h; - - mf->colorspace = fmt->colorspace; - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV3640 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n%s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((*value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value > 0) && ((digitalzoom_cur + *value) > digitalzoom_total)) - { - *value = digitalzoom_total - digitalzoom_cur; - } - - if ((*value < 0) && ((digitalzoom_cur + *value) < 0)) - { - *value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += *value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, *value); - return 0; - } - - return -EINVAL; -} -#endif - -#if CONFIG_SENSOR_Focus -#if 0 -static int sensor_set_focus_absolute(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int ret = 0; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (!qctrl_info) - return -EINVAL; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - if ((value >= qctrl_info->minimum) && (value <= qctrl_info->maximum)) { - ret = sensor_af_workqueue_set(icd, WqCmd_af_special_pos, value, true); - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EINVAL; - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - } - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - - return ret; -} -#endif -static int sensor_set_focus_relative(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int ret = 0; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_RELATIVE); - if (!qctrl_info) - return -EINVAL; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - if ((value >= qctrl_info->minimum) && (value <= qctrl_info->maximum)) { - if (value > 0) { - ret = sensor_af_workqueue_set(icd, WqCmd_af_near_pos, 0, true); - } else { - ret = sensor_af_workqueue_set(icd, WqCmd_af_far_pos, 0, true); - } - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EINVAL; - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - } - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - return ret; -} - -static int sensor_set_focus_mode(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int ret = 0; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - switch (value) - { - case SENSOR_AF_MODE_AUTO: - { - ret = sensor_af_workqueue_set(icd, WqCmd_af_single, 0, true); - break; - } - /* - case SENSOR_AF_MODE_MACRO: - { - ret = sensor_set_focus_absolute(icd, qctrl, 0xff); - break; - } - - case SENSOR_AF_MODE_INFINITY: - { - ret = sensor_set_focus_absolute(icd, qctrl, 0x00); - break; - } - - case SENSOR_AF_MODE_CONTINUOUS: - { - ret = sensor_af_workqueue_set(icd, WqCmd_af_continues, 0, true); - break; - }*/ - default: - SENSOR_TR("\n %s..%s AF value(0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__,value); - break; - - } - - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - - return ret; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %d\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - sensor_set_focus_relative(icd, qctrl,ext_ctrl->value); - break; - } - case V4L2_CID_FOCUS_AUTO: - { - if (ext_ctrl->value == 1) { - if (sensor_set_focus_mode(icd, qctrl,SENSOR_AF_MODE_AUTO) != 0) { - if(0 == (sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK)) { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_AUTO; - } - return -EINVAL; - } - sensor->info_priv.auto_focus = SENSOR_AF_MODE_AUTO; - } else if (SENSOR_AF_MODE_AUTO == sensor->info_priv.auto_focus){ - if (ext_ctrl->value == 0) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CLOSE; - } - break; - } - case V4L2_CID_FOCUS_CONTINUOUS: - { - /*if (SENSOR_AF_MODE_CONTINUOUS != sensor->info_priv.auto_focus) { - if (ext_ctrl->value == 1) { - if (sensor_set_focus_mode(icd, qctrl,SENSOR_AF_MODE_CONTINUOUS) != 0) - return -EINVAL; - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CONTINUOUS; - } - } else { - if (ext_ctrl->value == 0) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CLOSE; - }*/ - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_stream(struct v4l2_subdev *sd, int enable) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - #if CONFIG_SENSOR_Focus - struct soc_camera_device *icd = client->dev.platform_data; - struct v4l2_mbus_framefmt mf; - #endif - - if (enable == 1) { - sensor->info_priv.enable = 1; - #if CONFIG_SENSOR_Focus - mf.width = icd->user_width; - mf.height = icd->user_height; - mf.code = sensor->info_priv.fmt.code; - mf.colorspace = sensor->info_priv.fmt.colorspace; - mf.field = V4L2_FIELD_NONE; - /* If auto focus firmware haven't download success, must download firmware again when in video or preview stream on */ - if (sensor_fmt_capturechk(sd, &mf) == false) { - if ((sensor->info_priv.affm_reinit == 1) || ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK)==0)) { - sensor_af_workqueue_set(icd, WqCmd_af_init, 0, false); - sensor->info_priv.affm_reinit = 0; - } - } - #endif - } else if (enable == 0) { - sensor->info_priv.enable = 0; - #if CONFIG_SENSOR_Focus - flush_workqueue(sensor->sensor_wq); - #endif - } - return 0; -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char value; - int ret,pid = 0; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - /* soft reset */ - ret = sensor_write(client, 0x3012, 0x80); - if (ret != 0) { - SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - mdelay(5); //delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x300a, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid |= (value << 8); - - ret = sensor_read(client, 0x300b, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - return 0; - -sensor_video_probe_err: - return ret; -} -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0,i; - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - sensor->sensor_gpio_res = NULL; - for (i=0; isensor_io_request->gpio_res[i].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[i].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[i]; - } - } - if (sensor->sensor_gpio_res == NULL) { - SENSOR_TR("%s %s obtain gpio resource failed when RK29_CAM_SUBDEV_IOREQUEST \n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - printk("flash io:%d\n",sensor->sensor_gpio_res->gpio_flash); - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } - -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, - .s_stream = sensor_s_stream, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - sensor->info_priv.fmt = sensor_colour_fmts[0]; - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } else { - #if CONFIG_SENSOR_Focus - sensor->sensor_wq = create_workqueue(SENSOR_NAME_STRING(_af_workqueue)); - if (sensor->sensor_wq == NULL) - SENSOR_TR("%s create fail!", SENSOR_NAME_STRING(_af_workqueue)); - mutex_init(&sensor->wq_lock); - #endif - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - #if CONFIG_SENSOR_Focus - if (sensor->sensor_wq) { - destroy_workqueue(sensor->sensor_wq); - sensor->sensor_wq = NULL; - } - #endif - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - diff --git a/drivers/media/video/ov3640.h b/drivers/media/video/ov3640.h deleted file mode 100755 index 213c5dc2ea88..000000000000 --- a/drivers/media/video/ov3640.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Driver for OV5642 CMOS Image Sensor from OmniVision - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#ifndef __OV3640_H__ -#define __OV3640_H__ -struct reginfo -{ - u16 reg; - u8 val; -}; - -#define SEQUENCE_INIT 0x00 -#define SEQUENCE_NORMAL 0x01 - -#define SEQUENCE_PROPERTY 0xFFFD -#define SEQUENCE_WAIT_MS 0xFFFE -#define SEQUENCE_END 0x0000 -#endif - diff --git a/drivers/media/video/ov3640_af_firmware.c b/drivers/media/video/ov3640_af_firmware.c deleted file mode 100755 index f11019389bac..000000000000 --- a/drivers/media/video/ov3640_af_firmware.c +++ /dev/null @@ -1,3477 +0,0 @@ -/* - * Driver for OV5642 CMOS Image Sensor from OmniVision - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#define VCM_DRIVER_A3907 0 -#define VCM_DRIVER_AD5820 1 -#define VCM_DRIVER_DW9710 2 -#define VCM_DRIVER VCM_DRIVER_AD5820 - - -#if (VCM_DRIVER == VCM_DRIVER_AD5820) -static struct reginfo sensor_af_firmware[ ]= -{ - {0x308c,0x00}, - {0x3104,0x02}, - {0x3105,0xff}, - {0x3106,0x00}, - {0x3107,0xff}, - {0x8000,0x02}, - {0x8001,0x00}, - {0x8002,0x06}, - {0x8003,0x02}, - {0x8004,0x07}, - {0x8005,0xa9}, - {0x8006,0x78}, - {0x8007,0x7f}, - {0x8008,0xe4}, - {0x8009,0xf6}, - {0x800a,0xd8}, - {0x800b,0xfd}, - {0x800c,0x75}, - {0x800d,0x81}, - {0x800e,0x45}, - {0x800f,0x02}, - {0x8010,0x0a}, - {0x8011,0xdf}, - {0x8012,0x32}, - {0x8013,0x02}, - {0x8014,0x00}, - {0x8015,0x12}, - {0x8016,0xe8}, - {0x8017,0x8f}, - {0x8018,0xf0}, - {0x8019,0xa4}, - {0x801a,0xcc}, - {0x801b,0x8b}, - {0x801c,0xf0}, - {0x801d,0xa4}, - {0x801e,0x2c}, - {0x801f,0xfc}, - {0x8020,0xe9}, - {0x8021,0x8e}, - {0x8022,0xf0}, - {0x8023,0xa4}, - {0x8024,0x2c}, - {0x8025,0xfc}, - {0x8026,0x8a}, - {0x8027,0xf0}, - {0x8028,0xed}, - {0x8029,0xa4}, - {0x802a,0x2c}, - {0x802b,0xfc}, - {0x802c,0xea}, - {0x802d,0x8e}, - {0x802e,0xf0}, - {0x802f,0xa4}, - {0x8030,0xcd}, - {0x8031,0xa8}, - {0x8032,0xf0}, - {0x8033,0x8b}, - {0x8034,0xf0}, - {0x8035,0xa4}, - {0x8036,0x2d}, - {0x8037,0xcc}, - {0x8038,0x38}, - {0x8039,0x25}, - {0x803a,0xf0}, - {0x803b,0xfd}, - {0x803c,0xe9}, - {0x803d,0x8f}, - {0x803e,0xf0}, - {0x803f,0xa4}, - {0x8040,0x2c}, - {0x8041,0xcd}, - {0x8042,0x35}, - {0x8043,0xf0}, - {0x8044,0xfc}, - {0x8045,0xeb}, - {0x8046,0x8e}, - {0x8047,0xf0}, - {0x8048,0xa4}, - {0x8049,0xfe}, - {0x804a,0xa9}, - {0x804b,0xf0}, - {0x804c,0xeb}, - {0x804d,0x8f}, - {0x804e,0xf0}, - {0x804f,0xa4}, - {0x8050,0xcf}, - {0x8051,0xc5}, - {0x8052,0xf0}, - {0x8053,0x2e}, - {0x8054,0xcd}, - {0x8055,0x39}, - {0x8056,0xfe}, - {0x8057,0xe4}, - {0x8058,0x3c}, - {0x8059,0xfc}, - {0x805a,0xea}, - {0x805b,0xa4}, - {0x805c,0x2d}, - {0x805d,0xce}, - {0x805e,0x35}, - {0x805f,0xf0}, - {0x8060,0xfd}, - {0x8061,0xe4}, - {0x8062,0x3c}, - {0x8063,0xfc}, - {0x8064,0x22}, - {0x8065,0x75}, - {0x8066,0xf0}, - {0x8067,0x08}, - {0x8068,0x75}, - {0x8069,0x82}, - {0x806a,0x00}, - {0x806b,0xef}, - {0x806c,0x2f}, - {0x806d,0xff}, - {0x806e,0xee}, - {0x806f,0x33}, - {0x8070,0xfe}, - {0x8071,0xcd}, - {0x8072,0x33}, - {0x8073,0xcd}, - {0x8074,0xcc}, - {0x8075,0x33}, - {0x8076,0xcc}, - {0x8077,0xc5}, - {0x8078,0x82}, - {0x8079,0x33}, - {0x807a,0xc5}, - {0x807b,0x82}, - {0x807c,0x9b}, - {0x807d,0xed}, - {0x807e,0x9a}, - {0x807f,0xec}, - {0x8080,0x99}, - {0x8081,0xe5}, - {0x8082,0x82}, - {0x8083,0x98}, - {0x8084,0x40}, - {0x8085,0x0c}, - {0x8086,0xf5}, - {0x8087,0x82}, - {0x8088,0xee}, - {0x8089,0x9b}, - {0x808a,0xfe}, - {0x808b,0xed}, - {0x808c,0x9a}, - {0x808d,0xfd}, - {0x808e,0xec}, - {0x808f,0x99}, - {0x8090,0xfc}, - {0x8091,0x0f}, - {0x8092,0xd5}, - {0x8093,0xf0}, - {0x8094,0xd6}, - {0x8095,0xe4}, - {0x8096,0xce}, - {0x8097,0xfb}, - {0x8098,0xe4}, - {0x8099,0xcd}, - {0x809a,0xfa}, - {0x809b,0xe4}, - {0x809c,0xcc}, - {0x809d,0xf9}, - {0x809e,0xa8}, - {0x809f,0x82}, - {0x80a0,0x22}, - {0x80a1,0xb8}, - {0x80a2,0x00}, - {0x80a3,0xc1}, - {0x80a4,0xb9}, - {0x80a5,0x00}, - {0x80a6,0x59}, - {0x80a7,0xba}, - {0x80a8,0x00}, - {0x80a9,0x2d}, - {0x80aa,0xec}, - {0x80ab,0x8b}, - {0x80ac,0xf0}, - {0x80ad,0x84}, - {0x80ae,0xcf}, - {0x80af,0xce}, - {0x80b0,0xcd}, - {0x80b1,0xfc}, - {0x80b2,0xe5}, - {0x80b3,0xf0}, - {0x80b4,0xcb}, - {0x80b5,0xf9}, - {0x80b6,0x78}, - {0x80b7,0x18}, - {0x80b8,0xef}, - {0x80b9,0x2f}, - {0x80ba,0xff}, - {0x80bb,0xee}, - {0x80bc,0x33}, - {0x80bd,0xfe}, - {0x80be,0xed}, - {0x80bf,0x33}, - {0x80c0,0xfd}, - {0x80c1,0xec}, - {0x80c2,0x33}, - {0x80c3,0xfc}, - {0x80c4,0xeb}, - {0x80c5,0x33}, - {0x80c6,0xfb}, - {0x80c7,0x10}, - {0x80c8,0xd7}, - {0x80c9,0x03}, - {0x80ca,0x99}, - {0x80cb,0x40}, - {0x80cc,0x04}, - {0x80cd,0xeb}, - {0x80ce,0x99}, - {0x80cf,0xfb}, - {0x80d0,0x0f}, - {0x80d1,0xd8}, - {0x80d2,0xe5}, - {0x80d3,0xe4}, - {0x80d4,0xf9}, - {0x80d5,0xfa}, - {0x80d6,0x22}, - {0x80d7,0x78}, - {0x80d8,0x18}, - {0x80d9,0xef}, - {0x80da,0x2f}, - {0x80db,0xff}, - {0x80dc,0xee}, - {0x80dd,0x33}, - {0x80de,0xfe}, - {0x80df,0xed}, - {0x80e0,0x33}, - {0x80e1,0xfd}, - {0x80e2,0xec}, - {0x80e3,0x33}, - {0x80e4,0xfc}, - {0x80e5,0xc9}, - {0x80e6,0x33}, - {0x80e7,0xc9}, - {0x80e8,0x10}, - {0x80e9,0xd7}, - {0x80ea,0x05}, - {0x80eb,0x9b}, - {0x80ec,0xe9}, - {0x80ed,0x9a}, - {0x80ee,0x40}, - {0x80ef,0x07}, - {0x80f0,0xec}, - {0x80f1,0x9b}, - {0x80f2,0xfc}, - {0x80f3,0xe9}, - {0x80f4,0x9a}, - {0x80f5,0xf9}, - {0x80f6,0x0f}, - {0x80f7,0xd8}, - {0x80f8,0xe0}, - {0x80f9,0xe4}, - {0x80fa,0xc9}, - {0x80fb,0xfa}, - {0x80fc,0xe4}, - {0x80fd,0xcc}, - {0x80fe,0xfb}, - {0x80ff,0x22}, - {0x8100,0x75}, - {0x8101,0xf0}, - {0x8102,0x10}, - {0x8103,0xef}, - {0x8104,0x2f}, - {0x8105,0xff}, - {0x8106,0xee}, - {0x8107,0x33}, - {0x8108,0xfe}, - {0x8109,0xed}, - {0x810a,0x33}, - {0x810b,0xfd}, - {0x810c,0xcc}, - {0x810d,0x33}, - {0x810e,0xcc}, - {0x810f,0xc8}, - {0x8110,0x33}, - {0x8111,0xc8}, - {0x8112,0x10}, - {0x8113,0xd7}, - {0x8114,0x07}, - {0x8115,0x9b}, - {0x8116,0xec}, - {0x8117,0x9a}, - {0x8118,0xe8}, - {0x8119,0x99}, - {0x811a,0x40}, - {0x811b,0x0a}, - {0x811c,0xed}, - {0x811d,0x9b}, - {0x811e,0xfd}, - {0x811f,0xec}, - {0x8120,0x9a}, - {0x8121,0xfc}, - {0x8122,0xe8}, - {0x8123,0x99}, - {0x8124,0xf8}, - {0x8125,0x0f}, - {0x8126,0xd5}, - {0x8127,0xf0}, - {0x8128,0xda}, - {0x8129,0xe4}, - {0x812a,0xcd}, - {0x812b,0xfb}, - {0x812c,0xe4}, - {0x812d,0xcc}, - {0x812e,0xfa}, - {0x812f,0xe4}, - {0x8130,0xc8}, - {0x8131,0xf9}, - {0x8132,0x22}, - {0x8133,0xe8}, - {0x8134,0x60}, - {0x8135,0x0f}, - {0x8136,0xef}, - {0x8137,0xc3}, - {0x8138,0x33}, - {0x8139,0xff}, - {0x813a,0xee}, - {0x813b,0x33}, - {0x813c,0xfe}, - {0x813d,0xed}, - {0x813e,0x33}, - {0x813f,0xfd}, - {0x8140,0xec}, - {0x8141,0x33}, - {0x8142,0xfc}, - {0x8143,0xd8}, - {0x8144,0xf1}, - {0x8145,0x22}, - {0x8146,0xa4}, - {0x8147,0x25}, - {0x8148,0x82}, - {0x8149,0xf5}, - {0x814a,0x82}, - {0x814b,0xe5}, - {0x814c,0xf0}, - {0x814d,0x35}, - {0x814e,0x83}, - {0x814f,0xf5}, - {0x8150,0x83}, - {0x8151,0x22}, - {0x8152,0xd0}, - {0x8153,0x83}, - {0x8154,0xd0}, - {0x8155,0x82}, - {0x8156,0xf8}, - {0x8157,0xe4}, - {0x8158,0x93}, - {0x8159,0x70}, - {0x815a,0x12}, - {0x815b,0x74}, - {0x815c,0x01}, - {0x815d,0x93}, - {0x815e,0x70}, - {0x815f,0x0d}, - {0x8160,0xa3}, - {0x8161,0xa3}, - {0x8162,0x93}, - {0x8163,0xf8}, - {0x8164,0x74}, - {0x8165,0x01}, - {0x8166,0x93}, - {0x8167,0xf5}, - {0x8168,0x82}, - {0x8169,0x88}, - {0x816a,0x83}, - {0x816b,0xe4}, - {0x816c,0x73}, - {0x816d,0x74}, - {0x816e,0x02}, - {0x816f,0x93}, - {0x8170,0x68}, - {0x8171,0x60}, - {0x8172,0xef}, - {0x8173,0xa3}, - {0x8174,0xa3}, - {0x8175,0xa3}, - {0x8176,0x80}, - {0x8177,0xdf}, - {0x8178,0x75}, - {0x8179,0x0c}, - {0x817a,0x0a}, - {0x817b,0xa2}, - {0x817c,0xaf}, - {0x817d,0x92}, - {0x817e,0x22}, - {0x817f,0xc2}, - {0x8180,0xaf}, - {0x8181,0xc2}, - {0x8182,0x23}, - {0x8183,0x12}, - {0x8184,0x04}, - {0x8185,0x07}, - {0x8186,0x12}, - {0x8187,0x04}, - {0x8188,0x4d}, - {0x8189,0x12}, - {0x818a,0x04}, - {0x818b,0x07}, - {0x818c,0x75}, - {0x818d,0x32}, - {0x818e,0x05}, - {0x818f,0xaf}, - {0x8190,0x32}, - {0x8191,0x15}, - {0x8192,0x32}, - {0x8193,0xef}, - {0x8194,0x70}, - {0x8195,0xf9}, - {0x8196,0xd2}, - {0x8197,0x18}, - {0x8198,0x12}, - {0x8199,0x04}, - {0x819a,0x09}, - {0x819b,0x75}, - {0x819c,0x32}, - {0x819d,0x0a}, - {0x819e,0xaf}, - {0x819f,0x32}, - {0x81a0,0x15}, - {0x81a1,0x32}, - {0x81a2,0xef}, - {0x81a3,0x70}, - {0x81a4,0xf9}, - {0x81a5,0xc2}, - {0x81a6,0x19}, - {0x81a7,0x12}, - {0x81a8,0x04}, - {0x81a9,0x09}, - {0x81aa,0x75}, - {0x81ab,0x32}, - {0x81ac,0x05}, - {0x81ad,0xaf}, - {0x81ae,0x32}, - {0x81af,0x15}, - {0x81b0,0x32}, - {0x81b1,0xef}, - {0x81b2,0x70}, - {0x81b3,0xf9}, - {0x81b4,0xc2}, - {0x81b5,0x18}, - {0x81b6,0x12}, - {0x81b7,0x04}, - {0x81b8,0x09}, - {0x81b9,0x75}, - {0x81ba,0x32}, - {0x81bb,0x05}, - {0x81bc,0xaf}, - {0x81bd,0x32}, - {0x81be,0x15}, - {0x81bf,0x32}, - {0x81c0,0xef}, - {0x81c1,0x70}, - {0x81c2,0xf9}, - {0x81c3,0x75}, - {0x81c4,0x0d}, - {0x81c5,0x18}, - {0x81c6,0x12}, - {0x81c7,0x02}, - {0x81c8,0xb8}, - {0x81c9,0x75}, - {0x81ca,0x32}, - {0x81cb,0x0a}, - {0x81cc,0xaf}, - {0x81cd,0x32}, - {0x81ce,0x15}, - {0x81cf,0x32}, - {0x81d0,0xef}, - {0x81d1,0x70}, - {0x81d2,0xf9}, - {0x81d3,0xd2}, - {0x81d4,0x18}, - {0x81d5,0x12}, - {0x81d6,0x04}, - {0x81d7,0x09}, - {0x81d8,0x12}, - {0x81d9,0x04}, - {0x81da,0x97}, - {0x81db,0xaf}, - {0x81dc,0x32}, - {0x81dd,0x15}, - {0x81de,0x32}, - {0x81df,0xef}, - {0x81e0,0x70}, - {0x81e1,0xf9}, - {0x81e2,0xc2}, - {0x81e3,0x18}, - {0x81e4,0x12}, - {0x81e5,0x04}, - {0x81e6,0x09}, - {0x81e7,0x75}, - {0x81e8,0x32}, - {0x81e9,0x0a}, - {0x81ea,0xaf}, - {0x81eb,0x32}, - {0x81ec,0x15}, - {0x81ed,0x32}, - {0x81ee,0xef}, - {0x81ef,0x70}, - {0x81f0,0xf9}, - {0x81f1,0x30}, - {0x81f2,0x11}, - {0x81f3,0x03}, - {0x81f4,0x02}, - {0x81f5,0x02}, - {0x81f6,0x6f}, - {0x81f7,0x12}, - {0x81f8,0x04}, - {0x81f9,0x07}, - {0x81fa,0x12}, - {0x81fb,0x04}, - {0x81fc,0x4d}, - {0x81fd,0xe5}, - {0x81fe,0x0a}, - {0x81ff,0xf5}, - {0x8200,0x0d}, - {0x8201,0x12}, - {0x8202,0x02}, - {0x8203,0xb8}, - {0x8204,0x75}, - {0x8205,0x32}, - {0x8206,0x0a}, - {0x8207,0xaf}, - {0x8208,0x32}, - {0x8209,0x15}, - {0x820a,0x32}, - {0x820b,0xef}, - {0x820c,0x70}, - {0x820d,0xf9}, - {0x820e,0xd2}, - {0x820f,0x18}, - {0x8210,0x12}, - {0x8211,0x04}, - {0x8212,0x09}, - {0x8213,0x12}, - {0x8214,0x04}, - {0x8215,0x97}, - {0x8216,0xaf}, - {0x8217,0x32}, - {0x8218,0x15}, - {0x8219,0x32}, - {0x821a,0xef}, - {0x821b,0x70}, - {0x821c,0xf9}, - {0x821d,0xc2}, - {0x821e,0x18}, - {0x821f,0x12}, - {0x8220,0x04}, - {0x8221,0x09}, - {0x8222,0x75}, - {0x8223,0x32}, - {0x8224,0x0a}, - {0x8225,0xaf}, - {0x8226,0x32}, - {0x8227,0x15}, - {0x8228,0x32}, - {0x8229,0xef}, - {0x822a,0x70}, - {0x822b,0xf9}, - {0x822c,0x30}, - {0x822d,0x11}, - {0x822e,0x04}, - {0x822f,0x15}, - {0x8230,0x0c}, - {0x8231,0x80}, - {0x8232,0x45}, - {0x8233,0x12}, - {0x8234,0x04}, - {0x8235,0x07}, - {0x8236,0x12}, - {0x8237,0x04}, - {0x8238,0x4d}, - {0x8239,0x85}, - {0x823a,0x0b}, - {0x823b,0x0d}, - {0x823c,0x12}, - {0x823d,0x0a}, - {0x823e,0x9b}, - {0x823f,0xc2}, - {0x8240,0x0f}, - {0x8241,0x12}, - {0x8242,0x04}, - {0x8243,0x4f}, - {0x8244,0x75}, - {0x8245,0x32}, - {0x8246,0x0a}, - {0x8247,0xaf}, - {0x8248,0x32}, - {0x8249,0x15}, - {0x824a,0x32}, - {0x824b,0xef}, - {0x824c,0x70}, - {0x824d,0xf9}, - {0x824e,0xd2}, - {0x824f,0x18}, - {0x8250,0x12}, - {0x8251,0x04}, - {0x8252,0x09}, - {0x8253,0x12}, - {0x8254,0x04}, - {0x8255,0x97}, - {0x8256,0xaf}, - {0x8257,0x32}, - {0x8258,0x15}, - {0x8259,0x32}, - {0x825a,0xef}, - {0x825b,0x70}, - {0x825c,0xf9}, - {0x825d,0xc2}, - {0x825e,0x18}, - {0x825f,0x12}, - {0x8260,0x04}, - {0x8261,0x09}, - {0x8262,0x75}, - {0x8263,0x32}, - {0x8264,0x0a}, - {0x8265,0xaf}, - {0x8266,0x32}, - {0x8267,0x15}, - {0x8268,0x32}, - {0x8269,0xef}, - {0x826a,0x70}, - {0x826b,0xf9}, - {0x826c,0x30}, - {0x826d,0x11}, - {0x826e,0x06}, - {0x826f,0x15}, - {0x8270,0x0c}, - {0x8271,0xd2}, - {0x8272,0x23}, - {0x8273,0x80}, - {0x8274,0x03}, - {0x8275,0xe4}, - {0x8276,0xf5}, - {0x8277,0x0c}, - {0x8278,0x12}, - {0x8279,0x04}, - {0x827a,0x07}, - {0x827b,0x12}, - {0x827c,0x04}, - {0x827d,0x4d}, - {0x827e,0xc2}, - {0x827f,0x19}, - {0x8280,0x12}, - {0x8281,0x04}, - {0x8282,0x09}, - {0x8283,0x75}, - {0x8284,0x32}, - {0x8285,0x05}, - {0x8286,0xaf}, - {0x8287,0x32}, - {0x8288,0x15}, - {0x8289,0x32}, - {0x828a,0xef}, - {0x828b,0x70}, - {0x828c,0xf9}, - {0x828d,0xd2}, - {0x828e,0x18}, - {0x828f,0x12}, - {0x8290,0x04}, - {0x8291,0x09}, - {0x8292,0x75}, - {0x8293,0x32}, - {0x8294,0x05}, - {0x8295,0xaf}, - {0x8296,0x32}, - {0x8297,0x15}, - {0x8298,0x32}, - {0x8299,0xef}, - {0x829a,0x70}, - {0x829b,0xf9}, - {0x829c,0x12}, - {0x829d,0x04}, - {0x829e,0x07}, - {0x829f,0x75}, - {0x82a0,0x32}, - {0x82a1,0x05}, - {0x82a2,0xaf}, - {0x82a3,0x32}, - {0x82a4,0x15}, - {0x82a5,0x32}, - {0x82a6,0xef}, - {0x82a7,0x70}, - {0x82a8,0xf9}, - {0x82a9,0xa2}, - {0x82aa,0x22}, - {0x82ab,0x92}, - {0x82ac,0xaf}, - {0x82ad,0xe5}, - {0x82ae,0x0c}, - {0x82af,0xd3}, - {0x82b0,0x94}, - {0x82b1,0x00}, - {0x82b2,0x40}, - {0x82b3,0x03}, - {0x82b4,0x02}, - {0x82b5,0x01}, - {0x82b6,0x7f}, - {0x82b7,0x22}, - {0x82b8,0x12}, - {0x82b9,0x0a}, - {0x82ba,0x9b}, - {0x82bb,0xc2}, - {0x82bc,0x0f}, - {0x82bd,0x90}, - {0x82be,0x30}, - {0x82bf,0xb1}, - {0x82c0,0xe5}, - {0x82c1,0x21}, - {0x82c2,0xf0}, - {0x82c3,0x22}, - {0x82c4,0x90}, - {0x82c5,0x33}, - {0x82c6,0x5f}, - {0x82c7,0xe0}, - {0x82c8,0x54}, - {0x82c9,0x0f}, - {0x82ca,0xfe}, - {0x82cb,0xa3}, - {0x82cc,0xe0}, - {0x82cd,0xfd}, - {0x82ce,0xed}, - {0x82cf,0xff}, - {0x82d0,0xee}, - {0x82d1,0x54}, - {0x82d2,0x0f}, - {0x82d3,0xf5}, - {0x82d4,0x0d}, - {0x82d5,0x8f}, - {0x82d6,0x0e}, - {0x82d7,0x90}, - {0x82d8,0x33}, - {0x82d9,0x5f}, - {0x82da,0xe0}, - {0x82db,0x54}, - {0x82dc,0x70}, - {0x82dd,0x75}, - {0x82de,0xf0}, - {0x82df,0x10}, - {0x82e0,0xa4}, - {0x82e1,0xff}, - {0x82e2,0x90}, - {0x82e3,0x33}, - {0x82e4,0x61}, - {0x82e5,0xe0}, - {0x82e6,0xfd}, - {0x82e7,0xef}, - {0x82e8,0x4d}, - {0x82e9,0xff}, - {0x82ea,0xe5}, - {0x82eb,0xf0}, - {0x82ec,0x54}, - {0x82ed,0x07}, - {0x82ee,0xf5}, - {0x82ef,0x0f}, - {0x82f0,0x8f}, - {0x82f1,0x10}, - {0x82f2,0xe5}, - {0x82f3,0x0e}, - {0x82f4,0xae}, - {0x82f5,0x0d}, - {0x82f6,0x78}, - {0x82f7,0x05}, - {0x82f8,0xce}, - {0x82f9,0xc3}, - {0x82fa,0x13}, - {0x82fb,0xce}, - {0x82fc,0x13}, - {0x82fd,0xd8}, - {0x82fe,0xf9}, - {0x82ff,0xf5}, - {0x8300,0x0e}, - {0x8301,0x8e}, - {0x8302,0x0d}, - {0x8303,0xe5}, - {0x8304,0x10}, - {0x8305,0xae}, - {0x8306,0x0f}, - {0x8307,0x78}, - {0x8308,0x03}, - {0x8309,0xce}, - {0x830a,0xc3}, - {0x830b,0x13}, - {0x830c,0xce}, - {0x830d,0x13}, - {0x830e,0xd8}, - {0x830f,0xf9}, - {0x8310,0xf5}, - {0x8311,0x10}, - {0x8312,0x8e}, - {0x8313,0x0f}, - {0x8314,0x85}, - {0x8315,0x2a}, - {0x8316,0x11}, - {0x8317,0x85}, - {0x8318,0x2b}, - {0x8319,0x13}, - {0x831a,0x85}, - {0x831b,0x2c}, - {0x831c,0x12}, - {0x831d,0x85}, - {0x831e,0x2d}, - {0x831f,0x14}, - {0x8320,0x12}, - {0x8321,0x04}, - {0x8322,0xab}, - {0x8323,0xaf}, - {0x8324,0x11}, - {0x8325,0x12}, - {0x8326,0x03}, - {0x8327,0xdf}, - {0x8328,0x8f}, - {0x8329,0x11}, - {0x832a,0x12}, - {0x832b,0x04}, - {0x832c,0xab}, - {0x832d,0xaf}, - {0x832e,0x12}, - {0x832f,0x12}, - {0x8330,0x03}, - {0x8331,0xdf}, - {0x8332,0x8f}, - {0x8333,0x12}, - {0x8334,0x12}, - {0x8335,0x04}, - {0x8336,0x56}, - {0x8337,0xaf}, - {0x8338,0x13}, - {0x8339,0xfc}, - {0x833a,0xfd}, - {0x833b,0xfe}, - {0x833c,0x12}, - {0x833d,0x00}, - {0x833e,0x16}, - {0x833f,0x12}, - {0x8340,0x03}, - {0x8341,0xfe}, - {0x8342,0x7b}, - {0x8343,0x1e}, - {0x8344,0x12}, - {0x8345,0x03}, - {0x8346,0xf7}, - {0x8347,0x8f}, - {0x8348,0x13}, - {0x8349,0x12}, - {0x834a,0x04}, - {0x834b,0x56}, - {0x834c,0xaf}, - {0x834d,0x14}, - {0x834e,0xfc}, - {0x834f,0xfd}, - {0x8350,0xfe}, - {0x8351,0x12}, - {0x8352,0x00}, - {0x8353,0x16}, - {0x8354,0x12}, - {0x8355,0x03}, - {0x8356,0xfe}, - {0x8357,0xe4}, - {0x8358,0x7b}, - {0x8359,0x1e}, - {0x835a,0x12}, - {0x835b,0x03}, - {0x835c,0xf8}, - {0x835d,0x8f}, - {0x835e,0x14}, - {0x835f,0xc3}, - {0x8360,0xe5}, - {0x8361,0x12}, - {0x8362,0x95}, - {0x8363,0x11}, - {0x8364,0xff}, - {0x8365,0x0f}, - {0x8366,0xef}, - {0x8367,0xc3}, - {0x8368,0x13}, - {0x8369,0xff}, - {0x836a,0xc3}, - {0x836b,0x94}, - {0x836c,0x02}, - {0x836d,0x50}, - {0x836e,0x27}, - {0x836f,0xe5}, - {0x8370,0x11}, - {0x8371,0x9f}, - {0x8372,0x40}, - {0x8373,0x06}, - {0x8374,0xe5}, - {0x8375,0x11}, - {0x8376,0x9f}, - {0x8377,0xfe}, - {0x8378,0x80}, - {0x8379,0x02}, - {0x837a,0x7e}, - {0x837b,0x00}, - {0x837c,0x8e}, - {0x837d,0x11}, - {0x837e,0xef}, - {0x837f,0xfd}, - {0x8380,0xe5}, - {0x8381,0x12}, - {0x8382,0x2d}, - {0x8383,0xfd}, - {0x8384,0xe4}, - {0x8385,0x33}, - {0x8386,0xfc}, - {0x8387,0xc3}, - {0x8388,0xed}, - {0x8389,0x95}, - {0x838a,0x0e}, - {0x838b,0xec}, - {0x838c,0x95}, - {0x838d,0x0d}, - {0x838e,0x50}, - {0x838f,0x02}, - {0x8390,0x80}, - {0x8391,0x02}, - {0x8392,0xad}, - {0x8393,0x0e}, - {0x8394,0x8d}, - {0x8395,0x12}, - {0x8396,0xc3}, - {0x8397,0xe5}, - {0x8398,0x14}, - {0x8399,0x95}, - {0x839a,0x13}, - {0x839b,0xff}, - {0x839c,0xc3}, - {0x839d,0x94}, - {0x839e,0x08}, - {0x839f,0x50}, - {0x83a0,0x29}, - {0x83a1,0xe5}, - {0x83a2,0x13}, - {0x83a3,0x9f}, - {0x83a4,0x40}, - {0x83a5,0x06}, - {0x83a6,0xe5}, - {0x83a7,0x13}, - {0x83a8,0x9f}, - {0x83a9,0xfe}, - {0x83aa,0x80}, - {0x83ab,0x02}, - {0x83ac,0x7e}, - {0x83ad,0x00}, - {0x83ae,0x8e}, - {0x83af,0x13}, - {0x83b0,0xef}, - {0x83b1,0xfd}, - {0x83b2,0xe5}, - {0x83b3,0x14}, - {0x83b4,0x2d}, - {0x83b5,0xfd}, - {0x83b6,0xe4}, - {0x83b7,0x33}, - {0x83b8,0xfc}, - {0x83b9,0xc3}, - {0x83ba,0xed}, - {0x83bb,0x95}, - {0x83bc,0x10}, - {0x83bd,0xec}, - {0x83be,0x95}, - {0x83bf,0x0f}, - {0x83c0,0x50}, - {0x83c1,0x04}, - {0x83c2,0xaf}, - {0x83c3,0x05}, - {0x83c4,0x80}, - {0x83c5,0x02}, - {0x83c6,0xaf}, - {0x83c7,0x10}, - {0x83c8,0x8f}, - {0x83c9,0x14}, - {0x83ca,0x90}, - {0x83cb,0x39}, - {0x83cc,0x0a}, - {0x83cd,0xe5}, - {0x83ce,0x11}, - {0x83cf,0xf0}, - {0x83d0,0xa3}, - {0x83d1,0xe5}, - {0x83d2,0x13}, - {0x83d3,0xf0}, - {0x83d4,0xa3}, - {0x83d5,0xe5}, - {0x83d6,0x12}, - {0x83d7,0xf0}, - {0x83d8,0xa3}, - {0x83d9,0xe5}, - {0x83da,0x14}, - {0x83db,0xf0}, - {0x83dc,0xc2}, - {0x83dd,0x20}, - {0x83de,0x22}, - {0x83df,0xab}, - {0x83e0,0x0c}, - {0x83e1,0xaa}, - {0x83e2,0x0b}, - {0x83e3,0xa9}, - {0x83e4,0x0a}, - {0x83e5,0xa8}, - {0x83e6,0x09}, - {0x83e7,0xfc}, - {0x83e8,0xfd}, - {0x83e9,0xfe}, - {0x83ea,0x12}, - {0x83eb,0x00}, - {0x83ec,0x16}, - {0x83ed,0x8f}, - {0x83ee,0x0c}, - {0x83ef,0x8e}, - {0x83f0,0x0b}, - {0x83f1,0x8d}, - {0x83f2,0x0a}, - {0x83f3,0x8c}, - {0x83f4,0x09}, - {0x83f5,0x7b}, - {0x83f6,0x28}, - {0x83f7,0xe4}, - {0x83f8,0xfa}, - {0x83f9,0xf9}, - {0x83fa,0xf8}, - {0x83fb,0x12}, - {0x83fc,0x00}, - {0x83fd,0xa1}, - {0x83fe,0x8f}, - {0x83ff,0x0c}, - {0x8400,0x8e}, - {0x8401,0x0b}, - {0x8402,0x8d}, - {0x8403,0x0a}, - {0x8404,0x8c}, - {0x8405,0x09}, - {0x8406,0x22}, - {0x8407,0xd2}, - {0x8408,0x19}, - {0x8409,0x90}, - {0x840a,0x30}, - {0x840b,0xb4}, - {0x840c,0xe5}, - {0x840d,0x23}, - {0x840e,0xf0}, - {0x840f,0x22}, - {0x8410,0x85}, - {0x8411,0x2f}, - {0x8412,0x82}, - {0x8413,0x85}, - {0x8414,0x2e}, - {0x8415,0x83}, - {0x8416,0xe5}, - {0x8417,0x43}, - {0x8418,0x75}, - {0x8419,0xf0}, - {0x841a,0x02}, - {0x841b,0x12}, - {0x841c,0x01}, - {0x841d,0x46}, - {0x841e,0xe4}, - {0x841f,0x93}, - {0x8420,0xfe}, - {0x8421,0x74}, - {0x8422,0x01}, - {0x8423,0x93}, - {0x8424,0xff}, - {0x8425,0x85}, - {0x8426,0x2f}, - {0x8427,0x82}, - {0x8428,0x85}, - {0x8429,0x2e}, - {0x842a,0x83}, - {0x842b,0xe4}, - {0x842c,0x93}, - {0x842d,0xfc}, - {0x842e,0x74}, - {0x842f,0x01}, - {0x8430,0x93}, - {0x8431,0xfd}, - {0x8432,0xc3}, - {0x8433,0xef}, - {0x8434,0x9d}, - {0x8435,0xff}, - {0x8436,0xee}, - {0x8437,0x9c}, - {0x8438,0x22}, - {0x8439,0x12}, - {0x843a,0x00}, - {0x843b,0x16}, - {0x843c,0x8f}, - {0x843d,0x3c}, - {0x843e,0x8e}, - {0x843f,0x3b}, - {0x8440,0x8d}, - {0x8441,0x3a}, - {0x8442,0x8c}, - {0x8443,0x39}, - {0x8444,0xaf}, - {0x8445,0x3c}, - {0x8446,0xae}, - {0x8447,0x3b}, - {0x8448,0xad}, - {0x8449,0x3a}, - {0x844a,0xac}, - {0x844b,0x39}, - {0x844c,0x22}, - {0x844d,0xd2}, - {0x844e,0x0f}, - {0x844f,0x90}, - {0x8450,0x30}, - {0x8451,0xb1}, - {0x8452,0xe5}, - {0x8453,0x21}, - {0x8454,0xf0}, - {0x8455,0x22}, - {0x8456,0xe4}, - {0x8457,0x85}, - {0x8458,0x10}, - {0x8459,0x0c}, - {0x845a,0x85}, - {0x845b,0x0f}, - {0x845c,0x0b}, - {0x845d,0xf5}, - {0x845e,0x0a}, - {0x845f,0xf5}, - {0x8460,0x09}, - {0x8461,0xab}, - {0x8462,0x0c}, - {0x8463,0xaa}, - {0x8464,0x0b}, - {0x8465,0xa9}, - {0x8466,0x0a}, - {0x8467,0xa8}, - {0x8468,0x09}, - {0x8469,0x22}, - {0x846a,0x85}, - {0x846b,0x2f}, - {0x846c,0x82}, - {0x846d,0x85}, - {0x846e,0x2e}, - {0x846f,0x83}, - {0x8470,0x22}, - {0x8471,0xff}, - {0x8472,0xe4}, - {0x8473,0x94}, - {0x8474,0x00}, - {0x8475,0xfe}, - {0x8476,0xe4}, - {0x8477,0xfc}, - {0x8478,0xfd}, - {0x8479,0x02}, - {0x847a,0x01}, - {0x847b,0x33}, - {0x847c,0xc2}, - {0x847d,0x07}, - {0x847e,0xc2}, - {0x847f,0x06}, - {0x8480,0xc2}, - {0x8481,0x02}, - {0x8482,0xc2}, - {0x8483,0x01}, - {0x8484,0xc2}, - {0x8485,0x00}, - {0x8486,0xc2}, - {0x8487,0x03}, - {0x8488,0xd2}, - {0x8489,0x04}, - {0x848a,0x22}, - {0x848b,0x90}, - {0x848c,0x33}, - {0x848d,0xb3}, - {0x848e,0xe4}, - {0x848f,0xf0}, - {0x8490,0xa3}, - {0x8491,0xf0}, - {0x8492,0xa3}, - {0x8493,0xf0}, - {0x8494,0xa3}, - {0x8495,0xf0}, - {0x8496,0x22}, - {0x8497,0xa3}, - {0x8498,0xe0}, - {0x8499,0xf5}, - {0x849a,0x22}, - {0x849b,0x75}, - {0x849c,0x32}, - {0x849d,0x0a}, - {0x849e,0x22}, - {0x849f,0x12}, - {0x84a0,0x00}, - {0x84a1,0xa1}, - {0x84a2,0x8f}, - {0x84a3,0x3c}, - {0x84a4,0x8e}, - {0x84a5,0x3b}, - {0x84a6,0x8d}, - {0x84a7,0x3a}, - {0x84a8,0x8c}, - {0x84a9,0x39}, - {0x84aa,0x22}, - {0x84ab,0xe4}, - {0x84ac,0x85}, - {0x84ad,0x0e}, - {0x84ae,0x0c}, - {0x84af,0x85}, - {0x84b0,0x0d}, - {0x84b1,0x0b}, - {0x84b2,0xf5}, - {0x84b3,0x0a}, - {0x84b4,0xf5}, - {0x84b5,0x09}, - {0x84b6,0x22}, - {0x84b7,0xe4}, - {0x84b8,0xfc}, - {0x84b9,0xfd}, - {0x84ba,0xfe}, - {0x84bb,0x02}, - {0x84bc,0x01}, - {0x84bd,0x33}, - {0x84be,0x90}, - {0x84bf,0x0b}, - {0x84c0,0x4c}, - {0x84c1,0xe4}, - {0x84c2,0x93}, - {0x84c3,0xff}, - {0x84c4,0x90}, - {0x84c5,0x30}, - {0x84c6,0x0a}, - {0x84c7,0xe0}, - {0x84c8,0x22}, - {0x84c9,0xc2}, - {0x84ca,0x02}, - {0x84cb,0xc2}, - {0x84cc,0x01}, - {0x84cd,0xd2}, - {0x84ce,0x00}, - {0x84cf,0xc2}, - {0x84d0,0x03}, - {0x84d1,0xc2}, - {0x84d2,0x04}, - {0x84d3,0x22}, - {0x84d4,0x75}, - {0x84d5,0xf0}, - {0x84d6,0x02}, - {0x84d7,0x02}, - {0x84d8,0x01}, - {0x84d9,0x46}, - {0x84da,0xe4}, - {0x84db,0x93}, - {0x84dc,0xf5}, - {0x84dd,0x43}, - {0x84de,0xa3}, - {0x84df,0xe4}, - {0x84e0,0x93}, - {0x84e1,0xf5}, - {0x84e2,0x28}, - {0x84e3,0x22}, - {0x84e4,0xd2}, - {0x84e5,0x02}, - {0x84e6,0xd2}, - {0x84e7,0x01}, - {0x84e8,0xc2}, - {0x84e9,0x00}, - {0x84ea,0x22}, - {0x84eb,0xd3}, - {0x84ec,0xe5}, - {0x84ed,0x3c}, - {0x84ee,0x94}, - {0x84ef,0xff}, - {0x84f0,0xe5}, - {0x84f1,0x3b}, - {0x84f2,0x94}, - {0x84f3,0x03}, - {0x84f4,0x22}, - {0x84f5,0x30}, - {0x84f6,0x04}, - {0x84f7,0x03}, - {0x84f8,0x02}, - {0x84f9,0x05}, - {0x84fa,0xd5}, - {0x84fb,0xd2}, - {0x84fc,0x04}, - {0x84fd,0xe5}, - {0x84fe,0x45}, - {0x84ff,0xb4}, - {0x8500,0x01}, - {0x8501,0x06}, - {0x8502,0x12}, - {0x8503,0x0c}, - {0x8504,0xfe}, - {0x8505,0x02}, - {0x8506,0x05}, - {0x8507,0xce}, - {0x8508,0xe5}, - {0x8509,0x45}, - {0x850a,0xb4}, - {0x850b,0x02}, - {0x850c,0x06}, - {0x850d,0x12}, - {0x850e,0x0d}, - {0x850f,0x0f}, - {0x8510,0x02}, - {0x8511,0x05}, - {0x8512,0xce}, - {0x8513,0xe5}, - {0x8514,0x45}, - {0x8515,0xb4}, - {0x8516,0x03}, - {0x8517,0x05}, - {0x8518,0xe4}, - {0x8519,0xf5}, - {0x851a,0x09}, - {0x851b,0x80}, - {0x851c,0x08}, - {0x851d,0xe5}, - {0x851e,0x45}, - {0x851f,0xb4}, - {0x8520,0x04}, - {0x8521,0x09}, - {0x8522,0x85}, - {0x8523,0x43}, - {0x8524,0x09}, - {0x8525,0x12}, - {0x8526,0x09}, - {0x8527,0xee}, - {0x8528,0x02}, - {0x8529,0x05}, - {0x852a,0xce}, - {0x852b,0xe5}, - {0x852c,0x45}, - {0x852d,0x64}, - {0x852e,0x0f}, - {0x852f,0x70}, - {0x8530,0x15}, - {0x8531,0x12}, - {0x8532,0x04}, - {0x8533,0xeb}, - {0x8534,0x40}, - {0x8535,0x06}, - {0x8536,0x7e}, - {0x8537,0x03}, - {0x8538,0x7f}, - {0x8539,0xff}, - {0x853a,0x80}, - {0x853b,0x04}, - {0x853c,0xae}, - {0x853d,0x3b}, - {0x853e,0xaf}, - {0x853f,0x3c}, - {0x8540,0x12}, - {0x8541,0x05}, - {0x8542,0xd6}, - {0x8543,0x02}, - {0x8544,0x05}, - {0x8545,0xce}, - {0x8546,0xe5}, - {0x8547,0x45}, - {0x8548,0x64}, - {0x8549,0x10}, - {0x854a,0x60}, - {0x854b,0x03}, - {0x854c,0x02}, - {0x854d,0x05}, - {0x854e,0xce}, - {0x854f,0xf5}, - {0x8550,0x39}, - {0x8551,0xf5}, - {0x8552,0x3a}, - {0x8553,0xf5}, - {0x8554,0x3b}, - {0x8555,0xab}, - {0x8556,0x3c}, - {0x8557,0xaa}, - {0x8558,0x3b}, - {0x8559,0xa9}, - {0x855a,0x3a}, - {0x855b,0xa8}, - {0x855c,0x39}, - {0x855d,0x12}, - {0x855e,0x04}, - {0x855f,0x10}, - {0x8560,0xfe}, - {0x8561,0xe4}, - {0x8562,0xfc}, - {0x8563,0xfd}, - {0x8564,0x12}, - {0x8565,0x04}, - {0x8566,0x39}, - {0x8567,0xe4}, - {0x8568,0x7b}, - {0x8569,0xff}, - {0x856a,0xfa}, - {0x856b,0xf9}, - {0x856c,0xf8}, - {0x856d,0x12}, - {0x856e,0x04}, - {0x856f,0x9f}, - {0x8570,0x12}, - {0x8571,0x04}, - {0x8572,0x6a}, - {0x8573,0xe4}, - {0x8574,0x93}, - {0x8575,0xfe}, - {0x8576,0x74}, - {0x8577,0x01}, - {0x8578,0x93}, - {0x8579,0xff}, - {0x857a,0xe4}, - {0x857b,0xfc}, - {0x857c,0xfd}, - {0x857d,0xe5}, - {0x857e,0x3c}, - {0x857f,0x2f}, - {0x8580,0xf5}, - {0x8581,0x3c}, - {0x8582,0xe5}, - {0x8583,0x3b}, - {0x8584,0x3e}, - {0x8585,0xf5}, - {0x8586,0x3b}, - {0x8587,0xed}, - {0x8588,0x35}, - {0x8589,0x3a}, - {0x858a,0xf5}, - {0x858b,0x3a}, - {0x858c,0xec}, - {0x858d,0x35}, - {0x858e,0x39}, - {0x858f,0xf5}, - {0x8590,0x39}, - {0x8591,0x12}, - {0x8592,0x04}, - {0x8593,0xeb}, - {0x8594,0x40}, - {0x8595,0x06}, - {0x8596,0x7e}, - {0x8597,0x03}, - {0x8598,0x7f}, - {0x8599,0xff}, - {0x859a,0x80}, - {0x859b,0x04}, - {0x859c,0xae}, - {0x859d,0x3b}, - {0x859e,0xaf}, - {0x859f,0x3c}, - {0x85a0,0x12}, - {0x85a1,0x05}, - {0x85a2,0xd6}, - {0x85a3,0xe4}, - {0x85a4,0xf5}, - {0x85a5,0x3a}, - {0x85a6,0xf5}, - {0x85a7,0x3a}, - {0x85a8,0xe5}, - {0x85a9,0x3a}, - {0x85aa,0xd3}, - {0x85ab,0x95}, - {0x85ac,0x43}, - {0x85ad,0x50}, - {0x85ae,0x1c}, - {0x85af,0x12}, - {0x85b0,0x04}, - {0x85b1,0x6a}, - {0x85b2,0xaf}, - {0x85b3,0x3a}, - {0x85b4,0x75}, - {0x85b5,0xf0}, - {0x85b6,0x02}, - {0x85b7,0xef}, - {0x85b8,0x12}, - {0x85b9,0x01}, - {0x85ba,0x46}, - {0x85bb,0xc3}, - {0x85bc,0x74}, - {0x85bd,0x01}, - {0x85be,0x93}, - {0x85bf,0x95}, - {0x85c0,0x3c}, - {0x85c1,0xe4}, - {0x85c2,0x93}, - {0x85c3,0x95}, - {0x85c4,0x3b}, - {0x85c5,0x50}, - {0x85c6,0x04}, - {0x85c7,0x05}, - {0x85c8,0x3a}, - {0x85c9,0x80}, - {0x85ca,0xdd}, - {0x85cb,0x85}, - {0x85cc,0x3a}, - {0x85cd,0x44}, - {0x85ce,0x90}, - {0x85cf,0x3f}, - {0x85d0,0x01}, - {0x85d1,0xe4}, - {0x85d2,0xf0}, - {0x85d3,0xd2}, - {0x85d4,0x25}, - {0x85d5,0x22}, - {0x85d6,0x8e}, - {0x85d7,0x3b}, - {0x85d8,0x8f}, - {0x85d9,0x3c}, - {0x85da,0x85}, - {0x85db,0x3b}, - {0x85dc,0x37}, - {0x85dd,0x85}, - {0x85de,0x3c}, - {0x85df,0x38}, - {0x85e0,0xe5}, - {0x85e1,0x3c}, - {0x85e2,0xc4}, - {0x85e3,0xf8}, - {0x85e4,0x54}, - {0x85e5,0x0f}, - {0x85e6,0xc8}, - {0x85e7,0x68}, - {0x85e8,0xf5}, - {0x85e9,0x3c}, - {0x85ea,0xe5}, - {0x85eb,0x3b}, - {0x85ec,0xc4}, - {0x85ed,0x54}, - {0x85ee,0xf0}, - {0x85ef,0x48}, - {0x85f0,0xf5}, - {0x85f1,0x3b}, - {0x85f2,0x85}, - {0x85f3,0x3b}, - {0x85f4,0x0a}, - {0x85f5,0x85}, - {0x85f6,0x3c}, - {0x85f7,0x0b}, - {0x85f8,0x12}, - {0x85f9,0x01}, - {0x85fa,0x78}, - {0x85fb,0x22}, - {0x85fc,0xe5}, - {0x85fd,0x29}, - {0x85fe,0x70}, - {0x85ff,0x03}, - {0x8600,0x02}, - {0x8601,0x06}, - {0x8602,0xd4}, - {0x8603,0xc2}, - {0x8604,0xaf}, - {0x8605,0xaf}, - {0x8606,0x29}, - {0x8607,0xe4}, - {0x8608,0xf5}, - {0x8609,0x29}, - {0x860a,0xd2}, - {0x860b,0xaf}, - {0x860c,0x90}, - {0x860d,0x3f}, - {0x860e,0x01}, - {0x860f,0xe0}, - {0x8610,0xf5}, - {0x8611,0x45}, - {0x8612,0xa3}, - {0x8613,0xe0}, - {0x8614,0xf5}, - {0x8615,0x39}, - {0x8616,0xa3}, - {0x8617,0xe0}, - {0x8618,0xf5}, - {0x8619,0x3a}, - {0x861a,0xa3}, - {0x861b,0xe0}, - {0x861c,0xf5}, - {0x861d,0x3b}, - {0x861e,0xa3}, - {0x861f,0xe0}, - {0x8620,0xf5}, - {0x8621,0x3c}, - {0x8622,0xef}, - {0x8623,0x12}, - {0x8624,0x01}, - {0x8625,0x52}, - {0x8626,0x06}, - {0x8627,0x4b}, - {0x8628,0x03}, - {0x8629,0x06}, - {0x862a,0x5a}, - {0x862b,0x05}, - {0x862c,0x06}, - {0x862d,0x81}, - {0x862e,0x06}, - {0x862f,0x06}, - {0x8630,0x6f}, - {0x8631,0x08}, - {0x8632,0x06}, - {0x8633,0xa2}, - {0x8634,0x09}, - {0x8635,0x06}, - {0x8636,0x8e}, - {0x8637,0x10}, - {0x8638,0x06}, - {0x8639,0xa2}, - {0x863a,0x12}, - {0x863b,0x06}, - {0x863c,0xa7}, - {0x863d,0x20}, - {0x863e,0x06}, - {0x863f,0xb5}, - {0x8640,0x21}, - {0x8641,0x06}, - {0x8642,0xba}, - {0x8643,0x30}, - {0x8644,0x06}, - {0x8645,0xc5}, - {0x8646,0xd0}, - {0x8647,0x00}, - {0x8648,0x00}, - {0x8649,0x06}, - {0x864a,0xc9}, - {0x864b,0x30}, - {0x864c,0x05}, - {0x864d,0x7b}, - {0x864e,0x20}, - {0x864f,0x00}, - {0x8650,0x78}, - {0x8651,0xd2}, - {0x8652,0x07}, - {0x8653,0xc2}, - {0x8654,0x06}, - {0x8655,0x12}, - {0x8656,0x04}, - {0x8657,0xc9}, - {0x8658,0x80}, - {0x8659,0x21}, - {0x865a,0x30}, - {0x865b,0x05}, - {0x865c,0x6c}, - {0x865d,0x20}, - {0x865e,0x00}, - {0x865f,0x69}, - {0x8660,0xc2}, - {0x8661,0x07}, - {0x8662,0xd2}, - {0x8663,0x06}, - {0x8664,0xc2}, - {0x8665,0x03}, - {0x8666,0x12}, - {0x8667,0x04}, - {0x8668,0xe4}, - {0x8669,0xc2}, - {0x866a,0x04}, - {0x866b,0xc2}, - {0x866c,0x21}, - {0x866d,0x80}, - {0x866e,0x5a}, - {0x866f,0x12}, - {0x8670,0x04}, - {0x8671,0x7c}, - {0x8672,0x30}, - {0x8673,0x05}, - {0x8674,0x06}, - {0x8675,0xe4}, - {0x8676,0xf5}, - {0x8677,0x09}, - {0x8678,0x12}, - {0x8679,0x09}, - {0x867a,0xee}, - {0x867b,0xc2}, - {0x867c,0x21}, - {0x867d,0xd2}, - {0x867e,0x25}, - {0x867f,0x80}, - {0x8680,0x48}, - {0x8681,0x30}, - {0x8682,0x07}, - {0x8683,0x45}, - {0x8684,0x30}, - {0x8685,0x06}, - {0x8686,0x42}, - {0x8687,0x12}, - {0x8688,0x04}, - {0x8689,0xc9}, - {0x868a,0xd2}, - {0x868b,0x21}, - {0x868c,0x80}, - {0x868d,0x3b}, - {0x868e,0x20}, - {0x868f,0x07}, - {0x8690,0x03}, - {0x8691,0x30}, - {0x8692,0x06}, - {0x8693,0x09}, - {0x8694,0xe5}, - {0x8695,0x45}, - {0x8696,0x64}, - {0x8697,0x0e}, - {0x8698,0x70}, - {0x8699,0x2f}, - {0x869a,0x20}, - {0x869b,0x00}, - {0x869c,0x2c}, - {0x869d,0x12}, - {0x869e,0x06}, - {0x869f,0xd5}, - {0x86a0,0x80}, - {0x86a1,0x27}, - {0x86a2,0x12}, - {0x86a3,0x02}, - {0x86a4,0xc4}, - {0x86a5,0x80}, - {0x86a6,0x22}, - {0x86a7,0x30}, - {0x86a8,0x05}, - {0x86a9,0x1f}, - {0x86aa,0x20}, - {0x86ab,0x07}, - {0x86ac,0x1c}, - {0x86ad,0x20}, - {0x86ae,0x06}, - {0x86af,0x19}, - {0x86b0,0x12}, - {0x86b1,0x0c}, - {0x86b2,0xa6}, - {0x86b3,0x80}, - {0x86b4,0x14}, - {0x86b5,0x12}, - {0x86b6,0x09}, - {0x86b7,0x85}, - {0x86b8,0x80}, - {0x86b9,0x0f}, - {0x86ba,0x20}, - {0x86bb,0x07}, - {0x86bc,0x0c}, - {0x86bd,0x20}, - {0x86be,0x06}, - {0x86bf,0x09}, - {0x86c0,0x12}, - {0x86c1,0x0d}, - {0x86c2,0x3c}, - {0x86c3,0x80}, - {0x86c4,0x04}, - {0x86c5,0xd2}, - {0x86c6,0x26}, - {0x86c7,0xc2}, - {0x86c8,0x26}, - {0x86c9,0x20}, - {0x86ca,0x07}, - {0x86cb,0x03}, - {0x86cc,0x20}, - {0x86cd,0x06}, - {0x86ce,0x05}, - {0x86cf,0x90}, - {0x86d0,0x3f}, - {0x86d1,0x01}, - {0x86d2,0xe4}, - {0x86d3,0xf0}, - {0x86d4,0x22}, - {0x86d5,0xe5}, - {0x86d6,0x45}, - {0x86d7,0x24}, - {0x86d8,0xfe}, - {0x86d9,0x60}, - {0x86da,0x19}, - {0x86db,0x14}, - {0x86dc,0x60}, - {0x86dd,0x2c}, - {0x86de,0x24}, - {0x86df,0x02}, - {0x86e0,0x60}, - {0x86e1,0x03}, - {0x86e2,0x02}, - {0x86e3,0x07}, - {0x86e4,0xa8}, - {0x86e5,0xe5}, - {0x86e6,0x3c}, - {0x86e7,0xd3}, - {0x86e8,0x94}, - {0x86e9,0x03}, - {0x86ea,0x40}, - {0x86eb,0x03}, - {0x86ec,0x75}, - {0x86ed,0x3c}, - {0x86ee,0x03}, - {0x86ef,0xe4}, - {0x86f0,0xf5}, - {0x86f1,0x09}, - {0x86f2,0x80}, - {0x86f3,0x0d}, - {0x86f4,0xe5}, - {0x86f5,0x3c}, - {0x86f6,0xd3}, - {0x86f7,0x94}, - {0x86f8,0x05}, - {0x86f9,0x40}, - {0x86fa,0x03}, - {0x86fb,0x75}, - {0x86fc,0x3c}, - {0x86fd,0x05}, - {0x86fe,0x75}, - {0x86ff,0x09}, - {0x8700,0x01}, - {0x8701,0x85}, - {0x8702,0x3c}, - {0x8703,0x0a}, - {0x8704,0x12}, - {0x8705,0x08}, - {0x8706,0xfa}, - {0x8707,0xd2}, - {0x8708,0x20}, - {0x8709,0x22}, - {0x870a,0xe5}, - {0x870b,0x39}, - {0x870c,0xd3}, - {0x870d,0x94}, - {0x870e,0x28}, - {0x870f,0x40}, - {0x8710,0x04}, - {0x8711,0x7f}, - {0x8712,0x28}, - {0x8713,0x80}, - {0x8714,0x02}, - {0x8715,0xaf}, - {0x8716,0x39}, - {0x8717,0x8f}, - {0x8718,0x39}, - {0x8719,0xe5}, - {0x871a,0x3a}, - {0x871b,0xd3}, - {0x871c,0x94}, - {0x871d,0x1e}, - {0x871e,0x40}, - {0x871f,0x04}, - {0x8720,0x7f}, - {0x8721,0x1e}, - {0x8722,0x80}, - {0x8723,0x02}, - {0x8724,0xaf}, - {0x8725,0x3a}, - {0x8726,0x8f}, - {0x8727,0x3a}, - {0x8728,0xe5}, - {0x8729,0x3b}, - {0x872a,0xd3}, - {0x872b,0x94}, - {0x872c,0x28}, - {0x872d,0x40}, - {0x872e,0x04}, - {0x872f,0x7f}, - {0x8730,0x28}, - {0x8731,0x80}, - {0x8732,0x02}, - {0x8733,0xaf}, - {0x8734,0x3b}, - {0x8735,0x8f}, - {0x8736,0x3b}, - {0x8737,0xe5}, - {0x8738,0x3c}, - {0x8739,0xd3}, - {0x873a,0x94}, - {0x873b,0x1e}, - {0x873c,0x40}, - {0x873d,0x04}, - {0x873e,0x7f}, - {0x873f,0x1e}, - {0x8740,0x80}, - {0x8741,0x02}, - {0x8742,0xaf}, - {0x8743,0x3c}, - {0x8744,0x8f}, - {0x8745,0x3c}, - {0x8746,0xaf}, - {0x8747,0x3a}, - {0x8748,0x78}, - {0x8749,0x10}, - {0x874a,0x12}, - {0x874b,0x04}, - {0x874c,0xb7}, - {0x874d,0xc0}, - {0x874e,0x04}, - {0x874f,0xc0}, - {0x8750,0x05}, - {0x8751,0xc0}, - {0x8752,0x06}, - {0x8753,0xc0}, - {0x8754,0x07}, - {0x8755,0xaf}, - {0x8756,0x39}, - {0x8757,0x78}, - {0x8758,0x18}, - {0x8759,0x12}, - {0x875a,0x04}, - {0x875b,0xb7}, - {0x875c,0xd0}, - {0x875d,0x03}, - {0x875e,0xd0}, - {0x875f,0x02}, - {0x8760,0xd0}, - {0x8761,0x01}, - {0x8762,0xd0}, - {0x8763,0x00}, - {0x8764,0xef}, - {0x8765,0x4b}, - {0x8766,0xff}, - {0x8767,0xee}, - {0x8768,0x4a}, - {0x8769,0xfe}, - {0x876a,0xed}, - {0x876b,0x49}, - {0x876c,0xfd}, - {0x876d,0xec}, - {0x876e,0x48}, - {0x876f,0xfc}, - {0x8770,0xc0}, - {0x8771,0x04}, - {0x8772,0xc0}, - {0x8773,0x05}, - {0x8774,0xc0}, - {0x8775,0x06}, - {0x8776,0xc0}, - {0x8777,0x07}, - {0x8778,0xaf}, - {0x8779,0x3b}, - {0x877a,0xe4}, - {0x877b,0xfc}, - {0x877c,0xfd}, - {0x877d,0xfe}, - {0x877e,0x78}, - {0x877f,0x08}, - {0x8780,0x12}, - {0x8781,0x01}, - {0x8782,0x33}, - {0x8783,0xd0}, - {0x8784,0x03}, - {0x8785,0xd0}, - {0x8786,0x02}, - {0x8787,0xd0}, - {0x8788,0x01}, - {0x8789,0xd0}, - {0x878a,0x00}, - {0x878b,0xef}, - {0x878c,0x4b}, - {0x878d,0xfb}, - {0x878e,0xee}, - {0x878f,0x4a}, - {0x8790,0xfa}, - {0x8791,0xed}, - {0x8792,0x49}, - {0x8793,0xf9}, - {0x8794,0xec}, - {0x8795,0x48}, - {0x8796,0xf8}, - {0x8797,0xaf}, - {0x8798,0x3c}, - {0x8799,0xeb}, - {0x879a,0x4f}, - {0x879b,0xf5}, - {0x879c,0x2d}, - {0x879d,0xea}, - {0x879e,0xf5}, - {0x879f,0x2c}, - {0x87a0,0xe9}, - {0x87a1,0xf5}, - {0x87a2,0x2b}, - {0x87a3,0xe8}, - {0x87a4,0xf5}, - {0x87a5,0x2a}, - {0x87a6,0xd2}, - {0x87a7,0x20}, - {0x87a8,0x22}, - {0x87a9,0xc0}, - {0x87aa,0xe0}, - {0x87ab,0xc0}, - {0x87ac,0x83}, - {0x87ad,0xc0}, - {0x87ae,0x82}, - {0x87af,0xc0}, - {0x87b0,0xd0}, - {0x87b1,0x75}, - {0x87b2,0xd0}, - {0x87b3,0x00}, - {0x87b4,0xc0}, - {0x87b5,0x00}, - {0x87b6,0xc0}, - {0x87b7,0x06}, - {0x87b8,0xc0}, - {0x87b9,0x07}, - {0x87ba,0x90}, - {0x87bb,0x37}, - {0x87bc,0x08}, - {0x87bd,0xe0}, - {0x87be,0xf5}, - {0x87bf,0x08}, - {0x87c0,0xe5}, - {0x87c1,0x08}, - {0x87c2,0x30}, - {0x87c3,0xe3}, - {0x87c4,0x23}, - {0x87c5,0x20}, - {0x87c6,0x26}, - {0x87c7,0x20}, - {0x87c8,0x90}, - {0x87c9,0x3a}, - {0x87ca,0x00}, - {0x87cb,0x74}, - {0x87cc,0x81}, - {0x87cd,0xf0}, - {0x87ce,0x90}, - {0x87cf,0x3a}, - {0x87d0,0x03}, - {0x87d1,0xe0}, - {0x87d2,0xf5}, - {0x87d3,0x3e}, - {0x87d4,0xe0}, - {0x87d5,0xf5}, - {0x87d6,0x3d}, - {0x87d7,0x90}, - {0x87d8,0x3a}, - {0x87d9,0x00}, - {0x87da,0x74}, - {0x87db,0x85}, - {0x87dc,0xf0}, - {0x87dd,0x90}, - {0x87de,0x3a}, - {0x87df,0x03}, - {0x87e0,0xe0}, - {0x87e1,0xf5}, - {0x87e2,0x40}, - {0x87e3,0xe0}, - {0x87e4,0xf5}, - {0x87e5,0x3f}, - {0x87e6,0xd2}, - {0x87e7,0x2f}, - {0x87e8,0xe5}, - {0x87e9,0x08}, - {0x87ea,0x30}, - {0x87eb,0xe5}, - {0x87ec,0x56}, - {0x87ed,0x90}, - {0x87ee,0x30}, - {0x87ef,0x1b}, - {0x87f0,0xe0}, - {0x87f1,0xf5}, - {0x87f2,0x42}, - {0x87f3,0xe5}, - {0x87f4,0x41}, - {0x87f5,0x24}, - {0x87f6,0x02}, - {0x87f7,0xff}, - {0x87f8,0xe4}, - {0x87f9,0x33}, - {0x87fa,0xfe}, - {0x87fb,0xc3}, - {0x87fc,0xef}, - {0x87fd,0x95}, - {0x87fe,0x42}, - {0x87ff,0x74}, - {0x8800,0x80}, - {0x8801,0xf8}, - {0x8802,0x6e}, - {0x8803,0x98}, - {0x8804,0x50}, - {0x8805,0x02}, - {0x8806,0x80}, - {0x8807,0x01}, - {0x8808,0xc3}, - {0x8809,0x92}, - {0x880a,0x24}, - {0x880b,0xe5}, - {0x880c,0x42}, - {0x880d,0x24}, - {0x880e,0x02}, - {0x880f,0xff}, - {0x8810,0xe4}, - {0x8811,0x33}, - {0x8812,0xfe}, - {0x8813,0xc3}, - {0x8814,0xef}, - {0x8815,0x95}, - {0x8816,0x41}, - {0x8817,0x74}, - {0x8818,0x80}, - {0x8819,0xf8}, - {0x881a,0x6e}, - {0x881b,0x98}, - {0x881c,0x50}, - {0x881d,0x02}, - {0x881e,0x80}, - {0x881f,0x02}, - {0x8820,0xa2}, - {0x8821,0x24}, - {0x8822,0x92}, - {0x8823,0x24}, - {0x8824,0x30}, - {0x8825,0x24}, - {0x8826,0x04}, - {0x8827,0xaf}, - {0x8828,0x42}, - {0x8829,0x80}, - {0x882a,0x02}, - {0x882b,0xaf}, - {0x882c,0x41}, - {0x882d,0x8f}, - {0x882e,0x41}, - {0x882f,0x30}, - {0x8830,0x27}, - {0x8831,0x11}, - {0x8832,0x90}, - {0x8833,0x33}, - {0x8834,0x00}, - {0x8835,0xe0}, - {0x8836,0x30}, - {0x8837,0x29}, - {0x8838,0x05}, - {0x8839,0x44}, - {0x883a,0x40}, - {0x883b,0xf0}, - {0x883c,0x80}, - {0x883d,0x03}, - {0x883e,0x54}, - {0x883f,0xbf}, - {0x8840,0xf0}, - {0x8841,0xc2}, - {0x8842,0x27}, - {0x8843,0xe5}, - {0x8844,0x08}, - {0x8845,0x30}, - {0x8846,0xe1}, - {0x8847,0x08}, - {0x8848,0x90}, - {0x8849,0x3f}, - {0x884a,0x00}, - {0x884b,0xe0}, - {0x884c,0xf5}, - {0x884d,0x29}, - {0x884e,0xe4}, - {0x884f,0xf0}, - {0x8850,0x90}, - {0x8851,0x37}, - {0x8852,0x08}, - {0x8853,0xe5}, - {0x8854,0x08}, - {0x8855,0xf0}, - {0x8856,0xd0}, - {0x8857,0x07}, - {0x8858,0xd0}, - {0x8859,0x06}, - {0x885a,0xd0}, - {0x885b,0x00}, - {0x885c,0xd0}, - {0x885d,0xd0}, - {0x885e,0xd0}, - {0x885f,0x82}, - {0x8860,0xd0}, - {0x8861,0x83}, - {0x8862,0xd0}, - {0x8863,0xe0}, - {0x8864,0x32}, - {0x8865,0x12}, - {0x8866,0x04}, - {0x8867,0xbe}, - {0x8868,0xb5}, - {0x8869,0x07}, - {0x886a,0x03}, - {0x886b,0xd3}, - {0x886c,0x80}, - {0x886d,0x01}, - {0x886e,0xc3}, - {0x886f,0x40}, - {0x8870,0x03}, - {0x8871,0x02}, - {0x8872,0x08}, - {0x8873,0xf9}, - {0x8874,0x90}, - {0x8875,0x31}, - {0x8876,0x00}, - {0x8877,0xe0}, - {0x8878,0x54}, - {0x8879,0xfe}, - {0x887a,0xf0}, - {0x887b,0xe0}, - {0x887c,0x54}, - {0x887d,0xfd}, - {0x887e,0xf0}, - {0x887f,0xa3}, - {0x8880,0xe4}, - {0x8881,0xf0}, - {0x8882,0x90}, - {0x8883,0x33}, - {0x8884,0x00}, - {0x8885,0xe0}, - {0x8886,0x54}, - {0x8887,0xbf}, - {0x8888,0xf0}, - {0x8889,0x12}, - {0x888a,0x04}, - {0x888b,0x8b}, - {0x888c,0x90}, - {0x888d,0x33}, - {0x888e,0xb0}, - {0x888f,0xf0}, - {0x8890,0xa3}, - {0x8891,0xf0}, - {0x8892,0xa3}, - {0x8893,0xf0}, - {0x8894,0x90}, - {0x8895,0x30}, - {0x8896,0xb2}, - {0x8897,0xe0}, - {0x8898,0x44}, - {0x8899,0x08}, - {0x889a,0xf0}, - {0x889b,0x90}, - {0x889c,0x30}, - {0x889d,0xb0}, - {0x889e,0xe0}, - {0x889f,0x44}, - {0x88a0,0x01}, - {0x88a1,0xf0}, - {0x88a2,0xa3}, - {0x88a3,0xe0}, - {0x88a4,0x44}, - {0x88a5,0x0c}, - {0x88a6,0xf0}, - {0x88a7,0x90}, - {0x88a8,0x30}, - {0x88a9,0xb4}, - {0x88aa,0xe0}, - {0x88ab,0x44}, - {0x88ac,0x07}, - {0x88ad,0xf0}, - {0x88ae,0xe0}, - {0x88af,0xf5}, - {0x88b0,0x23}, - {0x88b1,0x90}, - {0x88b2,0x30}, - {0x88b3,0xb1}, - {0x88b4,0xe0}, - {0x88b5,0xf5}, - {0x88b6,0x21}, - {0x88b7,0x90}, - {0x88b8,0x39}, - {0x88b9,0x01}, - {0x88ba,0x74}, - {0x88bb,0x35}, - {0x88bc,0xf0}, - {0x88bd,0x90}, - {0x88be,0x39}, - {0x88bf,0x00}, - {0x88c0,0x74}, - {0x88c1,0x20}, - {0x88c2,0xf0}, - {0x88c3,0x90}, - {0x88c4,0x37}, - {0x88c5,0x00}, - {0x88c6,0x74}, - {0x88c7,0xff}, - {0x88c8,0xf0}, - {0x88c9,0xa3}, - {0x88ca,0xf0}, - {0x88cb,0x90}, - {0x88cc,0x37}, - {0x88cd,0x00}, - {0x88ce,0xe0}, - {0x88cf,0x54}, - {0x88d0,0xf7}, - {0x88d1,0xf0}, - {0x88d2,0xe0}, - {0x88d3,0x54}, - {0x88d4,0xdf}, - {0x88d5,0xf0}, - {0x88d6,0x90}, - {0x88d7,0x31}, - {0x88d8,0x0f}, - {0x88d9,0x74}, - {0x88da,0x3f}, - {0x88db,0xf0}, - {0x88dc,0xa3}, - {0x88dd,0xe4}, - {0x88de,0xf0}, - {0x88df,0xa3}, - {0x88e0,0x74}, - {0x88e1,0x3f}, - {0x88e2,0xf0}, - {0x88e3,0xa3}, - {0x88e4,0x74}, - {0x88e5,0x01}, - {0x88e6,0xf0}, - {0x88e7,0x90}, - {0x88e8,0x37}, - {0x88e9,0x00}, - {0x88ea,0xe0}, - {0x88eb,0x54}, - {0x88ec,0xfd}, - {0x88ed,0xf0}, - {0x88ee,0x90}, - {0x88ef,0x37}, - {0x88f0,0x08}, - {0x88f1,0x74}, - {0x88f2,0xff}, - {0x88f3,0xf0}, - {0x88f4,0xa3}, - {0x88f5,0xf0}, - {0x88f6,0x75}, - {0x88f7,0xa8}, - {0x88f8,0x01}, - {0x88f9,0x22}, - {0x88fa,0xe5}, - {0x88fb,0x0a}, - {0x88fc,0x25}, - {0x88fd,0xe0}, - {0x88fe,0x25}, - {0x88ff,0xe0}, - {0x8900,0xf5}, - {0x8901,0x0b}, - {0x8902,0xe5}, - {0x8903,0x09}, - {0x8904,0x60}, - {0x8905,0x09}, - {0x8906,0xe5}, - {0x8907,0x0a}, - {0x8908,0x75}, - {0x8909,0xf0}, - {0x890a,0x03}, - {0x890b,0xa4}, - {0x890c,0xff}, - {0x890d,0x80}, - {0x890e,0x02}, - {0x890f,0xaf}, - {0x8910,0x0b}, - {0x8911,0x8f}, - {0x8912,0x0c}, - {0x8913,0xc3}, - {0x8914,0x74}, - {0x8915,0x0f}, - {0x8916,0x9f}, - {0x8917,0x78}, - {0x8918,0x10}, - {0x8919,0x12}, - {0x891a,0x04}, - {0x891b,0x71}, - {0x891c,0xc0}, - {0x891d,0x04}, - {0x891e,0xc0}, - {0x891f,0x05}, - {0x8920,0xc0}, - {0x8921,0x06}, - {0x8922,0xc0}, - {0x8923,0x07}, - {0x8924,0xc3}, - {0x8925,0x74}, - {0x8926,0x14}, - {0x8927,0x95}, - {0x8928,0x0b}, - {0x8929,0x78}, - {0x892a,0x18}, - {0x892b,0x12}, - {0x892c,0x04}, - {0x892d,0x71}, - {0x892e,0xd0}, - {0x892f,0x03}, - {0x8930,0xd0}, - {0x8931,0x02}, - {0x8932,0xd0}, - {0x8933,0x01}, - {0x8934,0xd0}, - {0x8935,0x00}, - {0x8936,0xef}, - {0x8937,0x4b}, - {0x8938,0xff}, - {0x8939,0xee}, - {0x893a,0x4a}, - {0x893b,0xfe}, - {0x893c,0xed}, - {0x893d,0x49}, - {0x893e,0xfd}, - {0x893f,0xec}, - {0x8940,0x48}, - {0x8941,0xfc}, - {0x8942,0xc0}, - {0x8943,0x04}, - {0x8944,0xc0}, - {0x8945,0x05}, - {0x8946,0xc0}, - {0x8947,0x06}, - {0x8948,0xc0}, - {0x8949,0x07}, - {0x894a,0xe5}, - {0x894b,0x0b}, - {0x894c,0x24}, - {0x894d,0x14}, - {0x894e,0xff}, - {0x894f,0xe4}, - {0x8950,0x33}, - {0x8951,0xfe}, - {0x8952,0xe4}, - {0x8953,0xfc}, - {0x8954,0xfd}, - {0x8955,0x78}, - {0x8956,0x08}, - {0x8957,0x12}, - {0x8958,0x01}, - {0x8959,0x33}, - {0x895a,0xd0}, - {0x895b,0x03}, - {0x895c,0xd0}, - {0x895d,0x02}, - {0x895e,0xd0}, - {0x895f,0x01}, - {0x8960,0xd0}, - {0x8961,0x00}, - {0x8962,0xef}, - {0x8963,0x4b}, - {0x8964,0xfb}, - {0x8965,0xee}, - {0x8966,0x4a}, - {0x8967,0xfa}, - {0x8968,0xed}, - {0x8969,0x49}, - {0x896a,0xf9}, - {0x896b,0xec}, - {0x896c,0x48}, - {0x896d,0xf8}, - {0x896e,0xe5}, - {0x896f,0x0c}, - {0x8970,0x24}, - {0x8971,0x0f}, - {0x8972,0xff}, - {0x8973,0xe4}, - {0x8974,0x33}, - {0x8975,0xfe}, - {0x8976,0xeb}, - {0x8977,0x4f}, - {0x8978,0xf5}, - {0x8979,0x2d}, - {0x897a,0xea}, - {0x897b,0x4e}, - {0x897c,0xf5}, - {0x897d,0x2c}, - {0x897e,0xe9}, - {0x897f,0xf5}, - {0x8980,0x2b}, - {0x8981,0xe8}, - {0x8982,0xf5}, - {0x8983,0x2a}, - {0x8984,0x22}, - {0x8985,0xe5}, - {0x8986,0x45}, - {0x8987,0x64}, - {0x8988,0x01}, - {0x8989,0x70}, - {0x898a,0x50}, - {0x898b,0x12}, - {0x898c,0x04}, - {0x898d,0x6a}, - {0x898e,0xe5}, - {0x898f,0x44}, - {0x8990,0x12}, - {0x8991,0x04}, - {0x8992,0x18}, - {0x8993,0xfe}, - {0x8994,0xe4}, - {0x8995,0x8f}, - {0x8996,0x3c}, - {0x8997,0x8e}, - {0x8998,0x3b}, - {0x8999,0xf5}, - {0x899a,0x3a}, - {0x899b,0xf5}, - {0x899c,0x39}, - {0x899d,0x12}, - {0x899e,0x04}, - {0x899f,0x44}, - {0x89a0,0x7b}, - {0x89a1,0xff}, - {0x89a2,0xfa}, - {0x89a3,0xf9}, - {0x89a4,0xf8}, - {0x89a5,0x12}, - {0x89a6,0x04}, - {0x89a7,0x39}, - {0x89a8,0xc0}, - {0x89a9,0x04}, - {0x89aa,0xc0}, - {0x89ab,0x05}, - {0x89ac,0xc0}, - {0x89ad,0x06}, - {0x89ae,0xc0}, - {0x89af,0x07}, - {0x89b0,0x12}, - {0x89b1,0x04}, - {0x89b2,0x10}, - {0x89b3,0xab}, - {0x89b4,0x07}, - {0x89b5,0xfa}, - {0x89b6,0xe4}, - {0x89b7,0xf9}, - {0x89b8,0xf8}, - {0x89b9,0xd0}, - {0x89ba,0x07}, - {0x89bb,0xd0}, - {0x89bc,0x06}, - {0x89bd,0xd0}, - {0x89be,0x05}, - {0x89bf,0xd0}, - {0x89c0,0x04}, - {0x89c1,0x12}, - {0x89c2,0x04}, - {0x89c3,0x9f}, - {0x89c4,0x85}, - {0x89c5,0x3c}, - {0x89c6,0x39}, - {0x89c7,0x85}, - {0x89c8,0x44}, - {0x89c9,0x3a}, - {0x89ca,0x12}, - {0x89cb,0x04}, - {0x89cc,0x6a}, - {0x89cd,0xe5}, - {0x89ce,0x44}, - {0x89cf,0x12}, - {0x89d0,0x04}, - {0x89d1,0xd4}, - {0x89d2,0xe4}, - {0x89d3,0x93}, - {0x89d4,0xf5}, - {0x89d5,0x3b}, - {0x89d6,0x74}, - {0x89d7,0x01}, - {0x89d8,0x93}, - {0x89d9,0xf5}, - {0x89da,0x3c}, - {0x89db,0x90}, - {0x89dc,0x3f}, - {0x89dd,0x02}, - {0x89de,0xe5}, - {0x89df,0x39}, - {0x89e0,0xf0}, - {0x89e1,0xa3}, - {0x89e2,0xe5}, - {0x89e3,0x3a}, - {0x89e4,0xf0}, - {0x89e5,0xa3}, - {0x89e6,0xe5}, - {0x89e7,0x3b}, - {0x89e8,0xf0}, - {0x89e9,0xa3}, - {0x89ea,0xe5}, - {0x89eb,0x3c}, - {0x89ec,0xf0}, - {0x89ed,0x22}, - {0x89ee,0xe5}, - {0x89ef,0x09}, - {0x89f0,0xd3}, - {0x89f1,0x95}, - {0x89f2,0x43}, - {0x89f3,0x40}, - {0x89f4,0x01}, - {0x89f5,0x22}, - {0x89f6,0x12}, - {0x89f7,0x04}, - {0x89f8,0x6a}, - {0x89f9,0xe5}, - {0x89fa,0x09}, - {0x89fb,0x12}, - {0x89fc,0x04}, - {0x89fd,0xd4}, - {0x89fe,0xe4}, - {0x89ff,0x93}, - {0x8a00,0xfe}, - {0x8a01,0x74}, - {0x8a02,0x01}, - {0x8a03,0x93}, - {0x8a04,0xff}, - {0x8a05,0x4e}, - {0x8a06,0x60}, - {0x8a07,0x21}, - {0x8a08,0x8e}, - {0x8a09,0x37}, - {0x8a0a,0x8f}, - {0x8a0b,0x38}, - {0x8a0c,0xef}, - {0x8a0d,0xc4}, - {0x8a0e,0xf8}, - {0x8a0f,0x54}, - {0x8a10,0x0f}, - {0x8a11,0xc8}, - {0x8a12,0x68}, - {0x8a13,0xff}, - {0x8a14,0xee}, - {0x8a15,0xc4}, - {0x8a16,0x54}, - {0x8a17,0xf0}, - {0x8a18,0x48}, - {0x8a19,0xfe}, - {0x8a1a,0x43}, - {0x8a1b,0x07}, - {0x8a1c,0x0d}, - {0x8a1d,0x8e}, - {0x8a1e,0x0a}, - {0x8a1f,0x8f}, - {0x8a20,0x0b}, - {0x8a21,0x12}, - {0x8a22,0x01}, - {0x8a23,0x78}, - {0x8a24,0x30}, - {0x8a25,0x23}, - {0x8a26,0x22}, - {0x8a27,0xc3}, - {0x8a28,0x22}, - {0x8a29,0x75}, - {0x8a2a,0x0a}, - {0x8a2b,0x00}, - {0x8a2c,0x75}, - {0x8a2d,0x0b}, - {0x8a2e,0x0d}, - {0x8a2f,0x12}, - {0x8a30,0x01}, - {0x8a31,0x78}, - {0x8a32,0x30}, - {0x8a33,0x23}, - {0x8a34,0x02}, - {0x8a35,0xc3}, - {0x8a36,0x22}, - {0x8a37,0x75}, - {0x8a38,0x0a}, - {0x8a39,0x00}, - {0x8a3a,0x75}, - {0x8a3b,0x0b}, - {0x8a3c,0x64}, - {0x8a3d,0x12}, - {0x8a3e,0x0c}, - {0x8a3f,0x67}, - {0x8a40,0x75}, - {0x8a41,0x0a}, - {0x8a42,0x80}, - {0x8a43,0x75}, - {0x8a44,0x0b}, - {0x8a45,0x00}, - {0x8a46,0x12}, - {0x8a47,0x01}, - {0x8a48,0x78}, - {0x8a49,0x85}, - {0x8a4a,0x09}, - {0x8a4b,0x44}, - {0x8a4c,0xd3}, - {0x8a4d,0x22}, - {0x8a4e,0xc2}, - {0x8a4f,0x25}, - {0x8a50,0x20}, - {0x8a51,0x05}, - {0x8a52,0x05}, - {0x8a53,0x75}, - {0x8a54,0x09}, - {0x8a55,0xee}, - {0x8a56,0x80}, - {0x8a57,0x36}, - {0x8a58,0x20}, - {0x8a59,0x07}, - {0x8a5a,0x08}, - {0x8a5b,0x20}, - {0x8a5c,0x06}, - {0x8a5d,0x05}, - {0x8a5e,0xe4}, - {0x8a5f,0xf5}, - {0x8a60,0x09}, - {0x8a61,0x80}, - {0x8a62,0x2b}, - {0x8a63,0x20}, - {0x8a64,0x07}, - {0x8a65,0x08}, - {0x8a66,0x30}, - {0x8a67,0x06}, - {0x8a68,0x05}, - {0x8a69,0x75}, - {0x8a6a,0x09}, - {0x8a6b,0x20}, - {0x8a6c,0x80}, - {0x8a6d,0x20}, - {0x8a6e,0x30}, - {0x8a6f,0x00}, - {0x8a70,0x05}, - {0x8a71,0x75}, - {0x8a72,0x09}, - {0x8a73,0x01}, - {0x8a74,0x80}, - {0x8a75,0x18}, - {0x8a76,0xe5}, - {0x8a77,0x20}, - {0x8a78,0x54}, - {0x8a79,0x07}, - {0x8a7a,0xff}, - {0x8a7b,0xbf}, - {0x8a7c,0x06}, - {0x8a7d,0x0d}, - {0x8a7e,0x30}, - {0x8a7f,0x21}, - {0x8a80,0x04}, - {0x8a81,0x7f}, - {0x8a82,0x12}, - {0x8a83,0x80}, - {0x8a84,0x02}, - {0x8a85,0x7f}, - {0x8a86,0x02}, - {0x8a87,0x8f}, - {0x8a88,0x09}, - {0x8a89,0x80}, - {0x8a8a,0x03}, - {0x8a8b,0x75}, - {0x8a8c,0x09}, - {0x8a8d,0xfe}, - {0x8a8e,0x90}, - {0x8a8f,0x3f}, - {0x8a90,0x07}, - {0x8a91,0xe5}, - {0x8a92,0x09}, - {0x8a93,0xf0}, - {0x8a94,0x90}, - {0x8a95,0x3f}, - {0x8a96,0x06}, - {0x8a97,0xe5}, - {0x8a98,0x44}, - {0x8a99,0xf0}, - {0x8a9a,0x22}, - {0x8a9b,0x85}, - {0x8a9c,0x0d}, - {0x8a9d,0x0e}, - {0x8a9e,0x7f}, - {0x8a9f,0x08}, - {0x8aa0,0xe5}, - {0x8aa1,0x0e}, - {0x8aa2,0x30}, - {0x8aa3,0xe7}, - {0x8aa4,0x04}, - {0x8aa5,0xd2}, - {0x8aa6,0x19}, - {0x8aa7,0x80}, - {0x8aa8,0x02}, - {0x8aa9,0xc2}, - {0x8aaa,0x19}, - {0x8aab,0x12}, - {0x8aac,0x04}, - {0x8aad,0x09}, - {0x8aae,0x75}, - {0x8aaf,0x32}, - {0x8ab0,0x0a}, - {0x8ab1,0xae}, - {0x8ab2,0x32}, - {0x8ab3,0x15}, - {0x8ab4,0x32}, - {0x8ab5,0xee}, - {0x8ab6,0x70}, - {0x8ab7,0xf9}, - {0x8ab8,0xe5}, - {0x8ab9,0x0e}, - {0x8aba,0x25}, - {0x8abb,0xe0}, - {0x8abc,0xf5}, - {0x8abd,0x0e}, - {0x8abe,0xd2}, - {0x8abf,0x18}, - {0x8ac0,0x12}, - {0x8ac1,0x04}, - {0x8ac2,0x09}, - {0x8ac3,0x75}, - {0x8ac4,0x32}, - {0x8ac5,0x0a}, - {0x8ac6,0xae}, - {0x8ac7,0x32}, - {0x8ac8,0x15}, - {0x8ac9,0x32}, - {0x8aca,0xee}, - {0x8acb,0x70}, - {0x8acc,0xf9}, - {0x8acd,0xc2}, - {0x8ace,0x18}, - {0x8acf,0x12}, - {0x8ad0,0x04}, - {0x8ad1,0x09}, - {0x8ad2,0x75}, - {0x8ad3,0x32}, - {0x8ad4,0x05}, - {0x8ad5,0xae}, - {0x8ad6,0x32}, - {0x8ad7,0x15}, - {0x8ad8,0x32}, - {0x8ad9,0xee}, - {0x8ada,0x70}, - {0x8adb,0xf9}, - {0x8adc,0xdf}, - {0x8add,0xc2}, - {0x8ade,0x22}, - {0x8adf,0x90}, - {0x8ae0,0x3f}, - {0x8ae1,0x07}, - {0x8ae2,0x74}, - {0x8ae3,0xfa}, - {0x8ae4,0xf0}, - {0x8ae5,0x12}, - {0x8ae6,0x08}, - {0x8ae7,0x65}, - {0x8ae8,0x12}, - {0x8ae9,0x0b}, - {0x8aea,0xfb}, - {0x8aeb,0xe4}, - {0x8aec,0xf5}, - {0x8aed,0x29}, - {0x8aee,0xd2}, - {0x8aef,0xaf}, - {0x8af0,0x12}, - {0x8af1,0x05}, - {0x8af2,0xfc}, - {0x8af3,0x30}, - {0x8af4,0x20}, - {0x8af5,0x03}, - {0x8af6,0x12}, - {0x8af7,0x02}, - {0x8af8,0xc4}, - {0x8af9,0x30}, - {0x8afa,0x25}, - {0x8afb,0x03}, - {0x8afc,0x12}, - {0x8afd,0x0a}, - {0x8afe,0x4e}, - {0x8aff,0x30}, - {0x8b00,0x2f}, - {0x8b01,0xee}, - {0x8b02,0xc2}, - {0x8b03,0x2f}, - {0x8b04,0xd2}, - {0x8b05,0x26}, - {0x8b06,0x30}, - {0x8b07,0x00}, - {0x8b08,0x05}, - {0x8b09,0x12}, - {0x8b0a,0x0b}, - {0x8b0b,0x7b}, - {0x8b0c,0x80}, - {0x8b0d,0x09}, - {0x8b0e,0x20}, - {0x8b0f,0x07}, - {0x8b10,0x06}, - {0x8b11,0x30}, - {0x8b12,0x06}, - {0x8b13,0x03}, - {0x8b14,0x12}, - {0x8b15,0x04}, - {0x8b16,0xf5}, - {0x8b17,0xc2}, - {0x8b18,0x26}, - {0x8b19,0x80}, - {0x8b1a,0xd5}, - {0x8b1b,0xe5}, - {0x8b1c,0x44}, - {0x8b1d,0x70}, - {0x8b1e,0x19}, - {0x8b1f,0x12}, - {0x8b20,0x0d}, - {0x8b21,0x4b}, - {0x8b22,0xc2}, - {0x8b23,0x30}, - {0x8b24,0x12}, - {0x8b25,0x0b}, - {0x8b26,0xd2}, - {0x8b27,0xc2}, - {0x8b28,0x30}, - {0x8b29,0x12}, - {0x8b2a,0x0c}, - {0x8b2b,0x89}, - {0x8b2c,0xc2}, - {0x8b2d,0x03}, - {0x8b2e,0x12}, - {0x8b2f,0x0c}, - {0x8b30,0xfe}, - {0x8b31,0xd2}, - {0x8b32,0x02}, - {0x8b33,0xd2}, - {0x8b34,0x01}, - {0x8b35,0xd2}, - {0x8b36,0x00}, - {0x8b37,0x22}, - {0x8b38,0x30}, - {0x8b39,0x03}, - {0x8b3a,0x08}, - {0x8b3b,0xc2}, - {0x8b3c,0x03}, - {0x8b3d,0xc2}, - {0x8b3e,0x04}, - {0x8b3f,0x12}, - {0x8b40,0x04}, - {0x8b41,0xe4}, - {0x8b42,0x22}, - {0x8b43,0xe4}, - {0x8b44,0xf5}, - {0x8b45,0x09}, - {0x8b46,0x12}, - {0x8b47,0x09}, - {0x8b48,0xee}, - {0x8b49,0xd2}, - {0x8b4a,0x03}, - {0x8b4b,0x22}, - {0x8b4c,0x36}, - {0x8b4d,0x0c}, - {0x8b4e,0x04}, - {0x8b4f,0x00}, - {0x8b50,0x00}, - {0x8b51,0x00}, - {0x8b52,0xc8}, - {0x8b53,0x01}, - {0x8b54,0x2c}, - {0x8b55,0x01}, - {0x8b56,0x5e}, - {0x8b57,0x01}, - {0x8b58,0x8b}, - {0x8b59,0x01}, - {0x8b5a,0xb8}, - {0x8b5b,0x01}, - {0x8b5c,0xe5}, - {0x8b5d,0x02}, - {0x8b5e,0x12}, - {0x8b5f,0x02}, - {0x8b60,0x3f}, - {0x8b61,0x02}, - {0x8b62,0x6c}, - {0x8b63,0x02}, - {0x8b64,0x99}, - {0x8b65,0x02}, - {0x8b66,0xc6}, - {0x8b67,0x02}, - {0x8b68,0xf3}, - {0x8b69,0x07}, - {0x8b6a,0x00}, - {0x8b6b,0x02}, - {0x8b6c,0x4e}, - {0x8b6d,0x02}, - {0x8b6e,0x6c}, - {0x8b6f,0x02}, - {0x8b70,0x8a}, - {0x8b71,0x02}, - {0x8b72,0xa8}, - {0x8b73,0x02}, - {0x8b74,0xc6}, - {0x8b75,0x02}, - {0x8b76,0xe4}, - {0x8b77,0x03}, - {0x8b78,0x02}, - {0x8b79,0x03}, - {0x8b7a,0x20}, - {0x8b7b,0xe5}, - {0x8b7c,0x20}, - {0x8b7d,0x54}, - {0x8b7e,0x07}, - {0x8b7f,0xff}, - {0x8b80,0xbf}, - {0x8b81,0x01}, - {0x8b82,0x03}, - {0x8b83,0x02}, - {0x8b84,0x0b}, - {0x8b85,0x1b}, - {0x8b86,0xe5}, - {0x8b87,0x20}, - {0x8b88,0x54}, - {0x8b89,0x07}, - {0x8b8a,0xff}, - {0x8b8b,0xbf}, - {0x8b8c,0x07}, - {0x8b8d,0x03}, - {0x8b8e,0x02}, - {0x8b8f,0x0c}, - {0x8b90,0x44}, - {0x8b91,0xe5}, - {0x8b92,0x20}, - {0x8b93,0x54}, - {0x8b94,0x07}, - {0x8b95,0xff}, - {0x8b96,0xbf}, - {0x8b97,0x03}, - {0x8b98,0x03}, - {0x8b99,0x02}, - {0x8b9a,0x0b}, - {0x8b9b,0xa8}, - {0x8b9c,0xe5}, - {0x8b9d,0x20}, - {0x8b9e,0x54}, - {0x8b9f,0x07}, - {0x8ba0,0xff}, - {0x8ba1,0xbf}, - {0x8ba2,0x05}, - {0x8ba3,0x03}, - {0x8ba4,0x12}, - {0x8ba5,0x0d}, - {0x8ba6,0x59}, - {0x8ba7,0x22}, - {0x8ba8,0x12}, - {0x8ba9,0x0c}, - {0x8baa,0x21}, - {0x8bab,0xd2}, - {0x8bac,0x30}, - {0x8bad,0x12}, - {0x8bae,0x0b}, - {0x8baf,0xd2}, - {0x8bb0,0xd2}, - {0x8bb1,0x30}, - {0x8bb2,0x12}, - {0x8bb3,0x0c}, - {0x8bb4,0x89}, - {0x8bb5,0xe5}, - {0x8bb6,0x43}, - {0x8bb7,0xd3}, - {0x8bb8,0x95}, - {0x8bb9,0x44}, - {0x8bba,0x40}, - {0x8bbb,0x03}, - {0x8bbc,0xd3}, - {0x8bbd,0x80}, - {0x8bbe,0x01}, - {0x8bbf,0xc3}, - {0x8bc0,0x50}, - {0x8bc1,0x0c}, - {0x8bc2,0x20}, - {0x8bc3,0x28}, - {0x8bc4,0x06}, - {0x8bc5,0x30}, - {0x8bc6,0x2d}, - {0x8bc7,0x03}, - {0x8bc8,0x20}, - {0x8bc9,0x2e}, - {0x8bca,0x03}, - {0x8bcb,0x02}, - {0x8bcc,0x0c}, - {0x8bcd,0xfe}, - {0x8bce,0x12}, - {0x8bcf,0x0c}, - {0x8bd0,0xbf}, - {0x8bd1,0x22}, - {0x8bd2,0x30}, - {0x8bd3,0x30}, - {0x8bd4,0x09}, - {0x8bd5,0x30}, - {0x8bd6,0x2d}, - {0x8bd7,0x06}, - {0x8bd8,0xae}, - {0x8bd9,0x33}, - {0x8bda,0xaf}, - {0x8bdb,0x34}, - {0x8bdc,0x80}, - {0x8bdd,0x04}, - {0x8bde,0xae}, - {0x8bdf,0x3d}, - {0x8be0,0xaf}, - {0x8be1,0x3e}, - {0x8be2,0x8e}, - {0x8be3,0x33}, - {0x8be4,0x8f}, - {0x8be5,0x34}, - {0x8be6,0x30}, - {0x8be7,0x30}, - {0x8be8,0x09}, - {0x8be9,0x30}, - {0x8bea,0x2e}, - {0x8beb,0x06}, - {0x8bec,0xae}, - {0x8bed,0x35}, - {0x8bee,0xaf}, - {0x8bef,0x36}, - {0x8bf0,0x80}, - {0x8bf1,0x04}, - {0x8bf2,0xae}, - {0x8bf3,0x3f}, - {0x8bf4,0xaf}, - {0x8bf5,0x40}, - {0x8bf6,0x8e}, - {0x8bf7,0x35}, - {0x8bf8,0x8f}, - {0x8bf9,0x36}, - {0x8bfa,0x22}, - {0x8bfb,0x12}, - {0x8bfc,0x0c}, - {0x8bfd,0xec}, - {0x8bfe,0x12}, - {0x8bff,0x0d}, - {0x8c00,0x67}, - {0x8c01,0x50}, - {0x8c02,0x04}, - {0x8c03,0xd2}, - {0x8c04,0x05}, - {0x8c05,0x80}, - {0x8c06,0x02}, - {0x8c07,0xc2}, - {0x8c08,0x05}, - {0x8c09,0x12}, - {0x8c0a,0x04}, - {0x8c0b,0x7c}, - {0x8c0c,0xc2}, - {0x8c0d,0x28}, - {0x8c0e,0xc2}, - {0x8c0f,0x21}, - {0x8c10,0xd2}, - {0x8c11,0x25}, - {0x8c12,0x12}, - {0x8c13,0x04}, - {0x8c14,0xbe}, - {0x8c15,0xb5}, - {0x8c16,0x07}, - {0x8c17,0x03}, - {0x8c18,0xd3}, - {0x8c19,0x80}, - {0x8c1a,0x01}, - {0x8c1b,0xc3}, - {0x8c1c,0x40}, - {0x8c1d,0x02}, - {0x8c1e,0xc2}, - {0x8c1f,0x05}, - {0x8c20,0x22}, - {0x8c21,0xd3}, - {0x8c22,0xe5}, - {0x8c23,0x34}, - {0x8c24,0x95}, - {0x8c25,0x3e}, - {0x8c26,0xe5}, - {0x8c27,0x33}, - {0x8c28,0x95}, - {0x8c29,0x3d}, - {0x8c2a,0x40}, - {0x8c2b,0x03}, - {0x8c2c,0xd3}, - {0x8c2d,0x80}, - {0x8c2e,0x01}, - {0x8c2f,0xc3}, - {0x8c30,0x92}, - {0x8c31,0x2d}, - {0x8c32,0xd3}, - {0x8c33,0xe5}, - {0x8c34,0x36}, - {0x8c35,0x95}, - {0x8c36,0x40}, - {0x8c37,0xe5}, - {0x8c38,0x35}, - {0x8c39,0x95}, - {0x8c3a,0x3f}, - {0x8c3b,0x40}, - {0x8c3c,0x03}, - {0x8c3d,0xd3}, - {0x8c3e,0x80}, - {0x8c3f,0x01}, - {0x8c40,0xc3}, - {0x8c41,0x92}, - {0x8c42,0x2e}, - {0x8c43,0x22}, - {0x8c44,0x12}, - {0x8c45,0x0c}, - {0x8c46,0x21}, - {0x8c47,0xd2}, - {0x8c48,0x30}, - {0x8c49,0x12}, - {0x8c4a,0x0b}, - {0x8c4b,0xd2}, - {0x8c4c,0xd2}, - {0x8c4d,0x30}, - {0x8c4e,0x12}, - {0x8c4f,0x0c}, - {0x8c50,0x89}, - {0x8c51,0x12}, - {0x8c52,0x0c}, - {0x8c53,0xfe}, - {0x8c54,0xe5}, - {0x8c55,0x28}, - {0x8c56,0xd3}, - {0x8c57,0x95}, - {0x8c58,0x44}, - {0x8c59,0x40}, - {0x8c5a,0x05}, - {0x8c5b,0xe4}, - {0x8c5c,0x95}, - {0x8c5d,0x44}, - {0x8c5e,0x40}, - {0x8c5f,0x06}, - {0x8c60,0xc2}, - {0x8c61,0x02}, - {0x8c62,0xd2}, - {0x8c63,0x01}, - {0x8c64,0xd2}, - {0x8c65,0x00}, - {0x8c66,0x22}, - {0x8c67,0xe4}, - {0x8c68,0xff}, - {0x8c69,0xfe}, - {0x8c6a,0xc3}, - {0x8c6b,0xef}, - {0x8c6c,0x95}, - {0x8c6d,0x0b}, - {0x8c6e,0xee}, - {0x8c6f,0x95}, - {0x8c70,0x0a}, - {0x8c71,0x50}, - {0x8c72,0x15}, - {0x8c73,0x7d}, - {0x8c74,0x8a}, - {0x8c75,0x7c}, - {0x8c76,0x02}, - {0x8c77,0xed}, - {0x8c78,0x1d}, - {0x8c79,0xaa}, - {0x8c7a,0x04}, - {0x8c7b,0x70}, - {0x8c7c,0x01}, - {0x8c7d,0x1c}, - {0x8c7e,0x4a}, - {0x8c7f,0x70}, - {0x8c80,0xf6}, - {0x8c81,0x0f}, - {0x8c82,0xbf}, - {0x8c83,0x00}, - {0x8c84,0x01}, - {0x8c85,0x0e}, - {0x8c86,0x80}, - {0x8c87,0xe2}, - {0x8c88,0x22}, - {0x8c89,0x30}, - {0x8c8a,0x30}, - {0x8c8b,0x07}, - {0x8c8c,0x30}, - {0x8c8d,0x2d}, - {0x8c8e,0x04}, - {0x8c8f,0xaf}, - {0x8c90,0x30}, - {0x8c91,0x80}, - {0x8c92,0x02}, - {0x8c93,0xaf}, - {0x8c94,0x44}, - {0x8c95,0x8f}, - {0x8c96,0x30}, - {0x8c97,0x30}, - {0x8c98,0x30}, - {0x8c99,0x07}, - {0x8c9a,0x30}, - {0x8c9b,0x2e}, - {0x8c9c,0x04}, - {0x8c9d,0xaf}, - {0x8c9e,0x31}, - {0x8c9f,0x80}, - {0x8ca0,0x02}, - {0x8ca1,0xaf}, - {0x8ca2,0x44}, - {0x8ca3,0x8f}, - {0x8ca4,0x31}, - {0x8ca5,0x22}, - {0x8ca6,0xe5}, - {0x8ca7,0x45}, - {0x8ca8,0xb4}, - {0x8ca9,0x01}, - {0x8caa,0x05}, - {0x8cab,0x12}, - {0x8cac,0x0d}, - {0x8cad,0x1e}, - {0x8cae,0x80}, - {0x8caf,0x08}, - {0x8cb0,0xe5}, - {0x8cb1,0x45}, - {0x8cb2,0xb4}, - {0x8cb3,0x02}, - {0x8cb4,0x09}, - {0x8cb5,0x12}, - {0x8cb6,0x0d}, - {0x8cb7,0x2d}, - {0x8cb8,0xe4}, - {0x8cb9,0xf5}, - {0x8cba,0x09}, - {0x8cbb,0x12}, - {0x8cbc,0x09}, - {0x8cbd,0xee}, - {0x8cbe,0x22}, - {0x8cbf,0xaf}, - {0x8cc0,0x31}, - {0x8cc1,0xe5}, - {0x8cc2,0x44}, - {0x8cc3,0xb5}, - {0x8cc4,0x07}, - {0x8cc5,0x03}, - {0x8cc6,0x02}, - {0x8cc7,0x0c}, - {0x8cc8,0xd8}, - {0x8cc9,0x8f}, - {0x8cca,0x09}, - {0x8ccb,0x12}, - {0x8ccc,0x09}, - {0x8ccd,0xee}, - {0x8cce,0xd2}, - {0x8ccf,0x02}, - {0x8cd0,0xc2}, - {0x8cd1,0x01}, - {0x8cd2,0xd2}, - {0x8cd3,0x00}, - {0x8cd4,0x75}, - {0x8cd5,0x27}, - {0x8cd6,0x03}, - {0x8cd7,0x22}, - {0x8cd8,0xc2}, - {0x8cd9,0x03}, - {0x8cda,0xd2}, - {0x8cdb,0x04}, - {0x8cdc,0x12}, - {0x8cdd,0x04}, - {0x8cde,0xe4}, - {0x8cdf,0xc2}, - {0x8ce0,0x30}, - {0x8ce1,0x12}, - {0x8ce2,0x0b}, - {0x8ce3,0xd2}, - {0x8ce4,0xc2}, - {0x8ce5,0x30}, - {0x8ce6,0x12}, - {0x8ce7,0x0c}, - {0x8ce8,0x89}, - {0x8ce9,0xd2}, - {0x8cea,0x25}, - {0x8ceb,0x22}, - {0x8cec,0x12}, - {0x8ced,0x04}, - {0x8cee,0x8b}, - {0x8cef,0xf5}, - {0x8cf0,0x09}, - {0x8cf1,0x75}, - {0x8cf2,0x0a}, - {0x8cf3,0x01}, - {0x8cf4,0x12}, - {0x8cf5,0x08}, - {0x8cf6,0xfa}, - {0x8cf7,0xd2}, - {0x8cf8,0x20}, - {0x8cf9,0xc2}, - {0x8cfa,0x26}, - {0x8cfb,0xc2}, - {0x8cfc,0x2f}, - {0x8cfd,0x22}, - {0x8cfe,0xe5}, - {0x8cff,0x44}, - {0x8d00,0xc3}, - {0x8d01,0x95}, - {0x8d02,0x43}, - {0x8d03,0x40}, - {0x8d04,0x01}, - {0x8d05,0x22}, - {0x8d06,0xe5}, - {0x8d07,0x44}, - {0x8d08,0x04}, - {0x8d09,0xf5}, - {0x8d0a,0x09}, - {0x8d0b,0x12}, - {0x8d0c,0x09}, - {0x8d0d,0xee}, - {0x8d0e,0x22}, - {0x8d0f,0xe5}, - {0x8d10,0x44}, - {0x8d11,0x70}, - {0x8d12,0x02}, - {0x8d13,0xc3}, - {0x8d14,0x22}, - {0x8d15,0xe5}, - {0x8d16,0x44}, - {0x8d17,0x14}, - {0x8d18,0xf5}, - {0x8d19,0x09}, - {0x8d1a,0x12}, - {0x8d1b,0x09}, - {0x8d1c,0xee}, - {0x8d1d,0x22}, - {0x8d1e,0x75}, - {0x8d1f,0x2e}, - {0x8d20,0x0b}, - {0x8d21,0x75}, - {0x8d22,0x2f}, - {0x8d23,0x4f}, - {0x8d24,0x90}, - {0x8d25,0x0b}, - {0x8d26,0x4d}, - {0x8d27,0x12}, - {0x8d28,0x04}, - {0x8d29,0xda}, - {0x8d2a,0xc2}, - {0x8d2b,0x2c}, - {0x8d2c,0x22}, - {0x8d2d,0x75}, - {0x8d2e,0x2e}, - {0x8d2f,0x0b}, - {0x8d30,0x75}, - {0x8d31,0x2f}, - {0x8d32,0x6b}, - {0x8d33,0x90}, - {0x8d34,0x0b}, - {0x8d35,0x69}, - {0x8d36,0x12}, - {0x8d37,0x04}, - {0x8d38,0xda}, - {0x8d39,0xd2}, - {0x8d3a,0x2c}, - {0x8d3b,0x22}, - {0x8d3c,0xe5}, - {0x8d3d,0x45}, - {0x8d3e,0x24}, - {0x8d3f,0xfe}, - {0x8d40,0x60}, - {0x8d41,0x06}, - {0x8d42,0x04}, - {0x8d43,0x70}, - {0x8d44,0x05}, - {0x8d45,0xd2}, - {0x8d46,0x28}, - {0x8d47,0x22}, - {0x8d48,0xc2}, - {0x8d49,0x28}, - {0x8d4a,0x22}, - {0x8d4b,0xe4}, - {0x8d4c,0xf5}, - {0x8d4d,0x33}, - {0x8d4e,0xf5}, - {0x8d4f,0x34}, - {0x8d50,0xf5}, - {0x8d51,0x35}, - {0x8d52,0xf5}, - {0x8d53,0x36}, - {0x8d54,0xc2}, - {0x8d55,0x2d}, - {0x8d56,0xc2}, - {0x8d57,0x2e}, - {0x8d58,0x22}, - {0x8d59,0xe5}, - {0x8d5a,0x27}, - {0x8d5b,0xd3}, - {0x8d5c,0x94}, - {0x8d5d,0x00}, - {0x8d5e,0x40}, - {0x8d5f,0x03}, - {0x8d60,0x15}, - {0x8d61,0x27}, - {0x8d62,0x22}, - {0x8d63,0x12}, - {0x8d64,0x0c}, - {0x8d65,0xd8}, - {0x8d66,0x22}, - {0x8d67,0x12}, - {0x8d68,0x0d}, - {0x8d69,0x1e}, - {0x8d6a,0xe4}, - {0x8d6b,0xf5}, - {0x8d6c,0x09}, - {0x8d6d,0x12}, - {0x8d6e,0x09}, - {0x8d6f,0xee}, - {0x8d70,0x22}, - {0x3F00,0x00}, - {0x3F01,0x00}, - {0x3F02,0x00}, - {0x3F03,0x00}, - {0x3F04,0x00}, - {0x3F05,0x00}, - {0x3F06,0x00}, - {0x3F07,0xFF}, - {0x3104,0x00}, - {0x0000,0x00} -}; -#endif \ No newline at end of file diff --git a/drivers/media/video/ov3660.c b/drivers/media/video/ov3660.c deleted file mode 100755 index efee33bdcc21..000000000000 --- a/drivers/media/video/ov3660.c +++ /dev/null @@ -1,3573 +0,0 @@ -/* -o* Driver for MT9M001 CMOS Image Sensor from Micron - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - - -static int debug; - - - -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, ...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## __VA_ARGS__); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME ov3660 -#define SENSOR_V4L2_IDENT V4L2_IDENT_OV3660 -#define SENSOR_ID 0x3660 -#define SENSOR_MIN_WIDTH 800 -#define SENSOR_MIN_HEIGHT 600 -#define SENSOR_MAX_WIDTH 2048 -#define SENSOR_MAX_HEIGHT 1536 -#define SENSOR_INIT_WIDTH 800 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 600 -#define SENSOR_INIT_WINSEQADR sensor_svga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_YUYV8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 1 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 1 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 - -#define CONFIG_SENSOR_I2C_SPEED 350000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING|\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) - -struct reginfo -{ - u16 reg; - u8 val; -}; - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); - -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -/* init 800*600 SVGA */ -static struct reginfo sensor_init_data[] = -{ - //Jacky_M - {0x3008,0x82}, - {0x3103,0x13}, - {0x3008,0x42}, - {0x3017,0xff}, - {0x3018,0xff}, - //{0x302c,0x43}, - {0x3032,0x00}, - {0x3901,0x13}, - {0x3704,0x80}, - {0x3717,0x00}, - {0x371b,0x60}, - {0x370b,0x10}, - {0x3624,0x03}, - {0x3622,0x80}, - {0x3614,0x80}, - {0x3630,0x52}, - {0x3632,0x07}, - {0x3633,0xd2}, - {0x3619,0x75}, - {0x371c,0x00}, - {0x370b,0x12}, - {0x3704,0x80}, - {0x3600,0x08}, - {0x3620,0x43}, - {0x3702,0x20}, - {0x3739,0x48}, - {0x3730,0x20}, - {0x370c,0x0c}, - {0x3a18,0x00}, - {0x3a19,0xf8}, - {0x3000,0x10}, - {0x3004,0xef}, - {0x6700,0x05}, - {0x6701,0x19}, - {0x6702,0xfd}, - {0x6703,0xd1}, - {0x6704,0xff}, - {0x6705,0xff}, - {0x3002,0x1c}, - {0x3006,0xc3}, - {0x3800,0x00}, - {0x3801,0x00}, - {0x3802,0x00}, - {0x3803,0x00}, - {0x3804,0x08}, - {0x3805,0x1f}, - {0x3806,0x06}, - {0x3807,0x07}, - {0x3808,0x04}, - {0x3809,0x00}, - {0x380a,0x03}, - {0x380b,0x00}, - {0x380c,0x08}, - {0x380d,0xfc}, - {0x380e,0x03}, - {0x380f,0x14}, - {0x3810,0x00}, - {0x3811,0x08}, - {0x3812,0x00}, - {0x3813,0x02}, - {0x3814,0x31}, - {0x3815,0x31}, - {0x3820,0x01}, - {0x3821,0x01}, - {0x3824,0x01}, - {0x3826,0x23}, - {0x3a02,0x30}, - {0x3a03,0xc0}, - {0x3a08,0x00}, - {0x3a09,0xec}, - {0x3a0a,0x00}, - {0x3a0b,0xc5}, - {0x3a0d,0x04}, - {0x3a0e,0x03}, - {0x3a14,0x30}, - {0x3a15,0x72}, - {0x3618,0x00}, - {0x3623,0x00}, - {0x3708,0x64}, - {0x3709,0x52}, - {0x4300,0x30},//0x32},//0x31},//0x30}, - {0x440e,0x09}, - {0x4514,0xaa}, - {0x4520,0x0b}, - {0x460b,0x37}, - {0x460c,0x20}, - {0x4713,0x02}, - {0x471c,0xd0}, - {0x5086,0x00}, - {0x5000,0x07}, - {0x5001,0x03}, - {0x5002,0x00}, - {0x501f,0x00}, - {0x3008,0x02}, - {0x302c,0x43}, - {0x3a00,0x38}, - {0x303c,0x12}, //0x15//jack change to 0x15 - {0x440e,0x08}, - - {0x5180,0xff}, - {0x5181,0xf2}, - {0x5182,0x0 }, - {0x5183,0x14}, - {0x5184,0x25}, - {0x5185,0x24}, - {0x5186,0x9 }, - {0x5187,0x9 }, - {0x5188,0x9 }, - {0x5189,0x75}, - {0x518a,0x54}, - {0x518b,0xe0}, - {0x518c,0xb2}, - {0x518d,0x42}, - {0x518e,0x3d}, - {0x518f,0x56}, - {0x5190,0x46}, - {0x5191,0xf8}, - {0x5192,0x4 }, - {0x5193,0x70}, - {0x5194,0xf0}, - {0x5195,0xf0}, - {0x5196,0x3 }, - {0x5197,0x1 }, - {0x5198,0x4 }, - {0x5199,0x12}, - {0x519a,0x4 }, - {0x519b,0x0 }, - {0x519c,0x6 }, - {0x519d,0x82}, - {0x519e,0x38}, - {0x5381,0x1c}, - {0x5382,0x5a}, - {0x5383,0x6 }, - {0x5384,0xa }, - {0x5385,0x7e}, - {0x5386,0x88}, - {0x5387,0x7c}, - {0x5388,0x6c}, - {0x5389,0x10}, - {0x538a,0x1 }, - {0x538b,0x98}, - {0x5000,0x27}, - {0x5481,0x8 }, - {0x5482,0x14}, - {0x5483,0x28}, - {0x5484,0x51}, - {0x5485,0x65}, - {0x5486,0x71}, - {0x5487,0x7d}, - {0x5488,0x87}, - {0x5489,0x91}, - {0x548a,0x9a}, - {0x548b,0xaa}, - {0x548c,0xb8}, - {0x548d,0xcd}, - {0x548e,0xdd}, - {0x548f,0xea}, - {0x5490,0x1d}, - {0x3821,0x06}, - {0x4514,0xbb}, - {0x3a0f,0x38}, - {0x3a10,0x30}, - {0x3a1b,0x38}, - {0x3a1e,0x30}, - {0x3a11,0x70}, - {0x3a1f,0x14}, - {0x3a18,0x0 }, - {0x3808,0x03}, - {0x3809,0x20}, - {0x380a,0x02}, - {0x380b,0x58}, - -// preview vga -{0x303c, 0x12}, -{0x3824, 0x02}, -{0x460c, 0x22}, -//XGA Windowing -{0x5001, 0x83}, -{0x3800, 0x00}, -{0x3801, 0x00}, -{0x3802, 0x00}, -{0x3803, 0x00}, -{0x3804, 0x08}, -{0x3805, 0x1f}, -{0x3806, 0x06}, -{0x3807, 0x09}, -{0x3808, 0x04}, -{0x3809, 0x00}, -{0x380a, 0x03}, -{0x380b, 0x00}, -{0x380c, 0x08}, -{0x380d, 0xfc}, -{0x380e, 0x03}, -{0x380f, 0x14}, -{0x3810, 0x00}, -{0x3811, 0x08}, -{0x3812, 0x00}, -{0x3813, 0x02}, -{0x3814, 0x31}, -{0x3815, 0x31}, - -{0x3708, 0x66}, -{0x3709, 0x12}, -{0x370c, 0x0c}, -{0x4520, 0x0b}, -{0x302c, 0x03}, - -//Bining mode -{0x3820, 0x01}, -{0x3821, 0x03},//0x01 -{0x4514, 0xaa}, - -//vga -{0x5001, 0xa3}, -{0x3808, 0x02}, -{0x3809, 0x80}, -{0x380a, 0x01}, -{0x380b, 0xe0}, -{0x380c, 0x08}, -{0x380d, 0xfc}, -{0x380e, 0x03}, -{0x380f, 0x14}, -{0x3810, 0x00}, -{0x3811, 0x08}, -{0x3812, 0x00}, -{0x3813, 0x02}, -{0x3814, 0x31}, -{0x3815, 0x31}, - - - {0x5001,0xa7}, - //ISP - {0x5000, 0xa7}, -{0x5001, 0x03}, -//OV3660 LENC setting -{0x5800, 0x23}, -{0x5801, 0x10}, -{0x5802, 0xe }, -{0x5803, 0xe }, -{0x5804, 0x11}, -{0x5805, 0x1e}, -{0x5806, 0xa }, -{0x5807, 0x7 }, -{0x5808, 0x5 }, -{0x5809, 0x5 }, -{0x580a, 0x7 }, -{0x580b, 0xc }, -{0x580c, 0x7 }, -{0x580d, 0x3 }, -{0x580e, 0x0 }, -{0x580f, 0x0 }, -{0x5810, 0x3 }, -{0x5811, 0x8 }, -{0x5812, 0x8 }, -{0x5813, 0x3 }, -{0x5814, 0x0 }, -{0x5815, 0x0 }, -{0x5816, 0x3 }, -{0x5817, 0x9 }, -{0x5818, 0xb }, -{0x5819, 0x7 }, -{0x581a, 0x5 }, -{0x581b, 0x5 }, -{0x581c, 0x8 }, -{0x581d, 0xc }, -{0x581e, 0x1d}, -{0x581f, 0x10}, -{0x5820, 0xf }, -{0x5821, 0xf }, -{0x5822, 0x11}, -{0x5823, 0x1e}, -{0x5824, 0x45}, -{0x5825, 0x29}, -{0x5826, 0x1b}, -{0x5827, 0x29}, -{0x5828, 0x44}, -{0x5829, 0x1b}, -{0x582a, 0x28}, -{0x582b, 0x36}, -{0x582c, 0x27}, -{0x582d, 0x1a}, -{0x582e, 0x1b}, -{0x582f, 0x33}, -{0x5830, 0x50}, -{0x5831, 0x43}, -{0x5832, 0x19}, -{0x5833, 0x1b}, -{0x5834, 0x27}, -{0x5835, 0x34}, -{0x5836, 0x37}, -{0x5837, 0x1a}, -{0x5838, 0x47}, -{0x5839, 0x19}, -{0x583a, 0xa }, -{0x583b, 0x19}, -{0x583c, 0x35}, -{0x583d, 0xce}, - - - {0x5180,0xff},// //;IQ setting example //;Sample_AWB - {0x5181,0xf2},// - {0x5182,0x0 },// - {0x5183,0x14},// - {0x5184,0x25},// - {0x5185,0x24},// - {0x5186,0x0d},// - {0x5187,0x0f},// - {0x5188,0x0f},// - {0x5189,0x75},// - {0x518a,0x54},// - {0x518b,0xe0},// - {0x518c,0xb2},// - {0x518d,0x3e},// - {0x518e,0x39},// - {0x518f,0x52},// - {0x5190,0x47},// - {0x5191,0xf8},// - {0x5192,0x4 },// - {0x5193,0x70},// - {0x5194,0xf0},// - {0x5195,0xf0},// - {0x5196,0x3 },// - {0x5197,0x1 },// - {0x5198,0x4 },// - {0x5199,0x68},// - {0x519a,0x4 },// - {0x519b,0x0 },// - {0x519c,0x07 },// - {0x519d,0xa5},// - {0x519e,0x38},// - {0x5381,0x1c},// //;Sample_CMX - {0x5382,0x5a},// - {0x5383,0x6 },// - {0x5384,0x09 },// - {0x5385,0x71},// - {0x5386,0x7a},// - {0x5387,0x70},// - {0x5388,0x61},// - {0x5389,0x0e},// - - {0x538b,0x98},// - {0x538a,0x1 },// - - {0x3a0f,0x38},// - {0x3a10,0x30},// - {0x3a1b,0x38},// - {0x3a1e,0x30},// - {0x3a11,0x70},// - {0x3a1f,0x14},// -// {0x3a18,0x0 },// -{0x5000,0xa7}, - {0x3503,0x00}, - {0x0000, 0x00} -}; - -/* 1280x720 */ -static struct reginfo sensor_720p[]= - { - - {0x3008,0x82},// - {0x3103,0x13},// - {0x3008,0x42},// - {0x3017,0xff},// - {0x3018,0xff},// - {0x302c,0x43},// - {0x3032,0x00},// - {0x3901,0x13},// - {0x3704,0x80},// - {0x3717,0x00},// - {0x371b,0x60},// - {0x370b,0x10},// - {0x3624,0x03},// - {0x3622,0x80},// - {0x3614,0x80},// - {0x3630,0x52},// - {0x3632,0x07},// - {0x3633,0xd2},// - {0x3619,0x75},// - {0x371c,0x00},// - {0x370b,0x12},// - {0x3704,0x80},// - {0x3600,0x08},// - {0x3620,0x43},// - {0x3702,0x20},// - {0x3739,0x48},// - {0x3730,0x20},// - {0x370c,0x0c},// - {0x3a18,0x00},// - {0x3a19,0xf8},// - {0x3000,0x10},// - {0x3004,0xef},// - {0x6700,0x05},// - {0x6701,0x19},// - {0x6702,0xfd},// - {0x6703,0xd1},// - {0x6704,0xff},// - {0x6705,0xff},// - {0x3002,0x1c},// - {0x3006,0xc3},// - {0x3800,0x01},// - {0x3801,0x80},// - {0x3802,0x01},// - {0x3803,0x98},// - {0x3804,0x06},// - {0x3805,0x9f},// - {0x3806,0x04},// - {0x3807,0x73},// - {0x3808,0x05},// - {0x3809,0x00},// - {0x380a,0x02},// - {0x380b,0xd0},// - {0x380c,0x08},// - {0x380d,0xfc},// - {0x380e,0x02},// - {0x380f,0xec},// - {0x3810,0x00},// - {0x3811,0x10},// - {0x3812,0x00},// - {0x3813,0x06},// - {0x3814,0x11},// - {0x3815,0x11},// - {0x3820,0x40},// - {0x3821,0x00},// - {0x3824,0x01},// - {0x3826,0x23},// - {0x3a02,0x30},// - {0x3a03,0xc0},// - {0x3a08,0x00},// - {0x3a09,0xe0},// - {0x3a0a,0x00},// - {0x3a0b,0xbb},// - {0x3a0d,0x04},// - {0x3a0e,0x03},// - {0x3a14,0x30},// - {0x3a15,0x72},// - {0x3618,0x78},// - {0x3623,0x00},// - {0x3708,0x21},// - {0x3709,0x12},// - {0x4300,0x30},// - {0x440e,0x09},// - {0x4514,0x00},// - {0x4520,0xb0},// - {0x460b,0x37},// - {0x460c,0x20},// - {0x4713,0x02},// - {0x471c,0xd0},// - {0x5086,0x00},// - {0x5000,0x07},// - {0x5001,0x03},// - {0x5002,0x00},// - {0x501f,0x00},// - {0x302c,0x43},// - {0x3a00,0x38},// - {0x303c,0x14},// ;15fps - {0x440e,0x08},// ;for MBIST - {0x3821,0x06},// ;mirror on - {0x3008,0x02},// - //ISP - {0x5180,0xff},// //;IQ setting example //;Sample_AWB - {0x5181,0xf2},// - {0x5182,0x0 },// - {0x5183,0x14},// - {0x5184,0x25},// - {0x5185,0x24},// - {0x5186,0x9 },// - {0x5187,0x9 },// - {0x5188,0x9 },// - {0x5189,0x75},// - {0x518a,0x54},// - {0x518b,0xe0},// - {0x518c,0xb2},// - {0x518d,0x42},// - {0x518e,0x3d},// - {0x518f,0x56},// - {0x5190,0x46},// - {0x5191,0xf8},// - {0x5192,0x4 },// - {0x5193,0x70},// - {0x5194,0xf0},// - {0x5195,0xf0},// - {0x5196,0x3 },// - {0x5197,0x1 },// - {0x5198,0x4 },// - {0x5199,0x12},// - {0x519a,0x4 },// - {0x519b,0x0 },// - {0x519c,0x6 },// - {0x519d,0x82},// - {0x519e,0x38},// - {0x5381,0x1c},// //;Sample_CMX - {0x5382,0x5a},// - {0x5383,0x6 },// - {0x5384,0xa },// - {0x5385,0x7e},// - {0x5386,0x88},// - {0x5387,0x7c},// - {0x5388,0x6c},// - {0x5389,0x10},// - {0x538a,0x1 },// - {0x538b,0x98},// - {0x5000,0x27},// //;Sample_gamma;enable gamma - {0x5481,0x8 },// - {0x5482,0x14},// - {0x5483,0x28},// - {0x5484,0x51},// - {0x5485,0x65},// - {0x5486,0x71},// - {0x5487,0x7d},// - {0x5488,0x87},// - {0x5489,0x91},// - {0x548a,0x9a},// - {0x548b,0xaa},// - {0x548c,0xb8},// - {0x548d,0xcd},// - {0x548e,0xdd},// - {0x548f,0xea},// - {0x5490,0x1d},// - {0x3a0f,0x38},// //;Example_EV - {0x3a10,0x30},// - {0x3a1b,0x38},// - {0x3a1e,0x30},// - {0x3a11,0x70},// - {0x3a1f,0x14},// - {0x3a18,0x0 },// - - {0x0000, 0x00} -}; -/* 2048*1536 QXGA */ -static struct reginfo sensor_qxga[] = -{ - -{0x303b,0x1b}, -{0x303c,0x13},// ;13 -{0x303d,0x30}, - -{0x3108,0x16}, - -{0x3824,0x01}, -{0x460C,0x20}, - -{0x5001,0x03}, -{0x3800,0x00}, -{0x3801,0x00}, -{0x3802,0x00}, -{0x3803,0x00}, -{0x3804,0x08}, -{0x3805,0x1f}, -{0x3806,0x06}, -{0x3807,0x0b}, -{0x3808,0x08}, -{0x3809,0x00}, -{0x380a,0x06}, -{0x380b,0x00}, -{0x380c,0x08}, -{0x380d,0xfc}, -{0x380e,0x06}, -{0x380f,0x1c}, -{0x3810,0x00}, -{0x3811,0x10}, -{0x3812,0x00}, -{0x3813,0x06}, -{0x3814,0x11}, -{0x3815,0x11}, - -{0x3708,0x63}, -{0x3709,0x12}, -{0x370c,0x0c}, -{0x4520,0xb0}, -{0x302c,0x03}, - - -{0x3820,0x10},//0x40 -{0x3821,0x06},//0x00 -{0x4514,0x00}, -{0x5000,0xa7}, -{0x0000, 0x00} - -}; - -/* 1600X1200 UXGA */ -static struct reginfo sensor_uxga[] = - { - - {0x0000, 0x00} -}; - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {0x0, 0x0} -}; -/* 1024X768 SXGA */ -static struct reginfo sensor_xga[] = -{ - {0x0, 0x0} -}; -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - - {0x3008,0x82},// - {0x3103,0x13},// - {0x3008,0x42},// - {0x3017,0xff},// - {0x3018,0xff},// - {0x302c,0x43},// - {0x3032,0x00},// - {0x3901,0x13},// - {0x3704,0x80},// - {0x3717,0x00},// - {0x371b,0x60},// - {0x370b,0x10},// - {0x3624,0x03},// - {0x3622,0x80},// - {0x3614,0x80},// - {0x3630,0x52},// - {0x3632,0x07},// - {0x3633,0xd2},// - {0x3619,0x75},// - {0x371c,0x00},// - {0x370b,0x12},// - {0x3704,0x80},// - {0x3600,0x08},// - {0x3620,0x43},// - {0x3702,0x20},// - {0x3739,0x48},// - {0x3730,0x20},// - {0x370c,0x0c},// - {0x3a18,0x00},// - {0x3a19,0xf8},// - {0x3000,0x10},// - {0x3004,0xef},// - {0x6700,0x05},// - {0x6701,0x19},// - {0x6702,0xfd},// - {0x6703,0xd1},// - {0x6704,0xff},// - {0x6705,0xff},// - {0x3002,0x1c},// - {0x3006,0xc3},// - {0x3800,0x00},// - {0x3801,0x00},// - {0x3802,0x00},// - {0x3803,0x00},// - {0x3804,0x08},// - {0x3805,0x1f},// - {0x3806,0x06},// - {0x3807,0x0b},// - {0x3808,0x08},// - {0x3809,0x00},// - {0x380a,0x06},// - {0x380b,0x00},// - {0x380c,0x08},// - {0x380d,0xfc},// - {0x380e,0x06},// - {0x380f,0x1c},// - {0x3810,0x00},// - {0x3811,0x10},// - {0x3812,0x00},// - {0x3813,0x06},// - {0x3814,0x11},// - {0x3815,0x11},// - {0x3820,0x40},// - {0x3821,0x00},// - {0x3824,0x01},// - {0x3826,0x23},// - {0x3a02,0x30},// - {0x3a03,0xc0},// - {0x3a08,0x00},// - {0x3a09,0xea},// - {0x3a0a,0x00},// - {0x3a0b,0xc3},// - {0x3a0d,0x08},// - {0x3a0e,0x06},// - {0x3a14,0x30},// - {0x3a15,0x72},// - {0x3618,0x78},// - {0x3623,0x00},// - {0x3708,0x21},// - {0x3709,0x12},// - {0x4300,0x30},// - {0x440e,0x09},// - {0x4514,0x00},// - {0x4520,0xb0},// - {0x460b,0x37},// - {0x460c,0x20},// - {0x4713,0x02},// - {0x471c,0xd0},// - {0x5086,0x00},// - {0x5000,0x07},// - {0x5001,0x03},// - {0x5002,0x00},// - {0x501f,0x00},// - {0x302c,0x43},// - {0x3a00,0x38},// - {0x303c,0x14},// ;5fps - {0x440e,0x08},// ;for MBIST - {0x3821,0x06},// ;mirror on - {0x3008,0x02},// - {0x5180,0x00},// //;IQ setting example //;Sample_AWB - {0x5181,0xf2},// - {0x5182,0x0 },// - {0x5183,0x14},// - {0x5184,0x25},// - {0x5185,0x24},// - {0x5186,0x9 },// - {0x5187,0x9 },// - {0x5188,0x9 },// - {0x5189,0x75},// - {0x518a,0x54},// - {0x518b,0xe0},// - {0x518c,0xb2},// - {0x518d,0x42},// - {0x518e,0x3d},// - {0x518f,0x56},// - {0x5190,0x46},// - {0x5191,0xf8},// - {0x5192,0x4 },// - {0x5193,0x70},// - {0x5194,0xf0},// - {0x5195,0xf0},// - {0x5196,0x3 },// - {0x5197,0x1 },// - {0x5198,0x4 },// - {0x5199,0x12},// - {0x519a,0x4 },// - {0x519b,0x0 },// - {0x519c,0x6 },// - {0x519d,0x82},// - {0x519e,0x38},// - {0x5381,0x1c},// //;Sample_CMX - {0x5382,0x5a},// - {0x5383,0x6 },// - {0x5384,0xa },// - {0x5385,0x7e},// - {0x5386,0x88},// - {0x5387,0x7c},// - {0x5388,0x6c},// - {0x5389,0x10},// - {0x538a,0x1 },// - {0x538b,0x98},// - {0x5000,0x27},// //;Sample_gamma;enable gamma - {0x5481,0x8 },// - {0x5482,0x14},// - {0x5483,0x28},// - {0x5484,0x51},// - {0x5485,0x65},// - {0x5486,0x71},// - {0x5487,0x7d},// - {0x5488,0x87},// - {0x5489,0x91},// - {0x548a,0x9a},// - {0x548b,0xaa},// - {0x548c,0xb8},// - {0x548d,0xcd},// - {0x548e,0xdd},// - {0x548f,0xea},// - {0x5490,0x1d},// - {0x3a0f,0x38},// //;Example_EV - {0x3a10,0x30},// - {0x3a1b,0x38},// - {0x3a1e,0x30},// - {0x3a11,0x70},// - {0x3a1f,0x14},// - {0x3a18,0x0 },// - {0x3406, 0x00}, - {0x3400, 0x07}, - {0x3401, 0x02}, - {0x3402, 0x04}, - {0x3403, 0x00}, - {0x3404, 0x05}, - {0x3405, 0x15}, - //AWB -{0x5180 ,0xff}, -{0x5181 ,0xf2}, -{0x5182 ,0x0 }, -{0x5183 ,0x14}, -{0x5184 ,0x25}, -{0x5185 ,0x24}, -{0x5186 ,0xd }, -{0x5187 ,0xf }, -{0x5188 ,0xf }, -{0x5189 ,0x75}, -{0x518a ,0x54}, -{0x518b ,0xe0}, -{0x518c ,0xb2}, -{0x518d ,0x3e}, -{0x518e ,0x39}, -{0x518f ,0x52}, - - -{0x5190 ,0x47}, -{0x5191 ,0xf8}, -{0x5192 ,0x4 }, -{0x5193 ,0x70}, -{0x5194 ,0xf0}, -{0x5195 ,0xf0}, -{0x5196 ,0x3 }, -{0x5197 ,0x1 }, -{0x5198 ,0x4 }, -{0x5199 ,0x68}, -{0x519a ,0x4 }, -{0x519b ,0x0 }, -{0x519c ,0x7 }, -{0x519d ,0xa5}, -{0x519e ,0x38}, - - {0x0000, 0x00} -}; - -/* 640X480 VGA *///preview -static struct reginfo sensor_vga[] = -{ -// preview vga -{0x303c, 0x12}, -{0x3824, 0x02}, -{0x460c, 0x22}, -//XGA Windowing -{0x5001, 0x83}, -{0x3800, 0x00}, -{0x3801, 0x00}, -{0x3802, 0x00}, -{0x3803, 0x00}, -{0x3804, 0x08}, -{0x3805, 0x1f}, -{0x3806, 0x06}, -{0x3807, 0x09}, -{0x3808, 0x04}, -{0x3809, 0x00}, -{0x380a, 0x03}, -{0x380b, 0x00}, -{0x380c, 0x08}, -{0x380d, 0xfc}, -{0x380e, 0x03}, -{0x380f, 0x14}, -{0x3810, 0x00}, -{0x3811, 0x08}, -{0x3812, 0x00}, -{0x3813, 0x02}, -{0x3814, 0x31}, -{0x3815, 0x31}, - -{0x3708, 0x66}, -{0x3709, 0x12}, -{0x370c, 0x0c}, -{0x4520, 0x0b}, -{0x302c, 0x03}, - -//Bining mode -{0x3820, 0x01}, -{0x3821, 0x03},//0x01 -{0x4514, 0xaa}, - -//vga -{0x5000, 0xa7}, -{0x5001, 0xa3}, -{0x3808, 0x02}, -{0x3809, 0x80}, -{0x380a, 0x01}, -{0x380b, 0xe0}, -{0x380c, 0x08}, -{0x380d, 0xfc}, -{0x380e, 0x03}, -{0x380f, 0x14}, -{0x3810, 0x00}, -{0x3811, 0x08}, -{0x3812, 0x00}, -{0x3813, 0x02}, -{0x3814, 0x31}, -{0x3815, 0x31}, - {0x3503,0x00}, - {0x0000, 0x00} -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {0x0, 0x0} -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - - - {0x0000, 0x00} -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {0x0, 0x0} -}; - -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {0x4300, 0x30}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {0x4300, 0x32}, - {0x0000, 0x00} -}; - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - -{0x3406, 0x00}, - {0x5180,0xff},// //;IQ setting example //;Sample_AWB - {0x5181,0xf2},// - {0x5182,0x0 },// - {0x5183,0x14},// - {0x5184,0x25},// - {0x5185,0x24},// - {0x5186,0x0d},// - {0x5187,0x0f},// - {0x5188,0x0f},// - {0x5189,0x75},// - {0x518a,0x54},// - {0x518b,0xe0},// - {0x518c,0xb2},// - {0x518d,0x3e},// - {0x518e,0x39},// - {0x518f,0x52},// - {0x5190,0x47},// - {0x5191,0xf8},// - {0x5192,0x4 },// - {0x5193,0x70},// - {0x5194,0xf0},// - {0x5195,0xf0},// - {0x5196,0x3 },// - {0x5197,0x1 },// - {0x5198,0x4 },// - {0x5199,0x68},// - {0x519a,0x4 },// - {0x519b,0x0 },// - {0x519c,0x07 },// - {0x519d,0xa5},// - {0x519e,0x38},// -{0x0000, 0x00} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - - {0x3406, 0x01}, - {0x3400, 0x07}, - {0x3401, 0x02}, - {0x3402, 0x04}, - {0x3403, 0x00}, - {0x3404, 0x05}, - {0x3405, 0x15}, - {0x0000, 0x00} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x3406, 0x01}, - {0x3400, 0x07}, - {0x3401, 0x02}, - {0x3402, 0x04}, - {0x3403, 0x00}, - {0x3404, 0x05}, - {0x3405, 0x15}, - {0x0000, 0x00} -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0x3406, 0x01}, - {0x3400, 0x06}, - {0x3401, 0x2a}, - {0x3402, 0x04}, - {0x3403, 0x00}, - {0x3404, 0x07}, - {0x3405, 0x24}, - {0x0000, 0x00} - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x3406, 0x01}, - {0x3400, 0x04}, - {0x3401, 0x58}, - {0x3402, 0x04}, - {0x3403, 0x00}, - {0x3404, 0x07}, - {0x3405, 0x24}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - // Brightness -2 - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness1[]= -{ - // Brightness -1 - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - // Brightness 0 - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - // Brightness +1 - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - // Brightness +2 - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - // Brightness +3 - - {0x0000, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x507b, 0x00}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {0x507b, 0x20}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x507b, 0x18}, - {0x507e, 0x40}, - {0x507f, 0xa0}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - //Negative - {0x507b, 0x40}, //bit[6] negative - {0x0000, 0x00} -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - // Bluish - {0x507b, 0x18}, - {0x507e, 0xa0}, - {0x507f, 0x40}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish - {0x507b, 0x18}, - {0x507e, 0x60}, - {0x507f, 0x60}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure1[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {0x0000, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast2[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - {0x0000, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - {0x0000, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {0x0000, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {0x0000, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ - //Jacky_M - {0x3a00, 0x78}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_SceneNight[] = -{ - {0x3003, 0x80}, - {0x3004, 0x20}, - {0x3005, 0x18}, - {0x3006, 0x0d}, - {0x3a00, 0x7c}, - {0x3a02 ,0x07}, - {0x3a03 ,0x38}, - {0x3a14 ,0x07}, - {0x3a15 ,0x38}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom1[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom2[] = -{ - {0x0, 0x0}, -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {0x0, 0x0}, -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif - -#if 0 -static struct reginfo sensor_ISO100[] = -{ - - {0x0, 0x0}, -}; - -static struct reginfo sensor_ISO200[] = -{ - - {0x0, 0x0}, -}; - -static struct reginfo sensor_ISO400[] = -{ - - {0x0, 0x0}, -}; - - -static struct reginfo sensor_ISO800[] = -{ - - {0x0, 0x0}, -}; -static struct reginfo *sensor_ISOSeqe[] = {sensor_ISO100, sensor_ISO200, sensor_ISO400, sensor_ISO800, NULL,}; -#endif - -static struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - - - - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG} -}; - - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - unsigned int winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int funmodule_state; -} sensor_info_priv_t; - -struct SENSOR -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - - -static struct SENSOR* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct SENSOR, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct SENSOR *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, u16 reg, u8 val) -{ - int err,cnt; - u8 buf[3]; - struct i2c_msg msg[1]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - buf[2] = val; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u16 reg, u8 *val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[2]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - - while (regarray[i].reg != 0) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - i++; - } - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != 0) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 1) { - mdelay(50); - } - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct SENSOR *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on) { - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_power_end: - return ret; -} - -static enum hrtimer_restart flash_off_func(struct hrtimer *timer) -{ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - - return 0; -} - -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct SENSOR *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; -unsigned char value; -int ret=0,pid = 0; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - printk("jack+sensor_init begin\n"); - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - - - if (ret != 0) - { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - mdelay(5); //delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x300a, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value << 8); - - ret = sensor_read(client, 0x300b, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - //icd->user_width = SENSOR_INIT_WIDTH; - //icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.winseqe_cur_addr = (int)SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - flash_off_timer.icd = icd; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - flash_off_timer.icd = icd; - #endif - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} - -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - u8 reg_val; - struct SENSOR *sensor = to_sensor(client); - - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - if (sensor->info_priv.funmodule_state & SENSOR_INIT_IS_OK) { - sensor_task_lock(client, 1); - sensor_read(client,0x3017,®_val); - sensor_write(client, 0x3017, reg_val&0x80); - sensor_read(client,0x3018,®_val); - sensor_write(client, 0x3018, reg_val&0x03); - sensor_task_lock(client, 0); - } - sensor_ioctrl(icd, Sensor_PowerDown, 1); - - msleep(100); - - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - - return 0; -} - -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - - return 0; - -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct SENSOR *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} - -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -void button5_Click(struct i2c_client *client,struct reginfo *winseqe_set_addr) -{ - int extra_lines, Preview_Gain, preview_dummy_pixels, Capture_Exposure; - char temp_reg1, temp_reg2, temp_reg3; - int Capture_Line_Width,Capture_Banding_Filter,Capture_Gain, shutter, Gain_Exposure; - //int PV_EXPOSURE_LIMITATION = 782; - //int FULL_EXPOSURE_LIMITATION = 1640; - int Capture_Maximum_Shutter = 1564; - int Default_Reg0x380c = 8; - int Default_Reg0x380d = 252; - int Capture_PCLK_Frequency = 54 ; - int Capture_Dummy_Pixels =0 ; - int Capture_Max_Gain = 256 ; - int extra_exposure_lines =0 ; - int ret = 0; - - sensor_read(client, 0x3500, &temp_reg1); - sensor_read(client, 0x3501, &temp_reg2); - sensor_read(client, 0x3502, &temp_reg3); - - shutter = (temp_reg1 << 16) | (temp_reg2 << 8) | (temp_reg3); - shutter = shutter / 16; - - sensor_read(client, 0x350d, &temp_reg1); - sensor_read(client, 0x350c, &temp_reg2); - extra_lines = (temp_reg1) | (temp_reg2 << 8); - - sensor_read(client, 0x350b, &temp_reg1); - sensor_read(client, 0x350a, &temp_reg2); - Preview_Gain = (temp_reg2 << 8) | (temp_reg1); - - sensor_read(client, 0x380d, &temp_reg1); - sensor_read(client, 0x380c, &temp_reg2); - - preview_dummy_pixels = (((temp_reg1-Default_Reg0x380c) & 0xf0) << 8 ) + temp_reg2-Default_Reg0x380d ; - - //sensor_write(client, 0x3503, 0x00); - sensor_write(client, 0x3503, 0x03); - - Capture_Line_Width = 2376 + Capture_Dummy_Pixels; - - //Capture_Exposure = (shutter + extra_lines)/2; - Capture_Exposure = (shutter + extra_lines)*36/27/2; - Capture_Banding_Filter = Capture_PCLK_Frequency * 1000000 / 100 / (2 * Capture_Line_Width); //114 - if(Preview_Gain < 16) - { - Preview_Gain = 16 ; - } - Gain_Exposure = Preview_Gain * Capture_Exposure; - - if (Gain_Exposure < Capture_Banding_Filter * 16 ) //114 - { - Capture_Exposure = Gain_Exposure / 16; - - if(0 == Capture_Exposure) - { - Capture_Exposure = 1; - } - - Capture_Gain = (Gain_Exposure*2 / Capture_Exposure + 1 ) / 2; - } else { - if (Gain_Exposure > Capture_Maximum_Shutter * 16 ) //1564*16 - { - Capture_Exposure = Capture_Maximum_Shutter; - Capture_Gain = (Gain_Exposure*2 /Capture_Maximum_Shutter + 1)/2; - - if (Capture_Gain > Capture_Max_Gain) //512 - { - Capture_Exposure = Gain_Exposure/Capture_Max_Gain/16 + Gain_Exposure/10/Capture_Max_Gain/16; - if(0 == Capture_Exposure) - { - Capture_Exposure = 1; - } - - Capture_Exposure = Capture_Exposure/ Capture_Banding_Filter; - Capture_Exposure = Capture_Exposure * Capture_Banding_Filter; - Capture_Gain = (Gain_Exposure *2 / Capture_Exposure + 1) /2; - } - } else { - Capture_Exposure = Gain_Exposure /16/ Capture_Banding_Filter; - Capture_Exposure = Capture_Exposure * Capture_Banding_Filter; - if(0 == Capture_Exposure) - { - Capture_Exposure = 1; - } - Capture_Gain = (Gain_Exposure *2 / Capture_Exposure +1)/2; - } - - shutter = Capture_Exposure; - } - - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - } - - - if(shutter <= 1640) - { - extra_exposure_lines = 0; - } else { - extra_exposure_lines = shutter - 1640; - } - - if (shutter > 1640) - { - shutter = 1640; - } - - shutter = shutter * 16; - - if(Capture_Gain >= 128) - sensor_write(client, 0x5000,0x07); - - sensor_write(client, 0x350d, (extra_exposure_lines & 0xFF)); - sensor_write(client, 0x350c, ((extra_exposure_lines & 0xFF00) >> 8)); - - sensor_write(client, 0x3502, (shutter & 0xFF)); - sensor_write(client, 0x3501, ((shutter & 0xFF00) >> 8)); - sensor_write(client, 0x3500, ((shutter & 0xFF0000) >> 16)); - - sensor_write(client, 0x350b, (Capture_Gain & 0xFF)); - sensor_write(client, 0x350a, (( Capture_Gain & 0xFF00) >> 8)); -} - -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct SENSOR *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - int ret=0, set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - winseqe_set_addr = sensor_svga; - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 720)) && sensor_720p[0].reg) - { - winseqe_set_addr = sensor_720p; - set_w = 1280; - set_h = 720; - } - else if (((set_w <= 1024) && (set_h <= 768)) && sensor_xga[0].reg) - { - winseqe_set_addr = sensor_xga; - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - winseqe_set_addr = sensor_sxga; - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && sensor_uxga[0].reg) - { - winseqe_set_addr = sensor_uxga; - set_w = 1600; - set_h = 1200; - } - else if (((set_w <= 2048) && (set_h <= 1536)) && sensor_qxga[0].reg) - { - winseqe_set_addr = sensor_qxga; - set_w = 2048; - set_h = 1536; - } - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) { - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - } else { /* ddl@rock-chips.com : Video */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - } - #endif - if (sensor_fmt_capturechk(sd,mf) != true) - { - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - } - - sensor->info_priv.winseqe_cur_addr = (int)winseqe_set_addr; - - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - - button5_Click(client,winseqe_set_addr); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - if (sensor->info_priv.whiteBalance != 0) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - sensor->info_priv.snap2preview = true; - } else if (sensor_fmt_videochk(sd,mf) == true) { /* ddl@rock-chips.com : Video */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - sensor->info_priv.video2preview = true; - } else if ((sensor->info_priv.snap2preview == true) || (sensor->info_priv.video2preview == true)) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - msleep(200); - sensor->info_priv.video2preview = false; - sensor->info_priv.snap2preview = false; - } - else - {msleep(200);} - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; - -sensor_s_fmt_end: - return ret; -} - - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct SENSOR *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 720)) && sensor_720p[0].reg) - { - set_w = 1280; - set_h = 720; - } - else if (((set_w <= 1024) && (set_h <= 768)) && sensor_xga[0].reg) - { - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && sensor_uxga[0].reg) - { - set_w = 1600; - set_h = 1200; - } - else if (((set_w <= 2048) && (set_h <= 1536)) && sensor_qxga[0].reg) - { - set_w = 2048; - set_h = 1536; - } - else - { - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - mf->width = set_w; - mf->height = set_h; - mf->colorspace = fmt->colorspace; - - return ret; -} - - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV2655 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct SENSOR *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value > 0) && ((digitalzoom_cur + *value) > digitalzoom_total)) - { - value = digitalzoom_total - digitalzoom_cur; - } - - if ((value < 0) && ((digitalzoom_cur + *value) < 0)) - { - value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct SENSOR *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); -//jack+ -printk("jack+sensor_g_control\n"); -//jack- - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct SENSOR *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct SENSOR *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct SENSOR *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ -unsigned char value; -int ret,pid = 0; - struct SENSOR *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - - /* soft reset */ - mdelay(5); //delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x300a, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid |= (value << 8); - - ret = sensor_read(client, 0x300b, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - //icd->formats = sensor_colour_formats; - //icd->num_formats = ARRAY_SIZE(sensor_colour_formats); - - return 0; - -sensor_video_probe_err: - - return ret; -} - -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct SENSOR *sensor = to_sensor(client); - int ret = 0; - #if CONFIG_SENSOR_Flash - int i; -#endif - printk("jack+sensor_ioctl\n"); //jack++ - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - if (sensor->sensor_io_request->gpio_res[0].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[0].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[0]; - } else if (sensor->sensor_io_request->gpio_res[1].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[1].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[1]; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - // memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} - -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} - -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, -}; - - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct SENSOR *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct SENSOR), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - sensor->info_priv.fmt = sensor_colour_fmts[0]; - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - - #if CONFIG_SENSOR_Flash - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - flash_off_timer.timer.function = flash_off_func; - #endif - - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct SENSOR *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - - - diff --git a/drivers/media/video/ov5640.c b/drivers/media/video/ov5640.c deleted file mode 100644 index 9a176bfb4198..000000000000 --- a/drivers/media/video/ov5640.c +++ /dev/null @@ -1,1538 +0,0 @@ -/* - * drivers/media/video/ov5640.c - * - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "generic_sensor.h" - -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.1.1: -* add sensor_focus_af_const_pause_usr_cb; -*v0.1.3: -* config sensor io H-Z in sensor_deactive_cb; -*/ -static int version = KERNEL_VERSION(0,1,3); -module_param(version, int, S_IRUGO); - - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_OV5640 -#define SENSOR_V4L2_IDENT V4L2_IDENT_OV5640 -#define SENSOR_ID 0x5640 -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_PCLK_SAMPLE_RISING|V4L2_MBUS_HSYNC_ACTIVE_HIGH| V4L2_MBUS_VSYNC_ACTIVE_LOW|\ - V4L2_MBUS_DATA_ACTIVE_HIGH |SOCAM_MCLK_24MHZ) -#define SENSOR_PREVIEW_W 800 -#define SENSOR_PREVIEW_H 600 -#define SENSOR_PREVIEW_FPS 15000 // 15fps -#define SENSOR_FULLRES_L_FPS 7500 // 7.5fps -#define SENSOR_FULLRES_H_FPS 7500 // 7.5fps -#define SENSOR_720P_FPS 30000 -#define SENSOR_1080P_FPS 15000 - -#define SENSOR_REGISTER_LEN 2 // sensor register address bytes -#define SENSOR_VALUE_LEN 1 // sensor register value bytes - -static unsigned int SensorConfiguration = (CFG_WhiteBalance|CFG_Effect - |CFG_Scene|CFG_Focus - |CFG_FocusZone); - -static unsigned int SensorChipID[] = {SENSOR_ID}; -/* Sensor Driver Configuration End */ - - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a,b) CONS4(SensorReg,SENSOR_REGISTER_LEN,Val,SENSOR_VALUE_LEN)(a,b) -#define sensor_write(client,reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_read(client,reg,v) CONS4(sensor_read_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_write_array generic_sensor_write_array - -#if 1//CONFIG_SENSOR_Focus -#include "ov5640_af_firmware.c" -/* ov5640 VCM Command and Status Registers */ -#define CONFIG_SENSOR_FocusCenterInCapture 0 -#define CMD_MAIN_Reg 0x3022 -//#define CMD_TAG_Reg 0x3023 -#define CMD_ACK_Reg 0x3023 -#define CMD_PARA0_Reg 0x3024 -#define CMD_PARA1_Reg 0x3025 -#define CMD_PARA2_Reg 0x3026 -#define CMD_PARA3_Reg 0x3027 -#define CMD_PARA4_Reg 0x3028 - -//#define STA_ZONE_Reg 0x3026 -#define STA_FOCUS_Reg 0x3029 - -/* ov5640 VCM Command */ - -#define ConstFocus_Cmd 0x04 -#define StepMode_Cmd 0x05 -#define PauseFocus_Cmd 0x06 -#define ReturnIdle_Cmd 0x08 -#define SetZone_Cmd 0x10 -#define UpdateZone_Cmd 0x12 -#define SetMotor_Cmd 0x20 -#define SingleFocus_Cmd 0x03 -#define GetFocusResult_Cmd 0x07 -#define ReleaseFocus_Cmd 0x08 -#define ZoneRelaunch_Cmd 0x12 -#define DefaultZoneConfig_Cmd 0x80 -#define TouchZoneConfig_Cmd 0x81 -#define CustomZoneConfig_Cmd 0x8f - - -/* ov5640 Focus State */ -//#define S_FIRWRE 0xFF /*Firmware is downloaded and not run*/ -#define S_STARTUP 0x7e /*Firmware is initializing*/ -#define S_ERROR 0x7f -#define S_IDLE 0x70 /*Idle state, focus is released; lens is located at the furthest position.*/ -#define S_FOCUSING 0x00 /*Auto Focus is running.*/ -#define S_FOCUSED 0x10 /*Auto Focus is completed.*/ - -#define S_CAPTURE 0x12 -#define S_STEP 0x20 - -/* ov5640 Zone State */ -#define Zone_Is_Focused(a, zone_val) (zone_val&(1<<(a-3))) -#define Zone_Get_ID(zone_val) (zone_val&0x03) - -#define Zone_CenterMode 0x01 -#define Zone_5xMode 0x02 -#define Zone_5PlusMode 0x03 -#define Zone_4fMode 0x04 - -#define ZoneSel_Auto 0x0b -#define ZoneSel_SemiAuto 0x0c -#define ZoneSel_Manual 0x0d -#define ZoneSel_Rotate 0x0e - -/* ov5640 Step Focus Commands */ -#define StepFocus_Near_Tag 0x01 -#define StepFocus_Far_Tag 0x02 -#define StepFocus_Furthest_Tag 0x03 -#define StepFocus_Nearest_Tag 0x04 -#define StepFocus_Spec_Tag 0x10 -#endif - -struct sensor_parameter -{ - unsigned int PreviewDummyPixels; - unsigned int CaptureDummyPixels; - unsigned int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - unsigned short int preview_maxlines; - - unsigned short int PreviewPclk; - unsigned short int CapturePclk; - char awb[6]; -}; - -struct specific_sensor{ - struct generic_sensor common_sensor; - //define user data below - struct sensor_parameter parameter; - -}; - -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ - -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_init_data[] ={ - {0x3103, 0x11}, - {0x3008, 0x82}, - SensorWaitMs(5), - {0x3008, 0x42}, - {0x3103, 0x03}, - {0x3017, 0xff}, - {0x3018, 0xff}, - {0x3034, 0x1a}, - {0x3035, 0x21}, - {0x3036, 0x46}, - {0x3037, 0x12}, - {0x3108, 0x01}, - {0x3630, 0x36}, - {0x3631, 0x0e}, - {0x3632, 0xe2}, - {0x3633, 0x12}, - {0x3621, 0xe0}, - {0x3704, 0xa0}, - {0x3703, 0x5a}, - {0x3715, 0x78}, - {0x3717, 0x01}, - {0x370b, 0x60}, - {0x3705, 0x1a}, - {0x3905, 0x02}, - {0x3906, 0x10}, - {0x3901, 0x0a}, - {0x3731, 0x12}, - {0x3600, 0x08}, - {0x3601, 0x33}, - {0x302d, 0x60}, - {0x3620, 0x52}, - {0x371b, 0x20}, - {0x471c, 0x50}, - {0x3a13, 0x43}, - {0x3a18, 0x00}, - {0x3a19, 0xf8}, - {0x3635, 0x13}, - {0x3636, 0x03}, - {0x3634, 0x40}, - {0x3622, 0x01}, - {0x3c01, 0x34}, - {0x3c04, 0x28}, - {0x3c05, 0x98}, - {0x3c06, 0x00}, - {0x3c07, 0x08}, - {0x3c08, 0x00}, - {0x3c09, 0x1c}, - {0x3c0a, 0x9c}, - {0x3c0b, 0x40}, - {0x3820, 0x41}, - {0x3821, 0x07}, - {0x3814, 0x31}, - {0x3815, 0x31}, - {0x3800, 0x00}, - {0x3801, 0x00}, - {0x3802, 0x00}, - {0x3803, 0x04}, - {0x3804, 0x0a}, - {0x3805, 0x3f}, - {0x3806, 0x07}, - {0x3807, 0x9b}, - {0x3808, 0x03}, - {0x3809, 0x20}, - {0x380a, 0x02}, - {0x380b, 0x58}, - {0x380c, 0x07}, - {0x380d, 0x68}, - {0x380e, 0x03}, - {0x380f, 0xd8}, - {0x3810, 0x00}, - {0x3811, 0x10}, - {0x3812, 0x00}, - {0x3813, 0x06}, - {0x3618, 0x00}, - {0x3612, 0x29}, - {0x3708, 0x64}, - {0x3709, 0x52}, - {0x370c, 0x03}, - {0x3a02, 0x03}, - {0x3a03, 0xd8}, - {0x3a08, 0x01}, - {0x3a09, 0x27}, - {0x3a0a, 0x00}, - {0x3a0b, 0xf6}, - {0x3a0e, 0x03}, - {0x3a0d, 0x04}, - {0x3a14, 0x03}, - {0x3a15, 0xd8}, - {0x4001, 0x02}, - {0x4004, 0x02}, - {0x3000, 0x00}, - {0x3002, 0x1c}, - {0x3004, 0xff}, - {0x3006, 0xc3}, - {0x300e, 0x58}, - {0x302e, 0x00}, - {0x4740, 0x20}, - {0x4300, 0x32},//uyvy:0x32,yuyv:0x30 - {0x501f, 0x00}, - {0x4713, 0x03}, - {0x4407, 0x04}, - {0x440e, 0x00}, - {0x460b, 0x35}, - {0x460c, 0x20}, - {0x4837, 0x22}, - {0x3824, 0x02}, - {0x5000, 0xa7}, - {0x5001, 0xa3}, - {0x5180, 0xff}, - {0x5181, 0xf2}, - {0x5182, 0x00}, - {0x5183, 0x14}, - {0x5184, 0x25}, - {0x5185, 0x24}, - {0x5186, 0x09}, - {0x5187, 0x09}, - {0x5188, 0x09}, - {0x5189, 0x75}, - {0x518a, 0x54}, - {0x518b, 0xe0}, - {0x518c, 0xb2}, - {0x518d, 0x42}, - {0x518e, 0x3d}, - {0x518f, 0x56}, - {0x5190, 0x46}, - {0x5191, 0xf8}, - {0x5192, 0x04}, - {0x5193, 0x70}, - {0x5194, 0xf0}, - {0x5195, 0xf0}, - {0x5196, 0x03}, - {0x5197, 0x01}, - {0x5198, 0x04}, - {0x5199, 0x12}, - {0x519a, 0x04}, - {0x519b, 0x00}, - {0x519c, 0x06}, - {0x519d, 0x82}, - {0x519e, 0x38}, - {0x5381, 0x1e}, - {0x5382, 0x5b}, - {0x5383, 0x08}, - {0x5384, 0x0a}, - {0x5385, 0x7e}, - {0x5386, 0x88}, - {0x5387, 0x7c}, - {0x5388, 0x6c}, - {0x5389, 0x10}, - {0x538a, 0x01}, - {0x538b, 0x98}, - {0x5300, 0x08}, - {0x5301, 0x30}, - {0x5302, 0x10}, - {0x5303, 0x00}, - {0x5304, 0x08}, - {0x5305, 0x30}, - {0x5306, 0x08}, - {0x5307, 0x16}, - {0x5309, 0x08}, - {0x530a, 0x30}, - {0x530b, 0x04}, - {0x530c, 0x06}, - {0x5480, 0x01}, - {0x5481, 0x08}, - {0x5482, 0x14}, - {0x5483, 0x28}, - {0x5484, 0x51}, - {0x5485, 0x65}, - {0x5486, 0x71}, - {0x5487, 0x7d}, - {0x5488, 0x87}, - {0x5489, 0x91}, - {0x548a, 0x9a}, - {0x548b, 0xaa}, - {0x548c, 0xb8}, - {0x548d, 0xcd}, - {0x548e, 0xdd}, - {0x548f, 0xea}, - {0x5490, 0x1d}, - {0x5580, 0x02}, - {0x5583, 0x40}, - {0x5584, 0x10}, - {0x5589, 0x10}, - {0x558a, 0x00}, - {0x558b, 0xf8}, - {0x5800, 0x23}, - {0x5801, 0x14}, - {0x5802, 0x0f}, - {0x5803, 0x0f}, - {0x5804, 0x12}, - {0x5805, 0x26}, - {0x5806, 0x0c}, - {0x5807, 0x08}, - {0x5808, 0x05}, - {0x5809, 0x05}, - {0x580a, 0x08}, - {0x580b, 0x0d}, - {0x580c, 0x08}, - {0x580d, 0x03}, - {0x580e, 0x00}, - {0x580f, 0x00}, - {0x5810, 0x03}, - {0x5811, 0x09}, - {0x5812, 0x07}, - {0x5813, 0x03}, - {0x5814, 0x00}, - {0x5815, 0x01}, - {0x5816, 0x03}, - {0x5817, 0x08}, - {0x5818, 0x0d}, - {0x5819, 0x08}, - {0x581a, 0x05}, - {0x581b, 0x06}, - {0x581c, 0x08}, - {0x581d, 0x0e}, - {0x581e, 0x29}, - {0x581f, 0x17}, - {0x5820, 0x11}, - {0x5821, 0x11}, - {0x5822, 0x15}, - {0x5823, 0x28}, - {0x5824, 0x46}, - {0x5825, 0x26}, - {0x5826, 0x08}, - {0x5827, 0x26}, - {0x5828, 0x64}, - {0x5829, 0x26}, - {0x582a, 0x24}, - {0x582b, 0x22}, - {0x582c, 0x24}, - {0x582d, 0x24}, - {0x582e, 0x06}, - {0x582f, 0x22}, - {0x5830, 0x40}, - {0x5831, 0x42}, - {0x5832, 0x24}, - {0x5833, 0x26}, - {0x5834, 0x24}, - {0x5835, 0x22}, - {0x5836, 0x22}, - {0x5837, 0x26}, - {0x5838, 0x44}, - {0x5839, 0x24}, - {0x583a, 0x26}, - {0x583b, 0x28}, - {0x583c, 0x42}, - {0x583d, 0xce}, - {0x5025, 0x00}, - {0x3a0f, 0x30}, - {0x3a10, 0x28}, - {0x3a1b, 0x30}, - {0x3a1e, 0x26}, - {0x3a11, 0x60}, - {0x3a1f, 0x14}, - {0x3008, 0x02}, - {0x302c, 0xc2}, - SensorWaitUs(1000), - SensorEnd -}; -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={ - - {0x3820, 0x40}, - {0x3821, 0x06}, - {0x3814, 0x11}, - {0x3815, 0x11}, - {0x3803, 0x00}, - {0x3807, 0x9f}, - {0x3808, 0x0a}, - {0x3809, 0x20}, - {0x380a, 0x07}, - {0x380b, 0x98}, - {0x380c, 0x0b}, - {0x380d, 0x1c}, - {0x380e, 0x07}, - {0x380f, 0xb0}, - {0x3811, 0x10}, // - {0x3813, 0x04}, - {0x3618, 0x04}, - {0x3612, 0x2b}, //4b - {0x3708, 0x64}, - {0x3709, 0x12}, - {0x370c, 0x00}, - {0x3a02, 0x07}, - {0x3a03, 0xb0}, - {0x3a0e, 0x06}, - {0x3a0d, 0x08}, - {0x3a14, 0x07}, - {0x3a15, 0xb0}, - {0x4004, 0x06}, - {0x5000, 0xa7}, - {0x5001, 0x83}, - {0x519e, 0x38}, - {0x5381, 0x1e}, - {0x5382, 0x5b}, - {0x5383, 0x08}, - {0x460b, 0x37}, - {0x460c, 0x20}, - {0x3824, 0x01}, - {0x4005, 0x1A}, - SensorEnd -}; -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] ={ - SensorEnd -}; -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data[] = -{ - {0x3503, 0x00}, - {0x3c07, 0x08}, - {0x3820, 0x41}, - {0x3821, 0x07}, - {0x3814, 0x31}, - {0x3815, 0x31}, - {0x3803, 0x04}, - {0x3806, 0x07},/// - {0x3807, 0x9b}, - {0x3808, 0x03}, - {0x3809, 0x20}, - {0x380a, 0x02}, - {0x380b, 0x58}, - {0x380c, 0x07}, - {0x380d, 0x68}, - {0x380e, 0x03}, - {0x380f, 0xd8}, - {0x3813, 0x06}, - {0x3618, 0x00}, - {0x3612, 0x29}, - {0x3709, 0x52}, - {0x370c, 0x03}, - {0x3a02, 0x03}, - {0x3a03, 0xd8}, - {0x3a08 ,0x01},/// - {0x3a09, 0x27},/// - {0x3a0a, 0x00},/// - {0x3a0b, 0xf6},/// - {0x3a0e, 0x03}, - {0x3a0d, 0x04}, - {0x3a14, 0x03}, - {0x3a15, 0xd8}, - {0x4004, 0x02}, - {0x3002, 0x1c},//// - {0x4713, 0x03},//// - {0x3035, 0x21}, - {0x3036, 0x46}, - {0x4837, 0x22}, - {0x3824, 0x02},//// - {0x5001, 0xa3}, - - SensorEnd -}; -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[]={ - {0x3503, 0x00}, - - {0x3c07,0x07}, - {0x3803,0xfa}, - {0x3806,0x06},//// - {0x3807,0xa9}, - {0x3808,0x05}, - {0x3809,0x00}, - {0x380a,0x02}, - {0x380b,0xd0}, - {0x380c,0x07}, - {0x380d,0x64}, - {0x380e,0x02}, - {0x380f,0xe4}, - {0x3813,0x04}, - {0x3a02,0x02}, - {0x3a03,0xe4}, - {0x3a08,0x01},/// - {0x3a09,0xbc},//// - {0x3a0a,0x01},/// - {0x3a0b,0x72},//// - {0x3a0e,0x01}, - {0x3a0d,0x02}, - {0x3a14,0x02}, - {0x3a15,0xe4}, - - {0x3820, 0x41}, //ddl@rock-chips.com add start: qsxvga -> 720p isn't stream on - {0x3821, 0x07}, - {0x3814, 0x31}, - {0x3815, 0x31}, - - {0x3618, 0x00}, - {0x3612, 0x29}, - {0x3709, 0x52}, - {0x370c, 0x03}, - {0x3a02, 0x03}, - {0x3a03, 0xd8}, - {0x3a08 ,0x01},/// - {0x3a09, 0x27},/// - {0x3a0a, 0x00},/// - {0x3a0b, 0xf6},/// - {0x3a0e, 0x03}, - {0x3a0d, 0x04}, - {0x3a14, 0x03}, - {0x3a15, 0xd8}, - {0x4004, 0x02}, - {0x3002, 0x1c},//// - {0x4713, 0x03},//////ddl@rock-chips.com add end - - {0x3002,0x00},/// - {0x4713,0x02},/// - {0x4837,0x16}, - {0x3824,0x04},/// - {0x5001,0x83}, - {0x3035,0x21}, - {0x3036,0x46}, - - {0x4837, 0x22}, - {0x5001, 0xa3}, - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[]={ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_softreset_data[]={ - SensorRegVal(0x3008, 0x80), - SensorWaitMs(5), - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[]={ - SensorRegVal(0x300a,0), - SensorRegVal(0x300b,0), - SensorEnd -}; -/* -* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx -*/ -static struct rk_sensor_reg sensor_WhiteB_Auto[]= -{ - {0x3406 ,0x00}, - {0x5192 ,0x04}, - {0x5191 ,0xf8}, - {0x5193 ,0x70}, - {0x5194 ,0xf0}, - {0x5195 ,0xf0}, - {0x518d ,0x3d}, - {0x518f ,0x54}, - {0x518e ,0x3d}, - {0x5190 ,0x54}, - {0x518b ,0xa8}, - {0x518c ,0xa8}, - {0x5187 ,0x18}, - {0x5188 ,0x18}, - {0x5189 ,0x6e}, - {0x518a ,0x68}, - {0x5186 ,0x1c}, - {0x5181 ,0x50}, - {0x5184 ,0x25}, - {0x5182 ,0x11}, - {0x5183 ,0x14}, - {0x5184 ,0x25}, - {0x5185 ,0x24}, - SensorEnd -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[]= -{ - {0x3406 ,0x1 }, - {0x3400 ,0x6 }, - {0x3401 ,0x48}, - {0x3402 ,0x4 }, - {0x3403 ,0x0 }, - {0x3404 ,0x4 }, - {0x3405 ,0xd3 }, - SensorEnd -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[]= -{ - {0x3406 ,0x1 }, - {0x3400 ,0x6 }, - {0x3401 ,0x1c}, - {0x3402 ,0x4 }, - {0x3403 ,0x0 }, - {0x3404 ,0x4 }, - {0x3405 ,0xf3}, - SensorEnd -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0x3406 ,0x1 }, - {0x3400 ,0x5 }, - {0x3401 ,0x48}, - {0x3402 ,0x4 }, - {0x3403 ,0x0 }, - {0x3404 ,0x7 }, - {0x3405 ,0xcf}, - SensorEnd - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x3406 ,0x1 }, - {0x3400 ,0x4 }, - {0x3401 ,0x10}, - {0x3402 ,0x4 }, - {0x3403 ,0x0 }, - {0x3404 ,0x8 }, - {0x3405 ,0xb6}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[]= -{ - // Brightness -2 - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[]= -{ - // Brightness -1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[]= -{ - // Brightness 0 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[]= -{ - // Brightness +1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[]= -{ - // Brightness +2 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[]= -{ - // Brightness +3 - - SensorEnd -}; -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = -{ - {0x5001, 0x7f}, - {0x5580, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = -{ - {0x5001, 0xff}, - {0x5580, 0x18}, - {0x5583, 0x80}, - {0x5584, 0x80}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = -{ - {0x5001, 0xff}, - {0x5580, 0x18}, - {0x5583, 0x40}, - {0x5584, 0xa0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Negative[] = -{ - //Negative - {0x5001, 0xff}, - {0x5580, 0x40}, - SensorEnd -}; -static struct rk_sensor_reg sensor_Effect_Bluish[] = -{ - // Bluish - {0x5001, 0xff}, - {0x5580, 0x18}, - {0x5583, 0xa0}, - {0x5584, 0x40}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = -{ - // Greenish - {0x5001, 0xff}, - {0x5580, 0x18}, - {0x5583, 0x60}, - {0x5584, 0x60}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; - -static struct rk_sensor_reg sensor_Exposure0[]= -{ - {0x3a0f, 0x10}, - {0x3a10, 0x08}, - {0x3a1b, 0x10}, - {0x3a1e, 0x08}, - {0x3a11, 0x20}, - {0x3a1f, 0x10}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure1[]= -{ - {0x3a0f, 0x20}, - {0x3a10, 0x18}, - {0x3a11, 0x41}, - {0x3a1b, 0x20}, - {0x3a1e, 0x18}, - {0x3a1f, 0x10}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure2[]= -{ - {0x3a0f, 0x30}, - {0x3a10, 0x28}, - {0x3a11, 0x61}, - {0x3a1b, 0x30}, - {0x3a1e, 0x28}, - {0x3a1f, 0x10}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure3[]= -{ - {0x3a0f, 0x38}, - {0x3a10, 0x30}, - {0x3a11, 0x61}, - {0x3a1b, 0x38}, - {0x3a1e, 0x30}, - {0x3a1f, 0x10}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure4[]= -{ - {0x3a0f, 0x40}, - {0x3a10, 0x38}, - {0x3a11, 0x71}, - {0x3a1b, 0x40}, - {0x3a1e, 0x38}, - {0x3a1f, 0x10}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure5[]= -{ - {0x3a0f, 0x50}, - {0x3a10, 0x48}, - {0x3a11, 0x90}, - {0x3a1b, 0x50}, - {0x3a1e, 0x48}, - {0x3a1f, 0x20}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure6[]= -{ - {0x3a0f, 0x60}, - {0x3a10, 0x58}, - {0x3a11, 0xa0}, - {0x3a1b, 0x60}, - {0x3a1e, 0x58}, - {0x3a1f, 0x20}, - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; - -static struct rk_sensor_reg sensor_Saturation0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -static struct rk_sensor_reg sensor_Contrast0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast2[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast3[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast4[]= -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Contrast5[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast6[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; -static struct rk_sensor_reg sensor_SceneAuto[] = -{ - {0x3a00, 0x78}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = -{ - //15fps ~ 3.75fps night mode for 60/50Hz light environment, 24Mhz clock input,24Mzh pclk - {0x3034 ,0x1a}, - {0x3035 ,0x21}, - {0x3036 ,0x46}, - {0x3037 ,0x13}, - {0x3038 ,0x00}, - {0x3039 ,0x00}, - {0x3a00 ,0x7c}, - {0x3a08 ,0x01}, - {0x3a09 ,0x27}, - {0x3a0a ,0x00}, - {0x3a0b ,0xf6}, - {0x3a0d ,0x04}, - {0x3a0e ,0x04}, - {0x3a02 ,0x0b}, - {0x3a03 ,0x88}, - {0x3a14 ,0x0b}, - {0x3a15 ,0x88}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -static struct rk_sensor_reg sensor_Zoom0[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Zoom3[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; - -/* -* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu -*/ -static struct v4l2_querymenu sensor_menus[] = -{ -}; -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = -{ -}; - -//MUST define the current used format as the first item -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {MEDIA_BUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG} -}; -/*static struct soc_camera_ops sensor_ops;*/ - - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ - static int sensor_parameter_record(struct i2c_client *client) - { - u8 ret_l,ret_m,ret_h; - int tp_l,tp_m,tp_h; - struct generic_sensor*sensor = to_generic_sensor(client); - struct specific_sensor *spsensor = to_specific_sensor(sensor); - sensor_read(client,0x3a00, &ret_l); - sensor_write(client,0x3a00, ret_l&0xfb); - - sensor_write(client,0x3503,0x07); //stop AE/AG - sensor_read(client,0x3406, &ret_l); - sensor_write(client,0x3406, ret_l|0x01); - - sensor_read(client,0x3500,&ret_h); - sensor_read(client,0x3501, &ret_m); - sensor_read(client,0x3502, &ret_l); - tp_l = ret_l; - tp_m = ret_m; - tp_h = ret_h; - spsensor->parameter.preview_exposure = ((tp_h<<12) & 0xF000) | ((tp_m<<4) & 0x0FF0) | ((tp_l>>4) & 0x0F); - - //Read back AGC Gain for preview - sensor_read(client,0x350b, &ret_l); - spsensor->parameter.preview_gain = ret_l; - - SENSOR_DG(" %s Read 0x350b=0x%02x PreviewExposure:%d 0x3500=0x%02x 0x3501=0x%02x 0x3502=0x%02x \n", - SENSOR_NAME_STRING(), tp_l,spsensor->parameter.preview_exposure,tp_h, tp_m, tp_l); - return 0; - } -#define OV5640_FULL_PERIOD_PIXEL_NUMS_HTS (2844) -#define OV5640_FULL_PERIOD_LINE_NUMS_VTS (1968) -#define OV5640_PV_PERIOD_PIXEL_NUMS_HTS (1896) -#define OV5640_PV_PERIOD_LINE_NUMS_VTS (984) - static int sensor_ae_transfer(struct i2c_client *client) - { - u8 ExposureLow; - u8 ExposureMid; - u8 ExposureHigh; - u16 ulCapture_Exposure; - u16 Preview_Maxlines; - u8 Gain; - u16 OV5640_g_iExtra_ExpLines; - struct generic_sensor*sensor = to_generic_sensor(client); - struct specific_sensor *spsensor = to_specific_sensor(sensor); - //Preview_Maxlines = sensor->parameter.preview_line_width; - Preview_Maxlines = spsensor->parameter.preview_maxlines; - Gain = spsensor->parameter.preview_gain; - - - ulCapture_Exposure = (spsensor->parameter.preview_exposure*OV5640_PV_PERIOD_PIXEL_NUMS_HTS)/OV5640_FULL_PERIOD_PIXEL_NUMS_HTS; - - SENSOR_DG("cap shutter calutaed = %d, 0x%x\n", ulCapture_Exposure,ulCapture_Exposure); - - // write the gain and exposure to 0x350* registers - sensor_write(client,0x350b, Gain); - - if (ulCapture_Exposure <= 1940) { - OV5640_g_iExtra_ExpLines = 0; - }else { - OV5640_g_iExtra_ExpLines = ulCapture_Exposure - 1940; - } - SENSOR_DG("Set Extra-line = %d, iExp = %d \n", OV5640_g_iExtra_ExpLines, ulCapture_Exposure); - - ExposureLow = (ulCapture_Exposure<<4)&0xff; - ExposureMid = (ulCapture_Exposure>>4)&0xff; - ExposureHigh = (ulCapture_Exposure>>12); - - sensor_write(client,0x350c, (OV5640_g_iExtra_ExpLines&0xff00)>>8); - sensor_write(client,0x350d, OV5640_g_iExtra_ExpLines&0xff); - sensor_write(client,0x3502, ExposureLow); - sensor_write(client,0x3501, ExposureMid); - sensor_write(client,0x3500, ExposureHigh); - - //SENSOR_DG(" %s Write 0x350b=0x%02x 0x350c=0x%2x 0x350d=0x%2x 0x3502=0x%02x 0x3501=0x%02x 0x3500=0x%02x\n",SENSOR_NAME_STRING(), Gain, ExposureLow, ExposureMid, ExposureHigh); - mdelay(100); - return 0; - } -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - SENSOR_DG("%s",__FUNCTION__); - return 0; -} -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - struct generic_sensor *sensor = to_generic_sensor(client); - - SENSOR_DG("%s",__FUNCTION__); - if (sensor->info_priv.funmodule_state & SENSOR_INIT_IS_OK) { - sensor_write(client, 0x3017, 0x00); // FREX,VSYNC,HREF,PCLK,D9-D6 - sensor_write(client, 0x3018, 0x03); // D5-D0 - sensor_write(client,0x3019,0x00); // STROBE,SDA - } - - return 0; -} -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - //struct generic_sensor*sensor = to_generic_sensor(client); - - if (capture) { - sensor_parameter_record(client); - } - return 0; -} -static int sensor_softrest_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - return 0; -} - -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh (struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - //struct generic_sensor*sensor = to_generic_sensor(client); - if (capture) { - sensor_ae_transfer(client); - } - msleep(400); - return 0; -} -static int sensor_try_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf) -{ - return 0; -} - -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("Suspend"); - - } else { - SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n",pm_msg.event); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - - SENSOR_DG("Resume"); - - return 0; - -} -static int sensor_mirror_cb (struct i2c_client *client, int mirror) -{ - - SENSOR_DG("mirror: %d",mirror); - - return 0; -} -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_mirror_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_mirror failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_mirror success, value:0x%x",ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - SENSOR_DG("flip: %d",flip); - - return 0; -} -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_flip_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_flip failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_flip success, value:0x%x",ext_ctrl->value); - return 0; -} -/* -* the functions are focus callbacks -*/ -/* -for 5640 focus -*/ -struct af_cmdinfo -{ - char cmd_tag; - char cmd_para[4]; - char validate_bit; -}; -static int sensor_af_cmdset(struct i2c_client *client, int cmd_main, struct af_cmdinfo *cmdinfo) -{ - int i; - char read_tag=0xff,cnt; - - if (cmdinfo) { - for (i=0; i<4; i++) { - if (cmdinfo->validate_bit & (1<cmd_para[i])) { - SENSOR_TR("%s write CMD_PARA_Reg(main:0x%x para%d:0x%x) error!\n",SENSOR_NAME_STRING(),cmd_main,i,cmdinfo->cmd_para[i]); - goto sensor_af_cmdset_err; - } - SENSOR_DG("%s write CMD_PARA_Reg(main:0x%x para%d:0x%x) success!\n",SENSOR_NAME_STRING(),cmd_main,i,cmdinfo->cmd_para[i]); - } - } - - if (cmdinfo->validate_bit & 0x80) { - if (sensor_write(client, CMD_ACK_Reg, cmdinfo->cmd_tag)) { - SENSOR_TR("%s write CMD_ACK_Reg(main:0x%x tag:0x%x) error!\n",SENSOR_NAME_STRING(),cmd_main,cmdinfo->cmd_tag); - goto sensor_af_cmdset_err; - } - SENSOR_DG("%s write CMD_ACK_Reg(main:0x%x tag:0x%x) success!\n",SENSOR_NAME_STRING(),cmd_main,cmdinfo->cmd_tag); - } - - } else { - if (sensor_write(client, CMD_ACK_Reg, 0x01)) { - SENSOR_TR("%s write CMD_ACK_Reg(main:0x%x no tag) error!\n",SENSOR_NAME_STRING(),cmd_main); - goto sensor_af_cmdset_err; - } - SENSOR_DG("%s write CMD_ACK_Reg(main:0x%x no tag) success!\n",SENSOR_NAME_STRING(),cmd_main); - } - - if (sensor_write(client, CMD_MAIN_Reg, cmd_main)) { - SENSOR_TR("%s write CMD_MAIN_Reg(main:0x%x) error!\n",SENSOR_NAME_STRING(),cmd_main); - goto sensor_af_cmdset_err; - } - - cnt = 0; - do - { - msleep(5); - if (sensor_read(client,CMD_ACK_Reg,&read_tag)){ - SENSOR_TR("%s[%d] read TAG failed\n",SENSOR_NAME_STRING(),__LINE__); - break; - } - } while((read_tag != 0x00)&& (cnt++<100)); - - SENSOR_DG("%s write CMD_MAIN_Reg(main:0x%x read tag:0x%x) success!\n",SENSOR_NAME_STRING(),cmd_main,read_tag); - return 0; -sensor_af_cmdset_err: - return -1; -} -static int sensor_af_idlechk(struct i2c_client *client) -{ - int ret = 0; - char state; - struct af_cmdinfo cmdinfo; - - SENSOR_DG("%s , %d\n",__FUNCTION__,__LINE__); - - cmdinfo.cmd_tag = 0x01; - cmdinfo.validate_bit = 0x80; - ret = sensor_af_cmdset(client, ReturnIdle_Cmd, &cmdinfo); - if(0 != ret) { - SENSOR_TR("%s[%d] read focus_status failed\n",SENSOR_NAME_STRING(),__LINE__); - ret = -1; - goto sensor_af_idlechk_end; - } - - - do{ - ret = sensor_read(client, CMD_ACK_Reg, &state); - if (ret != 0){ - SENSOR_TR("%s[%d] read focus_status failed\n",SENSOR_NAME_STRING(),__LINE__); - ret = -1; - goto sensor_af_idlechk_end; - } - }while(0x00 != state); - - SENSOR_DG("%s , %d\n",__FUNCTION__,__LINE__); -sensor_af_idlechk_end: - return ret; -} -/*for 5640 focus end*/ -// -static int sensor_focus_af_single_usr_cb(struct i2c_client *client); - -static int sensor_focus_init_usr_cb(struct i2c_client *client) -{ - int ret = 0, cnt; - char state; - - msleep(1); - ret = sensor_write_array(client, sensor_af_firmware); - if (ret != 0) { - SENSOR_TR("%s Download firmware failed\n",SENSOR_NAME_STRING()); - ret = -1; - goto sensor_af_init_end; - } - - cnt = 0; - do - { - msleep(1); - if (cnt++ > 500) - break; - ret = sensor_read(client, STA_FOCUS_Reg, &state); - if (ret != 0){ - SENSOR_TR("%s[%d] read focus_status failed\n",SENSOR_NAME_STRING(),__LINE__); - ret = -1; - goto sensor_af_init_end; - } - } while (state != S_IDLE); - - if (state != S_IDLE) { - SENSOR_TR("%s focus state(0x%x) is error!\n",SENSOR_NAME_STRING(),state); - ret = -1; - goto sensor_af_init_end; - } -sensor_af_init_end: - SENSOR_DG("%s %s ret:0x%x \n",SENSOR_NAME_STRING(),__FUNCTION__,ret); - return ret; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client) -{ - int ret = 0; - char state,cnt; - struct af_cmdinfo cmdinfo; - //char s_zone[5],i; - cmdinfo.cmd_tag = 0x01; - cmdinfo.validate_bit = 0x80; - ret = sensor_af_cmdset(client, SingleFocus_Cmd, &cmdinfo); - if(0 != ret) { - SENSOR_TR("%s single focus mode set error!\n",SENSOR_NAME_STRING()); - ret = -1; - goto sensor_af_single_end; - } - - cnt = 0; - do - { - if (cnt != 0) { - msleep(1); - } - cnt++; - ret = sensor_read(client, STA_FOCUS_Reg, &state); - if (ret != 0){ - SENSOR_TR("%s[%d] read focus_status failed\n",SENSOR_NAME_STRING(),__LINE__); - ret = -1; - goto sensor_af_single_end; - } - }while((state == S_FOCUSING) && (cnt<100)); - - if (state != S_FOCUSED) { - SENSOR_TR("%s[%d] focus state(0x%x) is error!\n",SENSOR_NAME_STRING(),__LINE__,state); - ret = -1; - goto sensor_af_single_end; - } else { - SENSOR_DG("%s[%d] single focus mode set success!\n",SENSOR_NAME_STRING(),__LINE__); - } -sensor_af_single_end: - return ret; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client) -{ - - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos) -{ - struct af_cmdinfo cmdinfo; - sensor_af_idlechk(client); - return 0; - cmdinfo.cmd_tag = StepFocus_Spec_Tag; - cmdinfo.cmd_para[0] = pos; - cmdinfo.validate_bit = 0x81; - return sensor_af_cmdset(client, StepMode_Cmd, &cmdinfo); -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client) -{ - int ret = 0; - struct af_cmdinfo cmdinfo; - cmdinfo.cmd_tag = 0x01; - cmdinfo.cmd_para[0] = 0x00; - cmdinfo.validate_bit = 0x81; - sensor_af_idlechk(client); - if (sensor_af_cmdset(client, ConstFocus_Cmd, &cmdinfo)) { - SENSOR_TR("%s[%d] const focus mode set error!\n",SENSOR_NAME_STRING(),__LINE__); - ret = -1; - goto sensor_af_const_end; - } else { - SENSOR_DG("%s[%d] const focus mode set success!\n",SENSOR_NAME_STRING(),__LINE__); - } -sensor_af_const_end: - return ret; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client) -{ - int ret = 0; - sensor_af_idlechk(client); - if (sensor_af_cmdset(client, PauseFocus_Cmd, NULL)) { - SENSOR_TR("%s pause focus mode set error!\n",SENSOR_NAME_STRING()); - ret = -1; - goto sensor_af_pause_end; - } -sensor_af_pause_end: - return ret; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos) -{ - int ret = 0; - struct af_cmdinfo cmdinfo; - //int zone_tm_pos[4]; - int zone_center_pos[2]; - //struct generic_sensor*sensor = to_generic_sensor(client); - - if (zone_tm_pos) { - zone_tm_pos[0] += 1000; - zone_tm_pos[1] += 1000; - zone_tm_pos[2]+= 1000; - zone_tm_pos[3] += 1000; - zone_center_pos[0] = ((zone_tm_pos[0] + zone_tm_pos[2])>>1)*80/2000; - zone_center_pos[1] = ((zone_tm_pos[1] + zone_tm_pos[3])>>1)*60/2000; - } else { -#if CONFIG_SENSOR_FocusCenterInCapture - zone_center_pos[0] = 32; - zone_center_pos[1] = 24; -#else - zone_center_pos[0] = -1; - zone_center_pos[1] = -1; -#endif - } - if ((zone_center_pos[0] >=0) && (zone_center_pos[1]>=0)){ - cmdinfo.cmd_tag = 0x01; - cmdinfo.validate_bit = 0x83; - if (zone_center_pos[0]<=8) - cmdinfo.cmd_para[0] = 0; - else if ((zone_center_pos[0]>8) && (zone_center_pos[0]<72)) - cmdinfo.cmd_para[0] = zone_center_pos[0]-8; - else - cmdinfo.cmd_para[0] = 72; - - if (zone_center_pos[1]<=6) - cmdinfo.cmd_para[1] = 0; - else if ((zone_center_pos[1]>6) && (zone_center_pos[1]<54)) - cmdinfo.cmd_para[1] = zone_center_pos[1]-6; - else - cmdinfo.cmd_para[1] = 54; - - ret = sensor_af_cmdset(client, TouchZoneConfig_Cmd, &cmdinfo); - if(0 != ret) { - SENSOR_TR("%s touch zone config error!\n",SENSOR_NAME_STRING()); - ret = -1; - goto sensor_af_zone_end; - } - } -sensor_af_zone_end: - return ret; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client,int on){ - return 0; -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor* spsensor,struct soc_camera_device *icd) -{ - return; -} - -/* -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); - - - diff --git a/drivers/media/video/ov5640.h b/drivers/media/video/ov5640.h deleted file mode 100644 index cc02d24cbf62..000000000000 --- a/drivers/media/video/ov5640.h +++ /dev/null @@ -1,16 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __OV5640_H__ -#define __OV5640_H__ -struct reginfo -{ - u16 reg; - u8 val; -}; - -#define SEQUENCE_INIT 0x00 -#define SEQUENCE_NORMAL 0x01 - -#define SEQUENCE_PROPERTY 0xFFFD -#define SEQUENCE_WAIT_MS 0xFFFE -#define SEQUENCE_END 0xFFFF -#endif diff --git a/drivers/media/video/ov5640_af_firmware.c b/drivers/media/video/ov5640_af_firmware.c deleted file mode 100755 index 553ba774d527..000000000000 --- a/drivers/media/video/ov5640_af_firmware.c +++ /dev/null @@ -1,11930 +0,0 @@ -/* - * Driver for OV5640 CMOS Image Sensor from OmniVision - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -//#include "ov5640.h" - -static struct rk_sensor_reg sensor_af_firmware[] = -{ - SensorStreamChk, -#if 0 - {0x3000, 0x20}, - {0x8000, 0x02}, - {0x8001, 0x0b}, - {0x8002, 0x61}, - {0x8003, 0x02}, - {0x8004, 0x07}, - {0x8005, 0xb1}, - {0x8006, 0xc2}, - {0x8007, 0x01}, - {0x8008, 0x22}, - {0x8009, 0x22}, - {0x800a, 0x00}, - {0x800b, 0x02}, - {0x800c, 0x0b}, - {0x800d, 0x4b}, - {0x800e, 0xe5}, - {0x800f, 0x1f}, - {0x8010, 0x60}, - {0x8011, 0x03}, - {0x8012, 0x02}, - {0x8013, 0x00}, - {0x8014, 0x97}, - {0x8015, 0xf5}, - {0x8016, 0x1e}, - {0x8017, 0xd2}, - {0x8018, 0x34}, - {0x8019, 0x75}, - {0x801a, 0x34}, - {0x801b, 0xff}, - {0x801c, 0x75}, - {0x801d, 0x35}, - {0x801e, 0x0e}, - {0x801f, 0x75}, - {0x8020, 0x36}, - {0x8021, 0x55}, - {0x8022, 0x75}, - {0x8023, 0x37}, - {0x8024, 0x01}, - {0x8025, 0x12}, - {0x8026, 0x0a}, - {0x8027, 0x3e}, - {0x8028, 0xe4}, - {0x8029, 0xff}, - {0x802a, 0xef}, - {0x802b, 0x25}, - {0x802c, 0xe0}, - {0x802d, 0x24}, - {0x802e, 0x4b}, - {0x802f, 0xf8}, - {0x8030, 0xe4}, - {0x8031, 0xf6}, - {0x8032, 0x08}, - {0x8033, 0xf6}, - {0x8034, 0x0f}, - {0x8035, 0xbf}, - {0x8036, 0x34}, - {0x8037, 0xf2}, - {0x8038, 0x90}, - {0x8039, 0x0e}, - {0x803a, 0x88}, - {0x803b, 0xe4}, - {0x803c, 0x93}, - {0x803d, 0xff}, - {0x803e, 0xe5}, - {0x803f, 0x49}, - {0x8040, 0xc3}, - {0x8041, 0x9f}, - {0x8042, 0x50}, - {0x8043, 0x04}, - {0x8044, 0x7f}, - {0x8045, 0x05}, - {0x8046, 0x80}, - {0x8047, 0x02}, - {0x8048, 0x7f}, - {0x8049, 0xfb}, - {0x804a, 0x78}, - {0x804b, 0xba}, - {0x804c, 0xa6}, - {0x804d, 0x07}, - {0x804e, 0x12}, - {0x804f, 0x0a}, - {0x8050, 0xa8}, - {0x8051, 0x40}, - {0x8052, 0x04}, - {0x8053, 0x7f}, - {0x8054, 0x03}, - {0x8055, 0x80}, - {0x8056, 0x02}, - {0x8057, 0x7f}, - {0x8058, 0x30}, - {0x8059, 0x78}, - {0x805a, 0xb9}, - {0x805b, 0xa6}, - {0x805c, 0x07}, - {0x805d, 0xe6}, - {0x805e, 0x18}, - {0x805f, 0xf6}, - {0x8060, 0x08}, - {0x8061, 0xe6}, - {0x8062, 0x78}, - {0x8063, 0xb6}, - {0x8064, 0xf6}, - {0x8065, 0x78}, - {0x8066, 0xb9}, - {0x8067, 0xe6}, - {0x8068, 0x78}, - {0x8069, 0xb7}, - {0x806a, 0xf6}, - {0x806b, 0x78}, - {0x806c, 0xbc}, - {0x806d, 0x76}, - {0x806e, 0x33}, - {0x806f, 0xe4}, - {0x8070, 0x08}, - {0x8071, 0xf6}, - {0x8072, 0x78}, - {0x8073, 0xb5}, - {0x8074, 0x76}, - {0x8075, 0x01}, - {0x8076, 0x75}, - {0x8077, 0x48}, - {0x8078, 0x02}, - {0x8079, 0x78}, - {0x807a, 0xb3}, - {0x807b, 0xf6}, - {0x807c, 0x08}, - {0x807d, 0xf6}, - {0x807e, 0x74}, - {0x807f, 0xff}, - {0x8080, 0x78}, - {0x8081, 0xbe}, - {0x8082, 0xf6}, - {0x8083, 0x08}, - {0x8084, 0xf6}, - {0x8085, 0x75}, - {0x8086, 0x1f}, - {0x8087, 0x01}, - {0x8088, 0x78}, - {0x8089, 0xb9}, - {0x808a, 0xe6}, - {0x808b, 0x75}, - {0x808c, 0xf0}, - {0x808d, 0x05}, - {0x808e, 0xa4}, - {0x808f, 0xf5}, - {0x8090, 0x49}, - {0x8091, 0x12}, - {0x8092, 0x08}, - {0x8093, 0x4f}, - {0x8094, 0xc2}, - {0x8095, 0x36}, - {0x8096, 0x22}, - {0x8097, 0x78}, - {0x8098, 0xb5}, - {0x8099, 0xe6}, - {0x809a, 0xd3}, - {0x809b, 0x94}, - {0x809c, 0x00}, - {0x809d, 0x40}, - {0x809e, 0x02}, - {0x809f, 0x16}, - {0x80a0, 0x22}, - {0x80a1, 0xe5}, - {0x80a2, 0x1f}, - {0x80a3, 0xb4}, - {0x80a4, 0x05}, - {0x80a5, 0x23}, - {0x80a6, 0xe4}, - {0x80a7, 0xf5}, - {0x80a8, 0x1f}, - {0x80a9, 0xc2}, - {0x80aa, 0x01}, - {0x80ab, 0x78}, - {0x80ac, 0xb3}, - {0x80ad, 0xe6}, - {0x80ae, 0xfe}, - {0x80af, 0x08}, - {0x80b0, 0xe6}, - {0x80b1, 0xff}, - {0x80b2, 0x78}, - {0x80b3, 0x4b}, - {0x80b4, 0xa6}, - {0x80b5, 0x06}, - {0x80b6, 0x08}, - {0x80b7, 0xa6}, - {0x80b8, 0x07}, - {0x80b9, 0xa2}, - {0x80ba, 0x36}, - {0x80bb, 0xe4}, - {0x80bc, 0x33}, - {0x80bd, 0xf5}, - {0x80be, 0x3c}, - {0x80bf, 0x90}, - {0x80c0, 0x30}, - {0x80c1, 0x28}, - {0x80c2, 0xf0}, - {0x80c3, 0x75}, - {0x80c4, 0x1e}, - {0x80c5, 0x10}, - {0x80c6, 0xd2}, - {0x80c7, 0x34}, - {0x80c8, 0x22}, - {0x80c9, 0xe5}, - {0x80ca, 0x49}, - {0x80cb, 0x75}, - {0x80cc, 0xf0}, - {0x80cd, 0x05}, - {0x80ce, 0x84}, - {0x80cf, 0x78}, - {0x80d0, 0xb9}, - {0x80d1, 0xf6}, - {0x80d2, 0x90}, - {0x80d3, 0x0e}, - {0x80d4, 0x85}, - {0x80d5, 0xe4}, - {0x80d6, 0x93}, - {0x80d7, 0xff}, - {0x80d8, 0x25}, - {0x80d9, 0xe0}, - {0x80da, 0x24}, - {0x80db, 0x0a}, - {0x80dc, 0xf8}, - {0x80dd, 0xe6}, - {0x80de, 0xfc}, - {0x80df, 0x08}, - {0x80e0, 0xe6}, - {0x80e1, 0xfd}, - {0x80e2, 0x78}, - {0x80e3, 0xb9}, - {0x80e4, 0xe6}, - {0x80e5, 0x25}, - {0x80e6, 0xe0}, - {0x80e7, 0x24}, - {0x80e8, 0x4b}, - {0x80e9, 0xf8}, - {0x80ea, 0xa6}, - {0x80eb, 0x04}, - {0x80ec, 0x08}, - {0x80ed, 0xa6}, - {0x80ee, 0x05}, - {0x80ef, 0xef}, - {0x80f0, 0x12}, - {0x80f1, 0x0a}, - {0x80f2, 0xaf}, - {0x80f3, 0xd3}, - {0x80f4, 0x78}, - {0x80f5, 0xb4}, - {0x80f6, 0x96}, - {0x80f7, 0xee}, - {0x80f8, 0x18}, - {0x80f9, 0x96}, - {0x80fa, 0x40}, - {0x80fb, 0x0d}, - {0x80fc, 0x78}, - {0x80fd, 0xb9}, - {0x80fe, 0xe6}, - {0x80ff, 0x78}, - {0x8100, 0xb6}, - {0x8101, 0xf6}, - {0x8102, 0x78}, - {0x8103, 0xb3}, - {0x8104, 0xa6}, - {0x8105, 0x06}, - {0x8106, 0x08}, - {0x8107, 0xa6}, - {0x8108, 0x07}, - {0x8109, 0x90}, - {0x810a, 0x0e}, - {0x810b, 0x85}, - {0x810c, 0xe4}, - {0x810d, 0x93}, - {0x810e, 0x12}, - {0x810f, 0x0a}, - {0x8110, 0xaf}, - {0x8111, 0xc3}, - {0x8112, 0x78}, - {0x8113, 0xbf}, - {0x8114, 0x96}, - {0x8115, 0xee}, - {0x8116, 0x18}, - {0x8117, 0x96}, - {0x8118, 0x50}, - {0x8119, 0x0d}, - {0x811a, 0x78}, - {0x811b, 0xb9}, - {0x811c, 0xe6}, - {0x811d, 0x78}, - {0x811e, 0xb7}, - {0x811f, 0xf6}, - {0x8120, 0x78}, - {0x8121, 0xbe}, - {0x8122, 0xa6}, - {0x8123, 0x06}, - {0x8124, 0x08}, - {0x8125, 0xa6}, - {0x8126, 0x07}, - {0x8127, 0x78}, - {0x8128, 0xb3}, - {0x8129, 0xe6}, - {0x812a, 0xfe}, - {0x812b, 0x08}, - {0x812c, 0xe6}, - {0x812d, 0xc3}, - {0x812e, 0x78}, - {0x812f, 0xbf}, - {0x8130, 0x96}, - {0x8131, 0xff}, - {0x8132, 0xee}, - {0x8133, 0x18}, - {0x8134, 0x96}, - {0x8135, 0x78}, - {0x8136, 0xc0}, - {0x8137, 0xf6}, - {0x8138, 0x08}, - {0x8139, 0xa6}, - {0x813a, 0x07}, - {0x813b, 0x90}, - {0x813c, 0x0e}, - {0x813d, 0x8a}, - {0x813e, 0xe4}, - {0x813f, 0x18}, - {0x8140, 0x12}, - {0x8141, 0x0a}, - {0x8142, 0x8d}, - {0x8143, 0x40}, - {0x8144, 0x02}, - {0x8145, 0xd2}, - {0x8146, 0x36}, - {0x8147, 0x78}, - {0x8148, 0xb9}, - {0x8149, 0xe6}, - {0x814a, 0x08}, - {0x814b, 0x26}, - {0x814c, 0x08}, - {0x814d, 0xf6}, - {0x814e, 0xe5}, - {0x814f, 0x1f}, - {0x8150, 0x64}, - {0x8151, 0x01}, - {0x8152, 0x70}, - {0x8153, 0x4a}, - {0x8154, 0xe6}, - {0x8155, 0xc3}, - {0x8156, 0x78}, - {0x8157, 0xbd}, - {0x8158, 0x12}, - {0x8159, 0x0a}, - {0x815a, 0x83}, - {0x815b, 0x40}, - {0x815c, 0x05}, - {0x815d, 0x12}, - {0x815e, 0x0a}, - {0x815f, 0x7e}, - {0x8160, 0x40}, - {0x8161, 0x39}, - {0x8162, 0x12}, - {0x8163, 0x0a}, - {0x8164, 0xa6}, - {0x8165, 0x40}, - {0x8166, 0x04}, - {0x8167, 0x7f}, - {0x8168, 0xfe}, - {0x8169, 0x80}, - {0x816a, 0x02}, - {0x816b, 0x7f}, - {0x816c, 0x02}, - {0x816d, 0x78}, - {0x816e, 0xba}, - {0x816f, 0xa6}, - {0x8170, 0x07}, - {0x8171, 0x78}, - {0x8172, 0xb6}, - {0x8173, 0xe6}, - {0x8174, 0x24}, - {0x8175, 0x03}, - {0x8176, 0x78}, - {0x8177, 0xbc}, - {0x8178, 0xf6}, - {0x8179, 0x78}, - {0x817a, 0xb6}, - {0x817b, 0xe6}, - {0x817c, 0x24}, - {0x817d, 0xfd}, - {0x817e, 0x78}, - {0x817f, 0xbd}, - {0x8180, 0xf6}, - {0x8181, 0x12}, - {0x8182, 0x0a}, - {0x8183, 0xa6}, - {0x8184, 0x40}, - {0x8185, 0x06}, - {0x8186, 0x78}, - {0x8187, 0xbd}, - {0x8188, 0xe6}, - {0x8189, 0xff}, - {0x818a, 0x80}, - {0x818b, 0x04}, - {0x818c, 0x78}, - {0x818d, 0xbc}, - {0x818e, 0xe6}, - {0x818f, 0xff}, - {0x8190, 0x78}, - {0x8191, 0xbb}, - {0x8192, 0xa6}, - {0x8193, 0x07}, - {0x8194, 0x75}, - {0x8195, 0x1f}, - {0x8196, 0x02}, - {0x8197, 0x78}, - {0x8198, 0xb5}, - {0x8199, 0x76}, - {0x819a, 0x01}, - {0x819b, 0x02}, - {0x819c, 0x02}, - {0x819d, 0x5d}, - {0x819e, 0xe5}, - {0x819f, 0x1f}, - {0x81a0, 0x64}, - {0x81a1, 0x02}, - {0x81a2, 0x60}, - {0x81a3, 0x03}, - {0x81a4, 0x02}, - {0x81a5, 0x02}, - {0x81a6, 0x3d}, - {0x81a7, 0x78}, - {0x81a8, 0xbb}, - {0x81a9, 0xe6}, - {0x81aa, 0xff}, - {0x81ab, 0xc3}, - {0x81ac, 0x78}, - {0x81ad, 0xbd}, - {0x81ae, 0x12}, - {0x81af, 0x0a}, - {0x81b0, 0x84}, - {0x81b1, 0x40}, - {0x81b2, 0x08}, - {0x81b3, 0x12}, - {0x81b4, 0x0a}, - {0x81b5, 0x7e}, - {0x81b6, 0x50}, - {0x81b7, 0x03}, - {0x81b8, 0x02}, - {0x81b9, 0x02}, - {0x81ba, 0x3b}, - {0x81bb, 0x12}, - {0x81bc, 0x0a}, - {0x81bd, 0xa6}, - {0x81be, 0x40}, - {0x81bf, 0x04}, - {0x81c0, 0x7f}, - {0x81c1, 0xff}, - {0x81c2, 0x80}, - {0x81c3, 0x02}, - {0x81c4, 0x7f}, - {0x81c5, 0x01}, - {0x81c6, 0x78}, - {0x81c7, 0xba}, - {0x81c8, 0xa6}, - {0x81c9, 0x07}, - {0x81ca, 0x78}, - {0x81cb, 0xb6}, - {0x81cc, 0xe6}, - {0x81cd, 0x04}, - {0x81ce, 0x78}, - {0x81cf, 0xbc}, - {0x81d0, 0xf6}, - {0x81d1, 0x78}, - {0x81d2, 0xb6}, - {0x81d3, 0xe6}, - {0x81d4, 0x14}, - {0x81d5, 0x78}, - {0x81d6, 0xbd}, - {0x81d7, 0xf6}, - {0x81d8, 0x18}, - {0x81d9, 0x12}, - {0x81da, 0x0a}, - {0x81db, 0xa8}, - {0x81dc, 0x40}, - {0x81dd, 0x04}, - {0x81de, 0xe6}, - {0x81df, 0xff}, - {0x81e0, 0x80}, - {0x81e1, 0x02}, - {0x81e2, 0x7f}, - {0x81e3, 0x00}, - {0x81e4, 0x78}, - {0x81e5, 0xbc}, - {0x81e6, 0xa6}, - {0x81e7, 0x07}, - {0x81e8, 0xd3}, - {0x81e9, 0x08}, - {0x81ea, 0xe6}, - {0x81eb, 0x64}, - {0x81ec, 0x80}, - {0x81ed, 0x94}, - {0x81ee, 0x80}, - {0x81ef, 0x40}, - {0x81f0, 0x04}, - {0x81f1, 0xe6}, - {0x81f2, 0xff}, - {0x81f3, 0x80}, - {0x81f4, 0x02}, - {0x81f5, 0x7f}, - {0x81f6, 0x00}, - {0x81f7, 0x78}, - {0x81f8, 0xbd}, - {0x81f9, 0xa6}, - {0x81fa, 0x07}, - {0x81fb, 0xc3}, - {0x81fc, 0x18}, - {0x81fd, 0xe6}, - {0x81fe, 0x64}, - {0x81ff, 0x80}, - {0x8200, 0x94}, - {0x8201, 0xb3}, - {0x8202, 0x50}, - {0x8203, 0x04}, - {0x8204, 0xe6}, - {0x8205, 0xff}, - {0x8206, 0x80}, - {0x8207, 0x02}, - {0x8208, 0x7f}, - {0x8209, 0x33}, - {0x820a, 0x78}, - {0x820b, 0xbc}, - {0x820c, 0xa6}, - {0x820d, 0x07}, - {0x820e, 0xc3}, - {0x820f, 0x08}, - {0x8210, 0xe6}, - {0x8211, 0x64}, - {0x8212, 0x80}, - {0x8213, 0x94}, - {0x8214, 0xb3}, - {0x8215, 0x50}, - {0x8216, 0x04}, - {0x8217, 0xe6}, - {0x8218, 0xff}, - {0x8219, 0x80}, - {0x821a, 0x02}, - {0x821b, 0x7f}, - {0x821c, 0x33}, - {0x821d, 0x78}, - {0x821e, 0xbd}, - {0x821f, 0xa6}, - {0x8220, 0x07}, - {0x8221, 0x12}, - {0x8222, 0x0a}, - {0x8223, 0xa6}, - {0x8224, 0x40}, - {0x8225, 0x06}, - {0x8226, 0x78}, - {0x8227, 0xbd}, - {0x8228, 0xe6}, - {0x8229, 0xff}, - {0x822a, 0x80}, - {0x822b, 0x04}, - {0x822c, 0x78}, - {0x822d, 0xbc}, - {0x822e, 0xe6}, - {0x822f, 0xff}, - {0x8230, 0x78}, - {0x8231, 0xbb}, - {0x8232, 0xa6}, - {0x8233, 0x07}, - {0x8234, 0x75}, - {0x8235, 0x1f}, - {0x8236, 0x03}, - {0x8237, 0x78}, - {0x8238, 0xb5}, - {0x8239, 0x76}, - {0x823a, 0x01}, - {0x823b, 0x80}, - {0x823c, 0x20}, - {0x823d, 0xe5}, - {0x823e, 0x1f}, - {0x823f, 0x64}, - {0x8240, 0x03}, - {0x8241, 0x70}, - {0x8242, 0x26}, - {0x8243, 0x78}, - {0x8244, 0xbb}, - {0x8245, 0xe6}, - {0x8246, 0xff}, - {0x8247, 0xc3}, - {0x8248, 0x78}, - {0x8249, 0xbd}, - {0x824a, 0x12}, - {0x824b, 0x0a}, - {0x824c, 0x84}, - {0x824d, 0x40}, - {0x824e, 0x05}, - {0x824f, 0x12}, - {0x8250, 0x0a}, - {0x8251, 0x7e}, - {0x8252, 0x40}, - {0x8253, 0x09}, - {0x8254, 0x78}, - {0x8255, 0xb6}, - {0x8256, 0xe6}, - {0x8257, 0x78}, - {0x8258, 0xbb}, - {0x8259, 0xf6}, - {0x825a, 0x75}, - {0x825b, 0x1f}, - {0x825c, 0x04}, - {0x825d, 0x78}, - {0x825e, 0xbb}, - {0x825f, 0xe6}, - {0x8260, 0x75}, - {0x8261, 0xf0}, - {0x8262, 0x05}, - {0x8263, 0xa4}, - {0x8264, 0xf5}, - {0x8265, 0x49}, - {0x8266, 0x02}, - {0x8267, 0x08}, - {0x8268, 0x4f}, - {0x8269, 0xe5}, - {0x826a, 0x1f}, - {0x826b, 0xb4}, - {0x826c, 0x04}, - {0x826d, 0x1f}, - {0x826e, 0x90}, - {0x826f, 0x0e}, - {0x8270, 0x89}, - {0x8271, 0xe4}, - {0x8272, 0x78}, - {0x8273, 0xc0}, - {0x8274, 0x12}, - {0x8275, 0x0a}, - {0x8276, 0x8d}, - {0x8277, 0x40}, - {0x8278, 0x02}, - {0x8279, 0xd2}, - {0x827a, 0x36}, - {0x827b, 0x75}, - {0x827c, 0x1f}, - {0x827d, 0x05}, - {0x827e, 0x75}, - {0x827f, 0x34}, - {0x8280, 0xff}, - {0x8281, 0x75}, - {0x8282, 0x35}, - {0x8283, 0x0e}, - {0x8284, 0x75}, - {0x8285, 0x36}, - {0x8286, 0x59}, - {0x8287, 0x75}, - {0x8288, 0x37}, - {0x8289, 0x01}, - {0x828a, 0x12}, - {0x828b, 0x0a}, - {0x828c, 0x3e}, - {0x828d, 0x22}, - {0x828e, 0xef}, - {0x828f, 0x8d}, - {0x8290, 0xf0}, - {0x8291, 0xa4}, - {0x8292, 0xa8}, - {0x8293, 0xf0}, - {0x8294, 0xcf}, - {0x8295, 0x8c}, - {0x8296, 0xf0}, - {0x8297, 0xa4}, - {0x8298, 0x28}, - {0x8299, 0xce}, - {0x829a, 0x8d}, - {0x829b, 0xf0}, - {0x829c, 0xa4}, - {0x829d, 0x2e}, - {0x829e, 0xfe}, - {0x829f, 0x22}, - {0x82a0, 0xbc}, - {0x82a1, 0x00}, - {0x82a2, 0x0b}, - {0x82a3, 0xbe}, - {0x82a4, 0x00}, - {0x82a5, 0x29}, - {0x82a6, 0xef}, - {0x82a7, 0x8d}, - {0x82a8, 0xf0}, - {0x82a9, 0x84}, - {0x82aa, 0xff}, - {0x82ab, 0xad}, - {0x82ac, 0xf0}, - {0x82ad, 0x22}, - {0x82ae, 0xe4}, - {0x82af, 0xcc}, - {0x82b0, 0xf8}, - {0x82b1, 0x75}, - {0x82b2, 0xf0}, - {0x82b3, 0x08}, - {0x82b4, 0xef}, - {0x82b5, 0x2f}, - {0x82b6, 0xff}, - {0x82b7, 0xee}, - {0x82b8, 0x33}, - {0x82b9, 0xfe}, - {0x82ba, 0xec}, - {0x82bb, 0x33}, - {0x82bc, 0xfc}, - {0x82bd, 0xee}, - {0x82be, 0x9d}, - {0x82bf, 0xec}, - {0x82c0, 0x98}, - {0x82c1, 0x40}, - {0x82c2, 0x05}, - {0x82c3, 0xfc}, - {0x82c4, 0xee}, - {0x82c5, 0x9d}, - {0x82c6, 0xfe}, - {0x82c7, 0x0f}, - {0x82c8, 0xd5}, - {0x82c9, 0xf0}, - {0x82ca, 0xe9}, - {0x82cb, 0xe4}, - {0x82cc, 0xce}, - {0x82cd, 0xfd}, - {0x82ce, 0x22}, - {0x82cf, 0xed}, - {0x82d0, 0xf8}, - {0x82d1, 0xf5}, - {0x82d2, 0xf0}, - {0x82d3, 0xee}, - {0x82d4, 0x84}, - {0x82d5, 0x20}, - {0x82d6, 0xd2}, - {0x82d7, 0x1c}, - {0x82d8, 0xfe}, - {0x82d9, 0xad}, - {0x82da, 0xf0}, - {0x82db, 0x75}, - {0x82dc, 0xf0}, - {0x82dd, 0x08}, - {0x82de, 0xef}, - {0x82df, 0x2f}, - {0x82e0, 0xff}, - {0x82e1, 0xed}, - {0x82e2, 0x33}, - {0x82e3, 0xfd}, - {0x82e4, 0x40}, - {0x82e5, 0x07}, - {0x82e6, 0x98}, - {0x82e7, 0x50}, - {0x82e8, 0x06}, - {0x82e9, 0xd5}, - {0x82ea, 0xf0}, - {0x82eb, 0xf2}, - {0x82ec, 0x22}, - {0x82ed, 0xc3}, - {0x82ee, 0x98}, - {0x82ef, 0xfd}, - {0x82f0, 0x0f}, - {0x82f1, 0xd5}, - {0x82f2, 0xf0}, - {0x82f3, 0xea}, - {0x82f4, 0x22}, - {0x82f5, 0xe8}, - {0x82f6, 0x8f}, - {0x82f7, 0xf0}, - {0x82f8, 0xa4}, - {0x82f9, 0xcc}, - {0x82fa, 0x8b}, - {0x82fb, 0xf0}, - {0x82fc, 0xa4}, - {0x82fd, 0x2c}, - {0x82fe, 0xfc}, - {0x82ff, 0xe9}, - {0x8300, 0x8e}, - {0x8301, 0xf0}, - {0x8302, 0xa4}, - {0x8303, 0x2c}, - {0x8304, 0xfc}, - {0x8305, 0x8a}, - {0x8306, 0xf0}, - {0x8307, 0xed}, - {0x8308, 0xa4}, - {0x8309, 0x2c}, - {0x830a, 0xfc}, - {0x830b, 0xea}, - {0x830c, 0x8e}, - {0x830d, 0xf0}, - {0x830e, 0xa4}, - {0x830f, 0xcd}, - {0x8310, 0xa8}, - {0x8311, 0xf0}, - {0x8312, 0x8b}, - {0x8313, 0xf0}, - {0x8314, 0xa4}, - {0x8315, 0x2d}, - {0x8316, 0xcc}, - {0x8317, 0x38}, - {0x8318, 0x25}, - {0x8319, 0xf0}, - {0x831a, 0xfd}, - {0x831b, 0xe9}, - {0x831c, 0x8f}, - {0x831d, 0xf0}, - {0x831e, 0xa4}, - {0x831f, 0x2c}, - {0x8320, 0xcd}, - {0x8321, 0x35}, - {0x8322, 0xf0}, - {0x8323, 0xfc}, - {0x8324, 0xeb}, - {0x8325, 0x8e}, - {0x8326, 0xf0}, - {0x8327, 0xa4}, - {0x8328, 0xfe}, - {0x8329, 0xa9}, - {0x832a, 0xf0}, - {0x832b, 0xeb}, - {0x832c, 0x8f}, - {0x832d, 0xf0}, - {0x832e, 0xa4}, - {0x832f, 0xcf}, - {0x8330, 0xc5}, - {0x8331, 0xf0}, - {0x8332, 0x2e}, - {0x8333, 0xcd}, - {0x8334, 0x39}, - {0x8335, 0xfe}, - {0x8336, 0xe4}, - {0x8337, 0x3c}, - {0x8338, 0xfc}, - {0x8339, 0xea}, - {0x833a, 0xa4}, - {0x833b, 0x2d}, - {0x833c, 0xce}, - {0x833d, 0x35}, - {0x833e, 0xf0}, - {0x833f, 0xfd}, - {0x8340, 0xe4}, - {0x8341, 0x3c}, - {0x8342, 0xfc}, - {0x8343, 0x22}, - {0x8344, 0x75}, - {0x8345, 0xf0}, - {0x8346, 0x08}, - {0x8347, 0x75}, - {0x8348, 0x82}, - {0x8349, 0x00}, - {0x834a, 0xef}, - {0x834b, 0x2f}, - {0x834c, 0xff}, - {0x834d, 0xee}, - {0x834e, 0x33}, - {0x834f, 0xfe}, - {0x8350, 0xcd}, - {0x8351, 0x33}, - {0x8352, 0xcd}, - {0x8353, 0xcc}, - {0x8354, 0x33}, - {0x8355, 0xcc}, - {0x8356, 0xc5}, - {0x8357, 0x82}, - {0x8358, 0x33}, - {0x8359, 0xc5}, - {0x835a, 0x82}, - {0x835b, 0x9b}, - {0x835c, 0xed}, - {0x835d, 0x9a}, - {0x835e, 0xec}, - {0x835f, 0x99}, - {0x8360, 0xe5}, - {0x8361, 0x82}, - {0x8362, 0x98}, - {0x8363, 0x40}, - {0x8364, 0x0c}, - {0x8365, 0xf5}, - {0x8366, 0x82}, - {0x8367, 0xee}, - {0x8368, 0x9b}, - {0x8369, 0xfe}, - {0x836a, 0xed}, - {0x836b, 0x9a}, - {0x836c, 0xfd}, - {0x836d, 0xec}, - {0x836e, 0x99}, - {0x836f, 0xfc}, - {0x8370, 0x0f}, - {0x8371, 0xd5}, - {0x8372, 0xf0}, - {0x8373, 0xd6}, - {0x8374, 0xe4}, - {0x8375, 0xce}, - {0x8376, 0xfb}, - {0x8377, 0xe4}, - {0x8378, 0xcd}, - {0x8379, 0xfa}, - {0x837a, 0xe4}, - {0x837b, 0xcc}, - {0x837c, 0xf9}, - {0x837d, 0xa8}, - {0x837e, 0x82}, - {0x837f, 0x22}, - {0x8380, 0xb8}, - {0x8381, 0x00}, - {0x8382, 0xc1}, - {0x8383, 0xb9}, - {0x8384, 0x00}, - {0x8385, 0x59}, - {0x8386, 0xba}, - {0x8387, 0x00}, - {0x8388, 0x2d}, - {0x8389, 0xec}, - {0x838a, 0x8b}, - {0x838b, 0xf0}, - {0x838c, 0x84}, - {0x838d, 0xcf}, - {0x838e, 0xce}, - {0x838f, 0xcd}, - {0x8390, 0xfc}, - {0x8391, 0xe5}, - {0x8392, 0xf0}, - {0x8393, 0xcb}, - {0x8394, 0xf9}, - {0x8395, 0x78}, - {0x8396, 0x18}, - {0x8397, 0xef}, - {0x8398, 0x2f}, - {0x8399, 0xff}, - {0x839a, 0xee}, - {0x839b, 0x33}, - {0x839c, 0xfe}, - {0x839d, 0xed}, - {0x839e, 0x33}, - {0x839f, 0xfd}, - {0x83a0, 0xec}, - {0x83a1, 0x33}, - {0x83a2, 0xfc}, - {0x83a3, 0xeb}, - {0x83a4, 0x33}, - {0x83a5, 0xfb}, - {0x83a6, 0x10}, - {0x83a7, 0xd7}, - {0x83a8, 0x03}, - {0x83a9, 0x99}, - {0x83aa, 0x40}, - {0x83ab, 0x04}, - {0x83ac, 0xeb}, - {0x83ad, 0x99}, - {0x83ae, 0xfb}, - {0x83af, 0x0f}, - {0x83b0, 0xd8}, - {0x83b1, 0xe5}, - {0x83b2, 0xe4}, - {0x83b3, 0xf9}, - {0x83b4, 0xfa}, - {0x83b5, 0x22}, - {0x83b6, 0x78}, - {0x83b7, 0x18}, - {0x83b8, 0xef}, - {0x83b9, 0x2f}, - {0x83ba, 0xff}, - {0x83bb, 0xee}, - {0x83bc, 0x33}, - {0x83bd, 0xfe}, - {0x83be, 0xed}, - {0x83bf, 0x33}, - {0x83c0, 0xfd}, - {0x83c1, 0xec}, - {0x83c2, 0x33}, - {0x83c3, 0xfc}, - {0x83c4, 0xc9}, - {0x83c5, 0x33}, - {0x83c6, 0xc9}, - {0x83c7, 0x10}, - {0x83c8, 0xd7}, - {0x83c9, 0x05}, - {0x83ca, 0x9b}, - {0x83cb, 0xe9}, - {0x83cc, 0x9a}, - {0x83cd, 0x40}, - {0x83ce, 0x07}, - {0x83cf, 0xec}, - {0x83d0, 0x9b}, - {0x83d1, 0xfc}, - {0x83d2, 0xe9}, - {0x83d3, 0x9a}, - {0x83d4, 0xf9}, - {0x83d5, 0x0f}, - {0x83d6, 0xd8}, - {0x83d7, 0xe0}, - {0x83d8, 0xe4}, - {0x83d9, 0xc9}, - {0x83da, 0xfa}, - {0x83db, 0xe4}, - {0x83dc, 0xcc}, - {0x83dd, 0xfb}, - {0x83de, 0x22}, - {0x83df, 0x75}, - {0x83e0, 0xf0}, - {0x83e1, 0x10}, - {0x83e2, 0xef}, - {0x83e3, 0x2f}, - {0x83e4, 0xff}, - {0x83e5, 0xee}, - {0x83e6, 0x33}, - {0x83e7, 0xfe}, - {0x83e8, 0xed}, - {0x83e9, 0x33}, - {0x83ea, 0xfd}, - {0x83eb, 0xcc}, - {0x83ec, 0x33}, - {0x83ed, 0xcc}, - {0x83ee, 0xc8}, - {0x83ef, 0x33}, - {0x83f0, 0xc8}, - {0x83f1, 0x10}, - {0x83f2, 0xd7}, - {0x83f3, 0x07}, - {0x83f4, 0x9b}, - {0x83f5, 0xec}, - {0x83f6, 0x9a}, - {0x83f7, 0xe8}, - {0x83f8, 0x99}, - {0x83f9, 0x40}, - {0x83fa, 0x0a}, - {0x83fb, 0xed}, - {0x83fc, 0x9b}, - {0x83fd, 0xfd}, - {0x83fe, 0xec}, - {0x83ff, 0x9a}, - {0x8400, 0xfc}, - {0x8401, 0xe8}, - {0x8402, 0x99}, - {0x8403, 0xf8}, - {0x8404, 0x0f}, - {0x8405, 0xd5}, - {0x8406, 0xf0}, - {0x8407, 0xda}, - {0x8408, 0xe4}, - {0x8409, 0xcd}, - {0x840a, 0xfb}, - {0x840b, 0xe4}, - {0x840c, 0xcc}, - {0x840d, 0xfa}, - {0x840e, 0xe4}, - {0x840f, 0xc8}, - {0x8410, 0xf9}, - {0x8411, 0x22}, - {0x8412, 0xeb}, - {0x8413, 0x9f}, - {0x8414, 0xf5}, - {0x8415, 0xf0}, - {0x8416, 0xea}, - {0x8417, 0x9e}, - {0x8418, 0x42}, - {0x8419, 0xf0}, - {0x841a, 0xe9}, - {0x841b, 0x9d}, - {0x841c, 0x42}, - {0x841d, 0xf0}, - {0x841e, 0xe8}, - {0x841f, 0x9c}, - {0x8420, 0x45}, - {0x8421, 0xf0}, - {0x8422, 0x22}, - {0x8423, 0xe8}, - {0x8424, 0x60}, - {0x8425, 0x0f}, - {0x8426, 0xef}, - {0x8427, 0xc3}, - {0x8428, 0x33}, - {0x8429, 0xff}, - {0x842a, 0xee}, - {0x842b, 0x33}, - {0x842c, 0xfe}, - {0x842d, 0xed}, - {0x842e, 0x33}, - {0x842f, 0xfd}, - {0x8430, 0xec}, - {0x8431, 0x33}, - {0x8432, 0xfc}, - {0x8433, 0xd8}, - {0x8434, 0xf1}, - {0x8435, 0x22}, - {0x8436, 0xe4}, - {0x8437, 0x93}, - {0x8438, 0xfc}, - {0x8439, 0x74}, - {0x843a, 0x01}, - {0x843b, 0x93}, - {0x843c, 0xfd}, - {0x843d, 0x74}, - {0x843e, 0x02}, - {0x843f, 0x93}, - {0x8440, 0xfe}, - {0x8441, 0x74}, - {0x8442, 0x03}, - {0x8443, 0x93}, - {0x8444, 0xff}, - {0x8445, 0x22}, - {0x8446, 0xe6}, - {0x8447, 0xfb}, - {0x8448, 0x08}, - {0x8449, 0xe6}, - {0x844a, 0xf9}, - {0x844b, 0x08}, - {0x844c, 0xe6}, - {0x844d, 0xfa}, - {0x844e, 0x08}, - {0x844f, 0xe6}, - {0x8450, 0xcb}, - {0x8451, 0xf8}, - {0x8452, 0x22}, - {0x8453, 0xec}, - {0x8454, 0xf6}, - {0x8455, 0x08}, - {0x8456, 0xed}, - {0x8457, 0xf6}, - {0x8458, 0x08}, - {0x8459, 0xee}, - {0x845a, 0xf6}, - {0x845b, 0x08}, - {0x845c, 0xef}, - {0x845d, 0xf6}, - {0x845e, 0x22}, - {0x845f, 0xa4}, - {0x8460, 0x25}, - {0x8461, 0x82}, - {0x8462, 0xf5}, - {0x8463, 0x82}, - {0x8464, 0xe5}, - {0x8465, 0xf0}, - {0x8466, 0x35}, - {0x8467, 0x83}, - {0x8468, 0xf5}, - {0x8469, 0x83}, - {0x846a, 0x22}, - {0x846b, 0xd0}, - {0x846c, 0x83}, - {0x846d, 0xd0}, - {0x846e, 0x82}, - {0x846f, 0xf8}, - {0x8470, 0xe4}, - {0x8471, 0x93}, - {0x8472, 0x70}, - {0x8473, 0x12}, - {0x8474, 0x74}, - {0x8475, 0x01}, - {0x8476, 0x93}, - {0x8477, 0x70}, - {0x8478, 0x0d}, - {0x8479, 0xa3}, - {0x847a, 0xa3}, - {0x847b, 0x93}, - {0x847c, 0xf8}, - {0x847d, 0x74}, - {0x847e, 0x01}, - {0x847f, 0x93}, - {0x8480, 0xf5}, - {0x8481, 0x82}, - {0x8482, 0x88}, - {0x8483, 0x83}, - {0x8484, 0xe4}, - {0x8485, 0x73}, - {0x8486, 0x74}, - {0x8487, 0x02}, - {0x8488, 0x93}, - {0x8489, 0x68}, - {0x848a, 0x60}, - {0x848b, 0xef}, - {0x848c, 0xa3}, - {0x848d, 0xa3}, - {0x848e, 0xa3}, - {0x848f, 0x80}, - {0x8490, 0xdf}, - {0x8491, 0x90}, - {0x8492, 0x38}, - {0x8493, 0x04}, - {0x8494, 0x78}, - {0x8495, 0x4f}, - {0x8496, 0x12}, - {0x8497, 0x09}, - {0x8498, 0x44}, - {0x8499, 0x90}, - {0x849a, 0x38}, - {0x849b, 0x00}, - {0x849c, 0xe0}, - {0x849d, 0xfe}, - {0x849e, 0xa3}, - {0x849f, 0xe0}, - {0x84a0, 0xfd}, - {0x84a1, 0xed}, - {0x84a2, 0xff}, - {0x84a3, 0xc3}, - {0x84a4, 0x12}, - {0x84a5, 0x08}, - {0x84a6, 0xfd}, - {0x84a7, 0x90}, - {0x84a8, 0x38}, - {0x84a9, 0x10}, - {0x84aa, 0x12}, - {0x84ab, 0x08}, - {0x84ac, 0xf1}, - {0x84ad, 0x90}, - {0x84ae, 0x38}, - {0x84af, 0x06}, - {0x84b0, 0x78}, - {0x84b1, 0x51}, - {0x84b2, 0x12}, - {0x84b3, 0x09}, - {0x84b4, 0x44}, - {0x84b5, 0x90}, - {0x84b6, 0x38}, - {0x84b7, 0x02}, - {0x84b8, 0xe0}, - {0x84b9, 0xfe}, - {0x84ba, 0xa3}, - {0x84bb, 0xe0}, - {0x84bc, 0xfd}, - {0x84bd, 0xed}, - {0x84be, 0xff}, - {0x84bf, 0xc3}, - {0x84c0, 0x12}, - {0x84c1, 0x08}, - {0x84c2, 0xfd}, - {0x84c3, 0x90}, - {0x84c4, 0x38}, - {0x84c5, 0x12}, - {0x84c6, 0x12}, - {0x84c7, 0x08}, - {0x84c8, 0xf1}, - {0x84c9, 0xa3}, - {0x84ca, 0xe0}, - {0x84cb, 0xb4}, - {0x84cc, 0x31}, - {0x84cd, 0x07}, - {0x84ce, 0x78}, - {0x84cf, 0x4f}, - {0x84d0, 0x79}, - {0x84d1, 0x4f}, - {0x84d2, 0x12}, - {0x84d3, 0x09}, - {0x84d4, 0x5a}, - {0x84d5, 0x90}, - {0x84d6, 0x38}, - {0x84d7, 0x14}, - {0x84d8, 0xe0}, - {0x84d9, 0xb4}, - {0x84da, 0x71}, - {0x84db, 0x15}, - {0x84dc, 0x78}, - {0x84dd, 0x4f}, - {0x84de, 0xe6}, - {0x84df, 0xfe}, - {0x84e0, 0x08}, - {0x84e1, 0xe6}, - {0x84e2, 0x78}, - {0x84e3, 0x02}, - {0x84e4, 0xce}, - {0x84e5, 0xc3}, - {0x84e6, 0x13}, - {0x84e7, 0xce}, - {0x84e8, 0x13}, - {0x84e9, 0xd8}, - {0x84ea, 0xf9}, - {0x84eb, 0x79}, - {0x84ec, 0x50}, - {0x84ed, 0xf7}, - {0x84ee, 0xee}, - {0x84ef, 0x19}, - {0x84f0, 0xf7}, - {0x84f1, 0x90}, - {0x84f2, 0x38}, - {0x84f3, 0x15}, - {0x84f4, 0xe0}, - {0x84f5, 0xb4}, - {0x84f6, 0x31}, - {0x84f7, 0x07}, - {0x84f8, 0x78}, - {0x84f9, 0x51}, - {0x84fa, 0x79}, - {0x84fb, 0x51}, - {0x84fc, 0x12}, - {0x84fd, 0x09}, - {0x84fe, 0x5a}, - {0x84ff, 0x90}, - {0x8500, 0x38}, - {0x8501, 0x15}, - {0x8502, 0xe0}, - {0x8503, 0xb4}, - {0x8504, 0x71}, - {0x8505, 0x15}, - {0x8506, 0x78}, - {0x8507, 0x51}, - {0x8508, 0xe6}, - {0x8509, 0xfe}, - {0x850a, 0x08}, - {0x850b, 0xe6}, - {0x850c, 0x78}, - {0x850d, 0x02}, - {0x850e, 0xce}, - {0x850f, 0xc3}, - {0x8510, 0x13}, - {0x8511, 0xce}, - {0x8512, 0x13}, - {0x8513, 0xd8}, - {0x8514, 0xf9}, - {0x8515, 0x79}, - {0x8516, 0x52}, - {0x8517, 0xf7}, - {0x8518, 0xee}, - {0x8519, 0x19}, - {0x851a, 0xf7}, - {0x851b, 0x79}, - {0x851c, 0x4f}, - {0x851d, 0x12}, - {0x851e, 0x09}, - {0x851f, 0x2c}, - {0x8520, 0x09}, - {0x8521, 0x12}, - {0x8522, 0x09}, - {0x8523, 0x2c}, - {0x8524, 0xaf}, - {0x8525, 0x45}, - {0x8526, 0x12}, - {0x8527, 0x08}, - {0x8528, 0xe2}, - {0x8529, 0x7d}, - {0x852a, 0x50}, - {0x852b, 0x12}, - {0x852c, 0x02}, - {0x852d, 0xa0}, - {0x852e, 0x78}, - {0x852f, 0x57}, - {0x8530, 0xa6}, - {0x8531, 0x06}, - {0x8532, 0x08}, - {0x8533, 0xa6}, - {0x8534, 0x07}, - {0x8535, 0xaf}, - {0x8536, 0x43}, - {0x8537, 0x12}, - {0x8538, 0x08}, - {0x8539, 0xe2}, - {0x853a, 0x7d}, - {0x853b, 0x50}, - {0x853c, 0x12}, - {0x853d, 0x02}, - {0x853e, 0xa0}, - {0x853f, 0x78}, - {0x8540, 0x53}, - {0x8541, 0xa6}, - {0x8542, 0x06}, - {0x8543, 0x08}, - {0x8544, 0xa6}, - {0x8545, 0x07}, - {0x8546, 0xaf}, - {0x8547, 0x46}, - {0x8548, 0x78}, - {0x8549, 0x51}, - {0x854a, 0x12}, - {0x854b, 0x08}, - {0x854c, 0xe4}, - {0x854d, 0x7d}, - {0x854e, 0x3c}, - {0x854f, 0x12}, - {0x8550, 0x02}, - {0x8551, 0xa0}, - {0x8552, 0x78}, - {0x8553, 0x59}, - {0x8554, 0xa6}, - {0x8555, 0x06}, - {0x8556, 0x08}, - {0x8557, 0xa6}, - {0x8558, 0x07}, - {0x8559, 0xaf}, - {0x855a, 0x44}, - {0x855b, 0x7e}, - {0x855c, 0x00}, - {0x855d, 0x78}, - {0x855e, 0x51}, - {0x855f, 0x12}, - {0x8560, 0x08}, - {0x8561, 0xe6}, - {0x8562, 0x7d}, - {0x8563, 0x3c}, - {0x8564, 0x12}, - {0x8565, 0x02}, - {0x8566, 0xa0}, - {0x8567, 0x78}, - {0x8568, 0x55}, - {0x8569, 0xa6}, - {0x856a, 0x06}, - {0x856b, 0x08}, - {0x856c, 0xa6}, - {0x856d, 0x07}, - {0x856e, 0xc3}, - {0x856f, 0x78}, - {0x8570, 0x58}, - {0x8571, 0xe6}, - {0x8572, 0x94}, - {0x8573, 0x08}, - {0x8574, 0x18}, - {0x8575, 0xe6}, - {0x8576, 0x94}, - {0x8577, 0x00}, - {0x8578, 0x50}, - {0x8579, 0x05}, - {0x857a, 0x76}, - {0x857b, 0x00}, - {0x857c, 0x08}, - {0x857d, 0x76}, - {0x857e, 0x08}, - {0x857f, 0xc3}, - {0x8580, 0x78}, - {0x8581, 0x5a}, - {0x8582, 0xe6}, - {0x8583, 0x94}, - {0x8584, 0x08}, - {0x8585, 0x18}, - {0x8586, 0xe6}, - {0x8587, 0x94}, - {0x8588, 0x00}, - {0x8589, 0x50}, - {0x858a, 0x05}, - {0x858b, 0x76}, - {0x858c, 0x00}, - {0x858d, 0x08}, - {0x858e, 0x76}, - {0x858f, 0x08}, - {0x8590, 0x78}, - {0x8591, 0x57}, - {0x8592, 0x12}, - {0x8593, 0x09}, - {0x8594, 0x19}, - {0x8595, 0xff}, - {0x8596, 0xd3}, - {0x8597, 0x78}, - {0x8598, 0x54}, - {0x8599, 0xe6}, - {0x859a, 0x9f}, - {0x859b, 0x18}, - {0x859c, 0xe6}, - {0x859d, 0x9e}, - {0x859e, 0x40}, - {0x859f, 0x0e}, - {0x85a0, 0x78}, - {0x85a1, 0x57}, - {0x85a2, 0xe6}, - {0x85a3, 0x13}, - {0x85a4, 0xfe}, - {0x85a5, 0x08}, - {0x85a6, 0xe6}, - {0x85a7, 0x78}, - {0x85a8, 0x54}, - {0x85a9, 0x12}, - {0x85aa, 0x09}, - {0x85ab, 0x4f}, - {0x85ac, 0x80}, - {0x85ad, 0x04}, - {0x85ae, 0x7e}, - {0x85af, 0x00}, - {0x85b0, 0x7f}, - {0x85b1, 0x00}, - {0x85b2, 0x78}, - {0x85b3, 0x5b}, - {0x85b4, 0x12}, - {0x85b5, 0x09}, - {0x85b6, 0x11}, - {0x85b7, 0xff}, - {0x85b8, 0xd3}, - {0x85b9, 0x78}, - {0x85ba, 0x56}, - {0x85bb, 0xe6}, - {0x85bc, 0x9f}, - {0x85bd, 0x18}, - {0x85be, 0xe6}, - {0x85bf, 0x9e}, - {0x85c0, 0x40}, - {0x85c1, 0x0e}, - {0x85c2, 0x78}, - {0x85c3, 0x59}, - {0x85c4, 0xe6}, - {0x85c5, 0x13}, - {0x85c6, 0xfe}, - {0x85c7, 0x08}, - {0x85c8, 0xe6}, - {0x85c9, 0x78}, - {0x85ca, 0x56}, - {0x85cb, 0x12}, - {0x85cc, 0x09}, - {0x85cd, 0x4f}, - {0x85ce, 0x80}, - {0x85cf, 0x04}, - {0x85d0, 0x7e}, - {0x85d1, 0x00}, - {0x85d2, 0x7f}, - {0x85d3, 0x00}, - {0x85d4, 0xe4}, - {0x85d5, 0xfc}, - {0x85d6, 0xfd}, - {0x85d7, 0x78}, - {0x85d8, 0x5f}, - {0x85d9, 0x12}, - {0x85da, 0x04}, - {0x85db, 0x53}, - {0x85dc, 0x78}, - {0x85dd, 0x57}, - {0x85de, 0x12}, - {0x85df, 0x09}, - {0x85e0, 0x19}, - {0x85e1, 0x78}, - {0x85e2, 0x54}, - {0x85e3, 0x26}, - {0x85e4, 0xff}, - {0x85e5, 0xee}, - {0x85e6, 0x18}, - {0x85e7, 0x36}, - {0x85e8, 0xfe}, - {0x85e9, 0x78}, - {0x85ea, 0x63}, - {0x85eb, 0x12}, - {0x85ec, 0x09}, - {0x85ed, 0x11}, - {0x85ee, 0x78}, - {0x85ef, 0x56}, - {0x85f0, 0x26}, - {0x85f1, 0xff}, - {0x85f2, 0xee}, - {0x85f3, 0x18}, - {0x85f4, 0x36}, - {0x85f5, 0xfe}, - {0x85f6, 0xe4}, - {0x85f7, 0xfc}, - {0x85f8, 0xfd}, - {0x85f9, 0x78}, - {0x85fa, 0x67}, - {0x85fb, 0x12}, - {0x85fc, 0x04}, - {0x85fd, 0x53}, - {0x85fe, 0x12}, - {0x85ff, 0x09}, - {0x8600, 0x21}, - {0x8601, 0x78}, - {0x8602, 0x63}, - {0x8603, 0x12}, - {0x8604, 0x04}, - {0x8605, 0x46}, - {0x8606, 0xd3}, - {0x8607, 0x12}, - {0x8608, 0x04}, - {0x8609, 0x12}, - {0x860a, 0x40}, - {0x860b, 0x08}, - {0x860c, 0x12}, - {0x860d, 0x09}, - {0x860e, 0x21}, - {0x860f, 0x78}, - {0x8610, 0x63}, - {0x8611, 0x12}, - {0x8612, 0x04}, - {0x8613, 0x53}, - {0x8614, 0x78}, - {0x8615, 0x51}, - {0x8616, 0x12}, - {0x8617, 0x09}, - {0x8618, 0x23}, - {0x8619, 0x78}, - {0x861a, 0x67}, - {0x861b, 0x12}, - {0x861c, 0x04}, - {0x861d, 0x46}, - {0x861e, 0xd3}, - {0x861f, 0x12}, - {0x8620, 0x04}, - {0x8621, 0x12}, - {0x8622, 0x40}, - {0x8623, 0x0a}, - {0x8624, 0x78}, - {0x8625, 0x51}, - {0x8626, 0x12}, - {0x8627, 0x09}, - {0x8628, 0x23}, - {0x8629, 0x78}, - {0x862a, 0x67}, - {0x862b, 0x12}, - {0x862c, 0x04}, - {0x862d, 0x53}, - {0x862e, 0xe4}, - {0x862f, 0xfd}, - {0x8630, 0x78}, - {0x8631, 0x5e}, - {0x8632, 0x12}, - {0x8633, 0x09}, - {0x8634, 0x3c}, - {0x8635, 0x24}, - {0x8636, 0x01}, - {0x8637, 0x12}, - {0x8638, 0x09}, - {0x8639, 0x05}, - {0x863a, 0x78}, - {0x863b, 0x62}, - {0x863c, 0x12}, - {0x863d, 0x09}, - {0x863e, 0x3c}, - {0x863f, 0x24}, - {0x8640, 0x02}, - {0x8641, 0x12}, - {0x8642, 0x09}, - {0x8643, 0x05}, - {0x8644, 0x78}, - {0x8645, 0x66}, - {0x8646, 0x12}, - {0x8647, 0x09}, - {0x8648, 0x3c}, - {0x8649, 0x24}, - {0x864a, 0x03}, - {0x864b, 0x12}, - {0x864c, 0x09}, - {0x864d, 0x05}, - {0x864e, 0x78}, - {0x864f, 0x6a}, - {0x8650, 0x12}, - {0x8651, 0x09}, - {0x8652, 0x3c}, - {0x8653, 0x24}, - {0x8654, 0x04}, - {0x8655, 0x12}, - {0x8656, 0x09}, - {0x8657, 0x05}, - {0x8658, 0x0d}, - {0x8659, 0xbd}, - {0x865a, 0x05}, - {0x865b, 0xd4}, - {0x865c, 0xc2}, - {0x865d, 0x0e}, - {0x865e, 0xc2}, - {0x865f, 0x06}, - {0x8660, 0x22}, - {0x8661, 0x85}, - {0x8662, 0x08}, - {0x8663, 0x41}, - {0x8664, 0x90}, - {0x8665, 0x30}, - {0x8666, 0x24}, - {0x8667, 0xe0}, - {0x8668, 0xf5}, - {0x8669, 0x3d}, - {0x866a, 0xa3}, - {0x866b, 0xe0}, - {0x866c, 0xf5}, - {0x866d, 0x3e}, - {0x866e, 0xa3}, - {0x866f, 0xe0}, - {0x8670, 0xf5}, - {0x8671, 0x3f}, - {0x8672, 0xa3}, - {0x8673, 0xe0}, - {0x8674, 0xf5}, - {0x8675, 0x40}, - {0x8676, 0xa3}, - {0x8677, 0xe0}, - {0x8678, 0xf5}, - {0x8679, 0x3c}, - {0x867a, 0xd2}, - {0x867b, 0x33}, - {0x867c, 0xe5}, - {0x867d, 0x41}, - {0x867e, 0x12}, - {0x867f, 0x04}, - {0x8680, 0x6b}, - {0x8681, 0x06}, - {0x8682, 0xbe}, - {0x8683, 0x03}, - {0x8684, 0x06}, - {0x8685, 0xc2}, - {0x8686, 0x04}, - {0x8687, 0x06}, - {0x8688, 0xc8}, - {0x8689, 0x07}, - {0x868a, 0x06}, - {0x868b, 0xd1}, - {0x868c, 0x08}, - {0x868d, 0x06}, - {0x868e, 0xe2}, - {0x868f, 0x12}, - {0x8690, 0x06}, - {0x8691, 0xfd}, - {0x8692, 0x18}, - {0x8693, 0x07}, - {0x8694, 0x13}, - {0x8695, 0x19}, - {0x8696, 0x06}, - {0x8697, 0xe8}, - {0x8698, 0x1a}, - {0x8699, 0x06}, - {0x869a, 0xf4}, - {0x869b, 0x1b}, - {0x869c, 0x07}, - {0x869d, 0x37}, - {0x869e, 0x80}, - {0x869f, 0x07}, - {0x86a0, 0x3a}, - {0x86a1, 0x81}, - {0x86a2, 0x07}, - {0x86a3, 0x95}, - {0x86a4, 0x8f}, - {0x86a5, 0x07}, - {0x86a6, 0x84}, - {0x86a7, 0x90}, - {0x86a8, 0x07}, - {0x86a9, 0x95}, - {0x86aa, 0x91}, - {0x86ab, 0x07}, - {0x86ac, 0x95}, - {0x86ad, 0x92}, - {0x86ae, 0x07}, - {0x86af, 0x95}, - {0x86b0, 0x93}, - {0x86b1, 0x07}, - {0x86b2, 0x95}, - {0x86b3, 0x94}, - {0x86b4, 0x07}, - {0x86b5, 0x95}, - {0x86b6, 0x98}, - {0x86b7, 0x07}, - {0x86b8, 0x92}, - {0x86b9, 0x9f}, - {0x86ba, 0x00}, - {0x86bb, 0x00}, - {0x86bc, 0x07}, - {0x86bd, 0xb0}, - {0x86be, 0x12}, - {0x86bf, 0x0a}, - {0x86c0, 0xe8}, - {0x86c1, 0x22}, - {0x86c2, 0x12}, - {0x86c3, 0x0a}, - {0x86c4, 0xe8}, - {0x86c5, 0xd2}, - {0x86c6, 0x03}, - {0x86c7, 0x22}, - {0x86c8, 0xa2}, - {0x86c9, 0x36}, - {0x86ca, 0xe4}, - {0x86cb, 0x33}, - {0x86cc, 0xf5}, - {0x86cd, 0x3c}, - {0x86ce, 0x02}, - {0x86cf, 0x07}, - {0x86d0, 0x95}, - {0x86d1, 0xc2}, - {0x86d2, 0x01}, - {0x86d3, 0xc2}, - {0x86d4, 0x02}, - {0x86d5, 0xc2}, - {0x86d6, 0x03}, - {0x86d7, 0x12}, - {0x86d8, 0x09}, - {0x86d9, 0x64}, - {0x86da, 0x75}, - {0x86db, 0x1e}, - {0x86dc, 0x70}, - {0x86dd, 0xd2}, - {0x86de, 0x34}, - {0x86df, 0x02}, - {0x86e0, 0x07}, - {0x86e1, 0x95}, - {0x86e2, 0x12}, - {0x86e3, 0x04}, - {0x86e4, 0x91}, - {0x86e5, 0x02}, - {0x86e6, 0x07}, - {0x86e7, 0x95}, - {0x86e8, 0x85}, - {0x86e9, 0x40}, - {0x86ea, 0x48}, - {0x86eb, 0x85}, - {0x86ec, 0x3c}, - {0x86ed, 0x49}, - {0x86ee, 0x12}, - {0x86ef, 0x08}, - {0x86f0, 0x4f}, - {0x86f1, 0x02}, - {0x86f2, 0x07}, - {0x86f3, 0x95}, - {0x86f4, 0x85}, - {0x86f5, 0x48}, - {0x86f6, 0x40}, - {0x86f7, 0x85}, - {0x86f8, 0x49}, - {0x86f9, 0x3c}, - {0x86fa, 0x02}, - {0x86fb, 0x07}, - {0x86fc, 0x95}, - {0x86fd, 0xe4}, - {0x86fe, 0xf5}, - {0x86ff, 0x22}, - {0x8700, 0xf5}, - {0x8701, 0x23}, - {0x8702, 0x85}, - {0x8703, 0x40}, - {0x8704, 0x31}, - {0x8705, 0x85}, - {0x8706, 0x3f}, - {0x8707, 0x30}, - {0x8708, 0x85}, - {0x8709, 0x3e}, - {0x870a, 0x2f}, - {0x870b, 0x85}, - {0x870c, 0x3d}, - {0x870d, 0x2e}, - {0x870e, 0x12}, - {0x870f, 0x0a}, - {0x8710, 0xba}, - {0x8711, 0x80}, - {0x8712, 0x1f}, - {0x8713, 0x75}, - {0x8714, 0x22}, - {0x8715, 0x00}, - {0x8716, 0x75}, - {0x8717, 0x23}, - {0x8718, 0x01}, - {0x8719, 0x74}, - {0x871a, 0xff}, - {0x871b, 0xf5}, - {0x871c, 0x2d}, - {0x871d, 0xf5}, - {0x871e, 0x2c}, - {0x871f, 0xf5}, - {0x8720, 0x2b}, - {0x8721, 0xf5}, - {0x8722, 0x2a}, - {0x8723, 0x12}, - {0x8724, 0x0a}, - {0x8725, 0xba}, - {0x8726, 0x85}, - {0x8727, 0x2d}, - {0x8728, 0x40}, - {0x8729, 0x85}, - {0x872a, 0x2c}, - {0x872b, 0x3f}, - {0x872c, 0x85}, - {0x872d, 0x2b}, - {0x872e, 0x3e}, - {0x872f, 0x85}, - {0x8730, 0x2a}, - {0x8731, 0x3d}, - {0x8732, 0xe4}, - {0x8733, 0xf5}, - {0x8734, 0x3c}, - {0x8735, 0x80}, - {0x8736, 0x5e}, - {0x8737, 0x02}, - {0x8738, 0x0b}, - {0x8739, 0x31}, - {0x873a, 0x85}, - {0x873b, 0x3d}, - {0x873c, 0x43}, - {0x873d, 0x85}, - {0x873e, 0x3e}, - {0x873f, 0x44}, - {0x8740, 0xe5}, - {0x8741, 0x45}, - {0x8742, 0xc3}, - {0x8743, 0x13}, - {0x8744, 0xff}, - {0x8745, 0xe5}, - {0x8746, 0x43}, - {0x8747, 0xc3}, - {0x8748, 0x9f}, - {0x8749, 0x50}, - {0x874a, 0x02}, - {0x874b, 0x8f}, - {0x874c, 0x43}, - {0x874d, 0xe5}, - {0x874e, 0x46}, - {0x874f, 0xc3}, - {0x8750, 0x13}, - {0x8751, 0xff}, - {0x8752, 0xe5}, - {0x8753, 0x44}, - {0x8754, 0xc3}, - {0x8755, 0x9f}, - {0x8756, 0x50}, - {0x8757, 0x02}, - {0x8758, 0x8f}, - {0x8759, 0x44}, - {0x875a, 0xe5}, - {0x875b, 0x45}, - {0x875c, 0xc3}, - {0x875d, 0x13}, - {0x875e, 0xff}, - {0x875f, 0xfd}, - {0x8760, 0xe5}, - {0x8761, 0x43}, - {0x8762, 0x90}, - {0x8763, 0x0e}, - {0x8764, 0x7f}, - {0x8765, 0x12}, - {0x8766, 0x0b}, - {0x8767, 0x04}, - {0x8768, 0x40}, - {0x8769, 0x04}, - {0x876a, 0xee}, - {0x876b, 0x9f}, - {0x876c, 0xf5}, - {0x876d, 0x43}, - {0x876e, 0xe5}, - {0x876f, 0x46}, - {0x8770, 0xc3}, - {0x8771, 0x13}, - {0x8772, 0xff}, - {0x8773, 0xfd}, - {0x8774, 0xe5}, - {0x8775, 0x44}, - {0x8776, 0x90}, - {0x8777, 0x0e}, - {0x8778, 0x80}, - {0x8779, 0x12}, - {0x877a, 0x0b}, - {0x877b, 0x04}, - {0x877c, 0x40}, - {0x877d, 0x14}, - {0x877e, 0xee}, - {0x877f, 0x9f}, - {0x8780, 0xf5}, - {0x8781, 0x44}, - {0x8782, 0x80}, - {0x8783, 0x0e}, - {0x8784, 0x85}, - {0x8785, 0x40}, - {0x8786, 0x46}, - {0x8787, 0x85}, - {0x8788, 0x3f}, - {0x8789, 0x45}, - {0x878a, 0x85}, - {0x878b, 0x3e}, - {0x878c, 0x44}, - {0x878d, 0x85}, - {0x878e, 0x3d}, - {0x878f, 0x43}, - {0x8790, 0x80}, - {0x8791, 0x03}, - {0x8792, 0x02}, - {0x8793, 0x04}, - {0x8794, 0x91}, - {0x8795, 0x90}, - {0x8796, 0x30}, - {0x8797, 0x24}, - {0x8798, 0xe5}, - {0x8799, 0x3d}, - {0x879a, 0xf0}, - {0x879b, 0xa3}, - {0x879c, 0xe5}, - {0x879d, 0x3e}, - {0x879e, 0xf0}, - {0x879f, 0xa3}, - {0x87a0, 0xe5}, - {0x87a1, 0x3f}, - {0x87a2, 0xf0}, - {0x87a3, 0xa3}, - {0x87a4, 0xe5}, - {0x87a5, 0x40}, - {0x87a6, 0xf0}, - {0x87a7, 0xa3}, - {0x87a8, 0xe5}, - {0x87a9, 0x3c}, - {0x87aa, 0xf0}, - {0x87ab, 0x90}, - {0x87ac, 0x30}, - {0x87ad, 0x23}, - {0x87ae, 0xe4}, - {0x87af, 0xf0}, - {0x87b0, 0x22}, - {0x87b1, 0xc0}, - {0x87b2, 0xe0}, - {0x87b3, 0xc0}, - {0x87b4, 0x83}, - {0x87b5, 0xc0}, - {0x87b6, 0x82}, - {0x87b7, 0xc0}, - {0x87b8, 0xd0}, - {0x87b9, 0x90}, - {0x87ba, 0x3f}, - {0x87bb, 0x0c}, - {0x87bc, 0xe0}, - {0x87bd, 0xf5}, - {0x87be, 0x32}, - {0x87bf, 0xe5}, - {0x87c0, 0x32}, - {0x87c1, 0x30}, - {0x87c2, 0xe3}, - {0x87c3, 0x4c}, - {0x87c4, 0x30}, - {0x87c5, 0x35}, - {0x87c6, 0x3e}, - {0x87c7, 0x90}, - {0x87c8, 0x60}, - {0x87c9, 0x19}, - {0x87ca, 0xe0}, - {0x87cb, 0xf5}, - {0x87cc, 0x0a}, - {0x87cd, 0xa3}, - {0x87ce, 0xe0}, - {0x87cf, 0xf5}, - {0x87d0, 0x0b}, - {0x87d1, 0x90}, - {0x87d2, 0x60}, - {0x87d3, 0x1d}, - {0x87d4, 0xe0}, - {0x87d5, 0xf5}, - {0x87d6, 0x14}, - {0x87d7, 0xa3}, - {0x87d8, 0xe0}, - {0x87d9, 0xf5}, - {0x87da, 0x15}, - {0x87db, 0x30}, - {0x87dc, 0x01}, - {0x87dd, 0x06}, - {0x87de, 0x30}, - {0x87df, 0x32}, - {0x87e0, 0x03}, - {0x87e1, 0xd3}, - {0x87e2, 0x80}, - {0x87e3, 0x01}, - {0x87e4, 0xc3}, - {0x87e5, 0x92}, - {0x87e6, 0x09}, - {0x87e7, 0x30}, - {0x87e8, 0x02}, - {0x87e9, 0x06}, - {0x87ea, 0x30}, - {0x87eb, 0x32}, - {0x87ec, 0x03}, - {0x87ed, 0xd3}, - {0x87ee, 0x80}, - {0x87ef, 0x01}, - {0x87f0, 0xc3}, - {0x87f1, 0x92}, - {0x87f2, 0x0a}, - {0x87f3, 0x30}, - {0x87f4, 0x32}, - {0x87f5, 0x0c}, - {0x87f6, 0x30}, - {0x87f7, 0x03}, - {0x87f8, 0x09}, - {0x87f9, 0x20}, - {0x87fa, 0x02}, - {0x87fb, 0x06}, - {0x87fc, 0x20}, - {0x87fd, 0x01}, - {0x87fe, 0x03}, - {0x87ff, 0xd3}, - {0x8800, 0x80}, - {0x8801, 0x01}, - {0x8802, 0xc3}, - {0x8803, 0x92}, - {0x8804, 0x0b}, - {0x8805, 0x90}, - {0x8806, 0x30}, - {0x8807, 0x01}, - {0x8808, 0xe0}, - {0x8809, 0x44}, - {0x880a, 0x40}, - {0x880b, 0xf0}, - {0x880c, 0xe0}, - {0x880d, 0x54}, - {0x880e, 0xbf}, - {0x880f, 0xf0}, - {0x8810, 0xe5}, - {0x8811, 0x32}, - {0x8812, 0x30}, - {0x8813, 0xe1}, - {0x8814, 0x14}, - {0x8815, 0x30}, - {0x8816, 0x33}, - {0x8817, 0x11}, - {0x8818, 0x90}, - {0x8819, 0x30}, - {0x881a, 0x22}, - {0x881b, 0xe0}, - {0x881c, 0xf5}, - {0x881d, 0x08}, - {0x881e, 0xe4}, - {0x881f, 0xf0}, - {0x8820, 0x30}, - {0x8821, 0x00}, - {0x8822, 0x03}, - {0x8823, 0xd3}, - {0x8824, 0x80}, - {0x8825, 0x01}, - {0x8826, 0xc3}, - {0x8827, 0x92}, - {0x8828, 0x08}, - {0x8829, 0xe5}, - {0x882a, 0x32}, - {0x882b, 0x30}, - {0x882c, 0xe5}, - {0x882d, 0x12}, - {0x882e, 0x90}, - {0x882f, 0x56}, - {0x8830, 0x90}, - {0x8831, 0xe0}, - {0x8832, 0xf5}, - {0x8833, 0x09}, - {0x8834, 0x30}, - {0x8835, 0x30}, - {0x8836, 0x09}, - {0x8837, 0x30}, - {0x8838, 0x05}, - {0x8839, 0x03}, - {0x883a, 0xd3}, - {0x883b, 0x80}, - {0x883c, 0x01}, - {0x883d, 0xc3}, - {0x883e, 0x92}, - {0x883f, 0x0d}, - {0x8840, 0x90}, - {0x8841, 0x3f}, - {0x8842, 0x0c}, - {0x8843, 0xe5}, - {0x8844, 0x32}, - {0x8845, 0xf0}, - {0x8846, 0xd0}, - {0x8847, 0xd0}, - {0x8848, 0xd0}, - {0x8849, 0x82}, - {0x884a, 0xd0}, - {0x884b, 0x83}, - {0x884c, 0xd0}, - {0x884d, 0xe0}, - {0x884e, 0x32}, - {0x884f, 0x90}, - {0x8850, 0x0e}, - {0x8851, 0x7d}, - {0x8852, 0xe4}, - {0x8853, 0x93}, - {0x8854, 0xfe}, - {0x8855, 0x74}, - {0x8856, 0x01}, - {0x8857, 0x93}, - {0x8858, 0xff}, - {0x8859, 0xc3}, - {0x885a, 0x90}, - {0x885b, 0x0e}, - {0x885c, 0x7b}, - {0x885d, 0x74}, - {0x885e, 0x01}, - {0x885f, 0x93}, - {0x8860, 0x9f}, - {0x8861, 0xff}, - {0x8862, 0xe4}, - {0x8863, 0x93}, - {0x8864, 0x9e}, - {0x8865, 0xfe}, - {0x8866, 0xe4}, - {0x8867, 0x8f}, - {0x8868, 0x3b}, - {0x8869, 0x8e}, - {0x886a, 0x3a}, - {0x886b, 0xf5}, - {0x886c, 0x39}, - {0x886d, 0xf5}, - {0x886e, 0x38}, - {0x886f, 0xab}, - {0x8870, 0x3b}, - {0x8871, 0xaa}, - {0x8872, 0x3a}, - {0x8873, 0xa9}, - {0x8874, 0x39}, - {0x8875, 0xa8}, - {0x8876, 0x38}, - {0x8877, 0xaf}, - {0x8878, 0x49}, - {0x8879, 0xfc}, - {0x887a, 0xfd}, - {0x887b, 0xfe}, - {0x887c, 0x12}, - {0x887d, 0x02}, - {0x887e, 0xf5}, - {0x887f, 0x12}, - {0x8880, 0x0b}, - {0x8881, 0x16}, - {0x8882, 0xe4}, - {0x8883, 0x7b}, - {0x8884, 0xff}, - {0x8885, 0xfa}, - {0x8886, 0xf9}, - {0x8887, 0xf8}, - {0x8888, 0x12}, - {0x8889, 0x03}, - {0x888a, 0x80}, - {0x888b, 0x12}, - {0x888c, 0x0b}, - {0x888d, 0x16}, - {0x888e, 0x90}, - {0x888f, 0x0e}, - {0x8890, 0x69}, - {0x8891, 0xe4}, - {0x8892, 0x12}, - {0x8893, 0x0b}, - {0x8894, 0x2b}, - {0x8895, 0x12}, - {0x8896, 0x0b}, - {0x8897, 0x16}, - {0x8898, 0xe4}, - {0x8899, 0x85}, - {0x889a, 0x48}, - {0x889b, 0x37}, - {0x889c, 0xf5}, - {0x889d, 0x36}, - {0x889e, 0xf5}, - {0x889f, 0x35}, - {0x88a0, 0xf5}, - {0x88a1, 0x34}, - {0x88a2, 0xaf}, - {0x88a3, 0x37}, - {0x88a4, 0xae}, - {0x88a5, 0x36}, - {0x88a6, 0xad}, - {0x88a7, 0x35}, - {0x88a8, 0xac}, - {0x88a9, 0x34}, - {0x88aa, 0xa3}, - {0x88ab, 0x12}, - {0x88ac, 0x0b}, - {0x88ad, 0x2b}, - {0x88ae, 0x8f}, - {0x88af, 0x37}, - {0x88b0, 0x8e}, - {0x88b1, 0x36}, - {0x88b2, 0x8d}, - {0x88b3, 0x35}, - {0x88b4, 0x8c}, - {0x88b5, 0x34}, - {0x88b6, 0xe5}, - {0x88b7, 0x3b}, - {0x88b8, 0x45}, - {0x88b9, 0x37}, - {0x88ba, 0xf5}, - {0x88bb, 0x3b}, - {0x88bc, 0xe5}, - {0x88bd, 0x3a}, - {0x88be, 0x45}, - {0x88bf, 0x36}, - {0x88c0, 0xf5}, - {0x88c1, 0x3a}, - {0x88c2, 0xe5}, - {0x88c3, 0x39}, - {0x88c4, 0x45}, - {0x88c5, 0x35}, - {0x88c6, 0xf5}, - {0x88c7, 0x39}, - {0x88c8, 0xe5}, - {0x88c9, 0x38}, - {0x88ca, 0x45}, - {0x88cb, 0x34}, - {0x88cc, 0xf5}, - {0x88cd, 0x38}, - {0x88ce, 0xe4}, - {0x88cf, 0xf5}, - {0x88d0, 0x22}, - {0x88d1, 0xf5}, - {0x88d2, 0x23}, - {0x88d3, 0x85}, - {0x88d4, 0x3b}, - {0x88d5, 0x31}, - {0x88d6, 0x85}, - {0x88d7, 0x3a}, - {0x88d8, 0x30}, - {0x88d9, 0x85}, - {0x88da, 0x39}, - {0x88db, 0x2f}, - {0x88dc, 0x85}, - {0x88dd, 0x38}, - {0x88de, 0x2e}, - {0x88df, 0x02}, - {0x88e0, 0x0a}, - {0x88e1, 0xba}, - {0x88e2, 0x78}, - {0x88e3, 0x4f}, - {0x88e4, 0x7e}, - {0x88e5, 0x00}, - {0x88e6, 0xe6}, - {0x88e7, 0xfc}, - {0x88e8, 0x08}, - {0x88e9, 0xe6}, - {0x88ea, 0xfd}, - {0x88eb, 0x12}, - {0x88ec, 0x02}, - {0x88ed, 0x8e}, - {0x88ee, 0x7c}, - {0x88ef, 0x00}, - {0x88f0, 0x22}, - {0x88f1, 0xe0}, - {0x88f2, 0xa3}, - {0x88f3, 0xe0}, - {0x88f4, 0x75}, - {0x88f5, 0xf0}, - {0x88f6, 0x02}, - {0x88f7, 0xa4}, - {0x88f8, 0xff}, - {0x88f9, 0xae}, - {0x88fa, 0xf0}, - {0x88fb, 0xc3}, - {0x88fc, 0x08}, - {0x88fd, 0xe6}, - {0x88fe, 0x9f}, - {0x88ff, 0xf6}, - {0x8900, 0x18}, - {0x8901, 0xe6}, - {0x8902, 0x9e}, - {0x8903, 0xf6}, - {0x8904, 0x22}, - {0x8905, 0xff}, - {0x8906, 0xe5}, - {0x8907, 0xf0}, - {0x8908, 0x34}, - {0x8909, 0x60}, - {0x890a, 0x8f}, - {0x890b, 0x82}, - {0x890c, 0xf5}, - {0x890d, 0x83}, - {0x890e, 0xec}, - {0x890f, 0xf0}, - {0x8910, 0x22}, - {0x8911, 0xe4}, - {0x8912, 0xfc}, - {0x8913, 0xfd}, - {0x8914, 0x12}, - {0x8915, 0x04}, - {0x8916, 0x53}, - {0x8917, 0x78}, - {0x8918, 0x59}, - {0x8919, 0xe6}, - {0x891a, 0xc3}, - {0x891b, 0x13}, - {0x891c, 0xfe}, - {0x891d, 0x08}, - {0x891e, 0xe6}, - {0x891f, 0x13}, - {0x8920, 0x22}, - {0x8921, 0x78}, - {0x8922, 0x4f}, - {0x8923, 0xe6}, - {0x8924, 0xfe}, - {0x8925, 0x08}, - {0x8926, 0xe6}, - {0x8927, 0xff}, - {0x8928, 0xe4}, - {0x8929, 0xfc}, - {0x892a, 0xfd}, - {0x892b, 0x22}, - {0x892c, 0xe7}, - {0x892d, 0xc4}, - {0x892e, 0xf8}, - {0x892f, 0x54}, - {0x8930, 0xf0}, - {0x8931, 0xc8}, - {0x8932, 0x68}, - {0x8933, 0xf7}, - {0x8934, 0x09}, - {0x8935, 0xe7}, - {0x8936, 0xc4}, - {0x8937, 0x54}, - {0x8938, 0x0f}, - {0x8939, 0x48}, - {0x893a, 0xf7}, - {0x893b, 0x22}, - {0x893c, 0xe6}, - {0x893d, 0xfc}, - {0x893e, 0xed}, - {0x893f, 0x75}, - {0x8940, 0xf0}, - {0x8941, 0x04}, - {0x8942, 0xa4}, - {0x8943, 0x22}, - {0x8944, 0xe0}, - {0x8945, 0xfe}, - {0x8946, 0xa3}, - {0x8947, 0xe0}, - {0x8948, 0xfd}, - {0x8949, 0xee}, - {0x894a, 0xf6}, - {0x894b, 0xed}, - {0x894c, 0x08}, - {0x894d, 0xf6}, - {0x894e, 0x22}, - {0x894f, 0x13}, - {0x8950, 0xff}, - {0x8951, 0xc3}, - {0x8952, 0xe6}, - {0x8953, 0x9f}, - {0x8954, 0xff}, - {0x8955, 0x18}, - {0x8956, 0xe6}, - {0x8957, 0x9e}, - {0x8958, 0xfe}, - {0x8959, 0x22}, - {0x895a, 0xe6}, - {0x895b, 0xc3}, - {0x895c, 0x13}, - {0x895d, 0xf7}, - {0x895e, 0x08}, - {0x895f, 0xe6}, - {0x8960, 0x13}, - {0x8961, 0x09}, - {0x8962, 0xf7}, - {0x8963, 0x22}, - {0x8964, 0xe4}, - {0x8965, 0xf5}, - {0x8966, 0x49}, - {0x8967, 0x90}, - {0x8968, 0x0e}, - {0x8969, 0x77}, - {0x896a, 0x93}, - {0x896b, 0xff}, - {0x896c, 0xe4}, - {0x896d, 0x8f}, - {0x896e, 0x37}, - {0x896f, 0xf5}, - {0x8970, 0x36}, - {0x8971, 0xf5}, - {0x8972, 0x35}, - {0x8973, 0xf5}, - {0x8974, 0x34}, - {0x8975, 0xaf}, - {0x8976, 0x37}, - {0x8977, 0xae}, - {0x8978, 0x36}, - {0x8979, 0xad}, - {0x897a, 0x35}, - {0x897b, 0xac}, - {0x897c, 0x34}, - {0x897d, 0x90}, - {0x897e, 0x0e}, - {0x897f, 0x6a}, - {0x8980, 0x12}, - {0x8981, 0x0b}, - {0x8982, 0x2b}, - {0x8983, 0x8f}, - {0x8984, 0x37}, - {0x8985, 0x8e}, - {0x8986, 0x36}, - {0x8987, 0x8d}, - {0x8988, 0x35}, - {0x8989, 0x8c}, - {0x898a, 0x34}, - {0x898b, 0x90}, - {0x898c, 0x0e}, - {0x898d, 0x72}, - {0x898e, 0x12}, - {0x898f, 0x04}, - {0x8990, 0x36}, - {0x8991, 0xef}, - {0x8992, 0x45}, - {0x8993, 0x37}, - {0x8994, 0xf5}, - {0x8995, 0x37}, - {0x8996, 0xee}, - {0x8997, 0x45}, - {0x8998, 0x36}, - {0x8999, 0xf5}, - {0x899a, 0x36}, - {0x899b, 0xed}, - {0x899c, 0x45}, - {0x899d, 0x35}, - {0x899e, 0xf5}, - {0x899f, 0x35}, - {0x89a0, 0xec}, - {0x89a1, 0x45}, - {0x89a2, 0x34}, - {0x89a3, 0xf5}, - {0x89a4, 0x34}, - {0x89a5, 0xe4}, - {0x89a6, 0xf5}, - {0x89a7, 0x22}, - {0x89a8, 0xf5}, - {0x89a9, 0x23}, - {0x89aa, 0x85}, - {0x89ab, 0x37}, - {0x89ac, 0x31}, - {0x89ad, 0x85}, - {0x89ae, 0x36}, - {0x89af, 0x30}, - {0x89b0, 0x85}, - {0x89b1, 0x35}, - {0x89b2, 0x2f}, - {0x89b3, 0x85}, - {0x89b4, 0x34}, - {0x89b5, 0x2e}, - {0x89b6, 0x12}, - {0x89b7, 0x0a}, - {0x89b8, 0xba}, - {0x89b9, 0xe4}, - {0x89ba, 0xf5}, - {0x89bb, 0x22}, - {0x89bc, 0xf5}, - {0x89bd, 0x23}, - {0x89be, 0x90}, - {0x89bf, 0x0e}, - {0x89c0, 0x72}, - {0x89c1, 0x12}, - {0x89c2, 0x0b}, - {0x89c3, 0x1f}, - {0x89c4, 0x12}, - {0x89c5, 0x0a}, - {0x89c6, 0xba}, - {0x89c7, 0xe4}, - {0x89c8, 0xf5}, - {0x89c9, 0x22}, - {0x89ca, 0xf5}, - {0x89cb, 0x23}, - {0x89cc, 0x90}, - {0x89cd, 0x0e}, - {0x89ce, 0x6e}, - {0x89cf, 0x12}, - {0x89d0, 0x0b}, - {0x89d1, 0x1f}, - {0x89d2, 0x02}, - {0x89d3, 0x0a}, - {0x89d4, 0xba}, - {0x89d5, 0x75}, - {0x89d6, 0x89}, - {0x89d7, 0x03}, - {0x89d8, 0x75}, - {0x89d9, 0xa8}, - {0x89da, 0x01}, - {0x89db, 0x75}, - {0x89dc, 0xb8}, - {0x89dd, 0x04}, - {0x89de, 0x75}, - {0x89df, 0x34}, - {0x89e0, 0xff}, - {0x89e1, 0x75}, - {0x89e2, 0x35}, - {0x89e3, 0x0e}, - {0x89e4, 0x75}, - {0x89e5, 0x36}, - {0x89e6, 0x15}, - {0x89e7, 0x75}, - {0x89e8, 0x37}, - {0x89e9, 0x0d}, - {0x89ea, 0x12}, - {0x89eb, 0x0a}, - {0x89ec, 0x3e}, - {0x89ed, 0x12}, - {0x89ee, 0x00}, - {0x89ef, 0x09}, - {0x89f0, 0x12}, - {0x89f1, 0x0b}, - {0x89f2, 0x31}, - {0x89f3, 0x12}, - {0x89f4, 0x00}, - {0x89f5, 0x06}, - {0x89f6, 0xd2}, - {0x89f7, 0x00}, - {0x89f8, 0xd2}, - {0x89f9, 0x33}, - {0x89fa, 0xd2}, - {0x89fb, 0xaf}, - {0x89fc, 0x75}, - {0x89fd, 0x34}, - {0x89fe, 0xff}, - {0x89ff, 0x75}, - {0x8a00, 0x35}, - {0x8a01, 0x0e}, - {0x8a02, 0x75}, - {0x8a03, 0x36}, - {0x8a04, 0x49}, - {0x8a05, 0x75}, - {0x8a06, 0x37}, - {0x8a07, 0x03}, - {0x8a08, 0x12}, - {0x8a09, 0x0a}, - {0x8a0a, 0x3e}, - {0x8a0b, 0x30}, - {0x8a0c, 0x08}, - {0x8a0d, 0x09}, - {0x8a0e, 0xc2}, - {0x8a0f, 0x33}, - {0x8a10, 0x12}, - {0x8a11, 0x06}, - {0x8a12, 0x61}, - {0x8a13, 0xc2}, - {0x8a14, 0x08}, - {0x8a15, 0xd2}, - {0x8a16, 0x33}, - {0x8a17, 0x30}, - {0x8a18, 0x09}, - {0x8a19, 0x09}, - {0x8a1a, 0xc2}, - {0x8a1b, 0x35}, - {0x8a1c, 0x12}, - {0x8a1d, 0x00}, - {0x8a1e, 0x0e}, - {0x8a1f, 0xc2}, - {0x8a20, 0x09}, - {0x8a21, 0xd2}, - {0x8a22, 0x35}, - {0x8a23, 0x30}, - {0x8a24, 0x0e}, - {0x8a25, 0x03}, - {0x8a26, 0x12}, - {0x8a27, 0x04}, - {0x8a28, 0x91}, - {0x8a29, 0x30}, - {0x8a2a, 0x34}, - {0x8a2b, 0xdf}, - {0x8a2c, 0x90}, - {0x8a2d, 0x30}, - {0x8a2e, 0x29}, - {0x8a2f, 0xe5}, - {0x8a30, 0x1e}, - {0x8a31, 0xf0}, - {0x8a32, 0xb4}, - {0x8a33, 0x10}, - {0x8a34, 0x05}, - {0x8a35, 0x90}, - {0x8a36, 0x30}, - {0x8a37, 0x23}, - {0x8a38, 0xe4}, - {0x8a39, 0xf0}, - {0x8a3a, 0xc2}, - {0x8a3b, 0x34}, - {0x8a3c, 0x80}, - {0x8a3d, 0xcd}, - {0x8a3e, 0xae}, - {0x8a3f, 0x35}, - {0x8a40, 0xaf}, - {0x8a41, 0x36}, - {0x8a42, 0xe4}, - {0x8a43, 0xfd}, - {0x8a44, 0xed}, - {0x8a45, 0xc3}, - {0x8a46, 0x95}, - {0x8a47, 0x37}, - {0x8a48, 0x50}, - {0x8a49, 0x33}, - {0x8a4a, 0x12}, - {0x8a4b, 0x0b}, - {0x8a4c, 0x78}, - {0x8a4d, 0xe4}, - {0x8a4e, 0x93}, - {0x8a4f, 0xf5}, - {0x8a50, 0x38}, - {0x8a51, 0x74}, - {0x8a52, 0x01}, - {0x8a53, 0x93}, - {0x8a54, 0xf5}, - {0x8a55, 0x39}, - {0x8a56, 0x45}, - {0x8a57, 0x38}, - {0x8a58, 0x60}, - {0x8a59, 0x23}, - {0x8a5a, 0x85}, - {0x8a5b, 0x39}, - {0x8a5c, 0x82}, - {0x8a5d, 0x85}, - {0x8a5e, 0x38}, - {0x8a5f, 0x83}, - {0x8a60, 0xe0}, - {0x8a61, 0xfc}, - {0x8a62, 0x12}, - {0x8a63, 0x0b}, - {0x8a64, 0x78}, - {0x8a65, 0x74}, - {0x8a66, 0x03}, - {0x8a67, 0x93}, - {0x8a68, 0x52}, - {0x8a69, 0x04}, - {0x8a6a, 0x12}, - {0x8a6b, 0x0b}, - {0x8a6c, 0x78}, - {0x8a6d, 0x74}, - {0x8a6e, 0x02}, - {0x8a6f, 0x93}, - {0x8a70, 0x42}, - {0x8a71, 0x04}, - {0x8a72, 0x85}, - {0x8a73, 0x39}, - {0x8a74, 0x82}, - {0x8a75, 0x85}, - {0x8a76, 0x38}, - {0x8a77, 0x83}, - {0x8a78, 0xec}, - {0x8a79, 0xf0}, - {0x8a7a, 0x0d}, - {0x8a7b, 0x80}, - {0x8a7c, 0xc7}, - {0x8a7d, 0x22}, - {0x8a7e, 0x78}, - {0x8a7f, 0xbb}, - {0x8a80, 0xe6}, - {0x8a81, 0xd3}, - {0x8a82, 0x08}, - {0x8a83, 0xff}, - {0x8a84, 0xe6}, - {0x8a85, 0x64}, - {0x8a86, 0x80}, - {0x8a87, 0xf8}, - {0x8a88, 0xef}, - {0x8a89, 0x64}, - {0x8a8a, 0x80}, - {0x8a8b, 0x98}, - {0x8a8c, 0x22}, - {0x8a8d, 0x93}, - {0x8a8e, 0xff}, - {0x8a8f, 0x7e}, - {0x8a90, 0x00}, - {0x8a91, 0xe6}, - {0x8a92, 0xfc}, - {0x8a93, 0x08}, - {0x8a94, 0xe6}, - {0x8a95, 0xfd}, - {0x8a96, 0x12}, - {0x8a97, 0x02}, - {0x8a98, 0x8e}, - {0x8a99, 0x78}, - {0x8a9a, 0xbe}, - {0x8a9b, 0xe6}, - {0x8a9c, 0xfc}, - {0x8a9d, 0x08}, - {0x8a9e, 0xe6}, - {0x8a9f, 0xfd}, - {0x8aa0, 0xd3}, - {0x8aa1, 0xef}, - {0x8aa2, 0x9d}, - {0x8aa3, 0xee}, - {0x8aa4, 0x9c}, - {0x8aa5, 0x22}, - {0x8aa6, 0x78}, - {0x8aa7, 0xba}, - {0x8aa8, 0xd3}, - {0x8aa9, 0xe6}, - {0x8aaa, 0x64}, - {0x8aab, 0x80}, - {0x8aac, 0x94}, - {0x8aad, 0x80}, - {0x8aae, 0x22}, - {0x8aaf, 0x25}, - {0x8ab0, 0xe0}, - {0x8ab1, 0x24}, - {0x8ab2, 0x0a}, - {0x8ab3, 0xf8}, - {0x8ab4, 0xe6}, - {0x8ab5, 0xfe}, - {0x8ab6, 0x08}, - {0x8ab7, 0xe6}, - {0x8ab8, 0xff}, - {0x8ab9, 0x22}, - {0x8aba, 0xa2}, - {0x8abb, 0xaf}, - {0x8abc, 0x92}, - {0x8abd, 0x31}, - {0x8abe, 0xc2}, - {0x8abf, 0xaf}, - {0x8ac0, 0xe5}, - {0x8ac1, 0x23}, - {0x8ac2, 0x45}, - {0x8ac3, 0x22}, - {0x8ac4, 0x90}, - {0x8ac5, 0x0e}, - {0x8ac6, 0x5d}, - {0x8ac7, 0x60}, - {0x8ac8, 0x0b}, - {0x8ac9, 0x12}, - {0x8aca, 0x0b}, - {0x8acb, 0x6d}, - {0x8acc, 0xe0}, - {0x8acd, 0xf5}, - {0x8ace, 0x2c}, - {0x8acf, 0xe0}, - {0x8ad0, 0xf5}, - {0x8ad1, 0x2d}, - {0x8ad2, 0x80}, - {0x8ad3, 0x0f}, - {0x8ad4, 0x12}, - {0x8ad5, 0x0b}, - {0x8ad6, 0x6d}, - {0x8ad7, 0xe5}, - {0x8ad8, 0x30}, - {0x8ad9, 0xf0}, - {0x8ada, 0x90}, - {0x8adb, 0x0e}, - {0x8adc, 0x5f}, - {0x8add, 0x12}, - {0x8ade, 0x0b}, - {0x8adf, 0x6d}, - {0x8ae0, 0xe5}, - {0x8ae1, 0x31}, - {0x8ae2, 0xf0}, - {0x8ae3, 0xa2}, - {0x8ae4, 0x31}, - {0x8ae5, 0x92}, - {0x8ae6, 0xaf}, - {0x8ae7, 0x22}, - {0x8ae8, 0xd2}, - {0x8ae9, 0x01}, - {0x8aea, 0xc2}, - {0x8aeb, 0x02}, - {0x8aec, 0xe4}, - {0x8aed, 0xf5}, - {0x8aee, 0x1f}, - {0x8aef, 0xf5}, - {0x8af0, 0x1e}, - {0x8af1, 0xd2}, - {0x8af2, 0x34}, - {0x8af3, 0xd2}, - {0x8af4, 0x32}, - {0x8af5, 0xd2}, - {0x8af6, 0x35}, - {0x8af7, 0xd2}, - {0x8af8, 0x01}, - {0x8af9, 0xc2}, - {0x8afa, 0x02}, - {0x8afb, 0xf5}, - {0x8afc, 0x1f}, - {0x8afd, 0xf5}, - {0x8afe, 0x1e}, - {0x8aff, 0xd2}, - {0x8b00, 0x34}, - {0x8b01, 0xd2}, - {0x8b02, 0x32}, - {0x8b03, 0x22}, - {0x8b04, 0x2d}, - {0x8b05, 0xfd}, - {0x8b06, 0xe4}, - {0x8b07, 0x33}, - {0x8b08, 0xfc}, - {0x8b09, 0xe4}, - {0x8b0a, 0x93}, - {0x8b0b, 0xfe}, - {0x8b0c, 0xfb}, - {0x8b0d, 0xd3}, - {0x8b0e, 0xed}, - {0x8b0f, 0x9b}, - {0x8b10, 0x74}, - {0x8b11, 0x80}, - {0x8b12, 0xf8}, - {0x8b13, 0x6c}, - {0x8b14, 0x98}, - {0x8b15, 0x22}, - {0x8b16, 0x8f}, - {0x8b17, 0x3b}, - {0x8b18, 0x8e}, - {0x8b19, 0x3a}, - {0x8b1a, 0x8d}, - {0x8b1b, 0x39}, - {0x8b1c, 0x8c}, - {0x8b1d, 0x38}, - {0x8b1e, 0x22}, - {0x8b1f, 0x12}, - {0x8b20, 0x04}, - {0x8b21, 0x36}, - {0x8b22, 0x8f}, - {0x8b23, 0x31}, - {0x8b24, 0x8e}, - {0x8b25, 0x30}, - {0x8b26, 0x8d}, - {0x8b27, 0x2f}, - {0x8b28, 0x8c}, - {0x8b29, 0x2e}, - {0x8b2a, 0x22}, - {0x8b2b, 0x93}, - {0x8b2c, 0xf9}, - {0x8b2d, 0xf8}, - {0x8b2e, 0x02}, - {0x8b2f, 0x04}, - {0x8b30, 0x23}, - {0x8b31, 0x90}, - {0x8b32, 0x0e}, - {0x8b33, 0x81}, - {0x8b34, 0x12}, - {0x8b35, 0x04}, - {0x8b36, 0x36}, - {0x8b37, 0x8f}, - {0x8b38, 0x46}, - {0x8b39, 0x8e}, - {0x8b3a, 0x45}, - {0x8b3b, 0x8d}, - {0x8b3c, 0x44}, - {0x8b3d, 0x8c}, - {0x8b3e, 0x43}, - {0x8b3f, 0xd2}, - {0x8b40, 0x06}, - {0x8b41, 0x30}, - {0x8b42, 0x06}, - {0x8b43, 0x03}, - {0x8b44, 0xd3}, - {0x8b45, 0x80}, - {0x8b46, 0x01}, - {0x8b47, 0xc3}, - {0x8b48, 0x92}, - {0x8b49, 0x0e}, - {0x8b4a, 0x22}, - {0x8b4b, 0xc0}, - {0x8b4c, 0xe0}, - {0x8b4d, 0xc0}, - {0x8b4e, 0x83}, - {0x8b4f, 0xc0}, - {0x8b50, 0x82}, - {0x8b51, 0x90}, - {0x8b52, 0x3f}, - {0x8b53, 0x0d}, - {0x8b54, 0xe0}, - {0x8b55, 0xf5}, - {0x8b56, 0x33}, - {0x8b57, 0xe5}, - {0x8b58, 0x33}, - {0x8b59, 0xf0}, - {0x8b5a, 0xd0}, - {0x8b5b, 0x82}, - {0x8b5c, 0xd0}, - {0x8b5d, 0x83}, - {0x8b5e, 0xd0}, - {0x8b5f, 0xe0}, - {0x8b60, 0x32}, - {0x8b61, 0x78}, - {0x8b62, 0x7f}, - {0x8b63, 0xe4}, - {0x8b64, 0xf6}, - {0x8b65, 0xd8}, - {0x8b66, 0xfd}, - {0x8b67, 0x75}, - {0x8b68, 0x81}, - {0x8b69, 0xca}, - {0x8b6a, 0x02}, - {0x8b6b, 0x09}, - {0x8b6c, 0xd5}, - {0x8b6d, 0xe4}, - {0x8b6e, 0x93}, - {0x8b6f, 0xfe}, - {0x8b70, 0x74}, - {0x8b71, 0x01}, - {0x8b72, 0x93}, - {0x8b73, 0xf5}, - {0x8b74, 0x82}, - {0x8b75, 0x8e}, - {0x8b76, 0x83}, - {0x8b77, 0x22}, - {0x8b78, 0x8f}, - {0x8b79, 0x82}, - {0x8b7a, 0x8e}, - {0x8b7b, 0x83}, - {0x8b7c, 0x75}, - {0x8b7d, 0xf0}, - {0x8b7e, 0x04}, - {0x8b7f, 0xed}, - {0x8b80, 0x02}, - {0x8b81, 0x04}, - {0x8b82, 0x5f}, - {0x8b83, 0x00}, - {0x8b84, 0x00}, - {0x8b85, 0x00}, - {0x8b86, 0x00}, - {0x8b87, 0x00}, - {0x8b88, 0x00}, - {0x8b89, 0x00}, - {0x8b8a, 0x00}, - {0x8b8b, 0x00}, - {0x8b8c, 0x00}, - {0x8b8d, 0x00}, - {0x8b8e, 0x00}, - {0x8b8f, 0x00}, - {0x8b90, 0x00}, - {0x8b91, 0x00}, - {0x8b92, 0x00}, - {0x8b93, 0x00}, - {0x8b94, 0x00}, - {0x8b95, 0x00}, - {0x8b96, 0x00}, - {0x8b97, 0x00}, - {0x8b98, 0x00}, - {0x8b99, 0x00}, - {0x8b9a, 0x00}, - {0x8b9b, 0x00}, - {0x8b9c, 0x00}, - {0x8b9d, 0x00}, - {0x8b9e, 0x00}, - {0x8b9f, 0x00}, - {0x8ba0, 0x00}, - {0x8ba1, 0x00}, - {0x8ba2, 0x00}, - {0x8ba3, 0x00}, - {0x8ba4, 0x00}, - {0x8ba5, 0x00}, - {0x8ba6, 0x00}, - {0x8ba7, 0x00}, - {0x8ba8, 0x00}, - {0x8ba9, 0x00}, - {0x8baa, 0x00}, - {0x8bab, 0x00}, - {0x8bac, 0x00}, - {0x8bad, 0x00}, - {0x8bae, 0x00}, - {0x8baf, 0x00}, - {0x8bb0, 0x00}, - {0x8bb1, 0x00}, - {0x8bb2, 0x00}, - {0x8bb3, 0x00}, - {0x8bb4, 0x00}, - {0x8bb5, 0x00}, - {0x8bb6, 0x00}, - {0x8bb7, 0x00}, - {0x8bb8, 0x00}, - {0x8bb9, 0x00}, - {0x8bba, 0x00}, - {0x8bbb, 0x00}, - {0x8bbc, 0x00}, - {0x8bbd, 0x00}, - {0x8bbe, 0x00}, - {0x8bbf, 0x00}, - {0x8bc0, 0x00}, - {0x8bc1, 0x00}, - {0x8bc2, 0x00}, - {0x8bc3, 0x00}, - {0x8bc4, 0x00}, - {0x8bc5, 0x00}, - {0x8bc6, 0x00}, - {0x8bc7, 0x00}, - {0x8bc8, 0x00}, - {0x8bc9, 0x00}, - {0x8bca, 0x00}, - {0x8bcb, 0x00}, - {0x8bcc, 0x00}, - {0x8bcd, 0x00}, - {0x8bce, 0x00}, - {0x8bcf, 0x00}, - {0x8bd0, 0x00}, - {0x8bd1, 0x00}, - {0x8bd2, 0x00}, - {0x8bd3, 0x00}, - {0x8bd4, 0x00}, - {0x8bd5, 0x00}, - {0x8bd6, 0x00}, - {0x8bd7, 0x00}, - {0x8bd8, 0x00}, - {0x8bd9, 0x00}, - {0x8bda, 0x00}, - {0x8bdb, 0x00}, - {0x8bdc, 0x00}, - {0x8bdd, 0x00}, - {0x8bde, 0x00}, - {0x8bdf, 0x00}, - {0x8be0, 0x00}, - {0x8be1, 0x00}, - {0x8be2, 0x00}, - {0x8be3, 0x00}, - {0x8be4, 0x00}, - {0x8be5, 0x00}, - {0x8be6, 0x00}, - {0x8be7, 0x00}, - {0x8be8, 0x00}, - {0x8be9, 0x00}, - {0x8bea, 0x00}, - {0x8beb, 0x00}, - {0x8bec, 0x00}, - {0x8bed, 0x00}, - {0x8bee, 0x00}, - {0x8bef, 0x00}, - {0x8bf0, 0x00}, - {0x8bf1, 0x00}, - {0x8bf2, 0x00}, - {0x8bf3, 0x00}, - {0x8bf4, 0x00}, - {0x8bf5, 0x00}, - {0x8bf6, 0x00}, - {0x8bf7, 0x00}, - {0x8bf8, 0x00}, - {0x8bf9, 0x00}, - {0x8bfa, 0x00}, - {0x8bfb, 0x00}, - {0x8bfc, 0x00}, - {0x8bfd, 0x00}, - {0x8bfe, 0x00}, - {0x8bff, 0x00}, - {0x8c00, 0x00}, - {0x8c01, 0x00}, - {0x8c02, 0x00}, - {0x8c03, 0x00}, - {0x8c04, 0x00}, - {0x8c05, 0x00}, - {0x8c06, 0x00}, - {0x8c07, 0x00}, - {0x8c08, 0x00}, - {0x8c09, 0x00}, - {0x8c0a, 0x00}, - {0x8c0b, 0x00}, - {0x8c0c, 0x00}, - {0x8c0d, 0x00}, - {0x8c0e, 0x00}, - {0x8c0f, 0x00}, - {0x8c10, 0x00}, - {0x8c11, 0x00}, - {0x8c12, 0x00}, - {0x8c13, 0x00}, - {0x8c14, 0x00}, - {0x8c15, 0x00}, - {0x8c16, 0x00}, - {0x8c17, 0x00}, - {0x8c18, 0x00}, - {0x8c19, 0x00}, - {0x8c1a, 0x00}, - {0x8c1b, 0x00}, - {0x8c1c, 0x00}, - {0x8c1d, 0x00}, - {0x8c1e, 0x00}, - {0x8c1f, 0x00}, - {0x8c20, 0x00}, - {0x8c21, 0x00}, - {0x8c22, 0x00}, - {0x8c23, 0x00}, - {0x8c24, 0x00}, - {0x8c25, 0x00}, - {0x8c26, 0x00}, - {0x8c27, 0x00}, - {0x8c28, 0x00}, - {0x8c29, 0x00}, - {0x8c2a, 0x00}, - {0x8c2b, 0x00}, - {0x8c2c, 0x00}, - {0x8c2d, 0x00}, - {0x8c2e, 0x00}, - {0x8c2f, 0x00}, - {0x8c30, 0x00}, - {0x8c31, 0x00}, - {0x8c32, 0x00}, - {0x8c33, 0x00}, - {0x8c34, 0x00}, - {0x8c35, 0x00}, - {0x8c36, 0x00}, - {0x8c37, 0x00}, - {0x8c38, 0x00}, - {0x8c39, 0x00}, - {0x8c3a, 0x00}, - {0x8c3b, 0x00}, - {0x8c3c, 0x00}, - {0x8c3d, 0x00}, - {0x8c3e, 0x00}, - {0x8c3f, 0x00}, - {0x8c40, 0x00}, - {0x8c41, 0x00}, - {0x8c42, 0x00}, - {0x8c43, 0x00}, - {0x8c44, 0x00}, - {0x8c45, 0x00}, - {0x8c46, 0x00}, - {0x8c47, 0x00}, - {0x8c48, 0x00}, - {0x8c49, 0x00}, - {0x8c4a, 0x00}, - {0x8c4b, 0x00}, - {0x8c4c, 0x00}, - {0x8c4d, 0x00}, - {0x8c4e, 0x00}, - {0x8c4f, 0x00}, - {0x8c50, 0x00}, - {0x8c51, 0x00}, - {0x8c52, 0x00}, - {0x8c53, 0x00}, - {0x8c54, 0x00}, - {0x8c55, 0x00}, - {0x8c56, 0x00}, - {0x8c57, 0x00}, - {0x8c58, 0x00}, - {0x8c59, 0x00}, - {0x8c5a, 0x00}, - {0x8c5b, 0x00}, - {0x8c5c, 0x00}, - {0x8c5d, 0x00}, - {0x8c5e, 0x00}, - {0x8c5f, 0x00}, - {0x8c60, 0x00}, - {0x8c61, 0x00}, - {0x8c62, 0x00}, - {0x8c63, 0x00}, - {0x8c64, 0x00}, - {0x8c65, 0x00}, - {0x8c66, 0x00}, - {0x8c67, 0x00}, - {0x8c68, 0x00}, - {0x8c69, 0x00}, - {0x8c6a, 0x00}, - {0x8c6b, 0x00}, - {0x8c6c, 0x00}, - {0x8c6d, 0x00}, - {0x8c6e, 0x00}, - {0x8c6f, 0x00}, - {0x8c70, 0x00}, - {0x8c71, 0x00}, - {0x8c72, 0x00}, - {0x8c73, 0x00}, - {0x8c74, 0x00}, - {0x8c75, 0x00}, - {0x8c76, 0x00}, - {0x8c77, 0x00}, - {0x8c78, 0x00}, - {0x8c79, 0x00}, - {0x8c7a, 0x00}, - {0x8c7b, 0x00}, - {0x8c7c, 0x00}, - {0x8c7d, 0x00}, - {0x8c7e, 0x00}, - {0x8c7f, 0x00}, - {0x8c80, 0x00}, - {0x8c81, 0x00}, - {0x8c82, 0x00}, - {0x8c83, 0x00}, - {0x8c84, 0x00}, - {0x8c85, 0x00}, - {0x8c86, 0x00}, - {0x8c87, 0x00}, - {0x8c88, 0x00}, - {0x8c89, 0x00}, - {0x8c8a, 0x00}, - {0x8c8b, 0x00}, - {0x8c8c, 0x00}, - {0x8c8d, 0x00}, - {0x8c8e, 0x00}, - {0x8c8f, 0x00}, - {0x8c90, 0x00}, - {0x8c91, 0x00}, - {0x8c92, 0x00}, - {0x8c93, 0x00}, - {0x8c94, 0x00}, - {0x8c95, 0x00}, - {0x8c96, 0x00}, - {0x8c97, 0x00}, - {0x8c98, 0x00}, - {0x8c99, 0x00}, - {0x8c9a, 0x00}, - {0x8c9b, 0x00}, - {0x8c9c, 0x00}, - {0x8c9d, 0x00}, - {0x8c9e, 0x00}, - {0x8c9f, 0x00}, - {0x8ca0, 0x00}, - {0x8ca1, 0x00}, - {0x8ca2, 0x00}, - {0x8ca3, 0x00}, - {0x8ca4, 0x00}, - {0x8ca5, 0x00}, - {0x8ca6, 0x00}, - {0x8ca7, 0x00}, - {0x8ca8, 0x00}, - {0x8ca9, 0x00}, - {0x8caa, 0x00}, - {0x8cab, 0x00}, - {0x8cac, 0x00}, - {0x8cad, 0x00}, - {0x8cae, 0x00}, - {0x8caf, 0x00}, - {0x8cb0, 0x00}, - {0x8cb1, 0x00}, - {0x8cb2, 0x00}, - {0x8cb3, 0x00}, - {0x8cb4, 0x00}, - {0x8cb5, 0x00}, - {0x8cb6, 0x00}, - {0x8cb7, 0x00}, - {0x8cb8, 0x00}, - {0x8cb9, 0x00}, - {0x8cba, 0x00}, - {0x8cbb, 0x00}, - {0x8cbc, 0x00}, - {0x8cbd, 0x00}, - {0x8cbe, 0x00}, - {0x8cbf, 0x00}, - {0x8cc0, 0x00}, - {0x8cc1, 0x00}, - {0x8cc2, 0x00}, - {0x8cc3, 0x00}, - {0x8cc4, 0x00}, - {0x8cc5, 0x00}, - {0x8cc6, 0x00}, - {0x8cc7, 0x00}, - {0x8cc8, 0x00}, - {0x8cc9, 0x00}, - {0x8cca, 0x00}, - {0x8ccb, 0x00}, - {0x8ccc, 0x00}, - {0x8ccd, 0x00}, - {0x8cce, 0x00}, - {0x8ccf, 0x00}, - {0x8cd0, 0x00}, - {0x8cd1, 0x00}, - {0x8cd2, 0x00}, - {0x8cd3, 0x00}, - {0x8cd4, 0x00}, - {0x8cd5, 0x00}, - {0x8cd6, 0x00}, - {0x8cd7, 0x00}, - {0x8cd8, 0x00}, - {0x8cd9, 0x00}, - {0x8cda, 0x00}, - {0x8cdb, 0x00}, - {0x8cdc, 0x00}, - {0x8cdd, 0x00}, - {0x8cde, 0x00}, - {0x8cdf, 0x00}, - {0x8ce0, 0x00}, - {0x8ce1, 0x00}, - {0x8ce2, 0x00}, - {0x8ce3, 0x00}, - {0x8ce4, 0x00}, - {0x8ce5, 0x00}, - {0x8ce6, 0x00}, - {0x8ce7, 0x00}, - {0x8ce8, 0x00}, - {0x8ce9, 0x00}, - {0x8cea, 0x00}, - {0x8ceb, 0x00}, - {0x8cec, 0x00}, - {0x8ced, 0x00}, - {0x8cee, 0x00}, - {0x8cef, 0x00}, - {0x8cf0, 0x00}, - {0x8cf1, 0x00}, - {0x8cf2, 0x00}, - {0x8cf3, 0x00}, - {0x8cf4, 0x00}, - {0x8cf5, 0x00}, - {0x8cf6, 0x00}, - {0x8cf7, 0x00}, - {0x8cf8, 0x00}, - {0x8cf9, 0x00}, - {0x8cfa, 0x00}, - {0x8cfb, 0x00}, - {0x8cfc, 0x00}, - {0x8cfd, 0x00}, - {0x8cfe, 0x00}, - {0x8cff, 0x00}, - {0x8d00, 0x00}, - {0x8d01, 0x00}, - {0x8d02, 0x00}, - {0x8d03, 0x00}, - {0x8d04, 0x00}, - {0x8d05, 0x00}, - {0x8d06, 0x00}, - {0x8d07, 0x00}, - {0x8d08, 0x00}, - {0x8d09, 0x00}, - {0x8d0a, 0x00}, - {0x8d0b, 0x00}, - {0x8d0c, 0x00}, - {0x8d0d, 0x00}, - {0x8d0e, 0x00}, - {0x8d0f, 0x00}, - {0x8d10, 0x00}, - {0x8d11, 0x00}, - {0x8d12, 0x00}, - {0x8d13, 0x00}, - {0x8d14, 0x00}, - {0x8d15, 0x00}, - {0x8d16, 0x00}, - {0x8d17, 0x00}, - {0x8d18, 0x00}, - {0x8d19, 0x00}, - {0x8d1a, 0x00}, - {0x8d1b, 0x00}, - {0x8d1c, 0x00}, - {0x8d1d, 0x00}, - {0x8d1e, 0x00}, - {0x8d1f, 0x00}, - {0x8d20, 0x00}, - {0x8d21, 0x00}, - {0x8d22, 0x00}, - {0x8d23, 0x00}, - {0x8d24, 0x00}, - {0x8d25, 0x00}, - {0x8d26, 0x00}, - {0x8d27, 0x00}, - {0x8d28, 0x00}, - {0x8d29, 0x00}, - {0x8d2a, 0x00}, - {0x8d2b, 0x00}, - {0x8d2c, 0x00}, - {0x8d2d, 0x00}, - {0x8d2e, 0x00}, - {0x8d2f, 0x00}, - {0x8d30, 0x00}, - {0x8d31, 0x00}, - {0x8d32, 0x00}, - {0x8d33, 0x00}, - {0x8d34, 0x00}, - {0x8d35, 0x00}, - {0x8d36, 0x00}, - {0x8d37, 0x00}, - {0x8d38, 0x00}, - {0x8d39, 0x00}, - {0x8d3a, 0x00}, - {0x8d3b, 0x00}, - {0x8d3c, 0x00}, - {0x8d3d, 0x00}, - {0x8d3e, 0x00}, - {0x8d3f, 0x00}, - {0x8d40, 0x00}, - {0x8d41, 0x00}, - {0x8d42, 0x00}, - {0x8d43, 0x00}, - {0x8d44, 0x00}, - {0x8d45, 0x00}, - {0x8d46, 0x00}, - {0x8d47, 0x00}, - {0x8d48, 0x00}, - {0x8d49, 0x00}, - {0x8d4a, 0x00}, - {0x8d4b, 0x00}, - {0x8d4c, 0x00}, - {0x8d4d, 0x00}, - {0x8d4e, 0x00}, - {0x8d4f, 0x00}, - {0x8d50, 0x00}, - {0x8d51, 0x00}, - {0x8d52, 0x00}, - {0x8d53, 0x00}, - {0x8d54, 0x00}, - {0x8d55, 0x00}, - {0x8d56, 0x00}, - {0x8d57, 0x00}, - {0x8d58, 0x00}, - {0x8d59, 0x00}, - {0x8d5a, 0x00}, - {0x8d5b, 0x00}, - {0x8d5c, 0x00}, - {0x8d5d, 0x00}, - {0x8d5e, 0x00}, - {0x8d5f, 0x00}, - {0x8d60, 0x00}, - {0x8d61, 0x00}, - {0x8d62, 0x00}, - {0x8d63, 0x00}, - {0x8d64, 0x00}, - {0x8d65, 0x00}, - {0x8d66, 0x00}, - {0x8d67, 0x00}, - {0x8d68, 0x00}, - {0x8d69, 0x00}, - {0x8d6a, 0x00}, - {0x8d6b, 0x00}, - {0x8d6c, 0x00}, - {0x8d6d, 0x00}, - {0x8d6e, 0x00}, - {0x8d6f, 0x00}, - {0x8d70, 0x00}, - {0x8d71, 0x00}, - {0x8d72, 0x00}, - {0x8d73, 0x00}, - {0x8d74, 0x00}, - {0x8d75, 0x00}, - {0x8d76, 0x00}, - {0x8d77, 0x00}, - {0x8d78, 0x00}, - {0x8d79, 0x00}, - {0x8d7a, 0x00}, - {0x8d7b, 0x00}, - {0x8d7c, 0x00}, - {0x8d7d, 0x00}, - {0x8d7e, 0x00}, - {0x8d7f, 0x00}, - {0x8d80, 0x00}, - {0x8d81, 0x00}, - {0x8d82, 0x00}, - {0x8d83, 0x00}, - {0x8d84, 0x00}, - {0x8d85, 0x00}, - {0x8d86, 0x00}, - {0x8d87, 0x00}, - {0x8d88, 0x00}, - {0x8d89, 0x00}, - {0x8d8a, 0x00}, - {0x8d8b, 0x00}, - {0x8d8c, 0x00}, - {0x8d8d, 0x00}, - {0x8d8e, 0x00}, - {0x8d8f, 0x00}, - {0x8d90, 0x00}, - {0x8d91, 0x00}, - {0x8d92, 0x00}, - {0x8d93, 0x00}, - {0x8d94, 0x00}, - {0x8d95, 0x00}, - {0x8d96, 0x00}, - {0x8d97, 0x00}, - {0x8d98, 0x00}, - {0x8d99, 0x00}, - {0x8d9a, 0x00}, - {0x8d9b, 0x00}, - {0x8d9c, 0x00}, - {0x8d9d, 0x00}, - {0x8d9e, 0x00}, - {0x8d9f, 0x00}, - {0x8da0, 0x00}, - {0x8da1, 0x00}, - {0x8da2, 0x00}, - {0x8da3, 0x00}, - {0x8da4, 0x00}, - {0x8da5, 0x00}, - {0x8da6, 0x00}, - {0x8da7, 0x00}, - {0x8da8, 0x00}, - {0x8da9, 0x00}, - {0x8daa, 0x00}, - {0x8dab, 0x00}, - {0x8dac, 0x00}, - {0x8dad, 0x00}, - {0x8dae, 0x00}, - {0x8daf, 0x00}, - {0x8db0, 0x00}, - {0x8db1, 0x00}, - {0x8db2, 0x00}, - {0x8db3, 0x00}, - {0x8db4, 0x00}, - {0x8db5, 0x00}, - {0x8db6, 0x00}, - {0x8db7, 0x00}, - {0x8db8, 0x00}, - {0x8db9, 0x00}, - {0x8dba, 0x00}, - {0x8dbb, 0x00}, - {0x8dbc, 0x00}, - {0x8dbd, 0x00}, - {0x8dbe, 0x00}, - {0x8dbf, 0x00}, - {0x8dc0, 0x00}, - {0x8dc1, 0x00}, - {0x8dc2, 0x00}, - {0x8dc3, 0x00}, - {0x8dc4, 0x00}, - {0x8dc5, 0x00}, - {0x8dc6, 0x00}, - {0x8dc7, 0x00}, - {0x8dc8, 0x00}, - {0x8dc9, 0x00}, - {0x8dca, 0x00}, - {0x8dcb, 0x00}, - {0x8dcc, 0x00}, - {0x8dcd, 0x00}, - {0x8dce, 0x00}, - {0x8dcf, 0x00}, - {0x8dd0, 0x00}, - {0x8dd1, 0x00}, - {0x8dd2, 0x00}, - {0x8dd3, 0x00}, - {0x8dd4, 0x00}, - {0x8dd5, 0x00}, - {0x8dd6, 0x00}, - {0x8dd7, 0x00}, - {0x8dd8, 0x00}, - {0x8dd9, 0x00}, - {0x8dda, 0x00}, - {0x8ddb, 0x00}, - {0x8ddc, 0x00}, - {0x8ddd, 0x00}, - {0x8dde, 0x00}, - {0x8ddf, 0x00}, - {0x8de0, 0x00}, - {0x8de1, 0x00}, - {0x8de2, 0x00}, - {0x8de3, 0x00}, - {0x8de4, 0x00}, - {0x8de5, 0x00}, - {0x8de6, 0x00}, - {0x8de7, 0x00}, - {0x8de8, 0x00}, - {0x8de9, 0x00}, - {0x8dea, 0x00}, - {0x8deb, 0x00}, - {0x8dec, 0x00}, - {0x8ded, 0x00}, - {0x8dee, 0x00}, - {0x8def, 0x00}, - {0x8df0, 0x00}, - {0x8df1, 0x00}, - {0x8df2, 0x00}, - {0x8df3, 0x00}, - {0x8df4, 0x00}, - {0x8df5, 0x00}, - {0x8df6, 0x00}, - {0x8df7, 0x00}, - {0x8df8, 0x00}, - {0x8df9, 0x00}, - {0x8dfa, 0x00}, - {0x8dfb, 0x00}, - {0x8dfc, 0x00}, - {0x8dfd, 0x00}, - {0x8dfe, 0x00}, - {0x8dff, 0x00}, - {0x8e00, 0x11}, - {0x8e01, 0x04}, - {0x8e02, 0x21}, - {0x8e03, 0x15}, - {0x8e04, 0x12}, - {0x8e05, 0x52}, - {0x8e06, 0x4f}, - {0x8e07, 0x56}, - {0x8e08, 0x54}, - {0x8e09, 0x20}, - {0x8e0a, 0x20}, - {0x8e0b, 0x20}, - {0x8e0c, 0x20}, - {0x8e0d, 0x20}, - {0x8e0e, 0x10}, - {0x8e0f, 0x01}, - {0x8e10, 0x10}, - {0x8e11, 0x00}, - {0x8e12, 0x56}, - {0x8e13, 0x40}, - {0x8e14, 0x1a}, - {0x8e15, 0x30}, - {0x8e16, 0x29}, - {0x8e17, 0x7e}, - {0x8e18, 0x00}, - {0x8e19, 0x30}, - {0x8e1a, 0x04}, - {0x8e1b, 0x20}, - {0x8e1c, 0xdf}, - {0x8e1d, 0x30}, - {0x8e1e, 0x05}, - {0x8e1f, 0x40}, - {0x8e20, 0xbf}, - {0x8e21, 0x50}, - {0x8e22, 0x25}, - {0x8e23, 0x04}, - {0x8e24, 0xfb}, - {0x8e25, 0x50}, - {0x8e26, 0x03}, - {0x8e27, 0x00}, - {0x8e28, 0xfd}, - {0x8e29, 0x50}, - {0x8e2a, 0x27}, - {0x8e2b, 0x01}, - {0x8e2c, 0xfe}, - {0x8e2d, 0x60}, - {0x8e2e, 0x00}, - {0x8e2f, 0x11}, - {0x8e30, 0x00}, - {0x8e31, 0x3f}, - {0x8e32, 0x05}, - {0x8e33, 0x30}, - {0x8e34, 0x00}, - {0x8e35, 0x3f}, - {0x8e36, 0x06}, - {0x8e37, 0x22}, - {0x8e38, 0x00}, - {0x8e39, 0x3f}, - {0x8e3a, 0x01}, - {0x8e3b, 0x29}, - {0x8e3c, 0x00}, - {0x8e3d, 0x3f}, - {0x8e3e, 0x02}, - {0x8e3f, 0x00}, - {0x8e40, 0x00}, - {0x8e41, 0x36}, - {0x8e42, 0x06}, - {0x8e43, 0x07}, - {0x8e44, 0x00}, - {0x8e45, 0x3f}, - {0x8e46, 0x0b}, - {0x8e47, 0x0f}, - {0x8e48, 0xf0}, - {0x8e49, 0x30}, - {0x8e4a, 0x01}, - {0x8e4b, 0x40}, - {0x8e4c, 0xbf}, - {0x8e4d, 0x30}, - {0x8e4e, 0x01}, - {0x8e4f, 0x00}, - {0x8e50, 0xbf}, - {0x8e51, 0x30}, - {0x8e52, 0x29}, - {0x8e53, 0x70}, - {0x8e54, 0x00}, - {0x8e55, 0x3a}, - {0x8e56, 0x00}, - {0x8e57, 0x00}, - {0x8e58, 0xff}, - {0x8e59, 0x3a}, - {0x8e5a, 0x00}, - {0x8e5b, 0x00}, - {0x8e5c, 0xff}, - {0x8e5d, 0x36}, - {0x8e5e, 0x03}, - {0x8e5f, 0x36}, - {0x8e60, 0x02}, - {0x8e61, 0x41}, - {0x8e62, 0x44}, - {0x8e63, 0x58}, - {0x8e64, 0x20}, - {0x8e65, 0x18}, - {0x8e66, 0x10}, - {0x8e67, 0x0a}, - {0x8e68, 0x04}, - {0x8e69, 0x04}, - {0x8e6a, 0x00}, - {0x8e6b, 0x03}, - {0x8e6c, 0xff}, - {0x8e6d, 0x64}, - {0x8e6e, 0x00}, - {0x8e6f, 0x00}, - {0x8e70, 0x80}, - {0x8e71, 0x00}, - {0x8e72, 0x00}, - {0x8e73, 0x00}, - {0x8e74, 0x00}, - {0x8e75, 0x00}, - {0x8e76, 0x00}, - {0x8e77, 0x02}, - {0x8e78, 0x04}, - {0x8e79, 0x06}, - {0x8e7a, 0x00}, - {0x8e7b, 0x03}, - {0x8e7c, 0x98}, - {0x8e7d, 0x00}, - {0x8e7e, 0xcc}, - {0x8e7f, 0x50}, - {0x8e80, 0x3c}, - {0x8e81, 0x28}, - {0x8e82, 0x1e}, - {0x8e83, 0x10}, - {0x8e84, 0x10}, - {0x8e85, 0x00}, - {0x8e86, 0x00}, - {0x8e87, 0x00}, - {0x8e88, 0x6e}, - {0x8e89, 0x06}, - {0x8e8a, 0x05}, - {0x8e8b, 0x00}, - {0x8e8c, 0xa5}, - {0x8e8d, 0x5a}, - {0x3022, 0x00}, - {0x3023, 0x00}, - {0x3024, 0x00}, - {0x3025, 0x00}, - {0x3026, 0x00}, - {0x3027, 0x00}, - {0x3028, 0x00}, - {0x3029, 0xFF}, - {0x3000, 0x00}, -#elif 0 // ddl@rock-chips.com : Touch Focus from OVT - {0x3000,0x20}, -{0x8000,0x02}, -{0x8001,0x0f}, -{0x8002,0xd6}, -{0x8003,0x02}, -{0x8004,0x0a}, -{0x8005,0x39}, -{0x8006,0xc2}, -{0x8007,0x01}, -{0x8008,0x22}, -{0x8009,0x22}, -{0x800a,0x00}, -{0x800b,0x02}, -{0x800c,0x0f}, -{0x800d,0xb2}, -{0x800e,0xe5}, -{0x800f,0x1f}, -{0x8010,0x70}, -{0x8011,0x72}, -{0x8012,0xf5}, -{0x8013,0x1e}, -{0x8014,0xd2}, -{0x8015,0x35}, -{0x8016,0xff}, -{0x8017,0xef}, -{0x8018,0x25}, -{0x8019,0xe0}, -{0x801a,0x24}, -{0x801b,0x4e}, -{0x801c,0xf8}, -{0x801d,0xe4}, -{0x801e,0xf6}, -{0x801f,0x08}, -{0x8020,0xf6}, -{0x8021,0x0f}, -{0x8022,0xbf}, -{0x8023,0x34}, -{0x8024,0xf2}, -{0x8025,0x90}, -{0x8026,0x0e}, -{0x8027,0x93}, -{0x8028,0xe4}, -{0x8029,0x93}, -{0x802a,0xff}, -{0x802b,0xe5}, -{0x802c,0x4b}, -{0x802d,0xc3}, -{0x802e,0x9f}, -{0x802f,0x50}, -{0x8030,0x04}, -{0x8031,0x7f}, -{0x8032,0x05}, -{0x8033,0x80}, -{0x8034,0x02}, -{0x8035,0x7f}, -{0x8036,0xfb}, -{0x8037,0x78}, -{0x8038,0xbd}, -{0x8039,0xa6}, -{0x803a,0x07}, -{0x803b,0x12}, -{0x803c,0x0f}, -{0x803d,0x04}, -{0x803e,0x40}, -{0x803f,0x04}, -{0x8040,0x7f}, -{0x8041,0x03}, -{0x8042,0x80}, -{0x8043,0x02}, -{0x8044,0x7f}, -{0x8045,0x30}, -{0x8046,0x78}, -{0x8047,0xbc}, -{0x8048,0xa6}, -{0x8049,0x07}, -{0x804a,0xe6}, -{0x804b,0x18}, -{0x804c,0xf6}, -{0x804d,0x08}, -{0x804e,0xe6}, -{0x804f,0x78}, -{0x8050,0xb9}, -{0x8051,0xf6}, -{0x8052,0x78}, -{0x8053,0xbc}, -{0x8054,0xe6}, -{0x8055,0x78}, -{0x8056,0xba}, -{0x8057,0xf6}, -{0x8058,0x78}, -{0x8059,0xbf}, -{0x805a,0x76}, -{0x805b,0x33}, -{0x805c,0xe4}, -{0x805d,0x08}, -{0x805e,0xf6}, -{0x805f,0x78}, -{0x8060,0xb8}, -{0x8061,0x76}, -{0x8062,0x01}, -{0x8063,0x75}, -{0x8064,0x4a}, -{0x8065,0x02}, -{0x8066,0x78}, -{0x8067,0xb6}, -{0x8068,0xf6}, -{0x8069,0x08}, -{0x806a,0xf6}, -{0x806b,0x74}, -{0x806c,0xff}, -{0x806d,0x78}, -{0x806e,0xc1}, -{0x806f,0xf6}, -{0x8070,0x08}, -{0x8071,0xf6}, -{0x8072,0x75}, -{0x8073,0x1f}, -{0x8074,0x01}, -{0x8075,0x78}, -{0x8076,0xbc}, -{0x8077,0xe6}, -{0x8078,0x75}, -{0x8079,0xf0}, -{0x807a,0x05}, -{0x807b,0xa4}, -{0x807c,0xf5}, -{0x807d,0x4b}, -{0x807e,0x12}, -{0x807f,0x0a}, -{0x8080,0xff}, -{0x8081,0xc2}, -{0x8082,0x37}, -{0x8083,0x22}, -{0x8084,0x78}, -{0x8085,0xb8}, -{0x8086,0xe6}, -{0x8087,0xd3}, -{0x8088,0x94}, -{0x8089,0x00}, -{0x808a,0x40}, -{0x808b,0x02}, -{0x808c,0x16}, -{0x808d,0x22}, -{0x808e,0xe5}, -{0x808f,0x1f}, -{0x8090,0xb4}, -{0x8091,0x05}, -{0x8092,0x23}, -{0x8093,0xe4}, -{0x8094,0xf5}, -{0x8095,0x1f}, -{0x8096,0xc2}, -{0x8097,0x01}, -{0x8098,0x78}, -{0x8099,0xb6}, -{0x809a,0xe6}, -{0x809b,0xfe}, -{0x809c,0x08}, -{0x809d,0xe6}, -{0x809e,0xff}, -{0x809f,0x78}, -{0x80a0,0x4e}, -{0x80a1,0xa6}, -{0x80a2,0x06}, -{0x80a3,0x08}, -{0x80a4,0xa6}, -{0x80a5,0x07}, -{0x80a6,0xa2}, -{0x80a7,0x37}, -{0x80a8,0xe4}, -{0x80a9,0x33}, -{0x80aa,0xf5}, -{0x80ab,0x3c}, -{0x80ac,0x90}, -{0x80ad,0x30}, -{0x80ae,0x28}, -{0x80af,0xf0}, -{0x80b0,0x75}, -{0x80b1,0x1e}, -{0x80b2,0x10}, -{0x80b3,0xd2}, -{0x80b4,0x35}, -{0x80b5,0x22}, -{0x80b6,0xe5}, -{0x80b7,0x4b}, -{0x80b8,0x75}, -{0x80b9,0xf0}, -{0x80ba,0x05}, -{0x80bb,0x84}, -{0x80bc,0x78}, -{0x80bd,0xbc}, -{0x80be,0xf6}, -{0x80bf,0x90}, -{0x80c0,0x0e}, -{0x80c1,0x8c}, -{0x80c2,0xe4}, -{0x80c3,0x93}, -{0x80c4,0xff}, -{0x80c5,0x25}, -{0x80c6,0xe0}, -{0x80c7,0x24}, -{0x80c8,0x0a}, -{0x80c9,0xf8}, -{0x80ca,0xe6}, -{0x80cb,0xfc}, -{0x80cc,0x08}, -{0x80cd,0xe6}, -{0x80ce,0xfd}, -{0x80cf,0x78}, -{0x80d0,0xbc}, -{0x80d1,0xe6}, -{0x80d2,0x25}, -{0x80d3,0xe0}, -{0x80d4,0x24}, -{0x80d5,0x4e}, -{0x80d6,0xf8}, -{0x80d7,0xa6}, -{0x80d8,0x04}, -{0x80d9,0x08}, -{0x80da,0xa6}, -{0x80db,0x05}, -{0x80dc,0xef}, -{0x80dd,0x12}, -{0x80de,0x0f}, -{0x80df,0x0b}, -{0x80e0,0xd3}, -{0x80e1,0x78}, -{0x80e2,0xb7}, -{0x80e3,0x96}, -{0x80e4,0xee}, -{0x80e5,0x18}, -{0x80e6,0x96}, -{0x80e7,0x40}, -{0x80e8,0x0d}, -{0x80e9,0x78}, -{0x80ea,0xbc}, -{0x80eb,0xe6}, -{0x80ec,0x78}, -{0x80ed,0xb9}, -{0x80ee,0xf6}, -{0x80ef,0x78}, -{0x80f0,0xb6}, -{0x80f1,0xa6}, -{0x80f2,0x06}, -{0x80f3,0x08}, -{0x80f4,0xa6}, -{0x80f5,0x07}, -{0x80f6,0x90}, -{0x80f7,0x0e}, -{0x80f8,0x8c}, -{0x80f9,0xe4}, -{0x80fa,0x93}, -{0x80fb,0x12}, -{0x80fc,0x0f}, -{0x80fd,0x0b}, -{0x80fe,0xc3}, -{0x80ff,0x78}, -{0x8100,0xc2}, -{0x8101,0x96}, -{0x8102,0xee}, -{0x8103,0x18}, -{0x8104,0x96}, -{0x8105,0x50}, -{0x8106,0x0d}, -{0x8107,0x78}, -{0x8108,0xbc}, -{0x8109,0xe6}, -{0x810a,0x78}, -{0x810b,0xba}, -{0x810c,0xf6}, -{0x810d,0x78}, -{0x810e,0xc1}, -{0x810f,0xa6}, -{0x8110,0x06}, -{0x8111,0x08}, -{0x8112,0xa6}, -{0x8113,0x07}, -{0x8114,0x78}, -{0x8115,0xb6}, -{0x8116,0xe6}, -{0x8117,0xfe}, -{0x8118,0x08}, -{0x8119,0xe6}, -{0x811a,0xc3}, -{0x811b,0x78}, -{0x811c,0xc2}, -{0x811d,0x96}, -{0x811e,0xff}, -{0x811f,0xee}, -{0x8120,0x18}, -{0x8121,0x96}, -{0x8122,0x78}, -{0x8123,0xc3}, -{0x8124,0xf6}, -{0x8125,0x08}, -{0x8126,0xa6}, -{0x8127,0x07}, -{0x8128,0x90}, -{0x8129,0x0e}, -{0x812a,0x95}, -{0x812b,0xe4}, -{0x812c,0x18}, -{0x812d,0x12}, -{0x812e,0x0e}, -{0x812f,0xe9}, -{0x8130,0x40}, -{0x8131,0x02}, -{0x8132,0xd2}, -{0x8133,0x37}, -{0x8134,0x78}, -{0x8135,0xbc}, -{0x8136,0xe6}, -{0x8137,0x08}, -{0x8138,0x26}, -{0x8139,0x08}, -{0x813a,0xf6}, -{0x813b,0xe5}, -{0x813c,0x1f}, -{0x813d,0x64}, -{0x813e,0x01}, -{0x813f,0x70}, -{0x8140,0x4a}, -{0x8141,0xe6}, -{0x8142,0xc3}, -{0x8143,0x78}, -{0x8144,0xc0}, -{0x8145,0x12}, -{0x8146,0x0e}, -{0x8147,0xdf}, -{0x8148,0x40}, -{0x8149,0x05}, -{0x814a,0x12}, -{0x814b,0x0e}, -{0x814c,0xda}, -{0x814d,0x40}, -{0x814e,0x39}, -{0x814f,0x12}, -{0x8150,0x0f}, -{0x8151,0x02}, -{0x8152,0x40}, -{0x8153,0x04}, -{0x8154,0x7f}, -{0x8155,0xfe}, -{0x8156,0x80}, -{0x8157,0x02}, -{0x8158,0x7f}, -{0x8159,0x02}, -{0x815a,0x78}, -{0x815b,0xbd}, -{0x815c,0xa6}, -{0x815d,0x07}, -{0x815e,0x78}, -{0x815f,0xb9}, -{0x8160,0xe6}, -{0x8161,0x24}, -{0x8162,0x03}, -{0x8163,0x78}, -{0x8164,0xbf}, -{0x8165,0xf6}, -{0x8166,0x78}, -{0x8167,0xb9}, -{0x8168,0xe6}, -{0x8169,0x24}, -{0x816a,0xfd}, -{0x816b,0x78}, -{0x816c,0xc0}, -{0x816d,0xf6}, -{0x816e,0x12}, -{0x816f,0x0f}, -{0x8170,0x02}, -{0x8171,0x40}, -{0x8172,0x06}, -{0x8173,0x78}, -{0x8174,0xc0}, -{0x8175,0xe6}, -{0x8176,0xff}, -{0x8177,0x80}, -{0x8178,0x04}, -{0x8179,0x78}, -{0x817a,0xbf}, -{0x817b,0xe6}, -{0x817c,0xff}, -{0x817d,0x78}, -{0x817e,0xbe}, -{0x817f,0xa6}, -{0x8180,0x07}, -{0x8181,0x75}, -{0x8182,0x1f}, -{0x8183,0x02}, -{0x8184,0x78}, -{0x8185,0xb8}, -{0x8186,0x76}, -{0x8187,0x01}, -{0x8188,0x02}, -{0x8189,0x02}, -{0x818a,0x4a}, -{0x818b,0xe5}, -{0x818c,0x1f}, -{0x818d,0x64}, -{0x818e,0x02}, -{0x818f,0x60}, -{0x8190,0x03}, -{0x8191,0x02}, -{0x8192,0x02}, -{0x8193,0x2a}, -{0x8194,0x78}, -{0x8195,0xbe}, -{0x8196,0xe6}, -{0x8197,0xff}, -{0x8198,0xc3}, -{0x8199,0x78}, -{0x819a,0xc0}, -{0x819b,0x12}, -{0x819c,0x0e}, -{0x819d,0xe0}, -{0x819e,0x40}, -{0x819f,0x08}, -{0x81a0,0x12}, -{0x81a1,0x0e}, -{0x81a2,0xda}, -{0x81a3,0x50}, -{0x81a4,0x03}, -{0x81a5,0x02}, -{0x81a6,0x02}, -{0x81a7,0x28}, -{0x81a8,0x12}, -{0x81a9,0x0f}, -{0x81aa,0x02}, -{0x81ab,0x40}, -{0x81ac,0x04}, -{0x81ad,0x7f}, -{0x81ae,0xff}, -{0x81af,0x80}, -{0x81b0,0x02}, -{0x81b1,0x7f}, -{0x81b2,0x01}, -{0x81b3,0x78}, -{0x81b4,0xbd}, -{0x81b5,0xa6}, -{0x81b6,0x07}, -{0x81b7,0x78}, -{0x81b8,0xb9}, -{0x81b9,0xe6}, -{0x81ba,0x04}, -{0x81bb,0x78}, -{0x81bc,0xbf}, -{0x81bd,0xf6}, -{0x81be,0x78}, -{0x81bf,0xb9}, -{0x81c0,0xe6}, -{0x81c1,0x14}, -{0x81c2,0x78}, -{0x81c3,0xc0}, -{0x81c4,0xf6}, -{0x81c5,0x18}, -{0x81c6,0x12}, -{0x81c7,0x0f}, -{0x81c8,0x04}, -{0x81c9,0x40}, -{0x81ca,0x04}, -{0x81cb,0xe6}, -{0x81cc,0xff}, -{0x81cd,0x80}, -{0x81ce,0x02}, -{0x81cf,0x7f}, -{0x81d0,0x00}, -{0x81d1,0x78}, -{0x81d2,0xbf}, -{0x81d3,0xa6}, -{0x81d4,0x07}, -{0x81d5,0xd3}, -{0x81d6,0x08}, -{0x81d7,0xe6}, -{0x81d8,0x64}, -{0x81d9,0x80}, -{0x81da,0x94}, -{0x81db,0x80}, -{0x81dc,0x40}, -{0x81dd,0x04}, -{0x81de,0xe6}, -{0x81df,0xff}, -{0x81e0,0x80}, -{0x81e1,0x02}, -{0x81e2,0x7f}, -{0x81e3,0x00}, -{0x81e4,0x78}, -{0x81e5,0xc0}, -{0x81e6,0xa6}, -{0x81e7,0x07}, -{0x81e8,0xc3}, -{0x81e9,0x18}, -{0x81ea,0xe6}, -{0x81eb,0x64}, -{0x81ec,0x80}, -{0x81ed,0x94}, -{0x81ee,0xb3}, -{0x81ef,0x50}, -{0x81f0,0x04}, -{0x81f1,0xe6}, -{0x81f2,0xff}, -{0x81f3,0x80}, -{0x81f4,0x02}, -{0x81f5,0x7f}, -{0x81f6,0x33}, -{0x81f7,0x78}, -{0x81f8,0xbf}, -{0x81f9,0xa6}, -{0x81fa,0x07}, -{0x81fb,0xc3}, -{0x81fc,0x08}, -{0x81fd,0xe6}, -{0x81fe,0x64}, -{0x81ff,0x80}, -{0x8200,0x94}, -{0x8201,0xb3}, -{0x8202,0x50}, -{0x8203,0x04}, -{0x8204,0xe6}, -{0x8205,0xff}, -{0x8206,0x80}, -{0x8207,0x02}, -{0x8208,0x7f}, -{0x8209,0x33}, -{0x820a,0x78}, -{0x820b,0xc0}, -{0x820c,0xa6}, -{0x820d,0x07}, -{0x820e,0x12}, -{0x820f,0x0f}, -{0x8210,0x02}, -{0x8211,0x40}, -{0x8212,0x06}, -{0x8213,0x78}, -{0x8214,0xc0}, -{0x8215,0xe6}, -{0x8216,0xff}, -{0x8217,0x80}, -{0x8218,0x04}, -{0x8219,0x78}, -{0x821a,0xbf}, -{0x821b,0xe6}, -{0x821c,0xff}, -{0x821d,0x78}, -{0x821e,0xbe}, -{0x821f,0xa6}, -{0x8220,0x07}, -{0x8221,0x75}, -{0x8222,0x1f}, -{0x8223,0x03}, -{0x8224,0x78}, -{0x8225,0xb8}, -{0x8226,0x76}, -{0x8227,0x01}, -{0x8228,0x80}, -{0x8229,0x20}, -{0x822a,0xe5}, -{0x822b,0x1f}, -{0x822c,0x64}, -{0x822d,0x03}, -{0x822e,0x70}, -{0x822f,0x26}, -{0x8230,0x78}, -{0x8231,0xbe}, -{0x8232,0xe6}, -{0x8233,0xff}, -{0x8234,0xc3}, -{0x8235,0x78}, -{0x8236,0xc0}, -{0x8237,0x12}, -{0x8238,0x0e}, -{0x8239,0xe0}, -{0x823a,0x40}, -{0x823b,0x05}, -{0x823c,0x12}, -{0x823d,0x0e}, -{0x823e,0xda}, -{0x823f,0x40}, -{0x8240,0x09}, -{0x8241,0x78}, -{0x8242,0xb9}, -{0x8243,0xe6}, -{0x8244,0x78}, -{0x8245,0xbe}, -{0x8246,0xf6}, -{0x8247,0x75}, -{0x8248,0x1f}, -{0x8249,0x04}, -{0x824a,0x78}, -{0x824b,0xbe}, -{0x824c,0xe6}, -{0x824d,0x75}, -{0x824e,0xf0}, -{0x824f,0x05}, -{0x8250,0xa4}, -{0x8251,0xf5}, -{0x8252,0x4b}, -{0x8253,0x02}, -{0x8254,0x0a}, -{0x8255,0xff}, -{0x8256,0xe5}, -{0x8257,0x1f}, -{0x8258,0xb4}, -{0x8259,0x04}, -{0x825a,0x10}, -{0x825b,0x90}, -{0x825c,0x0e}, -{0x825d,0x94}, -{0x825e,0xe4}, -{0x825f,0x78}, -{0x8260,0xc3}, -{0x8261,0x12}, -{0x8262,0x0e}, -{0x8263,0xe9}, -{0x8264,0x40}, -{0x8265,0x02}, -{0x8266,0xd2}, -{0x8267,0x37}, -{0x8268,0x75}, -{0x8269,0x1f}, -{0x826a,0x05}, -{0x826b,0x22}, -{0x826c,0x30}, -{0x826d,0x01}, -{0x826e,0x03}, -{0x826f,0x02}, -{0x8270,0x04}, -{0x8271,0xc0}, -{0x8272,0x30}, -{0x8273,0x02}, -{0x8274,0x03}, -{0x8275,0x02}, -{0x8276,0x04}, -{0x8277,0xc0}, -{0x8278,0x90}, -{0x8279,0x51}, -{0x827a,0xa5}, -{0x827b,0xe0}, -{0x827c,0x78}, -{0x827d,0x93}, -{0x827e,0xf6}, -{0x827f,0xa3}, -{0x8280,0xe0}, -{0x8281,0x08}, -{0x8282,0xf6}, -{0x8283,0xa3}, -{0x8284,0xe0}, -{0x8285,0x08}, -{0x8286,0xf6}, -{0x8287,0xe5}, -{0x8288,0x1f}, -{0x8289,0x70}, -{0x828a,0x3c}, -{0x828b,0x75}, -{0x828c,0x1e}, -{0x828d,0x20}, -{0x828e,0xd2}, -{0x828f,0x35}, -{0x8290,0x12}, -{0x8291,0x0c}, -{0x8292,0x7a}, -{0x8293,0x78}, -{0x8294,0x7e}, -{0x8295,0xa6}, -{0x8296,0x06}, -{0x8297,0x08}, -{0x8298,0xa6}, -{0x8299,0x07}, -{0x829a,0x78}, -{0x829b,0x8b}, -{0x829c,0xa6}, -{0x829d,0x09}, -{0x829e,0x18}, -{0x829f,0x76}, -{0x82a0,0x01}, -{0x82a1,0x12}, -{0x82a2,0x0c}, -{0x82a3,0x5b}, -{0x82a4,0x78}, -{0x82a5,0x4e}, -{0x82a6,0xa6}, -{0x82a7,0x06}, -{0x82a8,0x08}, -{0x82a9,0xa6}, -{0x82aa,0x07}, -{0x82ab,0x78}, -{0x82ac,0x8b}, -{0x82ad,0xe6}, -{0x82ae,0x78}, -{0x82af,0x6e}, -{0x82b0,0xf6}, -{0x82b1,0x75}, -{0x82b2,0x1f}, -{0x82b3,0x01}, -{0x82b4,0x78}, -{0x82b5,0x93}, -{0x82b6,0xe6}, -{0x82b7,0x78}, -{0x82b8,0x90}, -{0x82b9,0xf6}, -{0x82ba,0x78}, -{0x82bb,0x94}, -{0x82bc,0xe6}, -{0x82bd,0x78}, -{0x82be,0x91}, -{0x82bf,0xf6}, -{0x82c0,0x78}, -{0x82c1,0x95}, -{0x82c2,0xe6}, -{0x82c3,0x78}, -{0x82c4,0x92}, -{0x82c5,0xf6}, -{0x82c6,0x22}, -{0x82c7,0x79}, -{0x82c8,0x90}, -{0x82c9,0xe7}, -{0x82ca,0xd3}, -{0x82cb,0x78}, -{0x82cc,0x93}, -{0x82cd,0x96}, -{0x82ce,0x40}, -{0x82cf,0x05}, -{0x82d0,0xe7}, -{0x82d1,0x96}, -{0x82d2,0xff}, -{0x82d3,0x80}, -{0x82d4,0x08}, -{0x82d5,0xc3}, -{0x82d6,0x79}, -{0x82d7,0x93}, -{0x82d8,0xe7}, -{0x82d9,0x78}, -{0x82da,0x90}, -{0x82db,0x96}, -{0x82dc,0xff}, -{0x82dd,0x78}, -{0x82de,0x88}, -{0x82df,0x76}, -{0x82e0,0x00}, -{0x82e1,0x08}, -{0x82e2,0xa6}, -{0x82e3,0x07}, -{0x82e4,0x79}, -{0x82e5,0x91}, -{0x82e6,0xe7}, -{0x82e7,0xd3}, -{0x82e8,0x78}, -{0x82e9,0x94}, -{0x82ea,0x96}, -{0x82eb,0x40}, -{0x82ec,0x05}, -{0x82ed,0xe7}, -{0x82ee,0x96}, -{0x82ef,0xff}, -{0x82f0,0x80}, -{0x82f1,0x08}, -{0x82f2,0xc3}, -{0x82f3,0x79}, -{0x82f4,0x94}, -{0x82f5,0xe7}, -{0x82f6,0x78}, -{0x82f7,0x91}, -{0x82f8,0x96}, -{0x82f9,0xff}, -{0x82fa,0x12}, -{0x82fb,0x0c}, -{0x82fc,0x8e}, -{0x82fd,0x79}, -{0x82fe,0x92}, -{0x82ff,0xe7}, -{0x8300,0xd3}, -{0x8301,0x78}, -{0x8302,0x95}, -{0x8303,0x96}, -{0x8304,0x40}, -{0x8305,0x05}, -{0x8306,0xe7}, -{0x8307,0x96}, -{0x8308,0xff}, -{0x8309,0x80}, -{0x830a,0x08}, -{0x830b,0xc3}, -{0x830c,0x79}, -{0x830d,0x95}, -{0x830e,0xe7}, -{0x830f,0x78}, -{0x8310,0x92}, -{0x8311,0x96}, -{0x8312,0xff}, -{0x8313,0x12}, -{0x8314,0x0c}, -{0x8315,0x8e}, -{0x8316,0x12}, -{0x8317,0x0c}, -{0x8318,0x5b}, -{0x8319,0x78}, -{0x831a,0x8a}, -{0x831b,0xe6}, -{0x831c,0x25}, -{0x831d,0xe0}, -{0x831e,0x24}, -{0x831f,0x4e}, -{0x8320,0xf8}, -{0x8321,0xa6}, -{0x8322,0x06}, -{0x8323,0x08}, -{0x8324,0xa6}, -{0x8325,0x07}, -{0x8326,0x78}, -{0x8327,0x8a}, -{0x8328,0xe6}, -{0x8329,0x24}, -{0x832a,0x6e}, -{0x832b,0xf8}, -{0x832c,0xa6}, -{0x832d,0x09}, -{0x832e,0x78}, -{0x832f,0x8a}, -{0x8330,0xe6}, -{0x8331,0x24}, -{0x8332,0x01}, -{0x8333,0xff}, -{0x8334,0xe4}, -{0x8335,0x33}, -{0x8336,0xfe}, -{0x8337,0xd3}, -{0x8338,0xef}, -{0x8339,0x94}, -{0x833a,0x0f}, -{0x833b,0xee}, -{0x833c,0x64}, -{0x833d,0x80}, -{0x833e,0x94}, -{0x833f,0x80}, -{0x8340,0x40}, -{0x8341,0x04}, -{0x8342,0x7f}, -{0x8343,0x00}, -{0x8344,0x80}, -{0x8345,0x05}, -{0x8346,0x78}, -{0x8347,0x8a}, -{0x8348,0xe6}, -{0x8349,0x04}, -{0x834a,0xff}, -{0x834b,0x78}, -{0x834c,0x8a}, -{0x834d,0xa6}, -{0x834e,0x07}, -{0x834f,0xe5}, -{0x8350,0x1f}, -{0x8351,0xb4}, -{0x8352,0x01}, -{0x8353,0x0a}, -{0x8354,0xe6}, -{0x8355,0x60}, -{0x8356,0x03}, -{0x8357,0x02}, -{0x8358,0x04}, -{0x8359,0xc0}, -{0x835a,0x75}, -{0x835b,0x1f}, -{0x835c,0x02}, -{0x835d,0x22}, -{0x835e,0x12}, -{0x835f,0x0c}, -{0x8360,0x7a}, -{0x8361,0x78}, -{0x8362,0x80}, -{0x8363,0xa6}, -{0x8364,0x06}, -{0x8365,0x08}, -{0x8366,0xa6}, -{0x8367,0x07}, -{0x8368,0x12}, -{0x8369,0x0c}, -{0x836a,0x7a}, -{0x836b,0x78}, -{0x836c,0x82}, -{0x836d,0xa6}, -{0x836e,0x06}, -{0x836f,0x08}, -{0x8370,0xa6}, -{0x8371,0x07}, -{0x8372,0x78}, -{0x8373,0x6e}, -{0x8374,0xe6}, -{0x8375,0x78}, -{0x8376,0x8c}, -{0x8377,0xf6}, -{0x8378,0x78}, -{0x8379,0x6e}, -{0x837a,0xe6}, -{0x837b,0x78}, -{0x837c,0x8d}, -{0x837d,0xf6}, -{0x837e,0x7f}, -{0x837f,0x01}, -{0x8380,0xef}, -{0x8381,0x25}, -{0x8382,0xe0}, -{0x8383,0x24}, -{0x8384,0x4f}, -{0x8385,0xf9}, -{0x8386,0xc3}, -{0x8387,0x78}, -{0x8388,0x81}, -{0x8389,0xe6}, -{0x838a,0x97}, -{0x838b,0x18}, -{0x838c,0xe6}, -{0x838d,0x19}, -{0x838e,0x97}, -{0x838f,0x50}, -{0x8390,0x0a}, -{0x8391,0x12}, -{0x8392,0x0c}, -{0x8393,0x82}, -{0x8394,0x78}, -{0x8395,0x80}, -{0x8396,0xa6}, -{0x8397,0x04}, -{0x8398,0x08}, -{0x8399,0xa6}, -{0x839a,0x05}, -{0x839b,0x74}, -{0x839c,0x6e}, -{0x839d,0x2f}, -{0x839e,0xf9}, -{0x839f,0x78}, -{0x83a0,0x8c}, -{0x83a1,0xe6}, -{0x83a2,0xc3}, -{0x83a3,0x97}, -{0x83a4,0x50}, -{0x83a5,0x08}, -{0x83a6,0x74}, -{0x83a7,0x6e}, -{0x83a8,0x2f}, -{0x83a9,0xf8}, -{0x83aa,0xe6}, -{0x83ab,0x78}, -{0x83ac,0x8c}, -{0x83ad,0xf6}, -{0x83ae,0xef}, -{0x83af,0x25}, -{0x83b0,0xe0}, -{0x83b1,0x24}, -{0x83b2,0x4f}, -{0x83b3,0xf9}, -{0x83b4,0xd3}, -{0x83b5,0x78}, -{0x83b6,0x83}, -{0x83b7,0xe6}, -{0x83b8,0x97}, -{0x83b9,0x18}, -{0x83ba,0xe6}, -{0x83bb,0x19}, -{0x83bc,0x97}, -{0x83bd,0x40}, -{0x83be,0x0a}, -{0x83bf,0x12}, -{0x83c0,0x0c}, -{0x83c1,0x82}, -{0x83c2,0x78}, -{0x83c3,0x82}, -{0x83c4,0xa6}, -{0x83c5,0x04}, -{0x83c6,0x08}, -{0x83c7,0xa6}, -{0x83c8,0x05}, -{0x83c9,0x74}, -{0x83ca,0x6e}, -{0x83cb,0x2f}, -{0x83cc,0xf9}, -{0x83cd,0x78}, -{0x83ce,0x8d}, -{0x83cf,0xe6}, -{0x83d0,0xd3}, -{0x83d1,0x97}, -{0x83d2,0x40}, -{0x83d3,0x08}, -{0x83d4,0x74}, -{0x83d5,0x6e}, -{0x83d6,0x2f}, -{0x83d7,0xf8}, -{0x83d8,0xe6}, -{0x83d9,0x78}, -{0x83da,0x8d}, -{0x83db,0xf6}, -{0x83dc,0x0f}, -{0x83dd,0xef}, -{0x83de,0x64}, -{0x83df,0x10}, -{0x83e0,0x70}, -{0x83e1,0x9e}, -{0x83e2,0xc3}, -{0x83e3,0x79}, -{0x83e4,0x81}, -{0x83e5,0xe7}, -{0x83e6,0x78}, -{0x83e7,0x83}, -{0x83e8,0x96}, -{0x83e9,0xff}, -{0x83ea,0x19}, -{0x83eb,0xe7}, -{0x83ec,0x18}, -{0x83ed,0x96}, -{0x83ee,0x78}, -{0x83ef,0x84}, -{0x83f0,0xf6}, -{0x83f1,0x08}, -{0x83f2,0xa6}, -{0x83f3,0x07}, -{0x83f4,0xc3}, -{0x83f5,0x79}, -{0x83f6,0x8c}, -{0x83f7,0xe7}, -{0x83f8,0x78}, -{0x83f9,0x8d}, -{0x83fa,0x96}, -{0x83fb,0x08}, -{0x83fc,0xf6}, -{0x83fd,0xd3}, -{0x83fe,0x79}, -{0x83ff,0x81}, -{0x8400,0xe7}, -{0x8401,0x78}, -{0x8402,0x7f}, -{0x8403,0x96}, -{0x8404,0x19}, -{0x8405,0xe7}, -{0x8406,0x18}, -{0x8407,0x96}, -{0x8408,0x40}, -{0x8409,0x05}, -{0x840a,0x09}, -{0x840b,0xe7}, -{0x840c,0x08}, -{0x840d,0x80}, -{0x840e,0x06}, -{0x840f,0xc3}, -{0x8410,0x79}, -{0x8411,0x7f}, -{0x8412,0xe7}, -{0x8413,0x78}, -{0x8414,0x81}, -{0x8415,0x96}, -{0x8416,0xff}, -{0x8417,0x19}, -{0x8418,0xe7}, -{0x8419,0x18}, -{0x841a,0x96}, -{0x841b,0xfe}, -{0x841c,0x78}, -{0x841d,0x86}, -{0x841e,0xa6}, -{0x841f,0x06}, -{0x8420,0x08}, -{0x8421,0xa6}, -{0x8422,0x07}, -{0x8423,0x79}, -{0x8424,0x8c}, -{0x8425,0xe7}, -{0x8426,0xd3}, -{0x8427,0x78}, -{0x8428,0x8b}, -{0x8429,0x96}, -{0x842a,0x40}, -{0x842b,0x05}, -{0x842c,0xe7}, -{0x842d,0x96}, -{0x842e,0xff}, -{0x842f,0x80}, -{0x8430,0x08}, -{0x8431,0xc3}, -{0x8432,0x79}, -{0x8433,0x8b}, -{0x8434,0xe7}, -{0x8435,0x78}, -{0x8436,0x8c}, -{0x8437,0x96}, -{0x8438,0xff}, -{0x8439,0x78}, -{0x843a,0x8f}, -{0x843b,0xa6}, -{0x843c,0x07}, -{0x843d,0xe5}, -{0x843e,0x1f}, -{0x843f,0x64}, -{0x8440,0x02}, -{0x8441,0x70}, -{0x8442,0x69}, -{0x8443,0x90}, -{0x8444,0x0e}, -{0x8445,0x91}, -{0x8446,0x93}, -{0x8447,0xff}, -{0x8448,0x18}, -{0x8449,0xe6}, -{0x844a,0xc3}, -{0x844b,0x9f}, -{0x844c,0x50}, -{0x844d,0x72}, -{0x844e,0x12}, -{0x844f,0x0c}, -{0x8450,0x4a}, -{0x8451,0x12}, -{0x8452,0x0c}, -{0x8453,0x2f}, -{0x8454,0x90}, -{0x8455,0x0e}, -{0x8456,0x8e}, -{0x8457,0x12}, -{0x8458,0x0c}, -{0x8459,0x38}, -{0x845a,0x78}, -{0x845b,0x80}, -{0x845c,0x12}, -{0x845d,0x0c}, -{0x845e,0x6b}, -{0x845f,0x7b}, -{0x8460,0x04}, -{0x8461,0x12}, -{0x8462,0x0c}, -{0x8463,0x1d}, -{0x8464,0xc3}, -{0x8465,0x12}, -{0x8466,0x06}, -{0x8467,0x45}, -{0x8468,0x50}, -{0x8469,0x56}, -{0x846a,0x90}, -{0x846b,0x0e}, -{0x846c,0x92}, -{0x846d,0xe4}, -{0x846e,0x93}, -{0x846f,0xff}, -{0x8470,0x78}, -{0x8471,0x8f}, -{0x8472,0xe6}, -{0x8473,0x9f}, -{0x8474,0x40}, -{0x8475,0x02}, -{0x8476,0x80}, -{0x8477,0x11}, -{0x8478,0x90}, -{0x8479,0x0e}, -{0x847a,0x90}, -{0x847b,0xe4}, -{0x847c,0x93}, -{0x847d,0xff}, -{0x847e,0xd3}, -{0x847f,0x78}, -{0x8480,0x89}, -{0x8481,0xe6}, -{0x8482,0x9f}, -{0x8483,0x18}, -{0x8484,0xe6}, -{0x8485,0x94}, -{0x8486,0x00}, -{0x8487,0x40}, -{0x8488,0x03}, -{0x8489,0x75}, -{0x848a,0x1f}, -{0x848b,0x05}, -{0x848c,0x12}, -{0x848d,0x0c}, -{0x848e,0x4a}, -{0x848f,0x12}, -{0x8490,0x0c}, -{0x8491,0x2f}, -{0x8492,0x90}, -{0x8493,0x0e}, -{0x8494,0x8f}, -{0x8495,0x12}, -{0x8496,0x0c}, -{0x8497,0x38}, -{0x8498,0x78}, -{0x8499,0x7e}, -{0x849a,0x12}, -{0x849b,0x0c}, -{0x849c,0x6b}, -{0x849d,0x7b}, -{0x849e,0x40}, -{0x849f,0x12}, -{0x84a0,0x0c}, -{0x84a1,0x1d}, -{0x84a2,0xd3}, -{0x84a3,0x12}, -{0x84a4,0x06}, -{0x84a5,0x45}, -{0x84a6,0x40}, -{0x84a7,0x18}, -{0x84a8,0x75}, -{0x84a9,0x1f}, -{0x84aa,0x05}, -{0x84ab,0x22}, -{0x84ac,0xe5}, -{0x84ad,0x1f}, -{0x84ae,0xb4}, -{0x84af,0x05}, -{0x84b0,0x0f}, -{0x84b1,0xd2}, -{0x84b2,0x01}, -{0x84b3,0xc2}, -{0x84b4,0x02}, -{0x84b5,0xe4}, -{0x84b6,0xf5}, -{0x84b7,0x1f}, -{0x84b8,0xf5}, -{0x84b9,0x1e}, -{0x84ba,0xd2}, -{0x84bb,0x35}, -{0x84bc,0xd2}, -{0x84bd,0x33}, -{0x84be,0xd2}, -{0x84bf,0x36}, -{0x84c0,0x22}, -{0x84c1,0xef}, -{0x84c2,0x8d}, -{0x84c3,0xf0}, -{0x84c4,0xa4}, -{0x84c5,0xa8}, -{0x84c6,0xf0}, -{0x84c7,0xcf}, -{0x84c8,0x8c}, -{0x84c9,0xf0}, -{0x84ca,0xa4}, -{0x84cb,0x28}, -{0x84cc,0xce}, -{0x84cd,0x8d}, -{0x84ce,0xf0}, -{0x84cf,0xa4}, -{0x84d0,0x2e}, -{0x84d1,0xfe}, -{0x84d2,0x22}, -{0x84d3,0xbc}, -{0x84d4,0x00}, -{0x84d5,0x0b}, -{0x84d6,0xbe}, -{0x84d7,0x00}, -{0x84d8,0x29}, -{0x84d9,0xef}, -{0x84da,0x8d}, -{0x84db,0xf0}, -{0x84dc,0x84}, -{0x84dd,0xff}, -{0x84de,0xad}, -{0x84df,0xf0}, -{0x84e0,0x22}, -{0x84e1,0xe4}, -{0x84e2,0xcc}, -{0x84e3,0xf8}, -{0x84e4,0x75}, -{0x84e5,0xf0}, -{0x84e6,0x08}, -{0x84e7,0xef}, -{0x84e8,0x2f}, -{0x84e9,0xff}, -{0x84ea,0xee}, -{0x84eb,0x33}, -{0x84ec,0xfe}, -{0x84ed,0xec}, -{0x84ee,0x33}, -{0x84ef,0xfc}, -{0x84f0,0xee}, -{0x84f1,0x9d}, -{0x84f2,0xec}, -{0x84f3,0x98}, -{0x84f4,0x40}, -{0x84f5,0x05}, -{0x84f6,0xfc}, -{0x84f7,0xee}, -{0x84f8,0x9d}, -{0x84f9,0xfe}, -{0x84fa,0x0f}, -{0x84fb,0xd5}, -{0x84fc,0xf0}, -{0x84fd,0xe9}, -{0x84fe,0xe4}, -{0x84ff,0xce}, -{0x8500,0xfd}, -{0x8501,0x22}, -{0x8502,0xed}, -{0x8503,0xf8}, -{0x8504,0xf5}, -{0x8505,0xf0}, -{0x8506,0xee}, -{0x8507,0x84}, -{0x8508,0x20}, -{0x8509,0xd2}, -{0x850a,0x1c}, -{0x850b,0xfe}, -{0x850c,0xad}, -{0x850d,0xf0}, -{0x850e,0x75}, -{0x850f,0xf0}, -{0x8510,0x08}, -{0x8511,0xef}, -{0x8512,0x2f}, -{0x8513,0xff}, -{0x8514,0xed}, -{0x8515,0x33}, -{0x8516,0xfd}, -{0x8517,0x40}, -{0x8518,0x07}, -{0x8519,0x98}, -{0x851a,0x50}, -{0x851b,0x06}, -{0x851c,0xd5}, -{0x851d,0xf0}, -{0x851e,0xf2}, -{0x851f,0x22}, -{0x8520,0xc3}, -{0x8521,0x98}, -{0x8522,0xfd}, -{0x8523,0x0f}, -{0x8524,0xd5}, -{0x8525,0xf0}, -{0x8526,0xea}, -{0x8527,0x22}, -{0x8528,0xe8}, -{0x8529,0x8f}, -{0x852a,0xf0}, -{0x852b,0xa4}, -{0x852c,0xcc}, -{0x852d,0x8b}, -{0x852e,0xf0}, -{0x852f,0xa4}, -{0x8530,0x2c}, -{0x8531,0xfc}, -{0x8532,0xe9}, -{0x8533,0x8e}, -{0x8534,0xf0}, -{0x8535,0xa4}, -{0x8536,0x2c}, -{0x8537,0xfc}, -{0x8538,0x8a}, -{0x8539,0xf0}, -{0x853a,0xed}, -{0x853b,0xa4}, -{0x853c,0x2c}, -{0x853d,0xfc}, -{0x853e,0xea}, -{0x853f,0x8e}, -{0x8540,0xf0}, -{0x8541,0xa4}, -{0x8542,0xcd}, -{0x8543,0xa8}, -{0x8544,0xf0}, -{0x8545,0x8b}, -{0x8546,0xf0}, -{0x8547,0xa4}, -{0x8548,0x2d}, -{0x8549,0xcc}, -{0x854a,0x38}, -{0x854b,0x25}, -{0x854c,0xf0}, -{0x854d,0xfd}, -{0x854e,0xe9}, -{0x854f,0x8f}, -{0x8550,0xf0}, -{0x8551,0xa4}, -{0x8552,0x2c}, -{0x8553,0xcd}, -{0x8554,0x35}, -{0x8555,0xf0}, -{0x8556,0xfc}, -{0x8557,0xeb}, -{0x8558,0x8e}, -{0x8559,0xf0}, -{0x855a,0xa4}, -{0x855b,0xfe}, -{0x855c,0xa9}, -{0x855d,0xf0}, -{0x855e,0xeb}, -{0x855f,0x8f}, -{0x8560,0xf0}, -{0x8561,0xa4}, -{0x8562,0xcf}, -{0x8563,0xc5}, -{0x8564,0xf0}, -{0x8565,0x2e}, -{0x8566,0xcd}, -{0x8567,0x39}, -{0x8568,0xfe}, -{0x8569,0xe4}, -{0x856a,0x3c}, -{0x856b,0xfc}, -{0x856c,0xea}, -{0x856d,0xa4}, -{0x856e,0x2d}, -{0x856f,0xce}, -{0x8570,0x35}, -{0x8571,0xf0}, -{0x8572,0xfd}, -{0x8573,0xe4}, -{0x8574,0x3c}, -{0x8575,0xfc}, -{0x8576,0x22}, -{0x8577,0x75}, -{0x8578,0xf0}, -{0x8579,0x08}, -{0x857a,0x75}, -{0x857b,0x82}, -{0x857c,0x00}, -{0x857d,0xef}, -{0x857e,0x2f}, -{0x857f,0xff}, -{0x8580,0xee}, -{0x8581,0x33}, -{0x8582,0xfe}, -{0x8583,0xcd}, -{0x8584,0x33}, -{0x8585,0xcd}, -{0x8586,0xcc}, -{0x8587,0x33}, -{0x8588,0xcc}, -{0x8589,0xc5}, -{0x858a,0x82}, -{0x858b,0x33}, -{0x858c,0xc5}, -{0x858d,0x82}, -{0x858e,0x9b}, -{0x858f,0xed}, -{0x8590,0x9a}, -{0x8591,0xec}, -{0x8592,0x99}, -{0x8593,0xe5}, -{0x8594,0x82}, -{0x8595,0x98}, -{0x8596,0x40}, -{0x8597,0x0c}, -{0x8598,0xf5}, -{0x8599,0x82}, -{0x859a,0xee}, -{0x859b,0x9b}, -{0x859c,0xfe}, -{0x859d,0xed}, -{0x859e,0x9a}, -{0x859f,0xfd}, -{0x85a0,0xec}, -{0x85a1,0x99}, -{0x85a2,0xfc}, -{0x85a3,0x0f}, -{0x85a4,0xd5}, -{0x85a5,0xf0}, -{0x85a6,0xd6}, -{0x85a7,0xe4}, -{0x85a8,0xce}, -{0x85a9,0xfb}, -{0x85aa,0xe4}, -{0x85ab,0xcd}, -{0x85ac,0xfa}, -{0x85ad,0xe4}, -{0x85ae,0xcc}, -{0x85af,0xf9}, -{0x85b0,0xa8}, -{0x85b1,0x82}, -{0x85b2,0x22}, -{0x85b3,0xb8}, -{0x85b4,0x00}, -{0x85b5,0xc1}, -{0x85b6,0xb9}, -{0x85b7,0x00}, -{0x85b8,0x59}, -{0x85b9,0xba}, -{0x85ba,0x00}, -{0x85bb,0x2d}, -{0x85bc,0xec}, -{0x85bd,0x8b}, -{0x85be,0xf0}, -{0x85bf,0x84}, -{0x85c0,0xcf}, -{0x85c1,0xce}, -{0x85c2,0xcd}, -{0x85c3,0xfc}, -{0x85c4,0xe5}, -{0x85c5,0xf0}, -{0x85c6,0xcb}, -{0x85c7,0xf9}, -{0x85c8,0x78}, -{0x85c9,0x18}, -{0x85ca,0xef}, -{0x85cb,0x2f}, -{0x85cc,0xff}, -{0x85cd,0xee}, -{0x85ce,0x33}, -{0x85cf,0xfe}, -{0x85d0,0xed}, -{0x85d1,0x33}, -{0x85d2,0xfd}, -{0x85d3,0xec}, -{0x85d4,0x33}, -{0x85d5,0xfc}, -{0x85d6,0xeb}, -{0x85d7,0x33}, -{0x85d8,0xfb}, -{0x85d9,0x10}, -{0x85da,0xd7}, -{0x85db,0x03}, -{0x85dc,0x99}, -{0x85dd,0x40}, -{0x85de,0x04}, -{0x85df,0xeb}, -{0x85e0,0x99}, -{0x85e1,0xfb}, -{0x85e2,0x0f}, -{0x85e3,0xd8}, -{0x85e4,0xe5}, -{0x85e5,0xe4}, -{0x85e6,0xf9}, -{0x85e7,0xfa}, -{0x85e8,0x22}, -{0x85e9,0x78}, -{0x85ea,0x18}, -{0x85eb,0xef}, -{0x85ec,0x2f}, -{0x85ed,0xff}, -{0x85ee,0xee}, -{0x85ef,0x33}, -{0x85f0,0xfe}, -{0x85f1,0xed}, -{0x85f2,0x33}, -{0x85f3,0xfd}, -{0x85f4,0xec}, -{0x85f5,0x33}, -{0x85f6,0xfc}, -{0x85f7,0xc9}, -{0x85f8,0x33}, -{0x85f9,0xc9}, -{0x85fa,0x10}, -{0x85fb,0xd7}, -{0x85fc,0x05}, -{0x85fd,0x9b}, -{0x85fe,0xe9}, -{0x85ff,0x9a}, -{0x8600,0x40}, -{0x8601,0x07}, -{0x8602,0xec}, -{0x8603,0x9b}, -{0x8604,0xfc}, -{0x8605,0xe9}, -{0x8606,0x9a}, -{0x8607,0xf9}, -{0x8608,0x0f}, -{0x8609,0xd8}, -{0x860a,0xe0}, -{0x860b,0xe4}, -{0x860c,0xc9}, -{0x860d,0xfa}, -{0x860e,0xe4}, -{0x860f,0xcc}, -{0x8610,0xfb}, -{0x8611,0x22}, -{0x8612,0x75}, -{0x8613,0xf0}, -{0x8614,0x10}, -{0x8615,0xef}, -{0x8616,0x2f}, -{0x8617,0xff}, -{0x8618,0xee}, -{0x8619,0x33}, -{0x861a,0xfe}, -{0x861b,0xed}, -{0x861c,0x33}, -{0x861d,0xfd}, -{0x861e,0xcc}, -{0x861f,0x33}, -{0x8620,0xcc}, -{0x8621,0xc8}, -{0x8622,0x33}, -{0x8623,0xc8}, -{0x8624,0x10}, -{0x8625,0xd7}, -{0x8626,0x07}, -{0x8627,0x9b}, -{0x8628,0xec}, -{0x8629,0x9a}, -{0x862a,0xe8}, -{0x862b,0x99}, -{0x862c,0x40}, -{0x862d,0x0a}, -{0x862e,0xed}, -{0x862f,0x9b}, -{0x8630,0xfd}, -{0x8631,0xec}, -{0x8632,0x9a}, -{0x8633,0xfc}, -{0x8634,0xe8}, -{0x8635,0x99}, -{0x8636,0xf8}, -{0x8637,0x0f}, -{0x8638,0xd5}, -{0x8639,0xf0}, -{0x863a,0xda}, -{0x863b,0xe4}, -{0x863c,0xcd}, -{0x863d,0xfb}, -{0x863e,0xe4}, -{0x863f,0xcc}, -{0x8640,0xfa}, -{0x8641,0xe4}, -{0x8642,0xc8}, -{0x8643,0xf9}, -{0x8644,0x22}, -{0x8645,0xeb}, -{0x8646,0x9f}, -{0x8647,0xf5}, -{0x8648,0xf0}, -{0x8649,0xea}, -{0x864a,0x9e}, -{0x864b,0x42}, -{0x864c,0xf0}, -{0x864d,0xe9}, -{0x864e,0x9d}, -{0x864f,0x42}, -{0x8650,0xf0}, -{0x8651,0xe8}, -{0x8652,0x9c}, -{0x8653,0x45}, -{0x8654,0xf0}, -{0x8655,0x22}, -{0x8656,0xe8}, -{0x8657,0x60}, -{0x8658,0x0f}, -{0x8659,0xec}, -{0x865a,0xc3}, -{0x865b,0x13}, -{0x865c,0xfc}, -{0x865d,0xed}, -{0x865e,0x13}, -{0x865f,0xfd}, -{0x8660,0xee}, -{0x8661,0x13}, -{0x8662,0xfe}, -{0x8663,0xef}, -{0x8664,0x13}, -{0x8665,0xff}, -{0x8666,0xd8}, -{0x8667,0xf1}, -{0x8668,0x22}, -{0x8669,0xe8}, -{0x866a,0x60}, -{0x866b,0x0f}, -{0x866c,0xef}, -{0x866d,0xc3}, -{0x866e,0x33}, -{0x866f,0xff}, -{0x8670,0xee}, -{0x8671,0x33}, -{0x8672,0xfe}, -{0x8673,0xed}, -{0x8674,0x33}, -{0x8675,0xfd}, -{0x8676,0xec}, -{0x8677,0x33}, -{0x8678,0xfc}, -{0x8679,0xd8}, -{0x867a,0xf1}, -{0x867b,0x22}, -{0x867c,0xe4}, -{0x867d,0x93}, -{0x867e,0xfc}, -{0x867f,0x74}, -{0x8680,0x01}, -{0x8681,0x93}, -{0x8682,0xfd}, -{0x8683,0x74}, -{0x8684,0x02}, -{0x8685,0x93}, -{0x8686,0xfe}, -{0x8687,0x74}, -{0x8688,0x03}, -{0x8689,0x93}, -{0x868a,0xff}, -{0x868b,0x22}, -{0x868c,0xe6}, -{0x868d,0xfb}, -{0x868e,0x08}, -{0x868f,0xe6}, -{0x8690,0xf9}, -{0x8691,0x08}, -{0x8692,0xe6}, -{0x8693,0xfa}, -{0x8694,0x08}, -{0x8695,0xe6}, -{0x8696,0xcb}, -{0x8697,0xf8}, -{0x8698,0x22}, -{0x8699,0xec}, -{0x869a,0xf6}, -{0x869b,0x08}, -{0x869c,0xed}, -{0x869d,0xf6}, -{0x869e,0x08}, -{0x869f,0xee}, -{0x86a0,0xf6}, -{0x86a1,0x08}, -{0x86a2,0xef}, -{0x86a3,0xf6}, -{0x86a4,0x22}, -{0x86a5,0xa4}, -{0x86a6,0x25}, -{0x86a7,0x82}, -{0x86a8,0xf5}, -{0x86a9,0x82}, -{0x86aa,0xe5}, -{0x86ab,0xf0}, -{0x86ac,0x35}, -{0x86ad,0x83}, -{0x86ae,0xf5}, -{0x86af,0x83}, -{0x86b0,0x22}, -{0x86b1,0xd0}, -{0x86b2,0x83}, -{0x86b3,0xd0}, -{0x86b4,0x82}, -{0x86b5,0xf8}, -{0x86b6,0xe4}, -{0x86b7,0x93}, -{0x86b8,0x70}, -{0x86b9,0x12}, -{0x86ba,0x74}, -{0x86bb,0x01}, -{0x86bc,0x93}, -{0x86bd,0x70}, -{0x86be,0x0d}, -{0x86bf,0xa3}, -{0x86c0,0xa3}, -{0x86c1,0x93}, -{0x86c2,0xf8}, -{0x86c3,0x74}, -{0x86c4,0x01}, -{0x86c5,0x93}, -{0x86c6,0xf5}, -{0x86c7,0x82}, -{0x86c8,0x88}, -{0x86c9,0x83}, -{0x86ca,0xe4}, -{0x86cb,0x73}, -{0x86cc,0x74}, -{0x86cd,0x02}, -{0x86ce,0x93}, -{0x86cf,0x68}, -{0x86d0,0x60}, -{0x86d1,0xef}, -{0x86d2,0xa3}, -{0x86d3,0xa3}, -{0x86d4,0xa3}, -{0x86d5,0x80}, -{0x86d6,0xdf}, -{0x86d7,0x90}, -{0x86d8,0x38}, -{0x86d9,0x04}, -{0x86da,0x78}, -{0x86db,0x52}, -{0x86dc,0x12}, -{0x86dd,0x0b}, -{0x86de,0xfd}, -{0x86df,0x90}, -{0x86e0,0x38}, -{0x86e1,0x00}, -{0x86e2,0xe0}, -{0x86e3,0xfe}, -{0x86e4,0xa3}, -{0x86e5,0xe0}, -{0x86e6,0xfd}, -{0x86e7,0xed}, -{0x86e8,0xff}, -{0x86e9,0xc3}, -{0x86ea,0x12}, -{0x86eb,0x0b}, -{0x86ec,0x9e}, -{0x86ed,0x90}, -{0x86ee,0x38}, -{0x86ef,0x10}, -{0x86f0,0x12}, -{0x86f1,0x0b}, -{0x86f2,0x92}, -{0x86f3,0x90}, -{0x86f4,0x38}, -{0x86f5,0x06}, -{0x86f6,0x78}, -{0x86f7,0x54}, -{0x86f8,0x12}, -{0x86f9,0x0b}, -{0x86fa,0xfd}, -{0x86fb,0x90}, -{0x86fc,0x38}, -{0x86fd,0x02}, -{0x86fe,0xe0}, -{0x86ff,0xfe}, -{0x8700,0xa3}, -{0x8701,0xe0}, -{0x8702,0xfd}, -{0x8703,0xed}, -{0x8704,0xff}, -{0x8705,0xc3}, -{0x8706,0x12}, -{0x8707,0x0b}, -{0x8708,0x9e}, -{0x8709,0x90}, -{0x870a,0x38}, -{0x870b,0x12}, -{0x870c,0x12}, -{0x870d,0x0b}, -{0x870e,0x92}, -{0x870f,0xa3}, -{0x8710,0xe0}, -{0x8711,0xb4}, -{0x8712,0x31}, -{0x8713,0x07}, -{0x8714,0x78}, -{0x8715,0x52}, -{0x8716,0x79}, -{0x8717,0x52}, -{0x8718,0x12}, -{0x8719,0x0c}, -{0x871a,0x13}, -{0x871b,0x90}, -{0x871c,0x38}, -{0x871d,0x14}, -{0x871e,0xe0}, -{0x871f,0xb4}, -{0x8720,0x71}, -{0x8721,0x15}, -{0x8722,0x78}, -{0x8723,0x52}, -{0x8724,0xe6}, -{0x8725,0xfe}, -{0x8726,0x08}, -{0x8727,0xe6}, -{0x8728,0x78}, -{0x8729,0x02}, -{0x872a,0xce}, -{0x872b,0xc3}, -{0x872c,0x13}, -{0x872d,0xce}, -{0x872e,0x13}, -{0x872f,0xd8}, -{0x8730,0xf9}, -{0x8731,0x79}, -{0x8732,0x53}, -{0x8733,0xf7}, -{0x8734,0xee}, -{0x8735,0x19}, -{0x8736,0xf7}, -{0x8737,0x90}, -{0x8738,0x38}, -{0x8739,0x15}, -{0x873a,0xe0}, -{0x873b,0xb4}, -{0x873c,0x31}, -{0x873d,0x07}, -{0x873e,0x78}, -{0x873f,0x54}, -{0x8740,0x79}, -{0x8741,0x54}, -{0x8742,0x12}, -{0x8743,0x0c}, -{0x8744,0x13}, -{0x8745,0x90}, -{0x8746,0x38}, -{0x8747,0x15}, -{0x8748,0xe0}, -{0x8749,0xb4}, -{0x874a,0x71}, -{0x874b,0x15}, -{0x874c,0x78}, -{0x874d,0x54}, -{0x874e,0xe6}, -{0x874f,0xfe}, -{0x8750,0x08}, -{0x8751,0xe6}, -{0x8752,0x78}, -{0x8753,0x02}, -{0x8754,0xce}, -{0x8755,0xc3}, -{0x8756,0x13}, -{0x8757,0xce}, -{0x8758,0x13}, -{0x8759,0xd8}, -{0x875a,0xf9}, -{0x875b,0x79}, -{0x875c,0x55}, -{0x875d,0xf7}, -{0x875e,0xee}, -{0x875f,0x19}, -{0x8760,0xf7}, -{0x8761,0x79}, -{0x8762,0x52}, -{0x8763,0x12}, -{0x8764,0x0b}, -{0x8765,0xd9}, -{0x8766,0x09}, -{0x8767,0x12}, -{0x8768,0x0b}, -{0x8769,0xd9}, -{0x876a,0xaf}, -{0x876b,0x47}, -{0x876c,0x12}, -{0x876d,0x0b}, -{0x876e,0xb2}, -{0x876f,0xe5}, -{0x8770,0x44}, -{0x8771,0xfb}, -{0x8772,0x7a}, -{0x8773,0x00}, -{0x8774,0xfd}, -{0x8775,0x7c}, -{0x8776,0x00}, -{0x8777,0x12}, -{0x8778,0x04}, -{0x8779,0xd3}, -{0x877a,0x78}, -{0x877b,0x5a}, -{0x877c,0xa6}, -{0x877d,0x06}, -{0x877e,0x08}, -{0x877f,0xa6}, -{0x8780,0x07}, -{0x8781,0xaf}, -{0x8782,0x45}, -{0x8783,0x12}, -{0x8784,0x0b}, -{0x8785,0xb2}, -{0x8786,0xad}, -{0x8787,0x03}, -{0x8788,0x7c}, -{0x8789,0x00}, -{0x878a,0x12}, -{0x878b,0x04}, -{0x878c,0xd3}, -{0x878d,0x78}, -{0x878e,0x56}, -{0x878f,0xa6}, -{0x8790,0x06}, -{0x8791,0x08}, -{0x8792,0xa6}, -{0x8793,0x07}, -{0x8794,0xaf}, -{0x8795,0x48}, -{0x8796,0x78}, -{0x8797,0x54}, -{0x8798,0x12}, -{0x8799,0x0b}, -{0x879a,0xb4}, -{0x879b,0xe5}, -{0x879c,0x43}, -{0x879d,0xfb}, -{0x879e,0xfd}, -{0x879f,0x7c}, -{0x87a0,0x00}, -{0x87a1,0x12}, -{0x87a2,0x04}, -{0x87a3,0xd3}, -{0x87a4,0x78}, -{0x87a5,0x5c}, -{0x87a6,0xa6}, -{0x87a7,0x06}, -{0x87a8,0x08}, -{0x87a9,0xa6}, -{0x87aa,0x07}, -{0x87ab,0xaf}, -{0x87ac,0x46}, -{0x87ad,0x7e}, -{0x87ae,0x00}, -{0x87af,0x78}, -{0x87b0,0x54}, -{0x87b1,0x12}, -{0x87b2,0x0b}, -{0x87b3,0xb6}, -{0x87b4,0xad}, -{0x87b5,0x03}, -{0x87b6,0x7c}, -{0x87b7,0x00}, -{0x87b8,0x12}, -{0x87b9,0x04}, -{0x87ba,0xd3}, -{0x87bb,0x78}, -{0x87bc,0x58}, -{0x87bd,0xa6}, -{0x87be,0x06}, -{0x87bf,0x08}, -{0x87c0,0xa6}, -{0x87c1,0x07}, -{0x87c2,0xc3}, -{0x87c3,0x78}, -{0x87c4,0x5b}, -{0x87c5,0xe6}, -{0x87c6,0x94}, -{0x87c7,0x08}, -{0x87c8,0x18}, -{0x87c9,0xe6}, -{0x87ca,0x94}, -{0x87cb,0x00}, -{0x87cc,0x50}, -{0x87cd,0x05}, -{0x87ce,0x76}, -{0x87cf,0x00}, -{0x87d0,0x08}, -{0x87d1,0x76}, -{0x87d2,0x08}, -{0x87d3,0xc3}, -{0x87d4,0x78}, -{0x87d5,0x5d}, -{0x87d6,0xe6}, -{0x87d7,0x94}, -{0x87d8,0x08}, -{0x87d9,0x18}, -{0x87da,0xe6}, -{0x87db,0x94}, -{0x87dc,0x00}, -{0x87dd,0x50}, -{0x87de,0x05}, -{0x87df,0x76}, -{0x87e0,0x00}, -{0x87e1,0x08}, -{0x87e2,0x76}, -{0x87e3,0x08}, -{0x87e4,0x78}, -{0x87e5,0x5a}, -{0x87e6,0x12}, -{0x87e7,0x0b}, -{0x87e8,0xc6}, -{0x87e9,0xff}, -{0x87ea,0xd3}, -{0x87eb,0x78}, -{0x87ec,0x57}, -{0x87ed,0xe6}, -{0x87ee,0x9f}, -{0x87ef,0x18}, -{0x87f0,0xe6}, -{0x87f1,0x9e}, -{0x87f2,0x40}, -{0x87f3,0x0e}, -{0x87f4,0x78}, -{0x87f5,0x5a}, -{0x87f6,0xe6}, -{0x87f7,0x13}, -{0x87f8,0xfe}, -{0x87f9,0x08}, -{0x87fa,0xe6}, -{0x87fb,0x78}, -{0x87fc,0x57}, -{0x87fd,0x12}, -{0x87fe,0x0c}, -{0x87ff,0x08}, -{0x8800,0x80}, -{0x8801,0x04}, -{0x8802,0x7e}, -{0x8803,0x00}, -{0x8804,0x7f}, -{0x8805,0x00}, -{0x8806,0x78}, -{0x8807,0x5e}, -{0x8808,0x12}, -{0x8809,0x0b}, -{0x880a,0xbe}, -{0x880b,0xff}, -{0x880c,0xd3}, -{0x880d,0x78}, -{0x880e,0x59}, -{0x880f,0xe6}, -{0x8810,0x9f}, -{0x8811,0x18}, -{0x8812,0xe6}, -{0x8813,0x9e}, -{0x8814,0x40}, -{0x8815,0x0e}, -{0x8816,0x78}, -{0x8817,0x5c}, -{0x8818,0xe6}, -{0x8819,0x13}, -{0x881a,0xfe}, -{0x881b,0x08}, -{0x881c,0xe6}, -{0x881d,0x78}, -{0x881e,0x59}, -{0x881f,0x12}, -{0x8820,0x0c}, -{0x8821,0x08}, -{0x8822,0x80}, -{0x8823,0x04}, -{0x8824,0x7e}, -{0x8825,0x00}, -{0x8826,0x7f}, -{0x8827,0x00}, -{0x8828,0xe4}, -{0x8829,0xfc}, -{0x882a,0xfd}, -{0x882b,0x78}, -{0x882c,0x62}, -{0x882d,0x12}, -{0x882e,0x06}, -{0x882f,0x99}, -{0x8830,0x78}, -{0x8831,0x5a}, -{0x8832,0x12}, -{0x8833,0x0b}, -{0x8834,0xc6}, -{0x8835,0x78}, -{0x8836,0x57}, -{0x8837,0x26}, -{0x8838,0xff}, -{0x8839,0xee}, -{0x883a,0x18}, -{0x883b,0x36}, -{0x883c,0xfe}, -{0x883d,0x78}, -{0x883e,0x66}, -{0x883f,0x12}, -{0x8840,0x0b}, -{0x8841,0xbe}, -{0x8842,0x78}, -{0x8843,0x59}, -{0x8844,0x26}, -{0x8845,0xff}, -{0x8846,0xee}, -{0x8847,0x18}, -{0x8848,0x36}, -{0x8849,0xfe}, -{0x884a,0xe4}, -{0x884b,0xfc}, -{0x884c,0xfd}, -{0x884d,0x78}, -{0x884e,0x6a}, -{0x884f,0x12}, -{0x8850,0x06}, -{0x8851,0x99}, -{0x8852,0x12}, -{0x8853,0x0b}, -{0x8854,0xce}, -{0x8855,0x78}, -{0x8856,0x66}, -{0x8857,0x12}, -{0x8858,0x06}, -{0x8859,0x8c}, -{0x885a,0xd3}, -{0x885b,0x12}, -{0x885c,0x06}, -{0x885d,0x45}, -{0x885e,0x40}, -{0x885f,0x08}, -{0x8860,0x12}, -{0x8861,0x0b}, -{0x8862,0xce}, -{0x8863,0x78}, -{0x8864,0x66}, -{0x8865,0x12}, -{0x8866,0x06}, -{0x8867,0x99}, -{0x8868,0x78}, -{0x8869,0x54}, -{0x886a,0x12}, -{0x886b,0x0b}, -{0x886c,0xd0}, -{0x886d,0x78}, -{0x886e,0x6a}, -{0x886f,0x12}, -{0x8870,0x06}, -{0x8871,0x8c}, -{0x8872,0xd3}, -{0x8873,0x12}, -{0x8874,0x06}, -{0x8875,0x45}, -{0x8876,0x40}, -{0x8877,0x0a}, -{0x8878,0x78}, -{0x8879,0x54}, -{0x887a,0x12}, -{0x887b,0x0b}, -{0x887c,0xd0}, -{0x887d,0x78}, -{0x887e,0x6a}, -{0x887f,0x12}, -{0x8880,0x06}, -{0x8881,0x99}, -{0x8882,0x78}, -{0x8883,0x61}, -{0x8884,0xe6}, -{0x8885,0x90}, -{0x8886,0x60}, -{0x8887,0x01}, -{0x8888,0xf0}, -{0x8889,0x78}, -{0x888a,0x65}, -{0x888b,0xe6}, -{0x888c,0xa3}, -{0x888d,0xf0}, -{0x888e,0x78}, -{0x888f,0x69}, -{0x8890,0xe6}, -{0x8891,0xa3}, -{0x8892,0xf0}, -{0x8893,0x78}, -{0x8894,0x55}, -{0x8895,0xe6}, -{0x8896,0xa3}, -{0x8897,0xf0}, -{0x8898,0x7d}, -{0x8899,0x01}, -{0x889a,0x78}, -{0x889b,0x61}, -{0x889c,0x12}, -{0x889d,0x0b}, -{0x889e,0xe9}, -{0x889f,0x24}, -{0x88a0,0x01}, -{0x88a1,0x12}, -{0x88a2,0x0b}, -{0x88a3,0xa6}, -{0x88a4,0x78}, -{0x88a5,0x65}, -{0x88a6,0x12}, -{0x88a7,0x0b}, -{0x88a8,0xe9}, -{0x88a9,0x24}, -{0x88aa,0x02}, -{0x88ab,0x12}, -{0x88ac,0x0b}, -{0x88ad,0xa6}, -{0x88ae,0x78}, -{0x88af,0x69}, -{0x88b0,0x12}, -{0x88b1,0x0b}, -{0x88b2,0xe9}, -{0x88b3,0x24}, -{0x88b4,0x03}, -{0x88b5,0x12}, -{0x88b6,0x0b}, -{0x88b7,0xa6}, -{0x88b8,0x78}, -{0x88b9,0x6d}, -{0x88ba,0x12}, -{0x88bb,0x0b}, -{0x88bc,0xe9}, -{0x88bd,0x24}, -{0x88be,0x04}, -{0x88bf,0x12}, -{0x88c0,0x0b}, -{0x88c1,0xa6}, -{0x88c2,0x0d}, -{0x88c3,0xbd}, -{0x88c4,0x05}, -{0x88c5,0xd4}, -{0x88c6,0xc2}, -{0x88c7,0x0e}, -{0x88c8,0xc2}, -{0x88c9,0x06}, -{0x88ca,0x22}, -{0x88cb,0x85}, -{0x88cc,0x08}, -{0x88cd,0x41}, -{0x88ce,0x90}, -{0x88cf,0x30}, -{0x88d0,0x24}, -{0x88d1,0xe0}, -{0x88d2,0xf5}, -{0x88d3,0x3d}, -{0x88d4,0xa3}, -{0x88d5,0xe0}, -{0x88d6,0xf5}, -{0x88d7,0x3e}, -{0x88d8,0xa3}, -{0x88d9,0xe0}, -{0x88da,0xf5}, -{0x88db,0x3f}, -{0x88dc,0xa3}, -{0x88dd,0xe0}, -{0x88de,0xf5}, -{0x88df,0x40}, -{0x88e0,0xa3}, -{0x88e1,0xe0}, -{0x88e2,0xf5}, -{0x88e3,0x3c}, -{0x88e4,0xd2}, -{0x88e5,0x34}, -{0x88e6,0xe5}, -{0x88e7,0x41}, -{0x88e8,0x12}, -{0x88e9,0x06}, -{0x88ea,0xb1}, -{0x88eb,0x09}, -{0x88ec,0x31}, -{0x88ed,0x03}, -{0x88ee,0x09}, -{0x88ef,0x35}, -{0x88f0,0x04}, -{0x88f1,0x09}, -{0x88f2,0x3b}, -{0x88f3,0x05}, -{0x88f4,0x09}, -{0x88f5,0x3e}, -{0x88f6,0x06}, -{0x88f7,0x09}, -{0x88f8,0x41}, -{0x88f9,0x07}, -{0x88fa,0x09}, -{0x88fb,0x4a}, -{0x88fc,0x08}, -{0x88fd,0x09}, -{0x88fe,0x5b}, -{0x88ff,0x12}, -{0x8900,0x09}, -{0x8901,0x73}, -{0x8902,0x18}, -{0x8903,0x09}, -{0x8904,0x89}, -{0x8905,0x19}, -{0x8906,0x09}, -{0x8907,0x5e}, -{0x8908,0x1a}, -{0x8909,0x09}, -{0x890a,0x6a}, -{0x890b,0x1b}, -{0x890c,0x09}, -{0x890d,0xad}, -{0x890e,0x80}, -{0x890f,0x09}, -{0x8910,0xb2}, -{0x8911,0x81}, -{0x8912,0x0a}, -{0x8913,0x1d}, -{0x8914,0x8f}, -{0x8915,0x0a}, -{0x8916,0x09}, -{0x8917,0x90}, -{0x8918,0x0a}, -{0x8919,0x1d}, -{0x891a,0x91}, -{0x891b,0x0a}, -{0x891c,0x1d}, -{0x891d,0x92}, -{0x891e,0x0a}, -{0x891f,0x1d}, -{0x8920,0x93}, -{0x8921,0x0a}, -{0x8922,0x1d}, -{0x8923,0x94}, -{0x8924,0x0a}, -{0x8925,0x1d}, -{0x8926,0x98}, -{0x8927,0x0a}, -{0x8928,0x17}, -{0x8929,0x9f}, -{0x892a,0x0a}, -{0x892b,0x1a}, -{0x892c,0xec}, -{0x892d,0x00}, -{0x892e,0x00}, -{0x892f,0x0a}, -{0x8930,0x38}, -{0x8931,0x12}, -{0x8932,0x0f}, -{0x8933,0x74}, -{0x8934,0x22}, -{0x8935,0x12}, -{0x8936,0x0f}, -{0x8937,0x74}, -{0x8938,0xd2}, -{0x8939,0x03}, -{0x893a,0x22}, -{0x893b,0xd2}, -{0x893c,0x03}, -{0x893d,0x22}, -{0x893e,0xc2}, -{0x893f,0x03}, -{0x8940,0x22}, -{0x8941,0xa2}, -{0x8942,0x37}, -{0x8943,0xe4}, -{0x8944,0x33}, -{0x8945,0xf5}, -{0x8946,0x3c}, -{0x8947,0x02}, -{0x8948,0x0a}, -{0x8949,0x1d}, -{0x894a,0xc2}, -{0x894b,0x01}, -{0x894c,0xc2}, -{0x894d,0x02}, -{0x894e,0xc2}, -{0x894f,0x03}, -{0x8950,0x12}, -{0x8951,0x0d}, -{0x8952,0x0d}, -{0x8953,0x75}, -{0x8954,0x1e}, -{0x8955,0x70}, -{0x8956,0xd2}, -{0x8957,0x35}, -{0x8958,0x02}, -{0x8959,0x0a}, -{0x895a,0x1d}, -{0x895b,0x02}, -{0x895c,0x0a}, -{0x895d,0x04}, -{0x895e,0x85}, -{0x895f,0x40}, -{0x8960,0x4a}, -{0x8961,0x85}, -{0x8962,0x3c}, -{0x8963,0x4b}, -{0x8964,0x12}, -{0x8965,0x0a}, -{0x8966,0xff}, -{0x8967,0x02}, -{0x8968,0x0a}, -{0x8969,0x1d}, -{0x896a,0x85}, -{0x896b,0x4a}, -{0x896c,0x40}, -{0x896d,0x85}, -{0x896e,0x4b}, -{0x896f,0x3c}, -{0x8970,0x02}, -{0x8971,0x0a}, -{0x8972,0x1d}, -{0x8973,0xe4}, -{0x8974,0xf5}, -{0x8975,0x22}, -{0x8976,0xf5}, -{0x8977,0x23}, -{0x8978,0x85}, -{0x8979,0x40}, -{0x897a,0x31}, -{0x897b,0x85}, -{0x897c,0x3f}, -{0x897d,0x30}, -{0x897e,0x85}, -{0x897f,0x3e}, -{0x8980,0x2f}, -{0x8981,0x85}, -{0x8982,0x3d}, -{0x8983,0x2e}, -{0x8984,0x12}, -{0x8985,0x0f}, -{0x8986,0x46}, -{0x8987,0x80}, -{0x8988,0x1f}, -{0x8989,0x75}, -{0x898a,0x22}, -{0x898b,0x00}, -{0x898c,0x75}, -{0x898d,0x23}, -{0x898e,0x01}, -{0x898f,0x74}, -{0x8990,0xff}, -{0x8991,0xf5}, -{0x8992,0x2d}, -{0x8993,0xf5}, -{0x8994,0x2c}, -{0x8995,0xf5}, -{0x8996,0x2b}, -{0x8997,0xf5}, -{0x8998,0x2a}, -{0x8999,0x12}, -{0x899a,0x0f}, -{0x899b,0x46}, -{0x899c,0x85}, -{0x899d,0x2d}, -{0x899e,0x40}, -{0x899f,0x85}, -{0x89a0,0x2c}, -{0x89a1,0x3f}, -{0x89a2,0x85}, -{0x89a3,0x2b}, -{0x89a4,0x3e}, -{0x89a5,0x85}, -{0x89a6,0x2a}, -{0x89a7,0x3d}, -{0x89a8,0xe4}, -{0x89a9,0xf5}, -{0x89aa,0x3c}, -{0x89ab,0x80}, -{0x89ac,0x70}, -{0x89ad,0x12}, -{0x89ae,0x0f}, -{0x89af,0x16}, -{0x89b0,0x80}, -{0x89b1,0x6b}, -{0x89b2,0x85}, -{0x89b3,0x3d}, -{0x89b4,0x45}, -{0x89b5,0x85}, -{0x89b6,0x3e}, -{0x89b7,0x46}, -{0x89b8,0xe5}, -{0x89b9,0x47}, -{0x89ba,0xc3}, -{0x89bb,0x13}, -{0x89bc,0xff}, -{0x89bd,0xe5}, -{0x89be,0x45}, -{0x89bf,0xc3}, -{0x89c0,0x9f}, -{0x89c1,0x50}, -{0x89c2,0x02}, -{0x89c3,0x8f}, -{0x89c4,0x45}, -{0x89c5,0xe5}, -{0x89c6,0x48}, -{0x89c7,0xc3}, -{0x89c8,0x13}, -{0x89c9,0xff}, -{0x89ca,0xe5}, -{0x89cb,0x46}, -{0x89cc,0xc3}, -{0x89cd,0x9f}, -{0x89ce,0x50}, -{0x89cf,0x02}, -{0x89d0,0x8f}, -{0x89d1,0x46}, -{0x89d2,0xe5}, -{0x89d3,0x47}, -{0x89d4,0xc3}, -{0x89d5,0x13}, -{0x89d6,0xff}, -{0x89d7,0xfd}, -{0x89d8,0xe5}, -{0x89d9,0x45}, -{0x89da,0x2d}, -{0x89db,0xfd}, -{0x89dc,0xe4}, -{0x89dd,0x33}, -{0x89de,0xfc}, -{0x89df,0xe5}, -{0x89e0,0x44}, -{0x89e1,0x12}, -{0x89e2,0x0f}, -{0x89e3,0x90}, -{0x89e4,0x40}, -{0x89e5,0x05}, -{0x89e6,0xe5}, -{0x89e7,0x44}, -{0x89e8,0x9f}, -{0x89e9,0xf5}, -{0x89ea,0x45}, -{0x89eb,0xe5}, -{0x89ec,0x48}, -{0x89ed,0xc3}, -{0x89ee,0x13}, -{0x89ef,0xff}, -{0x89f0,0xfd}, -{0x89f1,0xe5}, -{0x89f2,0x46}, -{0x89f3,0x2d}, -{0x89f4,0xfd}, -{0x89f5,0xe4}, -{0x89f6,0x33}, -{0x89f7,0xfc}, -{0x89f8,0xe5}, -{0x89f9,0x43}, -{0x89fa,0x12}, -{0x89fb,0x0f}, -{0x89fc,0x90}, -{0x89fd,0x40}, -{0x89fe,0x05}, -{0x89ff,0xe5}, -{0x8a00,0x43}, -{0x8a01,0x9f}, -{0x8a02,0xf5}, -{0x8a03,0x46}, -{0x8a04,0x12}, -{0x8a05,0x06}, -{0x8a06,0xd7}, -{0x8a07,0x80}, -{0x8a08,0x14}, -{0x8a09,0x85}, -{0x8a0a,0x40}, -{0x8a0b,0x48}, -{0x8a0c,0x85}, -{0x8a0d,0x3f}, -{0x8a0e,0x47}, -{0x8a0f,0x85}, -{0x8a10,0x3e}, -{0x8a11,0x46}, -{0x8a12,0x85}, -{0x8a13,0x3d}, -{0x8a14,0x45}, -{0x8a15,0x80}, -{0x8a16,0x06}, -{0x8a17,0x02}, -{0x8a18,0x06}, -{0x8a19,0xd7}, -{0x8a1a,0x12}, -{0x8a1b,0x0d}, -{0x8a1c,0x7e}, -{0x8a1d,0x90}, -{0x8a1e,0x30}, -{0x8a1f,0x24}, -{0x8a20,0xe5}, -{0x8a21,0x3d}, -{0x8a22,0xf0}, -{0x8a23,0xa3}, -{0x8a24,0xe5}, -{0x8a25,0x3e}, -{0x8a26,0xf0}, -{0x8a27,0xa3}, -{0x8a28,0xe5}, -{0x8a29,0x3f}, -{0x8a2a,0xf0}, -{0x8a2b,0xa3}, -{0x8a2c,0xe5}, -{0x8a2d,0x40}, -{0x8a2e,0xf0}, -{0x8a2f,0xa3}, -{0x8a30,0xe5}, -{0x8a31,0x3c}, -{0x8a32,0xf0}, -{0x8a33,0x90}, -{0x8a34,0x30}, -{0x8a35,0x23}, -{0x8a36,0xe4}, -{0x8a37,0xf0}, -{0x8a38,0x22}, -{0x8a39,0xc0}, -{0x8a3a,0xe0}, -{0x8a3b,0xc0}, -{0x8a3c,0x83}, -{0x8a3d,0xc0}, -{0x8a3e,0x82}, -{0x8a3f,0xc0}, -{0x8a40,0xd0}, -{0x8a41,0x90}, -{0x8a42,0x3f}, -{0x8a43,0x0c}, -{0x8a44,0xe0}, -{0x8a45,0xf5}, -{0x8a46,0x32}, -{0x8a47,0xe5}, -{0x8a48,0x32}, -{0x8a49,0x30}, -{0x8a4a,0xe3}, -{0x8a4b,0x74}, -{0x8a4c,0x30}, -{0x8a4d,0x36}, -{0x8a4e,0x66}, -{0x8a4f,0x90}, -{0x8a50,0x60}, -{0x8a51,0x19}, -{0x8a52,0xe0}, -{0x8a53,0xf5}, -{0x8a54,0x0a}, -{0x8a55,0xa3}, -{0x8a56,0xe0}, -{0x8a57,0xf5}, -{0x8a58,0x0b}, -{0x8a59,0x90}, -{0x8a5a,0x60}, -{0x8a5b,0x1d}, -{0x8a5c,0xe0}, -{0x8a5d,0xf5}, -{0x8a5e,0x14}, -{0x8a5f,0xa3}, -{0x8a60,0xe0}, -{0x8a61,0xf5}, -{0x8a62,0x15}, -{0x8a63,0x90}, -{0x8a64,0x60}, -{0x8a65,0x21}, -{0x8a66,0xe0}, -{0x8a67,0xf5}, -{0x8a68,0x0c}, -{0x8a69,0xa3}, -{0x8a6a,0xe0}, -{0x8a6b,0xf5}, -{0x8a6c,0x0d}, -{0x8a6d,0x90}, -{0x8a6e,0x60}, -{0x8a6f,0x29}, -{0x8a70,0xe0}, -{0x8a71,0xf5}, -{0x8a72,0x0e}, -{0x8a73,0xa3}, -{0x8a74,0xe0}, -{0x8a75,0xf5}, -{0x8a76,0x0f}, -{0x8a77,0x90}, -{0x8a78,0x60}, -{0x8a79,0x31}, -{0x8a7a,0xe0}, -{0x8a7b,0xf5}, -{0x8a7c,0x10}, -{0x8a7d,0xa3}, -{0x8a7e,0xe0}, -{0x8a7f,0xf5}, -{0x8a80,0x11}, -{0x8a81,0x90}, -{0x8a82,0x60}, -{0x8a83,0x39}, -{0x8a84,0xe0}, -{0x8a85,0xf5}, -{0x8a86,0x12}, -{0x8a87,0xa3}, -{0x8a88,0xe0}, -{0x8a89,0xf5}, -{0x8a8a,0x13}, -{0x8a8b,0x30}, -{0x8a8c,0x01}, -{0x8a8d,0x06}, -{0x8a8e,0x30}, -{0x8a8f,0x33}, -{0x8a90,0x03}, -{0x8a91,0xd3}, -{0x8a92,0x80}, -{0x8a93,0x01}, -{0x8a94,0xc3}, -{0x8a95,0x92}, -{0x8a96,0x09}, -{0x8a97,0x30}, -{0x8a98,0x02}, -{0x8a99,0x06}, -{0x8a9a,0x30}, -{0x8a9b,0x33}, -{0x8a9c,0x03}, -{0x8a9d,0xd3}, -{0x8a9e,0x80}, -{0x8a9f,0x01}, -{0x8aa0,0xc3}, -{0x8aa1,0x92}, -{0x8aa2,0x0a}, -{0x8aa3,0x30}, -{0x8aa4,0x33}, -{0x8aa5,0x0c}, -{0x8aa6,0x30}, -{0x8aa7,0x03}, -{0x8aa8,0x09}, -{0x8aa9,0x20}, -{0x8aaa,0x02}, -{0x8aab,0x06}, -{0x8aac,0x20}, -{0x8aad,0x01}, -{0x8aae,0x03}, -{0x8aaf,0xd3}, -{0x8ab0,0x80}, -{0x8ab1,0x01}, -{0x8ab2,0xc3}, -{0x8ab3,0x92}, -{0x8ab4,0x0b}, -{0x8ab5,0x90}, -{0x8ab6,0x30}, -{0x8ab7,0x01}, -{0x8ab8,0xe0}, -{0x8ab9,0x44}, -{0x8aba,0x40}, -{0x8abb,0xf0}, -{0x8abc,0xe0}, -{0x8abd,0x54}, -{0x8abe,0xbf}, -{0x8abf,0xf0}, -{0x8ac0,0xe5}, -{0x8ac1,0x32}, -{0x8ac2,0x30}, -{0x8ac3,0xe1}, -{0x8ac4,0x14}, -{0x8ac5,0x30}, -{0x8ac6,0x34}, -{0x8ac7,0x11}, -{0x8ac8,0x90}, -{0x8ac9,0x30}, -{0x8aca,0x22}, -{0x8acb,0xe0}, -{0x8acc,0xf5}, -{0x8acd,0x08}, -{0x8ace,0xe4}, -{0x8acf,0xf0}, -{0x8ad0,0x30}, -{0x8ad1,0x00}, -{0x8ad2,0x03}, -{0x8ad3,0xd3}, -{0x8ad4,0x80}, -{0x8ad5,0x01}, -{0x8ad6,0xc3}, -{0x8ad7,0x92}, -{0x8ad8,0x08}, -{0x8ad9,0xe5}, -{0x8ada,0x32}, -{0x8adb,0x30}, -{0x8adc,0xe5}, -{0x8add,0x12}, -{0x8ade,0x90}, -{0x8adf,0x56}, -{0x8ae0,0xa1}, -{0x8ae1,0xe0}, -{0x8ae2,0xf5}, -{0x8ae3,0x09}, -{0x8ae4,0x30}, -{0x8ae5,0x31}, -{0x8ae6,0x09}, -{0x8ae7,0x30}, -{0x8ae8,0x05}, -{0x8ae9,0x03}, -{0x8aea,0xd3}, -{0x8aeb,0x80}, -{0x8aec,0x01}, -{0x8aed,0xc3}, -{0x8aee,0x92}, -{0x8aef,0x0d}, -{0x8af0,0x90}, -{0x8af1,0x3f}, -{0x8af2,0x0c}, -{0x8af3,0xe5}, -{0x8af4,0x32}, -{0x8af5,0xf0}, -{0x8af6,0xd0}, -{0x8af7,0xd0}, -{0x8af8,0xd0}, -{0x8af9,0x82}, -{0x8afa,0xd0}, -{0x8afb,0x83}, -{0x8afc,0xd0}, -{0x8afd,0xe0}, -{0x8afe,0x32}, -{0x8aff,0x90}, -{0x8b00,0x0e}, -{0x8b01,0x7e}, -{0x8b02,0xe4}, -{0x8b03,0x93}, -{0x8b04,0xfe}, -{0x8b05,0x74}, -{0x8b06,0x01}, -{0x8b07,0x93}, -{0x8b08,0xff}, -{0x8b09,0xc3}, -{0x8b0a,0x90}, -{0x8b0b,0x0e}, -{0x8b0c,0x7c}, -{0x8b0d,0x74}, -{0x8b0e,0x01}, -{0x8b0f,0x93}, -{0x8b10,0x9f}, -{0x8b11,0xff}, -{0x8b12,0xe4}, -{0x8b13,0x93}, -{0x8b14,0x9e}, -{0x8b15,0xfe}, -{0x8b16,0xe4}, -{0x8b17,0x8f}, -{0x8b18,0x3b}, -{0x8b19,0x8e}, -{0x8b1a,0x3a}, -{0x8b1b,0xf5}, -{0x8b1c,0x39}, -{0x8b1d,0xf5}, -{0x8b1e,0x38}, -{0x8b1f,0xab}, -{0x8b20,0x3b}, -{0x8b21,0xaa}, -{0x8b22,0x3a}, -{0x8b23,0xa9}, -{0x8b24,0x39}, -{0x8b25,0xa8}, -{0x8b26,0x38}, -{0x8b27,0xaf}, -{0x8b28,0x4b}, -{0x8b29,0xfc}, -{0x8b2a,0xfd}, -{0x8b2b,0xfe}, -{0x8b2c,0x12}, -{0x8b2d,0x05}, -{0x8b2e,0x28}, -{0x8b2f,0x12}, -{0x8b30,0x0d}, -{0x8b31,0xe1}, -{0x8b32,0xe4}, -{0x8b33,0x7b}, -{0x8b34,0xff}, -{0x8b35,0xfa}, -{0x8b36,0xf9}, -{0x8b37,0xf8}, -{0x8b38,0x12}, -{0x8b39,0x05}, -{0x8b3a,0xb3}, -{0x8b3b,0x12}, -{0x8b3c,0x0d}, -{0x8b3d,0xe1}, -{0x8b3e,0x90}, -{0x8b3f,0x0e}, -{0x8b40,0x69}, -{0x8b41,0xe4}, -{0x8b42,0x12}, -{0x8b43,0x0d}, -{0x8b44,0xf6}, -{0x8b45,0x12}, -{0x8b46,0x0d}, -{0x8b47,0xe1}, -{0x8b48,0xe4}, -{0x8b49,0x85}, -{0x8b4a,0x4a}, -{0x8b4b,0x37}, -{0x8b4c,0xf5}, -{0x8b4d,0x36}, -{0x8b4e,0xf5}, -{0x8b4f,0x35}, -{0x8b50,0xf5}, -{0x8b51,0x34}, -{0x8b52,0xaf}, -{0x8b53,0x37}, -{0x8b54,0xae}, -{0x8b55,0x36}, -{0x8b56,0xad}, -{0x8b57,0x35}, -{0x8b58,0xac}, -{0x8b59,0x34}, -{0x8b5a,0xa3}, -{0x8b5b,0x12}, -{0x8b5c,0x0d}, -{0x8b5d,0xf6}, -{0x8b5e,0x8f}, -{0x8b5f,0x37}, -{0x8b60,0x8e}, -{0x8b61,0x36}, -{0x8b62,0x8d}, -{0x8b63,0x35}, -{0x8b64,0x8c}, -{0x8b65,0x34}, -{0x8b66,0xe5}, -{0x8b67,0x3b}, -{0x8b68,0x45}, -{0x8b69,0x37}, -{0x8b6a,0xf5}, -{0x8b6b,0x3b}, -{0x8b6c,0xe5}, -{0x8b6d,0x3a}, -{0x8b6e,0x45}, -{0x8b6f,0x36}, -{0x8b70,0xf5}, -{0x8b71,0x3a}, -{0x8b72,0xe5}, -{0x8b73,0x39}, -{0x8b74,0x45}, -{0x8b75,0x35}, -{0x8b76,0xf5}, -{0x8b77,0x39}, -{0x8b78,0xe5}, -{0x8b79,0x38}, -{0x8b7a,0x45}, -{0x8b7b,0x34}, -{0x8b7c,0xf5}, -{0x8b7d,0x38}, -{0x8b7e,0xe4}, -{0x8b7f,0xf5}, -{0x8b80,0x22}, -{0x8b81,0xf5}, -{0x8b82,0x23}, -{0x8b83,0x85}, -{0x8b84,0x3b}, -{0x8b85,0x31}, -{0x8b86,0x85}, -{0x8b87,0x3a}, -{0x8b88,0x30}, -{0x8b89,0x85}, -{0x8b8a,0x39}, -{0x8b8b,0x2f}, -{0x8b8c,0x85}, -{0x8b8d,0x38}, -{0x8b8e,0x2e}, -{0x8b8f,0x02}, -{0x8b90,0x0f}, -{0x8b91,0x46}, -{0x8b92,0xe0}, -{0x8b93,0xa3}, -{0x8b94,0xe0}, -{0x8b95,0x75}, -{0x8b96,0xf0}, -{0x8b97,0x02}, -{0x8b98,0xa4}, -{0x8b99,0xff}, -{0x8b9a,0xae}, -{0x8b9b,0xf0}, -{0x8b9c,0xc3}, -{0x8b9d,0x08}, -{0x8b9e,0xe6}, -{0x8b9f,0x9f}, -{0x8ba0,0xf6}, -{0x8ba1,0x18}, -{0x8ba2,0xe6}, -{0x8ba3,0x9e}, -{0x8ba4,0xf6}, -{0x8ba5,0x22}, -{0x8ba6,0xff}, -{0x8ba7,0xe5}, -{0x8ba8,0xf0}, -{0x8ba9,0x34}, -{0x8baa,0x60}, -{0x8bab,0x8f}, -{0x8bac,0x82}, -{0x8bad,0xf5}, -{0x8bae,0x83}, -{0x8baf,0xec}, -{0x8bb0,0xf0}, -{0x8bb1,0x22}, -{0x8bb2,0x78}, -{0x8bb3,0x52}, -{0x8bb4,0x7e}, -{0x8bb5,0x00}, -{0x8bb6,0xe6}, -{0x8bb7,0xfc}, -{0x8bb8,0x08}, -{0x8bb9,0xe6}, -{0x8bba,0xfd}, -{0x8bbb,0x02}, -{0x8bbc,0x04}, -{0x8bbd,0xc1}, -{0x8bbe,0xe4}, -{0x8bbf,0xfc}, -{0x8bc0,0xfd}, -{0x8bc1,0x12}, -{0x8bc2,0x06}, -{0x8bc3,0x99}, -{0x8bc4,0x78}, -{0x8bc5,0x5c}, -{0x8bc6,0xe6}, -{0x8bc7,0xc3}, -{0x8bc8,0x13}, -{0x8bc9,0xfe}, -{0x8bca,0x08}, -{0x8bcb,0xe6}, -{0x8bcc,0x13}, -{0x8bcd,0x22}, -{0x8bce,0x78}, -{0x8bcf,0x52}, -{0x8bd0,0xe6}, -{0x8bd1,0xfe}, -{0x8bd2,0x08}, -{0x8bd3,0xe6}, -{0x8bd4,0xff}, -{0x8bd5,0xe4}, -{0x8bd6,0xfc}, -{0x8bd7,0xfd}, -{0x8bd8,0x22}, -{0x8bd9,0xe7}, -{0x8bda,0xc4}, -{0x8bdb,0xf8}, -{0x8bdc,0x54}, -{0x8bdd,0xf0}, -{0x8bde,0xc8}, -{0x8bdf,0x68}, -{0x8be0,0xf7}, -{0x8be1,0x09}, -{0x8be2,0xe7}, -{0x8be3,0xc4}, -{0x8be4,0x54}, -{0x8be5,0x0f}, -{0x8be6,0x48}, -{0x8be7,0xf7}, -{0x8be8,0x22}, -{0x8be9,0xe6}, -{0x8bea,0xfc}, -{0x8beb,0xed}, -{0x8bec,0x75}, -{0x8bed,0xf0}, -{0x8bee,0x04}, -{0x8bef,0xa4}, -{0x8bf0,0x22}, -{0x8bf1,0x12}, -{0x8bf2,0x06}, -{0x8bf3,0x7c}, -{0x8bf4,0x8f}, -{0x8bf5,0x48}, -{0x8bf6,0x8e}, -{0x8bf7,0x47}, -{0x8bf8,0x8d}, -{0x8bf9,0x46}, -{0x8bfa,0x8c}, -{0x8bfb,0x45}, -{0x8bfc,0x22}, -{0x8bfd,0xe0}, -{0x8bfe,0xfe}, -{0x8bff,0xa3}, -{0x8c00,0xe0}, -{0x8c01,0xfd}, -{0x8c02,0xee}, -{0x8c03,0xf6}, -{0x8c04,0xed}, -{0x8c05,0x08}, -{0x8c06,0xf6}, -{0x8c07,0x22}, -{0x8c08,0x13}, -{0x8c09,0xff}, -{0x8c0a,0xc3}, -{0x8c0b,0xe6}, -{0x8c0c,0x9f}, -{0x8c0d,0xff}, -{0x8c0e,0x18}, -{0x8c0f,0xe6}, -{0x8c10,0x9e}, -{0x8c11,0xfe}, -{0x8c12,0x22}, -{0x8c13,0xe6}, -{0x8c14,0xc3}, -{0x8c15,0x13}, -{0x8c16,0xf7}, -{0x8c17,0x08}, -{0x8c18,0xe6}, -{0x8c19,0x13}, -{0x8c1a,0x09}, -{0x8c1b,0xf7}, -{0x8c1c,0x22}, -{0x8c1d,0xad}, -{0x8c1e,0x39}, -{0x8c1f,0xac}, -{0x8c20,0x38}, -{0x8c21,0xfa}, -{0x8c22,0xf9}, -{0x8c23,0xf8}, -{0x8c24,0x12}, -{0x8c25,0x05}, -{0x8c26,0x28}, -{0x8c27,0x8f}, -{0x8c28,0x3b}, -{0x8c29,0x8e}, -{0x8c2a,0x3a}, -{0x8c2b,0x8d}, -{0x8c2c,0x39}, -{0x8c2d,0x8c}, -{0x8c2e,0x38}, -{0x8c2f,0xab}, -{0x8c30,0x37}, -{0x8c31,0xaa}, -{0x8c32,0x36}, -{0x8c33,0xa9}, -{0x8c34,0x35}, -{0x8c35,0xa8}, -{0x8c36,0x34}, -{0x8c37,0x22}, -{0x8c38,0x93}, -{0x8c39,0xff}, -{0x8c3a,0xe4}, -{0x8c3b,0xfc}, -{0x8c3c,0xfd}, -{0x8c3d,0xfe}, -{0x8c3e,0x12}, -{0x8c3f,0x05}, -{0x8c40,0x28}, -{0x8c41,0x8f}, -{0x8c42,0x37}, -{0x8c43,0x8e}, -{0x8c44,0x36}, -{0x8c45,0x8d}, -{0x8c46,0x35}, -{0x8c47,0x8c}, -{0x8c48,0x34}, -{0x8c49,0x22}, -{0x8c4a,0x78}, -{0x8c4b,0x84}, -{0x8c4c,0xe6}, -{0x8c4d,0xfe}, -{0x8c4e,0x08}, -{0x8c4f,0xe6}, -{0x8c50,0xff}, -{0x8c51,0xe4}, -{0x8c52,0x8f}, -{0x8c53,0x37}, -{0x8c54,0x8e}, -{0x8c55,0x36}, -{0x8c56,0xf5}, -{0x8c57,0x35}, -{0x8c58,0xf5}, -{0x8c59,0x34}, -{0x8c5a,0x22}, -{0x8c5b,0x90}, -{0x8c5c,0x0e}, -{0x8c5d,0x8c}, -{0x8c5e,0xe4}, -{0x8c5f,0x93}, -{0x8c60,0x25}, -{0x8c61,0xe0}, -{0x8c62,0x24}, -{0x8c63,0x0a}, -{0x8c64,0xf8}, -{0x8c65,0xe6}, -{0x8c66,0xfe}, -{0x8c67,0x08}, -{0x8c68,0xe6}, -{0x8c69,0xff}, -{0x8c6a,0x22}, -{0x8c6b,0xe6}, -{0x8c6c,0xfe}, -{0x8c6d,0x08}, -{0x8c6e,0xe6}, -{0x8c6f,0xff}, -{0x8c70,0xe4}, -{0x8c71,0x8f}, -{0x8c72,0x3b}, -{0x8c73,0x8e}, -{0x8c74,0x3a}, -{0x8c75,0xf5}, -{0x8c76,0x39}, -{0x8c77,0xf5}, -{0x8c78,0x38}, -{0x8c79,0x22}, -{0x8c7a,0x78}, -{0x8c7b,0x4e}, -{0x8c7c,0xe6}, -{0x8c7d,0xfe}, -{0x8c7e,0x08}, -{0x8c7f,0xe6}, -{0x8c80,0xff}, -{0x8c81,0x22}, -{0x8c82,0xef}, -{0x8c83,0x25}, -{0x8c84,0xe0}, -{0x8c85,0x24}, -{0x8c86,0x4e}, -{0x8c87,0xf8}, -{0x8c88,0xe6}, -{0x8c89,0xfc}, -{0x8c8a,0x08}, -{0x8c8b,0xe6}, -{0x8c8c,0xfd}, -{0x8c8d,0x22}, -{0x8c8e,0x78}, -{0x8c8f,0x89}, -{0x8c90,0xef}, -{0x8c91,0x26}, -{0x8c92,0xf6}, -{0x8c93,0x18}, -{0x8c94,0xe4}, -{0x8c95,0x36}, -{0x8c96,0xf6}, -{0x8c97,0x22}, -{0x8c98,0x75}, -{0x8c99,0x89}, -{0x8c9a,0x03}, -{0x8c9b,0x75}, -{0x8c9c,0xa8}, -{0x8c9d,0x01}, -{0x8c9e,0x75}, -{0x8c9f,0xb8}, -{0x8ca0,0x04}, -{0x8ca1,0x75}, -{0x8ca2,0x34}, -{0x8ca3,0xff}, -{0x8ca4,0x75}, -{0x8ca5,0x35}, -{0x8ca6,0x0e}, -{0x8ca7,0x75}, -{0x8ca8,0x36}, -{0x8ca9,0x15}, -{0x8caa,0x75}, -{0x8cab,0x37}, -{0x8cac,0x0d}, -{0x8cad,0x12}, -{0x8cae,0x0e}, -{0x8caf,0x9a}, -{0x8cb0,0x12}, -{0x8cb1,0x00}, -{0x8cb2,0x09}, -{0x8cb3,0x12}, -{0x8cb4,0x0f}, -{0x8cb5,0x16}, -{0x8cb6,0x12}, -{0x8cb7,0x00}, -{0x8cb8,0x06}, -{0x8cb9,0xd2}, -{0x8cba,0x00}, -{0x8cbb,0xd2}, -{0x8cbc,0x34}, -{0x8cbd,0xd2}, -{0x8cbe,0xaf}, -{0x8cbf,0x75}, -{0x8cc0,0x34}, -{0x8cc1,0xff}, -{0x8cc2,0x75}, -{0x8cc3,0x35}, -{0x8cc4,0x0e}, -{0x8cc5,0x75}, -{0x8cc6,0x36}, -{0x8cc7,0x49}, -{0x8cc8,0x75}, -{0x8cc9,0x37}, -{0x8cca,0x03}, -{0x8ccb,0x12}, -{0x8ccc,0x0e}, -{0x8ccd,0x9a}, -{0x8cce,0x30}, -{0x8ccf,0x08}, -{0x8cd0,0x09}, -{0x8cd1,0xc2}, -{0x8cd2,0x34}, -{0x8cd3,0x12}, -{0x8cd4,0x08}, -{0x8cd5,0xcb}, -{0x8cd6,0xc2}, -{0x8cd7,0x08}, -{0x8cd8,0xd2}, -{0x8cd9,0x34}, -{0x8cda,0x30}, -{0x8cdb,0x0b}, -{0x8cdc,0x09}, -{0x8cdd,0xc2}, -{0x8cde,0x36}, -{0x8cdf,0x12}, -{0x8ce0,0x02}, -{0x8ce1,0x6c}, -{0x8ce2,0xc2}, -{0x8ce3,0x0b}, -{0x8ce4,0xd2}, -{0x8ce5,0x36}, -{0x8ce6,0x30}, -{0x8ce7,0x09}, -{0x8ce8,0x09}, -{0x8ce9,0xc2}, -{0x8cea,0x36}, -{0x8ceb,0x12}, -{0x8cec,0x00}, -{0x8ced,0x0e}, -{0x8cee,0xc2}, -{0x8cef,0x09}, -{0x8cf0,0xd2}, -{0x8cf1,0x36}, -{0x8cf2,0x30}, -{0x8cf3,0x0e}, -{0x8cf4,0x03}, -{0x8cf5,0x12}, -{0x8cf6,0x06}, -{0x8cf7,0xd7}, -{0x8cf8,0x30}, -{0x8cf9,0x35}, -{0x8cfa,0xd3}, -{0x8cfb,0x90}, -{0x8cfc,0x30}, -{0x8cfd,0x29}, -{0x8cfe,0xe5}, -{0x8cff,0x1e}, -{0x8d00,0xf0}, -{0x8d01,0xb4}, -{0x8d02,0x10}, -{0x8d03,0x05}, -{0x8d04,0x90}, -{0x8d05,0x30}, -{0x8d06,0x23}, -{0x8d07,0xe4}, -{0x8d08,0xf0}, -{0x8d09,0xc2}, -{0x8d0a,0x35}, -{0x8d0b,0x80}, -{0x8d0c,0xc1}, -{0x8d0d,0xe4}, -{0x8d0e,0xf5}, -{0x8d0f,0x4b}, -{0x8d10,0x90}, -{0x8d11,0x0e}, -{0x8d12,0x7a}, -{0x8d13,0x93}, -{0x8d14,0xff}, -{0x8d15,0xe4}, -{0x8d16,0x8f}, -{0x8d17,0x37}, -{0x8d18,0xf5}, -{0x8d19,0x36}, -{0x8d1a,0xf5}, -{0x8d1b,0x35}, -{0x8d1c,0xf5}, -{0x8d1d,0x34}, -{0x8d1e,0xaf}, -{0x8d1f,0x37}, -{0x8d20,0xae}, -{0x8d21,0x36}, -{0x8d22,0xad}, -{0x8d23,0x35}, -{0x8d24,0xac}, -{0x8d25,0x34}, -{0x8d26,0x90}, -{0x8d27,0x0e}, -{0x8d28,0x6a}, -{0x8d29,0x12}, -{0x8d2a,0x0d}, -{0x8d2b,0xf6}, -{0x8d2c,0x8f}, -{0x8d2d,0x37}, -{0x8d2e,0x8e}, -{0x8d2f,0x36}, -{0x8d30,0x8d}, -{0x8d31,0x35}, -{0x8d32,0x8c}, -{0x8d33,0x34}, -{0x8d34,0x90}, -{0x8d35,0x0e}, -{0x8d36,0x72}, -{0x8d37,0x12}, -{0x8d38,0x06}, -{0x8d39,0x7c}, -{0x8d3a,0xef}, -{0x8d3b,0x45}, -{0x8d3c,0x37}, -{0x8d3d,0xf5}, -{0x8d3e,0x37}, -{0x8d3f,0xee}, -{0x8d40,0x45}, -{0x8d41,0x36}, -{0x8d42,0xf5}, -{0x8d43,0x36}, -{0x8d44,0xed}, -{0x8d45,0x45}, -{0x8d46,0x35}, -{0x8d47,0xf5}, -{0x8d48,0x35}, -{0x8d49,0xec}, -{0x8d4a,0x45}, -{0x8d4b,0x34}, -{0x8d4c,0xf5}, -{0x8d4d,0x34}, -{0x8d4e,0xe4}, -{0x8d4f,0xf5}, -{0x8d50,0x22}, -{0x8d51,0xf5}, -{0x8d52,0x23}, -{0x8d53,0x85}, -{0x8d54,0x37}, -{0x8d55,0x31}, -{0x8d56,0x85}, -{0x8d57,0x36}, -{0x8d58,0x30}, -{0x8d59,0x85}, -{0x8d5a,0x35}, -{0x8d5b,0x2f}, -{0x8d5c,0x85}, -{0x8d5d,0x34}, -{0x8d5e,0x2e}, -{0x8d5f,0x12}, -{0x8d60,0x0f}, -{0x8d61,0x46}, -{0x8d62,0xe4}, -{0x8d63,0xf5}, -{0x8d64,0x22}, -{0x8d65,0xf5}, -{0x8d66,0x23}, -{0x8d67,0x90}, -{0x8d68,0x0e}, -{0x8d69,0x72}, -{0x8d6a,0x12}, -{0x8d6b,0x0d}, -{0x8d6c,0xea}, -{0x8d6d,0x12}, -{0x8d6e,0x0f}, -{0x8d6f,0x46}, -{0x8d70,0xe4}, -{0x8d71,0xf5}, -{0x8d72,0x22}, -{0x8d73,0xf5}, -{0x8d74,0x23}, -{0x8d75,0x90}, -{0x8d76,0x0e}, -{0x8d77,0x6e}, -{0x8d78,0x12}, -{0x8d79,0x0d}, -{0x8d7a,0xea}, -{0x8d7b,0x02}, -{0x8d7c,0x0f}, -{0x8d7d,0x46}, -{0x8d7e,0xe5}, -{0x8d7f,0x40}, -{0x8d80,0x24}, -{0x8d81,0xf2}, -{0x8d82,0xf5}, -{0x8d83,0x37}, -{0x8d84,0xe5}, -{0x8d85,0x3f}, -{0x8d86,0x34}, -{0x8d87,0x43}, -{0x8d88,0xf5}, -{0x8d89,0x36}, -{0x8d8a,0xe5}, -{0x8d8b,0x3e}, -{0x8d8c,0x34}, -{0x8d8d,0xa2}, -{0x8d8e,0xf5}, -{0x8d8f,0x35}, -{0x8d90,0xe5}, -{0x8d91,0x3d}, -{0x8d92,0x34}, -{0x8d93,0x28}, -{0x8d94,0xf5}, -{0x8d95,0x34}, -{0x8d96,0xe5}, -{0x8d97,0x37}, -{0x8d98,0xff}, -{0x8d99,0xe4}, -{0x8d9a,0xfe}, -{0x8d9b,0xfd}, -{0x8d9c,0xfc}, -{0x8d9d,0x78}, -{0x8d9e,0x18}, -{0x8d9f,0x12}, -{0x8da0,0x06}, -{0x8da1,0x69}, -{0x8da2,0x8f}, -{0x8da3,0x40}, -{0x8da4,0x8e}, -{0x8da5,0x3f}, -{0x8da6,0x8d}, -{0x8da7,0x3e}, -{0x8da8,0x8c}, -{0x8da9,0x3d}, -{0x8daa,0xe5}, -{0x8dab,0x37}, -{0x8dac,0x54}, -{0x8dad,0xa0}, -{0x8dae,0xff}, -{0x8daf,0xe5}, -{0x8db0,0x36}, -{0x8db1,0xfe}, -{0x8db2,0xe4}, -{0x8db3,0xfd}, -{0x8db4,0xfc}, -{0x8db5,0x78}, -{0x8db6,0x07}, -{0x8db7,0x12}, -{0x8db8,0x06}, -{0x8db9,0x56}, -{0x8dba,0x78}, -{0x8dbb,0x10}, -{0x8dbc,0x12}, -{0x8dbd,0x0f}, -{0x8dbe,0x9a}, -{0x8dbf,0xe4}, -{0x8dc0,0xff}, -{0x8dc1,0xfe}, -{0x8dc2,0xe5}, -{0x8dc3,0x35}, -{0x8dc4,0xfd}, -{0x8dc5,0xe4}, -{0x8dc6,0xfc}, -{0x8dc7,0x78}, -{0x8dc8,0x0e}, -{0x8dc9,0x12}, -{0x8dca,0x06}, -{0x8dcb,0x56}, -{0x8dcc,0x12}, -{0x8dcd,0x0f}, -{0x8dce,0x9d}, -{0x8dcf,0xe4}, -{0x8dd0,0xff}, -{0x8dd1,0xfe}, -{0x8dd2,0xfd}, -{0x8dd3,0xe5}, -{0x8dd4,0x34}, -{0x8dd5,0xfc}, -{0x8dd6,0x78}, -{0x8dd7,0x18}, -{0x8dd8,0x12}, -{0x8dd9,0x06}, -{0x8dda,0x56}, -{0x8ddb,0x78}, -{0x8ddc,0x08}, -{0x8ddd,0x12}, -{0x8dde,0x0f}, -{0x8ddf,0x9a}, -{0x8de0,0x22}, -{0x8de1,0x8f}, -{0x8de2,0x3b}, -{0x8de3,0x8e}, -{0x8de4,0x3a}, -{0x8de5,0x8d}, -{0x8de6,0x39}, -{0x8de7,0x8c}, -{0x8de8,0x38}, -{0x8de9,0x22}, -{0x8dea,0x12}, -{0x8deb,0x06}, -{0x8dec,0x7c}, -{0x8ded,0x8f}, -{0x8dee,0x31}, -{0x8def,0x8e}, -{0x8df0,0x30}, -{0x8df1,0x8d}, -{0x8df2,0x2f}, -{0x8df3,0x8c}, -{0x8df4,0x2e}, -{0x8df5,0x22}, -{0x8df6,0x93}, -{0x8df7,0xf9}, -{0x8df8,0xf8}, -{0x8df9,0x02}, -{0x8dfa,0x06}, -{0x8dfb,0x69}, -{0x8dfc,0x00}, -{0x8dfd,0x00}, -{0x8dfe,0x00}, -{0x8dff,0x00}, -{0x8e00,0x12}, -{0x8e01,0x01}, -{0x8e02,0x17}, -{0x8e03,0x08}, -{0x8e04,0x31}, -{0x8e05,0x15}, -{0x8e06,0x53}, -{0x8e07,0x54}, -{0x8e08,0x44}, -{0x8e09,0x20}, -{0x8e0a,0x20}, -{0x8e0b,0x20}, -{0x8e0c,0x20}, -{0x8e0d,0x20}, -{0x8e0e,0x13}, -{0x8e0f,0x01}, -{0x8e10,0x10}, -{0x8e11,0x01}, -{0x8e12,0x56}, -{0x8e13,0x40}, -{0x8e14,0x1a}, -{0x8e15,0x30}, -{0x8e16,0x29}, -{0x8e17,0x7e}, -{0x8e18,0x00}, -{0x8e19,0x30}, -{0x8e1a,0x04}, -{0x8e1b,0x20}, -{0x8e1c,0xdf}, -{0x8e1d,0x30}, -{0x8e1e,0x05}, -{0x8e1f,0x40}, -{0x8e20,0xbf}, -{0x8e21,0x50}, -{0x8e22,0x03}, -{0x8e23,0x00}, -{0x8e24,0xfd}, -{0x8e25,0x50}, -{0x8e26,0x27}, -{0x8e27,0x01}, -{0x8e28,0xfe}, -{0x8e29,0x60}, -{0x8e2a,0x00}, -{0x8e2b,0x11}, -{0x8e2c,0x00}, -{0x8e2d,0x3f}, -{0x8e2e,0x05}, -{0x8e2f,0x30}, -{0x8e30,0x00}, -{0x8e31,0x3f}, -{0x8e32,0x06}, -{0x8e33,0x22}, -{0x8e34,0x00}, -{0x8e35,0x3f}, -{0x8e36,0x01}, -{0x8e37,0x2a}, -{0x8e38,0x00}, -{0x8e39,0x3f}, -{0x8e3a,0x02}, -{0x8e3b,0x00}, -{0x8e3c,0x00}, -{0x8e3d,0x36}, -{0x8e3e,0x06}, -{0x8e3f,0x07}, -{0x8e40,0x00}, -{0x8e41,0x3f}, -{0x8e42,0x0b}, -{0x8e43,0x0f}, -{0x8e44,0xf0}, -{0x8e45,0x00}, -{0x8e46,0x00}, -{0x8e47,0x00}, -{0x8e48,0x00}, -{0x8e49,0x30}, -{0x8e4a,0x01}, -{0x8e4b,0x40}, -{0x8e4c,0xbf}, -{0x8e4d,0x30}, -{0x8e4e,0x01}, -{0x8e4f,0x00}, -{0x8e50,0xbf}, -{0x8e51,0x30}, -{0x8e52,0x29}, -{0x8e53,0x70}, -{0x8e54,0x00}, -{0x8e55,0x3a}, -{0x8e56,0x00}, -{0x8e57,0x00}, -{0x8e58,0xff}, -{0x8e59,0x3a}, -{0x8e5a,0x00}, -{0x8e5b,0x00}, -{0x8e5c,0xff}, -{0x8e5d,0x36}, -{0x8e5e,0x03}, -{0x8e5f,0x36}, -{0x8e60,0x02}, -{0x8e61,0x41}, -{0x8e62,0x44}, -{0x8e63,0x58}, -{0x8e64,0x20}, -{0x8e65,0x18}, -{0x8e66,0x10}, -{0x8e67,0x0a}, -{0x8e68,0x04}, -{0x8e69,0x04}, -{0x8e6a,0x00}, -{0x8e6b,0x03}, -{0x8e6c,0xff}, -{0x8e6d,0x64}, -{0x8e6e,0x00}, -{0x8e6f,0x00}, -{0x8e70,0x80}, -{0x8e71,0x00}, -{0x8e72,0x00}, -{0x8e73,0x00}, -{0x8e74,0x00}, -{0x8e75,0x00}, -{0x8e76,0x00}, -{0x8e77,0x02}, -{0x8e78,0x04}, -{0x8e79,0x06}, -{0x8e7a,0x06}, -{0x8e7b,0x00}, -{0x8e7c,0x02}, -{0x8e7d,0x60},//CC -{0x8e7e,0x00}, -{0x8e7f,0x70}, -{0x8e80,0x50}, -{0x8e81,0x3c}, -{0x8e82,0x28}, -{0x8e83,0x1e}, -{0x8e84,0x10}, -{0x8e85,0x10}, -{0x8e86,0x50}, -{0x8e87,0x2d}, -{0x8e88,0x28}, -{0x8e89,0x16}, -{0x8e8a,0x10}, -{0x8e8b,0x10}, -{0x8e8c,0x02}, -{0x8e8d,0x00}, -{0x8e8e,0x10}, -{0x8e8f,0x0c}, -{0x8e90,0x10}, -{0x8e91,0x04}, -{0x8e92,0x0c}, -{0x8e93,0x6e}, -{0x8e94,0x0a}, -{0x8e95,0x05}, -{0x8e96,0x00}, -{0x8e97,0xa5}, -{0x8e98,0x5a}, -{0x8e99,0x00}, -{0x8e9a,0xae}, -{0x8e9b,0x35}, -{0x8e9c,0xaf}, -{0x8e9d,0x36}, -{0x8e9e,0xe4}, -{0x8e9f,0xfd}, -{0x8ea0,0xed}, -{0x8ea1,0xc3}, -{0x8ea2,0x95}, -{0x8ea3,0x37}, -{0x8ea4,0x50}, -{0x8ea5,0x33}, -{0x8ea6,0x12}, -{0x8ea7,0x0f}, -{0x8ea8,0xe2}, -{0x8ea9,0xe4}, -{0x8eaa,0x93}, -{0x8eab,0xf5}, -{0x8eac,0x38}, -{0x8ead,0x74}, -{0x8eae,0x01}, -{0x8eaf,0x93}, -{0x8eb0,0xf5}, -{0x8eb1,0x39}, -{0x8eb2,0x45}, -{0x8eb3,0x38}, -{0x8eb4,0x60}, -{0x8eb5,0x23}, -{0x8eb6,0x85}, -{0x8eb7,0x39}, -{0x8eb8,0x82}, -{0x8eb9,0x85}, -{0x8eba,0x38}, -{0x8ebb,0x83}, -{0x8ebc,0xe0}, -{0x8ebd,0xfc}, -{0x8ebe,0x12}, -{0x8ebf,0x0f}, -{0x8ec0,0xe2}, -{0x8ec1,0x74}, -{0x8ec2,0x03}, -{0x8ec3,0x93}, -{0x8ec4,0x52}, -{0x8ec5,0x04}, -{0x8ec6,0x12}, -{0x8ec7,0x0f}, -{0x8ec8,0xe2}, -{0x8ec9,0x74}, -{0x8eca,0x02}, -{0x8ecb,0x93}, -{0x8ecc,0x42}, -{0x8ecd,0x04}, -{0x8ece,0x85}, -{0x8ecf,0x39}, -{0x8ed0,0x82}, -{0x8ed1,0x85}, -{0x8ed2,0x38}, -{0x8ed3,0x83}, -{0x8ed4,0xec}, -{0x8ed5,0xf0}, -{0x8ed6,0x0d}, -{0x8ed7,0x80}, -{0x8ed8,0xc7}, -{0x8ed9,0x22}, -{0x8eda,0x78}, -{0x8edb,0xbe}, -{0x8edc,0xe6}, -{0x8edd,0xd3}, -{0x8ede,0x08}, -{0x8edf,0xff}, -{0x8ee0,0xe6}, -{0x8ee1,0x64}, -{0x8ee2,0x80}, -{0x8ee3,0xf8}, -{0x8ee4,0xef}, -{0x8ee5,0x64}, -{0x8ee6,0x80}, -{0x8ee7,0x98}, -{0x8ee8,0x22}, -{0x8ee9,0x93}, -{0x8eea,0xff}, -{0x8eeb,0x7e}, -{0x8eec,0x00}, -{0x8eed,0xe6}, -{0x8eee,0xfc}, -{0x8eef,0x08}, -{0x8ef0,0xe6}, -{0x8ef1,0xfd}, -{0x8ef2,0x12}, -{0x8ef3,0x04}, -{0x8ef4,0xc1}, -{0x8ef5,0x78}, -{0x8ef6,0xc1}, -{0x8ef7,0xe6}, -{0x8ef8,0xfc}, -{0x8ef9,0x08}, -{0x8efa,0xe6}, -{0x8efb,0xfd}, -{0x8efc,0xd3}, -{0x8efd,0xef}, -{0x8efe,0x9d}, -{0x8eff,0xee}, -{0x8f00,0x9c}, -{0x8f01,0x22}, -{0x8f02,0x78}, -{0x8f03,0xbd}, -{0x8f04,0xd3}, -{0x8f05,0xe6}, -{0x8f06,0x64}, -{0x8f07,0x80}, -{0x8f08,0x94}, -{0x8f09,0x80}, -{0x8f0a,0x22}, -{0x8f0b,0x25}, -{0x8f0c,0xe0}, -{0x8f0d,0x24}, -{0x8f0e,0x0a}, -{0x8f0f,0xf8}, -{0x8f10,0xe6}, -{0x8f11,0xfe}, -{0x8f12,0x08}, -{0x8f13,0xe6}, -{0x8f14,0xff}, -{0x8f15,0x22}, -{0x8f16,0xe5}, -{0x8f17,0x3c}, -{0x8f18,0xd3}, -{0x8f19,0x94}, -{0x8f1a,0x00}, -{0x8f1b,0x40}, -{0x8f1c,0x0b}, -{0x8f1d,0x90}, -{0x8f1e,0x0e}, -{0x8f1f,0x88}, -{0x8f20,0x12}, -{0x8f21,0x0b}, -{0x8f22,0xf1}, -{0x8f23,0x90}, -{0x8f24,0x0e}, -{0x8f25,0x86}, -{0x8f26,0x80}, -{0x8f27,0x09}, -{0x8f28,0x90}, -{0x8f29,0x0e}, -{0x8f2a,0x82}, -{0x8f2b,0x12}, -{0x8f2c,0x0b}, -{0x8f2d,0xf1}, -{0x8f2e,0x90}, -{0x8f2f,0x0e}, -{0x8f30,0x80}, -{0x8f31,0xe4}, -{0x8f32,0x93}, -{0x8f33,0xf5}, -{0x8f34,0x44}, -{0x8f35,0xa3}, -{0x8f36,0xe4}, -{0x8f37,0x93}, -{0x8f38,0xf5}, -{0x8f39,0x43}, -{0x8f3a,0xd2}, -{0x8f3b,0x06}, -{0x8f3c,0x30}, -{0x8f3d,0x06}, -{0x8f3e,0x03}, -{0x8f3f,0xd3}, -{0x8f40,0x80}, -{0x8f41,0x01}, -{0x8f42,0xc3}, -{0x8f43,0x92}, -{0x8f44,0x0e}, -{0x8f45,0x22}, -{0x8f46,0xa2}, -{0x8f47,0xaf}, -{0x8f48,0x92}, -{0x8f49,0x32}, -{0x8f4a,0xc2}, -{0x8f4b,0xaf}, -{0x8f4c,0xe5}, -{0x8f4d,0x23}, -{0x8f4e,0x45}, -{0x8f4f,0x22}, -{0x8f50,0x90}, -{0x8f51,0x0e}, -{0x8f52,0x5d}, -{0x8f53,0x60}, -{0x8f54,0x0e}, -{0x8f55,0x12}, -{0x8f56,0x0f}, -{0x8f57,0xcb}, -{0x8f58,0xe0}, -{0x8f59,0xf5}, -{0x8f5a,0x2c}, -{0x8f5b,0x12}, -{0x8f5c,0x0f}, -{0x8f5d,0xc8}, -{0x8f5e,0xe0}, -{0x8f5f,0xf5}, -{0x8f60,0x2d}, -{0x8f61,0x80}, -{0x8f62,0x0c}, -{0x8f63,0x12}, -{0x8f64,0x0f}, -{0x8f65,0xcb}, -{0x8f66,0xe5}, -{0x8f67,0x30}, -{0x8f68,0xf0}, -{0x8f69,0x12}, -{0x8f6a,0x0f}, -{0x8f6b,0xc8}, -{0x8f6c,0xe5}, -{0x8f6d,0x31}, -{0x8f6e,0xf0}, -{0x8f6f,0xa2}, -{0x8f70,0x32}, -{0x8f71,0x92}, -{0x8f72,0xaf}, -{0x8f73,0x22}, -{0x8f74,0xd2}, -{0x8f75,0x01}, -{0x8f76,0xc2}, -{0x8f77,0x02}, -{0x8f78,0xe4}, -{0x8f79,0xf5}, -{0x8f7a,0x1f}, -{0x8f7b,0xf5}, -{0x8f7c,0x1e}, -{0x8f7d,0xd2}, -{0x8f7e,0x35}, -{0x8f7f,0xd2}, -{0x8f80,0x33}, -{0x8f81,0xd2}, -{0x8f82,0x36}, -{0x8f83,0xd2}, -{0x8f84,0x01}, -{0x8f85,0xc2}, -{0x8f86,0x02}, -{0x8f87,0xf5}, -{0x8f88,0x1f}, -{0x8f89,0xf5}, -{0x8f8a,0x1e}, -{0x8f8b,0xd2}, -{0x8f8c,0x35}, -{0x8f8d,0xd2}, -{0x8f8e,0x33}, -{0x8f8f,0x22}, -{0x8f90,0xfb}, -{0x8f91,0xd3}, -{0x8f92,0xed}, -{0x8f93,0x9b}, -{0x8f94,0x74}, -{0x8f95,0x80}, -{0x8f96,0xf8}, -{0x8f97,0x6c}, -{0x8f98,0x98}, -{0x8f99,0x22}, -{0x8f9a,0x12}, -{0x8f9b,0x06}, -{0x8f9c,0x69}, -{0x8f9d,0xe5}, -{0x8f9e,0x40}, -{0x8f9f,0x2f}, -{0x8fa0,0xf5}, -{0x8fa1,0x40}, -{0x8fa2,0xe5}, -{0x8fa3,0x3f}, -{0x8fa4,0x3e}, -{0x8fa5,0xf5}, -{0x8fa6,0x3f}, -{0x8fa7,0xe5}, -{0x8fa8,0x3e}, -{0x8fa9,0x3d}, -{0x8faa,0xf5}, -{0x8fab,0x3e}, -{0x8fac,0xe5}, -{0x8fad,0x3d}, -{0x8fae,0x3c}, -{0x8faf,0xf5}, -{0x8fb0,0x3d}, -{0x8fb1,0x22}, -{0x8fb2,0xc0}, -{0x8fb3,0xe0}, -{0x8fb4,0xc0}, -{0x8fb5,0x83}, -{0x8fb6,0xc0}, -{0x8fb7,0x82}, -{0x8fb8,0x90}, -{0x8fb9,0x3f}, -{0x8fba,0x0d}, -{0x8fbb,0xe0}, -{0x8fbc,0xf5}, -{0x8fbd,0x33}, -{0x8fbe,0xe5}, -{0x8fbf,0x33}, -{0x8fc0,0xf0}, -{0x8fc1,0xd0}, -{0x8fc2,0x82}, -{0x8fc3,0xd0}, -{0x8fc4,0x83}, -{0x8fc5,0xd0}, -{0x8fc6,0xe0}, -{0x8fc7,0x32}, -{0x8fc8,0x90}, -{0x8fc9,0x0e}, -{0x8fca,0x5f}, -{0x8fcb,0xe4}, -{0x8fcc,0x93}, -{0x8fcd,0xfe}, -{0x8fce,0x74}, -{0x8fcf,0x01}, -{0x8fd0,0x93}, -{0x8fd1,0xf5}, -{0x8fd2,0x82}, -{0x8fd3,0x8e}, -{0x8fd4,0x83}, -{0x8fd5,0x22}, -{0x8fd6,0x78}, -{0x8fd7,0x7f}, -{0x8fd8,0xe4}, -{0x8fd9,0xf6}, -{0x8fda,0xd8}, -{0x8fdb,0xfd}, -{0x8fdc,0x75}, -{0x8fdd,0x81}, -{0x8fde,0xcd}, -{0x8fdf,0x02}, -{0x8fe0,0x0c}, -{0x8fe1,0x98}, -{0x8fe2,0x8f}, -{0x8fe3,0x82}, -{0x8fe4,0x8e}, -{0x8fe5,0x83}, -{0x8fe6,0x75}, -{0x8fe7,0xf0}, -{0x8fe8,0x04}, -{0x8fe9,0xed}, -{0x8fea,0x02}, -{0x8feb,0x06}, -{0x8fec,0xa5}, -{0x3022,0x00}, -{0x3023,0x00}, -{0x3024,0x00}, -{0x3025,0x00}, -{0x3026,0x00}, -{0x3027,0x00}, -{0x3028,0x00}, -{0x3029,0x7F}, -{0x3000,0x00}, -#elif 1 // ddl@rock-chips.com : 2012/12/10 Continues Focus from OVT -{0x3000,0x20}, -{0x8000,0x02}, -{0x8001,0x0f}, -{0x8002,0xd6}, -{0x8003,0x02}, -{0x8004,0x0a}, -{0x8005,0x39}, -{0x8006,0xc2}, -{0x8007,0x01}, -{0x8008,0x22}, -{0x8009,0x22}, -{0x800a,0x00}, -{0x800b,0x02}, -{0x800c,0x0f}, -{0x800d,0xb2}, -{0x800e,0xe5}, -{0x800f,0x1f}, -{0x8010,0x70}, -{0x8011,0x72}, -{0x8012,0xf5}, -{0x8013,0x1e}, -{0x8014,0xd2}, -{0x8015,0x35}, -{0x8016,0xff}, -{0x8017,0xef}, -{0x8018,0x25}, -{0x8019,0xe0}, -{0x801a,0x24}, -{0x801b,0x4e}, -{0x801c,0xf8}, -{0x801d,0xe4}, -{0x801e,0xf6}, -{0x801f,0x08}, -{0x8020,0xf6}, -{0x8021,0x0f}, -{0x8022,0xbf}, -{0x8023,0x34}, -{0x8024,0xf2}, -{0x8025,0x90}, -{0x8026,0x0e}, -{0x8027,0x93}, -{0x8028,0xe4}, -{0x8029,0x93}, -{0x802a,0xff}, -{0x802b,0xe5}, -{0x802c,0x4b}, -{0x802d,0xc3}, -{0x802e,0x9f}, -{0x802f,0x50}, -{0x8030,0x04}, -{0x8031,0x7f}, -{0x8032,0x05}, -{0x8033,0x80}, -{0x8034,0x02}, -{0x8035,0x7f}, -{0x8036,0xfb}, -{0x8037,0x78}, -{0x8038,0xbd}, -{0x8039,0xa6}, -{0x803a,0x07}, -{0x803b,0x12}, -{0x803c,0x0f}, -{0x803d,0x04}, -{0x803e,0x40}, -{0x803f,0x04}, -{0x8040,0x7f}, -{0x8041,0x03}, -{0x8042,0x80}, -{0x8043,0x02}, -{0x8044,0x7f}, -{0x8045,0x30}, -{0x8046,0x78}, -{0x8047,0xbc}, -{0x8048,0xa6}, -{0x8049,0x07}, -{0x804a,0xe6}, -{0x804b,0x18}, -{0x804c,0xf6}, -{0x804d,0x08}, -{0x804e,0xe6}, -{0x804f,0x78}, -{0x8050,0xb9}, -{0x8051,0xf6}, -{0x8052,0x78}, -{0x8053,0xbc}, -{0x8054,0xe6}, -{0x8055,0x78}, -{0x8056,0xba}, -{0x8057,0xf6}, -{0x8058,0x78}, -{0x8059,0xbf}, -{0x805a,0x76}, -{0x805b,0x33}, -{0x805c,0xe4}, -{0x805d,0x08}, -{0x805e,0xf6}, -{0x805f,0x78}, -{0x8060,0xb8}, -{0x8061,0x76}, -{0x8062,0x01}, -{0x8063,0x75}, -{0x8064,0x4a}, -{0x8065,0x02}, -{0x8066,0x78}, -{0x8067,0xb6}, -{0x8068,0xf6}, -{0x8069,0x08}, -{0x806a,0xf6}, -{0x806b,0x74}, -{0x806c,0xff}, -{0x806d,0x78}, -{0x806e,0xc1}, -{0x806f,0xf6}, -{0x8070,0x08}, -{0x8071,0xf6}, -{0x8072,0x75}, -{0x8073,0x1f}, -{0x8074,0x01}, -{0x8075,0x78}, -{0x8076,0xbc}, -{0x8077,0xe6}, -{0x8078,0x75}, -{0x8079,0xf0}, -{0x807a,0x05}, -{0x807b,0xa4}, -{0x807c,0xf5}, -{0x807d,0x4b}, -{0x807e,0x12}, -{0x807f,0x0a}, -{0x8080,0xff}, -{0x8081,0xc2}, -{0x8082,0x37}, -{0x8083,0x22}, -{0x8084,0x78}, -{0x8085,0xb8}, -{0x8086,0xe6}, -{0x8087,0xd3}, -{0x8088,0x94}, -{0x8089,0x00}, -{0x808a,0x40}, -{0x808b,0x02}, -{0x808c,0x16}, -{0x808d,0x22}, -{0x808e,0xe5}, -{0x808f,0x1f}, -{0x8090,0xb4}, -{0x8091,0x05}, -{0x8092,0x23}, -{0x8093,0xe4}, -{0x8094,0xf5}, -{0x8095,0x1f}, -{0x8096,0xc2}, -{0x8097,0x01}, -{0x8098,0x78}, -{0x8099,0xb6}, -{0x809a,0xe6}, -{0x809b,0xfe}, -{0x809c,0x08}, -{0x809d,0xe6}, -{0x809e,0xff}, -{0x809f,0x78}, -{0x80a0,0x4e}, -{0x80a1,0xa6}, -{0x80a2,0x06}, -{0x80a3,0x08}, -{0x80a4,0xa6}, -{0x80a5,0x07}, -{0x80a6,0xa2}, -{0x80a7,0x37}, -{0x80a8,0xe4}, -{0x80a9,0x33}, -{0x80aa,0xf5}, -{0x80ab,0x3c}, -{0x80ac,0x90}, -{0x80ad,0x30}, -{0x80ae,0x28}, -{0x80af,0xf0}, -{0x80b0,0x75}, -{0x80b1,0x1e}, -{0x80b2,0x10}, -{0x80b3,0xd2}, -{0x80b4,0x35}, -{0x80b5,0x22}, -{0x80b6,0xe5}, -{0x80b7,0x4b}, -{0x80b8,0x75}, -{0x80b9,0xf0}, -{0x80ba,0x05}, -{0x80bb,0x84}, -{0x80bc,0x78}, -{0x80bd,0xbc}, -{0x80be,0xf6}, -{0x80bf,0x90}, -{0x80c0,0x0e}, -{0x80c1,0x8c}, -{0x80c2,0xe4}, -{0x80c3,0x93}, -{0x80c4,0xff}, -{0x80c5,0x25}, -{0x80c6,0xe0}, -{0x80c7,0x24}, -{0x80c8,0x0a}, -{0x80c9,0xf8}, -{0x80ca,0xe6}, -{0x80cb,0xfc}, -{0x80cc,0x08}, -{0x80cd,0xe6}, -{0x80ce,0xfd}, -{0x80cf,0x78}, -{0x80d0,0xbc}, -{0x80d1,0xe6}, -{0x80d2,0x25}, -{0x80d3,0xe0}, -{0x80d4,0x24}, -{0x80d5,0x4e}, -{0x80d6,0xf8}, -{0x80d7,0xa6}, -{0x80d8,0x04}, -{0x80d9,0x08}, -{0x80da,0xa6}, -{0x80db,0x05}, -{0x80dc,0xef}, -{0x80dd,0x12}, -{0x80de,0x0f}, -{0x80df,0x0b}, -{0x80e0,0xd3}, -{0x80e1,0x78}, -{0x80e2,0xb7}, -{0x80e3,0x96}, -{0x80e4,0xee}, -{0x80e5,0x18}, -{0x80e6,0x96}, -{0x80e7,0x40}, -{0x80e8,0x0d}, -{0x80e9,0x78}, -{0x80ea,0xbc}, -{0x80eb,0xe6}, -{0x80ec,0x78}, -{0x80ed,0xb9}, -{0x80ee,0xf6}, -{0x80ef,0x78}, -{0x80f0,0xb6}, -{0x80f1,0xa6}, -{0x80f2,0x06}, -{0x80f3,0x08}, -{0x80f4,0xa6}, -{0x80f5,0x07}, -{0x80f6,0x90}, -{0x80f7,0x0e}, -{0x80f8,0x8c}, -{0x80f9,0xe4}, -{0x80fa,0x93}, -{0x80fb,0x12}, -{0x80fc,0x0f}, -{0x80fd,0x0b}, -{0x80fe,0xc3}, -{0x80ff,0x78}, -{0x8100,0xc2}, -{0x8101,0x96}, -{0x8102,0xee}, -{0x8103,0x18}, -{0x8104,0x96}, -{0x8105,0x50}, -{0x8106,0x0d}, -{0x8107,0x78}, -{0x8108,0xbc}, -{0x8109,0xe6}, -{0x810a,0x78}, -{0x810b,0xba}, -{0x810c,0xf6}, -{0x810d,0x78}, -{0x810e,0xc1}, -{0x810f,0xa6}, -{0x8110,0x06}, -{0x8111,0x08}, -{0x8112,0xa6}, -{0x8113,0x07}, -{0x8114,0x78}, -{0x8115,0xb6}, -{0x8116,0xe6}, -{0x8117,0xfe}, -{0x8118,0x08}, -{0x8119,0xe6}, -{0x811a,0xc3}, -{0x811b,0x78}, -{0x811c,0xc2}, -{0x811d,0x96}, -{0x811e,0xff}, -{0x811f,0xee}, -{0x8120,0x18}, -{0x8121,0x96}, -{0x8122,0x78}, -{0x8123,0xc3}, -{0x8124,0xf6}, -{0x8125,0x08}, -{0x8126,0xa6}, -{0x8127,0x07}, -{0x8128,0x90}, -{0x8129,0x0e}, -{0x812a,0x95}, -{0x812b,0xe4}, -{0x812c,0x18}, -{0x812d,0x12}, -{0x812e,0x0e}, -{0x812f,0xe9}, -{0x8130,0x40}, -{0x8131,0x02}, -{0x8132,0xd2}, -{0x8133,0x37}, -{0x8134,0x78}, -{0x8135,0xbc}, -{0x8136,0xe6}, -{0x8137,0x08}, -{0x8138,0x26}, -{0x8139,0x08}, -{0x813a,0xf6}, -{0x813b,0xe5}, -{0x813c,0x1f}, -{0x813d,0x64}, -{0x813e,0x01}, -{0x813f,0x70}, -{0x8140,0x4a}, -{0x8141,0xe6}, -{0x8142,0xc3}, -{0x8143,0x78}, -{0x8144,0xc0}, -{0x8145,0x12}, -{0x8146,0x0e}, -{0x8147,0xdf}, -{0x8148,0x40}, -{0x8149,0x05}, -{0x814a,0x12}, -{0x814b,0x0e}, -{0x814c,0xda}, -{0x814d,0x40}, -{0x814e,0x39}, -{0x814f,0x12}, -{0x8150,0x0f}, -{0x8151,0x02}, -{0x8152,0x40}, -{0x8153,0x04}, -{0x8154,0x7f}, -{0x8155,0xfe}, -{0x8156,0x80}, -{0x8157,0x02}, -{0x8158,0x7f}, -{0x8159,0x02}, -{0x815a,0x78}, -{0x815b,0xbd}, -{0x815c,0xa6}, -{0x815d,0x07}, -{0x815e,0x78}, -{0x815f,0xb9}, -{0x8160,0xe6}, -{0x8161,0x24}, -{0x8162,0x03}, -{0x8163,0x78}, -{0x8164,0xbf}, -{0x8165,0xf6}, -{0x8166,0x78}, -{0x8167,0xb9}, -{0x8168,0xe6}, -{0x8169,0x24}, -{0x816a,0xfd}, -{0x816b,0x78}, -{0x816c,0xc0}, -{0x816d,0xf6}, -{0x816e,0x12}, -{0x816f,0x0f}, -{0x8170,0x02}, -{0x8171,0x40}, -{0x8172,0x06}, -{0x8173,0x78}, -{0x8174,0xc0}, -{0x8175,0xe6}, -{0x8176,0xff}, -{0x8177,0x80}, -{0x8178,0x04}, -{0x8179,0x78}, -{0x817a,0xbf}, -{0x817b,0xe6}, -{0x817c,0xff}, -{0x817d,0x78}, -{0x817e,0xbe}, -{0x817f,0xa6}, -{0x8180,0x07}, -{0x8181,0x75}, -{0x8182,0x1f}, -{0x8183,0x02}, -{0x8184,0x78}, -{0x8185,0xb8}, -{0x8186,0x76}, -{0x8187,0x01}, -{0x8188,0x02}, -{0x8189,0x02}, -{0x818a,0x4a}, -{0x818b,0xe5}, -{0x818c,0x1f}, -{0x818d,0x64}, -{0x818e,0x02}, -{0x818f,0x60}, -{0x8190,0x03}, -{0x8191,0x02}, -{0x8192,0x02}, -{0x8193,0x2a}, -{0x8194,0x78}, -{0x8195,0xbe}, -{0x8196,0xe6}, -{0x8197,0xff}, -{0x8198,0xc3}, -{0x8199,0x78}, -{0x819a,0xc0}, -{0x819b,0x12}, -{0x819c,0x0e}, -{0x819d,0xe0}, -{0x819e,0x40}, -{0x819f,0x08}, -{0x81a0,0x12}, -{0x81a1,0x0e}, -{0x81a2,0xda}, -{0x81a3,0x50}, -{0x81a4,0x03}, -{0x81a5,0x02}, -{0x81a6,0x02}, -{0x81a7,0x28}, -{0x81a8,0x12}, -{0x81a9,0x0f}, -{0x81aa,0x02}, -{0x81ab,0x40}, -{0x81ac,0x04}, -{0x81ad,0x7f}, -{0x81ae,0xff}, -{0x81af,0x80}, -{0x81b0,0x02}, -{0x81b1,0x7f}, -{0x81b2,0x01}, -{0x81b3,0x78}, -{0x81b4,0xbd}, -{0x81b5,0xa6}, -{0x81b6,0x07}, -{0x81b7,0x78}, -{0x81b8,0xb9}, -{0x81b9,0xe6}, -{0x81ba,0x04}, -{0x81bb,0x78}, -{0x81bc,0xbf}, -{0x81bd,0xf6}, -{0x81be,0x78}, -{0x81bf,0xb9}, -{0x81c0,0xe6}, -{0x81c1,0x14}, -{0x81c2,0x78}, -{0x81c3,0xc0}, -{0x81c4,0xf6}, -{0x81c5,0x18}, -{0x81c6,0x12}, -{0x81c7,0x0f}, -{0x81c8,0x04}, -{0x81c9,0x40}, -{0x81ca,0x04}, -{0x81cb,0xe6}, -{0x81cc,0xff}, -{0x81cd,0x80}, -{0x81ce,0x02}, -{0x81cf,0x7f}, -{0x81d0,0x00}, -{0x81d1,0x78}, -{0x81d2,0xbf}, -{0x81d3,0xa6}, -{0x81d4,0x07}, -{0x81d5,0xd3}, -{0x81d6,0x08}, -{0x81d7,0xe6}, -{0x81d8,0x64}, -{0x81d9,0x80}, -{0x81da,0x94}, -{0x81db,0x80}, -{0x81dc,0x40}, -{0x81dd,0x04}, -{0x81de,0xe6}, -{0x81df,0xff}, -{0x81e0,0x80}, -{0x81e1,0x02}, -{0x81e2,0x7f}, -{0x81e3,0x00}, -{0x81e4,0x78}, -{0x81e5,0xc0}, -{0x81e6,0xa6}, -{0x81e7,0x07}, -{0x81e8,0xc3}, -{0x81e9,0x18}, -{0x81ea,0xe6}, -{0x81eb,0x64}, -{0x81ec,0x80}, -{0x81ed,0x94}, -{0x81ee,0xb3}, -{0x81ef,0x50}, -{0x81f0,0x04}, -{0x81f1,0xe6}, -{0x81f2,0xff}, -{0x81f3,0x80}, -{0x81f4,0x02}, -{0x81f5,0x7f}, -{0x81f6,0x33}, -{0x81f7,0x78}, -{0x81f8,0xbf}, -{0x81f9,0xa6}, -{0x81fa,0x07}, -{0x81fb,0xc3}, -{0x81fc,0x08}, -{0x81fd,0xe6}, -{0x81fe,0x64}, -{0x81ff,0x80}, -{0x8200,0x94}, -{0x8201,0xb3}, -{0x8202,0x50}, -{0x8203,0x04}, -{0x8204,0xe6}, -{0x8205,0xff}, -{0x8206,0x80}, -{0x8207,0x02}, -{0x8208,0x7f}, -{0x8209,0x33}, -{0x820a,0x78}, -{0x820b,0xc0}, -{0x820c,0xa6}, -{0x820d,0x07}, -{0x820e,0x12}, -{0x820f,0x0f}, -{0x8210,0x02}, -{0x8211,0x40}, -{0x8212,0x06}, -{0x8213,0x78}, -{0x8214,0xc0}, -{0x8215,0xe6}, -{0x8216,0xff}, -{0x8217,0x80}, -{0x8218,0x04}, -{0x8219,0x78}, -{0x821a,0xbf}, -{0x821b,0xe6}, -{0x821c,0xff}, -{0x821d,0x78}, -{0x821e,0xbe}, -{0x821f,0xa6}, -{0x8220,0x07}, -{0x8221,0x75}, -{0x8222,0x1f}, -{0x8223,0x03}, -{0x8224,0x78}, -{0x8225,0xb8}, -{0x8226,0x76}, -{0x8227,0x01}, -{0x8228,0x80}, -{0x8229,0x20}, -{0x822a,0xe5}, -{0x822b,0x1f}, -{0x822c,0x64}, -{0x822d,0x03}, -{0x822e,0x70}, -{0x822f,0x26}, -{0x8230,0x78}, -{0x8231,0xbe}, -{0x8232,0xe6}, -{0x8233,0xff}, -{0x8234,0xc3}, -{0x8235,0x78}, -{0x8236,0xc0}, -{0x8237,0x12}, -{0x8238,0x0e}, -{0x8239,0xe0}, -{0x823a,0x40}, -{0x823b,0x05}, -{0x823c,0x12}, -{0x823d,0x0e}, -{0x823e,0xda}, -{0x823f,0x40}, -{0x8240,0x09}, -{0x8241,0x78}, -{0x8242,0xb9}, -{0x8243,0xe6}, -{0x8244,0x78}, -{0x8245,0xbe}, -{0x8246,0xf6}, -{0x8247,0x75}, -{0x8248,0x1f}, -{0x8249,0x04}, -{0x824a,0x78}, -{0x824b,0xbe}, -{0x824c,0xe6}, -{0x824d,0x75}, -{0x824e,0xf0}, -{0x824f,0x05}, -{0x8250,0xa4}, -{0x8251,0xf5}, -{0x8252,0x4b}, -{0x8253,0x02}, -{0x8254,0x0a}, -{0x8255,0xff}, -{0x8256,0xe5}, -{0x8257,0x1f}, -{0x8258,0xb4}, -{0x8259,0x04}, -{0x825a,0x10}, -{0x825b,0x90}, -{0x825c,0x0e}, -{0x825d,0x94}, -{0x825e,0xe4}, -{0x825f,0x78}, -{0x8260,0xc3}, -{0x8261,0x12}, -{0x8262,0x0e}, -{0x8263,0xe9}, -{0x8264,0x40}, -{0x8265,0x02}, -{0x8266,0xd2}, -{0x8267,0x37}, -{0x8268,0x75}, -{0x8269,0x1f}, -{0x826a,0x05}, -{0x826b,0x22}, -{0x826c,0x30}, -{0x826d,0x01}, -{0x826e,0x03}, -{0x826f,0x02}, -{0x8270,0x04}, -{0x8271,0xc0}, -{0x8272,0x30}, -{0x8273,0x02}, -{0x8274,0x03}, -{0x8275,0x02}, -{0x8276,0x04}, -{0x8277,0xc0}, -{0x8278,0x90}, -{0x8279,0x51}, -{0x827a,0xa5}, -{0x827b,0xe0}, -{0x827c,0x78}, -{0x827d,0x93}, -{0x827e,0xf6}, -{0x827f,0xa3}, -{0x8280,0xe0}, -{0x8281,0x08}, -{0x8282,0xf6}, -{0x8283,0xa3}, -{0x8284,0xe0}, -{0x8285,0x08}, -{0x8286,0xf6}, -{0x8287,0xe5}, -{0x8288,0x1f}, -{0x8289,0x70}, -{0x828a,0x3c}, -{0x828b,0x75}, -{0x828c,0x1e}, -{0x828d,0x20}, -{0x828e,0xd2}, -{0x828f,0x35}, -{0x8290,0x12}, -{0x8291,0x0c}, -{0x8292,0x7a}, -{0x8293,0x78}, -{0x8294,0x7e}, -{0x8295,0xa6}, -{0x8296,0x06}, -{0x8297,0x08}, -{0x8298,0xa6}, -{0x8299,0x07}, -{0x829a,0x78}, -{0x829b,0x8b}, -{0x829c,0xa6}, -{0x829d,0x09}, -{0x829e,0x18}, -{0x829f,0x76}, -{0x82a0,0x01}, -{0x82a1,0x12}, -{0x82a2,0x0c}, -{0x82a3,0x5b}, -{0x82a4,0x78}, -{0x82a5,0x4e}, -{0x82a6,0xa6}, -{0x82a7,0x06}, -{0x82a8,0x08}, -{0x82a9,0xa6}, -{0x82aa,0x07}, -{0x82ab,0x78}, -{0x82ac,0x8b}, -{0x82ad,0xe6}, -{0x82ae,0x78}, -{0x82af,0x6e}, -{0x82b0,0xf6}, -{0x82b1,0x75}, -{0x82b2,0x1f}, -{0x82b3,0x01}, -{0x82b4,0x78}, -{0x82b5,0x93}, -{0x82b6,0xe6}, -{0x82b7,0x78}, -{0x82b8,0x90}, -{0x82b9,0xf6}, -{0x82ba,0x78}, -{0x82bb,0x94}, -{0x82bc,0xe6}, -{0x82bd,0x78}, -{0x82be,0x91}, -{0x82bf,0xf6}, -{0x82c0,0x78}, -{0x82c1,0x95}, -{0x82c2,0xe6}, -{0x82c3,0x78}, -{0x82c4,0x92}, -{0x82c5,0xf6}, -{0x82c6,0x22}, -{0x82c7,0x79}, -{0x82c8,0x90}, -{0x82c9,0xe7}, -{0x82ca,0xd3}, -{0x82cb,0x78}, -{0x82cc,0x93}, -{0x82cd,0x96}, -{0x82ce,0x40}, -{0x82cf,0x05}, -{0x82d0,0xe7}, -{0x82d1,0x96}, -{0x82d2,0xff}, -{0x82d3,0x80}, -{0x82d4,0x08}, -{0x82d5,0xc3}, -{0x82d6,0x79}, -{0x82d7,0x93}, -{0x82d8,0xe7}, -{0x82d9,0x78}, -{0x82da,0x90}, -{0x82db,0x96}, -{0x82dc,0xff}, -{0x82dd,0x78}, -{0x82de,0x88}, -{0x82df,0x76}, -{0x82e0,0x00}, -{0x82e1,0x08}, -{0x82e2,0xa6}, -{0x82e3,0x07}, -{0x82e4,0x79}, -{0x82e5,0x91}, -{0x82e6,0xe7}, -{0x82e7,0xd3}, -{0x82e8,0x78}, -{0x82e9,0x94}, -{0x82ea,0x96}, -{0x82eb,0x40}, -{0x82ec,0x05}, -{0x82ed,0xe7}, -{0x82ee,0x96}, -{0x82ef,0xff}, -{0x82f0,0x80}, -{0x82f1,0x08}, -{0x82f2,0xc3}, -{0x82f3,0x79}, -{0x82f4,0x94}, -{0x82f5,0xe7}, -{0x82f6,0x78}, -{0x82f7,0x91}, -{0x82f8,0x96}, -{0x82f9,0xff}, -{0x82fa,0x12}, -{0x82fb,0x0c}, -{0x82fc,0x8e}, -{0x82fd,0x79}, -{0x82fe,0x92}, -{0x82ff,0xe7}, -{0x8300,0xd3}, -{0x8301,0x78}, -{0x8302,0x95}, -{0x8303,0x96}, -{0x8304,0x40}, -{0x8305,0x05}, -{0x8306,0xe7}, -{0x8307,0x96}, -{0x8308,0xff}, -{0x8309,0x80}, -{0x830a,0x08}, -{0x830b,0xc3}, -{0x830c,0x79}, -{0x830d,0x95}, -{0x830e,0xe7}, -{0x830f,0x78}, -{0x8310,0x92}, -{0x8311,0x96}, -{0x8312,0xff}, -{0x8313,0x12}, -{0x8314,0x0c}, -{0x8315,0x8e}, -{0x8316,0x12}, -{0x8317,0x0c}, -{0x8318,0x5b}, -{0x8319,0x78}, -{0x831a,0x8a}, -{0x831b,0xe6}, -{0x831c,0x25}, -{0x831d,0xe0}, -{0x831e,0x24}, -{0x831f,0x4e}, -{0x8320,0xf8}, -{0x8321,0xa6}, -{0x8322,0x06}, -{0x8323,0x08}, -{0x8324,0xa6}, -{0x8325,0x07}, -{0x8326,0x78}, -{0x8327,0x8a}, -{0x8328,0xe6}, -{0x8329,0x24}, -{0x832a,0x6e}, -{0x832b,0xf8}, -{0x832c,0xa6}, -{0x832d,0x09}, -{0x832e,0x78}, -{0x832f,0x8a}, -{0x8330,0xe6}, -{0x8331,0x24}, -{0x8332,0x01}, -{0x8333,0xff}, -{0x8334,0xe4}, -{0x8335,0x33}, -{0x8336,0xfe}, -{0x8337,0xd3}, -{0x8338,0xef}, -{0x8339,0x94}, -{0x833a,0x0f}, -{0x833b,0xee}, -{0x833c,0x64}, -{0x833d,0x80}, -{0x833e,0x94}, -{0x833f,0x80}, -{0x8340,0x40}, -{0x8341,0x04}, -{0x8342,0x7f}, -{0x8343,0x00}, -{0x8344,0x80}, -{0x8345,0x05}, -{0x8346,0x78}, -{0x8347,0x8a}, -{0x8348,0xe6}, -{0x8349,0x04}, -{0x834a,0xff}, -{0x834b,0x78}, -{0x834c,0x8a}, -{0x834d,0xa6}, -{0x834e,0x07}, -{0x834f,0xe5}, -{0x8350,0x1f}, -{0x8351,0xb4}, -{0x8352,0x01}, -{0x8353,0x0a}, -{0x8354,0xe6}, -{0x8355,0x60}, -{0x8356,0x03}, -{0x8357,0x02}, -{0x8358,0x04}, -{0x8359,0xc0}, -{0x835a,0x75}, -{0x835b,0x1f}, -{0x835c,0x02}, -{0x835d,0x22}, -{0x835e,0x12}, -{0x835f,0x0c}, -{0x8360,0x7a}, -{0x8361,0x78}, -{0x8362,0x80}, -{0x8363,0xa6}, -{0x8364,0x06}, -{0x8365,0x08}, -{0x8366,0xa6}, -{0x8367,0x07}, -{0x8368,0x12}, -{0x8369,0x0c}, -{0x836a,0x7a}, -{0x836b,0x78}, -{0x836c,0x82}, -{0x836d,0xa6}, -{0x836e,0x06}, -{0x836f,0x08}, -{0x8370,0xa6}, -{0x8371,0x07}, -{0x8372,0x78}, -{0x8373,0x6e}, -{0x8374,0xe6}, -{0x8375,0x78}, -{0x8376,0x8c}, -{0x8377,0xf6}, -{0x8378,0x78}, -{0x8379,0x6e}, -{0x837a,0xe6}, -{0x837b,0x78}, -{0x837c,0x8d}, -{0x837d,0xf6}, -{0x837e,0x7f}, -{0x837f,0x01}, -{0x8380,0xef}, -{0x8381,0x25}, -{0x8382,0xe0}, -{0x8383,0x24}, -{0x8384,0x4f}, -{0x8385,0xf9}, -{0x8386,0xc3}, -{0x8387,0x78}, -{0x8388,0x81}, -{0x8389,0xe6}, -{0x838a,0x97}, -{0x838b,0x18}, -{0x838c,0xe6}, -{0x838d,0x19}, -{0x838e,0x97}, -{0x838f,0x50}, -{0x8390,0x0a}, -{0x8391,0x12}, -{0x8392,0x0c}, -{0x8393,0x82}, -{0x8394,0x78}, -{0x8395,0x80}, -{0x8396,0xa6}, -{0x8397,0x04}, -{0x8398,0x08}, -{0x8399,0xa6}, -{0x839a,0x05}, -{0x839b,0x74}, -{0x839c,0x6e}, -{0x839d,0x2f}, -{0x839e,0xf9}, -{0x839f,0x78}, -{0x83a0,0x8c}, -{0x83a1,0xe6}, -{0x83a2,0xc3}, -{0x83a3,0x97}, -{0x83a4,0x50}, -{0x83a5,0x08}, -{0x83a6,0x74}, -{0x83a7,0x6e}, -{0x83a8,0x2f}, -{0x83a9,0xf8}, -{0x83aa,0xe6}, -{0x83ab,0x78}, -{0x83ac,0x8c}, -{0x83ad,0xf6}, -{0x83ae,0xef}, -{0x83af,0x25}, -{0x83b0,0xe0}, -{0x83b1,0x24}, -{0x83b2,0x4f}, -{0x83b3,0xf9}, -{0x83b4,0xd3}, -{0x83b5,0x78}, -{0x83b6,0x83}, -{0x83b7,0xe6}, -{0x83b8,0x97}, -{0x83b9,0x18}, -{0x83ba,0xe6}, -{0x83bb,0x19}, -{0x83bc,0x97}, -{0x83bd,0x40}, -{0x83be,0x0a}, -{0x83bf,0x12}, -{0x83c0,0x0c}, -{0x83c1,0x82}, -{0x83c2,0x78}, -{0x83c3,0x82}, -{0x83c4,0xa6}, -{0x83c5,0x04}, -{0x83c6,0x08}, -{0x83c7,0xa6}, -{0x83c8,0x05}, -{0x83c9,0x74}, -{0x83ca,0x6e}, -{0x83cb,0x2f}, -{0x83cc,0xf9}, -{0x83cd,0x78}, -{0x83ce,0x8d}, -{0x83cf,0xe6}, -{0x83d0,0xd3}, -{0x83d1,0x97}, -{0x83d2,0x40}, -{0x83d3,0x08}, -{0x83d4,0x74}, -{0x83d5,0x6e}, -{0x83d6,0x2f}, -{0x83d7,0xf8}, -{0x83d8,0xe6}, -{0x83d9,0x78}, -{0x83da,0x8d}, -{0x83db,0xf6}, -{0x83dc,0x0f}, -{0x83dd,0xef}, -{0x83de,0x64}, -{0x83df,0x10}, -{0x83e0,0x70}, -{0x83e1,0x9e}, -{0x83e2,0xc3}, -{0x83e3,0x79}, -{0x83e4,0x81}, -{0x83e5,0xe7}, -{0x83e6,0x78}, -{0x83e7,0x83}, -{0x83e8,0x96}, -{0x83e9,0xff}, -{0x83ea,0x19}, -{0x83eb,0xe7}, -{0x83ec,0x18}, -{0x83ed,0x96}, -{0x83ee,0x78}, -{0x83ef,0x84}, -{0x83f0,0xf6}, -{0x83f1,0x08}, -{0x83f2,0xa6}, -{0x83f3,0x07}, -{0x83f4,0xc3}, -{0x83f5,0x79}, -{0x83f6,0x8c}, -{0x83f7,0xe7}, -{0x83f8,0x78}, -{0x83f9,0x8d}, -{0x83fa,0x96}, -{0x83fb,0x08}, -{0x83fc,0xf6}, -{0x83fd,0xd3}, -{0x83fe,0x79}, -{0x83ff,0x81}, -{0x8400,0xe7}, -{0x8401,0x78}, -{0x8402,0x7f}, -{0x8403,0x96}, -{0x8404,0x19}, -{0x8405,0xe7}, -{0x8406,0x18}, -{0x8407,0x96}, -{0x8408,0x40}, -{0x8409,0x05}, -{0x840a,0x09}, -{0x840b,0xe7}, -{0x840c,0x08}, -{0x840d,0x80}, -{0x840e,0x06}, -{0x840f,0xc3}, -{0x8410,0x79}, -{0x8411,0x7f}, -{0x8412,0xe7}, -{0x8413,0x78}, -{0x8414,0x81}, -{0x8415,0x96}, -{0x8416,0xff}, -{0x8417,0x19}, -{0x8418,0xe7}, -{0x8419,0x18}, -{0x841a,0x96}, -{0x841b,0xfe}, -{0x841c,0x78}, -{0x841d,0x86}, -{0x841e,0xa6}, -{0x841f,0x06}, -{0x8420,0x08}, -{0x8421,0xa6}, -{0x8422,0x07}, -{0x8423,0x79}, -{0x8424,0x8c}, -{0x8425,0xe7}, -{0x8426,0xd3}, -{0x8427,0x78}, -{0x8428,0x8b}, -{0x8429,0x96}, -{0x842a,0x40}, -{0x842b,0x05}, -{0x842c,0xe7}, -{0x842d,0x96}, -{0x842e,0xff}, -{0x842f,0x80}, -{0x8430,0x08}, -{0x8431,0xc3}, -{0x8432,0x79}, -{0x8433,0x8b}, -{0x8434,0xe7}, -{0x8435,0x78}, -{0x8436,0x8c}, -{0x8437,0x96}, -{0x8438,0xff}, -{0x8439,0x78}, -{0x843a,0x8f}, -{0x843b,0xa6}, -{0x843c,0x07}, -{0x843d,0xe5}, -{0x843e,0x1f}, -{0x843f,0x64}, -{0x8440,0x02}, -{0x8441,0x70}, -{0x8442,0x69}, -{0x8443,0x90}, -{0x8444,0x0e}, -{0x8445,0x91}, -{0x8446,0x93}, -{0x8447,0xff}, -{0x8448,0x18}, -{0x8449,0xe6}, -{0x844a,0xc3}, -{0x844b,0x9f}, -{0x844c,0x50}, -{0x844d,0x72}, -{0x844e,0x12}, -{0x844f,0x0c}, -{0x8450,0x4a}, -{0x8451,0x12}, -{0x8452,0x0c}, -{0x8453,0x2f}, -{0x8454,0x90}, -{0x8455,0x0e}, -{0x8456,0x8e}, -{0x8457,0x12}, -{0x8458,0x0c}, -{0x8459,0x38}, -{0x845a,0x78}, -{0x845b,0x80}, -{0x845c,0x12}, -{0x845d,0x0c}, -{0x845e,0x6b}, -{0x845f,0x7b}, -{0x8460,0x04}, -{0x8461,0x12}, -{0x8462,0x0c}, -{0x8463,0x1d}, -{0x8464,0xc3}, -{0x8465,0x12}, -{0x8466,0x06}, -{0x8467,0x45}, -{0x8468,0x50}, -{0x8469,0x56}, -{0x846a,0x90}, -{0x846b,0x0e}, -{0x846c,0x92}, -{0x846d,0xe4}, -{0x846e,0x93}, -{0x846f,0xff}, -{0x8470,0x78}, -{0x8471,0x8f}, -{0x8472,0xe6}, -{0x8473,0x9f}, -{0x8474,0x40}, -{0x8475,0x02}, -{0x8476,0x80}, -{0x8477,0x11}, -{0x8478,0x90}, -{0x8479,0x0e}, -{0x847a,0x90}, -{0x847b,0xe4}, -{0x847c,0x93}, -{0x847d,0xff}, -{0x847e,0xd3}, -{0x847f,0x78}, -{0x8480,0x89}, -{0x8481,0xe6}, -{0x8482,0x9f}, -{0x8483,0x18}, -{0x8484,0xe6}, -{0x8485,0x94}, -{0x8486,0x00}, -{0x8487,0x40}, -{0x8488,0x03}, -{0x8489,0x75}, -{0x848a,0x1f}, -{0x848b,0x05}, -{0x848c,0x12}, -{0x848d,0x0c}, -{0x848e,0x4a}, -{0x848f,0x12}, -{0x8490,0x0c}, -{0x8491,0x2f}, -{0x8492,0x90}, -{0x8493,0x0e}, -{0x8494,0x8f}, -{0x8495,0x12}, -{0x8496,0x0c}, -{0x8497,0x38}, -{0x8498,0x78}, -{0x8499,0x7e}, -{0x849a,0x12}, -{0x849b,0x0c}, -{0x849c,0x6b}, -{0x849d,0x7b}, -{0x849e,0x40}, -{0x849f,0x12}, -{0x84a0,0x0c}, -{0x84a1,0x1d}, -{0x84a2,0xd3}, -{0x84a3,0x12}, -{0x84a4,0x06}, -{0x84a5,0x45}, -{0x84a6,0x40}, -{0x84a7,0x18}, -{0x84a8,0x75}, -{0x84a9,0x1f}, -{0x84aa,0x05}, -{0x84ab,0x22}, -{0x84ac,0xe5}, -{0x84ad,0x1f}, -{0x84ae,0xb4}, -{0x84af,0x05}, -{0x84b0,0x0f}, -{0x84b1,0xd2}, -{0x84b2,0x01}, -{0x84b3,0xc2}, -{0x84b4,0x02}, -{0x84b5,0xe4}, -{0x84b6,0xf5}, -{0x84b7,0x1f}, -{0x84b8,0xf5}, -{0x84b9,0x1e}, -{0x84ba,0xd2}, -{0x84bb,0x35}, -{0x84bc,0xd2}, -{0x84bd,0x33}, -{0x84be,0xd2}, -{0x84bf,0x36}, -{0x84c0,0x22}, -{0x84c1,0xef}, -{0x84c2,0x8d}, -{0x84c3,0xf0}, -{0x84c4,0xa4}, -{0x84c5,0xa8}, -{0x84c6,0xf0}, -{0x84c7,0xcf}, -{0x84c8,0x8c}, -{0x84c9,0xf0}, -{0x84ca,0xa4}, -{0x84cb,0x28}, -{0x84cc,0xce}, -{0x84cd,0x8d}, -{0x84ce,0xf0}, -{0x84cf,0xa4}, -{0x84d0,0x2e}, -{0x84d1,0xfe}, -{0x84d2,0x22}, -{0x84d3,0xbc}, -{0x84d4,0x00}, -{0x84d5,0x0b}, -{0x84d6,0xbe}, -{0x84d7,0x00}, -{0x84d8,0x29}, -{0x84d9,0xef}, -{0x84da,0x8d}, -{0x84db,0xf0}, -{0x84dc,0x84}, -{0x84dd,0xff}, -{0x84de,0xad}, -{0x84df,0xf0}, -{0x84e0,0x22}, -{0x84e1,0xe4}, -{0x84e2,0xcc}, -{0x84e3,0xf8}, -{0x84e4,0x75}, -{0x84e5,0xf0}, -{0x84e6,0x08}, -{0x84e7,0xef}, -{0x84e8,0x2f}, -{0x84e9,0xff}, -{0x84ea,0xee}, -{0x84eb,0x33}, -{0x84ec,0xfe}, -{0x84ed,0xec}, -{0x84ee,0x33}, -{0x84ef,0xfc}, -{0x84f0,0xee}, -{0x84f1,0x9d}, -{0x84f2,0xec}, -{0x84f3,0x98}, -{0x84f4,0x40}, -{0x84f5,0x05}, -{0x84f6,0xfc}, -{0x84f7,0xee}, -{0x84f8,0x9d}, -{0x84f9,0xfe}, -{0x84fa,0x0f}, -{0x84fb,0xd5}, -{0x84fc,0xf0}, -{0x84fd,0xe9}, -{0x84fe,0xe4}, -{0x84ff,0xce}, -{0x8500,0xfd}, -{0x8501,0x22}, -{0x8502,0xed}, -{0x8503,0xf8}, -{0x8504,0xf5}, -{0x8505,0xf0}, -{0x8506,0xee}, -{0x8507,0x84}, -{0x8508,0x20}, -{0x8509,0xd2}, -{0x850a,0x1c}, -{0x850b,0xfe}, -{0x850c,0xad}, -{0x850d,0xf0}, -{0x850e,0x75}, -{0x850f,0xf0}, -{0x8510,0x08}, -{0x8511,0xef}, -{0x8512,0x2f}, -{0x8513,0xff}, -{0x8514,0xed}, -{0x8515,0x33}, -{0x8516,0xfd}, -{0x8517,0x40}, -{0x8518,0x07}, -{0x8519,0x98}, -{0x851a,0x50}, -{0x851b,0x06}, -{0x851c,0xd5}, -{0x851d,0xf0}, -{0x851e,0xf2}, -{0x851f,0x22}, -{0x8520,0xc3}, -{0x8521,0x98}, -{0x8522,0xfd}, -{0x8523,0x0f}, -{0x8524,0xd5}, -{0x8525,0xf0}, -{0x8526,0xea}, -{0x8527,0x22}, -{0x8528,0xe8}, -{0x8529,0x8f}, -{0x852a,0xf0}, -{0x852b,0xa4}, -{0x852c,0xcc}, -{0x852d,0x8b}, -{0x852e,0xf0}, -{0x852f,0xa4}, -{0x8530,0x2c}, -{0x8531,0xfc}, -{0x8532,0xe9}, -{0x8533,0x8e}, -{0x8534,0xf0}, -{0x8535,0xa4}, -{0x8536,0x2c}, -{0x8537,0xfc}, -{0x8538,0x8a}, -{0x8539,0xf0}, -{0x853a,0xed}, -{0x853b,0xa4}, -{0x853c,0x2c}, -{0x853d,0xfc}, -{0x853e,0xea}, -{0x853f,0x8e}, -{0x8540,0xf0}, -{0x8541,0xa4}, -{0x8542,0xcd}, -{0x8543,0xa8}, -{0x8544,0xf0}, -{0x8545,0x8b}, -{0x8546,0xf0}, -{0x8547,0xa4}, -{0x8548,0x2d}, -{0x8549,0xcc}, -{0x854a,0x38}, -{0x854b,0x25}, -{0x854c,0xf0}, -{0x854d,0xfd}, -{0x854e,0xe9}, -{0x854f,0x8f}, -{0x8550,0xf0}, -{0x8551,0xa4}, -{0x8552,0x2c}, -{0x8553,0xcd}, -{0x8554,0x35}, -{0x8555,0xf0}, -{0x8556,0xfc}, -{0x8557,0xeb}, -{0x8558,0x8e}, -{0x8559,0xf0}, -{0x855a,0xa4}, -{0x855b,0xfe}, -{0x855c,0xa9}, -{0x855d,0xf0}, -{0x855e,0xeb}, -{0x855f,0x8f}, -{0x8560,0xf0}, -{0x8561,0xa4}, -{0x8562,0xcf}, -{0x8563,0xc5}, -{0x8564,0xf0}, -{0x8565,0x2e}, -{0x8566,0xcd}, -{0x8567,0x39}, -{0x8568,0xfe}, -{0x8569,0xe4}, -{0x856a,0x3c}, -{0x856b,0xfc}, -{0x856c,0xea}, -{0x856d,0xa4}, -{0x856e,0x2d}, -{0x856f,0xce}, -{0x8570,0x35}, -{0x8571,0xf0}, -{0x8572,0xfd}, -{0x8573,0xe4}, -{0x8574,0x3c}, -{0x8575,0xfc}, -{0x8576,0x22}, -{0x8577,0x75}, -{0x8578,0xf0}, -{0x8579,0x08}, -{0x857a,0x75}, -{0x857b,0x82}, -{0x857c,0x00}, -{0x857d,0xef}, -{0x857e,0x2f}, -{0x857f,0xff}, -{0x8580,0xee}, -{0x8581,0x33}, -{0x8582,0xfe}, -{0x8583,0xcd}, -{0x8584,0x33}, -{0x8585,0xcd}, -{0x8586,0xcc}, -{0x8587,0x33}, -{0x8588,0xcc}, -{0x8589,0xc5}, -{0x858a,0x82}, -{0x858b,0x33}, -{0x858c,0xc5}, -{0x858d,0x82}, -{0x858e,0x9b}, -{0x858f,0xed}, -{0x8590,0x9a}, -{0x8591,0xec}, -{0x8592,0x99}, -{0x8593,0xe5}, -{0x8594,0x82}, -{0x8595,0x98}, -{0x8596,0x40}, -{0x8597,0x0c}, -{0x8598,0xf5}, -{0x8599,0x82}, -{0x859a,0xee}, -{0x859b,0x9b}, -{0x859c,0xfe}, -{0x859d,0xed}, -{0x859e,0x9a}, -{0x859f,0xfd}, -{0x85a0,0xec}, -{0x85a1,0x99}, -{0x85a2,0xfc}, -{0x85a3,0x0f}, -{0x85a4,0xd5}, -{0x85a5,0xf0}, -{0x85a6,0xd6}, -{0x85a7,0xe4}, -{0x85a8,0xce}, -{0x85a9,0xfb}, -{0x85aa,0xe4}, -{0x85ab,0xcd}, -{0x85ac,0xfa}, -{0x85ad,0xe4}, -{0x85ae,0xcc}, -{0x85af,0xf9}, -{0x85b0,0xa8}, -{0x85b1,0x82}, -{0x85b2,0x22}, -{0x85b3,0xb8}, -{0x85b4,0x00}, -{0x85b5,0xc1}, -{0x85b6,0xb9}, -{0x85b7,0x00}, -{0x85b8,0x59}, -{0x85b9,0xba}, -{0x85ba,0x00}, -{0x85bb,0x2d}, -{0x85bc,0xec}, -{0x85bd,0x8b}, -{0x85be,0xf0}, -{0x85bf,0x84}, -{0x85c0,0xcf}, -{0x85c1,0xce}, -{0x85c2,0xcd}, -{0x85c3,0xfc}, -{0x85c4,0xe5}, -{0x85c5,0xf0}, -{0x85c6,0xcb}, -{0x85c7,0xf9}, -{0x85c8,0x78}, -{0x85c9,0x18}, -{0x85ca,0xef}, -{0x85cb,0x2f}, -{0x85cc,0xff}, -{0x85cd,0xee}, -{0x85ce,0x33}, -{0x85cf,0xfe}, -{0x85d0,0xed}, -{0x85d1,0x33}, -{0x85d2,0xfd}, -{0x85d3,0xec}, -{0x85d4,0x33}, -{0x85d5,0xfc}, -{0x85d6,0xeb}, -{0x85d7,0x33}, -{0x85d8,0xfb}, -{0x85d9,0x10}, -{0x85da,0xd7}, -{0x85db,0x03}, -{0x85dc,0x99}, -{0x85dd,0x40}, -{0x85de,0x04}, -{0x85df,0xeb}, -{0x85e0,0x99}, -{0x85e1,0xfb}, -{0x85e2,0x0f}, -{0x85e3,0xd8}, -{0x85e4,0xe5}, -{0x85e5,0xe4}, -{0x85e6,0xf9}, -{0x85e7,0xfa}, -{0x85e8,0x22}, -{0x85e9,0x78}, -{0x85ea,0x18}, -{0x85eb,0xef}, -{0x85ec,0x2f}, -{0x85ed,0xff}, -{0x85ee,0xee}, -{0x85ef,0x33}, -{0x85f0,0xfe}, -{0x85f1,0xed}, -{0x85f2,0x33}, -{0x85f3,0xfd}, -{0x85f4,0xec}, -{0x85f5,0x33}, -{0x85f6,0xfc}, -{0x85f7,0xc9}, -{0x85f8,0x33}, -{0x85f9,0xc9}, -{0x85fa,0x10}, -{0x85fb,0xd7}, -{0x85fc,0x05}, -{0x85fd,0x9b}, -{0x85fe,0xe9}, -{0x85ff,0x9a}, -{0x8600,0x40}, -{0x8601,0x07}, -{0x8602,0xec}, -{0x8603,0x9b}, -{0x8604,0xfc}, -{0x8605,0xe9}, -{0x8606,0x9a}, -{0x8607,0xf9}, -{0x8608,0x0f}, -{0x8609,0xd8}, -{0x860a,0xe0}, -{0x860b,0xe4}, -{0x860c,0xc9}, -{0x860d,0xfa}, -{0x860e,0xe4}, -{0x860f,0xcc}, -{0x8610,0xfb}, -{0x8611,0x22}, -{0x8612,0x75}, -{0x8613,0xf0}, -{0x8614,0x10}, -{0x8615,0xef}, -{0x8616,0x2f}, -{0x8617,0xff}, -{0x8618,0xee}, -{0x8619,0x33}, -{0x861a,0xfe}, -{0x861b,0xed}, -{0x861c,0x33}, -{0x861d,0xfd}, -{0x861e,0xcc}, -{0x861f,0x33}, -{0x8620,0xcc}, -{0x8621,0xc8}, -{0x8622,0x33}, -{0x8623,0xc8}, -{0x8624,0x10}, -{0x8625,0xd7}, -{0x8626,0x07}, -{0x8627,0x9b}, -{0x8628,0xec}, -{0x8629,0x9a}, -{0x862a,0xe8}, -{0x862b,0x99}, -{0x862c,0x40}, -{0x862d,0x0a}, -{0x862e,0xed}, -{0x862f,0x9b}, -{0x8630,0xfd}, -{0x8631,0xec}, -{0x8632,0x9a}, -{0x8633,0xfc}, -{0x8634,0xe8}, -{0x8635,0x99}, -{0x8636,0xf8}, -{0x8637,0x0f}, -{0x8638,0xd5}, -{0x8639,0xf0}, -{0x863a,0xda}, -{0x863b,0xe4}, -{0x863c,0xcd}, -{0x863d,0xfb}, -{0x863e,0xe4}, -{0x863f,0xcc}, -{0x8640,0xfa}, -{0x8641,0xe4}, -{0x8642,0xc8}, -{0x8643,0xf9}, -{0x8644,0x22}, -{0x8645,0xeb}, -{0x8646,0x9f}, -{0x8647,0xf5}, -{0x8648,0xf0}, -{0x8649,0xea}, -{0x864a,0x9e}, -{0x864b,0x42}, -{0x864c,0xf0}, -{0x864d,0xe9}, -{0x864e,0x9d}, -{0x864f,0x42}, -{0x8650,0xf0}, -{0x8651,0xe8}, -{0x8652,0x9c}, -{0x8653,0x45}, -{0x8654,0xf0}, -{0x8655,0x22}, -{0x8656,0xe8}, -{0x8657,0x60}, -{0x8658,0x0f}, -{0x8659,0xec}, -{0x865a,0xc3}, -{0x865b,0x13}, -{0x865c,0xfc}, -{0x865d,0xed}, -{0x865e,0x13}, -{0x865f,0xfd}, -{0x8660,0xee}, -{0x8661,0x13}, -{0x8662,0xfe}, -{0x8663,0xef}, -{0x8664,0x13}, -{0x8665,0xff}, -{0x8666,0xd8}, -{0x8667,0xf1}, -{0x8668,0x22}, -{0x8669,0xe8}, -{0x866a,0x60}, -{0x866b,0x0f}, -{0x866c,0xef}, -{0x866d,0xc3}, -{0x866e,0x33}, -{0x866f,0xff}, -{0x8670,0xee}, -{0x8671,0x33}, -{0x8672,0xfe}, -{0x8673,0xed}, -{0x8674,0x33}, -{0x8675,0xfd}, -{0x8676,0xec}, -{0x8677,0x33}, -{0x8678,0xfc}, -{0x8679,0xd8}, -{0x867a,0xf1}, -{0x867b,0x22}, -{0x867c,0xe4}, -{0x867d,0x93}, -{0x867e,0xfc}, -{0x867f,0x74}, -{0x8680,0x01}, -{0x8681,0x93}, -{0x8682,0xfd}, -{0x8683,0x74}, -{0x8684,0x02}, -{0x8685,0x93}, -{0x8686,0xfe}, -{0x8687,0x74}, -{0x8688,0x03}, -{0x8689,0x93}, -{0x868a,0xff}, -{0x868b,0x22}, -{0x868c,0xe6}, -{0x868d,0xfb}, -{0x868e,0x08}, -{0x868f,0xe6}, -{0x8690,0xf9}, -{0x8691,0x08}, -{0x8692,0xe6}, -{0x8693,0xfa}, -{0x8694,0x08}, -{0x8695,0xe6}, -{0x8696,0xcb}, -{0x8697,0xf8}, -{0x8698,0x22}, -{0x8699,0xec}, -{0x869a,0xf6}, -{0x869b,0x08}, -{0x869c,0xed}, -{0x869d,0xf6}, -{0x869e,0x08}, -{0x869f,0xee}, -{0x86a0,0xf6}, -{0x86a1,0x08}, -{0x86a2,0xef}, -{0x86a3,0xf6}, -{0x86a4,0x22}, -{0x86a5,0xa4}, -{0x86a6,0x25}, -{0x86a7,0x82}, -{0x86a8,0xf5}, -{0x86a9,0x82}, -{0x86aa,0xe5}, -{0x86ab,0xf0}, -{0x86ac,0x35}, -{0x86ad,0x83}, -{0x86ae,0xf5}, -{0x86af,0x83}, -{0x86b0,0x22}, -{0x86b1,0xd0}, -{0x86b2,0x83}, -{0x86b3,0xd0}, -{0x86b4,0x82}, -{0x86b5,0xf8}, -{0x86b6,0xe4}, -{0x86b7,0x93}, -{0x86b8,0x70}, -{0x86b9,0x12}, -{0x86ba,0x74}, -{0x86bb,0x01}, -{0x86bc,0x93}, -{0x86bd,0x70}, -{0x86be,0x0d}, -{0x86bf,0xa3}, -{0x86c0,0xa3}, -{0x86c1,0x93}, -{0x86c2,0xf8}, -{0x86c3,0x74}, -{0x86c4,0x01}, -{0x86c5,0x93}, -{0x86c6,0xf5}, -{0x86c7,0x82}, -{0x86c8,0x88}, -{0x86c9,0x83}, -{0x86ca,0xe4}, -{0x86cb,0x73}, -{0x86cc,0x74}, -{0x86cd,0x02}, -{0x86ce,0x93}, -{0x86cf,0x68}, -{0x86d0,0x60}, -{0x86d1,0xef}, -{0x86d2,0xa3}, -{0x86d3,0xa3}, -{0x86d4,0xa3}, -{0x86d5,0x80}, -{0x86d6,0xdf}, -{0x86d7,0x90}, -{0x86d8,0x38}, -{0x86d9,0x04}, -{0x86da,0x78}, -{0x86db,0x52}, -{0x86dc,0x12}, -{0x86dd,0x0b}, -{0x86de,0xfd}, -{0x86df,0x90}, -{0x86e0,0x38}, -{0x86e1,0x00}, -{0x86e2,0xe0}, -{0x86e3,0xfe}, -{0x86e4,0xa3}, -{0x86e5,0xe0}, -{0x86e6,0xfd}, -{0x86e7,0xed}, -{0x86e8,0xff}, -{0x86e9,0xc3}, -{0x86ea,0x12}, -{0x86eb,0x0b}, -{0x86ec,0x9e}, -{0x86ed,0x90}, -{0x86ee,0x38}, -{0x86ef,0x10}, -{0x86f0,0x12}, -{0x86f1,0x0b}, -{0x86f2,0x92}, -{0x86f3,0x90}, -{0x86f4,0x38}, -{0x86f5,0x06}, -{0x86f6,0x78}, -{0x86f7,0x54}, -{0x86f8,0x12}, -{0x86f9,0x0b}, -{0x86fa,0xfd}, -{0x86fb,0x90}, -{0x86fc,0x38}, -{0x86fd,0x02}, -{0x86fe,0xe0}, -{0x86ff,0xfe}, -{0x8700,0xa3}, -{0x8701,0xe0}, -{0x8702,0xfd}, -{0x8703,0xed}, -{0x8704,0xff}, -{0x8705,0xc3}, -{0x8706,0x12}, -{0x8707,0x0b}, -{0x8708,0x9e}, -{0x8709,0x90}, -{0x870a,0x38}, -{0x870b,0x12}, -{0x870c,0x12}, -{0x870d,0x0b}, -{0x870e,0x92}, -{0x870f,0xa3}, -{0x8710,0xe0}, -{0x8711,0xb4}, -{0x8712,0x31}, -{0x8713,0x07}, -{0x8714,0x78}, -{0x8715,0x52}, -{0x8716,0x79}, -{0x8717,0x52}, -{0x8718,0x12}, -{0x8719,0x0c}, -{0x871a,0x13}, -{0x871b,0x90}, -{0x871c,0x38}, -{0x871d,0x14}, -{0x871e,0xe0}, -{0x871f,0xb4}, -{0x8720,0x71}, -{0x8721,0x15}, -{0x8722,0x78}, -{0x8723,0x52}, -{0x8724,0xe6}, -{0x8725,0xfe}, -{0x8726,0x08}, -{0x8727,0xe6}, -{0x8728,0x78}, -{0x8729,0x02}, -{0x872a,0xce}, -{0x872b,0xc3}, -{0x872c,0x13}, -{0x872d,0xce}, -{0x872e,0x13}, -{0x872f,0xd8}, -{0x8730,0xf9}, -{0x8731,0x79}, -{0x8732,0x53}, -{0x8733,0xf7}, -{0x8734,0xee}, -{0x8735,0x19}, -{0x8736,0xf7}, -{0x8737,0x90}, -{0x8738,0x38}, -{0x8739,0x15}, -{0x873a,0xe0}, -{0x873b,0xb4}, -{0x873c,0x31}, -{0x873d,0x07}, -{0x873e,0x78}, -{0x873f,0x54}, -{0x8740,0x79}, -{0x8741,0x54}, -{0x8742,0x12}, -{0x8743,0x0c}, -{0x8744,0x13}, -{0x8745,0x90}, -{0x8746,0x38}, -{0x8747,0x15}, -{0x8748,0xe0}, -{0x8749,0xb4}, -{0x874a,0x71}, -{0x874b,0x15}, -{0x874c,0x78}, -{0x874d,0x54}, -{0x874e,0xe6}, -{0x874f,0xfe}, -{0x8750,0x08}, -{0x8751,0xe6}, -{0x8752,0x78}, -{0x8753,0x02}, -{0x8754,0xce}, -{0x8755,0xc3}, -{0x8756,0x13}, -{0x8757,0xce}, -{0x8758,0x13}, -{0x8759,0xd8}, -{0x875a,0xf9}, -{0x875b,0x79}, -{0x875c,0x55}, -{0x875d,0xf7}, -{0x875e,0xee}, -{0x875f,0x19}, -{0x8760,0xf7}, -{0x8761,0x79}, -{0x8762,0x52}, -{0x8763,0x12}, -{0x8764,0x0b}, -{0x8765,0xd9}, -{0x8766,0x09}, -{0x8767,0x12}, -{0x8768,0x0b}, -{0x8769,0xd9}, -{0x876a,0xaf}, -{0x876b,0x47}, -{0x876c,0x12}, -{0x876d,0x0b}, -{0x876e,0xb2}, -{0x876f,0xe5}, -{0x8770,0x44}, -{0x8771,0xfb}, -{0x8772,0x7a}, -{0x8773,0x00}, -{0x8774,0xfd}, -{0x8775,0x7c}, -{0x8776,0x00}, -{0x8777,0x12}, -{0x8778,0x04}, -{0x8779,0xd3}, -{0x877a,0x78}, -{0x877b,0x5a}, -{0x877c,0xa6}, -{0x877d,0x06}, -{0x877e,0x08}, -{0x877f,0xa6}, -{0x8780,0x07}, -{0x8781,0xaf}, -{0x8782,0x45}, -{0x8783,0x12}, -{0x8784,0x0b}, -{0x8785,0xb2}, -{0x8786,0xad}, -{0x8787,0x03}, -{0x8788,0x7c}, -{0x8789,0x00}, -{0x878a,0x12}, -{0x878b,0x04}, -{0x878c,0xd3}, -{0x878d,0x78}, -{0x878e,0x56}, -{0x878f,0xa6}, -{0x8790,0x06}, -{0x8791,0x08}, -{0x8792,0xa6}, -{0x8793,0x07}, -{0x8794,0xaf}, -{0x8795,0x48}, -{0x8796,0x78}, -{0x8797,0x54}, -{0x8798,0x12}, -{0x8799,0x0b}, -{0x879a,0xb4}, -{0x879b,0xe5}, -{0x879c,0x43}, -{0x879d,0xfb}, -{0x879e,0xfd}, -{0x879f,0x7c}, -{0x87a0,0x00}, -{0x87a1,0x12}, -{0x87a2,0x04}, -{0x87a3,0xd3}, -{0x87a4,0x78}, -{0x87a5,0x5c}, -{0x87a6,0xa6}, -{0x87a7,0x06}, -{0x87a8,0x08}, -{0x87a9,0xa6}, -{0x87aa,0x07}, -{0x87ab,0xaf}, -{0x87ac,0x46}, -{0x87ad,0x7e}, -{0x87ae,0x00}, -{0x87af,0x78}, -{0x87b0,0x54}, -{0x87b1,0x12}, -{0x87b2,0x0b}, -{0x87b3,0xb6}, -{0x87b4,0xad}, -{0x87b5,0x03}, -{0x87b6,0x7c}, -{0x87b7,0x00}, -{0x87b8,0x12}, -{0x87b9,0x04}, -{0x87ba,0xd3}, -{0x87bb,0x78}, -{0x87bc,0x58}, -{0x87bd,0xa6}, -{0x87be,0x06}, -{0x87bf,0x08}, -{0x87c0,0xa6}, -{0x87c1,0x07}, -{0x87c2,0xc3}, -{0x87c3,0x78}, -{0x87c4,0x5b}, -{0x87c5,0xe6}, -{0x87c6,0x94}, -{0x87c7,0x08}, -{0x87c8,0x18}, -{0x87c9,0xe6}, -{0x87ca,0x94}, -{0x87cb,0x00}, -{0x87cc,0x50}, -{0x87cd,0x05}, -{0x87ce,0x76}, -{0x87cf,0x00}, -{0x87d0,0x08}, -{0x87d1,0x76}, -{0x87d2,0x08}, -{0x87d3,0xc3}, -{0x87d4,0x78}, -{0x87d5,0x5d}, -{0x87d6,0xe6}, -{0x87d7,0x94}, -{0x87d8,0x08}, -{0x87d9,0x18}, -{0x87da,0xe6}, -{0x87db,0x94}, -{0x87dc,0x00}, -{0x87dd,0x50}, -{0x87de,0x05}, -{0x87df,0x76}, -{0x87e0,0x00}, -{0x87e1,0x08}, -{0x87e2,0x76}, -{0x87e3,0x08}, -{0x87e4,0x78}, -{0x87e5,0x5a}, -{0x87e6,0x12}, -{0x87e7,0x0b}, -{0x87e8,0xc6}, -{0x87e9,0xff}, -{0x87ea,0xd3}, -{0x87eb,0x78}, -{0x87ec,0x57}, -{0x87ed,0xe6}, -{0x87ee,0x9f}, -{0x87ef,0x18}, -{0x87f0,0xe6}, -{0x87f1,0x9e}, -{0x87f2,0x40}, -{0x87f3,0x0e}, -{0x87f4,0x78}, -{0x87f5,0x5a}, -{0x87f6,0xe6}, -{0x87f7,0x13}, -{0x87f8,0xfe}, -{0x87f9,0x08}, -{0x87fa,0xe6}, -{0x87fb,0x78}, -{0x87fc,0x57}, -{0x87fd,0x12}, -{0x87fe,0x0c}, -{0x87ff,0x08}, -{0x8800,0x80}, -{0x8801,0x04}, -{0x8802,0x7e}, -{0x8803,0x00}, -{0x8804,0x7f}, -{0x8805,0x00}, -{0x8806,0x78}, -{0x8807,0x5e}, -{0x8808,0x12}, -{0x8809,0x0b}, -{0x880a,0xbe}, -{0x880b,0xff}, -{0x880c,0xd3}, -{0x880d,0x78}, -{0x880e,0x59}, -{0x880f,0xe6}, -{0x8810,0x9f}, -{0x8811,0x18}, -{0x8812,0xe6}, -{0x8813,0x9e}, -{0x8814,0x40}, -{0x8815,0x0e}, -{0x8816,0x78}, -{0x8817,0x5c}, -{0x8818,0xe6}, -{0x8819,0x13}, -{0x881a,0xfe}, -{0x881b,0x08}, -{0x881c,0xe6}, -{0x881d,0x78}, -{0x881e,0x59}, -{0x881f,0x12}, -{0x8820,0x0c}, -{0x8821,0x08}, -{0x8822,0x80}, -{0x8823,0x04}, -{0x8824,0x7e}, -{0x8825,0x00}, -{0x8826,0x7f}, -{0x8827,0x00}, -{0x8828,0xe4}, -{0x8829,0xfc}, -{0x882a,0xfd}, -{0x882b,0x78}, -{0x882c,0x62}, -{0x882d,0x12}, -{0x882e,0x06}, -{0x882f,0x99}, -{0x8830,0x78}, -{0x8831,0x5a}, -{0x8832,0x12}, -{0x8833,0x0b}, -{0x8834,0xc6}, -{0x8835,0x78}, -{0x8836,0x57}, -{0x8837,0x26}, -{0x8838,0xff}, -{0x8839,0xee}, -{0x883a,0x18}, -{0x883b,0x36}, -{0x883c,0xfe}, -{0x883d,0x78}, -{0x883e,0x66}, -{0x883f,0x12}, -{0x8840,0x0b}, -{0x8841,0xbe}, -{0x8842,0x78}, -{0x8843,0x59}, -{0x8844,0x26}, -{0x8845,0xff}, -{0x8846,0xee}, -{0x8847,0x18}, -{0x8848,0x36}, -{0x8849,0xfe}, -{0x884a,0xe4}, -{0x884b,0xfc}, -{0x884c,0xfd}, -{0x884d,0x78}, -{0x884e,0x6a}, -{0x884f,0x12}, -{0x8850,0x06}, -{0x8851,0x99}, -{0x8852,0x12}, -{0x8853,0x0b}, -{0x8854,0xce}, -{0x8855,0x78}, -{0x8856,0x66}, -{0x8857,0x12}, -{0x8858,0x06}, -{0x8859,0x8c}, -{0x885a,0xd3}, -{0x885b,0x12}, -{0x885c,0x06}, -{0x885d,0x45}, -{0x885e,0x40}, -{0x885f,0x08}, -{0x8860,0x12}, -{0x8861,0x0b}, -{0x8862,0xce}, -{0x8863,0x78}, -{0x8864,0x66}, -{0x8865,0x12}, -{0x8866,0x06}, -{0x8867,0x99}, -{0x8868,0x78}, -{0x8869,0x54}, -{0x886a,0x12}, -{0x886b,0x0b}, -{0x886c,0xd0}, -{0x886d,0x78}, -{0x886e,0x6a}, -{0x886f,0x12}, -{0x8870,0x06}, -{0x8871,0x8c}, -{0x8872,0xd3}, -{0x8873,0x12}, -{0x8874,0x06}, -{0x8875,0x45}, -{0x8876,0x40}, -{0x8877,0x0a}, -{0x8878,0x78}, -{0x8879,0x54}, -{0x887a,0x12}, -{0x887b,0x0b}, -{0x887c,0xd0}, -{0x887d,0x78}, -{0x887e,0x6a}, -{0x887f,0x12}, -{0x8880,0x06}, -{0x8881,0x99}, -{0x8882,0x78}, -{0x8883,0x61}, -{0x8884,0xe6}, -{0x8885,0x90}, -{0x8886,0x60}, -{0x8887,0x01}, -{0x8888,0xf0}, -{0x8889,0x78}, -{0x888a,0x65}, -{0x888b,0xe6}, -{0x888c,0xa3}, -{0x888d,0xf0}, -{0x888e,0x78}, -{0x888f,0x69}, -{0x8890,0xe6}, -{0x8891,0xa3}, -{0x8892,0xf0}, -{0x8893,0x78}, -{0x8894,0x55}, -{0x8895,0xe6}, -{0x8896,0xa3}, -{0x8897,0xf0}, -{0x8898,0x7d}, -{0x8899,0x01}, -{0x889a,0x78}, -{0x889b,0x61}, -{0x889c,0x12}, -{0x889d,0x0b}, -{0x889e,0xe9}, -{0x889f,0x24}, -{0x88a0,0x01}, -{0x88a1,0x12}, -{0x88a2,0x0b}, -{0x88a3,0xa6}, -{0x88a4,0x78}, -{0x88a5,0x65}, -{0x88a6,0x12}, -{0x88a7,0x0b}, -{0x88a8,0xe9}, -{0x88a9,0x24}, -{0x88aa,0x02}, -{0x88ab,0x12}, -{0x88ac,0x0b}, -{0x88ad,0xa6}, -{0x88ae,0x78}, -{0x88af,0x69}, -{0x88b0,0x12}, -{0x88b1,0x0b}, -{0x88b2,0xe9}, -{0x88b3,0x24}, -{0x88b4,0x03}, -{0x88b5,0x12}, -{0x88b6,0x0b}, -{0x88b7,0xa6}, -{0x88b8,0x78}, -{0x88b9,0x6d}, -{0x88ba,0x12}, -{0x88bb,0x0b}, -{0x88bc,0xe9}, -{0x88bd,0x24}, -{0x88be,0x04}, -{0x88bf,0x12}, -{0x88c0,0x0b}, -{0x88c1,0xa6}, -{0x88c2,0x0d}, -{0x88c3,0xbd}, -{0x88c4,0x05}, -{0x88c5,0xd4}, -{0x88c6,0xc2}, -{0x88c7,0x0e}, -{0x88c8,0xc2}, -{0x88c9,0x06}, -{0x88ca,0x22}, -{0x88cb,0x85}, -{0x88cc,0x08}, -{0x88cd,0x41}, -{0x88ce,0x90}, -{0x88cf,0x30}, -{0x88d0,0x24}, -{0x88d1,0xe0}, -{0x88d2,0xf5}, -{0x88d3,0x3d}, -{0x88d4,0xa3}, -{0x88d5,0xe0}, -{0x88d6,0xf5}, -{0x88d7,0x3e}, -{0x88d8,0xa3}, -{0x88d9,0xe0}, -{0x88da,0xf5}, -{0x88db,0x3f}, -{0x88dc,0xa3}, -{0x88dd,0xe0}, -{0x88de,0xf5}, -{0x88df,0x40}, -{0x88e0,0xa3}, -{0x88e1,0xe0}, -{0x88e2,0xf5}, -{0x88e3,0x3c}, -{0x88e4,0xd2}, -{0x88e5,0x34}, -{0x88e6,0xe5}, -{0x88e7,0x41}, -{0x88e8,0x12}, -{0x88e9,0x06}, -{0x88ea,0xb1}, -{0x88eb,0x09}, -{0x88ec,0x31}, -{0x88ed,0x03}, -{0x88ee,0x09}, -{0x88ef,0x35}, -{0x88f0,0x04}, -{0x88f1,0x09}, -{0x88f2,0x3b}, -{0x88f3,0x05}, -{0x88f4,0x09}, -{0x88f5,0x3e}, -{0x88f6,0x06}, -{0x88f7,0x09}, -{0x88f8,0x41}, -{0x88f9,0x07}, -{0x88fa,0x09}, -{0x88fb,0x4a}, -{0x88fc,0x08}, -{0x88fd,0x09}, -{0x88fe,0x5b}, -{0x88ff,0x12}, -{0x8900,0x09}, -{0x8901,0x73}, -{0x8902,0x18}, -{0x8903,0x09}, -{0x8904,0x89}, -{0x8905,0x19}, -{0x8906,0x09}, -{0x8907,0x5e}, -{0x8908,0x1a}, -{0x8909,0x09}, -{0x890a,0x6a}, -{0x890b,0x1b}, -{0x890c,0x09}, -{0x890d,0xad}, -{0x890e,0x80}, -{0x890f,0x09}, -{0x8910,0xb2}, -{0x8911,0x81}, -{0x8912,0x0a}, -{0x8913,0x1d}, -{0x8914,0x8f}, -{0x8915,0x0a}, -{0x8916,0x09}, -{0x8917,0x90}, -{0x8918,0x0a}, -{0x8919,0x1d}, -{0x891a,0x91}, -{0x891b,0x0a}, -{0x891c,0x1d}, -{0x891d,0x92}, -{0x891e,0x0a}, -{0x891f,0x1d}, -{0x8920,0x93}, -{0x8921,0x0a}, -{0x8922,0x1d}, -{0x8923,0x94}, -{0x8924,0x0a}, -{0x8925,0x1d}, -{0x8926,0x98}, -{0x8927,0x0a}, -{0x8928,0x17}, -{0x8929,0x9f}, -{0x892a,0x0a}, -{0x892b,0x1a}, -{0x892c,0xec}, -{0x892d,0x00}, -{0x892e,0x00}, -{0x892f,0x0a}, -{0x8930,0x38}, -{0x8931,0x12}, -{0x8932,0x0f}, -{0x8933,0x74}, -{0x8934,0x22}, -{0x8935,0x12}, -{0x8936,0x0f}, -{0x8937,0x74}, -{0x8938,0xd2}, -{0x8939,0x03}, -{0x893a,0x22}, -{0x893b,0xd2}, -{0x893c,0x03}, -{0x893d,0x22}, -{0x893e,0xc2}, -{0x893f,0x03}, -{0x8940,0x22}, -{0x8941,0xa2}, -{0x8942,0x37}, -{0x8943,0xe4}, -{0x8944,0x33}, -{0x8945,0xf5}, -{0x8946,0x3c}, -{0x8947,0x02}, -{0x8948,0x0a}, -{0x8949,0x1d}, -{0x894a,0xc2}, -{0x894b,0x01}, -{0x894c,0xc2}, -{0x894d,0x02}, -{0x894e,0xc2}, -{0x894f,0x03}, -{0x8950,0x12}, -{0x8951,0x0d}, -{0x8952,0x0d}, -{0x8953,0x75}, -{0x8954,0x1e}, -{0x8955,0x70}, -{0x8956,0xd2}, -{0x8957,0x35}, -{0x8958,0x02}, -{0x8959,0x0a}, -{0x895a,0x1d}, -{0x895b,0x02}, -{0x895c,0x0a}, -{0x895d,0x04}, -{0x895e,0x85}, -{0x895f,0x40}, -{0x8960,0x4a}, -{0x8961,0x85}, -{0x8962,0x3c}, -{0x8963,0x4b}, -{0x8964,0x12}, -{0x8965,0x0a}, -{0x8966,0xff}, -{0x8967,0x02}, -{0x8968,0x0a}, -{0x8969,0x1d}, -{0x896a,0x85}, -{0x896b,0x4a}, -{0x896c,0x40}, -{0x896d,0x85}, -{0x896e,0x4b}, -{0x896f,0x3c}, -{0x8970,0x02}, -{0x8971,0x0a}, -{0x8972,0x1d}, -{0x8973,0xe4}, -{0x8974,0xf5}, -{0x8975,0x22}, -{0x8976,0xf5}, -{0x8977,0x23}, -{0x8978,0x85}, -{0x8979,0x40}, -{0x897a,0x31}, -{0x897b,0x85}, -{0x897c,0x3f}, -{0x897d,0x30}, -{0x897e,0x85}, -{0x897f,0x3e}, -{0x8980,0x2f}, -{0x8981,0x85}, -{0x8982,0x3d}, -{0x8983,0x2e}, -{0x8984,0x12}, -{0x8985,0x0f}, -{0x8986,0x46}, -{0x8987,0x80}, -{0x8988,0x1f}, -{0x8989,0x75}, -{0x898a,0x22}, -{0x898b,0x00}, -{0x898c,0x75}, -{0x898d,0x23}, -{0x898e,0x01}, -{0x898f,0x74}, -{0x8990,0xff}, -{0x8991,0xf5}, -{0x8992,0x2d}, -{0x8993,0xf5}, -{0x8994,0x2c}, -{0x8995,0xf5}, -{0x8996,0x2b}, -{0x8997,0xf5}, -{0x8998,0x2a}, -{0x8999,0x12}, -{0x899a,0x0f}, -{0x899b,0x46}, -{0x899c,0x85}, -{0x899d,0x2d}, -{0x899e,0x40}, -{0x899f,0x85}, -{0x89a0,0x2c}, -{0x89a1,0x3f}, -{0x89a2,0x85}, -{0x89a3,0x2b}, -{0x89a4,0x3e}, -{0x89a5,0x85}, -{0x89a6,0x2a}, -{0x89a7,0x3d}, -{0x89a8,0xe4}, -{0x89a9,0xf5}, -{0x89aa,0x3c}, -{0x89ab,0x80}, -{0x89ac,0x70}, -{0x89ad,0x12}, -{0x89ae,0x0f}, -{0x89af,0x16}, -{0x89b0,0x80}, -{0x89b1,0x6b}, -{0x89b2,0x85}, -{0x89b3,0x3d}, -{0x89b4,0x45}, -{0x89b5,0x85}, -{0x89b6,0x3e}, -{0x89b7,0x46}, -{0x89b8,0xe5}, -{0x89b9,0x47}, -{0x89ba,0xc3}, -{0x89bb,0x13}, -{0x89bc,0xff}, -{0x89bd,0xe5}, -{0x89be,0x45}, -{0x89bf,0xc3}, -{0x89c0,0x9f}, -{0x89c1,0x50}, -{0x89c2,0x02}, -{0x89c3,0x8f}, -{0x89c4,0x45}, -{0x89c5,0xe5}, -{0x89c6,0x48}, -{0x89c7,0xc3}, -{0x89c8,0x13}, -{0x89c9,0xff}, -{0x89ca,0xe5}, -{0x89cb,0x46}, -{0x89cc,0xc3}, -{0x89cd,0x9f}, -{0x89ce,0x50}, -{0x89cf,0x02}, -{0x89d0,0x8f}, -{0x89d1,0x46}, -{0x89d2,0xe5}, -{0x89d3,0x47}, -{0x89d4,0xc3}, -{0x89d5,0x13}, -{0x89d6,0xff}, -{0x89d7,0xfd}, -{0x89d8,0xe5}, -{0x89d9,0x45}, -{0x89da,0x2d}, -{0x89db,0xfd}, -{0x89dc,0xe4}, -{0x89dd,0x33}, -{0x89de,0xfc}, -{0x89df,0xe5}, -{0x89e0,0x44}, -{0x89e1,0x12}, -{0x89e2,0x0f}, -{0x89e3,0x90}, -{0x89e4,0x40}, -{0x89e5,0x05}, -{0x89e6,0xe5}, -{0x89e7,0x44}, -{0x89e8,0x9f}, -{0x89e9,0xf5}, -{0x89ea,0x45}, -{0x89eb,0xe5}, -{0x89ec,0x48}, -{0x89ed,0xc3}, -{0x89ee,0x13}, -{0x89ef,0xff}, -{0x89f0,0xfd}, -{0x89f1,0xe5}, -{0x89f2,0x46}, -{0x89f3,0x2d}, -{0x89f4,0xfd}, -{0x89f5,0xe4}, -{0x89f6,0x33}, -{0x89f7,0xfc}, -{0x89f8,0xe5}, -{0x89f9,0x43}, -{0x89fa,0x12}, -{0x89fb,0x0f}, -{0x89fc,0x90}, -{0x89fd,0x40}, -{0x89fe,0x05}, -{0x89ff,0xe5}, -{0x8a00,0x43}, -{0x8a01,0x9f}, -{0x8a02,0xf5}, -{0x8a03,0x46}, -{0x8a04,0x12}, -{0x8a05,0x06}, -{0x8a06,0xd7}, -{0x8a07,0x80}, -{0x8a08,0x14}, -{0x8a09,0x85}, -{0x8a0a,0x40}, -{0x8a0b,0x48}, -{0x8a0c,0x85}, -{0x8a0d,0x3f}, -{0x8a0e,0x47}, -{0x8a0f,0x85}, -{0x8a10,0x3e}, -{0x8a11,0x46}, -{0x8a12,0x85}, -{0x8a13,0x3d}, -{0x8a14,0x45}, -{0x8a15,0x80}, -{0x8a16,0x06}, -{0x8a17,0x02}, -{0x8a18,0x06}, -{0x8a19,0xd7}, -{0x8a1a,0x12}, -{0x8a1b,0x0d}, -{0x8a1c,0x7e}, -{0x8a1d,0x90}, -{0x8a1e,0x30}, -{0x8a1f,0x24}, -{0x8a20,0xe5}, -{0x8a21,0x3d}, -{0x8a22,0xf0}, -{0x8a23,0xa3}, -{0x8a24,0xe5}, -{0x8a25,0x3e}, -{0x8a26,0xf0}, -{0x8a27,0xa3}, -{0x8a28,0xe5}, -{0x8a29,0x3f}, -{0x8a2a,0xf0}, -{0x8a2b,0xa3}, -{0x8a2c,0xe5}, -{0x8a2d,0x40}, -{0x8a2e,0xf0}, -{0x8a2f,0xa3}, -{0x8a30,0xe5}, -{0x8a31,0x3c}, -{0x8a32,0xf0}, -{0x8a33,0x90}, -{0x8a34,0x30}, -{0x8a35,0x23}, -{0x8a36,0xe4}, -{0x8a37,0xf0}, -{0x8a38,0x22}, -{0x8a39,0xc0}, -{0x8a3a,0xe0}, -{0x8a3b,0xc0}, -{0x8a3c,0x83}, -{0x8a3d,0xc0}, -{0x8a3e,0x82}, -{0x8a3f,0xc0}, -{0x8a40,0xd0}, -{0x8a41,0x90}, -{0x8a42,0x3f}, -{0x8a43,0x0c}, -{0x8a44,0xe0}, -{0x8a45,0xf5}, -{0x8a46,0x32}, -{0x8a47,0xe5}, -{0x8a48,0x32}, -{0x8a49,0x30}, -{0x8a4a,0xe3}, -{0x8a4b,0x74}, -{0x8a4c,0x30}, -{0x8a4d,0x36}, -{0x8a4e,0x66}, -{0x8a4f,0x90}, -{0x8a50,0x60}, -{0x8a51,0x19}, -{0x8a52,0xe0}, -{0x8a53,0xf5}, -{0x8a54,0x0a}, -{0x8a55,0xa3}, -{0x8a56,0xe0}, -{0x8a57,0xf5}, -{0x8a58,0x0b}, -{0x8a59,0x90}, -{0x8a5a,0x60}, -{0x8a5b,0x1d}, -{0x8a5c,0xe0}, -{0x8a5d,0xf5}, -{0x8a5e,0x14}, -{0x8a5f,0xa3}, -{0x8a60,0xe0}, -{0x8a61,0xf5}, -{0x8a62,0x15}, -{0x8a63,0x90}, -{0x8a64,0x60}, -{0x8a65,0x21}, -{0x8a66,0xe0}, -{0x8a67,0xf5}, -{0x8a68,0x0c}, -{0x8a69,0xa3}, -{0x8a6a,0xe0}, -{0x8a6b,0xf5}, -{0x8a6c,0x0d}, -{0x8a6d,0x90}, -{0x8a6e,0x60}, -{0x8a6f,0x29}, -{0x8a70,0xe0}, -{0x8a71,0xf5}, -{0x8a72,0x0e}, -{0x8a73,0xa3}, -{0x8a74,0xe0}, -{0x8a75,0xf5}, -{0x8a76,0x0f}, -{0x8a77,0x90}, -{0x8a78,0x60}, -{0x8a79,0x31}, -{0x8a7a,0xe0}, -{0x8a7b,0xf5}, -{0x8a7c,0x10}, -{0x8a7d,0xa3}, -{0x8a7e,0xe0}, -{0x8a7f,0xf5}, -{0x8a80,0x11}, -{0x8a81,0x90}, -{0x8a82,0x60}, -{0x8a83,0x39}, -{0x8a84,0xe0}, -{0x8a85,0xf5}, -{0x8a86,0x12}, -{0x8a87,0xa3}, -{0x8a88,0xe0}, -{0x8a89,0xf5}, -{0x8a8a,0x13}, -{0x8a8b,0x30}, -{0x8a8c,0x01}, -{0x8a8d,0x06}, -{0x8a8e,0x30}, -{0x8a8f,0x33}, -{0x8a90,0x03}, -{0x8a91,0xd3}, -{0x8a92,0x80}, -{0x8a93,0x01}, -{0x8a94,0xc3}, -{0x8a95,0x92}, -{0x8a96,0x09}, -{0x8a97,0x30}, -{0x8a98,0x02}, -{0x8a99,0x06}, -{0x8a9a,0x30}, -{0x8a9b,0x33}, -{0x8a9c,0x03}, -{0x8a9d,0xd3}, -{0x8a9e,0x80}, -{0x8a9f,0x01}, -{0x8aa0,0xc3}, -{0x8aa1,0x92}, -{0x8aa2,0x0a}, -{0x8aa3,0x30}, -{0x8aa4,0x33}, -{0x8aa5,0x0c}, -{0x8aa6,0x30}, -{0x8aa7,0x03}, -{0x8aa8,0x09}, -{0x8aa9,0x20}, -{0x8aaa,0x02}, -{0x8aab,0x06}, -{0x8aac,0x20}, -{0x8aad,0x01}, -{0x8aae,0x03}, -{0x8aaf,0xd3}, -{0x8ab0,0x80}, -{0x8ab1,0x01}, -{0x8ab2,0xc3}, -{0x8ab3,0x92}, -{0x8ab4,0x0b}, -{0x8ab5,0x90}, -{0x8ab6,0x30}, -{0x8ab7,0x01}, -{0x8ab8,0xe0}, -{0x8ab9,0x44}, -{0x8aba,0x40}, -{0x8abb,0xf0}, -{0x8abc,0xe0}, -{0x8abd,0x54}, -{0x8abe,0xbf}, -{0x8abf,0xf0}, -{0x8ac0,0xe5}, -{0x8ac1,0x32}, -{0x8ac2,0x30}, -{0x8ac3,0xe1}, -{0x8ac4,0x14}, -{0x8ac5,0x30}, -{0x8ac6,0x34}, -{0x8ac7,0x11}, -{0x8ac8,0x90}, -{0x8ac9,0x30}, -{0x8aca,0x22}, -{0x8acb,0xe0}, -{0x8acc,0xf5}, -{0x8acd,0x08}, -{0x8ace,0xe4}, -{0x8acf,0xf0}, -{0x8ad0,0x30}, -{0x8ad1,0x00}, -{0x8ad2,0x03}, -{0x8ad3,0xd3}, -{0x8ad4,0x80}, -{0x8ad5,0x01}, -{0x8ad6,0xc3}, -{0x8ad7,0x92}, -{0x8ad8,0x08}, -{0x8ad9,0xe5}, -{0x8ada,0x32}, -{0x8adb,0x30}, -{0x8adc,0xe5}, -{0x8add,0x12}, -{0x8ade,0x90}, -{0x8adf,0x56}, -{0x8ae0,0xa1}, -{0x8ae1,0xe0}, -{0x8ae2,0xf5}, -{0x8ae3,0x09}, -{0x8ae4,0x30}, -{0x8ae5,0x31}, -{0x8ae6,0x09}, -{0x8ae7,0x30}, -{0x8ae8,0x05}, -{0x8ae9,0x03}, -{0x8aea,0xd3}, -{0x8aeb,0x80}, -{0x8aec,0x01}, -{0x8aed,0xc3}, -{0x8aee,0x92}, -{0x8aef,0x0d}, -{0x8af0,0x90}, -{0x8af1,0x3f}, -{0x8af2,0x0c}, -{0x8af3,0xe5}, -{0x8af4,0x32}, -{0x8af5,0xf0}, -{0x8af6,0xd0}, -{0x8af7,0xd0}, -{0x8af8,0xd0}, -{0x8af9,0x82}, -{0x8afa,0xd0}, -{0x8afb,0x83}, -{0x8afc,0xd0}, -{0x8afd,0xe0}, -{0x8afe,0x32}, -{0x8aff,0x90}, -{0x8b00,0x0e}, -{0x8b01,0x7e}, -{0x8b02,0xe4}, -{0x8b03,0x93}, -{0x8b04,0xfe}, -{0x8b05,0x74}, -{0x8b06,0x01}, -{0x8b07,0x93}, -{0x8b08,0xff}, -{0x8b09,0xc3}, -{0x8b0a,0x90}, -{0x8b0b,0x0e}, -{0x8b0c,0x7c}, -{0x8b0d,0x74}, -{0x8b0e,0x01}, -{0x8b0f,0x93}, -{0x8b10,0x9f}, -{0x8b11,0xff}, -{0x8b12,0xe4}, -{0x8b13,0x93}, -{0x8b14,0x9e}, -{0x8b15,0xfe}, -{0x8b16,0xe4}, -{0x8b17,0x8f}, -{0x8b18,0x3b}, -{0x8b19,0x8e}, -{0x8b1a,0x3a}, -{0x8b1b,0xf5}, -{0x8b1c,0x39}, -{0x8b1d,0xf5}, -{0x8b1e,0x38}, -{0x8b1f,0xab}, -{0x8b20,0x3b}, -{0x8b21,0xaa}, -{0x8b22,0x3a}, -{0x8b23,0xa9}, -{0x8b24,0x39}, -{0x8b25,0xa8}, -{0x8b26,0x38}, -{0x8b27,0xaf}, -{0x8b28,0x4b}, -{0x8b29,0xfc}, -{0x8b2a,0xfd}, -{0x8b2b,0xfe}, -{0x8b2c,0x12}, -{0x8b2d,0x05}, -{0x8b2e,0x28}, -{0x8b2f,0x12}, -{0x8b30,0x0d}, -{0x8b31,0xe1}, -{0x8b32,0xe4}, -{0x8b33,0x7b}, -{0x8b34,0xff}, -{0x8b35,0xfa}, -{0x8b36,0xf9}, -{0x8b37,0xf8}, -{0x8b38,0x12}, -{0x8b39,0x05}, -{0x8b3a,0xb3}, -{0x8b3b,0x12}, -{0x8b3c,0x0d}, -{0x8b3d,0xe1}, -{0x8b3e,0x90}, -{0x8b3f,0x0e}, -{0x8b40,0x69}, -{0x8b41,0xe4}, -{0x8b42,0x12}, -{0x8b43,0x0d}, -{0x8b44,0xf6}, -{0x8b45,0x12}, -{0x8b46,0x0d}, -{0x8b47,0xe1}, -{0x8b48,0xe4}, -{0x8b49,0x85}, -{0x8b4a,0x4a}, -{0x8b4b,0x37}, -{0x8b4c,0xf5}, -{0x8b4d,0x36}, -{0x8b4e,0xf5}, -{0x8b4f,0x35}, -{0x8b50,0xf5}, -{0x8b51,0x34}, -{0x8b52,0xaf}, -{0x8b53,0x37}, -{0x8b54,0xae}, -{0x8b55,0x36}, -{0x8b56,0xad}, -{0x8b57,0x35}, -{0x8b58,0xac}, -{0x8b59,0x34}, -{0x8b5a,0xa3}, -{0x8b5b,0x12}, -{0x8b5c,0x0d}, -{0x8b5d,0xf6}, -{0x8b5e,0x8f}, -{0x8b5f,0x37}, -{0x8b60,0x8e}, -{0x8b61,0x36}, -{0x8b62,0x8d}, -{0x8b63,0x35}, -{0x8b64,0x8c}, -{0x8b65,0x34}, -{0x8b66,0xe5}, -{0x8b67,0x3b}, -{0x8b68,0x45}, -{0x8b69,0x37}, -{0x8b6a,0xf5}, -{0x8b6b,0x3b}, -{0x8b6c,0xe5}, -{0x8b6d,0x3a}, -{0x8b6e,0x45}, -{0x8b6f,0x36}, -{0x8b70,0xf5}, -{0x8b71,0x3a}, -{0x8b72,0xe5}, -{0x8b73,0x39}, -{0x8b74,0x45}, -{0x8b75,0x35}, -{0x8b76,0xf5}, -{0x8b77,0x39}, -{0x8b78,0xe5}, -{0x8b79,0x38}, -{0x8b7a,0x45}, -{0x8b7b,0x34}, -{0x8b7c,0xf5}, -{0x8b7d,0x38}, -{0x8b7e,0xe4}, -{0x8b7f,0xf5}, -{0x8b80,0x22}, -{0x8b81,0xf5}, -{0x8b82,0x23}, -{0x8b83,0x85}, -{0x8b84,0x3b}, -{0x8b85,0x31}, -{0x8b86,0x85}, -{0x8b87,0x3a}, -{0x8b88,0x30}, -{0x8b89,0x85}, -{0x8b8a,0x39}, -{0x8b8b,0x2f}, -{0x8b8c,0x85}, -{0x8b8d,0x38}, -{0x8b8e,0x2e}, -{0x8b8f,0x02}, -{0x8b90,0x0f}, -{0x8b91,0x46}, -{0x8b92,0xe0}, -{0x8b93,0xa3}, -{0x8b94,0xe0}, -{0x8b95,0x75}, -{0x8b96,0xf0}, -{0x8b97,0x02}, -{0x8b98,0xa4}, -{0x8b99,0xff}, -{0x8b9a,0xae}, -{0x8b9b,0xf0}, -{0x8b9c,0xc3}, -{0x8b9d,0x08}, -{0x8b9e,0xe6}, -{0x8b9f,0x9f}, -{0x8ba0,0xf6}, -{0x8ba1,0x18}, -{0x8ba2,0xe6}, -{0x8ba3,0x9e}, -{0x8ba4,0xf6}, -{0x8ba5,0x22}, -{0x8ba6,0xff}, -{0x8ba7,0xe5}, -{0x8ba8,0xf0}, -{0x8ba9,0x34}, -{0x8baa,0x60}, -{0x8bab,0x8f}, -{0x8bac,0x82}, -{0x8bad,0xf5}, -{0x8bae,0x83}, -{0x8baf,0xec}, -{0x8bb0,0xf0}, -{0x8bb1,0x22}, -{0x8bb2,0x78}, -{0x8bb3,0x52}, -{0x8bb4,0x7e}, -{0x8bb5,0x00}, -{0x8bb6,0xe6}, -{0x8bb7,0xfc}, -{0x8bb8,0x08}, -{0x8bb9,0xe6}, -{0x8bba,0xfd}, -{0x8bbb,0x02}, -{0x8bbc,0x04}, -{0x8bbd,0xc1}, -{0x8bbe,0xe4}, -{0x8bbf,0xfc}, -{0x8bc0,0xfd}, -{0x8bc1,0x12}, -{0x8bc2,0x06}, -{0x8bc3,0x99}, -{0x8bc4,0x78}, -{0x8bc5,0x5c}, -{0x8bc6,0xe6}, -{0x8bc7,0xc3}, -{0x8bc8,0x13}, -{0x8bc9,0xfe}, -{0x8bca,0x08}, -{0x8bcb,0xe6}, -{0x8bcc,0x13}, -{0x8bcd,0x22}, -{0x8bce,0x78}, -{0x8bcf,0x52}, -{0x8bd0,0xe6}, -{0x8bd1,0xfe}, -{0x8bd2,0x08}, -{0x8bd3,0xe6}, -{0x8bd4,0xff}, -{0x8bd5,0xe4}, -{0x8bd6,0xfc}, -{0x8bd7,0xfd}, -{0x8bd8,0x22}, -{0x8bd9,0xe7}, -{0x8bda,0xc4}, -{0x8bdb,0xf8}, -{0x8bdc,0x54}, -{0x8bdd,0xf0}, -{0x8bde,0xc8}, -{0x8bdf,0x68}, -{0x8be0,0xf7}, -{0x8be1,0x09}, -{0x8be2,0xe7}, -{0x8be3,0xc4}, -{0x8be4,0x54}, -{0x8be5,0x0f}, -{0x8be6,0x48}, -{0x8be7,0xf7}, -{0x8be8,0x22}, -{0x8be9,0xe6}, -{0x8bea,0xfc}, -{0x8beb,0xed}, -{0x8bec,0x75}, -{0x8bed,0xf0}, -{0x8bee,0x04}, -{0x8bef,0xa4}, -{0x8bf0,0x22}, -{0x8bf1,0x12}, -{0x8bf2,0x06}, -{0x8bf3,0x7c}, -{0x8bf4,0x8f}, -{0x8bf5,0x48}, -{0x8bf6,0x8e}, -{0x8bf7,0x47}, -{0x8bf8,0x8d}, -{0x8bf9,0x46}, -{0x8bfa,0x8c}, -{0x8bfb,0x45}, -{0x8bfc,0x22}, -{0x8bfd,0xe0}, -{0x8bfe,0xfe}, -{0x8bff,0xa3}, -{0x8c00,0xe0}, -{0x8c01,0xfd}, -{0x8c02,0xee}, -{0x8c03,0xf6}, -{0x8c04,0xed}, -{0x8c05,0x08}, -{0x8c06,0xf6}, -{0x8c07,0x22}, -{0x8c08,0x13}, -{0x8c09,0xff}, -{0x8c0a,0xc3}, -{0x8c0b,0xe6}, -{0x8c0c,0x9f}, -{0x8c0d,0xff}, -{0x8c0e,0x18}, -{0x8c0f,0xe6}, -{0x8c10,0x9e}, -{0x8c11,0xfe}, -{0x8c12,0x22}, -{0x8c13,0xe6}, -{0x8c14,0xc3}, -{0x8c15,0x13}, -{0x8c16,0xf7}, -{0x8c17,0x08}, -{0x8c18,0xe6}, -{0x8c19,0x13}, -{0x8c1a,0x09}, -{0x8c1b,0xf7}, -{0x8c1c,0x22}, -{0x8c1d,0xad}, -{0x8c1e,0x39}, -{0x8c1f,0xac}, -{0x8c20,0x38}, -{0x8c21,0xfa}, -{0x8c22,0xf9}, -{0x8c23,0xf8}, -{0x8c24,0x12}, -{0x8c25,0x05}, -{0x8c26,0x28}, -{0x8c27,0x8f}, -{0x8c28,0x3b}, -{0x8c29,0x8e}, -{0x8c2a,0x3a}, -{0x8c2b,0x8d}, -{0x8c2c,0x39}, -{0x8c2d,0x8c}, -{0x8c2e,0x38}, -{0x8c2f,0xab}, -{0x8c30,0x37}, -{0x8c31,0xaa}, -{0x8c32,0x36}, -{0x8c33,0xa9}, -{0x8c34,0x35}, -{0x8c35,0xa8}, -{0x8c36,0x34}, -{0x8c37,0x22}, -{0x8c38,0x93}, -{0x8c39,0xff}, -{0x8c3a,0xe4}, -{0x8c3b,0xfc}, -{0x8c3c,0xfd}, -{0x8c3d,0xfe}, -{0x8c3e,0x12}, -{0x8c3f,0x05}, -{0x8c40,0x28}, -{0x8c41,0x8f}, -{0x8c42,0x37}, -{0x8c43,0x8e}, -{0x8c44,0x36}, -{0x8c45,0x8d}, -{0x8c46,0x35}, -{0x8c47,0x8c}, -{0x8c48,0x34}, -{0x8c49,0x22}, -{0x8c4a,0x78}, -{0x8c4b,0x84}, -{0x8c4c,0xe6}, -{0x8c4d,0xfe}, -{0x8c4e,0x08}, -{0x8c4f,0xe6}, -{0x8c50,0xff}, -{0x8c51,0xe4}, -{0x8c52,0x8f}, -{0x8c53,0x37}, -{0x8c54,0x8e}, -{0x8c55,0x36}, -{0x8c56,0xf5}, -{0x8c57,0x35}, -{0x8c58,0xf5}, -{0x8c59,0x34}, -{0x8c5a,0x22}, -{0x8c5b,0x90}, -{0x8c5c,0x0e}, -{0x8c5d,0x8c}, -{0x8c5e,0xe4}, -{0x8c5f,0x93}, -{0x8c60,0x25}, -{0x8c61,0xe0}, -{0x8c62,0x24}, -{0x8c63,0x0a}, -{0x8c64,0xf8}, -{0x8c65,0xe6}, -{0x8c66,0xfe}, -{0x8c67,0x08}, -{0x8c68,0xe6}, -{0x8c69,0xff}, -{0x8c6a,0x22}, -{0x8c6b,0xe6}, -{0x8c6c,0xfe}, -{0x8c6d,0x08}, -{0x8c6e,0xe6}, -{0x8c6f,0xff}, -{0x8c70,0xe4}, -{0x8c71,0x8f}, -{0x8c72,0x3b}, -{0x8c73,0x8e}, -{0x8c74,0x3a}, -{0x8c75,0xf5}, -{0x8c76,0x39}, -{0x8c77,0xf5}, -{0x8c78,0x38}, -{0x8c79,0x22}, -{0x8c7a,0x78}, -{0x8c7b,0x4e}, -{0x8c7c,0xe6}, -{0x8c7d,0xfe}, -{0x8c7e,0x08}, -{0x8c7f,0xe6}, -{0x8c80,0xff}, -{0x8c81,0x22}, -{0x8c82,0xef}, -{0x8c83,0x25}, -{0x8c84,0xe0}, -{0x8c85,0x24}, -{0x8c86,0x4e}, -{0x8c87,0xf8}, -{0x8c88,0xe6}, -{0x8c89,0xfc}, -{0x8c8a,0x08}, -{0x8c8b,0xe6}, -{0x8c8c,0xfd}, -{0x8c8d,0x22}, -{0x8c8e,0x78}, -{0x8c8f,0x89}, -{0x8c90,0xef}, -{0x8c91,0x26}, -{0x8c92,0xf6}, -{0x8c93,0x18}, -{0x8c94,0xe4}, -{0x8c95,0x36}, -{0x8c96,0xf6}, -{0x8c97,0x22}, -{0x8c98,0x75}, -{0x8c99,0x89}, -{0x8c9a,0x03}, -{0x8c9b,0x75}, -{0x8c9c,0xa8}, -{0x8c9d,0x01}, -{0x8c9e,0x75}, -{0x8c9f,0xb8}, -{0x8ca0,0x04}, -{0x8ca1,0x75}, -{0x8ca2,0x34}, -{0x8ca3,0xff}, -{0x8ca4,0x75}, -{0x8ca5,0x35}, -{0x8ca6,0x0e}, -{0x8ca7,0x75}, -{0x8ca8,0x36}, -{0x8ca9,0x15}, -{0x8caa,0x75}, -{0x8cab,0x37}, -{0x8cac,0x0d}, -{0x8cad,0x12}, -{0x8cae,0x0e}, -{0x8caf,0x9a}, -{0x8cb0,0x12}, -{0x8cb1,0x00}, -{0x8cb2,0x09}, -{0x8cb3,0x12}, -{0x8cb4,0x0f}, -{0x8cb5,0x16}, -{0x8cb6,0x12}, -{0x8cb7,0x00}, -{0x8cb8,0x06}, -{0x8cb9,0xd2}, -{0x8cba,0x00}, -{0x8cbb,0xd2}, -{0x8cbc,0x34}, -{0x8cbd,0xd2}, -{0x8cbe,0xaf}, -{0x8cbf,0x75}, -{0x8cc0,0x34}, -{0x8cc1,0xff}, -{0x8cc2,0x75}, -{0x8cc3,0x35}, -{0x8cc4,0x0e}, -{0x8cc5,0x75}, -{0x8cc6,0x36}, -{0x8cc7,0x49}, -{0x8cc8,0x75}, -{0x8cc9,0x37}, -{0x8cca,0x03}, -{0x8ccb,0x12}, -{0x8ccc,0x0e}, -{0x8ccd,0x9a}, -{0x8cce,0x30}, -{0x8ccf,0x08}, -{0x8cd0,0x09}, -{0x8cd1,0xc2}, -{0x8cd2,0x34}, -{0x8cd3,0x12}, -{0x8cd4,0x08}, -{0x8cd5,0xcb}, -{0x8cd6,0xc2}, -{0x8cd7,0x08}, -{0x8cd8,0xd2}, -{0x8cd9,0x34}, -{0x8cda,0x30}, -{0x8cdb,0x0b}, -{0x8cdc,0x09}, -{0x8cdd,0xc2}, -{0x8cde,0x36}, -{0x8cdf,0x12}, -{0x8ce0,0x02}, -{0x8ce1,0x6c}, -{0x8ce2,0xc2}, -{0x8ce3,0x0b}, -{0x8ce4,0xd2}, -{0x8ce5,0x36}, -{0x8ce6,0x30}, -{0x8ce7,0x09}, -{0x8ce8,0x09}, -{0x8ce9,0xc2}, -{0x8cea,0x36}, -{0x8ceb,0x12}, -{0x8cec,0x00}, -{0x8ced,0x0e}, -{0x8cee,0xc2}, -{0x8cef,0x09}, -{0x8cf0,0xd2}, -{0x8cf1,0x36}, -{0x8cf2,0x30}, -{0x8cf3,0x0e}, -{0x8cf4,0x03}, -{0x8cf5,0x12}, -{0x8cf6,0x06}, -{0x8cf7,0xd7}, -{0x8cf8,0x30}, -{0x8cf9,0x35}, -{0x8cfa,0xd3}, -{0x8cfb,0x90}, -{0x8cfc,0x30}, -{0x8cfd,0x29}, -{0x8cfe,0xe5}, -{0x8cff,0x1e}, -{0x8d00,0xf0}, -{0x8d01,0xb4}, -{0x8d02,0x10}, -{0x8d03,0x05}, -{0x8d04,0x90}, -{0x8d05,0x30}, -{0x8d06,0x23}, -{0x8d07,0xe4}, -{0x8d08,0xf0}, -{0x8d09,0xc2}, -{0x8d0a,0x35}, -{0x8d0b,0x80}, -{0x8d0c,0xc1}, -{0x8d0d,0xe4}, -{0x8d0e,0xf5}, -{0x8d0f,0x4b}, -{0x8d10,0x90}, -{0x8d11,0x0e}, -{0x8d12,0x7a}, -{0x8d13,0x93}, -{0x8d14,0xff}, -{0x8d15,0xe4}, -{0x8d16,0x8f}, -{0x8d17,0x37}, -{0x8d18,0xf5}, -{0x8d19,0x36}, -{0x8d1a,0xf5}, -{0x8d1b,0x35}, -{0x8d1c,0xf5}, -{0x8d1d,0x34}, -{0x8d1e,0xaf}, -{0x8d1f,0x37}, -{0x8d20,0xae}, -{0x8d21,0x36}, -{0x8d22,0xad}, -{0x8d23,0x35}, -{0x8d24,0xac}, -{0x8d25,0x34}, -{0x8d26,0x90}, -{0x8d27,0x0e}, -{0x8d28,0x6a}, -{0x8d29,0x12}, -{0x8d2a,0x0d}, -{0x8d2b,0xf6}, -{0x8d2c,0x8f}, -{0x8d2d,0x37}, -{0x8d2e,0x8e}, -{0x8d2f,0x36}, -{0x8d30,0x8d}, -{0x8d31,0x35}, -{0x8d32,0x8c}, -{0x8d33,0x34}, -{0x8d34,0x90}, -{0x8d35,0x0e}, -{0x8d36,0x72}, -{0x8d37,0x12}, -{0x8d38,0x06}, -{0x8d39,0x7c}, -{0x8d3a,0xef}, -{0x8d3b,0x45}, -{0x8d3c,0x37}, -{0x8d3d,0xf5}, -{0x8d3e,0x37}, -{0x8d3f,0xee}, -{0x8d40,0x45}, -{0x8d41,0x36}, -{0x8d42,0xf5}, -{0x8d43,0x36}, -{0x8d44,0xed}, -{0x8d45,0x45}, -{0x8d46,0x35}, -{0x8d47,0xf5}, -{0x8d48,0x35}, -{0x8d49,0xec}, -{0x8d4a,0x45}, -{0x8d4b,0x34}, -{0x8d4c,0xf5}, -{0x8d4d,0x34}, -{0x8d4e,0xe4}, -{0x8d4f,0xf5}, -{0x8d50,0x22}, -{0x8d51,0xf5}, -{0x8d52,0x23}, -{0x8d53,0x85}, -{0x8d54,0x37}, -{0x8d55,0x31}, -{0x8d56,0x85}, -{0x8d57,0x36}, -{0x8d58,0x30}, -{0x8d59,0x85}, -{0x8d5a,0x35}, -{0x8d5b,0x2f}, -{0x8d5c,0x85}, -{0x8d5d,0x34}, -{0x8d5e,0x2e}, -{0x8d5f,0x12}, -{0x8d60,0x0f}, -{0x8d61,0x46}, -{0x8d62,0xe4}, -{0x8d63,0xf5}, -{0x8d64,0x22}, -{0x8d65,0xf5}, -{0x8d66,0x23}, -{0x8d67,0x90}, -{0x8d68,0x0e}, -{0x8d69,0x72}, -{0x8d6a,0x12}, -{0x8d6b,0x0d}, -{0x8d6c,0xea}, -{0x8d6d,0x12}, -{0x8d6e,0x0f}, -{0x8d6f,0x46}, -{0x8d70,0xe4}, -{0x8d71,0xf5}, -{0x8d72,0x22}, -{0x8d73,0xf5}, -{0x8d74,0x23}, -{0x8d75,0x90}, -{0x8d76,0x0e}, -{0x8d77,0x6e}, -{0x8d78,0x12}, -{0x8d79,0x0d}, -{0x8d7a,0xea}, -{0x8d7b,0x02}, -{0x8d7c,0x0f}, -{0x8d7d,0x46}, -{0x8d7e,0xe5}, -{0x8d7f,0x40}, -{0x8d80,0x24}, -{0x8d81,0xf2}, -{0x8d82,0xf5}, -{0x8d83,0x37}, -{0x8d84,0xe5}, -{0x8d85,0x3f}, -{0x8d86,0x34}, -{0x8d87,0x43}, -{0x8d88,0xf5}, -{0x8d89,0x36}, -{0x8d8a,0xe5}, -{0x8d8b,0x3e}, -{0x8d8c,0x34}, -{0x8d8d,0xa2}, -{0x8d8e,0xf5}, -{0x8d8f,0x35}, -{0x8d90,0xe5}, -{0x8d91,0x3d}, -{0x8d92,0x34}, -{0x8d93,0x28}, -{0x8d94,0xf5}, -{0x8d95,0x34}, -{0x8d96,0xe5}, -{0x8d97,0x37}, -{0x8d98,0xff}, -{0x8d99,0xe4}, -{0x8d9a,0xfe}, -{0x8d9b,0xfd}, -{0x8d9c,0xfc}, -{0x8d9d,0x78}, -{0x8d9e,0x18}, -{0x8d9f,0x12}, -{0x8da0,0x06}, -{0x8da1,0x69}, -{0x8da2,0x8f}, -{0x8da3,0x40}, -{0x8da4,0x8e}, -{0x8da5,0x3f}, -{0x8da6,0x8d}, -{0x8da7,0x3e}, -{0x8da8,0x8c}, -{0x8da9,0x3d}, -{0x8daa,0xe5}, -{0x8dab,0x37}, -{0x8dac,0x54}, -{0x8dad,0xa0}, -{0x8dae,0xff}, -{0x8daf,0xe5}, -{0x8db0,0x36}, -{0x8db1,0xfe}, -{0x8db2,0xe4}, -{0x8db3,0xfd}, -{0x8db4,0xfc}, -{0x8db5,0x78}, -{0x8db6,0x07}, -{0x8db7,0x12}, -{0x8db8,0x06}, -{0x8db9,0x56}, -{0x8dba,0x78}, -{0x8dbb,0x10}, -{0x8dbc,0x12}, -{0x8dbd,0x0f}, -{0x8dbe,0x9a}, -{0x8dbf,0xe4}, -{0x8dc0,0xff}, -{0x8dc1,0xfe}, -{0x8dc2,0xe5}, -{0x8dc3,0x35}, -{0x8dc4,0xfd}, -{0x8dc5,0xe4}, -{0x8dc6,0xfc}, -{0x8dc7,0x78}, -{0x8dc8,0x0e}, -{0x8dc9,0x12}, -{0x8dca,0x06}, -{0x8dcb,0x56}, -{0x8dcc,0x12}, -{0x8dcd,0x0f}, -{0x8dce,0x9d}, -{0x8dcf,0xe4}, -{0x8dd0,0xff}, -{0x8dd1,0xfe}, -{0x8dd2,0xfd}, -{0x8dd3,0xe5}, -{0x8dd4,0x34}, -{0x8dd5,0xfc}, -{0x8dd6,0x78}, -{0x8dd7,0x18}, -{0x8dd8,0x12}, -{0x8dd9,0x06}, -{0x8dda,0x56}, -{0x8ddb,0x78}, -{0x8ddc,0x08}, -{0x8ddd,0x12}, -{0x8dde,0x0f}, -{0x8ddf,0x9a}, -{0x8de0,0x22}, -{0x8de1,0x8f}, -{0x8de2,0x3b}, -{0x8de3,0x8e}, -{0x8de4,0x3a}, -{0x8de5,0x8d}, -{0x8de6,0x39}, -{0x8de7,0x8c}, -{0x8de8,0x38}, -{0x8de9,0x22}, -{0x8dea,0x12}, -{0x8deb,0x06}, -{0x8dec,0x7c}, -{0x8ded,0x8f}, -{0x8dee,0x31}, -{0x8def,0x8e}, -{0x8df0,0x30}, -{0x8df1,0x8d}, -{0x8df2,0x2f}, -{0x8df3,0x8c}, -{0x8df4,0x2e}, -{0x8df5,0x22}, -{0x8df6,0x93}, -{0x8df7,0xf9}, -{0x8df8,0xf8}, -{0x8df9,0x02}, -{0x8dfa,0x06}, -{0x8dfb,0x69}, -{0x8dfc,0x00}, -{0x8dfd,0x00}, -{0x8dfe,0x00}, -{0x8dff,0x00}, -{0x8e00,0x12}, -{0x8e01,0x01}, -{0x8e02,0x17}, -{0x8e03,0x08}, -{0x8e04,0x31}, -{0x8e05,0x15}, -{0x8e06,0x53}, -{0x8e07,0x54}, -{0x8e08,0x44}, -{0x8e09,0x20}, -{0x8e0a,0x20}, -{0x8e0b,0x20}, -{0x8e0c,0x20}, -{0x8e0d,0x20}, -{0x8e0e,0x13}, -{0x8e0f,0x01}, -{0x8e10,0x10}, -{0x8e11,0x01}, -{0x8e12,0x56}, -{0x8e13,0x40}, -{0x8e14,0x1a}, -{0x8e15,0x30}, -{0x8e16,0x29}, -{0x8e17,0x7e}, -{0x8e18,0x00}, -{0x8e19,0x30}, -{0x8e1a,0x04}, -{0x8e1b,0x20}, -{0x8e1c,0xdf}, -{0x8e1d,0x30}, -{0x8e1e,0x05}, -{0x8e1f,0x40}, -{0x8e20,0xbf}, -{0x8e21,0x50}, -{0x8e22,0x03}, -{0x8e23,0x00}, -{0x8e24,0xfd}, -{0x8e25,0x50}, -{0x8e26,0x27}, -{0x8e27,0x01}, -{0x8e28,0xfe}, -{0x8e29,0x60}, -{0x8e2a,0x00}, -{0x8e2b,0x11}, -{0x8e2c,0x00}, -{0x8e2d,0x3f}, -{0x8e2e,0x05}, -{0x8e2f,0x30}, -{0x8e30,0x00}, -{0x8e31,0x3f}, -{0x8e32,0x06}, -{0x8e33,0x22}, -{0x8e34,0x00}, -{0x8e35,0x3f}, -{0x8e36,0x01}, -{0x8e37,0x2a}, -{0x8e38,0x00}, -{0x8e39,0x3f}, -{0x8e3a,0x02}, -{0x8e3b,0x00}, -{0x8e3c,0x00}, -{0x8e3d,0x36}, -{0x8e3e,0x06}, -{0x8e3f,0x07}, -{0x8e40,0x00}, -{0x8e41,0x3f}, -{0x8e42,0x0b}, -{0x8e43,0x0f}, -{0x8e44,0xf0}, -{0x8e45,0x00}, -{0x8e46,0x00}, -{0x8e47,0x00}, -{0x8e48,0x00}, -{0x8e49,0x30}, -{0x8e4a,0x01}, -{0x8e4b,0x40}, -{0x8e4c,0xbf}, -{0x8e4d,0x30}, -{0x8e4e,0x01}, -{0x8e4f,0x00}, -{0x8e50,0xbf}, -{0x8e51,0x30}, -{0x8e52,0x29}, -{0x8e53,0x70}, -{0x8e54,0x00}, -{0x8e55,0x3a}, -{0x8e56,0x00}, -{0x8e57,0x00}, -{0x8e58,0xff}, -{0x8e59,0x3a}, -{0x8e5a,0x00}, -{0x8e5b,0x00}, -{0x8e5c,0xff}, -{0x8e5d,0x36}, -{0x8e5e,0x03}, -{0x8e5f,0x36}, -{0x8e60,0x02}, -{0x8e61,0x41}, -{0x8e62,0x44}, -{0x8e63,0x58}, -{0x8e64,0x20}, -{0x8e65,0x18}, -{0x8e66,0x10}, -{0x8e67,0x0a}, -{0x8e68,0x04}, -{0x8e69,0x04}, -{0x8e6a,0x00}, -{0x8e6b,0x03}, -{0x8e6c,0xff}, -{0x8e6d,0x64}, -{0x8e6e,0x00}, -{0x8e6f,0x00}, -{0x8e70,0x80}, -{0x8e71,0x00}, -{0x8e72,0x00}, -{0x8e73,0x00}, -{0x8e74,0x00}, -{0x8e75,0x00}, -{0x8e76,0x00}, -{0x8e77,0x02}, -{0x8e78,0x04}, -{0x8e79,0x06}, -{0x8e7a,0x06}, -{0x8e7b,0x00}, -{0x8e7c,0x02}, -{0x8e7d,0x60},//cc}, -{0x8e7e,0x00}, -{0x8e7f,0x70}, -{0x8e80,0x50}, -{0x8e81,0x3c}, -{0x8e82,0x28}, -{0x8e83,0x1e}, -{0x8e84,0x10}, -{0x8e85,0x10}, -{0x8e86,0x50}, -{0x8e87,0x2d}, -{0x8e88,0x28}, -{0x8e89,0x16}, -{0x8e8a,0x10}, -{0x8e8b,0x10}, -{0x8e8c,0x02}, -{0x8e8d,0x00}, -{0x8e8e,0x10}, -{0x8e8f,0x30}, -{0x8e90,0x0a}, -{0x8e91,0x04}, -{0x8e92,0x05}, -{0x8e93,0x08}, -{0x8e94,0x06}, -{0x8e95,0x05}, -{0x8e96,0x00}, -{0x8e97,0xa5}, -{0x8e98,0x5a}, -{0x8e99,0x00}, -{0x8e9a,0xae}, -{0x8e9b,0x35}, -{0x8e9c,0xaf}, -{0x8e9d,0x36}, -{0x8e9e,0xe4}, -{0x8e9f,0xfd}, -{0x8ea0,0xed}, -{0x8ea1,0xc3}, -{0x8ea2,0x95}, -{0x8ea3,0x37}, -{0x8ea4,0x50}, -{0x8ea5,0x33}, -{0x8ea6,0x12}, -{0x8ea7,0x0f}, -{0x8ea8,0xe2}, -{0x8ea9,0xe4}, -{0x8eaa,0x93}, -{0x8eab,0xf5}, -{0x8eac,0x38}, -{0x8ead,0x74}, -{0x8eae,0x01}, -{0x8eaf,0x93}, -{0x8eb0,0xf5}, -{0x8eb1,0x39}, -{0x8eb2,0x45}, -{0x8eb3,0x38}, -{0x8eb4,0x60}, -{0x8eb5,0x23}, -{0x8eb6,0x85}, -{0x8eb7,0x39}, -{0x8eb8,0x82}, -{0x8eb9,0x85}, -{0x8eba,0x38}, -{0x8ebb,0x83}, -{0x8ebc,0xe0}, -{0x8ebd,0xfc}, -{0x8ebe,0x12}, -{0x8ebf,0x0f}, -{0x8ec0,0xe2}, -{0x8ec1,0x74}, -{0x8ec2,0x03}, -{0x8ec3,0x93}, -{0x8ec4,0x52}, -{0x8ec5,0x04}, -{0x8ec6,0x12}, -{0x8ec7,0x0f}, -{0x8ec8,0xe2}, -{0x8ec9,0x74}, -{0x8eca,0x02}, -{0x8ecb,0x93}, -{0x8ecc,0x42}, -{0x8ecd,0x04}, -{0x8ece,0x85}, -{0x8ecf,0x39}, -{0x8ed0,0x82}, -{0x8ed1,0x85}, -{0x8ed2,0x38}, -{0x8ed3,0x83}, -{0x8ed4,0xec}, -{0x8ed5,0xf0}, -{0x8ed6,0x0d}, -{0x8ed7,0x80}, -{0x8ed8,0xc7}, -{0x8ed9,0x22}, -{0x8eda,0x78}, -{0x8edb,0xbe}, -{0x8edc,0xe6}, -{0x8edd,0xd3}, -{0x8ede,0x08}, -{0x8edf,0xff}, -{0x8ee0,0xe6}, -{0x8ee1,0x64}, -{0x8ee2,0x80}, -{0x8ee3,0xf8}, -{0x8ee4,0xef}, -{0x8ee5,0x64}, -{0x8ee6,0x80}, -{0x8ee7,0x98}, -{0x8ee8,0x22}, -{0x8ee9,0x93}, -{0x8eea,0xff}, -{0x8eeb,0x7e}, -{0x8eec,0x00}, -{0x8eed,0xe6}, -{0x8eee,0xfc}, -{0x8eef,0x08}, -{0x8ef0,0xe6}, -{0x8ef1,0xfd}, -{0x8ef2,0x12}, -{0x8ef3,0x04}, -{0x8ef4,0xc1}, -{0x8ef5,0x78}, -{0x8ef6,0xc1}, -{0x8ef7,0xe6}, -{0x8ef8,0xfc}, -{0x8ef9,0x08}, -{0x8efa,0xe6}, -{0x8efb,0xfd}, -{0x8efc,0xd3}, -{0x8efd,0xef}, -{0x8efe,0x9d}, -{0x8eff,0xee}, -{0x8f00,0x9c}, -{0x8f01,0x22}, -{0x8f02,0x78}, -{0x8f03,0xbd}, -{0x8f04,0xd3}, -{0x8f05,0xe6}, -{0x8f06,0x64}, -{0x8f07,0x80}, -{0x8f08,0x94}, -{0x8f09,0x80}, -{0x8f0a,0x22}, -{0x8f0b,0x25}, -{0x8f0c,0xe0}, -{0x8f0d,0x24}, -{0x8f0e,0x0a}, -{0x8f0f,0xf8}, -{0x8f10,0xe6}, -{0x8f11,0xfe}, -{0x8f12,0x08}, -{0x8f13,0xe6}, -{0x8f14,0xff}, -{0x8f15,0x22}, -{0x8f16,0xe5}, -{0x8f17,0x3c}, -{0x8f18,0xd3}, -{0x8f19,0x94}, -{0x8f1a,0x00}, -{0x8f1b,0x40}, -{0x8f1c,0x0b}, -{0x8f1d,0x90}, -{0x8f1e,0x0e}, -{0x8f1f,0x88}, -{0x8f20,0x12}, -{0x8f21,0x0b}, -{0x8f22,0xf1}, -{0x8f23,0x90}, -{0x8f24,0x0e}, -{0x8f25,0x86}, -{0x8f26,0x80}, -{0x8f27,0x09}, -{0x8f28,0x90}, -{0x8f29,0x0e}, -{0x8f2a,0x82}, -{0x8f2b,0x12}, -{0x8f2c,0x0b}, -{0x8f2d,0xf1}, -{0x8f2e,0x90}, -{0x8f2f,0x0e}, -{0x8f30,0x80}, -{0x8f31,0xe4}, -{0x8f32,0x93}, -{0x8f33,0xf5}, -{0x8f34,0x44}, -{0x8f35,0xa3}, -{0x8f36,0xe4}, -{0x8f37,0x93}, -{0x8f38,0xf5}, -{0x8f39,0x43}, -{0x8f3a,0xd2}, -{0x8f3b,0x06}, -{0x8f3c,0x30}, -{0x8f3d,0x06}, -{0x8f3e,0x03}, -{0x8f3f,0xd3}, -{0x8f40,0x80}, -{0x8f41,0x01}, -{0x8f42,0xc3}, -{0x8f43,0x92}, -{0x8f44,0x0e}, -{0x8f45,0x22}, -{0x8f46,0xa2}, -{0x8f47,0xaf}, -{0x8f48,0x92}, -{0x8f49,0x32}, -{0x8f4a,0xc2}, -{0x8f4b,0xaf}, -{0x8f4c,0xe5}, -{0x8f4d,0x23}, -{0x8f4e,0x45}, -{0x8f4f,0x22}, -{0x8f50,0x90}, -{0x8f51,0x0e}, -{0x8f52,0x5d}, -{0x8f53,0x60}, -{0x8f54,0x0e}, -{0x8f55,0x12}, -{0x8f56,0x0f}, -{0x8f57,0xcb}, -{0x8f58,0xe0}, -{0x8f59,0xf5}, -{0x8f5a,0x2c}, -{0x8f5b,0x12}, -{0x8f5c,0x0f}, -{0x8f5d,0xc8}, -{0x8f5e,0xe0}, -{0x8f5f,0xf5}, -{0x8f60,0x2d}, -{0x8f61,0x80}, -{0x8f62,0x0c}, -{0x8f63,0x12}, -{0x8f64,0x0f}, -{0x8f65,0xcb}, -{0x8f66,0xe5}, -{0x8f67,0x30}, -{0x8f68,0xf0}, -{0x8f69,0x12}, -{0x8f6a,0x0f}, -{0x8f6b,0xc8}, -{0x8f6c,0xe5}, -{0x8f6d,0x31}, -{0x8f6e,0xf0}, -{0x8f6f,0xa2}, -{0x8f70,0x32}, -{0x8f71,0x92}, -{0x8f72,0xaf}, -{0x8f73,0x22}, -{0x8f74,0xd2}, -{0x8f75,0x01}, -{0x8f76,0xc2}, -{0x8f77,0x02}, -{0x8f78,0xe4}, -{0x8f79,0xf5}, -{0x8f7a,0x1f}, -{0x8f7b,0xf5}, -{0x8f7c,0x1e}, -{0x8f7d,0xd2}, -{0x8f7e,0x35}, -{0x8f7f,0xd2}, -{0x8f80,0x33}, -{0x8f81,0xd2}, -{0x8f82,0x36}, -{0x8f83,0xd2}, -{0x8f84,0x01}, -{0x8f85,0xc2}, -{0x8f86,0x02}, -{0x8f87,0xf5}, -{0x8f88,0x1f}, -{0x8f89,0xf5}, -{0x8f8a,0x1e}, -{0x8f8b,0xd2}, -{0x8f8c,0x35}, -{0x8f8d,0xd2}, -{0x8f8e,0x33}, -{0x8f8f,0x22}, -{0x8f90,0xfb}, -{0x8f91,0xd3}, -{0x8f92,0xed}, -{0x8f93,0x9b}, -{0x8f94,0x74}, -{0x8f95,0x80}, -{0x8f96,0xf8}, -{0x8f97,0x6c}, -{0x8f98,0x98}, -{0x8f99,0x22}, -{0x8f9a,0x12}, -{0x8f9b,0x06}, -{0x8f9c,0x69}, -{0x8f9d,0xe5}, -{0x8f9e,0x40}, -{0x8f9f,0x2f}, -{0x8fa0,0xf5}, -{0x8fa1,0x40}, -{0x8fa2,0xe5}, -{0x8fa3,0x3f}, -{0x8fa4,0x3e}, -{0x8fa5,0xf5}, -{0x8fa6,0x3f}, -{0x8fa7,0xe5}, -{0x8fa8,0x3e}, -{0x8fa9,0x3d}, -{0x8faa,0xf5}, -{0x8fab,0x3e}, -{0x8fac,0xe5}, -{0x8fad,0x3d}, -{0x8fae,0x3c}, -{0x8faf,0xf5}, -{0x8fb0,0x3d}, -{0x8fb1,0x22}, -{0x8fb2,0xc0}, -{0x8fb3,0xe0}, -{0x8fb4,0xc0}, -{0x8fb5,0x83}, -{0x8fb6,0xc0}, -{0x8fb7,0x82}, -{0x8fb8,0x90}, -{0x8fb9,0x3f}, -{0x8fba,0x0d}, -{0x8fbb,0xe0}, -{0x8fbc,0xf5}, -{0x8fbd,0x33}, -{0x8fbe,0xe5}, -{0x8fbf,0x33}, -{0x8fc0,0xf0}, -{0x8fc1,0xd0}, -{0x8fc2,0x82}, -{0x8fc3,0xd0}, -{0x8fc4,0x83}, -{0x8fc5,0xd0}, -{0x8fc6,0xe0}, -{0x8fc7,0x32}, -{0x8fc8,0x90}, -{0x8fc9,0x0e}, -{0x8fca,0x5f}, -{0x8fcb,0xe4}, -{0x8fcc,0x93}, -{0x8fcd,0xfe}, -{0x8fce,0x74}, -{0x8fcf,0x01}, -{0x8fd0,0x93}, -{0x8fd1,0xf5}, -{0x8fd2,0x82}, -{0x8fd3,0x8e}, -{0x8fd4,0x83}, -{0x8fd5,0x22}, -{0x8fd6,0x78}, -{0x8fd7,0x7f}, -{0x8fd8,0xe4}, -{0x8fd9,0xf6}, -{0x8fda,0xd8}, -{0x8fdb,0xfd}, -{0x8fdc,0x75}, -{0x8fdd,0x81}, -{0x8fde,0xcd}, -{0x8fdf,0x02}, -{0x8fe0,0x0c}, -{0x8fe1,0x98}, -{0x8fe2,0x8f}, -{0x8fe3,0x82}, -{0x8fe4,0x8e}, -{0x8fe5,0x83}, -{0x8fe6,0x75}, -{0x8fe7,0xf0}, -{0x8fe8,0x04}, -{0x8fe9,0xed}, -{0x8fea,0x02}, -{0x8feb,0x06}, -{0x8fec,0xa5}, -{0x3022,0x00}, -{0x3023,0x00}, -{0x3024,0x00}, -{0x3025,0x00}, -{0x3026,0x00}, -{0x3027,0x00}, -{0x3028,0x00}, -{0x3029,0x7F}, -{0x3000,0x00}, -#endif -SensorEnd -}; diff --git a/drivers/media/video/ov5640_af_firmware_old.c b/drivers/media/video/ov5640_af_firmware_old.c deleted file mode 100755 index 4341b102c17b..000000000000 --- a/drivers/media/video/ov5640_af_firmware_old.c +++ /dev/null @@ -1,11929 +0,0 @@ -/* - * Driver for OV5640 CMOS Image Sensor from OmniVision - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -#include "ov5640.h" - -static struct reginfo sensor_af_firmware[] = -{ -#if 0 - {0x3000, 0x20}, - {0x8000, 0x02}, - {0x8001, 0x0b}, - {0x8002, 0x61}, - {0x8003, 0x02}, - {0x8004, 0x07}, - {0x8005, 0xb1}, - {0x8006, 0xc2}, - {0x8007, 0x01}, - {0x8008, 0x22}, - {0x8009, 0x22}, - {0x800a, 0x00}, - {0x800b, 0x02}, - {0x800c, 0x0b}, - {0x800d, 0x4b}, - {0x800e, 0xe5}, - {0x800f, 0x1f}, - {0x8010, 0x60}, - {0x8011, 0x03}, - {0x8012, 0x02}, - {0x8013, 0x00}, - {0x8014, 0x97}, - {0x8015, 0xf5}, - {0x8016, 0x1e}, - {0x8017, 0xd2}, - {0x8018, 0x34}, - {0x8019, 0x75}, - {0x801a, 0x34}, - {0x801b, 0xff}, - {0x801c, 0x75}, - {0x801d, 0x35}, - {0x801e, 0x0e}, - {0x801f, 0x75}, - {0x8020, 0x36}, - {0x8021, 0x55}, - {0x8022, 0x75}, - {0x8023, 0x37}, - {0x8024, 0x01}, - {0x8025, 0x12}, - {0x8026, 0x0a}, - {0x8027, 0x3e}, - {0x8028, 0xe4}, - {0x8029, 0xff}, - {0x802a, 0xef}, - {0x802b, 0x25}, - {0x802c, 0xe0}, - {0x802d, 0x24}, - {0x802e, 0x4b}, - {0x802f, 0xf8}, - {0x8030, 0xe4}, - {0x8031, 0xf6}, - {0x8032, 0x08}, - {0x8033, 0xf6}, - {0x8034, 0x0f}, - {0x8035, 0xbf}, - {0x8036, 0x34}, - {0x8037, 0xf2}, - {0x8038, 0x90}, - {0x8039, 0x0e}, - {0x803a, 0x88}, - {0x803b, 0xe4}, - {0x803c, 0x93}, - {0x803d, 0xff}, - {0x803e, 0xe5}, - {0x803f, 0x49}, - {0x8040, 0xc3}, - {0x8041, 0x9f}, - {0x8042, 0x50}, - {0x8043, 0x04}, - {0x8044, 0x7f}, - {0x8045, 0x05}, - {0x8046, 0x80}, - {0x8047, 0x02}, - {0x8048, 0x7f}, - {0x8049, 0xfb}, - {0x804a, 0x78}, - {0x804b, 0xba}, - {0x804c, 0xa6}, - {0x804d, 0x07}, - {0x804e, 0x12}, - {0x804f, 0x0a}, - {0x8050, 0xa8}, - {0x8051, 0x40}, - {0x8052, 0x04}, - {0x8053, 0x7f}, - {0x8054, 0x03}, - {0x8055, 0x80}, - {0x8056, 0x02}, - {0x8057, 0x7f}, - {0x8058, 0x30}, - {0x8059, 0x78}, - {0x805a, 0xb9}, - {0x805b, 0xa6}, - {0x805c, 0x07}, - {0x805d, 0xe6}, - {0x805e, 0x18}, - {0x805f, 0xf6}, - {0x8060, 0x08}, - {0x8061, 0xe6}, - {0x8062, 0x78}, - {0x8063, 0xb6}, - {0x8064, 0xf6}, - {0x8065, 0x78}, - {0x8066, 0xb9}, - {0x8067, 0xe6}, - {0x8068, 0x78}, - {0x8069, 0xb7}, - {0x806a, 0xf6}, - {0x806b, 0x78}, - {0x806c, 0xbc}, - {0x806d, 0x76}, - {0x806e, 0x33}, - {0x806f, 0xe4}, - {0x8070, 0x08}, - {0x8071, 0xf6}, - {0x8072, 0x78}, - {0x8073, 0xb5}, - {0x8074, 0x76}, - {0x8075, 0x01}, - {0x8076, 0x75}, - {0x8077, 0x48}, - {0x8078, 0x02}, - {0x8079, 0x78}, - {0x807a, 0xb3}, - {0x807b, 0xf6}, - {0x807c, 0x08}, - {0x807d, 0xf6}, - {0x807e, 0x74}, - {0x807f, 0xff}, - {0x8080, 0x78}, - {0x8081, 0xbe}, - {0x8082, 0xf6}, - {0x8083, 0x08}, - {0x8084, 0xf6}, - {0x8085, 0x75}, - {0x8086, 0x1f}, - {0x8087, 0x01}, - {0x8088, 0x78}, - {0x8089, 0xb9}, - {0x808a, 0xe6}, - {0x808b, 0x75}, - {0x808c, 0xf0}, - {0x808d, 0x05}, - {0x808e, 0xa4}, - {0x808f, 0xf5}, - {0x8090, 0x49}, - {0x8091, 0x12}, - {0x8092, 0x08}, - {0x8093, 0x4f}, - {0x8094, 0xc2}, - {0x8095, 0x36}, - {0x8096, 0x22}, - {0x8097, 0x78}, - {0x8098, 0xb5}, - {0x8099, 0xe6}, - {0x809a, 0xd3}, - {0x809b, 0x94}, - {0x809c, 0x00}, - {0x809d, 0x40}, - {0x809e, 0x02}, - {0x809f, 0x16}, - {0x80a0, 0x22}, - {0x80a1, 0xe5}, - {0x80a2, 0x1f}, - {0x80a3, 0xb4}, - {0x80a4, 0x05}, - {0x80a5, 0x23}, - {0x80a6, 0xe4}, - {0x80a7, 0xf5}, - {0x80a8, 0x1f}, - {0x80a9, 0xc2}, - {0x80aa, 0x01}, - {0x80ab, 0x78}, - {0x80ac, 0xb3}, - {0x80ad, 0xe6}, - {0x80ae, 0xfe}, - {0x80af, 0x08}, - {0x80b0, 0xe6}, - {0x80b1, 0xff}, - {0x80b2, 0x78}, - {0x80b3, 0x4b}, - {0x80b4, 0xa6}, - {0x80b5, 0x06}, - {0x80b6, 0x08}, - {0x80b7, 0xa6}, - {0x80b8, 0x07}, - {0x80b9, 0xa2}, - {0x80ba, 0x36}, - {0x80bb, 0xe4}, - {0x80bc, 0x33}, - {0x80bd, 0xf5}, - {0x80be, 0x3c}, - {0x80bf, 0x90}, - {0x80c0, 0x30}, - {0x80c1, 0x28}, - {0x80c2, 0xf0}, - {0x80c3, 0x75}, - {0x80c4, 0x1e}, - {0x80c5, 0x10}, - {0x80c6, 0xd2}, - {0x80c7, 0x34}, - {0x80c8, 0x22}, - {0x80c9, 0xe5}, - {0x80ca, 0x49}, - {0x80cb, 0x75}, - {0x80cc, 0xf0}, - {0x80cd, 0x05}, - {0x80ce, 0x84}, - {0x80cf, 0x78}, - {0x80d0, 0xb9}, - {0x80d1, 0xf6}, - {0x80d2, 0x90}, - {0x80d3, 0x0e}, - {0x80d4, 0x85}, - {0x80d5, 0xe4}, - {0x80d6, 0x93}, - {0x80d7, 0xff}, - {0x80d8, 0x25}, - {0x80d9, 0xe0}, - {0x80da, 0x24}, - {0x80db, 0x0a}, - {0x80dc, 0xf8}, - {0x80dd, 0xe6}, - {0x80de, 0xfc}, - {0x80df, 0x08}, - {0x80e0, 0xe6}, - {0x80e1, 0xfd}, - {0x80e2, 0x78}, - {0x80e3, 0xb9}, - {0x80e4, 0xe6}, - {0x80e5, 0x25}, - {0x80e6, 0xe0}, - {0x80e7, 0x24}, - {0x80e8, 0x4b}, - {0x80e9, 0xf8}, - {0x80ea, 0xa6}, - {0x80eb, 0x04}, - {0x80ec, 0x08}, - {0x80ed, 0xa6}, - {0x80ee, 0x05}, - {0x80ef, 0xef}, - {0x80f0, 0x12}, - {0x80f1, 0x0a}, - {0x80f2, 0xaf}, - {0x80f3, 0xd3}, - {0x80f4, 0x78}, - {0x80f5, 0xb4}, - {0x80f6, 0x96}, - {0x80f7, 0xee}, - {0x80f8, 0x18}, - {0x80f9, 0x96}, - {0x80fa, 0x40}, - {0x80fb, 0x0d}, - {0x80fc, 0x78}, - {0x80fd, 0xb9}, - {0x80fe, 0xe6}, - {0x80ff, 0x78}, - {0x8100, 0xb6}, - {0x8101, 0xf6}, - {0x8102, 0x78}, - {0x8103, 0xb3}, - {0x8104, 0xa6}, - {0x8105, 0x06}, - {0x8106, 0x08}, - {0x8107, 0xa6}, - {0x8108, 0x07}, - {0x8109, 0x90}, - {0x810a, 0x0e}, - {0x810b, 0x85}, - {0x810c, 0xe4}, - {0x810d, 0x93}, - {0x810e, 0x12}, - {0x810f, 0x0a}, - {0x8110, 0xaf}, - {0x8111, 0xc3}, - {0x8112, 0x78}, - {0x8113, 0xbf}, - {0x8114, 0x96}, - {0x8115, 0xee}, - {0x8116, 0x18}, - {0x8117, 0x96}, - {0x8118, 0x50}, - {0x8119, 0x0d}, - {0x811a, 0x78}, - {0x811b, 0xb9}, - {0x811c, 0xe6}, - {0x811d, 0x78}, - {0x811e, 0xb7}, - {0x811f, 0xf6}, - {0x8120, 0x78}, - {0x8121, 0xbe}, - {0x8122, 0xa6}, - {0x8123, 0x06}, - {0x8124, 0x08}, - {0x8125, 0xa6}, - {0x8126, 0x07}, - {0x8127, 0x78}, - {0x8128, 0xb3}, - {0x8129, 0xe6}, - {0x812a, 0xfe}, - {0x812b, 0x08}, - {0x812c, 0xe6}, - {0x812d, 0xc3}, - {0x812e, 0x78}, - {0x812f, 0xbf}, - {0x8130, 0x96}, - {0x8131, 0xff}, - {0x8132, 0xee}, - {0x8133, 0x18}, - {0x8134, 0x96}, - {0x8135, 0x78}, - {0x8136, 0xc0}, - {0x8137, 0xf6}, - {0x8138, 0x08}, - {0x8139, 0xa6}, - {0x813a, 0x07}, - {0x813b, 0x90}, - {0x813c, 0x0e}, - {0x813d, 0x8a}, - {0x813e, 0xe4}, - {0x813f, 0x18}, - {0x8140, 0x12}, - {0x8141, 0x0a}, - {0x8142, 0x8d}, - {0x8143, 0x40}, - {0x8144, 0x02}, - {0x8145, 0xd2}, - {0x8146, 0x36}, - {0x8147, 0x78}, - {0x8148, 0xb9}, - {0x8149, 0xe6}, - {0x814a, 0x08}, - {0x814b, 0x26}, - {0x814c, 0x08}, - {0x814d, 0xf6}, - {0x814e, 0xe5}, - {0x814f, 0x1f}, - {0x8150, 0x64}, - {0x8151, 0x01}, - {0x8152, 0x70}, - {0x8153, 0x4a}, - {0x8154, 0xe6}, - {0x8155, 0xc3}, - {0x8156, 0x78}, - {0x8157, 0xbd}, - {0x8158, 0x12}, - {0x8159, 0x0a}, - {0x815a, 0x83}, - {0x815b, 0x40}, - {0x815c, 0x05}, - {0x815d, 0x12}, - {0x815e, 0x0a}, - {0x815f, 0x7e}, - {0x8160, 0x40}, - {0x8161, 0x39}, - {0x8162, 0x12}, - {0x8163, 0x0a}, - {0x8164, 0xa6}, - {0x8165, 0x40}, - {0x8166, 0x04}, - {0x8167, 0x7f}, - {0x8168, 0xfe}, - {0x8169, 0x80}, - {0x816a, 0x02}, - {0x816b, 0x7f}, - {0x816c, 0x02}, - {0x816d, 0x78}, - {0x816e, 0xba}, - {0x816f, 0xa6}, - {0x8170, 0x07}, - {0x8171, 0x78}, - {0x8172, 0xb6}, - {0x8173, 0xe6}, - {0x8174, 0x24}, - {0x8175, 0x03}, - {0x8176, 0x78}, - {0x8177, 0xbc}, - {0x8178, 0xf6}, - {0x8179, 0x78}, - {0x817a, 0xb6}, - {0x817b, 0xe6}, - {0x817c, 0x24}, - {0x817d, 0xfd}, - {0x817e, 0x78}, - {0x817f, 0xbd}, - {0x8180, 0xf6}, - {0x8181, 0x12}, - {0x8182, 0x0a}, - {0x8183, 0xa6}, - {0x8184, 0x40}, - {0x8185, 0x06}, - {0x8186, 0x78}, - {0x8187, 0xbd}, - {0x8188, 0xe6}, - {0x8189, 0xff}, - {0x818a, 0x80}, - {0x818b, 0x04}, - {0x818c, 0x78}, - {0x818d, 0xbc}, - {0x818e, 0xe6}, - {0x818f, 0xff}, - {0x8190, 0x78}, - {0x8191, 0xbb}, - {0x8192, 0xa6}, - {0x8193, 0x07}, - {0x8194, 0x75}, - {0x8195, 0x1f}, - {0x8196, 0x02}, - {0x8197, 0x78}, - {0x8198, 0xb5}, - {0x8199, 0x76}, - {0x819a, 0x01}, - {0x819b, 0x02}, - {0x819c, 0x02}, - {0x819d, 0x5d}, - {0x819e, 0xe5}, - {0x819f, 0x1f}, - {0x81a0, 0x64}, - {0x81a1, 0x02}, - {0x81a2, 0x60}, - {0x81a3, 0x03}, - {0x81a4, 0x02}, - {0x81a5, 0x02}, - {0x81a6, 0x3d}, - {0x81a7, 0x78}, - {0x81a8, 0xbb}, - {0x81a9, 0xe6}, - {0x81aa, 0xff}, - {0x81ab, 0xc3}, - {0x81ac, 0x78}, - {0x81ad, 0xbd}, - {0x81ae, 0x12}, - {0x81af, 0x0a}, - {0x81b0, 0x84}, - {0x81b1, 0x40}, - {0x81b2, 0x08}, - {0x81b3, 0x12}, - {0x81b4, 0x0a}, - {0x81b5, 0x7e}, - {0x81b6, 0x50}, - {0x81b7, 0x03}, - {0x81b8, 0x02}, - {0x81b9, 0x02}, - {0x81ba, 0x3b}, - {0x81bb, 0x12}, - {0x81bc, 0x0a}, - {0x81bd, 0xa6}, - {0x81be, 0x40}, - {0x81bf, 0x04}, - {0x81c0, 0x7f}, - {0x81c1, 0xff}, - {0x81c2, 0x80}, - {0x81c3, 0x02}, - {0x81c4, 0x7f}, - {0x81c5, 0x01}, - {0x81c6, 0x78}, - {0x81c7, 0xba}, - {0x81c8, 0xa6}, - {0x81c9, 0x07}, - {0x81ca, 0x78}, - {0x81cb, 0xb6}, - {0x81cc, 0xe6}, - {0x81cd, 0x04}, - {0x81ce, 0x78}, - {0x81cf, 0xbc}, - {0x81d0, 0xf6}, - {0x81d1, 0x78}, - {0x81d2, 0xb6}, - {0x81d3, 0xe6}, - {0x81d4, 0x14}, - {0x81d5, 0x78}, - {0x81d6, 0xbd}, - {0x81d7, 0xf6}, - {0x81d8, 0x18}, - {0x81d9, 0x12}, - {0x81da, 0x0a}, - {0x81db, 0xa8}, - {0x81dc, 0x40}, - {0x81dd, 0x04}, - {0x81de, 0xe6}, - {0x81df, 0xff}, - {0x81e0, 0x80}, - {0x81e1, 0x02}, - {0x81e2, 0x7f}, - {0x81e3, 0x00}, - {0x81e4, 0x78}, - {0x81e5, 0xbc}, - {0x81e6, 0xa6}, - {0x81e7, 0x07}, - {0x81e8, 0xd3}, - {0x81e9, 0x08}, - {0x81ea, 0xe6}, - {0x81eb, 0x64}, - {0x81ec, 0x80}, - {0x81ed, 0x94}, - {0x81ee, 0x80}, - {0x81ef, 0x40}, - {0x81f0, 0x04}, - {0x81f1, 0xe6}, - {0x81f2, 0xff}, - {0x81f3, 0x80}, - {0x81f4, 0x02}, - {0x81f5, 0x7f}, - {0x81f6, 0x00}, - {0x81f7, 0x78}, - {0x81f8, 0xbd}, - {0x81f9, 0xa6}, - {0x81fa, 0x07}, - {0x81fb, 0xc3}, - {0x81fc, 0x18}, - {0x81fd, 0xe6}, - {0x81fe, 0x64}, - {0x81ff, 0x80}, - {0x8200, 0x94}, - {0x8201, 0xb3}, - {0x8202, 0x50}, - {0x8203, 0x04}, - {0x8204, 0xe6}, - {0x8205, 0xff}, - {0x8206, 0x80}, - {0x8207, 0x02}, - {0x8208, 0x7f}, - {0x8209, 0x33}, - {0x820a, 0x78}, - {0x820b, 0xbc}, - {0x820c, 0xa6}, - {0x820d, 0x07}, - {0x820e, 0xc3}, - {0x820f, 0x08}, - {0x8210, 0xe6}, - {0x8211, 0x64}, - {0x8212, 0x80}, - {0x8213, 0x94}, - {0x8214, 0xb3}, - {0x8215, 0x50}, - {0x8216, 0x04}, - {0x8217, 0xe6}, - {0x8218, 0xff}, - {0x8219, 0x80}, - {0x821a, 0x02}, - {0x821b, 0x7f}, - {0x821c, 0x33}, - {0x821d, 0x78}, - {0x821e, 0xbd}, - {0x821f, 0xa6}, - {0x8220, 0x07}, - {0x8221, 0x12}, - {0x8222, 0x0a}, - {0x8223, 0xa6}, - {0x8224, 0x40}, - {0x8225, 0x06}, - {0x8226, 0x78}, - {0x8227, 0xbd}, - {0x8228, 0xe6}, - {0x8229, 0xff}, - {0x822a, 0x80}, - {0x822b, 0x04}, - {0x822c, 0x78}, - {0x822d, 0xbc}, - {0x822e, 0xe6}, - {0x822f, 0xff}, - {0x8230, 0x78}, - {0x8231, 0xbb}, - {0x8232, 0xa6}, - {0x8233, 0x07}, - {0x8234, 0x75}, - {0x8235, 0x1f}, - {0x8236, 0x03}, - {0x8237, 0x78}, - {0x8238, 0xb5}, - {0x8239, 0x76}, - {0x823a, 0x01}, - {0x823b, 0x80}, - {0x823c, 0x20}, - {0x823d, 0xe5}, - {0x823e, 0x1f}, - {0x823f, 0x64}, - {0x8240, 0x03}, - {0x8241, 0x70}, - {0x8242, 0x26}, - {0x8243, 0x78}, - {0x8244, 0xbb}, - {0x8245, 0xe6}, - {0x8246, 0xff}, - {0x8247, 0xc3}, - {0x8248, 0x78}, - {0x8249, 0xbd}, - {0x824a, 0x12}, - {0x824b, 0x0a}, - {0x824c, 0x84}, - {0x824d, 0x40}, - {0x824e, 0x05}, - {0x824f, 0x12}, - {0x8250, 0x0a}, - {0x8251, 0x7e}, - {0x8252, 0x40}, - {0x8253, 0x09}, - {0x8254, 0x78}, - {0x8255, 0xb6}, - {0x8256, 0xe6}, - {0x8257, 0x78}, - {0x8258, 0xbb}, - {0x8259, 0xf6}, - {0x825a, 0x75}, - {0x825b, 0x1f}, - {0x825c, 0x04}, - {0x825d, 0x78}, - {0x825e, 0xbb}, - {0x825f, 0xe6}, - {0x8260, 0x75}, - {0x8261, 0xf0}, - {0x8262, 0x05}, - {0x8263, 0xa4}, - {0x8264, 0xf5}, - {0x8265, 0x49}, - {0x8266, 0x02}, - {0x8267, 0x08}, - {0x8268, 0x4f}, - {0x8269, 0xe5}, - {0x826a, 0x1f}, - {0x826b, 0xb4}, - {0x826c, 0x04}, - {0x826d, 0x1f}, - {0x826e, 0x90}, - {0x826f, 0x0e}, - {0x8270, 0x89}, - {0x8271, 0xe4}, - {0x8272, 0x78}, - {0x8273, 0xc0}, - {0x8274, 0x12}, - {0x8275, 0x0a}, - {0x8276, 0x8d}, - {0x8277, 0x40}, - {0x8278, 0x02}, - {0x8279, 0xd2}, - {0x827a, 0x36}, - {0x827b, 0x75}, - {0x827c, 0x1f}, - {0x827d, 0x05}, - {0x827e, 0x75}, - {0x827f, 0x34}, - {0x8280, 0xff}, - {0x8281, 0x75}, - {0x8282, 0x35}, - {0x8283, 0x0e}, - {0x8284, 0x75}, - {0x8285, 0x36}, - {0x8286, 0x59}, - {0x8287, 0x75}, - {0x8288, 0x37}, - {0x8289, 0x01}, - {0x828a, 0x12}, - {0x828b, 0x0a}, - {0x828c, 0x3e}, - {0x828d, 0x22}, - {0x828e, 0xef}, - {0x828f, 0x8d}, - {0x8290, 0xf0}, - {0x8291, 0xa4}, - {0x8292, 0xa8}, - {0x8293, 0xf0}, - {0x8294, 0xcf}, - {0x8295, 0x8c}, - {0x8296, 0xf0}, - {0x8297, 0xa4}, - {0x8298, 0x28}, - {0x8299, 0xce}, - {0x829a, 0x8d}, - {0x829b, 0xf0}, - {0x829c, 0xa4}, - {0x829d, 0x2e}, - {0x829e, 0xfe}, - {0x829f, 0x22}, - {0x82a0, 0xbc}, - {0x82a1, 0x00}, - {0x82a2, 0x0b}, - {0x82a3, 0xbe}, - {0x82a4, 0x00}, - {0x82a5, 0x29}, - {0x82a6, 0xef}, - {0x82a7, 0x8d}, - {0x82a8, 0xf0}, - {0x82a9, 0x84}, - {0x82aa, 0xff}, - {0x82ab, 0xad}, - {0x82ac, 0xf0}, - {0x82ad, 0x22}, - {0x82ae, 0xe4}, - {0x82af, 0xcc}, - {0x82b0, 0xf8}, - {0x82b1, 0x75}, - {0x82b2, 0xf0}, - {0x82b3, 0x08}, - {0x82b4, 0xef}, - {0x82b5, 0x2f}, - {0x82b6, 0xff}, - {0x82b7, 0xee}, - {0x82b8, 0x33}, - {0x82b9, 0xfe}, - {0x82ba, 0xec}, - {0x82bb, 0x33}, - {0x82bc, 0xfc}, - {0x82bd, 0xee}, - {0x82be, 0x9d}, - {0x82bf, 0xec}, - {0x82c0, 0x98}, - {0x82c1, 0x40}, - {0x82c2, 0x05}, - {0x82c3, 0xfc}, - {0x82c4, 0xee}, - {0x82c5, 0x9d}, - {0x82c6, 0xfe}, - {0x82c7, 0x0f}, - {0x82c8, 0xd5}, - {0x82c9, 0xf0}, - {0x82ca, 0xe9}, - {0x82cb, 0xe4}, - {0x82cc, 0xce}, - {0x82cd, 0xfd}, - {0x82ce, 0x22}, - {0x82cf, 0xed}, - {0x82d0, 0xf8}, - {0x82d1, 0xf5}, - {0x82d2, 0xf0}, - {0x82d3, 0xee}, - {0x82d4, 0x84}, - {0x82d5, 0x20}, - {0x82d6, 0xd2}, - {0x82d7, 0x1c}, - {0x82d8, 0xfe}, - {0x82d9, 0xad}, - {0x82da, 0xf0}, - {0x82db, 0x75}, - {0x82dc, 0xf0}, - {0x82dd, 0x08}, - {0x82de, 0xef}, - {0x82df, 0x2f}, - {0x82e0, 0xff}, - {0x82e1, 0xed}, - {0x82e2, 0x33}, - {0x82e3, 0xfd}, - {0x82e4, 0x40}, - {0x82e5, 0x07}, - {0x82e6, 0x98}, - {0x82e7, 0x50}, - {0x82e8, 0x06}, - {0x82e9, 0xd5}, - {0x82ea, 0xf0}, - {0x82eb, 0xf2}, - {0x82ec, 0x22}, - {0x82ed, 0xc3}, - {0x82ee, 0x98}, - {0x82ef, 0xfd}, - {0x82f0, 0x0f}, - {0x82f1, 0xd5}, - {0x82f2, 0xf0}, - {0x82f3, 0xea}, - {0x82f4, 0x22}, - {0x82f5, 0xe8}, - {0x82f6, 0x8f}, - {0x82f7, 0xf0}, - {0x82f8, 0xa4}, - {0x82f9, 0xcc}, - {0x82fa, 0x8b}, - {0x82fb, 0xf0}, - {0x82fc, 0xa4}, - {0x82fd, 0x2c}, - {0x82fe, 0xfc}, - {0x82ff, 0xe9}, - {0x8300, 0x8e}, - {0x8301, 0xf0}, - {0x8302, 0xa4}, - {0x8303, 0x2c}, - {0x8304, 0xfc}, - {0x8305, 0x8a}, - {0x8306, 0xf0}, - {0x8307, 0xed}, - {0x8308, 0xa4}, - {0x8309, 0x2c}, - {0x830a, 0xfc}, - {0x830b, 0xea}, - {0x830c, 0x8e}, - {0x830d, 0xf0}, - {0x830e, 0xa4}, - {0x830f, 0xcd}, - {0x8310, 0xa8}, - {0x8311, 0xf0}, - {0x8312, 0x8b}, - {0x8313, 0xf0}, - {0x8314, 0xa4}, - {0x8315, 0x2d}, - {0x8316, 0xcc}, - {0x8317, 0x38}, - {0x8318, 0x25}, - {0x8319, 0xf0}, - {0x831a, 0xfd}, - {0x831b, 0xe9}, - {0x831c, 0x8f}, - {0x831d, 0xf0}, - {0x831e, 0xa4}, - {0x831f, 0x2c}, - {0x8320, 0xcd}, - {0x8321, 0x35}, - {0x8322, 0xf0}, - {0x8323, 0xfc}, - {0x8324, 0xeb}, - {0x8325, 0x8e}, - {0x8326, 0xf0}, - {0x8327, 0xa4}, - {0x8328, 0xfe}, - {0x8329, 0xa9}, - {0x832a, 0xf0}, - {0x832b, 0xeb}, - {0x832c, 0x8f}, - {0x832d, 0xf0}, - {0x832e, 0xa4}, - {0x832f, 0xcf}, - {0x8330, 0xc5}, - {0x8331, 0xf0}, - {0x8332, 0x2e}, - {0x8333, 0xcd}, - {0x8334, 0x39}, - {0x8335, 0xfe}, - {0x8336, 0xe4}, - {0x8337, 0x3c}, - {0x8338, 0xfc}, - {0x8339, 0xea}, - {0x833a, 0xa4}, - {0x833b, 0x2d}, - {0x833c, 0xce}, - {0x833d, 0x35}, - {0x833e, 0xf0}, - {0x833f, 0xfd}, - {0x8340, 0xe4}, - {0x8341, 0x3c}, - {0x8342, 0xfc}, - {0x8343, 0x22}, - {0x8344, 0x75}, - {0x8345, 0xf0}, - {0x8346, 0x08}, - {0x8347, 0x75}, - {0x8348, 0x82}, - {0x8349, 0x00}, - {0x834a, 0xef}, - {0x834b, 0x2f}, - {0x834c, 0xff}, - {0x834d, 0xee}, - {0x834e, 0x33}, - {0x834f, 0xfe}, - {0x8350, 0xcd}, - {0x8351, 0x33}, - {0x8352, 0xcd}, - {0x8353, 0xcc}, - {0x8354, 0x33}, - {0x8355, 0xcc}, - {0x8356, 0xc5}, - {0x8357, 0x82}, - {0x8358, 0x33}, - {0x8359, 0xc5}, - {0x835a, 0x82}, - {0x835b, 0x9b}, - {0x835c, 0xed}, - {0x835d, 0x9a}, - {0x835e, 0xec}, - {0x835f, 0x99}, - {0x8360, 0xe5}, - {0x8361, 0x82}, - {0x8362, 0x98}, - {0x8363, 0x40}, - {0x8364, 0x0c}, - {0x8365, 0xf5}, - {0x8366, 0x82}, - {0x8367, 0xee}, - {0x8368, 0x9b}, - {0x8369, 0xfe}, - {0x836a, 0xed}, - {0x836b, 0x9a}, - {0x836c, 0xfd}, - {0x836d, 0xec}, - {0x836e, 0x99}, - {0x836f, 0xfc}, - {0x8370, 0x0f}, - {0x8371, 0xd5}, - {0x8372, 0xf0}, - {0x8373, 0xd6}, - {0x8374, 0xe4}, - {0x8375, 0xce}, - {0x8376, 0xfb}, - {0x8377, 0xe4}, - {0x8378, 0xcd}, - {0x8379, 0xfa}, - {0x837a, 0xe4}, - {0x837b, 0xcc}, - {0x837c, 0xf9}, - {0x837d, 0xa8}, - {0x837e, 0x82}, - {0x837f, 0x22}, - {0x8380, 0xb8}, - {0x8381, 0x00}, - {0x8382, 0xc1}, - {0x8383, 0xb9}, - {0x8384, 0x00}, - {0x8385, 0x59}, - {0x8386, 0xba}, - {0x8387, 0x00}, - {0x8388, 0x2d}, - {0x8389, 0xec}, - {0x838a, 0x8b}, - {0x838b, 0xf0}, - {0x838c, 0x84}, - {0x838d, 0xcf}, - {0x838e, 0xce}, - {0x838f, 0xcd}, - {0x8390, 0xfc}, - {0x8391, 0xe5}, - {0x8392, 0xf0}, - {0x8393, 0xcb}, - {0x8394, 0xf9}, - {0x8395, 0x78}, - {0x8396, 0x18}, - {0x8397, 0xef}, - {0x8398, 0x2f}, - {0x8399, 0xff}, - {0x839a, 0xee}, - {0x839b, 0x33}, - {0x839c, 0xfe}, - {0x839d, 0xed}, - {0x839e, 0x33}, - {0x839f, 0xfd}, - {0x83a0, 0xec}, - {0x83a1, 0x33}, - {0x83a2, 0xfc}, - {0x83a3, 0xeb}, - {0x83a4, 0x33}, - {0x83a5, 0xfb}, - {0x83a6, 0x10}, - {0x83a7, 0xd7}, - {0x83a8, 0x03}, - {0x83a9, 0x99}, - {0x83aa, 0x40}, - {0x83ab, 0x04}, - {0x83ac, 0xeb}, - {0x83ad, 0x99}, - {0x83ae, 0xfb}, - {0x83af, 0x0f}, - {0x83b0, 0xd8}, - {0x83b1, 0xe5}, - {0x83b2, 0xe4}, - {0x83b3, 0xf9}, - {0x83b4, 0xfa}, - {0x83b5, 0x22}, - {0x83b6, 0x78}, - {0x83b7, 0x18}, - {0x83b8, 0xef}, - {0x83b9, 0x2f}, - {0x83ba, 0xff}, - {0x83bb, 0xee}, - {0x83bc, 0x33}, - {0x83bd, 0xfe}, - {0x83be, 0xed}, - {0x83bf, 0x33}, - {0x83c0, 0xfd}, - {0x83c1, 0xec}, - {0x83c2, 0x33}, - {0x83c3, 0xfc}, - {0x83c4, 0xc9}, - {0x83c5, 0x33}, - {0x83c6, 0xc9}, - {0x83c7, 0x10}, - {0x83c8, 0xd7}, - {0x83c9, 0x05}, - {0x83ca, 0x9b}, - {0x83cb, 0xe9}, - {0x83cc, 0x9a}, - {0x83cd, 0x40}, - {0x83ce, 0x07}, - {0x83cf, 0xec}, - {0x83d0, 0x9b}, - {0x83d1, 0xfc}, - {0x83d2, 0xe9}, - {0x83d3, 0x9a}, - {0x83d4, 0xf9}, - {0x83d5, 0x0f}, - {0x83d6, 0xd8}, - {0x83d7, 0xe0}, - {0x83d8, 0xe4}, - {0x83d9, 0xc9}, - {0x83da, 0xfa}, - {0x83db, 0xe4}, - {0x83dc, 0xcc}, - {0x83dd, 0xfb}, - {0x83de, 0x22}, - {0x83df, 0x75}, - {0x83e0, 0xf0}, - {0x83e1, 0x10}, - {0x83e2, 0xef}, - {0x83e3, 0x2f}, - {0x83e4, 0xff}, - {0x83e5, 0xee}, - {0x83e6, 0x33}, - {0x83e7, 0xfe}, - {0x83e8, 0xed}, - {0x83e9, 0x33}, - {0x83ea, 0xfd}, - {0x83eb, 0xcc}, - {0x83ec, 0x33}, - {0x83ed, 0xcc}, - {0x83ee, 0xc8}, - {0x83ef, 0x33}, - {0x83f0, 0xc8}, - {0x83f1, 0x10}, - {0x83f2, 0xd7}, - {0x83f3, 0x07}, - {0x83f4, 0x9b}, - {0x83f5, 0xec}, - {0x83f6, 0x9a}, - {0x83f7, 0xe8}, - {0x83f8, 0x99}, - {0x83f9, 0x40}, - {0x83fa, 0x0a}, - {0x83fb, 0xed}, - {0x83fc, 0x9b}, - {0x83fd, 0xfd}, - {0x83fe, 0xec}, - {0x83ff, 0x9a}, - {0x8400, 0xfc}, - {0x8401, 0xe8}, - {0x8402, 0x99}, - {0x8403, 0xf8}, - {0x8404, 0x0f}, - {0x8405, 0xd5}, - {0x8406, 0xf0}, - {0x8407, 0xda}, - {0x8408, 0xe4}, - {0x8409, 0xcd}, - {0x840a, 0xfb}, - {0x840b, 0xe4}, - {0x840c, 0xcc}, - {0x840d, 0xfa}, - {0x840e, 0xe4}, - {0x840f, 0xc8}, - {0x8410, 0xf9}, - {0x8411, 0x22}, - {0x8412, 0xeb}, - {0x8413, 0x9f}, - {0x8414, 0xf5}, - {0x8415, 0xf0}, - {0x8416, 0xea}, - {0x8417, 0x9e}, - {0x8418, 0x42}, - {0x8419, 0xf0}, - {0x841a, 0xe9}, - {0x841b, 0x9d}, - {0x841c, 0x42}, - {0x841d, 0xf0}, - {0x841e, 0xe8}, - {0x841f, 0x9c}, - {0x8420, 0x45}, - {0x8421, 0xf0}, - {0x8422, 0x22}, - {0x8423, 0xe8}, - {0x8424, 0x60}, - {0x8425, 0x0f}, - {0x8426, 0xef}, - {0x8427, 0xc3}, - {0x8428, 0x33}, - {0x8429, 0xff}, - {0x842a, 0xee}, - {0x842b, 0x33}, - {0x842c, 0xfe}, - {0x842d, 0xed}, - {0x842e, 0x33}, - {0x842f, 0xfd}, - {0x8430, 0xec}, - {0x8431, 0x33}, - {0x8432, 0xfc}, - {0x8433, 0xd8}, - {0x8434, 0xf1}, - {0x8435, 0x22}, - {0x8436, 0xe4}, - {0x8437, 0x93}, - {0x8438, 0xfc}, - {0x8439, 0x74}, - {0x843a, 0x01}, - {0x843b, 0x93}, - {0x843c, 0xfd}, - {0x843d, 0x74}, - {0x843e, 0x02}, - {0x843f, 0x93}, - {0x8440, 0xfe}, - {0x8441, 0x74}, - {0x8442, 0x03}, - {0x8443, 0x93}, - {0x8444, 0xff}, - {0x8445, 0x22}, - {0x8446, 0xe6}, - {0x8447, 0xfb}, - {0x8448, 0x08}, - {0x8449, 0xe6}, - {0x844a, 0xf9}, - {0x844b, 0x08}, - {0x844c, 0xe6}, - {0x844d, 0xfa}, - {0x844e, 0x08}, - {0x844f, 0xe6}, - {0x8450, 0xcb}, - {0x8451, 0xf8}, - {0x8452, 0x22}, - {0x8453, 0xec}, - {0x8454, 0xf6}, - {0x8455, 0x08}, - {0x8456, 0xed}, - {0x8457, 0xf6}, - {0x8458, 0x08}, - {0x8459, 0xee}, - {0x845a, 0xf6}, - {0x845b, 0x08}, - {0x845c, 0xef}, - {0x845d, 0xf6}, - {0x845e, 0x22}, - {0x845f, 0xa4}, - {0x8460, 0x25}, - {0x8461, 0x82}, - {0x8462, 0xf5}, - {0x8463, 0x82}, - {0x8464, 0xe5}, - {0x8465, 0xf0}, - {0x8466, 0x35}, - {0x8467, 0x83}, - {0x8468, 0xf5}, - {0x8469, 0x83}, - {0x846a, 0x22}, - {0x846b, 0xd0}, - {0x846c, 0x83}, - {0x846d, 0xd0}, - {0x846e, 0x82}, - {0x846f, 0xf8}, - {0x8470, 0xe4}, - {0x8471, 0x93}, - {0x8472, 0x70}, - {0x8473, 0x12}, - {0x8474, 0x74}, - {0x8475, 0x01}, - {0x8476, 0x93}, - {0x8477, 0x70}, - {0x8478, 0x0d}, - {0x8479, 0xa3}, - {0x847a, 0xa3}, - {0x847b, 0x93}, - {0x847c, 0xf8}, - {0x847d, 0x74}, - {0x847e, 0x01}, - {0x847f, 0x93}, - {0x8480, 0xf5}, - {0x8481, 0x82}, - {0x8482, 0x88}, - {0x8483, 0x83}, - {0x8484, 0xe4}, - {0x8485, 0x73}, - {0x8486, 0x74}, - {0x8487, 0x02}, - {0x8488, 0x93}, - {0x8489, 0x68}, - {0x848a, 0x60}, - {0x848b, 0xef}, - {0x848c, 0xa3}, - {0x848d, 0xa3}, - {0x848e, 0xa3}, - {0x848f, 0x80}, - {0x8490, 0xdf}, - {0x8491, 0x90}, - {0x8492, 0x38}, - {0x8493, 0x04}, - {0x8494, 0x78}, - {0x8495, 0x4f}, - {0x8496, 0x12}, - {0x8497, 0x09}, - {0x8498, 0x44}, - {0x8499, 0x90}, - {0x849a, 0x38}, - {0x849b, 0x00}, - {0x849c, 0xe0}, - {0x849d, 0xfe}, - {0x849e, 0xa3}, - {0x849f, 0xe0}, - {0x84a0, 0xfd}, - {0x84a1, 0xed}, - {0x84a2, 0xff}, - {0x84a3, 0xc3}, - {0x84a4, 0x12}, - {0x84a5, 0x08}, - {0x84a6, 0xfd}, - {0x84a7, 0x90}, - {0x84a8, 0x38}, - {0x84a9, 0x10}, - {0x84aa, 0x12}, - {0x84ab, 0x08}, - {0x84ac, 0xf1}, - {0x84ad, 0x90}, - {0x84ae, 0x38}, - {0x84af, 0x06}, - {0x84b0, 0x78}, - {0x84b1, 0x51}, - {0x84b2, 0x12}, - {0x84b3, 0x09}, - {0x84b4, 0x44}, - {0x84b5, 0x90}, - {0x84b6, 0x38}, - {0x84b7, 0x02}, - {0x84b8, 0xe0}, - {0x84b9, 0xfe}, - {0x84ba, 0xa3}, - {0x84bb, 0xe0}, - {0x84bc, 0xfd}, - {0x84bd, 0xed}, - {0x84be, 0xff}, - {0x84bf, 0xc3}, - {0x84c0, 0x12}, - {0x84c1, 0x08}, - {0x84c2, 0xfd}, - {0x84c3, 0x90}, - {0x84c4, 0x38}, - {0x84c5, 0x12}, - {0x84c6, 0x12}, - {0x84c7, 0x08}, - {0x84c8, 0xf1}, - {0x84c9, 0xa3}, - {0x84ca, 0xe0}, - {0x84cb, 0xb4}, - {0x84cc, 0x31}, - {0x84cd, 0x07}, - {0x84ce, 0x78}, - {0x84cf, 0x4f}, - {0x84d0, 0x79}, - {0x84d1, 0x4f}, - {0x84d2, 0x12}, - {0x84d3, 0x09}, - {0x84d4, 0x5a}, - {0x84d5, 0x90}, - {0x84d6, 0x38}, - {0x84d7, 0x14}, - {0x84d8, 0xe0}, - {0x84d9, 0xb4}, - {0x84da, 0x71}, - {0x84db, 0x15}, - {0x84dc, 0x78}, - {0x84dd, 0x4f}, - {0x84de, 0xe6}, - {0x84df, 0xfe}, - {0x84e0, 0x08}, - {0x84e1, 0xe6}, - {0x84e2, 0x78}, - {0x84e3, 0x02}, - {0x84e4, 0xce}, - {0x84e5, 0xc3}, - {0x84e6, 0x13}, - {0x84e7, 0xce}, - {0x84e8, 0x13}, - {0x84e9, 0xd8}, - {0x84ea, 0xf9}, - {0x84eb, 0x79}, - {0x84ec, 0x50}, - {0x84ed, 0xf7}, - {0x84ee, 0xee}, - {0x84ef, 0x19}, - {0x84f0, 0xf7}, - {0x84f1, 0x90}, - {0x84f2, 0x38}, - {0x84f3, 0x15}, - {0x84f4, 0xe0}, - {0x84f5, 0xb4}, - {0x84f6, 0x31}, - {0x84f7, 0x07}, - {0x84f8, 0x78}, - {0x84f9, 0x51}, - {0x84fa, 0x79}, - {0x84fb, 0x51}, - {0x84fc, 0x12}, - {0x84fd, 0x09}, - {0x84fe, 0x5a}, - {0x84ff, 0x90}, - {0x8500, 0x38}, - {0x8501, 0x15}, - {0x8502, 0xe0}, - {0x8503, 0xb4}, - {0x8504, 0x71}, - {0x8505, 0x15}, - {0x8506, 0x78}, - {0x8507, 0x51}, - {0x8508, 0xe6}, - {0x8509, 0xfe}, - {0x850a, 0x08}, - {0x850b, 0xe6}, - {0x850c, 0x78}, - {0x850d, 0x02}, - {0x850e, 0xce}, - {0x850f, 0xc3}, - {0x8510, 0x13}, - {0x8511, 0xce}, - {0x8512, 0x13}, - {0x8513, 0xd8}, - {0x8514, 0xf9}, - {0x8515, 0x79}, - {0x8516, 0x52}, - {0x8517, 0xf7}, - {0x8518, 0xee}, - {0x8519, 0x19}, - {0x851a, 0xf7}, - {0x851b, 0x79}, - {0x851c, 0x4f}, - {0x851d, 0x12}, - {0x851e, 0x09}, - {0x851f, 0x2c}, - {0x8520, 0x09}, - {0x8521, 0x12}, - {0x8522, 0x09}, - {0x8523, 0x2c}, - {0x8524, 0xaf}, - {0x8525, 0x45}, - {0x8526, 0x12}, - {0x8527, 0x08}, - {0x8528, 0xe2}, - {0x8529, 0x7d}, - {0x852a, 0x50}, - {0x852b, 0x12}, - {0x852c, 0x02}, - {0x852d, 0xa0}, - {0x852e, 0x78}, - {0x852f, 0x57}, - {0x8530, 0xa6}, - {0x8531, 0x06}, - {0x8532, 0x08}, - {0x8533, 0xa6}, - {0x8534, 0x07}, - {0x8535, 0xaf}, - {0x8536, 0x43}, - {0x8537, 0x12}, - {0x8538, 0x08}, - {0x8539, 0xe2}, - {0x853a, 0x7d}, - {0x853b, 0x50}, - {0x853c, 0x12}, - {0x853d, 0x02}, - {0x853e, 0xa0}, - {0x853f, 0x78}, - {0x8540, 0x53}, - {0x8541, 0xa6}, - {0x8542, 0x06}, - {0x8543, 0x08}, - {0x8544, 0xa6}, - {0x8545, 0x07}, - {0x8546, 0xaf}, - {0x8547, 0x46}, - {0x8548, 0x78}, - {0x8549, 0x51}, - {0x854a, 0x12}, - {0x854b, 0x08}, - {0x854c, 0xe4}, - {0x854d, 0x7d}, - {0x854e, 0x3c}, - {0x854f, 0x12}, - {0x8550, 0x02}, - {0x8551, 0xa0}, - {0x8552, 0x78}, - {0x8553, 0x59}, - {0x8554, 0xa6}, - {0x8555, 0x06}, - {0x8556, 0x08}, - {0x8557, 0xa6}, - {0x8558, 0x07}, - {0x8559, 0xaf}, - {0x855a, 0x44}, - {0x855b, 0x7e}, - {0x855c, 0x00}, - {0x855d, 0x78}, - {0x855e, 0x51}, - {0x855f, 0x12}, - {0x8560, 0x08}, - {0x8561, 0xe6}, - {0x8562, 0x7d}, - {0x8563, 0x3c}, - {0x8564, 0x12}, - {0x8565, 0x02}, - {0x8566, 0xa0}, - {0x8567, 0x78}, - {0x8568, 0x55}, - {0x8569, 0xa6}, - {0x856a, 0x06}, - {0x856b, 0x08}, - {0x856c, 0xa6}, - {0x856d, 0x07}, - {0x856e, 0xc3}, - {0x856f, 0x78}, - {0x8570, 0x58}, - {0x8571, 0xe6}, - {0x8572, 0x94}, - {0x8573, 0x08}, - {0x8574, 0x18}, - {0x8575, 0xe6}, - {0x8576, 0x94}, - {0x8577, 0x00}, - {0x8578, 0x50}, - {0x8579, 0x05}, - {0x857a, 0x76}, - {0x857b, 0x00}, - {0x857c, 0x08}, - {0x857d, 0x76}, - {0x857e, 0x08}, - {0x857f, 0xc3}, - {0x8580, 0x78}, - {0x8581, 0x5a}, - {0x8582, 0xe6}, - {0x8583, 0x94}, - {0x8584, 0x08}, - {0x8585, 0x18}, - {0x8586, 0xe6}, - {0x8587, 0x94}, - {0x8588, 0x00}, - {0x8589, 0x50}, - {0x858a, 0x05}, - {0x858b, 0x76}, - {0x858c, 0x00}, - {0x858d, 0x08}, - {0x858e, 0x76}, - {0x858f, 0x08}, - {0x8590, 0x78}, - {0x8591, 0x57}, - {0x8592, 0x12}, - {0x8593, 0x09}, - {0x8594, 0x19}, - {0x8595, 0xff}, - {0x8596, 0xd3}, - {0x8597, 0x78}, - {0x8598, 0x54}, - {0x8599, 0xe6}, - {0x859a, 0x9f}, - {0x859b, 0x18}, - {0x859c, 0xe6}, - {0x859d, 0x9e}, - {0x859e, 0x40}, - {0x859f, 0x0e}, - {0x85a0, 0x78}, - {0x85a1, 0x57}, - {0x85a2, 0xe6}, - {0x85a3, 0x13}, - {0x85a4, 0xfe}, - {0x85a5, 0x08}, - {0x85a6, 0xe6}, - {0x85a7, 0x78}, - {0x85a8, 0x54}, - {0x85a9, 0x12}, - {0x85aa, 0x09}, - {0x85ab, 0x4f}, - {0x85ac, 0x80}, - {0x85ad, 0x04}, - {0x85ae, 0x7e}, - {0x85af, 0x00}, - {0x85b0, 0x7f}, - {0x85b1, 0x00}, - {0x85b2, 0x78}, - {0x85b3, 0x5b}, - {0x85b4, 0x12}, - {0x85b5, 0x09}, - {0x85b6, 0x11}, - {0x85b7, 0xff}, - {0x85b8, 0xd3}, - {0x85b9, 0x78}, - {0x85ba, 0x56}, - {0x85bb, 0xe6}, - {0x85bc, 0x9f}, - {0x85bd, 0x18}, - {0x85be, 0xe6}, - {0x85bf, 0x9e}, - {0x85c0, 0x40}, - {0x85c1, 0x0e}, - {0x85c2, 0x78}, - {0x85c3, 0x59}, - {0x85c4, 0xe6}, - {0x85c5, 0x13}, - {0x85c6, 0xfe}, - {0x85c7, 0x08}, - {0x85c8, 0xe6}, - {0x85c9, 0x78}, - {0x85ca, 0x56}, - {0x85cb, 0x12}, - {0x85cc, 0x09}, - {0x85cd, 0x4f}, - {0x85ce, 0x80}, - {0x85cf, 0x04}, - {0x85d0, 0x7e}, - {0x85d1, 0x00}, - {0x85d2, 0x7f}, - {0x85d3, 0x00}, - {0x85d4, 0xe4}, - {0x85d5, 0xfc}, - {0x85d6, 0xfd}, - {0x85d7, 0x78}, - {0x85d8, 0x5f}, - {0x85d9, 0x12}, - {0x85da, 0x04}, - {0x85db, 0x53}, - {0x85dc, 0x78}, - {0x85dd, 0x57}, - {0x85de, 0x12}, - {0x85df, 0x09}, - {0x85e0, 0x19}, - {0x85e1, 0x78}, - {0x85e2, 0x54}, - {0x85e3, 0x26}, - {0x85e4, 0xff}, - {0x85e5, 0xee}, - {0x85e6, 0x18}, - {0x85e7, 0x36}, - {0x85e8, 0xfe}, - {0x85e9, 0x78}, - {0x85ea, 0x63}, - {0x85eb, 0x12}, - {0x85ec, 0x09}, - {0x85ed, 0x11}, - {0x85ee, 0x78}, - {0x85ef, 0x56}, - {0x85f0, 0x26}, - {0x85f1, 0xff}, - {0x85f2, 0xee}, - {0x85f3, 0x18}, - {0x85f4, 0x36}, - {0x85f5, 0xfe}, - {0x85f6, 0xe4}, - {0x85f7, 0xfc}, - {0x85f8, 0xfd}, - {0x85f9, 0x78}, - {0x85fa, 0x67}, - {0x85fb, 0x12}, - {0x85fc, 0x04}, - {0x85fd, 0x53}, - {0x85fe, 0x12}, - {0x85ff, 0x09}, - {0x8600, 0x21}, - {0x8601, 0x78}, - {0x8602, 0x63}, - {0x8603, 0x12}, - {0x8604, 0x04}, - {0x8605, 0x46}, - {0x8606, 0xd3}, - {0x8607, 0x12}, - {0x8608, 0x04}, - {0x8609, 0x12}, - {0x860a, 0x40}, - {0x860b, 0x08}, - {0x860c, 0x12}, - {0x860d, 0x09}, - {0x860e, 0x21}, - {0x860f, 0x78}, - {0x8610, 0x63}, - {0x8611, 0x12}, - {0x8612, 0x04}, - {0x8613, 0x53}, - {0x8614, 0x78}, - {0x8615, 0x51}, - {0x8616, 0x12}, - {0x8617, 0x09}, - {0x8618, 0x23}, - {0x8619, 0x78}, - {0x861a, 0x67}, - {0x861b, 0x12}, - {0x861c, 0x04}, - {0x861d, 0x46}, - {0x861e, 0xd3}, - {0x861f, 0x12}, - {0x8620, 0x04}, - {0x8621, 0x12}, - {0x8622, 0x40}, - {0x8623, 0x0a}, - {0x8624, 0x78}, - {0x8625, 0x51}, - {0x8626, 0x12}, - {0x8627, 0x09}, - {0x8628, 0x23}, - {0x8629, 0x78}, - {0x862a, 0x67}, - {0x862b, 0x12}, - {0x862c, 0x04}, - {0x862d, 0x53}, - {0x862e, 0xe4}, - {0x862f, 0xfd}, - {0x8630, 0x78}, - {0x8631, 0x5e}, - {0x8632, 0x12}, - {0x8633, 0x09}, - {0x8634, 0x3c}, - {0x8635, 0x24}, - {0x8636, 0x01}, - {0x8637, 0x12}, - {0x8638, 0x09}, - {0x8639, 0x05}, - {0x863a, 0x78}, - {0x863b, 0x62}, - {0x863c, 0x12}, - {0x863d, 0x09}, - {0x863e, 0x3c}, - {0x863f, 0x24}, - {0x8640, 0x02}, - {0x8641, 0x12}, - {0x8642, 0x09}, - {0x8643, 0x05}, - {0x8644, 0x78}, - {0x8645, 0x66}, - {0x8646, 0x12}, - {0x8647, 0x09}, - {0x8648, 0x3c}, - {0x8649, 0x24}, - {0x864a, 0x03}, - {0x864b, 0x12}, - {0x864c, 0x09}, - {0x864d, 0x05}, - {0x864e, 0x78}, - {0x864f, 0x6a}, - {0x8650, 0x12}, - {0x8651, 0x09}, - {0x8652, 0x3c}, - {0x8653, 0x24}, - {0x8654, 0x04}, - {0x8655, 0x12}, - {0x8656, 0x09}, - {0x8657, 0x05}, - {0x8658, 0x0d}, - {0x8659, 0xbd}, - {0x865a, 0x05}, - {0x865b, 0xd4}, - {0x865c, 0xc2}, - {0x865d, 0x0e}, - {0x865e, 0xc2}, - {0x865f, 0x06}, - {0x8660, 0x22}, - {0x8661, 0x85}, - {0x8662, 0x08}, - {0x8663, 0x41}, - {0x8664, 0x90}, - {0x8665, 0x30}, - {0x8666, 0x24}, - {0x8667, 0xe0}, - {0x8668, 0xf5}, - {0x8669, 0x3d}, - {0x866a, 0xa3}, - {0x866b, 0xe0}, - {0x866c, 0xf5}, - {0x866d, 0x3e}, - {0x866e, 0xa3}, - {0x866f, 0xe0}, - {0x8670, 0xf5}, - {0x8671, 0x3f}, - {0x8672, 0xa3}, - {0x8673, 0xe0}, - {0x8674, 0xf5}, - {0x8675, 0x40}, - {0x8676, 0xa3}, - {0x8677, 0xe0}, - {0x8678, 0xf5}, - {0x8679, 0x3c}, - {0x867a, 0xd2}, - {0x867b, 0x33}, - {0x867c, 0xe5}, - {0x867d, 0x41}, - {0x867e, 0x12}, - {0x867f, 0x04}, - {0x8680, 0x6b}, - {0x8681, 0x06}, - {0x8682, 0xbe}, - {0x8683, 0x03}, - {0x8684, 0x06}, - {0x8685, 0xc2}, - {0x8686, 0x04}, - {0x8687, 0x06}, - {0x8688, 0xc8}, - {0x8689, 0x07}, - {0x868a, 0x06}, - {0x868b, 0xd1}, - {0x868c, 0x08}, - {0x868d, 0x06}, - {0x868e, 0xe2}, - {0x868f, 0x12}, - {0x8690, 0x06}, - {0x8691, 0xfd}, - {0x8692, 0x18}, - {0x8693, 0x07}, - {0x8694, 0x13}, - {0x8695, 0x19}, - {0x8696, 0x06}, - {0x8697, 0xe8}, - {0x8698, 0x1a}, - {0x8699, 0x06}, - {0x869a, 0xf4}, - {0x869b, 0x1b}, - {0x869c, 0x07}, - {0x869d, 0x37}, - {0x869e, 0x80}, - {0x869f, 0x07}, - {0x86a0, 0x3a}, - {0x86a1, 0x81}, - {0x86a2, 0x07}, - {0x86a3, 0x95}, - {0x86a4, 0x8f}, - {0x86a5, 0x07}, - {0x86a6, 0x84}, - {0x86a7, 0x90}, - {0x86a8, 0x07}, - {0x86a9, 0x95}, - {0x86aa, 0x91}, - {0x86ab, 0x07}, - {0x86ac, 0x95}, - {0x86ad, 0x92}, - {0x86ae, 0x07}, - {0x86af, 0x95}, - {0x86b0, 0x93}, - {0x86b1, 0x07}, - {0x86b2, 0x95}, - {0x86b3, 0x94}, - {0x86b4, 0x07}, - {0x86b5, 0x95}, - {0x86b6, 0x98}, - {0x86b7, 0x07}, - {0x86b8, 0x92}, - {0x86b9, 0x9f}, - {0x86ba, 0x00}, - {0x86bb, 0x00}, - {0x86bc, 0x07}, - {0x86bd, 0xb0}, - {0x86be, 0x12}, - {0x86bf, 0x0a}, - {0x86c0, 0xe8}, - {0x86c1, 0x22}, - {0x86c2, 0x12}, - {0x86c3, 0x0a}, - {0x86c4, 0xe8}, - {0x86c5, 0xd2}, - {0x86c6, 0x03}, - {0x86c7, 0x22}, - {0x86c8, 0xa2}, - {0x86c9, 0x36}, - {0x86ca, 0xe4}, - {0x86cb, 0x33}, - {0x86cc, 0xf5}, - {0x86cd, 0x3c}, - {0x86ce, 0x02}, - {0x86cf, 0x07}, - {0x86d0, 0x95}, - {0x86d1, 0xc2}, - {0x86d2, 0x01}, - {0x86d3, 0xc2}, - {0x86d4, 0x02}, - {0x86d5, 0xc2}, - {0x86d6, 0x03}, - {0x86d7, 0x12}, - {0x86d8, 0x09}, - {0x86d9, 0x64}, - {0x86da, 0x75}, - {0x86db, 0x1e}, - {0x86dc, 0x70}, - {0x86dd, 0xd2}, - {0x86de, 0x34}, - {0x86df, 0x02}, - {0x86e0, 0x07}, - {0x86e1, 0x95}, - {0x86e2, 0x12}, - {0x86e3, 0x04}, - {0x86e4, 0x91}, - {0x86e5, 0x02}, - {0x86e6, 0x07}, - {0x86e7, 0x95}, - {0x86e8, 0x85}, - {0x86e9, 0x40}, - {0x86ea, 0x48}, - {0x86eb, 0x85}, - {0x86ec, 0x3c}, - {0x86ed, 0x49}, - {0x86ee, 0x12}, - {0x86ef, 0x08}, - {0x86f0, 0x4f}, - {0x86f1, 0x02}, - {0x86f2, 0x07}, - {0x86f3, 0x95}, - {0x86f4, 0x85}, - {0x86f5, 0x48}, - {0x86f6, 0x40}, - {0x86f7, 0x85}, - {0x86f8, 0x49}, - {0x86f9, 0x3c}, - {0x86fa, 0x02}, - {0x86fb, 0x07}, - {0x86fc, 0x95}, - {0x86fd, 0xe4}, - {0x86fe, 0xf5}, - {0x86ff, 0x22}, - {0x8700, 0xf5}, - {0x8701, 0x23}, - {0x8702, 0x85}, - {0x8703, 0x40}, - {0x8704, 0x31}, - {0x8705, 0x85}, - {0x8706, 0x3f}, - {0x8707, 0x30}, - {0x8708, 0x85}, - {0x8709, 0x3e}, - {0x870a, 0x2f}, - {0x870b, 0x85}, - {0x870c, 0x3d}, - {0x870d, 0x2e}, - {0x870e, 0x12}, - {0x870f, 0x0a}, - {0x8710, 0xba}, - {0x8711, 0x80}, - {0x8712, 0x1f}, - {0x8713, 0x75}, - {0x8714, 0x22}, - {0x8715, 0x00}, - {0x8716, 0x75}, - {0x8717, 0x23}, - {0x8718, 0x01}, - {0x8719, 0x74}, - {0x871a, 0xff}, - {0x871b, 0xf5}, - {0x871c, 0x2d}, - {0x871d, 0xf5}, - {0x871e, 0x2c}, - {0x871f, 0xf5}, - {0x8720, 0x2b}, - {0x8721, 0xf5}, - {0x8722, 0x2a}, - {0x8723, 0x12}, - {0x8724, 0x0a}, - {0x8725, 0xba}, - {0x8726, 0x85}, - {0x8727, 0x2d}, - {0x8728, 0x40}, - {0x8729, 0x85}, - {0x872a, 0x2c}, - {0x872b, 0x3f}, - {0x872c, 0x85}, - {0x872d, 0x2b}, - {0x872e, 0x3e}, - {0x872f, 0x85}, - {0x8730, 0x2a}, - {0x8731, 0x3d}, - {0x8732, 0xe4}, - {0x8733, 0xf5}, - {0x8734, 0x3c}, - {0x8735, 0x80}, - {0x8736, 0x5e}, - {0x8737, 0x02}, - {0x8738, 0x0b}, - {0x8739, 0x31}, - {0x873a, 0x85}, - {0x873b, 0x3d}, - {0x873c, 0x43}, - {0x873d, 0x85}, - {0x873e, 0x3e}, - {0x873f, 0x44}, - {0x8740, 0xe5}, - {0x8741, 0x45}, - {0x8742, 0xc3}, - {0x8743, 0x13}, - {0x8744, 0xff}, - {0x8745, 0xe5}, - {0x8746, 0x43}, - {0x8747, 0xc3}, - {0x8748, 0x9f}, - {0x8749, 0x50}, - {0x874a, 0x02}, - {0x874b, 0x8f}, - {0x874c, 0x43}, - {0x874d, 0xe5}, - {0x874e, 0x46}, - {0x874f, 0xc3}, - {0x8750, 0x13}, - {0x8751, 0xff}, - {0x8752, 0xe5}, - {0x8753, 0x44}, - {0x8754, 0xc3}, - {0x8755, 0x9f}, - {0x8756, 0x50}, - {0x8757, 0x02}, - {0x8758, 0x8f}, - {0x8759, 0x44}, - {0x875a, 0xe5}, - {0x875b, 0x45}, - {0x875c, 0xc3}, - {0x875d, 0x13}, - {0x875e, 0xff}, - {0x875f, 0xfd}, - {0x8760, 0xe5}, - {0x8761, 0x43}, - {0x8762, 0x90}, - {0x8763, 0x0e}, - {0x8764, 0x7f}, - {0x8765, 0x12}, - {0x8766, 0x0b}, - {0x8767, 0x04}, - {0x8768, 0x40}, - {0x8769, 0x04}, - {0x876a, 0xee}, - {0x876b, 0x9f}, - {0x876c, 0xf5}, - {0x876d, 0x43}, - {0x876e, 0xe5}, - {0x876f, 0x46}, - {0x8770, 0xc3}, - {0x8771, 0x13}, - {0x8772, 0xff}, - {0x8773, 0xfd}, - {0x8774, 0xe5}, - {0x8775, 0x44}, - {0x8776, 0x90}, - {0x8777, 0x0e}, - {0x8778, 0x80}, - {0x8779, 0x12}, - {0x877a, 0x0b}, - {0x877b, 0x04}, - {0x877c, 0x40}, - {0x877d, 0x14}, - {0x877e, 0xee}, - {0x877f, 0x9f}, - {0x8780, 0xf5}, - {0x8781, 0x44}, - {0x8782, 0x80}, - {0x8783, 0x0e}, - {0x8784, 0x85}, - {0x8785, 0x40}, - {0x8786, 0x46}, - {0x8787, 0x85}, - {0x8788, 0x3f}, - {0x8789, 0x45}, - {0x878a, 0x85}, - {0x878b, 0x3e}, - {0x878c, 0x44}, - {0x878d, 0x85}, - {0x878e, 0x3d}, - {0x878f, 0x43}, - {0x8790, 0x80}, - {0x8791, 0x03}, - {0x8792, 0x02}, - {0x8793, 0x04}, - {0x8794, 0x91}, - {0x8795, 0x90}, - {0x8796, 0x30}, - {0x8797, 0x24}, - {0x8798, 0xe5}, - {0x8799, 0x3d}, - {0x879a, 0xf0}, - {0x879b, 0xa3}, - {0x879c, 0xe5}, - {0x879d, 0x3e}, - {0x879e, 0xf0}, - {0x879f, 0xa3}, - {0x87a0, 0xe5}, - {0x87a1, 0x3f}, - {0x87a2, 0xf0}, - {0x87a3, 0xa3}, - {0x87a4, 0xe5}, - {0x87a5, 0x40}, - {0x87a6, 0xf0}, - {0x87a7, 0xa3}, - {0x87a8, 0xe5}, - {0x87a9, 0x3c}, - {0x87aa, 0xf0}, - {0x87ab, 0x90}, - {0x87ac, 0x30}, - {0x87ad, 0x23}, - {0x87ae, 0xe4}, - {0x87af, 0xf0}, - {0x87b0, 0x22}, - {0x87b1, 0xc0}, - {0x87b2, 0xe0}, - {0x87b3, 0xc0}, - {0x87b4, 0x83}, - {0x87b5, 0xc0}, - {0x87b6, 0x82}, - {0x87b7, 0xc0}, - {0x87b8, 0xd0}, - {0x87b9, 0x90}, - {0x87ba, 0x3f}, - {0x87bb, 0x0c}, - {0x87bc, 0xe0}, - {0x87bd, 0xf5}, - {0x87be, 0x32}, - {0x87bf, 0xe5}, - {0x87c0, 0x32}, - {0x87c1, 0x30}, - {0x87c2, 0xe3}, - {0x87c3, 0x4c}, - {0x87c4, 0x30}, - {0x87c5, 0x35}, - {0x87c6, 0x3e}, - {0x87c7, 0x90}, - {0x87c8, 0x60}, - {0x87c9, 0x19}, - {0x87ca, 0xe0}, - {0x87cb, 0xf5}, - {0x87cc, 0x0a}, - {0x87cd, 0xa3}, - {0x87ce, 0xe0}, - {0x87cf, 0xf5}, - {0x87d0, 0x0b}, - {0x87d1, 0x90}, - {0x87d2, 0x60}, - {0x87d3, 0x1d}, - {0x87d4, 0xe0}, - {0x87d5, 0xf5}, - {0x87d6, 0x14}, - {0x87d7, 0xa3}, - {0x87d8, 0xe0}, - {0x87d9, 0xf5}, - {0x87da, 0x15}, - {0x87db, 0x30}, - {0x87dc, 0x01}, - {0x87dd, 0x06}, - {0x87de, 0x30}, - {0x87df, 0x32}, - {0x87e0, 0x03}, - {0x87e1, 0xd3}, - {0x87e2, 0x80}, - {0x87e3, 0x01}, - {0x87e4, 0xc3}, - {0x87e5, 0x92}, - {0x87e6, 0x09}, - {0x87e7, 0x30}, - {0x87e8, 0x02}, - {0x87e9, 0x06}, - {0x87ea, 0x30}, - {0x87eb, 0x32}, - {0x87ec, 0x03}, - {0x87ed, 0xd3}, - {0x87ee, 0x80}, - {0x87ef, 0x01}, - {0x87f0, 0xc3}, - {0x87f1, 0x92}, - {0x87f2, 0x0a}, - {0x87f3, 0x30}, - {0x87f4, 0x32}, - {0x87f5, 0x0c}, - {0x87f6, 0x30}, - {0x87f7, 0x03}, - {0x87f8, 0x09}, - {0x87f9, 0x20}, - {0x87fa, 0x02}, - {0x87fb, 0x06}, - {0x87fc, 0x20}, - {0x87fd, 0x01}, - {0x87fe, 0x03}, - {0x87ff, 0xd3}, - {0x8800, 0x80}, - {0x8801, 0x01}, - {0x8802, 0xc3}, - {0x8803, 0x92}, - {0x8804, 0x0b}, - {0x8805, 0x90}, - {0x8806, 0x30}, - {0x8807, 0x01}, - {0x8808, 0xe0}, - {0x8809, 0x44}, - {0x880a, 0x40}, - {0x880b, 0xf0}, - {0x880c, 0xe0}, - {0x880d, 0x54}, - {0x880e, 0xbf}, - {0x880f, 0xf0}, - {0x8810, 0xe5}, - {0x8811, 0x32}, - {0x8812, 0x30}, - {0x8813, 0xe1}, - {0x8814, 0x14}, - {0x8815, 0x30}, - {0x8816, 0x33}, - {0x8817, 0x11}, - {0x8818, 0x90}, - {0x8819, 0x30}, - {0x881a, 0x22}, - {0x881b, 0xe0}, - {0x881c, 0xf5}, - {0x881d, 0x08}, - {0x881e, 0xe4}, - {0x881f, 0xf0}, - {0x8820, 0x30}, - {0x8821, 0x00}, - {0x8822, 0x03}, - {0x8823, 0xd3}, - {0x8824, 0x80}, - {0x8825, 0x01}, - {0x8826, 0xc3}, - {0x8827, 0x92}, - {0x8828, 0x08}, - {0x8829, 0xe5}, - {0x882a, 0x32}, - {0x882b, 0x30}, - {0x882c, 0xe5}, - {0x882d, 0x12}, - {0x882e, 0x90}, - {0x882f, 0x56}, - {0x8830, 0x90}, - {0x8831, 0xe0}, - {0x8832, 0xf5}, - {0x8833, 0x09}, - {0x8834, 0x30}, - {0x8835, 0x30}, - {0x8836, 0x09}, - {0x8837, 0x30}, - {0x8838, 0x05}, - {0x8839, 0x03}, - {0x883a, 0xd3}, - {0x883b, 0x80}, - {0x883c, 0x01}, - {0x883d, 0xc3}, - {0x883e, 0x92}, - {0x883f, 0x0d}, - {0x8840, 0x90}, - {0x8841, 0x3f}, - {0x8842, 0x0c}, - {0x8843, 0xe5}, - {0x8844, 0x32}, - {0x8845, 0xf0}, - {0x8846, 0xd0}, - {0x8847, 0xd0}, - {0x8848, 0xd0}, - {0x8849, 0x82}, - {0x884a, 0xd0}, - {0x884b, 0x83}, - {0x884c, 0xd0}, - {0x884d, 0xe0}, - {0x884e, 0x32}, - {0x884f, 0x90}, - {0x8850, 0x0e}, - {0x8851, 0x7d}, - {0x8852, 0xe4}, - {0x8853, 0x93}, - {0x8854, 0xfe}, - {0x8855, 0x74}, - {0x8856, 0x01}, - {0x8857, 0x93}, - {0x8858, 0xff}, - {0x8859, 0xc3}, - {0x885a, 0x90}, - {0x885b, 0x0e}, - {0x885c, 0x7b}, - {0x885d, 0x74}, - {0x885e, 0x01}, - {0x885f, 0x93}, - {0x8860, 0x9f}, - {0x8861, 0xff}, - {0x8862, 0xe4}, - {0x8863, 0x93}, - {0x8864, 0x9e}, - {0x8865, 0xfe}, - {0x8866, 0xe4}, - {0x8867, 0x8f}, - {0x8868, 0x3b}, - {0x8869, 0x8e}, - {0x886a, 0x3a}, - {0x886b, 0xf5}, - {0x886c, 0x39}, - {0x886d, 0xf5}, - {0x886e, 0x38}, - {0x886f, 0xab}, - {0x8870, 0x3b}, - {0x8871, 0xaa}, - {0x8872, 0x3a}, - {0x8873, 0xa9}, - {0x8874, 0x39}, - {0x8875, 0xa8}, - {0x8876, 0x38}, - {0x8877, 0xaf}, - {0x8878, 0x49}, - {0x8879, 0xfc}, - {0x887a, 0xfd}, - {0x887b, 0xfe}, - {0x887c, 0x12}, - {0x887d, 0x02}, - {0x887e, 0xf5}, - {0x887f, 0x12}, - {0x8880, 0x0b}, - {0x8881, 0x16}, - {0x8882, 0xe4}, - {0x8883, 0x7b}, - {0x8884, 0xff}, - {0x8885, 0xfa}, - {0x8886, 0xf9}, - {0x8887, 0xf8}, - {0x8888, 0x12}, - {0x8889, 0x03}, - {0x888a, 0x80}, - {0x888b, 0x12}, - {0x888c, 0x0b}, - {0x888d, 0x16}, - {0x888e, 0x90}, - {0x888f, 0x0e}, - {0x8890, 0x69}, - {0x8891, 0xe4}, - {0x8892, 0x12}, - {0x8893, 0x0b}, - {0x8894, 0x2b}, - {0x8895, 0x12}, - {0x8896, 0x0b}, - {0x8897, 0x16}, - {0x8898, 0xe4}, - {0x8899, 0x85}, - {0x889a, 0x48}, - {0x889b, 0x37}, - {0x889c, 0xf5}, - {0x889d, 0x36}, - {0x889e, 0xf5}, - {0x889f, 0x35}, - {0x88a0, 0xf5}, - {0x88a1, 0x34}, - {0x88a2, 0xaf}, - {0x88a3, 0x37}, - {0x88a4, 0xae}, - {0x88a5, 0x36}, - {0x88a6, 0xad}, - {0x88a7, 0x35}, - {0x88a8, 0xac}, - {0x88a9, 0x34}, - {0x88aa, 0xa3}, - {0x88ab, 0x12}, - {0x88ac, 0x0b}, - {0x88ad, 0x2b}, - {0x88ae, 0x8f}, - {0x88af, 0x37}, - {0x88b0, 0x8e}, - {0x88b1, 0x36}, - {0x88b2, 0x8d}, - {0x88b3, 0x35}, - {0x88b4, 0x8c}, - {0x88b5, 0x34}, - {0x88b6, 0xe5}, - {0x88b7, 0x3b}, - {0x88b8, 0x45}, - {0x88b9, 0x37}, - {0x88ba, 0xf5}, - {0x88bb, 0x3b}, - {0x88bc, 0xe5}, - {0x88bd, 0x3a}, - {0x88be, 0x45}, - {0x88bf, 0x36}, - {0x88c0, 0xf5}, - {0x88c1, 0x3a}, - {0x88c2, 0xe5}, - {0x88c3, 0x39}, - {0x88c4, 0x45}, - {0x88c5, 0x35}, - {0x88c6, 0xf5}, - {0x88c7, 0x39}, - {0x88c8, 0xe5}, - {0x88c9, 0x38}, - {0x88ca, 0x45}, - {0x88cb, 0x34}, - {0x88cc, 0xf5}, - {0x88cd, 0x38}, - {0x88ce, 0xe4}, - {0x88cf, 0xf5}, - {0x88d0, 0x22}, - {0x88d1, 0xf5}, - {0x88d2, 0x23}, - {0x88d3, 0x85}, - {0x88d4, 0x3b}, - {0x88d5, 0x31}, - {0x88d6, 0x85}, - {0x88d7, 0x3a}, - {0x88d8, 0x30}, - {0x88d9, 0x85}, - {0x88da, 0x39}, - {0x88db, 0x2f}, - {0x88dc, 0x85}, - {0x88dd, 0x38}, - {0x88de, 0x2e}, - {0x88df, 0x02}, - {0x88e0, 0x0a}, - {0x88e1, 0xba}, - {0x88e2, 0x78}, - {0x88e3, 0x4f}, - {0x88e4, 0x7e}, - {0x88e5, 0x00}, - {0x88e6, 0xe6}, - {0x88e7, 0xfc}, - {0x88e8, 0x08}, - {0x88e9, 0xe6}, - {0x88ea, 0xfd}, - {0x88eb, 0x12}, - {0x88ec, 0x02}, - {0x88ed, 0x8e}, - {0x88ee, 0x7c}, - {0x88ef, 0x00}, - {0x88f0, 0x22}, - {0x88f1, 0xe0}, - {0x88f2, 0xa3}, - {0x88f3, 0xe0}, - {0x88f4, 0x75}, - {0x88f5, 0xf0}, - {0x88f6, 0x02}, - {0x88f7, 0xa4}, - {0x88f8, 0xff}, - {0x88f9, 0xae}, - {0x88fa, 0xf0}, - {0x88fb, 0xc3}, - {0x88fc, 0x08}, - {0x88fd, 0xe6}, - {0x88fe, 0x9f}, - {0x88ff, 0xf6}, - {0x8900, 0x18}, - {0x8901, 0xe6}, - {0x8902, 0x9e}, - {0x8903, 0xf6}, - {0x8904, 0x22}, - {0x8905, 0xff}, - {0x8906, 0xe5}, - {0x8907, 0xf0}, - {0x8908, 0x34}, - {0x8909, 0x60}, - {0x890a, 0x8f}, - {0x890b, 0x82}, - {0x890c, 0xf5}, - {0x890d, 0x83}, - {0x890e, 0xec}, - {0x890f, 0xf0}, - {0x8910, 0x22}, - {0x8911, 0xe4}, - {0x8912, 0xfc}, - {0x8913, 0xfd}, - {0x8914, 0x12}, - {0x8915, 0x04}, - {0x8916, 0x53}, - {0x8917, 0x78}, - {0x8918, 0x59}, - {0x8919, 0xe6}, - {0x891a, 0xc3}, - {0x891b, 0x13}, - {0x891c, 0xfe}, - {0x891d, 0x08}, - {0x891e, 0xe6}, - {0x891f, 0x13}, - {0x8920, 0x22}, - {0x8921, 0x78}, - {0x8922, 0x4f}, - {0x8923, 0xe6}, - {0x8924, 0xfe}, - {0x8925, 0x08}, - {0x8926, 0xe6}, - {0x8927, 0xff}, - {0x8928, 0xe4}, - {0x8929, 0xfc}, - {0x892a, 0xfd}, - {0x892b, 0x22}, - {0x892c, 0xe7}, - {0x892d, 0xc4}, - {0x892e, 0xf8}, - {0x892f, 0x54}, - {0x8930, 0xf0}, - {0x8931, 0xc8}, - {0x8932, 0x68}, - {0x8933, 0xf7}, - {0x8934, 0x09}, - {0x8935, 0xe7}, - {0x8936, 0xc4}, - {0x8937, 0x54}, - {0x8938, 0x0f}, - {0x8939, 0x48}, - {0x893a, 0xf7}, - {0x893b, 0x22}, - {0x893c, 0xe6}, - {0x893d, 0xfc}, - {0x893e, 0xed}, - {0x893f, 0x75}, - {0x8940, 0xf0}, - {0x8941, 0x04}, - {0x8942, 0xa4}, - {0x8943, 0x22}, - {0x8944, 0xe0}, - {0x8945, 0xfe}, - {0x8946, 0xa3}, - {0x8947, 0xe0}, - {0x8948, 0xfd}, - {0x8949, 0xee}, - {0x894a, 0xf6}, - {0x894b, 0xed}, - {0x894c, 0x08}, - {0x894d, 0xf6}, - {0x894e, 0x22}, - {0x894f, 0x13}, - {0x8950, 0xff}, - {0x8951, 0xc3}, - {0x8952, 0xe6}, - {0x8953, 0x9f}, - {0x8954, 0xff}, - {0x8955, 0x18}, - {0x8956, 0xe6}, - {0x8957, 0x9e}, - {0x8958, 0xfe}, - {0x8959, 0x22}, - {0x895a, 0xe6}, - {0x895b, 0xc3}, - {0x895c, 0x13}, - {0x895d, 0xf7}, - {0x895e, 0x08}, - {0x895f, 0xe6}, - {0x8960, 0x13}, - {0x8961, 0x09}, - {0x8962, 0xf7}, - {0x8963, 0x22}, - {0x8964, 0xe4}, - {0x8965, 0xf5}, - {0x8966, 0x49}, - {0x8967, 0x90}, - {0x8968, 0x0e}, - {0x8969, 0x77}, - {0x896a, 0x93}, - {0x896b, 0xff}, - {0x896c, 0xe4}, - {0x896d, 0x8f}, - {0x896e, 0x37}, - {0x896f, 0xf5}, - {0x8970, 0x36}, - {0x8971, 0xf5}, - {0x8972, 0x35}, - {0x8973, 0xf5}, - {0x8974, 0x34}, - {0x8975, 0xaf}, - {0x8976, 0x37}, - {0x8977, 0xae}, - {0x8978, 0x36}, - {0x8979, 0xad}, - {0x897a, 0x35}, - {0x897b, 0xac}, - {0x897c, 0x34}, - {0x897d, 0x90}, - {0x897e, 0x0e}, - {0x897f, 0x6a}, - {0x8980, 0x12}, - {0x8981, 0x0b}, - {0x8982, 0x2b}, - {0x8983, 0x8f}, - {0x8984, 0x37}, - {0x8985, 0x8e}, - {0x8986, 0x36}, - {0x8987, 0x8d}, - {0x8988, 0x35}, - {0x8989, 0x8c}, - {0x898a, 0x34}, - {0x898b, 0x90}, - {0x898c, 0x0e}, - {0x898d, 0x72}, - {0x898e, 0x12}, - {0x898f, 0x04}, - {0x8990, 0x36}, - {0x8991, 0xef}, - {0x8992, 0x45}, - {0x8993, 0x37}, - {0x8994, 0xf5}, - {0x8995, 0x37}, - {0x8996, 0xee}, - {0x8997, 0x45}, - {0x8998, 0x36}, - {0x8999, 0xf5}, - {0x899a, 0x36}, - {0x899b, 0xed}, - {0x899c, 0x45}, - {0x899d, 0x35}, - {0x899e, 0xf5}, - {0x899f, 0x35}, - {0x89a0, 0xec}, - {0x89a1, 0x45}, - {0x89a2, 0x34}, - {0x89a3, 0xf5}, - {0x89a4, 0x34}, - {0x89a5, 0xe4}, - {0x89a6, 0xf5}, - {0x89a7, 0x22}, - {0x89a8, 0xf5}, - {0x89a9, 0x23}, - {0x89aa, 0x85}, - {0x89ab, 0x37}, - {0x89ac, 0x31}, - {0x89ad, 0x85}, - {0x89ae, 0x36}, - {0x89af, 0x30}, - {0x89b0, 0x85}, - {0x89b1, 0x35}, - {0x89b2, 0x2f}, - {0x89b3, 0x85}, - {0x89b4, 0x34}, - {0x89b5, 0x2e}, - {0x89b6, 0x12}, - {0x89b7, 0x0a}, - {0x89b8, 0xba}, - {0x89b9, 0xe4}, - {0x89ba, 0xf5}, - {0x89bb, 0x22}, - {0x89bc, 0xf5}, - {0x89bd, 0x23}, - {0x89be, 0x90}, - {0x89bf, 0x0e}, - {0x89c0, 0x72}, - {0x89c1, 0x12}, - {0x89c2, 0x0b}, - {0x89c3, 0x1f}, - {0x89c4, 0x12}, - {0x89c5, 0x0a}, - {0x89c6, 0xba}, - {0x89c7, 0xe4}, - {0x89c8, 0xf5}, - {0x89c9, 0x22}, - {0x89ca, 0xf5}, - {0x89cb, 0x23}, - {0x89cc, 0x90}, - {0x89cd, 0x0e}, - {0x89ce, 0x6e}, - {0x89cf, 0x12}, - {0x89d0, 0x0b}, - {0x89d1, 0x1f}, - {0x89d2, 0x02}, - {0x89d3, 0x0a}, - {0x89d4, 0xba}, - {0x89d5, 0x75}, - {0x89d6, 0x89}, - {0x89d7, 0x03}, - {0x89d8, 0x75}, - {0x89d9, 0xa8}, - {0x89da, 0x01}, - {0x89db, 0x75}, - {0x89dc, 0xb8}, - {0x89dd, 0x04}, - {0x89de, 0x75}, - {0x89df, 0x34}, - {0x89e0, 0xff}, - {0x89e1, 0x75}, - {0x89e2, 0x35}, - {0x89e3, 0x0e}, - {0x89e4, 0x75}, - {0x89e5, 0x36}, - {0x89e6, 0x15}, - {0x89e7, 0x75}, - {0x89e8, 0x37}, - {0x89e9, 0x0d}, - {0x89ea, 0x12}, - {0x89eb, 0x0a}, - {0x89ec, 0x3e}, - {0x89ed, 0x12}, - {0x89ee, 0x00}, - {0x89ef, 0x09}, - {0x89f0, 0x12}, - {0x89f1, 0x0b}, - {0x89f2, 0x31}, - {0x89f3, 0x12}, - {0x89f4, 0x00}, - {0x89f5, 0x06}, - {0x89f6, 0xd2}, - {0x89f7, 0x00}, - {0x89f8, 0xd2}, - {0x89f9, 0x33}, - {0x89fa, 0xd2}, - {0x89fb, 0xaf}, - {0x89fc, 0x75}, - {0x89fd, 0x34}, - {0x89fe, 0xff}, - {0x89ff, 0x75}, - {0x8a00, 0x35}, - {0x8a01, 0x0e}, - {0x8a02, 0x75}, - {0x8a03, 0x36}, - {0x8a04, 0x49}, - {0x8a05, 0x75}, - {0x8a06, 0x37}, - {0x8a07, 0x03}, - {0x8a08, 0x12}, - {0x8a09, 0x0a}, - {0x8a0a, 0x3e}, - {0x8a0b, 0x30}, - {0x8a0c, 0x08}, - {0x8a0d, 0x09}, - {0x8a0e, 0xc2}, - {0x8a0f, 0x33}, - {0x8a10, 0x12}, - {0x8a11, 0x06}, - {0x8a12, 0x61}, - {0x8a13, 0xc2}, - {0x8a14, 0x08}, - {0x8a15, 0xd2}, - {0x8a16, 0x33}, - {0x8a17, 0x30}, - {0x8a18, 0x09}, - {0x8a19, 0x09}, - {0x8a1a, 0xc2}, - {0x8a1b, 0x35}, - {0x8a1c, 0x12}, - {0x8a1d, 0x00}, - {0x8a1e, 0x0e}, - {0x8a1f, 0xc2}, - {0x8a20, 0x09}, - {0x8a21, 0xd2}, - {0x8a22, 0x35}, - {0x8a23, 0x30}, - {0x8a24, 0x0e}, - {0x8a25, 0x03}, - {0x8a26, 0x12}, - {0x8a27, 0x04}, - {0x8a28, 0x91}, - {0x8a29, 0x30}, - {0x8a2a, 0x34}, - {0x8a2b, 0xdf}, - {0x8a2c, 0x90}, - {0x8a2d, 0x30}, - {0x8a2e, 0x29}, - {0x8a2f, 0xe5}, - {0x8a30, 0x1e}, - {0x8a31, 0xf0}, - {0x8a32, 0xb4}, - {0x8a33, 0x10}, - {0x8a34, 0x05}, - {0x8a35, 0x90}, - {0x8a36, 0x30}, - {0x8a37, 0x23}, - {0x8a38, 0xe4}, - {0x8a39, 0xf0}, - {0x8a3a, 0xc2}, - {0x8a3b, 0x34}, - {0x8a3c, 0x80}, - {0x8a3d, 0xcd}, - {0x8a3e, 0xae}, - {0x8a3f, 0x35}, - {0x8a40, 0xaf}, - {0x8a41, 0x36}, - {0x8a42, 0xe4}, - {0x8a43, 0xfd}, - {0x8a44, 0xed}, - {0x8a45, 0xc3}, - {0x8a46, 0x95}, - {0x8a47, 0x37}, - {0x8a48, 0x50}, - {0x8a49, 0x33}, - {0x8a4a, 0x12}, - {0x8a4b, 0x0b}, - {0x8a4c, 0x78}, - {0x8a4d, 0xe4}, - {0x8a4e, 0x93}, - {0x8a4f, 0xf5}, - {0x8a50, 0x38}, - {0x8a51, 0x74}, - {0x8a52, 0x01}, - {0x8a53, 0x93}, - {0x8a54, 0xf5}, - {0x8a55, 0x39}, - {0x8a56, 0x45}, - {0x8a57, 0x38}, - {0x8a58, 0x60}, - {0x8a59, 0x23}, - {0x8a5a, 0x85}, - {0x8a5b, 0x39}, - {0x8a5c, 0x82}, - {0x8a5d, 0x85}, - {0x8a5e, 0x38}, - {0x8a5f, 0x83}, - {0x8a60, 0xe0}, - {0x8a61, 0xfc}, - {0x8a62, 0x12}, - {0x8a63, 0x0b}, - {0x8a64, 0x78}, - {0x8a65, 0x74}, - {0x8a66, 0x03}, - {0x8a67, 0x93}, - {0x8a68, 0x52}, - {0x8a69, 0x04}, - {0x8a6a, 0x12}, - {0x8a6b, 0x0b}, - {0x8a6c, 0x78}, - {0x8a6d, 0x74}, - {0x8a6e, 0x02}, - {0x8a6f, 0x93}, - {0x8a70, 0x42}, - {0x8a71, 0x04}, - {0x8a72, 0x85}, - {0x8a73, 0x39}, - {0x8a74, 0x82}, - {0x8a75, 0x85}, - {0x8a76, 0x38}, - {0x8a77, 0x83}, - {0x8a78, 0xec}, - {0x8a79, 0xf0}, - {0x8a7a, 0x0d}, - {0x8a7b, 0x80}, - {0x8a7c, 0xc7}, - {0x8a7d, 0x22}, - {0x8a7e, 0x78}, - {0x8a7f, 0xbb}, - {0x8a80, 0xe6}, - {0x8a81, 0xd3}, - {0x8a82, 0x08}, - {0x8a83, 0xff}, - {0x8a84, 0xe6}, - {0x8a85, 0x64}, - {0x8a86, 0x80}, - {0x8a87, 0xf8}, - {0x8a88, 0xef}, - {0x8a89, 0x64}, - {0x8a8a, 0x80}, - {0x8a8b, 0x98}, - {0x8a8c, 0x22}, - {0x8a8d, 0x93}, - {0x8a8e, 0xff}, - {0x8a8f, 0x7e}, - {0x8a90, 0x00}, - {0x8a91, 0xe6}, - {0x8a92, 0xfc}, - {0x8a93, 0x08}, - {0x8a94, 0xe6}, - {0x8a95, 0xfd}, - {0x8a96, 0x12}, - {0x8a97, 0x02}, - {0x8a98, 0x8e}, - {0x8a99, 0x78}, - {0x8a9a, 0xbe}, - {0x8a9b, 0xe6}, - {0x8a9c, 0xfc}, - {0x8a9d, 0x08}, - {0x8a9e, 0xe6}, - {0x8a9f, 0xfd}, - {0x8aa0, 0xd3}, - {0x8aa1, 0xef}, - {0x8aa2, 0x9d}, - {0x8aa3, 0xee}, - {0x8aa4, 0x9c}, - {0x8aa5, 0x22}, - {0x8aa6, 0x78}, - {0x8aa7, 0xba}, - {0x8aa8, 0xd3}, - {0x8aa9, 0xe6}, - {0x8aaa, 0x64}, - {0x8aab, 0x80}, - {0x8aac, 0x94}, - {0x8aad, 0x80}, - {0x8aae, 0x22}, - {0x8aaf, 0x25}, - {0x8ab0, 0xe0}, - {0x8ab1, 0x24}, - {0x8ab2, 0x0a}, - {0x8ab3, 0xf8}, - {0x8ab4, 0xe6}, - {0x8ab5, 0xfe}, - {0x8ab6, 0x08}, - {0x8ab7, 0xe6}, - {0x8ab8, 0xff}, - {0x8ab9, 0x22}, - {0x8aba, 0xa2}, - {0x8abb, 0xaf}, - {0x8abc, 0x92}, - {0x8abd, 0x31}, - {0x8abe, 0xc2}, - {0x8abf, 0xaf}, - {0x8ac0, 0xe5}, - {0x8ac1, 0x23}, - {0x8ac2, 0x45}, - {0x8ac3, 0x22}, - {0x8ac4, 0x90}, - {0x8ac5, 0x0e}, - {0x8ac6, 0x5d}, - {0x8ac7, 0x60}, - {0x8ac8, 0x0b}, - {0x8ac9, 0x12}, - {0x8aca, 0x0b}, - {0x8acb, 0x6d}, - {0x8acc, 0xe0}, - {0x8acd, 0xf5}, - {0x8ace, 0x2c}, - {0x8acf, 0xe0}, - {0x8ad0, 0xf5}, - {0x8ad1, 0x2d}, - {0x8ad2, 0x80}, - {0x8ad3, 0x0f}, - {0x8ad4, 0x12}, - {0x8ad5, 0x0b}, - {0x8ad6, 0x6d}, - {0x8ad7, 0xe5}, - {0x8ad8, 0x30}, - {0x8ad9, 0xf0}, - {0x8ada, 0x90}, - {0x8adb, 0x0e}, - {0x8adc, 0x5f}, - {0x8add, 0x12}, - {0x8ade, 0x0b}, - {0x8adf, 0x6d}, - {0x8ae0, 0xe5}, - {0x8ae1, 0x31}, - {0x8ae2, 0xf0}, - {0x8ae3, 0xa2}, - {0x8ae4, 0x31}, - {0x8ae5, 0x92}, - {0x8ae6, 0xaf}, - {0x8ae7, 0x22}, - {0x8ae8, 0xd2}, - {0x8ae9, 0x01}, - {0x8aea, 0xc2}, - {0x8aeb, 0x02}, - {0x8aec, 0xe4}, - {0x8aed, 0xf5}, - {0x8aee, 0x1f}, - {0x8aef, 0xf5}, - {0x8af0, 0x1e}, - {0x8af1, 0xd2}, - {0x8af2, 0x34}, - {0x8af3, 0xd2}, - {0x8af4, 0x32}, - {0x8af5, 0xd2}, - {0x8af6, 0x35}, - {0x8af7, 0xd2}, - {0x8af8, 0x01}, - {0x8af9, 0xc2}, - {0x8afa, 0x02}, - {0x8afb, 0xf5}, - {0x8afc, 0x1f}, - {0x8afd, 0xf5}, - {0x8afe, 0x1e}, - {0x8aff, 0xd2}, - {0x8b00, 0x34}, - {0x8b01, 0xd2}, - {0x8b02, 0x32}, - {0x8b03, 0x22}, - {0x8b04, 0x2d}, - {0x8b05, 0xfd}, - {0x8b06, 0xe4}, - {0x8b07, 0x33}, - {0x8b08, 0xfc}, - {0x8b09, 0xe4}, - {0x8b0a, 0x93}, - {0x8b0b, 0xfe}, - {0x8b0c, 0xfb}, - {0x8b0d, 0xd3}, - {0x8b0e, 0xed}, - {0x8b0f, 0x9b}, - {0x8b10, 0x74}, - {0x8b11, 0x80}, - {0x8b12, 0xf8}, - {0x8b13, 0x6c}, - {0x8b14, 0x98}, - {0x8b15, 0x22}, - {0x8b16, 0x8f}, - {0x8b17, 0x3b}, - {0x8b18, 0x8e}, - {0x8b19, 0x3a}, - {0x8b1a, 0x8d}, - {0x8b1b, 0x39}, - {0x8b1c, 0x8c}, - {0x8b1d, 0x38}, - {0x8b1e, 0x22}, - {0x8b1f, 0x12}, - {0x8b20, 0x04}, - {0x8b21, 0x36}, - {0x8b22, 0x8f}, - {0x8b23, 0x31}, - {0x8b24, 0x8e}, - {0x8b25, 0x30}, - {0x8b26, 0x8d}, - {0x8b27, 0x2f}, - {0x8b28, 0x8c}, - {0x8b29, 0x2e}, - {0x8b2a, 0x22}, - {0x8b2b, 0x93}, - {0x8b2c, 0xf9}, - {0x8b2d, 0xf8}, - {0x8b2e, 0x02}, - {0x8b2f, 0x04}, - {0x8b30, 0x23}, - {0x8b31, 0x90}, - {0x8b32, 0x0e}, - {0x8b33, 0x81}, - {0x8b34, 0x12}, - {0x8b35, 0x04}, - {0x8b36, 0x36}, - {0x8b37, 0x8f}, - {0x8b38, 0x46}, - {0x8b39, 0x8e}, - {0x8b3a, 0x45}, - {0x8b3b, 0x8d}, - {0x8b3c, 0x44}, - {0x8b3d, 0x8c}, - {0x8b3e, 0x43}, - {0x8b3f, 0xd2}, - {0x8b40, 0x06}, - {0x8b41, 0x30}, - {0x8b42, 0x06}, - {0x8b43, 0x03}, - {0x8b44, 0xd3}, - {0x8b45, 0x80}, - {0x8b46, 0x01}, - {0x8b47, 0xc3}, - {0x8b48, 0x92}, - {0x8b49, 0x0e}, - {0x8b4a, 0x22}, - {0x8b4b, 0xc0}, - {0x8b4c, 0xe0}, - {0x8b4d, 0xc0}, - {0x8b4e, 0x83}, - {0x8b4f, 0xc0}, - {0x8b50, 0x82}, - {0x8b51, 0x90}, - {0x8b52, 0x3f}, - {0x8b53, 0x0d}, - {0x8b54, 0xe0}, - {0x8b55, 0xf5}, - {0x8b56, 0x33}, - {0x8b57, 0xe5}, - {0x8b58, 0x33}, - {0x8b59, 0xf0}, - {0x8b5a, 0xd0}, - {0x8b5b, 0x82}, - {0x8b5c, 0xd0}, - {0x8b5d, 0x83}, - {0x8b5e, 0xd0}, - {0x8b5f, 0xe0}, - {0x8b60, 0x32}, - {0x8b61, 0x78}, - {0x8b62, 0x7f}, - {0x8b63, 0xe4}, - {0x8b64, 0xf6}, - {0x8b65, 0xd8}, - {0x8b66, 0xfd}, - {0x8b67, 0x75}, - {0x8b68, 0x81}, - {0x8b69, 0xca}, - {0x8b6a, 0x02}, - {0x8b6b, 0x09}, - {0x8b6c, 0xd5}, - {0x8b6d, 0xe4}, - {0x8b6e, 0x93}, - {0x8b6f, 0xfe}, - {0x8b70, 0x74}, - {0x8b71, 0x01}, - {0x8b72, 0x93}, - {0x8b73, 0xf5}, - {0x8b74, 0x82}, - {0x8b75, 0x8e}, - {0x8b76, 0x83}, - {0x8b77, 0x22}, - {0x8b78, 0x8f}, - {0x8b79, 0x82}, - {0x8b7a, 0x8e}, - {0x8b7b, 0x83}, - {0x8b7c, 0x75}, - {0x8b7d, 0xf0}, - {0x8b7e, 0x04}, - {0x8b7f, 0xed}, - {0x8b80, 0x02}, - {0x8b81, 0x04}, - {0x8b82, 0x5f}, - {0x8b83, 0x00}, - {0x8b84, 0x00}, - {0x8b85, 0x00}, - {0x8b86, 0x00}, - {0x8b87, 0x00}, - {0x8b88, 0x00}, - {0x8b89, 0x00}, - {0x8b8a, 0x00}, - {0x8b8b, 0x00}, - {0x8b8c, 0x00}, - {0x8b8d, 0x00}, - {0x8b8e, 0x00}, - {0x8b8f, 0x00}, - {0x8b90, 0x00}, - {0x8b91, 0x00}, - {0x8b92, 0x00}, - {0x8b93, 0x00}, - {0x8b94, 0x00}, - {0x8b95, 0x00}, - {0x8b96, 0x00}, - {0x8b97, 0x00}, - {0x8b98, 0x00}, - {0x8b99, 0x00}, - {0x8b9a, 0x00}, - {0x8b9b, 0x00}, - {0x8b9c, 0x00}, - {0x8b9d, 0x00}, - {0x8b9e, 0x00}, - {0x8b9f, 0x00}, - {0x8ba0, 0x00}, - {0x8ba1, 0x00}, - {0x8ba2, 0x00}, - {0x8ba3, 0x00}, - {0x8ba4, 0x00}, - {0x8ba5, 0x00}, - {0x8ba6, 0x00}, - {0x8ba7, 0x00}, - {0x8ba8, 0x00}, - {0x8ba9, 0x00}, - {0x8baa, 0x00}, - {0x8bab, 0x00}, - {0x8bac, 0x00}, - {0x8bad, 0x00}, - {0x8bae, 0x00}, - {0x8baf, 0x00}, - {0x8bb0, 0x00}, - {0x8bb1, 0x00}, - {0x8bb2, 0x00}, - {0x8bb3, 0x00}, - {0x8bb4, 0x00}, - {0x8bb5, 0x00}, - {0x8bb6, 0x00}, - {0x8bb7, 0x00}, - {0x8bb8, 0x00}, - {0x8bb9, 0x00}, - {0x8bba, 0x00}, - {0x8bbb, 0x00}, - {0x8bbc, 0x00}, - {0x8bbd, 0x00}, - {0x8bbe, 0x00}, - {0x8bbf, 0x00}, - {0x8bc0, 0x00}, - {0x8bc1, 0x00}, - {0x8bc2, 0x00}, - {0x8bc3, 0x00}, - {0x8bc4, 0x00}, - {0x8bc5, 0x00}, - {0x8bc6, 0x00}, - {0x8bc7, 0x00}, - {0x8bc8, 0x00}, - {0x8bc9, 0x00}, - {0x8bca, 0x00}, - {0x8bcb, 0x00}, - {0x8bcc, 0x00}, - {0x8bcd, 0x00}, - {0x8bce, 0x00}, - {0x8bcf, 0x00}, - {0x8bd0, 0x00}, - {0x8bd1, 0x00}, - {0x8bd2, 0x00}, - {0x8bd3, 0x00}, - {0x8bd4, 0x00}, - {0x8bd5, 0x00}, - {0x8bd6, 0x00}, - {0x8bd7, 0x00}, - {0x8bd8, 0x00}, - {0x8bd9, 0x00}, - {0x8bda, 0x00}, - {0x8bdb, 0x00}, - {0x8bdc, 0x00}, - {0x8bdd, 0x00}, - {0x8bde, 0x00}, - {0x8bdf, 0x00}, - {0x8be0, 0x00}, - {0x8be1, 0x00}, - {0x8be2, 0x00}, - {0x8be3, 0x00}, - {0x8be4, 0x00}, - {0x8be5, 0x00}, - {0x8be6, 0x00}, - {0x8be7, 0x00}, - {0x8be8, 0x00}, - {0x8be9, 0x00}, - {0x8bea, 0x00}, - {0x8beb, 0x00}, - {0x8bec, 0x00}, - {0x8bed, 0x00}, - {0x8bee, 0x00}, - {0x8bef, 0x00}, - {0x8bf0, 0x00}, - {0x8bf1, 0x00}, - {0x8bf2, 0x00}, - {0x8bf3, 0x00}, - {0x8bf4, 0x00}, - {0x8bf5, 0x00}, - {0x8bf6, 0x00}, - {0x8bf7, 0x00}, - {0x8bf8, 0x00}, - {0x8bf9, 0x00}, - {0x8bfa, 0x00}, - {0x8bfb, 0x00}, - {0x8bfc, 0x00}, - {0x8bfd, 0x00}, - {0x8bfe, 0x00}, - {0x8bff, 0x00}, - {0x8c00, 0x00}, - {0x8c01, 0x00}, - {0x8c02, 0x00}, - {0x8c03, 0x00}, - {0x8c04, 0x00}, - {0x8c05, 0x00}, - {0x8c06, 0x00}, - {0x8c07, 0x00}, - {0x8c08, 0x00}, - {0x8c09, 0x00}, - {0x8c0a, 0x00}, - {0x8c0b, 0x00}, - {0x8c0c, 0x00}, - {0x8c0d, 0x00}, - {0x8c0e, 0x00}, - {0x8c0f, 0x00}, - {0x8c10, 0x00}, - {0x8c11, 0x00}, - {0x8c12, 0x00}, - {0x8c13, 0x00}, - {0x8c14, 0x00}, - {0x8c15, 0x00}, - {0x8c16, 0x00}, - {0x8c17, 0x00}, - {0x8c18, 0x00}, - {0x8c19, 0x00}, - {0x8c1a, 0x00}, - {0x8c1b, 0x00}, - {0x8c1c, 0x00}, - {0x8c1d, 0x00}, - {0x8c1e, 0x00}, - {0x8c1f, 0x00}, - {0x8c20, 0x00}, - {0x8c21, 0x00}, - {0x8c22, 0x00}, - {0x8c23, 0x00}, - {0x8c24, 0x00}, - {0x8c25, 0x00}, - {0x8c26, 0x00}, - {0x8c27, 0x00}, - {0x8c28, 0x00}, - {0x8c29, 0x00}, - {0x8c2a, 0x00}, - {0x8c2b, 0x00}, - {0x8c2c, 0x00}, - {0x8c2d, 0x00}, - {0x8c2e, 0x00}, - {0x8c2f, 0x00}, - {0x8c30, 0x00}, - {0x8c31, 0x00}, - {0x8c32, 0x00}, - {0x8c33, 0x00}, - {0x8c34, 0x00}, - {0x8c35, 0x00}, - {0x8c36, 0x00}, - {0x8c37, 0x00}, - {0x8c38, 0x00}, - {0x8c39, 0x00}, - {0x8c3a, 0x00}, - {0x8c3b, 0x00}, - {0x8c3c, 0x00}, - {0x8c3d, 0x00}, - {0x8c3e, 0x00}, - {0x8c3f, 0x00}, - {0x8c40, 0x00}, - {0x8c41, 0x00}, - {0x8c42, 0x00}, - {0x8c43, 0x00}, - {0x8c44, 0x00}, - {0x8c45, 0x00}, - {0x8c46, 0x00}, - {0x8c47, 0x00}, - {0x8c48, 0x00}, - {0x8c49, 0x00}, - {0x8c4a, 0x00}, - {0x8c4b, 0x00}, - {0x8c4c, 0x00}, - {0x8c4d, 0x00}, - {0x8c4e, 0x00}, - {0x8c4f, 0x00}, - {0x8c50, 0x00}, - {0x8c51, 0x00}, - {0x8c52, 0x00}, - {0x8c53, 0x00}, - {0x8c54, 0x00}, - {0x8c55, 0x00}, - {0x8c56, 0x00}, - {0x8c57, 0x00}, - {0x8c58, 0x00}, - {0x8c59, 0x00}, - {0x8c5a, 0x00}, - {0x8c5b, 0x00}, - {0x8c5c, 0x00}, - {0x8c5d, 0x00}, - {0x8c5e, 0x00}, - {0x8c5f, 0x00}, - {0x8c60, 0x00}, - {0x8c61, 0x00}, - {0x8c62, 0x00}, - {0x8c63, 0x00}, - {0x8c64, 0x00}, - {0x8c65, 0x00}, - {0x8c66, 0x00}, - {0x8c67, 0x00}, - {0x8c68, 0x00}, - {0x8c69, 0x00}, - {0x8c6a, 0x00}, - {0x8c6b, 0x00}, - {0x8c6c, 0x00}, - {0x8c6d, 0x00}, - {0x8c6e, 0x00}, - {0x8c6f, 0x00}, - {0x8c70, 0x00}, - {0x8c71, 0x00}, - {0x8c72, 0x00}, - {0x8c73, 0x00}, - {0x8c74, 0x00}, - {0x8c75, 0x00}, - {0x8c76, 0x00}, - {0x8c77, 0x00}, - {0x8c78, 0x00}, - {0x8c79, 0x00}, - {0x8c7a, 0x00}, - {0x8c7b, 0x00}, - {0x8c7c, 0x00}, - {0x8c7d, 0x00}, - {0x8c7e, 0x00}, - {0x8c7f, 0x00}, - {0x8c80, 0x00}, - {0x8c81, 0x00}, - {0x8c82, 0x00}, - {0x8c83, 0x00}, - {0x8c84, 0x00}, - {0x8c85, 0x00}, - {0x8c86, 0x00}, - {0x8c87, 0x00}, - {0x8c88, 0x00}, - {0x8c89, 0x00}, - {0x8c8a, 0x00}, - {0x8c8b, 0x00}, - {0x8c8c, 0x00}, - {0x8c8d, 0x00}, - {0x8c8e, 0x00}, - {0x8c8f, 0x00}, - {0x8c90, 0x00}, - {0x8c91, 0x00}, - {0x8c92, 0x00}, - {0x8c93, 0x00}, - {0x8c94, 0x00}, - {0x8c95, 0x00}, - {0x8c96, 0x00}, - {0x8c97, 0x00}, - {0x8c98, 0x00}, - {0x8c99, 0x00}, - {0x8c9a, 0x00}, - {0x8c9b, 0x00}, - {0x8c9c, 0x00}, - {0x8c9d, 0x00}, - {0x8c9e, 0x00}, - {0x8c9f, 0x00}, - {0x8ca0, 0x00}, - {0x8ca1, 0x00}, - {0x8ca2, 0x00}, - {0x8ca3, 0x00}, - {0x8ca4, 0x00}, - {0x8ca5, 0x00}, - {0x8ca6, 0x00}, - {0x8ca7, 0x00}, - {0x8ca8, 0x00}, - {0x8ca9, 0x00}, - {0x8caa, 0x00}, - {0x8cab, 0x00}, - {0x8cac, 0x00}, - {0x8cad, 0x00}, - {0x8cae, 0x00}, - {0x8caf, 0x00}, - {0x8cb0, 0x00}, - {0x8cb1, 0x00}, - {0x8cb2, 0x00}, - {0x8cb3, 0x00}, - {0x8cb4, 0x00}, - {0x8cb5, 0x00}, - {0x8cb6, 0x00}, - {0x8cb7, 0x00}, - {0x8cb8, 0x00}, - {0x8cb9, 0x00}, - {0x8cba, 0x00}, - {0x8cbb, 0x00}, - {0x8cbc, 0x00}, - {0x8cbd, 0x00}, - {0x8cbe, 0x00}, - {0x8cbf, 0x00}, - {0x8cc0, 0x00}, - {0x8cc1, 0x00}, - {0x8cc2, 0x00}, - {0x8cc3, 0x00}, - {0x8cc4, 0x00}, - {0x8cc5, 0x00}, - {0x8cc6, 0x00}, - {0x8cc7, 0x00}, - {0x8cc8, 0x00}, - {0x8cc9, 0x00}, - {0x8cca, 0x00}, - {0x8ccb, 0x00}, - {0x8ccc, 0x00}, - {0x8ccd, 0x00}, - {0x8cce, 0x00}, - {0x8ccf, 0x00}, - {0x8cd0, 0x00}, - {0x8cd1, 0x00}, - {0x8cd2, 0x00}, - {0x8cd3, 0x00}, - {0x8cd4, 0x00}, - {0x8cd5, 0x00}, - {0x8cd6, 0x00}, - {0x8cd7, 0x00}, - {0x8cd8, 0x00}, - {0x8cd9, 0x00}, - {0x8cda, 0x00}, - {0x8cdb, 0x00}, - {0x8cdc, 0x00}, - {0x8cdd, 0x00}, - {0x8cde, 0x00}, - {0x8cdf, 0x00}, - {0x8ce0, 0x00}, - {0x8ce1, 0x00}, - {0x8ce2, 0x00}, - {0x8ce3, 0x00}, - {0x8ce4, 0x00}, - {0x8ce5, 0x00}, - {0x8ce6, 0x00}, - {0x8ce7, 0x00}, - {0x8ce8, 0x00}, - {0x8ce9, 0x00}, - {0x8cea, 0x00}, - {0x8ceb, 0x00}, - {0x8cec, 0x00}, - {0x8ced, 0x00}, - {0x8cee, 0x00}, - {0x8cef, 0x00}, - {0x8cf0, 0x00}, - {0x8cf1, 0x00}, - {0x8cf2, 0x00}, - {0x8cf3, 0x00}, - {0x8cf4, 0x00}, - {0x8cf5, 0x00}, - {0x8cf6, 0x00}, - {0x8cf7, 0x00}, - {0x8cf8, 0x00}, - {0x8cf9, 0x00}, - {0x8cfa, 0x00}, - {0x8cfb, 0x00}, - {0x8cfc, 0x00}, - {0x8cfd, 0x00}, - {0x8cfe, 0x00}, - {0x8cff, 0x00}, - {0x8d00, 0x00}, - {0x8d01, 0x00}, - {0x8d02, 0x00}, - {0x8d03, 0x00}, - {0x8d04, 0x00}, - {0x8d05, 0x00}, - {0x8d06, 0x00}, - {0x8d07, 0x00}, - {0x8d08, 0x00}, - {0x8d09, 0x00}, - {0x8d0a, 0x00}, - {0x8d0b, 0x00}, - {0x8d0c, 0x00}, - {0x8d0d, 0x00}, - {0x8d0e, 0x00}, - {0x8d0f, 0x00}, - {0x8d10, 0x00}, - {0x8d11, 0x00}, - {0x8d12, 0x00}, - {0x8d13, 0x00}, - {0x8d14, 0x00}, - {0x8d15, 0x00}, - {0x8d16, 0x00}, - {0x8d17, 0x00}, - {0x8d18, 0x00}, - {0x8d19, 0x00}, - {0x8d1a, 0x00}, - {0x8d1b, 0x00}, - {0x8d1c, 0x00}, - {0x8d1d, 0x00}, - {0x8d1e, 0x00}, - {0x8d1f, 0x00}, - {0x8d20, 0x00}, - {0x8d21, 0x00}, - {0x8d22, 0x00}, - {0x8d23, 0x00}, - {0x8d24, 0x00}, - {0x8d25, 0x00}, - {0x8d26, 0x00}, - {0x8d27, 0x00}, - {0x8d28, 0x00}, - {0x8d29, 0x00}, - {0x8d2a, 0x00}, - {0x8d2b, 0x00}, - {0x8d2c, 0x00}, - {0x8d2d, 0x00}, - {0x8d2e, 0x00}, - {0x8d2f, 0x00}, - {0x8d30, 0x00}, - {0x8d31, 0x00}, - {0x8d32, 0x00}, - {0x8d33, 0x00}, - {0x8d34, 0x00}, - {0x8d35, 0x00}, - {0x8d36, 0x00}, - {0x8d37, 0x00}, - {0x8d38, 0x00}, - {0x8d39, 0x00}, - {0x8d3a, 0x00}, - {0x8d3b, 0x00}, - {0x8d3c, 0x00}, - {0x8d3d, 0x00}, - {0x8d3e, 0x00}, - {0x8d3f, 0x00}, - {0x8d40, 0x00}, - {0x8d41, 0x00}, - {0x8d42, 0x00}, - {0x8d43, 0x00}, - {0x8d44, 0x00}, - {0x8d45, 0x00}, - {0x8d46, 0x00}, - {0x8d47, 0x00}, - {0x8d48, 0x00}, - {0x8d49, 0x00}, - {0x8d4a, 0x00}, - {0x8d4b, 0x00}, - {0x8d4c, 0x00}, - {0x8d4d, 0x00}, - {0x8d4e, 0x00}, - {0x8d4f, 0x00}, - {0x8d50, 0x00}, - {0x8d51, 0x00}, - {0x8d52, 0x00}, - {0x8d53, 0x00}, - {0x8d54, 0x00}, - {0x8d55, 0x00}, - {0x8d56, 0x00}, - {0x8d57, 0x00}, - {0x8d58, 0x00}, - {0x8d59, 0x00}, - {0x8d5a, 0x00}, - {0x8d5b, 0x00}, - {0x8d5c, 0x00}, - {0x8d5d, 0x00}, - {0x8d5e, 0x00}, - {0x8d5f, 0x00}, - {0x8d60, 0x00}, - {0x8d61, 0x00}, - {0x8d62, 0x00}, - {0x8d63, 0x00}, - {0x8d64, 0x00}, - {0x8d65, 0x00}, - {0x8d66, 0x00}, - {0x8d67, 0x00}, - {0x8d68, 0x00}, - {0x8d69, 0x00}, - {0x8d6a, 0x00}, - {0x8d6b, 0x00}, - {0x8d6c, 0x00}, - {0x8d6d, 0x00}, - {0x8d6e, 0x00}, - {0x8d6f, 0x00}, - {0x8d70, 0x00}, - {0x8d71, 0x00}, - {0x8d72, 0x00}, - {0x8d73, 0x00}, - {0x8d74, 0x00}, - {0x8d75, 0x00}, - {0x8d76, 0x00}, - {0x8d77, 0x00}, - {0x8d78, 0x00}, - {0x8d79, 0x00}, - {0x8d7a, 0x00}, - {0x8d7b, 0x00}, - {0x8d7c, 0x00}, - {0x8d7d, 0x00}, - {0x8d7e, 0x00}, - {0x8d7f, 0x00}, - {0x8d80, 0x00}, - {0x8d81, 0x00}, - {0x8d82, 0x00}, - {0x8d83, 0x00}, - {0x8d84, 0x00}, - {0x8d85, 0x00}, - {0x8d86, 0x00}, - {0x8d87, 0x00}, - {0x8d88, 0x00}, - {0x8d89, 0x00}, - {0x8d8a, 0x00}, - {0x8d8b, 0x00}, - {0x8d8c, 0x00}, - {0x8d8d, 0x00}, - {0x8d8e, 0x00}, - {0x8d8f, 0x00}, - {0x8d90, 0x00}, - {0x8d91, 0x00}, - {0x8d92, 0x00}, - {0x8d93, 0x00}, - {0x8d94, 0x00}, - {0x8d95, 0x00}, - {0x8d96, 0x00}, - {0x8d97, 0x00}, - {0x8d98, 0x00}, - {0x8d99, 0x00}, - {0x8d9a, 0x00}, - {0x8d9b, 0x00}, - {0x8d9c, 0x00}, - {0x8d9d, 0x00}, - {0x8d9e, 0x00}, - {0x8d9f, 0x00}, - {0x8da0, 0x00}, - {0x8da1, 0x00}, - {0x8da2, 0x00}, - {0x8da3, 0x00}, - {0x8da4, 0x00}, - {0x8da5, 0x00}, - {0x8da6, 0x00}, - {0x8da7, 0x00}, - {0x8da8, 0x00}, - {0x8da9, 0x00}, - {0x8daa, 0x00}, - {0x8dab, 0x00}, - {0x8dac, 0x00}, - {0x8dad, 0x00}, - {0x8dae, 0x00}, - {0x8daf, 0x00}, - {0x8db0, 0x00}, - {0x8db1, 0x00}, - {0x8db2, 0x00}, - {0x8db3, 0x00}, - {0x8db4, 0x00}, - {0x8db5, 0x00}, - {0x8db6, 0x00}, - {0x8db7, 0x00}, - {0x8db8, 0x00}, - {0x8db9, 0x00}, - {0x8dba, 0x00}, - {0x8dbb, 0x00}, - {0x8dbc, 0x00}, - {0x8dbd, 0x00}, - {0x8dbe, 0x00}, - {0x8dbf, 0x00}, - {0x8dc0, 0x00}, - {0x8dc1, 0x00}, - {0x8dc2, 0x00}, - {0x8dc3, 0x00}, - {0x8dc4, 0x00}, - {0x8dc5, 0x00}, - {0x8dc6, 0x00}, - {0x8dc7, 0x00}, - {0x8dc8, 0x00}, - {0x8dc9, 0x00}, - {0x8dca, 0x00}, - {0x8dcb, 0x00}, - {0x8dcc, 0x00}, - {0x8dcd, 0x00}, - {0x8dce, 0x00}, - {0x8dcf, 0x00}, - {0x8dd0, 0x00}, - {0x8dd1, 0x00}, - {0x8dd2, 0x00}, - {0x8dd3, 0x00}, - {0x8dd4, 0x00}, - {0x8dd5, 0x00}, - {0x8dd6, 0x00}, - {0x8dd7, 0x00}, - {0x8dd8, 0x00}, - {0x8dd9, 0x00}, - {0x8dda, 0x00}, - {0x8ddb, 0x00}, - {0x8ddc, 0x00}, - {0x8ddd, 0x00}, - {0x8dde, 0x00}, - {0x8ddf, 0x00}, - {0x8de0, 0x00}, - {0x8de1, 0x00}, - {0x8de2, 0x00}, - {0x8de3, 0x00}, - {0x8de4, 0x00}, - {0x8de5, 0x00}, - {0x8de6, 0x00}, - {0x8de7, 0x00}, - {0x8de8, 0x00}, - {0x8de9, 0x00}, - {0x8dea, 0x00}, - {0x8deb, 0x00}, - {0x8dec, 0x00}, - {0x8ded, 0x00}, - {0x8dee, 0x00}, - {0x8def, 0x00}, - {0x8df0, 0x00}, - {0x8df1, 0x00}, - {0x8df2, 0x00}, - {0x8df3, 0x00}, - {0x8df4, 0x00}, - {0x8df5, 0x00}, - {0x8df6, 0x00}, - {0x8df7, 0x00}, - {0x8df8, 0x00}, - {0x8df9, 0x00}, - {0x8dfa, 0x00}, - {0x8dfb, 0x00}, - {0x8dfc, 0x00}, - {0x8dfd, 0x00}, - {0x8dfe, 0x00}, - {0x8dff, 0x00}, - {0x8e00, 0x11}, - {0x8e01, 0x04}, - {0x8e02, 0x21}, - {0x8e03, 0x15}, - {0x8e04, 0x12}, - {0x8e05, 0x52}, - {0x8e06, 0x4f}, - {0x8e07, 0x56}, - {0x8e08, 0x54}, - {0x8e09, 0x20}, - {0x8e0a, 0x20}, - {0x8e0b, 0x20}, - {0x8e0c, 0x20}, - {0x8e0d, 0x20}, - {0x8e0e, 0x10}, - {0x8e0f, 0x01}, - {0x8e10, 0x10}, - {0x8e11, 0x00}, - {0x8e12, 0x56}, - {0x8e13, 0x40}, - {0x8e14, 0x1a}, - {0x8e15, 0x30}, - {0x8e16, 0x29}, - {0x8e17, 0x7e}, - {0x8e18, 0x00}, - {0x8e19, 0x30}, - {0x8e1a, 0x04}, - {0x8e1b, 0x20}, - {0x8e1c, 0xdf}, - {0x8e1d, 0x30}, - {0x8e1e, 0x05}, - {0x8e1f, 0x40}, - {0x8e20, 0xbf}, - {0x8e21, 0x50}, - {0x8e22, 0x25}, - {0x8e23, 0x04}, - {0x8e24, 0xfb}, - {0x8e25, 0x50}, - {0x8e26, 0x03}, - {0x8e27, 0x00}, - {0x8e28, 0xfd}, - {0x8e29, 0x50}, - {0x8e2a, 0x27}, - {0x8e2b, 0x01}, - {0x8e2c, 0xfe}, - {0x8e2d, 0x60}, - {0x8e2e, 0x00}, - {0x8e2f, 0x11}, - {0x8e30, 0x00}, - {0x8e31, 0x3f}, - {0x8e32, 0x05}, - {0x8e33, 0x30}, - {0x8e34, 0x00}, - {0x8e35, 0x3f}, - {0x8e36, 0x06}, - {0x8e37, 0x22}, - {0x8e38, 0x00}, - {0x8e39, 0x3f}, - {0x8e3a, 0x01}, - {0x8e3b, 0x29}, - {0x8e3c, 0x00}, - {0x8e3d, 0x3f}, - {0x8e3e, 0x02}, - {0x8e3f, 0x00}, - {0x8e40, 0x00}, - {0x8e41, 0x36}, - {0x8e42, 0x06}, - {0x8e43, 0x07}, - {0x8e44, 0x00}, - {0x8e45, 0x3f}, - {0x8e46, 0x0b}, - {0x8e47, 0x0f}, - {0x8e48, 0xf0}, - {0x8e49, 0x30}, - {0x8e4a, 0x01}, - {0x8e4b, 0x40}, - {0x8e4c, 0xbf}, - {0x8e4d, 0x30}, - {0x8e4e, 0x01}, - {0x8e4f, 0x00}, - {0x8e50, 0xbf}, - {0x8e51, 0x30}, - {0x8e52, 0x29}, - {0x8e53, 0x70}, - {0x8e54, 0x00}, - {0x8e55, 0x3a}, - {0x8e56, 0x00}, - {0x8e57, 0x00}, - {0x8e58, 0xff}, - {0x8e59, 0x3a}, - {0x8e5a, 0x00}, - {0x8e5b, 0x00}, - {0x8e5c, 0xff}, - {0x8e5d, 0x36}, - {0x8e5e, 0x03}, - {0x8e5f, 0x36}, - {0x8e60, 0x02}, - {0x8e61, 0x41}, - {0x8e62, 0x44}, - {0x8e63, 0x58}, - {0x8e64, 0x20}, - {0x8e65, 0x18}, - {0x8e66, 0x10}, - {0x8e67, 0x0a}, - {0x8e68, 0x04}, - {0x8e69, 0x04}, - {0x8e6a, 0x00}, - {0x8e6b, 0x03}, - {0x8e6c, 0xff}, - {0x8e6d, 0x64}, - {0x8e6e, 0x00}, - {0x8e6f, 0x00}, - {0x8e70, 0x80}, - {0x8e71, 0x00}, - {0x8e72, 0x00}, - {0x8e73, 0x00}, - {0x8e74, 0x00}, - {0x8e75, 0x00}, - {0x8e76, 0x00}, - {0x8e77, 0x02}, - {0x8e78, 0x04}, - {0x8e79, 0x06}, - {0x8e7a, 0x00}, - {0x8e7b, 0x03}, - {0x8e7c, 0x98}, - {0x8e7d, 0x00}, - {0x8e7e, 0xcc}, - {0x8e7f, 0x50}, - {0x8e80, 0x3c}, - {0x8e81, 0x28}, - {0x8e82, 0x1e}, - {0x8e83, 0x10}, - {0x8e84, 0x10}, - {0x8e85, 0x00}, - {0x8e86, 0x00}, - {0x8e87, 0x00}, - {0x8e88, 0x6e}, - {0x8e89, 0x06}, - {0x8e8a, 0x05}, - {0x8e8b, 0x00}, - {0x8e8c, 0xa5}, - {0x8e8d, 0x5a}, - {0x3022, 0x00}, - {0x3023, 0x00}, - {0x3024, 0x00}, - {0x3025, 0x00}, - {0x3026, 0x00}, - {0x3027, 0x00}, - {0x3028, 0x00}, - {0x3029, 0xFF}, - {0x3000, 0x00}, -#elif 0 // ddl@rock-chips.com : Touch Focus from OVT - {0x3000,0x20}, -{0x8000,0x02}, -{0x8001,0x0f}, -{0x8002,0xd6}, -{0x8003,0x02}, -{0x8004,0x0a}, -{0x8005,0x39}, -{0x8006,0xc2}, -{0x8007,0x01}, -{0x8008,0x22}, -{0x8009,0x22}, -{0x800a,0x00}, -{0x800b,0x02}, -{0x800c,0x0f}, -{0x800d,0xb2}, -{0x800e,0xe5}, -{0x800f,0x1f}, -{0x8010,0x70}, -{0x8011,0x72}, -{0x8012,0xf5}, -{0x8013,0x1e}, -{0x8014,0xd2}, -{0x8015,0x35}, -{0x8016,0xff}, -{0x8017,0xef}, -{0x8018,0x25}, -{0x8019,0xe0}, -{0x801a,0x24}, -{0x801b,0x4e}, -{0x801c,0xf8}, -{0x801d,0xe4}, -{0x801e,0xf6}, -{0x801f,0x08}, -{0x8020,0xf6}, -{0x8021,0x0f}, -{0x8022,0xbf}, -{0x8023,0x34}, -{0x8024,0xf2}, -{0x8025,0x90}, -{0x8026,0x0e}, -{0x8027,0x93}, -{0x8028,0xe4}, -{0x8029,0x93}, -{0x802a,0xff}, -{0x802b,0xe5}, -{0x802c,0x4b}, -{0x802d,0xc3}, -{0x802e,0x9f}, -{0x802f,0x50}, -{0x8030,0x04}, -{0x8031,0x7f}, -{0x8032,0x05}, -{0x8033,0x80}, -{0x8034,0x02}, -{0x8035,0x7f}, -{0x8036,0xfb}, -{0x8037,0x78}, -{0x8038,0xbd}, -{0x8039,0xa6}, -{0x803a,0x07}, -{0x803b,0x12}, -{0x803c,0x0f}, -{0x803d,0x04}, -{0x803e,0x40}, -{0x803f,0x04}, -{0x8040,0x7f}, -{0x8041,0x03}, -{0x8042,0x80}, -{0x8043,0x02}, -{0x8044,0x7f}, -{0x8045,0x30}, -{0x8046,0x78}, -{0x8047,0xbc}, -{0x8048,0xa6}, -{0x8049,0x07}, -{0x804a,0xe6}, -{0x804b,0x18}, -{0x804c,0xf6}, -{0x804d,0x08}, -{0x804e,0xe6}, -{0x804f,0x78}, -{0x8050,0xb9}, -{0x8051,0xf6}, -{0x8052,0x78}, -{0x8053,0xbc}, -{0x8054,0xe6}, -{0x8055,0x78}, -{0x8056,0xba}, -{0x8057,0xf6}, -{0x8058,0x78}, -{0x8059,0xbf}, -{0x805a,0x76}, -{0x805b,0x33}, -{0x805c,0xe4}, -{0x805d,0x08}, -{0x805e,0xf6}, -{0x805f,0x78}, -{0x8060,0xb8}, -{0x8061,0x76}, -{0x8062,0x01}, -{0x8063,0x75}, -{0x8064,0x4a}, -{0x8065,0x02}, -{0x8066,0x78}, -{0x8067,0xb6}, -{0x8068,0xf6}, -{0x8069,0x08}, -{0x806a,0xf6}, -{0x806b,0x74}, -{0x806c,0xff}, -{0x806d,0x78}, -{0x806e,0xc1}, -{0x806f,0xf6}, -{0x8070,0x08}, -{0x8071,0xf6}, -{0x8072,0x75}, -{0x8073,0x1f}, -{0x8074,0x01}, -{0x8075,0x78}, -{0x8076,0xbc}, -{0x8077,0xe6}, -{0x8078,0x75}, -{0x8079,0xf0}, -{0x807a,0x05}, -{0x807b,0xa4}, -{0x807c,0xf5}, -{0x807d,0x4b}, -{0x807e,0x12}, -{0x807f,0x0a}, -{0x8080,0xff}, -{0x8081,0xc2}, -{0x8082,0x37}, -{0x8083,0x22}, -{0x8084,0x78}, -{0x8085,0xb8}, -{0x8086,0xe6}, -{0x8087,0xd3}, -{0x8088,0x94}, -{0x8089,0x00}, -{0x808a,0x40}, -{0x808b,0x02}, -{0x808c,0x16}, -{0x808d,0x22}, -{0x808e,0xe5}, -{0x808f,0x1f}, -{0x8090,0xb4}, -{0x8091,0x05}, -{0x8092,0x23}, -{0x8093,0xe4}, -{0x8094,0xf5}, -{0x8095,0x1f}, -{0x8096,0xc2}, -{0x8097,0x01}, -{0x8098,0x78}, -{0x8099,0xb6}, -{0x809a,0xe6}, -{0x809b,0xfe}, -{0x809c,0x08}, -{0x809d,0xe6}, -{0x809e,0xff}, -{0x809f,0x78}, -{0x80a0,0x4e}, -{0x80a1,0xa6}, -{0x80a2,0x06}, -{0x80a3,0x08}, -{0x80a4,0xa6}, -{0x80a5,0x07}, -{0x80a6,0xa2}, -{0x80a7,0x37}, -{0x80a8,0xe4}, -{0x80a9,0x33}, -{0x80aa,0xf5}, -{0x80ab,0x3c}, -{0x80ac,0x90}, -{0x80ad,0x30}, -{0x80ae,0x28}, -{0x80af,0xf0}, -{0x80b0,0x75}, -{0x80b1,0x1e}, -{0x80b2,0x10}, -{0x80b3,0xd2}, -{0x80b4,0x35}, -{0x80b5,0x22}, -{0x80b6,0xe5}, -{0x80b7,0x4b}, -{0x80b8,0x75}, -{0x80b9,0xf0}, -{0x80ba,0x05}, -{0x80bb,0x84}, -{0x80bc,0x78}, -{0x80bd,0xbc}, -{0x80be,0xf6}, -{0x80bf,0x90}, -{0x80c0,0x0e}, -{0x80c1,0x8c}, -{0x80c2,0xe4}, -{0x80c3,0x93}, -{0x80c4,0xff}, -{0x80c5,0x25}, -{0x80c6,0xe0}, -{0x80c7,0x24}, -{0x80c8,0x0a}, -{0x80c9,0xf8}, -{0x80ca,0xe6}, -{0x80cb,0xfc}, -{0x80cc,0x08}, -{0x80cd,0xe6}, -{0x80ce,0xfd}, -{0x80cf,0x78}, -{0x80d0,0xbc}, -{0x80d1,0xe6}, -{0x80d2,0x25}, -{0x80d3,0xe0}, -{0x80d4,0x24}, -{0x80d5,0x4e}, -{0x80d6,0xf8}, -{0x80d7,0xa6}, -{0x80d8,0x04}, -{0x80d9,0x08}, -{0x80da,0xa6}, -{0x80db,0x05}, -{0x80dc,0xef}, -{0x80dd,0x12}, -{0x80de,0x0f}, -{0x80df,0x0b}, -{0x80e0,0xd3}, -{0x80e1,0x78}, -{0x80e2,0xb7}, -{0x80e3,0x96}, -{0x80e4,0xee}, -{0x80e5,0x18}, -{0x80e6,0x96}, -{0x80e7,0x40}, -{0x80e8,0x0d}, -{0x80e9,0x78}, -{0x80ea,0xbc}, -{0x80eb,0xe6}, -{0x80ec,0x78}, -{0x80ed,0xb9}, -{0x80ee,0xf6}, -{0x80ef,0x78}, -{0x80f0,0xb6}, -{0x80f1,0xa6}, -{0x80f2,0x06}, -{0x80f3,0x08}, -{0x80f4,0xa6}, -{0x80f5,0x07}, -{0x80f6,0x90}, -{0x80f7,0x0e}, -{0x80f8,0x8c}, -{0x80f9,0xe4}, -{0x80fa,0x93}, -{0x80fb,0x12}, -{0x80fc,0x0f}, -{0x80fd,0x0b}, -{0x80fe,0xc3}, -{0x80ff,0x78}, -{0x8100,0xc2}, -{0x8101,0x96}, -{0x8102,0xee}, -{0x8103,0x18}, -{0x8104,0x96}, -{0x8105,0x50}, -{0x8106,0x0d}, -{0x8107,0x78}, -{0x8108,0xbc}, -{0x8109,0xe6}, -{0x810a,0x78}, -{0x810b,0xba}, -{0x810c,0xf6}, -{0x810d,0x78}, -{0x810e,0xc1}, -{0x810f,0xa6}, -{0x8110,0x06}, -{0x8111,0x08}, -{0x8112,0xa6}, -{0x8113,0x07}, -{0x8114,0x78}, -{0x8115,0xb6}, -{0x8116,0xe6}, -{0x8117,0xfe}, -{0x8118,0x08}, -{0x8119,0xe6}, -{0x811a,0xc3}, -{0x811b,0x78}, -{0x811c,0xc2}, -{0x811d,0x96}, -{0x811e,0xff}, -{0x811f,0xee}, -{0x8120,0x18}, -{0x8121,0x96}, -{0x8122,0x78}, -{0x8123,0xc3}, -{0x8124,0xf6}, -{0x8125,0x08}, -{0x8126,0xa6}, -{0x8127,0x07}, -{0x8128,0x90}, -{0x8129,0x0e}, -{0x812a,0x95}, -{0x812b,0xe4}, -{0x812c,0x18}, -{0x812d,0x12}, -{0x812e,0x0e}, -{0x812f,0xe9}, -{0x8130,0x40}, -{0x8131,0x02}, -{0x8132,0xd2}, -{0x8133,0x37}, -{0x8134,0x78}, -{0x8135,0xbc}, -{0x8136,0xe6}, -{0x8137,0x08}, -{0x8138,0x26}, -{0x8139,0x08}, -{0x813a,0xf6}, -{0x813b,0xe5}, -{0x813c,0x1f}, -{0x813d,0x64}, -{0x813e,0x01}, -{0x813f,0x70}, -{0x8140,0x4a}, -{0x8141,0xe6}, -{0x8142,0xc3}, -{0x8143,0x78}, -{0x8144,0xc0}, -{0x8145,0x12}, -{0x8146,0x0e}, -{0x8147,0xdf}, -{0x8148,0x40}, -{0x8149,0x05}, -{0x814a,0x12}, -{0x814b,0x0e}, -{0x814c,0xda}, -{0x814d,0x40}, -{0x814e,0x39}, -{0x814f,0x12}, -{0x8150,0x0f}, -{0x8151,0x02}, -{0x8152,0x40}, -{0x8153,0x04}, -{0x8154,0x7f}, -{0x8155,0xfe}, -{0x8156,0x80}, -{0x8157,0x02}, -{0x8158,0x7f}, -{0x8159,0x02}, -{0x815a,0x78}, -{0x815b,0xbd}, -{0x815c,0xa6}, -{0x815d,0x07}, -{0x815e,0x78}, -{0x815f,0xb9}, -{0x8160,0xe6}, -{0x8161,0x24}, -{0x8162,0x03}, -{0x8163,0x78}, -{0x8164,0xbf}, -{0x8165,0xf6}, -{0x8166,0x78}, -{0x8167,0xb9}, -{0x8168,0xe6}, -{0x8169,0x24}, -{0x816a,0xfd}, -{0x816b,0x78}, -{0x816c,0xc0}, -{0x816d,0xf6}, -{0x816e,0x12}, -{0x816f,0x0f}, -{0x8170,0x02}, -{0x8171,0x40}, -{0x8172,0x06}, -{0x8173,0x78}, -{0x8174,0xc0}, -{0x8175,0xe6}, -{0x8176,0xff}, -{0x8177,0x80}, -{0x8178,0x04}, -{0x8179,0x78}, -{0x817a,0xbf}, -{0x817b,0xe6}, -{0x817c,0xff}, -{0x817d,0x78}, -{0x817e,0xbe}, -{0x817f,0xa6}, -{0x8180,0x07}, -{0x8181,0x75}, -{0x8182,0x1f}, -{0x8183,0x02}, -{0x8184,0x78}, -{0x8185,0xb8}, -{0x8186,0x76}, -{0x8187,0x01}, -{0x8188,0x02}, -{0x8189,0x02}, -{0x818a,0x4a}, -{0x818b,0xe5}, -{0x818c,0x1f}, -{0x818d,0x64}, -{0x818e,0x02}, -{0x818f,0x60}, -{0x8190,0x03}, -{0x8191,0x02}, -{0x8192,0x02}, -{0x8193,0x2a}, -{0x8194,0x78}, -{0x8195,0xbe}, -{0x8196,0xe6}, -{0x8197,0xff}, -{0x8198,0xc3}, -{0x8199,0x78}, -{0x819a,0xc0}, -{0x819b,0x12}, -{0x819c,0x0e}, -{0x819d,0xe0}, -{0x819e,0x40}, -{0x819f,0x08}, -{0x81a0,0x12}, -{0x81a1,0x0e}, -{0x81a2,0xda}, -{0x81a3,0x50}, -{0x81a4,0x03}, -{0x81a5,0x02}, -{0x81a6,0x02}, -{0x81a7,0x28}, -{0x81a8,0x12}, -{0x81a9,0x0f}, -{0x81aa,0x02}, -{0x81ab,0x40}, -{0x81ac,0x04}, -{0x81ad,0x7f}, -{0x81ae,0xff}, -{0x81af,0x80}, -{0x81b0,0x02}, -{0x81b1,0x7f}, -{0x81b2,0x01}, -{0x81b3,0x78}, -{0x81b4,0xbd}, -{0x81b5,0xa6}, -{0x81b6,0x07}, -{0x81b7,0x78}, -{0x81b8,0xb9}, -{0x81b9,0xe6}, -{0x81ba,0x04}, -{0x81bb,0x78}, -{0x81bc,0xbf}, -{0x81bd,0xf6}, -{0x81be,0x78}, -{0x81bf,0xb9}, -{0x81c0,0xe6}, -{0x81c1,0x14}, -{0x81c2,0x78}, -{0x81c3,0xc0}, -{0x81c4,0xf6}, -{0x81c5,0x18}, -{0x81c6,0x12}, -{0x81c7,0x0f}, -{0x81c8,0x04}, -{0x81c9,0x40}, -{0x81ca,0x04}, -{0x81cb,0xe6}, -{0x81cc,0xff}, -{0x81cd,0x80}, -{0x81ce,0x02}, -{0x81cf,0x7f}, -{0x81d0,0x00}, -{0x81d1,0x78}, -{0x81d2,0xbf}, -{0x81d3,0xa6}, -{0x81d4,0x07}, -{0x81d5,0xd3}, -{0x81d6,0x08}, -{0x81d7,0xe6}, -{0x81d8,0x64}, -{0x81d9,0x80}, -{0x81da,0x94}, -{0x81db,0x80}, -{0x81dc,0x40}, -{0x81dd,0x04}, -{0x81de,0xe6}, -{0x81df,0xff}, -{0x81e0,0x80}, -{0x81e1,0x02}, -{0x81e2,0x7f}, -{0x81e3,0x00}, -{0x81e4,0x78}, -{0x81e5,0xc0}, -{0x81e6,0xa6}, -{0x81e7,0x07}, -{0x81e8,0xc3}, -{0x81e9,0x18}, -{0x81ea,0xe6}, -{0x81eb,0x64}, -{0x81ec,0x80}, -{0x81ed,0x94}, -{0x81ee,0xb3}, -{0x81ef,0x50}, -{0x81f0,0x04}, -{0x81f1,0xe6}, -{0x81f2,0xff}, -{0x81f3,0x80}, -{0x81f4,0x02}, -{0x81f5,0x7f}, -{0x81f6,0x33}, -{0x81f7,0x78}, -{0x81f8,0xbf}, -{0x81f9,0xa6}, -{0x81fa,0x07}, -{0x81fb,0xc3}, -{0x81fc,0x08}, -{0x81fd,0xe6}, -{0x81fe,0x64}, -{0x81ff,0x80}, -{0x8200,0x94}, -{0x8201,0xb3}, -{0x8202,0x50}, -{0x8203,0x04}, -{0x8204,0xe6}, -{0x8205,0xff}, -{0x8206,0x80}, -{0x8207,0x02}, -{0x8208,0x7f}, -{0x8209,0x33}, -{0x820a,0x78}, -{0x820b,0xc0}, -{0x820c,0xa6}, -{0x820d,0x07}, -{0x820e,0x12}, -{0x820f,0x0f}, -{0x8210,0x02}, -{0x8211,0x40}, -{0x8212,0x06}, -{0x8213,0x78}, -{0x8214,0xc0}, -{0x8215,0xe6}, -{0x8216,0xff}, -{0x8217,0x80}, -{0x8218,0x04}, -{0x8219,0x78}, -{0x821a,0xbf}, -{0x821b,0xe6}, -{0x821c,0xff}, -{0x821d,0x78}, -{0x821e,0xbe}, -{0x821f,0xa6}, -{0x8220,0x07}, -{0x8221,0x75}, -{0x8222,0x1f}, -{0x8223,0x03}, -{0x8224,0x78}, -{0x8225,0xb8}, -{0x8226,0x76}, -{0x8227,0x01}, -{0x8228,0x80}, -{0x8229,0x20}, -{0x822a,0xe5}, -{0x822b,0x1f}, -{0x822c,0x64}, -{0x822d,0x03}, -{0x822e,0x70}, -{0x822f,0x26}, -{0x8230,0x78}, -{0x8231,0xbe}, -{0x8232,0xe6}, -{0x8233,0xff}, -{0x8234,0xc3}, -{0x8235,0x78}, -{0x8236,0xc0}, -{0x8237,0x12}, -{0x8238,0x0e}, -{0x8239,0xe0}, -{0x823a,0x40}, -{0x823b,0x05}, -{0x823c,0x12}, -{0x823d,0x0e}, -{0x823e,0xda}, -{0x823f,0x40}, -{0x8240,0x09}, -{0x8241,0x78}, -{0x8242,0xb9}, -{0x8243,0xe6}, -{0x8244,0x78}, -{0x8245,0xbe}, -{0x8246,0xf6}, -{0x8247,0x75}, -{0x8248,0x1f}, -{0x8249,0x04}, -{0x824a,0x78}, -{0x824b,0xbe}, -{0x824c,0xe6}, -{0x824d,0x75}, -{0x824e,0xf0}, -{0x824f,0x05}, -{0x8250,0xa4}, -{0x8251,0xf5}, -{0x8252,0x4b}, -{0x8253,0x02}, -{0x8254,0x0a}, -{0x8255,0xff}, -{0x8256,0xe5}, -{0x8257,0x1f}, -{0x8258,0xb4}, -{0x8259,0x04}, -{0x825a,0x10}, -{0x825b,0x90}, -{0x825c,0x0e}, -{0x825d,0x94}, -{0x825e,0xe4}, -{0x825f,0x78}, -{0x8260,0xc3}, -{0x8261,0x12}, -{0x8262,0x0e}, -{0x8263,0xe9}, -{0x8264,0x40}, -{0x8265,0x02}, -{0x8266,0xd2}, -{0x8267,0x37}, -{0x8268,0x75}, -{0x8269,0x1f}, -{0x826a,0x05}, -{0x826b,0x22}, -{0x826c,0x30}, -{0x826d,0x01}, -{0x826e,0x03}, -{0x826f,0x02}, -{0x8270,0x04}, -{0x8271,0xc0}, -{0x8272,0x30}, -{0x8273,0x02}, -{0x8274,0x03}, -{0x8275,0x02}, -{0x8276,0x04}, -{0x8277,0xc0}, -{0x8278,0x90}, -{0x8279,0x51}, -{0x827a,0xa5}, -{0x827b,0xe0}, -{0x827c,0x78}, -{0x827d,0x93}, -{0x827e,0xf6}, -{0x827f,0xa3}, -{0x8280,0xe0}, -{0x8281,0x08}, -{0x8282,0xf6}, -{0x8283,0xa3}, -{0x8284,0xe0}, -{0x8285,0x08}, -{0x8286,0xf6}, -{0x8287,0xe5}, -{0x8288,0x1f}, -{0x8289,0x70}, -{0x828a,0x3c}, -{0x828b,0x75}, -{0x828c,0x1e}, -{0x828d,0x20}, -{0x828e,0xd2}, -{0x828f,0x35}, -{0x8290,0x12}, -{0x8291,0x0c}, -{0x8292,0x7a}, -{0x8293,0x78}, -{0x8294,0x7e}, -{0x8295,0xa6}, -{0x8296,0x06}, -{0x8297,0x08}, -{0x8298,0xa6}, -{0x8299,0x07}, -{0x829a,0x78}, -{0x829b,0x8b}, -{0x829c,0xa6}, -{0x829d,0x09}, -{0x829e,0x18}, -{0x829f,0x76}, -{0x82a0,0x01}, -{0x82a1,0x12}, -{0x82a2,0x0c}, -{0x82a3,0x5b}, -{0x82a4,0x78}, -{0x82a5,0x4e}, -{0x82a6,0xa6}, -{0x82a7,0x06}, -{0x82a8,0x08}, -{0x82a9,0xa6}, -{0x82aa,0x07}, -{0x82ab,0x78}, -{0x82ac,0x8b}, -{0x82ad,0xe6}, -{0x82ae,0x78}, -{0x82af,0x6e}, -{0x82b0,0xf6}, -{0x82b1,0x75}, -{0x82b2,0x1f}, -{0x82b3,0x01}, -{0x82b4,0x78}, -{0x82b5,0x93}, -{0x82b6,0xe6}, -{0x82b7,0x78}, -{0x82b8,0x90}, -{0x82b9,0xf6}, -{0x82ba,0x78}, -{0x82bb,0x94}, -{0x82bc,0xe6}, -{0x82bd,0x78}, -{0x82be,0x91}, -{0x82bf,0xf6}, -{0x82c0,0x78}, -{0x82c1,0x95}, -{0x82c2,0xe6}, -{0x82c3,0x78}, -{0x82c4,0x92}, -{0x82c5,0xf6}, -{0x82c6,0x22}, -{0x82c7,0x79}, -{0x82c8,0x90}, -{0x82c9,0xe7}, -{0x82ca,0xd3}, -{0x82cb,0x78}, -{0x82cc,0x93}, -{0x82cd,0x96}, -{0x82ce,0x40}, -{0x82cf,0x05}, -{0x82d0,0xe7}, -{0x82d1,0x96}, -{0x82d2,0xff}, -{0x82d3,0x80}, -{0x82d4,0x08}, -{0x82d5,0xc3}, -{0x82d6,0x79}, -{0x82d7,0x93}, -{0x82d8,0xe7}, -{0x82d9,0x78}, -{0x82da,0x90}, -{0x82db,0x96}, -{0x82dc,0xff}, -{0x82dd,0x78}, -{0x82de,0x88}, -{0x82df,0x76}, -{0x82e0,0x00}, -{0x82e1,0x08}, -{0x82e2,0xa6}, -{0x82e3,0x07}, -{0x82e4,0x79}, -{0x82e5,0x91}, -{0x82e6,0xe7}, -{0x82e7,0xd3}, -{0x82e8,0x78}, -{0x82e9,0x94}, -{0x82ea,0x96}, -{0x82eb,0x40}, -{0x82ec,0x05}, -{0x82ed,0xe7}, -{0x82ee,0x96}, -{0x82ef,0xff}, -{0x82f0,0x80}, -{0x82f1,0x08}, -{0x82f2,0xc3}, -{0x82f3,0x79}, -{0x82f4,0x94}, -{0x82f5,0xe7}, -{0x82f6,0x78}, -{0x82f7,0x91}, -{0x82f8,0x96}, -{0x82f9,0xff}, -{0x82fa,0x12}, -{0x82fb,0x0c}, -{0x82fc,0x8e}, -{0x82fd,0x79}, -{0x82fe,0x92}, -{0x82ff,0xe7}, -{0x8300,0xd3}, -{0x8301,0x78}, -{0x8302,0x95}, -{0x8303,0x96}, -{0x8304,0x40}, -{0x8305,0x05}, -{0x8306,0xe7}, -{0x8307,0x96}, -{0x8308,0xff}, -{0x8309,0x80}, -{0x830a,0x08}, -{0x830b,0xc3}, -{0x830c,0x79}, -{0x830d,0x95}, -{0x830e,0xe7}, -{0x830f,0x78}, -{0x8310,0x92}, -{0x8311,0x96}, -{0x8312,0xff}, -{0x8313,0x12}, -{0x8314,0x0c}, -{0x8315,0x8e}, -{0x8316,0x12}, -{0x8317,0x0c}, -{0x8318,0x5b}, -{0x8319,0x78}, -{0x831a,0x8a}, -{0x831b,0xe6}, -{0x831c,0x25}, -{0x831d,0xe0}, -{0x831e,0x24}, -{0x831f,0x4e}, -{0x8320,0xf8}, -{0x8321,0xa6}, -{0x8322,0x06}, -{0x8323,0x08}, -{0x8324,0xa6}, -{0x8325,0x07}, -{0x8326,0x78}, -{0x8327,0x8a}, -{0x8328,0xe6}, -{0x8329,0x24}, -{0x832a,0x6e}, -{0x832b,0xf8}, -{0x832c,0xa6}, -{0x832d,0x09}, -{0x832e,0x78}, -{0x832f,0x8a}, -{0x8330,0xe6}, -{0x8331,0x24}, -{0x8332,0x01}, -{0x8333,0xff}, -{0x8334,0xe4}, -{0x8335,0x33}, -{0x8336,0xfe}, -{0x8337,0xd3}, -{0x8338,0xef}, -{0x8339,0x94}, -{0x833a,0x0f}, -{0x833b,0xee}, -{0x833c,0x64}, -{0x833d,0x80}, -{0x833e,0x94}, -{0x833f,0x80}, -{0x8340,0x40}, -{0x8341,0x04}, -{0x8342,0x7f}, -{0x8343,0x00}, -{0x8344,0x80}, -{0x8345,0x05}, -{0x8346,0x78}, -{0x8347,0x8a}, -{0x8348,0xe6}, -{0x8349,0x04}, -{0x834a,0xff}, -{0x834b,0x78}, -{0x834c,0x8a}, -{0x834d,0xa6}, -{0x834e,0x07}, -{0x834f,0xe5}, -{0x8350,0x1f}, -{0x8351,0xb4}, -{0x8352,0x01}, -{0x8353,0x0a}, -{0x8354,0xe6}, -{0x8355,0x60}, -{0x8356,0x03}, -{0x8357,0x02}, -{0x8358,0x04}, -{0x8359,0xc0}, -{0x835a,0x75}, -{0x835b,0x1f}, -{0x835c,0x02}, -{0x835d,0x22}, -{0x835e,0x12}, -{0x835f,0x0c}, -{0x8360,0x7a}, -{0x8361,0x78}, -{0x8362,0x80}, -{0x8363,0xa6}, -{0x8364,0x06}, -{0x8365,0x08}, -{0x8366,0xa6}, -{0x8367,0x07}, -{0x8368,0x12}, -{0x8369,0x0c}, -{0x836a,0x7a}, -{0x836b,0x78}, -{0x836c,0x82}, -{0x836d,0xa6}, -{0x836e,0x06}, -{0x836f,0x08}, -{0x8370,0xa6}, -{0x8371,0x07}, -{0x8372,0x78}, -{0x8373,0x6e}, -{0x8374,0xe6}, -{0x8375,0x78}, -{0x8376,0x8c}, -{0x8377,0xf6}, -{0x8378,0x78}, -{0x8379,0x6e}, -{0x837a,0xe6}, -{0x837b,0x78}, -{0x837c,0x8d}, -{0x837d,0xf6}, -{0x837e,0x7f}, -{0x837f,0x01}, -{0x8380,0xef}, -{0x8381,0x25}, -{0x8382,0xe0}, -{0x8383,0x24}, -{0x8384,0x4f}, -{0x8385,0xf9}, -{0x8386,0xc3}, -{0x8387,0x78}, -{0x8388,0x81}, -{0x8389,0xe6}, -{0x838a,0x97}, -{0x838b,0x18}, -{0x838c,0xe6}, -{0x838d,0x19}, -{0x838e,0x97}, -{0x838f,0x50}, -{0x8390,0x0a}, -{0x8391,0x12}, -{0x8392,0x0c}, -{0x8393,0x82}, -{0x8394,0x78}, -{0x8395,0x80}, -{0x8396,0xa6}, -{0x8397,0x04}, -{0x8398,0x08}, -{0x8399,0xa6}, -{0x839a,0x05}, -{0x839b,0x74}, -{0x839c,0x6e}, -{0x839d,0x2f}, -{0x839e,0xf9}, -{0x839f,0x78}, -{0x83a0,0x8c}, -{0x83a1,0xe6}, -{0x83a2,0xc3}, -{0x83a3,0x97}, -{0x83a4,0x50}, -{0x83a5,0x08}, -{0x83a6,0x74}, -{0x83a7,0x6e}, -{0x83a8,0x2f}, -{0x83a9,0xf8}, -{0x83aa,0xe6}, -{0x83ab,0x78}, -{0x83ac,0x8c}, -{0x83ad,0xf6}, -{0x83ae,0xef}, -{0x83af,0x25}, -{0x83b0,0xe0}, -{0x83b1,0x24}, -{0x83b2,0x4f}, -{0x83b3,0xf9}, -{0x83b4,0xd3}, -{0x83b5,0x78}, -{0x83b6,0x83}, -{0x83b7,0xe6}, -{0x83b8,0x97}, -{0x83b9,0x18}, -{0x83ba,0xe6}, -{0x83bb,0x19}, -{0x83bc,0x97}, -{0x83bd,0x40}, -{0x83be,0x0a}, -{0x83bf,0x12}, -{0x83c0,0x0c}, -{0x83c1,0x82}, -{0x83c2,0x78}, -{0x83c3,0x82}, -{0x83c4,0xa6}, -{0x83c5,0x04}, -{0x83c6,0x08}, -{0x83c7,0xa6}, -{0x83c8,0x05}, -{0x83c9,0x74}, -{0x83ca,0x6e}, -{0x83cb,0x2f}, -{0x83cc,0xf9}, -{0x83cd,0x78}, -{0x83ce,0x8d}, -{0x83cf,0xe6}, -{0x83d0,0xd3}, -{0x83d1,0x97}, -{0x83d2,0x40}, -{0x83d3,0x08}, -{0x83d4,0x74}, -{0x83d5,0x6e}, -{0x83d6,0x2f}, -{0x83d7,0xf8}, -{0x83d8,0xe6}, -{0x83d9,0x78}, -{0x83da,0x8d}, -{0x83db,0xf6}, -{0x83dc,0x0f}, -{0x83dd,0xef}, -{0x83de,0x64}, -{0x83df,0x10}, -{0x83e0,0x70}, -{0x83e1,0x9e}, -{0x83e2,0xc3}, -{0x83e3,0x79}, -{0x83e4,0x81}, -{0x83e5,0xe7}, -{0x83e6,0x78}, -{0x83e7,0x83}, -{0x83e8,0x96}, -{0x83e9,0xff}, -{0x83ea,0x19}, -{0x83eb,0xe7}, -{0x83ec,0x18}, -{0x83ed,0x96}, -{0x83ee,0x78}, -{0x83ef,0x84}, -{0x83f0,0xf6}, -{0x83f1,0x08}, -{0x83f2,0xa6}, -{0x83f3,0x07}, -{0x83f4,0xc3}, -{0x83f5,0x79}, -{0x83f6,0x8c}, -{0x83f7,0xe7}, -{0x83f8,0x78}, -{0x83f9,0x8d}, -{0x83fa,0x96}, -{0x83fb,0x08}, -{0x83fc,0xf6}, -{0x83fd,0xd3}, -{0x83fe,0x79}, -{0x83ff,0x81}, -{0x8400,0xe7}, -{0x8401,0x78}, -{0x8402,0x7f}, -{0x8403,0x96}, -{0x8404,0x19}, -{0x8405,0xe7}, -{0x8406,0x18}, -{0x8407,0x96}, -{0x8408,0x40}, -{0x8409,0x05}, -{0x840a,0x09}, -{0x840b,0xe7}, -{0x840c,0x08}, -{0x840d,0x80}, -{0x840e,0x06}, -{0x840f,0xc3}, -{0x8410,0x79}, -{0x8411,0x7f}, -{0x8412,0xe7}, -{0x8413,0x78}, -{0x8414,0x81}, -{0x8415,0x96}, -{0x8416,0xff}, -{0x8417,0x19}, -{0x8418,0xe7}, -{0x8419,0x18}, -{0x841a,0x96}, -{0x841b,0xfe}, -{0x841c,0x78}, -{0x841d,0x86}, -{0x841e,0xa6}, -{0x841f,0x06}, -{0x8420,0x08}, -{0x8421,0xa6}, -{0x8422,0x07}, -{0x8423,0x79}, -{0x8424,0x8c}, -{0x8425,0xe7}, -{0x8426,0xd3}, -{0x8427,0x78}, -{0x8428,0x8b}, -{0x8429,0x96}, -{0x842a,0x40}, -{0x842b,0x05}, -{0x842c,0xe7}, -{0x842d,0x96}, -{0x842e,0xff}, -{0x842f,0x80}, -{0x8430,0x08}, -{0x8431,0xc3}, -{0x8432,0x79}, -{0x8433,0x8b}, -{0x8434,0xe7}, -{0x8435,0x78}, -{0x8436,0x8c}, -{0x8437,0x96}, -{0x8438,0xff}, -{0x8439,0x78}, -{0x843a,0x8f}, -{0x843b,0xa6}, -{0x843c,0x07}, -{0x843d,0xe5}, -{0x843e,0x1f}, -{0x843f,0x64}, -{0x8440,0x02}, -{0x8441,0x70}, -{0x8442,0x69}, -{0x8443,0x90}, -{0x8444,0x0e}, -{0x8445,0x91}, -{0x8446,0x93}, -{0x8447,0xff}, -{0x8448,0x18}, -{0x8449,0xe6}, -{0x844a,0xc3}, -{0x844b,0x9f}, -{0x844c,0x50}, -{0x844d,0x72}, -{0x844e,0x12}, -{0x844f,0x0c}, -{0x8450,0x4a}, -{0x8451,0x12}, -{0x8452,0x0c}, -{0x8453,0x2f}, -{0x8454,0x90}, -{0x8455,0x0e}, -{0x8456,0x8e}, -{0x8457,0x12}, -{0x8458,0x0c}, -{0x8459,0x38}, -{0x845a,0x78}, -{0x845b,0x80}, -{0x845c,0x12}, -{0x845d,0x0c}, -{0x845e,0x6b}, -{0x845f,0x7b}, -{0x8460,0x04}, -{0x8461,0x12}, -{0x8462,0x0c}, -{0x8463,0x1d}, -{0x8464,0xc3}, -{0x8465,0x12}, -{0x8466,0x06}, -{0x8467,0x45}, -{0x8468,0x50}, -{0x8469,0x56}, -{0x846a,0x90}, -{0x846b,0x0e}, -{0x846c,0x92}, -{0x846d,0xe4}, -{0x846e,0x93}, -{0x846f,0xff}, -{0x8470,0x78}, -{0x8471,0x8f}, -{0x8472,0xe6}, -{0x8473,0x9f}, -{0x8474,0x40}, -{0x8475,0x02}, -{0x8476,0x80}, -{0x8477,0x11}, -{0x8478,0x90}, -{0x8479,0x0e}, -{0x847a,0x90}, -{0x847b,0xe4}, -{0x847c,0x93}, -{0x847d,0xff}, -{0x847e,0xd3}, -{0x847f,0x78}, -{0x8480,0x89}, -{0x8481,0xe6}, -{0x8482,0x9f}, -{0x8483,0x18}, -{0x8484,0xe6}, -{0x8485,0x94}, -{0x8486,0x00}, -{0x8487,0x40}, -{0x8488,0x03}, -{0x8489,0x75}, -{0x848a,0x1f}, -{0x848b,0x05}, -{0x848c,0x12}, -{0x848d,0x0c}, -{0x848e,0x4a}, -{0x848f,0x12}, -{0x8490,0x0c}, -{0x8491,0x2f}, -{0x8492,0x90}, -{0x8493,0x0e}, -{0x8494,0x8f}, -{0x8495,0x12}, -{0x8496,0x0c}, -{0x8497,0x38}, -{0x8498,0x78}, -{0x8499,0x7e}, -{0x849a,0x12}, -{0x849b,0x0c}, -{0x849c,0x6b}, -{0x849d,0x7b}, -{0x849e,0x40}, -{0x849f,0x12}, -{0x84a0,0x0c}, -{0x84a1,0x1d}, -{0x84a2,0xd3}, -{0x84a3,0x12}, -{0x84a4,0x06}, -{0x84a5,0x45}, -{0x84a6,0x40}, -{0x84a7,0x18}, -{0x84a8,0x75}, -{0x84a9,0x1f}, -{0x84aa,0x05}, -{0x84ab,0x22}, -{0x84ac,0xe5}, -{0x84ad,0x1f}, -{0x84ae,0xb4}, -{0x84af,0x05}, -{0x84b0,0x0f}, -{0x84b1,0xd2}, -{0x84b2,0x01}, -{0x84b3,0xc2}, -{0x84b4,0x02}, -{0x84b5,0xe4}, -{0x84b6,0xf5}, -{0x84b7,0x1f}, -{0x84b8,0xf5}, -{0x84b9,0x1e}, -{0x84ba,0xd2}, -{0x84bb,0x35}, -{0x84bc,0xd2}, -{0x84bd,0x33}, -{0x84be,0xd2}, -{0x84bf,0x36}, -{0x84c0,0x22}, -{0x84c1,0xef}, -{0x84c2,0x8d}, -{0x84c3,0xf0}, -{0x84c4,0xa4}, -{0x84c5,0xa8}, -{0x84c6,0xf0}, -{0x84c7,0xcf}, -{0x84c8,0x8c}, -{0x84c9,0xf0}, -{0x84ca,0xa4}, -{0x84cb,0x28}, -{0x84cc,0xce}, -{0x84cd,0x8d}, -{0x84ce,0xf0}, -{0x84cf,0xa4}, -{0x84d0,0x2e}, -{0x84d1,0xfe}, -{0x84d2,0x22}, -{0x84d3,0xbc}, -{0x84d4,0x00}, -{0x84d5,0x0b}, -{0x84d6,0xbe}, -{0x84d7,0x00}, -{0x84d8,0x29}, -{0x84d9,0xef}, -{0x84da,0x8d}, -{0x84db,0xf0}, -{0x84dc,0x84}, -{0x84dd,0xff}, -{0x84de,0xad}, -{0x84df,0xf0}, -{0x84e0,0x22}, -{0x84e1,0xe4}, -{0x84e2,0xcc}, -{0x84e3,0xf8}, -{0x84e4,0x75}, -{0x84e5,0xf0}, -{0x84e6,0x08}, -{0x84e7,0xef}, -{0x84e8,0x2f}, -{0x84e9,0xff}, -{0x84ea,0xee}, -{0x84eb,0x33}, -{0x84ec,0xfe}, -{0x84ed,0xec}, -{0x84ee,0x33}, -{0x84ef,0xfc}, -{0x84f0,0xee}, -{0x84f1,0x9d}, -{0x84f2,0xec}, -{0x84f3,0x98}, -{0x84f4,0x40}, -{0x84f5,0x05}, -{0x84f6,0xfc}, -{0x84f7,0xee}, -{0x84f8,0x9d}, -{0x84f9,0xfe}, -{0x84fa,0x0f}, -{0x84fb,0xd5}, -{0x84fc,0xf0}, -{0x84fd,0xe9}, -{0x84fe,0xe4}, -{0x84ff,0xce}, -{0x8500,0xfd}, -{0x8501,0x22}, -{0x8502,0xed}, -{0x8503,0xf8}, -{0x8504,0xf5}, -{0x8505,0xf0}, -{0x8506,0xee}, -{0x8507,0x84}, -{0x8508,0x20}, -{0x8509,0xd2}, -{0x850a,0x1c}, -{0x850b,0xfe}, -{0x850c,0xad}, -{0x850d,0xf0}, -{0x850e,0x75}, -{0x850f,0xf0}, -{0x8510,0x08}, -{0x8511,0xef}, -{0x8512,0x2f}, -{0x8513,0xff}, -{0x8514,0xed}, -{0x8515,0x33}, -{0x8516,0xfd}, -{0x8517,0x40}, -{0x8518,0x07}, -{0x8519,0x98}, -{0x851a,0x50}, -{0x851b,0x06}, -{0x851c,0xd5}, -{0x851d,0xf0}, -{0x851e,0xf2}, -{0x851f,0x22}, -{0x8520,0xc3}, -{0x8521,0x98}, -{0x8522,0xfd}, -{0x8523,0x0f}, -{0x8524,0xd5}, -{0x8525,0xf0}, -{0x8526,0xea}, -{0x8527,0x22}, -{0x8528,0xe8}, -{0x8529,0x8f}, -{0x852a,0xf0}, -{0x852b,0xa4}, -{0x852c,0xcc}, -{0x852d,0x8b}, -{0x852e,0xf0}, -{0x852f,0xa4}, -{0x8530,0x2c}, -{0x8531,0xfc}, -{0x8532,0xe9}, -{0x8533,0x8e}, -{0x8534,0xf0}, -{0x8535,0xa4}, -{0x8536,0x2c}, -{0x8537,0xfc}, -{0x8538,0x8a}, -{0x8539,0xf0}, -{0x853a,0xed}, -{0x853b,0xa4}, -{0x853c,0x2c}, -{0x853d,0xfc}, -{0x853e,0xea}, -{0x853f,0x8e}, -{0x8540,0xf0}, -{0x8541,0xa4}, -{0x8542,0xcd}, -{0x8543,0xa8}, -{0x8544,0xf0}, -{0x8545,0x8b}, -{0x8546,0xf0}, -{0x8547,0xa4}, -{0x8548,0x2d}, -{0x8549,0xcc}, -{0x854a,0x38}, -{0x854b,0x25}, -{0x854c,0xf0}, -{0x854d,0xfd}, -{0x854e,0xe9}, -{0x854f,0x8f}, -{0x8550,0xf0}, -{0x8551,0xa4}, -{0x8552,0x2c}, -{0x8553,0xcd}, -{0x8554,0x35}, -{0x8555,0xf0}, -{0x8556,0xfc}, -{0x8557,0xeb}, -{0x8558,0x8e}, -{0x8559,0xf0}, -{0x855a,0xa4}, -{0x855b,0xfe}, -{0x855c,0xa9}, -{0x855d,0xf0}, -{0x855e,0xeb}, -{0x855f,0x8f}, -{0x8560,0xf0}, -{0x8561,0xa4}, -{0x8562,0xcf}, -{0x8563,0xc5}, -{0x8564,0xf0}, -{0x8565,0x2e}, -{0x8566,0xcd}, -{0x8567,0x39}, -{0x8568,0xfe}, -{0x8569,0xe4}, -{0x856a,0x3c}, -{0x856b,0xfc}, -{0x856c,0xea}, -{0x856d,0xa4}, -{0x856e,0x2d}, -{0x856f,0xce}, -{0x8570,0x35}, -{0x8571,0xf0}, -{0x8572,0xfd}, -{0x8573,0xe4}, -{0x8574,0x3c}, -{0x8575,0xfc}, -{0x8576,0x22}, -{0x8577,0x75}, -{0x8578,0xf0}, -{0x8579,0x08}, -{0x857a,0x75}, -{0x857b,0x82}, -{0x857c,0x00}, -{0x857d,0xef}, -{0x857e,0x2f}, -{0x857f,0xff}, -{0x8580,0xee}, -{0x8581,0x33}, -{0x8582,0xfe}, -{0x8583,0xcd}, -{0x8584,0x33}, -{0x8585,0xcd}, -{0x8586,0xcc}, -{0x8587,0x33}, -{0x8588,0xcc}, -{0x8589,0xc5}, -{0x858a,0x82}, -{0x858b,0x33}, -{0x858c,0xc5}, -{0x858d,0x82}, -{0x858e,0x9b}, -{0x858f,0xed}, -{0x8590,0x9a}, -{0x8591,0xec}, -{0x8592,0x99}, -{0x8593,0xe5}, -{0x8594,0x82}, -{0x8595,0x98}, -{0x8596,0x40}, -{0x8597,0x0c}, -{0x8598,0xf5}, -{0x8599,0x82}, -{0x859a,0xee}, -{0x859b,0x9b}, -{0x859c,0xfe}, -{0x859d,0xed}, -{0x859e,0x9a}, -{0x859f,0xfd}, -{0x85a0,0xec}, -{0x85a1,0x99}, -{0x85a2,0xfc}, -{0x85a3,0x0f}, -{0x85a4,0xd5}, -{0x85a5,0xf0}, -{0x85a6,0xd6}, -{0x85a7,0xe4}, -{0x85a8,0xce}, -{0x85a9,0xfb}, -{0x85aa,0xe4}, -{0x85ab,0xcd}, -{0x85ac,0xfa}, -{0x85ad,0xe4}, -{0x85ae,0xcc}, -{0x85af,0xf9}, -{0x85b0,0xa8}, -{0x85b1,0x82}, -{0x85b2,0x22}, -{0x85b3,0xb8}, -{0x85b4,0x00}, -{0x85b5,0xc1}, -{0x85b6,0xb9}, -{0x85b7,0x00}, -{0x85b8,0x59}, -{0x85b9,0xba}, -{0x85ba,0x00}, -{0x85bb,0x2d}, -{0x85bc,0xec}, -{0x85bd,0x8b}, -{0x85be,0xf0}, -{0x85bf,0x84}, -{0x85c0,0xcf}, -{0x85c1,0xce}, -{0x85c2,0xcd}, -{0x85c3,0xfc}, -{0x85c4,0xe5}, -{0x85c5,0xf0}, -{0x85c6,0xcb}, -{0x85c7,0xf9}, -{0x85c8,0x78}, -{0x85c9,0x18}, -{0x85ca,0xef}, -{0x85cb,0x2f}, -{0x85cc,0xff}, -{0x85cd,0xee}, -{0x85ce,0x33}, -{0x85cf,0xfe}, -{0x85d0,0xed}, -{0x85d1,0x33}, -{0x85d2,0xfd}, -{0x85d3,0xec}, -{0x85d4,0x33}, -{0x85d5,0xfc}, -{0x85d6,0xeb}, -{0x85d7,0x33}, -{0x85d8,0xfb}, -{0x85d9,0x10}, -{0x85da,0xd7}, -{0x85db,0x03}, -{0x85dc,0x99}, -{0x85dd,0x40}, -{0x85de,0x04}, -{0x85df,0xeb}, -{0x85e0,0x99}, -{0x85e1,0xfb}, -{0x85e2,0x0f}, -{0x85e3,0xd8}, -{0x85e4,0xe5}, -{0x85e5,0xe4}, -{0x85e6,0xf9}, -{0x85e7,0xfa}, -{0x85e8,0x22}, -{0x85e9,0x78}, -{0x85ea,0x18}, -{0x85eb,0xef}, -{0x85ec,0x2f}, -{0x85ed,0xff}, -{0x85ee,0xee}, -{0x85ef,0x33}, -{0x85f0,0xfe}, -{0x85f1,0xed}, -{0x85f2,0x33}, -{0x85f3,0xfd}, -{0x85f4,0xec}, -{0x85f5,0x33}, -{0x85f6,0xfc}, -{0x85f7,0xc9}, -{0x85f8,0x33}, -{0x85f9,0xc9}, -{0x85fa,0x10}, -{0x85fb,0xd7}, -{0x85fc,0x05}, -{0x85fd,0x9b}, -{0x85fe,0xe9}, -{0x85ff,0x9a}, -{0x8600,0x40}, -{0x8601,0x07}, -{0x8602,0xec}, -{0x8603,0x9b}, -{0x8604,0xfc}, -{0x8605,0xe9}, -{0x8606,0x9a}, -{0x8607,0xf9}, -{0x8608,0x0f}, -{0x8609,0xd8}, -{0x860a,0xe0}, -{0x860b,0xe4}, -{0x860c,0xc9}, -{0x860d,0xfa}, -{0x860e,0xe4}, -{0x860f,0xcc}, -{0x8610,0xfb}, -{0x8611,0x22}, -{0x8612,0x75}, -{0x8613,0xf0}, -{0x8614,0x10}, -{0x8615,0xef}, -{0x8616,0x2f}, -{0x8617,0xff}, -{0x8618,0xee}, -{0x8619,0x33}, -{0x861a,0xfe}, -{0x861b,0xed}, -{0x861c,0x33}, -{0x861d,0xfd}, -{0x861e,0xcc}, -{0x861f,0x33}, -{0x8620,0xcc}, -{0x8621,0xc8}, -{0x8622,0x33}, -{0x8623,0xc8}, -{0x8624,0x10}, -{0x8625,0xd7}, -{0x8626,0x07}, -{0x8627,0x9b}, -{0x8628,0xec}, -{0x8629,0x9a}, -{0x862a,0xe8}, -{0x862b,0x99}, -{0x862c,0x40}, -{0x862d,0x0a}, -{0x862e,0xed}, -{0x862f,0x9b}, -{0x8630,0xfd}, -{0x8631,0xec}, -{0x8632,0x9a}, -{0x8633,0xfc}, -{0x8634,0xe8}, -{0x8635,0x99}, -{0x8636,0xf8}, -{0x8637,0x0f}, -{0x8638,0xd5}, -{0x8639,0xf0}, -{0x863a,0xda}, -{0x863b,0xe4}, -{0x863c,0xcd}, -{0x863d,0xfb}, -{0x863e,0xe4}, -{0x863f,0xcc}, -{0x8640,0xfa}, -{0x8641,0xe4}, -{0x8642,0xc8}, -{0x8643,0xf9}, -{0x8644,0x22}, -{0x8645,0xeb}, -{0x8646,0x9f}, -{0x8647,0xf5}, -{0x8648,0xf0}, -{0x8649,0xea}, -{0x864a,0x9e}, -{0x864b,0x42}, -{0x864c,0xf0}, -{0x864d,0xe9}, -{0x864e,0x9d}, -{0x864f,0x42}, -{0x8650,0xf0}, -{0x8651,0xe8}, -{0x8652,0x9c}, -{0x8653,0x45}, -{0x8654,0xf0}, -{0x8655,0x22}, -{0x8656,0xe8}, -{0x8657,0x60}, -{0x8658,0x0f}, -{0x8659,0xec}, -{0x865a,0xc3}, -{0x865b,0x13}, -{0x865c,0xfc}, -{0x865d,0xed}, -{0x865e,0x13}, -{0x865f,0xfd}, -{0x8660,0xee}, -{0x8661,0x13}, -{0x8662,0xfe}, -{0x8663,0xef}, -{0x8664,0x13}, -{0x8665,0xff}, -{0x8666,0xd8}, -{0x8667,0xf1}, -{0x8668,0x22}, -{0x8669,0xe8}, -{0x866a,0x60}, -{0x866b,0x0f}, -{0x866c,0xef}, -{0x866d,0xc3}, -{0x866e,0x33}, -{0x866f,0xff}, -{0x8670,0xee}, -{0x8671,0x33}, -{0x8672,0xfe}, -{0x8673,0xed}, -{0x8674,0x33}, -{0x8675,0xfd}, -{0x8676,0xec}, -{0x8677,0x33}, -{0x8678,0xfc}, -{0x8679,0xd8}, -{0x867a,0xf1}, -{0x867b,0x22}, -{0x867c,0xe4}, -{0x867d,0x93}, -{0x867e,0xfc}, -{0x867f,0x74}, -{0x8680,0x01}, -{0x8681,0x93}, -{0x8682,0xfd}, -{0x8683,0x74}, -{0x8684,0x02}, -{0x8685,0x93}, -{0x8686,0xfe}, -{0x8687,0x74}, -{0x8688,0x03}, -{0x8689,0x93}, -{0x868a,0xff}, -{0x868b,0x22}, -{0x868c,0xe6}, -{0x868d,0xfb}, -{0x868e,0x08}, -{0x868f,0xe6}, -{0x8690,0xf9}, -{0x8691,0x08}, -{0x8692,0xe6}, -{0x8693,0xfa}, -{0x8694,0x08}, -{0x8695,0xe6}, -{0x8696,0xcb}, -{0x8697,0xf8}, -{0x8698,0x22}, -{0x8699,0xec}, -{0x869a,0xf6}, -{0x869b,0x08}, -{0x869c,0xed}, -{0x869d,0xf6}, -{0x869e,0x08}, -{0x869f,0xee}, -{0x86a0,0xf6}, -{0x86a1,0x08}, -{0x86a2,0xef}, -{0x86a3,0xf6}, -{0x86a4,0x22}, -{0x86a5,0xa4}, -{0x86a6,0x25}, -{0x86a7,0x82}, -{0x86a8,0xf5}, -{0x86a9,0x82}, -{0x86aa,0xe5}, -{0x86ab,0xf0}, -{0x86ac,0x35}, -{0x86ad,0x83}, -{0x86ae,0xf5}, -{0x86af,0x83}, -{0x86b0,0x22}, -{0x86b1,0xd0}, -{0x86b2,0x83}, -{0x86b3,0xd0}, -{0x86b4,0x82}, -{0x86b5,0xf8}, -{0x86b6,0xe4}, -{0x86b7,0x93}, -{0x86b8,0x70}, -{0x86b9,0x12}, -{0x86ba,0x74}, -{0x86bb,0x01}, -{0x86bc,0x93}, -{0x86bd,0x70}, -{0x86be,0x0d}, -{0x86bf,0xa3}, -{0x86c0,0xa3}, -{0x86c1,0x93}, -{0x86c2,0xf8}, -{0x86c3,0x74}, -{0x86c4,0x01}, -{0x86c5,0x93}, -{0x86c6,0xf5}, -{0x86c7,0x82}, -{0x86c8,0x88}, -{0x86c9,0x83}, -{0x86ca,0xe4}, -{0x86cb,0x73}, -{0x86cc,0x74}, -{0x86cd,0x02}, -{0x86ce,0x93}, -{0x86cf,0x68}, -{0x86d0,0x60}, -{0x86d1,0xef}, -{0x86d2,0xa3}, -{0x86d3,0xa3}, -{0x86d4,0xa3}, -{0x86d5,0x80}, -{0x86d6,0xdf}, -{0x86d7,0x90}, -{0x86d8,0x38}, -{0x86d9,0x04}, -{0x86da,0x78}, -{0x86db,0x52}, -{0x86dc,0x12}, -{0x86dd,0x0b}, -{0x86de,0xfd}, -{0x86df,0x90}, -{0x86e0,0x38}, -{0x86e1,0x00}, -{0x86e2,0xe0}, -{0x86e3,0xfe}, -{0x86e4,0xa3}, -{0x86e5,0xe0}, -{0x86e6,0xfd}, -{0x86e7,0xed}, -{0x86e8,0xff}, -{0x86e9,0xc3}, -{0x86ea,0x12}, -{0x86eb,0x0b}, -{0x86ec,0x9e}, -{0x86ed,0x90}, -{0x86ee,0x38}, -{0x86ef,0x10}, -{0x86f0,0x12}, -{0x86f1,0x0b}, -{0x86f2,0x92}, -{0x86f3,0x90}, -{0x86f4,0x38}, -{0x86f5,0x06}, -{0x86f6,0x78}, -{0x86f7,0x54}, -{0x86f8,0x12}, -{0x86f9,0x0b}, -{0x86fa,0xfd}, -{0x86fb,0x90}, -{0x86fc,0x38}, -{0x86fd,0x02}, -{0x86fe,0xe0}, -{0x86ff,0xfe}, -{0x8700,0xa3}, -{0x8701,0xe0}, -{0x8702,0xfd}, -{0x8703,0xed}, -{0x8704,0xff}, -{0x8705,0xc3}, -{0x8706,0x12}, -{0x8707,0x0b}, -{0x8708,0x9e}, -{0x8709,0x90}, -{0x870a,0x38}, -{0x870b,0x12}, -{0x870c,0x12}, -{0x870d,0x0b}, -{0x870e,0x92}, -{0x870f,0xa3}, -{0x8710,0xe0}, -{0x8711,0xb4}, -{0x8712,0x31}, -{0x8713,0x07}, -{0x8714,0x78}, -{0x8715,0x52}, -{0x8716,0x79}, -{0x8717,0x52}, -{0x8718,0x12}, -{0x8719,0x0c}, -{0x871a,0x13}, -{0x871b,0x90}, -{0x871c,0x38}, -{0x871d,0x14}, -{0x871e,0xe0}, -{0x871f,0xb4}, -{0x8720,0x71}, -{0x8721,0x15}, -{0x8722,0x78}, -{0x8723,0x52}, -{0x8724,0xe6}, -{0x8725,0xfe}, -{0x8726,0x08}, -{0x8727,0xe6}, -{0x8728,0x78}, -{0x8729,0x02}, -{0x872a,0xce}, -{0x872b,0xc3}, -{0x872c,0x13}, -{0x872d,0xce}, -{0x872e,0x13}, -{0x872f,0xd8}, -{0x8730,0xf9}, -{0x8731,0x79}, -{0x8732,0x53}, -{0x8733,0xf7}, -{0x8734,0xee}, -{0x8735,0x19}, -{0x8736,0xf7}, -{0x8737,0x90}, -{0x8738,0x38}, -{0x8739,0x15}, -{0x873a,0xe0}, -{0x873b,0xb4}, -{0x873c,0x31}, -{0x873d,0x07}, -{0x873e,0x78}, -{0x873f,0x54}, -{0x8740,0x79}, -{0x8741,0x54}, -{0x8742,0x12}, -{0x8743,0x0c}, -{0x8744,0x13}, -{0x8745,0x90}, -{0x8746,0x38}, -{0x8747,0x15}, -{0x8748,0xe0}, -{0x8749,0xb4}, -{0x874a,0x71}, -{0x874b,0x15}, -{0x874c,0x78}, -{0x874d,0x54}, -{0x874e,0xe6}, -{0x874f,0xfe}, -{0x8750,0x08}, -{0x8751,0xe6}, -{0x8752,0x78}, -{0x8753,0x02}, -{0x8754,0xce}, -{0x8755,0xc3}, -{0x8756,0x13}, -{0x8757,0xce}, -{0x8758,0x13}, -{0x8759,0xd8}, -{0x875a,0xf9}, -{0x875b,0x79}, -{0x875c,0x55}, -{0x875d,0xf7}, -{0x875e,0xee}, -{0x875f,0x19}, -{0x8760,0xf7}, -{0x8761,0x79}, -{0x8762,0x52}, -{0x8763,0x12}, -{0x8764,0x0b}, -{0x8765,0xd9}, -{0x8766,0x09}, -{0x8767,0x12}, -{0x8768,0x0b}, -{0x8769,0xd9}, -{0x876a,0xaf}, -{0x876b,0x47}, -{0x876c,0x12}, -{0x876d,0x0b}, -{0x876e,0xb2}, -{0x876f,0xe5}, -{0x8770,0x44}, -{0x8771,0xfb}, -{0x8772,0x7a}, -{0x8773,0x00}, -{0x8774,0xfd}, -{0x8775,0x7c}, -{0x8776,0x00}, -{0x8777,0x12}, -{0x8778,0x04}, -{0x8779,0xd3}, -{0x877a,0x78}, -{0x877b,0x5a}, -{0x877c,0xa6}, -{0x877d,0x06}, -{0x877e,0x08}, -{0x877f,0xa6}, -{0x8780,0x07}, -{0x8781,0xaf}, -{0x8782,0x45}, -{0x8783,0x12}, -{0x8784,0x0b}, -{0x8785,0xb2}, -{0x8786,0xad}, -{0x8787,0x03}, -{0x8788,0x7c}, -{0x8789,0x00}, -{0x878a,0x12}, -{0x878b,0x04}, -{0x878c,0xd3}, -{0x878d,0x78}, -{0x878e,0x56}, -{0x878f,0xa6}, -{0x8790,0x06}, -{0x8791,0x08}, -{0x8792,0xa6}, -{0x8793,0x07}, -{0x8794,0xaf}, -{0x8795,0x48}, -{0x8796,0x78}, -{0x8797,0x54}, -{0x8798,0x12}, -{0x8799,0x0b}, -{0x879a,0xb4}, -{0x879b,0xe5}, -{0x879c,0x43}, -{0x879d,0xfb}, -{0x879e,0xfd}, -{0x879f,0x7c}, -{0x87a0,0x00}, -{0x87a1,0x12}, -{0x87a2,0x04}, -{0x87a3,0xd3}, -{0x87a4,0x78}, -{0x87a5,0x5c}, -{0x87a6,0xa6}, -{0x87a7,0x06}, -{0x87a8,0x08}, -{0x87a9,0xa6}, -{0x87aa,0x07}, -{0x87ab,0xaf}, -{0x87ac,0x46}, -{0x87ad,0x7e}, -{0x87ae,0x00}, -{0x87af,0x78}, -{0x87b0,0x54}, -{0x87b1,0x12}, -{0x87b2,0x0b}, -{0x87b3,0xb6}, -{0x87b4,0xad}, -{0x87b5,0x03}, -{0x87b6,0x7c}, -{0x87b7,0x00}, -{0x87b8,0x12}, -{0x87b9,0x04}, -{0x87ba,0xd3}, -{0x87bb,0x78}, -{0x87bc,0x58}, -{0x87bd,0xa6}, -{0x87be,0x06}, -{0x87bf,0x08}, -{0x87c0,0xa6}, -{0x87c1,0x07}, -{0x87c2,0xc3}, -{0x87c3,0x78}, -{0x87c4,0x5b}, -{0x87c5,0xe6}, -{0x87c6,0x94}, -{0x87c7,0x08}, -{0x87c8,0x18}, -{0x87c9,0xe6}, -{0x87ca,0x94}, -{0x87cb,0x00}, -{0x87cc,0x50}, -{0x87cd,0x05}, -{0x87ce,0x76}, -{0x87cf,0x00}, -{0x87d0,0x08}, -{0x87d1,0x76}, -{0x87d2,0x08}, -{0x87d3,0xc3}, -{0x87d4,0x78}, -{0x87d5,0x5d}, -{0x87d6,0xe6}, -{0x87d7,0x94}, -{0x87d8,0x08}, -{0x87d9,0x18}, -{0x87da,0xe6}, -{0x87db,0x94}, -{0x87dc,0x00}, -{0x87dd,0x50}, -{0x87de,0x05}, -{0x87df,0x76}, -{0x87e0,0x00}, -{0x87e1,0x08}, -{0x87e2,0x76}, -{0x87e3,0x08}, -{0x87e4,0x78}, -{0x87e5,0x5a}, -{0x87e6,0x12}, -{0x87e7,0x0b}, -{0x87e8,0xc6}, -{0x87e9,0xff}, -{0x87ea,0xd3}, -{0x87eb,0x78}, -{0x87ec,0x57}, -{0x87ed,0xe6}, -{0x87ee,0x9f}, -{0x87ef,0x18}, -{0x87f0,0xe6}, -{0x87f1,0x9e}, -{0x87f2,0x40}, -{0x87f3,0x0e}, -{0x87f4,0x78}, -{0x87f5,0x5a}, -{0x87f6,0xe6}, -{0x87f7,0x13}, -{0x87f8,0xfe}, -{0x87f9,0x08}, -{0x87fa,0xe6}, -{0x87fb,0x78}, -{0x87fc,0x57}, -{0x87fd,0x12}, -{0x87fe,0x0c}, -{0x87ff,0x08}, -{0x8800,0x80}, -{0x8801,0x04}, -{0x8802,0x7e}, -{0x8803,0x00}, -{0x8804,0x7f}, -{0x8805,0x00}, -{0x8806,0x78}, -{0x8807,0x5e}, -{0x8808,0x12}, -{0x8809,0x0b}, -{0x880a,0xbe}, -{0x880b,0xff}, -{0x880c,0xd3}, -{0x880d,0x78}, -{0x880e,0x59}, -{0x880f,0xe6}, -{0x8810,0x9f}, -{0x8811,0x18}, -{0x8812,0xe6}, -{0x8813,0x9e}, -{0x8814,0x40}, -{0x8815,0x0e}, -{0x8816,0x78}, -{0x8817,0x5c}, -{0x8818,0xe6}, -{0x8819,0x13}, -{0x881a,0xfe}, -{0x881b,0x08}, -{0x881c,0xe6}, -{0x881d,0x78}, -{0x881e,0x59}, -{0x881f,0x12}, -{0x8820,0x0c}, -{0x8821,0x08}, -{0x8822,0x80}, -{0x8823,0x04}, -{0x8824,0x7e}, -{0x8825,0x00}, -{0x8826,0x7f}, -{0x8827,0x00}, -{0x8828,0xe4}, -{0x8829,0xfc}, -{0x882a,0xfd}, -{0x882b,0x78}, -{0x882c,0x62}, -{0x882d,0x12}, -{0x882e,0x06}, -{0x882f,0x99}, -{0x8830,0x78}, -{0x8831,0x5a}, -{0x8832,0x12}, -{0x8833,0x0b}, -{0x8834,0xc6}, -{0x8835,0x78}, -{0x8836,0x57}, -{0x8837,0x26}, -{0x8838,0xff}, -{0x8839,0xee}, -{0x883a,0x18}, -{0x883b,0x36}, -{0x883c,0xfe}, -{0x883d,0x78}, -{0x883e,0x66}, -{0x883f,0x12}, -{0x8840,0x0b}, -{0x8841,0xbe}, -{0x8842,0x78}, -{0x8843,0x59}, -{0x8844,0x26}, -{0x8845,0xff}, -{0x8846,0xee}, -{0x8847,0x18}, -{0x8848,0x36}, -{0x8849,0xfe}, -{0x884a,0xe4}, -{0x884b,0xfc}, -{0x884c,0xfd}, -{0x884d,0x78}, -{0x884e,0x6a}, -{0x884f,0x12}, -{0x8850,0x06}, -{0x8851,0x99}, -{0x8852,0x12}, -{0x8853,0x0b}, -{0x8854,0xce}, -{0x8855,0x78}, -{0x8856,0x66}, -{0x8857,0x12}, -{0x8858,0x06}, -{0x8859,0x8c}, -{0x885a,0xd3}, -{0x885b,0x12}, -{0x885c,0x06}, -{0x885d,0x45}, -{0x885e,0x40}, -{0x885f,0x08}, -{0x8860,0x12}, -{0x8861,0x0b}, -{0x8862,0xce}, -{0x8863,0x78}, -{0x8864,0x66}, -{0x8865,0x12}, -{0x8866,0x06}, -{0x8867,0x99}, -{0x8868,0x78}, -{0x8869,0x54}, -{0x886a,0x12}, -{0x886b,0x0b}, -{0x886c,0xd0}, -{0x886d,0x78}, -{0x886e,0x6a}, -{0x886f,0x12}, -{0x8870,0x06}, -{0x8871,0x8c}, -{0x8872,0xd3}, -{0x8873,0x12}, -{0x8874,0x06}, -{0x8875,0x45}, -{0x8876,0x40}, -{0x8877,0x0a}, -{0x8878,0x78}, -{0x8879,0x54}, -{0x887a,0x12}, -{0x887b,0x0b}, -{0x887c,0xd0}, -{0x887d,0x78}, -{0x887e,0x6a}, -{0x887f,0x12}, -{0x8880,0x06}, -{0x8881,0x99}, -{0x8882,0x78}, -{0x8883,0x61}, -{0x8884,0xe6}, -{0x8885,0x90}, -{0x8886,0x60}, -{0x8887,0x01}, -{0x8888,0xf0}, -{0x8889,0x78}, -{0x888a,0x65}, -{0x888b,0xe6}, -{0x888c,0xa3}, -{0x888d,0xf0}, -{0x888e,0x78}, -{0x888f,0x69}, -{0x8890,0xe6}, -{0x8891,0xa3}, -{0x8892,0xf0}, -{0x8893,0x78}, -{0x8894,0x55}, -{0x8895,0xe6}, -{0x8896,0xa3}, -{0x8897,0xf0}, -{0x8898,0x7d}, -{0x8899,0x01}, -{0x889a,0x78}, -{0x889b,0x61}, -{0x889c,0x12}, -{0x889d,0x0b}, -{0x889e,0xe9}, -{0x889f,0x24}, -{0x88a0,0x01}, -{0x88a1,0x12}, -{0x88a2,0x0b}, -{0x88a3,0xa6}, -{0x88a4,0x78}, -{0x88a5,0x65}, -{0x88a6,0x12}, -{0x88a7,0x0b}, -{0x88a8,0xe9}, -{0x88a9,0x24}, -{0x88aa,0x02}, -{0x88ab,0x12}, -{0x88ac,0x0b}, -{0x88ad,0xa6}, -{0x88ae,0x78}, -{0x88af,0x69}, -{0x88b0,0x12}, -{0x88b1,0x0b}, -{0x88b2,0xe9}, -{0x88b3,0x24}, -{0x88b4,0x03}, -{0x88b5,0x12}, -{0x88b6,0x0b}, -{0x88b7,0xa6}, -{0x88b8,0x78}, -{0x88b9,0x6d}, -{0x88ba,0x12}, -{0x88bb,0x0b}, -{0x88bc,0xe9}, -{0x88bd,0x24}, -{0x88be,0x04}, -{0x88bf,0x12}, -{0x88c0,0x0b}, -{0x88c1,0xa6}, -{0x88c2,0x0d}, -{0x88c3,0xbd}, -{0x88c4,0x05}, -{0x88c5,0xd4}, -{0x88c6,0xc2}, -{0x88c7,0x0e}, -{0x88c8,0xc2}, -{0x88c9,0x06}, -{0x88ca,0x22}, -{0x88cb,0x85}, -{0x88cc,0x08}, -{0x88cd,0x41}, -{0x88ce,0x90}, -{0x88cf,0x30}, -{0x88d0,0x24}, -{0x88d1,0xe0}, -{0x88d2,0xf5}, -{0x88d3,0x3d}, -{0x88d4,0xa3}, -{0x88d5,0xe0}, -{0x88d6,0xf5}, -{0x88d7,0x3e}, -{0x88d8,0xa3}, -{0x88d9,0xe0}, -{0x88da,0xf5}, -{0x88db,0x3f}, -{0x88dc,0xa3}, -{0x88dd,0xe0}, -{0x88de,0xf5}, -{0x88df,0x40}, -{0x88e0,0xa3}, -{0x88e1,0xe0}, -{0x88e2,0xf5}, -{0x88e3,0x3c}, -{0x88e4,0xd2}, -{0x88e5,0x34}, -{0x88e6,0xe5}, -{0x88e7,0x41}, -{0x88e8,0x12}, -{0x88e9,0x06}, -{0x88ea,0xb1}, -{0x88eb,0x09}, -{0x88ec,0x31}, -{0x88ed,0x03}, -{0x88ee,0x09}, -{0x88ef,0x35}, -{0x88f0,0x04}, -{0x88f1,0x09}, -{0x88f2,0x3b}, -{0x88f3,0x05}, -{0x88f4,0x09}, -{0x88f5,0x3e}, -{0x88f6,0x06}, -{0x88f7,0x09}, -{0x88f8,0x41}, -{0x88f9,0x07}, -{0x88fa,0x09}, -{0x88fb,0x4a}, -{0x88fc,0x08}, -{0x88fd,0x09}, -{0x88fe,0x5b}, -{0x88ff,0x12}, -{0x8900,0x09}, -{0x8901,0x73}, -{0x8902,0x18}, -{0x8903,0x09}, -{0x8904,0x89}, -{0x8905,0x19}, -{0x8906,0x09}, -{0x8907,0x5e}, -{0x8908,0x1a}, -{0x8909,0x09}, -{0x890a,0x6a}, -{0x890b,0x1b}, -{0x890c,0x09}, -{0x890d,0xad}, -{0x890e,0x80}, -{0x890f,0x09}, -{0x8910,0xb2}, -{0x8911,0x81}, -{0x8912,0x0a}, -{0x8913,0x1d}, -{0x8914,0x8f}, -{0x8915,0x0a}, -{0x8916,0x09}, -{0x8917,0x90}, -{0x8918,0x0a}, -{0x8919,0x1d}, -{0x891a,0x91}, -{0x891b,0x0a}, -{0x891c,0x1d}, -{0x891d,0x92}, -{0x891e,0x0a}, -{0x891f,0x1d}, -{0x8920,0x93}, -{0x8921,0x0a}, -{0x8922,0x1d}, -{0x8923,0x94}, -{0x8924,0x0a}, -{0x8925,0x1d}, -{0x8926,0x98}, -{0x8927,0x0a}, -{0x8928,0x17}, -{0x8929,0x9f}, -{0x892a,0x0a}, -{0x892b,0x1a}, -{0x892c,0xec}, -{0x892d,0x00}, -{0x892e,0x00}, -{0x892f,0x0a}, -{0x8930,0x38}, -{0x8931,0x12}, -{0x8932,0x0f}, -{0x8933,0x74}, -{0x8934,0x22}, -{0x8935,0x12}, -{0x8936,0x0f}, -{0x8937,0x74}, -{0x8938,0xd2}, -{0x8939,0x03}, -{0x893a,0x22}, -{0x893b,0xd2}, -{0x893c,0x03}, -{0x893d,0x22}, -{0x893e,0xc2}, -{0x893f,0x03}, -{0x8940,0x22}, -{0x8941,0xa2}, -{0x8942,0x37}, -{0x8943,0xe4}, -{0x8944,0x33}, -{0x8945,0xf5}, -{0x8946,0x3c}, -{0x8947,0x02}, -{0x8948,0x0a}, -{0x8949,0x1d}, -{0x894a,0xc2}, -{0x894b,0x01}, -{0x894c,0xc2}, -{0x894d,0x02}, -{0x894e,0xc2}, -{0x894f,0x03}, -{0x8950,0x12}, -{0x8951,0x0d}, -{0x8952,0x0d}, -{0x8953,0x75}, -{0x8954,0x1e}, -{0x8955,0x70}, -{0x8956,0xd2}, -{0x8957,0x35}, -{0x8958,0x02}, -{0x8959,0x0a}, -{0x895a,0x1d}, -{0x895b,0x02}, -{0x895c,0x0a}, -{0x895d,0x04}, -{0x895e,0x85}, -{0x895f,0x40}, -{0x8960,0x4a}, -{0x8961,0x85}, -{0x8962,0x3c}, -{0x8963,0x4b}, -{0x8964,0x12}, -{0x8965,0x0a}, -{0x8966,0xff}, -{0x8967,0x02}, -{0x8968,0x0a}, -{0x8969,0x1d}, -{0x896a,0x85}, -{0x896b,0x4a}, -{0x896c,0x40}, -{0x896d,0x85}, -{0x896e,0x4b}, -{0x896f,0x3c}, -{0x8970,0x02}, -{0x8971,0x0a}, -{0x8972,0x1d}, -{0x8973,0xe4}, -{0x8974,0xf5}, -{0x8975,0x22}, -{0x8976,0xf5}, -{0x8977,0x23}, -{0x8978,0x85}, -{0x8979,0x40}, -{0x897a,0x31}, -{0x897b,0x85}, -{0x897c,0x3f}, -{0x897d,0x30}, -{0x897e,0x85}, -{0x897f,0x3e}, -{0x8980,0x2f}, -{0x8981,0x85}, -{0x8982,0x3d}, -{0x8983,0x2e}, -{0x8984,0x12}, -{0x8985,0x0f}, -{0x8986,0x46}, -{0x8987,0x80}, -{0x8988,0x1f}, -{0x8989,0x75}, -{0x898a,0x22}, -{0x898b,0x00}, -{0x898c,0x75}, -{0x898d,0x23}, -{0x898e,0x01}, -{0x898f,0x74}, -{0x8990,0xff}, -{0x8991,0xf5}, -{0x8992,0x2d}, -{0x8993,0xf5}, -{0x8994,0x2c}, -{0x8995,0xf5}, -{0x8996,0x2b}, -{0x8997,0xf5}, -{0x8998,0x2a}, -{0x8999,0x12}, -{0x899a,0x0f}, -{0x899b,0x46}, -{0x899c,0x85}, -{0x899d,0x2d}, -{0x899e,0x40}, -{0x899f,0x85}, -{0x89a0,0x2c}, -{0x89a1,0x3f}, -{0x89a2,0x85}, -{0x89a3,0x2b}, -{0x89a4,0x3e}, -{0x89a5,0x85}, -{0x89a6,0x2a}, -{0x89a7,0x3d}, -{0x89a8,0xe4}, -{0x89a9,0xf5}, -{0x89aa,0x3c}, -{0x89ab,0x80}, -{0x89ac,0x70}, -{0x89ad,0x12}, -{0x89ae,0x0f}, -{0x89af,0x16}, -{0x89b0,0x80}, -{0x89b1,0x6b}, -{0x89b2,0x85}, -{0x89b3,0x3d}, -{0x89b4,0x45}, -{0x89b5,0x85}, -{0x89b6,0x3e}, -{0x89b7,0x46}, -{0x89b8,0xe5}, -{0x89b9,0x47}, -{0x89ba,0xc3}, -{0x89bb,0x13}, -{0x89bc,0xff}, -{0x89bd,0xe5}, -{0x89be,0x45}, -{0x89bf,0xc3}, -{0x89c0,0x9f}, -{0x89c1,0x50}, -{0x89c2,0x02}, -{0x89c3,0x8f}, -{0x89c4,0x45}, -{0x89c5,0xe5}, -{0x89c6,0x48}, -{0x89c7,0xc3}, -{0x89c8,0x13}, -{0x89c9,0xff}, -{0x89ca,0xe5}, -{0x89cb,0x46}, -{0x89cc,0xc3}, -{0x89cd,0x9f}, -{0x89ce,0x50}, -{0x89cf,0x02}, -{0x89d0,0x8f}, -{0x89d1,0x46}, -{0x89d2,0xe5}, -{0x89d3,0x47}, -{0x89d4,0xc3}, -{0x89d5,0x13}, -{0x89d6,0xff}, -{0x89d7,0xfd}, -{0x89d8,0xe5}, -{0x89d9,0x45}, -{0x89da,0x2d}, -{0x89db,0xfd}, -{0x89dc,0xe4}, -{0x89dd,0x33}, -{0x89de,0xfc}, -{0x89df,0xe5}, -{0x89e0,0x44}, -{0x89e1,0x12}, -{0x89e2,0x0f}, -{0x89e3,0x90}, -{0x89e4,0x40}, -{0x89e5,0x05}, -{0x89e6,0xe5}, -{0x89e7,0x44}, -{0x89e8,0x9f}, -{0x89e9,0xf5}, -{0x89ea,0x45}, -{0x89eb,0xe5}, -{0x89ec,0x48}, -{0x89ed,0xc3}, -{0x89ee,0x13}, -{0x89ef,0xff}, -{0x89f0,0xfd}, -{0x89f1,0xe5}, -{0x89f2,0x46}, -{0x89f3,0x2d}, -{0x89f4,0xfd}, -{0x89f5,0xe4}, -{0x89f6,0x33}, -{0x89f7,0xfc}, -{0x89f8,0xe5}, -{0x89f9,0x43}, -{0x89fa,0x12}, -{0x89fb,0x0f}, -{0x89fc,0x90}, -{0x89fd,0x40}, -{0x89fe,0x05}, -{0x89ff,0xe5}, -{0x8a00,0x43}, -{0x8a01,0x9f}, -{0x8a02,0xf5}, -{0x8a03,0x46}, -{0x8a04,0x12}, -{0x8a05,0x06}, -{0x8a06,0xd7}, -{0x8a07,0x80}, -{0x8a08,0x14}, -{0x8a09,0x85}, -{0x8a0a,0x40}, -{0x8a0b,0x48}, -{0x8a0c,0x85}, -{0x8a0d,0x3f}, -{0x8a0e,0x47}, -{0x8a0f,0x85}, -{0x8a10,0x3e}, -{0x8a11,0x46}, -{0x8a12,0x85}, -{0x8a13,0x3d}, -{0x8a14,0x45}, -{0x8a15,0x80}, -{0x8a16,0x06}, -{0x8a17,0x02}, -{0x8a18,0x06}, -{0x8a19,0xd7}, -{0x8a1a,0x12}, -{0x8a1b,0x0d}, -{0x8a1c,0x7e}, -{0x8a1d,0x90}, -{0x8a1e,0x30}, -{0x8a1f,0x24}, -{0x8a20,0xe5}, -{0x8a21,0x3d}, -{0x8a22,0xf0}, -{0x8a23,0xa3}, -{0x8a24,0xe5}, -{0x8a25,0x3e}, -{0x8a26,0xf0}, -{0x8a27,0xa3}, -{0x8a28,0xe5}, -{0x8a29,0x3f}, -{0x8a2a,0xf0}, -{0x8a2b,0xa3}, -{0x8a2c,0xe5}, -{0x8a2d,0x40}, -{0x8a2e,0xf0}, -{0x8a2f,0xa3}, -{0x8a30,0xe5}, -{0x8a31,0x3c}, -{0x8a32,0xf0}, -{0x8a33,0x90}, -{0x8a34,0x30}, -{0x8a35,0x23}, -{0x8a36,0xe4}, -{0x8a37,0xf0}, -{0x8a38,0x22}, -{0x8a39,0xc0}, -{0x8a3a,0xe0}, -{0x8a3b,0xc0}, -{0x8a3c,0x83}, -{0x8a3d,0xc0}, -{0x8a3e,0x82}, -{0x8a3f,0xc0}, -{0x8a40,0xd0}, -{0x8a41,0x90}, -{0x8a42,0x3f}, -{0x8a43,0x0c}, -{0x8a44,0xe0}, -{0x8a45,0xf5}, -{0x8a46,0x32}, -{0x8a47,0xe5}, -{0x8a48,0x32}, -{0x8a49,0x30}, -{0x8a4a,0xe3}, -{0x8a4b,0x74}, -{0x8a4c,0x30}, -{0x8a4d,0x36}, -{0x8a4e,0x66}, -{0x8a4f,0x90}, -{0x8a50,0x60}, -{0x8a51,0x19}, -{0x8a52,0xe0}, -{0x8a53,0xf5}, -{0x8a54,0x0a}, -{0x8a55,0xa3}, -{0x8a56,0xe0}, -{0x8a57,0xf5}, -{0x8a58,0x0b}, -{0x8a59,0x90}, -{0x8a5a,0x60}, -{0x8a5b,0x1d}, -{0x8a5c,0xe0}, -{0x8a5d,0xf5}, -{0x8a5e,0x14}, -{0x8a5f,0xa3}, -{0x8a60,0xe0}, -{0x8a61,0xf5}, -{0x8a62,0x15}, -{0x8a63,0x90}, -{0x8a64,0x60}, -{0x8a65,0x21}, -{0x8a66,0xe0}, -{0x8a67,0xf5}, -{0x8a68,0x0c}, -{0x8a69,0xa3}, -{0x8a6a,0xe0}, -{0x8a6b,0xf5}, -{0x8a6c,0x0d}, -{0x8a6d,0x90}, -{0x8a6e,0x60}, -{0x8a6f,0x29}, -{0x8a70,0xe0}, -{0x8a71,0xf5}, -{0x8a72,0x0e}, -{0x8a73,0xa3}, -{0x8a74,0xe0}, -{0x8a75,0xf5}, -{0x8a76,0x0f}, -{0x8a77,0x90}, -{0x8a78,0x60}, -{0x8a79,0x31}, -{0x8a7a,0xe0}, -{0x8a7b,0xf5}, -{0x8a7c,0x10}, -{0x8a7d,0xa3}, -{0x8a7e,0xe0}, -{0x8a7f,0xf5}, -{0x8a80,0x11}, -{0x8a81,0x90}, -{0x8a82,0x60}, -{0x8a83,0x39}, -{0x8a84,0xe0}, -{0x8a85,0xf5}, -{0x8a86,0x12}, -{0x8a87,0xa3}, -{0x8a88,0xe0}, -{0x8a89,0xf5}, -{0x8a8a,0x13}, -{0x8a8b,0x30}, -{0x8a8c,0x01}, -{0x8a8d,0x06}, -{0x8a8e,0x30}, -{0x8a8f,0x33}, -{0x8a90,0x03}, -{0x8a91,0xd3}, -{0x8a92,0x80}, -{0x8a93,0x01}, -{0x8a94,0xc3}, -{0x8a95,0x92}, -{0x8a96,0x09}, -{0x8a97,0x30}, -{0x8a98,0x02}, -{0x8a99,0x06}, -{0x8a9a,0x30}, -{0x8a9b,0x33}, -{0x8a9c,0x03}, -{0x8a9d,0xd3}, -{0x8a9e,0x80}, -{0x8a9f,0x01}, -{0x8aa0,0xc3}, -{0x8aa1,0x92}, -{0x8aa2,0x0a}, -{0x8aa3,0x30}, -{0x8aa4,0x33}, -{0x8aa5,0x0c}, -{0x8aa6,0x30}, -{0x8aa7,0x03}, -{0x8aa8,0x09}, -{0x8aa9,0x20}, -{0x8aaa,0x02}, -{0x8aab,0x06}, -{0x8aac,0x20}, -{0x8aad,0x01}, -{0x8aae,0x03}, -{0x8aaf,0xd3}, -{0x8ab0,0x80}, -{0x8ab1,0x01}, -{0x8ab2,0xc3}, -{0x8ab3,0x92}, -{0x8ab4,0x0b}, -{0x8ab5,0x90}, -{0x8ab6,0x30}, -{0x8ab7,0x01}, -{0x8ab8,0xe0}, -{0x8ab9,0x44}, -{0x8aba,0x40}, -{0x8abb,0xf0}, -{0x8abc,0xe0}, -{0x8abd,0x54}, -{0x8abe,0xbf}, -{0x8abf,0xf0}, -{0x8ac0,0xe5}, -{0x8ac1,0x32}, -{0x8ac2,0x30}, -{0x8ac3,0xe1}, -{0x8ac4,0x14}, -{0x8ac5,0x30}, -{0x8ac6,0x34}, -{0x8ac7,0x11}, -{0x8ac8,0x90}, -{0x8ac9,0x30}, -{0x8aca,0x22}, -{0x8acb,0xe0}, -{0x8acc,0xf5}, -{0x8acd,0x08}, -{0x8ace,0xe4}, -{0x8acf,0xf0}, -{0x8ad0,0x30}, -{0x8ad1,0x00}, -{0x8ad2,0x03}, -{0x8ad3,0xd3}, -{0x8ad4,0x80}, -{0x8ad5,0x01}, -{0x8ad6,0xc3}, -{0x8ad7,0x92}, -{0x8ad8,0x08}, -{0x8ad9,0xe5}, -{0x8ada,0x32}, -{0x8adb,0x30}, -{0x8adc,0xe5}, -{0x8add,0x12}, -{0x8ade,0x90}, -{0x8adf,0x56}, -{0x8ae0,0xa1}, -{0x8ae1,0xe0}, -{0x8ae2,0xf5}, -{0x8ae3,0x09}, -{0x8ae4,0x30}, -{0x8ae5,0x31}, -{0x8ae6,0x09}, -{0x8ae7,0x30}, -{0x8ae8,0x05}, -{0x8ae9,0x03}, -{0x8aea,0xd3}, -{0x8aeb,0x80}, -{0x8aec,0x01}, -{0x8aed,0xc3}, -{0x8aee,0x92}, -{0x8aef,0x0d}, -{0x8af0,0x90}, -{0x8af1,0x3f}, -{0x8af2,0x0c}, -{0x8af3,0xe5}, -{0x8af4,0x32}, -{0x8af5,0xf0}, -{0x8af6,0xd0}, -{0x8af7,0xd0}, -{0x8af8,0xd0}, -{0x8af9,0x82}, -{0x8afa,0xd0}, -{0x8afb,0x83}, -{0x8afc,0xd0}, -{0x8afd,0xe0}, -{0x8afe,0x32}, -{0x8aff,0x90}, -{0x8b00,0x0e}, -{0x8b01,0x7e}, -{0x8b02,0xe4}, -{0x8b03,0x93}, -{0x8b04,0xfe}, -{0x8b05,0x74}, -{0x8b06,0x01}, -{0x8b07,0x93}, -{0x8b08,0xff}, -{0x8b09,0xc3}, -{0x8b0a,0x90}, -{0x8b0b,0x0e}, -{0x8b0c,0x7c}, -{0x8b0d,0x74}, -{0x8b0e,0x01}, -{0x8b0f,0x93}, -{0x8b10,0x9f}, -{0x8b11,0xff}, -{0x8b12,0xe4}, -{0x8b13,0x93}, -{0x8b14,0x9e}, -{0x8b15,0xfe}, -{0x8b16,0xe4}, -{0x8b17,0x8f}, -{0x8b18,0x3b}, -{0x8b19,0x8e}, -{0x8b1a,0x3a}, -{0x8b1b,0xf5}, -{0x8b1c,0x39}, -{0x8b1d,0xf5}, -{0x8b1e,0x38}, -{0x8b1f,0xab}, -{0x8b20,0x3b}, -{0x8b21,0xaa}, -{0x8b22,0x3a}, -{0x8b23,0xa9}, -{0x8b24,0x39}, -{0x8b25,0xa8}, -{0x8b26,0x38}, -{0x8b27,0xaf}, -{0x8b28,0x4b}, -{0x8b29,0xfc}, -{0x8b2a,0xfd}, -{0x8b2b,0xfe}, -{0x8b2c,0x12}, -{0x8b2d,0x05}, -{0x8b2e,0x28}, -{0x8b2f,0x12}, -{0x8b30,0x0d}, -{0x8b31,0xe1}, -{0x8b32,0xe4}, -{0x8b33,0x7b}, -{0x8b34,0xff}, -{0x8b35,0xfa}, -{0x8b36,0xf9}, -{0x8b37,0xf8}, -{0x8b38,0x12}, -{0x8b39,0x05}, -{0x8b3a,0xb3}, -{0x8b3b,0x12}, -{0x8b3c,0x0d}, -{0x8b3d,0xe1}, -{0x8b3e,0x90}, -{0x8b3f,0x0e}, -{0x8b40,0x69}, -{0x8b41,0xe4}, -{0x8b42,0x12}, -{0x8b43,0x0d}, -{0x8b44,0xf6}, -{0x8b45,0x12}, -{0x8b46,0x0d}, -{0x8b47,0xe1}, -{0x8b48,0xe4}, -{0x8b49,0x85}, -{0x8b4a,0x4a}, -{0x8b4b,0x37}, -{0x8b4c,0xf5}, -{0x8b4d,0x36}, -{0x8b4e,0xf5}, -{0x8b4f,0x35}, -{0x8b50,0xf5}, -{0x8b51,0x34}, -{0x8b52,0xaf}, -{0x8b53,0x37}, -{0x8b54,0xae}, -{0x8b55,0x36}, -{0x8b56,0xad}, -{0x8b57,0x35}, -{0x8b58,0xac}, -{0x8b59,0x34}, -{0x8b5a,0xa3}, -{0x8b5b,0x12}, -{0x8b5c,0x0d}, -{0x8b5d,0xf6}, -{0x8b5e,0x8f}, -{0x8b5f,0x37}, -{0x8b60,0x8e}, -{0x8b61,0x36}, -{0x8b62,0x8d}, -{0x8b63,0x35}, -{0x8b64,0x8c}, -{0x8b65,0x34}, -{0x8b66,0xe5}, -{0x8b67,0x3b}, -{0x8b68,0x45}, -{0x8b69,0x37}, -{0x8b6a,0xf5}, -{0x8b6b,0x3b}, -{0x8b6c,0xe5}, -{0x8b6d,0x3a}, -{0x8b6e,0x45}, -{0x8b6f,0x36}, -{0x8b70,0xf5}, -{0x8b71,0x3a}, -{0x8b72,0xe5}, -{0x8b73,0x39}, -{0x8b74,0x45}, -{0x8b75,0x35}, -{0x8b76,0xf5}, -{0x8b77,0x39}, -{0x8b78,0xe5}, -{0x8b79,0x38}, -{0x8b7a,0x45}, -{0x8b7b,0x34}, -{0x8b7c,0xf5}, -{0x8b7d,0x38}, -{0x8b7e,0xe4}, -{0x8b7f,0xf5}, -{0x8b80,0x22}, -{0x8b81,0xf5}, -{0x8b82,0x23}, -{0x8b83,0x85}, -{0x8b84,0x3b}, -{0x8b85,0x31}, -{0x8b86,0x85}, -{0x8b87,0x3a}, -{0x8b88,0x30}, -{0x8b89,0x85}, -{0x8b8a,0x39}, -{0x8b8b,0x2f}, -{0x8b8c,0x85}, -{0x8b8d,0x38}, -{0x8b8e,0x2e}, -{0x8b8f,0x02}, -{0x8b90,0x0f}, -{0x8b91,0x46}, -{0x8b92,0xe0}, -{0x8b93,0xa3}, -{0x8b94,0xe0}, -{0x8b95,0x75}, -{0x8b96,0xf0}, -{0x8b97,0x02}, -{0x8b98,0xa4}, -{0x8b99,0xff}, -{0x8b9a,0xae}, -{0x8b9b,0xf0}, -{0x8b9c,0xc3}, -{0x8b9d,0x08}, -{0x8b9e,0xe6}, -{0x8b9f,0x9f}, -{0x8ba0,0xf6}, -{0x8ba1,0x18}, -{0x8ba2,0xe6}, -{0x8ba3,0x9e}, -{0x8ba4,0xf6}, -{0x8ba5,0x22}, -{0x8ba6,0xff}, -{0x8ba7,0xe5}, -{0x8ba8,0xf0}, -{0x8ba9,0x34}, -{0x8baa,0x60}, -{0x8bab,0x8f}, -{0x8bac,0x82}, -{0x8bad,0xf5}, -{0x8bae,0x83}, -{0x8baf,0xec}, -{0x8bb0,0xf0}, -{0x8bb1,0x22}, -{0x8bb2,0x78}, -{0x8bb3,0x52}, -{0x8bb4,0x7e}, -{0x8bb5,0x00}, -{0x8bb6,0xe6}, -{0x8bb7,0xfc}, -{0x8bb8,0x08}, -{0x8bb9,0xe6}, -{0x8bba,0xfd}, -{0x8bbb,0x02}, -{0x8bbc,0x04}, -{0x8bbd,0xc1}, -{0x8bbe,0xe4}, -{0x8bbf,0xfc}, -{0x8bc0,0xfd}, -{0x8bc1,0x12}, -{0x8bc2,0x06}, -{0x8bc3,0x99}, -{0x8bc4,0x78}, -{0x8bc5,0x5c}, -{0x8bc6,0xe6}, -{0x8bc7,0xc3}, -{0x8bc8,0x13}, -{0x8bc9,0xfe}, -{0x8bca,0x08}, -{0x8bcb,0xe6}, -{0x8bcc,0x13}, -{0x8bcd,0x22}, -{0x8bce,0x78}, -{0x8bcf,0x52}, -{0x8bd0,0xe6}, -{0x8bd1,0xfe}, -{0x8bd2,0x08}, -{0x8bd3,0xe6}, -{0x8bd4,0xff}, -{0x8bd5,0xe4}, -{0x8bd6,0xfc}, -{0x8bd7,0xfd}, -{0x8bd8,0x22}, -{0x8bd9,0xe7}, -{0x8bda,0xc4}, -{0x8bdb,0xf8}, -{0x8bdc,0x54}, -{0x8bdd,0xf0}, -{0x8bde,0xc8}, -{0x8bdf,0x68}, -{0x8be0,0xf7}, -{0x8be1,0x09}, -{0x8be2,0xe7}, -{0x8be3,0xc4}, -{0x8be4,0x54}, -{0x8be5,0x0f}, -{0x8be6,0x48}, -{0x8be7,0xf7}, -{0x8be8,0x22}, -{0x8be9,0xe6}, -{0x8bea,0xfc}, -{0x8beb,0xed}, -{0x8bec,0x75}, -{0x8bed,0xf0}, -{0x8bee,0x04}, -{0x8bef,0xa4}, -{0x8bf0,0x22}, -{0x8bf1,0x12}, -{0x8bf2,0x06}, -{0x8bf3,0x7c}, -{0x8bf4,0x8f}, -{0x8bf5,0x48}, -{0x8bf6,0x8e}, -{0x8bf7,0x47}, -{0x8bf8,0x8d}, -{0x8bf9,0x46}, -{0x8bfa,0x8c}, -{0x8bfb,0x45}, -{0x8bfc,0x22}, -{0x8bfd,0xe0}, -{0x8bfe,0xfe}, -{0x8bff,0xa3}, -{0x8c00,0xe0}, -{0x8c01,0xfd}, -{0x8c02,0xee}, -{0x8c03,0xf6}, -{0x8c04,0xed}, -{0x8c05,0x08}, -{0x8c06,0xf6}, -{0x8c07,0x22}, -{0x8c08,0x13}, -{0x8c09,0xff}, -{0x8c0a,0xc3}, -{0x8c0b,0xe6}, -{0x8c0c,0x9f}, -{0x8c0d,0xff}, -{0x8c0e,0x18}, -{0x8c0f,0xe6}, -{0x8c10,0x9e}, -{0x8c11,0xfe}, -{0x8c12,0x22}, -{0x8c13,0xe6}, -{0x8c14,0xc3}, -{0x8c15,0x13}, -{0x8c16,0xf7}, -{0x8c17,0x08}, -{0x8c18,0xe6}, -{0x8c19,0x13}, -{0x8c1a,0x09}, -{0x8c1b,0xf7}, -{0x8c1c,0x22}, -{0x8c1d,0xad}, -{0x8c1e,0x39}, -{0x8c1f,0xac}, -{0x8c20,0x38}, -{0x8c21,0xfa}, -{0x8c22,0xf9}, -{0x8c23,0xf8}, -{0x8c24,0x12}, -{0x8c25,0x05}, -{0x8c26,0x28}, -{0x8c27,0x8f}, -{0x8c28,0x3b}, -{0x8c29,0x8e}, -{0x8c2a,0x3a}, -{0x8c2b,0x8d}, -{0x8c2c,0x39}, -{0x8c2d,0x8c}, -{0x8c2e,0x38}, -{0x8c2f,0xab}, -{0x8c30,0x37}, -{0x8c31,0xaa}, -{0x8c32,0x36}, -{0x8c33,0xa9}, -{0x8c34,0x35}, -{0x8c35,0xa8}, -{0x8c36,0x34}, -{0x8c37,0x22}, -{0x8c38,0x93}, -{0x8c39,0xff}, -{0x8c3a,0xe4}, -{0x8c3b,0xfc}, -{0x8c3c,0xfd}, -{0x8c3d,0xfe}, -{0x8c3e,0x12}, -{0x8c3f,0x05}, -{0x8c40,0x28}, -{0x8c41,0x8f}, -{0x8c42,0x37}, -{0x8c43,0x8e}, -{0x8c44,0x36}, -{0x8c45,0x8d}, -{0x8c46,0x35}, -{0x8c47,0x8c}, -{0x8c48,0x34}, -{0x8c49,0x22}, -{0x8c4a,0x78}, -{0x8c4b,0x84}, -{0x8c4c,0xe6}, -{0x8c4d,0xfe}, -{0x8c4e,0x08}, -{0x8c4f,0xe6}, -{0x8c50,0xff}, -{0x8c51,0xe4}, -{0x8c52,0x8f}, -{0x8c53,0x37}, -{0x8c54,0x8e}, -{0x8c55,0x36}, -{0x8c56,0xf5}, -{0x8c57,0x35}, -{0x8c58,0xf5}, -{0x8c59,0x34}, -{0x8c5a,0x22}, -{0x8c5b,0x90}, -{0x8c5c,0x0e}, -{0x8c5d,0x8c}, -{0x8c5e,0xe4}, -{0x8c5f,0x93}, -{0x8c60,0x25}, -{0x8c61,0xe0}, -{0x8c62,0x24}, -{0x8c63,0x0a}, -{0x8c64,0xf8}, -{0x8c65,0xe6}, -{0x8c66,0xfe}, -{0x8c67,0x08}, -{0x8c68,0xe6}, -{0x8c69,0xff}, -{0x8c6a,0x22}, -{0x8c6b,0xe6}, -{0x8c6c,0xfe}, -{0x8c6d,0x08}, -{0x8c6e,0xe6}, -{0x8c6f,0xff}, -{0x8c70,0xe4}, -{0x8c71,0x8f}, -{0x8c72,0x3b}, -{0x8c73,0x8e}, -{0x8c74,0x3a}, -{0x8c75,0xf5}, -{0x8c76,0x39}, -{0x8c77,0xf5}, -{0x8c78,0x38}, -{0x8c79,0x22}, -{0x8c7a,0x78}, -{0x8c7b,0x4e}, -{0x8c7c,0xe6}, -{0x8c7d,0xfe}, -{0x8c7e,0x08}, -{0x8c7f,0xe6}, -{0x8c80,0xff}, -{0x8c81,0x22}, -{0x8c82,0xef}, -{0x8c83,0x25}, -{0x8c84,0xe0}, -{0x8c85,0x24}, -{0x8c86,0x4e}, -{0x8c87,0xf8}, -{0x8c88,0xe6}, -{0x8c89,0xfc}, -{0x8c8a,0x08}, -{0x8c8b,0xe6}, -{0x8c8c,0xfd}, -{0x8c8d,0x22}, -{0x8c8e,0x78}, -{0x8c8f,0x89}, -{0x8c90,0xef}, -{0x8c91,0x26}, -{0x8c92,0xf6}, -{0x8c93,0x18}, -{0x8c94,0xe4}, -{0x8c95,0x36}, -{0x8c96,0xf6}, -{0x8c97,0x22}, -{0x8c98,0x75}, -{0x8c99,0x89}, -{0x8c9a,0x03}, -{0x8c9b,0x75}, -{0x8c9c,0xa8}, -{0x8c9d,0x01}, -{0x8c9e,0x75}, -{0x8c9f,0xb8}, -{0x8ca0,0x04}, -{0x8ca1,0x75}, -{0x8ca2,0x34}, -{0x8ca3,0xff}, -{0x8ca4,0x75}, -{0x8ca5,0x35}, -{0x8ca6,0x0e}, -{0x8ca7,0x75}, -{0x8ca8,0x36}, -{0x8ca9,0x15}, -{0x8caa,0x75}, -{0x8cab,0x37}, -{0x8cac,0x0d}, -{0x8cad,0x12}, -{0x8cae,0x0e}, -{0x8caf,0x9a}, -{0x8cb0,0x12}, -{0x8cb1,0x00}, -{0x8cb2,0x09}, -{0x8cb3,0x12}, -{0x8cb4,0x0f}, -{0x8cb5,0x16}, -{0x8cb6,0x12}, -{0x8cb7,0x00}, -{0x8cb8,0x06}, -{0x8cb9,0xd2}, -{0x8cba,0x00}, -{0x8cbb,0xd2}, -{0x8cbc,0x34}, -{0x8cbd,0xd2}, -{0x8cbe,0xaf}, -{0x8cbf,0x75}, -{0x8cc0,0x34}, -{0x8cc1,0xff}, -{0x8cc2,0x75}, -{0x8cc3,0x35}, -{0x8cc4,0x0e}, -{0x8cc5,0x75}, -{0x8cc6,0x36}, -{0x8cc7,0x49}, -{0x8cc8,0x75}, -{0x8cc9,0x37}, -{0x8cca,0x03}, -{0x8ccb,0x12}, -{0x8ccc,0x0e}, -{0x8ccd,0x9a}, -{0x8cce,0x30}, -{0x8ccf,0x08}, -{0x8cd0,0x09}, -{0x8cd1,0xc2}, -{0x8cd2,0x34}, -{0x8cd3,0x12}, -{0x8cd4,0x08}, -{0x8cd5,0xcb}, -{0x8cd6,0xc2}, -{0x8cd7,0x08}, -{0x8cd8,0xd2}, -{0x8cd9,0x34}, -{0x8cda,0x30}, -{0x8cdb,0x0b}, -{0x8cdc,0x09}, -{0x8cdd,0xc2}, -{0x8cde,0x36}, -{0x8cdf,0x12}, -{0x8ce0,0x02}, -{0x8ce1,0x6c}, -{0x8ce2,0xc2}, -{0x8ce3,0x0b}, -{0x8ce4,0xd2}, -{0x8ce5,0x36}, -{0x8ce6,0x30}, -{0x8ce7,0x09}, -{0x8ce8,0x09}, -{0x8ce9,0xc2}, -{0x8cea,0x36}, -{0x8ceb,0x12}, -{0x8cec,0x00}, -{0x8ced,0x0e}, -{0x8cee,0xc2}, -{0x8cef,0x09}, -{0x8cf0,0xd2}, -{0x8cf1,0x36}, -{0x8cf2,0x30}, -{0x8cf3,0x0e}, -{0x8cf4,0x03}, -{0x8cf5,0x12}, -{0x8cf6,0x06}, -{0x8cf7,0xd7}, -{0x8cf8,0x30}, -{0x8cf9,0x35}, -{0x8cfa,0xd3}, -{0x8cfb,0x90}, -{0x8cfc,0x30}, -{0x8cfd,0x29}, -{0x8cfe,0xe5}, -{0x8cff,0x1e}, -{0x8d00,0xf0}, -{0x8d01,0xb4}, -{0x8d02,0x10}, -{0x8d03,0x05}, -{0x8d04,0x90}, -{0x8d05,0x30}, -{0x8d06,0x23}, -{0x8d07,0xe4}, -{0x8d08,0xf0}, -{0x8d09,0xc2}, -{0x8d0a,0x35}, -{0x8d0b,0x80}, -{0x8d0c,0xc1}, -{0x8d0d,0xe4}, -{0x8d0e,0xf5}, -{0x8d0f,0x4b}, -{0x8d10,0x90}, -{0x8d11,0x0e}, -{0x8d12,0x7a}, -{0x8d13,0x93}, -{0x8d14,0xff}, -{0x8d15,0xe4}, -{0x8d16,0x8f}, -{0x8d17,0x37}, -{0x8d18,0xf5}, -{0x8d19,0x36}, -{0x8d1a,0xf5}, -{0x8d1b,0x35}, -{0x8d1c,0xf5}, -{0x8d1d,0x34}, -{0x8d1e,0xaf}, -{0x8d1f,0x37}, -{0x8d20,0xae}, -{0x8d21,0x36}, -{0x8d22,0xad}, -{0x8d23,0x35}, -{0x8d24,0xac}, -{0x8d25,0x34}, -{0x8d26,0x90}, -{0x8d27,0x0e}, -{0x8d28,0x6a}, -{0x8d29,0x12}, -{0x8d2a,0x0d}, -{0x8d2b,0xf6}, -{0x8d2c,0x8f}, -{0x8d2d,0x37}, -{0x8d2e,0x8e}, -{0x8d2f,0x36}, -{0x8d30,0x8d}, -{0x8d31,0x35}, -{0x8d32,0x8c}, -{0x8d33,0x34}, -{0x8d34,0x90}, -{0x8d35,0x0e}, -{0x8d36,0x72}, -{0x8d37,0x12}, -{0x8d38,0x06}, -{0x8d39,0x7c}, -{0x8d3a,0xef}, -{0x8d3b,0x45}, -{0x8d3c,0x37}, -{0x8d3d,0xf5}, -{0x8d3e,0x37}, -{0x8d3f,0xee}, -{0x8d40,0x45}, -{0x8d41,0x36}, -{0x8d42,0xf5}, -{0x8d43,0x36}, -{0x8d44,0xed}, -{0x8d45,0x45}, -{0x8d46,0x35}, -{0x8d47,0xf5}, -{0x8d48,0x35}, -{0x8d49,0xec}, -{0x8d4a,0x45}, -{0x8d4b,0x34}, -{0x8d4c,0xf5}, -{0x8d4d,0x34}, -{0x8d4e,0xe4}, -{0x8d4f,0xf5}, -{0x8d50,0x22}, -{0x8d51,0xf5}, -{0x8d52,0x23}, -{0x8d53,0x85}, -{0x8d54,0x37}, -{0x8d55,0x31}, -{0x8d56,0x85}, -{0x8d57,0x36}, -{0x8d58,0x30}, -{0x8d59,0x85}, -{0x8d5a,0x35}, -{0x8d5b,0x2f}, -{0x8d5c,0x85}, -{0x8d5d,0x34}, -{0x8d5e,0x2e}, -{0x8d5f,0x12}, -{0x8d60,0x0f}, -{0x8d61,0x46}, -{0x8d62,0xe4}, -{0x8d63,0xf5}, -{0x8d64,0x22}, -{0x8d65,0xf5}, -{0x8d66,0x23}, -{0x8d67,0x90}, -{0x8d68,0x0e}, -{0x8d69,0x72}, -{0x8d6a,0x12}, -{0x8d6b,0x0d}, -{0x8d6c,0xea}, -{0x8d6d,0x12}, -{0x8d6e,0x0f}, -{0x8d6f,0x46}, -{0x8d70,0xe4}, -{0x8d71,0xf5}, -{0x8d72,0x22}, -{0x8d73,0xf5}, -{0x8d74,0x23}, -{0x8d75,0x90}, -{0x8d76,0x0e}, -{0x8d77,0x6e}, -{0x8d78,0x12}, -{0x8d79,0x0d}, -{0x8d7a,0xea}, -{0x8d7b,0x02}, -{0x8d7c,0x0f}, -{0x8d7d,0x46}, -{0x8d7e,0xe5}, -{0x8d7f,0x40}, -{0x8d80,0x24}, -{0x8d81,0xf2}, -{0x8d82,0xf5}, -{0x8d83,0x37}, -{0x8d84,0xe5}, -{0x8d85,0x3f}, -{0x8d86,0x34}, -{0x8d87,0x43}, -{0x8d88,0xf5}, -{0x8d89,0x36}, -{0x8d8a,0xe5}, -{0x8d8b,0x3e}, -{0x8d8c,0x34}, -{0x8d8d,0xa2}, -{0x8d8e,0xf5}, -{0x8d8f,0x35}, -{0x8d90,0xe5}, -{0x8d91,0x3d}, -{0x8d92,0x34}, -{0x8d93,0x28}, -{0x8d94,0xf5}, -{0x8d95,0x34}, -{0x8d96,0xe5}, -{0x8d97,0x37}, -{0x8d98,0xff}, -{0x8d99,0xe4}, -{0x8d9a,0xfe}, -{0x8d9b,0xfd}, -{0x8d9c,0xfc}, -{0x8d9d,0x78}, -{0x8d9e,0x18}, -{0x8d9f,0x12}, -{0x8da0,0x06}, -{0x8da1,0x69}, -{0x8da2,0x8f}, -{0x8da3,0x40}, -{0x8da4,0x8e}, -{0x8da5,0x3f}, -{0x8da6,0x8d}, -{0x8da7,0x3e}, -{0x8da8,0x8c}, -{0x8da9,0x3d}, -{0x8daa,0xe5}, -{0x8dab,0x37}, -{0x8dac,0x54}, -{0x8dad,0xa0}, -{0x8dae,0xff}, -{0x8daf,0xe5}, -{0x8db0,0x36}, -{0x8db1,0xfe}, -{0x8db2,0xe4}, -{0x8db3,0xfd}, -{0x8db4,0xfc}, -{0x8db5,0x78}, -{0x8db6,0x07}, -{0x8db7,0x12}, -{0x8db8,0x06}, -{0x8db9,0x56}, -{0x8dba,0x78}, -{0x8dbb,0x10}, -{0x8dbc,0x12}, -{0x8dbd,0x0f}, -{0x8dbe,0x9a}, -{0x8dbf,0xe4}, -{0x8dc0,0xff}, -{0x8dc1,0xfe}, -{0x8dc2,0xe5}, -{0x8dc3,0x35}, -{0x8dc4,0xfd}, -{0x8dc5,0xe4}, -{0x8dc6,0xfc}, -{0x8dc7,0x78}, -{0x8dc8,0x0e}, -{0x8dc9,0x12}, -{0x8dca,0x06}, -{0x8dcb,0x56}, -{0x8dcc,0x12}, -{0x8dcd,0x0f}, -{0x8dce,0x9d}, -{0x8dcf,0xe4}, -{0x8dd0,0xff}, -{0x8dd1,0xfe}, -{0x8dd2,0xfd}, -{0x8dd3,0xe5}, -{0x8dd4,0x34}, -{0x8dd5,0xfc}, -{0x8dd6,0x78}, -{0x8dd7,0x18}, -{0x8dd8,0x12}, -{0x8dd9,0x06}, -{0x8dda,0x56}, -{0x8ddb,0x78}, -{0x8ddc,0x08}, -{0x8ddd,0x12}, -{0x8dde,0x0f}, -{0x8ddf,0x9a}, -{0x8de0,0x22}, -{0x8de1,0x8f}, -{0x8de2,0x3b}, -{0x8de3,0x8e}, -{0x8de4,0x3a}, -{0x8de5,0x8d}, -{0x8de6,0x39}, -{0x8de7,0x8c}, -{0x8de8,0x38}, -{0x8de9,0x22}, -{0x8dea,0x12}, -{0x8deb,0x06}, -{0x8dec,0x7c}, -{0x8ded,0x8f}, -{0x8dee,0x31}, -{0x8def,0x8e}, -{0x8df0,0x30}, -{0x8df1,0x8d}, -{0x8df2,0x2f}, -{0x8df3,0x8c}, -{0x8df4,0x2e}, -{0x8df5,0x22}, -{0x8df6,0x93}, -{0x8df7,0xf9}, -{0x8df8,0xf8}, -{0x8df9,0x02}, -{0x8dfa,0x06}, -{0x8dfb,0x69}, -{0x8dfc,0x00}, -{0x8dfd,0x00}, -{0x8dfe,0x00}, -{0x8dff,0x00}, -{0x8e00,0x12}, -{0x8e01,0x01}, -{0x8e02,0x17}, -{0x8e03,0x08}, -{0x8e04,0x31}, -{0x8e05,0x15}, -{0x8e06,0x53}, -{0x8e07,0x54}, -{0x8e08,0x44}, -{0x8e09,0x20}, -{0x8e0a,0x20}, -{0x8e0b,0x20}, -{0x8e0c,0x20}, -{0x8e0d,0x20}, -{0x8e0e,0x13}, -{0x8e0f,0x01}, -{0x8e10,0x10}, -{0x8e11,0x01}, -{0x8e12,0x56}, -{0x8e13,0x40}, -{0x8e14,0x1a}, -{0x8e15,0x30}, -{0x8e16,0x29}, -{0x8e17,0x7e}, -{0x8e18,0x00}, -{0x8e19,0x30}, -{0x8e1a,0x04}, -{0x8e1b,0x20}, -{0x8e1c,0xdf}, -{0x8e1d,0x30}, -{0x8e1e,0x05}, -{0x8e1f,0x40}, -{0x8e20,0xbf}, -{0x8e21,0x50}, -{0x8e22,0x03}, -{0x8e23,0x00}, -{0x8e24,0xfd}, -{0x8e25,0x50}, -{0x8e26,0x27}, -{0x8e27,0x01}, -{0x8e28,0xfe}, -{0x8e29,0x60}, -{0x8e2a,0x00}, -{0x8e2b,0x11}, -{0x8e2c,0x00}, -{0x8e2d,0x3f}, -{0x8e2e,0x05}, -{0x8e2f,0x30}, -{0x8e30,0x00}, -{0x8e31,0x3f}, -{0x8e32,0x06}, -{0x8e33,0x22}, -{0x8e34,0x00}, -{0x8e35,0x3f}, -{0x8e36,0x01}, -{0x8e37,0x2a}, -{0x8e38,0x00}, -{0x8e39,0x3f}, -{0x8e3a,0x02}, -{0x8e3b,0x00}, -{0x8e3c,0x00}, -{0x8e3d,0x36}, -{0x8e3e,0x06}, -{0x8e3f,0x07}, -{0x8e40,0x00}, -{0x8e41,0x3f}, -{0x8e42,0x0b}, -{0x8e43,0x0f}, -{0x8e44,0xf0}, -{0x8e45,0x00}, -{0x8e46,0x00}, -{0x8e47,0x00}, -{0x8e48,0x00}, -{0x8e49,0x30}, -{0x8e4a,0x01}, -{0x8e4b,0x40}, -{0x8e4c,0xbf}, -{0x8e4d,0x30}, -{0x8e4e,0x01}, -{0x8e4f,0x00}, -{0x8e50,0xbf}, -{0x8e51,0x30}, -{0x8e52,0x29}, -{0x8e53,0x70}, -{0x8e54,0x00}, -{0x8e55,0x3a}, -{0x8e56,0x00}, -{0x8e57,0x00}, -{0x8e58,0xff}, -{0x8e59,0x3a}, -{0x8e5a,0x00}, -{0x8e5b,0x00}, -{0x8e5c,0xff}, -{0x8e5d,0x36}, -{0x8e5e,0x03}, -{0x8e5f,0x36}, -{0x8e60,0x02}, -{0x8e61,0x41}, -{0x8e62,0x44}, -{0x8e63,0x58}, -{0x8e64,0x20}, -{0x8e65,0x18}, -{0x8e66,0x10}, -{0x8e67,0x0a}, -{0x8e68,0x04}, -{0x8e69,0x04}, -{0x8e6a,0x00}, -{0x8e6b,0x03}, -{0x8e6c,0xff}, -{0x8e6d,0x64}, -{0x8e6e,0x00}, -{0x8e6f,0x00}, -{0x8e70,0x80}, -{0x8e71,0x00}, -{0x8e72,0x00}, -{0x8e73,0x00}, -{0x8e74,0x00}, -{0x8e75,0x00}, -{0x8e76,0x00}, -{0x8e77,0x02}, -{0x8e78,0x04}, -{0x8e79,0x06}, -{0x8e7a,0x06}, -{0x8e7b,0x00}, -{0x8e7c,0x02}, -{0x8e7d,0x60},//CC -{0x8e7e,0x00}, -{0x8e7f,0x70}, -{0x8e80,0x50}, -{0x8e81,0x3c}, -{0x8e82,0x28}, -{0x8e83,0x1e}, -{0x8e84,0x10}, -{0x8e85,0x10}, -{0x8e86,0x50}, -{0x8e87,0x2d}, -{0x8e88,0x28}, -{0x8e89,0x16}, -{0x8e8a,0x10}, -{0x8e8b,0x10}, -{0x8e8c,0x02}, -{0x8e8d,0x00}, -{0x8e8e,0x10}, -{0x8e8f,0x0c}, -{0x8e90,0x10}, -{0x8e91,0x04}, -{0x8e92,0x0c}, -{0x8e93,0x6e}, -{0x8e94,0x0a}, -{0x8e95,0x05}, -{0x8e96,0x00}, -{0x8e97,0xa5}, -{0x8e98,0x5a}, -{0x8e99,0x00}, -{0x8e9a,0xae}, -{0x8e9b,0x35}, -{0x8e9c,0xaf}, -{0x8e9d,0x36}, -{0x8e9e,0xe4}, -{0x8e9f,0xfd}, -{0x8ea0,0xed}, -{0x8ea1,0xc3}, -{0x8ea2,0x95}, -{0x8ea3,0x37}, -{0x8ea4,0x50}, -{0x8ea5,0x33}, -{0x8ea6,0x12}, -{0x8ea7,0x0f}, -{0x8ea8,0xe2}, -{0x8ea9,0xe4}, -{0x8eaa,0x93}, -{0x8eab,0xf5}, -{0x8eac,0x38}, -{0x8ead,0x74}, -{0x8eae,0x01}, -{0x8eaf,0x93}, -{0x8eb0,0xf5}, -{0x8eb1,0x39}, -{0x8eb2,0x45}, -{0x8eb3,0x38}, -{0x8eb4,0x60}, -{0x8eb5,0x23}, -{0x8eb6,0x85}, -{0x8eb7,0x39}, -{0x8eb8,0x82}, -{0x8eb9,0x85}, -{0x8eba,0x38}, -{0x8ebb,0x83}, -{0x8ebc,0xe0}, -{0x8ebd,0xfc}, -{0x8ebe,0x12}, -{0x8ebf,0x0f}, -{0x8ec0,0xe2}, -{0x8ec1,0x74}, -{0x8ec2,0x03}, -{0x8ec3,0x93}, -{0x8ec4,0x52}, -{0x8ec5,0x04}, -{0x8ec6,0x12}, -{0x8ec7,0x0f}, -{0x8ec8,0xe2}, -{0x8ec9,0x74}, -{0x8eca,0x02}, -{0x8ecb,0x93}, -{0x8ecc,0x42}, -{0x8ecd,0x04}, -{0x8ece,0x85}, -{0x8ecf,0x39}, -{0x8ed0,0x82}, -{0x8ed1,0x85}, -{0x8ed2,0x38}, -{0x8ed3,0x83}, -{0x8ed4,0xec}, -{0x8ed5,0xf0}, -{0x8ed6,0x0d}, -{0x8ed7,0x80}, -{0x8ed8,0xc7}, -{0x8ed9,0x22}, -{0x8eda,0x78}, -{0x8edb,0xbe}, -{0x8edc,0xe6}, -{0x8edd,0xd3}, -{0x8ede,0x08}, -{0x8edf,0xff}, -{0x8ee0,0xe6}, -{0x8ee1,0x64}, -{0x8ee2,0x80}, -{0x8ee3,0xf8}, -{0x8ee4,0xef}, -{0x8ee5,0x64}, -{0x8ee6,0x80}, -{0x8ee7,0x98}, -{0x8ee8,0x22}, -{0x8ee9,0x93}, -{0x8eea,0xff}, -{0x8eeb,0x7e}, -{0x8eec,0x00}, -{0x8eed,0xe6}, -{0x8eee,0xfc}, -{0x8eef,0x08}, -{0x8ef0,0xe6}, -{0x8ef1,0xfd}, -{0x8ef2,0x12}, -{0x8ef3,0x04}, -{0x8ef4,0xc1}, -{0x8ef5,0x78}, -{0x8ef6,0xc1}, -{0x8ef7,0xe6}, -{0x8ef8,0xfc}, -{0x8ef9,0x08}, -{0x8efa,0xe6}, -{0x8efb,0xfd}, -{0x8efc,0xd3}, -{0x8efd,0xef}, -{0x8efe,0x9d}, -{0x8eff,0xee}, -{0x8f00,0x9c}, -{0x8f01,0x22}, -{0x8f02,0x78}, -{0x8f03,0xbd}, -{0x8f04,0xd3}, -{0x8f05,0xe6}, -{0x8f06,0x64}, -{0x8f07,0x80}, -{0x8f08,0x94}, -{0x8f09,0x80}, -{0x8f0a,0x22}, -{0x8f0b,0x25}, -{0x8f0c,0xe0}, -{0x8f0d,0x24}, -{0x8f0e,0x0a}, -{0x8f0f,0xf8}, -{0x8f10,0xe6}, -{0x8f11,0xfe}, -{0x8f12,0x08}, -{0x8f13,0xe6}, -{0x8f14,0xff}, -{0x8f15,0x22}, -{0x8f16,0xe5}, -{0x8f17,0x3c}, -{0x8f18,0xd3}, -{0x8f19,0x94}, -{0x8f1a,0x00}, -{0x8f1b,0x40}, -{0x8f1c,0x0b}, -{0x8f1d,0x90}, -{0x8f1e,0x0e}, -{0x8f1f,0x88}, -{0x8f20,0x12}, -{0x8f21,0x0b}, -{0x8f22,0xf1}, -{0x8f23,0x90}, -{0x8f24,0x0e}, -{0x8f25,0x86}, -{0x8f26,0x80}, -{0x8f27,0x09}, -{0x8f28,0x90}, -{0x8f29,0x0e}, -{0x8f2a,0x82}, -{0x8f2b,0x12}, -{0x8f2c,0x0b}, -{0x8f2d,0xf1}, -{0x8f2e,0x90}, -{0x8f2f,0x0e}, -{0x8f30,0x80}, -{0x8f31,0xe4}, -{0x8f32,0x93}, -{0x8f33,0xf5}, -{0x8f34,0x44}, -{0x8f35,0xa3}, -{0x8f36,0xe4}, -{0x8f37,0x93}, -{0x8f38,0xf5}, -{0x8f39,0x43}, -{0x8f3a,0xd2}, -{0x8f3b,0x06}, -{0x8f3c,0x30}, -{0x8f3d,0x06}, -{0x8f3e,0x03}, -{0x8f3f,0xd3}, -{0x8f40,0x80}, -{0x8f41,0x01}, -{0x8f42,0xc3}, -{0x8f43,0x92}, -{0x8f44,0x0e}, -{0x8f45,0x22}, -{0x8f46,0xa2}, -{0x8f47,0xaf}, -{0x8f48,0x92}, -{0x8f49,0x32}, -{0x8f4a,0xc2}, -{0x8f4b,0xaf}, -{0x8f4c,0xe5}, -{0x8f4d,0x23}, -{0x8f4e,0x45}, -{0x8f4f,0x22}, -{0x8f50,0x90}, -{0x8f51,0x0e}, -{0x8f52,0x5d}, -{0x8f53,0x60}, -{0x8f54,0x0e}, -{0x8f55,0x12}, -{0x8f56,0x0f}, -{0x8f57,0xcb}, -{0x8f58,0xe0}, -{0x8f59,0xf5}, -{0x8f5a,0x2c}, -{0x8f5b,0x12}, -{0x8f5c,0x0f}, -{0x8f5d,0xc8}, -{0x8f5e,0xe0}, -{0x8f5f,0xf5}, -{0x8f60,0x2d}, -{0x8f61,0x80}, -{0x8f62,0x0c}, -{0x8f63,0x12}, -{0x8f64,0x0f}, -{0x8f65,0xcb}, -{0x8f66,0xe5}, -{0x8f67,0x30}, -{0x8f68,0xf0}, -{0x8f69,0x12}, -{0x8f6a,0x0f}, -{0x8f6b,0xc8}, -{0x8f6c,0xe5}, -{0x8f6d,0x31}, -{0x8f6e,0xf0}, -{0x8f6f,0xa2}, -{0x8f70,0x32}, -{0x8f71,0x92}, -{0x8f72,0xaf}, -{0x8f73,0x22}, -{0x8f74,0xd2}, -{0x8f75,0x01}, -{0x8f76,0xc2}, -{0x8f77,0x02}, -{0x8f78,0xe4}, -{0x8f79,0xf5}, -{0x8f7a,0x1f}, -{0x8f7b,0xf5}, -{0x8f7c,0x1e}, -{0x8f7d,0xd2}, -{0x8f7e,0x35}, -{0x8f7f,0xd2}, -{0x8f80,0x33}, -{0x8f81,0xd2}, -{0x8f82,0x36}, -{0x8f83,0xd2}, -{0x8f84,0x01}, -{0x8f85,0xc2}, -{0x8f86,0x02}, -{0x8f87,0xf5}, -{0x8f88,0x1f}, -{0x8f89,0xf5}, -{0x8f8a,0x1e}, -{0x8f8b,0xd2}, -{0x8f8c,0x35}, -{0x8f8d,0xd2}, -{0x8f8e,0x33}, -{0x8f8f,0x22}, -{0x8f90,0xfb}, -{0x8f91,0xd3}, -{0x8f92,0xed}, -{0x8f93,0x9b}, -{0x8f94,0x74}, -{0x8f95,0x80}, -{0x8f96,0xf8}, -{0x8f97,0x6c}, -{0x8f98,0x98}, -{0x8f99,0x22}, -{0x8f9a,0x12}, -{0x8f9b,0x06}, -{0x8f9c,0x69}, -{0x8f9d,0xe5}, -{0x8f9e,0x40}, -{0x8f9f,0x2f}, -{0x8fa0,0xf5}, -{0x8fa1,0x40}, -{0x8fa2,0xe5}, -{0x8fa3,0x3f}, -{0x8fa4,0x3e}, -{0x8fa5,0xf5}, -{0x8fa6,0x3f}, -{0x8fa7,0xe5}, -{0x8fa8,0x3e}, -{0x8fa9,0x3d}, -{0x8faa,0xf5}, -{0x8fab,0x3e}, -{0x8fac,0xe5}, -{0x8fad,0x3d}, -{0x8fae,0x3c}, -{0x8faf,0xf5}, -{0x8fb0,0x3d}, -{0x8fb1,0x22}, -{0x8fb2,0xc0}, -{0x8fb3,0xe0}, -{0x8fb4,0xc0}, -{0x8fb5,0x83}, -{0x8fb6,0xc0}, -{0x8fb7,0x82}, -{0x8fb8,0x90}, -{0x8fb9,0x3f}, -{0x8fba,0x0d}, -{0x8fbb,0xe0}, -{0x8fbc,0xf5}, -{0x8fbd,0x33}, -{0x8fbe,0xe5}, -{0x8fbf,0x33}, -{0x8fc0,0xf0}, -{0x8fc1,0xd0}, -{0x8fc2,0x82}, -{0x8fc3,0xd0}, -{0x8fc4,0x83}, -{0x8fc5,0xd0}, -{0x8fc6,0xe0}, -{0x8fc7,0x32}, -{0x8fc8,0x90}, -{0x8fc9,0x0e}, -{0x8fca,0x5f}, -{0x8fcb,0xe4}, -{0x8fcc,0x93}, -{0x8fcd,0xfe}, -{0x8fce,0x74}, -{0x8fcf,0x01}, -{0x8fd0,0x93}, -{0x8fd1,0xf5}, -{0x8fd2,0x82}, -{0x8fd3,0x8e}, -{0x8fd4,0x83}, -{0x8fd5,0x22}, -{0x8fd6,0x78}, -{0x8fd7,0x7f}, -{0x8fd8,0xe4}, -{0x8fd9,0xf6}, -{0x8fda,0xd8}, -{0x8fdb,0xfd}, -{0x8fdc,0x75}, -{0x8fdd,0x81}, -{0x8fde,0xcd}, -{0x8fdf,0x02}, -{0x8fe0,0x0c}, -{0x8fe1,0x98}, -{0x8fe2,0x8f}, -{0x8fe3,0x82}, -{0x8fe4,0x8e}, -{0x8fe5,0x83}, -{0x8fe6,0x75}, -{0x8fe7,0xf0}, -{0x8fe8,0x04}, -{0x8fe9,0xed}, -{0x8fea,0x02}, -{0x8feb,0x06}, -{0x8fec,0xa5}, -{0x3022,0x00}, -{0x3023,0x00}, -{0x3024,0x00}, -{0x3025,0x00}, -{0x3026,0x00}, -{0x3027,0x00}, -{0x3028,0x00}, -{0x3029,0x7F}, -{0x3000,0x00}, -#elif 1 // ddl@rock-chips.com : 2012/12/10 Continues Focus from OVT -{0x3000,0x20}, -{0x8000,0x02}, -{0x8001,0x0f}, -{0x8002,0xd6}, -{0x8003,0x02}, -{0x8004,0x0a}, -{0x8005,0x39}, -{0x8006,0xc2}, -{0x8007,0x01}, -{0x8008,0x22}, -{0x8009,0x22}, -{0x800a,0x00}, -{0x800b,0x02}, -{0x800c,0x0f}, -{0x800d,0xb2}, -{0x800e,0xe5}, -{0x800f,0x1f}, -{0x8010,0x70}, -{0x8011,0x72}, -{0x8012,0xf5}, -{0x8013,0x1e}, -{0x8014,0xd2}, -{0x8015,0x35}, -{0x8016,0xff}, -{0x8017,0xef}, -{0x8018,0x25}, -{0x8019,0xe0}, -{0x801a,0x24}, -{0x801b,0x4e}, -{0x801c,0xf8}, -{0x801d,0xe4}, -{0x801e,0xf6}, -{0x801f,0x08}, -{0x8020,0xf6}, -{0x8021,0x0f}, -{0x8022,0xbf}, -{0x8023,0x34}, -{0x8024,0xf2}, -{0x8025,0x90}, -{0x8026,0x0e}, -{0x8027,0x93}, -{0x8028,0xe4}, -{0x8029,0x93}, -{0x802a,0xff}, -{0x802b,0xe5}, -{0x802c,0x4b}, -{0x802d,0xc3}, -{0x802e,0x9f}, -{0x802f,0x50}, -{0x8030,0x04}, -{0x8031,0x7f}, -{0x8032,0x05}, -{0x8033,0x80}, -{0x8034,0x02}, -{0x8035,0x7f}, -{0x8036,0xfb}, -{0x8037,0x78}, -{0x8038,0xbd}, -{0x8039,0xa6}, -{0x803a,0x07}, -{0x803b,0x12}, -{0x803c,0x0f}, -{0x803d,0x04}, -{0x803e,0x40}, -{0x803f,0x04}, -{0x8040,0x7f}, -{0x8041,0x03}, -{0x8042,0x80}, -{0x8043,0x02}, -{0x8044,0x7f}, -{0x8045,0x30}, -{0x8046,0x78}, -{0x8047,0xbc}, -{0x8048,0xa6}, -{0x8049,0x07}, -{0x804a,0xe6}, -{0x804b,0x18}, -{0x804c,0xf6}, -{0x804d,0x08}, -{0x804e,0xe6}, -{0x804f,0x78}, -{0x8050,0xb9}, -{0x8051,0xf6}, -{0x8052,0x78}, -{0x8053,0xbc}, -{0x8054,0xe6}, -{0x8055,0x78}, -{0x8056,0xba}, -{0x8057,0xf6}, -{0x8058,0x78}, -{0x8059,0xbf}, -{0x805a,0x76}, -{0x805b,0x33}, -{0x805c,0xe4}, -{0x805d,0x08}, -{0x805e,0xf6}, -{0x805f,0x78}, -{0x8060,0xb8}, -{0x8061,0x76}, -{0x8062,0x01}, -{0x8063,0x75}, -{0x8064,0x4a}, -{0x8065,0x02}, -{0x8066,0x78}, -{0x8067,0xb6}, -{0x8068,0xf6}, -{0x8069,0x08}, -{0x806a,0xf6}, -{0x806b,0x74}, -{0x806c,0xff}, -{0x806d,0x78}, -{0x806e,0xc1}, -{0x806f,0xf6}, -{0x8070,0x08}, -{0x8071,0xf6}, -{0x8072,0x75}, -{0x8073,0x1f}, -{0x8074,0x01}, -{0x8075,0x78}, -{0x8076,0xbc}, -{0x8077,0xe6}, -{0x8078,0x75}, -{0x8079,0xf0}, -{0x807a,0x05}, -{0x807b,0xa4}, -{0x807c,0xf5}, -{0x807d,0x4b}, -{0x807e,0x12}, -{0x807f,0x0a}, -{0x8080,0xff}, -{0x8081,0xc2}, -{0x8082,0x37}, -{0x8083,0x22}, -{0x8084,0x78}, -{0x8085,0xb8}, -{0x8086,0xe6}, -{0x8087,0xd3}, -{0x8088,0x94}, -{0x8089,0x00}, -{0x808a,0x40}, -{0x808b,0x02}, -{0x808c,0x16}, -{0x808d,0x22}, -{0x808e,0xe5}, -{0x808f,0x1f}, -{0x8090,0xb4}, -{0x8091,0x05}, -{0x8092,0x23}, -{0x8093,0xe4}, -{0x8094,0xf5}, -{0x8095,0x1f}, -{0x8096,0xc2}, -{0x8097,0x01}, -{0x8098,0x78}, -{0x8099,0xb6}, -{0x809a,0xe6}, -{0x809b,0xfe}, -{0x809c,0x08}, -{0x809d,0xe6}, -{0x809e,0xff}, -{0x809f,0x78}, -{0x80a0,0x4e}, -{0x80a1,0xa6}, -{0x80a2,0x06}, -{0x80a3,0x08}, -{0x80a4,0xa6}, -{0x80a5,0x07}, -{0x80a6,0xa2}, -{0x80a7,0x37}, -{0x80a8,0xe4}, -{0x80a9,0x33}, -{0x80aa,0xf5}, -{0x80ab,0x3c}, -{0x80ac,0x90}, -{0x80ad,0x30}, -{0x80ae,0x28}, -{0x80af,0xf0}, -{0x80b0,0x75}, -{0x80b1,0x1e}, -{0x80b2,0x10}, -{0x80b3,0xd2}, -{0x80b4,0x35}, -{0x80b5,0x22}, -{0x80b6,0xe5}, -{0x80b7,0x4b}, -{0x80b8,0x75}, -{0x80b9,0xf0}, -{0x80ba,0x05}, -{0x80bb,0x84}, -{0x80bc,0x78}, -{0x80bd,0xbc}, -{0x80be,0xf6}, -{0x80bf,0x90}, -{0x80c0,0x0e}, -{0x80c1,0x8c}, -{0x80c2,0xe4}, -{0x80c3,0x93}, -{0x80c4,0xff}, -{0x80c5,0x25}, -{0x80c6,0xe0}, -{0x80c7,0x24}, -{0x80c8,0x0a}, -{0x80c9,0xf8}, -{0x80ca,0xe6}, -{0x80cb,0xfc}, -{0x80cc,0x08}, -{0x80cd,0xe6}, -{0x80ce,0xfd}, -{0x80cf,0x78}, -{0x80d0,0xbc}, -{0x80d1,0xe6}, -{0x80d2,0x25}, -{0x80d3,0xe0}, -{0x80d4,0x24}, -{0x80d5,0x4e}, -{0x80d6,0xf8}, -{0x80d7,0xa6}, -{0x80d8,0x04}, -{0x80d9,0x08}, -{0x80da,0xa6}, -{0x80db,0x05}, -{0x80dc,0xef}, -{0x80dd,0x12}, -{0x80de,0x0f}, -{0x80df,0x0b}, -{0x80e0,0xd3}, -{0x80e1,0x78}, -{0x80e2,0xb7}, -{0x80e3,0x96}, -{0x80e4,0xee}, -{0x80e5,0x18}, -{0x80e6,0x96}, -{0x80e7,0x40}, -{0x80e8,0x0d}, -{0x80e9,0x78}, -{0x80ea,0xbc}, -{0x80eb,0xe6}, -{0x80ec,0x78}, -{0x80ed,0xb9}, -{0x80ee,0xf6}, -{0x80ef,0x78}, -{0x80f0,0xb6}, -{0x80f1,0xa6}, -{0x80f2,0x06}, -{0x80f3,0x08}, -{0x80f4,0xa6}, -{0x80f5,0x07}, -{0x80f6,0x90}, -{0x80f7,0x0e}, -{0x80f8,0x8c}, -{0x80f9,0xe4}, -{0x80fa,0x93}, -{0x80fb,0x12}, -{0x80fc,0x0f}, -{0x80fd,0x0b}, -{0x80fe,0xc3}, -{0x80ff,0x78}, -{0x8100,0xc2}, -{0x8101,0x96}, -{0x8102,0xee}, -{0x8103,0x18}, -{0x8104,0x96}, -{0x8105,0x50}, -{0x8106,0x0d}, -{0x8107,0x78}, -{0x8108,0xbc}, -{0x8109,0xe6}, -{0x810a,0x78}, -{0x810b,0xba}, -{0x810c,0xf6}, -{0x810d,0x78}, -{0x810e,0xc1}, -{0x810f,0xa6}, -{0x8110,0x06}, -{0x8111,0x08}, -{0x8112,0xa6}, -{0x8113,0x07}, -{0x8114,0x78}, -{0x8115,0xb6}, -{0x8116,0xe6}, -{0x8117,0xfe}, -{0x8118,0x08}, -{0x8119,0xe6}, -{0x811a,0xc3}, -{0x811b,0x78}, -{0x811c,0xc2}, -{0x811d,0x96}, -{0x811e,0xff}, -{0x811f,0xee}, -{0x8120,0x18}, -{0x8121,0x96}, -{0x8122,0x78}, -{0x8123,0xc3}, -{0x8124,0xf6}, -{0x8125,0x08}, -{0x8126,0xa6}, -{0x8127,0x07}, -{0x8128,0x90}, -{0x8129,0x0e}, -{0x812a,0x95}, -{0x812b,0xe4}, -{0x812c,0x18}, -{0x812d,0x12}, -{0x812e,0x0e}, -{0x812f,0xe9}, -{0x8130,0x40}, -{0x8131,0x02}, -{0x8132,0xd2}, -{0x8133,0x37}, -{0x8134,0x78}, -{0x8135,0xbc}, -{0x8136,0xe6}, -{0x8137,0x08}, -{0x8138,0x26}, -{0x8139,0x08}, -{0x813a,0xf6}, -{0x813b,0xe5}, -{0x813c,0x1f}, -{0x813d,0x64}, -{0x813e,0x01}, -{0x813f,0x70}, -{0x8140,0x4a}, -{0x8141,0xe6}, -{0x8142,0xc3}, -{0x8143,0x78}, -{0x8144,0xc0}, -{0x8145,0x12}, -{0x8146,0x0e}, -{0x8147,0xdf}, -{0x8148,0x40}, -{0x8149,0x05}, -{0x814a,0x12}, -{0x814b,0x0e}, -{0x814c,0xda}, -{0x814d,0x40}, -{0x814e,0x39}, -{0x814f,0x12}, -{0x8150,0x0f}, -{0x8151,0x02}, -{0x8152,0x40}, -{0x8153,0x04}, -{0x8154,0x7f}, -{0x8155,0xfe}, -{0x8156,0x80}, -{0x8157,0x02}, -{0x8158,0x7f}, -{0x8159,0x02}, -{0x815a,0x78}, -{0x815b,0xbd}, -{0x815c,0xa6}, -{0x815d,0x07}, -{0x815e,0x78}, -{0x815f,0xb9}, -{0x8160,0xe6}, -{0x8161,0x24}, -{0x8162,0x03}, -{0x8163,0x78}, -{0x8164,0xbf}, -{0x8165,0xf6}, -{0x8166,0x78}, -{0x8167,0xb9}, -{0x8168,0xe6}, -{0x8169,0x24}, -{0x816a,0xfd}, -{0x816b,0x78}, -{0x816c,0xc0}, -{0x816d,0xf6}, -{0x816e,0x12}, -{0x816f,0x0f}, -{0x8170,0x02}, -{0x8171,0x40}, -{0x8172,0x06}, -{0x8173,0x78}, -{0x8174,0xc0}, -{0x8175,0xe6}, -{0x8176,0xff}, -{0x8177,0x80}, -{0x8178,0x04}, -{0x8179,0x78}, -{0x817a,0xbf}, -{0x817b,0xe6}, -{0x817c,0xff}, -{0x817d,0x78}, -{0x817e,0xbe}, -{0x817f,0xa6}, -{0x8180,0x07}, -{0x8181,0x75}, -{0x8182,0x1f}, -{0x8183,0x02}, -{0x8184,0x78}, -{0x8185,0xb8}, -{0x8186,0x76}, -{0x8187,0x01}, -{0x8188,0x02}, -{0x8189,0x02}, -{0x818a,0x4a}, -{0x818b,0xe5}, -{0x818c,0x1f}, -{0x818d,0x64}, -{0x818e,0x02}, -{0x818f,0x60}, -{0x8190,0x03}, -{0x8191,0x02}, -{0x8192,0x02}, -{0x8193,0x2a}, -{0x8194,0x78}, -{0x8195,0xbe}, -{0x8196,0xe6}, -{0x8197,0xff}, -{0x8198,0xc3}, -{0x8199,0x78}, -{0x819a,0xc0}, -{0x819b,0x12}, -{0x819c,0x0e}, -{0x819d,0xe0}, -{0x819e,0x40}, -{0x819f,0x08}, -{0x81a0,0x12}, -{0x81a1,0x0e}, -{0x81a2,0xda}, -{0x81a3,0x50}, -{0x81a4,0x03}, -{0x81a5,0x02}, -{0x81a6,0x02}, -{0x81a7,0x28}, -{0x81a8,0x12}, -{0x81a9,0x0f}, -{0x81aa,0x02}, -{0x81ab,0x40}, -{0x81ac,0x04}, -{0x81ad,0x7f}, -{0x81ae,0xff}, -{0x81af,0x80}, -{0x81b0,0x02}, -{0x81b1,0x7f}, -{0x81b2,0x01}, -{0x81b3,0x78}, -{0x81b4,0xbd}, -{0x81b5,0xa6}, -{0x81b6,0x07}, -{0x81b7,0x78}, -{0x81b8,0xb9}, -{0x81b9,0xe6}, -{0x81ba,0x04}, -{0x81bb,0x78}, -{0x81bc,0xbf}, -{0x81bd,0xf6}, -{0x81be,0x78}, -{0x81bf,0xb9}, -{0x81c0,0xe6}, -{0x81c1,0x14}, -{0x81c2,0x78}, -{0x81c3,0xc0}, -{0x81c4,0xf6}, -{0x81c5,0x18}, -{0x81c6,0x12}, -{0x81c7,0x0f}, -{0x81c8,0x04}, -{0x81c9,0x40}, -{0x81ca,0x04}, -{0x81cb,0xe6}, -{0x81cc,0xff}, -{0x81cd,0x80}, -{0x81ce,0x02}, -{0x81cf,0x7f}, -{0x81d0,0x00}, -{0x81d1,0x78}, -{0x81d2,0xbf}, -{0x81d3,0xa6}, -{0x81d4,0x07}, -{0x81d5,0xd3}, -{0x81d6,0x08}, -{0x81d7,0xe6}, -{0x81d8,0x64}, -{0x81d9,0x80}, -{0x81da,0x94}, -{0x81db,0x80}, -{0x81dc,0x40}, -{0x81dd,0x04}, -{0x81de,0xe6}, -{0x81df,0xff}, -{0x81e0,0x80}, -{0x81e1,0x02}, -{0x81e2,0x7f}, -{0x81e3,0x00}, -{0x81e4,0x78}, -{0x81e5,0xc0}, -{0x81e6,0xa6}, -{0x81e7,0x07}, -{0x81e8,0xc3}, -{0x81e9,0x18}, -{0x81ea,0xe6}, -{0x81eb,0x64}, -{0x81ec,0x80}, -{0x81ed,0x94}, -{0x81ee,0xb3}, -{0x81ef,0x50}, -{0x81f0,0x04}, -{0x81f1,0xe6}, -{0x81f2,0xff}, -{0x81f3,0x80}, -{0x81f4,0x02}, -{0x81f5,0x7f}, -{0x81f6,0x33}, -{0x81f7,0x78}, -{0x81f8,0xbf}, -{0x81f9,0xa6}, -{0x81fa,0x07}, -{0x81fb,0xc3}, -{0x81fc,0x08}, -{0x81fd,0xe6}, -{0x81fe,0x64}, -{0x81ff,0x80}, -{0x8200,0x94}, -{0x8201,0xb3}, -{0x8202,0x50}, -{0x8203,0x04}, -{0x8204,0xe6}, -{0x8205,0xff}, -{0x8206,0x80}, -{0x8207,0x02}, -{0x8208,0x7f}, -{0x8209,0x33}, -{0x820a,0x78}, -{0x820b,0xc0}, -{0x820c,0xa6}, -{0x820d,0x07}, -{0x820e,0x12}, -{0x820f,0x0f}, -{0x8210,0x02}, -{0x8211,0x40}, -{0x8212,0x06}, -{0x8213,0x78}, -{0x8214,0xc0}, -{0x8215,0xe6}, -{0x8216,0xff}, -{0x8217,0x80}, -{0x8218,0x04}, -{0x8219,0x78}, -{0x821a,0xbf}, -{0x821b,0xe6}, -{0x821c,0xff}, -{0x821d,0x78}, -{0x821e,0xbe}, -{0x821f,0xa6}, -{0x8220,0x07}, -{0x8221,0x75}, -{0x8222,0x1f}, -{0x8223,0x03}, -{0x8224,0x78}, -{0x8225,0xb8}, -{0x8226,0x76}, -{0x8227,0x01}, -{0x8228,0x80}, -{0x8229,0x20}, -{0x822a,0xe5}, -{0x822b,0x1f}, -{0x822c,0x64}, -{0x822d,0x03}, -{0x822e,0x70}, -{0x822f,0x26}, -{0x8230,0x78}, -{0x8231,0xbe}, -{0x8232,0xe6}, -{0x8233,0xff}, -{0x8234,0xc3}, -{0x8235,0x78}, -{0x8236,0xc0}, -{0x8237,0x12}, -{0x8238,0x0e}, -{0x8239,0xe0}, -{0x823a,0x40}, -{0x823b,0x05}, -{0x823c,0x12}, -{0x823d,0x0e}, -{0x823e,0xda}, -{0x823f,0x40}, -{0x8240,0x09}, -{0x8241,0x78}, -{0x8242,0xb9}, -{0x8243,0xe6}, -{0x8244,0x78}, -{0x8245,0xbe}, -{0x8246,0xf6}, -{0x8247,0x75}, -{0x8248,0x1f}, -{0x8249,0x04}, -{0x824a,0x78}, -{0x824b,0xbe}, -{0x824c,0xe6}, -{0x824d,0x75}, -{0x824e,0xf0}, -{0x824f,0x05}, -{0x8250,0xa4}, -{0x8251,0xf5}, -{0x8252,0x4b}, -{0x8253,0x02}, -{0x8254,0x0a}, -{0x8255,0xff}, -{0x8256,0xe5}, -{0x8257,0x1f}, -{0x8258,0xb4}, -{0x8259,0x04}, -{0x825a,0x10}, -{0x825b,0x90}, -{0x825c,0x0e}, -{0x825d,0x94}, -{0x825e,0xe4}, -{0x825f,0x78}, -{0x8260,0xc3}, -{0x8261,0x12}, -{0x8262,0x0e}, -{0x8263,0xe9}, -{0x8264,0x40}, -{0x8265,0x02}, -{0x8266,0xd2}, -{0x8267,0x37}, -{0x8268,0x75}, -{0x8269,0x1f}, -{0x826a,0x05}, -{0x826b,0x22}, -{0x826c,0x30}, -{0x826d,0x01}, -{0x826e,0x03}, -{0x826f,0x02}, -{0x8270,0x04}, -{0x8271,0xc0}, -{0x8272,0x30}, -{0x8273,0x02}, -{0x8274,0x03}, -{0x8275,0x02}, -{0x8276,0x04}, -{0x8277,0xc0}, -{0x8278,0x90}, -{0x8279,0x51}, -{0x827a,0xa5}, -{0x827b,0xe0}, -{0x827c,0x78}, -{0x827d,0x93}, -{0x827e,0xf6}, -{0x827f,0xa3}, -{0x8280,0xe0}, -{0x8281,0x08}, -{0x8282,0xf6}, -{0x8283,0xa3}, -{0x8284,0xe0}, -{0x8285,0x08}, -{0x8286,0xf6}, -{0x8287,0xe5}, -{0x8288,0x1f}, -{0x8289,0x70}, -{0x828a,0x3c}, -{0x828b,0x75}, -{0x828c,0x1e}, -{0x828d,0x20}, -{0x828e,0xd2}, -{0x828f,0x35}, -{0x8290,0x12}, -{0x8291,0x0c}, -{0x8292,0x7a}, -{0x8293,0x78}, -{0x8294,0x7e}, -{0x8295,0xa6}, -{0x8296,0x06}, -{0x8297,0x08}, -{0x8298,0xa6}, -{0x8299,0x07}, -{0x829a,0x78}, -{0x829b,0x8b}, -{0x829c,0xa6}, -{0x829d,0x09}, -{0x829e,0x18}, -{0x829f,0x76}, -{0x82a0,0x01}, -{0x82a1,0x12}, -{0x82a2,0x0c}, -{0x82a3,0x5b}, -{0x82a4,0x78}, -{0x82a5,0x4e}, -{0x82a6,0xa6}, -{0x82a7,0x06}, -{0x82a8,0x08}, -{0x82a9,0xa6}, -{0x82aa,0x07}, -{0x82ab,0x78}, -{0x82ac,0x8b}, -{0x82ad,0xe6}, -{0x82ae,0x78}, -{0x82af,0x6e}, -{0x82b0,0xf6}, -{0x82b1,0x75}, -{0x82b2,0x1f}, -{0x82b3,0x01}, -{0x82b4,0x78}, -{0x82b5,0x93}, -{0x82b6,0xe6}, -{0x82b7,0x78}, -{0x82b8,0x90}, -{0x82b9,0xf6}, -{0x82ba,0x78}, -{0x82bb,0x94}, -{0x82bc,0xe6}, -{0x82bd,0x78}, -{0x82be,0x91}, -{0x82bf,0xf6}, -{0x82c0,0x78}, -{0x82c1,0x95}, -{0x82c2,0xe6}, -{0x82c3,0x78}, -{0x82c4,0x92}, -{0x82c5,0xf6}, -{0x82c6,0x22}, -{0x82c7,0x79}, -{0x82c8,0x90}, -{0x82c9,0xe7}, -{0x82ca,0xd3}, -{0x82cb,0x78}, -{0x82cc,0x93}, -{0x82cd,0x96}, -{0x82ce,0x40}, -{0x82cf,0x05}, -{0x82d0,0xe7}, -{0x82d1,0x96}, -{0x82d2,0xff}, -{0x82d3,0x80}, -{0x82d4,0x08}, -{0x82d5,0xc3}, -{0x82d6,0x79}, -{0x82d7,0x93}, -{0x82d8,0xe7}, -{0x82d9,0x78}, -{0x82da,0x90}, -{0x82db,0x96}, -{0x82dc,0xff}, -{0x82dd,0x78}, -{0x82de,0x88}, -{0x82df,0x76}, -{0x82e0,0x00}, -{0x82e1,0x08}, -{0x82e2,0xa6}, -{0x82e3,0x07}, -{0x82e4,0x79}, -{0x82e5,0x91}, -{0x82e6,0xe7}, -{0x82e7,0xd3}, -{0x82e8,0x78}, -{0x82e9,0x94}, -{0x82ea,0x96}, -{0x82eb,0x40}, -{0x82ec,0x05}, -{0x82ed,0xe7}, -{0x82ee,0x96}, -{0x82ef,0xff}, -{0x82f0,0x80}, -{0x82f1,0x08}, -{0x82f2,0xc3}, -{0x82f3,0x79}, -{0x82f4,0x94}, -{0x82f5,0xe7}, -{0x82f6,0x78}, -{0x82f7,0x91}, -{0x82f8,0x96}, -{0x82f9,0xff}, -{0x82fa,0x12}, -{0x82fb,0x0c}, -{0x82fc,0x8e}, -{0x82fd,0x79}, -{0x82fe,0x92}, -{0x82ff,0xe7}, -{0x8300,0xd3}, -{0x8301,0x78}, -{0x8302,0x95}, -{0x8303,0x96}, -{0x8304,0x40}, -{0x8305,0x05}, -{0x8306,0xe7}, -{0x8307,0x96}, -{0x8308,0xff}, -{0x8309,0x80}, -{0x830a,0x08}, -{0x830b,0xc3}, -{0x830c,0x79}, -{0x830d,0x95}, -{0x830e,0xe7}, -{0x830f,0x78}, -{0x8310,0x92}, -{0x8311,0x96}, -{0x8312,0xff}, -{0x8313,0x12}, -{0x8314,0x0c}, -{0x8315,0x8e}, -{0x8316,0x12}, -{0x8317,0x0c}, -{0x8318,0x5b}, -{0x8319,0x78}, -{0x831a,0x8a}, -{0x831b,0xe6}, -{0x831c,0x25}, -{0x831d,0xe0}, -{0x831e,0x24}, -{0x831f,0x4e}, -{0x8320,0xf8}, -{0x8321,0xa6}, -{0x8322,0x06}, -{0x8323,0x08}, -{0x8324,0xa6}, -{0x8325,0x07}, -{0x8326,0x78}, -{0x8327,0x8a}, -{0x8328,0xe6}, -{0x8329,0x24}, -{0x832a,0x6e}, -{0x832b,0xf8}, -{0x832c,0xa6}, -{0x832d,0x09}, -{0x832e,0x78}, -{0x832f,0x8a}, -{0x8330,0xe6}, -{0x8331,0x24}, -{0x8332,0x01}, -{0x8333,0xff}, -{0x8334,0xe4}, -{0x8335,0x33}, -{0x8336,0xfe}, -{0x8337,0xd3}, -{0x8338,0xef}, -{0x8339,0x94}, -{0x833a,0x0f}, -{0x833b,0xee}, -{0x833c,0x64}, -{0x833d,0x80}, -{0x833e,0x94}, -{0x833f,0x80}, -{0x8340,0x40}, -{0x8341,0x04}, -{0x8342,0x7f}, -{0x8343,0x00}, -{0x8344,0x80}, -{0x8345,0x05}, -{0x8346,0x78}, -{0x8347,0x8a}, -{0x8348,0xe6}, -{0x8349,0x04}, -{0x834a,0xff}, -{0x834b,0x78}, -{0x834c,0x8a}, -{0x834d,0xa6}, -{0x834e,0x07}, -{0x834f,0xe5}, -{0x8350,0x1f}, -{0x8351,0xb4}, -{0x8352,0x01}, -{0x8353,0x0a}, -{0x8354,0xe6}, -{0x8355,0x60}, -{0x8356,0x03}, -{0x8357,0x02}, -{0x8358,0x04}, -{0x8359,0xc0}, -{0x835a,0x75}, -{0x835b,0x1f}, -{0x835c,0x02}, -{0x835d,0x22}, -{0x835e,0x12}, -{0x835f,0x0c}, -{0x8360,0x7a}, -{0x8361,0x78}, -{0x8362,0x80}, -{0x8363,0xa6}, -{0x8364,0x06}, -{0x8365,0x08}, -{0x8366,0xa6}, -{0x8367,0x07}, -{0x8368,0x12}, -{0x8369,0x0c}, -{0x836a,0x7a}, -{0x836b,0x78}, -{0x836c,0x82}, -{0x836d,0xa6}, -{0x836e,0x06}, -{0x836f,0x08}, -{0x8370,0xa6}, -{0x8371,0x07}, -{0x8372,0x78}, -{0x8373,0x6e}, -{0x8374,0xe6}, -{0x8375,0x78}, -{0x8376,0x8c}, -{0x8377,0xf6}, -{0x8378,0x78}, -{0x8379,0x6e}, -{0x837a,0xe6}, -{0x837b,0x78}, -{0x837c,0x8d}, -{0x837d,0xf6}, -{0x837e,0x7f}, -{0x837f,0x01}, -{0x8380,0xef}, -{0x8381,0x25}, -{0x8382,0xe0}, -{0x8383,0x24}, -{0x8384,0x4f}, -{0x8385,0xf9}, -{0x8386,0xc3}, -{0x8387,0x78}, -{0x8388,0x81}, -{0x8389,0xe6}, -{0x838a,0x97}, -{0x838b,0x18}, -{0x838c,0xe6}, -{0x838d,0x19}, -{0x838e,0x97}, -{0x838f,0x50}, -{0x8390,0x0a}, -{0x8391,0x12}, -{0x8392,0x0c}, -{0x8393,0x82}, -{0x8394,0x78}, -{0x8395,0x80}, -{0x8396,0xa6}, -{0x8397,0x04}, -{0x8398,0x08}, -{0x8399,0xa6}, -{0x839a,0x05}, -{0x839b,0x74}, -{0x839c,0x6e}, -{0x839d,0x2f}, -{0x839e,0xf9}, -{0x839f,0x78}, -{0x83a0,0x8c}, -{0x83a1,0xe6}, -{0x83a2,0xc3}, -{0x83a3,0x97}, -{0x83a4,0x50}, -{0x83a5,0x08}, -{0x83a6,0x74}, -{0x83a7,0x6e}, -{0x83a8,0x2f}, -{0x83a9,0xf8}, -{0x83aa,0xe6}, -{0x83ab,0x78}, -{0x83ac,0x8c}, -{0x83ad,0xf6}, -{0x83ae,0xef}, -{0x83af,0x25}, -{0x83b0,0xe0}, -{0x83b1,0x24}, -{0x83b2,0x4f}, -{0x83b3,0xf9}, -{0x83b4,0xd3}, -{0x83b5,0x78}, -{0x83b6,0x83}, -{0x83b7,0xe6}, -{0x83b8,0x97}, -{0x83b9,0x18}, -{0x83ba,0xe6}, -{0x83bb,0x19}, -{0x83bc,0x97}, -{0x83bd,0x40}, -{0x83be,0x0a}, -{0x83bf,0x12}, -{0x83c0,0x0c}, -{0x83c1,0x82}, -{0x83c2,0x78}, -{0x83c3,0x82}, -{0x83c4,0xa6}, -{0x83c5,0x04}, -{0x83c6,0x08}, -{0x83c7,0xa6}, -{0x83c8,0x05}, -{0x83c9,0x74}, -{0x83ca,0x6e}, -{0x83cb,0x2f}, -{0x83cc,0xf9}, -{0x83cd,0x78}, -{0x83ce,0x8d}, -{0x83cf,0xe6}, -{0x83d0,0xd3}, -{0x83d1,0x97}, -{0x83d2,0x40}, -{0x83d3,0x08}, -{0x83d4,0x74}, -{0x83d5,0x6e}, -{0x83d6,0x2f}, -{0x83d7,0xf8}, -{0x83d8,0xe6}, -{0x83d9,0x78}, -{0x83da,0x8d}, -{0x83db,0xf6}, -{0x83dc,0x0f}, -{0x83dd,0xef}, -{0x83de,0x64}, -{0x83df,0x10}, -{0x83e0,0x70}, -{0x83e1,0x9e}, -{0x83e2,0xc3}, -{0x83e3,0x79}, -{0x83e4,0x81}, -{0x83e5,0xe7}, -{0x83e6,0x78}, -{0x83e7,0x83}, -{0x83e8,0x96}, -{0x83e9,0xff}, -{0x83ea,0x19}, -{0x83eb,0xe7}, -{0x83ec,0x18}, -{0x83ed,0x96}, -{0x83ee,0x78}, -{0x83ef,0x84}, -{0x83f0,0xf6}, -{0x83f1,0x08}, -{0x83f2,0xa6}, -{0x83f3,0x07}, -{0x83f4,0xc3}, -{0x83f5,0x79}, -{0x83f6,0x8c}, -{0x83f7,0xe7}, -{0x83f8,0x78}, -{0x83f9,0x8d}, -{0x83fa,0x96}, -{0x83fb,0x08}, -{0x83fc,0xf6}, -{0x83fd,0xd3}, -{0x83fe,0x79}, -{0x83ff,0x81}, -{0x8400,0xe7}, -{0x8401,0x78}, -{0x8402,0x7f}, -{0x8403,0x96}, -{0x8404,0x19}, -{0x8405,0xe7}, -{0x8406,0x18}, -{0x8407,0x96}, -{0x8408,0x40}, -{0x8409,0x05}, -{0x840a,0x09}, -{0x840b,0xe7}, -{0x840c,0x08}, -{0x840d,0x80}, -{0x840e,0x06}, -{0x840f,0xc3}, -{0x8410,0x79}, -{0x8411,0x7f}, -{0x8412,0xe7}, -{0x8413,0x78}, -{0x8414,0x81}, -{0x8415,0x96}, -{0x8416,0xff}, -{0x8417,0x19}, -{0x8418,0xe7}, -{0x8419,0x18}, -{0x841a,0x96}, -{0x841b,0xfe}, -{0x841c,0x78}, -{0x841d,0x86}, -{0x841e,0xa6}, -{0x841f,0x06}, -{0x8420,0x08}, -{0x8421,0xa6}, -{0x8422,0x07}, -{0x8423,0x79}, -{0x8424,0x8c}, -{0x8425,0xe7}, -{0x8426,0xd3}, -{0x8427,0x78}, -{0x8428,0x8b}, -{0x8429,0x96}, -{0x842a,0x40}, -{0x842b,0x05}, -{0x842c,0xe7}, -{0x842d,0x96}, -{0x842e,0xff}, -{0x842f,0x80}, -{0x8430,0x08}, -{0x8431,0xc3}, -{0x8432,0x79}, -{0x8433,0x8b}, -{0x8434,0xe7}, -{0x8435,0x78}, -{0x8436,0x8c}, -{0x8437,0x96}, -{0x8438,0xff}, -{0x8439,0x78}, -{0x843a,0x8f}, -{0x843b,0xa6}, -{0x843c,0x07}, -{0x843d,0xe5}, -{0x843e,0x1f}, -{0x843f,0x64}, -{0x8440,0x02}, -{0x8441,0x70}, -{0x8442,0x69}, -{0x8443,0x90}, -{0x8444,0x0e}, -{0x8445,0x91}, -{0x8446,0x93}, -{0x8447,0xff}, -{0x8448,0x18}, -{0x8449,0xe6}, -{0x844a,0xc3}, -{0x844b,0x9f}, -{0x844c,0x50}, -{0x844d,0x72}, -{0x844e,0x12}, -{0x844f,0x0c}, -{0x8450,0x4a}, -{0x8451,0x12}, -{0x8452,0x0c}, -{0x8453,0x2f}, -{0x8454,0x90}, -{0x8455,0x0e}, -{0x8456,0x8e}, -{0x8457,0x12}, -{0x8458,0x0c}, -{0x8459,0x38}, -{0x845a,0x78}, -{0x845b,0x80}, -{0x845c,0x12}, -{0x845d,0x0c}, -{0x845e,0x6b}, -{0x845f,0x7b}, -{0x8460,0x04}, -{0x8461,0x12}, -{0x8462,0x0c}, -{0x8463,0x1d}, -{0x8464,0xc3}, -{0x8465,0x12}, -{0x8466,0x06}, -{0x8467,0x45}, -{0x8468,0x50}, -{0x8469,0x56}, -{0x846a,0x90}, -{0x846b,0x0e}, -{0x846c,0x92}, -{0x846d,0xe4}, -{0x846e,0x93}, -{0x846f,0xff}, -{0x8470,0x78}, -{0x8471,0x8f}, -{0x8472,0xe6}, -{0x8473,0x9f}, -{0x8474,0x40}, -{0x8475,0x02}, -{0x8476,0x80}, -{0x8477,0x11}, -{0x8478,0x90}, -{0x8479,0x0e}, -{0x847a,0x90}, -{0x847b,0xe4}, -{0x847c,0x93}, -{0x847d,0xff}, -{0x847e,0xd3}, -{0x847f,0x78}, -{0x8480,0x89}, -{0x8481,0xe6}, -{0x8482,0x9f}, -{0x8483,0x18}, -{0x8484,0xe6}, -{0x8485,0x94}, -{0x8486,0x00}, -{0x8487,0x40}, -{0x8488,0x03}, -{0x8489,0x75}, -{0x848a,0x1f}, -{0x848b,0x05}, -{0x848c,0x12}, -{0x848d,0x0c}, -{0x848e,0x4a}, -{0x848f,0x12}, -{0x8490,0x0c}, -{0x8491,0x2f}, -{0x8492,0x90}, -{0x8493,0x0e}, -{0x8494,0x8f}, -{0x8495,0x12}, -{0x8496,0x0c}, -{0x8497,0x38}, -{0x8498,0x78}, -{0x8499,0x7e}, -{0x849a,0x12}, -{0x849b,0x0c}, -{0x849c,0x6b}, -{0x849d,0x7b}, -{0x849e,0x40}, -{0x849f,0x12}, -{0x84a0,0x0c}, -{0x84a1,0x1d}, -{0x84a2,0xd3}, -{0x84a3,0x12}, -{0x84a4,0x06}, -{0x84a5,0x45}, -{0x84a6,0x40}, -{0x84a7,0x18}, -{0x84a8,0x75}, -{0x84a9,0x1f}, -{0x84aa,0x05}, -{0x84ab,0x22}, -{0x84ac,0xe5}, -{0x84ad,0x1f}, -{0x84ae,0xb4}, -{0x84af,0x05}, -{0x84b0,0x0f}, -{0x84b1,0xd2}, -{0x84b2,0x01}, -{0x84b3,0xc2}, -{0x84b4,0x02}, -{0x84b5,0xe4}, -{0x84b6,0xf5}, -{0x84b7,0x1f}, -{0x84b8,0xf5}, -{0x84b9,0x1e}, -{0x84ba,0xd2}, -{0x84bb,0x35}, -{0x84bc,0xd2}, -{0x84bd,0x33}, -{0x84be,0xd2}, -{0x84bf,0x36}, -{0x84c0,0x22}, -{0x84c1,0xef}, -{0x84c2,0x8d}, -{0x84c3,0xf0}, -{0x84c4,0xa4}, -{0x84c5,0xa8}, -{0x84c6,0xf0}, -{0x84c7,0xcf}, -{0x84c8,0x8c}, -{0x84c9,0xf0}, -{0x84ca,0xa4}, -{0x84cb,0x28}, -{0x84cc,0xce}, -{0x84cd,0x8d}, -{0x84ce,0xf0}, -{0x84cf,0xa4}, -{0x84d0,0x2e}, -{0x84d1,0xfe}, -{0x84d2,0x22}, -{0x84d3,0xbc}, -{0x84d4,0x00}, -{0x84d5,0x0b}, -{0x84d6,0xbe}, -{0x84d7,0x00}, -{0x84d8,0x29}, -{0x84d9,0xef}, -{0x84da,0x8d}, -{0x84db,0xf0}, -{0x84dc,0x84}, -{0x84dd,0xff}, -{0x84de,0xad}, -{0x84df,0xf0}, -{0x84e0,0x22}, -{0x84e1,0xe4}, -{0x84e2,0xcc}, -{0x84e3,0xf8}, -{0x84e4,0x75}, -{0x84e5,0xf0}, -{0x84e6,0x08}, -{0x84e7,0xef}, -{0x84e8,0x2f}, -{0x84e9,0xff}, -{0x84ea,0xee}, -{0x84eb,0x33}, -{0x84ec,0xfe}, -{0x84ed,0xec}, -{0x84ee,0x33}, -{0x84ef,0xfc}, -{0x84f0,0xee}, -{0x84f1,0x9d}, -{0x84f2,0xec}, -{0x84f3,0x98}, -{0x84f4,0x40}, -{0x84f5,0x05}, -{0x84f6,0xfc}, -{0x84f7,0xee}, -{0x84f8,0x9d}, -{0x84f9,0xfe}, -{0x84fa,0x0f}, -{0x84fb,0xd5}, -{0x84fc,0xf0}, -{0x84fd,0xe9}, -{0x84fe,0xe4}, -{0x84ff,0xce}, -{0x8500,0xfd}, -{0x8501,0x22}, -{0x8502,0xed}, -{0x8503,0xf8}, -{0x8504,0xf5}, -{0x8505,0xf0}, -{0x8506,0xee}, -{0x8507,0x84}, -{0x8508,0x20}, -{0x8509,0xd2}, -{0x850a,0x1c}, -{0x850b,0xfe}, -{0x850c,0xad}, -{0x850d,0xf0}, -{0x850e,0x75}, -{0x850f,0xf0}, -{0x8510,0x08}, -{0x8511,0xef}, -{0x8512,0x2f}, -{0x8513,0xff}, -{0x8514,0xed}, -{0x8515,0x33}, -{0x8516,0xfd}, -{0x8517,0x40}, -{0x8518,0x07}, -{0x8519,0x98}, -{0x851a,0x50}, -{0x851b,0x06}, -{0x851c,0xd5}, -{0x851d,0xf0}, -{0x851e,0xf2}, -{0x851f,0x22}, -{0x8520,0xc3}, -{0x8521,0x98}, -{0x8522,0xfd}, -{0x8523,0x0f}, -{0x8524,0xd5}, -{0x8525,0xf0}, -{0x8526,0xea}, -{0x8527,0x22}, -{0x8528,0xe8}, -{0x8529,0x8f}, -{0x852a,0xf0}, -{0x852b,0xa4}, -{0x852c,0xcc}, -{0x852d,0x8b}, -{0x852e,0xf0}, -{0x852f,0xa4}, -{0x8530,0x2c}, -{0x8531,0xfc}, -{0x8532,0xe9}, -{0x8533,0x8e}, -{0x8534,0xf0}, -{0x8535,0xa4}, -{0x8536,0x2c}, -{0x8537,0xfc}, -{0x8538,0x8a}, -{0x8539,0xf0}, -{0x853a,0xed}, -{0x853b,0xa4}, -{0x853c,0x2c}, -{0x853d,0xfc}, -{0x853e,0xea}, -{0x853f,0x8e}, -{0x8540,0xf0}, -{0x8541,0xa4}, -{0x8542,0xcd}, -{0x8543,0xa8}, -{0x8544,0xf0}, -{0x8545,0x8b}, -{0x8546,0xf0}, -{0x8547,0xa4}, -{0x8548,0x2d}, -{0x8549,0xcc}, -{0x854a,0x38}, -{0x854b,0x25}, -{0x854c,0xf0}, -{0x854d,0xfd}, -{0x854e,0xe9}, -{0x854f,0x8f}, -{0x8550,0xf0}, -{0x8551,0xa4}, -{0x8552,0x2c}, -{0x8553,0xcd}, -{0x8554,0x35}, -{0x8555,0xf0}, -{0x8556,0xfc}, -{0x8557,0xeb}, -{0x8558,0x8e}, -{0x8559,0xf0}, -{0x855a,0xa4}, -{0x855b,0xfe}, -{0x855c,0xa9}, -{0x855d,0xf0}, -{0x855e,0xeb}, -{0x855f,0x8f}, -{0x8560,0xf0}, -{0x8561,0xa4}, -{0x8562,0xcf}, -{0x8563,0xc5}, -{0x8564,0xf0}, -{0x8565,0x2e}, -{0x8566,0xcd}, -{0x8567,0x39}, -{0x8568,0xfe}, -{0x8569,0xe4}, -{0x856a,0x3c}, -{0x856b,0xfc}, -{0x856c,0xea}, -{0x856d,0xa4}, -{0x856e,0x2d}, -{0x856f,0xce}, -{0x8570,0x35}, -{0x8571,0xf0}, -{0x8572,0xfd}, -{0x8573,0xe4}, -{0x8574,0x3c}, -{0x8575,0xfc}, -{0x8576,0x22}, -{0x8577,0x75}, -{0x8578,0xf0}, -{0x8579,0x08}, -{0x857a,0x75}, -{0x857b,0x82}, -{0x857c,0x00}, -{0x857d,0xef}, -{0x857e,0x2f}, -{0x857f,0xff}, -{0x8580,0xee}, -{0x8581,0x33}, -{0x8582,0xfe}, -{0x8583,0xcd}, -{0x8584,0x33}, -{0x8585,0xcd}, -{0x8586,0xcc}, -{0x8587,0x33}, -{0x8588,0xcc}, -{0x8589,0xc5}, -{0x858a,0x82}, -{0x858b,0x33}, -{0x858c,0xc5}, -{0x858d,0x82}, -{0x858e,0x9b}, -{0x858f,0xed}, -{0x8590,0x9a}, -{0x8591,0xec}, -{0x8592,0x99}, -{0x8593,0xe5}, -{0x8594,0x82}, -{0x8595,0x98}, -{0x8596,0x40}, -{0x8597,0x0c}, -{0x8598,0xf5}, -{0x8599,0x82}, -{0x859a,0xee}, -{0x859b,0x9b}, -{0x859c,0xfe}, -{0x859d,0xed}, -{0x859e,0x9a}, -{0x859f,0xfd}, -{0x85a0,0xec}, -{0x85a1,0x99}, -{0x85a2,0xfc}, -{0x85a3,0x0f}, -{0x85a4,0xd5}, -{0x85a5,0xf0}, -{0x85a6,0xd6}, -{0x85a7,0xe4}, -{0x85a8,0xce}, -{0x85a9,0xfb}, -{0x85aa,0xe4}, -{0x85ab,0xcd}, -{0x85ac,0xfa}, -{0x85ad,0xe4}, -{0x85ae,0xcc}, -{0x85af,0xf9}, -{0x85b0,0xa8}, -{0x85b1,0x82}, -{0x85b2,0x22}, -{0x85b3,0xb8}, -{0x85b4,0x00}, -{0x85b5,0xc1}, -{0x85b6,0xb9}, -{0x85b7,0x00}, -{0x85b8,0x59}, -{0x85b9,0xba}, -{0x85ba,0x00}, -{0x85bb,0x2d}, -{0x85bc,0xec}, -{0x85bd,0x8b}, -{0x85be,0xf0}, -{0x85bf,0x84}, -{0x85c0,0xcf}, -{0x85c1,0xce}, -{0x85c2,0xcd}, -{0x85c3,0xfc}, -{0x85c4,0xe5}, -{0x85c5,0xf0}, -{0x85c6,0xcb}, -{0x85c7,0xf9}, -{0x85c8,0x78}, -{0x85c9,0x18}, -{0x85ca,0xef}, -{0x85cb,0x2f}, -{0x85cc,0xff}, -{0x85cd,0xee}, -{0x85ce,0x33}, -{0x85cf,0xfe}, -{0x85d0,0xed}, -{0x85d1,0x33}, -{0x85d2,0xfd}, -{0x85d3,0xec}, -{0x85d4,0x33}, -{0x85d5,0xfc}, -{0x85d6,0xeb}, -{0x85d7,0x33}, -{0x85d8,0xfb}, -{0x85d9,0x10}, -{0x85da,0xd7}, -{0x85db,0x03}, -{0x85dc,0x99}, -{0x85dd,0x40}, -{0x85de,0x04}, -{0x85df,0xeb}, -{0x85e0,0x99}, -{0x85e1,0xfb}, -{0x85e2,0x0f}, -{0x85e3,0xd8}, -{0x85e4,0xe5}, -{0x85e5,0xe4}, -{0x85e6,0xf9}, -{0x85e7,0xfa}, -{0x85e8,0x22}, -{0x85e9,0x78}, -{0x85ea,0x18}, -{0x85eb,0xef}, -{0x85ec,0x2f}, -{0x85ed,0xff}, -{0x85ee,0xee}, -{0x85ef,0x33}, -{0x85f0,0xfe}, -{0x85f1,0xed}, -{0x85f2,0x33}, -{0x85f3,0xfd}, -{0x85f4,0xec}, -{0x85f5,0x33}, -{0x85f6,0xfc}, -{0x85f7,0xc9}, -{0x85f8,0x33}, -{0x85f9,0xc9}, -{0x85fa,0x10}, -{0x85fb,0xd7}, -{0x85fc,0x05}, -{0x85fd,0x9b}, -{0x85fe,0xe9}, -{0x85ff,0x9a}, -{0x8600,0x40}, -{0x8601,0x07}, -{0x8602,0xec}, -{0x8603,0x9b}, -{0x8604,0xfc}, -{0x8605,0xe9}, -{0x8606,0x9a}, -{0x8607,0xf9}, -{0x8608,0x0f}, -{0x8609,0xd8}, -{0x860a,0xe0}, -{0x860b,0xe4}, -{0x860c,0xc9}, -{0x860d,0xfa}, -{0x860e,0xe4}, -{0x860f,0xcc}, -{0x8610,0xfb}, -{0x8611,0x22}, -{0x8612,0x75}, -{0x8613,0xf0}, -{0x8614,0x10}, -{0x8615,0xef}, -{0x8616,0x2f}, -{0x8617,0xff}, -{0x8618,0xee}, -{0x8619,0x33}, -{0x861a,0xfe}, -{0x861b,0xed}, -{0x861c,0x33}, -{0x861d,0xfd}, -{0x861e,0xcc}, -{0x861f,0x33}, -{0x8620,0xcc}, -{0x8621,0xc8}, -{0x8622,0x33}, -{0x8623,0xc8}, -{0x8624,0x10}, -{0x8625,0xd7}, -{0x8626,0x07}, -{0x8627,0x9b}, -{0x8628,0xec}, -{0x8629,0x9a}, -{0x862a,0xe8}, -{0x862b,0x99}, -{0x862c,0x40}, -{0x862d,0x0a}, -{0x862e,0xed}, -{0x862f,0x9b}, -{0x8630,0xfd}, -{0x8631,0xec}, -{0x8632,0x9a}, -{0x8633,0xfc}, -{0x8634,0xe8}, -{0x8635,0x99}, -{0x8636,0xf8}, -{0x8637,0x0f}, -{0x8638,0xd5}, -{0x8639,0xf0}, -{0x863a,0xda}, -{0x863b,0xe4}, -{0x863c,0xcd}, -{0x863d,0xfb}, -{0x863e,0xe4}, -{0x863f,0xcc}, -{0x8640,0xfa}, -{0x8641,0xe4}, -{0x8642,0xc8}, -{0x8643,0xf9}, -{0x8644,0x22}, -{0x8645,0xeb}, -{0x8646,0x9f}, -{0x8647,0xf5}, -{0x8648,0xf0}, -{0x8649,0xea}, -{0x864a,0x9e}, -{0x864b,0x42}, -{0x864c,0xf0}, -{0x864d,0xe9}, -{0x864e,0x9d}, -{0x864f,0x42}, -{0x8650,0xf0}, -{0x8651,0xe8}, -{0x8652,0x9c}, -{0x8653,0x45}, -{0x8654,0xf0}, -{0x8655,0x22}, -{0x8656,0xe8}, -{0x8657,0x60}, -{0x8658,0x0f}, -{0x8659,0xec}, -{0x865a,0xc3}, -{0x865b,0x13}, -{0x865c,0xfc}, -{0x865d,0xed}, -{0x865e,0x13}, -{0x865f,0xfd}, -{0x8660,0xee}, -{0x8661,0x13}, -{0x8662,0xfe}, -{0x8663,0xef}, -{0x8664,0x13}, -{0x8665,0xff}, -{0x8666,0xd8}, -{0x8667,0xf1}, -{0x8668,0x22}, -{0x8669,0xe8}, -{0x866a,0x60}, -{0x866b,0x0f}, -{0x866c,0xef}, -{0x866d,0xc3}, -{0x866e,0x33}, -{0x866f,0xff}, -{0x8670,0xee}, -{0x8671,0x33}, -{0x8672,0xfe}, -{0x8673,0xed}, -{0x8674,0x33}, -{0x8675,0xfd}, -{0x8676,0xec}, -{0x8677,0x33}, -{0x8678,0xfc}, -{0x8679,0xd8}, -{0x867a,0xf1}, -{0x867b,0x22}, -{0x867c,0xe4}, -{0x867d,0x93}, -{0x867e,0xfc}, -{0x867f,0x74}, -{0x8680,0x01}, -{0x8681,0x93}, -{0x8682,0xfd}, -{0x8683,0x74}, -{0x8684,0x02}, -{0x8685,0x93}, -{0x8686,0xfe}, -{0x8687,0x74}, -{0x8688,0x03}, -{0x8689,0x93}, -{0x868a,0xff}, -{0x868b,0x22}, -{0x868c,0xe6}, -{0x868d,0xfb}, -{0x868e,0x08}, -{0x868f,0xe6}, -{0x8690,0xf9}, -{0x8691,0x08}, -{0x8692,0xe6}, -{0x8693,0xfa}, -{0x8694,0x08}, -{0x8695,0xe6}, -{0x8696,0xcb}, -{0x8697,0xf8}, -{0x8698,0x22}, -{0x8699,0xec}, -{0x869a,0xf6}, -{0x869b,0x08}, -{0x869c,0xed}, -{0x869d,0xf6}, -{0x869e,0x08}, -{0x869f,0xee}, -{0x86a0,0xf6}, -{0x86a1,0x08}, -{0x86a2,0xef}, -{0x86a3,0xf6}, -{0x86a4,0x22}, -{0x86a5,0xa4}, -{0x86a6,0x25}, -{0x86a7,0x82}, -{0x86a8,0xf5}, -{0x86a9,0x82}, -{0x86aa,0xe5}, -{0x86ab,0xf0}, -{0x86ac,0x35}, -{0x86ad,0x83}, -{0x86ae,0xf5}, -{0x86af,0x83}, -{0x86b0,0x22}, -{0x86b1,0xd0}, -{0x86b2,0x83}, -{0x86b3,0xd0}, -{0x86b4,0x82}, -{0x86b5,0xf8}, -{0x86b6,0xe4}, -{0x86b7,0x93}, -{0x86b8,0x70}, -{0x86b9,0x12}, -{0x86ba,0x74}, -{0x86bb,0x01}, -{0x86bc,0x93}, -{0x86bd,0x70}, -{0x86be,0x0d}, -{0x86bf,0xa3}, -{0x86c0,0xa3}, -{0x86c1,0x93}, -{0x86c2,0xf8}, -{0x86c3,0x74}, -{0x86c4,0x01}, -{0x86c5,0x93}, -{0x86c6,0xf5}, -{0x86c7,0x82}, -{0x86c8,0x88}, -{0x86c9,0x83}, -{0x86ca,0xe4}, -{0x86cb,0x73}, -{0x86cc,0x74}, -{0x86cd,0x02}, -{0x86ce,0x93}, -{0x86cf,0x68}, -{0x86d0,0x60}, -{0x86d1,0xef}, -{0x86d2,0xa3}, -{0x86d3,0xa3}, -{0x86d4,0xa3}, -{0x86d5,0x80}, -{0x86d6,0xdf}, -{0x86d7,0x90}, -{0x86d8,0x38}, -{0x86d9,0x04}, -{0x86da,0x78}, -{0x86db,0x52}, -{0x86dc,0x12}, -{0x86dd,0x0b}, -{0x86de,0xfd}, -{0x86df,0x90}, -{0x86e0,0x38}, -{0x86e1,0x00}, -{0x86e2,0xe0}, -{0x86e3,0xfe}, -{0x86e4,0xa3}, -{0x86e5,0xe0}, -{0x86e6,0xfd}, -{0x86e7,0xed}, -{0x86e8,0xff}, -{0x86e9,0xc3}, -{0x86ea,0x12}, -{0x86eb,0x0b}, -{0x86ec,0x9e}, -{0x86ed,0x90}, -{0x86ee,0x38}, -{0x86ef,0x10}, -{0x86f0,0x12}, -{0x86f1,0x0b}, -{0x86f2,0x92}, -{0x86f3,0x90}, -{0x86f4,0x38}, -{0x86f5,0x06}, -{0x86f6,0x78}, -{0x86f7,0x54}, -{0x86f8,0x12}, -{0x86f9,0x0b}, -{0x86fa,0xfd}, -{0x86fb,0x90}, -{0x86fc,0x38}, -{0x86fd,0x02}, -{0x86fe,0xe0}, -{0x86ff,0xfe}, -{0x8700,0xa3}, -{0x8701,0xe0}, -{0x8702,0xfd}, -{0x8703,0xed}, -{0x8704,0xff}, -{0x8705,0xc3}, -{0x8706,0x12}, -{0x8707,0x0b}, -{0x8708,0x9e}, -{0x8709,0x90}, -{0x870a,0x38}, -{0x870b,0x12}, -{0x870c,0x12}, -{0x870d,0x0b}, -{0x870e,0x92}, -{0x870f,0xa3}, -{0x8710,0xe0}, -{0x8711,0xb4}, -{0x8712,0x31}, -{0x8713,0x07}, -{0x8714,0x78}, -{0x8715,0x52}, -{0x8716,0x79}, -{0x8717,0x52}, -{0x8718,0x12}, -{0x8719,0x0c}, -{0x871a,0x13}, -{0x871b,0x90}, -{0x871c,0x38}, -{0x871d,0x14}, -{0x871e,0xe0}, -{0x871f,0xb4}, -{0x8720,0x71}, -{0x8721,0x15}, -{0x8722,0x78}, -{0x8723,0x52}, -{0x8724,0xe6}, -{0x8725,0xfe}, -{0x8726,0x08}, -{0x8727,0xe6}, -{0x8728,0x78}, -{0x8729,0x02}, -{0x872a,0xce}, -{0x872b,0xc3}, -{0x872c,0x13}, -{0x872d,0xce}, -{0x872e,0x13}, -{0x872f,0xd8}, -{0x8730,0xf9}, -{0x8731,0x79}, -{0x8732,0x53}, -{0x8733,0xf7}, -{0x8734,0xee}, -{0x8735,0x19}, -{0x8736,0xf7}, -{0x8737,0x90}, -{0x8738,0x38}, -{0x8739,0x15}, -{0x873a,0xe0}, -{0x873b,0xb4}, -{0x873c,0x31}, -{0x873d,0x07}, -{0x873e,0x78}, -{0x873f,0x54}, -{0x8740,0x79}, -{0x8741,0x54}, -{0x8742,0x12}, -{0x8743,0x0c}, -{0x8744,0x13}, -{0x8745,0x90}, -{0x8746,0x38}, -{0x8747,0x15}, -{0x8748,0xe0}, -{0x8749,0xb4}, -{0x874a,0x71}, -{0x874b,0x15}, -{0x874c,0x78}, -{0x874d,0x54}, -{0x874e,0xe6}, -{0x874f,0xfe}, -{0x8750,0x08}, -{0x8751,0xe6}, -{0x8752,0x78}, -{0x8753,0x02}, -{0x8754,0xce}, -{0x8755,0xc3}, -{0x8756,0x13}, -{0x8757,0xce}, -{0x8758,0x13}, -{0x8759,0xd8}, -{0x875a,0xf9}, -{0x875b,0x79}, -{0x875c,0x55}, -{0x875d,0xf7}, -{0x875e,0xee}, -{0x875f,0x19}, -{0x8760,0xf7}, -{0x8761,0x79}, -{0x8762,0x52}, -{0x8763,0x12}, -{0x8764,0x0b}, -{0x8765,0xd9}, -{0x8766,0x09}, -{0x8767,0x12}, -{0x8768,0x0b}, -{0x8769,0xd9}, -{0x876a,0xaf}, -{0x876b,0x47}, -{0x876c,0x12}, -{0x876d,0x0b}, -{0x876e,0xb2}, -{0x876f,0xe5}, -{0x8770,0x44}, -{0x8771,0xfb}, -{0x8772,0x7a}, -{0x8773,0x00}, -{0x8774,0xfd}, -{0x8775,0x7c}, -{0x8776,0x00}, -{0x8777,0x12}, -{0x8778,0x04}, -{0x8779,0xd3}, -{0x877a,0x78}, -{0x877b,0x5a}, -{0x877c,0xa6}, -{0x877d,0x06}, -{0x877e,0x08}, -{0x877f,0xa6}, -{0x8780,0x07}, -{0x8781,0xaf}, -{0x8782,0x45}, -{0x8783,0x12}, -{0x8784,0x0b}, -{0x8785,0xb2}, -{0x8786,0xad}, -{0x8787,0x03}, -{0x8788,0x7c}, -{0x8789,0x00}, -{0x878a,0x12}, -{0x878b,0x04}, -{0x878c,0xd3}, -{0x878d,0x78}, -{0x878e,0x56}, -{0x878f,0xa6}, -{0x8790,0x06}, -{0x8791,0x08}, -{0x8792,0xa6}, -{0x8793,0x07}, -{0x8794,0xaf}, -{0x8795,0x48}, -{0x8796,0x78}, -{0x8797,0x54}, -{0x8798,0x12}, -{0x8799,0x0b}, -{0x879a,0xb4}, -{0x879b,0xe5}, -{0x879c,0x43}, -{0x879d,0xfb}, -{0x879e,0xfd}, -{0x879f,0x7c}, -{0x87a0,0x00}, -{0x87a1,0x12}, -{0x87a2,0x04}, -{0x87a3,0xd3}, -{0x87a4,0x78}, -{0x87a5,0x5c}, -{0x87a6,0xa6}, -{0x87a7,0x06}, -{0x87a8,0x08}, -{0x87a9,0xa6}, -{0x87aa,0x07}, -{0x87ab,0xaf}, -{0x87ac,0x46}, -{0x87ad,0x7e}, -{0x87ae,0x00}, -{0x87af,0x78}, -{0x87b0,0x54}, -{0x87b1,0x12}, -{0x87b2,0x0b}, -{0x87b3,0xb6}, -{0x87b4,0xad}, -{0x87b5,0x03}, -{0x87b6,0x7c}, -{0x87b7,0x00}, -{0x87b8,0x12}, -{0x87b9,0x04}, -{0x87ba,0xd3}, -{0x87bb,0x78}, -{0x87bc,0x58}, -{0x87bd,0xa6}, -{0x87be,0x06}, -{0x87bf,0x08}, -{0x87c0,0xa6}, -{0x87c1,0x07}, -{0x87c2,0xc3}, -{0x87c3,0x78}, -{0x87c4,0x5b}, -{0x87c5,0xe6}, -{0x87c6,0x94}, -{0x87c7,0x08}, -{0x87c8,0x18}, -{0x87c9,0xe6}, -{0x87ca,0x94}, -{0x87cb,0x00}, -{0x87cc,0x50}, -{0x87cd,0x05}, -{0x87ce,0x76}, -{0x87cf,0x00}, -{0x87d0,0x08}, -{0x87d1,0x76}, -{0x87d2,0x08}, -{0x87d3,0xc3}, -{0x87d4,0x78}, -{0x87d5,0x5d}, -{0x87d6,0xe6}, -{0x87d7,0x94}, -{0x87d8,0x08}, -{0x87d9,0x18}, -{0x87da,0xe6}, -{0x87db,0x94}, -{0x87dc,0x00}, -{0x87dd,0x50}, -{0x87de,0x05}, -{0x87df,0x76}, -{0x87e0,0x00}, -{0x87e1,0x08}, -{0x87e2,0x76}, -{0x87e3,0x08}, -{0x87e4,0x78}, -{0x87e5,0x5a}, -{0x87e6,0x12}, -{0x87e7,0x0b}, -{0x87e8,0xc6}, -{0x87e9,0xff}, -{0x87ea,0xd3}, -{0x87eb,0x78}, -{0x87ec,0x57}, -{0x87ed,0xe6}, -{0x87ee,0x9f}, -{0x87ef,0x18}, -{0x87f0,0xe6}, -{0x87f1,0x9e}, -{0x87f2,0x40}, -{0x87f3,0x0e}, -{0x87f4,0x78}, -{0x87f5,0x5a}, -{0x87f6,0xe6}, -{0x87f7,0x13}, -{0x87f8,0xfe}, -{0x87f9,0x08}, -{0x87fa,0xe6}, -{0x87fb,0x78}, -{0x87fc,0x57}, -{0x87fd,0x12}, -{0x87fe,0x0c}, -{0x87ff,0x08}, -{0x8800,0x80}, -{0x8801,0x04}, -{0x8802,0x7e}, -{0x8803,0x00}, -{0x8804,0x7f}, -{0x8805,0x00}, -{0x8806,0x78}, -{0x8807,0x5e}, -{0x8808,0x12}, -{0x8809,0x0b}, -{0x880a,0xbe}, -{0x880b,0xff}, -{0x880c,0xd3}, -{0x880d,0x78}, -{0x880e,0x59}, -{0x880f,0xe6}, -{0x8810,0x9f}, -{0x8811,0x18}, -{0x8812,0xe6}, -{0x8813,0x9e}, -{0x8814,0x40}, -{0x8815,0x0e}, -{0x8816,0x78}, -{0x8817,0x5c}, -{0x8818,0xe6}, -{0x8819,0x13}, -{0x881a,0xfe}, -{0x881b,0x08}, -{0x881c,0xe6}, -{0x881d,0x78}, -{0x881e,0x59}, -{0x881f,0x12}, -{0x8820,0x0c}, -{0x8821,0x08}, -{0x8822,0x80}, -{0x8823,0x04}, -{0x8824,0x7e}, -{0x8825,0x00}, -{0x8826,0x7f}, -{0x8827,0x00}, -{0x8828,0xe4}, -{0x8829,0xfc}, -{0x882a,0xfd}, -{0x882b,0x78}, -{0x882c,0x62}, -{0x882d,0x12}, -{0x882e,0x06}, -{0x882f,0x99}, -{0x8830,0x78}, -{0x8831,0x5a}, -{0x8832,0x12}, -{0x8833,0x0b}, -{0x8834,0xc6}, -{0x8835,0x78}, -{0x8836,0x57}, -{0x8837,0x26}, -{0x8838,0xff}, -{0x8839,0xee}, -{0x883a,0x18}, -{0x883b,0x36}, -{0x883c,0xfe}, -{0x883d,0x78}, -{0x883e,0x66}, -{0x883f,0x12}, -{0x8840,0x0b}, -{0x8841,0xbe}, -{0x8842,0x78}, -{0x8843,0x59}, -{0x8844,0x26}, -{0x8845,0xff}, -{0x8846,0xee}, -{0x8847,0x18}, -{0x8848,0x36}, -{0x8849,0xfe}, -{0x884a,0xe4}, -{0x884b,0xfc}, -{0x884c,0xfd}, -{0x884d,0x78}, -{0x884e,0x6a}, -{0x884f,0x12}, -{0x8850,0x06}, -{0x8851,0x99}, -{0x8852,0x12}, -{0x8853,0x0b}, -{0x8854,0xce}, -{0x8855,0x78}, -{0x8856,0x66}, -{0x8857,0x12}, -{0x8858,0x06}, -{0x8859,0x8c}, -{0x885a,0xd3}, -{0x885b,0x12}, -{0x885c,0x06}, -{0x885d,0x45}, -{0x885e,0x40}, -{0x885f,0x08}, -{0x8860,0x12}, -{0x8861,0x0b}, -{0x8862,0xce}, -{0x8863,0x78}, -{0x8864,0x66}, -{0x8865,0x12}, -{0x8866,0x06}, -{0x8867,0x99}, -{0x8868,0x78}, -{0x8869,0x54}, -{0x886a,0x12}, -{0x886b,0x0b}, -{0x886c,0xd0}, -{0x886d,0x78}, -{0x886e,0x6a}, -{0x886f,0x12}, -{0x8870,0x06}, -{0x8871,0x8c}, -{0x8872,0xd3}, -{0x8873,0x12}, -{0x8874,0x06}, -{0x8875,0x45}, -{0x8876,0x40}, -{0x8877,0x0a}, -{0x8878,0x78}, -{0x8879,0x54}, -{0x887a,0x12}, -{0x887b,0x0b}, -{0x887c,0xd0}, -{0x887d,0x78}, -{0x887e,0x6a}, -{0x887f,0x12}, -{0x8880,0x06}, -{0x8881,0x99}, -{0x8882,0x78}, -{0x8883,0x61}, -{0x8884,0xe6}, -{0x8885,0x90}, -{0x8886,0x60}, -{0x8887,0x01}, -{0x8888,0xf0}, -{0x8889,0x78}, -{0x888a,0x65}, -{0x888b,0xe6}, -{0x888c,0xa3}, -{0x888d,0xf0}, -{0x888e,0x78}, -{0x888f,0x69}, -{0x8890,0xe6}, -{0x8891,0xa3}, -{0x8892,0xf0}, -{0x8893,0x78}, -{0x8894,0x55}, -{0x8895,0xe6}, -{0x8896,0xa3}, -{0x8897,0xf0}, -{0x8898,0x7d}, -{0x8899,0x01}, -{0x889a,0x78}, -{0x889b,0x61}, -{0x889c,0x12}, -{0x889d,0x0b}, -{0x889e,0xe9}, -{0x889f,0x24}, -{0x88a0,0x01}, -{0x88a1,0x12}, -{0x88a2,0x0b}, -{0x88a3,0xa6}, -{0x88a4,0x78}, -{0x88a5,0x65}, -{0x88a6,0x12}, -{0x88a7,0x0b}, -{0x88a8,0xe9}, -{0x88a9,0x24}, -{0x88aa,0x02}, -{0x88ab,0x12}, -{0x88ac,0x0b}, -{0x88ad,0xa6}, -{0x88ae,0x78}, -{0x88af,0x69}, -{0x88b0,0x12}, -{0x88b1,0x0b}, -{0x88b2,0xe9}, -{0x88b3,0x24}, -{0x88b4,0x03}, -{0x88b5,0x12}, -{0x88b6,0x0b}, -{0x88b7,0xa6}, -{0x88b8,0x78}, -{0x88b9,0x6d}, -{0x88ba,0x12}, -{0x88bb,0x0b}, -{0x88bc,0xe9}, -{0x88bd,0x24}, -{0x88be,0x04}, -{0x88bf,0x12}, -{0x88c0,0x0b}, -{0x88c1,0xa6}, -{0x88c2,0x0d}, -{0x88c3,0xbd}, -{0x88c4,0x05}, -{0x88c5,0xd4}, -{0x88c6,0xc2}, -{0x88c7,0x0e}, -{0x88c8,0xc2}, -{0x88c9,0x06}, -{0x88ca,0x22}, -{0x88cb,0x85}, -{0x88cc,0x08}, -{0x88cd,0x41}, -{0x88ce,0x90}, -{0x88cf,0x30}, -{0x88d0,0x24}, -{0x88d1,0xe0}, -{0x88d2,0xf5}, -{0x88d3,0x3d}, -{0x88d4,0xa3}, -{0x88d5,0xe0}, -{0x88d6,0xf5}, -{0x88d7,0x3e}, -{0x88d8,0xa3}, -{0x88d9,0xe0}, -{0x88da,0xf5}, -{0x88db,0x3f}, -{0x88dc,0xa3}, -{0x88dd,0xe0}, -{0x88de,0xf5}, -{0x88df,0x40}, -{0x88e0,0xa3}, -{0x88e1,0xe0}, -{0x88e2,0xf5}, -{0x88e3,0x3c}, -{0x88e4,0xd2}, -{0x88e5,0x34}, -{0x88e6,0xe5}, -{0x88e7,0x41}, -{0x88e8,0x12}, -{0x88e9,0x06}, -{0x88ea,0xb1}, -{0x88eb,0x09}, -{0x88ec,0x31}, -{0x88ed,0x03}, -{0x88ee,0x09}, -{0x88ef,0x35}, -{0x88f0,0x04}, -{0x88f1,0x09}, -{0x88f2,0x3b}, -{0x88f3,0x05}, -{0x88f4,0x09}, -{0x88f5,0x3e}, -{0x88f6,0x06}, -{0x88f7,0x09}, -{0x88f8,0x41}, -{0x88f9,0x07}, -{0x88fa,0x09}, -{0x88fb,0x4a}, -{0x88fc,0x08}, -{0x88fd,0x09}, -{0x88fe,0x5b}, -{0x88ff,0x12}, -{0x8900,0x09}, -{0x8901,0x73}, -{0x8902,0x18}, -{0x8903,0x09}, -{0x8904,0x89}, -{0x8905,0x19}, -{0x8906,0x09}, -{0x8907,0x5e}, -{0x8908,0x1a}, -{0x8909,0x09}, -{0x890a,0x6a}, -{0x890b,0x1b}, -{0x890c,0x09}, -{0x890d,0xad}, -{0x890e,0x80}, -{0x890f,0x09}, -{0x8910,0xb2}, -{0x8911,0x81}, -{0x8912,0x0a}, -{0x8913,0x1d}, -{0x8914,0x8f}, -{0x8915,0x0a}, -{0x8916,0x09}, -{0x8917,0x90}, -{0x8918,0x0a}, -{0x8919,0x1d}, -{0x891a,0x91}, -{0x891b,0x0a}, -{0x891c,0x1d}, -{0x891d,0x92}, -{0x891e,0x0a}, -{0x891f,0x1d}, -{0x8920,0x93}, -{0x8921,0x0a}, -{0x8922,0x1d}, -{0x8923,0x94}, -{0x8924,0x0a}, -{0x8925,0x1d}, -{0x8926,0x98}, -{0x8927,0x0a}, -{0x8928,0x17}, -{0x8929,0x9f}, -{0x892a,0x0a}, -{0x892b,0x1a}, -{0x892c,0xec}, -{0x892d,0x00}, -{0x892e,0x00}, -{0x892f,0x0a}, -{0x8930,0x38}, -{0x8931,0x12}, -{0x8932,0x0f}, -{0x8933,0x74}, -{0x8934,0x22}, -{0x8935,0x12}, -{0x8936,0x0f}, -{0x8937,0x74}, -{0x8938,0xd2}, -{0x8939,0x03}, -{0x893a,0x22}, -{0x893b,0xd2}, -{0x893c,0x03}, -{0x893d,0x22}, -{0x893e,0xc2}, -{0x893f,0x03}, -{0x8940,0x22}, -{0x8941,0xa2}, -{0x8942,0x37}, -{0x8943,0xe4}, -{0x8944,0x33}, -{0x8945,0xf5}, -{0x8946,0x3c}, -{0x8947,0x02}, -{0x8948,0x0a}, -{0x8949,0x1d}, -{0x894a,0xc2}, -{0x894b,0x01}, -{0x894c,0xc2}, -{0x894d,0x02}, -{0x894e,0xc2}, -{0x894f,0x03}, -{0x8950,0x12}, -{0x8951,0x0d}, -{0x8952,0x0d}, -{0x8953,0x75}, -{0x8954,0x1e}, -{0x8955,0x70}, -{0x8956,0xd2}, -{0x8957,0x35}, -{0x8958,0x02}, -{0x8959,0x0a}, -{0x895a,0x1d}, -{0x895b,0x02}, -{0x895c,0x0a}, -{0x895d,0x04}, -{0x895e,0x85}, -{0x895f,0x40}, -{0x8960,0x4a}, -{0x8961,0x85}, -{0x8962,0x3c}, -{0x8963,0x4b}, -{0x8964,0x12}, -{0x8965,0x0a}, -{0x8966,0xff}, -{0x8967,0x02}, -{0x8968,0x0a}, -{0x8969,0x1d}, -{0x896a,0x85}, -{0x896b,0x4a}, -{0x896c,0x40}, -{0x896d,0x85}, -{0x896e,0x4b}, -{0x896f,0x3c}, -{0x8970,0x02}, -{0x8971,0x0a}, -{0x8972,0x1d}, -{0x8973,0xe4}, -{0x8974,0xf5}, -{0x8975,0x22}, -{0x8976,0xf5}, -{0x8977,0x23}, -{0x8978,0x85}, -{0x8979,0x40}, -{0x897a,0x31}, -{0x897b,0x85}, -{0x897c,0x3f}, -{0x897d,0x30}, -{0x897e,0x85}, -{0x897f,0x3e}, -{0x8980,0x2f}, -{0x8981,0x85}, -{0x8982,0x3d}, -{0x8983,0x2e}, -{0x8984,0x12}, -{0x8985,0x0f}, -{0x8986,0x46}, -{0x8987,0x80}, -{0x8988,0x1f}, -{0x8989,0x75}, -{0x898a,0x22}, -{0x898b,0x00}, -{0x898c,0x75}, -{0x898d,0x23}, -{0x898e,0x01}, -{0x898f,0x74}, -{0x8990,0xff}, -{0x8991,0xf5}, -{0x8992,0x2d}, -{0x8993,0xf5}, -{0x8994,0x2c}, -{0x8995,0xf5}, -{0x8996,0x2b}, -{0x8997,0xf5}, -{0x8998,0x2a}, -{0x8999,0x12}, -{0x899a,0x0f}, -{0x899b,0x46}, -{0x899c,0x85}, -{0x899d,0x2d}, -{0x899e,0x40}, -{0x899f,0x85}, -{0x89a0,0x2c}, -{0x89a1,0x3f}, -{0x89a2,0x85}, -{0x89a3,0x2b}, -{0x89a4,0x3e}, -{0x89a5,0x85}, -{0x89a6,0x2a}, -{0x89a7,0x3d}, -{0x89a8,0xe4}, -{0x89a9,0xf5}, -{0x89aa,0x3c}, -{0x89ab,0x80}, -{0x89ac,0x70}, -{0x89ad,0x12}, -{0x89ae,0x0f}, -{0x89af,0x16}, -{0x89b0,0x80}, -{0x89b1,0x6b}, -{0x89b2,0x85}, -{0x89b3,0x3d}, -{0x89b4,0x45}, -{0x89b5,0x85}, -{0x89b6,0x3e}, -{0x89b7,0x46}, -{0x89b8,0xe5}, -{0x89b9,0x47}, -{0x89ba,0xc3}, -{0x89bb,0x13}, -{0x89bc,0xff}, -{0x89bd,0xe5}, -{0x89be,0x45}, -{0x89bf,0xc3}, -{0x89c0,0x9f}, -{0x89c1,0x50}, -{0x89c2,0x02}, -{0x89c3,0x8f}, -{0x89c4,0x45}, -{0x89c5,0xe5}, -{0x89c6,0x48}, -{0x89c7,0xc3}, -{0x89c8,0x13}, -{0x89c9,0xff}, -{0x89ca,0xe5}, -{0x89cb,0x46}, -{0x89cc,0xc3}, -{0x89cd,0x9f}, -{0x89ce,0x50}, -{0x89cf,0x02}, -{0x89d0,0x8f}, -{0x89d1,0x46}, -{0x89d2,0xe5}, -{0x89d3,0x47}, -{0x89d4,0xc3}, -{0x89d5,0x13}, -{0x89d6,0xff}, -{0x89d7,0xfd}, -{0x89d8,0xe5}, -{0x89d9,0x45}, -{0x89da,0x2d}, -{0x89db,0xfd}, -{0x89dc,0xe4}, -{0x89dd,0x33}, -{0x89de,0xfc}, -{0x89df,0xe5}, -{0x89e0,0x44}, -{0x89e1,0x12}, -{0x89e2,0x0f}, -{0x89e3,0x90}, -{0x89e4,0x40}, -{0x89e5,0x05}, -{0x89e6,0xe5}, -{0x89e7,0x44}, -{0x89e8,0x9f}, -{0x89e9,0xf5}, -{0x89ea,0x45}, -{0x89eb,0xe5}, -{0x89ec,0x48}, -{0x89ed,0xc3}, -{0x89ee,0x13}, -{0x89ef,0xff}, -{0x89f0,0xfd}, -{0x89f1,0xe5}, -{0x89f2,0x46}, -{0x89f3,0x2d}, -{0x89f4,0xfd}, -{0x89f5,0xe4}, -{0x89f6,0x33}, -{0x89f7,0xfc}, -{0x89f8,0xe5}, -{0x89f9,0x43}, -{0x89fa,0x12}, -{0x89fb,0x0f}, -{0x89fc,0x90}, -{0x89fd,0x40}, -{0x89fe,0x05}, -{0x89ff,0xe5}, -{0x8a00,0x43}, -{0x8a01,0x9f}, -{0x8a02,0xf5}, -{0x8a03,0x46}, -{0x8a04,0x12}, -{0x8a05,0x06}, -{0x8a06,0xd7}, -{0x8a07,0x80}, -{0x8a08,0x14}, -{0x8a09,0x85}, -{0x8a0a,0x40}, -{0x8a0b,0x48}, -{0x8a0c,0x85}, -{0x8a0d,0x3f}, -{0x8a0e,0x47}, -{0x8a0f,0x85}, -{0x8a10,0x3e}, -{0x8a11,0x46}, -{0x8a12,0x85}, -{0x8a13,0x3d}, -{0x8a14,0x45}, -{0x8a15,0x80}, -{0x8a16,0x06}, -{0x8a17,0x02}, -{0x8a18,0x06}, -{0x8a19,0xd7}, -{0x8a1a,0x12}, -{0x8a1b,0x0d}, -{0x8a1c,0x7e}, -{0x8a1d,0x90}, -{0x8a1e,0x30}, -{0x8a1f,0x24}, -{0x8a20,0xe5}, -{0x8a21,0x3d}, -{0x8a22,0xf0}, -{0x8a23,0xa3}, -{0x8a24,0xe5}, -{0x8a25,0x3e}, -{0x8a26,0xf0}, -{0x8a27,0xa3}, -{0x8a28,0xe5}, -{0x8a29,0x3f}, -{0x8a2a,0xf0}, -{0x8a2b,0xa3}, -{0x8a2c,0xe5}, -{0x8a2d,0x40}, -{0x8a2e,0xf0}, -{0x8a2f,0xa3}, -{0x8a30,0xe5}, -{0x8a31,0x3c}, -{0x8a32,0xf0}, -{0x8a33,0x90}, -{0x8a34,0x30}, -{0x8a35,0x23}, -{0x8a36,0xe4}, -{0x8a37,0xf0}, -{0x8a38,0x22}, -{0x8a39,0xc0}, -{0x8a3a,0xe0}, -{0x8a3b,0xc0}, -{0x8a3c,0x83}, -{0x8a3d,0xc0}, -{0x8a3e,0x82}, -{0x8a3f,0xc0}, -{0x8a40,0xd0}, -{0x8a41,0x90}, -{0x8a42,0x3f}, -{0x8a43,0x0c}, -{0x8a44,0xe0}, -{0x8a45,0xf5}, -{0x8a46,0x32}, -{0x8a47,0xe5}, -{0x8a48,0x32}, -{0x8a49,0x30}, -{0x8a4a,0xe3}, -{0x8a4b,0x74}, -{0x8a4c,0x30}, -{0x8a4d,0x36}, -{0x8a4e,0x66}, -{0x8a4f,0x90}, -{0x8a50,0x60}, -{0x8a51,0x19}, -{0x8a52,0xe0}, -{0x8a53,0xf5}, -{0x8a54,0x0a}, -{0x8a55,0xa3}, -{0x8a56,0xe0}, -{0x8a57,0xf5}, -{0x8a58,0x0b}, -{0x8a59,0x90}, -{0x8a5a,0x60}, -{0x8a5b,0x1d}, -{0x8a5c,0xe0}, -{0x8a5d,0xf5}, -{0x8a5e,0x14}, -{0x8a5f,0xa3}, -{0x8a60,0xe0}, -{0x8a61,0xf5}, -{0x8a62,0x15}, -{0x8a63,0x90}, -{0x8a64,0x60}, -{0x8a65,0x21}, -{0x8a66,0xe0}, -{0x8a67,0xf5}, -{0x8a68,0x0c}, -{0x8a69,0xa3}, -{0x8a6a,0xe0}, -{0x8a6b,0xf5}, -{0x8a6c,0x0d}, -{0x8a6d,0x90}, -{0x8a6e,0x60}, -{0x8a6f,0x29}, -{0x8a70,0xe0}, -{0x8a71,0xf5}, -{0x8a72,0x0e}, -{0x8a73,0xa3}, -{0x8a74,0xe0}, -{0x8a75,0xf5}, -{0x8a76,0x0f}, -{0x8a77,0x90}, -{0x8a78,0x60}, -{0x8a79,0x31}, -{0x8a7a,0xe0}, -{0x8a7b,0xf5}, -{0x8a7c,0x10}, -{0x8a7d,0xa3}, -{0x8a7e,0xe0}, -{0x8a7f,0xf5}, -{0x8a80,0x11}, -{0x8a81,0x90}, -{0x8a82,0x60}, -{0x8a83,0x39}, -{0x8a84,0xe0}, -{0x8a85,0xf5}, -{0x8a86,0x12}, -{0x8a87,0xa3}, -{0x8a88,0xe0}, -{0x8a89,0xf5}, -{0x8a8a,0x13}, -{0x8a8b,0x30}, -{0x8a8c,0x01}, -{0x8a8d,0x06}, -{0x8a8e,0x30}, -{0x8a8f,0x33}, -{0x8a90,0x03}, -{0x8a91,0xd3}, -{0x8a92,0x80}, -{0x8a93,0x01}, -{0x8a94,0xc3}, -{0x8a95,0x92}, -{0x8a96,0x09}, -{0x8a97,0x30}, -{0x8a98,0x02}, -{0x8a99,0x06}, -{0x8a9a,0x30}, -{0x8a9b,0x33}, -{0x8a9c,0x03}, -{0x8a9d,0xd3}, -{0x8a9e,0x80}, -{0x8a9f,0x01}, -{0x8aa0,0xc3}, -{0x8aa1,0x92}, -{0x8aa2,0x0a}, -{0x8aa3,0x30}, -{0x8aa4,0x33}, -{0x8aa5,0x0c}, -{0x8aa6,0x30}, -{0x8aa7,0x03}, -{0x8aa8,0x09}, -{0x8aa9,0x20}, -{0x8aaa,0x02}, -{0x8aab,0x06}, -{0x8aac,0x20}, -{0x8aad,0x01}, -{0x8aae,0x03}, -{0x8aaf,0xd3}, -{0x8ab0,0x80}, -{0x8ab1,0x01}, -{0x8ab2,0xc3}, -{0x8ab3,0x92}, -{0x8ab4,0x0b}, -{0x8ab5,0x90}, -{0x8ab6,0x30}, -{0x8ab7,0x01}, -{0x8ab8,0xe0}, -{0x8ab9,0x44}, -{0x8aba,0x40}, -{0x8abb,0xf0}, -{0x8abc,0xe0}, -{0x8abd,0x54}, -{0x8abe,0xbf}, -{0x8abf,0xf0}, -{0x8ac0,0xe5}, -{0x8ac1,0x32}, -{0x8ac2,0x30}, -{0x8ac3,0xe1}, -{0x8ac4,0x14}, -{0x8ac5,0x30}, -{0x8ac6,0x34}, -{0x8ac7,0x11}, -{0x8ac8,0x90}, -{0x8ac9,0x30}, -{0x8aca,0x22}, -{0x8acb,0xe0}, -{0x8acc,0xf5}, -{0x8acd,0x08}, -{0x8ace,0xe4}, -{0x8acf,0xf0}, -{0x8ad0,0x30}, -{0x8ad1,0x00}, -{0x8ad2,0x03}, -{0x8ad3,0xd3}, -{0x8ad4,0x80}, -{0x8ad5,0x01}, -{0x8ad6,0xc3}, -{0x8ad7,0x92}, -{0x8ad8,0x08}, -{0x8ad9,0xe5}, -{0x8ada,0x32}, -{0x8adb,0x30}, -{0x8adc,0xe5}, -{0x8add,0x12}, -{0x8ade,0x90}, -{0x8adf,0x56}, -{0x8ae0,0xa1}, -{0x8ae1,0xe0}, -{0x8ae2,0xf5}, -{0x8ae3,0x09}, -{0x8ae4,0x30}, -{0x8ae5,0x31}, -{0x8ae6,0x09}, -{0x8ae7,0x30}, -{0x8ae8,0x05}, -{0x8ae9,0x03}, -{0x8aea,0xd3}, -{0x8aeb,0x80}, -{0x8aec,0x01}, -{0x8aed,0xc3}, -{0x8aee,0x92}, -{0x8aef,0x0d}, -{0x8af0,0x90}, -{0x8af1,0x3f}, -{0x8af2,0x0c}, -{0x8af3,0xe5}, -{0x8af4,0x32}, -{0x8af5,0xf0}, -{0x8af6,0xd0}, -{0x8af7,0xd0}, -{0x8af8,0xd0}, -{0x8af9,0x82}, -{0x8afa,0xd0}, -{0x8afb,0x83}, -{0x8afc,0xd0}, -{0x8afd,0xe0}, -{0x8afe,0x32}, -{0x8aff,0x90}, -{0x8b00,0x0e}, -{0x8b01,0x7e}, -{0x8b02,0xe4}, -{0x8b03,0x93}, -{0x8b04,0xfe}, -{0x8b05,0x74}, -{0x8b06,0x01}, -{0x8b07,0x93}, -{0x8b08,0xff}, -{0x8b09,0xc3}, -{0x8b0a,0x90}, -{0x8b0b,0x0e}, -{0x8b0c,0x7c}, -{0x8b0d,0x74}, -{0x8b0e,0x01}, -{0x8b0f,0x93}, -{0x8b10,0x9f}, -{0x8b11,0xff}, -{0x8b12,0xe4}, -{0x8b13,0x93}, -{0x8b14,0x9e}, -{0x8b15,0xfe}, -{0x8b16,0xe4}, -{0x8b17,0x8f}, -{0x8b18,0x3b}, -{0x8b19,0x8e}, -{0x8b1a,0x3a}, -{0x8b1b,0xf5}, -{0x8b1c,0x39}, -{0x8b1d,0xf5}, -{0x8b1e,0x38}, -{0x8b1f,0xab}, -{0x8b20,0x3b}, -{0x8b21,0xaa}, -{0x8b22,0x3a}, -{0x8b23,0xa9}, -{0x8b24,0x39}, -{0x8b25,0xa8}, -{0x8b26,0x38}, -{0x8b27,0xaf}, -{0x8b28,0x4b}, -{0x8b29,0xfc}, -{0x8b2a,0xfd}, -{0x8b2b,0xfe}, -{0x8b2c,0x12}, -{0x8b2d,0x05}, -{0x8b2e,0x28}, -{0x8b2f,0x12}, -{0x8b30,0x0d}, -{0x8b31,0xe1}, -{0x8b32,0xe4}, -{0x8b33,0x7b}, -{0x8b34,0xff}, -{0x8b35,0xfa}, -{0x8b36,0xf9}, -{0x8b37,0xf8}, -{0x8b38,0x12}, -{0x8b39,0x05}, -{0x8b3a,0xb3}, -{0x8b3b,0x12}, -{0x8b3c,0x0d}, -{0x8b3d,0xe1}, -{0x8b3e,0x90}, -{0x8b3f,0x0e}, -{0x8b40,0x69}, -{0x8b41,0xe4}, -{0x8b42,0x12}, -{0x8b43,0x0d}, -{0x8b44,0xf6}, -{0x8b45,0x12}, -{0x8b46,0x0d}, -{0x8b47,0xe1}, -{0x8b48,0xe4}, -{0x8b49,0x85}, -{0x8b4a,0x4a}, -{0x8b4b,0x37}, -{0x8b4c,0xf5}, -{0x8b4d,0x36}, -{0x8b4e,0xf5}, -{0x8b4f,0x35}, -{0x8b50,0xf5}, -{0x8b51,0x34}, -{0x8b52,0xaf}, -{0x8b53,0x37}, -{0x8b54,0xae}, -{0x8b55,0x36}, -{0x8b56,0xad}, -{0x8b57,0x35}, -{0x8b58,0xac}, -{0x8b59,0x34}, -{0x8b5a,0xa3}, -{0x8b5b,0x12}, -{0x8b5c,0x0d}, -{0x8b5d,0xf6}, -{0x8b5e,0x8f}, -{0x8b5f,0x37}, -{0x8b60,0x8e}, -{0x8b61,0x36}, -{0x8b62,0x8d}, -{0x8b63,0x35}, -{0x8b64,0x8c}, -{0x8b65,0x34}, -{0x8b66,0xe5}, -{0x8b67,0x3b}, -{0x8b68,0x45}, -{0x8b69,0x37}, -{0x8b6a,0xf5}, -{0x8b6b,0x3b}, -{0x8b6c,0xe5}, -{0x8b6d,0x3a}, -{0x8b6e,0x45}, -{0x8b6f,0x36}, -{0x8b70,0xf5}, -{0x8b71,0x3a}, -{0x8b72,0xe5}, -{0x8b73,0x39}, -{0x8b74,0x45}, -{0x8b75,0x35}, -{0x8b76,0xf5}, -{0x8b77,0x39}, -{0x8b78,0xe5}, -{0x8b79,0x38}, -{0x8b7a,0x45}, -{0x8b7b,0x34}, -{0x8b7c,0xf5}, -{0x8b7d,0x38}, -{0x8b7e,0xe4}, -{0x8b7f,0xf5}, -{0x8b80,0x22}, -{0x8b81,0xf5}, -{0x8b82,0x23}, -{0x8b83,0x85}, -{0x8b84,0x3b}, -{0x8b85,0x31}, -{0x8b86,0x85}, -{0x8b87,0x3a}, -{0x8b88,0x30}, -{0x8b89,0x85}, -{0x8b8a,0x39}, -{0x8b8b,0x2f}, -{0x8b8c,0x85}, -{0x8b8d,0x38}, -{0x8b8e,0x2e}, -{0x8b8f,0x02}, -{0x8b90,0x0f}, -{0x8b91,0x46}, -{0x8b92,0xe0}, -{0x8b93,0xa3}, -{0x8b94,0xe0}, -{0x8b95,0x75}, -{0x8b96,0xf0}, -{0x8b97,0x02}, -{0x8b98,0xa4}, -{0x8b99,0xff}, -{0x8b9a,0xae}, -{0x8b9b,0xf0}, -{0x8b9c,0xc3}, -{0x8b9d,0x08}, -{0x8b9e,0xe6}, -{0x8b9f,0x9f}, -{0x8ba0,0xf6}, -{0x8ba1,0x18}, -{0x8ba2,0xe6}, -{0x8ba3,0x9e}, -{0x8ba4,0xf6}, -{0x8ba5,0x22}, -{0x8ba6,0xff}, -{0x8ba7,0xe5}, -{0x8ba8,0xf0}, -{0x8ba9,0x34}, -{0x8baa,0x60}, -{0x8bab,0x8f}, -{0x8bac,0x82}, -{0x8bad,0xf5}, -{0x8bae,0x83}, -{0x8baf,0xec}, -{0x8bb0,0xf0}, -{0x8bb1,0x22}, -{0x8bb2,0x78}, -{0x8bb3,0x52}, -{0x8bb4,0x7e}, -{0x8bb5,0x00}, -{0x8bb6,0xe6}, -{0x8bb7,0xfc}, -{0x8bb8,0x08}, -{0x8bb9,0xe6}, -{0x8bba,0xfd}, -{0x8bbb,0x02}, -{0x8bbc,0x04}, -{0x8bbd,0xc1}, -{0x8bbe,0xe4}, -{0x8bbf,0xfc}, -{0x8bc0,0xfd}, -{0x8bc1,0x12}, -{0x8bc2,0x06}, -{0x8bc3,0x99}, -{0x8bc4,0x78}, -{0x8bc5,0x5c}, -{0x8bc6,0xe6}, -{0x8bc7,0xc3}, -{0x8bc8,0x13}, -{0x8bc9,0xfe}, -{0x8bca,0x08}, -{0x8bcb,0xe6}, -{0x8bcc,0x13}, -{0x8bcd,0x22}, -{0x8bce,0x78}, -{0x8bcf,0x52}, -{0x8bd0,0xe6}, -{0x8bd1,0xfe}, -{0x8bd2,0x08}, -{0x8bd3,0xe6}, -{0x8bd4,0xff}, -{0x8bd5,0xe4}, -{0x8bd6,0xfc}, -{0x8bd7,0xfd}, -{0x8bd8,0x22}, -{0x8bd9,0xe7}, -{0x8bda,0xc4}, -{0x8bdb,0xf8}, -{0x8bdc,0x54}, -{0x8bdd,0xf0}, -{0x8bde,0xc8}, -{0x8bdf,0x68}, -{0x8be0,0xf7}, -{0x8be1,0x09}, -{0x8be2,0xe7}, -{0x8be3,0xc4}, -{0x8be4,0x54}, -{0x8be5,0x0f}, -{0x8be6,0x48}, -{0x8be7,0xf7}, -{0x8be8,0x22}, -{0x8be9,0xe6}, -{0x8bea,0xfc}, -{0x8beb,0xed}, -{0x8bec,0x75}, -{0x8bed,0xf0}, -{0x8bee,0x04}, -{0x8bef,0xa4}, -{0x8bf0,0x22}, -{0x8bf1,0x12}, -{0x8bf2,0x06}, -{0x8bf3,0x7c}, -{0x8bf4,0x8f}, -{0x8bf5,0x48}, -{0x8bf6,0x8e}, -{0x8bf7,0x47}, -{0x8bf8,0x8d}, -{0x8bf9,0x46}, -{0x8bfa,0x8c}, -{0x8bfb,0x45}, -{0x8bfc,0x22}, -{0x8bfd,0xe0}, -{0x8bfe,0xfe}, -{0x8bff,0xa3}, -{0x8c00,0xe0}, -{0x8c01,0xfd}, -{0x8c02,0xee}, -{0x8c03,0xf6}, -{0x8c04,0xed}, -{0x8c05,0x08}, -{0x8c06,0xf6}, -{0x8c07,0x22}, -{0x8c08,0x13}, -{0x8c09,0xff}, -{0x8c0a,0xc3}, -{0x8c0b,0xe6}, -{0x8c0c,0x9f}, -{0x8c0d,0xff}, -{0x8c0e,0x18}, -{0x8c0f,0xe6}, -{0x8c10,0x9e}, -{0x8c11,0xfe}, -{0x8c12,0x22}, -{0x8c13,0xe6}, -{0x8c14,0xc3}, -{0x8c15,0x13}, -{0x8c16,0xf7}, -{0x8c17,0x08}, -{0x8c18,0xe6}, -{0x8c19,0x13}, -{0x8c1a,0x09}, -{0x8c1b,0xf7}, -{0x8c1c,0x22}, -{0x8c1d,0xad}, -{0x8c1e,0x39}, -{0x8c1f,0xac}, -{0x8c20,0x38}, -{0x8c21,0xfa}, -{0x8c22,0xf9}, -{0x8c23,0xf8}, -{0x8c24,0x12}, -{0x8c25,0x05}, -{0x8c26,0x28}, -{0x8c27,0x8f}, -{0x8c28,0x3b}, -{0x8c29,0x8e}, -{0x8c2a,0x3a}, -{0x8c2b,0x8d}, -{0x8c2c,0x39}, -{0x8c2d,0x8c}, -{0x8c2e,0x38}, -{0x8c2f,0xab}, -{0x8c30,0x37}, -{0x8c31,0xaa}, -{0x8c32,0x36}, -{0x8c33,0xa9}, -{0x8c34,0x35}, -{0x8c35,0xa8}, -{0x8c36,0x34}, -{0x8c37,0x22}, -{0x8c38,0x93}, -{0x8c39,0xff}, -{0x8c3a,0xe4}, -{0x8c3b,0xfc}, -{0x8c3c,0xfd}, -{0x8c3d,0xfe}, -{0x8c3e,0x12}, -{0x8c3f,0x05}, -{0x8c40,0x28}, -{0x8c41,0x8f}, -{0x8c42,0x37}, -{0x8c43,0x8e}, -{0x8c44,0x36}, -{0x8c45,0x8d}, -{0x8c46,0x35}, -{0x8c47,0x8c}, -{0x8c48,0x34}, -{0x8c49,0x22}, -{0x8c4a,0x78}, -{0x8c4b,0x84}, -{0x8c4c,0xe6}, -{0x8c4d,0xfe}, -{0x8c4e,0x08}, -{0x8c4f,0xe6}, -{0x8c50,0xff}, -{0x8c51,0xe4}, -{0x8c52,0x8f}, -{0x8c53,0x37}, -{0x8c54,0x8e}, -{0x8c55,0x36}, -{0x8c56,0xf5}, -{0x8c57,0x35}, -{0x8c58,0xf5}, -{0x8c59,0x34}, -{0x8c5a,0x22}, -{0x8c5b,0x90}, -{0x8c5c,0x0e}, -{0x8c5d,0x8c}, -{0x8c5e,0xe4}, -{0x8c5f,0x93}, -{0x8c60,0x25}, -{0x8c61,0xe0}, -{0x8c62,0x24}, -{0x8c63,0x0a}, -{0x8c64,0xf8}, -{0x8c65,0xe6}, -{0x8c66,0xfe}, -{0x8c67,0x08}, -{0x8c68,0xe6}, -{0x8c69,0xff}, -{0x8c6a,0x22}, -{0x8c6b,0xe6}, -{0x8c6c,0xfe}, -{0x8c6d,0x08}, -{0x8c6e,0xe6}, -{0x8c6f,0xff}, -{0x8c70,0xe4}, -{0x8c71,0x8f}, -{0x8c72,0x3b}, -{0x8c73,0x8e}, -{0x8c74,0x3a}, -{0x8c75,0xf5}, -{0x8c76,0x39}, -{0x8c77,0xf5}, -{0x8c78,0x38}, -{0x8c79,0x22}, -{0x8c7a,0x78}, -{0x8c7b,0x4e}, -{0x8c7c,0xe6}, -{0x8c7d,0xfe}, -{0x8c7e,0x08}, -{0x8c7f,0xe6}, -{0x8c80,0xff}, -{0x8c81,0x22}, -{0x8c82,0xef}, -{0x8c83,0x25}, -{0x8c84,0xe0}, -{0x8c85,0x24}, -{0x8c86,0x4e}, -{0x8c87,0xf8}, -{0x8c88,0xe6}, -{0x8c89,0xfc}, -{0x8c8a,0x08}, -{0x8c8b,0xe6}, -{0x8c8c,0xfd}, -{0x8c8d,0x22}, -{0x8c8e,0x78}, -{0x8c8f,0x89}, -{0x8c90,0xef}, -{0x8c91,0x26}, -{0x8c92,0xf6}, -{0x8c93,0x18}, -{0x8c94,0xe4}, -{0x8c95,0x36}, -{0x8c96,0xf6}, -{0x8c97,0x22}, -{0x8c98,0x75}, -{0x8c99,0x89}, -{0x8c9a,0x03}, -{0x8c9b,0x75}, -{0x8c9c,0xa8}, -{0x8c9d,0x01}, -{0x8c9e,0x75}, -{0x8c9f,0xb8}, -{0x8ca0,0x04}, -{0x8ca1,0x75}, -{0x8ca2,0x34}, -{0x8ca3,0xff}, -{0x8ca4,0x75}, -{0x8ca5,0x35}, -{0x8ca6,0x0e}, -{0x8ca7,0x75}, -{0x8ca8,0x36}, -{0x8ca9,0x15}, -{0x8caa,0x75}, -{0x8cab,0x37}, -{0x8cac,0x0d}, -{0x8cad,0x12}, -{0x8cae,0x0e}, -{0x8caf,0x9a}, -{0x8cb0,0x12}, -{0x8cb1,0x00}, -{0x8cb2,0x09}, -{0x8cb3,0x12}, -{0x8cb4,0x0f}, -{0x8cb5,0x16}, -{0x8cb6,0x12}, -{0x8cb7,0x00}, -{0x8cb8,0x06}, -{0x8cb9,0xd2}, -{0x8cba,0x00}, -{0x8cbb,0xd2}, -{0x8cbc,0x34}, -{0x8cbd,0xd2}, -{0x8cbe,0xaf}, -{0x8cbf,0x75}, -{0x8cc0,0x34}, -{0x8cc1,0xff}, -{0x8cc2,0x75}, -{0x8cc3,0x35}, -{0x8cc4,0x0e}, -{0x8cc5,0x75}, -{0x8cc6,0x36}, -{0x8cc7,0x49}, -{0x8cc8,0x75}, -{0x8cc9,0x37}, -{0x8cca,0x03}, -{0x8ccb,0x12}, -{0x8ccc,0x0e}, -{0x8ccd,0x9a}, -{0x8cce,0x30}, -{0x8ccf,0x08}, -{0x8cd0,0x09}, -{0x8cd1,0xc2}, -{0x8cd2,0x34}, -{0x8cd3,0x12}, -{0x8cd4,0x08}, -{0x8cd5,0xcb}, -{0x8cd6,0xc2}, -{0x8cd7,0x08}, -{0x8cd8,0xd2}, -{0x8cd9,0x34}, -{0x8cda,0x30}, -{0x8cdb,0x0b}, -{0x8cdc,0x09}, -{0x8cdd,0xc2}, -{0x8cde,0x36}, -{0x8cdf,0x12}, -{0x8ce0,0x02}, -{0x8ce1,0x6c}, -{0x8ce2,0xc2}, -{0x8ce3,0x0b}, -{0x8ce4,0xd2}, -{0x8ce5,0x36}, -{0x8ce6,0x30}, -{0x8ce7,0x09}, -{0x8ce8,0x09}, -{0x8ce9,0xc2}, -{0x8cea,0x36}, -{0x8ceb,0x12}, -{0x8cec,0x00}, -{0x8ced,0x0e}, -{0x8cee,0xc2}, -{0x8cef,0x09}, -{0x8cf0,0xd2}, -{0x8cf1,0x36}, -{0x8cf2,0x30}, -{0x8cf3,0x0e}, -{0x8cf4,0x03}, -{0x8cf5,0x12}, -{0x8cf6,0x06}, -{0x8cf7,0xd7}, -{0x8cf8,0x30}, -{0x8cf9,0x35}, -{0x8cfa,0xd3}, -{0x8cfb,0x90}, -{0x8cfc,0x30}, -{0x8cfd,0x29}, -{0x8cfe,0xe5}, -{0x8cff,0x1e}, -{0x8d00,0xf0}, -{0x8d01,0xb4}, -{0x8d02,0x10}, -{0x8d03,0x05}, -{0x8d04,0x90}, -{0x8d05,0x30}, -{0x8d06,0x23}, -{0x8d07,0xe4}, -{0x8d08,0xf0}, -{0x8d09,0xc2}, -{0x8d0a,0x35}, -{0x8d0b,0x80}, -{0x8d0c,0xc1}, -{0x8d0d,0xe4}, -{0x8d0e,0xf5}, -{0x8d0f,0x4b}, -{0x8d10,0x90}, -{0x8d11,0x0e}, -{0x8d12,0x7a}, -{0x8d13,0x93}, -{0x8d14,0xff}, -{0x8d15,0xe4}, -{0x8d16,0x8f}, -{0x8d17,0x37}, -{0x8d18,0xf5}, -{0x8d19,0x36}, -{0x8d1a,0xf5}, -{0x8d1b,0x35}, -{0x8d1c,0xf5}, -{0x8d1d,0x34}, -{0x8d1e,0xaf}, -{0x8d1f,0x37}, -{0x8d20,0xae}, -{0x8d21,0x36}, -{0x8d22,0xad}, -{0x8d23,0x35}, -{0x8d24,0xac}, -{0x8d25,0x34}, -{0x8d26,0x90}, -{0x8d27,0x0e}, -{0x8d28,0x6a}, -{0x8d29,0x12}, -{0x8d2a,0x0d}, -{0x8d2b,0xf6}, -{0x8d2c,0x8f}, -{0x8d2d,0x37}, -{0x8d2e,0x8e}, -{0x8d2f,0x36}, -{0x8d30,0x8d}, -{0x8d31,0x35}, -{0x8d32,0x8c}, -{0x8d33,0x34}, -{0x8d34,0x90}, -{0x8d35,0x0e}, -{0x8d36,0x72}, -{0x8d37,0x12}, -{0x8d38,0x06}, -{0x8d39,0x7c}, -{0x8d3a,0xef}, -{0x8d3b,0x45}, -{0x8d3c,0x37}, -{0x8d3d,0xf5}, -{0x8d3e,0x37}, -{0x8d3f,0xee}, -{0x8d40,0x45}, -{0x8d41,0x36}, -{0x8d42,0xf5}, -{0x8d43,0x36}, -{0x8d44,0xed}, -{0x8d45,0x45}, -{0x8d46,0x35}, -{0x8d47,0xf5}, -{0x8d48,0x35}, -{0x8d49,0xec}, -{0x8d4a,0x45}, -{0x8d4b,0x34}, -{0x8d4c,0xf5}, -{0x8d4d,0x34}, -{0x8d4e,0xe4}, -{0x8d4f,0xf5}, -{0x8d50,0x22}, -{0x8d51,0xf5}, -{0x8d52,0x23}, -{0x8d53,0x85}, -{0x8d54,0x37}, -{0x8d55,0x31}, -{0x8d56,0x85}, -{0x8d57,0x36}, -{0x8d58,0x30}, -{0x8d59,0x85}, -{0x8d5a,0x35}, -{0x8d5b,0x2f}, -{0x8d5c,0x85}, -{0x8d5d,0x34}, -{0x8d5e,0x2e}, -{0x8d5f,0x12}, -{0x8d60,0x0f}, -{0x8d61,0x46}, -{0x8d62,0xe4}, -{0x8d63,0xf5}, -{0x8d64,0x22}, -{0x8d65,0xf5}, -{0x8d66,0x23}, -{0x8d67,0x90}, -{0x8d68,0x0e}, -{0x8d69,0x72}, -{0x8d6a,0x12}, -{0x8d6b,0x0d}, -{0x8d6c,0xea}, -{0x8d6d,0x12}, -{0x8d6e,0x0f}, -{0x8d6f,0x46}, -{0x8d70,0xe4}, -{0x8d71,0xf5}, -{0x8d72,0x22}, -{0x8d73,0xf5}, -{0x8d74,0x23}, -{0x8d75,0x90}, -{0x8d76,0x0e}, -{0x8d77,0x6e}, -{0x8d78,0x12}, -{0x8d79,0x0d}, -{0x8d7a,0xea}, -{0x8d7b,0x02}, -{0x8d7c,0x0f}, -{0x8d7d,0x46}, -{0x8d7e,0xe5}, -{0x8d7f,0x40}, -{0x8d80,0x24}, -{0x8d81,0xf2}, -{0x8d82,0xf5}, -{0x8d83,0x37}, -{0x8d84,0xe5}, -{0x8d85,0x3f}, -{0x8d86,0x34}, -{0x8d87,0x43}, -{0x8d88,0xf5}, -{0x8d89,0x36}, -{0x8d8a,0xe5}, -{0x8d8b,0x3e}, -{0x8d8c,0x34}, -{0x8d8d,0xa2}, -{0x8d8e,0xf5}, -{0x8d8f,0x35}, -{0x8d90,0xe5}, -{0x8d91,0x3d}, -{0x8d92,0x34}, -{0x8d93,0x28}, -{0x8d94,0xf5}, -{0x8d95,0x34}, -{0x8d96,0xe5}, -{0x8d97,0x37}, -{0x8d98,0xff}, -{0x8d99,0xe4}, -{0x8d9a,0xfe}, -{0x8d9b,0xfd}, -{0x8d9c,0xfc}, -{0x8d9d,0x78}, -{0x8d9e,0x18}, -{0x8d9f,0x12}, -{0x8da0,0x06}, -{0x8da1,0x69}, -{0x8da2,0x8f}, -{0x8da3,0x40}, -{0x8da4,0x8e}, -{0x8da5,0x3f}, -{0x8da6,0x8d}, -{0x8da7,0x3e}, -{0x8da8,0x8c}, -{0x8da9,0x3d}, -{0x8daa,0xe5}, -{0x8dab,0x37}, -{0x8dac,0x54}, -{0x8dad,0xa0}, -{0x8dae,0xff}, -{0x8daf,0xe5}, -{0x8db0,0x36}, -{0x8db1,0xfe}, -{0x8db2,0xe4}, -{0x8db3,0xfd}, -{0x8db4,0xfc}, -{0x8db5,0x78}, -{0x8db6,0x07}, -{0x8db7,0x12}, -{0x8db8,0x06}, -{0x8db9,0x56}, -{0x8dba,0x78}, -{0x8dbb,0x10}, -{0x8dbc,0x12}, -{0x8dbd,0x0f}, -{0x8dbe,0x9a}, -{0x8dbf,0xe4}, -{0x8dc0,0xff}, -{0x8dc1,0xfe}, -{0x8dc2,0xe5}, -{0x8dc3,0x35}, -{0x8dc4,0xfd}, -{0x8dc5,0xe4}, -{0x8dc6,0xfc}, -{0x8dc7,0x78}, -{0x8dc8,0x0e}, -{0x8dc9,0x12}, -{0x8dca,0x06}, -{0x8dcb,0x56}, -{0x8dcc,0x12}, -{0x8dcd,0x0f}, -{0x8dce,0x9d}, -{0x8dcf,0xe4}, -{0x8dd0,0xff}, -{0x8dd1,0xfe}, -{0x8dd2,0xfd}, -{0x8dd3,0xe5}, -{0x8dd4,0x34}, -{0x8dd5,0xfc}, -{0x8dd6,0x78}, -{0x8dd7,0x18}, -{0x8dd8,0x12}, -{0x8dd9,0x06}, -{0x8dda,0x56}, -{0x8ddb,0x78}, -{0x8ddc,0x08}, -{0x8ddd,0x12}, -{0x8dde,0x0f}, -{0x8ddf,0x9a}, -{0x8de0,0x22}, -{0x8de1,0x8f}, -{0x8de2,0x3b}, -{0x8de3,0x8e}, -{0x8de4,0x3a}, -{0x8de5,0x8d}, -{0x8de6,0x39}, -{0x8de7,0x8c}, -{0x8de8,0x38}, -{0x8de9,0x22}, -{0x8dea,0x12}, -{0x8deb,0x06}, -{0x8dec,0x7c}, -{0x8ded,0x8f}, -{0x8dee,0x31}, -{0x8def,0x8e}, -{0x8df0,0x30}, -{0x8df1,0x8d}, -{0x8df2,0x2f}, -{0x8df3,0x8c}, -{0x8df4,0x2e}, -{0x8df5,0x22}, -{0x8df6,0x93}, -{0x8df7,0xf9}, -{0x8df8,0xf8}, -{0x8df9,0x02}, -{0x8dfa,0x06}, -{0x8dfb,0x69}, -{0x8dfc,0x00}, -{0x8dfd,0x00}, -{0x8dfe,0x00}, -{0x8dff,0x00}, -{0x8e00,0x12}, -{0x8e01,0x01}, -{0x8e02,0x17}, -{0x8e03,0x08}, -{0x8e04,0x31}, -{0x8e05,0x15}, -{0x8e06,0x53}, -{0x8e07,0x54}, -{0x8e08,0x44}, -{0x8e09,0x20}, -{0x8e0a,0x20}, -{0x8e0b,0x20}, -{0x8e0c,0x20}, -{0x8e0d,0x20}, -{0x8e0e,0x13}, -{0x8e0f,0x01}, -{0x8e10,0x10}, -{0x8e11,0x01}, -{0x8e12,0x56}, -{0x8e13,0x40}, -{0x8e14,0x1a}, -{0x8e15,0x30}, -{0x8e16,0x29}, -{0x8e17,0x7e}, -{0x8e18,0x00}, -{0x8e19,0x30}, -{0x8e1a,0x04}, -{0x8e1b,0x20}, -{0x8e1c,0xdf}, -{0x8e1d,0x30}, -{0x8e1e,0x05}, -{0x8e1f,0x40}, -{0x8e20,0xbf}, -{0x8e21,0x50}, -{0x8e22,0x03}, -{0x8e23,0x00}, -{0x8e24,0xfd}, -{0x8e25,0x50}, -{0x8e26,0x27}, -{0x8e27,0x01}, -{0x8e28,0xfe}, -{0x8e29,0x60}, -{0x8e2a,0x00}, -{0x8e2b,0x11}, -{0x8e2c,0x00}, -{0x8e2d,0x3f}, -{0x8e2e,0x05}, -{0x8e2f,0x30}, -{0x8e30,0x00}, -{0x8e31,0x3f}, -{0x8e32,0x06}, -{0x8e33,0x22}, -{0x8e34,0x00}, -{0x8e35,0x3f}, -{0x8e36,0x01}, -{0x8e37,0x2a}, -{0x8e38,0x00}, -{0x8e39,0x3f}, -{0x8e3a,0x02}, -{0x8e3b,0x00}, -{0x8e3c,0x00}, -{0x8e3d,0x36}, -{0x8e3e,0x06}, -{0x8e3f,0x07}, -{0x8e40,0x00}, -{0x8e41,0x3f}, -{0x8e42,0x0b}, -{0x8e43,0x0f}, -{0x8e44,0xf0}, -{0x8e45,0x00}, -{0x8e46,0x00}, -{0x8e47,0x00}, -{0x8e48,0x00}, -{0x8e49,0x30}, -{0x8e4a,0x01}, -{0x8e4b,0x40}, -{0x8e4c,0xbf}, -{0x8e4d,0x30}, -{0x8e4e,0x01}, -{0x8e4f,0x00}, -{0x8e50,0xbf}, -{0x8e51,0x30}, -{0x8e52,0x29}, -{0x8e53,0x70}, -{0x8e54,0x00}, -{0x8e55,0x3a}, -{0x8e56,0x00}, -{0x8e57,0x00}, -{0x8e58,0xff}, -{0x8e59,0x3a}, -{0x8e5a,0x00}, -{0x8e5b,0x00}, -{0x8e5c,0xff}, -{0x8e5d,0x36}, -{0x8e5e,0x03}, -{0x8e5f,0x36}, -{0x8e60,0x02}, -{0x8e61,0x41}, -{0x8e62,0x44}, -{0x8e63,0x58}, -{0x8e64,0x20}, -{0x8e65,0x18}, -{0x8e66,0x10}, -{0x8e67,0x0a}, -{0x8e68,0x04}, -{0x8e69,0x04}, -{0x8e6a,0x00}, -{0x8e6b,0x03}, -{0x8e6c,0xff}, -{0x8e6d,0x64}, -{0x8e6e,0x00}, -{0x8e6f,0x00}, -{0x8e70,0x80}, -{0x8e71,0x00}, -{0x8e72,0x00}, -{0x8e73,0x00}, -{0x8e74,0x00}, -{0x8e75,0x00}, -{0x8e76,0x00}, -{0x8e77,0x02}, -{0x8e78,0x04}, -{0x8e79,0x06}, -{0x8e7a,0x06}, -{0x8e7b,0x00}, -{0x8e7c,0x02}, -{0x8e7d,0x60},//cc}, -{0x8e7e,0x00}, -{0x8e7f,0x70}, -{0x8e80,0x50}, -{0x8e81,0x3c}, -{0x8e82,0x28}, -{0x8e83,0x1e}, -{0x8e84,0x10}, -{0x8e85,0x10}, -{0x8e86,0x50}, -{0x8e87,0x2d}, -{0x8e88,0x28}, -{0x8e89,0x16}, -{0x8e8a,0x10}, -{0x8e8b,0x10}, -{0x8e8c,0x02}, -{0x8e8d,0x00}, -{0x8e8e,0x10}, -{0x8e8f,0x30}, -{0x8e90,0x0a}, -{0x8e91,0x04}, -{0x8e92,0x05}, -{0x8e93,0x08}, -{0x8e94,0x06}, -{0x8e95,0x05}, -{0x8e96,0x00}, -{0x8e97,0xa5}, -{0x8e98,0x5a}, -{0x8e99,0x00}, -{0x8e9a,0xae}, -{0x8e9b,0x35}, -{0x8e9c,0xaf}, -{0x8e9d,0x36}, -{0x8e9e,0xe4}, -{0x8e9f,0xfd}, -{0x8ea0,0xed}, -{0x8ea1,0xc3}, -{0x8ea2,0x95}, -{0x8ea3,0x37}, -{0x8ea4,0x50}, -{0x8ea5,0x33}, -{0x8ea6,0x12}, -{0x8ea7,0x0f}, -{0x8ea8,0xe2}, -{0x8ea9,0xe4}, -{0x8eaa,0x93}, -{0x8eab,0xf5}, -{0x8eac,0x38}, -{0x8ead,0x74}, -{0x8eae,0x01}, -{0x8eaf,0x93}, -{0x8eb0,0xf5}, -{0x8eb1,0x39}, -{0x8eb2,0x45}, -{0x8eb3,0x38}, -{0x8eb4,0x60}, -{0x8eb5,0x23}, -{0x8eb6,0x85}, -{0x8eb7,0x39}, -{0x8eb8,0x82}, -{0x8eb9,0x85}, -{0x8eba,0x38}, -{0x8ebb,0x83}, -{0x8ebc,0xe0}, -{0x8ebd,0xfc}, -{0x8ebe,0x12}, -{0x8ebf,0x0f}, -{0x8ec0,0xe2}, -{0x8ec1,0x74}, -{0x8ec2,0x03}, -{0x8ec3,0x93}, -{0x8ec4,0x52}, -{0x8ec5,0x04}, -{0x8ec6,0x12}, -{0x8ec7,0x0f}, -{0x8ec8,0xe2}, -{0x8ec9,0x74}, -{0x8eca,0x02}, -{0x8ecb,0x93}, -{0x8ecc,0x42}, -{0x8ecd,0x04}, -{0x8ece,0x85}, -{0x8ecf,0x39}, -{0x8ed0,0x82}, -{0x8ed1,0x85}, -{0x8ed2,0x38}, -{0x8ed3,0x83}, -{0x8ed4,0xec}, -{0x8ed5,0xf0}, -{0x8ed6,0x0d}, -{0x8ed7,0x80}, -{0x8ed8,0xc7}, -{0x8ed9,0x22}, -{0x8eda,0x78}, -{0x8edb,0xbe}, -{0x8edc,0xe6}, -{0x8edd,0xd3}, -{0x8ede,0x08}, -{0x8edf,0xff}, -{0x8ee0,0xe6}, -{0x8ee1,0x64}, -{0x8ee2,0x80}, -{0x8ee3,0xf8}, -{0x8ee4,0xef}, -{0x8ee5,0x64}, -{0x8ee6,0x80}, -{0x8ee7,0x98}, -{0x8ee8,0x22}, -{0x8ee9,0x93}, -{0x8eea,0xff}, -{0x8eeb,0x7e}, -{0x8eec,0x00}, -{0x8eed,0xe6}, -{0x8eee,0xfc}, -{0x8eef,0x08}, -{0x8ef0,0xe6}, -{0x8ef1,0xfd}, -{0x8ef2,0x12}, -{0x8ef3,0x04}, -{0x8ef4,0xc1}, -{0x8ef5,0x78}, -{0x8ef6,0xc1}, -{0x8ef7,0xe6}, -{0x8ef8,0xfc}, -{0x8ef9,0x08}, -{0x8efa,0xe6}, -{0x8efb,0xfd}, -{0x8efc,0xd3}, -{0x8efd,0xef}, -{0x8efe,0x9d}, -{0x8eff,0xee}, -{0x8f00,0x9c}, -{0x8f01,0x22}, -{0x8f02,0x78}, -{0x8f03,0xbd}, -{0x8f04,0xd3}, -{0x8f05,0xe6}, -{0x8f06,0x64}, -{0x8f07,0x80}, -{0x8f08,0x94}, -{0x8f09,0x80}, -{0x8f0a,0x22}, -{0x8f0b,0x25}, -{0x8f0c,0xe0}, -{0x8f0d,0x24}, -{0x8f0e,0x0a}, -{0x8f0f,0xf8}, -{0x8f10,0xe6}, -{0x8f11,0xfe}, -{0x8f12,0x08}, -{0x8f13,0xe6}, -{0x8f14,0xff}, -{0x8f15,0x22}, -{0x8f16,0xe5}, -{0x8f17,0x3c}, -{0x8f18,0xd3}, -{0x8f19,0x94}, -{0x8f1a,0x00}, -{0x8f1b,0x40}, -{0x8f1c,0x0b}, -{0x8f1d,0x90}, -{0x8f1e,0x0e}, -{0x8f1f,0x88}, -{0x8f20,0x12}, -{0x8f21,0x0b}, -{0x8f22,0xf1}, -{0x8f23,0x90}, -{0x8f24,0x0e}, -{0x8f25,0x86}, -{0x8f26,0x80}, -{0x8f27,0x09}, -{0x8f28,0x90}, -{0x8f29,0x0e}, -{0x8f2a,0x82}, -{0x8f2b,0x12}, -{0x8f2c,0x0b}, -{0x8f2d,0xf1}, -{0x8f2e,0x90}, -{0x8f2f,0x0e}, -{0x8f30,0x80}, -{0x8f31,0xe4}, -{0x8f32,0x93}, -{0x8f33,0xf5}, -{0x8f34,0x44}, -{0x8f35,0xa3}, -{0x8f36,0xe4}, -{0x8f37,0x93}, -{0x8f38,0xf5}, -{0x8f39,0x43}, -{0x8f3a,0xd2}, -{0x8f3b,0x06}, -{0x8f3c,0x30}, -{0x8f3d,0x06}, -{0x8f3e,0x03}, -{0x8f3f,0xd3}, -{0x8f40,0x80}, -{0x8f41,0x01}, -{0x8f42,0xc3}, -{0x8f43,0x92}, -{0x8f44,0x0e}, -{0x8f45,0x22}, -{0x8f46,0xa2}, -{0x8f47,0xaf}, -{0x8f48,0x92}, -{0x8f49,0x32}, -{0x8f4a,0xc2}, -{0x8f4b,0xaf}, -{0x8f4c,0xe5}, -{0x8f4d,0x23}, -{0x8f4e,0x45}, -{0x8f4f,0x22}, -{0x8f50,0x90}, -{0x8f51,0x0e}, -{0x8f52,0x5d}, -{0x8f53,0x60}, -{0x8f54,0x0e}, -{0x8f55,0x12}, -{0x8f56,0x0f}, -{0x8f57,0xcb}, -{0x8f58,0xe0}, -{0x8f59,0xf5}, -{0x8f5a,0x2c}, -{0x8f5b,0x12}, -{0x8f5c,0x0f}, -{0x8f5d,0xc8}, -{0x8f5e,0xe0}, -{0x8f5f,0xf5}, -{0x8f60,0x2d}, -{0x8f61,0x80}, -{0x8f62,0x0c}, -{0x8f63,0x12}, -{0x8f64,0x0f}, -{0x8f65,0xcb}, -{0x8f66,0xe5}, -{0x8f67,0x30}, -{0x8f68,0xf0}, -{0x8f69,0x12}, -{0x8f6a,0x0f}, -{0x8f6b,0xc8}, -{0x8f6c,0xe5}, -{0x8f6d,0x31}, -{0x8f6e,0xf0}, -{0x8f6f,0xa2}, -{0x8f70,0x32}, -{0x8f71,0x92}, -{0x8f72,0xaf}, -{0x8f73,0x22}, -{0x8f74,0xd2}, -{0x8f75,0x01}, -{0x8f76,0xc2}, -{0x8f77,0x02}, -{0x8f78,0xe4}, -{0x8f79,0xf5}, -{0x8f7a,0x1f}, -{0x8f7b,0xf5}, -{0x8f7c,0x1e}, -{0x8f7d,0xd2}, -{0x8f7e,0x35}, -{0x8f7f,0xd2}, -{0x8f80,0x33}, -{0x8f81,0xd2}, -{0x8f82,0x36}, -{0x8f83,0xd2}, -{0x8f84,0x01}, -{0x8f85,0xc2}, -{0x8f86,0x02}, -{0x8f87,0xf5}, -{0x8f88,0x1f}, -{0x8f89,0xf5}, -{0x8f8a,0x1e}, -{0x8f8b,0xd2}, -{0x8f8c,0x35}, -{0x8f8d,0xd2}, -{0x8f8e,0x33}, -{0x8f8f,0x22}, -{0x8f90,0xfb}, -{0x8f91,0xd3}, -{0x8f92,0xed}, -{0x8f93,0x9b}, -{0x8f94,0x74}, -{0x8f95,0x80}, -{0x8f96,0xf8}, -{0x8f97,0x6c}, -{0x8f98,0x98}, -{0x8f99,0x22}, -{0x8f9a,0x12}, -{0x8f9b,0x06}, -{0x8f9c,0x69}, -{0x8f9d,0xe5}, -{0x8f9e,0x40}, -{0x8f9f,0x2f}, -{0x8fa0,0xf5}, -{0x8fa1,0x40}, -{0x8fa2,0xe5}, -{0x8fa3,0x3f}, -{0x8fa4,0x3e}, -{0x8fa5,0xf5}, -{0x8fa6,0x3f}, -{0x8fa7,0xe5}, -{0x8fa8,0x3e}, -{0x8fa9,0x3d}, -{0x8faa,0xf5}, -{0x8fab,0x3e}, -{0x8fac,0xe5}, -{0x8fad,0x3d}, -{0x8fae,0x3c}, -{0x8faf,0xf5}, -{0x8fb0,0x3d}, -{0x8fb1,0x22}, -{0x8fb2,0xc0}, -{0x8fb3,0xe0}, -{0x8fb4,0xc0}, -{0x8fb5,0x83}, -{0x8fb6,0xc0}, -{0x8fb7,0x82}, -{0x8fb8,0x90}, -{0x8fb9,0x3f}, -{0x8fba,0x0d}, -{0x8fbb,0xe0}, -{0x8fbc,0xf5}, -{0x8fbd,0x33}, -{0x8fbe,0xe5}, -{0x8fbf,0x33}, -{0x8fc0,0xf0}, -{0x8fc1,0xd0}, -{0x8fc2,0x82}, -{0x8fc3,0xd0}, -{0x8fc4,0x83}, -{0x8fc5,0xd0}, -{0x8fc6,0xe0}, -{0x8fc7,0x32}, -{0x8fc8,0x90}, -{0x8fc9,0x0e}, -{0x8fca,0x5f}, -{0x8fcb,0xe4}, -{0x8fcc,0x93}, -{0x8fcd,0xfe}, -{0x8fce,0x74}, -{0x8fcf,0x01}, -{0x8fd0,0x93}, -{0x8fd1,0xf5}, -{0x8fd2,0x82}, -{0x8fd3,0x8e}, -{0x8fd4,0x83}, -{0x8fd5,0x22}, -{0x8fd6,0x78}, -{0x8fd7,0x7f}, -{0x8fd8,0xe4}, -{0x8fd9,0xf6}, -{0x8fda,0xd8}, -{0x8fdb,0xfd}, -{0x8fdc,0x75}, -{0x8fdd,0x81}, -{0x8fde,0xcd}, -{0x8fdf,0x02}, -{0x8fe0,0x0c}, -{0x8fe1,0x98}, -{0x8fe2,0x8f}, -{0x8fe3,0x82}, -{0x8fe4,0x8e}, -{0x8fe5,0x83}, -{0x8fe6,0x75}, -{0x8fe7,0xf0}, -{0x8fe8,0x04}, -{0x8fe9,0xed}, -{0x8fea,0x02}, -{0x8feb,0x06}, -{0x8fec,0xa5}, -{0x3022,0x00}, -{0x3023,0x00}, -{0x3024,0x00}, -{0x3025,0x00}, -{0x3026,0x00}, -{0x3027,0x00}, -{0x3028,0x00}, -{0x3029,0x7F}, -{0x3000,0x00}, -#endif - {SEQUENCE_END,0x00}, -}; diff --git a/drivers/media/video/ov5640_for_td8801.c b/drivers/media/video/ov5640_for_td8801.c deleted file mode 100644 index de06e98c9219..000000000000 --- a/drivers/media/video/ov5640_for_td8801.c +++ /dev/null @@ -1,4154 +0,0 @@ -/* - * Driver for OV5640 CMOS Image Sensor from OmniVision - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "ov5640.h" - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_OV5640 -#define SENSOR_V4L2_IDENT V4L2_IDENT_OV5640 -#define SENSOR_ID 0x5640 -#define SENSOR_MIN_WIDTH 176 -#define SENSOR_MIN_HEIGHT 144 -#define SENSOR_MAX_WIDTH 2592 -#define SENSOR_MAX_HEIGHT 1944 -#define SENSOR_INIT_WIDTH 800 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 600 -#define SENSOR_INIT_WINSEQADR sensor_svga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_YUYV8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 1 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Exposure 1 -#define CONFIG_SENSOR_Flash 1 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 -#ifdef CONFIG_OV5640_AUTOFOCUS_FOR_TD8801 -#define CONFIG_SENSOR_Focus 1 -#include "ov5640_af_firmware.c" -#else -#define CONFIG_SENSOR_Focus 0 -#endif - -#define CONFIG_SENSOR_I2C_SPEED 400*1000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define CONFIG_SENSOR_WRITE_REGS 1 -#define WRITE_REGS_NUM 3 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) - -#if CONFIG_SENSOR_Focus -/*#define SENSOR_AF_MODE_INFINITY 0 -#define SENSOR_AF_MODE_MACRO 1 -#define SENSOR_AF_MODE_FIXED 2 -#define SENSOR_AF_MODE_AUTO 3 -#define SENSOR_AF_MODE_CONTINUOUS 4 -#define SENSOR_AF_MODE_CLOSE 5*/ -#define SENSOR_AF_MODE_AUTO 0 -#define SENSOR_AF_MODE_CLOSE 1 -#endif - -#if CONFIG_SENSOR_Focus -/* ov5640 VCM Command and Status Registers */ -#define CMD_MAIN_Reg 0x3022 -//#define CMD_TAG_Reg 0x3023 -#define CMD_ACK_Reg 0x3023 -#define CMD_PARA0_Reg 0x3024 -#define CMD_PARA1_Reg 0x3025 -#define CMD_PARA2_Reg 0x3026 -#define CMD_PARA3_Reg 0x3027 -#define CMD_PARA4_Reg 0x3028 - -//#define STA_ZONE_Reg 0x3026 -#define STA_FOCUS_Reg 0x3029 - -/* ov5640 VCM Command */ -#define OverlayEn_Cmd 0x01 -#define OverlayDis_Cmd 0x02 -#define SingleFocus_Cmd 0x03 -#define ConstFocus_Cmd 0x04 -#define StepMode_Cmd 0x05 -#define PauseFocus_Cmd 0x06 -#define ReturnIdle_Cmd 0x08 -#define SetZone_Cmd 0x10 -#define UpdateZone_Cmd 0x12 -#define SetMotor_Cmd 0x20 - - -#define Zone_configuration_Cmd 0x12 -#define Trig_autofocus_Cmd 0x03 -#define Get_focus_result_Cmd 0x07 - -/* ov5640 Focus State */ -//#define S_FIRWRE 0xFF /*Firmware is downloaded and not run*/ -#define S_STARTUP 0x7e /*Firmware is initializing*/ -#define S_ERROR 0x7f -#define S_IDLE 0x70 /*Idle state, focus is released; lens is located at the furthest position.*/ -#define S_FOCUSING 0x00 /*Auto Focus is running.*/ -#define S_FOCUSED 0x10 /*Auto Focus is completed.*/ - -#define S_CAPTURE 0x12 -#define S_STEP 0x20 - -/* ov5640 Zone State */ -#define Zone_Is_Focused(a, zone_val) (zone_val&(1<<(a-3))) -#define Zone_Get_ID(zone_val) (zone_val&0x03) - -#define Zone_CenterMode 0x01 -#define Zone_5xMode 0x02 -#define Zone_5PlusMode 0x03 -#define Zone_4fMode 0x04 - -#define ZoneSel_Auto 0x0b -#define ZoneSel_SemiAuto 0x0c -#define ZoneSel_Manual 0x0d -#define ZoneSel_Rotate 0x0e - -/* ov5640 Step Focus Commands */ -#define StepFocus_Near_Tag 0x01 -#define StepFocus_Far_Tag 0x02 -#define StepFocus_Furthest_Tag 0x03 -#define StepFocus_Nearest_Tag 0x04 -#define StepFocus_Spec_Tag 0x10 -#endif - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); - -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_OV5640_USER_DEFINED_SERIES -#include "ov5640_user_series.c" -#else - -/* init 800X600 SVGA */ -static struct reginfo sensor_init_data[] = -{ - {0x3103, 0x11}, -// {0x3008, 0x82}, //don't do software reset here, or writing some registers may fail - {0x3008, 0x42}, - {0x3103, 0x03}, - {0x3017, 0xff}, - {0x3018, 0xff}, - {0x3034, 0x1a}, - {0x3035, 0x21}, - {0x3036, 0x46}, - {0x3037, 0x13}, - {0x3108, 0x01}, - {0x3630, 0x36}, - {0x3631, 0x0e}, - {0x3632, 0xe2}, - {0x3633, 0x12}, - {0x3621, 0xe0}, - {0x3704, 0xa0}, - {0x3703, 0x5a}, - {0x3715, 0x78}, - {0x3717, 0x01}, - {0x370b, 0x60}, - {0x3705, 0x1a}, - {0x3905, 0x02}, - {0x3906, 0x10}, - {0x3901, 0x0a}, - {0x3731, 0x12}, - {0x3600, 0x08}, - {0x3601, 0x33}, - {0x302d, 0x60}, - {0x3620, 0x52}, - {0x371b, 0x20}, - {0x471c, 0x50}, - {0x3a13, 0x43}, - {0x3a18, 0x00}, - {0x3a19, 0xf8}, - {0x3635, 0x13}, - {0x3636, 0x03}, - {0x3634, 0x40}, - {0x3622, 0x01}, - {0x3c01, 0x34}, - {0x3c04, 0x28}, - {0x3c05, 0x98}, - {0x3c06, 0x00}, - {0x3c07, 0x08}, - {0x3c08, 0x00}, - {0x3c09, 0x1c}, - {0x3c0a, 0x9c}, - {0x3c0b, 0x40}, - {0x3820, 0x41}, - {0x3821, 0x07}, - {0x3814, 0x31}, - {0x3815, 0x31}, - {0x3800, 0x00}, - {0x3801, 0x00}, - {0x3802, 0x00}, - {0x3803, 0x04}, - {0x3804, 0x0a}, - {0x3805, 0x3f}, - {0x3806, 0x07}, - {0x3807, 0x9b}, - {0x3808, 0x03}, - {0x3809, 0x20}, - {0x380a, 0x02}, - {0x380b, 0x58}, - {0x380c, 0x07}, - {0x380d, 0x68}, - {0x380e, 0x03}, - {0x380f, 0xd8}, - {0x3810, 0x00}, - {0x3811, 0x10}, - {0x3812, 0x00}, - {0x3813, 0x06}, - {0x3618, 0x00}, - {0x3612, 0x29}, - {0x3708, 0x64}, - {0x3709, 0x52}, - {0x370c, 0x03}, - {0x3a02, 0x03}, - {0x3a03, 0xd8}, - {0x3a08, 0x01}, - {0x3a09, 0x27}, - {0x3a0a, 0x00}, - {0x3a0b, 0xf6}, - {0x3a0e, 0x03}, - {0x3a0d, 0x04}, - {0x3a14, 0x03}, - {0x3a15, 0xd8}, - {0x4001, 0x02}, - {0x4004, 0x02}, - {0x3000, 0x00}, - {0x3002, 0x1c}, - {0x3004, 0xff}, - {0x3006, 0xc3}, - {0x300e, 0x58}, - {0x302e, 0x00}, - {0x4740, 0x20}, - {0x4300, 0x30}, - {0x501f, 0x00}, - {0x4713, 0x03}, - {0x4407, 0x04}, - {0x440e, 0x00}, - {0x460b, 0x35}, - {0x460c, 0x20}, - {0x4837, 0x22}, - {0x3824, 0x02}, - {0x5000, 0xa7}, - {0x5001, 0xa3}, - {0x5180, 0xff}, - {0x5181, 0xf2}, - {0x5182, 0x00}, - {0x5183, 0x14}, - {0x5184, 0x25}, - {0x5185, 0x24}, - {0x5186, 0x09}, - {0x5187, 0x09}, - {0x5188, 0x09}, - {0x5189, 0x75}, - {0x518a, 0x54}, - {0x518b, 0xe0}, - {0x518c, 0xb2}, - {0x518d, 0x42}, - {0x518e, 0x3d}, - {0x518f, 0x56}, - {0x5190, 0x46}, - {0x5191, 0xf8}, - {0x5192, 0x04}, - {0x5193, 0x70}, - {0x5194, 0xf0}, - {0x5195, 0xf0}, - {0x5196, 0x03}, - {0x5197, 0x01}, - {0x5198, 0x04}, - {0x5199, 0x12}, - {0x519a, 0x04}, - {0x519b, 0x00}, - {0x519c, 0x06}, - {0x519d, 0x82}, - {0x519e, 0x38}, - {0x5381, 0x1e}, - {0x5382, 0x5b}, - {0x5383, 0x08}, - {0x5384, 0x0a}, - {0x5385, 0x7e}, - {0x5386, 0x88}, - {0x5387, 0x7c}, - {0x5388, 0x6c}, - {0x5389, 0x10}, - {0x538a, 0x01}, - {0x538b, 0x98}, - {0x5300, 0x08}, - {0x5301, 0x30}, - {0x5302, 0x10}, - {0x5303, 0x00}, - {0x5304, 0x08}, - {0x5305, 0x30}, - {0x5306, 0x08}, - {0x5307, 0x16}, - {0x5309, 0x08}, - {0x530a, 0x30}, - {0x530b, 0x04}, - {0x530c, 0x06}, - {0x5480, 0x01}, - {0x5481, 0x08}, - {0x5482, 0x14}, - {0x5483, 0x28}, - {0x5484, 0x51}, - {0x5485, 0x65}, - {0x5486, 0x71}, - {0x5487, 0x7d}, - {0x5488, 0x87}, - {0x5489, 0x91}, - {0x548a, 0x9a}, - {0x548b, 0xaa}, - {0x548c, 0xb8}, - {0x548d, 0xcd}, - {0x548e, 0xdd}, - {0x548f, 0xea}, - {0x5490, 0x1d}, - {0x5580, 0x02}, - {0x5583, 0x40}, - {0x5584, 0x10}, - {0x5589, 0x10}, - {0x558a, 0x00}, - {0x558b, 0xf8}, - {0x5800, 0x23}, - {0x5801, 0x14}, - {0x5802, 0x0f}, - {0x5803, 0x0f}, - {0x5804, 0x12}, - {0x5805, 0x26}, - {0x5806, 0x0c}, - {0x5807, 0x08}, - {0x5808, 0x05}, - {0x5809, 0x05}, - {0x580a, 0x08}, - {0x580b, 0x0d}, - {0x580c, 0x08}, - {0x580d, 0x03}, - {0x580e, 0x00}, - {0x580f, 0x00}, - {0x5810, 0x03}, - {0x5811, 0x09}, - {0x5812, 0x07}, - {0x5813, 0x03}, - {0x5814, 0x00}, - {0x5815, 0x01}, - {0x5816, 0x03}, - {0x5817, 0x08}, - {0x5818, 0x0d}, - {0x5819, 0x08}, - {0x581a, 0x05}, - {0x581b, 0x06}, - {0x581c, 0x08}, - {0x581d, 0x0e}, - {0x581e, 0x29}, - {0x581f, 0x17}, - {0x5820, 0x11}, - {0x5821, 0x11}, - {0x5822, 0x15}, - {0x5823, 0x28}, - {0x5824, 0x46}, - {0x5825, 0x26}, - {0x5826, 0x08}, - {0x5827, 0x26}, - {0x5828, 0x64}, - {0x5829, 0x26}, - {0x582a, 0x24}, - {0x582b, 0x22}, - {0x582c, 0x24}, - {0x582d, 0x24}, - {0x582e, 0x06}, - {0x582f, 0x22}, - {0x5830, 0x40}, - {0x5831, 0x42}, - {0x5832, 0x24}, - {0x5833, 0x26}, - {0x5834, 0x24}, - {0x5835, 0x22}, - {0x5836, 0x22}, - {0x5837, 0x26}, - {0x5838, 0x44}, - {0x5839, 0x24}, - {0x583a, 0x26}, - {0x583b, 0x28}, - {0x583c, 0x42}, - {0x583d, 0xce}, - {0x5025, 0x00}, - {0x3a0f, 0x30}, - {0x3a10, 0x28}, - {0x3a1b, 0x30}, - {0x3a1e, 0x26}, - {0x3a11, 0x60}, - {0x3a1f, 0x14}, - {0x3008, 0x02}, - - {SEQUENCE_END, 0x00} -}; - -/* 720p 15fps @ 1280x720 */ - -static struct reginfo sensor_720p[]= -{ - {0x3503, 0x00}, - - {0x3c07,0x07}, - {0x3803,0xfa}, - {0x3806,0x06},//// - {0x3807,0xa9}, - {0x3808,0x05}, - {0x3809,0x00}, - {0x380a,0x02}, - {0x380b,0xd0}, - {0x380c,0x07}, - {0x380d,0x64}, - {0x380e,0x02}, - {0x380f,0xe4}, - {0x3813,0x04}, - {0x3a02,0x02}, - {0x3a03,0xe4}, - {0x3a08,0x01},/// - {0x3a09,0xbc},//// - {0x3a0a,0x01},/// - {0x3a0b,0x72},//// - {0x3a0e,0x01}, - {0x3a0d,0x02}, - {0x3a14,0x02}, - {0x3a15,0xe4}, - - {0x3820, 0x41}, //ddl@rock-chips.com add start: qsxvga -> 720p isn't stream on - {0x3821, 0x07}, - {0x3814, 0x31}, - {0x3815, 0x31}, - - {0x3618, 0x00}, - {0x3612, 0x29}, - {0x3709, 0x52}, - {0x370c, 0x03}, - {0x3a02, 0x03}, - {0x3a03, 0xd8}, - {0x3a08 ,0x01},/// - {0x3a09, 0x27},/// - {0x3a0a, 0x00},/// - {0x3a0b, 0xf6},/// - {0x3a0e, 0x03}, - {0x3a0d, 0x04}, - {0x3a14, 0x03}, - {0x3a15, 0xd8}, - {0x4004, 0x02}, - {0x3002, 0x1c},//// - {0x4713, 0x03},//////ddl@rock-chips.com add end - - {0x3002,0x00},/// - {0x4713,0x02},/// - {0x4837,0x16}, - {0x3824,0x04},/// - {0x5001,0x83}, - {0x3035,0x21}, - {0x3036,0x46}, - - {0x4837, 0x22}, - {0x5001, 0xa3}, - - {SEQUENCE_END, 0x00} -}; - -/* 1080p, 0x15fps, 0xyuv @1920x1080 */ - -static struct reginfo sensor_1080p[]= -{ - - {SEQUENCE_END, 0x00} -}; - -/* 2592X1944 QSXGA */ -static struct reginfo sensor_qsxga[] = -{ - {0x3503, 0x07}, - {0x3a00, 0x78}, - {0x350c, 0x00}, - {0x350d, 0x00}, - {0x3c07, 0x07}, - {0x3820, 0x40}, - {0x3821, 0x06}, - {0x3814, 0x11}, - {0x3815, 0x11}, - {0x3803, 0x00}, - {0x3807, 0x9f}, - {0x3808, 0x0a}, - {0x3809, 0x20}, - {0x380a, 0x07}, - {0x380b, 0x98}, - {0x380c, 0x0b}, - {0x380d, 0x1c}, - {0x380e, 0x07}, - {0x380f, 0xb0}, - {0x3813, 0x04}, - {0x3618, 0x04}, - {0x3612, 0x2b}, - {0x3709, 0x12}, - {0x370c, 0x00}, - {0x3a02, 0x07}, - {0x3a03, 0xb0}, - {0x3a0e, 0x06}, - {0x3a0d, 0x08}, - {0x3a14, 0x07}, - {0x3a15, 0xb0}, - {0x4004, 0x06}, - {0x3035, 0x21}, - {0x3036, 0x46}, - {0x4837, 0x2c}, - {0x5001, 0x83}, - - {SEQUENCE_END, 0x00} -}; -/* 2048*1536 QXGA */ -static struct reginfo sensor_qxga[] = -{ - {0x3503, 0x07}, - {0x3a00, 0x78}, - {0x350c, 0x00}, - {0x350d, 0x00}, - {0x3c07, 0x07}, - {0x3820, 0x40}, - {0x3821, 0x06}, - {0x3814, 0x11}, - {0x3815, 0x11}, - {0x3803, 0x00}, - {0x3807, 0x9f}, - {0x3808, 0x08}, - {0x3809, 0x00}, - {0x380a, 0x06}, - {0x380b, 0x00}, - {0x380c, 0x0b}, - {0x380d, 0x1c}, - {0x380e, 0x07}, - {0x380f, 0xb0}, - {0x3813, 0x04}, - {0x3618, 0x04}, - {0x3612, 0x2b}, - {0x3709, 0x12}, - {0x370c, 0x00}, - {0x3a02, 0x07}, - {0x3a03, 0xb0}, - {0x3a0e, 0x06}, - {0x3a0d, 0x08}, - {0x3a14, 0x07}, - {0x3a15, 0xb0}, - {0x4004, 0x06}, - {0x3035, 0x21}, - {0x3036, 0x46}, - {0x4837, 0x2c}, - {0x5001, 0xa3}, - - {SEQUENCE_END, 0x00} -}; - -/* 1600X1200 UXGA */ -static struct reginfo sensor_uxga[] = -{ - {0x3503, 0x07}, - {0x3a00, 0x78}, - {0x350c, 0x00}, - {0x350d, 0x00}, - {0x3c07, 0x07}, - {0x3820, 0x40}, - {0x3821, 0x06}, - {0x3814, 0x11}, - {0x3815, 0x11}, - {0x3803, 0x00}, - {0x3807, 0x9f}, - {0x3808, 0x06}, - {0x3809, 0x40}, - {0x380a, 0x04}, - {0x380b, 0xb0}, - {0x380c, 0x0b}, - {0x380d, 0x1c}, - {0x380e, 0x07}, - {0x380f, 0xb0}, - {0x3813, 0x04}, - {0x3618, 0x04}, - {0x3612, 0x2b}, - {0x3709, 0x12}, - {0x370c, 0x00}, - {0x3a02, 0x07}, - {0x3a03, 0xb0}, - {0x3a0e, 0x06}, - {0x3a0d, 0x08}, - {0x3a14, 0x07}, - {0x3a15, 0xb0}, - {0x4004, 0x06}, - {0x3035, 0x21}, - {0x3036, 0x46}, - {0x4837, 0x2c}, - {0x5001, 0xa3}, - - {SEQUENCE_END, 0x00} -}; - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {0x3503, 0x07}, - {0x3a00, 0x78}, - {0x350c, 0x00}, - {0x350d, 0x00}, - {0x3c07, 0x07}, - {0x3820, 0x40}, - {0x3821, 0x06}, - {0x3814, 0x11}, - {0x3815, 0x11}, - {0x3803, 0x00}, - {0x3807, 0x9f}, - {0x3808, 0x05}, - {0x3809, 0x00}, - {0x380a, 0x04}, - {0x380b, 0x00}, - {0x380c, 0x0b}, - {0x380d, 0x1c}, - {0x380e, 0x07}, - {0x380f, 0xb0}, - {0x3813, 0x04}, - {0x3618, 0x04}, - {0x3612, 0x2b}, - {0x3709, 0x12}, - {0x370c, 0x00}, - {0x3a02, 0x07}, - {0x3a03, 0xb0}, - {0x3a0e, 0x06}, - {0x3a0d, 0x08}, - {0x3a14, 0x07}, - {0x3a15, 0xb0}, - {0x4004, 0x06}, - {0x3035, 0x21}, - {0x3036, 0x46}, - {0x4837, 0x2c}, - {0x5001, 0xa3}, - - {SEQUENCE_END, 0x00} -}; -/* 1024X768 XGA */ -static struct reginfo sensor_xga[] = -{ - {0x3503, 0x07}, - {0x3a00, 0x78}, - {0x350c, 0x00}, - {0x350d, 0x00}, - {0x3c07, 0x07}, - {0x3820, 0x40}, - {0x3821, 0x06}, - {0x3814, 0x11}, - {0x3815, 0x11}, - {0x3803, 0x00}, - {0x3807, 0x9f}, - {0x3808, 0x05}, - {0x3809, 0x00}, - {0x380a, 0x04}, - {0x380b, 0x00}, - {0x380c, 0x0b}, - {0x380d, 0x1c}, - {0x380e, 0x07}, - {0x380f, 0xb0}, - {0x3813, 0x04}, - {0x3618, 0x04}, - {0x3612, 0x2b}, - {0x3709, 0x12}, - {0x370c, 0x00}, - {0x3a02, 0x07}, - {0x3a03, 0xb0}, - {0x3a0e, 0x06}, - {0x3a0d, 0x08}, - {0x3a14, 0x07}, - {0x3a15, 0xb0}, - {0x4004, 0x06}, - {0x3035, 0x21}, - {0x3036, 0x46}, - {0x4837, 0x2c}, - {0x5001, 0xa3}, - {SEQUENCE_END, 0x00} -}; -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - {0x3503, 0x00}, - {0x3c07, 0x08}, - {0x3820, 0x41}, - {0x3821, 0x07}, - {0x3814, 0x31}, - {0x3815, 0x31}, - {0x3803, 0x04}, - {0x3806, 0x07},/// - {0x3807, 0x9b}, - {0x3808, 0x03}, - {0x3809, 0x20}, - {0x380a, 0x02}, - {0x380b, 0x58}, - {0x380c, 0x07}, - {0x380d, 0x68}, - {0x380e, 0x03}, - {0x380f, 0xd8}, - {0x3813, 0x06}, - {0x3618, 0x00}, - {0x3612, 0x29}, - {0x3709, 0x52}, - {0x370c, 0x03}, - {0x3a02, 0x03}, - {0x3a03, 0xd8}, - {0x3a08 ,0x01},/// - {0x3a09, 0x27},/// - {0x3a0a, 0x00},/// - {0x3a0b, 0xf6},/// - {0x3a0e, 0x03}, - {0x3a0d, 0x04}, - {0x3a14, 0x03}, - {0x3a15, 0xd8}, - {0x4004, 0x02}, - {0x3002, 0x1c},//// - {0x4713, 0x03},//// - {0x3035, 0x21}, - {0x3036, 0x46}, - {0x4837, 0x22}, - {0x3824, 0x02},//// - {0x5001, 0xa3}, - {SEQUENCE_END, 0x00} -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - - {SEQUENCE_END, 0x00} -}; -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - - {SEQUENCE_END, 0x00} -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - - {SEQUENCE_END, 0x00} -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - - {SEQUENCE_END, 0x00} -}; -#endif -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {0x4300,0x30}, - {0x4300,0x30}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {0x4300,0x32}, - {0x4300,0x32}, - {SEQUENCE_END, 0x00} -}; - - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0x3406 ,0x00}, - {0x5192 ,0x04}, - {0x5191 ,0xf8}, - {0x5193 ,0x70}, - {0x5194 ,0xf0}, - {0x5195 ,0xf0}, - {0x518d ,0x3d}, - {0x518f ,0x54}, - {0x518e ,0x3d}, - {0x5190 ,0x54}, - {0x518b ,0xa8}, - {0x518c ,0xa8}, - {0x5187 ,0x18}, - {0x5188 ,0x18}, - {0x5189 ,0x6e}, - {0x518a ,0x68}, - {0x5186 ,0x1c}, - {0x5181 ,0x50}, - {0x5184 ,0x25}, - {0x5182 ,0x11}, - {0x5183 ,0x14}, - {0x5184 ,0x25}, - {0x5185 ,0x24}, - {SEQUENCE_END, 0x00} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0x3406 ,0x1 }, - {0x3400 ,0x6 }, - {0x3401 ,0x48}, - {0x3402 ,0x4 }, - {0x3403 ,0x0 }, - {0x3404 ,0x4 }, - {0x3405 ,0xd3 }, - {SEQUENCE_END, 0x00} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - {0x3406 ,0x1 }, - {0x3400 ,0x6 }, - {0x3401 ,0x1c}, - {0x3402 ,0x4 }, - {0x3403 ,0x0 }, - {0x3404 ,0x4 }, - {0x3405 ,0xf3}, - {SEQUENCE_END, 0x00} -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - {0x3406 ,0x1 }, - {0x3400 ,0x5 }, - {0x3401 ,0x48}, - {0x3402 ,0x4 }, - {0x3403 ,0x0 }, - {0x3404 ,0x7 }, - {0x3405 ,0xcf}, - {SEQUENCE_END, 0x00} -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - {0x3406 ,0x1 }, - {0x3400 ,0x4 }, - {0x3401 ,0x10}, - {0x3402 ,0x4 }, - {0x3403 ,0x0 }, - {0x3404 ,0x8 }, - {0x3405 ,0xb6}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Brightness1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Brightness3[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Brightness4[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x5001, 0x7f}, - {0x5580, 0x00}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Effect_WandB[] = -{ - {0x5001, 0xff}, - {0x5580, 0x18}, - {0x5583, 0x80}, - {0x5584, 0x80}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x5001, 0xff}, - {0x5580, 0x18}, - {0x5583, 0x40}, - {0x5584, 0xa0}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - //Negative - {0x5001, 0xff}, - {0x5580, 0x40}, - {SEQUENCE_END, 0x00} -};static struct reginfo sensor_Effect_Bluish[] = -{ - // Bluish - {0x5001, 0xff}, - {0x5580, 0x18}, - {0x5583, 0xa0}, - {0x5584, 0x40}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish - {0x5001, 0xff}, - {0x5580, 0x18}, - {0x5583, 0x60}, - {0x5584, 0x60}, - {SEQUENCE_END, 0x00} -}; -/*static struct reginfo sensor_Effect_Reddish[] = -{ - // Greenish - {0x5001, 0xff}, - {0x5580, 0x18}, - {0x5583, 0x80}, - {0x5584, 0xc0}, - {SEQUENCE_END, 0x00} -};*/ - -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - {0x3a0f, 0x10}, - {0x3a10, 0x08}, - {0x3a1b, 0x10}, - {0x3a1e, 0x08}, - {0x3a11, 0x20}, - {0x3a1f, 0x10}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Exposure1[]= -{ - {0x3a0f, 0x20}, - {0x3a10, 0x18}, - {0x3a11, 0x41}, - {0x3a1b, 0x20}, - {0x3a1e, 0x18}, - {0x3a1f, 0x10}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Exposure2[]= -{ - {0x3a0f, 0x30}, - {0x3a10, 0x28}, - {0x3a11, 0x61}, - {0x3a1b, 0x30}, - {0x3a1e, 0x28}, - {0x3a1f, 0x10}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - {0x3a0f, 0x38}, - {0x3a10, 0x30}, - {0x3a11, 0x61}, - {0x3a1b, 0x38}, - {0x3a1e, 0x30}, - {0x3a1f, 0x10}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Exposure4[]= -{ - {0x3a0f, 0x40}, - {0x3a10, 0x38}, - {0x3a11, 0x71}, - {0x3a1b, 0x40}, - {0x3a1e, 0x38}, - {0x3a1f, 0x10}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Exposure5[]= -{ - {0x3a0f, 0x50}, - {0x3a10, 0x48}, - {0x3a11, 0x90}, - {0x3a1b, 0x50}, - {0x3a1e, 0x48}, - {0x3a1f, 0x20}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Exposure6[]= -{ - {0x3a0f, 0x60}, - {0x3a10, 0x58}, - {0x3a11, 0xa0}, - {0x3a1b, 0x60}, - {0x3a1e, 0x58}, - {0x3a1f, 0x20}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {SEQUENCE_END, 0x00} -};static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Contrast2[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - {SEQUENCE_END, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_MirrorOff[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ - {0x3a00 , 0x78}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_SceneNight[] = -{ - //15fps ~ 3.75fps night mode for 60/50Hz light environment, 24Mhz clock input,24Mzh pclk - {0x3034 ,0x1a}, - {0x3035 ,0x21}, - {0x3036 ,0x46}, - {0x3037 ,0x13}, - {0x3038 ,0x00}, - {0x3039 ,0x00}, - {0x3a00 ,0x7c}, - {0x3a08 ,0x01}, - {0x3a09 ,0x27}, - {0x3a0a ,0x00}, - {0x3a0b ,0xf6}, - {0x3a0d ,0x04}, - {0x3a0e ,0x04}, - {0x3a02 ,0x0b}, - {0x3a03 ,0x88}, - {0x3a14 ,0x0b}, - {0x3a15 ,0x88}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Zoom1[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Zoom2[] = -{ - {SEQUENCE_END, 0x00} -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL}; -#endif -static const struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - /*{ - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - },*/ - { - .id = V4L2_CID_FOCUS_AUTO, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Focus Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - },/*{ - .id = V4L2_CID_FOCUS_CONTINUOUS, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Focus Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - },*/ - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_deactivate(struct i2c_client *client); -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf); -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; -enum sensor_wq_cmd -{ - WqCmd_af_init, - WqCmd_af_single, - WqCmd_af_special_pos, - WqCmd_af_far_pos, - WqCmd_af_near_pos, - WqCmd_af_continues, - WqCmd_af_return_idle, -}; -enum sensor_wq_result -{ - WqRet_success = 0, - WqRet_fail = -1, - WqRet_inval = -2 -}; -struct sensor_work -{ - struct i2c_client *client; - struct delayed_work dwork; - enum sensor_wq_cmd cmd; - wait_queue_head_t done; - enum sensor_wq_result result; - bool wait; - int var; -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int auto_focus; - int affm_reinit; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - struct reginfo *winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int enable; - unsigned int funmodule_state; -} sensor_info_priv_t; - - - -struct sensor_parameter -{ - unsigned short int preview_maxlines; - unsigned short int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int capture_framerate; - unsigned short int preview_framerate; - char awb[6]; -}; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - struct sensor_parameter parameter; - struct workqueue_struct *sensor_wq; - struct mutex wq_lock; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - - -#if CONFIG_SENSOR_WRITE_REGS -static int sensor_write_regs(struct i2c_client *client, u8 *reg_info, int num) -{ - int err=0,cnt; - struct i2c_msg msg[1]; - - msg->len = num; - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = reg_info; - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - - cnt= 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg failed, try to write again!\n", SENSOR_NAME_STRING()); - udelay(10); - } - } - - return err; - -} - -#endif - - - - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, u16 reg, u8 val) -{ - int err,cnt; - u8 buf[3]; - struct i2c_msg msg[1]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - buf[2] = val; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u16 reg, u8 *val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[2]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_Focus - struct sensor *sensor = to_sensor(client); -#endif -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif -#if CONFIG_SENSOR_WRITE_REGS - int j = 0, reg_num; - u8 *ptemp, *phead; - int reg_length; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - while (regarray[i].reg != SEQUENCE_END) { - #if CONFIG_SENSOR_Focus - if ((regarray == sensor_af_firmware) && (sensor->info_priv.enable == 0)) { - SENSOR_DG("%s disable, Download af firmware terminated!\n",SENSOR_NAME_STRING()); - err = -EINVAL; - goto sensor_write_array_end; - } - #endif - -#if CONFIG_SENSOR_WRITE_REGS - - j = i; - reg_num = 2; - reg_length = 0x0001; - - while((regarray[i].reg + reg_length) == regarray[i+1].reg) { - i++; - reg_num++; - if(reg_num >= WRITE_REGS_NUM) - break; - } - - if(reg_num > 2) { - - int size_num; - size_num = reg_num + 1; - - ptemp = phead = (u8*)kmalloc((size_num+10)*sizeof(u8),GFP_KERNEL); - if (!phead) { - SENSOR_DG("-------------write registers allocate memory fail!!!\n"); - i = j; - err = sensor_write(client, regarray[i].reg, regarray[i].val); - } else { - *phead = regarray[j].reg >> 8; - *(ptemp+1) = regarray[j].reg & 0xFF; - ptemp += 2; - for( ; reg_num > 0; reg_num --, j++) { - *ptemp ++ = regarray[j].val; - } - - ptemp = phead; - err = sensor_write_regs(client, ptemp,size_num); - kfree(phead); - } - }else{ - err = sensor_write(client, regarray[i].reg, regarray[i].val); - } -#else - err = sensor_write(client, regarray[i].reg, regarray[i].val); -#endif - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - i++; - } - - #if CONFIG_SENSOR_Focus - if (((regarray->reg == SEQUENCE_PROPERTY) && (regarray->val == SEQUENCE_INIT)) - || (regarray == sensor_init_data)) { - sensor->info_priv.affm_reinit = 1; - } - #endif - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != 0) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif -#if CONFIG_SENSOR_Focus -struct af_cmdinfo -{ - char cmd_tag; - char cmd_para[4]; - char validate_bit; -}; -static int sensor_af_cmdset(struct i2c_client *client, int cmd_main, struct af_cmdinfo *cmdinfo) -{ - int i; - char read_tag=0xff,cnt; - - if (cmdinfo) { - if (cmdinfo->validate_bit & 0x80) { - if (sensor_write(client, CMD_ACK_Reg, cmdinfo->cmd_tag)) { - SENSOR_TR("%s write CMD_ACK_Reg(main:0x%x tag:0x%x) error!\n",SENSOR_NAME_STRING(),cmd_main,cmdinfo->cmd_tag); - goto sensor_af_cmdset_err; - } - SENSOR_DG("%s write CMD_ACK_Reg(main:0x%x tag:0x%x) success!\n",SENSOR_NAME_STRING(),cmd_main,cmdinfo->cmd_tag); - } - for (i=0; i<4; i++) { - if (cmdinfo->validate_bit & (1<cmd_para[i])) { - SENSOR_TR("%s write CMD_PARA_Reg(main:0x%x para%d:0x%x) error!\n",SENSOR_NAME_STRING(),cmd_main,i,cmdinfo->cmd_para[i]); - goto sensor_af_cmdset_err; - } - SENSOR_DG("%s write CMD_PARA_Reg(main:0x%x para%d:0x%x) success!\n",SENSOR_NAME_STRING(),cmd_main,i,cmdinfo->cmd_para[i]); - } - } - } else { - if (sensor_write(client, CMD_ACK_Reg, 0xff)) { - SENSOR_TR("%s write CMD_ACK_Reg(main:0x%x no tag) error!\n",SENSOR_NAME_STRING(),cmd_main); - goto sensor_af_cmdset_err; - } - SENSOR_DG("%s write CMD_ACK_Reg(main:0x%x no tag) success!\n",SENSOR_NAME_STRING(),cmd_main); - } - - if (sensor_write(client, CMD_MAIN_Reg, cmd_main)) { - SENSOR_TR("%s write CMD_MAIN_Reg(main:0x%x) error!\n",SENSOR_NAME_STRING(),cmd_main); - goto sensor_af_cmdset_err; - } - - cnt = 0; - do - { - msleep(5); - if (sensor_read(client,CMD_ACK_Reg,&read_tag)){ - SENSOR_TR("%s[%d] read TAG failed\n",SENSOR_NAME_STRING(),__LINE__); - break; - } - } while((read_tag != 0x00)&& (cnt++<100)); - - SENSOR_DG("%s write CMD_MAIN_Reg(main:0x%x read tag:0x%x) success!\n",SENSOR_NAME_STRING(),cmd_main,read_tag); - return 0; -sensor_af_cmdset_err: - return -1; -} - -static int sensor_af_idlechk(struct i2c_client *client) -{ - int ret = 0; - char state; - struct af_cmdinfo cmdinfo; - - SENSOR_DG("%s , %d\n",__FUNCTION__,__LINE__); - - cmdinfo.cmd_tag = 0x01; - cmdinfo.validate_bit = 0x80; - ret = sensor_af_cmdset(client, ReturnIdle_Cmd, &cmdinfo); - if(0 != ret) { - SENSOR_TR("%s[%d] read focus_status failed\n",SENSOR_NAME_STRING(),__LINE__); - ret = -1; - goto sensor_af_idlechk_end; - } - - - do{ - ret = sensor_read(client, CMD_ACK_Reg, &state); - if (ret != 0){ - SENSOR_TR("%s[%d] read focus_status failed\n",SENSOR_NAME_STRING(),__LINE__); - ret = -1; - goto sensor_af_idlechk_end; - } - }while(0x00 != state); - - -sensor_af_idlechk_end: - return ret; -} - -static int sensor_af_single(struct i2c_client *client) -{ - int ret = 0; - char state,cnt; - struct af_cmdinfo cmdinfo; - - cmdinfo.cmd_tag = 0x01; - cmdinfo.validate_bit = 0x80; - ret = sensor_af_cmdset(client, SingleFocus_Cmd, &cmdinfo); - if(0 != ret) { - SENSOR_TR("%s single focus mode set error!\n",SENSOR_NAME_STRING()); - ret = -1; - goto sensor_af_single_end; - } - - cnt = 0; - do - { - if (cnt != 0) { - msleep(1); - } - cnt++; - ret = sensor_read(client, STA_FOCUS_Reg, &state); - if (ret != 0){ - SENSOR_TR("%s[%d] read focus_status failed\n",SENSOR_NAME_STRING(),__LINE__); - ret = -1; - goto sensor_af_single_end; - } - }while((state == S_FOCUSING) && (cnt<100)); - - if (state != S_FOCUSED) { - SENSOR_TR("%s[%d] focus state(0x%x) is error!\n",SENSOR_NAME_STRING(),__LINE__,state); - ret = -1; - goto sensor_af_single_end; - } - -sensor_af_single_end: - return ret; -} - -static int sensor_af_const(struct i2c_client *client) -{ - int ret = 0; - - - return ret; -} - - -static int sensor_af_init(struct i2c_client *client) -{ - int ret = 0, cnt; - char state; - - ret = sensor_write_array(client, sensor_af_firmware); - if (ret != 0) { - SENSOR_TR("%s Download firmware failed\n",SENSOR_NAME_STRING()); - ret = -1; - goto sensor_af_init_end; - } - - cnt = 0; - do - { - msleep(1); - if (cnt++ > 500) - break; - ret = sensor_read(client, STA_FOCUS_Reg, &state); - if (ret != 0){ - SENSOR_TR("%s[%d] read focus_status failed\n",SENSOR_NAME_STRING(),__LINE__); - ret = -1; - goto sensor_af_init_end; - } - } while (state != S_IDLE); - - if (state != S_IDLE) { - SENSOR_TR("%s focus state(0x%x) is error!\n",SENSOR_NAME_STRING(),state); - ret = -1; - goto sensor_af_init_end; - } - -sensor_af_init_end: - SENSOR_DG("%s %s ret:0x%x \n",SENSOR_NAME_STRING(),__FUNCTION__,ret); - return ret; -} - -static int sensor_af_downfirmware(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - int ret=0; - struct soc_camera_device *icd = client->dev.platform_data; - struct v4l2_mbus_framefmt mf; - - SENSOR_DG("%s %s Enter\n",SENSOR_NAME_STRING(), __FUNCTION__); - - if (sensor_af_init(client)) { - sensor->info_priv.funmodule_state &= (~SENSOR_AF_IS_OK); - ret = -1; - } else { - sensor->info_priv.funmodule_state |= SENSOR_AF_IS_OK; - - mf.width = icd->user_width; - mf.height = icd->user_height; - mf.code = sensor->info_priv.fmt.code; - mf.colorspace = sensor->info_priv.fmt.colorspace; - mf.field = V4L2_FIELD_NONE; - if (sensor_fmt_videochk(NULL, &mf) == true) { /* ddl@rock-chips.com: focus mode fix const auto focus in video */ - ret = sensor_af_const(client); - } else { - switch (sensor->info_priv.auto_focus) - { - case SENSOR_AF_MODE_AUTO: - { - ret = sensor_af_single(client); - break; - } - case SENSOR_AF_MODE_CLOSE: - { - ret = 0; - break; - } - default: - { - SENSOR_DG("%s focus mode(0x%x) is unkonwn\n",SENSOR_NAME_STRING(),sensor->info_priv.auto_focus); - goto sensor_af_downfirmware_end; - } - } - } - SENSOR_DG("%s sensor_af_downfirmware set focus mode(0x%x) ret:0x%x\n",SENSOR_NAME_STRING(), sensor->info_priv.auto_focus,ret); - } - -sensor_af_downfirmware_end: - - return ret; -} -static void sensor_af_workqueue(struct work_struct *work) -{ - struct sensor_work *sensor_work = container_of(work, struct sensor_work, dwork.work); - struct i2c_client *client = sensor_work->client; - struct sensor *sensor = to_sensor(client); - struct af_cmdinfo cmdinfo; - - SENSOR_DG("%s %s Enter, cmd:0x%x \n",SENSOR_NAME_STRING(), __FUNCTION__,sensor_work->cmd); - - mutex_lock(&sensor->wq_lock); - - switch (sensor_work->cmd) - { - case WqCmd_af_init: - { - if (sensor_af_downfirmware(client) < 0) { - SENSOR_TR("%s Sensor_af_init is failed in sensor_af_workqueue!\n",SENSOR_NAME_STRING()); - } - break; - } - case WqCmd_af_single: - { - if (sensor_af_single(client) < 0) { - SENSOR_TR("%s Sensor_af_single is failed in sensor_af_workqueue!\n",SENSOR_NAME_STRING()); - sensor_work->result = WqRet_fail; - } else { - sensor_work->result = WqRet_success; - } - break; - } - case WqCmd_af_special_pos: - { - sensor_af_idlechk(client); - - cmdinfo.cmd_tag = StepFocus_Spec_Tag; - cmdinfo.cmd_para[0] = sensor_work->var; - cmdinfo.validate_bit = 0x81; - if (sensor_af_cmdset(client, StepMode_Cmd, &cmdinfo) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_near_pos: - { - sensor_af_idlechk(client); - cmdinfo.cmd_tag = StepFocus_Near_Tag; - cmdinfo.validate_bit = 0x80; - if (sensor_af_cmdset(client, StepMode_Cmd, &cmdinfo) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_far_pos: - { - sensor_af_idlechk(client); - cmdinfo.cmd_tag = StepFocus_Far_Tag; - cmdinfo.validate_bit = 0x80; - if (sensor_af_cmdset(client, StepMode_Cmd, &cmdinfo) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_continues: - { - if (sensor_af_const(client) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_return_idle: - { - if (sensor_af_idlechk(client) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - default: - SENSOR_TR("Unknow command(%d) in %s af workqueue!",sensor_work->cmd,SENSOR_NAME_STRING()); - break; - } -set_end: - if (sensor_work->wait == false) { - kfree((void*)sensor_work); - } else { - wake_up(&sensor_work->done); - } - mutex_unlock(&sensor->wq_lock); - return; -} - -static int sensor_af_workqueue_set(struct soc_camera_device *icd, enum sensor_wq_cmd cmd, int var, bool wait) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - struct sensor_work *wk; - int ret=0; - - if (sensor->sensor_wq == NULL) { - ret = -EINVAL; - goto sensor_af_workqueue_set_end; - } - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) != SENSOR_AF_IS_OK) { - if (cmd != WqCmd_af_init) { - SENSOR_TR("%s %s cmd(%d) ingore,because af module isn't ready!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - ret = -1; - goto sensor_af_workqueue_set_end; - } - } - - wk = kzalloc(sizeof(struct sensor_work), GFP_KERNEL); - if (wk) { - wk->client = client; - INIT_WORK(&(wk->dwork.work), sensor_af_workqueue); - wk->cmd = cmd; - wk->result = WqRet_inval; - wk->wait = wait; - wk->var = var; - init_waitqueue_head(&wk->done); - - queue_delayed_work(sensor->sensor_wq,&(wk->dwork),0); - - /* ddl@rock-chips.com: - * video_lock is been locked in v4l2_ioctl function, but auto focus may slow, - * As a result any other ioctl calls will proceed very, very slowly since each call - * will have to wait for the AF to finish. Camera preview is pause,because VIDIOC_QBUF - * and VIDIOC_DQBUF is sched. so unlock video_lock here. - */ - if (wait == true) { - mutex_unlock(&icd->video_lock); - if (wait_event_timeout(wk->done, (wk->result != WqRet_inval), msecs_to_jiffies(5000)) == 0) { //hhb - SENSOR_TR("%s %s cmd(%d) is timeout!\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - } - ret = wk->result; - kfree((void*)wk); - mutex_lock(&icd->video_lock); - } - - } else { - SENSOR_TR("%s %s cmd(%d) ingore,because struct sensor_work malloc failed!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - ret = -1; - } -sensor_af_workqueue_set_end: - return ret; -} -#endif -static int sensor_parameter_record(struct i2c_client *client) -{ - u8 ret_l,ret_m,ret_h; - u8 tp_l,tp_m,tp_h; - struct sensor *sensor = to_sensor(client); - - sensor_write(client,0x3503,0x07); //stop AE/AG - sensor_write(client,0x3406,0x01); //stop AWB - - sensor_read(client,0x3500,&ret_h); - sensor_read(client,0x3501, &ret_m); - sensor_read(client,0x3502, &ret_l); - tp_l = ret_l; - tp_m = ret_m; - tp_h = ret_h; - SENSOR_DG(" %s Read 0x3500 = 0x%02x 0x3501 = 0x%02x 0x3502=0x%02x \n",SENSOR_NAME_STRING(), ret_h, ret_m, ret_l); - //sensor->parameter.preview_exposure = (tp_h<<12)+(tp_m<<4)+(tp_l>>4); - sensor->parameter.preview_exposure = ((((tp_h & 0x0f) << 8)+ tp_m) << 4) + (tp_l>>4); - - sensor_read(client,0x350c, &ret_h); - sensor_read(client,0x350d, &ret_l); - sensor->parameter.preview_line_width = ret_h & 0xff; - sensor->parameter.preview_line_width = (sensor->parameter.preview_line_width << 8) +ret_l; - //Read back AGC Gain for preview - sensor_read(client,0x350a, &ret_h); - sensor_read(client,0x350b, &tp_l); - sensor->parameter.preview_gain = ((ret_h & 0x01) << 8) + tp_l; - //preview_maxlines - sensor_read(client,0x380e, &ret_h); - sensor->parameter.preview_maxlines = ret_h; - sensor->parameter.preview_maxlines <<= 8; - sensor_read(client,0x380f, &tp_l); - sensor->parameter.preview_maxlines += tp_l; - - sensor->parameter.capture_framerate = 375; - sensor->parameter.preview_framerate = 1500; - - sensor_read(client,0x3400,&sensor->parameter.awb[0]); //record awb value - sensor_read(client,0x3401,&sensor->parameter.awb[1]); - sensor_read(client,0x3402,&sensor->parameter.awb[2]); - sensor_read(client,0x3403,&sensor->parameter.awb[3]); - sensor_read(client,0x3404,&sensor->parameter.awb[4]); - sensor_read(client,0x3405,&sensor->parameter.awb[5]); - - SENSOR_DG(" %s Read 0x350c = 0x%02x 0x350d = 0x%02x 0x350b=0x%02x \n",SENSOR_NAME_STRING(), ret_h, ret_l, sensor->parameter.preview_gain); - return 0; -} -static int sensor_ae_transfer(struct i2c_client *client) -{ - u8 ExposureLow; - u8 ExposureMid; - u8 ExposureHigh; - u16 ulCapture_Exposure; - u32 ulCapture_Exposure_Gain; - u16 iCapture_Gain; - u8 Lines_10ms; - bool m_60Hz = 0; - u8 reg_l = 0,reg_h =0; - u16 Preview_Maxlines; - u8 Gain; - u32 Capture_MaxLines; - struct sensor *sensor = to_sensor(client); - - //Preview_Maxlines = sensor->parameter.preview_line_width; - Preview_Maxlines = sensor->parameter.preview_maxlines; - Gain = sensor->parameter.preview_gain; - /* - sensor_read(client,0x350c, ®_h); - sensor_read(client,0x350d, ®_l); - Capture_MaxLines = reg_h & 0xff; - Capture_MaxLines = (Capture_MaxLines << 8) + reg_l; - */ - //capture_maxlines - sensor_read(client,0x380e, ®_h); - Capture_MaxLines = reg_h; - Capture_MaxLines <<= 8; - sensor_read(client,0x380f, ®_l); - Capture_MaxLines += reg_l; - - if(m_60Hz== 1) { - Lines_10ms = sensor->parameter.capture_framerate * Capture_MaxLines/12000; - } else { - Lines_10ms = sensor->parameter.capture_framerate * Capture_MaxLines/10000; - } - Lines_10ms = Lines_10ms & 0xffff; - - if(Preview_Maxlines == 0) - Preview_Maxlines = 1; - - //ulCapture_Exposure = - // (sensor->parameter.preview_exposure*(sensor->parameter.capture_framerate)*(Capture_MaxLines))/(((Preview_Maxlines)*(sensor->parameter.preview_framerate))); - - ulCapture_Exposure = - ((sensor->parameter.preview_exposure*(((sensor->parameter.capture_framerate)*(Capture_MaxLines) + 50)/100)) << 1)/(((Preview_Maxlines)*(sensor->parameter.preview_framerate) + 50)/100); - ulCapture_Exposure = ulCapture_Exposure & 0xffff; - - iCapture_Gain = (Gain & 0x0f) + 16; - if (Gain & 0x10) { - iCapture_Gain = iCapture_Gain << 1; - } - if (Gain & 0x20) { - iCapture_Gain = iCapture_Gain << 1; - } - if (Gain & 0x40) { - iCapture_Gain = iCapture_Gain << 1; - } - if (Gain & 0x80) { - iCapture_Gain = iCapture_Gain << 1; - } - - //ulCapture_Exposure_Gain =(u32) (11 * ulCapture_Exposure * iCapture_Gain/5); //0ld value 2.5, ½â¾ö¹ýÃà - ulCapture_Exposure_Gain =(u32) (ulCapture_Exposure * iCapture_Gain); - - if(ulCapture_Exposure_Gain < Capture_MaxLines*16) { - ulCapture_Exposure = ulCapture_Exposure_Gain/16; - if (ulCapture_Exposure > Lines_10ms) - { - //ulCapture_Exposure *= 1.7; - ulCapture_Exposure /= Lines_10ms; - ulCapture_Exposure *= Lines_10ms; - } - } else { - ulCapture_Exposure = Capture_MaxLines; - //ulCapture_Exposure_Gain *= 1.5; - } - - if(ulCapture_Exposure == 0) - ulCapture_Exposure = 1; - - iCapture_Gain = ((ulCapture_Exposure_Gain << 1)/ulCapture_Exposure + 1) >> 1; - iCapture_Gain = iCapture_Gain & 0xffff; - - ExposureLow = ((unsigned char)ulCapture_Exposure)<<4; - ExposureMid = (unsigned char)(ulCapture_Exposure >> 4) & 0xff; - ExposureHigh = (unsigned char)(ulCapture_Exposure >> 12); - - //Gain = 0; - Gain = 0x10; - if (iCapture_Gain > 31) { - Gain |= 0x10; - iCapture_Gain = iCapture_Gain >> 1; - } - if (iCapture_Gain > 31) { - Gain |= 0x20; - iCapture_Gain = iCapture_Gain >> 1; - } - if (iCapture_Gain > 31) { - Gain |= 0x40; - iCapture_Gain = iCapture_Gain >> 1; - } - if (iCapture_Gain > 31) { - Gain |= 0x80; - iCapture_Gain = iCapture_Gain >> 1; - } - if (iCapture_Gain > 16) - Gain |= ((iCapture_Gain -16) & 0x0f); - if(Gain == 0x10) - Gain = 0x11; - // write the gain and exposure to 0x350* registers - //m_iWrite0x350b=Gain; - sensor_write(client,0x350b, Gain); - Gain = (Gain >> 8) & 0x01; - sensor_write(client,0x350a, Gain); - //m_iWrite0x3502=ExposureLow; - sensor_write(client,0x3502, ExposureLow); - //m_iWrite0x3501=ExposureMid; - sensor_write(client,0x3501, ExposureMid); - //m_iWrite0x3500=ExposureHigh; - sensor_write(client,0x3500, ExposureHigh); - // SendToFile("Gain = 0x%x\r\n", Gain); - // SendToFile("ExposureLow = 0x%x\r\n", ExposureLow); - // SendToFile("ExposureMid = 0x%x\r\n", ExposureMid); - // SendToFile("ExposureHigh = 0x%x\r\n", ExposureHigh); - //¼Ó³¤ÑÓʱ£¬±ÜÃâ°µ´¦ÅÄÕÕʱµÄÃ÷°µ·Ö½çÎÊÌâ - //camera_timed_wait(200); - //linzhk camera_timed_wait(500); - - sensor_write(client,0x3400,sensor->parameter.awb[0]); // resume awb value - sensor_write(client,0x3401,sensor->parameter.awb[1]); - sensor_write(client,0x3402,sensor->parameter.awb[2]); - sensor_write(client,0x3403,sensor->parameter.awb[3]); - sensor_write(client,0x3404,sensor->parameter.awb[4]); - sensor_write(client,0x3405,sensor->parameter.awb[5]); - - SENSOR_DG(" %s Write 0x350b = 0x%02x 0x3502 = 0x%02x 0x3501=0x%02x 0x3500 = 0x%02x\n",SENSOR_NAME_STRING(), Gain, ExposureLow, ExposureMid, ExposureHigh); - mdelay(100); - return 0; -} -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on == Flash_On){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),cmd); - break; - } - } - -sensor_power_end: - return ret; -} - -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} - -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - char value; - int ret,pid = 0; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - ret = sensor_write(client, 0x3008, 0x80); - if (ret != 0) { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); //delay 5 microseconds - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x300a, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value << 8); - - ret = sensor_read(client, 0x300b, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x \n", SENSOR_NAME_STRING(), pid); - - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - ret = sensor_write_array(client, sensor_init_data); - udelay(1000); //wait sensor power on,so that I2C write sensor registers would sucess hhb@rock-chips.con - - if (ret != 0) { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - sensor->info_priv.winseqe_cur_addr = SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - - sensor->info_priv.funmodule_state = SENSOR_INIT_IS_OK; - - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - if (sensor->info_priv.funmodule_state & SENSOR_INIT_IS_OK) { - sensor_task_lock(client, 1); - sensor_write(client, 0x3017, 0x00); // FREX,VSYNC,HREF,PCLK,D9-D6 - sensor_write(client, 0x3018, 0x03); // D5-D0 - sensor_write(client,0x3019,0x00); // STROBE,SDA - sensor_task_lock(client, 0); - } - sensor_ioctrl(icd, Sensor_PowerDown, 1); - msleep(100); - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - return 0; -} - -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00} -}; - -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - return 0; -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static int sensor_s_fmt(struct v4l2_subdev *sd,struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - int ret = 0, set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && (sensor_svga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_svga; - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1024) && (set_h <= 768)) && (sensor_xga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_xga; - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 720)) && (sensor_720p[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_720p; - set_w = 1280; - set_h = 720; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_sxga; - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_uxga; - set_w = 1600; - set_h = 1200; - } - else if (((set_w <= 1920) && (set_h <= 1080)) && (sensor_1080p[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_1080p; - set_w = 1920; - set_h = 1080; - } - else if (((set_w <= 2048) && (set_h <= 1536)) && (sensor_qxga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_qxga; - set_w = 2048; - set_h = 1536; - } - else if (((set_w <= 2592) && (set_h <= 1944)) && (sensor_qsxga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_qsxga; - set_w = 2592; - set_h = 1944; - } - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if (winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) - { - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - sensor_parameter_record(client); - /*#if CONFIG_SENSOR_Focus - sensor_af_idlechk(client); - if (sensor->info_priv.auto_focus == SENSOR_AF_MODE_CONTINUOUS) - sensor_af_cmdset(client, PauseFocus_Cmd, NULL); - #endif*/ - #if CONFIG_SENSOR_Flash - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - #endif - }else { /* ddl@rock-chips.com : Video */ - #if CONFIG_SENSOR_Flash - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - #endif - } - if ((sensor->info_priv.winseqe_cur_addr->reg == SEQUENCE_PROPERTY) && (sensor->info_priv.winseqe_cur_addr->val == SEQUENCE_INIT)) { - if (((winseqe_set_addr->reg == SEQUENCE_PROPERTY) && (winseqe_set_addr->val == SEQUENCE_NORMAL)) - || (winseqe_set_addr->reg != SEQUENCE_PROPERTY)) { - ret |= sensor_write_array(client,sensor_init_data); - udelay(1000); //wait sensor power on,so that I2C write sensor registers would sucess hhb@rock-chips.con - SENSOR_DG("\n%s reinit ret:0x%x \n",SENSOR_NAME_STRING(), ret); - } - } - - if ((winseqe_set_addr == sensor_qsxga) && (sensor->info_priv.winseqe_cur_addr == sensor_720p)) { - sensor_write_array(client, sensor_svga); - } - - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - sensor->info_priv.winseqe_cur_addr = winseqe_set_addr; - - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - sensor_ae_transfer(client); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - if (sensor->info_priv.whiteBalance != 0) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - sensor->info_priv.snap2preview = true; - } else if (sensor_fmt_videochk(sd,mf) == true) { /* ddl@rock-chips.com : Video */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - - sensor->info_priv.video2preview = true; - } else if ((sensor->info_priv.snap2preview == true) || (sensor->info_priv.video2preview == true)) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - if (sensor->info_priv.snap2preview == true) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - #if CONFIG_SENSOR_Focus - if (sensor->info_priv.auto_focus == SENSOR_AF_MODE_AUTO) { - sensor_af_workqueue_set(icd,WqCmd_af_return_idle,0,true); - msleep(200); - } else { - msleep(500); - } - #else - msleep(500); - #endif - sensor->info_priv.video2preview = false; - sensor->info_priv.snap2preview = false; - } - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - mf->width = set_w; - mf->height = set_h; -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg!=SEQUENCE_END)) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg!=SEQUENCE_END)) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=SEQUENCE_END)) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=SEQUENCE_END)) - { - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && (sensor_svga[0].reg!=SEQUENCE_END)) - { - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1024) && (set_h <= 768)) && (sensor_xga[0].reg!=SEQUENCE_END)) - { - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 720)) && (sensor_720p[0].reg!=SEQUENCE_END)) - { - set_w = 1280; - set_h = 720; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=SEQUENCE_END)) - { - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=SEQUENCE_END)) - { - set_w = 1600; - set_h = 1200; - } - else if (((set_w <= 1920) && (set_h <= 1080)) && (sensor_1080p[0].reg!=SEQUENCE_END)) - { - set_w = 1920; - set_h = 1080; - } - else if (((set_w <= 2048) && (set_h <= 1536)) && (sensor_qxga[0].reg!=SEQUENCE_END)) - { - set_w = 2048; - set_h = 1536; - } - else if (((set_w <= 2592) && (set_h <= 1944)) && (sensor_qsxga[0].reg!=SEQUENCE_END)) - { - set_w = 2592; - set_h = 1944; - } - else - { - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - - mf->width = set_w; - mf->height = set_h; - - mf->colorspace = fmt->colorspace; - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV2655 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n%s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((*value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value > 0) && ((digitalzoom_cur + *value) > digitalzoom_total)) - { - *value = digitalzoom_total - digitalzoom_cur; - } - - if ((*value < 0) && ((digitalzoom_cur + *value) < 0)) - { - *value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += *value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, *value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Focus -static int sensor_set_focus_absolute(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int ret = 0; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (!qctrl_info) - return -EINVAL; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - if ((value >= qctrl_info->minimum) && (value <= qctrl_info->maximum)) { - ret = sensor_af_workqueue_set(icd, WqCmd_af_special_pos, value, true); - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EINVAL; - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - } - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - - return ret; -} -static int sensor_set_focus_relative(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int ret = 0; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_RELATIVE); - if (!qctrl_info) - return -EINVAL; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - if ((value >= qctrl_info->minimum) && (value <= qctrl_info->maximum)) { - if (value > 0) { - ret = sensor_af_workqueue_set(icd, WqCmd_af_near_pos, 0, true); - } else { - ret = sensor_af_workqueue_set(icd, WqCmd_af_far_pos, 0, true); - } - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EINVAL; - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - } - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - return ret; -} - -static int sensor_set_focus_mode(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int ret = 0; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - switch (value) - { - case SENSOR_AF_MODE_AUTO: - { - ret = sensor_af_workqueue_set(icd, WqCmd_af_single, 0, true); - break; - } - - /*case SENSOR_AF_MODE_MACRO: - { - ret = sensor_set_focus_absolute(icd, qctrl, 0xff); - break; - } - - case SENSOR_AF_MODE_INFINITY: - { - ret = sensor_set_focus_absolute(icd, qctrl, 0x00); - break; - } - - case SENSOR_AF_MODE_CONTINUOUS: - { - ret = sensor_af_workqueue_set(icd, WqCmd_af_continues, 0, true); - break; - }*/ - default: - SENSOR_TR("\n %s..%s AF value(0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__,value); - break; - - } - - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - - return ret; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %d\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset,ret; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - sensor_set_focus_relative(icd, qctrl,ext_ctrl->value); - break; - } - case V4L2_CID_FOCUS_AUTO: - { - if (ext_ctrl->value == 1) { - if (sensor_set_focus_mode(icd, qctrl,SENSOR_AF_MODE_AUTO) != 0) { - if(0 == (sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK)) { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_AUTO; - } - return -EINVAL; - } - sensor->info_priv.auto_focus = SENSOR_AF_MODE_AUTO; - } else if (SENSOR_AF_MODE_AUTO == sensor->info_priv.auto_focus){ - if (ext_ctrl->value == 0) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CLOSE; - } - break; - } - case V4L2_CID_FOCUS_CONTINUOUS: - { - /*if (SENSOR_AF_MODE_CONTINUOUS != sensor->info_priv.auto_focus) { - if (ext_ctrl->value == 1) { - if (sensor_set_focus_mode(icd, qctrl,SENSOR_AF_MODE_CONTINUOUS) != 0) - return -EINVAL; - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CONTINUOUS; - } - } else { - if (ext_ctrl->value == 0) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CLOSE; - }*/ - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_stream(struct v4l2_subdev *sd, int enable) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - #if CONFIG_SENSOR_Focus - struct soc_camera_device *icd = client->dev.platform_data; - struct v4l2_mbus_framefmt mf; - #endif - - if (enable == 1) { - sensor->info_priv.enable = 1; - #if CONFIG_SENSOR_Focus - mf.width = icd->user_width; - mf.height = icd->user_height; - mf.code = sensor->info_priv.fmt.code; - mf.colorspace = sensor->info_priv.fmt.colorspace; - mf.field = V4L2_FIELD_NONE; - /* If auto focus firmware haven't download success, must download firmware again when in video or preview stream on */ - if (sensor_fmt_capturechk(sd, &mf) == false) { - if ((sensor->info_priv.affm_reinit == 1) || ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK)==0)) { - sensor_af_workqueue_set(icd, WqCmd_af_init, 0, false); - sensor->info_priv.affm_reinit = 0; - } - } - #endif - } else if (enable == 0) { - sensor->info_priv.enable = 0; - #if CONFIG_SENSOR_Focus - flush_workqueue(sensor->sensor_wq); - #endif - } - return 0; -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char value; - int ret,pid = 0; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - /* soft reset */ - ret = sensor_write(client, 0x3008, 0x80); - if (ret != 0) { - SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - mdelay(5); //delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x300a, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid |= (value << 8); - - ret = sensor_read(client, 0x300b, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - return ret; -} -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0,i; - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - #if CONFIG_SENSOR_Flash //hhb - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - #endif - sensor_deactivate(client); - break; - } - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - sensor->sensor_gpio_res = NULL; - for (i=0; isensor_io_request->gpio_res[i].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[i].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[i]; - } - } - if (sensor->sensor_gpio_res == NULL) { - SENSOR_TR("%s %s obtain gpio resource failed when RK29_CAM_SUBDEV_IOREQUEST \n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - printk("flash io:%d\n",sensor->sensor_gpio_res->gpio_flash); - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } - -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, - .s_stream = sensor_s_stream, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - sensor->info_priv.fmt = sensor_colour_fmts[0]; - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } else { - #if CONFIG_SENSOR_Focus - sensor->sensor_wq = create_workqueue(SENSOR_NAME_STRING(_af_workqueue)); - if (sensor->sensor_wq == NULL) - SENSOR_TR("%s create fail!", SENSOR_NAME_STRING(_af_workqueue)); - mutex_init(&sensor->wq_lock); - #endif - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - #if CONFIG_SENSOR_Focus - if (sensor->sensor_wq) { - destroy_workqueue(sensor->sensor_wq); - sensor->sensor_wq = NULL; - } - #endif - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - - diff --git a/drivers/media/video/ov5640_old.c b/drivers/media/video/ov5640_old.c deleted file mode 100755 index 25b0dc1e5d34..000000000000 --- a/drivers/media/video/ov5640_old.c +++ /dev/null @@ -1,4199 +0,0 @@ -/* - * Driver for OV5640 CMOS Image Sensor from OmniVision - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "ov5640.h" - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_OV5640 -#define SENSOR_V4L2_IDENT V4L2_IDENT_OV5640 -#define SENSOR_ID 0x5640 -#define SENSOR_MIN_WIDTH 176 -#define SENSOR_MIN_HEIGHT 144 -#define SENSOR_MAX_WIDTH 2592 -#define SENSOR_MAX_HEIGHT 1944 -#define SENSOR_INIT_WIDTH 800 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 600 -#define SENSOR_INIT_WINSEQADR sensor_svga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_YUYV8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 1 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 1 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 -#ifdef CONFIG_OV5640_AUTOFOCUS -#define CONFIG_SENSOR_Focus 1 -#define CONFIG_SENSOR_FocusCenterInCapture 0 -#define CONFIG_SENSOR_FocusContinues 0 -#include "ov5640_af_firmware.c" -#else -#define CONFIG_SENSOR_Focus 0 -#endif - -#define CONFIG_SENSOR_I2C_SPEED 100000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define CONFIG_SENSOR_WRITE_REGS 0 -#define WRITE_REGS_NUM 3 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) - -#if CONFIG_SENSOR_Focus -/*#define SENSOR_AF_MODE_INFINITY 0 -#define SENSOR_AF_MODE_MACRO 1 -#define SENSOR_AF_MODE_FIXED 2 -#define SENSOR_AF_MODE_AUTO 3 -#define SENSOR_AF_MODE_CONTINUOUS 4 -#define SENSOR_AF_MODE_CLOSE 5*/ -#define SENSOR_AF_MODE_AUTO 0 -#define SENSOR_AF_MODE_CLOSE 1 -#define SENSOR_AF_MODE_CONTINUOUS 2 -#endif - -#if CONFIG_SENSOR_Focus -/* ov5640 VCM Command and Status Registers */ -#define CMD_MAIN_Reg 0x3022 -//#define CMD_TAG_Reg 0x3023 -#define CMD_ACK_Reg 0x3023 -#define CMD_PARA0_Reg 0x3024 -#define CMD_PARA1_Reg 0x3025 -#define CMD_PARA2_Reg 0x3026 -#define CMD_PARA3_Reg 0x3027 -#define CMD_PARA4_Reg 0x3028 - -//#define STA_ZONE_Reg 0x3026 -#define STA_FOCUS_Reg 0x3029 - -/* ov5640 VCM Command */ - -#define ConstFocus_Cmd 0x04 -#define StepMode_Cmd 0x05 -#define PauseFocus_Cmd 0x06 -#define ReturnIdle_Cmd 0x08 -#define SetZone_Cmd 0x10 -#define UpdateZone_Cmd 0x12 -#define SetMotor_Cmd 0x20 -#define SingleFocus_Cmd 0x03 -#define GetFocusResult_Cmd 0x07 -#define ReleaseFocus_Cmd 0x08 -#define ZoneRelaunch_Cmd 0x12 -#define DefaultZoneConfig_Cmd 0x80 -#define TouchZoneConfig_Cmd 0x81 -#define CustomZoneConfig_Cmd 0x8f - - -/* ov5640 Focus State */ -//#define S_FIRWRE 0xFF /*Firmware is downloaded and not run*/ -#define S_STARTUP 0x7e /*Firmware is initializing*/ -#define S_ERROR 0x7f -#define S_IDLE 0x70 /*Idle state, focus is released; lens is located at the furthest position.*/ -#define S_FOCUSING 0x00 /*Auto Focus is running.*/ -#define S_FOCUSED 0x10 /*Auto Focus is completed.*/ - -#define S_CAPTURE 0x12 -#define S_STEP 0x20 - -/* ov5640 Zone State */ -#define Zone_Is_Focused(a, zone_val) (zone_val&(1<<(a-3))) -#define Zone_Get_ID(zone_val) (zone_val&0x03) - -#define Zone_CenterMode 0x01 -#define Zone_5xMode 0x02 -#define Zone_5PlusMode 0x03 -#define Zone_4fMode 0x04 - -#define ZoneSel_Auto 0x0b -#define ZoneSel_SemiAuto 0x0c -#define ZoneSel_Manual 0x0d -#define ZoneSel_Rotate 0x0e - -/* ov5640 Step Focus Commands */ -#define StepFocus_Near_Tag 0x01 -#define StepFocus_Far_Tag 0x02 -#define StepFocus_Furthest_Tag 0x03 -#define StepFocus_Nearest_Tag 0x04 -#define StepFocus_Spec_Tag 0x10 -#endif - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); - -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_OV5640_USER_DEFINED_SERIES -#include "ov5640_user_series.c" -#else - -/* init 800X600 SVGA */ -static struct reginfo sensor_init_data[] = -{ - {0x3103, 0x11}, - //{0x3008, 0x82}, - {0x3008, 0x42}, - {0x3103, 0x03}, - {0x3017, 0xff}, - {0x3018, 0xff}, - {0x3034, 0x1a}, - {0x3035, 0x21}, - {0x3036, 0x46}, - {0x3037, 0x12}, - {0x3108, 0x01}, - {0x3630, 0x36}, - {0x3631, 0x0e}, - {0x3632, 0xe2}, - {0x3633, 0x12}, - {0x3621, 0xe0}, - {0x3704, 0xa0}, - {0x3703, 0x5a}, - {0x3715, 0x78}, - {0x3717, 0x01}, - {0x370b, 0x60}, - {0x3705, 0x1a}, - {0x3905, 0x02}, - {0x3906, 0x10}, - {0x3901, 0x0a}, - {0x3731, 0x12}, - {0x3600, 0x08}, - {0x3601, 0x33}, - {0x302d, 0x60}, - {0x3620, 0x52}, - {0x371b, 0x20}, - {0x471c, 0x50}, - {0x3a13, 0x43}, - {0x3a18, 0x00}, - {0x3a19, 0xf8}, - {0x3635, 0x13}, - {0x3636, 0x03}, - {0x3634, 0x40}, - {0x3622, 0x01}, - {0x3c01, 0x34}, - {0x3c04, 0x28}, - {0x3c05, 0x98}, - {0x3c06, 0x00}, - {0x3c07, 0x08}, - {0x3c08, 0x00}, - {0x3c09, 0x1c}, - {0x3c0a, 0x9c}, - {0x3c0b, 0x40}, - {0x3820, 0x41}, - {0x3821, 0x07}, - {0x3814, 0x31}, - {0x3815, 0x31}, - {0x3800, 0x00}, - {0x3801, 0x00}, - {0x3802, 0x00}, - {0x3803, 0x04}, - {0x3804, 0x0a}, - {0x3805, 0x3f}, - {0x3806, 0x07}, - {0x3807, 0x9b}, - {0x3808, 0x03}, - {0x3809, 0x20}, - {0x380a, 0x02}, - {0x380b, 0x58}, - {0x380c, 0x07}, - {0x380d, 0x68}, - {0x380e, 0x03}, - {0x380f, 0xd8}, - {0x3810, 0x00}, - {0x3811, 0x10}, - {0x3812, 0x00}, - {0x3813, 0x06}, - {0x3618, 0x00}, - {0x3612, 0x29}, - {0x3708, 0x64}, - {0x3709, 0x52}, - {0x370c, 0x03}, - {0x3a02, 0x03}, - {0x3a03, 0xd8}, - {0x3a08, 0x01}, - {0x3a09, 0x27}, - {0x3a0a, 0x00}, - {0x3a0b, 0xf6}, - {0x3a0e, 0x03}, - {0x3a0d, 0x04}, - {0x3a14, 0x03}, - {0x3a15, 0xd8}, - {0x4001, 0x02}, - {0x4004, 0x02}, - {0x3000, 0x00}, - {0x3002, 0x1c}, - {0x3004, 0xff}, - {0x3006, 0xc3}, - {0x300e, 0x58}, - {0x302e, 0x00}, - {0x4740, 0x20}, - {0x4300, 0x30}, - {0x501f, 0x00}, - {0x4713, 0x03}, - {0x4407, 0x04}, - {0x440e, 0x00}, - {0x460b, 0x35}, - {0x460c, 0x20}, - {0x4837, 0x22}, - {0x3824, 0x02}, - {0x5000, 0xa7}, - {0x5001, 0xa3}, - {0x5180, 0xff}, - {0x5181, 0xf2}, - {0x5182, 0x00}, - {0x5183, 0x14}, - {0x5184, 0x25}, - {0x5185, 0x24}, - {0x5186, 0x09}, - {0x5187, 0x09}, - {0x5188, 0x09}, - {0x5189, 0x75}, - {0x518a, 0x54}, - {0x518b, 0xe0}, - {0x518c, 0xb2}, - {0x518d, 0x42}, - {0x518e, 0x3d}, - {0x518f, 0x56}, - {0x5190, 0x46}, - {0x5191, 0xf8}, - {0x5192, 0x04}, - {0x5193, 0x70}, - {0x5194, 0xf0}, - {0x5195, 0xf0}, - {0x5196, 0x03}, - {0x5197, 0x01}, - {0x5198, 0x04}, - {0x5199, 0x12}, - {0x519a, 0x04}, - {0x519b, 0x00}, - {0x519c, 0x06}, - {0x519d, 0x82}, - {0x519e, 0x38}, - {0x5381, 0x1e}, - {0x5382, 0x5b}, - {0x5383, 0x08}, - {0x5384, 0x0a}, - {0x5385, 0x7e}, - {0x5386, 0x88}, - {0x5387, 0x7c}, - {0x5388, 0x6c}, - {0x5389, 0x10}, - {0x538a, 0x01}, - {0x538b, 0x98}, - {0x5300, 0x08}, - {0x5301, 0x30}, - {0x5302, 0x10}, - {0x5303, 0x00}, - {0x5304, 0x08}, - {0x5305, 0x30}, - {0x5306, 0x08}, - {0x5307, 0x16}, - {0x5309, 0x08}, - {0x530a, 0x30}, - {0x530b, 0x04}, - {0x530c, 0x06}, - {0x5480, 0x01}, - {0x5481, 0x08}, - {0x5482, 0x14}, - {0x5483, 0x28}, - {0x5484, 0x51}, - {0x5485, 0x65}, - {0x5486, 0x71}, - {0x5487, 0x7d}, - {0x5488, 0x87}, - {0x5489, 0x91}, - {0x548a, 0x9a}, - {0x548b, 0xaa}, - {0x548c, 0xb8}, - {0x548d, 0xcd}, - {0x548e, 0xdd}, - {0x548f, 0xea}, - {0x5490, 0x1d}, - {0x5580, 0x02}, - {0x5583, 0x40}, - {0x5584, 0x10}, - {0x5589, 0x10}, - {0x558a, 0x00}, - {0x558b, 0xf8}, - {0x5800, 0x23}, - {0x5801, 0x14}, - {0x5802, 0x0f}, - {0x5803, 0x0f}, - {0x5804, 0x12}, - {0x5805, 0x26}, - {0x5806, 0x0c}, - {0x5807, 0x08}, - {0x5808, 0x05}, - {0x5809, 0x05}, - {0x580a, 0x08}, - {0x580b, 0x0d}, - {0x580c, 0x08}, - {0x580d, 0x03}, - {0x580e, 0x00}, - {0x580f, 0x00}, - {0x5810, 0x03}, - {0x5811, 0x09}, - {0x5812, 0x07}, - {0x5813, 0x03}, - {0x5814, 0x00}, - {0x5815, 0x01}, - {0x5816, 0x03}, - {0x5817, 0x08}, - {0x5818, 0x0d}, - {0x5819, 0x08}, - {0x581a, 0x05}, - {0x581b, 0x06}, - {0x581c, 0x08}, - {0x581d, 0x0e}, - {0x581e, 0x29}, - {0x581f, 0x17}, - {0x5820, 0x11}, - {0x5821, 0x11}, - {0x5822, 0x15}, - {0x5823, 0x28}, - {0x5824, 0x46}, - {0x5825, 0x26}, - {0x5826, 0x08}, - {0x5827, 0x26}, - {0x5828, 0x64}, - {0x5829, 0x26}, - {0x582a, 0x24}, - {0x582b, 0x22}, - {0x582c, 0x24}, - {0x582d, 0x24}, - {0x582e, 0x06}, - {0x582f, 0x22}, - {0x5830, 0x40}, - {0x5831, 0x42}, - {0x5832, 0x24}, - {0x5833, 0x26}, - {0x5834, 0x24}, - {0x5835, 0x22}, - {0x5836, 0x22}, - {0x5837, 0x26}, - {0x5838, 0x44}, - {0x5839, 0x24}, - {0x583a, 0x26}, - {0x583b, 0x28}, - {0x583c, 0x42}, - {0x583d, 0xce}, - {0x5025, 0x00}, - {0x3a0f, 0x30}, - {0x3a10, 0x28}, - {0x3a1b, 0x30}, - {0x3a1e, 0x26}, - {0x3a11, 0x60}, - {0x3a1f, 0x14}, - {0x3008, 0x02}, - {0x302c, 0xc2}, - {SEQUENCE_END, 0x00} -}; - -/* 720p 15fps @ 1280x720 */ - -static struct reginfo sensor_720p[]= -{ - {0x3503, 0x00}, - - {0x3c07,0x07}, - {0x3803,0xfa}, - {0x3806,0x06},//// - {0x3807,0xa9}, - {0x3808,0x05}, - {0x3809,0x00}, - {0x380a,0x02}, - {0x380b,0xd0}, - {0x380c,0x07}, - {0x380d,0x64}, - {0x380e,0x02}, - {0x380f,0xe4}, - {0x3813,0x04}, - {0x3a02,0x02}, - {0x3a03,0xe4}, - {0x3a08,0x01},/// - {0x3a09,0xbc},//// - {0x3a0a,0x01},/// - {0x3a0b,0x72},//// - {0x3a0e,0x01}, - {0x3a0d,0x02}, - {0x3a14,0x02}, - {0x3a15,0xe4}, - - {0x3820, 0x41}, //ddl@rock-chips.com add start: qsxvga -> 720p isn't stream on - {0x3821, 0x07}, - {0x3814, 0x31}, - {0x3815, 0x31}, - - {0x3618, 0x00}, - {0x3612, 0x29}, - {0x3709, 0x52}, - {0x370c, 0x03}, - {0x3a02, 0x03}, - {0x3a03, 0xd8}, - {0x3a08 ,0x01},/// - {0x3a09, 0x27},/// - {0x3a0a, 0x00},/// - {0x3a0b, 0xf6},/// - {0x3a0e, 0x03}, - {0x3a0d, 0x04}, - {0x3a14, 0x03}, - {0x3a15, 0xd8}, - {0x4004, 0x02}, - {0x3002, 0x1c},//// - {0x4713, 0x03},//////ddl@rock-chips.com add end - - {0x3002,0x00},/// - {0x4713,0x02},/// - {0x4837,0x16}, - {0x3824,0x04},/// - {0x5001,0x83}, - {0x3035,0x21}, - {0x3036,0x46}, - - {0x4837, 0x22}, - {0x5001, 0xa3}, - - {SEQUENCE_END, 0x00} -}; - -/* 1080p, 0x15fps, 0xyuv @1920x1080 */ - -static struct reginfo sensor_1080p[]= -{ - - {SEQUENCE_END, 0x00} -}; - -/* 2592X1944 QSXGA */ -static struct reginfo sensor_qsxga[] = -{ -#if 0 - {0x3503, 0x07}, - {0x3a00, 0x78}, - {0x350c, 0x00}, - {0x350d, 0x00}, - {0x3c07, 0x07}, - {0x3820, 0x40}, - {0x3821, 0x06}, - {0x3814, 0x11}, - {0x3815, 0x11}, - {0x3803, 0x00}, - {0x3807, 0x9f}, - {0x3808, 0x0a}, - {0x3809, 0x20}, - {0x380a, 0x07}, - {0x380b, 0x98}, - {0x380c, 0x0b}, - {0x380d, 0x1c}, - {0x380e, 0x07}, - {0x380f, 0xb0}, - {0x3813, 0x04}, - {0x3618, 0x04}, - {0x3612, 0x2b}, - {0x3709, 0x12}, - {0x370c, 0x00}, - {0x3a02, 0x07}, - {0x3a03, 0xb0}, - {0x3a0e, 0x06}, - {0x3a0d, 0x08}, - {0x3a14, 0x07}, - {0x3a15, 0xb0}, - {0x4004, 0x06}, - {0x3035, 0x21}, - {0x3036, 0x46}, - {0x4837, 0x2c}, - {0x5001, 0x83}, -#else - {0x3820, 0x40}, - {0x3821, 0x06}, - {0x3814, 0x11}, - {0x3815, 0x11}, - {0x3803, 0x00}, - {0x3807, 0x9f}, - {0x3808, 0x0a}, - {0x3809, 0x20}, - {0x380a, 0x07}, - {0x380b, 0x98}, - {0x380c, 0x0b}, - {0x380d, 0x1c}, - {0x380e, 0x07}, - {0x380f, 0xb0}, - {0x3811, 0x10}, // - {0x3813, 0x04}, - {0x3618, 0x04}, - {0x3612, 0x2b}, //4b - {0x3708, 0x64}, - {0x3709, 0x12}, - {0x370c, 0x00}, - {0x3a02, 0x07}, - {0x3a03, 0xb0}, - {0x3a0e, 0x06}, - {0x3a0d, 0x08}, - {0x3a14, 0x07}, - {0x3a15, 0xb0}, - {0x4004, 0x06}, - {0x5000, 0xa7}, - {0x5001, 0x83}, - {0x519e, 0x38}, - {0x5381, 0x1e}, - {0x5382, 0x5b}, - {0x5383, 0x08}, - {0x460b, 0x37}, - {0x460c, 0x20}, - {0x3824, 0x01}, - {0x4005, 0x1A}, -#endif - {SEQUENCE_END, 0x00} -}; -/* 2048*1536 QXGA */ -static struct reginfo sensor_qxga[] = -{ -#if 0 - {0x3503, 0x07}, - {0x3a00, 0x78}, - {0x350c, 0x00}, - {0x350d, 0x00}, - {0x3c07, 0x07}, - {0x3820, 0x40}, - {0x3821, 0x06}, - {0x3814, 0x11}, - {0x3815, 0x11}, - {0x3803, 0x00}, - {0x3807, 0x9f}, - {0x3808, 0x08}, - {0x3809, 0x00}, - {0x380a, 0x06}, - {0x380b, 0x00}, - {0x380c, 0x0b}, - {0x380d, 0x1c}, - {0x380e, 0x07}, - {0x380f, 0xb0}, - {0x3813, 0x04}, - {0x3618, 0x04}, - {0x3612, 0x2b}, - {0x3709, 0x12}, - {0x370c, 0x00}, - {0x3a02, 0x07}, - {0x3a03, 0xb0}, - {0x3a0e, 0x06}, - {0x3a0d, 0x08}, - {0x3a14, 0x07}, - {0x3a15, 0xb0}, - {0x4004, 0x06}, - {0x3035, 0x21}, - {0x3036, 0x46}, - {0x4837, 0x2c}, - {0x5001, 0xa3}, -#endif - {SEQUENCE_END, 0x00} -}; - -/* 1600X1200 UXGA */ -static struct reginfo sensor_uxga[] = -{ -#if 0 - {0x3503, 0x07}, - {0x3a00, 0x78}, - {0x350c, 0x00}, - {0x350d, 0x00}, - {0x3c07, 0x07}, - {0x3820, 0x40}, - {0x3821, 0x06}, - {0x3814, 0x11}, - {0x3815, 0x11}, - {0x3803, 0x00}, - {0x3807, 0x9f}, - {0x3808, 0x06}, - {0x3809, 0x40}, - {0x380a, 0x04}, - {0x380b, 0xb0}, - {0x380c, 0x0b}, - {0x380d, 0x1c}, - {0x380e, 0x07}, - {0x380f, 0xb0}, - {0x3813, 0x04}, - {0x3618, 0x04}, - {0x3612, 0x2b}, - {0x3709, 0x12}, - {0x370c, 0x00}, - {0x3a02, 0x07}, - {0x3a03, 0xb0}, - {0x3a0e, 0x06}, - {0x3a0d, 0x08}, - {0x3a14, 0x07}, - {0x3a15, 0xb0}, - {0x4004, 0x06}, - {0x3035, 0x21}, - {0x3036, 0x46}, - {0x4837, 0x2c}, - {0x5001, 0xa3}, -#endif - {SEQUENCE_END, 0x00} -}; - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ -#if 0 - {0x3503, 0x07}, - {0x3a00, 0x78}, - {0x350c, 0x00}, - {0x350d, 0x00}, - {0x3c07, 0x07}, - {0x3820, 0x40}, - {0x3821, 0x06}, - {0x3814, 0x11}, - {0x3815, 0x11}, - {0x3803, 0x00}, - {0x3807, 0x9f}, - {0x3808, 0x05}, - {0x3809, 0x00}, - {0x380a, 0x04}, - {0x380b, 0x00}, - {0x380c, 0x0b}, - {0x380d, 0x1c}, - {0x380e, 0x07}, - {0x380f, 0xb0}, - {0x3813, 0x04}, - {0x3618, 0x04}, - {0x3612, 0x2b}, - {0x3709, 0x12}, - {0x370c, 0x00}, - {0x3a02, 0x07}, - {0x3a03, 0xb0}, - {0x3a0e, 0x06}, - {0x3a0d, 0x08}, - {0x3a14, 0x07}, - {0x3a15, 0xb0}, - {0x4004, 0x06}, - {0x3035, 0x21}, - {0x3036, 0x46}, - {0x4837, 0x2c}, - {0x5001, 0xa3}, -#endif - {SEQUENCE_END, 0x00} -}; -/* 1024X768 XGA */ -static struct reginfo sensor_xga[] = -{ -#if 0 - {0x3503, 0x07}, - {0x3a00, 0x78}, - {0x350c, 0x00}, - {0x350d, 0x00}, - {0x3c07, 0x07}, - {0x3820, 0x40}, - {0x3821, 0x06}, - {0x3814, 0x11}, - {0x3815, 0x11}, - {0x3803, 0x00}, - {0x3807, 0x9f}, - {0x3808, 0x05}, - {0x3809, 0x00}, - {0x380a, 0x04}, - {0x380b, 0x00}, - {0x380c, 0x0b}, - {0x380d, 0x1c}, - {0x380e, 0x07}, - {0x380f, 0xb0}, - {0x3813, 0x04}, - {0x3618, 0x04}, - {0x3612, 0x2b}, - {0x3709, 0x12}, - {0x370c, 0x00}, - {0x3a02, 0x07}, - {0x3a03, 0xb0}, - {0x3a0e, 0x06}, - {0x3a0d, 0x08}, - {0x3a14, 0x07}, - {0x3a15, 0xb0}, - {0x4004, 0x06}, - {0x3035, 0x21}, - {0x3036, 0x46}, - {0x4837, 0x2c}, - {0x5001, 0xa3}, -#endif - {SEQUENCE_END, 0x00} -}; -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - {0x3503, 0x00}, - {0x3c07, 0x08}, - {0x3820, 0x41}, - {0x3821, 0x07}, - {0x3814, 0x31}, - {0x3815, 0x31}, - {0x3803, 0x04}, - {0x3806, 0x07},/// - {0x3807, 0x9b}, - {0x3808, 0x03}, - {0x3809, 0x20}, - {0x380a, 0x02}, - {0x380b, 0x58}, - {0x380c, 0x07}, - {0x380d, 0x68}, - {0x380e, 0x03}, - {0x380f, 0xd8}, - {0x3813, 0x06}, - {0x3618, 0x00}, - {0x3612, 0x29}, - {0x3709, 0x52}, - {0x370c, 0x03}, - {0x3a02, 0x03}, - {0x3a03, 0xd8}, - {0x3a08 ,0x01},/// - {0x3a09, 0x27},/// - {0x3a0a, 0x00},/// - {0x3a0b, 0xf6},/// - {0x3a0e, 0x03}, - {0x3a0d, 0x04}, - {0x3a14, 0x03}, - {0x3a15, 0xd8}, - {0x4004, 0x02}, - {0x3002, 0x1c},//// - {0x4713, 0x03},//// - {0x3035, 0x21}, - {0x3036, 0x46}, - {0x4837, 0x22}, - {0x3824, 0x02},//// - {0x5001, 0xa3}, - {SEQUENCE_END, 0x00} -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - - {SEQUENCE_END, 0x00} -}; -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - - {SEQUENCE_END, 0x00} -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - - {SEQUENCE_END, 0x00} -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - - {SEQUENCE_END, 0x00} -}; -#endif -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {0x4300,0x30}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {0x4300,0x32}, - {SEQUENCE_END, 0x00} -}; - - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0x3406 ,0x00}, - {0x5192 ,0x04}, - {0x5191 ,0xf8}, - {0x5193 ,0x70}, - {0x5194 ,0xf0}, - {0x5195 ,0xf0}, - {0x518d ,0x3d}, - {0x518f ,0x54}, - {0x518e ,0x3d}, - {0x5190 ,0x54}, - {0x518b ,0xa8}, - {0x518c ,0xa8}, - {0x5187 ,0x18}, - {0x5188 ,0x18}, - {0x5189 ,0x6e}, - {0x518a ,0x68}, - {0x5186 ,0x1c}, - {0x5181 ,0x50}, - {0x5184 ,0x25}, - {0x5182 ,0x11}, - {0x5183 ,0x14}, - {0x5184 ,0x25}, - {0x5185 ,0x24}, - {SEQUENCE_END, 0x00} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0x3406 ,0x1 }, - {0x3400 ,0x6 }, - {0x3401 ,0x48}, - {0x3402 ,0x4 }, - {0x3403 ,0x0 }, - {0x3404 ,0x4 }, - {0x3405 ,0xd3 }, - {SEQUENCE_END, 0x00} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - {0x3406 ,0x1 }, - {0x3400 ,0x6 }, - {0x3401 ,0x1c}, - {0x3402 ,0x4 }, - {0x3403 ,0x0 }, - {0x3404 ,0x4 }, - {0x3405 ,0xf3}, - {SEQUENCE_END, 0x00} -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - {0x3406 ,0x1 }, - {0x3400 ,0x5 }, - {0x3401 ,0x48}, - {0x3402 ,0x4 }, - {0x3403 ,0x0 }, - {0x3404 ,0x7 }, - {0x3405 ,0xcf}, - {SEQUENCE_END, 0x00} -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - {0x3406 ,0x1 }, - {0x3400 ,0x4 }, - {0x3401 ,0x10}, - {0x3402 ,0x4 }, - {0x3403 ,0x0 }, - {0x3404 ,0x8 }, - {0x3405 ,0xb6}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Brightness1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Brightness3[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Brightness4[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x5001, 0x7f}, - {0x5580, 0x00}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Effect_WandB[] = -{ - {0x5001, 0xff}, - {0x5580, 0x18}, - {0x5583, 0x80}, - {0x5584, 0x80}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x5001, 0xff}, - {0x5580, 0x18}, - {0x5583, 0x40}, - {0x5584, 0xa0}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - //Negative - {0x5001, 0xff}, - {0x5580, 0x40}, - {SEQUENCE_END, 0x00} -};static struct reginfo sensor_Effect_Bluish[] = -{ - // Bluish - {0x5001, 0xff}, - {0x5580, 0x18}, - {0x5583, 0xa0}, - {0x5584, 0x40}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish - {0x5001, 0xff}, - {0x5580, 0x18}, - {0x5583, 0x60}, - {0x5584, 0x60}, - {SEQUENCE_END, 0x00} -}; -/*static struct reginfo sensor_Effect_Reddish[] = -{ - // Greenish - {0x5001, 0xff}, - {0x5580, 0x18}, - {0x5583, 0x80}, - {0x5584, 0xc0}, - {SEQUENCE_END, 0x00} -};*/ - -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - {0x3a0f, 0x10}, - {0x3a10, 0x08}, - {0x3a1b, 0x10}, - {0x3a1e, 0x08}, - {0x3a11, 0x20}, - {0x3a1f, 0x10}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Exposure1[]= -{ - {0x3a0f, 0x20}, - {0x3a10, 0x18}, - {0x3a11, 0x41}, - {0x3a1b, 0x20}, - {0x3a1e, 0x18}, - {0x3a1f, 0x10}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Exposure2[]= -{ - {0x3a0f, 0x30}, - {0x3a10, 0x28}, - {0x3a11, 0x61}, - {0x3a1b, 0x30}, - {0x3a1e, 0x28}, - {0x3a1f, 0x10}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - {0x3a0f, 0x38}, - {0x3a10, 0x30}, - {0x3a11, 0x61}, - {0x3a1b, 0x38}, - {0x3a1e, 0x30}, - {0x3a1f, 0x10}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Exposure4[]= -{ - {0x3a0f, 0x40}, - {0x3a10, 0x38}, - {0x3a11, 0x71}, - {0x3a1b, 0x40}, - {0x3a1e, 0x38}, - {0x3a1f, 0x10}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Exposure5[]= -{ - {0x3a0f, 0x50}, - {0x3a10, 0x48}, - {0x3a11, 0x90}, - {0x3a1b, 0x50}, - {0x3a1e, 0x48}, - {0x3a1f, 0x20}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Exposure6[]= -{ - {0x3a0f, 0x60}, - {0x3a10, 0x58}, - {0x3a11, 0xa0}, - {0x3a1b, 0x60}, - {0x3a1e, 0x58}, - {0x3a1f, 0x20}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {SEQUENCE_END, 0x00} -};static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Contrast2[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - {SEQUENCE_END, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_MirrorOff[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ - {0x3a00 , 0x78}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_SceneNight[] = -{ - //15fps ~ 3.75fps night mode for 60/50Hz light environment, 24Mhz clock input,24Mzh pclk - {0x3034 ,0x1a}, - {0x3035 ,0x21}, - {0x3036 ,0x46}, - {0x3037 ,0x13}, - {0x3038 ,0x00}, - {0x3039 ,0x00}, - {0x3a00 ,0x7c}, - {0x3a08 ,0x01}, - {0x3a09 ,0x27}, - {0x3a0a ,0x00}, - {0x3a0b ,0xf6}, - {0x3a0d ,0x04}, - {0x3a0e ,0x04}, - {0x3a02 ,0x0b}, - {0x3a03 ,0x88}, - {0x3a14 ,0x0b}, - {0x3a15 ,0x88}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Zoom1[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Zoom2[] = -{ - {SEQUENCE_END, 0x00} -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL}; -#endif -static const struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - /*{ - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - },*/ - { - .id = V4L2_CID_FOCUSZONE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "FocusZone Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - },{ - .id = V4L2_CID_FOCUS_AUTO, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Focus Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #if CONFIG_SENSOR_FocusContinues - { - .id = V4L2_CID_FOCUS_CONTINUOUS, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Focus Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_deactivate(struct i2c_client *client); -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf); -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; -enum sensor_wq_cmd -{ - WqCmd_af_init, - WqCmd_af_single, - WqCmd_af_special_pos, - WqCmd_af_far_pos, - WqCmd_af_near_pos, - WqCmd_af_continues, - WqCmd_af_return_idle, -}; -enum sensor_wq_result -{ - WqRet_success = 0, - WqRet_fail = -1, - WqRet_inval = -2 -}; -struct sensor_work -{ - struct i2c_client *client; - struct delayed_work dwork; - enum sensor_wq_cmd cmd; - wait_queue_head_t done; - enum sensor_wq_result result; - bool wait; - int var; - int zone_center_pos[2]; -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int auto_focus; - int affm_reinit; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - struct reginfo *winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int enable; - unsigned int funmodule_state; -} sensor_info_priv_t; - - - -struct sensor_parameter -{ - unsigned short int preview_maxlines; - unsigned int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int capture_framerate; - unsigned short int preview_framerate; - char awb[6]; -}; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - struct sensor_parameter parameter; - struct workqueue_struct *sensor_wq; - struct mutex wq_lock; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - - -#if CONFIG_SENSOR_WRITE_REGS -static int sensor_write_regs(struct i2c_client *client, u8 *reg_info, int num) -{ - int err=0,cnt; - struct i2c_msg msg[1]; - - msg->len = num; - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = reg_info; - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - - cnt= 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg failed, try to write again!\n", SENSOR_NAME_STRING()); - udelay(10); - } - } - - return err; - -} - -#endif - - - - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, u16 reg, u8 val) -{ - int err,cnt; - u8 buf[3]; - struct i2c_msg msg[1]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - buf[2] = val; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u16 reg, u8 *val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[2]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_Focus - struct sensor *sensor = to_sensor(client); -#endif -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif -#if CONFIG_SENSOR_WRITE_REGS - int j = 0, reg_num; - u8 *ptemp, *phead; - int reg_length; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - while (regarray[i].reg != SEQUENCE_END) { - #if CONFIG_SENSOR_Focus - if ((regarray == sensor_af_firmware) && (sensor->info_priv.enable == 0)) { - SENSOR_DG("%s disable, Download af firmware terminated!\n",SENSOR_NAME_STRING()); - err = -EINVAL; - goto sensor_write_array_end; - } - #endif - -#if CONFIG_SENSOR_WRITE_REGS - - j = i; - reg_num = 2; - reg_length = 0x0001; - - while((regarray[i].reg + reg_length) == regarray[i+1].reg) { - i++; - reg_num++; - if(reg_num >= WRITE_REGS_NUM) - break; - } - - if(reg_num > 2) { - - int size_num; - size_num = reg_num + 1; - - ptemp = phead = (u8*)kmalloc((size_num+10)*sizeof(u8),GFP_KERNEL); - if (!phead) { - SENSOR_DG("-------------write registers allocate memory fail!!!\n"); - i = j; - err = sensor_write(client, regarray[i].reg, regarray[i].val); - } else { - *phead = regarray[j].reg >> 8; - *(ptemp+1) = regarray[j].reg & 0xFF; - ptemp += 2; - for( ; reg_num > 0; reg_num --, j++) { - *ptemp ++ = regarray[j].val; - } - - ptemp = phead; - err = sensor_write_regs(client, ptemp,size_num); - kfree(phead); - } - }else{ - err = sensor_write(client, regarray[i].reg, regarray[i].val); - } -#else - err = sensor_write(client, regarray[i].reg, regarray[i].val); -#endif - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - i++; - } - - #if CONFIG_SENSOR_Focus - if (((regarray->reg == SEQUENCE_PROPERTY) && (regarray->val == SEQUENCE_INIT)) - || (regarray == sensor_init_data)) { - sensor->info_priv.affm_reinit = 1; - } - #endif - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != 0) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif -#if CONFIG_SENSOR_Focus -struct af_cmdinfo -{ - char cmd_tag; - char cmd_para[4]; - char validate_bit; -}; -static int sensor_af_cmdset(struct i2c_client *client, int cmd_main, struct af_cmdinfo *cmdinfo) -{ - int i; - char read_tag=0xff,cnt; - - if (cmdinfo) { - for (i=0; i<4; i++) { - if (cmdinfo->validate_bit & (1<cmd_para[i])) { - SENSOR_TR("%s write CMD_PARA_Reg(main:0x%x para%d:0x%x) error!\n",SENSOR_NAME_STRING(),cmd_main,i,cmdinfo->cmd_para[i]); - goto sensor_af_cmdset_err; - } - SENSOR_DG("%s write CMD_PARA_Reg(main:0x%x para%d:0x%x) success!\n",SENSOR_NAME_STRING(),cmd_main,i,cmdinfo->cmd_para[i]); - } - } - - if (cmdinfo->validate_bit & 0x80) { - if (sensor_write(client, CMD_ACK_Reg, cmdinfo->cmd_tag)) { - SENSOR_TR("%s write CMD_ACK_Reg(main:0x%x tag:0x%x) error!\n",SENSOR_NAME_STRING(),cmd_main,cmdinfo->cmd_tag); - goto sensor_af_cmdset_err; - } - SENSOR_DG("%s write CMD_ACK_Reg(main:0x%x tag:0x%x) success!\n",SENSOR_NAME_STRING(),cmd_main,cmdinfo->cmd_tag); - } - - } else { - if (sensor_write(client, CMD_ACK_Reg, 0x01)) { - SENSOR_TR("%s write CMD_ACK_Reg(main:0x%x no tag) error!\n",SENSOR_NAME_STRING(),cmd_main); - goto sensor_af_cmdset_err; - } - SENSOR_DG("%s write CMD_ACK_Reg(main:0x%x no tag) success!\n",SENSOR_NAME_STRING(),cmd_main); - } - - if (sensor_write(client, CMD_MAIN_Reg, cmd_main)) { - SENSOR_TR("%s write CMD_MAIN_Reg(main:0x%x) error!\n",SENSOR_NAME_STRING(),cmd_main); - goto sensor_af_cmdset_err; - } - - cnt = 0; - do - { - msleep(5); - if (sensor_read(client,CMD_ACK_Reg,&read_tag)){ - SENSOR_TR("%s[%d] read TAG failed\n",SENSOR_NAME_STRING(),__LINE__); - break; - } - } while((read_tag != 0x00)&& (cnt++<100)); - - SENSOR_DG("%s write CMD_MAIN_Reg(main:0x%x read tag:0x%x) success!\n",SENSOR_NAME_STRING(),cmd_main,read_tag); - return 0; -sensor_af_cmdset_err: - return -1; -} - -static int sensor_af_idlechk(struct i2c_client *client) -{ - int ret = 0; - char state; - struct af_cmdinfo cmdinfo; - - SENSOR_DG("%s , %d\n",__FUNCTION__,__LINE__); - - cmdinfo.cmd_tag = 0x01; - cmdinfo.validate_bit = 0x80; - ret = sensor_af_cmdset(client, ReturnIdle_Cmd, &cmdinfo); - if(0 != ret) { - SENSOR_TR("%s[%d] read focus_status failed\n",SENSOR_NAME_STRING(),__LINE__); - ret = -1; - goto sensor_af_idlechk_end; - } - - - do{ - ret = sensor_read(client, CMD_ACK_Reg, &state); - if (ret != 0){ - SENSOR_TR("%s[%d] read focus_status failed\n",SENSOR_NAME_STRING(),__LINE__); - ret = -1; - goto sensor_af_idlechk_end; - } - }while(0x00 != state); - - -sensor_af_idlechk_end: - return ret; -} -static int sensor_af_touch_zone(struct i2c_client *client, int *zone_center_pos) -{ - int ret = 0; - struct af_cmdinfo cmdinfo; - - cmdinfo.cmd_tag = 0x01; - cmdinfo.validate_bit = 0x83; - if (zone_center_pos[0]<=8) - cmdinfo.cmd_para[0] = 0; - else if ((zone_center_pos[0]>8) && (zone_center_pos[0]<72)) - cmdinfo.cmd_para[0] = zone_center_pos[0]-8; - else - cmdinfo.cmd_para[0] = 72; - - if (zone_center_pos[1]<=6) - cmdinfo.cmd_para[1] = 0; - else if ((zone_center_pos[1]>6) && (zone_center_pos[1]<54)) - cmdinfo.cmd_para[1] = zone_center_pos[1]-6; - else - cmdinfo.cmd_para[1] = 54; - - ret = sensor_af_cmdset(client, TouchZoneConfig_Cmd, &cmdinfo); - if(0 != ret) { - SENSOR_TR("%s touch zone config error!\n",SENSOR_NAME_STRING()); - ret = -1; - goto sensor_af_zone_end; - } -sensor_af_zone_end: - return ret; -} -static int sensor_af_single(struct i2c_client *client) -{ - int ret = 0; - char state,cnt; - struct af_cmdinfo cmdinfo; - char s_zone[5],i; - - cmdinfo.cmd_tag = 0x01; - cmdinfo.validate_bit = 0x80; - ret = sensor_af_cmdset(client, SingleFocus_Cmd, &cmdinfo); - if(0 != ret) { - SENSOR_TR("%s single focus mode set error!\n",SENSOR_NAME_STRING()); - ret = -1; - goto sensor_af_single_end; - } - - cnt = 0; - do - { - if (cnt != 0) { - msleep(1); - } - cnt++; - ret = sensor_read(client, STA_FOCUS_Reg, &state); - if (ret != 0){ - SENSOR_TR("%s[%d] read focus_status failed\n",SENSOR_NAME_STRING(),__LINE__); - ret = -1; - goto sensor_af_single_end; - } - }while((state == S_FOCUSING) && (cnt<100)); - - if (state != S_FOCUSED) { - SENSOR_TR("%s[%d] focus state(0x%x) is error!\n",SENSOR_NAME_STRING(),__LINE__,state); - ret = -1; - goto sensor_af_single_end; - } else { - SENSOR_DG("%s[%d] single focus mode set success!\n",SENSOR_NAME_STRING(),__LINE__); - } -sensor_af_single_end: - return ret; -} - -static int sensor_af_const(struct i2c_client *client) -{ - int ret = 0; - struct af_cmdinfo cmdinfo; - - - cmdinfo.cmd_tag = 0x01; - cmdinfo.cmd_para[0] = 0x00; - cmdinfo.validate_bit = 0x81; - - if (sensor_af_cmdset(client, ConstFocus_Cmd, &cmdinfo)) { - SENSOR_TR("%s[%d] const focus mode set error!\n",SENSOR_NAME_STRING(),__LINE__); - ret = -1; - goto sensor_af_const_end; - } else { - SENSOR_DG("%s[%d] const focus mode set success!\n",SENSOR_NAME_STRING(),__LINE__); - } -sensor_af_const_end: - return ret; -} -static int sensor_af_pause2capture(struct i2c_client *client) -{ - int ret = 0; - - if (sensor_af_cmdset(client, PauseFocus_Cmd, NULL)) { - SENSOR_TR("%s pause focus mode set error!\n",SENSOR_NAME_STRING()); - ret = -1; - goto sensor_af_pause_end; - } -sensor_af_pause_end: - return ret; -} - -static int sensor_af_init(struct i2c_client *client) -{ - int ret = 0, cnt; - char state; - - ret = sensor_write_array(client, sensor_af_firmware); - if (ret != 0) { - SENSOR_TR("%s Download firmware failed\n",SENSOR_NAME_STRING()); - ret = -1; - goto sensor_af_init_end; - } - - cnt = 0; - do - { - msleep(1); - if (cnt++ > 500) - break; - ret = sensor_read(client, STA_FOCUS_Reg, &state); - if (ret != 0){ - SENSOR_TR("%s[%d] read focus_status failed\n",SENSOR_NAME_STRING(),__LINE__); - ret = -1; - goto sensor_af_init_end; - } - } while (state != S_IDLE); - - if (state != S_IDLE) { - SENSOR_TR("%s focus state(0x%x) is error!\n",SENSOR_NAME_STRING(),state); - ret = -1; - goto sensor_af_init_end; - } - -sensor_af_init_end: - SENSOR_DG("%s %s ret:0x%x \n",SENSOR_NAME_STRING(),__FUNCTION__,ret); - return ret; -} - -static int sensor_af_downfirmware(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - int ret=0; - struct soc_camera_device *icd = client->dev.platform_data; - struct v4l2_mbus_framefmt mf; - - SENSOR_DG("%s %s Enter\n",SENSOR_NAME_STRING(), __FUNCTION__); - - if (sensor_af_init(client)) { - sensor->info_priv.funmodule_state &= (~SENSOR_AF_IS_OK); - ret = -1; - } else { - sensor->info_priv.funmodule_state |= SENSOR_AF_IS_OK; - - mf.width = icd->user_width; - mf.height = icd->user_height; - mf.code = sensor->info_priv.fmt.code; - mf.colorspace = sensor->info_priv.fmt.colorspace; - mf.field = V4L2_FIELD_NONE; - if (sensor_fmt_videochk(NULL, &mf) == true) { /* ddl@rock-chips.com: focus mode fix const auto focus in video */ - ret = sensor_af_const(client); - } else { - switch (sensor->info_priv.auto_focus) - { - case SENSOR_AF_MODE_AUTO: - { - ret = sensor_af_single(client); - break; - } - case SENSOR_AF_MODE_CLOSE: - { - ret = 0; - break; - } - case SENSOR_AF_MODE_CONTINUOUS: - { - ret = sensor_af_const(client); - break; - } - default: - { - SENSOR_DG("%s focus mode(0x%x) is unkonwn\n",SENSOR_NAME_STRING(),sensor->info_priv.auto_focus); - goto sensor_af_downfirmware_end; - } - } - } - SENSOR_DG("%s sensor_af_downfirmware set focus mode(0x%x) ret:0x%x\n",SENSOR_NAME_STRING(), sensor->info_priv.auto_focus,ret); - } - -sensor_af_downfirmware_end: - - return ret; -} -static void sensor_af_workqueue(struct work_struct *work) -{ - struct sensor_work *sensor_work = container_of(work, struct sensor_work, dwork.work); - struct i2c_client *client = sensor_work->client; - struct sensor *sensor = to_sensor(client); - struct af_cmdinfo cmdinfo; - - SENSOR_DG("%s %s Enter, cmd:0x%x \n",SENSOR_NAME_STRING(), __FUNCTION__,sensor_work->cmd); - - mutex_lock(&sensor->wq_lock); - - switch (sensor_work->cmd) - { - case WqCmd_af_init: - { - if (sensor_af_downfirmware(client) < 0) { - SENSOR_TR("%s Sensor_af_init is failed in sensor_af_workqueue!\n",SENSOR_NAME_STRING()); - } - break; - } - case WqCmd_af_single: - { - if ((sensor_work->zone_center_pos[0] >=0) && (sensor_work->zone_center_pos[1]>=0)) - sensor_af_touch_zone(client,sensor_work->zone_center_pos); - - if (sensor_af_single(client) < 0) { - SENSOR_TR("%s Sensor_af_single is failed in sensor_af_workqueue!\n",SENSOR_NAME_STRING()); - sensor_work->result = WqRet_fail; - } else { - sensor_work->result = WqRet_success; - } - break; - } - case WqCmd_af_special_pos: - { - sensor_af_idlechk(client); - - cmdinfo.cmd_tag = StepFocus_Spec_Tag; - cmdinfo.cmd_para[0] = sensor_work->var; - cmdinfo.validate_bit = 0x81; - if (sensor_af_cmdset(client, StepMode_Cmd, &cmdinfo) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_near_pos: - { - sensor_af_idlechk(client); - cmdinfo.cmd_tag = StepFocus_Near_Tag; - cmdinfo.validate_bit = 0x80; - if (sensor_af_cmdset(client, StepMode_Cmd, &cmdinfo) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_far_pos: - { - sensor_af_idlechk(client); - cmdinfo.cmd_tag = StepFocus_Far_Tag; - cmdinfo.validate_bit = 0x80; - if (sensor_af_cmdset(client, StepMode_Cmd, &cmdinfo) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_continues: - { - if (sensor_af_const(client) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_return_idle: - { - if (sensor_af_idlechk(client) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - default: - SENSOR_TR("Unknow command(%d) in %s af workqueue!",sensor_work->cmd,SENSOR_NAME_STRING()); - break; - } -set_end: - if (sensor_work->wait == false) { - kfree((void*)sensor_work); - } else { - wake_up(&sensor_work->done); - } - mutex_unlock(&sensor->wq_lock); - return; -} - -static int sensor_af_workqueue_set(struct soc_camera_device *icd, enum sensor_wq_cmd cmd, int var, bool wait, int *zone_pos) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - struct sensor_work *wk; - int ret=0; - - if (sensor->sensor_wq == NULL) { - ret = -EINVAL; - goto sensor_af_workqueue_set_end; - } - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) != SENSOR_AF_IS_OK) { - if (cmd != WqCmd_af_init) { - SENSOR_TR("%s %s cmd(%d) ingore,because af module isn't ready!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - ret = -1; - goto sensor_af_workqueue_set_end; - } - } - - wk = kzalloc(sizeof(struct sensor_work), GFP_KERNEL); - if (wk) { - wk->client = client; - INIT_DELAYED_WORK(&wk->dwork, sensor_af_workqueue); - wk->cmd = cmd; - wk->result = WqRet_inval; - wk->wait = wait; - wk->var = var; - - if (zone_pos) { - if (*zone_pos || *(zone_pos+1) || *(zone_pos+2) || *(zone_pos+3)) { - *zone_pos += 1000; - *(zone_pos+1) += 1000; - *(zone_pos+2) += 1000; - *(zone_pos+3) += 1000; - wk->zone_center_pos[0] = ((*zone_pos + *(zone_pos+2))>>1)*80/2000; - wk->zone_center_pos[1] = ((*(zone_pos+1) + *(zone_pos+3))>>1)*60/2000; - } else { - #if CONFIG_SENSOR_FocusCenterInCapture - wk->zone_center_pos[0] = 32; - wk->zone_center_pos[1] = 24; - #else - wk->zone_center_pos[0] = -1; - wk->zone_center_pos[1] = -1; - #endif - } - } - - init_waitqueue_head(&wk->done); - - /* ddl@rock-chips.com: - * video_lock is been locked in v4l2_ioctl function, but auto focus may slow, - * As a result any other ioctl calls will proceed very, very slowly since each call - * will have to wait for the AF to finish. Camera preview is pause,because VIDIOC_QBUF - * and VIDIOC_DQBUF is sched. so unlock video_lock here. - */ - if (wait == true) { - queue_delayed_work(sensor->sensor_wq,&(wk->dwork),0); - mutex_unlock(&icd->video_lock); - if (wait_event_timeout(wk->done, (wk->result != WqRet_inval), msecs_to_jiffies(5000)) == 0) { //hhb - SENSOR_TR("%s %s cmd(%d) is timeout!\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - } - ret = wk->result; - kfree((void*)wk); - mutex_lock(&icd->video_lock); - } else { - queue_delayed_work(sensor->sensor_wq,&(wk->dwork),msecs_to_jiffies(10)); - } - - } else { - SENSOR_TR("%s %s cmd(%d) ingore,because struct sensor_work malloc failed!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - ret = -1; - } -sensor_af_workqueue_set_end: - return ret; -} -#endif -static int sensor_parameter_record(struct i2c_client *client) -{ - u8 ret_l,ret_m,ret_h; - int tp_l,tp_m,tp_h; - struct sensor *sensor = to_sensor(client); - - sensor_read(client,0x3a00, &ret_l); - sensor_write(client,0x3a00, ret_l&0xfb); - - sensor_write(client,0x3503,0x07); //stop AE/AG - sensor_read(client,0x3406, &ret_l); - sensor_write(client,0x3406, ret_l|0x01); - - sensor_read(client,0x3500,&ret_h); - sensor_read(client,0x3501, &ret_m); - sensor_read(client,0x3502, &ret_l); - tp_l = ret_l; - tp_m = ret_m; - tp_h = ret_h; - sensor->parameter.preview_exposure = ((tp_h<<12) & 0xF000) | ((tp_m<<4) & 0x0FF0) | ((tp_l>>4) & 0x0F); - - //Read back AGC Gain for preview - sensor_read(client,0x350b, &ret_l); - sensor->parameter.preview_gain = ret_l; - - SENSOR_DG(" %s Read 0x350b=0x%02x PreviewExposure:%d 0x3500=0x%02x 0x3501=0x%02x 0x3502=0x%02x \n", - SENSOR_NAME_STRING(), tp_l,sensor->parameter.preview_exposure,tp_h, tp_m, tp_l); - return 0; -} -#define OV5640_FULL_PERIOD_PIXEL_NUMS_HTS (2844) -#define OV5640_FULL_PERIOD_LINE_NUMS_VTS (1968) -#define OV5640_PV_PERIOD_PIXEL_NUMS_HTS (1896) -#define OV5640_PV_PERIOD_LINE_NUMS_VTS (984) -static int sensor_ae_transfer(struct i2c_client *client) -{ - u8 ExposureLow; - u8 ExposureMid; - u8 ExposureHigh; - u16 ulCapture_Exposure; - u16 Preview_Maxlines; - u8 Gain; - u16 OV5640_g_iExtra_ExpLines; - struct sensor *sensor = to_sensor(client); - - //Preview_Maxlines = sensor->parameter.preview_line_width; - Preview_Maxlines = sensor->parameter.preview_maxlines; - Gain = sensor->parameter.preview_gain; - - - ulCapture_Exposure = (sensor->parameter.preview_exposure*OV5640_PV_PERIOD_PIXEL_NUMS_HTS)/OV5640_FULL_PERIOD_PIXEL_NUMS_HTS; - - SENSOR_DG("cap shutter calutaed = %d, 0x%x\n", ulCapture_Exposure,ulCapture_Exposure); - - // write the gain and exposure to 0x350* registers - sensor_write(client,0x350b, Gain); - - if (ulCapture_Exposure <= 1940) { - OV5640_g_iExtra_ExpLines = 0; - }else { - OV5640_g_iExtra_ExpLines = ulCapture_Exposure - 1940; - } - SENSOR_DG("Set Extra-line = %d, iExp = %d \n", OV5640_g_iExtra_ExpLines, ulCapture_Exposure); - - ExposureLow = (ulCapture_Exposure<<4)&0xff; - ExposureMid = (ulCapture_Exposure>>4)&0xff; - ExposureHigh = (ulCapture_Exposure>>12); - - sensor_write(client,0x350c, (OV5640_g_iExtra_ExpLines&0xff00)>>8); - sensor_write(client,0x350d, OV5640_g_iExtra_ExpLines&0xff); - sensor_write(client,0x3502, ExposureLow); - sensor_write(client,0x3501, ExposureMid); - sensor_write(client,0x3500, ExposureHigh); - - SENSOR_DG(" %s Write 0x350b=0x%02x 0x350c=0x%2x 0x350d=0x%2x 0x3502=0x%02x 0x3501=0x%02x 0x3500=0x%02x\n",SENSOR_NAME_STRING(), Gain, ExposureLow, ExposureMid, ExposureHigh); - mdelay(100); - return 0; -} - -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on == Flash_On){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),cmd); - break; - } - } - -sensor_power_end: - return ret; -} - -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} - -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - char value; - int ret,pid = 0; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - ret = sensor_write(client, 0x3008, 0x80); - if (ret != 0) { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); //delay 5 microseconds - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x300a, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value << 8); - - ret = sensor_read(client, 0x300b, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x \n", SENSOR_NAME_STRING(), pid); - - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - ret = sensor_write_array(client, sensor_init_data); - udelay(1000); //wait sensor power on,so that I2C write sensor registers would sucess hhb@rock-chips.con - - if (ret != 0) { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - sensor->info_priv.winseqe_cur_addr = SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - - sensor->info_priv.funmodule_state = SENSOR_INIT_IS_OK; - - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - if (sensor->info_priv.funmodule_state & SENSOR_INIT_IS_OK) { - sensor_task_lock(client, 1); - sensor_write(client, 0x3017, 0x00); // FREX,VSYNC,HREF,PCLK,D9-D6 - sensor_write(client, 0x3018, 0x03); // D5-D0 - sensor_write(client,0x3019,0x00); // STROBE,SDA - sensor_task_lock(client, 0); - } - sensor_ioctrl(icd, Sensor_PowerDown, 1); - msleep(100); - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - return 0; -} - -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00} -}; - -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - return 0; -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static int sensor_s_fmt(struct v4l2_subdev *sd,struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - int ret = 0, set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && (sensor_svga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_svga; - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1024) && (set_h <= 768)) && (sensor_xga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_xga; - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 720)) && (sensor_720p[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_720p; - set_w = 1280; - set_h = 720; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_sxga; - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_uxga; - set_w = 1600; - set_h = 1200; - } - else if (((set_w <= 1920) && (set_h <= 1080)) && (sensor_1080p[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_1080p; - set_w = 1920; - set_h = 1080; - } - else if (((set_w <= 2048) && (set_h <= 1536)) && (sensor_qxga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_qxga; - set_w = 2048; - set_h = 1536; - } - else if (((set_w <= 2592) && (set_h <= 1944)) && (sensor_qsxga[0].reg!=SEQUENCE_END)) - { - winseqe_set_addr = sensor_qsxga; - set_w = 2592; - set_h = 1944; - } - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if (winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) - { - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - sensor_parameter_record(client); - #if CONFIG_SENSOR_Focus - if (sensor->info_priv.auto_focus == SENSOR_AF_MODE_CONTINUOUS) - sensor_af_pause2capture(client); - #endif - #if CONFIG_SENSOR_Flash - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - #endif - }else { /* ddl@rock-chips.com : Video */ - #if CONFIG_SENSOR_Flash - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - #endif - } - if ((sensor->info_priv.winseqe_cur_addr->reg == SEQUENCE_PROPERTY) && (sensor->info_priv.winseqe_cur_addr->val == SEQUENCE_INIT)) { - if (((winseqe_set_addr->reg == SEQUENCE_PROPERTY) && (winseqe_set_addr->val == SEQUENCE_NORMAL)) - || (winseqe_set_addr->reg != SEQUENCE_PROPERTY)) { - ret |= sensor_write_array(client,sensor_init_data); - udelay(1000); //wait sensor power on,so that I2C write sensor registers would sucess hhb@rock-chips.con - SENSOR_DG("\n%s reinit ret:0x%x \n",SENSOR_NAME_STRING(), ret); - } - } - - if ((winseqe_set_addr == sensor_qsxga) && (sensor->info_priv.winseqe_cur_addr == sensor_720p)) { - sensor_write_array(client, sensor_svga); - } - - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - sensor->info_priv.winseqe_cur_addr = winseqe_set_addr; - - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - sensor_ae_transfer(client); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - if (sensor->info_priv.whiteBalance != 0) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - sensor->info_priv.snap2preview = true; - } else if (sensor_fmt_videochk(sd,mf) == true) { /* ddl@rock-chips.com : Video */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - - sensor->info_priv.video2preview = true; - } else if ((sensor->info_priv.snap2preview == true) || (sensor->info_priv.video2preview == true)) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - if (sensor->info_priv.snap2preview == true) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - #if CONFIG_SENSOR_Focus - if (sensor->info_priv.auto_focus == SENSOR_AF_MODE_CLOSE) { - msleep(500); - } else { - sensor_af_workqueue_set(icd,WqCmd_af_return_idle,0,false,NULL); - if (sensor->info_priv.auto_focus == SENSOR_AF_MODE_CONTINUOUS) { - sensor_af_workqueue_set(icd,WqCmd_af_continues,0,false,NULL); - } - - msleep(300); - } - #else - msleep(500); - #endif - sensor->info_priv.video2preview = false; - sensor->info_priv.snap2preview = false; - } - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - mf->width = set_w; - mf->height = set_h; -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg!=SEQUENCE_END)) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg!=SEQUENCE_END)) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=SEQUENCE_END)) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=SEQUENCE_END)) - { - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && (sensor_svga[0].reg!=SEQUENCE_END)) - { - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1024) && (set_h <= 768)) && (sensor_xga[0].reg!=SEQUENCE_END)) - { - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 720)) && (sensor_720p[0].reg!=SEQUENCE_END)) - { - set_w = 1280; - set_h = 720; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=SEQUENCE_END)) - { - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=SEQUENCE_END)) - { - set_w = 1600; - set_h = 1200; - } - else if (((set_w <= 1920) && (set_h <= 1080)) && (sensor_1080p[0].reg!=SEQUENCE_END)) - { - set_w = 1920; - set_h = 1080; - } - else if (((set_w <= 2048) && (set_h <= 1536)) && (sensor_qxga[0].reg!=SEQUENCE_END)) - { - set_w = 2048; - set_h = 1536; - } - else if (((set_w <= 2592) && (set_h <= 1944)) && (sensor_qsxga[0].reg!=SEQUENCE_END)) - { - set_w = 2592; - set_h = 1944; - } - else - { - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - - mf->width = set_w; - mf->height = set_h; - - mf->colorspace = fmt->colorspace; - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV2655 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n%s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((*value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value > 0) && ((digitalzoom_cur + *value) > digitalzoom_total)) - { - *value = digitalzoom_total - digitalzoom_cur; - } - - if ((*value < 0) && ((digitalzoom_cur + *value) < 0)) - { - *value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += *value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, *value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Focus -static int sensor_set_focus_absolute(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int ret = 0; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (!qctrl_info) - return -EINVAL; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - if ((value >= qctrl_info->minimum) && (value <= qctrl_info->maximum)) { - ret = sensor_af_workqueue_set(icd, WqCmd_af_special_pos, value, true,NULL); - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EINVAL; - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - } - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - - return ret; -} -static int sensor_set_focus_relative(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int ret = 0; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_RELATIVE); - if (!qctrl_info) - return -EINVAL; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - if ((value >= qctrl_info->minimum) && (value <= qctrl_info->maximum)) { - if (value > 0) { - ret = sensor_af_workqueue_set(icd, WqCmd_af_near_pos, 0, true,NULL); - } else { - ret = sensor_af_workqueue_set(icd, WqCmd_af_far_pos, 0, true,NULL); - } - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EINVAL; - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - } - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - return ret; -} - -static int sensor_set_focus_mode(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value, int *zone_pos) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int ret = 0; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - switch (value) - { - case SENSOR_AF_MODE_AUTO: - { - ret = sensor_af_workqueue_set(icd, WqCmd_af_single, 0, true, zone_pos); - break; - } - - /*case SENSOR_AF_MODE_MACRO: - { - ret = sensor_set_focus_absolute(icd, qctrl, 0xff); - break; - } - - case SENSOR_AF_MODE_INFINITY: - { - ret = sensor_set_focus_absolute(icd, qctrl, 0x00); - break; - } - */ - case SENSOR_AF_MODE_CONTINUOUS: - { - ret = sensor_af_workqueue_set(icd, WqCmd_af_continues, 0, true,NULL); - break; - } - default: - SENSOR_TR("\n %s..%s AF value(0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__,value); - break; - - } - - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - - return ret; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %d\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - sensor_set_focus_relative(icd, qctrl,ext_ctrl->value); - break; - } - case V4L2_CID_FOCUS_AUTO: - { - if (ext_ctrl->value) { - if ((ext_ctrl->value==1) || (SENSOR_AF_MODE_AUTO == sensor->info_priv.auto_focus)) { - if (sensor_set_focus_mode(icd, qctrl,SENSOR_AF_MODE_AUTO,ext_ctrl->rect) != 0) { - if(0 == (sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK)) { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_AUTO; - } - return -EINVAL; - } - } - if (ext_ctrl->value == 1) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_AUTO; - } else if (SENSOR_AF_MODE_AUTO == sensor->info_priv.auto_focus){ - if (ext_ctrl->value == 0) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CLOSE; - } - break; - } - case V4L2_CID_FOCUS_CONTINUOUS: - { - if (SENSOR_AF_MODE_CONTINUOUS != sensor->info_priv.auto_focus) { - if (ext_ctrl->value == 1) { - if (sensor_set_focus_mode(icd, qctrl,SENSOR_AF_MODE_CONTINUOUS,NULL) != 0) { - if(0 == (sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK)) { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CONTINUOUS; - } - return -EINVAL; - } - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CONTINUOUS; - } - } else { - if (ext_ctrl->value == 0) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CLOSE; - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_stream(struct v4l2_subdev *sd, int enable) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - #if CONFIG_SENSOR_Focus - struct soc_camera_device *icd = client->dev.platform_data; - struct v4l2_mbus_framefmt mf; - #endif - - if (enable == 1) { - sensor->info_priv.enable = 1; - #if CONFIG_SENSOR_Focus - mf.width = icd->user_width; - mf.height = icd->user_height; - mf.code = sensor->info_priv.fmt.code; - mf.colorspace = sensor->info_priv.fmt.colorspace; - mf.field = V4L2_FIELD_NONE; - /* If auto focus firmware haven't download success, must download firmware again when in video or preview stream on */ - if (sensor_fmt_capturechk(sd, &mf) == false) { - if ((sensor->info_priv.affm_reinit == 1) || ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK)==0)) { - sensor_af_workqueue_set(icd, WqCmd_af_init, 0, false,NULL); - sensor->info_priv.affm_reinit = 0; - } - } - #endif - } else if (enable == 0) { - sensor->info_priv.enable = 0; - #if CONFIG_SENSOR_Focus - flush_workqueue(sensor->sensor_wq); - #endif - } - return 0; -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char value; - int ret,pid = 0; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - /* soft reset */ - ret = sensor_write(client, 0x3008, 0x80); - if (ret != 0) { - SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - mdelay(5); //delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x300a, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid |= (value << 8); - - ret = sensor_read(client, 0x300b, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - return ret; -} -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0,i; - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - #if CONFIG_SENSOR_Flash //hhb - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - #endif - sensor_deactivate(client); - break; - } - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - sensor->sensor_gpio_res = NULL; - for (i=0; isensor_io_request->gpio_res[i].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[i].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[i]; - } - } - if (sensor->sensor_gpio_res == NULL) { - SENSOR_TR("%s %s obtain gpio resource failed when RK29_CAM_SUBDEV_IOREQUEST \n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - printk("flash io:%d\n",sensor->sensor_gpio_res->gpio_flash); - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } - -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, - .s_stream = sensor_s_stream, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - sensor->info_priv.fmt = sensor_colour_fmts[0]; - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } else { - #if CONFIG_SENSOR_Focus - sensor->sensor_wq = create_singlethread_workqueue(SENSOR_NAME_STRING(_af_workqueue)); - if (sensor->sensor_wq == NULL) - SENSOR_TR("%s create fail!", SENSOR_NAME_STRING(_af_workqueue)); - mutex_init(&sensor->wq_lock); - #endif - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - #if CONFIG_SENSOR_Focus - if (sensor->sensor_wq) { - destroy_workqueue(sensor->sensor_wq); - sensor->sensor_wq = NULL; - } - #endif - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - - diff --git a/drivers/media/video/ov5642.c b/drivers/media/video/ov5642.c deleted file mode 100755 index 219e8906bcc9..000000000000 --- a/drivers/media/video/ov5642.c +++ /dev/null @@ -1,6127 +0,0 @@ -/* - * Driver for OV5642 CMOS Image Sensor from OmniVision - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "ov5642.h" - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_OV5642 -#define SENSOR_V4L2_IDENT V4L2_IDENT_OV5642 -#define SENSOR_ID 0x5642 -#define SENSOR_MIN_WIDTH 176 -#define SENSOR_MIN_HEIGHT 144 -#define SENSOR_MAX_WIDTH_REAL 2592 -#define SENSOR_MAX_HEIGHT_REAL 1944 -#if defined(CONFIG_SOC_CAMERA_OV5642_INTERPOLATION_8M) -#define SENSOR_MAX_WIDTH 3264 -#define SENSOR_MAX_HEIGHT 2448 -#else -#define SENSOR_MAX_WIDTH SENSOR_MAX_WIDTH_REAL -#define SENSOR_MAX_HEIGHT SENSOR_MAX_HEIGHT_REAL -#endif -#define SENSOR_INIT_WIDTH sensor_init_width /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT sensor_init_height -#define SENSOR_INIT_WINSEQADR sensor_init_winseq_p -#define SENSOR_INIT_PIXFMT sensor_init_pixelcode -#define SENSOR_BUS_PARAM sensor_init_busparam - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 1 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 1 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 -#ifdef CONFIG_OV5642_AUTOFOCUS -#define CONFIG_SENSOR_Focus 1 -#define CONFIG_SENSOR_FocusContinues 0 -#include "ov5642_af_firmware.c" -#else -#define CONFIG_SENSOR_Focus 0 -#endif - -#define CONFIG_SENSOR_I2C_SPEED 250000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) - -#if CONFIG_SENSOR_Focus -#define SENSOR_AF_MODE_INFINITY 0 -#define SENSOR_AF_MODE_MACRO 1 -#define SENSOR_AF_MODE_FIXED 2 -#define SENSOR_AF_MODE_AUTO 3 -#define SENSOR_AF_MODE_CONTINUOUS 4 -#define SENSOR_AF_MODE_CLOSE 5 -#endif - -#if CONFIG_SENSOR_Focus -/* ov5642 VCM Command and Status Registers */ -#define CMD_MAIN_Reg 0x3024 -#define CMD_TAG_Reg 0x3025 -#define CMD_PARA0_Reg 0x5085 -#define CMD_PARA1_Reg 0x5084 -#define CMD_PARA2_Reg 0x5083 -#define CMD_PARA3_Reg 0x5082 -#define STA_ZONE_Reg 0x3026 -#define STA_FOCUS_Reg 0x3027 - -/* ov5642 VCM Command */ -#define OverlayEn_Cmd 0x01 -#define OverlayDis_Cmd 0x02 -#define SingleFocus_Cmd 0x03 -#define ConstFocus_Cmd 0x04 -#define StepMode_Cmd 0x05 -#define PauseFocus_Cmd 0x06 -#define ReturnIdle_Cmd 0x08 -#define SetZone_Cmd 0x10 -#define UpdateZone_Cmd 0x12 -#define SetMotor_Cmd 0x20 - -/* ov5642 Focus State */ -#define S_FIRWRE 0xFF -#define S_STARTUP 0xfa -#define S_ERROR 0xfe -#define S_DRVICERR 0xee -#define S_IDLE 0x00 -#define S_FOCUSING 0x01 -#define S_FOCUSED 0x02 -#define S_CAPTURE 0x12 -#define S_STEP 0x20 - -/* ov5642 Zone State */ -#define Zone_Is_Focused(a, zone_val) (zone_val&(1<<(a-3))) -#define Zone_Get_ID(zone_val) (zone_val&0x03) - -#define Zone_CenterMode 0x01 -#define Zone_5xMode 0x02 -#define Zone_5PlusMode 0x03 -#define Zone_4fMode 0x04 - -#define ZoneSel_Auto 0x0b -#define ZoneSel_SemiAuto 0x0c -#define ZoneSel_Manual 0x0d -#define ZoneSel_Rotate 0x0e - -/* ov5642 Step Focus Commands */ -#define StepFocus_Near_Tag 0x01 -#define StepFocus_Far_Tag 0x02 -#define StepFocus_Furthest_Tag 0x03 -#define StepFocus_Nearest_Tag 0x04 -#define StepFocus_Spec_Tag 0x10 -#endif - - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); - -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_OV5642_USER_DEFINED_SERIES -#include "ov5642_user_series.c" -#else -/* init 800X600 SVGA */ -static struct reginfo sensor_init_data[] = -{ - {0x3103 , 0x93}, - {0x3008 , 0x82}, - {0x3017 , 0x7f}, - {0x3018 , 0xfc}, - {0x3810 , 0xc2}, - {0x3615 , 0xf0}, - {0x3000 , 0x00}, - {0x3001 , 0x00}, - {0x3002 , 0x00}, - {0x3003 , 0x00}, - {0x3000 , 0xf8}, - {0x3001 , 0x48}, - {0x3002 , 0x5c}, - {0x3003 , 0x02}, - {0x3004 , 0x07}, - {0x3005 , 0xb7}, - {0x3006 , 0x43}, - {0x3007 , 0x37}, - {0x3011 , 0x08}, - {0x3010 , 0x10}, - {0x460c , 0x22}, - {0x3815 , 0x04}, - {0x370d , 0x06}, - {0x370c , 0xa0}, - {0x3602 , 0xfc}, - {0x3612 , 0xff}, - {0x3634 , 0xc0}, - {0x3613 , 0x00}, - {0x3605 , 0x7c}, - {0x3621 , 0x09}, - {0x3622 , 0x00}, - {0x3604 , 0x40}, - {0x3603 , 0xa7}, - {0x3603 , 0x27}, - {0x4000 , 0x21}, - {0x401d , 0x02}, - {0x3600 , 0x54}, - {0x3605 , 0x04}, - {0x3606 , 0x3f}, - {0x3c01 , 0x80}, - {0x5000 , 0x4f}, - {0x5020 , 0x04}, - {0x5181 , 0x79}, - {0x5182 , 0x00}, - {0x5185 , 0x22}, - {0x5197 , 0x01}, - {0x5001 , 0xff}, - {0x5500 , 0x0a}, - {0x5504 , 0x00}, - {0x5505 , 0x7f}, - {0x5080 , 0x08}, - {0x300e , 0x18}, - {0x4610 , 0x00}, - {0x471d , 0x05}, - {0x4708 , 0x06}, - {0x3710 , 0x10}, - {0x3632 , 0x41}, - {0x3702 , 0x40}, - {0x3620 , 0x37}, - {0x3631 , 0x01}, - {0x3808 , 0x02}, - {0x3809 , 0x80}, - {0x380a , 0x01}, - {0x380b , 0xe0}, - {0x380e , 0x07}, - {0x380f , 0xd0}, - {0x501f , 0x00}, - {0x5000 , 0x4f}, - {0x4300 , 0x32}, //UYVY - {0x3503 , 0x07}, - {0x3501 , 0x73}, - {0x3502 , 0x80}, - {0x350b , 0x00}, - {0x3503 , 0x07}, - {0x3824 , 0x11}, - {0x3501 , 0x1e}, - {0x3502 , 0x80}, - {0x350b , 0x7f}, - {0x380c , 0x0c}, - {0x380d , 0x80}, - {0x380e , 0x03}, - {0x380f , 0xe8}, - {0x3a0d , 0x04}, - {0x3a0e , 0x03}, - {0x3818 , 0xc1}, - {0x3705 , 0xdb}, - {0x370a , 0x81}, - {0x3801 , 0x80}, - {0x3621 , 0xc7}, - {0x3801 , 0x50}, - {0x3803 , 0x08}, - {0x3827 , 0x08}, - {0x3810 , 0xc0}, - {0x3804 , 0x05}, - {0x3805 , 0x00}, - {0x5682 , 0x05}, - {0x5683 , 0x00}, - {0x3806 , 0x03}, - {0x3807 , 0xc0}, - {0x5686 , 0x03}, - {0x5687 , 0xc0}, - {0x3a00 , 0x78}, - {0x3a1a , 0x04}, - {0x3a13 , 0x30}, - {0x3a18 , 0x00}, - {0x3a19 , 0x7c}, - {0x3a08 , 0x12}, - {0x3a09 , 0xc0}, - {0x3a0a , 0x0f}, - {0x3a0b , 0xa0}, - {0x3004 , 0xff}, - {0x350c , 0x07}, - {0x350d , 0xd0}, - {0x3500 , 0x00}, - {0x3501 , 0x00}, - {0x3502 , 0x00}, - {0x350a , 0x00}, - {0x350b , 0x00}, - {0x3503 , 0x00}, - {0x528a , 0x02}, - {0x528b , 0x04}, - {0x528c , 0x08}, - {0x528d , 0x08}, - {0x528e , 0x08}, - {0x528f , 0x10}, - {0x5290 , 0x10}, - {0x5292 , 0x00}, - {0x5293 , 0x02}, - {0x5294 , 0x00}, - {0x5295 , 0x02}, - {0x5296 , 0x00}, - {0x5297 , 0x02}, - {0x5298 , 0x00}, - {0x5299 , 0x02}, - {0x529a , 0x00}, - {0x529b , 0x02}, - {0x529c , 0x00}, - {0x529d , 0x02}, - {0x529e , 0x00}, - {0x529f , 0x02}, - {0x3a0f , 0x3c}, - {0x3a10 , 0x30}, - {0x3a1b , 0x3c}, - {0x3a1e , 0x30}, - {0x3a11 , 0x70}, - {0x3a1f , 0x10}, - {0x3030 , 0x0b}, - {0x3a02 , 0x00}, - {0x3a03 , 0x7d}, - {0x3a04 , 0x00}, - {0x3a14 , 0x00}, - {0x3a15 , 0x7d}, - {0x3a16 , 0x00}, - {0x3a00 , 0x78}, - {0x3a08 , 0x09}, - {0x3a09 , 0x60}, - {0x3a0a , 0x07}, - {0x3a0b , 0xd0}, - {0x3a0d , 0x08}, - {0x3a0e , 0x06}, - {0x5193 , 0x70}, - {0x3620 , 0x57}, - {0x3703 , 0x98}, - {0x3704 , 0x1c}, - {0x589b , 0x04}, - {0x589a , 0xc5}, - {0x528a , 0x00}, - {0x528b , 0x02}, - {0x528c , 0x08}, - {0x528d , 0x10}, - {0x528e , 0x20}, - {0x528f , 0x28}, - {0x5290 , 0x30}, - {0x5292 , 0x00}, - {0x5293 , 0x00}, - {0x5294 , 0x00}, - {0x5295 , 0x02}, - {0x5296 , 0x00}, - {0x5297 , 0x08}, - {0x5298 , 0x00}, - {0x5299 , 0x10}, - {0x529a , 0x00}, - {0x529b , 0x20}, - {0x529c , 0x00}, - {0x529d , 0x28}, - {0x529e , 0x00}, - {0x529f , 0x30}, - {0x5282 , 0x00}, - {0x5300 , 0x00}, - {0x5301 , 0x20}, - {0x5302 , 0x00}, - {0x5303 , 0x7c}, - {0x530c , 0x00}, - {0x530d , 0x0c}, - {0x530e , 0x20}, - {0x530f , 0x80}, - {0x5310 , 0x20}, - {0x5311 , 0x80}, - {0x5308 , 0x20}, - {0x5309 , 0x40}, - {0x5304 , 0x00}, - {0x5305 , 0x30}, - {0x5306 , 0x00}, - {0x5307 , 0x80}, - {0x5314 , 0x08}, - {0x5315 , 0x20}, - {0x5319 , 0x30}, - {0x5316 , 0x10}, - {0x5317 , 0x08}, - {0x5318 , 0x02}, - {0x5380 , 0x01}, - {0x5381 , 0x00}, - {0x5382 , 0x00}, - {0x5383 , 0x4e}, - {0x5384 , 0x00}, - {0x5385 , 0x0f}, - {0x5386 , 0x00}, - {0x5387 , 0x00}, - {0x5388 , 0x01}, - {0x5389 , 0x15}, - {0x538a , 0x00}, - {0x538b , 0x31}, - {0x538c , 0x00}, - {0x538d , 0x00}, - {0x538e , 0x00}, - {0x538f , 0x0f}, - {0x5390 , 0x00}, - {0x5391 , 0xab}, - {0x5392 , 0x00}, - {0x5393 , 0xa2}, - {0x5394 , 0x08}, - {0x5480 , 0x14}, - {0x5481 , 0x21}, - {0x5482 , 0x36}, - {0x5483 , 0x57}, - {0x5484 , 0x65}, - {0x5485 , 0x71}, - {0x5486 , 0x7d}, - {0x5487 , 0x87}, - {0x5488 , 0x91}, - {0x5489 , 0x9a}, - {0x548a , 0xaa}, - {0x548b , 0xb8}, - {0x548c , 0xcd}, - {0x548d , 0xdd}, - {0x548e , 0xea}, - {0x548f , 0x10}, - {0x5490 , 0x05}, - {0x5491 , 0x00}, - {0x5492 , 0x04}, - {0x5493 , 0x20}, - {0x5494 , 0x03}, - {0x5495 , 0x60}, - {0x5496 , 0x02}, - {0x5497 , 0xb8}, - {0x5498 , 0x02}, - {0x5499 , 0x86}, - {0x549a , 0x02}, - {0x549b , 0x5b}, - {0x549c , 0x02}, - {0x549d , 0x3b}, - {0x549e , 0x02}, - {0x549f , 0x1c}, - {0x54a0 , 0x02}, - {0x54a1 , 0x04}, - {0x54a2 , 0x01}, - {0x54a3 , 0xed}, - {0x54a4 , 0x01}, - {0x54a5 , 0xc5}, - {0x54a6 , 0x01}, - {0x54a7 , 0xa5}, - {0x54a8 , 0x01}, - {0x54a9 , 0x6c}, - {0x54aa , 0x01}, - {0x54ab , 0x41}, - {0x54ac , 0x01}, - {0x54ad , 0x20}, - {0x54ae , 0x00}, - {0x54af , 0x16}, - {0x3406 , 0x00}, - {0x5192 , 0x04}, - {0x5191 , 0xf8}, - {0x5193 , 0x70}, - {0x5194 , 0xf0}, - {0x5195 , 0xf0}, - {0x518d , 0x3d}, - {0x518f , 0x54}, - {0x518e , 0x3d}, - {0x5190 , 0x54}, - {0x518b , 0xc0}, - {0x518c , 0xbd}, - {0x5187 , 0x18}, - {0x5188 , 0x18}, - {0x5189 , 0x6e}, - {0x518a , 0x68}, - {0x5186 , 0x1c}, - {0x5181 , 0x50}, - {0x5184 , 0x25}, - {0x5182 , 0x11}, - {0x5183 , 0x14}, - {0x5184 , 0x25}, - {0x5185 , 0x24}, - {0x5025 , 0x82}, - {0x3a0f , 0x7e}, - {0x3a10 , 0x72}, - {0x3a1b , 0x80}, - {0x3a1e , 0x70}, - {0x3a11 , 0xd0}, - {0x3a1f , 0x40}, - {0x5583 , 0x40}, - {0x5584 , 0x40}, - {0x5580 , 0x02}, - {0x3633 , 0x07}, - {0x3702 , 0x10}, - {0x3703 , 0xb2}, - {0x3704 , 0x18}, - {0x370b , 0x40}, - {0x370d , 0x02}, - {0x3620 , 0x52}, - {0x3c00 , 0x04}, - - {0x5001,0xFF}, - {0x5583,0x50}, - {0x5584,0x50}, - {0x5580,0x02}, - {0x3c01,0x80}, - {0x3c00,0x04}, - {0x5800,0x27}, - {0x5801,0x22}, - {0x5802,0x1b}, - {0x5803,0x17}, - {0x5804,0x16}, - {0x5805,0x18}, - {0x5806,0x20}, - {0x5807,0x20}, - {0x5808,0x1b}, - {0x5809,0x15}, - {0x580a,0x0f}, - {0x580b,0x0d}, - {0x580c,0x0d}, - {0x580d,0x0e}, - {0x580e,0x11}, - {0x580f,0x18}, - {0x5810,0x10}, - {0x5811,0x0d}, - {0x5812,0x08}, - {0x5813,0x05}, - {0x5814,0x04}, - {0x5815,0x06}, - {0x5816,0x09}, - {0x5817,0x0e}, - {0x5818,0x0d}, - {0x5819,0x09}, - {0x581a,0x03}, - {0x581b,0x00}, - {0x581c,0x00}, - {0x581d,0x01}, - {0x581e,0x05}, - {0x581f,0x0b}, - {0x5820,0x0d}, - {0x5821,0x09}, - {0x5822,0x03}, - {0x5823,0x00}, - {0x5824,0x00}, - {0x5825,0x01}, - {0x5826,0x05}, - {0x5827,0x0b}, - {0x5828,0x10}, - {0x5829,0x0c}, - {0x582a,0x08}, - {0x582b,0x04}, - {0x582c,0x03}, - {0x582d,0x05}, - {0x582e,0x09}, - {0x582f,0x0e}, - {0x5830,0x1b}, - {0x5831,0x14}, - {0x5832,0x0f}, - {0x5833,0x0c}, - {0x5834,0x0c}, - {0x5835,0x0d}, - {0x5836,0x10}, - {0x5837,0x19}, - {0x5838,0x25}, - {0x5839,0x23}, - {0x583a,0x1a}, - {0x583b,0x16}, - {0x583c,0x15}, - {0x583d,0x18}, - {0x583e,0x1f}, - {0x583f,0x25}, - {0x5840,0x10}, - {0x5841,0x0e}, - {0x5842,0x0e}, - {0x5843,0x0e}, - {0x5844,0x0f}, - {0x5845,0x0a}, - {0x5846,0x08}, - {0x5847,0x0f}, - {0x5848,0x0f}, - {0x5849,0x0f}, - {0x584a,0x0c}, - {0x584b,0x0f}, - {0x584c,0x09}, - {0x584d,0x10}, - {0x584e,0x11}, - {0x584f,0x10}, - {0x5850,0x0f}, - {0x5851,0x0e}, - {0x5852,0x08}, - {0x5853,0x10}, - {0x5854,0x10}, - {0x5855,0x10}, - {0x5856,0x0e}, - {0x5857,0x0e}, - {0x5858,0x0a}, - {0x5859,0x0e}, - {0x585a,0x0e}, - {0x585b,0x0e}, - {0x585c,0x0e}, - {0x585d,0x0d}, - {0x585e,0x08}, - {0x585f,0x0b}, - {0x5860,0x0a}, - {0x5861,0x0a}, - {0x5862,0x09}, - {0x5863,0x0d}, - {0x5864,0x13}, - {0x5865,0x0e}, - {0x5866,0x10}, - {0x5867,0x10}, - {0x5868,0x0e}, - {0x5869,0x11}, - {0x586a,0x12}, - {0x586b,0x10}, - {0x586c,0x10}, - {0x586d,0x10}, - {0x586e,0x10}, - {0x586f,0x11}, - {0x5870,0x15}, - {0x5871,0x10}, - {0x5872,0x10}, - {0x5873,0x10}, - {0x5874,0x11}, - {0x5875,0x11}, - {0x5876,0x14}, - {0x5877,0x0f}, - {0x5878,0x10}, - {0x5879,0x10}, - {0x587a,0x10}, - {0x587b,0x11}, - {0x587c,0x12}, - {0x587d,0x0f}, - {0x587e,0x0f}, - {0x587f,0x10}, - {0x5880,0x10}, - {0x5881,0x0f}, - {0x5882,0x12}, - {0x5883,0x0e}, - {0x5884,0x10}, - {0x5885,0x10}, - {0x5886,0x0e}, - {0x5887,0x0e}, - {0x5180,0xff}, - {0x5181,0x52}, - {0x5182,0x11}, - {0x5183,0x14}, - {0x5184,0x25}, - {0x5185,0x24}, - {0x5186,0x14}, - {0x5187,0x14}, - {0x5188,0x14}, - {0x5189,0x6c}, - {0x518a,0x60}, - {0x518b,0xbd}, - {0x518c,0x9c}, - {0x518d,0x3d}, - {0x518e,0x34}, - {0x518f,0x57}, - {0x5190,0x4a}, - {0x5191,0xf8}, - {0x5192,0x04}, - {0x5193,0x70}, - {0x5194,0xf0}, - {0x5195,0xf0}, - {0x5196,0x03}, - {0x5197,0x01}, - {0x5198,0x04}, - {0x5199,0x00}, - {0x519a,0x04}, - {0x519b,0x35}, - {0x519c,0x08}, - {0x519d,0xb8}, - {0x519e,0xa0}, - {0x528a,0x00}, - {0x528b,0x01}, - {0x528c,0x04}, - {0x528d,0x08}, - {0x528e,0x10}, - {0x528f,0x20}, - {0x5290,0x30}, - {0x5292,0x00}, - {0x5293,0x00}, - {0x5294,0x00}, - {0x5295,0x01}, - {0x5296,0x00}, - {0x5297,0x04}, - {0x5298,0x00}, - {0x5299,0x08}, - {0x529a,0x00}, - {0x529b,0x10}, - {0x529c,0x00}, - {0x529d,0x20}, - {0x529e,0x00}, - {0x529f,0x30}, - {0x5282,0x00}, - {0x5300,0x00}, - {0x5301,0x20}, - {0x5302,0x00}, - {0x5303,0x7c}, - {0x530c,0x00}, - {0x530d,0x10}, - {0x530e,0x20}, - {0x530f,0x80}, - {0x5310,0x20}, - {0x5311,0x80}, - {0x5308,0x20}, - {0x5309,0x40}, - {0x5304,0x00}, - {0x5305,0x30}, - {0x5306,0x00}, - {0x5307,0x80}, - {0x5314,0x08}, - {0x5315,0x20}, - {0x5319,0x30}, - {0x5316,0x10}, - {0x5317,0x00}, - {0x5318,0x02}, - {0x5380,0x01}, - {0x5381,0x00}, - {0x5382,0x00}, - {0x5383,0x1f}, - {0x5384,0x00}, - {0x5385,0x06}, - {0x5386,0x00}, - {0x5387,0x00}, - {0x5388,0x00}, - {0x5389,0xE1}, - {0x538A,0x00}, - {0x538B,0x2B}, - {0x538C,0x00}, - {0x538D,0x00}, - {0x538E,0x00}, - {0x538F,0x10}, - {0x5390,0x00}, - {0x5391,0xB3}, - {0x5392,0x00}, - {0x5393,0xA6}, - {0x5394,0x08}, - {0x5480,0x14}, - {0x5481,0x21}, - {0x5482,0x36}, - {0x5483,0x57}, - {0x5484,0x65}, - {0x5485,0x71}, - {0x5486,0x7D}, - {0x5487,0x87}, - {0x5488,0x91}, - {0x5489,0x9A}, - {0x548A,0xAA}, - {0x548B,0xB8}, - {0x548C,0xCD}, - {0x548D,0xDD}, - {0x548E,0xEA}, - {0x548F,0x1d}, - {0x5490,0x05}, - {0x5491,0x00}, - {0x5492,0x04}, - {0x5493,0x20}, - {0x5494,0x03}, - {0x5495,0x60}, - {0x5496,0x02}, - {0x5497,0xB8}, - {0x5498,0x02}, - {0x5499,0x86}, - {0x549A,0x02}, - {0x549B,0x5B}, - {0x549C,0x02}, - {0x549D,0x3B}, - {0x549E,0x02}, - {0x549F,0x1C}, - {0x54A0,0x02}, - {0x54A1,0x04}, - {0x54A2,0x01}, - {0x54A3,0xED}, - {0x54A4,0x01}, - {0x54A5,0xC5}, - {0x54A6,0x01}, - {0x54A7,0xA5}, - {0x54A8,0x01}, - {0x54A9,0x6C}, - {0x54AA,0x01}, - {0x54AB,0x41}, - {0x54AC,0x01}, - {0x54AD,0x20}, - {0x54AE,0x00}, - {0x54AF,0x16}, - {0x54B0,0x01}, - {0x54B1,0x20}, - {0x54B2,0x00}, - {0x54B3,0x10}, - {0x54B4,0x00}, - {0x54B5,0xf0}, - {0x54B6,0x00}, - {0x54B7,0xDF}, - {0x5402,0x3f}, - {0x5403,0x00}, - {0x5500,0x10}, - {0x5502,0x00}, - {0x5503,0x06}, - {0x5504,0x00}, - {0x5505,0x7f}, - {0x5025,0x80}, - {0x3a0f,0x48},//0x30 - {0x3a10,0x38},//0x28 - {0x3a1b,0x50},//0x30 - {0x3a1e,0x30},//0x28 - {0x3a11,0x71},//0x61 - {0x3a1f,0x10}, - {0x5688,0xfd}, - {0x5689,0xdf}, - {0x568a,0xfe}, - {0x568b,0xef}, - {0x568c,0xfe}, - {0x568d,0xef}, - {0x568e,0xaa}, - {0x568f,0xaa}, - - {0x3800 ,0x1 }, - {0x3801 ,0x50}, - {0x3802 ,0x0 }, - {0x3803 ,0x8 }, - {0x3804 ,0x5 }, - {0x3805 ,0x0 }, - {0x3806 ,0x3 }, - {0x3807 ,0xc0}, - {0x3808 ,0x3 }, - {0x3809 ,0x20}, - {0x380a ,0x2 }, - {0x380b ,0x58}, - {0x380c ,0xc }, - {0x380d ,0x80}, - {0x380e ,0x3 }, - {0x380f ,0xe8}, - {0x5001 ,0x7f}, - {0x5680 ,0x0 }, - {0x5681 ,0x0 }, - {0x5682 ,0x5 }, - {0x5683 ,0x0 }, - {0x5684 ,0x0 }, - {0x5685 ,0x0 }, - {0x5686 ,0x3 }, - {0x5687 ,0xc0}, - {0x5687 ,0xc0}, - {0x3815 ,0x02}, - {0x3503 ,0x00}, - - {0x0000,0x00} - -}; - -/* 720p 15fps @ 1280x720 */ - -static struct reginfo sensor_720p[]= -{ -#if 0 - {SEQUENCE_PROPERTY, SEQUENCE_INIT}, - {0x3103, 0x93 }, - {0x3008, 0x82 }, - {0x3017, 0x7f }, - {0x3018, 0xfc }, - {0x3810, 0xc2 }, - {0x3615, 0xf0 }, - {0x3000, 0x00 }, - {0x3001, 0x00 }, - {0x3002, 0x00 }, - {0x3003, 0x00 }, - {0x3004, 0xff }, - {0x3030, 0x2b }, - {0x3011, 0x08 }, - {0x3010, 0x10 }, - {0x3604, 0x60 }, - {0x3622, 0x60 }, - {0x3621, 0x09 }, - {0x3709, 0x00 }, - {0x4000, 0x21 }, - {0x401d, 0x22 }, - {0x3600, 0x54 }, - {0x3605, 0x04 }, - {0x3606, 0x3f }, - {0x3c01, 0x80 }, - {0x300d, 0x22 }, - {0x3623, 0x22 }, - {0x5000, 0x4f }, - {0x5020, 0x04 }, - {0x5181, 0x79 }, - {0x5182, 0x00 }, - {0x5185, 0x22 }, - {0x5197, 0x01 }, - {0x5500, 0x0a }, - {0x5504, 0x00 }, - {0x5505, 0x7f }, - {0x5080, 0x08 }, - {0x300e, 0x18 }, - {0x4610, 0x00 }, - {0x471d, 0x05 }, - {0x4708, 0x06 }, - {0x370c, 0xa0 }, - {0x3808, 0x0a }, - {0x3809, 0x20 }, - {0x380a, 0x07 }, - {0x380b, 0x98 }, - {0x380c, 0x0c }, - {0x380d, 0x80 }, - {0x380e, 0x07 }, - {0x380f, 0xd0 }, - {0x5687, 0x94 }, - {0x501f, 0x00 }, - {0x5000, 0x4f }, - {0x5001, 0xcf }, - {0x4300, 0x30 }, - {0x460b, 0x35 }, - {0x471d, 0x00 }, - {0x3002, 0x0c }, - {0x3002, 0x00 }, - {0x4713, 0x03 }, - {0x471c, 0x50 }, - {0x4721, 0x02 }, - {0x4402, 0x90 }, - {0x460c, 0x22 }, - {0x3815, 0x44 }, - {0x3503, 0x07 }, - {0x3501, 0x73 }, - {0x3502, 0x80 }, - {0x350b, 0x00 }, - {0x3818, 0xc8 }, - {0x3801, 0x88 }, - {0x3824, 0x11 }, - {0x3a00, 0x78 }, - {0x3a1a, 0x04 }, - {0x3a13, 0x30 }, - {0x3a18, 0x00 }, - {0x3a19, 0x7c }, - {0x3a08, 0x12 }, - {0x3a09, 0xc0 }, - {0x3a0a, 0x0f }, - {0x3a0b, 0xa0 }, - {0x350c, 0x07 }, - {0x350d, 0xd0 }, - {0x3a0d, 0x08 }, - {0x3a0e, 0x06 }, - {0x3500, 0x00 }, - {0x3501, 0x00 }, - {0x3502, 0x00 }, - {0x350a, 0x00 }, - {0x350b, 0x00 }, - {0x3503, 0x00 }, - {0x3a0f, 0x3c }, - {0x3a10, 0x32 }, - {0x3a1b, 0x3c }, - {0x3a1e, 0x32 }, - {0x3a11, 0x80 }, - {0x3a1f, 0x20 }, - {0x3030, 0x2b }, - {0x3a02, 0x00 }, - {0x3a03, 0x7d }, - {0x3a04, 0x00 }, - {0x3a14, 0x00 }, - {0x3a15, 0x7d }, - {0x3a16, 0x00 }, - {0x3a00, 0x78 }, - {0x3a08, 0x09 }, - {0x3a09, 0x60 }, - {0x3a0a, 0x07 }, - {0x3a0b, 0xd0 }, - {0x3a0d, 0x10 }, - {0x3a0e, 0x0d }, - {0x4407, 0x04 }, - {0x5193, 0x70 }, - {0x589b, 0x00 }, - {0x589a, 0xc0 }, - {0x401e, 0x20 }, - {0x4001, 0x42 }, - {0x401c, 0x06 }, - {0x3825, 0xac }, - {0x3827, 0x0c }, - {0x528a, 0x01 }, - {0x528b, 0x04 }, - {0x528c, 0x08 }, - {0x528d, 0x10 }, - {0x528e, 0x20 }, - {0x528f, 0x28 }, - {0x5290, 0x30 }, - {0x5292, 0x00 }, - {0x5293, 0x01 }, - {0x5294, 0x00 }, - {0x5295, 0x04 }, - {0x5296, 0x00 }, - {0x5297, 0x08 }, - {0x5298, 0x00 }, - {0x5299, 0x10 }, - {0x529a, 0x00 }, - {0x529b, 0x20 }, - {0x529c, 0x00 }, - {0x529d, 0x28 }, - {0x529e, 0x00 }, - {0x529f, 0x30 }, - {0x5282, 0x00 }, - {0x5300, 0x00 }, - {0x5301, 0x20 }, - {0x5302, 0x00 }, - {0x5303, 0x7c }, - {0x530c, 0x00 }, - {0x530d, 0x0c }, - {0x530e, 0x20 }, - {0x530f, 0x80 }, - {0x5310, 0x20 }, - {0x5311, 0x80 }, - {0x5308, 0x20 }, - {0x5309, 0x40 }, - {0x5304, 0x00 }, - {0x5305, 0x30 }, - {0x5306, 0x00 }, - {0x5307, 0x80 }, - {0x5314, 0x08 }, - {0x5315, 0x20 }, - {0x5319, 0x30 }, - {0x5316, 0x10 }, - {0x5317, 0x00 }, - {0x5318, 0x02 }, - {0x5380, 0x01 }, - {0x5381, 0x00 }, - {0x5382, 0x00 }, - {0x5383, 0x4e }, - {0x5384, 0x00 }, - {0x5385, 0x0f }, - {0x5386, 0x00 }, - {0x5387, 0x00 }, - {0x5388, 0x01 }, - {0x5389, 0x15 }, - {0x538a, 0x00 }, - {0x538b, 0x31 }, - {0x538c, 0x00 }, - {0x538d, 0x00 }, - {0x538e, 0x00 }, - {0x538f, 0x0f }, - {0x5390, 0x00 }, - {0x5391, 0xab }, - {0x5392, 0x00 }, - {0x5393, 0xa2 }, - {0x5394, 0x08 }, - {0x5480, 0x14 }, - {0x5481, 0x21 }, - {0x5482, 0x36 }, - {0x5483, 0x57 }, - {0x5484, 0x65 }, - {0x5485, 0x71 }, - {0x5486, 0x7d }, - {0x5487, 0x87 }, - {0x5488, 0x91 }, - {0x5489, 0x9a }, - {0x548a, 0xaa }, - {0x548b, 0xb8 }, - {0x548c, 0xcd }, - {0x548d, 0xdd }, - {0x548e, 0xea }, - {0x548f, 0x1d }, - {0x5490, 0x05 }, - {0x5491, 0x00 }, - {0x5492, 0x04 }, - {0x5493, 0x20 }, - {0x5494, 0x03 }, - {0x5495, 0x60 }, - {0x5496, 0x02 }, - {0x5497, 0xb8 }, - {0x5498, 0x02 }, - {0x5499, 0x86 }, - {0x549a, 0x02 }, - {0x549b, 0x5b }, - {0x549c, 0x02 }, - {0x549d, 0x3b }, - {0x549e, 0x02 }, - {0x549f, 0x1c }, - {0x54a0, 0x02 }, - {0x54a1, 0x04 }, - {0x54a2, 0x01 }, - {0x54a3, 0xed }, - {0x54a4, 0x01 }, - {0x54a5, 0xc5 }, - {0x54a6, 0x01 }, - {0x54a7, 0xa5 }, - {0x54a8, 0x01 }, - {0x54a9, 0x6c }, - {0x54aa, 0x01 }, - {0x54ab, 0x41 }, - {0x54ac, 0x01 }, - {0x54ad, 0x20 }, - {0x54ae, 0x00 }, - {0x54af, 0x16 }, - {0x54b0, 0x01 }, - {0x54b1, 0x20 }, - {0x54b2, 0x00 }, - {0x54b3, 0x10 }, - {0x54b4, 0x00 }, - {0x54b5, 0xf0 }, - {0x54b6, 0x00 }, - {0x54b7, 0xdf }, - {0x5402, 0x3f }, - {0x5403, 0x00 }, - {0x3406, 0x00 }, - {0x5180, 0xff }, - {0x5181, 0x52 }, - {0x5182, 0x11 }, - {0x5183, 0x14 }, - {0x5184, 0x25 }, - {0x5185, 0x24 }, - {0x5186, 0x06 }, - {0x5187, 0x08 }, - {0x5188, 0x08 }, - {0x5189, 0x7c }, - {0x518a, 0x60 }, - {0x518b, 0xb2 }, - {0x518c, 0xb2 }, - {0x518d, 0x44 }, - {0x518e, 0x3d }, - {0x518f, 0x58 }, - {0x5190, 0x46 }, - {0x5191, 0xf8 }, - {0x5192, 0x04 }, - {0x5193, 0x70 }, - {0x5194, 0xf0 }, - {0x5195, 0xf0 }, - {0x5196, 0x03 }, - {0x5197, 0x01 }, - {0x5198, 0x04 }, - {0x5199, 0x12 }, - {0x519a, 0x04 }, - {0x519b, 0x00 }, - {0x519c, 0x06 }, - {0x519d, 0x82 }, - {0x519e, 0x00 }, - {0x5025, 0x80 }, - {0x3a0f, 0x38 }, - {0x3a10, 0x30 }, - {0x3a1b, 0x3a }, - {0x3a1e, 0x2e }, - {0x3a11, 0x60 }, - {0x3a1f, 0x10 }, - {0x5688, 0xa6 }, - {0x5689, 0x6a }, - {0x568a, 0xea }, - {0x568b, 0xae }, - {0x568c, 0xa6 }, - {0x568d, 0x6a }, - {0x568e, 0x62 }, - {0x568f, 0x26 }, - {0x5583, 0x40 }, - {0x5584, 0x40 }, - {0x5580, 0x02 }, - {0x5000, 0xcf }, - {0x5800, 0x27 }, - {0x5801, 0x19 }, - {0x5802, 0x12 }, - {0x5803, 0x0f }, - {0x5804, 0x10 }, - {0x5805, 0x15 }, - {0x5806, 0x1e }, - {0x5807, 0x2f }, - {0x5808, 0x15 }, - {0x5809, 0x0d }, - {0x580a, 0x0a }, - {0x580b, 0x09 }, - {0x580c, 0x0a }, - {0x580d, 0x0c }, - {0x580e, 0x12 }, - {0x580f, 0x19 }, - {0x5810, 0x0b }, - {0x5811, 0x07 }, - {0x5812, 0x04 }, - {0x5813, 0x03 }, - {0x5814, 0x03 }, - {0x5815, 0x06 }, - {0x5816, 0x0a }, - {0x5817, 0x0f }, - {0x5818, 0x0a }, - {0x5819, 0x05 }, - {0x581a, 0x01 }, - {0x581b, 0x00 }, - {0x581c, 0x00 }, - {0x581d, 0x03 }, - {0x581e, 0x08 }, - {0x581f, 0x0c }, - {0x5820, 0x0a }, - {0x5821, 0x05 }, - {0x5822, 0x01 }, - {0x5823, 0x00 }, - {0x5824, 0x00 }, - {0x5825, 0x03 }, - {0x5826, 0x08 }, - {0x5827, 0x0c }, - {0x5828, 0x0e }, - {0x5829, 0x08 }, - {0x582a, 0x06 }, - {0x582b, 0x04 }, - {0x582c, 0x05 }, - {0x582d, 0x07 }, - {0x582e, 0x0b }, - {0x582f, 0x12 }, - {0x5830, 0x18 }, - {0x5831, 0x10 }, - {0x5832, 0x0c }, - {0x5833, 0x0a }, - {0x5834, 0x0b }, - {0x5835, 0x0e }, - {0x5836, 0x15 }, - {0x5837, 0x19 }, - {0x5838, 0x32 }, - {0x5839, 0x1f }, - {0x583a, 0x18 }, - {0x583b, 0x16 }, - {0x583c, 0x17 }, - {0x583d, 0x1e }, - {0x583e, 0x26 }, - {0x583f, 0x53 }, - {0x5840, 0x10 }, - {0x5841, 0x0f }, - {0x5842, 0x0d }, - {0x5843, 0x0c }, - {0x5844, 0x0e }, - {0x5845, 0x09 }, - {0x5846, 0x11 }, - {0x5847, 0x10 }, - {0x5848, 0x10 }, - {0x5849, 0x10 }, - {0x584a, 0x10 }, - {0x584b, 0x0e }, - {0x584c, 0x10 }, - {0x584d, 0x10 }, - {0x584e, 0x11 }, - {0x584f, 0x10 }, - {0x5850, 0x0f }, - {0x5851, 0x0c }, - {0x5852, 0x0f }, - {0x5853, 0x10 }, - {0x5854, 0x10 }, - {0x5855, 0x0f }, - {0x5856, 0x0e }, - {0x5857, 0x0b }, - {0x5858, 0x10 }, - {0x5859, 0x0d }, - {0x585a, 0x0d }, - {0x585b, 0x0c }, - {0x585c, 0x0c }, - {0x585d, 0x0c }, - {0x585e, 0x0b }, - {0x585f, 0x0c }, - {0x5860, 0x0c }, - {0x5861, 0x0c }, - {0x5862, 0x0d }, - {0x5863, 0x08 }, - {0x5864, 0x11 }, - {0x5865, 0x18 }, - {0x5866, 0x18 }, - {0x5867, 0x19 }, - {0x5868, 0x17 }, - {0x5869, 0x19 }, - {0x586a, 0x16 }, - {0x586b, 0x13 }, - {0x586c, 0x13 }, - {0x586d, 0x12 }, - {0x586e, 0x13 }, - {0x586f, 0x16 }, - {0x5870, 0x14 }, - {0x5871, 0x12 }, - {0x5872, 0x10 }, - {0x5873, 0x11 }, - {0x5874, 0x11 }, - {0x5875, 0x16 }, - {0x5876, 0x14 }, - {0x5877, 0x11 }, - {0x5878, 0x10 }, - {0x5879, 0x0f }, - {0x587a, 0x10 }, - {0x587b, 0x14 }, - {0x587c, 0x13 }, - {0x587d, 0x12 }, - {0x587e, 0x11 }, - {0x587f, 0x11 }, - {0x5880, 0x12 }, - {0x5881, 0x15 }, - {0x5882, 0x14 }, - {0x5883, 0x15 }, - {0x5884, 0x15 }, - {0x5885, 0x15 }, - {0x5886, 0x13 }, - {0x5887, 0x17 }, - {0x3710, 0x10 }, - {0x3632, 0x51 }, - {0x3702, 0x10 }, - {0x3703, 0xb2 }, - {0x3704, 0x18 }, - {0x370b, 0x40 }, - {0x370d, 0x03 }, - {0x3631, 0x01 }, - {0x3632, 0x52 }, - {0x3606, 0x24 }, - {0x3620, 0x96 }, - {0x5785, 0x07 }, - {0x3a13, 0x30 }, - {0x3600, 0x52 }, - {0x3604, 0x48 }, - {0x3606, 0x1b }, - {0x370d, 0x0b }, - {0x370f, 0xc0 }, - {0x3709, 0x01 }, - {0x3823, 0x00 }, - {0x5007, 0x00 }, - {0x5009, 0x00 }, - {0x5011, 0x00 }, - {0x5013, 0x00 }, - {0x519e, 0x00 }, - {0x5086, 0x00 }, - {0x5087, 0x00 }, - {0x5088, 0x00 }, - {0x5089, 0x00 }, - {0x302b, 0x00 }, - {0x3503, 0x07 }, - {0x3011, 0x10 },//15fps 0x08 // 10fps: 0x05 - {0x350c, 0x02 }, - {0x350d, 0xe4 }, - {0x3621, 0xc9 }, - {0x370a, 0x81 }, - {0x3803, 0x08 }, - {0x3804, 0x05 }, - {0x3805, 0x00 }, - {0x3806, 0x02 }, - {0x3807, 0xd0 }, - {0x3808, 0x05 }, - {0x3809, 0x00 }, - {0x380a, 0x02 }, - {0x380b, 0xd0 }, - {0x380c, 0x08 }, - {0x380d, 0x72 }, - {0x380e, 0x02 }, - {0x380f, 0xe4 }, - {0x3810, 0xc0 }, - {0x3818, 0xc9 }, - {0x381c, 0x10 }, - {0x381d, 0xa0 }, - {0x381e, 0x05 }, - {0x381f, 0xb0 }, - {0x3820, 0x00 }, - {0x3821, 0x00 }, - {0x3824, 0x11 }, - {0x3a08, 0x1b }, - {0x3a09, 0xc0 }, - {0x3a0a, 0x17 }, - {0x3a0b, 0x20 }, - {0x3a0d, 0x02 }, - {0x3a0e, 0x01 }, - {0x3c00, 0x04 }, - {0x401c, 0x04 }, - {0x5682, 0x05 }, - {0x5683, 0x00 }, - {0x5686, 0x02 }, - {0x5687, 0xcc }, - {0x5001, 0x7f }, - {0x589b, 0x06 }, - {0x589a, 0xc5 }, - {0x3503, 0x00 }, - - {0x3010, 0x30 }, - - {0x460c, 0x20 }, - {0x460b, 0x37 }, - {0x471c, 0xd0 }, - {0x471d, 0x05 }, - {0x3815, 0x01 }, - {0x3818, 0xc1 }, - {0x501f, 0x00 }, - {0x4300, 0x32 }, // 0x30---> 0x32, set yuv - {0x3002, 0x1c }, - {0x3819, 0x80 }, - {0x5002, 0xe0 }, -#elif 1 - //{0x3008,0x42}, //software sleep : Sensor vsync singal may not output if haven't sleep the sensor when transfer the array, - {0x3819,0x81}, - {0x3000,0xf8}, - {0x3001,0x48}, - {0x3002,0x5c}, - {0x3003,0x02}, - {0x3005,0xb7}, - {0x3006,0x43}, - {0x3007,0x37}, - {0x350c,0x02}, - {0x350d,0xe4}, - {0x3602,0xfc}, - {0x3612,0xff}, - {0x3613,0x00}, - {0x3621,0xc9}, - {0x3622,0x00}, - {0x3623,0x22}, - {0x3604,0x40}, - {0x3705,0xdb}, - {0x370a,0x81}, - {0x3801,0x50}, - {0x3803,0x08}, - {0x3804,0x05}, - {0x3805,0x00}, - {0x3806,0x02}, - {0x3807,0xd0}, - {0x3808,0x05}, - {0x3809,0x00}, - {0x380a,0x02}, - {0x380b,0xd0}, - {0x380c,0x08}, - {0x380d,0x72}, - {0x380e,0x02}, - {0x380f,0xe4}, - {0x3810,0xc0}, - {0x3818,0xc1}, - {0x381c,0x10}, - {0x381d,0xa0}, - {0x381e,0x05}, - {0x381f,0xb0}, - {0x3820,0x00}, - {0x3821,0x00}, - {0x3824,0x11}, - {0x3825,0xb4}, - {0x3826,0x00}, - {0x3827,0x08}, - {0x3011,0x08}, - {0x3c01,0x80}, - {0x3c01,0x00}, - {0x3c00,0x00}, - {0x3a08,0x0d}, - {0x3a09,0xe0}, - {0x3a0a,0x0b}, - {0x3a0b,0x90}, - {0x3a0d,0x04}, - {0x3a0e,0x03}, - {0x3a11,0x70}, - {0x3a10,0x30}, - {0x3a1b,0x3c}, - {0x3a1e,0x30}, - {0x3a1f,0x10}, - {0x401c,0x04}, - {0x5682,0x05}, - {0x5683,0x00}, - {0x5686,0x02}, - {0x5687,0xcc}, - {0x5001,0x7f}, - {0x589b,0x06}, - {0x589a,0xc5}, - {0x3503,0x00}, - {0x3010,0x10}, - {0x460c,0x22}, - {0x460b,0x37}, - {0x471c,0xd0}, - {0x471d,0x05}, - {0x3815,0x01}, - {0x3818,0xc1}, - {0x501f,0x00}, - {0x4300,0x32}, - {0x3002,0x1c}, - {0x3819,0x80}, - //{0x3008,0x02}, //software wake -#endif - {0x0000 ,0x00} - -}; - -/* 1080p, 0x15fps, 0xyuv @1920x1080 */ - -static struct reginfo sensor_1080p[]= -{ -#if 0 - {SEQUENCE_PROPERTY, SEQUENCE_INIT}, - { 0x3103, 0x93 }, - { 0x3008, 0x82 }, - { 0x3017, 0x7f }, - { 0x3018, 0xfc }, - { 0x3810, 0xc2 }, - { 0x3615, 0xf0 }, - { 0x3000, 0x00 }, - { 0x3001, 0x00 }, - { 0x3002, 0x00 }, - { 0x3003, 0x00 }, - { 0x3004, 0xff }, - { 0x3030, 0x2b }, - { 0x3011, 0x05 }, //10 fps 0x05 //15fps 0x08 - { 0x3010, 0x10 }, - { 0x3604, 0x60 }, - { 0x3622, 0x60 }, - { 0x3621, 0x09 }, - { 0x3709, 0x00 }, - { 0x4000, 0x21 }, - { 0x401d, 0x22 }, - { 0x3600, 0x54 }, - { 0x3605, 0x04 }, - { 0x3606, 0x3f }, - { 0x3c01, 0x80 }, - { 0x300d, 0x22 }, - { 0x3623, 0x22 }, - { 0x5000, 0x4f }, - { 0x5020, 0x04 }, - { 0x5181, 0x79 }, - { 0x5182, 0x00 }, - { 0x5185, 0x22 }, - { 0x5197, 0x01 }, - { 0x5500, 0x0a }, - { 0x5504, 0x00 }, - { 0x5505, 0x7f }, - { 0x5080, 0x08 }, - { 0x300e, 0x18 }, - { 0x4610, 0x00 }, - { 0x471d, 0x05 }, - { 0x4708, 0x06 }, - { 0x370c, 0xa0 }, - { 0x3808, 0x0a }, - { 0x3809, 0x20 }, - { 0x380a, 0x07 }, - { 0x380b, 0x98 }, - { 0x380c, 0x0c }, - { 0x380d, 0x80 }, - { 0x380e, 0x07 }, - { 0x380f, 0xd0 }, - { 0x5687, 0x94 }, - { 0x501f, 0x00 }, - { 0x5000, 0x4f }, - { 0x5001, 0xcf }, - { 0x4300, 0x30 }, - { 0x460b, 0x35 }, - { 0x471d, 0x00 }, - { 0x3002, 0x0c }, - { 0x3002, 0x00 }, - { 0x4713, 0x03 }, - { 0x471c, 0x50 }, - { 0x4721, 0x02 }, - { 0x4402, 0x90 }, - { 0x460c, 0x22 }, - { 0x3815, 0x44 }, - { 0x3503, 0x07 }, - { 0x3501, 0x73 }, - { 0x3502, 0x80 }, - { 0x350b, 0x00 }, - { 0x3818, 0xc8 }, - { 0x3801, 0x88 }, - { 0x3824, 0x11 }, - { 0x3a00, 0x78 }, - { 0x3a1a, 0x04 }, - { 0x3a13, 0x30 }, - { 0x3a18, 0x00 }, - { 0x3a19, 0x7c }, - { 0x3a08, 0x12 }, - { 0x3a09, 0xc0 }, - { 0x3a0a, 0x0f }, - { 0x3a0b, 0xa0 }, - { 0x350c, 0x07 }, - { 0x350d, 0xd0 }, - { 0x3a0d, 0x08 }, - { 0x3a0e, 0x06 }, - { 0x3500, 0x00 }, - { 0x3501, 0x00 }, - { 0x3502, 0x00 }, - { 0x350a, 0x00 }, - { 0x350b, 0x00 }, - { 0x3503, 0x00 }, - { 0x3a0f, 0x3c }, - { 0x3a10, 0x32 }, - { 0x3a1b, 0x3c }, - { 0x3a1e, 0x32 }, - { 0x3a11, 0x80 }, - { 0x3a1f, 0x20 }, - { 0x3030, 0x2b }, - { 0x3a02, 0x00 }, - { 0x3a03, 0x7d }, - { 0x3a04, 0x00 }, - { 0x3a14, 0x00 }, - { 0x3a15, 0x7d }, - { 0x3a16, 0x00 }, - { 0x3a00, 0x78 }, - { 0x3a08, 0x09 }, - { 0x3a09, 0x60 }, - { 0x3a0a, 0x07 }, - { 0x3a0b, 0xd0 }, - { 0x3a0d, 0x10 }, - { 0x3a0e, 0x0d }, - { 0x4407, 0x04 }, - { 0x5193, 0x70 }, - { 0x589b, 0x00 }, - { 0x589a, 0xc0 }, - { 0x401e, 0x20 }, - { 0x4001, 0x42 }, - { 0x401c, 0x06 }, - { 0x3825, 0xac }, - { 0x3827, 0x0c }, - { 0x528a, 0x01 }, - { 0x528b, 0x04 }, - { 0x528c, 0x08 }, - { 0x528d, 0x10 }, - { 0x528e, 0x20 }, - { 0x528f, 0x28 }, - { 0x5290, 0x30 }, - { 0x5292, 0x00 }, - { 0x5293, 0x01 }, - { 0x5294, 0x00 }, - { 0x5295, 0x04 }, - { 0x5296, 0x00 }, - { 0x5297, 0x08 }, - { 0x5298, 0x00 }, - { 0x5299, 0x10 }, - { 0x529a, 0x00 }, - { 0x529b, 0x20 }, - { 0x529c, 0x00 }, - { 0x529d, 0x28 }, - { 0x529e, 0x00 }, - { 0x529f, 0x30 }, - { 0x5282, 0x00 }, - { 0x5300, 0x00 }, - { 0x5301, 0x20 }, - { 0x5302, 0x00 }, - { 0x5303, 0x7c }, - { 0x530c, 0x00 }, - { 0x530d, 0x0c }, - { 0x530e, 0x20 }, - { 0x530f, 0x80 }, - { 0x5310, 0x20 }, - { 0x5311, 0x80 }, - { 0x5308, 0x20 }, - { 0x5309, 0x40 }, - { 0x5304, 0x00 }, - { 0x5305, 0x30 }, - { 0x5306, 0x00 }, - { 0x5307, 0x80 }, - { 0x5314, 0x08 }, - { 0x5315, 0x20 }, - { 0x5319, 0x30 }, - { 0x5316, 0x10 }, - { 0x5317, 0x00 }, - { 0x5318, 0x02 }, - { 0x5380, 0x01 }, - { 0x5381, 0x00 }, - { 0x5382, 0x00 }, - { 0x5383, 0x4e }, - { 0x5384, 0x00 }, - { 0x5385, 0x0f }, - { 0x5386, 0x00 }, - { 0x5387, 0x00 }, - { 0x5388, 0x01 }, - { 0x5389, 0x15 }, - { 0x538a, 0x00 }, - { 0x538b, 0x31 }, - { 0x538c, 0x00 }, - { 0x538d, 0x00 }, - { 0x538e, 0x00 }, - { 0x538f, 0x0f }, - { 0x5390, 0x00 }, - { 0x5391, 0xab }, - { 0x5392, 0x00 }, - { 0x5393, 0xa2 }, - { 0x5394, 0x08 }, - { 0x5480, 0x14 }, - { 0x5481, 0x21 }, - { 0x5482, 0x36 }, - { 0x5483, 0x57 }, - { 0x5484, 0x65 }, - { 0x5485, 0x71 }, - { 0x5486, 0x7d }, - { 0x5487, 0x87 }, - { 0x5488, 0x91 }, - { 0x5489, 0x9a }, - { 0x548a, 0xaa }, - { 0x548b, 0xb8 }, - { 0x548c, 0xcd }, - { 0x548d, 0xdd }, - { 0x548e, 0xea }, - { 0x548f, 0x1d }, - { 0x5490, 0x05 }, - { 0x5491, 0x00 }, - { 0x5492, 0x04 }, - { 0x5493, 0x20 }, - { 0x5494, 0x03 }, - { 0x5495, 0x60 }, - { 0x5496, 0x02 }, - { 0x5497, 0xb8 }, - { 0x5498, 0x02 }, - { 0x5499, 0x86 }, - { 0x549a, 0x02 }, - { 0x549b, 0x5b }, - { 0x549c, 0x02 }, - { 0x549d, 0x3b }, - { 0x549e, 0x02 }, - { 0x549f, 0x1c }, - { 0x54a0, 0x02 }, - { 0x54a1, 0x04 }, - { 0x54a2, 0x01 }, - { 0x54a3, 0xed }, - { 0x54a4, 0x01 }, - { 0x54a5, 0xc5 }, - { 0x54a6, 0x01 }, - { 0x54a7, 0xa5 }, - { 0x54a8, 0x01 }, - { 0x54a9, 0x6c }, - { 0x54aa, 0x01 }, - { 0x54ab, 0x41 }, - { 0x54ac, 0x01 }, - { 0x54ad, 0x20 }, - { 0x54ae, 0x00 }, - { 0x54af, 0x16 }, - { 0x54b0, 0x01 }, - { 0x54b1, 0x20 }, - { 0x54b2, 0x00 }, - { 0x54b3, 0x10 }, - { 0x54b4, 0x00 }, - { 0x54b5, 0xf0 }, - { 0x54b6, 0x00 }, - { 0x54b7, 0xdf }, - { 0x5402, 0x3f }, - { 0x5403, 0x00 }, - { 0x3406, 0x00 }, - { 0x5180, 0xff }, - { 0x5181, 0x52 }, - { 0x5182, 0x11 }, - { 0x5183, 0x14 }, - { 0x5184, 0x25 }, - { 0x5185, 0x24 }, - { 0x5186, 0x06 }, - { 0x5187, 0x08 }, - { 0x5188, 0x08 }, - { 0x5189, 0x7c }, - { 0x518a, 0x60 }, - { 0x518b, 0xb2 }, - { 0x518c, 0xb2 }, - { 0x518d, 0x44 }, - { 0x518e, 0x3d }, - { 0x518f, 0x58 }, - { 0x5190, 0x46 }, - { 0x5191, 0xf8 }, - { 0x5192, 0x04 }, - { 0x5193, 0x70 }, - { 0x5194, 0xf0 }, - { 0x5195, 0xf0 }, - { 0x5196, 0x03 }, - { 0x5197, 0x01 }, - { 0x5198, 0x04 }, - { 0x5199, 0x12 }, - { 0x519a, 0x04 }, - { 0x519b, 0x00 }, - { 0x519c, 0x06 }, - { 0x519d, 0x82 }, - { 0x519e, 0x00 }, - { 0x5025, 0x80 }, - { 0x3a0f, 0x38 }, - { 0x3a10, 0x30 }, - { 0x3a1b, 0x3a }, - { 0x3a1e, 0x2e }, - { 0x3a11, 0x60 }, - { 0x3a1f, 0x10 }, - { 0x5688, 0xa6 }, - { 0x5689, 0x6a }, - { 0x568a, 0xea }, - { 0x568b, 0xae }, - { 0x568c, 0xa6 }, - { 0x568d, 0x6a }, - { 0x568e, 0x62 }, - { 0x568f, 0x26 }, - { 0x5583, 0x40 }, - { 0x5584, 0x40 }, - { 0x5580, 0x02 }, - { 0x5000, 0xcf }, - { 0x5800, 0x27 }, - { 0x5801, 0x19 }, - { 0x5802, 0x12 }, - { 0x5803, 0x0f }, - { 0x5804, 0x10 }, - { 0x5805, 0x15 }, - { 0x5806, 0x1e }, - { 0x5807, 0x2f }, - { 0x5808, 0x15 }, - { 0x5809, 0x0d }, - { 0x580a, 0x0a }, - { 0x580b, 0x09 }, - { 0x580c, 0x0a }, - { 0x580d, 0x0c }, - { 0x580e, 0x12 }, - { 0x580f, 0x19 }, - { 0x5810, 0x0b }, - { 0x5811, 0x07 }, - { 0x5812, 0x04 }, - { 0x5813, 0x03 }, - { 0x5814, 0x03 }, - { 0x5815, 0x06 }, - { 0x5816, 0x0a }, - { 0x5817, 0x0f }, - { 0x5818, 0x0a }, - { 0x5819, 0x05 }, - { 0x581a, 0x01 }, - { 0x581b, 0x00 }, - { 0x581c, 0x00 }, - { 0x581d, 0x03 }, - { 0x581e, 0x08 }, - { 0x581f, 0x0c }, - { 0x5820, 0x0a }, - { 0x5821, 0x05 }, - { 0x5822, 0x01 }, - { 0x5823, 0x00 }, - { 0x5824, 0x00 }, - { 0x5825, 0x03 }, - { 0x5826, 0x08 }, - { 0x5827, 0x0c }, - { 0x5828, 0x0e }, - { 0x5829, 0x08 }, - { 0x582a, 0x06 }, - { 0x582b, 0x04 }, - { 0x582c, 0x05 }, - { 0x582d, 0x07 }, - { 0x582e, 0x0b }, - { 0x582f, 0x12 }, - { 0x5830, 0x18 }, - { 0x5831, 0x10 }, - { 0x5832, 0x0c }, - { 0x5833, 0x0a }, - { 0x5834, 0x0b }, - { 0x5835, 0x0e }, - { 0x5836, 0x15 }, - { 0x5837, 0x19 }, - { 0x5838, 0x32 }, - { 0x5839, 0x1f }, - { 0x583a, 0x18 }, - { 0x583b, 0x16 }, - { 0x583c, 0x17 }, - { 0x583d, 0x1e }, - { 0x583e, 0x26 }, - { 0x583f, 0x53 }, - { 0x5840, 0x10 }, - { 0x5841, 0x0f }, - { 0x5842, 0x0d }, - { 0x5843, 0x0c }, - { 0x5844, 0x0e }, - { 0x5845, 0x09 }, - { 0x5846, 0x11 }, - { 0x5847, 0x10 }, - { 0x5848, 0x10 }, - { 0x5849, 0x10 }, - { 0x584a, 0x10 }, - { 0x584b, 0x0e }, - { 0x584c, 0x10 }, - { 0x584d, 0x10 }, - { 0x584e, 0x11 }, - { 0x584f, 0x10 }, - { 0x5850, 0x0f }, - { 0x5851, 0x0c }, - { 0x5852, 0x0f }, - { 0x5853, 0x10 }, - { 0x5854, 0x10 }, - { 0x5855, 0x0f }, - { 0x5856, 0x0e }, - { 0x5857, 0x0b }, - { 0x5858, 0x10 }, - { 0x5859, 0x0d }, - { 0x585a, 0x0d }, - { 0x585b, 0x0c }, - { 0x585c, 0x0c }, - { 0x585d, 0x0c }, - { 0x585e, 0x0b }, - { 0x585f, 0x0c }, - { 0x5860, 0x0c }, - { 0x5861, 0x0c }, - { 0x5862, 0x0d }, - { 0x5863, 0x08 }, - { 0x5864, 0x11 }, - { 0x5865, 0x18 }, - { 0x5866, 0x18 }, - { 0x5867, 0x19 }, - { 0x5868, 0x17 }, - { 0x5869, 0x19 }, - { 0x586a, 0x16 }, - { 0x586b, 0x13 }, - { 0x586c, 0x13 }, - { 0x586d, 0x12 }, - { 0x586e, 0x13 }, - { 0x586f, 0x16 }, - { 0x5870, 0x14 }, - { 0x5871, 0x12 }, - { 0x5872, 0x10 }, - { 0x5873, 0x11 }, - { 0x5874, 0x11 }, - { 0x5875, 0x16 }, - { 0x5876, 0x14 }, - { 0x5877, 0x11 }, - { 0x5878, 0x10 }, - { 0x5879, 0x0f }, - { 0x587a, 0x10 }, - { 0x587b, 0x14 }, - { 0x587c, 0x13 }, - { 0x587d, 0x12 }, - { 0x587e, 0x11 }, - { 0x587f, 0x11 }, - { 0x5880, 0x12 }, - { 0x5881, 0x15 }, - { 0x5882, 0x14 }, - { 0x5883, 0x15 }, - { 0x5884, 0x15 }, - { 0x5885, 0x15 }, - { 0x5886, 0x13 }, - { 0x5887, 0x17 }, - { 0x3710, 0x10 }, - { 0x3632, 0x51 }, - { 0x3702, 0x10 }, - { 0x3703, 0xb2 }, - { 0x3704, 0x18 }, - { 0x370b, 0x40 }, - { 0x370d, 0x03 }, - { 0x3631, 0x01 }, - { 0x3632, 0x52 }, - { 0x3606, 0x24 }, - { 0x3620, 0x96 }, - { 0x5785, 0x07 }, - { 0x3a13, 0x30 }, - { 0x3600, 0x52 }, - { 0x3604, 0x48 }, - { 0x3606, 0x1b }, - { 0x370d, 0x0b }, - { 0x370f, 0xc0 }, - { 0x3709, 0x01 }, - { 0x3823, 0x00 }, - { 0x5007, 0x00 }, - { 0x5009, 0x00 }, - { 0x5011, 0x00 }, - { 0x5013, 0x00 }, - { 0x519e, 0x00 }, - { 0x5086, 0x00 }, - { 0x5087, 0x00 }, - { 0x5088, 0x00 }, - { 0x5089, 0x00 }, - { 0x302b, 0x00 }, - { 0x3503, 0x07 }, - { 0x3011, 0x07 }, //10 fps 0x05 //15fps 0x07 - { 0x350c, 0x04 }, - { 0x350d, 0x58 }, - { 0x3801, 0x8a }, - { 0x3803, 0x0a }, - { 0x3804, 0x07 }, - { 0x3805, 0x80 }, - { 0x3806, 0x04 }, - { 0x3807, 0x39 },//0x3a - { 0x3808, 0x07 }, - { 0x3809, 0x80 }, - { 0x380a, 0x04 }, - { 0x380b, 0x38 }, - { 0x380c, 0x09 }, - { 0x380d, 0xd6 }, - { 0x380e, 0x04 }, - { 0x380f, 0x58 }, - { 0x381c, 0x11 }, - { 0x381d, 0xba }, - { 0x381e, 0x04 }, - { 0x381f, 0x48 }, - { 0x3820, 0x04 }, - { 0x3821, 0x18 }, - { 0x3c01, 0x80 }, - { 0x3c00, 0x04 }, - { 0x3a08, 0x14 }, - { 0x3a09, 0xe0 }, - { 0x3a0a, 0x11 }, - { 0x3a0b, 0x60 }, - { 0x3a0d, 0x04 }, - { 0x3a0e, 0x03 }, - { 0x5682, 0x07 }, - { 0x5683, 0x60 }, - { 0x5686, 0x04 }, - { 0x5687, 0x1c }, - { 0x5001, 0x7f }, - { 0x3503, 0x00 }, - { 0x3010, 0x10 }, - - { 0x460c, 0x20 }, - { 0x460b, 0x37 }, - { 0x471c, 0xd0 }, - { 0x471d, 0x05 }, - { 0x3815, 0x01 }, - { 0x3818, 0xc0 }, - { 0x501f, 0x00 }, - { 0x4300, 0x32 }, // set yuv, 0x30--> 0x32 - { 0x3002, 0x1c }, - { 0x3819, 0x80 }, - { 0x5002, 0xe0 }, -#else - //{0x3008,0x42}, //software sleep : Sensor vsync singal may not output if haven't sleep the sensor when transfer the array, - {0x3819,0x81}, - {0x3000,0xf8}, - {0x3001,0x48}, - {0x3002,0x5c}, - {0x3003,0x02}, - {0x3005,0xb7}, - {0x3006,0x43}, - {0x3007,0x37}, - {0x350c,0x04}, - {0x350d,0x58}, - {0x3602,0xe4}, - {0x3612,0xac}, - {0x3613,0x44}, - {0x3621,0x09}, - {0x3622,0x00},//60}, - {0x3623,0x22}, - {0x3604,0x40},//48}, - {0x3705,0xda}, - {0x370a,0x80}, - {0x3801,0x8a}, - {0x3803,0x0a}, - {0x3804,0x07}, - {0x3805,0x80}, - {0x3806,0x04}, - {0x3807,0x39}, - {0x3808,0x07}, - {0x3809,0x80}, - {0x380a,0x04}, - {0x380b,0x38}, - {0x380c,0x09}, - {0x380d,0xd6}, - {0x380e,0x04}, - {0x380f,0x58}, - {0x3810,0xc2}, - {0x3818,0xc0}, - {0x381c,0x11}, - {0x381d,0xba}, - {0x381e,0x04}, - {0x381f,0x48}, - {0x3820,0x04}, - {0x3821,0x18}, - {0x3824,0x11}, - {0x3825,0xac}, - {0x3826,0x00}, - {0x3827,0x0c}, - { 0x3011, 0x07 }, //10 fps 0x05 //15fps 0x08 - { 0x3c01, 0x80 }, - { 0x3c00, 0x04 }, - {0x3a08,0x14}, //0x05 - {0x3a09,0xe0}, //0xf5 - {0x3a0a,0x11}, //0x04 - {0x3a0b,0x60}, //0xf6 - {0x3a0d,0x04}, //0x0b - {0x3a0e,0x03}, //0x0d - {0x3a10,0x30}, - {0x3a1b,0x3c}, - {0x3a1e,0x30}, - {0x3a11,0x70}, - {0x3a1f,0x10}, - {0x401c,0x06}, - {0x5682,0x07}, - {0x5683,0x60}, - {0x5686,0x04}, - {0x5687,0x1c}, - {0x5001,0x7f}, - {0x589b,0x00}, - {0x589a,0xc0}, - {0x3503,0x00}, - {0x3010,0x30}, - {0x460c,0x22}, - {0x460b,0x37}, - {0x471c,0xd0}, - {0x471d,0x05}, - {0x3815,0x01}, - {0x3818,0xc0}, - {0x501f,0x00}, - {0x4300,0x32}, - {0x3002,0x1c}, - {0x3819,0x80}, - //{0x3008,0x02}, //software wake -#endif - { 0x0000, 0x00 } -}; - -/* 2592X1944 QSXGA */ -static struct reginfo sensor_qsxga[] = -{ - {0x3008,0x42}, //software sleep : Sensor vsync singal may not output if haven't sleep the sensor when transfer the array, - //{0x3503 , 0x7 }, - {0x3000 , 0x0 }, - {0x3001 , 0x0 }, - {0x3002 , 0x0 }, - {0x3003 , 0x0 }, - {0x3005 , 0xff}, - {0x3006 , 0xff}, - {0x3007 , 0x3f}, - {0x350c , 0x7 }, - {0x350d , 0xd0}, - {0x3602 , 0xe4}, - {0x3612 , 0xac}, - {0x3613 , 0x44}, - {0x3621 , 0x27}, - {0x3622 , 0x8 }, - {0x3623 , 0x22}, - {0x3604 , 0x60}, - {0x3705 , 0xda}, - {0x370a , 0x80}, - {0x3801 , 0x8a}, - {0x3803 , 0xa }, - {0x3804 , 0xa }, - {0x3805 , 0x20}, - {0x3806 , 0x7 }, - {0x3807 , 0x98}, - {0x3808 , 0xa }, - {0x3809 , 0x20}, - {0x380a , 0x7 }, - {0x380b , 0x98}, - {0x380c , 0xc }, - {0x380d , 0x80}, - {0x380e , 0x7 }, - {0x380f , 0xd0}, - {0x3810 , 0xc2}, - {0x3815 , 0x1 }, - {0x3818 , 0xc0}, - {0x3824 , 0x1 }, - {0x3827 , 0xa }, - {0x3a00 , 0x78}, - {0x3a0d , 0x10}, - {0x3a0e , 0xd }, - {0x3a10 , 0x32}, - {0x3a1b , 0x40}, - {0x3a1e , 0x2e}, - {0x3a11 , 0xd0}, - {0x3a1f , 0x40}, - {0x3a00 , 0x78}, - {0x460b , 0x37}, - {0x471d , 0x5 }, - {0x4713 , 0x2 }, - {0x471c , 0xd0}, - {0x5682 , 0xa }, - {0x5683 , 0x20}, - {0x5686 , 0x7 }, - {0x5687 , 0x98}, - {0x5001 , 0x1 }, - {0x589b , 0x0 }, - {0x589a , 0xc0}, - {0x4407 , 0xc }, - {0x589b , 0x0 }, - {0x589a , 0xc0}, - {0x3002 , 0x0 }, - {0x3002 , 0x0 }, - {0x3503 , 0x0 }, - {0x3010 , 0x10}, - {0x3009 , 0x1 }, - {0x300a , 0x56}, - {0x3008,0x02}, //software wake - {0x0000 ,0x00} -}; -/* 2048*1536 QXGA */ -static struct reginfo sensor_qxga[] = -{ - {0x3008,0x42}, //software sleep : Sensor vsync singal may not output if haven't sleep the sensor when transfer the array, - //{0x3503 , 0x7 }, - {0x3000 , 0x0 }, - {0x3001 , 0x0 }, - {0x3002 , 0x0 }, - {0x3003 , 0x0 }, - {0x3005 , 0xff}, - {0x3006 , 0xff}, - {0x3007 , 0x3f}, - {0x350c , 0x7 }, - {0x350d , 0xd0}, - {0x3602 , 0xe4}, - {0x3612 , 0xac}, - {0x3613 , 0x44}, - {0x3621 , 0x27}, - {0x3622 , 0x8 }, - {0x3623 , 0x22}, - {0x3604 , 0x60}, - {0x3705 , 0xda}, - {0x370a , 0x80}, - {0x3801 , 0x8a}, - {0x3803 , 0xa }, - {0x3804 , 0xa }, - {0x3805 , 0x20}, - {0x3806 , 0x7 }, - {0x3807 , 0x98}, - {0x3808 , 0xa }, - {0x3809 , 0x20}, - {0x380a , 0x7 }, - {0x380b , 0x98}, - {0x380c , 0xc }, - {0x380d , 0x80}, - {0x380e , 0x7 }, - {0x380f , 0xd0}, - {0x3810 , 0xc2}, - {0x3815 , 0x1 }, - {0x3818 , 0xc0}, - {0x3824 , 0x1 }, - {0x3827 , 0xa }, - {0x3a00 , 0x78}, - {0x3a0d , 0x10}, - {0x3a0e , 0xd }, - {0x3a10 , 0x32}, - {0x3a1b , 0x40}, - {0x3a1e , 0x2e}, - {0x3a11 , 0xd0}, - {0x3a1f , 0x40}, - {0x3a00 , 0x78}, - {0x460b , 0x37}, - {0x471d , 0x5 }, - {0x4713 , 0x2 }, - {0x471c , 0xd0}, - {0x5682 , 0xa }, - {0x5683 , 0x20}, - {0x5686 , 0x7 }, - {0x5687 , 0x98}, - {0x5001 , 0x1 }, - {0x589b , 0x0 }, - {0x589a , 0xc0}, - {0x4407 , 0xc }, - {0x589b , 0x0 }, - {0x589a , 0xc0}, - {0x3002 , 0x0 }, - {0x3002 , 0x0 }, - {0x3503 , 0x0 }, - {0x3010 , 0x10}, - {0x3009 , 0x1 }, - {0x300a , 0x56}, - - {0x3800 ,0x1 }, - {0x3801 ,0x8A}, - {0x3802 ,0x0 }, - {0x3803 ,0xA }, - {0x3804 ,0xA }, - {0x3805 ,0x20}, - {0x3806 ,0x7 }, - {0x3807 ,0x98}, - {0x3808 ,0x8 }, - {0x3809 ,0x0 }, - {0x380a ,0x6 }, - {0x380b ,0x0 }, - {0x380c ,0xc }, - {0x380d ,0x80}, - {0x380e ,0x7 }, - {0x380f ,0xd0}, - {0x5001 ,0x7f}, - {0x5680 ,0x0 }, - {0x5681 ,0x0 }, - {0x5682 ,0xA }, - {0x5683 ,0x20}, - {0x5684 ,0x0 }, - {0x5685 ,0x0 }, - {0x5686 ,0x7 }, - {0x5687 ,0x98}, - {0x3008,0x02}, //software wake - {0x0000 ,0x00} -}; - -/* 1600X1200 UXGA */ -static struct reginfo sensor_uxga[] = -{ - {0x3008,0x42}, //software sleep : Sensor vsync singal may not output if haven't sleep the sensor when transfer the array, - //{0x3503 , 0x7 }, - {0x3000 , 0x0 }, - {0x3001 , 0x0 }, - {0x3002 , 0x0 }, - {0x3003 , 0x0 }, - {0x3005 , 0xff}, - {0x3006 , 0xff}, - {0x3007 , 0x3f}, - {0x350c , 0x7 }, - {0x350d , 0xd0}, - {0x3602 , 0xe4}, - {0x3612 , 0xac}, - {0x3613 , 0x44}, - {0x3621 , 0x27}, - {0x3622 , 0x8 }, - {0x3623 , 0x22}, - {0x3604 , 0x60}, - {0x3705 , 0xda}, - {0x370a , 0x80}, - {0x3801 , 0x8a}, - {0x3803 , 0xa }, - {0x3804 , 0xa }, - {0x3805 , 0x20}, - {0x3806 , 0x7 }, - {0x3807 , 0x98}, - {0x3808 , 0xa }, - {0x3809 , 0x20}, - {0x380a , 0x7 }, - {0x380b , 0x98}, - {0x380c , 0xc }, - {0x380d , 0x80}, - {0x380e , 0x7 }, - {0x380f , 0xd0}, - {0x3810 , 0xc2}, - {0x3815 , 0x1 }, - {0x3818 , 0xc0}, - {0x3824 , 0x1 }, - {0x3827 , 0xa }, - {0x3a00 , 0x78}, - {0x3a0d , 0x10}, - {0x3a0e , 0xd }, - {0x3a10 , 0x32}, - {0x3a1b , 0x40}, - {0x3a1e , 0x2e}, - {0x3a11 , 0xd0}, - {0x3a1f , 0x40}, - {0x3a00 , 0x78}, - {0x460b , 0x37}, - {0x471d , 0x5 }, - {0x4713 , 0x2 }, - {0x471c , 0xd0}, - {0x5682 , 0xa }, - {0x5683 , 0x20}, - {0x5686 , 0x7 }, - {0x5687 , 0x98}, - {0x5001 , 0x1 }, - {0x589b , 0x0 }, - {0x589a , 0xc0}, - {0x4407 , 0xc }, - {0x589b , 0x0 }, - {0x589a , 0xc0}, - {0x3002 , 0x0 }, - {0x3002 , 0x0 }, - {0x3503 , 0x0 }, - {0x3010 , 0x10}, - {0x3009 , 0x1 }, - {0x300a , 0x56}, - - {0x3800 ,0x1 }, - {0x3801 ,0x8A}, - {0x3802 ,0x0 }, - {0x3803 ,0xA }, - {0x3804 ,0xA }, - {0x3805 ,0x20}, - {0x3806 ,0x7 }, - {0x3807 ,0x98}, - {0x3808 ,0x6 }, - {0x3809 ,0x40}, - {0x380a ,0x4 }, - {0x380b ,0xb0}, - {0x380c ,0xc }, - {0x380d ,0x80}, - {0x380e ,0x7 }, - {0x380f ,0xd0}, - {0x5001 ,0x7f}, - {0x5680 ,0x0 }, - {0x5681 ,0x0 }, - {0x5682 ,0xA }, - {0x5683 ,0x20}, - {0x5684 ,0x0 }, - {0x5685 ,0x0 }, - {0x5686 ,0x7 }, - {0x5687 ,0x98}, - {0x3008,0x02}, //software wake - {0x0000 ,0x00} -}; -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {0x0000,0x00} -}; -/* 1024X768 XGA */ -static struct reginfo sensor_xga[] = -{ - {0x3008,0x42}, //software sleep : Sensor vsync singal may not output if haven't sleep the sensor when transfer the array, - //{0x3503 , 0x7 }, - {0x3000 , 0x0 }, - {0x3001 , 0x0 }, - {0x3002 , 0x0 }, - {0x3003 , 0x0 }, - {0x3005 , 0xff}, - {0x3006 , 0xff}, - {0x3007 , 0x3f}, - {0x350c , 0x7 }, - {0x350d , 0xd0}, - {0x3602 , 0xe4}, - {0x3612 , 0xac}, - {0x3613 , 0x44}, - {0x3621 , 0x27}, - {0x3622 , 0x8 }, - {0x3623 , 0x22}, - {0x3604 , 0x60}, - {0x3705 , 0xda}, - {0x370a , 0x80}, - {0x3801 , 0x8a}, - {0x3803 , 0xa }, - {0x3804 , 0xa }, - {0x3805 , 0x20}, - {0x3806 , 0x7 }, - {0x3807 , 0x98}, - {0x3808 , 0xa }, - {0x3809 , 0x20}, - {0x380a , 0x7 }, - {0x380b , 0x98}, - {0x380c , 0xc }, - {0x380d , 0x80}, - {0x380e , 0x7 }, - {0x380f , 0xd0}, - {0x3810 , 0xc2}, - {0x3815 , 0x1 }, - {0x3818 , 0xc0}, - {0x3824 , 0x1 }, - {0x3827 , 0xa }, - {0x3a00 , 0x78}, - {0x3a0d , 0x10}, - {0x3a0e , 0xd }, - {0x3a10 , 0x32}, - {0x3a1b , 0x40}, - {0x3a1e , 0x2e}, - {0x3a11 , 0xd0}, - {0x3a1f , 0x40}, - {0x3a00 , 0x78}, - {0x460b , 0x37}, - {0x471d , 0x5 }, - {0x4713 , 0x2 }, - {0x471c , 0xd0}, - {0x5682 , 0xa }, - {0x5683 , 0x20}, - {0x5686 , 0x7 }, - {0x5687 , 0x98}, - {0x5001 , 0x1 }, - {0x589b , 0x0 }, - {0x589a , 0xc0}, - {0x4407 , 0xc }, - {0x589b , 0x0 }, - {0x589a , 0xc0}, - {0x3002 , 0x0 }, - {0x3002 , 0x0 }, - {0x3503 , 0x0 }, - {0x3010 , 0x10}, - {0x3009 , 0x1 }, - {0x300a , 0x56}, - - {0x3800 ,0x1 }, - {0x3801 ,0x8A}, - {0x3802 ,0x0 }, - {0x3803 ,0xA }, - {0x3804 ,0xA }, - {0x3805 ,0x20}, - {0x3806 ,0x7 }, - {0x3807 ,0x98}, - {0x3808 ,0x5 }, - {0x3809 ,0x0 }, - {0x380a ,0x4 }, - {0x380b ,0x0 }, - {0x380c ,0xc }, - {0x380d ,0x80}, - {0x380e ,0x7 }, - {0x380f ,0xd0}, - {0x5001 ,0x7f}, - {0x5680 ,0x0 }, - {0x5681 ,0x0 }, - {0x5682 ,0xA }, - {0x5683 ,0x20}, - {0x5684 ,0x0 }, - {0x5685 ,0x0 }, - {0x5686 ,0x7 }, - {0x5687 ,0x98}, - {0x3008,0x02}, //software wake - {0x0000,0x00} -}; - -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - -{0x3819,0x81}, -{0x3000,0xf8}, -{0x3001,0x48}, -{0x3002,0x5c}, -{0x3003,0x02}, -{0x3005,0xb7}, -{0x3006,0x43}, -{0x3007,0x37}, -{0x350c,0x07},//03 -{0x350d,0xd0},//e8 -{0x3602,0xfc}, -{0x3612,0xff}, -{0x3613,0x00}, -{0x3621,0xc7},//87 -{0x3622,0x00},//60 -{0x3623,0x22},//01 -{0x3604,0x40},//48 -{0x3705,0xdb}, -{0x370a,0x81}, -{0x3801,0x50}, -{0x3803,0x08}, -{0x3804,0x05}, -{0x3805,0x00}, -{0x3806,0x03}, -{0x3807,0xc0}, -{0x3808,0x03}, -{0x3809,0x20}, -{0x380a,0x02}, -{0x380b,0x58}, -{0x380c,0x0c}, -{0x380d,0x80}, -{0x380e,0x03}, -{0x380f,0xe8}, -{0x3810,0x40},//c0 -{0x3815,0x02}, -{0x3818,0xc1}, -{0x381c,0x21}, -{0x381d,0x50}, -{0x381e,0x01}, -{0x381f,0x20}, -{0x3820,0x00}, -{0x3821,0x00}, -{0x3824,0x11}, -{0x3825,0xb4}, -{0x3826,0x00}, -{0x3827,0x08}, -{0x3a00,0x78}, - { 0x3011, 0x08 }, - { 0x3c01, 0x00 }, - { 0x3c00, 0x00 }, -{0x3a08,0x09}, -{0x3a09,0x60}, -{0x3a0a,0x07}, -{0x3a0b,0xd0}, -{0x3a0d,0x08}, -{0x3a0e,0x06}, -{0x3a10,0x30}, -{0x3a1b,0x3c}, -{0x3a1e,0x30}, -{0x3a11,0x70}, -{0x3a1f,0x10}, -{0x3010,0x10}, -{0x460b,0x37}, -{0x471d,0x05}, -{0x4713,0x02}, -{0x471c,0xd0}, -{0x501f,0x00}, -{0x4300,0x32}, -{0x3002,0x5c}, -{0x5682,0x05}, -{0x5683,0x00}, -{0x5686,0x03}, -{0x5687,0xc0}, -{0x5001,0x7f}, -{0x589b,0x04}, -{0x589a,0xc5}, -{0x4407,0x04}, -{0x3002,0x5c}, -{0x460c,0x22}, -{0x3815,0x03}, -{0x3000,0x00}, -{0x3819,0x80}, -{0x3503,0x00}, - {0x0000 ,0x00} -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - {0x0000,0x00} -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {0x3800 ,0x1 }, - {0x3801 ,0x50}, - {0x3802 ,0x0 }, - {0x3803 ,0x8 }, - {0x3804 ,0x4 }, - {0x3805 ,0x96}, - {0x3806 ,0x3 }, - {0x3807 ,0xc0}, - {0x3808 ,0x1 }, - {0x3809 ,0x60}, - {0x380a ,0x1 }, - {0x380b ,0x20}, - {0x380c ,0xc }, - {0x380d ,0x80}, - {0x380e ,0x3 }, - {0x380f ,0xe8}, - {0x5001 ,0x7f}, - {0x5680 ,0x0 }, - {0x5681 ,0x0 }, - {0x5682 ,0x4 }, - {0x5683 ,0x96}, - {0x5684 ,0x0 }, - {0x5685 ,0x0 }, - {0x5686 ,0x3 }, - {0x5687 ,0xc0}, - {0x0000,0x00} -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - {0x0000,0x00} -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {0x3800 ,0x1 }, - {0x3801 ,0x50}, - {0x3802 ,0x0 }, - {0x3803 ,0x8 }, - {0x3804 ,0x4 }, - {0x3805 ,0x96}, - {0x3806 ,0x3 }, - {0x3807 ,0xc0}, - {0x3808 ,0x0 }, - {0x3809 ,0xb0}, - {0x380a ,0x0 }, - {0x380b ,0x90}, - {0x380c ,0xc }, - {0x380d ,0x80}, - {0x380e ,0x3 }, - {0x380f ,0xe8}, - {0x5001 ,0x7f}, - {0x5680 ,0x0 }, - {0x5681 ,0x0 }, - {0x5682 ,0x4 }, - {0x5683 ,0x96}, - {0x5684 ,0x0 }, - {0x5685 ,0x0 }, - {0x5686 ,0x3 }, - {0x5687 ,0xc0}, - {0x0000,0x00} -}; -#endif -#if 0 -/* 160X120 QQVGA*/ -static struct reginfo ov2655_qqvga[] = -{ - - {0x300E, 0x34}, - {0x3011, 0x01}, - {0x3012, 0x10}, - {0x302a, 0x02}, - {0x302b, 0xE6}, - {0x306f, 0x14}, - {0x3362, 0x90}, - - {0x3070, 0x5d}, - {0x3072, 0x5d}, - {0x301c, 0x07}, - {0x301d, 0x07}, - - {0x3020, 0x01}, - {0x3021, 0x18}, - {0x3022, 0x00}, - {0x3023, 0x06}, - {0x3024, 0x06}, - {0x3025, 0x58}, - {0x3026, 0x02}, - {0x3027, 0x61}, - {0x3088, 0x00}, - {0x3089, 0xa0}, - {0x308a, 0x00}, - {0x308b, 0x78}, - {0x3316, 0x64}, - {0x3317, 0x25}, - {0x3318, 0x80}, - {0x3319, 0x08}, - {0x331a, 0x0a}, - {0x331b, 0x07}, - {0x331c, 0x80}, - {0x331d, 0x38}, - {0x3100, 0x00}, - {0x3302, 0x11}, - - {0x0, 0x0}, -}; - - - -static struct reginfo ov2655_Sharpness_auto[] = -{ - {0x3306, 0x00}, -}; - -static struct reginfo ov2655_Sharpness1[] = -{ - {0x3306, 0x08}, - {0x3371, 0x00}, -}; - -static struct reginfo ov2655_Sharpness2[][3] = -{ - //Sharpness 2 - {0x3306, 0x08}, - {0x3371, 0x01}, -}; - -static struct reginfo ov2655_Sharpness3[] = -{ - //default - {0x3306, 0x08}, - {0x332d, 0x02}, -}; -static struct reginfo ov2655_Sharpness4[]= -{ - //Sharpness 4 - {0x3306, 0x08}, - {0x332d, 0x03}, -}; - -static struct reginfo ov2655_Sharpness5[] = -{ - //Sharpness 5 - {0x3306, 0x08}, - {0x332d, 0x04}, -}; -#endif - -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {0x4300, 0x30}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {0x4300, 0x32}, - {0x0000, 0x00} -}; - - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0x3406 ,0x0 }, - {0x5192 ,0x04}, - {0x5191 ,0xf8}, - {0x518d ,0x26}, - {0x518f ,0x42}, - {0x518e ,0x2b}, - {0x5190 ,0x42}, - {0x518b ,0xd0}, - {0x518c ,0xbd}, - {0x5187 ,0x18}, - {0x5188 ,0x18}, - {0x5189 ,0x56}, - {0x518a ,0x5c}, - {0x5186 ,0x1c}, - {0x5181 ,0x50}, - {0x5184 ,0x20}, - {0x5182 ,0x11}, - {0x5183 ,0x0 }, - {0x0000,0x00} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0x3406, 0x01}, - {0x3400, 0x07}, - {0x3401, 0x88}, - {0x3402, 0x04}, - {0x3403, 0x00}, - {0x3404, 0x05}, - {0x3405, 0x00}, - {0x0000, 0x00} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x3406, 0x01}, - {0x3400, 0x07}, - {0x3401, 0x32}, - {0x3402, 0x04}, - {0x3403, 0x00}, - {0x3404, 0x05}, - {0x3405, 0x36}, - {0x0000, 0x00} -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0x3406, 0x01}, - {0x3400, 0x06}, - {0x3401, 0x13}, - {0x3402, 0x04}, - {0x3403, 0x00}, - {0x3404, 0x07}, - {0x3405, 0xe2}, - {0x0000, 0x00} - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x3406, 0x01}, - {0x3400, 0x04}, - {0x3401, 0x88}, - {0x3402, 0x04}, - {0x3403, 0x00}, - {0x3404, 0x08}, - {0x3405, 0xb6}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness1[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - {0x0000, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x5001, 0x7f}, - {0x5580, 0x00}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {0x5001, 0xff}, - {0x5580, 0x18}, - {0x5585, 0x80}, - {0x5586, 0x80}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x5001, 0xff}, - {0x5580, 0x18}, - {0x5585, 0x40}, - {0x5586, 0xa0}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - //Negative - {0x5001, 0xff}, - {0x5580, 0x40}, - {0x0000, 0x00} -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - // Bluish - {0x5001, 0xff}, - {0x5580, 0x18}, - {0x5585, 0xa0}, - {0x5586, 0x40}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish - {0x5001, 0xff}, - {0x5580, 0x18}, - {0x5585, 0x60}, - {0x5586, 0x60}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure1[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {0x0000, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast2[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - {0x0000, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - {0x0000, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {0x0000, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {0x0000, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {0x0000, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ - {0x3a00, 0x78}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_SceneNight[] = -{ - - //15fps ~ 3.75fps night mode for 60/50Hz light environment, 24Mhz clock input,24Mzh pclk - {0x3011, 0x08}, - {0x3012, 0x00}, - {0x3010, 0x10}, - {0x460c, 0x22}, - {0x380c, 0x0c}, - {0x380d, 0x80}, - {0x3a00, 0x7c}, - {0x3a08, 0x09}, - {0x3a09, 0x60}, - {0x3a0a, 0x07}, - {0x3a0b, 0xd0}, - {0x3a0d, 0x08}, - {0x3a0e, 0x06}, - {0x3a03, 0xfa}, - {0x0000, 0x00} - -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom1[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom2[] = -{ - {0x0, 0x0}, -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {0x0, 0x0}, -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL}; -#endif -static struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - { - .id = V4L2_CID_FOCUS_AUTO, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Focus Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #if CONFIG_SENSOR_FocusContinues - { - .id = V4L2_CID_FOCUS_CONTINUOUS, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Focus Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_deactivate(struct i2c_client *client); -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf); -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; -enum sensor_wq_cmd -{ - WqCmd_af_init, - WqCmd_af_single, - WqCmd_af_special_pos, - WqCmd_af_far_pos, - WqCmd_af_near_pos, - WqCmd_af_continues, - WqCmd_af_update_zone -}; -enum sensor_wq_result -{ - WqRet_success = 0, - WqRet_fail = -1, - WqRet_inval = -2 -}; -struct sensor_work -{ - struct i2c_client *client; - struct delayed_work dwork; - enum sensor_wq_cmd cmd; - wait_queue_head_t done; - enum sensor_wq_result result; - bool wait; - int var; -}; -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int auto_focus; - int affm_reinit; - int flash; - int exposure; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - bool snap2preview; - bool video2preview; - struct reginfo *winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int enable; - unsigned int funmodule_state; -} sensor_info_priv_t; - - - -struct sensor_parameter -{ - unsigned short int preview_maxlines; - unsigned short int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int capture_framerate; - unsigned short int preview_framerate; -}; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - struct sensor_parameter parameter; - struct workqueue_struct *sensor_wq; - struct mutex wq_lock; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, u16 reg, u8 val) -{ - int err,cnt; - u8 buf[3]; - struct i2c_msg msg[1]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - buf[2] = val; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u16 reg, u8 *val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[2]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_Focus - struct sensor *sensor = to_sensor(client); -#endif -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - while (regarray[i].reg != 0) - { - #if CONFIG_SENSOR_Focus - if ((regarray == sensor_af_firmware) && (sensor->info_priv.enable == 0)) { - SENSOR_DG("%s disable, Download af firmware terminated!\n",SENSOR_NAME_STRING()); - err = -EINVAL; - goto sensor_write_array_end; - } - #endif - - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - - i++; - } - - #if CONFIG_SENSOR_Focus - if (((regarray->reg == SEQUENCE_PROPERTY) && (regarray->val == SEQUENCE_INIT)) - || (regarray == sensor_init_data)) { - sensor->info_priv.affm_reinit = 1; - } - #endif - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != 0) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif -#if CONFIG_SENSOR_Focus -struct af_cmdinfo -{ - char cmd_tag; - char cmd_para[4]; - char validate_bit; -}; -static int sensor_af_cmdset(struct i2c_client *client, int cmd_main, struct af_cmdinfo *cmdinfo) -{ - int i; - char read_tag=0xff,cnt; - struct sensor *sensor = to_sensor(client); - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) == 0) { - SENSOR_TR("%s %s cancel,because auto focus firmware is invalidate!",SENSOR_NAME_STRING(), __FUNCTION__); - goto sensor_af_cmdset_err; - } - - if (cmdinfo) { - if (cmdinfo->validate_bit & 0x80) { - if (sensor_write(client, CMD_TAG_Reg, cmdinfo->cmd_tag)) { - SENSOR_TR("%s write CMD_TAG_Reg(main:0x%x tag:0x%x) error!\n",SENSOR_NAME_STRING(),cmd_main,cmdinfo->cmd_tag); - goto sensor_af_cmdset_err; - } - SENSOR_DG("%s write CMD_TAG_Reg(main:0x%x tag:0x%x) success!\n",SENSOR_NAME_STRING(),cmd_main,cmdinfo->cmd_tag); - } - for (i=0; i<4; i++) { - if (cmdinfo->validate_bit & (1<cmd_para[i])) { - SENSOR_TR("%s write CMD_PARA_Reg(main:0x%x para%d:0x%x) error!\n",SENSOR_NAME_STRING(),cmd_main,i,cmdinfo->cmd_para[i]); - goto sensor_af_cmdset_err; - } - SENSOR_DG("%s write CMD_PARA_Reg(main:0x%x para%d:0x%x) success!\n",SENSOR_NAME_STRING(),cmd_main,i,cmdinfo->cmd_para[i]); - } - } - } else { - if (sensor_write(client, CMD_TAG_Reg, 0xff)) { - SENSOR_TR("%s write CMD_TAG_Reg(main:0x%x no tag) error!\n",SENSOR_NAME_STRING(),cmd_main); - goto sensor_af_cmdset_err; - } - SENSOR_DG("%s write CMD_TAG_Reg(main:0x%x no tag) success!\n",SENSOR_NAME_STRING(),cmd_main); - } - - if (sensor_write(client, CMD_MAIN_Reg, cmd_main)) { - SENSOR_TR("%s write CMD_MAIN_Reg(main:0x%x) error!\n",SENSOR_NAME_STRING(),cmd_main); - goto sensor_af_cmdset_err; - } - - cnt = 0; - do - { - msleep(5); - if (sensor_read(client,CMD_TAG_Reg,&read_tag)){ - SENSOR_TR("%s[%d] read TAG failed\n",SENSOR_NAME_STRING(),__LINE__); - break; - } - } while((read_tag != 0x00)&& (cnt++<100)); - - SENSOR_DG("%s write CMD_MAIN_Reg(main:0x%x read tag:0x%x) success!\n",SENSOR_NAME_STRING(),cmd_main,read_tag); - return 0; -sensor_af_cmdset_err: - return -1; -} - -static int sensor_af_idlechk(struct i2c_client *client) -{ - int ret = 0; - char state,cnt; - struct sensor *sensor = to_sensor(client); - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) == 0) { - SENSOR_TR("%s %s cancel,because auto focus firmware is invalidate!",SENSOR_NAME_STRING(), __FUNCTION__); - ret = -1; - goto sensor_af_idlechk_end; - } - - cnt = 0; - do - { - ret = sensor_read(client, STA_FOCUS_Reg, &state); - if (ret != 0){ - SENSOR_TR("%s[%d] read focus_status failed\n",SENSOR_NAME_STRING(),__LINE__); - ret = -1; - goto sensor_af_idlechk_end; - } - - if (state != S_IDLE) { - sensor_af_cmdset(client, ReturnIdle_Cmd, NULL); - msleep(1); - cnt++; - } - } while((state != S_IDLE)&& (cnt<20)); - - ret = (state == S_IDLE) ? 0 : -1; - -sensor_af_idlechk_end: - return ret; -} - -static int sensor_af_single(struct i2c_client *client) -{ - int ret = 0; - char state,cnt; - struct sensor *sensor = to_sensor(client); - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) == 0) { - SENSOR_TR("%s %s cancel,because auto focus firmware is invalidate!",SENSOR_NAME_STRING(), __FUNCTION__); - ret = -1; - goto sensor_af_single_end; - } - - if (sensor_af_idlechk(client)) - goto sensor_af_single_end; - - if (sensor_af_cmdset(client, SingleFocus_Cmd, NULL)) { - SENSOR_TR("%s single focus mode set error!\n",SENSOR_NAME_STRING()); - ret = -1; - goto sensor_af_single_end; - } - - cnt = 0; - do - { - if (cnt != 0) { - msleep(1); - } - cnt++; - ret = sensor_read(client, STA_FOCUS_Reg, &state); - if (ret != 0){ - SENSOR_TR("%s[%d] read focus_status failed\n",SENSOR_NAME_STRING(),__LINE__); - ret = -1; - goto sensor_af_single_end; - } - }while((state == S_FOCUSING) && (cnt<100)); - - if (state != S_FOCUSED) { - SENSOR_TR("%s[%d] focus state(0x%x) is error!\n",SENSOR_NAME_STRING(),__LINE__,state); - ret = -1; - goto sensor_af_single_end; - } -sensor_af_single_end: - return ret; -} - -static int sensor_af_const(struct i2c_client *client) -{ - int ret = 0; - struct sensor *sensor = to_sensor(client); - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) == 0) { - SENSOR_TR("%s %s cancel,because auto focus firmware is invalidate!",SENSOR_NAME_STRING(), __FUNCTION__); - ret = -1; - goto sensor_af_const_end; - } - - if (sensor_af_idlechk(client)) - goto sensor_af_const_end; - - if (sensor_af_cmdset(client, ConstFocus_Cmd, NULL)) { - SENSOR_TR("%s const focus mode set error!\n",SENSOR_NAME_STRING()); - ret = -1; - goto sensor_af_const_end; - } -sensor_af_const_end: - return ret; -} -#if 0 -static int sensor_af_pause2capture(struct i2c_client *client) -{ - int ret = 0; - char state,cnt; - struct sensor *sensor = to_sensor(client); - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) == 0) { - SENSOR_TR("%s %s cancel,because auto focus firmware is invalidate!",SENSOR_NAME_STRING(), __FUNCTION__); - ret = -1; - goto sensor_af_pause_end; - } - - if (sensor_af_cmdset(client, PauseFocus_Cmd, NULL)) { - SENSOR_TR("%s pause focus mode set error!\n",SENSOR_NAME_STRING()); - ret = -1; - goto sensor_af_pause_end; - } - - cnt = 0; - do - { - if (cnt != 0) { - msleep(1); - } - cnt++; - ret = sensor_read(client, STA_FOCUS_Reg, &state); - if (ret != 0){ - SENSOR_TR("%s[%d] read focus_status failed\n",SENSOR_NAME_STRING(),__LINE__); - ret = -1; - goto sensor_af_pause_end; - } - }while((state != S_CAPTURE) && (cnt<100)); - - if (state != S_CAPTURE) { - SENSOR_TR("%s[%d] focus state(0x%x) is error!\n",SENSOR_NAME_STRING(),__LINE__,state); - ret = -1; - goto sensor_af_pause_end; - } -sensor_af_pause_end: - return ret; -} -#endif - -static int sensor_af_zoneupdate(struct i2c_client *client) -{ - int ret = 0; - struct sensor *sensor = to_sensor(client); - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) == 0) { - SENSOR_TR("%s %s cancel,because auto focus firmware is invalidate!",SENSOR_NAME_STRING(), __FUNCTION__); - ret = -1; - goto sensor_af_zoneupdate_end; - } - - if (sensor_af_idlechk(client)) - goto sensor_af_zoneupdate_end; - - if (sensor_af_cmdset(client, UpdateZone_Cmd, NULL)) { - SENSOR_TR("%s update zone fail!\n",SENSOR_NAME_STRING()); - ret = -1; - goto sensor_af_zoneupdate_end; - } - -sensor_af_zoneupdate_end: - return ret; -} -static int sensor_af_init(struct i2c_client *client) -{ - int ret = 0; - char state,cnt; - - ret = sensor_write_array(client, sensor_af_firmware); - if (ret != 0) { - SENSOR_TR("%s Download firmware failed\n",SENSOR_NAME_STRING()); - ret = -1; - goto sensor_af_init_end; - } - - cnt = 0; - do - { - if (cnt != 0) { - msleep(1); - } - cnt++; - ret = sensor_read(client, STA_FOCUS_Reg, &state); - if (ret != 0){ - SENSOR_TR("%s[%d] read focus_status failed\n",SENSOR_NAME_STRING(),__LINE__); - ret = -1; - goto sensor_af_init_end; - } - }while((state == S_STARTUP) && (cnt<100)); - - if (state != S_IDLE) { - SENSOR_TR("%s focus state(0x%x) is error!\n",SENSOR_NAME_STRING(),state); - ret = -1; - goto sensor_af_init_end; - } - -sensor_af_init_end: - SENSOR_DG("%s %s ret:0x%x \n",SENSOR_NAME_STRING(),__FUNCTION__,ret); - return ret; -} - -static int sensor_af_downfirmware(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct af_cmdinfo cmdinfo; - int ret=0, focus_pos = 0xfe; - struct soc_camera_device *icd = client->dev.platform_data; - struct v4l2_mbus_framefmt mf; - - SENSOR_DG("%s %s Enter\n",SENSOR_NAME_STRING(), __FUNCTION__); - - if (sensor_af_init(client)) { - sensor->info_priv.funmodule_state &= (~SENSOR_AF_IS_OK); - ret = -1; - } else { - sensor->info_priv.funmodule_state |= SENSOR_AF_IS_OK; - - mf.width = icd->user_width; - mf.height = icd->user_height; - mf.code = sensor->info_priv.fmt.code; - mf.colorspace = sensor->info_priv.fmt.colorspace; - mf.field = V4L2_FIELD_NONE; - if (sensor_fmt_videochk(NULL, &mf) == true) { /* ddl@rock-chips.com: focus mode fix const auto focus in video */ - ret = sensor_af_const(client); - } else { - switch (sensor->info_priv.auto_focus) - { - case SENSOR_AF_MODE_INFINITY: - { - focus_pos = 0x00; - } - case SENSOR_AF_MODE_MACRO: - { - if (focus_pos != 0x00) - focus_pos = 0xff; - - sensor_af_idlechk(client); - cmdinfo.cmd_tag = StepFocus_Spec_Tag; - cmdinfo.cmd_para[0] = focus_pos; - cmdinfo.validate_bit = 0x81; - ret = sensor_af_cmdset(client, StepMode_Cmd, &cmdinfo); - break; - } - case SENSOR_AF_MODE_AUTO: - { - ret = sensor_af_single(client); - break; - } - case SENSOR_AF_MODE_CONTINUOUS: - { - ret = sensor_af_const(client); - break; - } - case SENSOR_AF_MODE_CLOSE: - { - ret = 0; - break; - } - default: - { - SENSOR_DG("%s focus mode(0x%x) is unkonwn\n",SENSOR_NAME_STRING(),sensor->info_priv.auto_focus); - goto sensor_af_downfirmware_end; - } - } - } - SENSOR_DG("%s sensor_af_downfirmware set focus mode(0x%x) ret:0x%x\n",SENSOR_NAME_STRING(), sensor->info_priv.auto_focus,ret); - } - -sensor_af_downfirmware_end: - - return ret; -} -static void sensor_af_workqueue(struct work_struct *work) -{ - struct sensor_work *sensor_work = container_of(work, struct sensor_work, dwork.work); - struct i2c_client *client = sensor_work->client; - struct sensor *sensor = to_sensor(client); - struct af_cmdinfo cmdinfo; - - SENSOR_DG("%s %s Enter, cmd:0x%x \n",SENSOR_NAME_STRING(), __FUNCTION__,sensor_work->cmd); - - mutex_lock(&sensor->wq_lock); - - switch (sensor_work->cmd) - { - case WqCmd_af_init: - { - if (sensor_af_downfirmware(client) < 0) { - SENSOR_TR("%s Sensor_af_init is failed in sensor_af_workqueue!\n",SENSOR_NAME_STRING()); - } - break; - } - case WqCmd_af_single: - { - if (sensor_af_single(client) < 0) { - SENSOR_TR("%s Sensor_af_single is failed in sensor_af_workqueue!\n",SENSOR_NAME_STRING()); - sensor_work->result = WqRet_fail; - } else { - sensor_work->result = WqRet_success; - } - break; - } - case WqCmd_af_special_pos: - { - sensor_af_idlechk(client); - - cmdinfo.cmd_tag = StepFocus_Spec_Tag; - cmdinfo.cmd_para[0] = sensor_work->var; - cmdinfo.validate_bit = 0x81; - if (sensor_af_cmdset(client, StepMode_Cmd, &cmdinfo) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_near_pos: - { - sensor_af_idlechk(client); - cmdinfo.cmd_tag = StepFocus_Near_Tag; - cmdinfo.validate_bit = 0x80; - if (sensor_af_cmdset(client, StepMode_Cmd, &cmdinfo) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_far_pos: - { - sensor_af_idlechk(client); - cmdinfo.cmd_tag = StepFocus_Far_Tag; - cmdinfo.validate_bit = 0x80; - if (sensor_af_cmdset(client, StepMode_Cmd, &cmdinfo) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_continues: - { - if (sensor_af_const(client) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - case WqCmd_af_update_zone: - { - if (sensor_af_zoneupdate(client) < 0) - sensor_work->result = WqRet_fail; - else - sensor_work->result = WqRet_success; - break; - } - default: - SENSOR_TR("Unknow command(%d) in %s af workqueue!",sensor_work->cmd,SENSOR_NAME_STRING()); - break; - } -//set_end: - if (sensor_work->wait == false) { - kfree((void*)sensor_work); - } else { - wake_up(&sensor_work->done); - } - mutex_unlock(&sensor->wq_lock); - return; -} - -static int sensor_af_workqueue_set(struct soc_camera_device *icd, enum sensor_wq_cmd cmd, int var, bool wait) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - struct sensor_work *wk; - int ret=0; - - if (sensor->sensor_wq == NULL) { - ret = -EINVAL; - goto sensor_af_workqueue_set_end; - } - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) != SENSOR_AF_IS_OK) { - if (cmd != WqCmd_af_init) { - SENSOR_TR("%s %s cmd(%d) ingore,because af module isn't ready!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - ret = -1; - goto sensor_af_workqueue_set_end; - } - } - - wk = kzalloc(sizeof(struct sensor_work), GFP_KERNEL); - if (wk) { - wk->client = client; - INIT_DELAYED_WORK(&wk->dwork, sensor_af_workqueue); - wk->cmd = cmd; - wk->result = WqRet_inval; - wk->wait = wait; - wk->var = var; - init_waitqueue_head(&wk->done); - - /* ddl@rock-chips.com: - * video_lock is been locked in v4l2_ioctl function, but auto focus may slow, - * As a result any other ioctl calls will proceed very, very slowly since each call - * will have to wait for the AF to finish. Camera preview is pause,because VIDIOC_QBUF - * and VIDIOC_DQBUF is sched. so unlock video_lock here. - */ - if (wait == true) { - queue_delayed_work(sensor->sensor_wq,&(wk->dwork),0); - mutex_unlock(&icd->video_lock); - if (wait_event_timeout(wk->done, (wk->result != WqRet_inval), msecs_to_jiffies(5000)) == 0) { - SENSOR_TR("%s %s cmd(%d) is timeout!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - } - flush_workqueue(sensor->sensor_wq); - ret = wk->result; - kfree((void*)wk); - mutex_lock(&icd->video_lock); - } else { - queue_delayed_work(sensor->sensor_wq,&(wk->dwork),msecs_to_jiffies(10)); - } - - } else { - SENSOR_TR("%s %s cmd(%d) ingore,because struct sensor_work malloc failed!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - ret = -1; - } -sensor_af_workqueue_set_end: - return ret; -} -#endif -static int sensor_parameter_record(struct i2c_client *client) -{ - u8 ret_l,ret_m,ret_h; - u8 tp_l,tp_m,tp_h; - struct sensor *sensor = to_sensor(client); - - sensor_write(client,0x3503,0x07); //stop AE/AG - sensor_write(client,0x3406,0x01); //stop AWB - - sensor_read(client,0x3500,&ret_h); - sensor_read(client,0x3501, &ret_m); - sensor_read(client,0x3502, &ret_l); - tp_l = ret_l; - tp_m = ret_m; - tp_h = ret_h; - SENSOR_DG(" %s Read 0x3500 = 0x%02x 0x3501 = 0x%02x 0x3502=0x%02x \n",SENSOR_NAME_STRING(), ret_h, ret_m, ret_l); - sensor->parameter.preview_exposure = (tp_h<<12)+(tp_m<<4)+(tp_l>>4); - sensor_read(client,0x350c, &ret_h); - sensor_read(client,0x350d, &ret_l); - sensor->parameter.preview_line_width = ret_h & 0xff; - sensor->parameter.preview_line_width = (sensor->parameter.preview_line_width << 8) +ret_l; - //Read back AGC Gain for preview - sensor_read(client,0x350b, &tp_l); - sensor->parameter.preview_gain = tp_l; - - sensor->parameter.capture_framerate = 900; - sensor->parameter.preview_framerate = 1500; - - SENSOR_DG(" %s Read 0x350c = 0x%02x 0x350d = 0x%02x 0x350b=0x%02x \n",SENSOR_NAME_STRING(), ret_h, ret_l, sensor->parameter.preview_gain); - return 0; -} -static int sensor_ae_transfer(struct i2c_client *client) -{ - u8 ExposureLow; - u8 ExposureMid; - u8 ExposureHigh; - u16 ulCapture_Exposure; - u32 ulCapture_Exposure_Gain; - u16 iCapture_Gain; - u8 Lines_10ms; - bool m_60Hz = 0; - u8 reg_l = 0,reg_h =0; - u16 Preview_Maxlines; - u8 Gain; - u32 Capture_MaxLines; - struct sensor *sensor = to_sensor(client); - - Preview_Maxlines = sensor->parameter.preview_line_width; - Gain = sensor->parameter.preview_gain; - sensor_read(client,0x350c, ®_h); - sensor_read(client,0x350d, ®_l); - Capture_MaxLines = reg_h & 0xff; - Capture_MaxLines = (Capture_MaxLines << 8) + reg_l; - - if(m_60Hz== 1) { - Lines_10ms = sensor->parameter.capture_framerate * Capture_MaxLines/12000; - } else { - Lines_10ms = sensor->parameter.capture_framerate * Capture_MaxLines/10000; - } - - if(Preview_Maxlines == 0) - Preview_Maxlines = 1; - - ulCapture_Exposure = - (sensor->parameter.preview_exposure*(sensor->parameter.capture_framerate)*(Capture_MaxLines))/(((Preview_Maxlines)*(sensor->parameter.preview_framerate))); - iCapture_Gain = (Gain & 0x0f) + 16; - if (Gain & 0x10) { - iCapture_Gain = iCapture_Gain << 1; - } - if (Gain & 0x20) { - iCapture_Gain = iCapture_Gain << 1; - } - if (Gain & 0x40) { - iCapture_Gain = iCapture_Gain << 1; - } - if (Gain & 0x80) { - iCapture_Gain = iCapture_Gain << 1; - } - ulCapture_Exposure_Gain =(u32) (11 * ulCapture_Exposure * iCapture_Gain/5); //0ld value 2.5, ½â¾ö¹ýÁÁ - if(ulCapture_Exposure_Gain < Capture_MaxLines*16) { - ulCapture_Exposure = ulCapture_Exposure_Gain/16; - if (ulCapture_Exposure > Lines_10ms) - { - //ulCapture_Exposure *= 1.7; - ulCapture_Exposure /= Lines_10ms; - ulCapture_Exposure *= Lines_10ms; - } - } else { - ulCapture_Exposure = Capture_MaxLines; - //ulCapture_Exposure_Gain *= 1.5; - } - if(ulCapture_Exposure == 0) - ulCapture_Exposure = 1; - iCapture_Gain = (ulCapture_Exposure_Gain*2/ulCapture_Exposure + 1)/2; - ExposureLow = ((unsigned char)ulCapture_Exposure)<<4; - ExposureMid = (unsigned char)(ulCapture_Exposure >> 4) & 0xff; - ExposureHigh = (unsigned char)(ulCapture_Exposure >> 12); - - Gain = 0; - if (iCapture_Gain > 31) { - Gain |= 0x10; - iCapture_Gain = iCapture_Gain >> 1; - } - if (iCapture_Gain > 31) { - Gain |= 0x20; - iCapture_Gain = iCapture_Gain >> 1; - } - if (iCapture_Gain > 31) { - Gain |= 0x40; - iCapture_Gain = iCapture_Gain >> 1; - } - if (iCapture_Gain > 31) { - Gain |= 0x80; - iCapture_Gain = iCapture_Gain >> 1; - } - if (iCapture_Gain > 16) - Gain |= ((iCapture_Gain -16) & 0x0f); - if(Gain == 0x10) - Gain = 0x11; - // write the gain and exposure to 0x350* registers - //m_iWrite0x350b=Gain; - sensor_write(client,0x350b, Gain); - //m_iWrite0x3502=ExposureLow; - sensor_write(client,0x3502, ExposureLow); - //m_iWrite0x3501=ExposureMid; - sensor_write(client,0x3501, ExposureMid); - //m_iWrite0x3500=ExposureHigh; - sensor_write(client,0x3500, ExposureHigh); - // SendToFile("Gain = 0x%x\r\n", Gain); - // SendToFile("ExposureLow = 0x%x\r\n", ExposureLow); - // SendToFile("ExposureMid = 0x%x\r\n", ExposureMid); - // SendToFile("ExposureHigh = 0x%x\r\n", ExposureHigh); - //¼Ó³¤ÑÓʱ£¬±ÜÃâ°µ´¦ÅÄÕÕʱµÄÃ÷°µ·Ö½çÎÊÌâ - //camera_timed_wait(200); - //linzhk camera_timed_wait(500); - - SENSOR_DG(" %s Write 0x350b = 0x%02x 0x3502 = 0x%02x 0x3501=0x%02x 0x3500 = 0x%02x\n",SENSOR_NAME_STRING(), Gain, ExposureLow, ExposureMid, ExposureHigh); - mdelay(100); - return 0; -} -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),cmd); - break; - } - } - -sensor_power_end: - return ret; -} - -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} - -static s32 sensor_init_width = 800; -static s32 sensor_init_height = 600; -static unsigned long sensor_init_busparam = (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING|SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW |SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ); -static enum v4l2_mbus_pixelcode sensor_init_pixelcode = V4L2_MBUS_FMT_YUYV8_2X8; -static struct reginfo* sensor_init_data_p = NULL; -static struct reginfo* sensor_init_winseq_p = NULL; -static struct reginfo* sensor_init_winseq_board = NULL; -static struct reginfo* sensor_init_data_board = NULL; -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - char value; - int ret,pid = 0,i = 0,j=0; - struct rk29camera_platform_data* tmp_plat_data =sensor->sensor_io_request; - int tmp_winseq_size; - - sensor_init_data_p = sensor_init_data; - sensor_init_winseq_p = sensor_svga; - sensor_init_width = 800; - sensor_init_height = 600; - if (tmp_plat_data != NULL) { - for(i = 0;i < RK_CAM_NUM;i++){ - if ((tmp_plat_data->sensor_init_data[i])&& tmp_plat_data->info[i].dev_name && - (strcmp(tmp_plat_data->info[i].dev_name, dev_name(icd->pdev)) == 0)) { - break; - } - } - } - if(tmp_plat_data &&(i < RK_CAM_NUM) && tmp_plat_data->sensor_init_data[i]){ - //user has defined the init data - //init reg - int tmp_init_data_size = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_data_size; - if(tmp_init_data_size > 2){//init data is valid - if((sizeof(struct reginfo) != sizeof(struct reginfo_t))){ - if(sensor_init_data_board) { - vfree(sensor_init_data_board); - sensor_init_data_board = NULL; - } - sensor_init_data_board = (struct reginfo*)vmalloc(tmp_init_data_size); - if(!sensor_init_data_board) - SENSOR_TR("%s :vmalloc init data erro !",__FUNCTION__); - for(j = 0;j< tmp_init_data_size;j++) { - sensor_init_data_board[j].reg = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_data[j].reg; - sensor_init_data_board[j].val = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_data[j].val; - } - sensor_init_data_p = sensor_init_data_board; - } else{ - sensor_init_data_p = (struct reginfo*)(tmp_plat_data->sensor_init_data[i]->rk_sensor_init_data); - } - } - //init winseq - tmp_winseq_size = tmp_plat_data->sensor_init_data[i]->rk_sensor_winseq_size; - if(tmp_winseq_size > 2){ - if(sizeof(struct reginfo) != sizeof(struct reginfo_t)){ - if(sensor_init_winseq_board) { - vfree(sensor_init_winseq_board); - sensor_init_winseq_board = NULL; - } - sensor_init_winseq_board = (struct reginfo*)vmalloc(tmp_winseq_size); - if(!sensor_init_winseq_board) - SENSOR_TR("%s :vmalloc erro !",__FUNCTION__); - for(j = 0;j< tmp_winseq_size;j++){ - sensor_init_winseq_board[j].reg = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_winseq[j].reg; - sensor_init_winseq_board[j].val = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_winseq[j].val; - } - sensor_init_winseq_p = sensor_init_winseq_board; - } else{ - sensor_init_winseq_p = (struct reginfo*)(tmp_plat_data->sensor_init_data[i]->rk_sensor_init_winseq); - } - } - //init width,height,bus,pixelcode - if(tmp_plat_data->sensor_init_data[i]->rk_sensor_init_width != INVALID_VALUE) - sensor_init_width = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_width; - if(tmp_plat_data->sensor_init_data[i]->rk_sensor_init_height != INVALID_VALUE) - sensor_init_height = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_height; - if(tmp_plat_data->sensor_init_data[i]->rk_sensor_init_bus_param != INVALID_VALUE) - sensor_init_busparam = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_bus_param; - if(tmp_plat_data->sensor_init_data[i]->rk_sensor_init_pixelcode != INVALID_VALUE) - sensor_init_pixelcode = tmp_plat_data->sensor_init_data[i]->rk_sensor_init_pixelcode; - } - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - ret = sensor_write(client, 0x3008, 0x80); - if (ret != 0) { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); //delay 5 microseconds - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x300a, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value << 8); - - ret = sensor_read(client, 0x300b, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x \n", SENSOR_NAME_STRING(), pid); - - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - ret = sensor_write_array(client, sensor_init_data_p); - if (ret != 0) { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - sensor->info_priv.winseqe_cur_addr = SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - - sensor->info_priv.funmodule_state = SENSOR_INIT_IS_OK; - - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - if (sensor->info_priv.funmodule_state & SENSOR_INIT_IS_OK) { - sensor_task_lock(client, 1); - sensor_write(client, 0x3017, 0x00); // FREX,VSYNC,HREF,PCLK,D9-D6 - sensor_write(client, 0x3018, 0x03); // D5-D0 - sensor_write(client,0x3019,0x00); // STROBE,SDA - sensor_task_lock(client, 0); - } - sensor_ioctrl(icd, Sensor_PowerDown, 1); - msleep(100); - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - return 0; -} -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - return 0; -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } else if ((mf->width == 3264) && (mf->height == 2448)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - int ret = 0, set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - winseqe_set_addr = sensor_svga; - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1024) && (set_h <= 768)) && sensor_xga[0].reg) - { - winseqe_set_addr = sensor_xga; - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 720)) && sensor_720p[0].reg) - { - winseqe_set_addr = sensor_720p; - set_w = 1280; - set_h = 720; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - winseqe_set_addr = sensor_sxga; - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && sensor_uxga[0].reg) - { - winseqe_set_addr = sensor_uxga; - set_w = 1600; - set_h = 1200; - } - else if (((set_w <= 1920) && (set_h <= 1080)) && sensor_1080p[0].reg) - { - winseqe_set_addr = sensor_1080p; - set_w = 1920; - set_h = 1080; - } - else if (((set_w <= 2048) && (set_h <= 1536)) && sensor_qxga[0].reg) - { - winseqe_set_addr = sensor_qxga; - set_w = 2048; - set_h = 1536; - } - else if (((set_w <= 2592) && (set_h <= 1944)) && sensor_qsxga[0].reg) - { - winseqe_set_addr = sensor_qsxga; - set_w = 2592; - set_h = 1944; - } -#if defined(CONFIG_SOC_CAMERA_OV5642_INTERPOLATION) - else if (((set_w <= SENSOR_MAX_WIDTH) && (set_h <= SENSOR_MAX_HEIGHT)) ) - { - winseqe_set_addr = sensor_qsxga; - set_w = SENSOR_MAX_WIDTH_REAL; - set_h = SENSOR_MAX_HEIGHT_REAL; - } -#endif - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if (winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) - { - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - sensor_parameter_record(client); - #if CONFIG_SENSOR_Flash - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - #endif - }else { /* ddl@rock-chips.com : Video */ - #if CONFIG_SENSOR_Flash - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - #endif - } - - if ((sensor->info_priv.winseqe_cur_addr->reg == SEQUENCE_PROPERTY) && (sensor->info_priv.winseqe_cur_addr->val == SEQUENCE_INIT)) { - if (((winseqe_set_addr->reg == SEQUENCE_PROPERTY) && (winseqe_set_addr->val == SEQUENCE_NORMAL)) - || (winseqe_set_addr->reg != SEQUENCE_PROPERTY)) { - ret |= sensor_write_array(client,sensor_init_data); - SENSOR_DG("\n%s reinit ret:0x%x \n",SENSOR_NAME_STRING(), ret); - } - } - - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - - sensor->info_priv.winseqe_cur_addr = winseqe_set_addr; - - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - sensor_ae_transfer(client); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - if (sensor->info_priv.whiteBalance != 0) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - #if CONFIG_SENSOR_Focus - if (sensor->info_priv.auto_focus != SENSOR_AF_MODE_INFINITY) { - if (sensor_af_workqueue_set(icd, WqCmd_af_update_zone,0,true) == 0) { - if ((sensor->info_priv.auto_focus == SENSOR_AF_MODE_AUTO) || - (sensor->info_priv.auto_focus == SENSOR_AF_MODE_CONTINUOUS)) { - //msleep(80); - sensor_af_workqueue_set(icd, WqCmd_af_single,0,true); - } - } - } - #endif - sensor->info_priv.snap2preview = true; - } else if (sensor_fmt_videochk(sd,mf) == true) { /* ddl@rock-chips.com : Video */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - #if CONFIG_SENSOR_Focus - sensor->info_priv.affm_reinit = 1; - #endif - sensor->info_priv.video2preview = true; - } else if ((sensor->info_priv.snap2preview == true) || (sensor->info_priv.video2preview == true)) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - if (sensor->info_priv.snap2preview == true) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - #if CONFIG_SENSOR_Focus - if (sensor->info_priv.auto_focus != SENSOR_AF_MODE_INFINITY) { - /* ddl@rock-chips.com: The af operation is not necessary, if user don't care whether in focus after preview*/ - if (sensor_af_workqueue_set(icd, WqCmd_af_update_zone,0,false) == 0) { - if (sensor->info_priv.auto_focus == SENSOR_AF_MODE_CONTINUOUS) { - sensor_af_workqueue_set(icd, WqCmd_af_continues,0,false); - } else if (sensor->info_priv.auto_focus == SENSOR_AF_MODE_AUTO) { - msleep(100); - sensor_af_workqueue_set(icd, WqCmd_af_single,0,false); - } - } - - } else { - msleep(600); /* ddl@rock-chips.com : whitebalance auto must delay */ - } - #endif - sensor->info_priv.video2preview = false; - sensor->info_priv.snap2preview = false; - } - - - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - /* ddl@rock-chips.com : It is query max resolution only. */ - if (mf->reserved[6] == 0xfefe5a5a) { - mf->height = SENSOR_MAX_HEIGHT; - mf->width = SENSOR_MAX_WIDTH; - ret = 0; - printk("%s(%d): query resolution\n",__FUNCTION__,__LINE__); - goto sensor_try_fmt_end; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1024) && (set_h <= 768)) && sensor_xga[0].reg) - { - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 720)) && sensor_720p[0].reg) - { - set_w = 1280; - set_h = 720; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && sensor_uxga[0].reg) - { - set_w = 1600; - set_h = 1200; - } - else if (((set_w <= 1920) && (set_h <= 1080)) && sensor_1080p[0].reg) - { - set_w = 1920; - set_h = 1080; - } - else if (((set_w <= 2048) && (set_h <= 1536)) && sensor_qxga[0].reg) - { - set_w = 2048; - set_h = 1536; - } - else if (((set_w <= 2592) && (set_h <= 1944)) && sensor_qsxga[0].reg) - { - set_w = 2592; - set_h = 1944; - } -#if defined(CONFIG_SOC_CAMERA_OV5642_INTERPOLATION) - else if (((set_w <= SENSOR_MAX_WIDTH) && (set_h <= SENSOR_MAX_HEIGHT)) ) - { - set_w = SENSOR_MAX_WIDTH_REAL; - set_h = SENSOR_MAX_HEIGHT_REAL; - } -#endif - else - { - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - - mf->width = set_w; - mf->height = set_h; - - mf->colorspace = fmt->colorspace; -sensor_try_fmt_end: - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV2655 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((*value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value > 0) && ((digitalzoom_cur + *value) > digitalzoom_total)) - { - *value = digitalzoom_total - digitalzoom_cur; - } - - if ((*value < 0) && ((digitalzoom_cur + *value) < 0)) - { - *value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += *value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, *value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Focus -static int sensor_set_focus_absolute(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int ret = 0; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (!qctrl_info) - return -EINVAL; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - if ((value >= qctrl_info->minimum) && (value <= qctrl_info->maximum)) { - ret = sensor_af_workqueue_set(icd, WqCmd_af_special_pos, value, true); - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EINVAL; - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - } - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - - return ret; -} -static int sensor_set_focus_relative(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int ret = 0; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_RELATIVE); - if (!qctrl_info) - return -EINVAL; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - if ((value >= qctrl_info->minimum) && (value <= qctrl_info->maximum)) { - if (value > 0) { - ret = sensor_af_workqueue_set(icd, WqCmd_af_near_pos, 0, true); - } else { - ret = sensor_af_workqueue_set(icd, WqCmd_af_far_pos, 0, true); - } - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EINVAL; - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - } - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - return ret; -} - -static int sensor_set_focus_mode(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int ret = 0; - - if ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK) && (sensor->info_priv.affm_reinit == 0)) { - switch (value) - { - case SENSOR_AF_MODE_AUTO: - { - ret = sensor_af_workqueue_set(icd, WqCmd_af_single, 0, true); - break; - } - - case SENSOR_AF_MODE_MACRO: - { - ret = sensor_set_focus_absolute(icd, qctrl, 0xff); - break; - } - - case SENSOR_AF_MODE_INFINITY: - { - ret = sensor_set_focus_absolute(icd, qctrl, 0x00); - break; - } - - case SENSOR_AF_MODE_CONTINUOUS: - { - ret = sensor_af_workqueue_set(icd, WqCmd_af_continues, 0, true); - break; - } - default: - SENSOR_TR("\n %s..%s AF value(0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__,value); - break; - - } - - SENSOR_DG("%s..%s : %d ret:0x%x\n",SENSOR_NAME_STRING(),__FUNCTION__, value,ret); - } else { - ret = -EACCES; - SENSOR_TR("\n %s..%s AF module state(0x%x, 0x%x) is error!\n",SENSOR_NAME_STRING(),__FUNCTION__, - sensor->info_priv.funmodule_state,sensor->info_priv.affm_reinit); - } - - return ret; -} -#endif - -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %d\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset,ret; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - ret = sensor_set_focus_absolute(icd, qctrl,ext_ctrl->value); - if ((ret == 0) || (0 == (sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK))) { - if (ext_ctrl->value == qctrl->minimum) { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_INFINITY; - } else if (ext_ctrl->value == qctrl->maximum) { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_MACRO; - } else { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_FIXED; - } - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - sensor_set_focus_relative(icd, qctrl,ext_ctrl->value); - break; - } - case V4L2_CID_FOCUS_AUTO: - { - if (ext_ctrl->value) { - if ((ext_ctrl->value==1) || (SENSOR_AF_MODE_AUTO == sensor->info_priv.auto_focus)) { - if (sensor_set_focus_mode(icd, qctrl,SENSOR_AF_MODE_AUTO) != 0) { - if(0 == (sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK)) { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_AUTO; - } - return -EINVAL; - } - } - if (ext_ctrl->value == 1) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_AUTO; - } else if (SENSOR_AF_MODE_AUTO == sensor->info_priv.auto_focus){ - if (ext_ctrl->value == 0) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CLOSE; - } - break; - } - case V4L2_CID_FOCUS_CONTINUOUS: - { - if (SENSOR_AF_MODE_CONTINUOUS != sensor->info_priv.auto_focus) { - if (ext_ctrl->value == 1) { - if (sensor_set_focus_mode(icd, qctrl,SENSOR_AF_MODE_CONTINUOUS) != 0) { - if(0 == (sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK)) { - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CONTINUOUS; - } - return -EINVAL; - } - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CONTINUOUS; - } - } else { - if (ext_ctrl->value == 0) - sensor->info_priv.auto_focus = SENSOR_AF_MODE_CLOSE; - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_stream(struct v4l2_subdev *sd, int enable) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - #if CONFIG_SENSOR_Focus - struct soc_camera_device *icd = client->dev.platform_data; - struct v4l2_mbus_framefmt mf; - #endif - - if (enable == 1) { - sensor->info_priv.enable = 1; - #if CONFIG_SENSOR_Focus - mf.width = icd->user_width; - mf.height = icd->user_height; - mf.code = sensor->info_priv.fmt.code; - mf.colorspace = sensor->info_priv.fmt.colorspace; - mf.field = V4L2_FIELD_NONE; - /* If auto focus firmware haven't download success, must download firmware again when in video or preview stream on */ - if (sensor_fmt_capturechk(sd, &mf) == false) { - if ((sensor->info_priv.affm_reinit == 1) || ((sensor->info_priv.funmodule_state & SENSOR_AF_IS_OK)==0)) { - sensor_af_workqueue_set(icd, WqCmd_af_init, 0, false); - sensor->info_priv.affm_reinit = 0; - } - } - #endif - } else if (enable == 0) { - sensor->info_priv.enable = 0; - #if CONFIG_SENSOR_Focus - flush_workqueue(sensor->sensor_wq); - #endif - } - return 0; -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char value; - int ret,pid = 0; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - /* soft reset */ - ret = sensor_write(client, 0x3012, 0x80); - if (ret != 0) { - SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - mdelay(5); //delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x300a, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid |= (value << 8); - - ret = sensor_read(client, 0x300b, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - - return ret; -} -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0,i; - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - - if (sensor->sensor_io_request != NULL) { - int j = 0; - for(j = 0;j < RK_CAM_NUM;j++){ - if (sensor->sensor_io_request->gpio_res[j].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[j].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[j]; - break; - } - } - if(j == RK_CAM_NUM){ - SENSOR_TR("%s %s RK_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } - - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - printk("flash io:%d\n",sensor->sensor_gpio_res->gpio_flash); - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zycc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } - -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, - .s_stream = sensor_s_stream, -}; -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - sensor->info_priv.fmt = sensor_colour_fmts[0]; - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } else { - #if CONFIG_SENSOR_Focus - sensor->sensor_wq = create_workqueue(SENSOR_NAME_STRING(_af_workqueue)); - if (sensor->sensor_wq == NULL) - SENSOR_TR("%s create fail!", SENSOR_NAME_STRING(_af_workqueue)); - mutex_init(&sensor->wq_lock); - #endif - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - #if CONFIG_SENSOR_Focus - if (sensor->sensor_wq) { - destroy_workqueue(sensor->sensor_wq); - sensor->sensor_wq = NULL; - } - #endif - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - diff --git a/drivers/media/video/ov5642.h b/drivers/media/video/ov5642.h deleted file mode 100644 index cfdb7c6f783c..000000000000 --- a/drivers/media/video/ov5642.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Driver for OV5642 CMOS Image Sensor from OmniVision - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#ifndef __OV5642_H__ -#define __OV5642_H__ -struct reginfo -{ - u16 reg; - u8 val; -}; - -#define SEQUENCE_INIT 0x00 -#define SEQUENCE_NORMAL 0x01 - -#define SEQUENCE_PROPERTY 0xFFFD -#define SEQUENCE_WAIT_MS 0xFFFE -#define SEQUENCE_END 0xFFFF -#endif - diff --git a/drivers/media/video/ov5642_af_firmware.c b/drivers/media/video/ov5642_af_firmware.c deleted file mode 100644 index 84907b88f231..000000000000 --- a/drivers/media/video/ov5642_af_firmware.c +++ /dev/null @@ -1,17862 +0,0 @@ -/* - * Driver for OV5642 CMOS Image Sensor from OmniVision - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -#include "ov5642.h" - -#define VCM_DRIVER_A3907 0 -#define VCM_DRIVER_AD5820 1 -#define VCM_DRIVER_DW9710 2 -#define VCM_DRIVER VCM_DRIVER_A3907 - -#if (VCM_DRIVER == VCM_DRIVER_A3907) -static struct reginfo sensor_af_firmware[] = -{ - {0x3000,0x20}, - {0x8000,0x02}, - {0x8001,0x00}, - {0x8002,0x06}, - {0x8003,0x02}, - {0x8004,0x0d}, - {0x8005,0xd1}, - {0x8006,0x78}, - {0x8007,0x7f}, - {0x8008,0xe4}, - {0x8009,0xf6}, - {0x800a,0xd8}, - {0x800b,0xfd}, - {0x800c,0x75}, - {0x800d,0x81}, - {0x800e,0x7e}, - {0x800f,0x02}, - {0x8010,0x15}, - {0x8011,0x5f}, - {0x8012,0x00}, - {0x8013,0x02}, - {0x8014,0x15}, - {0x8015,0xab}, - {0x8016,0xe0}, - {0x8017,0xf5}, - {0x8018,0x72}, - {0x8019,0xa3}, - {0x801a,0xe0}, - {0x801b,0xf5}, - {0x801c,0x73}, - {0x801d,0xae}, - {0x801e,0x6a}, - {0x801f,0xe4}, - {0x8020,0x85}, - {0x8021,0x6b}, - {0x8022,0x55}, - {0x8023,0x8e}, - {0x8024,0x54}, - {0x8025,0xf5}, - {0x8026,0x53}, - {0x8027,0xf5}, - {0x8028,0x52}, - {0x8029,0xab}, - {0x802a,0x55}, - {0x802b,0xaa}, - {0x802c,0x54}, - {0x802d,0xa9}, - {0x802e,0x53}, - {0x802f,0xa8}, - {0x8030,0x52}, - {0x8031,0xaf}, - {0x8032,0x2c}, - {0x8033,0xfc}, - {0x8034,0xfd}, - {0x8035,0xfe}, - {0x8036,0x12}, - {0x8037,0x08}, - {0x8038,0x9b}, - {0x8039,0x8f}, - {0x803a,0x55}, - {0x803b,0x8e}, - {0x803c,0x54}, - {0x803d,0x8d}, - {0x803e,0x53}, - {0x803f,0x8c}, - {0x8040,0x52}, - {0x8041,0xaf}, - {0x8042,0x55}, - {0x8043,0xae}, - {0x8044,0x54}, - {0x8045,0xad}, - {0x8046,0x53}, - {0x8047,0xac}, - {0x8048,0x52}, - {0x8049,0x8f}, - {0x804a,0x2b}, - {0x804b,0x8e}, - {0x804c,0x2a}, - {0x804d,0x8d}, - {0x804e,0x29}, - {0x804f,0x8c}, - {0x8050,0x28}, - {0x8051,0xae}, - {0x8052,0x6c}, - {0x8053,0xe4}, - {0x8054,0x85}, - {0x8055,0x6d}, - {0x8056,0x55}, - {0x8057,0x8e}, - {0x8058,0x54}, - {0x8059,0xf5}, - {0x805a,0x53}, - {0x805b,0xf5}, - {0x805c,0x52}, - {0x805d,0xab}, - {0x805e,0x55}, - {0x805f,0xaa}, - {0x8060,0x54}, - {0x8061,0xa9}, - {0x8062,0x53}, - {0x8063,0xa8}, - {0x8064,0x52}, - {0x8065,0xaf}, - {0x8066,0x2d}, - {0x8067,0xfc}, - {0x8068,0xfd}, - {0x8069,0xfe}, - {0x806a,0x12}, - {0x806b,0x08}, - {0x806c,0x9b}, - {0x806d,0x8f}, - {0x806e,0x55}, - {0x806f,0x8e}, - {0x8070,0x54}, - {0x8071,0x8d}, - {0x8072,0x53}, - {0x8073,0x8c}, - {0x8074,0x52}, - {0x8075,0xe5}, - {0x8076,0x2b}, - {0x8077,0x25}, - {0x8078,0x55}, - {0x8079,0xf5}, - {0x807a,0x2b}, - {0x807b,0xe5}, - {0x807c,0x2a}, - {0x807d,0x35}, - {0x807e,0x54}, - {0x807f,0xf5}, - {0x8080,0x2a}, - {0x8081,0xe5}, - {0x8082,0x29}, - {0x8083,0x35}, - {0x8084,0x53}, - {0x8085,0xf5}, - {0x8086,0x29}, - {0x8087,0xe5}, - {0x8088,0x28}, - {0x8089,0x35}, - {0x808a,0x52}, - {0x808b,0xf5}, - {0x808c,0x28}, - {0x808d,0xae}, - {0x808e,0x6e}, - {0x808f,0xe4}, - {0x8090,0x85}, - {0x8091,0x6f}, - {0x8092,0x55}, - {0x8093,0x8e}, - {0x8094,0x54}, - {0x8095,0xf5}, - {0x8096,0x53}, - {0x8097,0xf5}, - {0x8098,0x52}, - {0x8099,0xab}, - {0x809a,0x55}, - {0x809b,0xaa}, - {0x809c,0x54}, - {0x809d,0xa9}, - {0x809e,0x53}, - {0x809f,0xa8}, - {0x80a0,0x52}, - {0x80a1,0xaf}, - {0x80a2,0x2e}, - {0x80a3,0xfc}, - {0x80a4,0xfd}, - {0x80a5,0xfe}, - {0x80a6,0x12}, - {0x80a7,0x08}, - {0x80a8,0x9b}, - {0x80a9,0x8f}, - {0x80aa,0x55}, - {0x80ab,0x8e}, - {0x80ac,0x54}, - {0x80ad,0x8d}, - {0x80ae,0x53}, - {0x80af,0x8c}, - {0x80b0,0x52}, - {0x80b1,0xe5}, - {0x80b2,0x2b}, - {0x80b3,0x25}, - {0x80b4,0x55}, - {0x80b5,0xf5}, - {0x80b6,0x2b}, - {0x80b7,0xe5}, - {0x80b8,0x2a}, - {0x80b9,0x35}, - {0x80ba,0x54}, - {0x80bb,0xf5}, - {0x80bc,0x2a}, - {0x80bd,0xe5}, - {0x80be,0x29}, - {0x80bf,0x35}, - {0x80c0,0x53}, - {0x80c1,0xf5}, - {0x80c2,0x29}, - {0x80c3,0xe5}, - {0x80c4,0x28}, - {0x80c5,0x35}, - {0x80c6,0x52}, - {0x80c7,0xf5}, - {0x80c8,0x28}, - {0x80c9,0xae}, - {0x80ca,0x70}, - {0x80cb,0xe4}, - {0x80cc,0x85}, - {0x80cd,0x71}, - {0x80ce,0x55}, - {0x80cf,0x8e}, - {0x80d0,0x54}, - {0x80d1,0xf5}, - {0x80d2,0x53}, - {0x80d3,0xf5}, - {0x80d4,0x52}, - {0x80d5,0xab}, - {0x80d6,0x55}, - {0x80d7,0xaa}, - {0x80d8,0x54}, - {0x80d9,0xa9}, - {0x80da,0x53}, - {0x80db,0xa8}, - {0x80dc,0x52}, - {0x80dd,0xaf}, - {0x80de,0x2f}, - {0x80df,0xfc}, - {0x80e0,0xfd}, - {0x80e1,0xfe}, - {0x80e2,0x12}, - {0x80e3,0x08}, - {0x80e4,0x9b}, - {0x80e5,0x8f}, - {0x80e6,0x55}, - {0x80e7,0x8e}, - {0x80e8,0x54}, - {0x80e9,0x8d}, - {0x80ea,0x53}, - {0x80eb,0x8c}, - {0x80ec,0x52}, - {0x80ed,0xe5}, - {0x80ee,0x2b}, - {0x80ef,0x25}, - {0x80f0,0x55}, - {0x80f1,0xf5}, - {0x80f2,0x2b}, - {0x80f3,0xe5}, - {0x80f4,0x2a}, - {0x80f5,0x35}, - {0x80f6,0x54}, - {0x80f7,0xf5}, - {0x80f8,0x2a}, - {0x80f9,0xe5}, - {0x80fa,0x29}, - {0x80fb,0x35}, - {0x80fc,0x53}, - {0x80fd,0xf5}, - {0x80fe,0x29}, - {0x80ff,0xe5}, - {0x8100,0x28}, - {0x8101,0x35}, - {0x8102,0x52}, - {0x8103,0xf5}, - {0x8104,0x28}, - {0x8105,0xae}, - {0x8106,0x72}, - {0x8107,0xe4}, - {0x8108,0x85}, - {0x8109,0x73}, - {0x810a,0x55}, - {0x810b,0x8e}, - {0x810c,0x54}, - {0x810d,0xf5}, - {0x810e,0x53}, - {0x810f,0xf5}, - {0x8110,0x52}, - {0x8111,0xab}, - {0x8112,0x55}, - {0x8113,0xaa}, - {0x8114,0x54}, - {0x8115,0xa9}, - {0x8116,0x53}, - {0x8117,0xa8}, - {0x8118,0x52}, - {0x8119,0xaf}, - {0x811a,0x30}, - {0x811b,0xfc}, - {0x811c,0xfd}, - {0x811d,0xfe}, - {0x811e,0x12}, - {0x811f,0x08}, - {0x8120,0x9b}, - {0x8121,0x8f}, - {0x8122,0x55}, - {0x8123,0x8e}, - {0x8124,0x54}, - {0x8125,0x8d}, - {0x8126,0x53}, - {0x8127,0x8c}, - {0x8128,0x52}, - {0x8129,0xe5}, - {0x812a,0x2b}, - {0x812b,0x25}, - {0x812c,0x55}, - {0x812d,0xf5}, - {0x812e,0x2b}, - {0x812f,0xe5}, - {0x8130,0x2a}, - {0x8131,0x35}, - {0x8132,0x54}, - {0x8133,0xf5}, - {0x8134,0x2a}, - {0x8135,0xe5}, - {0x8136,0x29}, - {0x8137,0x35}, - {0x8138,0x53}, - {0x8139,0xf5}, - {0x813a,0x29}, - {0x813b,0xe5}, - {0x813c,0x28}, - {0x813d,0x35}, - {0x813e,0x52}, - {0x813f,0xf5}, - {0x8140,0x28}, - {0x8141,0x22}, - {0x8142,0xab}, - {0x8143,0x0d}, - {0x8144,0xaa}, - {0x8145,0x0c}, - {0x8146,0xa9}, - {0x8147,0x0b}, - {0x8148,0xa8}, - {0x8149,0x0a}, - {0x814a,0xfc}, - {0x814b,0xfd}, - {0x814c,0xfe}, - {0x814d,0x12}, - {0x814e,0x08}, - {0x814f,0x9b}, - {0x8150,0x8f}, - {0x8151,0x0d}, - {0x8152,0x8e}, - {0x8153,0x0c}, - {0x8154,0x8d}, - {0x8155,0x0b}, - {0x8156,0x8c}, - {0x8157,0x0a}, - {0x8158,0x7b}, - {0x8159,0x40}, - {0x815a,0xe4}, - {0x815b,0xfa}, - {0x815c,0xf9}, - {0x815d,0xf8}, - {0x815e,0x12}, - {0x815f,0x09}, - {0x8160,0x26}, - {0x8161,0x8f}, - {0x8162,0x0d}, - {0x8163,0x8e}, - {0x8164,0x0c}, - {0x8165,0x8d}, - {0x8166,0x0b}, - {0x8167,0x8c}, - {0x8168,0x0a}, - {0x8169,0x22}, - {0x816a,0xd2}, - {0x816b,0x29}, - {0x816c,0x90}, - {0x816d,0x30}, - {0x816e,0x1b}, - {0x816f,0xe5}, - {0x8170,0x25}, - {0x8171,0xf0}, - {0x8172,0x22}, - {0x8173,0x85}, - {0x8174,0x49}, - {0x8175,0x82}, - {0x8176,0x85}, - {0x8177,0x48}, - {0x8178,0x83}, - {0x8179,0xe5}, - {0x817a,0x7c}, - {0x817b,0x75}, - {0x817c,0xf0}, - {0x817d,0x02}, - {0x817e,0x12}, - {0x817f,0x09}, - {0x8180,0xee}, - {0x8181,0xe4}, - {0x8182,0x93}, - {0x8183,0xfe}, - {0x8184,0x74}, - {0x8185,0x01}, - {0x8186,0x93}, - {0x8187,0xff}, - {0x8188,0x85}, - {0x8189,0x49}, - {0x818a,0x82}, - {0x818b,0x85}, - {0x818c,0x48}, - {0x818d,0x83}, - {0x818e,0x22}, - {0x818f,0xfe}, - {0x8190,0xe4}, - {0x8191,0xfc}, - {0x8192,0xfd}, - {0x8193,0xe5}, - {0x8194,0x3f}, - {0x8195,0x2f}, - {0x8196,0xf5}, - {0x8197,0x3f}, - {0x8198,0xe5}, - {0x8199,0x3e}, - {0x819a,0x3e}, - {0x819b,0xf5}, - {0x819c,0x3e}, - {0x819d,0xed}, - {0x819e,0x35}, - {0x819f,0x3d}, - {0x81a0,0xf5}, - {0x81a1,0x3d}, - {0x81a2,0xec}, - {0x81a3,0x35}, - {0x81a4,0x3c}, - {0x81a5,0xf5}, - {0x81a6,0x3c}, - {0x81a7,0xaf}, - {0x81a8,0x3f}, - {0x81a9,0xae}, - {0x81aa,0x3e}, - {0x81ab,0xfc}, - {0x81ac,0xad}, - {0x81ad,0x3d}, - {0x81ae,0x78}, - {0x81af,0x08}, - {0x81b0,0x12}, - {0x81b1,0x09}, - {0x81b2,0xcb}, - {0x81b3,0x8f}, - {0x81b4,0x3f}, - {0x81b5,0x8e}, - {0x81b6,0x3e}, - {0x81b7,0x8d}, - {0x81b8,0x3d}, - {0x81b9,0x8c}, - {0x81ba,0x3c}, - {0x81bb,0x22}, - {0x81bc,0xaf}, - {0x81bd,0x2b}, - {0x81be,0xae}, - {0x81bf,0x2a}, - {0x81c0,0xad}, - {0x81c1,0x29}, - {0x81c2,0xac}, - {0x81c3,0x28}, - {0x81c4,0x78}, - {0x81c5,0x06}, - {0x81c6,0x12}, - {0x81c7,0x09}, - {0x81c8,0xb8}, - {0x81c9,0x8f}, - {0x81ca,0x2b}, - {0x81cb,0x8e}, - {0x81cc,0x2a}, - {0x81cd,0x8d}, - {0x81ce,0x29}, - {0x81cf,0x8c}, - {0x81d0,0x28}, - {0x81d1,0xd3}, - {0x81d2,0xe5}, - {0x81d3,0x29}, - {0x81d4,0x94}, - {0x81d5,0x00}, - {0x81d6,0xe5}, - {0x81d7,0x28}, - {0x81d8,0x94}, - {0x81d9,0x00}, - {0x81da,0x22}, - {0x81db,0xe5}, - {0x81dc,0x0b}, - {0x81dd,0x24}, - {0x81de,0x01}, - {0x81df,0xff}, - {0x81e0,0xe4}, - {0x81e1,0x33}, - {0x81e2,0xfe}, - {0x81e3,0x22}, - {0x81e4,0x85}, - {0x81e5,0x0d}, - {0x81e6,0x64}, - {0x81e7,0x85}, - {0x81e8,0x0e}, - {0x81e9,0x65}, - {0x81ea,0xe5}, - {0x81eb,0x0e}, - {0x81ec,0xc4}, - {0x81ed,0xf8}, - {0x81ee,0x54}, - {0x81ef,0x0f}, - {0x81f0,0xc8}, - {0x81f1,0x68}, - {0x81f2,0xf5}, - {0x81f3,0x0e}, - {0x81f4,0xe5}, - {0x81f5,0x0d}, - {0x81f6,0xc4}, - {0x81f7,0x54}, - {0x81f8,0xf0}, - {0x81f9,0x48}, - {0x81fa,0xf5}, - {0x81fb,0x0d}, - {0x81fc,0x22}, - {0x81fd,0x12}, - {0x81fe,0x08}, - {0x81ff,0x9b}, - {0x8200,0x8f}, - {0x8201,0x69}, - {0x8202,0x8e}, - {0x8203,0x68}, - {0x8204,0x8d}, - {0x8205,0x67}, - {0x8206,0x8c}, - {0x8207,0x66}, - {0x8208,0xaf}, - {0x8209,0x69}, - {0x820a,0xae}, - {0x820b,0x68}, - {0x820c,0xad}, - {0x820d,0x67}, - {0x820e,0xac}, - {0x820f,0x66}, - {0x8210,0x22}, - {0x8211,0xe4}, - {0x8212,0x93}, - {0x8213,0xfc}, - {0x8214,0x74}, - {0x8215,0x01}, - {0x8216,0x93}, - {0x8217,0xfd}, - {0x8218,0xc3}, - {0x8219,0xef}, - {0x821a,0x9d}, - {0x821b,0xff}, - {0x821c,0xee}, - {0x821d,0x9c}, - {0x821e,0x22}, - {0x821f,0xe0}, - {0x8220,0x44}, - {0x8221,0x01}, - {0x8222,0xf0}, - {0x8223,0xe0}, - {0x8224,0x44}, - {0x8225,0x02}, - {0x8226,0xf0}, - {0x8227,0xe0}, - {0x8228,0x44}, - {0x8229,0x04}, - {0x822a,0xf0}, - {0x822b,0x22}, - {0x822c,0xd2}, - {0x822d,0x09}, - {0x822e,0x90}, - {0x822f,0x30}, - {0x8230,0x18}, - {0x8231,0xe5}, - {0x8232,0x21}, - {0x8233,0xf0}, - {0x8234,0x22}, - {0x8235,0xe4}, - {0x8236,0x85}, - {0x8237,0x11}, - {0x8238,0x0d}, - {0x8239,0x85}, - {0x823a,0x10}, - {0x823b,0x0c}, - {0x823c,0xf5}, - {0x823d,0x0b}, - {0x823e,0xf5}, - {0x823f,0x0a}, - {0x8240,0xab}, - {0x8241,0x0d}, - {0x8242,0xaa}, - {0x8243,0x0c}, - {0x8244,0xa9}, - {0x8245,0x0b}, - {0x8246,0xa8}, - {0x8247,0x0a}, - {0x8248,0x22}, - {0x8249,0x90}, - {0x824a,0x30}, - {0x824b,0x42}, - {0x824c,0xe0}, - {0x824d,0xf5}, - {0x824e,0x22}, - {0x824f,0x75}, - {0x8250,0x51}, - {0x8251,0x0a}, - {0x8252,0x22}, - {0x8253,0xf5}, - {0x8254,0x82}, - {0x8255,0xe4}, - {0x8256,0x3a}, - {0x8257,0xf5}, - {0x8258,0x83}, - {0x8259,0x02}, - {0x825a,0x09}, - {0x825b,0xde}, - {0x825c,0x8f}, - {0x825d,0x0a}, - {0x825e,0x74}, - {0x825f,0x4a}, - {0x8260,0x2f}, - {0x8261,0xf8}, - {0x8262,0xe6}, - {0x8263,0x22}, - {0x8264,0xc2}, - {0x8265,0x07}, - {0x8266,0xc2}, - {0x8267,0x06}, - {0x8268,0xc2}, - {0x8269,0x02}, - {0x826a,0xc2}, - {0x826b,0x01}, - {0x826c,0xc2}, - {0x826d,0x00}, - {0x826e,0xc2}, - {0x826f,0x03}, - {0x8270,0xd2}, - {0x8271,0x04}, - {0x8272,0x22}, - {0x8273,0xe5}, - {0x8274,0x16}, - {0x8275,0x25}, - {0x8276,0xe0}, - {0x8277,0x25}, - {0x8278,0xe0}, - {0x8279,0x22}, - {0x827a,0x12}, - {0x827b,0x09}, - {0x827c,0x26}, - {0x827d,0x8f}, - {0x827e,0x69}, - {0x827f,0x8e}, - {0x8280,0x68}, - {0x8281,0x8d}, - {0x8282,0x67}, - {0x8283,0x8c}, - {0x8284,0x66}, - {0x8285,0x22}, - {0x8286,0xe4}, - {0x8287,0x85}, - {0x8288,0x0f}, - {0x8289,0x0d}, - {0x828a,0x85}, - {0x828b,0x0e}, - {0x828c,0x0c}, - {0x828d,0xf5}, - {0x828e,0x0b}, - {0x828f,0xf5}, - {0x8290,0x0a}, - {0x8291,0x22}, - {0x8292,0x90}, - {0x8293,0x12}, - {0x8294,0x67}, - {0x8295,0xe4}, - {0x8296,0x93}, - {0x8297,0xff}, - {0x8298,0x90}, - {0x8299,0x30}, - {0x829a,0x0a}, - {0x829b,0xe0}, - {0x829c,0x22}, - {0x829d,0xc2}, - {0x829e,0x02}, - {0x829f,0xc2}, - {0x82a0,0x01}, - {0x82a1,0xd2}, - {0x82a2,0x00}, - {0x82a3,0xc2}, - {0x82a4,0x03}, - {0x82a5,0xc2}, - {0x82a6,0x04}, - {0x82a7,0x22}, - {0x82a8,0xd2}, - {0x82a9,0x02}, - {0x82aa,0xd2}, - {0x82ab,0x01}, - {0x82ac,0xc2}, - {0x82ad,0x00}, - {0x82ae,0x22}, - {0x82af,0x74}, - {0x82b0,0x4a}, - {0x82b1,0x25}, - {0x82b2,0x0a}, - {0x82b3,0xf8}, - {0x82b4,0xe6}, - {0x82b5,0x22}, - {0x82b6,0xd3}, - {0x82b7,0xe5}, - {0x82b8,0x0b}, - {0x82b9,0x94}, - {0x82ba,0xff}, - {0x82bb,0xe5}, - {0x82bc,0x0a}, - {0x82bd,0x94}, - {0x82be,0x00}, - {0x82bf,0x22}, - {0x82c0,0x30}, - {0x82c1,0x18}, - {0x82c2,0x4d}, - {0x82c3,0x20}, - {0x82c4,0x19}, - {0x82c5,0x4a}, - {0x82c6,0x75}, - {0x82c7,0x0a}, - {0x82c8,0x02}, - {0x82c9,0x12}, - {0x82ca,0x02}, - {0x82cb,0xaf}, - {0x82cc,0xff}, - {0x82cd,0xe5}, - {0x82ce,0x4a}, - {0x82cf,0xd3}, - {0x82d0,0x9f}, - {0x82d1,0x40}, - {0x82d2,0x04}, - {0x82d3,0x7f}, - {0x82d4,0x00}, - {0x82d5,0x80}, - {0x82d6,0x02}, - {0x82d7,0xaf}, - {0x82d8,0x0a}, - {0x82d9,0x12}, - {0x82da,0x02}, - {0x82db,0x5c}, - {0x82dc,0xff}, - {0x82dd,0xe5}, - {0x82de,0x4b}, - {0x82df,0xd3}, - {0x82e0,0x9f}, - {0x82e1,0x40}, - {0x82e2,0x04}, - {0x82e3,0x7f}, - {0x82e4,0x01}, - {0x82e5,0x80}, - {0x82e6,0x02}, - {0x82e7,0xaf}, - {0x82e8,0x0a}, - {0x82e9,0x12}, - {0x82ea,0x02}, - {0x82eb,0x5c}, - {0x82ec,0xff}, - {0x82ed,0xe5}, - {0x82ee,0x4d}, - {0x82ef,0xd3}, - {0x82f0,0x9f}, - {0x82f1,0x40}, - {0x82f2,0x04}, - {0x82f3,0x7f}, - {0x82f4,0x03}, - {0x82f5,0x80}, - {0x82f6,0x02}, - {0x82f7,0xaf}, - {0x82f8,0x0a}, - {0x82f9,0x12}, - {0x82fa,0x02}, - {0x82fb,0x5c}, - {0x82fc,0xff}, - {0x82fd,0xe5}, - {0x82fe,0x4e}, - {0x82ff,0xd3}, - {0x8300,0x9f}, - {0x8301,0x40}, - {0x8302,0x04}, - {0x8303,0x7f}, - {0x8304,0x04}, - {0x8305,0x80}, - {0x8306,0x02}, - {0x8307,0xaf}, - {0x8308,0x0a}, - {0x8309,0x12}, - {0x830a,0x02}, - {0x830b,0x5c}, - {0x830c,0xf5}, - {0x830d,0x0b}, - {0x830e,0x80}, - {0x830f,0x06}, - {0x8310,0x85}, - {0x8311,0x79}, - {0x8312,0x0a}, - {0x8313,0x85}, - {0x8314,0x4f}, - {0x8315,0x0b}, - {0x8316,0x7f}, - {0x8317,0x01}, - {0x8318,0xe4}, - {0x8319,0xfe}, - {0x831a,0x12}, - {0x831b,0x02}, - {0x831c,0xaf}, - {0x831d,0xfd}, - {0x831e,0xe5}, - {0x831f,0x0b}, - {0x8320,0xc3}, - {0x8321,0x9d}, - {0x8322,0x50}, - {0x8323,0x04}, - {0x8324,0x7d}, - {0x8325,0x01}, - {0x8326,0x80}, - {0x8327,0x02}, - {0x8328,0x7d}, - {0x8329,0xff}, - {0x832a,0xac}, - {0x832b,0x0b}, - {0x832c,0xe5}, - {0x832d,0x4e}, - {0x832e,0xb5}, - {0x832f,0x0b}, - {0x8330,0x03}, - {0x8331,0xd3}, - {0x8332,0x80}, - {0x8333,0x01}, - {0x8334,0xc3}, - {0x8335,0x92}, - {0x8336,0x1f}, - {0x8337,0xe5}, - {0x8338,0x4d}, - {0x8339,0xb5}, - {0x833a,0x0b}, - {0x833b,0x03}, - {0x833c,0xd3}, - {0x833d,0x80}, - {0x833e,0x01}, - {0x833f,0xc3}, - {0x8340,0x92}, - {0x8341,0x1e}, - {0x8342,0xe5}, - {0x8343,0x4c}, - {0x8344,0xb5}, - {0x8345,0x0b}, - {0x8346,0x03}, - {0x8347,0xd3}, - {0x8348,0x80}, - {0x8349,0x01}, - {0x834a,0xc3}, - {0x834b,0x92}, - {0x834c,0x1d}, - {0x834d,0xe5}, - {0x834e,0x4b}, - {0x834f,0xb5}, - {0x8350,0x0b}, - {0x8351,0x03}, - {0x8352,0xd3}, - {0x8353,0x80}, - {0x8354,0x01}, - {0x8355,0xc3}, - {0x8356,0x92}, - {0x8357,0x1c}, - {0x8358,0xe5}, - {0x8359,0x4a}, - {0x835a,0xb5}, - {0x835b,0x0b}, - {0x835c,0x03}, - {0x835d,0xd3}, - {0x835e,0x80}, - {0x835f,0x01}, - {0x8360,0xc3}, - {0x8361,0x92}, - {0x8362,0x1b}, - {0x8363,0xe5}, - {0x8364,0x30}, - {0x8365,0xd3}, - {0x8366,0x94}, - {0x8367,0x00}, - {0x8368,0x40}, - {0x8369,0x04}, - {0x836a,0xa2}, - {0x836b,0x1f}, - {0x836c,0x80}, - {0x836d,0x01}, - {0x836e,0xc3}, - {0x836f,0x92}, - {0x8370,0x1f}, - {0x8371,0xe5}, - {0x8372,0x2f}, - {0x8373,0xd3}, - {0x8374,0x94}, - {0x8375,0x00}, - {0x8376,0x40}, - {0x8377,0x04}, - {0x8378,0xa2}, - {0x8379,0x1e}, - {0x837a,0x80}, - {0x837b,0x01}, - {0x837c,0xc3}, - {0x837d,0x92}, - {0x837e,0x1e}, - {0x837f,0xe5}, - {0x8380,0x2e}, - {0x8381,0xd3}, - {0x8382,0x94}, - {0x8383,0x00}, - {0x8384,0x40}, - {0x8385,0x04}, - {0x8386,0xa2}, - {0x8387,0x1d}, - {0x8388,0x80}, - {0x8389,0x01}, - {0x838a,0xc3}, - {0x838b,0x92}, - {0x838c,0x1d}, - {0x838d,0xe5}, - {0x838e,0x2d}, - {0x838f,0xd3}, - {0x8390,0x94}, - {0x8391,0x00}, - {0x8392,0x40}, - {0x8393,0x04}, - {0x8394,0xa2}, - {0x8395,0x1c}, - {0x8396,0x80}, - {0x8397,0x01}, - {0x8398,0xc3}, - {0x8399,0x92}, - {0x839a,0x1c}, - {0x839b,0xe5}, - {0x839c,0x2c}, - {0x839d,0xd3}, - {0x839e,0x94}, - {0x839f,0x00}, - {0x83a0,0x40}, - {0x83a1,0x04}, - {0x83a2,0xa2}, - {0x83a3,0x1b}, - {0x83a4,0x80}, - {0x83a5,0x01}, - {0x83a6,0xc3}, - {0x83a7,0x92}, - {0x83a8,0x1b}, - {0x83a9,0xe5}, - {0x83aa,0x23}, - {0x83ab,0x54}, - {0x83ac,0xf8}, - {0x83ad,0x70}, - {0x83ae,0x5b}, - {0x83af,0xbf}, - {0x83b0,0x01}, - {0x83b1,0x08}, - {0x83b2,0xed}, - {0x83b3,0xf4}, - {0x83b4,0x04}, - {0x83b5,0xfd}, - {0x83b6,0x7f}, - {0x83b7,0x02}, - {0x83b8,0x80}, - {0x83b9,0x06}, - {0x83ba,0xbf}, - {0x83bb,0x02}, - {0x83bc,0x02}, - {0x83bd,0x7f}, - {0x83be,0x01}, - {0x83bf,0x0e}, - {0x83c0,0xd3}, - {0x83c1,0xed}, - {0x83c2,0x64}, - {0x83c3,0x80}, - {0x83c4,0x94}, - {0x83c5,0x80}, - {0x83c6,0x40}, - {0x83c7,0x18}, - {0x83c8,0xec}, - {0x83c9,0x2e}, - {0x83ca,0xf5}, - {0x83cb,0x0b}, - {0x83cc,0xd3}, - {0x83cd,0x95}, - {0x83ce,0x7c}, - {0x83cf,0x40}, - {0x83d0,0x2c}, - {0x83d1,0x7d}, - {0x83d2,0xff}, - {0x83d3,0xef}, - {0x83d4,0x60}, - {0x83d5,0x04}, - {0x83d6,0x7b}, - {0x83d7,0x00}, - {0x83d8,0x80}, - {0x83d9,0x02}, - {0x83da,0x7b}, - {0x83db,0x03}, - {0x83dc,0xaf}, - {0x83dd,0x03}, - {0x83de,0x80}, - {0x83df,0x18}, - {0x83e0,0xec}, - {0x83e1,0xc3}, - {0x83e2,0x9e}, - {0x83e3,0x50}, - {0x83e4,0x13}, - {0x83e5,0x7d}, - {0x83e6,0x01}, - {0x83e7,0xef}, - {0x83e8,0x60}, - {0x83e9,0x04}, - {0x83ea,0x7b}, - {0x83eb,0x00}, - {0x83ec,0x80}, - {0x83ed,0x02}, - {0x83ee,0x7b}, - {0x83ef,0x03}, - {0x83f0,0xaf}, - {0x83f1,0x03}, - {0x83f2,0xec}, - {0x83f3,0x2e}, - {0x83f4,0xf5}, - {0x83f5,0x0b}, - {0x83f6,0x80}, - {0x83f7,0x05}, - {0x83f8,0xc3}, - {0x83f9,0xec}, - {0x83fa,0x9e}, - {0x83fb,0xf5}, - {0x83fc,0x0b}, - {0x83fd,0xef}, - {0x83fe,0x64}, - {0x83ff,0x03}, - {0x8400,0x60}, - {0x8401,0x03}, - {0x8402,0x02}, - {0x8403,0x03}, - {0x8404,0x2c}, - {0x8405,0x12}, - {0x8406,0x02}, - {0x8407,0xaf}, - {0x8408,0xf5}, - {0x8409,0x0b}, - {0x840a,0x12}, - {0x840b,0x01}, - {0x840c,0xdb}, - {0x840d,0xe5}, - {0x840e,0x4e}, - {0x840f,0xb5}, - {0x8410,0x07}, - {0x8411,0x07}, - {0x8412,0xe4}, - {0x8413,0xb5}, - {0x8414,0x06}, - {0x8415,0x03}, - {0x8416,0xd3}, - {0x8417,0x80}, - {0x8418,0x02}, - {0x8419,0xa2}, - {0x841a,0x1f}, - {0x841b,0x92}, - {0x841c,0x1f}, - {0x841d,0xe5}, - {0x841e,0x4d}, - {0x841f,0xb5}, - {0x8420,0x07}, - {0x8421,0x07}, - {0x8422,0xe4}, - {0x8423,0xb5}, - {0x8424,0x06}, - {0x8425,0x03}, - {0x8426,0xd3}, - {0x8427,0x80}, - {0x8428,0x02}, - {0x8429,0xa2}, - {0x842a,0x1e}, - {0x842b,0x92}, - {0x842c,0x1e}, - {0x842d,0x12}, - {0x842e,0x01}, - {0x842f,0xdb}, - {0x8430,0xe5}, - {0x8431,0x4c}, - {0x8432,0xb5}, - {0x8433,0x07}, - {0x8434,0x07}, - {0x8435,0xe4}, - {0x8436,0xb5}, - {0x8437,0x06}, - {0x8438,0x03}, - {0x8439,0xd3}, - {0x843a,0x80}, - {0x843b,0x02}, - {0x843c,0xa2}, - {0x843d,0x1d}, - {0x843e,0x92}, - {0x843f,0x1d}, - {0x8440,0xe5}, - {0x8441,0x4b}, - {0x8442,0xb5}, - {0x8443,0x07}, - {0x8444,0x07}, - {0x8445,0xe4}, - {0x8446,0xb5}, - {0x8447,0x06}, - {0x8448,0x03}, - {0x8449,0xd3}, - {0x844a,0x80}, - {0x844b,0x02}, - {0x844c,0xa2}, - {0x844d,0x1c}, - {0x844e,0x92}, - {0x844f,0x1c}, - {0x8450,0x12}, - {0x8451,0x01}, - {0x8452,0xdb}, - {0x8453,0xe5}, - {0x8454,0x4a}, - {0x8455,0xb5}, - {0x8456,0x07}, - {0x8457,0x07}, - {0x8458,0xe4}, - {0x8459,0xb5}, - {0x845a,0x06}, - {0x845b,0x03}, - {0x845c,0xd3}, - {0x845d,0x80}, - {0x845e,0x02}, - {0x845f,0xa2}, - {0x8460,0x1b}, - {0x8461,0x92}, - {0x8462,0x1b}, - {0x8463,0xe5}, - {0x8464,0x4e}, - {0x8465,0x12}, - {0x8466,0x01}, - {0x8467,0xdd}, - {0x8468,0xad}, - {0x8469,0x0b}, - {0x846a,0x7c}, - {0x846b,0x00}, - {0x846c,0xef}, - {0x846d,0xb5}, - {0x846e,0x05}, - {0x846f,0x07}, - {0x8470,0xec}, - {0x8471,0xb5}, - {0x8472,0x06}, - {0x8473,0x03}, - {0x8474,0xd3}, - {0x8475,0x80}, - {0x8476,0x02}, - {0x8477,0xa2}, - {0x8478,0x1f}, - {0x8479,0x92}, - {0x847a,0x1f}, - {0x847b,0xe5}, - {0x847c,0x4d}, - {0x847d,0x12}, - {0x847e,0x01}, - {0x847f,0xdd}, - {0x8480,0xef}, - {0x8481,0xb5}, - {0x8482,0x05}, - {0x8483,0x07}, - {0x8484,0xee}, - {0x8485,0xb5}, - {0x8486,0x04}, - {0x8487,0x03}, - {0x8488,0xd3}, - {0x8489,0x80}, - {0x848a,0x02}, - {0x848b,0xa2}, - {0x848c,0x1e}, - {0x848d,0x92}, - {0x848e,0x1e}, - {0x848f,0xe5}, - {0x8490,0x4c}, - {0x8491,0x12}, - {0x8492,0x01}, - {0x8493,0xdd}, - {0x8494,0xad}, - {0x8495,0x0b}, - {0x8496,0x7c}, - {0x8497,0x00}, - {0x8498,0xef}, - {0x8499,0xb5}, - {0x849a,0x05}, - {0x849b,0x07}, - {0x849c,0xec}, - {0x849d,0xb5}, - {0x849e,0x06}, - {0x849f,0x03}, - {0x84a0,0xd3}, - {0x84a1,0x80}, - {0x84a2,0x02}, - {0x84a3,0xa2}, - {0x84a4,0x1d}, - {0x84a5,0x92}, - {0x84a6,0x1d}, - {0x84a7,0xe5}, - {0x84a8,0x4b}, - {0x84a9,0x12}, - {0x84aa,0x01}, - {0x84ab,0xdd}, - {0x84ac,0xef}, - {0x84ad,0xb5}, - {0x84ae,0x05}, - {0x84af,0x07}, - {0x84b0,0xee}, - {0x84b1,0xb5}, - {0x84b2,0x04}, - {0x84b3,0x03}, - {0x84b4,0xd3}, - {0x84b5,0x80}, - {0x84b6,0x02}, - {0x84b7,0xa2}, - {0x84b8,0x1c}, - {0x84b9,0x92}, - {0x84ba,0x1c}, - {0x84bb,0xe5}, - {0x84bc,0x4a}, - {0x84bd,0x12}, - {0x84be,0x01}, - {0x84bf,0xdd}, - {0x84c0,0x7c}, - {0x84c1,0x00}, - {0x84c2,0xef}, - {0x84c3,0xb5}, - {0x84c4,0x0b}, - {0x84c5,0x07}, - {0x84c6,0xec}, - {0x84c7,0xb5}, - {0x84c8,0x06}, - {0x84c9,0x03}, - {0x84ca,0xd3}, - {0x84cb,0x80}, - {0x84cc,0x02}, - {0x84cd,0xa2}, - {0x84ce,0x1b}, - {0x84cf,0x92}, - {0x84d0,0x1b}, - {0x84d1,0xe5}, - {0x84d2,0x30}, - {0x84d3,0xd3}, - {0x84d4,0x94}, - {0x84d5,0x00}, - {0x84d6,0x40}, - {0x84d7,0x04}, - {0x84d8,0xa2}, - {0x84d9,0x1f}, - {0x84da,0x80}, - {0x84db,0x01}, - {0x84dc,0xc3}, - {0x84dd,0x92}, - {0x84de,0x1f}, - {0x84df,0xe5}, - {0x84e0,0x2f}, - {0x84e1,0xd3}, - {0x84e2,0x94}, - {0x84e3,0x00}, - {0x84e4,0x40}, - {0x84e5,0x04}, - {0x84e6,0xa2}, - {0x84e7,0x1e}, - {0x84e8,0x80}, - {0x84e9,0x01}, - {0x84ea,0xc3}, - {0x84eb,0x92}, - {0x84ec,0x1e}, - {0x84ed,0xe5}, - {0x84ee,0x2e}, - {0x84ef,0xd3}, - {0x84f0,0x94}, - {0x84f1,0x00}, - {0x84f2,0x40}, - {0x84f3,0x04}, - {0x84f4,0xa2}, - {0x84f5,0x1d}, - {0x84f6,0x80}, - {0x84f7,0x01}, - {0x84f8,0xc3}, - {0x84f9,0x92}, - {0x84fa,0x1d}, - {0x84fb,0xe5}, - {0x84fc,0x2d}, - {0x84fd,0xd3}, - {0x84fe,0x94}, - {0x84ff,0x00}, - {0x8500,0x40}, - {0x8501,0x04}, - {0x8502,0xa2}, - {0x8503,0x1c}, - {0x8504,0x80}, - {0x8505,0x01}, - {0x8506,0xc3}, - {0x8507,0x92}, - {0x8508,0x1c}, - {0x8509,0xe5}, - {0x850a,0x2c}, - {0x850b,0xd3}, - {0x850c,0x94}, - {0x850d,0x00}, - {0x850e,0x40}, - {0x850f,0x04}, - {0x8510,0xa2}, - {0x8511,0x1b}, - {0x8512,0x80}, - {0x8513,0x01}, - {0x8514,0xc3}, - {0x8515,0x92}, - {0x8516,0x1b}, - {0x8517,0x85}, - {0x8518,0x0a}, - {0x8519,0x79}, - {0x851a,0xe5}, - {0x851b,0x7d}, - {0x851c,0xb5}, - {0x851d,0x0b}, - {0x851e,0x03}, - {0x851f,0x02}, - {0x8520,0x16}, - {0x8521,0xf7}, - {0x8522,0x85}, - {0x8523,0x0b}, - {0x8524,0x0c}, - {0x8525,0x12}, - {0x8526,0x0e}, - {0x8527,0xf9}, - {0x8528,0xd2}, - {0x8529,0x02}, - {0x852a,0xc2}, - {0x852b,0x01}, - {0x852c,0xd2}, - {0x852d,0x00}, - {0x852e,0x75}, - {0x852f,0x31}, - {0x8530,0x03}, - {0x8531,0x22}, - {0x8532,0xe5}, - {0x8533,0x7e}, - {0x8534,0x24}, - {0x8535,0xfe}, - {0x8536,0x60}, - {0x8537,0x27}, - {0x8538,0x14}, - {0x8539,0x60}, - {0x853a,0x31}, - {0x853b,0x24}, - {0x853c,0xf8}, - {0x853d,0x60}, - {0x853e,0x3a}, - {0x853f,0x14}, - {0x8540,0x60}, - {0x8541,0x4b}, - {0x8542,0x14}, - {0x8543,0x60}, - {0x8544,0x59}, - {0x8545,0x14}, - {0x8546,0x60}, - {0x8547,0x6a}, - {0x8548,0x24}, - {0x8549,0xfd}, - {0x854a,0x70}, - {0x854b,0x03}, - {0x854c,0x02}, - {0x854d,0x05}, - {0x854e,0xe7}, - {0x854f,0x24}, - {0x8550,0x10}, - {0x8551,0x60}, - {0x8552,0x03}, - {0x8553,0x02}, - {0x8554,0x06}, - {0x8555,0xe2}, - {0x8556,0xe4}, - {0x8557,0xf5}, - {0x8558,0x0a}, - {0x8559,0x12}, - {0x855a,0x13}, - {0x855b,0x9c}, - {0x855c,0x02}, - {0x855d,0x06}, - {0x855e,0xcb}, - {0x855f,0x75}, - {0x8560,0x0a}, - {0x8561,0x01}, - {0x8562,0x12}, - {0x8563,0x06}, - {0x8564,0xe3}, - {0x8565,0xc2}, - {0x8566,0x3c}, - {0x8567,0xd2}, - {0x8568,0x3b}, - {0x8569,0x02}, - {0x856a,0x06}, - {0x856b,0xdc}, - {0x856c,0x75}, - {0x856d,0x0a}, - {0x856e,0x02}, - {0x856f,0x12}, - {0x8570,0x06}, - {0x8571,0xe3}, - {0x8572,0xd2}, - {0x8573,0x3c}, - {0x8574,0xc2}, - {0x8575,0x3b}, - {0x8576,0x02}, - {0x8577,0x06}, - {0x8578,0xdc}, - {0x8579,0x30}, - {0x857a,0x38}, - {0x857b,0x0c}, - {0x857c,0x20}, - {0x857d,0x3c}, - {0x857e,0x03}, - {0x857f,0x30}, - {0x8580,0x3b}, - {0x8581,0x06}, - {0x8582,0xe4}, - {0x8583,0xf5}, - {0x8584,0x0a}, - {0x8585,0x12}, - {0x8586,0x15}, - {0x8587,0x10}, - {0x8588,0xd2}, - {0x8589,0x18}, - {0x858a,0xc2}, - {0x858b,0x19}, - {0x858c,0x22}, - {0x858d,0x30}, - {0x858e,0x38}, - {0x858f,0x09}, - {0x8590,0x20}, - {0x8591,0x3c}, - {0x8592,0x03}, - {0x8593,0x30}, - {0x8594,0x3b}, - {0x8595,0x03}, - {0x8596,0x12}, - {0x8597,0x06}, - {0x8598,0xf4}, - {0x8599,0xd2}, - {0x859a,0x18}, - {0x859b,0xd2}, - {0x859c,0x19}, - {0x859d,0x22}, - {0x859e,0x30}, - {0x859f,0x38}, - {0x85a0,0x0c}, - {0x85a1,0x20}, - {0x85a2,0x3c}, - {0x85a3,0x03}, - {0x85a4,0x30}, - {0x85a5,0x3b}, - {0x85a6,0x06}, - {0x85a7,0x75}, - {0x85a8,0x0a}, - {0x85a9,0x02}, - {0x85aa,0x12}, - {0x85ab,0x15}, - {0x85ac,0x10}, - {0x85ad,0xc2}, - {0x85ae,0x18}, - {0x85af,0xd2}, - {0x85b0,0x19}, - {0x85b1,0x22}, - {0x85b2,0x20}, - {0x85b3,0x3c}, - {0x85b4,0x06}, - {0x85b5,0x20}, - {0x85b6,0x3b}, - {0x85b7,0x03}, - {0x85b8,0x02}, - {0x85b9,0x06}, - {0x85ba,0xe2}, - {0x85bb,0xe5}, - {0x85bc,0x79}, - {0x85bd,0xd3}, - {0x85be,0x94}, - {0x85bf,0x03}, - {0x85c0,0x40}, - {0x85c1,0x04}, - {0x85c2,0x7f}, - {0x85c3,0x00}, - {0x85c4,0x80}, - {0x85c5,0x04}, - {0x85c6,0xe5}, - {0x85c7,0x79}, - {0x85c8,0x04}, - {0x85c9,0xff}, - {0x85ca,0x8f}, - {0x85cb,0x79}, - {0x85cc,0x30}, - {0x85cd,0x18}, - {0x85ce,0x06}, - {0x85cf,0x30}, - {0x85d0,0x19}, - {0x85d1,0x03}, - {0x85d2,0x12}, - {0x85d3,0x06}, - {0x85d4,0xf4}, - {0x85d5,0x30}, - {0x85d6,0x18}, - {0x85d7,0x03}, - {0x85d8,0x02}, - {0x85d9,0x06}, - {0x85da,0xe2}, - {0x85db,0x20}, - {0x85dc,0x19}, - {0x85dd,0x03}, - {0x85de,0x02}, - {0x85df,0x06}, - {0x85e0,0xe2}, - {0x85e1,0x75}, - {0x85e2,0x0a}, - {0x85e3,0x02}, - {0x85e4,0x02}, - {0x85e5,0x15}, - {0x85e6,0x10}, - {0x85e7,0xe5}, - {0x85e8,0x68}, - {0x85e9,0xd3}, - {0x85ea,0x94}, - {0x85eb,0x38}, - {0x85ec,0x40}, - {0x85ed,0x04}, - {0x85ee,0x7f}, - {0x85ef,0x34}, - {0x85f0,0x80}, - {0x85f1,0x02}, - {0x85f2,0xaf}, - {0x85f3,0x68}, - {0x85f4,0x8f}, - {0x85f5,0x68}, - {0x85f6,0xe5}, - {0x85f7,0x68}, - {0x85f8,0xc3}, - {0x85f9,0x94}, - {0x85fa,0x08}, - {0x85fb,0x50}, - {0x85fc,0x04}, - {0x85fd,0x7f}, - {0x85fe,0x08}, - {0x85ff,0x80}, - {0x8600,0x02}, - {0x8601,0xaf}, - {0x8602,0x68}, - {0x8603,0x8f}, - {0x8604,0x68}, - {0x8605,0xe5}, - {0x8606,0x69}, - {0x8607,0xd3}, - {0x8608,0x94}, - {0x8609,0x2a}, - {0x860a,0x40}, - {0x860b,0x04}, - {0x860c,0x7f}, - {0x860d,0x2a}, - {0x860e,0x80}, - {0x860f,0x02}, - {0x8610,0xaf}, - {0x8611,0x69}, - {0x8612,0x8f}, - {0x8613,0x69}, - {0x8614,0xe5}, - {0x8615,0x69}, - {0x8616,0xc3}, - {0x8617,0x94}, - {0x8618,0x06}, - {0x8619,0x50}, - {0x861a,0x04}, - {0x861b,0x7f}, - {0x861c,0x06}, - {0x861d,0x80}, - {0x861e,0x02}, - {0x861f,0xaf}, - {0x8620,0x69}, - {0x8621,0x8f}, - {0x8622,0x69}, - {0x8623,0xaf}, - {0x8624,0x68}, - {0x8625,0xef}, - {0x8626,0x24}, - {0x8627,0xf8}, - {0x8628,0xff}, - {0x8629,0xe4}, - {0x862a,0x34}, - {0x862b,0xff}, - {0x862c,0xfe}, - {0x862d,0xe4}, - {0x862e,0x8f}, - {0x862f,0x3f}, - {0x8630,0x8e}, - {0x8631,0x3e}, - {0x8632,0xf5}, - {0x8633,0x3d}, - {0x8634,0xf5}, - {0x8635,0x3c}, - {0x8636,0xac}, - {0x8637,0x3c}, - {0x8638,0x12}, - {0x8639,0x01}, - {0x863a,0xac}, - {0x863b,0xaf}, - {0x863c,0x69}, - {0x863d,0xef}, - {0x863e,0x24}, - {0x863f,0xfa}, - {0x8640,0xff}, - {0x8641,0xe4}, - {0x8642,0x34}, - {0x8643,0xff}, - {0x8644,0x12}, - {0x8645,0x01}, - {0x8646,0x8f}, - {0x8647,0xaf}, - {0x8648,0x68}, - {0x8649,0xef}, - {0x864a,0x24}, - {0x864b,0x08}, - {0x864c,0xff}, - {0x864d,0xe4}, - {0x864e,0x33}, - {0x864f,0x12}, - {0x8650,0x01}, - {0x8651,0x8f}, - {0x8652,0xaf}, - {0x8653,0x69}, - {0x8654,0xef}, - {0x8655,0x24}, - {0x8656,0x06}, - {0x8657,0xff}, - {0x8658,0xe4}, - {0x8659,0x33}, - {0x865a,0xfe}, - {0x865b,0xe4}, - {0x865c,0xfc}, - {0x865d,0xfd}, - {0x865e,0xe5}, - {0x865f,0x3f}, - {0x8660,0x2f}, - {0x8661,0xf5}, - {0x8662,0x3f}, - {0x8663,0xe5}, - {0x8664,0x3e}, - {0x8665,0x3e}, - {0x8666,0xf5}, - {0x8667,0x3e}, - {0x8668,0xed}, - {0x8669,0x35}, - {0x866a,0x3d}, - {0x866b,0xf5}, - {0x866c,0x3d}, - {0x866d,0xec}, - {0x866e,0x35}, - {0x866f,0x3c}, - {0x8670,0xf5}, - {0x8671,0x3c}, - {0x8672,0xe4}, - {0x8673,0x25}, - {0x8674,0x3f}, - {0x8675,0xf5}, - {0x8676,0x37}, - {0x8677,0xe4}, - {0x8678,0x35}, - {0x8679,0x3e}, - {0x867a,0xf5}, - {0x867b,0x36}, - {0x867c,0xe4}, - {0x867d,0x35}, - {0x867e,0x3d}, - {0x867f,0xf5}, - {0x8680,0x35}, - {0x8681,0xe5}, - {0x8682,0x3c}, - {0x8683,0x34}, - {0x8684,0x08}, - {0x8685,0xf5}, - {0x8686,0x34}, - {0x8687,0xe4}, - {0x8688,0x25}, - {0x8689,0x3f}, - {0x868a,0xf5}, - {0x868b,0x3b}, - {0x868c,0xe4}, - {0x868d,0x35}, - {0x868e,0x3e}, - {0x868f,0xf5}, - {0x8690,0x3a}, - {0x8691,0xe5}, - {0x8692,0x3d}, - {0x8693,0x34}, - {0x8694,0x06}, - {0x8695,0xf5}, - {0x8696,0x39}, - {0x8697,0xe4}, - {0x8698,0x35}, - {0x8699,0x3c}, - {0x869a,0xf5}, - {0x869b,0x38}, - {0x869c,0xe5}, - {0x869d,0x3f}, - {0x869e,0x24}, - {0x869f,0xfa}, - {0x86a0,0xf5}, - {0x86a1,0x43}, - {0x86a2,0xe5}, - {0x86a3,0x3e}, - {0x86a4,0x34}, - {0x86a5,0xff}, - {0x86a6,0xf5}, - {0x86a7,0x42}, - {0x86a8,0xe5}, - {0x86a9,0x3d}, - {0x86aa,0x34}, - {0x86ab,0xff}, - {0x86ac,0xf5}, - {0x86ad,0x41}, - {0x86ae,0xe5}, - {0x86af,0x3c}, - {0x86b0,0x34}, - {0x86b1,0xff}, - {0x86b2,0xf5}, - {0x86b3,0x40}, - {0x86b4,0xe4}, - {0x86b5,0x25}, - {0x86b6,0x3f}, - {0x86b7,0xf5}, - {0x86b8,0x47}, - {0x86b9,0xe5}, - {0x86ba,0x3e}, - {0x86bb,0x34}, - {0x86bc,0xf8}, - {0x86bd,0xf5}, - {0x86be,0x46}, - {0x86bf,0xe5}, - {0x86c0,0x3d}, - {0x86c1,0x34}, - {0x86c2,0xff}, - {0x86c3,0xf5}, - {0x86c4,0x45}, - {0x86c5,0xe5}, - {0x86c6,0x3c}, - {0x86c7,0x34}, - {0x86c8,0xff}, - {0x86c9,0xf5}, - {0x86ca,0x44}, - {0x86cb,0x75}, - {0x86cc,0x79}, - {0x86cd,0x02}, - {0x86ce,0x75}, - {0x86cf,0x0a}, - {0x86d0,0x01}, - {0x86d1,0x12}, - {0x86d2,0x15}, - {0x86d3,0x10}, - {0x86d4,0xd2}, - {0x86d5,0x18}, - {0x86d6,0xd2}, - {0x86d7,0x19}, - {0x86d8,0xc2}, - {0x86d9,0x3c}, - {0x86da,0xc2}, - {0x86db,0x3b}, - {0x86dc,0xd2}, - {0x86dd,0x1a}, - {0x86de,0xd2}, - {0x86df,0x38}, - {0x86e0,0xd2}, - {0x86e1,0x30}, - {0x86e2,0x22}, - {0x86e3,0x12}, - {0x86e4,0x13}, - {0x86e5,0x9c}, - {0x86e6,0x75}, - {0x86e7,0x79}, - {0x86e8,0x02}, - {0x86e9,0xe4}, - {0x86ea,0xf5}, - {0x86eb,0x0a}, - {0x86ec,0x12}, - {0x86ed,0x15}, - {0x86ee,0x10}, - {0x86ef,0xd2}, - {0x86f0,0x18}, - {0x86f1,0xc2}, - {0x86f2,0x19}, - {0x86f3,0x22}, - {0x86f4,0x75}, - {0x86f5,0x0a}, - {0x86f6,0x01}, - {0x86f7,0x12}, - {0x86f8,0x15}, - {0x86f9,0x10}, - {0x86fa,0x22}, - {0x86fb,0x90}, - {0x86fc,0x38}, - {0x86fd,0x04}, - {0x86fe,0xe0}, - {0x86ff,0xfe}, - {0x8700,0xa3}, - {0x8701,0xe0}, - {0x8702,0xfd}, - {0x8703,0xed}, - {0x8704,0xff}, - {0x8705,0xee}, - {0x8706,0x54}, - {0x8707,0x0f}, - {0x8708,0xf5}, - {0x8709,0x0e}, - {0x870a,0x8f}, - {0x870b,0x0f}, - {0x870c,0xa3}, - {0x870d,0xe0}, - {0x870e,0xfe}, - {0x870f,0xa3}, - {0x8710,0xe0}, - {0x8711,0xfd}, - {0x8712,0xed}, - {0x8713,0xff}, - {0x8714,0xee}, - {0x8715,0x54}, - {0x8716,0x07}, - {0x8717,0xf5}, - {0x8718,0x10}, - {0x8719,0x8f}, - {0x871a,0x11}, - {0x871b,0xe5}, - {0x871c,0x0e}, - {0x871d,0xc4}, - {0x871e,0xf8}, - {0x871f,0x54}, - {0x8720,0xf0}, - {0x8721,0xc8}, - {0x8722,0x68}, - {0x8723,0xf5}, - {0x8724,0x0e}, - {0x8725,0xe5}, - {0x8726,0x0f}, - {0x8727,0xc4}, - {0x8728,0x54}, - {0x8729,0x0f}, - {0x872a,0x48}, - {0x872b,0xf5}, - {0x872c,0x0f}, - {0x872d,0xe5}, - {0x872e,0x10}, - {0x872f,0xc4}, - {0x8730,0xf8}, - {0x8731,0x54}, - {0x8732,0xf0}, - {0x8733,0xc8}, - {0x8734,0x68}, - {0x8735,0xf5}, - {0x8736,0x10}, - {0x8737,0xe5}, - {0x8738,0x11}, - {0x8739,0xc4}, - {0x873a,0x54}, - {0x873b,0x0f}, - {0x873c,0x48}, - {0x873d,0xf5}, - {0x873e,0x11}, - {0x873f,0xe4}, - {0x8740,0xf5}, - {0x8741,0x17}, - {0x8742,0x75}, - {0x8743,0x16}, - {0x8744,0x04}, - {0x8745,0x12}, - {0x8746,0x02}, - {0x8747,0x73}, - {0x8748,0x24}, - {0x8749,0x34}, - {0x874a,0xf8}, - {0x874b,0xe6}, - {0x874c,0xf5}, - {0x874d,0x12}, - {0x874e,0x12}, - {0x874f,0x02}, - {0x8750,0x73}, - {0x8751,0x24}, - {0x8752,0x35}, - {0x8753,0xf8}, - {0x8754,0xe6}, - {0x8755,0xf5}, - {0x8756,0x14}, - {0x8757,0x12}, - {0x8758,0x02}, - {0x8759,0x73}, - {0x875a,0x24}, - {0x875b,0x36}, - {0x875c,0xf8}, - {0x875d,0xe6}, - {0x875e,0xf5}, - {0x875f,0x13}, - {0x8760,0x12}, - {0x8761,0x02}, - {0x8762,0x73}, - {0x8763,0x24}, - {0x8764,0x37}, - {0x8765,0xf8}, - {0x8766,0xe6}, - {0x8767,0xf5}, - {0x8768,0x15}, - {0x8769,0x12}, - {0x876a,0x02}, - {0x876b,0x86}, - {0x876c,0xaf}, - {0x876d,0x12}, - {0x876e,0x12}, - {0x876f,0x01}, - {0x8770,0x42}, - {0x8771,0x8f}, - {0x8772,0x12}, - {0x8773,0x12}, - {0x8774,0x02}, - {0x8775,0x86}, - {0x8776,0xaf}, - {0x8777,0x13}, - {0x8778,0x12}, - {0x8779,0x01}, - {0x877a,0x42}, - {0x877b,0x8f}, - {0x877c,0x13}, - {0x877d,0x12}, - {0x877e,0x02}, - {0x877f,0x35}, - {0x8780,0xaf}, - {0x8781,0x14}, - {0x8782,0xfc}, - {0x8783,0xfd}, - {0x8784,0xfe}, - {0x8785,0x12}, - {0x8786,0x08}, - {0x8787,0x9b}, - {0x8788,0x12}, - {0x8789,0x01}, - {0x878a,0x61}, - {0x878b,0x7b}, - {0x878c,0x30}, - {0x878d,0x12}, - {0x878e,0x01}, - {0x878f,0x5a}, - {0x8790,0x8f}, - {0x8791,0x14}, - {0x8792,0x12}, - {0x8793,0x02}, - {0x8794,0x35}, - {0x8795,0xaf}, - {0x8796,0x15}, - {0x8797,0xfc}, - {0x8798,0xfd}, - {0x8799,0xfe}, - {0x879a,0x12}, - {0x879b,0x08}, - {0x879c,0x9b}, - {0x879d,0x12}, - {0x879e,0x01}, - {0x879f,0x61}, - {0x87a0,0xe4}, - {0x87a1,0x7b}, - {0x87a2,0x30}, - {0x87a3,0x12}, - {0x87a4,0x01}, - {0x87a5,0x5b}, - {0x87a6,0x8f}, - {0x87a7,0x15}, - {0x87a8,0xc3}, - {0x87a9,0xe5}, - {0x87aa,0x13}, - {0x87ab,0x95}, - {0x87ac,0x12}, - {0x87ad,0xff}, - {0x87ae,0x0f}, - {0x87af,0xef}, - {0x87b0,0xc3}, - {0x87b1,0x13}, - {0x87b2,0xff}, - {0x87b3,0xc3}, - {0x87b4,0x94}, - {0x87b5,0x04}, - {0x87b6,0x50}, - {0x87b7,0x27}, - {0x87b8,0xe5}, - {0x87b9,0x12}, - {0x87ba,0x9f}, - {0x87bb,0x40}, - {0x87bc,0x06}, - {0x87bd,0xe5}, - {0x87be,0x12}, - {0x87bf,0x9f}, - {0x87c0,0xfe}, - {0x87c1,0x80}, - {0x87c2,0x02}, - {0x87c3,0x7e}, - {0x87c4,0x00}, - {0x87c5,0x8e}, - {0x87c6,0x12}, - {0x87c7,0xef}, - {0x87c8,0xfd}, - {0x87c9,0xe5}, - {0x87ca,0x13}, - {0x87cb,0x2d}, - {0x87cc,0xfd}, - {0x87cd,0xe4}, - {0x87ce,0x33}, - {0x87cf,0xfc}, - {0x87d0,0xc3}, - {0x87d1,0xed}, - {0x87d2,0x95}, - {0x87d3,0x0f}, - {0x87d4,0xec}, - {0x87d5,0x95}, - {0x87d6,0x0e}, - {0x87d7,0x50}, - {0x87d8,0x02}, - {0x87d9,0x80}, - {0x87da,0x02}, - {0x87db,0xad}, - {0x87dc,0x0f}, - {0x87dd,0x8d}, - {0x87de,0x13}, - {0x87df,0xc3}, - {0x87e0,0xe5}, - {0x87e1,0x15}, - {0x87e2,0x95}, - {0x87e3,0x14}, - {0x87e4,0xff}, - {0x87e5,0xc3}, - {0x87e6,0x94}, - {0x87e7,0x04}, - {0x87e8,0x50}, - {0x87e9,0x29}, - {0x87ea,0xe5}, - {0x87eb,0x14}, - {0x87ec,0x9f}, - {0x87ed,0x40}, - {0x87ee,0x06}, - {0x87ef,0xe5}, - {0x87f0,0x14}, - {0x87f1,0x9f}, - {0x87f2,0xfe}, - {0x87f3,0x80}, - {0x87f4,0x02}, - {0x87f5,0x7e}, - {0x87f6,0x00}, - {0x87f7,0x8e}, - {0x87f8,0x14}, - {0x87f9,0xef}, - {0x87fa,0xfd}, - {0x87fb,0xe5}, - {0x87fc,0x15}, - {0x87fd,0x2d}, - {0x87fe,0xfd}, - {0x87ff,0xe4}, - {0x8800,0x33}, - {0x8801,0xfc}, - {0x8802,0xc3}, - {0x8803,0xed}, - {0x8804,0x95}, - {0x8805,0x11}, - {0x8806,0xec}, - {0x8807,0x95}, - {0x8808,0x10}, - {0x8809,0x50}, - {0x880a,0x04}, - {0x880b,0xaf}, - {0x880c,0x05}, - {0x880d,0x80}, - {0x880e,0x02}, - {0x880f,0xaf}, - {0x8810,0x11}, - {0x8811,0x8f}, - {0x8812,0x15}, - {0x8813,0xe5}, - {0x8814,0x15}, - {0x8815,0xd3}, - {0x8816,0x95}, - {0x8817,0x17}, - {0x8818,0x40}, - {0x8819,0x04}, - {0x881a,0xaf}, - {0x881b,0x15}, - {0x881c,0x80}, - {0x881d,0x02}, - {0x881e,0xaf}, - {0x881f,0x17}, - {0x8820,0x8f}, - {0x8821,0x17}, - {0x8822,0xd3}, - {0x8823,0xe5}, - {0x8824,0x16}, - {0x8825,0x64}, - {0x8826,0x80}, - {0x8827,0x94}, - {0x8828,0x80}, - {0x8829,0x40}, - {0x882a,0x04}, - {0x882b,0xaf}, - {0x882c,0x15}, - {0x882d,0x80}, - {0x882e,0x02}, - {0x882f,0xaf}, - {0x8830,0x17}, - {0x8831,0x8f}, - {0x8832,0x15}, - {0x8833,0xe5}, - {0x8834,0x16}, - {0x8835,0xfd}, - {0x8836,0x33}, - {0x8837,0x95}, - {0x8838,0xe0}, - {0x8839,0xfc}, - {0x883a,0xed}, - {0x883b,0xae}, - {0x883c,0x04}, - {0x883d,0x78}, - {0x883e,0x02}, - {0x883f,0xc3}, - {0x8840,0x33}, - {0x8841,0xce}, - {0x8842,0x33}, - {0x8843,0xce}, - {0x8844,0xd8}, - {0x8845,0xf9}, - {0x8846,0xff}, - {0x8847,0x24}, - {0x8848,0x01}, - {0x8849,0xfb}, - {0x884a,0xee}, - {0x884b,0x34}, - {0x884c,0x60}, - {0x884d,0x8b}, - {0x884e,0x82}, - {0x884f,0xf5}, - {0x8850,0x83}, - {0x8851,0xe5}, - {0x8852,0x12}, - {0x8853,0xf0}, - {0x8854,0xef}, - {0x8855,0x24}, - {0x8856,0x02}, - {0x8857,0xff}, - {0x8858,0xee}, - {0x8859,0x34}, - {0x885a,0x60}, - {0x885b,0x8f}, - {0x885c,0x82}, - {0x885d,0xf5}, - {0x885e,0x83}, - {0x885f,0xe5}, - {0x8860,0x14}, - {0x8861,0xf0}, - {0x8862,0xed}, - {0x8863,0xae}, - {0x8864,0x04}, - {0x8865,0x78}, - {0x8866,0x02}, - {0x8867,0xc3}, - {0x8868,0x33}, - {0x8869,0xce}, - {0x886a,0x33}, - {0x886b,0xce}, - {0x886c,0xd8}, - {0x886d,0xf9}, - {0x886e,0xff}, - {0x886f,0x24}, - {0x8870,0x03}, - {0x8871,0xfd}, - {0x8872,0xee}, - {0x8873,0x34}, - {0x8874,0x60}, - {0x8875,0x8d}, - {0x8876,0x82}, - {0x8877,0xf5}, - {0x8878,0x83}, - {0x8879,0xe5}, - {0x887a,0x13}, - {0x887b,0xf0}, - {0x887c,0xef}, - {0x887d,0x24}, - {0x887e,0x04}, - {0x887f,0xff}, - {0x8880,0xee}, - {0x8881,0x34}, - {0x8882,0x60}, - {0x8883,0x8f}, - {0x8884,0x82}, - {0x8885,0xf5}, - {0x8886,0x83}, - {0x8887,0xe5}, - {0x8888,0x15}, - {0x8889,0xf0}, - {0x888a,0x15}, - {0x888b,0x16}, - {0x888c,0xc3}, - {0x888d,0xe5}, - {0x888e,0x16}, - {0x888f,0x64}, - {0x8890,0x80}, - {0x8891,0x94}, - {0x8892,0x80}, - {0x8893,0x40}, - {0x8894,0x03}, - {0x8895,0x02}, - {0x8896,0x07}, - {0x8897,0x45}, - {0x8898,0xc2}, - {0x8899,0x30}, - {0x889a,0x22}, - {0x889b,0xe8}, - {0x889c,0x8f}, - {0x889d,0xf0}, - {0x889e,0xa4}, - {0x889f,0xcc}, - {0x88a0,0x8b}, - {0x88a1,0xf0}, - {0x88a2,0xa4}, - {0x88a3,0x2c}, - {0x88a4,0xfc}, - {0x88a5,0xe9}, - {0x88a6,0x8e}, - {0x88a7,0xf0}, - {0x88a8,0xa4}, - {0x88a9,0x2c}, - {0x88aa,0xfc}, - {0x88ab,0x8a}, - {0x88ac,0xf0}, - {0x88ad,0xed}, - {0x88ae,0xa4}, - {0x88af,0x2c}, - {0x88b0,0xfc}, - {0x88b1,0xea}, - {0x88b2,0x8e}, - {0x88b3,0xf0}, - {0x88b4,0xa4}, - {0x88b5,0xcd}, - {0x88b6,0xa8}, - {0x88b7,0xf0}, - {0x88b8,0x8b}, - {0x88b9,0xf0}, - {0x88ba,0xa4}, - {0x88bb,0x2d}, - {0x88bc,0xcc}, - {0x88bd,0x38}, - {0x88be,0x25}, - {0x88bf,0xf0}, - {0x88c0,0xfd}, - {0x88c1,0xe9}, - {0x88c2,0x8f}, - {0x88c3,0xf0}, - {0x88c4,0xa4}, - {0x88c5,0x2c}, - {0x88c6,0xcd}, - {0x88c7,0x35}, - {0x88c8,0xf0}, - {0x88c9,0xfc}, - {0x88ca,0xeb}, - {0x88cb,0x8e}, - {0x88cc,0xf0}, - {0x88cd,0xa4}, - {0x88ce,0xfe}, - {0x88cf,0xa9}, - {0x88d0,0xf0}, - {0x88d1,0xeb}, - {0x88d2,0x8f}, - {0x88d3,0xf0}, - {0x88d4,0xa4}, - {0x88d5,0xcf}, - {0x88d6,0xc5}, - {0x88d7,0xf0}, - {0x88d8,0x2e}, - {0x88d9,0xcd}, - {0x88da,0x39}, - {0x88db,0xfe}, - {0x88dc,0xe4}, - {0x88dd,0x3c}, - {0x88de,0xfc}, - {0x88df,0xea}, - {0x88e0,0xa4}, - {0x88e1,0x2d}, - {0x88e2,0xce}, - {0x88e3,0x35}, - {0x88e4,0xf0}, - {0x88e5,0xfd}, - {0x88e6,0xe4}, - {0x88e7,0x3c}, - {0x88e8,0xfc}, - {0x88e9,0x22}, - {0x88ea,0x75}, - {0x88eb,0xf0}, - {0x88ec,0x08}, - {0x88ed,0x75}, - {0x88ee,0x82}, - {0x88ef,0x00}, - {0x88f0,0xef}, - {0x88f1,0x2f}, - {0x88f2,0xff}, - {0x88f3,0xee}, - {0x88f4,0x33}, - {0x88f5,0xfe}, - {0x88f6,0xcd}, - {0x88f7,0x33}, - {0x88f8,0xcd}, - {0x88f9,0xcc}, - {0x88fa,0x33}, - {0x88fb,0xcc}, - {0x88fc,0xc5}, - {0x88fd,0x82}, - {0x88fe,0x33}, - {0x88ff,0xc5}, - {0x8900,0x82}, - {0x8901,0x9b}, - {0x8902,0xed}, - {0x8903,0x9a}, - {0x8904,0xec}, - {0x8905,0x99}, - {0x8906,0xe5}, - {0x8907,0x82}, - {0x8908,0x98}, - {0x8909,0x40}, - {0x890a,0x0c}, - {0x890b,0xf5}, - {0x890c,0x82}, - {0x890d,0xee}, - {0x890e,0x9b}, - {0x890f,0xfe}, - {0x8910,0xed}, - {0x8911,0x9a}, - {0x8912,0xfd}, - {0x8913,0xec}, - {0x8914,0x99}, - {0x8915,0xfc}, - {0x8916,0x0f}, - {0x8917,0xd5}, - {0x8918,0xf0}, - {0x8919,0xd6}, - {0x891a,0xe4}, - {0x891b,0xce}, - {0x891c,0xfb}, - {0x891d,0xe4}, - {0x891e,0xcd}, - {0x891f,0xfa}, - {0x8920,0xe4}, - {0x8921,0xcc}, - {0x8922,0xf9}, - {0x8923,0xa8}, - {0x8924,0x82}, - {0x8925,0x22}, - {0x8926,0xb8}, - {0x8927,0x00}, - {0x8928,0xc1}, - {0x8929,0xb9}, - {0x892a,0x00}, - {0x892b,0x59}, - {0x892c,0xba}, - {0x892d,0x00}, - {0x892e,0x2d}, - {0x892f,0xec}, - {0x8930,0x8b}, - {0x8931,0xf0}, - {0x8932,0x84}, - {0x8933,0xcf}, - {0x8934,0xce}, - {0x8935,0xcd}, - {0x8936,0xfc}, - {0x8937,0xe5}, - {0x8938,0xf0}, - {0x8939,0xcb}, - {0x893a,0xf9}, - {0x893b,0x78}, - {0x893c,0x18}, - {0x893d,0xef}, - {0x893e,0x2f}, - {0x893f,0xff}, - {0x8940,0xee}, - {0x8941,0x33}, - {0x8942,0xfe}, - {0x8943,0xed}, - {0x8944,0x33}, - {0x8945,0xfd}, - {0x8946,0xec}, - {0x8947,0x33}, - {0x8948,0xfc}, - {0x8949,0xeb}, - {0x894a,0x33}, - {0x894b,0xfb}, - {0x894c,0x10}, - {0x894d,0xd7}, - {0x894e,0x03}, - {0x894f,0x99}, - {0x8950,0x40}, - {0x8951,0x04}, - {0x8952,0xeb}, - {0x8953,0x99}, - {0x8954,0xfb}, - {0x8955,0x0f}, - {0x8956,0xd8}, - {0x8957,0xe5}, - {0x8958,0xe4}, - {0x8959,0xf9}, - {0x895a,0xfa}, - {0x895b,0x22}, - {0x895c,0x78}, - {0x895d,0x18}, - {0x895e,0xef}, - {0x895f,0x2f}, - {0x8960,0xff}, - {0x8961,0xee}, - {0x8962,0x33}, - {0x8963,0xfe}, - {0x8964,0xed}, - {0x8965,0x33}, - {0x8966,0xfd}, - {0x8967,0xec}, - {0x8968,0x33}, - {0x8969,0xfc}, - {0x896a,0xc9}, - {0x896b,0x33}, - {0x896c,0xc9}, - {0x896d,0x10}, - {0x896e,0xd7}, - {0x896f,0x05}, - {0x8970,0x9b}, - {0x8971,0xe9}, - {0x8972,0x9a}, - {0x8973,0x40}, - {0x8974,0x07}, - {0x8975,0xec}, - {0x8976,0x9b}, - {0x8977,0xfc}, - {0x8978,0xe9}, - {0x8979,0x9a}, - {0x897a,0xf9}, - {0x897b,0x0f}, - {0x897c,0xd8}, - {0x897d,0xe0}, - {0x897e,0xe4}, - {0x897f,0xc9}, - {0x8980,0xfa}, - {0x8981,0xe4}, - {0x8982,0xcc}, - {0x8983,0xfb}, - {0x8984,0x22}, - {0x8985,0x75}, - {0x8986,0xf0}, - {0x8987,0x10}, - {0x8988,0xef}, - {0x8989,0x2f}, - {0x898a,0xff}, - {0x898b,0xee}, - {0x898c,0x33}, - {0x898d,0xfe}, - {0x898e,0xed}, - {0x898f,0x33}, - {0x8990,0xfd}, - {0x8991,0xcc}, - {0x8992,0x33}, - {0x8993,0xcc}, - {0x8994,0xc8}, - {0x8995,0x33}, - {0x8996,0xc8}, - {0x8997,0x10}, - {0x8998,0xd7}, - {0x8999,0x07}, - {0x899a,0x9b}, - {0x899b,0xec}, - {0x899c,0x9a}, - {0x899d,0xe8}, - {0x899e,0x99}, - {0x899f,0x40}, - {0x89a0,0x0a}, - {0x89a1,0xed}, - {0x89a2,0x9b}, - {0x89a3,0xfd}, - {0x89a4,0xec}, - {0x89a5,0x9a}, - {0x89a6,0xfc}, - {0x89a7,0xe8}, - {0x89a8,0x99}, - {0x89a9,0xf8}, - {0x89aa,0x0f}, - {0x89ab,0xd5}, - {0x89ac,0xf0}, - {0x89ad,0xda}, - {0x89ae,0xe4}, - {0x89af,0xcd}, - {0x89b0,0xfb}, - {0x89b1,0xe4}, - {0x89b2,0xcc}, - {0x89b3,0xfa}, - {0x89b4,0xe4}, - {0x89b5,0xc8}, - {0x89b6,0xf9}, - {0x89b7,0x22}, - {0x89b8,0xe8}, - {0x89b9,0x60}, - {0x89ba,0x0f}, - {0x89bb,0xec}, - {0x89bc,0xc3}, - {0x89bd,0x13}, - {0x89be,0xfc}, - {0x89bf,0xed}, - {0x89c0,0x13}, - {0x89c1,0xfd}, - {0x89c2,0xee}, - {0x89c3,0x13}, - {0x89c4,0xfe}, - {0x89c5,0xef}, - {0x89c6,0x13}, - {0x89c7,0xff}, - {0x89c8,0xd8}, - {0x89c9,0xf1}, - {0x89ca,0x22}, - {0x89cb,0xe8}, - {0x89cc,0x60}, - {0x89cd,0x0f}, - {0x89ce,0xef}, - {0x89cf,0xc3}, - {0x89d0,0x33}, - {0x89d1,0xff}, - {0x89d2,0xee}, - {0x89d3,0x33}, - {0x89d4,0xfe}, - {0x89d5,0xed}, - {0x89d6,0x33}, - {0x89d7,0xfd}, - {0x89d8,0xec}, - {0x89d9,0x33}, - {0x89da,0xfc}, - {0x89db,0xd8}, - {0x89dc,0xf1}, - {0x89dd,0x22}, - {0x89de,0xe4}, - {0x89df,0x93}, - {0x89e0,0xfc}, - {0x89e1,0x74}, - {0x89e2,0x01}, - {0x89e3,0x93}, - {0x89e4,0xfd}, - {0x89e5,0x74}, - {0x89e6,0x02}, - {0x89e7,0x93}, - {0x89e8,0xfe}, - {0x89e9,0x74}, - {0x89ea,0x03}, - {0x89eb,0x93}, - {0x89ec,0xff}, - {0x89ed,0x22}, - {0x89ee,0xa4}, - {0x89ef,0x25}, - {0x89f0,0x82}, - {0x89f1,0xf5}, - {0x89f2,0x82}, - {0x89f3,0xe5}, - {0x89f4,0xf0}, - {0x89f5,0x35}, - {0x89f6,0x83}, - {0x89f7,0xf5}, - {0x89f8,0x83}, - {0x89f9,0x22}, - {0x89fa,0xd0}, - {0x89fb,0x83}, - {0x89fc,0xd0}, - {0x89fd,0x82}, - {0x89fe,0xf8}, - {0x89ff,0xe4}, - {0x8a00,0x93}, - {0x8a01,0x70}, - {0x8a02,0x12}, - {0x8a03,0x74}, - {0x8a04,0x01}, - {0x8a05,0x93}, - {0x8a06,0x70}, - {0x8a07,0x0d}, - {0x8a08,0xa3}, - {0x8a09,0xa3}, - {0x8a0a,0x93}, - {0x8a0b,0xf8}, - {0x8a0c,0x74}, - {0x8a0d,0x01}, - {0x8a0e,0x93}, - {0x8a0f,0xf5}, - {0x8a10,0x82}, - {0x8a11,0x88}, - {0x8a12,0x83}, - {0x8a13,0xe4}, - {0x8a14,0x73}, - {0x8a15,0x74}, - {0x8a16,0x02}, - {0x8a17,0x93}, - {0x8a18,0x68}, - {0x8a19,0x60}, - {0x8a1a,0xef}, - {0x8a1b,0xa3}, - {0x8a1c,0xa3}, - {0x8a1d,0xa3}, - {0x8a1e,0x80}, - {0x8a1f,0xdf}, - {0x8a20,0x75}, - {0x8a21,0x13}, - {0x8a22,0x0a}, - {0x8a23,0xa2}, - {0x8a24,0xaf}, - {0x8a25,0x92}, - {0x8a26,0x32}, - {0x8a27,0xc2}, - {0x8a28,0xaf}, - {0x8a29,0xc2}, - {0x8a2a,0x33}, - {0x8a2b,0x12}, - {0x8a2c,0x01}, - {0x8a2d,0x6a}, - {0x8a2e,0x12}, - {0x8a2f,0x02}, - {0x8a30,0x2c}, - {0x8a31,0x12}, - {0x8a32,0x01}, - {0x8a33,0x6a}, - {0x8a34,0x75}, - {0x8a35,0x51}, - {0x8a36,0x05}, - {0x8a37,0xaf}, - {0x8a38,0x51}, - {0x8a39,0x15}, - {0x8a3a,0x51}, - {0x8a3b,0xef}, - {0x8a3c,0x70}, - {0x8a3d,0xf9}, - {0x8a3e,0xd2}, - {0x8a3f,0x28}, - {0x8a40,0x12}, - {0x8a41,0x01}, - {0x8a42,0x6c}, - {0x8a43,0x75}, - {0x8a44,0x51}, - {0x8a45,0x0a}, - {0x8a46,0xaf}, - {0x8a47,0x51}, - {0x8a48,0x15}, - {0x8a49,0x51}, - {0x8a4a,0xef}, - {0x8a4b,0x70}, - {0x8a4c,0xf9}, - {0x8a4d,0xc2}, - {0x8a4e,0x29}, - {0x8a4f,0x12}, - {0x8a50,0x01}, - {0x8a51,0x6c}, - {0x8a52,0x75}, - {0x8a53,0x51}, - {0x8a54,0x05}, - {0x8a55,0xaf}, - {0x8a56,0x51}, - {0x8a57,0x15}, - {0x8a58,0x51}, - {0x8a59,0xef}, - {0x8a5a,0x70}, - {0x8a5b,0xf9}, - {0x8a5c,0xc2}, - {0x8a5d,0x28}, - {0x8a5e,0x12}, - {0x8a5f,0x01}, - {0x8a60,0x6c}, - {0x8a61,0x75}, - {0x8a62,0x51}, - {0x8a63,0x05}, - {0x8a64,0xaf}, - {0x8a65,0x51}, - {0x8a66,0x15}, - {0x8a67,0x51}, - {0x8a68,0xef}, - {0x8a69,0x70}, - {0x8a6a,0xf9}, - {0x8a6b,0x75}, - {0x8a6c,0x14}, - {0x8a6d,0x18}, - {0x8a6e,0x12}, - {0x8a6f,0x0b}, - {0x8a70,0x60}, - {0x8a71,0x75}, - {0x8a72,0x51}, - {0x8a73,0x0a}, - {0x8a74,0xaf}, - {0x8a75,0x51}, - {0x8a76,0x15}, - {0x8a77,0x51}, - {0x8a78,0xef}, - {0x8a79,0x70}, - {0x8a7a,0xf9}, - {0x8a7b,0xd2}, - {0x8a7c,0x28}, - {0x8a7d,0x12}, - {0x8a7e,0x01}, - {0x8a7f,0x6c}, - {0x8a80,0x12}, - {0x8a81,0x02}, - {0x8a82,0x49}, - {0x8a83,0xaf}, - {0x8a84,0x51}, - {0x8a85,0x15}, - {0x8a86,0x51}, - {0x8a87,0xef}, - {0x8a88,0x70}, - {0x8a89,0xf9}, - {0x8a8a,0xc2}, - {0x8a8b,0x28}, - {0x8a8c,0x12}, - {0x8a8d,0x01}, - {0x8a8e,0x6c}, - {0x8a8f,0x75}, - {0x8a90,0x51}, - {0x8a91,0x0a}, - {0x8a92,0xaf}, - {0x8a93,0x51}, - {0x8a94,0x15}, - {0x8a95,0x51}, - {0x8a96,0xef}, - {0x8a97,0x70}, - {0x8a98,0xf9}, - {0x8a99,0x30}, - {0x8a9a,0x11}, - {0x8a9b,0x03}, - {0x8a9c,0x02}, - {0x8a9d,0x0b}, - {0x8a9e,0x17}, - {0x8a9f,0x12}, - {0x8aa0,0x01}, - {0x8aa1,0x6a}, - {0x8aa2,0x12}, - {0x8aa3,0x02}, - {0x8aa4,0x2c}, - {0x8aa5,0xe5}, - {0x8aa6,0x11}, - {0x8aa7,0xf5}, - {0x8aa8,0x14}, - {0x8aa9,0x12}, - {0x8aaa,0x0b}, - {0x8aab,0x60}, - {0x8aac,0x75}, - {0x8aad,0x51}, - {0x8aae,0x0a}, - {0x8aaf,0xaf}, - {0x8ab0,0x51}, - {0x8ab1,0x15}, - {0x8ab2,0x51}, - {0x8ab3,0xef}, - {0x8ab4,0x70}, - {0x8ab5,0xf9}, - {0x8ab6,0xd2}, - {0x8ab7,0x28}, - {0x8ab8,0x12}, - {0x8ab9,0x01}, - {0x8aba,0x6c}, - {0x8abb,0x12}, - {0x8abc,0x02}, - {0x8abd,0x49}, - {0x8abe,0xaf}, - {0x8abf,0x51}, - {0x8ac0,0x15}, - {0x8ac1,0x51}, - {0x8ac2,0xef}, - {0x8ac3,0x70}, - {0x8ac4,0xf9}, - {0x8ac5,0xc2}, - {0x8ac6,0x28}, - {0x8ac7,0x12}, - {0x8ac8,0x01}, - {0x8ac9,0x6c}, - {0x8aca,0x75}, - {0x8acb,0x51}, - {0x8acc,0x0a}, - {0x8acd,0xaf}, - {0x8ace,0x51}, - {0x8acf,0x15}, - {0x8ad0,0x51}, - {0x8ad1,0xef}, - {0x8ad2,0x70}, - {0x8ad3,0xf9}, - {0x8ad4,0x30}, - {0x8ad5,0x11}, - {0x8ad6,0x04}, - {0x8ad7,0x15}, - {0x8ad8,0x13}, - {0x8ad9,0x80}, - {0x8ada,0x45}, - {0x8adb,0x12}, - {0x8adc,0x01}, - {0x8add,0x6a}, - {0x8ade,0x12}, - {0x8adf,0x02}, - {0x8ae0,0x2c}, - {0x8ae1,0x85}, - {0x8ae2,0x12}, - {0x8ae3,0x14}, - {0x8ae4,0x12}, - {0x8ae5,0x16}, - {0x8ae6,0x3c}, - {0x8ae7,0xc2}, - {0x8ae8,0x09}, - {0x8ae9,0x12}, - {0x8aea,0x02}, - {0x8aeb,0x2e}, - {0x8aec,0x75}, - {0x8aed,0x51}, - {0x8aee,0x0a}, - {0x8aef,0xaf}, - {0x8af0,0x51}, - {0x8af1,0x15}, - {0x8af2,0x51}, - {0x8af3,0xef}, - {0x8af4,0x70}, - {0x8af5,0xf9}, - {0x8af6,0xd2}, - {0x8af7,0x28}, - {0x8af8,0x12}, - {0x8af9,0x01}, - {0x8afa,0x6c}, - {0x8afb,0x12}, - {0x8afc,0x02}, - {0x8afd,0x49}, - {0x8afe,0xaf}, - {0x8aff,0x51}, - {0x8b00,0x15}, - {0x8b01,0x51}, - {0x8b02,0xef}, - {0x8b03,0x70}, - {0x8b04,0xf9}, - {0x8b05,0xc2}, - {0x8b06,0x28}, - {0x8b07,0x12}, - {0x8b08,0x01}, - {0x8b09,0x6c}, - {0x8b0a,0x75}, - {0x8b0b,0x51}, - {0x8b0c,0x0a}, - {0x8b0d,0xaf}, - {0x8b0e,0x51}, - {0x8b0f,0x15}, - {0x8b10,0x51}, - {0x8b11,0xef}, - {0x8b12,0x70}, - {0x8b13,0xf9}, - {0x8b14,0x30}, - {0x8b15,0x11}, - {0x8b16,0x06}, - {0x8b17,0x15}, - {0x8b18,0x13}, - {0x8b19,0xd2}, - {0x8b1a,0x33}, - {0x8b1b,0x80}, - {0x8b1c,0x03}, - {0x8b1d,0xe4}, - {0x8b1e,0xf5}, - {0x8b1f,0x13}, - {0x8b20,0x12}, - {0x8b21,0x01}, - {0x8b22,0x6a}, - {0x8b23,0x12}, - {0x8b24,0x02}, - {0x8b25,0x2c}, - {0x8b26,0xc2}, - {0x8b27,0x29}, - {0x8b28,0x12}, - {0x8b29,0x01}, - {0x8b2a,0x6c}, - {0x8b2b,0x75}, - {0x8b2c,0x51}, - {0x8b2d,0x05}, - {0x8b2e,0xaf}, - {0x8b2f,0x51}, - {0x8b30,0x15}, - {0x8b31,0x51}, - {0x8b32,0xef}, - {0x8b33,0x70}, - {0x8b34,0xf9}, - {0x8b35,0xd2}, - {0x8b36,0x28}, - {0x8b37,0x12}, - {0x8b38,0x01}, - {0x8b39,0x6c}, - {0x8b3a,0x75}, - {0x8b3b,0x51}, - {0x8b3c,0x05}, - {0x8b3d,0xaf}, - {0x8b3e,0x51}, - {0x8b3f,0x15}, - {0x8b40,0x51}, - {0x8b41,0xef}, - {0x8b42,0x70}, - {0x8b43,0xf9}, - {0x8b44,0x12}, - {0x8b45,0x01}, - {0x8b46,0x6a}, - {0x8b47,0x75}, - {0x8b48,0x51}, - {0x8b49,0x05}, - {0x8b4a,0xaf}, - {0x8b4b,0x51}, - {0x8b4c,0x15}, - {0x8b4d,0x51}, - {0x8b4e,0xef}, - {0x8b4f,0x70}, - {0x8b50,0xf9}, - {0x8b51,0xa2}, - {0x8b52,0x32}, - {0x8b53,0x92}, - {0x8b54,0xaf}, - {0x8b55,0xe5}, - {0x8b56,0x13}, - {0x8b57,0xd3}, - {0x8b58,0x94}, - {0x8b59,0x00}, - {0x8b5a,0x40}, - {0x8b5b,0x03}, - {0x8b5c,0x02}, - {0x8b5d,0x0a}, - {0x8b5e,0x27}, - {0x8b5f,0x22}, - {0x8b60,0x12}, - {0x8b61,0x16}, - {0x8b62,0x3c}, - {0x8b63,0xc2}, - {0x8b64,0x09}, - {0x8b65,0x90}, - {0x8b66,0x30}, - {0x8b67,0x18}, - {0x8b68,0xe5}, - {0x8b69,0x21}, - {0x8b6a,0xf0}, - {0x8b6b,0x22}, - {0x8b6c,0x30}, - {0x8b6d,0x04}, - {0x8b6e,0x03}, - {0x8b6f,0x02}, - {0x8b70,0x0c}, - {0x8b71,0xa7}, - {0x8b72,0xd2}, - {0x8b73,0x04}, - {0x8b74,0xe5}, - {0x8b75,0x7e}, - {0x8b76,0xb4}, - {0x8b77,0x01}, - {0x8b78,0x06}, - {0x8b79,0x12}, - {0x8b7a,0x17}, - {0x8b7b,0x3c}, - {0x8b7c,0x02}, - {0x8b7d,0x0c}, - {0x8b7e,0xa0}, - {0x8b7f,0xe5}, - {0x8b80,0x7e}, - {0x8b81,0xb4}, - {0x8b82,0x02}, - {0x8b83,0x06}, - {0x8b84,0x12}, - {0x8b85,0x17}, - {0x8b86,0x4d}, - {0x8b87,0x02}, - {0x8b88,0x0c}, - {0x8b89,0xa0}, - {0x8b8a,0xe5}, - {0x8b8b,0x7e}, - {0x8b8c,0xb4}, - {0x8b8d,0x03}, - {0x8b8e,0x05}, - {0x8b8f,0xe4}, - {0x8b90,0xf5}, - {0x8b91,0x0c}, - {0x8b92,0x80}, - {0x8b93,0x08}, - {0x8b94,0xe5}, - {0x8b95,0x7e}, - {0x8b96,0xb4}, - {0x8b97,0x04}, - {0x8b98,0x09}, - {0x8b99,0x85}, - {0x8b9a,0x7c}, - {0x8b9b,0x0c}, - {0x8b9c,0x12}, - {0x8b9d,0x0e}, - {0x8b9e,0xf9}, - {0x8b9f,0x02}, - {0x8ba0,0x0c}, - {0x8ba1,0xa0}, - {0x8ba2,0xe5}, - {0x8ba3,0x7e}, - {0x8ba4,0x64}, - {0x8ba5,0x0f}, - {0x8ba6,0x70}, - {0x8ba7,0x3d}, - {0x8ba8,0xd3}, - {0x8ba9,0xe5}, - {0x8baa,0x69}, - {0x8bab,0x94}, - {0x8bac,0xff}, - {0x8bad,0xe5}, - {0x8bae,0x68}, - {0x8baf,0x94}, - {0x8bb0,0x03}, - {0x8bb1,0x40}, - {0x8bb2,0x06}, - {0x8bb3,0x7e}, - {0x8bb4,0x03}, - {0x8bb5,0x7f}, - {0x8bb6,0xff}, - {0x8bb7,0x80}, - {0x8bb8,0x04}, - {0x8bb9,0xae}, - {0x8bba,0x68}, - {0x8bbb,0xaf}, - {0x8bbc,0x69}, - {0x8bbd,0x8e}, - {0x8bbe,0x68}, - {0x8bbf,0x8f}, - {0x8bc0,0x69}, - {0x8bc1,0x85}, - {0x8bc2,0x68}, - {0x8bc3,0x64}, - {0x8bc4,0x85}, - {0x8bc5,0x69}, - {0x8bc6,0x65}, - {0x8bc7,0xe5}, - {0x8bc8,0x69}, - {0x8bc9,0xc4}, - {0x8bca,0xf8}, - {0x8bcb,0x54}, - {0x8bcc,0x0f}, - {0x8bcd,0xc8}, - {0x8bce,0x68}, - {0x8bcf,0xf5}, - {0x8bd0,0x69}, - {0x8bd1,0xe5}, - {0x8bd2,0x68}, - {0x8bd3,0xc4}, - {0x8bd4,0x54}, - {0x8bd5,0xf0}, - {0x8bd6,0x48}, - {0x8bd7,0xf5}, - {0x8bd8,0x68}, - {0x8bd9,0x85}, - {0x8bda,0x68}, - {0x8bdb,0x11}, - {0x8bdc,0x85}, - {0x8bdd,0x69}, - {0x8bde,0x12}, - {0x8bdf,0x12}, - {0x8be0,0x0a}, - {0x8be1,0x20}, - {0x8be2,0x02}, - {0x8be3,0x0c}, - {0x8be4,0xa0}, - {0x8be5,0xe5}, - {0x8be6,0x7e}, - {0x8be7,0x64}, - {0x8be8,0x10}, - {0x8be9,0x60}, - {0x8bea,0x03}, - {0x8beb,0x02}, - {0x8bec,0x0c}, - {0x8bed,0xa0}, - {0x8bee,0xf5}, - {0x8bef,0x66}, - {0x8bf0,0xf5}, - {0x8bf1,0x67}, - {0x8bf2,0xf5}, - {0x8bf3,0x68}, - {0x8bf4,0xab}, - {0x8bf5,0x69}, - {0x8bf6,0xaa}, - {0x8bf7,0x68}, - {0x8bf8,0xa9}, - {0x8bf9,0x67}, - {0x8bfa,0xa8}, - {0x8bfb,0x66}, - {0x8bfc,0x12}, - {0x8bfd,0x01}, - {0x8bfe,0x73}, - {0x8bff,0x12}, - {0x8c00,0x02}, - {0x8c01,0x11}, - {0x8c02,0xfe}, - {0x8c03,0xe4}, - {0x8c04,0xfc}, - {0x8c05,0xfd}, - {0x8c06,0x12}, - {0x8c07,0x01}, - {0x8c08,0xfd}, - {0x8c09,0xe4}, - {0x8c0a,0x7b}, - {0x8c0b,0xff}, - {0x8c0c,0xfa}, - {0x8c0d,0xf9}, - {0x8c0e,0xf8}, - {0x8c0f,0x12}, - {0x8c10,0x02}, - {0x8c11,0x7a}, - {0x8c12,0x12}, - {0x8c13,0x01}, - {0x8c14,0x88}, - {0x8c15,0xe4}, - {0x8c16,0x93}, - {0x8c17,0xfe}, - {0x8c18,0x74}, - {0x8c19,0x01}, - {0x8c1a,0x93}, - {0x8c1b,0xff}, - {0x8c1c,0xe4}, - {0x8c1d,0xfc}, - {0x8c1e,0xfd}, - {0x8c1f,0xe5}, - {0x8c20,0x69}, - {0x8c21,0x2f}, - {0x8c22,0xf5}, - {0x8c23,0x69}, - {0x8c24,0xe5}, - {0x8c25,0x68}, - {0x8c26,0x3e}, - {0x8c27,0xf5}, - {0x8c28,0x68}, - {0x8c29,0xed}, - {0x8c2a,0x35}, - {0x8c2b,0x67}, - {0x8c2c,0xf5}, - {0x8c2d,0x67}, - {0x8c2e,0xec}, - {0x8c2f,0x35}, - {0x8c30,0x66}, - {0x8c31,0xf5}, - {0x8c32,0x66}, - {0x8c33,0x85}, - {0x8c34,0x68}, - {0x8c35,0x66}, - {0x8c36,0x85}, - {0x8c37,0x69}, - {0x8c38,0x67}, - {0x8c39,0xd3}, - {0x8c3a,0xe5}, - {0x8c3b,0x67}, - {0x8c3c,0x94}, - {0x8c3d,0xff}, - {0x8c3e,0xe5}, - {0x8c3f,0x66}, - {0x8c40,0x94}, - {0x8c41,0x03}, - {0x8c42,0x40}, - {0x8c43,0x06}, - {0x8c44,0x7e}, - {0x8c45,0x03}, - {0x8c46,0x7f}, - {0x8c47,0xff}, - {0x8c48,0x80}, - {0x8c49,0x04}, - {0x8c4a,0xae}, - {0x8c4b,0x66}, - {0x8c4c,0xaf}, - {0x8c4d,0x67}, - {0x8c4e,0x8e}, - {0x8c4f,0x66}, - {0x8c50,0x8f}, - {0x8c51,0x67}, - {0x8c52,0x85}, - {0x8c53,0x66}, - {0x8c54,0x64}, - {0x8c55,0x85}, - {0x8c56,0x67}, - {0x8c57,0x65}, - {0x8c58,0xe5}, - {0x8c59,0x67}, - {0x8c5a,0xc4}, - {0x8c5b,0xf8}, - {0x8c5c,0x54}, - {0x8c5d,0x0f}, - {0x8c5e,0xc8}, - {0x8c5f,0x68}, - {0x8c60,0xf5}, - {0x8c61,0x67}, - {0x8c62,0xe5}, - {0x8c63,0x66}, - {0x8c64,0xc4}, - {0x8c65,0x54}, - {0x8c66,0xf0}, - {0x8c67,0x48}, - {0x8c68,0xf5}, - {0x8c69,0x66}, - {0x8c6a,0x85}, - {0x8c6b,0x66}, - {0x8c6c,0x11}, - {0x8c6d,0x85}, - {0x8c6e,0x67}, - {0x8c6f,0x12}, - {0x8c70,0x12}, - {0x8c71,0x0a}, - {0x8c72,0x20}, - {0x8c73,0xe4}, - {0x8c74,0xf5}, - {0x8c75,0x67}, - {0x8c76,0xf5}, - {0x8c77,0x67}, - {0x8c78,0xe5}, - {0x8c79,0x67}, - {0x8c7a,0xd3}, - {0x8c7b,0x95}, - {0x8c7c,0x7c}, - {0x8c7d,0x50}, - {0x8c7e,0x21}, - {0x8c7f,0x12}, - {0x8c80,0x01}, - {0x8c81,0x88}, - {0x8c82,0xaf}, - {0x8c83,0x67}, - {0x8c84,0x75}, - {0x8c85,0xf0}, - {0x8c86,0x02}, - {0x8c87,0xef}, - {0x8c88,0x12}, - {0x8c89,0x09}, - {0x8c8a,0xee}, - {0x8c8b,0xc3}, - {0x8c8c,0x74}, - {0x8c8d,0x01}, - {0x8c8e,0x93}, - {0x8c8f,0x95}, - {0x8c90,0x69}, - {0x8c91,0xe4}, - {0x8c92,0x93}, - {0x8c93,0x95}, - {0x8c94,0x68}, - {0x8c95,0x40}, - {0x8c96,0x05}, - {0x8c97,0x85}, - {0x8c98,0x67}, - {0x8c99,0x7d}, - {0x8c9a,0x80}, - {0x8c9b,0x04}, - {0x8c9c,0x05}, - {0x8c9d,0x67}, - {0x8c9e,0x80}, - {0x8c9f,0xd8}, - {0x8ca0,0x90}, - {0x8ca1,0x30}, - {0x8ca2,0x25}, - {0x8ca3,0xe4}, - {0x8ca4,0xf0}, - {0x8ca5,0xd2}, - {0x8ca6,0x34}, - {0x8ca7,0x22}, - {0x8ca8,0xe5}, - {0x8ca9,0x33}, - {0x8caa,0x70}, - {0x8cab,0x03}, - {0x8cac,0x02}, - {0x8cad,0x0d}, - {0x8cae,0xd0}, - {0x8caf,0xc2}, - {0x8cb0,0xaf}, - {0x8cb1,0xaf}, - {0x8cb2,0x33}, - {0x8cb3,0xe4}, - {0x8cb4,0xf5}, - {0x8cb5,0x33}, - {0x8cb6,0xd2}, - {0x8cb7,0xaf}, - {0x8cb8,0x90}, - {0x8cb9,0x30}, - {0x8cba,0x25}, - {0x8cbb,0xe0}, - {0x8cbc,0xf5}, - {0x8cbd,0x7e}, - {0x8cbe,0x90}, - {0x8cbf,0x50}, - {0x8cc0,0x82}, - {0x8cc1,0xe0}, - {0x8cc2,0xf5}, - {0x8cc3,0x66}, - {0x8cc4,0xa3}, - {0x8cc5,0xe0}, - {0x8cc6,0xf5}, - {0x8cc7,0x67}, - {0x8cc8,0xa3}, - {0x8cc9,0xe0}, - {0x8cca,0xf5}, - {0x8ccb,0x68}, - {0x8ccc,0xa3}, - {0x8ccd,0xe0}, - {0x8cce,0xf5}, - {0x8ccf,0x69}, - {0x8cd0,0xef}, - {0x8cd1,0x12}, - {0x8cd2,0x09}, - {0x8cd3,0xfa}, - {0x8cd4,0x0c}, - {0x8cd5,0xfc}, - {0x8cd6,0x03}, - {0x8cd7,0x0d}, - {0x8cd8,0x14}, - {0x8cd9,0x04}, - {0x8cda,0x0d}, - {0x8cdb,0x2f}, - {0x8cdc,0x05}, - {0x8cdd,0x0d}, - {0x8cde,0x53}, - {0x8cdf,0x06}, - {0x8ce0,0x0d}, - {0x8ce1,0x41}, - {0x8ce2,0x08}, - {0x8ce3,0x0d}, - {0x8ce4,0x60}, - {0x8ce5,0x10}, - {0x8ce6,0x0d}, - {0x8ce7,0x74}, - {0x8ce8,0x12}, - {0x8ce9,0x0d}, - {0x8cea,0x79}, - {0x8ceb,0x20}, - {0x8cec,0x0d}, - {0x8ced,0x87}, - {0x8cee,0x21}, - {0x8cef,0x0d}, - {0x8cf0,0x8c}, - {0x8cf1,0x30}, - {0x8cf2,0x0d}, - {0x8cf3,0xb5}, - {0x8cf4,0x50}, - {0x8cf5,0x0d}, - {0x8cf6,0x97}, - {0x8cf7,0xd8}, - {0x8cf8,0x00}, - {0x8cf9,0x00}, - {0x8cfa,0x0d}, - {0x8cfb,0xc2}, - {0x8cfc,0x30}, - {0x8cfd,0x00}, - {0x8cfe,0x03}, - {0x8cff,0x02}, - {0x8d00,0x0d}, - {0x8d01,0xc2}, - {0x8d02,0x20}, - {0x8d03,0x07}, - {0x8d04,0x06}, - {0x8d05,0x20}, - {0x8d06,0x06}, - {0x8d07,0x03}, - {0x8d08,0xc3}, - {0x8d09,0x80}, - {0x8d0a,0x01}, - {0x8d0b,0xd3}, - {0x8d0c,0x92}, - {0x8d0d,0x36}, - {0x8d0e,0xd2}, - {0x8d0f,0x07}, - {0x8d10,0xc2}, - {0x8d11,0x06}, - {0x8d12,0x80}, - {0x8d13,0x16}, - {0x8d14,0x30}, - {0x8d15,0x00}, - {0x8d16,0x03}, - {0x8d17,0x02}, - {0x8d18,0x0d}, - {0x8d19,0xc2}, - {0x8d1a,0x20}, - {0x8d1b,0x07}, - {0x8d1c,0x06}, - {0x8d1d,0x20}, - {0x8d1e,0x06}, - {0x8d1f,0x03}, - {0x8d20,0xc3}, - {0x8d21,0x80}, - {0x8d22,0x01}, - {0x8d23,0xd3}, - {0x8d24,0x92}, - {0x8d25,0x36}, - {0x8d26,0xd2}, - {0x8d27,0x07}, - {0x8d28,0xd2}, - {0x8d29,0x06}, - {0x8d2a,0x12}, - {0x8d2b,0x02}, - {0x8d2c,0x9d}, - {0x8d2d,0x80}, - {0x8d2e,0x1e}, - {0x8d2f,0x30}, - {0x8d30,0x00}, - {0x8d31,0x03}, - {0x8d32,0x02}, - {0x8d33,0x0d}, - {0x8d34,0xc2}, - {0x8d35,0xc2}, - {0x8d36,0x07}, - {0x8d37,0xd2}, - {0x8d38,0x06}, - {0x8d39,0x12}, - {0x8d3a,0x02}, - {0x8d3b,0xa8}, - {0x8d3c,0xc2}, - {0x8d3d,0x04}, - {0x8d3e,0x02}, - {0x8d3f,0x0d}, - {0x8d40,0xc2}, - {0x8d41,0x12}, - {0x8d42,0x02}, - {0x8d43,0x64}, - {0x8d44,0x30}, - {0x8d45,0x05}, - {0x8d46,0x06}, - {0x8d47,0xe4}, - {0x8d48,0xf5}, - {0x8d49,0x0c}, - {0x8d4a,0x12}, - {0x8d4b,0x0e}, - {0x8d4c,0xf9}, - {0x8d4d,0xc2}, - {0x8d4e,0x31}, - {0x8d4f,0xd2}, - {0x8d50,0x34}, - {0x8d51,0x80}, - {0x8d52,0x6f}, - {0x8d53,0x30}, - {0x8d54,0x07}, - {0x8d55,0x6c}, - {0x8d56,0x30}, - {0x8d57,0x06}, - {0x8d58,0x69}, - {0x8d59,0x12}, - {0x8d5a,0x02}, - {0x8d5b,0x9d}, - {0x8d5c,0xd2}, - {0x8d5d,0x31}, - {0x8d5e,0x80}, - {0x8d5f,0x62}, - {0x8d60,0x20}, - {0x8d61,0x07}, - {0x8d62,0x03}, - {0x8d63,0x30}, - {0x8d64,0x06}, - {0x8d65,0x09}, - {0x8d66,0xe5}, - {0x8d67,0x7e}, - {0x8d68,0x64}, - {0x8d69,0x0e}, - {0x8d6a,0x70}, - {0x8d6b,0x56}, - {0x8d6c,0x20}, - {0x8d6d,0x00}, - {0x8d6e,0x53}, - {0x8d6f,0x12}, - {0x8d70,0x05}, - {0x8d71,0x32}, - {0x8d72,0x80}, - {0x8d73,0x4e}, - {0x8d74,0x12}, - {0x8d75,0x06}, - {0x8d76,0xfb}, - {0x8d77,0x80}, - {0x8d78,0x49}, - {0x8d79,0x30}, - {0x8d7a,0x05}, - {0x8d7b,0x46}, - {0x8d7c,0x20}, - {0x8d7d,0x07}, - {0x8d7e,0x43}, - {0x8d7f,0x20}, - {0x8d80,0x06}, - {0x8d81,0x40}, - {0x8d82,0x12}, - {0x8d83,0x17}, - {0x8d84,0x5c}, - {0x8d85,0x80}, - {0x8d86,0x3b}, - {0x8d87,0x12}, - {0x8d88,0x10}, - {0x8d89,0x4b}, - {0x8d8a,0x80}, - {0x8d8b,0x36}, - {0x8d8c,0x20}, - {0x8d8d,0x07}, - {0x8d8e,0x33}, - {0x8d8f,0x20}, - {0x8d90,0x06}, - {0x8d91,0x30}, - {0x8d92,0x12}, - {0x8d93,0x17}, - {0x8d94,0x6b}, - {0x8d95,0x80}, - {0x8d96,0x2b}, - {0x8d97,0xe5}, - {0x8d98,0x7e}, - {0x8d99,0x64}, - {0x8d9a,0x01}, - {0x8d9b,0x70}, - {0x8d9c,0x25}, - {0x8d9d,0xd2}, - {0x8d9e,0x35}, - {0x8d9f,0x90}, - {0x8da0,0x50}, - {0x8da1,0x82}, - {0x8da2,0xe5}, - {0x8da3,0x74}, - {0x8da4,0xf0}, - {0x8da5,0xa3}, - {0x8da6,0xe5}, - {0x8da7,0x75}, - {0x8da8,0xf0}, - {0x8da9,0xa3}, - {0x8daa,0xe5}, - {0x8dab,0x76}, - {0x8dac,0xf0}, - {0x8dad,0xa3}, - {0x8dae,0xe5}, - {0x8daf,0x77}, - {0x8db0,0xf0}, - {0x8db1,0xc2}, - {0x8db2,0x35}, - {0x8db3,0x80}, - {0x8db4,0x0d}, - {0x8db5,0x90}, - {0x8db6,0x50}, - {0x8db7,0x82}, - {0x8db8,0x30}, - {0x8db9,0x33}, - {0x8dba,0x05}, - {0x8dbb,0x74}, - {0x8dbc,0x55}, - {0x8dbd,0xf0}, - {0x8dbe,0x80}, - {0x8dbf,0x02}, - {0x8dc0,0xe4}, - {0x8dc1,0xf0}, - {0x8dc2,0x20}, - {0x8dc3,0x07}, - {0x8dc4,0x06}, - {0x8dc5,0x30}, - {0x8dc6,0x06}, - {0x8dc7,0x03}, - {0x8dc8,0x30}, - {0x8dc9,0x04}, - {0x8dca,0x05}, - {0x8dcb,0x90}, - {0x8dcc,0x30}, - {0x8dcd,0x25}, - {0x8dce,0xe4}, - {0x8dcf,0xf0}, - {0x8dd0,0x22}, - {0x8dd1,0xc0}, - {0x8dd2,0xe0}, - {0x8dd3,0xc0}, - {0x8dd4,0xf0}, - {0x8dd5,0xc0}, - {0x8dd6,0x83}, - {0x8dd7,0xc0}, - {0x8dd8,0x82}, - {0x8dd9,0xc0}, - {0x8dda,0xd0}, - {0x8ddb,0x75}, - {0x8ddc,0xd0}, - {0x8ddd,0x00}, - {0x8dde,0xc0}, - {0x8ddf,0x00}, - {0x8de0,0xc0}, - {0x8de1,0x01}, - {0x8de2,0xc0}, - {0x8de3,0x02}, - {0x8de4,0xc0}, - {0x8de5,0x03}, - {0x8de6,0xc0}, - {0x8de7,0x04}, - {0x8de8,0xc0}, - {0x8de9,0x05}, - {0x8dea,0xc0}, - {0x8deb,0x06}, - {0x8dec,0xc0}, - {0x8ded,0x07}, - {0x8dee,0x90}, - {0x8def,0x3f}, - {0x8df0,0x0c}, - {0x8df1,0xe0}, - {0x8df2,0xf5}, - {0x8df3,0x08}, - {0x8df4,0xe5}, - {0x8df5,0x08}, - {0x8df6,0x20}, - {0x8df7,0xe3}, - {0x8df8,0x03}, - {0x8df9,0x02}, - {0x8dfa,0x0e}, - {0x8dfb,0x82}, - {0x8dfc,0x30}, - {0x8dfd,0x35}, - {0x8dfe,0x03}, - {0x8dff,0x02}, - {0x8e00,0x0e}, - {0x8e01,0x82}, - {0x8e02,0x90}, - {0x8e03,0x60}, - {0x8e04,0x16}, - {0x8e05,0xe0}, - {0x8e06,0xf5}, - {0x8e07,0x6a}, - {0x8e08,0xa3}, - {0x8e09,0xe0}, - {0x8e0a,0xf5}, - {0x8e0b,0x6b}, - {0x8e0c,0x90}, - {0x8e0d,0x60}, - {0x8e0e,0x1e}, - {0x8e0f,0xe0}, - {0x8e10,0xf5}, - {0x8e11,0x6c}, - {0x8e12,0xa3}, - {0x8e13,0xe0}, - {0x8e14,0xf5}, - {0x8e15,0x6d}, - {0x8e16,0x90}, - {0x8e17,0x60}, - {0x8e18,0x26}, - {0x8e19,0xe0}, - {0x8e1a,0xf5}, - {0x8e1b,0x6e}, - {0x8e1c,0xa3}, - {0x8e1d,0xe0}, - {0x8e1e,0xf5}, - {0x8e1f,0x6f}, - {0x8e20,0x90}, - {0x8e21,0x60}, - {0x8e22,0x2e}, - {0x8e23,0xe0}, - {0x8e24,0xf5}, - {0x8e25,0x70}, - {0x8e26,0xa3}, - {0x8e27,0xe0}, - {0x8e28,0xf5}, - {0x8e29,0x71}, - {0x8e2a,0x90}, - {0x8e2b,0x60}, - {0x8e2c,0x36}, - {0x8e2d,0x12}, - {0x8e2e,0x00}, - {0x8e2f,0x16}, - {0x8e30,0x12}, - {0x8e31,0x01}, - {0x8e32,0xbc}, - {0x8e33,0x40}, - {0x8e34,0x06}, - {0x8e35,0x75}, - {0x8e36,0x2a}, - {0x8e37,0xff}, - {0x8e38,0x75}, - {0x8e39,0x2b}, - {0x8e3a,0xff}, - {0x8e3b,0x85}, - {0x8e3c,0x2a}, - {0x8e3d,0x74}, - {0x8e3e,0x85}, - {0x8e3f,0x2b}, - {0x8e40,0x75}, - {0x8e41,0x90}, - {0x8e42,0x60}, - {0x8e43,0x1a}, - {0x8e44,0xe0}, - {0x8e45,0xf5}, - {0x8e46,0x6a}, - {0x8e47,0xa3}, - {0x8e48,0xe0}, - {0x8e49,0xf5}, - {0x8e4a,0x6b}, - {0x8e4b,0x90}, - {0x8e4c,0x60}, - {0x8e4d,0x22}, - {0x8e4e,0xe0}, - {0x8e4f,0xf5}, - {0x8e50,0x6c}, - {0x8e51,0xa3}, - {0x8e52,0xe0}, - {0x8e53,0xf5}, - {0x8e54,0x6d}, - {0x8e55,0x90}, - {0x8e56,0x60}, - {0x8e57,0x2a}, - {0x8e58,0xe0}, - {0x8e59,0xf5}, - {0x8e5a,0x6e}, - {0x8e5b,0xa3}, - {0x8e5c,0xe0}, - {0x8e5d,0xf5}, - {0x8e5e,0x6f}, - {0x8e5f,0x90}, - {0x8e60,0x60}, - {0x8e61,0x32}, - {0x8e62,0xe0}, - {0x8e63,0xf5}, - {0x8e64,0x70}, - {0x8e65,0xa3}, - {0x8e66,0xe0}, - {0x8e67,0xf5}, - {0x8e68,0x71}, - {0x8e69,0x90}, - {0x8e6a,0x60}, - {0x8e6b,0x3a}, - {0x8e6c,0x12}, - {0x8e6d,0x00}, - {0x8e6e,0x16}, - {0x8e6f,0x12}, - {0x8e70,0x01}, - {0x8e71,0xbc}, - {0x8e72,0x40}, - {0x8e73,0x06}, - {0x8e74,0x75}, - {0x8e75,0x2a}, - {0x8e76,0xff}, - {0x8e77,0x75}, - {0x8e78,0x2b}, - {0x8e79,0xff}, - {0x8e7a,0x85}, - {0x8e7b,0x2a}, - {0x8e7c,0x76}, - {0x8e7d,0x85}, - {0x8e7e,0x2b}, - {0x8e7f,0x77}, - {0x8e80,0xd2}, - {0x8e81,0x3d}, - {0x8e82,0xe5}, - {0x8e83,0x08}, - {0x8e84,0x30}, - {0x8e85,0xe5}, - {0x8e86,0x44}, - {0x8e87,0x90}, - {0x8e88,0x56}, - {0x8e89,0x90}, - {0x8e8a,0xe0}, - {0x8e8b,0xf5}, - {0x8e8c,0x55}, - {0x8e8d,0xe5}, - {0x8e8e,0x7b}, - {0x8e8f,0x24}, - {0x8e90,0x02}, - {0x8e91,0xff}, - {0x8e92,0xe4}, - {0x8e93,0x33}, - {0x8e94,0xfe}, - {0x8e95,0xad}, - {0x8e96,0x55}, - {0x8e97,0xc3}, - {0x8e98,0xef}, - {0x8e99,0x9d}, - {0x8e9a,0x74}, - {0x8e9b,0x80}, - {0x8e9c,0xf8}, - {0x8e9d,0x6e}, - {0x8e9e,0x98}, - {0x8e9f,0x50}, - {0x8ea0,0x02}, - {0x8ea1,0x80}, - {0x8ea2,0x01}, - {0x8ea3,0xc3}, - {0x8ea4,0x92}, - {0x8ea5,0x27}, - {0x8ea6,0xaf}, - {0x8ea7,0x55}, - {0x8ea8,0xef}, - {0x8ea9,0x24}, - {0x8eaa,0x02}, - {0x8eab,0xff}, - {0x8eac,0xe4}, - {0x8ead,0x33}, - {0x8eae,0xfe}, - {0x8eaf,0xc3}, - {0x8eb0,0xef}, - {0x8eb1,0x95}, - {0x8eb2,0x7b}, - {0x8eb3,0x74}, - {0x8eb4,0x80}, - {0x8eb5,0xf8}, - {0x8eb6,0x6e}, - {0x8eb7,0x98}, - {0x8eb8,0x50}, - {0x8eb9,0x02}, - {0x8eba,0x80}, - {0x8ebb,0x02}, - {0x8ebc,0xa2}, - {0x8ebd,0x27}, - {0x8ebe,0x92}, - {0x8ebf,0x27}, - {0x8ec0,0x30}, - {0x8ec1,0x27}, - {0x8ec2,0x04}, - {0x8ec3,0xaf}, - {0x8ec4,0x55}, - {0x8ec5,0x80}, - {0x8ec6,0x02}, - {0x8ec7,0xaf}, - {0x8ec8,0x7b}, - {0x8ec9,0x8f}, - {0x8eca,0x7b}, - {0x8ecb,0xe5}, - {0x8ecc,0x08}, - {0x8ecd,0x30}, - {0x8ece,0xe1}, - {0x8ecf,0x08}, - {0x8ed0,0x90}, - {0x8ed1,0x30}, - {0x8ed2,0x24}, - {0x8ed3,0xe0}, - {0x8ed4,0xf5}, - {0x8ed5,0x33}, - {0x8ed6,0xe4}, - {0x8ed7,0xf0}, - {0x8ed8,0x90}, - {0x8ed9,0x3f}, - {0x8eda,0x0c}, - {0x8edb,0xe5}, - {0x8edc,0x08}, - {0x8edd,0xf0}, - {0x8ede,0xd0}, - {0x8edf,0x07}, - {0x8ee0,0xd0}, - {0x8ee1,0x06}, - {0x8ee2,0xd0}, - {0x8ee3,0x05}, - {0x8ee4,0xd0}, - {0x8ee5,0x04}, - {0x8ee6,0xd0}, - {0x8ee7,0x03}, - {0x8ee8,0xd0}, - {0x8ee9,0x02}, - {0x8eea,0xd0}, - {0x8eeb,0x01}, - {0x8eec,0xd0}, - {0x8eed,0x00}, - {0x8eee,0xd0}, - {0x8eef,0xd0}, - {0x8ef0,0xd0}, - {0x8ef1,0x82}, - {0x8ef2,0xd0}, - {0x8ef3,0x83}, - {0x8ef4,0xd0}, - {0x8ef5,0xf0}, - {0x8ef6,0xd0}, - {0x8ef7,0xe0}, - {0x8ef8,0x32}, - {0x8ef9,0xe5}, - {0x8efa,0x0c}, - {0x8efb,0xd3}, - {0x8efc,0x95}, - {0x8efd,0x7c}, - {0x8efe,0x40}, - {0x8eff,0x01}, - {0x8f00,0x22}, - {0x8f01,0x12}, - {0x8f02,0x01}, - {0x8f03,0x88}, - {0x8f04,0x75}, - {0x8f05,0xf0}, - {0x8f06,0x02}, - {0x8f07,0xe5}, - {0x8f08,0x0c}, - {0x8f09,0x12}, - {0x8f0a,0x09}, - {0x8f0b,0xee}, - {0x8f0c,0xe4}, - {0x8f0d,0x93}, - {0x8f0e,0xf5}, - {0x8f0f,0x0d}, - {0x8f10,0x74}, - {0x8f11,0x01}, - {0x8f12,0x93}, - {0x8f13,0xf5}, - {0x8f14,0x0e}, - {0x8f15,0x45}, - {0x8f16,0x0d}, - {0x8f17,0x70}, - {0x8f18,0x08}, - {0x8f19,0x85}, - {0x8f1a,0x64}, - {0x8f1b,0x0f}, - {0x8f1c,0x85}, - {0x8f1d,0x65}, - {0x8f1e,0x10}, - {0x8f1f,0x80}, - {0x8f20,0x13}, - {0x8f21,0x12}, - {0x8f22,0x01}, - {0x8f23,0xe4}, - {0x8f24,0xf5}, - {0x8f25,0x11}, - {0x8f26,0x85}, - {0x8f27,0x0e}, - {0x8f28,0x12}, - {0x8f29,0x12}, - {0x8f2a,0x0a}, - {0x8f2b,0x20}, - {0x8f2c,0x30}, - {0x8f2d,0x33}, - {0x8f2e,0x02}, - {0x8f2f,0xc3}, - {0x8f30,0x22}, - {0x8f31,0x02}, - {0x8f32,0x0f}, - {0x8f33,0xa6}, - {0x8f34,0xd3}, - {0x8f35,0xe5}, - {0x8f36,0x10}, - {0x8f37,0x94}, - {0x8f38,0x64}, - {0x8f39,0xe5}, - {0x8f3a,0x0f}, - {0x8f3b,0x94}, - {0x8f3c,0x00}, - {0x8f3d,0x40}, - {0x8f3e,0x39}, - {0x8f3f,0xd3}, - {0x8f40,0xe5}, - {0x8f41,0x10}, - {0x8f42,0x94}, - {0x8f43,0xf4}, - {0x8f44,0xe5}, - {0x8f45,0x0f}, - {0x8f46,0x94}, - {0x8f47,0x01}, - {0x8f48,0x40}, - {0x8f49,0x08}, - {0x8f4a,0x75}, - {0x8f4b,0x0f}, - {0x8f4c,0x01}, - {0x8f4d,0x75}, - {0x8f4e,0x10}, - {0x8f4f,0xc2}, - {0x8f50,0x80}, - {0x8f51,0x1b}, - {0x8f52,0xd3}, - {0x8f53,0xe5}, - {0x8f54,0x10}, - {0x8f55,0x94}, - {0x8f56,0x5e}, - {0x8f57,0xe5}, - {0x8f58,0x0f}, - {0x8f59,0x94}, - {0x8f5a,0x01}, - {0x8f5b,0x40}, - {0x8f5c,0x04}, - {0x8f5d,0x74}, - {0x8f5e,0xce}, - {0x8f5f,0x80}, - {0x8f60,0x02}, - {0x8f61,0x74}, - {0x8f62,0xe2}, - {0x8f63,0x25}, - {0x8f64,0x10}, - {0x8f65,0xf5}, - {0x8f66,0x10}, - {0x8f67,0x74}, - {0x8f68,0xff}, - {0x8f69,0x35}, - {0x8f6a,0x0f}, - {0x8f6b,0xf5}, - {0x8f6c,0x0f}, - {0x8f6d,0x85}, - {0x8f6e,0x0f}, - {0x8f6f,0x0d}, - {0x8f70,0x85}, - {0x8f71,0x10}, - {0x8f72,0x0e}, - {0x8f73,0x12}, - {0x8f74,0x01}, - {0x8f75,0xe4}, - {0x8f76,0x80}, - {0x8f77,0x0e}, - {0x8f78,0xe4}, - {0x8f79,0xf5}, - {0x8f7a,0x0f}, - {0x8f7b,0xf5}, - {0x8f7c,0x10}, - {0x8f7d,0x75}, - {0x8f7e,0x0d}, - {0x8f7f,0x80}, - {0x8f80,0xf5}, - {0x8f81,0x0e}, - {0x8f82,0xf5}, - {0x8f83,0x64}, - {0x8f84,0xf5}, - {0x8f85,0x65}, - {0x8f86,0x85}, - {0x8f87,0x0d}, - {0x8f88,0x11}, - {0x8f89,0x85}, - {0x8f8a,0x0e}, - {0x8f8b,0x12}, - {0x8f8c,0x12}, - {0x8f8d,0x0a}, - {0x8f8e,0x20}, - {0x8f8f,0x30}, - {0x8f90,0x33}, - {0x8f91,0x02}, - {0x8f92,0xc3}, - {0x8f93,0x22}, - {0x8f94,0xe5}, - {0x8f95,0x10}, - {0x8f96,0x45}, - {0x8f97,0x0f}, - {0x8f98,0x60}, - {0x8f99,0x0c}, - {0x8f9a,0x75}, - {0x8f9b,0x11}, - {0x8f9c,0x00}, - {0x8f9d,0x75}, - {0x8f9e,0x12}, - {0x8f9f,0x32}, - {0x8fa0,0x12}, - {0x8fa1,0x16}, - {0x8fa2,0xd5}, - {0x8fa3,0x02}, - {0x8fa4,0x0f}, - {0x8fa5,0x34}, - {0x8fa6,0x85}, - {0x8fa7,0x0c}, - {0x8fa8,0x7d}, - {0x8fa9,0xd3}, - {0x8faa,0x22}, - {0x8fab,0x12}, - {0x8fac,0x02}, - {0x8fad,0x92}, - {0x8fae,0xb5}, - {0x8faf,0x07}, - {0x8fb0,0x03}, - {0x8fb1,0xd3}, - {0x8fb2,0x80}, - {0x8fb3,0x01}, - {0x8fb4,0xc3}, - {0x8fb5,0x40}, - {0x8fb6,0x03}, - {0x8fb7,0x02}, - {0x8fb8,0x10}, - {0x8fb9,0x4a}, - {0x8fba,0x90}, - {0x8fbb,0x30}, - {0x8fbc,0x04}, - {0x8fbd,0xe0}, - {0x8fbe,0x44}, - {0x8fbf,0x20}, - {0x8fc0,0xf0}, - {0x8fc1,0xa3}, - {0x8fc2,0xe0}, - {0x8fc3,0x44}, - {0x8fc4,0x40}, - {0x8fc5,0xf0}, - {0x8fc6,0x90}, - {0x8fc7,0x50}, - {0x8fc8,0x25}, - {0x8fc9,0xe0}, - {0x8fca,0x44}, - {0x8fcb,0x04}, - {0x8fcc,0xf0}, - {0x8fcd,0x90}, - {0x8fce,0x50}, - {0x8fcf,0x03}, - {0x8fd0,0xe0}, - {0x8fd1,0x54}, - {0x8fd2,0xfd}, - {0x8fd3,0xf0}, - {0x8fd4,0x90}, - {0x8fd5,0x50}, - {0x8fd6,0x27}, - {0x8fd7,0xe0}, - {0x8fd8,0x44}, - {0x8fd9,0x01}, - {0x8fda,0xf0}, - {0x8fdb,0x90}, - {0x8fdc,0x50}, - {0x8fdd,0x31}, - {0x8fde,0xe4}, - {0x8fdf,0xf0}, - {0x8fe0,0x90}, - {0x8fe1,0x50}, - {0x8fe2,0x33}, - {0x8fe3,0xf0}, - {0x8fe4,0x90}, - {0x8fe5,0x30}, - {0x8fe6,0x1e}, - {0x8fe7,0x12}, - {0x8fe8,0x02}, - {0x8fe9,0x1f}, - {0x8fea,0x90}, - {0x8feb,0x30}, - {0x8fec,0x18}, - {0x8fed,0x12}, - {0x8fee,0x02}, - {0x8fef,0x1f}, - {0x8ff0,0x90}, - {0x8ff1,0x30}, - {0x8ff2,0x1b}, - {0x8ff3,0x12}, - {0x8ff4,0x02}, - {0x8ff5,0x1f}, - {0x8ff6,0xe0}, - {0x8ff7,0xf5}, - {0x8ff8,0x25}, - {0x8ff9,0x90}, - {0x8ffa,0x30}, - {0x8ffb,0x18}, - {0x8ffc,0xe0}, - {0x8ffd,0xf5}, - {0x8ffe,0x21}, - {0x8fff,0x90}, - {0x9000,0x60}, - {0x9001,0x00}, - {0x9002,0x74}, - {0x9003,0xf5}, - {0x9004,0xf0}, - {0x9005,0x90}, - {0x9006,0x3f}, - {0x9007,0x01}, - {0x9008,0xe4}, - {0x9009,0xf0}, - {0x900a,0xa3}, - {0x900b,0xf0}, - {0x900c,0x90}, - {0x900d,0x3f}, - {0x900e,0x01}, - {0x900f,0xe0}, - {0x9010,0x44}, - {0x9011,0x08}, - {0x9012,0xf0}, - {0x9013,0xe0}, - {0x9014,0x44}, - {0x9015,0x20}, - {0x9016,0xf0}, - {0x9017,0x90}, - {0x9018,0x3f}, - {0x9019,0x05}, - {0x901a,0x74}, - {0x901b,0x30}, - {0x901c,0xf0}, - {0x901d,0xa3}, - {0x901e,0x74}, - {0x901f,0x24}, - {0x9020,0xf0}, - {0x9021,0x90}, - {0x9022,0x3f}, - {0x9023,0x0b}, - {0x9024,0xe0}, - {0x9025,0x44}, - {0x9026,0x0f}, - {0x9027,0xf0}, - {0x9028,0x90}, - {0x9029,0x3f}, - {0x902a,0x01}, - {0x902b,0xe0}, - {0x902c,0x44}, - {0x902d,0x02}, - {0x902e,0xf0}, - {0x902f,0xc2}, - {0x9030,0x8c}, - {0x9031,0x75}, - {0x9032,0x89}, - {0x9033,0x03}, - {0x9034,0x75}, - {0x9035,0xa8}, - {0x9036,0x07}, - {0x9037,0x75}, - {0x9038,0xb8}, - {0x9039,0x04}, - {0x903a,0xe4}, - {0x903b,0xf5}, - {0x903c,0xd8}, - {0x903d,0xf5}, - {0x903e,0xe8}, - {0x903f,0x90}, - {0x9040,0x30}, - {0x9041,0x01}, - {0x9042,0xe0}, - {0x9043,0x44}, - {0x9044,0x40}, - {0x9045,0xf0}, - {0x9046,0xe0}, - {0x9047,0x54}, - {0x9048,0xbf}, - {0x9049,0xf0}, - {0x904a,0x22}, - {0x904b,0xe5}, - {0x904c,0x7e}, - {0x904d,0x64}, - {0x904e,0x01}, - {0x904f,0x70}, - {0x9050,0x4f}, - {0x9051,0x12}, - {0x9052,0x01}, - {0x9053,0x88}, - {0x9054,0xe5}, - {0x9055,0x7d}, - {0x9056,0x12}, - {0x9057,0x01}, - {0x9058,0x7b}, - {0x9059,0x12}, - {0x905a,0x02}, - {0x905b,0x11}, - {0x905c,0xfe}, - {0x905d,0xe4}, - {0x905e,0x8f}, - {0x905f,0x69}, - {0x9060,0x8e}, - {0x9061,0x68}, - {0x9062,0xf5}, - {0x9063,0x67}, - {0x9064,0xf5}, - {0x9065,0x66}, - {0x9066,0x12}, - {0x9067,0x02}, - {0x9068,0x08}, - {0x9069,0x7b}, - {0x906a,0xff}, - {0x906b,0xfa}, - {0x906c,0xf9}, - {0x906d,0xf8}, - {0x906e,0x12}, - {0x906f,0x01}, - {0x9070,0xfd}, - {0x9071,0xc0}, - {0x9072,0x04}, - {0x9073,0xc0}, - {0x9074,0x05}, - {0x9075,0xc0}, - {0x9076,0x06}, - {0x9077,0xc0}, - {0x9078,0x07}, - {0x9079,0x12}, - {0x907a,0x01}, - {0x907b,0x73}, - {0x907c,0x12}, - {0x907d,0x02}, - {0x907e,0x11}, - {0x907f,0xab}, - {0x9080,0x07}, - {0x9081,0xfa}, - {0x9082,0xe4}, - {0x9083,0xf9}, - {0x9084,0xf8}, - {0x9085,0xd0}, - {0x9086,0x07}, - {0x9087,0xd0}, - {0x9088,0x06}, - {0x9089,0xd0}, - {0x908a,0x05}, - {0x908b,0xd0}, - {0x908c,0x04}, - {0x908d,0x12}, - {0x908e,0x02}, - {0x908f,0x7a}, - {0x9090,0x85}, - {0x9091,0x69}, - {0x9092,0x66}, - {0x9093,0x85}, - {0x9094,0x7d}, - {0x9095,0x67}, - {0x9096,0x12}, - {0x9097,0x01}, - {0x9098,0x88}, - {0x9099,0x75}, - {0x909a,0xf0}, - {0x909b,0x02}, - {0x909c,0xe5}, - {0x909d,0x7d}, - {0x909e,0x80}, - {0x909f,0x1d}, - {0x90a0,0xe5}, - {0x90a1,0x7e}, - {0x90a2,0xb4}, - {0x90a3,0x02}, - {0x90a4,0x08}, - {0x90a5,0xe4}, - {0x90a6,0xf5}, - {0x90a7,0x67}, - {0x90a8,0x12}, - {0x90a9,0x01}, - {0x90aa,0x88}, - {0x90ab,0x80}, - {0x90ac,0x14}, - {0x90ad,0xe5}, - {0x90ae,0x7e}, - {0x90af,0xb4}, - {0x90b0,0x03}, - {0x90b1,0x17}, - {0x90b2,0x85}, - {0x90b3,0x7c}, - {0x90b4,0x67}, - {0x90b5,0x12}, - {0x90b6,0x01}, - {0x90b7,0x88}, - {0x90b8,0x75}, - {0x90b9,0xf0}, - {0x90ba,0x02}, - {0x90bb,0xe5}, - {0x90bc,0x7c}, - {0x90bd,0x12}, - {0x90be,0x09}, - {0x90bf,0xee}, - {0x90c0,0xe4}, - {0x90c1,0x93}, - {0x90c2,0xf5}, - {0x90c3,0x68}, - {0x90c4,0x74}, - {0x90c5,0x01}, - {0x90c6,0x93}, - {0x90c7,0xf5}, - {0x90c8,0x69}, - {0x90c9,0x90}, - {0x90ca,0x50}, - {0x90cb,0x82}, - {0x90cc,0xe5}, - {0x90cd,0x66}, - {0x90ce,0xf0}, - {0x90cf,0xa3}, - {0x90d0,0xe5}, - {0x90d1,0x67}, - {0x90d2,0xf0}, - {0x90d3,0xa3}, - {0x90d4,0xe5}, - {0x90d5,0x68}, - {0x90d6,0xf0}, - {0x90d7,0xa3}, - {0x90d8,0xe5}, - {0x90d9,0x69}, - {0x90da,0xf0}, - {0x90db,0x22}, - {0x90dc,0x30}, - {0x90dd,0x3e}, - {0x90de,0x09}, - {0x90df,0x30}, - {0x90e0,0x20}, - {0x90e1,0x06}, - {0x90e2,0xae}, - {0x90e3,0x56}, - {0x90e4,0xaf}, - {0x90e5,0x57}, - {0x90e6,0x80}, - {0x90e7,0x04}, - {0x90e8,0xae}, - {0x90e9,0x6a}, - {0x90ea,0xaf}, - {0x90eb,0x6b}, - {0x90ec,0x8e}, - {0x90ed,0x56}, - {0x90ee,0x8f}, - {0x90ef,0x57}, - {0x90f0,0x30}, - {0x90f1,0x3e}, - {0x90f2,0x09}, - {0x90f3,0x30}, - {0x90f4,0x21}, - {0x90f5,0x06}, - {0x90f6,0xae}, - {0x90f7,0x58}, - {0x90f8,0xaf}, - {0x90f9,0x59}, - {0x90fa,0x80}, - {0x90fb,0x04}, - {0x90fc,0xae}, - {0x90fd,0x6c}, - {0x90fe,0xaf}, - {0x90ff,0x6d}, - {0x9100,0x8e}, - {0x9101,0x58}, - {0x9102,0x8f}, - {0x9103,0x59}, - {0x9104,0x30}, - {0x9105,0x3e}, - {0x9106,0x09}, - {0x9107,0x30}, - {0x9108,0x22}, - {0x9109,0x06}, - {0x910a,0xae}, - {0x910b,0x5a}, - {0x910c,0xaf}, - {0x910d,0x5b}, - {0x910e,0x80}, - {0x910f,0x04}, - {0x9110,0xae}, - {0x9111,0x6e}, - {0x9112,0xaf}, - {0x9113,0x6f}, - {0x9114,0x8e}, - {0x9115,0x5a}, - {0x9116,0x8f}, - {0x9117,0x5b}, - {0x9118,0x30}, - {0x9119,0x3e}, - {0x911a,0x09}, - {0x911b,0x30}, - {0x911c,0x23}, - {0x911d,0x06}, - {0x911e,0xae}, - {0x911f,0x5c}, - {0x9120,0xaf}, - {0x9121,0x5d}, - {0x9122,0x80}, - {0x9123,0x04}, - {0x9124,0xae}, - {0x9125,0x70}, - {0x9126,0xaf}, - {0x9127,0x71}, - {0x9128,0x8e}, - {0x9129,0x5c}, - {0x912a,0x8f}, - {0x912b,0x5d}, - {0x912c,0x30}, - {0x912d,0x3e}, - {0x912e,0x09}, - {0x912f,0x30}, - {0x9130,0x24}, - {0x9131,0x06}, - {0x9132,0xae}, - {0x9133,0x5e}, - {0x9134,0xaf}, - {0x9135,0x5f}, - {0x9136,0x80}, - {0x9137,0x04}, - {0x9138,0xae}, - {0x9139,0x72}, - {0x913a,0xaf}, - {0x913b,0x73}, - {0x913c,0x8e}, - {0x913d,0x5e}, - {0x913e,0x8f}, - {0x913f,0x5f}, - {0x9140,0x30}, - {0x9141,0x3e}, - {0x9142,0x09}, - {0x9143,0x30}, - {0x9144,0x25}, - {0x9145,0x06}, - {0x9146,0xae}, - {0x9147,0x60}, - {0x9148,0xaf}, - {0x9149,0x61}, - {0x914a,0x80}, - {0x914b,0x04}, - {0x914c,0xae}, - {0x914d,0x74}, - {0x914e,0xaf}, - {0x914f,0x75}, - {0x9150,0x8e}, - {0x9151,0x60}, - {0x9152,0x8f}, - {0x9153,0x61}, - {0x9154,0x30}, - {0x9155,0x3e}, - {0x9156,0x09}, - {0x9157,0x30}, - {0x9158,0x26}, - {0x9159,0x06}, - {0x915a,0xae}, - {0x915b,0x62}, - {0x915c,0xaf}, - {0x915d,0x63}, - {0x915e,0x80}, - {0x915f,0x04}, - {0x9160,0xae}, - {0x9161,0x76}, - {0x9162,0xaf}, - {0x9163,0x77}, - {0x9164,0x8e}, - {0x9165,0x62}, - {0x9166,0x8f}, - {0x9167,0x63}, - {0x9168,0x22}, - {0x9169,0x30}, - {0x916a,0x36}, - {0x916b,0x4e}, - {0x916c,0x12}, - {0x916d,0x11}, - {0x916e,0xe1}, - {0x916f,0xe5}, - {0x9170,0x32}, - {0x9171,0xd3}, - {0x9172,0x95}, - {0x9173,0x7d}, - {0x9174,0x40}, - {0x9175,0x0c}, - {0x9176,0xe5}, - {0x9177,0x32}, - {0x9178,0x04}, - {0x9179,0xf5}, - {0x917a,0x0c}, - {0x917b,0x12}, - {0x917c,0x0e}, - {0x917d,0xf9}, - {0x917e,0xd2}, - {0x917f,0x37}, - {0x9180,0x80}, - {0x9181,0x44}, - {0x9182,0xe5}, - {0x9183,0x7c}, - {0x9184,0xb5}, - {0x9185,0x7d}, - {0x9186,0x04}, - {0x9187,0x7f}, - {0x9188,0x01}, - {0x9189,0x80}, - {0x918a,0x02}, - {0x918b,0x7f}, - {0x918c,0x00}, - {0x918d,0xef}, - {0x918e,0x24}, - {0x918f,0xfb}, - {0x9190,0xd3}, - {0x9191,0x64}, - {0x9192,0x80}, - {0x9193,0xf8}, - {0x9194,0xe5}, - {0x9195,0x7d}, - {0x9196,0x64}, - {0x9197,0x80}, - {0x9198,0x98}, - {0x9199,0x40}, - {0x919a,0x12}, - {0x919b,0xc2}, - {0x919c,0x37}, - {0x919d,0xe5}, - {0x919e,0x7c}, - {0x919f,0xb5}, - {0x91a0,0x7d}, - {0x91a1,0x04}, - {0x91a2,0x7f}, - {0x91a3,0x01}, - {0x91a4,0x80}, - {0x91a5,0x02}, - {0x91a6,0x7f}, - {0x91a7,0x00}, - {0x91a8,0xef}, - {0x91a9,0x24}, - {0x91aa,0xfa}, - {0x91ab,0x80}, - {0x91ac,0x06}, - {0x91ad,0xd2}, - {0x91ae,0x37}, - {0x91af,0xe5}, - {0x91b0,0x7d}, - {0x91b1,0x24}, - {0x91b2,0x02}, - {0x91b3,0xf5}, - {0x91b4,0x0c}, - {0x91b5,0x12}, - {0x91b6,0x0e}, - {0x91b7,0xf9}, - {0x91b8,0x80}, - {0x91b9,0x0c}, - {0x91ba,0xe5}, - {0x91bb,0x7d}, - {0x91bc,0x70}, - {0x91bd,0x0f}, - {0x91be,0x12}, - {0x91bf,0x11}, - {0x91c0,0xe1}, - {0x91c1,0xc2}, - {0x91c2,0x03}, - {0x91c3,0x12}, - {0x91c4,0x17}, - {0x91c5,0x3c}, - {0x91c6,0xd2}, - {0x91c7,0x02}, - {0x91c8,0xd2}, - {0x91c9,0x01}, - {0x91ca,0xd2}, - {0x91cb,0x00}, - {0x91cc,0x22}, - {0x91cd,0x30}, - {0x91ce,0x03}, - {0x91cf,0x08}, - {0x91d0,0xc2}, - {0x91d1,0x03}, - {0x91d2,0xc2}, - {0x91d3,0x04}, - {0x91d4,0x12}, - {0x91d5,0x02}, - {0x91d6,0xa8}, - {0x91d7,0x22}, - {0x91d8,0xe4}, - {0x91d9,0xf5}, - {0x91da,0x0c}, - {0x91db,0x12}, - {0x91dc,0x0e}, - {0x91dd,0xf9}, - {0x91de,0xd2}, - {0x91df,0x03}, - {0x91e0,0x22}, - {0x91e1,0x12}, - {0x91e2,0x17}, - {0x91e3,0x28}, - {0x91e4,0xc2}, - {0x91e5,0x3e}, - {0x91e6,0x12}, - {0x91e7,0x10}, - {0x91e8,0xdc}, - {0x91e9,0xc2}, - {0x91ea,0x3e}, - {0x91eb,0x12}, - {0x91ec,0x14}, - {0x91ed,0x01}, - {0x91ee,0x22}, - {0x91ef,0xd3}, - {0x91f0,0xe5}, - {0x91f1,0x57}, - {0x91f2,0x95}, - {0x91f3,0x6b}, - {0x91f4,0xe5}, - {0x91f5,0x56}, - {0x91f6,0x95}, - {0x91f7,0x6a}, - {0x91f8,0x40}, - {0x91f9,0x03}, - {0x91fa,0xd3}, - {0x91fb,0x80}, - {0x91fc,0x01}, - {0x91fd,0xc3}, - {0x91fe,0x92}, - {0x91ff,0x20}, - {0x9200,0xd3}, - {0x9201,0xe5}, - {0x9202,0x59}, - {0x9203,0x95}, - {0x9204,0x6d}, - {0x9205,0xe5}, - {0x9206,0x58}, - {0x9207,0x95}, - {0x9208,0x6c}, - {0x9209,0x40}, - {0x920a,0x03}, - {0x920b,0xd3}, - {0x920c,0x80}, - {0x920d,0x01}, - {0x920e,0xc3}, - {0x920f,0x92}, - {0x9210,0x21}, - {0x9211,0xd3}, - {0x9212,0xe5}, - {0x9213,0x5b}, - {0x9214,0x95}, - {0x9215,0x6f}, - {0x9216,0xe5}, - {0x9217,0x5a}, - {0x9218,0x95}, - {0x9219,0x6e}, - {0x921a,0x40}, - {0x921b,0x03}, - {0x921c,0xd3}, - {0x921d,0x80}, - {0x921e,0x01}, - {0x921f,0xc3}, - {0x9220,0x92}, - {0x9221,0x22}, - {0x9222,0xd3}, - {0x9223,0xe5}, - {0x9224,0x5d}, - {0x9225,0x95}, - {0x9226,0x71}, - {0x9227,0xe5}, - {0x9228,0x5c}, - {0x9229,0x95}, - {0x922a,0x70}, - {0x922b,0x40}, - {0x922c,0x03}, - {0x922d,0xd3}, - {0x922e,0x80}, - {0x922f,0x01}, - {0x9230,0xc3}, - {0x9231,0x92}, - {0x9232,0x23}, - {0x9233,0xd3}, - {0x9234,0xe5}, - {0x9235,0x5f}, - {0x9236,0x95}, - {0x9237,0x73}, - {0x9238,0xe5}, - {0x9239,0x5e}, - {0x923a,0x95}, - {0x923b,0x72}, - {0x923c,0x40}, - {0x923d,0x03}, - {0x923e,0xd3}, - {0x923f,0x80}, - {0x9240,0x01}, - {0x9241,0xc3}, - {0x9242,0x92}, - {0x9243,0x24}, - {0x9244,0xd3}, - {0x9245,0xe5}, - {0x9246,0x61}, - {0x9247,0x95}, - {0x9248,0x75}, - {0x9249,0xe5}, - {0x924a,0x60}, - {0x924b,0x95}, - {0x924c,0x74}, - {0x924d,0x40}, - {0x924e,0x03}, - {0x924f,0xd3}, - {0x9250,0x80}, - {0x9251,0x01}, - {0x9252,0xc3}, - {0x9253,0x92}, - {0x9254,0x25}, - {0x9255,0xd3}, - {0x9256,0xe5}, - {0x9257,0x63}, - {0x9258,0x95}, - {0x9259,0x77}, - {0x925a,0xe5}, - {0x925b,0x62}, - {0x925c,0x95}, - {0x925d,0x76}, - {0x925e,0x40}, - {0x925f,0x03}, - {0x9260,0xd3}, - {0x9261,0x80}, - {0x9262,0x01}, - {0x9263,0xc3}, - {0x9264,0x92}, - {0x9265,0x26}, - {0x9266,0x22}, - {0x9267,0x56}, - {0x9268,0x0c}, - {0x9269,0x04}, - {0x926a,0x00}, - {0x926b,0x00}, - {0x926c,0x00}, - {0x926d,0xc8}, - {0x926e,0x01}, - {0x926f,0x2c}, - {0x9270,0x01}, - {0x9271,0x5e}, - {0x9272,0x01}, - {0x9273,0x8b}, - {0x9274,0x01}, - {0x9275,0xb8}, - {0x9276,0x01}, - {0x9277,0xe5}, - {0x9278,0x02}, - {0x9279,0x12}, - {0x927a,0x02}, - {0x927b,0x3f}, - {0x927c,0x02}, - {0x927d,0x6c}, - {0x927e,0x02}, - {0x927f,0x99}, - {0x9280,0x02}, - {0x9281,0xc6}, - {0x9282,0x02}, - {0x9283,0xf3}, - {0x9284,0x07}, - {0x9285,0x20}, - {0x9286,0x12}, - {0x9287,0x28}, - {0x9288,0x1e}, - {0x9289,0x18}, - {0x928a,0x18}, - {0x928b,0x28}, - {0x928c,0x1e}, - {0x928d,0x18}, - {0x928e,0x12}, - {0x928f,0x28}, - {0x9290,0x1e}, - {0x9291,0x18}, - {0x9292,0x12}, - {0x9293,0x28}, - {0x9294,0x18}, - {0x9295,0x18}, - {0x9296,0x12}, - {0x9297,0x20}, - {0x9298,0x18}, - {0x9299,0x28}, - {0x929a,0x1c}, - {0x929b,0x30}, - {0x929c,0x24}, - {0x929d,0x10}, - {0x929e,0x1c}, - {0x929f,0x18}, - {0x92a0,0x24}, - {0x92a1,0x1c}, - {0x92a2,0x14}, - {0x92a3,0x24}, - {0x92a4,0x1c}, - {0x92a5,0x28}, - {0x92a6,0x0c}, - {0x92a7,0x30}, - {0x92a8,0x14}, - {0x92a9,0x10}, - {0x92aa,0x0c}, - {0x92ab,0x18}, - {0x92ac,0x14}, - {0x92ad,0x1c}, - {0x92ae,0x20}, - {0x92af,0x24}, - {0x92b0,0x28}, - {0x92b1,0x0c}, - {0x92b2,0x14}, - {0x92b3,0x14}, - {0x92b4,0x1c}, - {0x92b5,0x1c}, - {0x92b6,0x14}, - {0x92b7,0x24}, - {0x92b8,0x1c}, - {0x92b9,0x2c}, - {0x92ba,0x14}, - {0x92bb,0x34}, - {0x92bc,0x1c}, - {0x92bd,0x1c}, - {0x92be,0x08}, - {0x92bf,0x24}, - {0x92c0,0x10}, - {0x92c1,0x19}, - {0x92c2,0x19}, - {0x92c3,0x1c}, - {0x92c4,0x19}, - {0x92c5,0x19}, - {0x92c6,0x10}, - {0x92c7,0x10}, - {0x92c8,0x10}, - {0x92c9,0x10}, - {0x92ca,0x10}, - {0x92cb,0x00}, - {0x92cc,0x00}, - {0x92cd,0x00}, - {0x92ce,0x00}, - {0x92cf,0x00}, - {0x92d0,0x12}, - {0x92d1,0x11}, - {0x92d2,0xef}, - {0x92d3,0x30}, - {0x92d4,0x36}, - {0x92d5,0x40}, - {0x92d6,0xe5}, - {0x92d7,0x24}, - {0x92d8,0x54}, - {0x92d9,0x1f}, - {0x92da,0xff}, - {0x92db,0x60}, - {0x92dc,0x0e}, - {0x92dd,0x64}, - {0x92de,0x1f}, - {0x92df,0x60}, - {0x92e0,0x0a}, - {0x92e1,0xe5}, - {0x92e2,0x7c}, - {0x92e3,0x65}, - {0x92e4,0x7d}, - {0x92e5,0x60}, - {0x92e6,0x04}, - {0x92e7,0xe5}, - {0x92e8,0x7d}, - {0x92e9,0x70}, - {0x92ea,0x18}, - {0x92eb,0xbf}, - {0x92ec,0x1f}, - {0x92ed,0x02}, - {0x92ee,0xb2}, - {0x92ef,0x37}, - {0x92f0,0xe5}, - {0x92f1,0x7c}, - {0x92f2,0xb5}, - {0x92f3,0x7d}, - {0x92f4,0x02}, - {0x92f5,0xc2}, - {0x92f6,0x37}, - {0x92f7,0xe5}, - {0x92f8,0x7d}, - {0x92f9,0x70}, - {0x92fa,0x02}, - {0x92fb,0xd2}, - {0x92fc,0x37}, - {0x92fd,0xc2}, - {0x92fe,0x02}, - {0x92ff,0xd2}, - {0x9300,0x01}, - {0x9301,0xd2}, - {0x9302,0x00}, - {0x9303,0xc2}, - {0x9304,0x3e}, - {0x9305,0x12}, - {0x9306,0x10}, - {0x9307,0xdc}, - {0x9308,0xc2}, - {0x9309,0x3e}, - {0x930a,0x12}, - {0x930b,0x14}, - {0x930c,0x01}, - {0x930d,0x30}, - {0x930e,0x37}, - {0x930f,0x03}, - {0x9310,0x02}, - {0x9311,0x17}, - {0x9312,0x3c}, - {0x9313,0x02}, - {0x9314,0x17}, - {0x9315,0x4d}, - {0x9316,0xd2}, - {0x9317,0x3e}, - {0x9318,0x12}, - {0x9319,0x10}, - {0x931a,0xdc}, - {0x931b,0xd2}, - {0x931c,0x3e}, - {0x931d,0x12}, - {0x931e,0x14}, - {0x931f,0x01}, - {0x9320,0x12}, - {0x9321,0x17}, - {0x9322,0x3c}, - {0x9323,0xe5}, - {0x9324,0x32}, - {0x9325,0xd3}, - {0x9326,0x95}, - {0x9327,0x7d}, - {0x9328,0x40}, - {0x9329,0x05}, - {0x932a,0xe4}, - {0x932b,0x95}, - {0x932c,0x7d}, - {0x932d,0x40}, - {0x932e,0x06}, - {0x932f,0xc2}, - {0x9330,0x02}, - {0x9331,0xd2}, - {0x9332,0x01}, - {0x9333,0xd2}, - {0x9334,0x00}, - {0x9335,0x22}, - {0x9336,0x12}, - {0x9337,0x11}, - {0x9338,0xef}, - {0x9339,0xc3}, - {0x933a,0x30}, - {0x933b,0x25}, - {0x933c,0x0c}, - {0x933d,0xe5}, - {0x933e,0x61}, - {0x933f,0x95}, - {0x9340,0x75}, - {0x9341,0xff}, - {0x9342,0xe5}, - {0x9343,0x60}, - {0x9344,0x95}, - {0x9345,0x74}, - {0x9346,0xfe}, - {0x9347,0x80}, - {0x9348,0x0a}, - {0x9349,0xe5}, - {0x934a,0x75}, - {0x934b,0x95}, - {0x934c,0x61}, - {0x934d,0xff}, - {0x934e,0xe5}, - {0x934f,0x74}, - {0x9350,0x95}, - {0x9351,0x60}, - {0x9352,0xfe}, - {0x9353,0x8e}, - {0x9354,0x0a}, - {0x9355,0x8f}, - {0x9356,0x0b}, - {0x9357,0x30}, - {0x9358,0x03}, - {0x9359,0x26}, - {0x935a,0x12}, - {0x935b,0x02}, - {0x935c,0xb6}, - {0x935d,0x50}, - {0x935e,0x03}, - {0x935f,0x30}, - {0x9360,0x27}, - {0x9361,0x07}, - {0x9362,0xc2}, - {0x9363,0x3e}, - {0x9364,0x12}, - {0x9365,0x10}, - {0x9366,0xdc}, - {0x9367,0x80}, - {0x9368,0x2f}, - {0x9369,0x05}, - {0x936a,0x31}, - {0x936b,0xe5}, - {0x936c,0x31}, - {0x936d,0xd3}, - {0x936e,0x94}, - {0x936f,0x02}, - {0x9370,0x40}, - {0x9371,0x29}, - {0x9372,0xe4}, - {0x9373,0xf5}, - {0x9374,0x31}, - {0x9375,0xc2}, - {0x9376,0x03}, - {0x9377,0xc2}, - {0x9378,0x02}, - {0x9379,0xc2}, - {0x937a,0x01}, - {0x937b,0xd2}, - {0x937c,0x00}, - {0x937d,0xd2}, - {0x937e,0x34}, - {0x937f,0x22}, - {0x9380,0x12}, - {0x9381,0x02}, - {0x9382,0xb6}, - {0x9383,0x50}, - {0x9384,0x03}, - {0x9385,0x30}, - {0x9386,0x27}, - {0x9387,0x04}, - {0x9388,0x05}, - {0x9389,0x31}, - {0x938a,0x80}, - {0x938b,0x03}, - {0x938c,0xe4}, - {0x938d,0xf5}, - {0x938e,0x31}, - {0x938f,0xe5}, - {0x9390,0x31}, - {0x9391,0xd3}, - {0x9392,0x94}, - {0x9393,0x02}, - {0x9394,0x40}, - {0x9395,0x05}, - {0x9396,0xd2}, - {0x9397,0x03}, - {0x9398,0xe4}, - {0x9399,0xf5}, - {0x939a,0x31}, - {0x939b,0x22}, - {0x939c,0xe5}, - {0x939d,0x0a}, - {0x939e,0x70}, - {0x939f,0x04}, - {0x93a0,0x7a}, - {0x93a1,0x12}, - {0x93a2,0x7b}, - {0x93a3,0x85}, - {0x93a4,0xe5}, - {0x93a5,0x0a}, - {0x93a6,0xb4}, - {0x93a7,0x01}, - {0x93a8,0x04}, - {0x93a9,0x7a}, - {0x93aa,0x12}, - {0x93ab,0x7b}, - {0x93ac,0x99}, - {0x93ad,0xe5}, - {0x93ae,0x0a}, - {0x93af,0xb4}, - {0x93b0,0x02}, - {0x93b1,0x04}, - {0x93b2,0x7a}, - {0x93b3,0x12}, - {0x93b4,0x7b}, - {0x93b5,0xad}, - {0x93b6,0x8b}, - {0x93b7,0x82}, - {0x93b8,0x8a}, - {0x93b9,0x83}, - {0x93ba,0x12}, - {0x93bb,0x09}, - {0x93bc,0xde}, - {0x93bd,0x8f}, - {0x93be,0x37}, - {0x93bf,0x8e}, - {0x93c0,0x36}, - {0x93c1,0x8d}, - {0x93c2,0x35}, - {0x93c3,0x8c}, - {0x93c4,0x34}, - {0x93c5,0xe5}, - {0x93c6,0x82}, - {0x93c7,0x24}, - {0x93c8,0x04}, - {0x93c9,0xf5}, - {0x93ca,0x82}, - {0x93cb,0xe4}, - {0x93cc,0x35}, - {0x93cd,0x83}, - {0x93ce,0xf5}, - {0x93cf,0x83}, - {0x93d0,0x12}, - {0x93d1,0x09}, - {0x93d2,0xde}, - {0x93d3,0x8f}, - {0x93d4,0x3b}, - {0x93d5,0x8e}, - {0x93d6,0x3a}, - {0x93d7,0x8d}, - {0x93d8,0x39}, - {0x93d9,0x8c}, - {0x93da,0x38}, - {0x93db,0xeb}, - {0x93dc,0x24}, - {0x93dd,0x08}, - {0x93de,0x12}, - {0x93df,0x02}, - {0x93e0,0x53}, - {0x93e1,0x12}, - {0x93e2,0x01}, - {0x93e3,0xb3}, - {0x93e4,0xeb}, - {0x93e5,0x24}, - {0x93e6,0x0c}, - {0x93e7,0x12}, - {0x93e8,0x02}, - {0x93e9,0x53}, - {0x93ea,0x8f}, - {0x93eb,0x43}, - {0x93ec,0x8e}, - {0x93ed,0x42}, - {0x93ee,0x8d}, - {0x93ef,0x41}, - {0x93f0,0x8c}, - {0x93f1,0x40}, - {0x93f2,0xeb}, - {0x93f3,0x24}, - {0x93f4,0x10}, - {0x93f5,0x12}, - {0x93f6,0x02}, - {0x93f7,0x53}, - {0x93f8,0x8f}, - {0x93f9,0x47}, - {0x93fa,0x8e}, - {0x93fb,0x46}, - {0x93fc,0x8d}, - {0x93fd,0x45}, - {0x93fe,0x8c}, - {0x93ff,0x44}, - {0x9400,0x22}, - {0x9401,0x30}, - {0x9402,0x3e}, - {0x9403,0x07}, - {0x9404,0x30}, - {0x9405,0x20}, - {0x9406,0x04}, - {0x9407,0xaf}, - {0x9408,0x4a}, - {0x9409,0x80}, - {0x940a,0x02}, - {0x940b,0xaf}, - {0x940c,0x7d}, - {0x940d,0x8f}, - {0x940e,0x4a}, - {0x940f,0x30}, - {0x9410,0x3e}, - {0x9411,0x07}, - {0x9412,0x30}, - {0x9413,0x21}, - {0x9414,0x04}, - {0x9415,0xaf}, - {0x9416,0x4b}, - {0x9417,0x80}, - {0x9418,0x02}, - {0x9419,0xaf}, - {0x941a,0x7d}, - {0x941b,0x8f}, - {0x941c,0x4b}, - {0x941d,0x30}, - {0x941e,0x3e}, - {0x941f,0x07}, - {0x9420,0x30}, - {0x9421,0x22}, - {0x9422,0x04}, - {0x9423,0xaf}, - {0x9424,0x4c}, - {0x9425,0x80}, - {0x9426,0x02}, - {0x9427,0xaf}, - {0x9428,0x7d}, - {0x9429,0x8f}, - {0x942a,0x4c}, - {0x942b,0x30}, - {0x942c,0x3e}, - {0x942d,0x07}, - {0x942e,0x30}, - {0x942f,0x23}, - {0x9430,0x04}, - {0x9431,0xaf}, - {0x9432,0x4d}, - {0x9433,0x80}, - {0x9434,0x02}, - {0x9435,0xaf}, - {0x9436,0x7d}, - {0x9437,0x8f}, - {0x9438,0x4d}, - {0x9439,0x30}, - {0x943a,0x3e}, - {0x943b,0x07}, - {0x943c,0x30}, - {0x943d,0x24}, - {0x943e,0x04}, - {0x943f,0xaf}, - {0x9440,0x4e}, - {0x9441,0x80}, - {0x9442,0x02}, - {0x9443,0xaf}, - {0x9444,0x7d}, - {0x9445,0x8f}, - {0x9446,0x4e}, - {0x9447,0x30}, - {0x9448,0x3e}, - {0x9449,0x07}, - {0x944a,0x30}, - {0x944b,0x25}, - {0x944c,0x04}, - {0x944d,0xaf}, - {0x944e,0x4f}, - {0x944f,0x80}, - {0x9450,0x02}, - {0x9451,0xaf}, - {0x9452,0x7d}, - {0x9453,0x8f}, - {0x9454,0x4f}, - {0x9455,0x30}, - {0x9456,0x3e}, - {0x9457,0x07}, - {0x9458,0x30}, - {0x9459,0x26}, - {0x945a,0x04}, - {0x945b,0xaf}, - {0x945c,0x50}, - {0x945d,0x80}, - {0x945e,0x02}, - {0x945f,0xaf}, - {0x9460,0x7d}, - {0x9461,0x8f}, - {0x9462,0x50}, - {0x9463,0x22}, - {0x9464,0x12}, - {0x9465,0x11}, - {0x9466,0xef}, - {0x9467,0xd2}, - {0x9468,0x3e}, - {0x9469,0x12}, - {0x946a,0x10}, - {0x946b,0xdc}, - {0x946c,0xd2}, - {0x946d,0x3e}, - {0x946e,0x12}, - {0x946f,0x14}, - {0x9470,0x01}, - {0x9471,0x30}, - {0x9472,0x36}, - {0x9473,0x26}, - {0x9474,0x30}, - {0x9475,0x37}, - {0x9476,0x06}, - {0x9477,0xe5}, - {0x9478,0x7c}, - {0x9479,0x65}, - {0x947a,0x7d}, - {0x947b,0x60}, - {0x947c,0x3e}, - {0x947d,0x20}, - {0x947e,0x37}, - {0x947f,0x04}, - {0x9480,0xe5}, - {0x9481,0x7d}, - {0x9482,0x60}, - {0x9483,0x37}, - {0x9484,0xe5}, - {0x9485,0x24}, - {0x9486,0x54}, - {0x9487,0x1f}, - {0x9488,0xff}, - {0x9489,0xbf}, - {0x948a,0x1f}, - {0x948b,0x06}, - {0x948c,0x30}, - {0x948d,0x25}, - {0x948e,0x03}, - {0x948f,0x20}, - {0x9490,0x26}, - {0x9491,0x29}, - {0x9492,0x30}, - {0x9493,0x37}, - {0x9494,0x02}, - {0x9495,0x80}, - {0x9496,0x21}, - {0x9497,0x02}, - {0x9498,0x17}, - {0x9499,0x4d}, - {0x949a,0xe5}, - {0x949b,0x7c}, - {0x949c,0xd3}, - {0x949d,0x95}, - {0x949e,0x7d}, - {0x949f,0x40}, - {0x94a0,0x03}, - {0x94a1,0xd3}, - {0x94a2,0x80}, - {0x94a3,0x01}, - {0x94a4,0xc3}, - {0x94a5,0x50}, - {0x94a6,0x14}, - {0x94a7,0x20}, - {0x94a8,0x39}, - {0x94a9,0x0e}, - {0x94aa,0xe5}, - {0x94ab,0x24}, - {0x94ac,0x54}, - {0x94ad,0x1f}, - {0x94ae,0xff}, - {0x94af,0xbf}, - {0x94b0,0x1f}, - {0x94b1,0x06}, - {0x94b2,0x30}, - {0x94b3,0x25}, - {0x94b4,0x03}, - {0x94b5,0x20}, - {0x94b6,0x26}, - {0x94b7,0x03}, - {0x94b8,0x02}, - {0x94b9,0x17}, - {0x94ba,0x3c}, - {0x94bb,0x12}, - {0x94bc,0x02}, - {0x94bd,0xc0}, - {0x94be,0x22}, - {0x94bf,0xc2}, - {0x94c0,0x34}, - {0x94c1,0x20}, - {0x94c2,0x07}, - {0x94c3,0x08}, - {0x94c4,0x20}, - {0x94c5,0x06}, - {0x94c6,0x05}, - {0x94c7,0xe4}, - {0x94c8,0xf5}, - {0x94c9,0x0a}, - {0x94ca,0x80}, - {0x94cb,0x2b}, - {0x94cc,0x20}, - {0x94cd,0x07}, - {0x94ce,0x08}, - {0x94cf,0x30}, - {0x94d0,0x06}, - {0x94d1,0x05}, - {0x94d2,0x75}, - {0x94d3,0x0a}, - {0x94d4,0x20}, - {0x94d5,0x80}, - {0x94d6,0x20}, - {0x94d7,0x30}, - {0x94d8,0x00}, - {0x94d9,0x05}, - {0x94da,0x75}, - {0x94db,0x0a}, - {0x94dc,0x01}, - {0x94dd,0x80}, - {0x94de,0x18}, - {0x94df,0xe5}, - {0x94e0,0x20}, - {0x94e1,0x54}, - {0x94e2,0x07}, - {0x94e3,0xff}, - {0x94e4,0xbf}, - {0x94e5,0x06}, - {0x94e6,0x0d}, - {0x94e7,0x30}, - {0x94e8,0x31}, - {0x94e9,0x04}, - {0x94ea,0x7f}, - {0x94eb,0x12}, - {0x94ec,0x80}, - {0x94ed,0x02}, - {0x94ee,0x7f}, - {0x94ef,0x02}, - {0x94f0,0x8f}, - {0x94f1,0x0a}, - {0x94f2,0x80}, - {0x94f3,0x03}, - {0x94f4,0x75}, - {0x94f5,0x0a}, - {0x94f6,0xfe}, - {0x94f7,0x90}, - {0x94f8,0x30}, - {0x94f9,0x27}, - {0x94fa,0xe5}, - {0x94fb,0x0a}, - {0x94fc,0xf0}, - {0x94fd,0xe5}, - {0x94fe,0x23}, - {0x94ff,0x54}, - {0x9500,0xf8}, - {0x9501,0xf5}, - {0x9502,0x0a}, - {0x9503,0xe5}, - {0x9504,0x79}, - {0x9505,0x25}, - {0x9506,0x0a}, - {0x9507,0xf5}, - {0x9508,0x0a}, - {0x9509,0x90}, - {0x950a,0x30}, - {0x950b,0x26}, - {0x950c,0xe5}, - {0x950d,0x0a}, - {0x950e,0xf0}, - {0x950f,0x22}, - {0x9510,0xe5}, - {0x9511,0x0a}, - {0x9512,0x70}, - {0x9513,0x04}, - {0x9514,0x7e}, - {0x9515,0x12}, - {0x9516,0x7f}, - {0x9517,0xc1}, - {0x9518,0xe5}, - {0x9519,0x0a}, - {0x951a,0xb4}, - {0x951b,0x01}, - {0x951c,0x04}, - {0x951d,0x7e}, - {0x951e,0x12}, - {0x951f,0x7f}, - {0x9520,0xc6}, - {0x9521,0xe5}, - {0x9522,0x0a}, - {0x9523,0xb4}, - {0x9524,0x02}, - {0x9525,0x04}, - {0x9526,0x7e}, - {0x9527,0x12}, - {0x9528,0x7f}, - {0x9529,0xcb}, - {0x952a,0x8f}, - {0x952b,0x82}, - {0x952c,0x8e}, - {0x952d,0x83}, - {0x952e,0xe4}, - {0x952f,0x93}, - {0x9530,0xf5}, - {0x9531,0x2c}, - {0x9532,0x74}, - {0x9533,0x01}, - {0x9534,0x93}, - {0x9535,0xf5}, - {0x9536,0x2d}, - {0x9537,0x74}, - {0x9538,0x02}, - {0x9539,0x93}, - {0x953a,0xf5}, - {0x953b,0x2e}, - {0x953c,0x74}, - {0x953d,0x03}, - {0x953e,0x93}, - {0x953f,0xf5}, - {0x9540,0x2f}, - {0x9541,0x74}, - {0x9542,0x04}, - {0x9543,0x93}, - {0x9544,0xf5}, - {0x9545,0x30}, - {0x9546,0xe5}, - {0x9547,0x0a}, - {0x9548,0xb4}, - {0x9549,0x01}, - {0x954a,0x07}, - {0x954b,0x74}, - {0x954c,0x2c}, - {0x954d,0x25}, - {0x954e,0x79}, - {0x954f,0xf8}, - {0x9550,0x76}, - {0x9551,0x40}, - {0x9552,0xe5}, - {0x9553,0x0a}, - {0x9554,0xb4}, - {0x9555,0x02}, - {0x9556,0x07}, - {0x9557,0x74}, - {0x9558,0x2c}, - {0x9559,0x25}, - {0x955a,0x79}, - {0x955b,0xf8}, - {0x955c,0x76}, - {0x955d,0x80}, - {0x955e,0x22}, - {0x955f,0xc2}, - {0x9560,0xaf}, - {0x9561,0x90}, - {0x9562,0x30}, - {0x9563,0x27}, - {0x9564,0x74}, - {0x9565,0xfa}, - {0x9566,0xf0}, - {0x9567,0x12}, - {0x9568,0x0f}, - {0x9569,0xab}, - {0x956a,0x12}, - {0x956b,0x16}, - {0x956c,0xad}, - {0x956d,0xe4}, - {0x956e,0xf5}, - {0x956f,0x33}, - {0x9570,0xd2}, - {0x9571,0xaf}, - {0x9572,0x12}, - {0x9573,0x0c}, - {0x9574,0xa8}, - {0x9575,0x30}, - {0x9576,0x30}, - {0x9577,0x03}, - {0x9578,0x12}, - {0x9579,0x06}, - {0x957a,0xfb}, - {0x957b,0x30}, - {0x957c,0x34}, - {0x957d,0x03}, - {0x957e,0x12}, - {0x957f,0x14}, - {0x9580,0xbf}, - {0x9581,0x30}, - {0x9582,0x3d}, - {0x9583,0xee}, - {0x9584,0xc2}, - {0x9585,0x3d}, - {0x9586,0xd2}, - {0x9587,0x35}, - {0x9588,0x30}, - {0x9589,0x00}, - {0x958a,0x05}, - {0x958b,0x12}, - {0x958c,0x16}, - {0x958d,0x80}, - {0x958e,0x80}, - {0x958f,0x17}, - {0x9590,0x30}, - {0x9591,0x07}, - {0x9592,0x0b}, - {0x9593,0x30}, - {0x9594,0x06}, - {0x9595,0x08}, - {0x9596,0x20}, - {0x9597,0x31}, - {0x9598,0x0e}, - {0x9599,0x12}, - {0x959a,0x13}, - {0x959b,0x36}, - {0x959c,0x80}, - {0x959d,0x09}, - {0x959e,0x20}, - {0x959f,0x07}, - {0x95a0,0x06}, - {0x95a1,0x30}, - {0x95a2,0x06}, - {0x95a3,0x03}, - {0x95a4,0x12}, - {0x95a5,0x0b}, - {0x95a6,0x6c}, - {0x95a7,0xc2}, - {0x95a8,0x35}, - {0x95a9,0x80}, - {0x95aa,0xc7}, - {0x95ab,0xc0}, - {0x95ac,0xe0}, - {0x95ad,0xc0}, - {0x95ae,0x83}, - {0x95af,0xc0}, - {0x95b0,0x82}, - {0x95b1,0xc0}, - {0x95b2,0xd0}, - {0x95b3,0x90}, - {0x95b4,0x3f}, - {0x95b5,0x0d}, - {0x95b6,0xe0}, - {0x95b7,0xf5}, - {0x95b8,0x09}, - {0x95b9,0xe5}, - {0x95ba,0x09}, - {0x95bb,0x30}, - {0x95bc,0xe0}, - {0x95bd,0x2e}, - {0x95be,0xe5}, - {0x95bf,0x7a}, - {0x95c0,0xb4}, - {0x95c1,0x01}, - {0x95c2,0x09}, - {0x95c3,0x90}, - {0x95c4,0x3a}, - {0x95c5,0x00}, - {0x95c6,0xe0}, - {0x95c7,0xf5}, - {0x95c8,0x78}, - {0x95c9,0x44}, - {0x95ca,0x01}, - {0x95cb,0xf0}, - {0x95cc,0xe5}, - {0x95cd,0x7a}, - {0x95ce,0xb4}, - {0x95cf,0x03}, - {0x95d0,0x09}, - {0x95d1,0x90}, - {0x95d2,0x3a}, - {0x95d3,0x00}, - {0x95d4,0xe0}, - {0x95d5,0xf5}, - {0x95d6,0x78}, - {0x95d7,0x54}, - {0x95d8,0xfe}, - {0x95d9,0xf0}, - {0x95da,0xe5}, - {0x95db,0x7a}, - {0x95dc,0xb4}, - {0x95dd,0x03}, - {0x95de,0x05}, - {0x95df,0x75}, - {0x95e0,0x7a}, - {0x95e1,0x00}, - {0x95e2,0x80}, - {0x95e3,0x02}, - {0x95e4,0x05}, - {0x95e5,0x7a}, - {0x95e6,0x90}, - {0x95e7,0x3f}, - {0x95e8,0x0d}, - {0x95e9,0x74}, - {0x95ea,0x01}, - {0x95eb,0xf0}, - {0x95ec,0xd0}, - {0x95ed,0xd0}, - {0x95ee,0xd0}, - {0x95ef,0x82}, - {0x95f0,0xd0}, - {0x95f1,0x83}, - {0x95f2,0xd0}, - {0x95f3,0xe0}, - {0x95f4,0x32}, - {0x95f5,0x90}, - {0x95f6,0x50}, - {0x95f7,0x27}, - {0x95f8,0xe0}, - {0x95f9,0x44}, - {0x95fa,0x01}, - {0x95fb,0xf0}, - {0x95fc,0x90}, - {0x95fd,0x50}, - {0x95fe,0x34}, - {0x95ff,0x74}, - {0x9600,0x80}, - {0x9601,0xf0}, - {0x9602,0xa3}, - {0x9603,0x74}, - {0x9604,0x2a}, - {0x9605,0xf0}, - {0x9606,0xa3}, - {0x9607,0x74}, - {0x9608,0x14}, - {0x9609,0xf0}, - {0x960a,0x90}, - {0x960b,0x50}, - {0x960c,0x30}, - {0x960d,0xe4}, - {0x960e,0xf0}, - {0x960f,0xa3}, - {0x9610,0x74}, - {0x9611,0x02}, - {0x9612,0xf0}, - {0x9613,0xa3}, - {0x9614,0xe4}, - {0x9615,0xf0}, - {0x9616,0xa3}, - {0x9617,0x74}, - {0x9618,0x80}, - {0x9619,0xf0}, - {0x961a,0xe4}, - {0x961b,0xf5}, - {0x961c,0x0a}, - {0x961d,0x12}, - {0x961e,0x13}, - {0x961f,0x9c}, - {0x9620,0x75}, - {0x9621,0x79}, - {0x9622,0x02}, - {0x9623,0x75}, - {0x9624,0x0a}, - {0x9625,0x01}, - {0x9626,0x12}, - {0x9627,0x15}, - {0x9628,0x10}, - {0x9629,0xd2}, - {0x962a,0x18}, - {0x962b,0xd2}, - {0x962c,0x19}, - {0x962d,0xc2}, - {0x962e,0x3c}, - {0x962f,0xc2}, - {0x9630,0x3b}, - {0x9631,0xd2}, - {0x9632,0x1a}, - {0x9633,0xd2}, - {0x9634,0x38}, - {0x9635,0xd2}, - {0x9636,0x30}, - {0x9637,0xc2}, - {0x9638,0x35}, - {0x9639,0xc2}, - {0x963a,0x3d}, - {0x963b,0x22}, - {0x963c,0x85}, - {0x963d,0x14}, - {0x963e,0x15}, - {0x963f,0x7f}, - {0x9640,0x08}, - {0x9641,0xe5}, - {0x9642,0x15}, - {0x9643,0x30}, - {0x9644,0xe7}, - {0x9645,0x04}, - {0x9646,0xd2}, - {0x9647,0x29}, - {0x9648,0x80}, - {0x9649,0x02}, - {0x964a,0xc2}, - {0x964b,0x29}, - {0x964c,0x12}, - {0x964d,0x01}, - {0x964e,0x6c}, - {0x964f,0x75}, - {0x9650,0x51}, - {0x9651,0x0a}, - {0x9652,0xae}, - {0x9653,0x51}, - {0x9654,0x15}, - {0x9655,0x51}, - {0x9656,0xee}, - {0x9657,0x70}, - {0x9658,0xf9}, - {0x9659,0xe5}, - {0x965a,0x15}, - {0x965b,0x25}, - {0x965c,0xe0}, - {0x965d,0xf5}, - {0x965e,0x15}, - {0x965f,0xd2}, - {0x9660,0x28}, - {0x9661,0x12}, - {0x9662,0x01}, - {0x9663,0x6c}, - {0x9664,0x75}, - {0x9665,0x51}, - {0x9666,0x0a}, - {0x9667,0xae}, - {0x9668,0x51}, - {0x9669,0x15}, - {0x966a,0x51}, - {0x966b,0xee}, - {0x966c,0x70}, - {0x966d,0xf9}, - {0x966e,0xc2}, - {0x966f,0x28}, - {0x9670,0x12}, - {0x9671,0x01}, - {0x9672,0x6c}, - {0x9673,0x75}, - {0x9674,0x51}, - {0x9675,0x05}, - {0x9676,0xae}, - {0x9677,0x51}, - {0x9678,0x15}, - {0x9679,0x51}, - {0x967a,0xee}, - {0x967b,0x70}, - {0x967c,0xf9}, - {0x967d,0xdf}, - {0x967e,0xc2}, - {0x967f,0x22}, - {0x9680,0xe5}, - {0x9681,0x20}, - {0x9682,0x54}, - {0x9683,0x07}, - {0x9684,0xff}, - {0x9685,0xbf}, - {0x9686,0x01}, - {0x9687,0x03}, - {0x9688,0x02}, - {0x9689,0x11}, - {0x968a,0x69}, - {0x968b,0xe5}, - {0x968c,0x20}, - {0x968d,0x54}, - {0x968e,0x07}, - {0x968f,0xff}, - {0x9690,0xbf}, - {0x9691,0x07}, - {0x9692,0x03}, - {0x9693,0x02}, - {0x9694,0x12}, - {0x9695,0xd0}, - {0x9696,0xe5}, - {0x9697,0x20}, - {0x9698,0x54}, - {0x9699,0x07}, - {0x969a,0xff}, - {0x969b,0xbf}, - {0x969c,0x03}, - {0x969d,0x03}, - {0x969e,0x02}, - {0x969f,0x14}, - {0x96a0,0x64}, - {0x96a1,0xe5}, - {0x96a2,0x20}, - {0x96a3,0x54}, - {0x96a4,0x07}, - {0x96a5,0xff}, - {0x96a6,0xbf}, - {0x96a7,0x05}, - {0x96a8,0x03}, - {0x96a9,0x12}, - {0x96aa,0x17}, - {0x96ab,0x7a}, - {0x96ac,0x22}, - {0x96ad,0x12}, - {0x96ae,0x15}, - {0x96af,0xf5}, - {0x96b0,0x12}, - {0x96b1,0x17}, - {0x96b2,0x88}, - {0x96b3,0x50}, - {0x96b4,0x04}, - {0x96b5,0xd2}, - {0x96b6,0x05}, - {0x96b7,0x80}, - {0x96b8,0x02}, - {0x96b9,0xc2}, - {0x96ba,0x05}, - {0x96bb,0x12}, - {0x96bc,0x02}, - {0x96bd,0x64}, - {0x96be,0xc2}, - {0x96bf,0x39}, - {0x96c0,0xc2}, - {0x96c1,0x36}, - {0x96c2,0xc2}, - {0x96c3,0x31}, - {0x96c4,0xd2}, - {0x96c5,0x34}, - {0x96c6,0x12}, - {0x96c7,0x02}, - {0x96c8,0x92}, - {0x96c9,0xb5}, - {0x96ca,0x07}, - {0x96cb,0x03}, - {0x96cc,0xd3}, - {0x96cd,0x80}, - {0x96ce,0x01}, - {0x96cf,0xc3}, - {0x96d0,0x40}, - {0x96d1,0x02}, - {0x96d2,0xc2}, - {0x96d3,0x05}, - {0x96d4,0x22}, - {0x96d5,0xe4}, - {0x96d6,0xff}, - {0x96d7,0xfe}, - {0x96d8,0xc3}, - {0x96d9,0xef}, - {0x96da,0x95}, - {0x96db,0x12}, - {0x96dc,0xee}, - {0x96dd,0x95}, - {0x96de,0x11}, - {0x96df,0x50}, - {0x96e0,0x15}, - {0x96e1,0x7d}, - {0x96e2,0x8a}, - {0x96e3,0x7c}, - {0x96e4,0x02}, - {0x96e5,0xed}, - {0x96e6,0x1d}, - {0x96e7,0xaa}, - {0x96e8,0x04}, - {0x96e9,0x70}, - {0x96ea,0x01}, - {0x96eb,0x1c}, - {0x96ec,0x4a}, - {0x96ed,0x70}, - {0x96ee,0xf6}, - {0x96ef,0x0f}, - {0x96f0,0xbf}, - {0x96f1,0x00}, - {0x96f2,0x01}, - {0x96f3,0x0e}, - {0x96f4,0x80}, - {0x96f5,0xe2}, - {0x96f6,0x22}, - {0x96f7,0xc2}, - {0x96f8,0x03}, - {0x96f9,0xd2}, - {0x96fa,0x04}, - {0x96fb,0x12}, - {0x96fc,0x02}, - {0x96fd,0xa8}, - {0x96fe,0x30}, - {0x96ff,0x07}, - {0x9700,0x05}, - {0x9701,0x30}, - {0x9702,0x06}, - {0x9703,0x02}, - {0x9704,0xd2}, - {0x9705,0x36}, - {0x9706,0xc2}, - {0x9707,0x3e}, - {0x9708,0x12}, - {0x9709,0x10}, - {0x970a,0xdc}, - {0x970b,0xc2}, - {0x970c,0x3e}, - {0x970d,0x12}, - {0x970e,0x14}, - {0x970f,0x01}, - {0x9710,0xd2}, - {0x9711,0x34}, - {0x9712,0x22}, - {0x9713,0x75}, - {0x9714,0x48}, - {0x9715,0x12}, - {0x9716,0x75}, - {0x9717,0x49}, - {0x9718,0x6a}, - {0x9719,0x90}, - {0x971a,0x12}, - {0x971b,0x68}, - {0x971c,0xe4}, - {0x971d,0x93}, - {0x971e,0xf5}, - {0x971f,0x7c}, - {0x9720,0xa3}, - {0x9721,0xe4}, - {0x9722,0x93}, - {0x9723,0xf5}, - {0x9724,0x32}, - {0x9725,0xc2}, - {0x9726,0x3a}, - {0x9727,0x22}, - {0x9728,0xe4}, - {0x9729,0xff}, - {0x972a,0xef}, - {0x972b,0x25}, - {0x972c,0xe0}, - {0x972d,0x24}, - {0x972e,0x56}, - {0x972f,0xf8}, - {0x9730,0xe4}, - {0x9731,0xf6}, - {0x9732,0x08}, - {0x9733,0xf6}, - {0x9734,0x0f}, - {0x9735,0xbf}, - {0x9736,0x07}, - {0x9737,0xf2}, - {0x9738,0x53}, - {0x9739,0x24}, - {0x973a,0x80}, - {0x973b,0x22}, - {0x973c,0xe5}, - {0x973d,0x7d}, - {0x973e,0xc3}, - {0x973f,0x95}, - {0x9740,0x7c}, - {0x9741,0x40}, - {0x9742,0x01}, - {0x9743,0x22}, - {0x9744,0xe5}, - {0x9745,0x7d}, - {0x9746,0x04}, - {0x9747,0xf5}, - {0x9748,0x0c}, - {0x9749,0x12}, - {0x974a,0x0e}, - {0x974b,0xf9}, - {0x974c,0x22}, - {0x974d,0xe5}, - {0x974e,0x7d}, - {0x974f,0x70}, - {0x9750,0x02}, - {0x9751,0xc3}, - {0x9752,0x22}, - {0x9753,0xe5}, - {0x9754,0x7d}, - {0x9755,0x14}, - {0x9756,0xf5}, - {0x9757,0x0c}, - {0x9758,0x12}, - {0x9759,0x0e}, - {0x975a,0xf9}, - {0x975b,0x22}, - {0x975c,0xe5}, - {0x975d,0x7e}, - {0x975e,0xb4}, - {0x975f,0x01}, - {0x9760,0x09}, - {0x9761,0x12}, - {0x9762,0x17}, - {0x9763,0x13}, - {0x9764,0xe4}, - {0x9765,0xf5}, - {0x9766,0x0c}, - {0x9767,0x12}, - {0x9768,0x0e}, - {0x9769,0xf9}, - {0x976a,0x22}, - {0x976b,0xe5}, - {0x976c,0x7e}, - {0x976d,0x24}, - {0x976e,0xfe}, - {0x976f,0x60}, - {0x9770,0x06}, - {0x9771,0x04}, - {0x9772,0x70}, - {0x9773,0x05}, - {0x9774,0xd2}, - {0x9775,0x39}, - {0x9776,0x22}, - {0x9777,0xc2}, - {0x9778,0x39}, - {0x9779,0x22}, - {0x977a,0xe5}, - {0x977b,0x31}, - {0x977c,0xd3}, - {0x977d,0x94}, - {0x977e,0x00}, - {0x977f,0x40}, - {0x9780,0x03}, - {0x9781,0x15}, - {0x9782,0x31}, - {0x9783,0x22}, - {0x9784,0x12}, - {0x9785,0x16}, - {0x9786,0xf7}, - {0x9787,0x22}, - {0x9788,0x12}, - {0x9789,0x17}, - {0x978a,0x13}, - {0x978b,0xe4}, - {0x978c,0xf5}, - {0x978d,0x0c}, - {0x978e,0x12}, - {0x978f,0x0e}, - {0x9790,0xf9}, - {0x9791,0x22}, - {0x3024,0x00}, - {0x3025,0x00}, - {0x5082,0x00}, - {0x5083,0x00}, - {0x5084,0x00}, - {0x5085,0x00}, - {0x3026,0x00}, - {0x3027,0xFF}, - {0x3000,0x00}, - {0x0000,0x00} -}; -#elif (VCM_DRIVER == VCM_DRIVER_AD5820) -/* support const-focus */ -static struct reginfo sensor_af_firmware[] = -{ - {0x3000,0x20}, - {0x8000,0x02}, - {0x8001,0x00}, - {0x8002,0x06}, - {0x8003,0x02}, - {0x8004,0x0c}, - {0x8005,0xa4}, - {0x8006,0x78}, - {0x8007,0x7f}, - {0x8008,0xe4}, - {0x8009,0xf6}, - {0x800a,0xd8}, - {0x800b,0xfd}, - {0x800c,0x75}, - {0x800d,0x81}, - {0x800e,0x7e}, - {0x800f,0x02}, - {0x8010,0x14}, - {0x8011,0xc7}, - {0x8012,0x00}, - {0x8013,0x02}, - {0x8014,0x15}, - {0x8015,0x13}, - {0x8016,0xe0}, - {0x8017,0xf5}, - {0x8018,0x72}, - {0x8019,0xa3}, - {0x801a,0xe0}, - {0x801b,0xf5}, - {0x801c,0x73}, - {0x801d,0xae}, - {0x801e,0x6a}, - {0x801f,0xe4}, - {0x8020,0x85}, - {0x8021,0x6b}, - {0x8022,0x55}, - {0x8023,0x8e}, - {0x8024,0x54}, - {0x8025,0xf5}, - {0x8026,0x53}, - {0x8027,0xf5}, - {0x8028,0x52}, - {0x8029,0xab}, - {0x802a,0x55}, - {0x802b,0xaa}, - {0x802c,0x54}, - {0x802d,0xa9}, - {0x802e,0x53}, - {0x802f,0xa8}, - {0x8030,0x52}, - {0x8031,0xaf}, - {0x8032,0x2c}, - {0x8033,0xfc}, - {0x8034,0xfd}, - {0x8035,0xfe}, - {0x8036,0x12}, - {0x8037,0x08}, - {0x8038,0x98}, - {0x8039,0x8f}, - {0x803a,0x55}, - {0x803b,0x8e}, - {0x803c,0x54}, - {0x803d,0x8d}, - {0x803e,0x53}, - {0x803f,0x8c}, - {0x8040,0x52}, - {0x8041,0xaf}, - {0x8042,0x55}, - {0x8043,0xae}, - {0x8044,0x54}, - {0x8045,0xad}, - {0x8046,0x53}, - {0x8047,0xac}, - {0x8048,0x52}, - {0x8049,0x8f}, - {0x804a,0x2b}, - {0x804b,0x8e}, - {0x804c,0x2a}, - {0x804d,0x8d}, - {0x804e,0x29}, - {0x804f,0x8c}, - {0x8050,0x28}, - {0x8051,0xae}, - {0x8052,0x6c}, - {0x8053,0xe4}, - {0x8054,0x85}, - {0x8055,0x6d}, - {0x8056,0x55}, - {0x8057,0x8e}, - {0x8058,0x54}, - {0x8059,0xf5}, - {0x805a,0x53}, - {0x805b,0xf5}, - {0x805c,0x52}, - {0x805d,0xab}, - {0x805e,0x55}, - {0x805f,0xaa}, - {0x8060,0x54}, - {0x8061,0xa9}, - {0x8062,0x53}, - {0x8063,0xa8}, - {0x8064,0x52}, - {0x8065,0xaf}, - {0x8066,0x2d}, - {0x8067,0xfc}, - {0x8068,0xfd}, - {0x8069,0xfe}, - {0x806a,0x12}, - {0x806b,0x08}, - {0x806c,0x98}, - {0x806d,0x8f}, - {0x806e,0x55}, - {0x806f,0x8e}, - {0x8070,0x54}, - {0x8071,0x8d}, - {0x8072,0x53}, - {0x8073,0x8c}, - {0x8074,0x52}, - {0x8075,0xe5}, - {0x8076,0x2b}, - {0x8077,0x25}, - {0x8078,0x55}, - {0x8079,0xf5}, - {0x807a,0x2b}, - {0x807b,0xe5}, - {0x807c,0x2a}, - {0x807d,0x35}, - {0x807e,0x54}, - {0x807f,0xf5}, - {0x8080,0x2a}, - {0x8081,0xe5}, - {0x8082,0x29}, - {0x8083,0x35}, - {0x8084,0x53}, - {0x8085,0xf5}, - {0x8086,0x29}, - {0x8087,0xe5}, - {0x8088,0x28}, - {0x8089,0x35}, - {0x808a,0x52}, - {0x808b,0xf5}, - {0x808c,0x28}, - {0x808d,0xae}, - {0x808e,0x6e}, - {0x808f,0xe4}, - {0x8090,0x85}, - {0x8091,0x6f}, - {0x8092,0x55}, - {0x8093,0x8e}, - {0x8094,0x54}, - {0x8095,0xf5}, - {0x8096,0x53}, - {0x8097,0xf5}, - {0x8098,0x52}, - {0x8099,0xab}, - {0x809a,0x55}, - {0x809b,0xaa}, - {0x809c,0x54}, - {0x809d,0xa9}, - {0x809e,0x53}, - {0x809f,0xa8}, - {0x80a0,0x52}, - {0x80a1,0xaf}, - {0x80a2,0x2e}, - {0x80a3,0xfc}, - {0x80a4,0xfd}, - {0x80a5,0xfe}, - {0x80a6,0x12}, - {0x80a7,0x08}, - {0x80a8,0x98}, - {0x80a9,0x8f}, - {0x80aa,0x55}, - {0x80ab,0x8e}, - {0x80ac,0x54}, - {0x80ad,0x8d}, - {0x80ae,0x53}, - {0x80af,0x8c}, - {0x80b0,0x52}, - {0x80b1,0xe5}, - {0x80b2,0x2b}, - {0x80b3,0x25}, - {0x80b4,0x55}, - {0x80b5,0xf5}, - {0x80b6,0x2b}, - {0x80b7,0xe5}, - {0x80b8,0x2a}, - {0x80b9,0x35}, - {0x80ba,0x54}, - {0x80bb,0xf5}, - {0x80bc,0x2a}, - {0x80bd,0xe5}, - {0x80be,0x29}, - {0x80bf,0x35}, - {0x80c0,0x53}, - {0x80c1,0xf5}, - {0x80c2,0x29}, - {0x80c3,0xe5}, - {0x80c4,0x28}, - {0x80c5,0x35}, - {0x80c6,0x52}, - {0x80c7,0xf5}, - {0x80c8,0x28}, - {0x80c9,0xae}, - {0x80ca,0x70}, - {0x80cb,0xe4}, - {0x80cc,0x85}, - {0x80cd,0x71}, - {0x80ce,0x55}, - {0x80cf,0x8e}, - {0x80d0,0x54}, - {0x80d1,0xf5}, - {0x80d2,0x53}, - {0x80d3,0xf5}, - {0x80d4,0x52}, - {0x80d5,0xab}, - {0x80d6,0x55}, - {0x80d7,0xaa}, - {0x80d8,0x54}, - {0x80d9,0xa9}, - {0x80da,0x53}, - {0x80db,0xa8}, - {0x80dc,0x52}, - {0x80dd,0xaf}, - {0x80de,0x2f}, - {0x80df,0xfc}, - {0x80e0,0xfd}, - {0x80e1,0xfe}, - {0x80e2,0x12}, - {0x80e3,0x08}, - {0x80e4,0x98}, - {0x80e5,0x8f}, - {0x80e6,0x55}, - {0x80e7,0x8e}, - {0x80e8,0x54}, - {0x80e9,0x8d}, - {0x80ea,0x53}, - {0x80eb,0x8c}, - {0x80ec,0x52}, - {0x80ed,0xe5}, - {0x80ee,0x2b}, - {0x80ef,0x25}, - {0x80f0,0x55}, - {0x80f1,0xf5}, - {0x80f2,0x2b}, - {0x80f3,0xe5}, - {0x80f4,0x2a}, - {0x80f5,0x35}, - {0x80f6,0x54}, - {0x80f7,0xf5}, - {0x80f8,0x2a}, - {0x80f9,0xe5}, - {0x80fa,0x29}, - {0x80fb,0x35}, - {0x80fc,0x53}, - {0x80fd,0xf5}, - {0x80fe,0x29}, - {0x80ff,0xe5}, - {0x8100,0x28}, - {0x8101,0x35}, - {0x8102,0x52}, - {0x8103,0xf5}, - {0x8104,0x28}, - {0x8105,0xae}, - {0x8106,0x72}, - {0x8107,0xe4}, - {0x8108,0x85}, - {0x8109,0x73}, - {0x810a,0x55}, - {0x810b,0x8e}, - {0x810c,0x54}, - {0x810d,0xf5}, - {0x810e,0x53}, - {0x810f,0xf5}, - {0x8110,0x52}, - {0x8111,0xab}, - {0x8112,0x55}, - {0x8113,0xaa}, - {0x8114,0x54}, - {0x8115,0xa9}, - {0x8116,0x53}, - {0x8117,0xa8}, - {0x8118,0x52}, - {0x8119,0xaf}, - {0x811a,0x30}, - {0x811b,0xfc}, - {0x811c,0xfd}, - {0x811d,0xfe}, - {0x811e,0x12}, - {0x811f,0x08}, - {0x8120,0x98}, - {0x8121,0x8f}, - {0x8122,0x55}, - {0x8123,0x8e}, - {0x8124,0x54}, - {0x8125,0x8d}, - {0x8126,0x53}, - {0x8127,0x8c}, - {0x8128,0x52}, - {0x8129,0xe5}, - {0x812a,0x2b}, - {0x812b,0x25}, - {0x812c,0x55}, - {0x812d,0xf5}, - {0x812e,0x2b}, - {0x812f,0xe5}, - {0x8130,0x2a}, - {0x8131,0x35}, - {0x8132,0x54}, - {0x8133,0xf5}, - {0x8134,0x2a}, - {0x8135,0xe5}, - {0x8136,0x29}, - {0x8137,0x35}, - {0x8138,0x53}, - {0x8139,0xf5}, - {0x813a,0x29}, - {0x813b,0xe5}, - {0x813c,0x28}, - {0x813d,0x35}, - {0x813e,0x52}, - {0x813f,0xf5}, - {0x8140,0x28}, - {0x8141,0x22}, - {0x8142,0xab}, - {0x8143,0x0d}, - {0x8144,0xaa}, - {0x8145,0x0c}, - {0x8146,0xa9}, - {0x8147,0x0b}, - {0x8148,0xa8}, - {0x8149,0x0a}, - {0x814a,0xfc}, - {0x814b,0xfd}, - {0x814c,0xfe}, - {0x814d,0x12}, - {0x814e,0x08}, - {0x814f,0x98}, - {0x8150,0x8f}, - {0x8151,0x0d}, - {0x8152,0x8e}, - {0x8153,0x0c}, - {0x8154,0x8d}, - {0x8155,0x0b}, - {0x8156,0x8c}, - {0x8157,0x0a}, - {0x8158,0x7b}, - {0x8159,0x40}, - {0x815a,0xe4}, - {0x815b,0xfa}, - {0x815c,0xf9}, - {0x815d,0xf8}, - {0x815e,0x12}, - {0x815f,0x09}, - {0x8160,0x23}, - {0x8161,0x8f}, - {0x8162,0x0d}, - {0x8163,0x8e}, - {0x8164,0x0c}, - {0x8165,0x8d}, - {0x8166,0x0b}, - {0x8167,0x8c}, - {0x8168,0x0a}, - {0x8169,0x22}, - {0x816a,0xd2}, - {0x816b,0x29}, - {0x816c,0x90}, - {0x816d,0x30}, - {0x816e,0x1b}, - {0x816f,0xe5}, - {0x8170,0x25}, - {0x8171,0xf0}, - {0x8172,0x22}, - {0x8173,0x85}, - {0x8174,0x49}, - {0x8175,0x82}, - {0x8176,0x85}, - {0x8177,0x48}, - {0x8178,0x83}, - {0x8179,0xe5}, - {0x817a,0x7c}, - {0x817b,0x75}, - {0x817c,0xf0}, - {0x817d,0x02}, - {0x817e,0x12}, - {0x817f,0x09}, - {0x8180,0xeb}, - {0x8181,0xe4}, - {0x8182,0x93}, - {0x8183,0xfe}, - {0x8184,0x74}, - {0x8185,0x01}, - {0x8186,0x93}, - {0x8187,0xff}, - {0x8188,0x85}, - {0x8189,0x49}, - {0x818a,0x82}, - {0x818b,0x85}, - {0x818c,0x48}, - {0x818d,0x83}, - {0x818e,0xe4}, - {0x818f,0x93}, - {0x8190,0xfc}, - {0x8191,0x74}, - {0x8192,0x01}, - {0x8193,0x93}, - {0x8194,0xfd}, - {0x8195,0xc3}, - {0x8196,0xef}, - {0x8197,0x9d}, - {0x8198,0xff}, - {0x8199,0xee}, - {0x819a,0x9c}, - {0x819b,0x22}, - {0x819c,0xfe}, - {0x819d,0xe4}, - {0x819e,0xfc}, - {0x819f,0xfd}, - {0x81a0,0xe5}, - {0x81a1,0x3f}, - {0x81a2,0x2f}, - {0x81a3,0xf5}, - {0x81a4,0x3f}, - {0x81a5,0xe5}, - {0x81a6,0x3e}, - {0x81a7,0x3e}, - {0x81a8,0xf5}, - {0x81a9,0x3e}, - {0x81aa,0xed}, - {0x81ab,0x35}, - {0x81ac,0x3d}, - {0x81ad,0xf5}, - {0x81ae,0x3d}, - {0x81af,0xec}, - {0x81b0,0x35}, - {0x81b1,0x3c}, - {0x81b2,0xf5}, - {0x81b3,0x3c}, - {0x81b4,0xaf}, - {0x81b5,0x3f}, - {0x81b6,0xae}, - {0x81b7,0x3e}, - {0x81b8,0xfc}, - {0x81b9,0xad}, - {0x81ba,0x3d}, - {0x81bb,0x78}, - {0x81bc,0x08}, - {0x81bd,0x12}, - {0x81be,0x09}, - {0x81bf,0xc8}, - {0x81c0,0x8f}, - {0x81c1,0x3f}, - {0x81c2,0x8e}, - {0x81c3,0x3e}, - {0x81c4,0x8d}, - {0x81c5,0x3d}, - {0x81c6,0x8c}, - {0x81c7,0x3c}, - {0x81c8,0x22}, - {0x81c9,0xaf}, - {0x81ca,0x2b}, - {0x81cb,0xae}, - {0x81cc,0x2a}, - {0x81cd,0xad}, - {0x81ce,0x29}, - {0x81cf,0xac}, - {0x81d0,0x28}, - {0x81d1,0x78}, - {0x81d2,0x06}, - {0x81d3,0x12}, - {0x81d4,0x09}, - {0x81d5,0xb5}, - {0x81d6,0x8f}, - {0x81d7,0x2b}, - {0x81d8,0x8e}, - {0x81d9,0x2a}, - {0x81da,0x8d}, - {0x81db,0x29}, - {0x81dc,0x8c}, - {0x81dd,0x28}, - {0x81de,0xd3}, - {0x81df,0xe5}, - {0x81e0,0x29}, - {0x81e1,0x94}, - {0x81e2,0x00}, - {0x81e3,0xe5}, - {0x81e4,0x28}, - {0x81e5,0x94}, - {0x81e6,0x00}, - {0x81e7,0x22}, - {0x81e8,0xe5}, - {0x81e9,0x0b}, - {0x81ea,0x24}, - {0x81eb,0x01}, - {0x81ec,0xff}, - {0x81ed,0xe4}, - {0x81ee,0x33}, - {0x81ef,0xfe}, - {0x81f0,0x22}, - {0x81f1,0x12}, - {0x81f2,0x08}, - {0x81f3,0x98}, - {0x81f4,0x8f}, - {0x81f5,0x69}, - {0x81f6,0x8e}, - {0x81f7,0x68}, - {0x81f8,0x8d}, - {0x81f9,0x67}, - {0x81fa,0x8c}, - {0x81fb,0x66}, - {0x81fc,0xaf}, - {0x81fd,0x69}, - {0x81fe,0xae}, - {0x81ff,0x68}, - {0x8200,0xad}, - {0x8201,0x67}, - {0x8202,0xac}, - {0x8203,0x66}, - {0x8204,0x22}, - {0x8205,0xe0}, - {0x8206,0x44}, - {0x8207,0x01}, - {0x8208,0xf0}, - {0x8209,0xe0}, - {0x820a,0x44}, - {0x820b,0x02}, - {0x820c,0xf0}, - {0x820d,0xe0}, - {0x820e,0x44}, - {0x820f,0x04}, - {0x8210,0xf0}, - {0x8211,0x22}, - {0x8212,0xd2}, - {0x8213,0x09}, - {0x8214,0x90}, - {0x8215,0x30}, - {0x8216,0x18}, - {0x8217,0xe5}, - {0x8218,0x21}, - {0x8219,0xf0}, - {0x821a,0x22}, - {0x821b,0xe4}, - {0x821c,0x85}, - {0x821d,0x11}, - {0x821e,0x0d}, - {0x821f,0x85}, - {0x8220,0x10}, - {0x8221,0x0c}, - {0x8222,0xf5}, - {0x8223,0x0b}, - {0x8224,0xf5}, - {0x8225,0x0a}, - {0x8226,0xab}, - {0x8227,0x0d}, - {0x8228,0xaa}, - {0x8229,0x0c}, - {0x822a,0xa9}, - {0x822b,0x0b}, - {0x822c,0xa8}, - {0x822d,0x0a}, - {0x822e,0x22}, - {0x822f,0x90}, - {0x8230,0x30}, - {0x8231,0x42}, - {0x8232,0xe0}, - {0x8233,0xf5}, - {0x8234,0x22}, - {0x8235,0x75}, - {0x8236,0x51}, - {0x8237,0x0a}, - {0x8238,0x22}, - {0x8239,0x85}, - {0x823a,0x49}, - {0x823b,0x82}, - {0x823c,0x85}, - {0x823d,0x48}, - {0x823e,0x83}, - {0x823f,0x22}, - {0x8240,0xf5}, - {0x8241,0x82}, - {0x8242,0xe4}, - {0x8243,0x3a}, - {0x8244,0xf5}, - {0x8245,0x83}, - {0x8246,0x02}, - {0x8247,0x09}, - {0x8248,0xdb}, - {0x8249,0x8f}, - {0x824a,0x0a}, - {0x824b,0x74}, - {0x824c,0x4a}, - {0x824d,0x2f}, - {0x824e,0xf8}, - {0x824f,0xe6}, - {0x8250,0x22}, - {0x8251,0xc2}, - {0x8252,0x07}, - {0x8253,0xc2}, - {0x8254,0x06}, - {0x8255,0xc2}, - {0x8256,0x02}, - {0x8257,0xc2}, - {0x8258,0x01}, - {0x8259,0xc2}, - {0x825a,0x00}, - {0x825b,0xc2}, - {0x825c,0x03}, - {0x825d,0xd2}, - {0x825e,0x04}, - {0x825f,0x22}, - {0x8260,0xe5}, - {0x8261,0x16}, - {0x8262,0x25}, - {0x8263,0xe0}, - {0x8264,0x25}, - {0x8265,0xe0}, - {0x8266,0x22}, - {0x8267,0x12}, - {0x8268,0x09}, - {0x8269,0x23}, - {0x826a,0x8f}, - {0x826b,0x69}, - {0x826c,0x8e}, - {0x826d,0x68}, - {0x826e,0x8d}, - {0x826f,0x67}, - {0x8270,0x8c}, - {0x8271,0x66}, - {0x8272,0x22}, - {0x8273,0xe4}, - {0x8274,0x85}, - {0x8275,0x0f}, - {0x8276,0x0d}, - {0x8277,0x85}, - {0x8278,0x0e}, - {0x8279,0x0c}, - {0x827a,0xf5}, - {0x827b,0x0b}, - {0x827c,0xf5}, - {0x827d,0x0a}, - {0x827e,0x22}, - {0x827f,0x90}, - {0x8280,0x11}, - {0x8281,0x67}, - {0x8282,0xe4}, - {0x8283,0x93}, - {0x8284,0xff}, - {0x8285,0x90}, - {0x8286,0x30}, - {0x8287,0x0a}, - {0x8288,0xe0}, - {0x8289,0x22}, - {0x828a,0xc2}, - {0x828b,0x02}, - {0x828c,0xc2}, - {0x828d,0x01}, - {0x828e,0xd2}, - {0x828f,0x00}, - {0x8290,0xc2}, - {0x8291,0x03}, - {0x8292,0xc2}, - {0x8293,0x04}, - {0x8294,0x22}, - {0x8295,0x75}, - {0x8296,0xf0}, - {0x8297,0x02}, - {0x8298,0x02}, - {0x8299,0x09}, - {0x829a,0xeb}, - {0x829b,0xd2}, - {0x829c,0x02}, - {0x829d,0xd2}, - {0x829e,0x01}, - {0x829f,0xc2}, - {0x82a0,0x00}, - {0x82a1,0x22}, - {0x82a2,0x74}, - {0x82a3,0x4a}, - {0x82a4,0x25}, - {0x82a5,0x0a}, - {0x82a6,0xf8}, - {0x82a7,0xe6}, - {0x82a8,0x22}, - {0x82a9,0xd3}, - {0x82aa,0xe5}, - {0x82ab,0x0b}, - {0x82ac,0x94}, - {0x82ad,0xff}, - {0x82ae,0xe5}, - {0x82af,0x0a}, - {0x82b0,0x94}, - {0x82b1,0x00}, - {0x82b2,0x22}, - {0x82b3,0xd3}, - {0x82b4,0xe5}, - {0x82b5,0x69}, - {0x82b6,0x94}, - {0x82b7,0xff}, - {0x82b8,0xe5}, - {0x82b9,0x68}, - {0x82ba,0x94}, - {0x82bb,0x03}, - {0x82bc,0x22}, - {0x82bd,0x30}, - {0x82be,0x18}, - {0x82bf,0x4d}, - {0x82c0,0x20}, - {0x82c1,0x19}, - {0x82c2,0x4a}, - {0x82c3,0x75}, - {0x82c4,0x0a}, - {0x82c5,0x02}, - {0x82c6,0x12}, - {0x82c7,0x02}, - {0x82c8,0xa2}, - {0x82c9,0xff}, - {0x82ca,0xe5}, - {0x82cb,0x4a}, - {0x82cc,0xd3}, - {0x82cd,0x9f}, - {0x82ce,0x40}, - {0x82cf,0x04}, - {0x82d0,0x7f}, - {0x82d1,0x00}, - {0x82d2,0x80}, - {0x82d3,0x02}, - {0x82d4,0xaf}, - {0x82d5,0x0a}, - {0x82d6,0x12}, - {0x82d7,0x02}, - {0x82d8,0x49}, - {0x82d9,0xff}, - {0x82da,0xe5}, - {0x82db,0x4b}, - {0x82dc,0xd3}, - {0x82dd,0x9f}, - {0x82de,0x40}, - {0x82df,0x04}, - {0x82e0,0x7f}, - {0x82e1,0x01}, - {0x82e2,0x80}, - {0x82e3,0x02}, - {0x82e4,0xaf}, - {0x82e5,0x0a}, - {0x82e6,0x12}, - {0x82e7,0x02}, - {0x82e8,0x49}, - {0x82e9,0xff}, - {0x82ea,0xe5}, - {0x82eb,0x4d}, - {0x82ec,0xd3}, - {0x82ed,0x9f}, - {0x82ee,0x40}, - {0x82ef,0x04}, - {0x82f0,0x7f}, - {0x82f1,0x03}, - {0x82f2,0x80}, - {0x82f3,0x02}, - {0x82f4,0xaf}, - {0x82f5,0x0a}, - {0x82f6,0x12}, - {0x82f7,0x02}, - {0x82f8,0x49}, - {0x82f9,0xff}, - {0x82fa,0xe5}, - {0x82fb,0x4e}, - {0x82fc,0xd3}, - {0x82fd,0x9f}, - {0x82fe,0x40}, - {0x82ff,0x04}, - {0x8300,0x7f}, - {0x8301,0x04}, - {0x8302,0x80}, - {0x8303,0x02}, - {0x8304,0xaf}, - {0x8305,0x0a}, - {0x8306,0x12}, - {0x8307,0x02}, - {0x8308,0x49}, - {0x8309,0xf5}, - {0x830a,0x0b}, - {0x830b,0x80}, - {0x830c,0x06}, - {0x830d,0x85}, - {0x830e,0x79}, - {0x830f,0x0a}, - {0x8310,0x85}, - {0x8311,0x4f}, - {0x8312,0x0b}, - {0x8313,0x7f}, - {0x8314,0x01}, - {0x8315,0xe4}, - {0x8316,0xfe}, - {0x8317,0x12}, - {0x8318,0x02}, - {0x8319,0xa2}, - {0x831a,0xfd}, - {0x831b,0xe5}, - {0x831c,0x0b}, - {0x831d,0xc3}, - {0x831e,0x9d}, - {0x831f,0x50}, - {0x8320,0x04}, - {0x8321,0x7d}, - {0x8322,0x01}, - {0x8323,0x80}, - {0x8324,0x02}, - {0x8325,0x7d}, - {0x8326,0xff}, - {0x8327,0xac}, - {0x8328,0x0b}, - {0x8329,0xe5}, - {0x832a,0x4e}, - {0x832b,0xb5}, - {0x832c,0x0b}, - {0x832d,0x03}, - {0x832e,0xd3}, - {0x832f,0x80}, - {0x8330,0x01}, - {0x8331,0xc3}, - {0x8332,0x92}, - {0x8333,0x1f}, - {0x8334,0xe5}, - {0x8335,0x4d}, - {0x8336,0xb5}, - {0x8337,0x0b}, - {0x8338,0x03}, - {0x8339,0xd3}, - {0x833a,0x80}, - {0x833b,0x01}, - {0x833c,0xc3}, - {0x833d,0x92}, - {0x833e,0x1e}, - {0x833f,0xe5}, - {0x8340,0x4c}, - {0x8341,0xb5}, - {0x8342,0x0b}, - {0x8343,0x03}, - {0x8344,0xd3}, - {0x8345,0x80}, - {0x8346,0x01}, - {0x8347,0xc3}, - {0x8348,0x92}, - {0x8349,0x1d}, - {0x834a,0xe5}, - {0x834b,0x4b}, - {0x834c,0xb5}, - {0x834d,0x0b}, - {0x834e,0x03}, - {0x834f,0xd3}, - {0x8350,0x80}, - {0x8351,0x01}, - {0x8352,0xc3}, - {0x8353,0x92}, - {0x8354,0x1c}, - {0x8355,0xe5}, - {0x8356,0x4a}, - {0x8357,0xb5}, - {0x8358,0x0b}, - {0x8359,0x03}, - {0x835a,0xd3}, - {0x835b,0x80}, - {0x835c,0x01}, - {0x835d,0xc3}, - {0x835e,0x92}, - {0x835f,0x1b}, - {0x8360,0xe5}, - {0x8361,0x30}, - {0x8362,0xd3}, - {0x8363,0x94}, - {0x8364,0x00}, - {0x8365,0x40}, - {0x8366,0x04}, - {0x8367,0xa2}, - {0x8368,0x1f}, - {0x8369,0x80}, - {0x836a,0x01}, - {0x836b,0xc3}, - {0x836c,0x92}, - {0x836d,0x1f}, - {0x836e,0xe5}, - {0x836f,0x2f}, - {0x8370,0xd3}, - {0x8371,0x94}, - {0x8372,0x00}, - {0x8373,0x40}, - {0x8374,0x04}, - {0x8375,0xa2}, - {0x8376,0x1e}, - {0x8377,0x80}, - {0x8378,0x01}, - {0x8379,0xc3}, - {0x837a,0x92}, - {0x837b,0x1e}, - {0x837c,0xe5}, - {0x837d,0x2e}, - {0x837e,0xd3}, - {0x837f,0x94}, - {0x8380,0x00}, - {0x8381,0x40}, - {0x8382,0x04}, - {0x8383,0xa2}, - {0x8384,0x1d}, - {0x8385,0x80}, - {0x8386,0x01}, - {0x8387,0xc3}, - {0x8388,0x92}, - {0x8389,0x1d}, - {0x838a,0xe5}, - {0x838b,0x2d}, - {0x838c,0xd3}, - {0x838d,0x94}, - {0x838e,0x00}, - {0x838f,0x40}, - {0x8390,0x04}, - {0x8391,0xa2}, - {0x8392,0x1c}, - {0x8393,0x80}, - {0x8394,0x01}, - {0x8395,0xc3}, - {0x8396,0x92}, - {0x8397,0x1c}, - {0x8398,0xe5}, - {0x8399,0x2c}, - {0x839a,0xd3}, - {0x839b,0x94}, - {0x839c,0x00}, - {0x839d,0x40}, - {0x839e,0x04}, - {0x839f,0xa2}, - {0x83a0,0x1b}, - {0x83a1,0x80}, - {0x83a2,0x01}, - {0x83a3,0xc3}, - {0x83a4,0x92}, - {0x83a5,0x1b}, - {0x83a6,0xe5}, - {0x83a7,0x23}, - {0x83a8,0x54}, - {0x83a9,0xf8}, - {0x83aa,0x70}, - {0x83ab,0x5b}, - {0x83ac,0xbf}, - {0x83ad,0x01}, - {0x83ae,0x08}, - {0x83af,0xed}, - {0x83b0,0xf4}, - {0x83b1,0x04}, - {0x83b2,0xfd}, - {0x83b3,0x7f}, - {0x83b4,0x02}, - {0x83b5,0x80}, - {0x83b6,0x06}, - {0x83b7,0xbf}, - {0x83b8,0x02}, - {0x83b9,0x02}, - {0x83ba,0x7f}, - {0x83bb,0x01}, - {0x83bc,0x0e}, - {0x83bd,0xd3}, - {0x83be,0xed}, - {0x83bf,0x64}, - {0x83c0,0x80}, - {0x83c1,0x94}, - {0x83c2,0x80}, - {0x83c3,0x40}, - {0x83c4,0x18}, - {0x83c5,0xec}, - {0x83c6,0x2e}, - {0x83c7,0xf5}, - {0x83c8,0x0b}, - {0x83c9,0xd3}, - {0x83ca,0x95}, - {0x83cb,0x7c}, - {0x83cc,0x40}, - {0x83cd,0x2c}, - {0x83ce,0x7d}, - {0x83cf,0xff}, - {0x83d0,0xef}, - {0x83d1,0x60}, - {0x83d2,0x04}, - {0x83d3,0x7b}, - {0x83d4,0x00}, - {0x83d5,0x80}, - {0x83d6,0x02}, - {0x83d7,0x7b}, - {0x83d8,0x03}, - {0x83d9,0xaf}, - {0x83da,0x03}, - {0x83db,0x80}, - {0x83dc,0x18}, - {0x83dd,0xec}, - {0x83de,0xc3}, - {0x83df,0x9e}, - {0x83e0,0x50}, - {0x83e1,0x13}, - {0x83e2,0x7d}, - {0x83e3,0x01}, - {0x83e4,0xef}, - {0x83e5,0x60}, - {0x83e6,0x04}, - {0x83e7,0x7b}, - {0x83e8,0x00}, - {0x83e9,0x80}, - {0x83ea,0x02}, - {0x83eb,0x7b}, - {0x83ec,0x03}, - {0x83ed,0xaf}, - {0x83ee,0x03}, - {0x83ef,0xec}, - {0x83f0,0x2e}, - {0x83f1,0xf5}, - {0x83f2,0x0b}, - {0x83f3,0x80}, - {0x83f4,0x05}, - {0x83f5,0xc3}, - {0x83f6,0xec}, - {0x83f7,0x9e}, - {0x83f8,0xf5}, - {0x83f9,0x0b}, - {0x83fa,0xef}, - {0x83fb,0x64}, - {0x83fc,0x03}, - {0x83fd,0x60}, - {0x83fe,0x03}, - {0x83ff,0x02}, - {0x8400,0x03}, - {0x8401,0x29}, - {0x8402,0x12}, - {0x8403,0x02}, - {0x8404,0xa2}, - {0x8405,0xf5}, - {0x8406,0x0b}, - {0x8407,0x12}, - {0x8408,0x01}, - {0x8409,0xe8}, - {0x840a,0xe5}, - {0x840b,0x4e}, - {0x840c,0xb5}, - {0x840d,0x07}, - {0x840e,0x07}, - {0x840f,0xe4}, - {0x8410,0xb5}, - {0x8411,0x06}, - {0x8412,0x03}, - {0x8413,0xd3}, - {0x8414,0x80}, - {0x8415,0x02}, - {0x8416,0xa2}, - {0x8417,0x1f}, - {0x8418,0x92}, - {0x8419,0x1f}, - {0x841a,0xe5}, - {0x841b,0x4d}, - {0x841c,0xb5}, - {0x841d,0x07}, - {0x841e,0x07}, - {0x841f,0xe4}, - {0x8420,0xb5}, - {0x8421,0x06}, - {0x8422,0x03}, - {0x8423,0xd3}, - {0x8424,0x80}, - {0x8425,0x02}, - {0x8426,0xa2}, - {0x8427,0x1e}, - {0x8428,0x92}, - {0x8429,0x1e}, - {0x842a,0x12}, - {0x842b,0x01}, - {0x842c,0xe8}, - {0x842d,0xe5}, - {0x842e,0x4c}, - {0x842f,0xb5}, - {0x8430,0x07}, - {0x8431,0x07}, - {0x8432,0xe4}, - {0x8433,0xb5}, - {0x8434,0x06}, - {0x8435,0x03}, - {0x8436,0xd3}, - {0x8437,0x80}, - {0x8438,0x02}, - {0x8439,0xa2}, - {0x843a,0x1d}, - {0x843b,0x92}, - {0x843c,0x1d}, - {0x843d,0xe5}, - {0x843e,0x4b}, - {0x843f,0xb5}, - {0x8440,0x07}, - {0x8441,0x07}, - {0x8442,0xe4}, - {0x8443,0xb5}, - {0x8444,0x06}, - {0x8445,0x03}, - {0x8446,0xd3}, - {0x8447,0x80}, - {0x8448,0x02}, - {0x8449,0xa2}, - {0x844a,0x1c}, - {0x844b,0x92}, - {0x844c,0x1c}, - {0x844d,0x12}, - {0x844e,0x01}, - {0x844f,0xe8}, - {0x8450,0xe5}, - {0x8451,0x4a}, - {0x8452,0xb5}, - {0x8453,0x07}, - {0x8454,0x07}, - {0x8455,0xe4}, - {0x8456,0xb5}, - {0x8457,0x06}, - {0x8458,0x03}, - {0x8459,0xd3}, - {0x845a,0x80}, - {0x845b,0x02}, - {0x845c,0xa2}, - {0x845d,0x1b}, - {0x845e,0x92}, - {0x845f,0x1b}, - {0x8460,0xe5}, - {0x8461,0x4e}, - {0x8462,0x12}, - {0x8463,0x01}, - {0x8464,0xea}, - {0x8465,0xad}, - {0x8466,0x0b}, - {0x8467,0x7c}, - {0x8468,0x00}, - {0x8469,0xef}, - {0x846a,0xb5}, - {0x846b,0x05}, - {0x846c,0x07}, - {0x846d,0xec}, - {0x846e,0xb5}, - {0x846f,0x06}, - {0x8470,0x03}, - {0x8471,0xd3}, - {0x8472,0x80}, - {0x8473,0x02}, - {0x8474,0xa2}, - {0x8475,0x1f}, - {0x8476,0x92}, - {0x8477,0x1f}, - {0x8478,0xe5}, - {0x8479,0x4d}, - {0x847a,0x12}, - {0x847b,0x01}, - {0x847c,0xea}, - {0x847d,0xef}, - {0x847e,0xb5}, - {0x847f,0x05}, - {0x8480,0x07}, - {0x8481,0xee}, - {0x8482,0xb5}, - {0x8483,0x04}, - {0x8484,0x03}, - {0x8485,0xd3}, - {0x8486,0x80}, - {0x8487,0x02}, - {0x8488,0xa2}, - {0x8489,0x1e}, - {0x848a,0x92}, - {0x848b,0x1e}, - {0x848c,0xe5}, - {0x848d,0x4c}, - {0x848e,0x12}, - {0x848f,0x01}, - {0x8490,0xea}, - {0x8491,0xad}, - {0x8492,0x0b}, - {0x8493,0x7c}, - {0x8494,0x00}, - {0x8495,0xef}, - {0x8496,0xb5}, - {0x8497,0x05}, - {0x8498,0x07}, - {0x8499,0xec}, - {0x849a,0xb5}, - {0x849b,0x06}, - {0x849c,0x03}, - {0x849d,0xd3}, - {0x849e,0x80}, - {0x849f,0x02}, - {0x84a0,0xa2}, - {0x84a1,0x1d}, - {0x84a2,0x92}, - {0x84a3,0x1d}, - {0x84a4,0xe5}, - {0x84a5,0x4b}, - {0x84a6,0x12}, - {0x84a7,0x01}, - {0x84a8,0xea}, - {0x84a9,0xef}, - {0x84aa,0xb5}, - {0x84ab,0x05}, - {0x84ac,0x07}, - {0x84ad,0xee}, - {0x84ae,0xb5}, - {0x84af,0x04}, - {0x84b0,0x03}, - {0x84b1,0xd3}, - {0x84b2,0x80}, - {0x84b3,0x02}, - {0x84b4,0xa2}, - {0x84b5,0x1c}, - {0x84b6,0x92}, - {0x84b7,0x1c}, - {0x84b8,0xe5}, - {0x84b9,0x4a}, - {0x84ba,0x12}, - {0x84bb,0x01}, - {0x84bc,0xea}, - {0x84bd,0x7c}, - {0x84be,0x00}, - {0x84bf,0xef}, - {0x84c0,0xb5}, - {0x84c1,0x0b}, - {0x84c2,0x07}, - {0x84c3,0xec}, - {0x84c4,0xb5}, - {0x84c5,0x06}, - {0x84c6,0x03}, - {0x84c7,0xd3}, - {0x84c8,0x80}, - {0x84c9,0x02}, - {0x84ca,0xa2}, - {0x84cb,0x1b}, - {0x84cc,0x92}, - {0x84cd,0x1b}, - {0x84ce,0xe5}, - {0x84cf,0x30}, - {0x84d0,0xd3}, - {0x84d1,0x94}, - {0x84d2,0x00}, - {0x84d3,0x40}, - {0x84d4,0x04}, - {0x84d5,0xa2}, - {0x84d6,0x1f}, - {0x84d7,0x80}, - {0x84d8,0x01}, - {0x84d9,0xc3}, - {0x84da,0x92}, - {0x84db,0x1f}, - {0x84dc,0xe5}, - {0x84dd,0x2f}, - {0x84de,0xd3}, - {0x84df,0x94}, - {0x84e0,0x00}, - {0x84e1,0x40}, - {0x84e2,0x04}, - {0x84e3,0xa2}, - {0x84e4,0x1e}, - {0x84e5,0x80}, - {0x84e6,0x01}, - {0x84e7,0xc3}, - {0x84e8,0x92}, - {0x84e9,0x1e}, - {0x84ea,0xe5}, - {0x84eb,0x2e}, - {0x84ec,0xd3}, - {0x84ed,0x94}, - {0x84ee,0x00}, - {0x84ef,0x40}, - {0x84f0,0x04}, - {0x84f1,0xa2}, - {0x84f2,0x1d}, - {0x84f3,0x80}, - {0x84f4,0x01}, - {0x84f5,0xc3}, - {0x84f6,0x92}, - {0x84f7,0x1d}, - {0x84f8,0xe5}, - {0x84f9,0x2d}, - {0x84fa,0xd3}, - {0x84fb,0x94}, - {0x84fc,0x00}, - {0x84fd,0x40}, - {0x84fe,0x04}, - {0x84ff,0xa2}, - {0x8500,0x1c}, - {0x8501,0x80}, - {0x8502,0x01}, - {0x8503,0xc3}, - {0x8504,0x92}, - {0x8505,0x1c}, - {0x8506,0xe5}, - {0x8507,0x2c}, - {0x8508,0xd3}, - {0x8509,0x94}, - {0x850a,0x00}, - {0x850b,0x40}, - {0x850c,0x04}, - {0x850d,0xa2}, - {0x850e,0x1b}, - {0x850f,0x80}, - {0x8510,0x01}, - {0x8511,0xc3}, - {0x8512,0x92}, - {0x8513,0x1b}, - {0x8514,0x85}, - {0x8515,0x0a}, - {0x8516,0x79}, - {0x8517,0xe5}, - {0x8518,0x7d}, - {0x8519,0xb5}, - {0x851a,0x0b}, - {0x851b,0x03}, - {0x851c,0x02}, - {0x851d,0x16}, - {0x851e,0x5f}, - {0x851f,0x85}, - {0x8520,0x0b}, - {0x8521,0x0c}, - {0x8522,0x12}, - {0x8523,0x13}, - {0x8524,0x64}, - {0x8525,0xd2}, - {0x8526,0x02}, - {0x8527,0xc2}, - {0x8528,0x01}, - {0x8529,0xd2}, - {0x852a,0x00}, - {0x852b,0x75}, - {0x852c,0x31}, - {0x852d,0x03}, - {0x852e,0x22}, - {0x852f,0xe5}, - {0x8530,0x7e}, - {0x8531,0x24}, - {0x8532,0xfe}, - {0x8533,0x60}, - {0x8534,0x27}, - {0x8535,0x14}, - {0x8536,0x60}, - {0x8537,0x31}, - {0x8538,0x24}, - {0x8539,0xf8}, - {0x853a,0x60}, - {0x853b,0x3a}, - {0x853c,0x14}, - {0x853d,0x60}, - {0x853e,0x4b}, - {0x853f,0x14}, - {0x8540,0x60}, - {0x8541,0x59}, - {0x8542,0x14}, - {0x8543,0x60}, - {0x8544,0x6a}, - {0x8545,0x24}, - {0x8546,0xfd}, - {0x8547,0x70}, - {0x8548,0x03}, - {0x8549,0x02}, - {0x854a,0x05}, - {0x854b,0xe4}, - {0x854c,0x24}, - {0x854d,0x10}, - {0x854e,0x60}, - {0x854f,0x03}, - {0x8550,0x02}, - {0x8551,0x06}, - {0x8552,0xdf}, - {0x8553,0xe4}, - {0x8554,0xf5}, - {0x8555,0x0a}, - {0x8556,0x12}, - {0x8557,0x12}, - {0x8558,0x9c}, - {0x8559,0x02}, - {0x855a,0x06}, - {0x855b,0xc8}, - {0x855c,0x75}, - {0x855d,0x0a}, - {0x855e,0x01}, - {0x855f,0x12}, - {0x8560,0x06}, - {0x8561,0xe0}, - {0x8562,0xc2}, - {0x8563,0x3c}, - {0x8564,0xd2}, - {0x8565,0x3b}, - {0x8566,0x02}, - {0x8567,0x06}, - {0x8568,0xd9}, - {0x8569,0x75}, - {0x856a,0x0a}, - {0x856b,0x02}, - {0x856c,0x12}, - {0x856d,0x06}, - {0x856e,0xe0}, - {0x856f,0xd2}, - {0x8570,0x3c}, - {0x8571,0xc2}, - {0x8572,0x3b}, - {0x8573,0x02}, - {0x8574,0x06}, - {0x8575,0xd9}, - {0x8576,0x30}, - {0x8577,0x38}, - {0x8578,0x0c}, - {0x8579,0x20}, - {0x857a,0x3c}, - {0x857b,0x03}, - {0x857c,0x30}, - {0x857d,0x3b}, - {0x857e,0x06}, - {0x857f,0xe4}, - {0x8580,0xf5}, - {0x8581,0x0a}, - {0x8582,0x12}, - {0x8583,0x14}, - {0x8584,0x78}, - {0x8585,0xd2}, - {0x8586,0x18}, - {0x8587,0xc2}, - {0x8588,0x19}, - {0x8589,0x22}, - {0x858a,0x30}, - {0x858b,0x38}, - {0x858c,0x09}, - {0x858d,0x20}, - {0x858e,0x3c}, - {0x858f,0x03}, - {0x8590,0x30}, - {0x8591,0x3b}, - {0x8592,0x03}, - {0x8593,0x12}, - {0x8594,0x06}, - {0x8595,0xf1}, - {0x8596,0xd2}, - {0x8597,0x18}, - {0x8598,0xd2}, - {0x8599,0x19}, - {0x859a,0x22}, - {0x859b,0x30}, - {0x859c,0x38}, - {0x859d,0x0c}, - {0x859e,0x20}, - {0x859f,0x3c}, - {0x85a0,0x03}, - {0x85a1,0x30}, - {0x85a2,0x3b}, - {0x85a3,0x06}, - {0x85a4,0x75}, - {0x85a5,0x0a}, - {0x85a6,0x02}, - {0x85a7,0x12}, - {0x85a8,0x14}, - {0x85a9,0x78}, - {0x85aa,0xc2}, - {0x85ab,0x18}, - {0x85ac,0xd2}, - {0x85ad,0x19}, - {0x85ae,0x22}, - {0x85af,0x20}, - {0x85b0,0x3c}, - {0x85b1,0x06}, - {0x85b2,0x20}, - {0x85b3,0x3b}, - {0x85b4,0x03}, - {0x85b5,0x02}, - {0x85b6,0x06}, - {0x85b7,0xdf}, - {0x85b8,0xe5}, - {0x85b9,0x79}, - {0x85ba,0xd3}, - {0x85bb,0x94}, - {0x85bc,0x03}, - {0x85bd,0x40}, - {0x85be,0x04}, - {0x85bf,0x7f}, - {0x85c0,0x00}, - {0x85c1,0x80}, - {0x85c2,0x04}, - {0x85c3,0xe5}, - {0x85c4,0x79}, - {0x85c5,0x04}, - {0x85c6,0xff}, - {0x85c7,0x8f}, - {0x85c8,0x79}, - {0x85c9,0x30}, - {0x85ca,0x18}, - {0x85cb,0x06}, - {0x85cc,0x30}, - {0x85cd,0x19}, - {0x85ce,0x03}, - {0x85cf,0x12}, - {0x85d0,0x06}, - {0x85d1,0xf1}, - {0x85d2,0x30}, - {0x85d3,0x18}, - {0x85d4,0x03}, - {0x85d5,0x02}, - {0x85d6,0x06}, - {0x85d7,0xdf}, - {0x85d8,0x20}, - {0x85d9,0x19}, - {0x85da,0x03}, - {0x85db,0x02}, - {0x85dc,0x06}, - {0x85dd,0xdf}, - {0x85de,0x75}, - {0x85df,0x0a}, - {0x85e0,0x02}, - {0x85e1,0x02}, - {0x85e2,0x14}, - {0x85e3,0x78}, - {0x85e4,0xe5}, - {0x85e5,0x68}, - {0x85e6,0xd3}, - {0x85e7,0x94}, - {0x85e8,0x38}, - {0x85e9,0x40}, - {0x85ea,0x04}, - {0x85eb,0x7f}, - {0x85ec,0x34}, - {0x85ed,0x80}, - {0x85ee,0x02}, - {0x85ef,0xaf}, - {0x85f0,0x68}, - {0x85f1,0x8f}, - {0x85f2,0x68}, - {0x85f3,0xe5}, - {0x85f4,0x68}, - {0x85f5,0xc3}, - {0x85f6,0x94}, - {0x85f7,0x08}, - {0x85f8,0x50}, - {0x85f9,0x04}, - {0x85fa,0x7f}, - {0x85fb,0x08}, - {0x85fc,0x80}, - {0x85fd,0x02}, - {0x85fe,0xaf}, - {0x85ff,0x68}, - {0x8600,0x8f}, - {0x8601,0x68}, - {0x8602,0xe5}, - {0x8603,0x69}, - {0x8604,0xd3}, - {0x8605,0x94}, - {0x8606,0x2a}, - {0x8607,0x40}, - {0x8608,0x04}, - {0x8609,0x7f}, - {0x860a,0x2a}, - {0x860b,0x80}, - {0x860c,0x02}, - {0x860d,0xaf}, - {0x860e,0x69}, - {0x860f,0x8f}, - {0x8610,0x69}, - {0x8611,0xe5}, - {0x8612,0x69}, - {0x8613,0xc3}, - {0x8614,0x94}, - {0x8615,0x06}, - {0x8616,0x50}, - {0x8617,0x04}, - {0x8618,0x7f}, - {0x8619,0x06}, - {0x861a,0x80}, - {0x861b,0x02}, - {0x861c,0xaf}, - {0x861d,0x69}, - {0x861e,0x8f}, - {0x861f,0x69}, - {0x8620,0xaf}, - {0x8621,0x68}, - {0x8622,0xef}, - {0x8623,0x24}, - {0x8624,0xf8}, - {0x8625,0xff}, - {0x8626,0xe4}, - {0x8627,0x34}, - {0x8628,0xff}, - {0x8629,0xfe}, - {0x862a,0xe4}, - {0x862b,0x8f}, - {0x862c,0x3f}, - {0x862d,0x8e}, - {0x862e,0x3e}, - {0x862f,0xf5}, - {0x8630,0x3d}, - {0x8631,0xf5}, - {0x8632,0x3c}, - {0x8633,0xac}, - {0x8634,0x3c}, - {0x8635,0x12}, - {0x8636,0x01}, - {0x8637,0xb9}, - {0x8638,0xaf}, - {0x8639,0x69}, - {0x863a,0xef}, - {0x863b,0x24}, - {0x863c,0xfa}, - {0x863d,0xff}, - {0x863e,0xe4}, - {0x863f,0x34}, - {0x8640,0xff}, - {0x8641,0x12}, - {0x8642,0x01}, - {0x8643,0x9c}, - {0x8644,0xaf}, - {0x8645,0x68}, - {0x8646,0xef}, - {0x8647,0x24}, - {0x8648,0x08}, - {0x8649,0xff}, - {0x864a,0xe4}, - {0x864b,0x33}, - {0x864c,0x12}, - {0x864d,0x01}, - {0x864e,0x9c}, - {0x864f,0xaf}, - {0x8650,0x69}, - {0x8651,0xef}, - {0x8652,0x24}, - {0x8653,0x06}, - {0x8654,0xff}, - {0x8655,0xe4}, - {0x8656,0x33}, - {0x8657,0xfe}, - {0x8658,0xe4}, - {0x8659,0xfc}, - {0x865a,0xfd}, - {0x865b,0xe5}, - {0x865c,0x3f}, - {0x865d,0x2f}, - {0x865e,0xf5}, - {0x865f,0x3f}, - {0x8660,0xe5}, - {0x8661,0x3e}, - {0x8662,0x3e}, - {0x8663,0xf5}, - {0x8664,0x3e}, - {0x8665,0xed}, - {0x8666,0x35}, - {0x8667,0x3d}, - {0x8668,0xf5}, - {0x8669,0x3d}, - {0x866a,0xec}, - {0x866b,0x35}, - {0x866c,0x3c}, - {0x866d,0xf5}, - {0x866e,0x3c}, - {0x866f,0xe4}, - {0x8670,0x25}, - {0x8671,0x3f}, - {0x8672,0xf5}, - {0x8673,0x37}, - {0x8674,0xe4}, - {0x8675,0x35}, - {0x8676,0x3e}, - {0x8677,0xf5}, - {0x8678,0x36}, - {0x8679,0xe4}, - {0x867a,0x35}, - {0x867b,0x3d}, - {0x867c,0xf5}, - {0x867d,0x35}, - {0x867e,0xe5}, - {0x867f,0x3c}, - {0x8680,0x34}, - {0x8681,0x08}, - {0x8682,0xf5}, - {0x8683,0x34}, - {0x8684,0xe4}, - {0x8685,0x25}, - {0x8686,0x3f}, - {0x8687,0xf5}, - {0x8688,0x3b}, - {0x8689,0xe4}, - {0x868a,0x35}, - {0x868b,0x3e}, - {0x868c,0xf5}, - {0x868d,0x3a}, - {0x868e,0xe5}, - {0x868f,0x3d}, - {0x8690,0x34}, - {0x8691,0x06}, - {0x8692,0xf5}, - {0x8693,0x39}, - {0x8694,0xe4}, - {0x8695,0x35}, - {0x8696,0x3c}, - {0x8697,0xf5}, - {0x8698,0x38}, - {0x8699,0xe5}, - {0x869a,0x3f}, - {0x869b,0x24}, - {0x869c,0xfa}, - {0x869d,0xf5}, - {0x869e,0x43}, - {0x869f,0xe5}, - {0x86a0,0x3e}, - {0x86a1,0x34}, - {0x86a2,0xff}, - {0x86a3,0xf5}, - {0x86a4,0x42}, - {0x86a5,0xe5}, - {0x86a6,0x3d}, - {0x86a7,0x34}, - {0x86a8,0xff}, - {0x86a9,0xf5}, - {0x86aa,0x41}, - {0x86ab,0xe5}, - {0x86ac,0x3c}, - {0x86ad,0x34}, - {0x86ae,0xff}, - {0x86af,0xf5}, - {0x86b0,0x40}, - {0x86b1,0xe4}, - {0x86b2,0x25}, - {0x86b3,0x3f}, - {0x86b4,0xf5}, - {0x86b5,0x47}, - {0x86b6,0xe5}, - {0x86b7,0x3e}, - {0x86b8,0x34}, - {0x86b9,0xf8}, - {0x86ba,0xf5}, - {0x86bb,0x46}, - {0x86bc,0xe5}, - {0x86bd,0x3d}, - {0x86be,0x34}, - {0x86bf,0xff}, - {0x86c0,0xf5}, - {0x86c1,0x45}, - {0x86c2,0xe5}, - {0x86c3,0x3c}, - {0x86c4,0x34}, - {0x86c5,0xff}, - {0x86c6,0xf5}, - {0x86c7,0x44}, - {0x86c8,0x75}, - {0x86c9,0x79}, - {0x86ca,0x02}, - {0x86cb,0x75}, - {0x86cc,0x0a}, - {0x86cd,0x01}, - {0x86ce,0x12}, - {0x86cf,0x14}, - {0x86d0,0x78}, - {0x86d1,0xd2}, - {0x86d2,0x18}, - {0x86d3,0xd2}, - {0x86d4,0x19}, - {0x86d5,0xc2}, - {0x86d6,0x3c}, - {0x86d7,0xc2}, - {0x86d8,0x3b}, - {0x86d9,0xd2}, - {0x86da,0x1a}, - {0x86db,0xd2}, - {0x86dc,0x38}, - {0x86dd,0xd2}, - {0x86de,0x30}, - {0x86df,0x22}, - {0x86e0,0x12}, - {0x86e1,0x12}, - {0x86e2,0x9c}, - {0x86e3,0x75}, - {0x86e4,0x79}, - {0x86e5,0x02}, - {0x86e6,0xe4}, - {0x86e7,0xf5}, - {0x86e8,0x0a}, - {0x86e9,0x12}, - {0x86ea,0x14}, - {0x86eb,0x78}, - {0x86ec,0xd2}, - {0x86ed,0x18}, - {0x86ee,0xc2}, - {0x86ef,0x19}, - {0x86f0,0x22}, - {0x86f1,0x75}, - {0x86f2,0x0a}, - {0x86f3,0x01}, - {0x86f4,0x12}, - {0x86f5,0x14}, - {0x86f6,0x78}, - {0x86f7,0x22}, - {0x86f8,0x90}, - {0x86f9,0x38}, - {0x86fa,0x04}, - {0x86fb,0xe0}, - {0x86fc,0xfe}, - {0x86fd,0xa3}, - {0x86fe,0xe0}, - {0x86ff,0xfd}, - {0x8700,0xed}, - {0x8701,0xff}, - {0x8702,0xee}, - {0x8703,0x54}, - {0x8704,0x0f}, - {0x8705,0xf5}, - {0x8706,0x0e}, - {0x8707,0x8f}, - {0x8708,0x0f}, - {0x8709,0xa3}, - {0x870a,0xe0}, - {0x870b,0xfe}, - {0x870c,0xa3}, - {0x870d,0xe0}, - {0x870e,0xfd}, - {0x870f,0xed}, - {0x8710,0xff}, - {0x8711,0xee}, - {0x8712,0x54}, - {0x8713,0x07}, - {0x8714,0xf5}, - {0x8715,0x10}, - {0x8716,0x8f}, - {0x8717,0x11}, - {0x8718,0xe5}, - {0x8719,0x0e}, - {0x871a,0xc4}, - {0x871b,0xf8}, - {0x871c,0x54}, - {0x871d,0xf0}, - {0x871e,0xc8}, - {0x871f,0x68}, - {0x8720,0xf5}, - {0x8721,0x0e}, - {0x8722,0xe5}, - {0x8723,0x0f}, - {0x8724,0xc4}, - {0x8725,0x54}, - {0x8726,0x0f}, - {0x8727,0x48}, - {0x8728,0xf5}, - {0x8729,0x0f}, - {0x872a,0xe5}, - {0x872b,0x10}, - {0x872c,0xc4}, - {0x872d,0xf8}, - {0x872e,0x54}, - {0x872f,0xf0}, - {0x8730,0xc8}, - {0x8731,0x68}, - {0x8732,0xf5}, - {0x8733,0x10}, - {0x8734,0xe5}, - {0x8735,0x11}, - {0x8736,0xc4}, - {0x8737,0x54}, - {0x8738,0x0f}, - {0x8739,0x48}, - {0x873a,0xf5}, - {0x873b,0x11}, - {0x873c,0xe4}, - {0x873d,0xf5}, - {0x873e,0x17}, - {0x873f,0x75}, - {0x8740,0x16}, - {0x8741,0x04}, - {0x8742,0x12}, - {0x8743,0x02}, - {0x8744,0x60}, - {0x8745,0x24}, - {0x8746,0x34}, - {0x8747,0xf8}, - {0x8748,0xe6}, - {0x8749,0xf5}, - {0x874a,0x12}, - {0x874b,0x12}, - {0x874c,0x02}, - {0x874d,0x60}, - {0x874e,0x24}, - {0x874f,0x35}, - {0x8750,0xf8}, - {0x8751,0xe6}, - {0x8752,0xf5}, - {0x8753,0x14}, - {0x8754,0x12}, - {0x8755,0x02}, - {0x8756,0x60}, - {0x8757,0x24}, - {0x8758,0x36}, - {0x8759,0xf8}, - {0x875a,0xe6}, - {0x875b,0xf5}, - {0x875c,0x13}, - {0x875d,0x12}, - {0x875e,0x02}, - {0x875f,0x60}, - {0x8760,0x24}, - {0x8761,0x37}, - {0x8762,0xf8}, - {0x8763,0xe6}, - {0x8764,0xf5}, - {0x8765,0x15}, - {0x8766,0x12}, - {0x8767,0x02}, - {0x8768,0x73}, - {0x8769,0xaf}, - {0x876a,0x12}, - {0x876b,0x12}, - {0x876c,0x01}, - {0x876d,0x42}, - {0x876e,0x8f}, - {0x876f,0x12}, - {0x8770,0x12}, - {0x8771,0x02}, - {0x8772,0x73}, - {0x8773,0xaf}, - {0x8774,0x13}, - {0x8775,0x12}, - {0x8776,0x01}, - {0x8777,0x42}, - {0x8778,0x8f}, - {0x8779,0x13}, - {0x877a,0x12}, - {0x877b,0x02}, - {0x877c,0x1b}, - {0x877d,0xaf}, - {0x877e,0x14}, - {0x877f,0xfc}, - {0x8780,0xfd}, - {0x8781,0xfe}, - {0x8782,0x12}, - {0x8783,0x08}, - {0x8784,0x98}, - {0x8785,0x12}, - {0x8786,0x01}, - {0x8787,0x61}, - {0x8788,0x7b}, - {0x8789,0x30}, - {0x878a,0x12}, - {0x878b,0x01}, - {0x878c,0x5a}, - {0x878d,0x8f}, - {0x878e,0x14}, - {0x878f,0x12}, - {0x8790,0x02}, - {0x8791,0x1b}, - {0x8792,0xaf}, - {0x8793,0x15}, - {0x8794,0xfc}, - {0x8795,0xfd}, - {0x8796,0xfe}, - {0x8797,0x12}, - {0x8798,0x08}, - {0x8799,0x98}, - {0x879a,0x12}, - {0x879b,0x01}, - {0x879c,0x61}, - {0x879d,0xe4}, - {0x879e,0x7b}, - {0x879f,0x30}, - {0x87a0,0x12}, - {0x87a1,0x01}, - {0x87a2,0x5b}, - {0x87a3,0x8f}, - {0x87a4,0x15}, - {0x87a5,0xc3}, - {0x87a6,0xe5}, - {0x87a7,0x13}, - {0x87a8,0x95}, - {0x87a9,0x12}, - {0x87aa,0xff}, - {0x87ab,0x0f}, - {0x87ac,0xef}, - {0x87ad,0xc3}, - {0x87ae,0x13}, - {0x87af,0xff}, - {0x87b0,0xc3}, - {0x87b1,0x94}, - {0x87b2,0x04}, - {0x87b3,0x50}, - {0x87b4,0x27}, - {0x87b5,0xe5}, - {0x87b6,0x12}, - {0x87b7,0x9f}, - {0x87b8,0x40}, - {0x87b9,0x06}, - {0x87ba,0xe5}, - {0x87bb,0x12}, - {0x87bc,0x9f}, - {0x87bd,0xfe}, - {0x87be,0x80}, - {0x87bf,0x02}, - {0x87c0,0x7e}, - {0x87c1,0x00}, - {0x87c2,0x8e}, - {0x87c3,0x12}, - {0x87c4,0xef}, - {0x87c5,0xfd}, - {0x87c6,0xe5}, - {0x87c7,0x13}, - {0x87c8,0x2d}, - {0x87c9,0xfd}, - {0x87ca,0xe4}, - {0x87cb,0x33}, - {0x87cc,0xfc}, - {0x87cd,0xc3}, - {0x87ce,0xed}, - {0x87cf,0x95}, - {0x87d0,0x0f}, - {0x87d1,0xec}, - {0x87d2,0x95}, - {0x87d3,0x0e}, - {0x87d4,0x50}, - {0x87d5,0x02}, - {0x87d6,0x80}, - {0x87d7,0x02}, - {0x87d8,0xad}, - {0x87d9,0x0f}, - {0x87da,0x8d}, - {0x87db,0x13}, - {0x87dc,0xc3}, - {0x87dd,0xe5}, - {0x87de,0x15}, - {0x87df,0x95}, - {0x87e0,0x14}, - {0x87e1,0xff}, - {0x87e2,0xc3}, - {0x87e3,0x94}, - {0x87e4,0x04}, - {0x87e5,0x50}, - {0x87e6,0x29}, - {0x87e7,0xe5}, - {0x87e8,0x14}, - {0x87e9,0x9f}, - {0x87ea,0x40}, - {0x87eb,0x06}, - {0x87ec,0xe5}, - {0x87ed,0x14}, - {0x87ee,0x9f}, - {0x87ef,0xfe}, - {0x87f0,0x80}, - {0x87f1,0x02}, - {0x87f2,0x7e}, - {0x87f3,0x00}, - {0x87f4,0x8e}, - {0x87f5,0x14}, - {0x87f6,0xef}, - {0x87f7,0xfd}, - {0x87f8,0xe5}, - {0x87f9,0x15}, - {0x87fa,0x2d}, - {0x87fb,0xfd}, - {0x87fc,0xe4}, - {0x87fd,0x33}, - {0x87fe,0xfc}, - {0x87ff,0xc3}, - {0x8800,0xed}, - {0x8801,0x95}, - {0x8802,0x11}, - {0x8803,0xec}, - {0x8804,0x95}, - {0x8805,0x10}, - {0x8806,0x50}, - {0x8807,0x04}, - {0x8808,0xaf}, - {0x8809,0x05}, - {0x880a,0x80}, - {0x880b,0x02}, - {0x880c,0xaf}, - {0x880d,0x11}, - {0x880e,0x8f}, - {0x880f,0x15}, - {0x8810,0xe5}, - {0x8811,0x15}, - {0x8812,0xd3}, - {0x8813,0x95}, - {0x8814,0x17}, - {0x8815,0x40}, - {0x8816,0x04}, - {0x8817,0xaf}, - {0x8818,0x15}, - {0x8819,0x80}, - {0x881a,0x02}, - {0x881b,0xaf}, - {0x881c,0x17}, - {0x881d,0x8f}, - {0x881e,0x17}, - {0x881f,0xd3}, - {0x8820,0xe5}, - {0x8821,0x16}, - {0x8822,0x64}, - {0x8823,0x80}, - {0x8824,0x94}, - {0x8825,0x80}, - {0x8826,0x40}, - {0x8827,0x04}, - {0x8828,0xaf}, - {0x8829,0x15}, - {0x882a,0x80}, - {0x882b,0x02}, - {0x882c,0xaf}, - {0x882d,0x17}, - {0x882e,0x8f}, - {0x882f,0x15}, - {0x8830,0xe5}, - {0x8831,0x16}, - {0x8832,0xfd}, - {0x8833,0x33}, - {0x8834,0x95}, - {0x8835,0xe0}, - {0x8836,0xfc}, - {0x8837,0xed}, - {0x8838,0xae}, - {0x8839,0x04}, - {0x883a,0x78}, - {0x883b,0x02}, - {0x883c,0xc3}, - {0x883d,0x33}, - {0x883e,0xce}, - {0x883f,0x33}, - {0x8840,0xce}, - {0x8841,0xd8}, - {0x8842,0xf9}, - {0x8843,0xff}, - {0x8844,0x24}, - {0x8845,0x01}, - {0x8846,0xfb}, - {0x8847,0xee}, - {0x8848,0x34}, - {0x8849,0x60}, - {0x884a,0x8b}, - {0x884b,0x82}, - {0x884c,0xf5}, - {0x884d,0x83}, - {0x884e,0xe5}, - {0x884f,0x12}, - {0x8850,0xf0}, - {0x8851,0xef}, - {0x8852,0x24}, - {0x8853,0x02}, - {0x8854,0xff}, - {0x8855,0xee}, - {0x8856,0x34}, - {0x8857,0x60}, - {0x8858,0x8f}, - {0x8859,0x82}, - {0x885a,0xf5}, - {0x885b,0x83}, - {0x885c,0xe5}, - {0x885d,0x14}, - {0x885e,0xf0}, - {0x885f,0xed}, - {0x8860,0xae}, - {0x8861,0x04}, - {0x8862,0x78}, - {0x8863,0x02}, - {0x8864,0xc3}, - {0x8865,0x33}, - {0x8866,0xce}, - {0x8867,0x33}, - {0x8868,0xce}, - {0x8869,0xd8}, - {0x886a,0xf9}, - {0x886b,0xff}, - {0x886c,0x24}, - {0x886d,0x03}, - {0x886e,0xfd}, - {0x886f,0xee}, - {0x8870,0x34}, - {0x8871,0x60}, - {0x8872,0x8d}, - {0x8873,0x82}, - {0x8874,0xf5}, - {0x8875,0x83}, - {0x8876,0xe5}, - {0x8877,0x13}, - {0x8878,0xf0}, - {0x8879,0xef}, - {0x887a,0x24}, - {0x887b,0x04}, - {0x887c,0xff}, - {0x887d,0xee}, - {0x887e,0x34}, - {0x887f,0x60}, - {0x8880,0x8f}, - {0x8881,0x82}, - {0x8882,0xf5}, - {0x8883,0x83}, - {0x8884,0xe5}, - {0x8885,0x15}, - {0x8886,0xf0}, - {0x8887,0x15}, - {0x8888,0x16}, - {0x8889,0xc3}, - {0x888a,0xe5}, - {0x888b,0x16}, - {0x888c,0x64}, - {0x888d,0x80}, - {0x888e,0x94}, - {0x888f,0x80}, - {0x8890,0x40}, - {0x8891,0x03}, - {0x8892,0x02}, - {0x8893,0x07}, - {0x8894,0x42}, - {0x8895,0xc2}, - {0x8896,0x30}, - {0x8897,0x22}, - {0x8898,0xe8}, - {0x8899,0x8f}, - {0x889a,0xf0}, - {0x889b,0xa4}, - {0x889c,0xcc}, - {0x889d,0x8b}, - {0x889e,0xf0}, - {0x889f,0xa4}, - {0x88a0,0x2c}, - {0x88a1,0xfc}, - {0x88a2,0xe9}, - {0x88a3,0x8e}, - {0x88a4,0xf0}, - {0x88a5,0xa4}, - {0x88a6,0x2c}, - {0x88a7,0xfc}, - {0x88a8,0x8a}, - {0x88a9,0xf0}, - {0x88aa,0xed}, - {0x88ab,0xa4}, - {0x88ac,0x2c}, - {0x88ad,0xfc}, - {0x88ae,0xea}, - {0x88af,0x8e}, - {0x88b0,0xf0}, - {0x88b1,0xa4}, - {0x88b2,0xcd}, - {0x88b3,0xa8}, - {0x88b4,0xf0}, - {0x88b5,0x8b}, - {0x88b6,0xf0}, - {0x88b7,0xa4}, - {0x88b8,0x2d}, - {0x88b9,0xcc}, - {0x88ba,0x38}, - {0x88bb,0x25}, - {0x88bc,0xf0}, - {0x88bd,0xfd}, - {0x88be,0xe9}, - {0x88bf,0x8f}, - {0x88c0,0xf0}, - {0x88c1,0xa4}, - {0x88c2,0x2c}, - {0x88c3,0xcd}, - {0x88c4,0x35}, - {0x88c5,0xf0}, - {0x88c6,0xfc}, - {0x88c7,0xeb}, - {0x88c8,0x8e}, - {0x88c9,0xf0}, - {0x88ca,0xa4}, - {0x88cb,0xfe}, - {0x88cc,0xa9}, - {0x88cd,0xf0}, - {0x88ce,0xeb}, - {0x88cf,0x8f}, - {0x88d0,0xf0}, - {0x88d1,0xa4}, - {0x88d2,0xcf}, - {0x88d3,0xc5}, - {0x88d4,0xf0}, - {0x88d5,0x2e}, - {0x88d6,0xcd}, - {0x88d7,0x39}, - {0x88d8,0xfe}, - {0x88d9,0xe4}, - {0x88da,0x3c}, - {0x88db,0xfc}, - {0x88dc,0xea}, - {0x88dd,0xa4}, - {0x88de,0x2d}, - {0x88df,0xce}, - {0x88e0,0x35}, - {0x88e1,0xf0}, - {0x88e2,0xfd}, - {0x88e3,0xe4}, - {0x88e4,0x3c}, - {0x88e5,0xfc}, - {0x88e6,0x22}, - {0x88e7,0x75}, - {0x88e8,0xf0}, - {0x88e9,0x08}, - {0x88ea,0x75}, - {0x88eb,0x82}, - {0x88ec,0x00}, - {0x88ed,0xef}, - {0x88ee,0x2f}, - {0x88ef,0xff}, - {0x88f0,0xee}, - {0x88f1,0x33}, - {0x88f2,0xfe}, - {0x88f3,0xcd}, - {0x88f4,0x33}, - {0x88f5,0xcd}, - {0x88f6,0xcc}, - {0x88f7,0x33}, - {0x88f8,0xcc}, - {0x88f9,0xc5}, - {0x88fa,0x82}, - {0x88fb,0x33}, - {0x88fc,0xc5}, - {0x88fd,0x82}, - {0x88fe,0x9b}, - {0x88ff,0xed}, - {0x8900,0x9a}, - {0x8901,0xec}, - {0x8902,0x99}, - {0x8903,0xe5}, - {0x8904,0x82}, - {0x8905,0x98}, - {0x8906,0x40}, - {0x8907,0x0c}, - {0x8908,0xf5}, - {0x8909,0x82}, - {0x890a,0xee}, - {0x890b,0x9b}, - {0x890c,0xfe}, - {0x890d,0xed}, - {0x890e,0x9a}, - {0x890f,0xfd}, - {0x8910,0xec}, - {0x8911,0x99}, - {0x8912,0xfc}, - {0x8913,0x0f}, - {0x8914,0xd5}, - {0x8915,0xf0}, - {0x8916,0xd6}, - {0x8917,0xe4}, - {0x8918,0xce}, - {0x8919,0xfb}, - {0x891a,0xe4}, - {0x891b,0xcd}, - {0x891c,0xfa}, - {0x891d,0xe4}, - {0x891e,0xcc}, - {0x891f,0xf9}, - {0x8920,0xa8}, - {0x8921,0x82}, - {0x8922,0x22}, - {0x8923,0xb8}, - {0x8924,0x00}, - {0x8925,0xc1}, - {0x8926,0xb9}, - {0x8927,0x00}, - {0x8928,0x59}, - {0x8929,0xba}, - {0x892a,0x00}, - {0x892b,0x2d}, - {0x892c,0xec}, - {0x892d,0x8b}, - {0x892e,0xf0}, - {0x892f,0x84}, - {0x8930,0xcf}, - {0x8931,0xce}, - {0x8932,0xcd}, - {0x8933,0xfc}, - {0x8934,0xe5}, - {0x8935,0xf0}, - {0x8936,0xcb}, - {0x8937,0xf9}, - {0x8938,0x78}, - {0x8939,0x18}, - {0x893a,0xef}, - {0x893b,0x2f}, - {0x893c,0xff}, - {0x893d,0xee}, - {0x893e,0x33}, - {0x893f,0xfe}, - {0x8940,0xed}, - {0x8941,0x33}, - {0x8942,0xfd}, - {0x8943,0xec}, - {0x8944,0x33}, - {0x8945,0xfc}, - {0x8946,0xeb}, - {0x8947,0x33}, - {0x8948,0xfb}, - {0x8949,0x10}, - {0x894a,0xd7}, - {0x894b,0x03}, - {0x894c,0x99}, - {0x894d,0x40}, - {0x894e,0x04}, - {0x894f,0xeb}, - {0x8950,0x99}, - {0x8951,0xfb}, - {0x8952,0x0f}, - {0x8953,0xd8}, - {0x8954,0xe5}, - {0x8955,0xe4}, - {0x8956,0xf9}, - {0x8957,0xfa}, - {0x8958,0x22}, - {0x8959,0x78}, - {0x895a,0x18}, - {0x895b,0xef}, - {0x895c,0x2f}, - {0x895d,0xff}, - {0x895e,0xee}, - {0x895f,0x33}, - {0x8960,0xfe}, - {0x8961,0xed}, - {0x8962,0x33}, - {0x8963,0xfd}, - {0x8964,0xec}, - {0x8965,0x33}, - {0x8966,0xfc}, - {0x8967,0xc9}, - {0x8968,0x33}, - {0x8969,0xc9}, - {0x896a,0x10}, - {0x896b,0xd7}, - {0x896c,0x05}, - {0x896d,0x9b}, - {0x896e,0xe9}, - {0x896f,0x9a}, - {0x8970,0x40}, - {0x8971,0x07}, - {0x8972,0xec}, - {0x8973,0x9b}, - {0x8974,0xfc}, - {0x8975,0xe9}, - {0x8976,0x9a}, - {0x8977,0xf9}, - {0x8978,0x0f}, - {0x8979,0xd8}, - {0x897a,0xe0}, - {0x897b,0xe4}, - {0x897c,0xc9}, - {0x897d,0xfa}, - {0x897e,0xe4}, - {0x897f,0xcc}, - {0x8980,0xfb}, - {0x8981,0x22}, - {0x8982,0x75}, - {0x8983,0xf0}, - {0x8984,0x10}, - {0x8985,0xef}, - {0x8986,0x2f}, - {0x8987,0xff}, - {0x8988,0xee}, - {0x8989,0x33}, - {0x898a,0xfe}, - {0x898b,0xed}, - {0x898c,0x33}, - {0x898d,0xfd}, - {0x898e,0xcc}, - {0x898f,0x33}, - {0x8990,0xcc}, - {0x8991,0xc8}, - {0x8992,0x33}, - {0x8993,0xc8}, - {0x8994,0x10}, - {0x8995,0xd7}, - {0x8996,0x07}, - {0x8997,0x9b}, - {0x8998,0xec}, - {0x8999,0x9a}, - {0x899a,0xe8}, - {0x899b,0x99}, - {0x899c,0x40}, - {0x899d,0x0a}, - {0x899e,0xed}, - {0x899f,0x9b}, - {0x89a0,0xfd}, - {0x89a1,0xec}, - {0x89a2,0x9a}, - {0x89a3,0xfc}, - {0x89a4,0xe8}, - {0x89a5,0x99}, - {0x89a6,0xf8}, - {0x89a7,0x0f}, - {0x89a8,0xd5}, - {0x89a9,0xf0}, - {0x89aa,0xda}, - {0x89ab,0xe4}, - {0x89ac,0xcd}, - {0x89ad,0xfb}, - {0x89ae,0xe4}, - {0x89af,0xcc}, - {0x89b0,0xfa}, - {0x89b1,0xe4}, - {0x89b2,0xc8}, - {0x89b3,0xf9}, - {0x89b4,0x22}, - {0x89b5,0xe8}, - {0x89b6,0x60}, - {0x89b7,0x0f}, - {0x89b8,0xec}, - {0x89b9,0xc3}, - {0x89ba,0x13}, - {0x89bb,0xfc}, - {0x89bc,0xed}, - {0x89bd,0x13}, - {0x89be,0xfd}, - {0x89bf,0xee}, - {0x89c0,0x13}, - {0x89c1,0xfe}, - {0x89c2,0xef}, - {0x89c3,0x13}, - {0x89c4,0xff}, - {0x89c5,0xd8}, - {0x89c6,0xf1}, - {0x89c7,0x22}, - {0x89c8,0xe8}, - {0x89c9,0x60}, - {0x89ca,0x0f}, - {0x89cb,0xef}, - {0x89cc,0xc3}, - {0x89cd,0x33}, - {0x89ce,0xff}, - {0x89cf,0xee}, - {0x89d0,0x33}, - {0x89d1,0xfe}, - {0x89d2,0xed}, - {0x89d3,0x33}, - {0x89d4,0xfd}, - {0x89d5,0xec}, - {0x89d6,0x33}, - {0x89d7,0xfc}, - {0x89d8,0xd8}, - {0x89d9,0xf1}, - {0x89da,0x22}, - {0x89db,0xe4}, - {0x89dc,0x93}, - {0x89dd,0xfc}, - {0x89de,0x74}, - {0x89df,0x01}, - {0x89e0,0x93}, - {0x89e1,0xfd}, - {0x89e2,0x74}, - {0x89e3,0x02}, - {0x89e4,0x93}, - {0x89e5,0xfe}, - {0x89e6,0x74}, - {0x89e7,0x03}, - {0x89e8,0x93}, - {0x89e9,0xff}, - {0x89ea,0x22}, - {0x89eb,0xa4}, - {0x89ec,0x25}, - {0x89ed,0x82}, - {0x89ee,0xf5}, - {0x89ef,0x82}, - {0x89f0,0xe5}, - {0x89f1,0xf0}, - {0x89f2,0x35}, - {0x89f3,0x83}, - {0x89f4,0xf5}, - {0x89f5,0x83}, - {0x89f6,0x22}, - {0x89f7,0xd0}, - {0x89f8,0x83}, - {0x89f9,0xd0}, - {0x89fa,0x82}, - {0x89fb,0xf8}, - {0x89fc,0xe4}, - {0x89fd,0x93}, - {0x89fe,0x70}, - {0x89ff,0x12}, - {0x8a00,0x74}, - {0x8a01,0x01}, - {0x8a02,0x93}, - {0x8a03,0x70}, - {0x8a04,0x0d}, - {0x8a05,0xa3}, - {0x8a06,0xa3}, - {0x8a07,0x93}, - {0x8a08,0xf8}, - {0x8a09,0x74}, - {0x8a0a,0x01}, - {0x8a0b,0x93}, - {0x8a0c,0xf5}, - {0x8a0d,0x82}, - {0x8a0e,0x88}, - {0x8a0f,0x83}, - {0x8a10,0xe4}, - {0x8a11,0x73}, - {0x8a12,0x74}, - {0x8a13,0x02}, - {0x8a14,0x93}, - {0x8a15,0x68}, - {0x8a16,0x60}, - {0x8a17,0xef}, - {0x8a18,0xa3}, - {0x8a19,0xa3}, - {0x8a1a,0xa3}, - {0x8a1b,0x80}, - {0x8a1c,0xdf}, - {0x8a1d,0x75}, - {0x8a1e,0x0f}, - {0x8a1f,0x0a}, - {0x8a20,0xa2}, - {0x8a21,0xaf}, - {0x8a22,0x92}, - {0x8a23,0x32}, - {0x8a24,0xc2}, - {0x8a25,0xaf}, - {0x8a26,0xc2}, - {0x8a27,0x33}, - {0x8a28,0x12}, - {0x8a29,0x01}, - {0x8a2a,0x6a}, - {0x8a2b,0x12}, - {0x8a2c,0x02}, - {0x8a2d,0x12}, - {0x8a2e,0x12}, - {0x8a2f,0x01}, - {0x8a30,0x6a}, - {0x8a31,0x75}, - {0x8a32,0x51}, - {0x8a33,0x05}, - {0x8a34,0xaf}, - {0x8a35,0x51}, - {0x8a36,0x15}, - {0x8a37,0x51}, - {0x8a38,0xef}, - {0x8a39,0x70}, - {0x8a3a,0xf9}, - {0x8a3b,0xd2}, - {0x8a3c,0x28}, - {0x8a3d,0x12}, - {0x8a3e,0x01}, - {0x8a3f,0x6c}, - {0x8a40,0x75}, - {0x8a41,0x51}, - {0x8a42,0x0a}, - {0x8a43,0xaf}, - {0x8a44,0x51}, - {0x8a45,0x15}, - {0x8a46,0x51}, - {0x8a47,0xef}, - {0x8a48,0x70}, - {0x8a49,0xf9}, - {0x8a4a,0xc2}, - {0x8a4b,0x29}, - {0x8a4c,0x12}, - {0x8a4d,0x01}, - {0x8a4e,0x6c}, - {0x8a4f,0x75}, - {0x8a50,0x51}, - {0x8a51,0x05}, - {0x8a52,0xaf}, - {0x8a53,0x51}, - {0x8a54,0x15}, - {0x8a55,0x51}, - {0x8a56,0xef}, - {0x8a57,0x70}, - {0x8a58,0xf9}, - {0x8a59,0xc2}, - {0x8a5a,0x28}, - {0x8a5b,0x12}, - {0x8a5c,0x01}, - {0x8a5d,0x6c}, - {0x8a5e,0x75}, - {0x8a5f,0x51}, - {0x8a60,0x05}, - {0x8a61,0xaf}, - {0x8a62,0x51}, - {0x8a63,0x15}, - {0x8a64,0x51}, - {0x8a65,0xef}, - {0x8a66,0x70}, - {0x8a67,0xf9}, - {0x8a68,0x75}, - {0x8a69,0x10}, - {0x8a6a,0x18}, - {0x8a6b,0x12}, - {0x8a6c,0x0b}, - {0x8a6d,0x5d}, - {0x8a6e,0x75}, - {0x8a6f,0x51}, - {0x8a70,0x0a}, - {0x8a71,0xaf}, - {0x8a72,0x51}, - {0x8a73,0x15}, - {0x8a74,0x51}, - {0x8a75,0xef}, - {0x8a76,0x70}, - {0x8a77,0xf9}, - {0x8a78,0xd2}, - {0x8a79,0x28}, - {0x8a7a,0x12}, - {0x8a7b,0x01}, - {0x8a7c,0x6c}, - {0x8a7d,0x12}, - {0x8a7e,0x02}, - {0x8a7f,0x2f}, - {0x8a80,0xaf}, - {0x8a81,0x51}, - {0x8a82,0x15}, - {0x8a83,0x51}, - {0x8a84,0xef}, - {0x8a85,0x70}, - {0x8a86,0xf9}, - {0x8a87,0xc2}, - {0x8a88,0x28}, - {0x8a89,0x12}, - {0x8a8a,0x01}, - {0x8a8b,0x6c}, - {0x8a8c,0x75}, - {0x8a8d,0x51}, - {0x8a8e,0x0a}, - {0x8a8f,0xaf}, - {0x8a90,0x51}, - {0x8a91,0x15}, - {0x8a92,0x51}, - {0x8a93,0xef}, - {0x8a94,0x70}, - {0x8a95,0xf9}, - {0x8a96,0x30}, - {0x8a97,0x11}, - {0x8a98,0x03}, - {0x8a99,0x02}, - {0x8a9a,0x0b}, - {0x8a9b,0x14}, - {0x8a9c,0x12}, - {0x8a9d,0x01}, - {0x8a9e,0x6a}, - {0x8a9f,0x12}, - {0x8aa0,0x02}, - {0x8aa1,0x12}, - {0x8aa2,0xe5}, - {0x8aa3,0x0d}, - {0x8aa4,0xf5}, - {0x8aa5,0x10}, - {0x8aa6,0x12}, - {0x8aa7,0x0b}, - {0x8aa8,0x5d}, - {0x8aa9,0x75}, - {0x8aaa,0x51}, - {0x8aab,0x0a}, - {0x8aac,0xaf}, - {0x8aad,0x51}, - {0x8aae,0x15}, - {0x8aaf,0x51}, - {0x8ab0,0xef}, - {0x8ab1,0x70}, - {0x8ab2,0xf9}, - {0x8ab3,0xd2}, - {0x8ab4,0x28}, - {0x8ab5,0x12}, - {0x8ab6,0x01}, - {0x8ab7,0x6c}, - {0x8ab8,0x12}, - {0x8ab9,0x02}, - {0x8aba,0x2f}, - {0x8abb,0xaf}, - {0x8abc,0x51}, - {0x8abd,0x15}, - {0x8abe,0x51}, - {0x8abf,0xef}, - {0x8ac0,0x70}, - {0x8ac1,0xf9}, - {0x8ac2,0xc2}, - {0x8ac3,0x28}, - {0x8ac4,0x12}, - {0x8ac5,0x01}, - {0x8ac6,0x6c}, - {0x8ac7,0x75}, - {0x8ac8,0x51}, - {0x8ac9,0x0a}, - {0x8aca,0xaf}, - {0x8acb,0x51}, - {0x8acc,0x15}, - {0x8acd,0x51}, - {0x8ace,0xef}, - {0x8acf,0x70}, - {0x8ad0,0xf9}, - {0x8ad1,0x30}, - {0x8ad2,0x11}, - {0x8ad3,0x04}, - {0x8ad4,0x15}, - {0x8ad5,0x0f}, - {0x8ad6,0x80}, - {0x8ad7,0x45}, - {0x8ad8,0x12}, - {0x8ad9,0x01}, - {0x8ada,0x6a}, - {0x8adb,0x12}, - {0x8adc,0x02}, - {0x8add,0x12}, - {0x8ade,0x85}, - {0x8adf,0x0e}, - {0x8ae0,0x10}, - {0x8ae1,0x12}, - {0x8ae2,0x15}, - {0x8ae3,0xa4}, - {0x8ae4,0xc2}, - {0x8ae5,0x09}, - {0x8ae6,0x12}, - {0x8ae7,0x02}, - {0x8ae8,0x14}, - {0x8ae9,0x75}, - {0x8aea,0x51}, - {0x8aeb,0x0a}, - {0x8aec,0xaf}, - {0x8aed,0x51}, - {0x8aee,0x15}, - {0x8aef,0x51}, - {0x8af0,0xef}, - {0x8af1,0x70}, - {0x8af2,0xf9}, - {0x8af3,0xd2}, - {0x8af4,0x28}, - {0x8af5,0x12}, - {0x8af6,0x01}, - {0x8af7,0x6c}, - {0x8af8,0x12}, - {0x8af9,0x02}, - {0x8afa,0x2f}, - {0x8afb,0xaf}, - {0x8afc,0x51}, - {0x8afd,0x15}, - {0x8afe,0x51}, - {0x8aff,0xef}, - {0x8b00,0x70}, - {0x8b01,0xf9}, - {0x8b02,0xc2}, - {0x8b03,0x28}, - {0x8b04,0x12}, - {0x8b05,0x01}, - {0x8b06,0x6c}, - {0x8b07,0x75}, - {0x8b08,0x51}, - {0x8b09,0x0a}, - {0x8b0a,0xaf}, - {0x8b0b,0x51}, - {0x8b0c,0x15}, - {0x8b0d,0x51}, - {0x8b0e,0xef}, - {0x8b0f,0x70}, - {0x8b10,0xf9}, - {0x8b11,0x30}, - {0x8b12,0x11}, - {0x8b13,0x06}, - {0x8b14,0x15}, - {0x8b15,0x0f}, - {0x8b16,0xd2}, - {0x8b17,0x33}, - {0x8b18,0x80}, - {0x8b19,0x03}, - {0x8b1a,0xe4}, - {0x8b1b,0xf5}, - {0x8b1c,0x0f}, - {0x8b1d,0x12}, - {0x8b1e,0x01}, - {0x8b1f,0x6a}, - {0x8b20,0x12}, - {0x8b21,0x02}, - {0x8b22,0x12}, - {0x8b23,0xc2}, - {0x8b24,0x29}, - {0x8b25,0x12}, - {0x8b26,0x01}, - {0x8b27,0x6c}, - {0x8b28,0x75}, - {0x8b29,0x51}, - {0x8b2a,0x05}, - {0x8b2b,0xaf}, - {0x8b2c,0x51}, - {0x8b2d,0x15}, - {0x8b2e,0x51}, - {0x8b2f,0xef}, - {0x8b30,0x70}, - {0x8b31,0xf9}, - {0x8b32,0xd2}, - {0x8b33,0x28}, - {0x8b34,0x12}, - {0x8b35,0x01}, - {0x8b36,0x6c}, - {0x8b37,0x75}, - {0x8b38,0x51}, - {0x8b39,0x05}, - {0x8b3a,0xaf}, - {0x8b3b,0x51}, - {0x8b3c,0x15}, - {0x8b3d,0x51}, - {0x8b3e,0xef}, - {0x8b3f,0x70}, - {0x8b40,0xf9}, - {0x8b41,0x12}, - {0x8b42,0x01}, - {0x8b43,0x6a}, - {0x8b44,0x75}, - {0x8b45,0x51}, - {0x8b46,0x05}, - {0x8b47,0xaf}, - {0x8b48,0x51}, - {0x8b49,0x15}, - {0x8b4a,0x51}, - {0x8b4b,0xef}, - {0x8b4c,0x70}, - {0x8b4d,0xf9}, - {0x8b4e,0xa2}, - {0x8b4f,0x32}, - {0x8b50,0x92}, - {0x8b51,0xaf}, - {0x8b52,0xe5}, - {0x8b53,0x0f}, - {0x8b54,0xd3}, - {0x8b55,0x94}, - {0x8b56,0x00}, - {0x8b57,0x40}, - {0x8b58,0x03}, - {0x8b59,0x02}, - {0x8b5a,0x0a}, - {0x8b5b,0x24}, - {0x8b5c,0x22}, - {0x8b5d,0x12}, - {0x8b5e,0x15}, - {0x8b5f,0xa4}, - {0x8b60,0xc2}, - {0x8b61,0x09}, - {0x8b62,0x90}, - {0x8b63,0x30}, - {0x8b64,0x18}, - {0x8b65,0xe5}, - {0x8b66,0x21}, - {0x8b67,0xf0}, - {0x8b68,0x22}, - {0x8b69,0xe5}, - {0x8b6a,0x33}, - {0x8b6b,0x70}, - {0x8b6c,0x03}, - {0x8b6d,0x02}, - {0x8b6e,0x0c}, - {0x8b6f,0xa3}, - {0x8b70,0xc2}, - {0x8b71,0xaf}, - {0x8b72,0xaf}, - {0x8b73,0x33}, - {0x8b74,0xe4}, - {0x8b75,0xf5}, - {0x8b76,0x33}, - {0x8b77,0xd2}, - {0x8b78,0xaf}, - {0x8b79,0x90}, - {0x8b7a,0x30}, - {0x8b7b,0x25}, - {0x8b7c,0xe0}, - {0x8b7d,0xf5}, - {0x8b7e,0x7e}, - {0x8b7f,0x90}, - {0x8b80,0x50}, - {0x8b81,0x82}, - {0x8b82,0xe0}, - {0x8b83,0xf5}, - {0x8b84,0x66}, - {0x8b85,0xa3}, - {0x8b86,0xe0}, - {0x8b87,0xf5}, - {0x8b88,0x67}, - {0x8b89,0xa3}, - {0x8b8a,0xe0}, - {0x8b8b,0xf5}, - {0x8b8c,0x68}, - {0x8b8d,0xa3}, - {0x8b8e,0xe0}, - {0x8b8f,0xf5}, - {0x8b90,0x69}, - {0x8b91,0xef}, - {0x8b92,0x12}, - {0x8b93,0x09}, - {0x8b94,0xf7}, - {0x8b95,0x0b}, - {0x8b96,0xbd}, - {0x8b97,0x03}, - {0x8b98,0x0b}, - {0x8b99,0xdb}, - {0x8b9a,0x04}, - {0x8b9b,0x0b}, - {0x8b9c,0xfc}, - {0x8b9d,0x05}, - {0x8b9e,0x0c}, - {0x8b9f,0x26}, - {0x8ba0,0x06}, - {0x8ba1,0x0c}, - {0x8ba2,0x14}, - {0x8ba3,0x08}, - {0x8ba4,0x0c}, - {0x8ba5,0x33}, - {0x8ba6,0x10}, - {0x8ba7,0x0c}, - {0x8ba8,0x47}, - {0x8ba9,0x12}, - {0x8baa,0x0c}, - {0x8bab,0x4c}, - {0x8bac,0x20}, - {0x8bad,0x0c}, - {0x8bae,0x5a}, - {0x8baf,0x21}, - {0x8bb0,0x0c}, - {0x8bb1,0x5f}, - {0x8bb2,0x30}, - {0x8bb3,0x0c}, - {0x8bb4,0x88}, - {0x8bb5,0x50}, - {0x8bb6,0x0c}, - {0x8bb7,0x6a}, - {0x8bb8,0xd8}, - {0x8bb9,0x00}, - {0x8bba,0x00}, - {0x8bbb,0x0c}, - {0x8bbc,0x95}, - {0x8bbd,0x20}, - {0x8bbe,0x05}, - {0x8bbf,0x03}, - {0x8bc0,0x02}, - {0x8bc1,0x0c}, - {0x8bc2,0x95}, - {0x8bc3,0x30}, - {0x8bc4,0x00}, - {0x8bc5,0x03}, - {0x8bc6,0x02}, - {0x8bc7,0x0c}, - {0x8bc8,0x95}, - {0x8bc9,0x20}, - {0x8bca,0x07}, - {0x8bcb,0x06}, - {0x8bcc,0x20}, - {0x8bcd,0x06}, - {0x8bce,0x03}, - {0x8bcf,0xc3}, - {0x8bd0,0x80}, - {0x8bd1,0x01}, - {0x8bd2,0xd3}, - {0x8bd3,0x92}, - {0x8bd4,0x36}, - {0x8bd5,0xd2}, - {0x8bd6,0x07}, - {0x8bd7,0xc2}, - {0x8bd8,0x06}, - {0x8bd9,0x80}, - {0x8bda,0x1c}, - {0x8bdb,0x20}, - {0x8bdc,0x05}, - {0x8bdd,0x03}, - {0x8bde,0x02}, - {0x8bdf,0x0c}, - {0x8be0,0x95}, - {0x8be1,0x30}, - {0x8be2,0x00}, - {0x8be3,0x03}, - {0x8be4,0x02}, - {0x8be5,0x0c}, - {0x8be6,0x95}, - {0x8be7,0x20}, - {0x8be8,0x07}, - {0x8be9,0x06}, - {0x8bea,0x20}, - {0x8beb,0x06}, - {0x8bec,0x03}, - {0x8bed,0xc3}, - {0x8bee,0x80}, - {0x8bef,0x01}, - {0x8bf0,0xd3}, - {0x8bf1,0x92}, - {0x8bf2,0x36}, - {0x8bf3,0xd2}, - {0x8bf4,0x07}, - {0x8bf5,0xd2}, - {0x8bf6,0x06}, - {0x8bf7,0x12}, - {0x8bf8,0x02}, - {0x8bf9,0x8a}, - {0x8bfa,0x80}, - {0x8bfb,0x24}, - {0x8bfc,0x20}, - {0x8bfd,0x05}, - {0x8bfe,0x03}, - {0x8bff,0x02}, - {0x8c00,0x0c}, - {0x8c01,0x95}, - {0x8c02,0x30}, - {0x8c03,0x00}, - {0x8c04,0x03}, - {0x8c05,0x02}, - {0x8c06,0x0c}, - {0x8c07,0x95}, - {0x8c08,0xc2}, - {0x8c09,0x07}, - {0x8c0a,0xd2}, - {0x8c0b,0x06}, - {0x8c0c,0x12}, - {0x8c0d,0x02}, - {0x8c0e,0x9b}, - {0x8c0f,0xc2}, - {0x8c10,0x04}, - {0x8c11,0x02}, - {0x8c12,0x0c}, - {0x8c13,0x95}, - {0x8c14,0x12}, - {0x8c15,0x02}, - {0x8c16,0x51}, - {0x8c17,0x30}, - {0x8c18,0x05}, - {0x8c19,0x06}, - {0x8c1a,0xe4}, - {0x8c1b,0xf5}, - {0x8c1c,0x0c}, - {0x8c1d,0x12}, - {0x8c1e,0x13}, - {0x8c1f,0x64}, - {0x8c20,0xc2}, - {0x8c21,0x31}, - {0x8c22,0xd2}, - {0x8c23,0x34}, - {0x8c24,0x80}, - {0x8c25,0x6f}, - {0x8c26,0x30}, - {0x8c27,0x07}, - {0x8c28,0x6c}, - {0x8c29,0x30}, - {0x8c2a,0x06}, - {0x8c2b,0x69}, - {0x8c2c,0x12}, - {0x8c2d,0x02}, - {0x8c2e,0x8a}, - {0x8c2f,0xd2}, - {0x8c30,0x31}, - {0x8c31,0x80}, - {0x8c32,0x62}, - {0x8c33,0x20}, - {0x8c34,0x07}, - {0x8c35,0x03}, - {0x8c36,0x30}, - {0x8c37,0x06}, - {0x8c38,0x09}, - {0x8c39,0xe5}, - {0x8c3a,0x7e}, - {0x8c3b,0x64}, - {0x8c3c,0x0e}, - {0x8c3d,0x70}, - {0x8c3e,0x56}, - {0x8c3f,0x20}, - {0x8c40,0x00}, - {0x8c41,0x53}, - {0x8c42,0x12}, - {0x8c43,0x05}, - {0x8c44,0x2f}, - {0x8c45,0x80}, - {0x8c46,0x4e}, - {0x8c47,0x12}, - {0x8c48,0x06}, - {0x8c49,0xf8}, - {0x8c4a,0x80}, - {0x8c4b,0x49}, - {0x8c4c,0x30}, - {0x8c4d,0x05}, - {0x8c4e,0x46}, - {0x8c4f,0x20}, - {0x8c50,0x07}, - {0x8c51,0x43}, - {0x8c52,0x20}, - {0x8c53,0x06}, - {0x8c54,0x40}, - {0x8c55,0x12}, - {0x8c56,0x16}, - {0x8c57,0xc4}, - {0x8c58,0x80}, - {0x8c59,0x3b}, - {0x8c5a,0x12}, - {0x8c5b,0x10}, - {0x8c5c,0xfe}, - {0x8c5d,0x80}, - {0x8c5e,0x36}, - {0x8c5f,0x20}, - {0x8c60,0x07}, - {0x8c61,0x33}, - {0x8c62,0x20}, - {0x8c63,0x06}, - {0x8c64,0x30}, - {0x8c65,0x12}, - {0x8c66,0x16}, - {0x8c67,0xd3}, - {0x8c68,0x80}, - {0x8c69,0x2b}, - {0x8c6a,0xe5}, - {0x8c6b,0x7e}, - {0x8c6c,0x64}, - {0x8c6d,0x01}, - {0x8c6e,0x70}, - {0x8c6f,0x25}, - {0x8c70,0xd2}, - {0x8c71,0x35}, - {0x8c72,0x90}, - {0x8c73,0x50}, - {0x8c74,0x82}, - {0x8c75,0xe5}, - {0x8c76,0x74}, - {0x8c77,0xf0}, - {0x8c78,0xa3}, - {0x8c79,0xe5}, - {0x8c7a,0x75}, - {0x8c7b,0xf0}, - {0x8c7c,0xa3}, - {0x8c7d,0xe5}, - {0x8c7e,0x76}, - {0x8c7f,0xf0}, - {0x8c80,0xa3}, - {0x8c81,0xe5}, - {0x8c82,0x77}, - {0x8c83,0xf0}, - {0x8c84,0xc2}, - {0x8c85,0x35}, - {0x8c86,0x80}, - {0x8c87,0x0d}, - {0x8c88,0x90}, - {0x8c89,0x50}, - {0x8c8a,0x82}, - {0x8c8b,0x30}, - {0x8c8c,0x33}, - {0x8c8d,0x05}, - {0x8c8e,0x74}, - {0x8c8f,0x55}, - {0x8c90,0xf0}, - {0x8c91,0x80}, - {0x8c92,0x02}, - {0x8c93,0xe4}, - {0x8c94,0xf0}, - {0x8c95,0x20}, - {0x8c96,0x07}, - {0x8c97,0x06}, - {0x8c98,0x30}, - {0x8c99,0x06}, - {0x8c9a,0x03}, - {0x8c9b,0x30}, - {0x8c9c,0x04}, - {0x8c9d,0x05}, - {0x8c9e,0x90}, - {0x8c9f,0x30}, - {0x8ca0,0x25}, - {0x8ca1,0xe4}, - {0x8ca2,0xf0}, - {0x8ca3,0x22}, - {0x8ca4,0xc0}, - {0x8ca5,0xe0}, - {0x8ca6,0xc0}, - {0x8ca7,0xf0}, - {0x8ca8,0xc0}, - {0x8ca9,0x83}, - {0x8caa,0xc0}, - {0x8cab,0x82}, - {0x8cac,0xc0}, - {0x8cad,0xd0}, - {0x8cae,0x75}, - {0x8caf,0xd0}, - {0x8cb0,0x00}, - {0x8cb1,0xc0}, - {0x8cb2,0x00}, - {0x8cb3,0xc0}, - {0x8cb4,0x01}, - {0x8cb5,0xc0}, - {0x8cb6,0x02}, - {0x8cb7,0xc0}, - {0x8cb8,0x03}, - {0x8cb9,0xc0}, - {0x8cba,0x04}, - {0x8cbb,0xc0}, - {0x8cbc,0x05}, - {0x8cbd,0xc0}, - {0x8cbe,0x06}, - {0x8cbf,0xc0}, - {0x8cc0,0x07}, - {0x8cc1,0x90}, - {0x8cc2,0x3f}, - {0x8cc3,0x0c}, - {0x8cc4,0xe0}, - {0x8cc5,0xf5}, - {0x8cc6,0x08}, - {0x8cc7,0xe5}, - {0x8cc8,0x08}, - {0x8cc9,0x20}, - {0x8cca,0xe3}, - {0x8ccb,0x03}, - {0x8ccc,0x02}, - {0x8ccd,0x0d}, - {0x8cce,0x55}, - {0x8ccf,0x30}, - {0x8cd0,0x35}, - {0x8cd1,0x03}, - {0x8cd2,0x02}, - {0x8cd3,0x0d}, - {0x8cd4,0x55}, - {0x8cd5,0x90}, - {0x8cd6,0x60}, - {0x8cd7,0x16}, - {0x8cd8,0xe0}, - {0x8cd9,0xf5}, - {0x8cda,0x6a}, - {0x8cdb,0xa3}, - {0x8cdc,0xe0}, - {0x8cdd,0xf5}, - {0x8cde,0x6b}, - {0x8cdf,0x90}, - {0x8ce0,0x60}, - {0x8ce1,0x1e}, - {0x8ce2,0xe0}, - {0x8ce3,0xf5}, - {0x8ce4,0x6c}, - {0x8ce5,0xa3}, - {0x8ce6,0xe0}, - {0x8ce7,0xf5}, - {0x8ce8,0x6d}, - {0x8ce9,0x90}, - {0x8cea,0x60}, - {0x8ceb,0x26}, - {0x8cec,0xe0}, - {0x8ced,0xf5}, - {0x8cee,0x6e}, - {0x8cef,0xa3}, - {0x8cf0,0xe0}, - {0x8cf1,0xf5}, - {0x8cf2,0x6f}, - {0x8cf3,0x90}, - {0x8cf4,0x60}, - {0x8cf5,0x2e}, - {0x8cf6,0xe0}, - {0x8cf7,0xf5}, - {0x8cf8,0x70}, - {0x8cf9,0xa3}, - {0x8cfa,0xe0}, - {0x8cfb,0xf5}, - {0x8cfc,0x71}, - {0x8cfd,0x90}, - {0x8cfe,0x60}, - {0x8cff,0x36}, - {0x8d00,0x12}, - {0x8d01,0x00}, - {0x8d02,0x16}, - {0x8d03,0x12}, - {0x8d04,0x01}, - {0x8d05,0xc9}, - {0x8d06,0x40}, - {0x8d07,0x06}, - {0x8d08,0x75}, - {0x8d09,0x2a}, - {0x8d0a,0xff}, - {0x8d0b,0x75}, - {0x8d0c,0x2b}, - {0x8d0d,0xff}, - {0x8d0e,0x85}, - {0x8d0f,0x2a}, - {0x8d10,0x74}, - {0x8d11,0x85}, - {0x8d12,0x2b}, - {0x8d13,0x75}, - {0x8d14,0x90}, - {0x8d15,0x60}, - {0x8d16,0x1a}, - {0x8d17,0xe0}, - {0x8d18,0xf5}, - {0x8d19,0x6a}, - {0x8d1a,0xa3}, - {0x8d1b,0xe0}, - {0x8d1c,0xf5}, - {0x8d1d,0x6b}, - {0x8d1e,0x90}, - {0x8d1f,0x60}, - {0x8d20,0x22}, - {0x8d21,0xe0}, - {0x8d22,0xf5}, - {0x8d23,0x6c}, - {0x8d24,0xa3}, - {0x8d25,0xe0}, - {0x8d26,0xf5}, - {0x8d27,0x6d}, - {0x8d28,0x90}, - {0x8d29,0x60}, - {0x8d2a,0x2a}, - {0x8d2b,0xe0}, - {0x8d2c,0xf5}, - {0x8d2d,0x6e}, - {0x8d2e,0xa3}, - {0x8d2f,0xe0}, - {0x8d30,0xf5}, - {0x8d31,0x6f}, - {0x8d32,0x90}, - {0x8d33,0x60}, - {0x8d34,0x32}, - {0x8d35,0xe0}, - {0x8d36,0xf5}, - {0x8d37,0x70}, - {0x8d38,0xa3}, - {0x8d39,0xe0}, - {0x8d3a,0xf5}, - {0x8d3b,0x71}, - {0x8d3c,0x90}, - {0x8d3d,0x60}, - {0x8d3e,0x3a}, - {0x8d3f,0x12}, - {0x8d40,0x00}, - {0x8d41,0x16}, - {0x8d42,0x12}, - {0x8d43,0x01}, - {0x8d44,0xc9}, - {0x8d45,0x40}, - {0x8d46,0x06}, - {0x8d47,0x75}, - {0x8d48,0x2a}, - {0x8d49,0xff}, - {0x8d4a,0x75}, - {0x8d4b,0x2b}, - {0x8d4c,0xff}, - {0x8d4d,0x85}, - {0x8d4e,0x2a}, - {0x8d4f,0x76}, - {0x8d50,0x85}, - {0x8d51,0x2b}, - {0x8d52,0x77}, - {0x8d53,0xd2}, - {0x8d54,0x3d}, - {0x8d55,0xe5}, - {0x8d56,0x08}, - {0x8d57,0x30}, - {0x8d58,0xe5}, - {0x8d59,0x44}, - {0x8d5a,0x90}, - {0x8d5b,0x56}, - {0x8d5c,0x90}, - {0x8d5d,0xe0}, - {0x8d5e,0xf5}, - {0x8d5f,0x55}, - {0x8d60,0xe5}, - {0x8d61,0x7b}, - {0x8d62,0x24}, - {0x8d63,0x02}, - {0x8d64,0xff}, - {0x8d65,0xe4}, - {0x8d66,0x33}, - {0x8d67,0xfe}, - {0x8d68,0xad}, - {0x8d69,0x55}, - {0x8d6a,0xc3}, - {0x8d6b,0xef}, - {0x8d6c,0x9d}, - {0x8d6d,0x74}, - {0x8d6e,0x80}, - {0x8d6f,0xf8}, - {0x8d70,0x6e}, - {0x8d71,0x98}, - {0x8d72,0x50}, - {0x8d73,0x02}, - {0x8d74,0x80}, - {0x8d75,0x01}, - {0x8d76,0xc3}, - {0x8d77,0x92}, - {0x8d78,0x27}, - {0x8d79,0xaf}, - {0x8d7a,0x55}, - {0x8d7b,0xef}, - {0x8d7c,0x24}, - {0x8d7d,0x02}, - {0x8d7e,0xff}, - {0x8d7f,0xe4}, - {0x8d80,0x33}, - {0x8d81,0xfe}, - {0x8d82,0xc3}, - {0x8d83,0xef}, - {0x8d84,0x95}, - {0x8d85,0x7b}, - {0x8d86,0x74}, - {0x8d87,0x80}, - {0x8d88,0xf8}, - {0x8d89,0x6e}, - {0x8d8a,0x98}, - {0x8d8b,0x50}, - {0x8d8c,0x02}, - {0x8d8d,0x80}, - {0x8d8e,0x02}, - {0x8d8f,0xa2}, - {0x8d90,0x27}, - {0x8d91,0x92}, - {0x8d92,0x27}, - {0x8d93,0x30}, - {0x8d94,0x27}, - {0x8d95,0x04}, - {0x8d96,0xaf}, - {0x8d97,0x55}, - {0x8d98,0x80}, - {0x8d99,0x02}, - {0x8d9a,0xaf}, - {0x8d9b,0x7b}, - {0x8d9c,0x8f}, - {0x8d9d,0x7b}, - {0x8d9e,0xe5}, - {0x8d9f,0x08}, - {0x8da0,0x30}, - {0x8da1,0xe1}, - {0x8da2,0x08}, - {0x8da3,0x90}, - {0x8da4,0x30}, - {0x8da5,0x24}, - {0x8da6,0xe0}, - {0x8da7,0xf5}, - {0x8da8,0x33}, - {0x8da9,0xe4}, - {0x8daa,0xf0}, - {0x8dab,0x90}, - {0x8dac,0x3f}, - {0x8dad,0x0c}, - {0x8dae,0xe5}, - {0x8daf,0x08}, - {0x8db0,0xf0}, - {0x8db1,0xd0}, - {0x8db2,0x07}, - {0x8db3,0xd0}, - {0x8db4,0x06}, - {0x8db5,0xd0}, - {0x8db6,0x05}, - {0x8db7,0xd0}, - {0x8db8,0x04}, - {0x8db9,0xd0}, - {0x8dba,0x03}, - {0x8dbb,0xd0}, - {0x8dbc,0x02}, - {0x8dbd,0xd0}, - {0x8dbe,0x01}, - {0x8dbf,0xd0}, - {0x8dc0,0x00}, - {0x8dc1,0xd0}, - {0x8dc2,0xd0}, - {0x8dc3,0xd0}, - {0x8dc4,0x82}, - {0x8dc5,0xd0}, - {0x8dc6,0x83}, - {0x8dc7,0xd0}, - {0x8dc8,0xf0}, - {0x8dc9,0xd0}, - {0x8dca,0xe0}, - {0x8dcb,0x32}, - {0x8dcc,0x30}, - {0x8dcd,0x04}, - {0x8dce,0x03}, - {0x8dcf,0x02}, - {0x8dd0,0x0e}, - {0x8dd1,0xac}, - {0x8dd2,0xd2}, - {0x8dd3,0x04}, - {0x8dd4,0xe5}, - {0x8dd5,0x7e}, - {0x8dd6,0xb4}, - {0x8dd7,0x01}, - {0x8dd8,0x06}, - {0x8dd9,0x12}, - {0x8dda,0x16}, - {0x8ddb,0xa4}, - {0x8ddc,0x02}, - {0x8ddd,0x0e}, - {0x8dde,0xa5}, - {0x8ddf,0xe5}, - {0x8de0,0x7e}, - {0x8de1,0xb4}, - {0x8de2,0x02}, - {0x8de3,0x06}, - {0x8de4,0x12}, - {0x8de5,0x16}, - {0x8de6,0xb5}, - {0x8de7,0x02}, - {0x8de8,0x0e}, - {0x8de9,0xa5}, - {0x8dea,0xe5}, - {0x8deb,0x7e}, - {0x8dec,0xb4}, - {0x8ded,0x03}, - {0x8dee,0x05}, - {0x8def,0xe4}, - {0x8df0,0xf5}, - {0x8df1,0x0c}, - {0x8df2,0x80}, - {0x8df3,0x08}, - {0x8df4,0xe5}, - {0x8df5,0x7e}, - {0x8df6,0xb4}, - {0x8df7,0x04}, - {0x8df8,0x09}, - {0x8df9,0x85}, - {0x8dfa,0x7c}, - {0x8dfb,0x0c}, - {0x8dfc,0x12}, - {0x8dfd,0x13}, - {0x8dfe,0x64}, - {0x8dff,0x02}, - {0x8e00,0x0e}, - {0x8e01,0xa5}, - {0x8e02,0xe5}, - {0x8e03,0x7e}, - {0x8e04,0x64}, - {0x8e05,0x0f}, - {0x8e06,0x70}, - {0x8e07,0x15}, - {0x8e08,0x12}, - {0x8e09,0x02}, - {0x8e0a,0xb3}, - {0x8e0b,0x40}, - {0x8e0c,0x06}, - {0x8e0d,0x7e}, - {0x8e0e,0x03}, - {0x8e0f,0x7f}, - {0x8e10,0xff}, - {0x8e11,0x80}, - {0x8e12,0x04}, - {0x8e13,0xae}, - {0x8e14,0x68}, - {0x8e15,0xaf}, - {0x8e16,0x69}, - {0x8e17,0x12}, - {0x8e18,0x0e}, - {0x8e19,0xad}, - {0x8e1a,0x02}, - {0x8e1b,0x0e}, - {0x8e1c,0xa5}, - {0x8e1d,0xe5}, - {0x8e1e,0x7e}, - {0x8e1f,0x64}, - {0x8e20,0x10}, - {0x8e21,0x60}, - {0x8e22,0x03}, - {0x8e23,0x02}, - {0x8e24,0x0e}, - {0x8e25,0xa5}, - {0x8e26,0xf5}, - {0x8e27,0x66}, - {0x8e28,0xf5}, - {0x8e29,0x67}, - {0x8e2a,0xf5}, - {0x8e2b,0x68}, - {0x8e2c,0xab}, - {0x8e2d,0x69}, - {0x8e2e,0xaa}, - {0x8e2f,0x68}, - {0x8e30,0xa9}, - {0x8e31,0x67}, - {0x8e32,0xa8}, - {0x8e33,0x66}, - {0x8e34,0x12}, - {0x8e35,0x01}, - {0x8e36,0x73}, - {0x8e37,0xfe}, - {0x8e38,0xe4}, - {0x8e39,0xfc}, - {0x8e3a,0xfd}, - {0x8e3b,0x12}, - {0x8e3c,0x01}, - {0x8e3d,0xf1}, - {0x8e3e,0xe4}, - {0x8e3f,0x7b}, - {0x8e40,0xff}, - {0x8e41,0xfa}, - {0x8e42,0xf9}, - {0x8e43,0xf8}, - {0x8e44,0x12}, - {0x8e45,0x02}, - {0x8e46,0x67}, - {0x8e47,0x12}, - {0x8e48,0x02}, - {0x8e49,0x39}, - {0x8e4a,0xe4}, - {0x8e4b,0x93}, - {0x8e4c,0xfe}, - {0x8e4d,0x74}, - {0x8e4e,0x01}, - {0x8e4f,0x93}, - {0x8e50,0xff}, - {0x8e51,0xe4}, - {0x8e52,0xfc}, - {0x8e53,0xfd}, - {0x8e54,0xe5}, - {0x8e55,0x69}, - {0x8e56,0x2f}, - {0x8e57,0xf5}, - {0x8e58,0x69}, - {0x8e59,0xe5}, - {0x8e5a,0x68}, - {0x8e5b,0x3e}, - {0x8e5c,0xf5}, - {0x8e5d,0x68}, - {0x8e5e,0xed}, - {0x8e5f,0x35}, - {0x8e60,0x67}, - {0x8e61,0xf5}, - {0x8e62,0x67}, - {0x8e63,0xec}, - {0x8e64,0x35}, - {0x8e65,0x66}, - {0x8e66,0xf5}, - {0x8e67,0x66}, - {0x8e68,0x12}, - {0x8e69,0x02}, - {0x8e6a,0xb3}, - {0x8e6b,0x40}, - {0x8e6c,0x06}, - {0x8e6d,0x7e}, - {0x8e6e,0x03}, - {0x8e6f,0x7f}, - {0x8e70,0xff}, - {0x8e71,0x80}, - {0x8e72,0x04}, - {0x8e73,0xae}, - {0x8e74,0x68}, - {0x8e75,0xaf}, - {0x8e76,0x69}, - {0x8e77,0x12}, - {0x8e78,0x0e}, - {0x8e79,0xad}, - {0x8e7a,0xe4}, - {0x8e7b,0xf5}, - {0x8e7c,0x67}, - {0x8e7d,0xf5}, - {0x8e7e,0x67}, - {0x8e7f,0xe5}, - {0x8e80,0x67}, - {0x8e81,0xd3}, - {0x8e82,0x95}, - {0x8e83,0x7c}, - {0x8e84,0x50}, - {0x8e85,0x1c}, - {0x8e86,0x12}, - {0x8e87,0x02}, - {0x8e88,0x39}, - {0x8e89,0xaf}, - {0x8e8a,0x67}, - {0x8e8b,0x75}, - {0x8e8c,0xf0}, - {0x8e8d,0x02}, - {0x8e8e,0xef}, - {0x8e8f,0x12}, - {0x8e90,0x09}, - {0x8e91,0xeb}, - {0x8e92,0xc3}, - {0x8e93,0x74}, - {0x8e94,0x01}, - {0x8e95,0x93}, - {0x8e96,0x95}, - {0x8e97,0x69}, - {0x8e98,0xe4}, - {0x8e99,0x93}, - {0x8e9a,0x95}, - {0x8e9b,0x68}, - {0x8e9c,0x50}, - {0x8e9d,0x04}, - {0x8e9e,0x05}, - {0x8e9f,0x67}, - {0x8ea0,0x80}, - {0x8ea1,0xdd}, - {0x8ea2,0x85}, - {0x8ea3,0x67}, - {0x8ea4,0x7d}, - {0x8ea5,0x90}, - {0x8ea6,0x30}, - {0x8ea7,0x25}, - {0x8ea8,0xe4}, - {0x8ea9,0xf0}, - {0x8eaa,0xd2}, - {0x8eab,0x34}, - {0x8eac,0x22}, - {0x8ead,0x8e}, - {0x8eae,0x68}, - {0x8eaf,0x8f}, - {0x8eb0,0x69}, - {0x8eb1,0x85}, - {0x8eb2,0x68}, - {0x8eb3,0x64}, - {0x8eb4,0x85}, - {0x8eb5,0x69}, - {0x8eb6,0x65}, - {0x8eb7,0xe5}, - {0x8eb8,0x69}, - {0x8eb9,0xc4}, - {0x8eba,0xf8}, - {0x8ebb,0x54}, - {0x8ebc,0x0f}, - {0x8ebd,0xc8}, - {0x8ebe,0x68}, - {0x8ebf,0xf5}, - {0x8ec0,0x69}, - {0x8ec1,0xe5}, - {0x8ec2,0x68}, - {0x8ec3,0xc4}, - {0x8ec4,0x54}, - {0x8ec5,0xf0}, - {0x8ec6,0x48}, - {0x8ec7,0xf5}, - {0x8ec8,0x68}, - {0x8ec9,0x85}, - {0x8eca,0x68}, - {0x8ecb,0x0d}, - {0x8ecc,0x85}, - {0x8ecd,0x69}, - {0x8ece,0x0e}, - {0x8ecf,0x12}, - {0x8ed0,0x0a}, - {0x8ed1,0x1d}, - {0x8ed2,0x22}, - {0x8ed3,0x12}, - {0x8ed4,0x02}, - {0x8ed5,0x7f}, - {0x8ed6,0xb5}, - {0x8ed7,0x07}, - {0x8ed8,0x03}, - {0x8ed9,0xd3}, - {0x8eda,0x80}, - {0x8edb,0x01}, - {0x8edc,0xc3}, - {0x8edd,0x40}, - {0x8ede,0x03}, - {0x8edf,0x02}, - {0x8ee0,0x0f}, - {0x8ee1,0x72}, - {0x8ee2,0x90}, - {0x8ee3,0x30}, - {0x8ee4,0x04}, - {0x8ee5,0xe0}, - {0x8ee6,0x44}, - {0x8ee7,0x20}, - {0x8ee8,0xf0}, - {0x8ee9,0xa3}, - {0x8eea,0xe0}, - {0x8eeb,0x44}, - {0x8eec,0x40}, - {0x8eed,0xf0}, - {0x8eee,0x90}, - {0x8eef,0x50}, - {0x8ef0,0x25}, - {0x8ef1,0xe0}, - {0x8ef2,0x44}, - {0x8ef3,0x04}, - {0x8ef4,0xf0}, - {0x8ef5,0x90}, - {0x8ef6,0x50}, - {0x8ef7,0x03}, - {0x8ef8,0xe0}, - {0x8ef9,0x54}, - {0x8efa,0xfd}, - {0x8efb,0xf0}, - {0x8efc,0x90}, - {0x8efd,0x50}, - {0x8efe,0x27}, - {0x8eff,0xe0}, - {0x8f00,0x44}, - {0x8f01,0x01}, - {0x8f02,0xf0}, - {0x8f03,0x90}, - {0x8f04,0x50}, - {0x8f05,0x31}, - {0x8f06,0xe4}, - {0x8f07,0xf0}, - {0x8f08,0x90}, - {0x8f09,0x50}, - {0x8f0a,0x33}, - {0x8f0b,0xf0}, - {0x8f0c,0x90}, - {0x8f0d,0x30}, - {0x8f0e,0x1e}, - {0x8f0f,0x12}, - {0x8f10,0x02}, - {0x8f11,0x05}, - {0x8f12,0x90}, - {0x8f13,0x30}, - {0x8f14,0x18}, - {0x8f15,0x12}, - {0x8f16,0x02}, - {0x8f17,0x05}, - {0x8f18,0x90}, - {0x8f19,0x30}, - {0x8f1a,0x1b}, - {0x8f1b,0x12}, - {0x8f1c,0x02}, - {0x8f1d,0x05}, - {0x8f1e,0xe0}, - {0x8f1f,0xf5}, - {0x8f20,0x25}, - {0x8f21,0x90}, - {0x8f22,0x30}, - {0x8f23,0x18}, - {0x8f24,0xe0}, - {0x8f25,0xf5}, - {0x8f26,0x21}, - {0x8f27,0x90}, - {0x8f28,0x60}, - {0x8f29,0x00}, - {0x8f2a,0x74}, - {0x8f2b,0xf5}, - {0x8f2c,0xf0}, - {0x8f2d,0x90}, - {0x8f2e,0x3f}, - {0x8f2f,0x01}, - {0x8f30,0xe4}, - {0x8f31,0xf0}, - {0x8f32,0xa3}, - {0x8f33,0xf0}, - {0x8f34,0x90}, - {0x8f35,0x3f}, - {0x8f36,0x01}, - {0x8f37,0xe0}, - {0x8f38,0x44}, - {0x8f39,0x08}, - {0x8f3a,0xf0}, - {0x8f3b,0xe0}, - {0x8f3c,0x44}, - {0x8f3d,0x20}, - {0x8f3e,0xf0}, - {0x8f3f,0x90}, - {0x8f40,0x3f}, - {0x8f41,0x05}, - {0x8f42,0x74}, - {0x8f43,0x30}, - {0x8f44,0xf0}, - {0x8f45,0xa3}, - {0x8f46,0x74}, - {0x8f47,0x24}, - {0x8f48,0xf0}, - {0x8f49,0x90}, - {0x8f4a,0x3f}, - {0x8f4b,0x0b}, - {0x8f4c,0xe0}, - {0x8f4d,0x44}, - {0x8f4e,0x0f}, - {0x8f4f,0xf0}, - {0x8f50,0x90}, - {0x8f51,0x3f}, - {0x8f52,0x01}, - {0x8f53,0xe0}, - {0x8f54,0x44}, - {0x8f55,0x02}, - {0x8f56,0xf0}, - {0x8f57,0xc2}, - {0x8f58,0x8c}, - {0x8f59,0x75}, - {0x8f5a,0x89}, - {0x8f5b,0x03}, - {0x8f5c,0x75}, - {0x8f5d,0xa8}, - {0x8f5e,0x07}, - {0x8f5f,0x75}, - {0x8f60,0xb8}, - {0x8f61,0x04}, - {0x8f62,0xe4}, - {0x8f63,0xf5}, - {0x8f64,0xd8}, - {0x8f65,0xf5}, - {0x8f66,0xe8}, - {0x8f67,0x90}, - {0x8f68,0x30}, - {0x8f69,0x01}, - {0x8f6a,0xe0}, - {0x8f6b,0x44}, - {0x8f6c,0x40}, - {0x8f6d,0xf0}, - {0x8f6e,0xe0}, - {0x8f6f,0x54}, - {0x8f70,0xbf}, - {0x8f71,0xf0}, - {0x8f72,0x22}, - {0x8f73,0x30}, - {0x8f74,0x3e}, - {0x8f75,0x09}, - {0x8f76,0x30}, - {0x8f77,0x20}, - {0x8f78,0x06}, - {0x8f79,0xae}, - {0x8f7a,0x56}, - {0x8f7b,0xaf}, - {0x8f7c,0x57}, - {0x8f7d,0x80}, - {0x8f7e,0x04}, - {0x8f7f,0xae}, - {0x8f80,0x6a}, - {0x8f81,0xaf}, - {0x8f82,0x6b}, - {0x8f83,0x8e}, - {0x8f84,0x56}, - {0x8f85,0x8f}, - {0x8f86,0x57}, - {0x8f87,0x30}, - {0x8f88,0x3e}, - {0x8f89,0x09}, - {0x8f8a,0x30}, - {0x8f8b,0x21}, - {0x8f8c,0x06}, - {0x8f8d,0xae}, - {0x8f8e,0x58}, - {0x8f8f,0xaf}, - {0x8f90,0x59}, - {0x8f91,0x80}, - {0x8f92,0x04}, - {0x8f93,0xae}, - {0x8f94,0x6c}, - {0x8f95,0xaf}, - {0x8f96,0x6d}, - {0x8f97,0x8e}, - {0x8f98,0x58}, - {0x8f99,0x8f}, - {0x8f9a,0x59}, - {0x8f9b,0x30}, - {0x8f9c,0x3e}, - {0x8f9d,0x09}, - {0x8f9e,0x30}, - {0x8f9f,0x22}, - {0x8fa0,0x06}, - {0x8fa1,0xae}, - {0x8fa2,0x5a}, - {0x8fa3,0xaf}, - {0x8fa4,0x5b}, - {0x8fa5,0x80}, - {0x8fa6,0x04}, - {0x8fa7,0xae}, - {0x8fa8,0x6e}, - {0x8fa9,0xaf}, - {0x8faa,0x6f}, - {0x8fab,0x8e}, - {0x8fac,0x5a}, - {0x8fad,0x8f}, - {0x8fae,0x5b}, - {0x8faf,0x30}, - {0x8fb0,0x3e}, - {0x8fb1,0x09}, - {0x8fb2,0x30}, - {0x8fb3,0x23}, - {0x8fb4,0x06}, - {0x8fb5,0xae}, - {0x8fb6,0x5c}, - {0x8fb7,0xaf}, - {0x8fb8,0x5d}, - {0x8fb9,0x80}, - {0x8fba,0x04}, - {0x8fbb,0xae}, - {0x8fbc,0x70}, - {0x8fbd,0xaf}, - {0x8fbe,0x71}, - {0x8fbf,0x8e}, - {0x8fc0,0x5c}, - {0x8fc1,0x8f}, - {0x8fc2,0x5d}, - {0x8fc3,0x30}, - {0x8fc4,0x3e}, - {0x8fc5,0x09}, - {0x8fc6,0x30}, - {0x8fc7,0x24}, - {0x8fc8,0x06}, - {0x8fc9,0xae}, - {0x8fca,0x5e}, - {0x8fcb,0xaf}, - {0x8fcc,0x5f}, - {0x8fcd,0x80}, - {0x8fce,0x04}, - {0x8fcf,0xae}, - {0x8fd0,0x72}, - {0x8fd1,0xaf}, - {0x8fd2,0x73}, - {0x8fd3,0x8e}, - {0x8fd4,0x5e}, - {0x8fd5,0x8f}, - {0x8fd6,0x5f}, - {0x8fd7,0x30}, - {0x8fd8,0x3e}, - {0x8fd9,0x09}, - {0x8fda,0x30}, - {0x8fdb,0x25}, - {0x8fdc,0x06}, - {0x8fdd,0xae}, - {0x8fde,0x60}, - {0x8fdf,0xaf}, - {0x8fe0,0x61}, - {0x8fe1,0x80}, - {0x8fe2,0x04}, - {0x8fe3,0xae}, - {0x8fe4,0x74}, - {0x8fe5,0xaf}, - {0x8fe6,0x75}, - {0x8fe7,0x8e}, - {0x8fe8,0x60}, - {0x8fe9,0x8f}, - {0x8fea,0x61}, - {0x8feb,0x30}, - {0x8fec,0x3e}, - {0x8fed,0x09}, - {0x8fee,0x30}, - {0x8fef,0x26}, - {0x8ff0,0x06}, - {0x8ff1,0xae}, - {0x8ff2,0x62}, - {0x8ff3,0xaf}, - {0x8ff4,0x63}, - {0x8ff5,0x80}, - {0x8ff6,0x04}, - {0x8ff7,0xae}, - {0x8ff8,0x76}, - {0x8ff9,0xaf}, - {0x8ffa,0x77}, - {0x8ffb,0x8e}, - {0x8ffc,0x62}, - {0x8ffd,0x8f}, - {0x8ffe,0x63}, - {0x8fff,0x22}, - {0x9000,0x30}, - {0x9001,0x36}, - {0x9002,0x4e}, - {0x9003,0x12}, - {0x9004,0x10}, - {0x9005,0x78}, - {0x9006,0xe5}, - {0x9007,0x32}, - {0x9008,0xd3}, - {0x9009,0x95}, - {0x900a,0x7d}, - {0x900b,0x40}, - {0x900c,0x0c}, - {0x900d,0xe5}, - {0x900e,0x32}, - {0x900f,0x04}, - {0x9010,0xf5}, - {0x9011,0x0c}, - {0x9012,0x12}, - {0x9013,0x13}, - {0x9014,0x64}, - {0x9015,0xd2}, - {0x9016,0x37}, - {0x9017,0x80}, - {0x9018,0x44}, - {0x9019,0xe5}, - {0x901a,0x7c}, - {0x901b,0xb5}, - {0x901c,0x7d}, - {0x901d,0x04}, - {0x901e,0x7f}, - {0x901f,0x01}, - {0x9020,0x80}, - {0x9021,0x02}, - {0x9022,0x7f}, - {0x9023,0x00}, - {0x9024,0xef}, - {0x9025,0x24}, - {0x9026,0xfb}, - {0x9027,0xd3}, - {0x9028,0x64}, - {0x9029,0x80}, - {0x902a,0xf8}, - {0x902b,0xe5}, - {0x902c,0x7d}, - {0x902d,0x64}, - {0x902e,0x80}, - {0x902f,0x98}, - {0x9030,0x40}, - {0x9031,0x12}, - {0x9032,0xc2}, - {0x9033,0x37}, - {0x9034,0xe5}, - {0x9035,0x7c}, - {0x9036,0xb5}, - {0x9037,0x7d}, - {0x9038,0x04}, - {0x9039,0x7f}, - {0x903a,0x01}, - {0x903b,0x80}, - {0x903c,0x02}, - {0x903d,0x7f}, - {0x903e,0x00}, - {0x903f,0xef}, - {0x9040,0x24}, - {0x9041,0xfa}, - {0x9042,0x80}, - {0x9043,0x06}, - {0x9044,0xd2}, - {0x9045,0x37}, - {0x9046,0xe5}, - {0x9047,0x7d}, - {0x9048,0x24}, - {0x9049,0x02}, - {0x904a,0xf5}, - {0x904b,0x0c}, - {0x904c,0x12}, - {0x904d,0x13}, - {0x904e,0x64}, - {0x904f,0x80}, - {0x9050,0x0c}, - {0x9051,0xe5}, - {0x9052,0x7d}, - {0x9053,0x70}, - {0x9054,0x0f}, - {0x9055,0x12}, - {0x9056,0x10}, - {0x9057,0x78}, - {0x9058,0xc2}, - {0x9059,0x03}, - {0x905a,0x12}, - {0x905b,0x16}, - {0x905c,0xa4}, - {0x905d,0xd2}, - {0x905e,0x02}, - {0x905f,0xd2}, - {0x9060,0x01}, - {0x9061,0xd2}, - {0x9062,0x00}, - {0x9063,0x22}, - {0x9064,0x30}, - {0x9065,0x03}, - {0x9066,0x08}, - {0x9067,0xc2}, - {0x9068,0x03}, - {0x9069,0xc2}, - {0x906a,0x04}, - {0x906b,0x12}, - {0x906c,0x02}, - {0x906d,0x9b}, - {0x906e,0x22}, - {0x906f,0xe4}, - {0x9070,0xf5}, - {0x9071,0x0c}, - {0x9072,0x12}, - {0x9073,0x13}, - {0x9074,0x64}, - {0x9075,0xd2}, - {0x9076,0x03}, - {0x9077,0x22}, - {0x9078,0x12}, - {0x9079,0x16}, - {0x907a,0x90}, - {0x907b,0xc2}, - {0x907c,0x3e}, - {0x907d,0x12}, - {0x907e,0x0f}, - {0x907f,0x73}, - {0x9080,0xc2}, - {0x9081,0x3e}, - {0x9082,0x12}, - {0x9083,0x13}, - {0x9084,0x01}, - {0x9085,0x22}, - {0x9086,0xd3}, - {0x9087,0xe5}, - {0x9088,0x57}, - {0x9089,0x95}, - {0x908a,0x6b}, - {0x908b,0xe5}, - {0x908c,0x56}, - {0x908d,0x95}, - {0x908e,0x6a}, - {0x908f,0x40}, - {0x9090,0x03}, - {0x9091,0xd3}, - {0x9092,0x80}, - {0x9093,0x01}, - {0x9094,0xc3}, - {0x9095,0x92}, - {0x9096,0x20}, - {0x9097,0xd3}, - {0x9098,0xe5}, - {0x9099,0x59}, - {0x909a,0x95}, - {0x909b,0x6d}, - {0x909c,0xe5}, - {0x909d,0x58}, - {0x909e,0x95}, - {0x909f,0x6c}, - {0x90a0,0x40}, - {0x90a1,0x03}, - {0x90a2,0xd3}, - {0x90a3,0x80}, - {0x90a4,0x01}, - {0x90a5,0xc3}, - {0x90a6,0x92}, - {0x90a7,0x21}, - {0x90a8,0xd3}, - {0x90a9,0xe5}, - {0x90aa,0x5b}, - {0x90ab,0x95}, - {0x90ac,0x6f}, - {0x90ad,0xe5}, - {0x90ae,0x5a}, - {0x90af,0x95}, - {0x90b0,0x6e}, - {0x90b1,0x40}, - {0x90b2,0x03}, - {0x90b3,0xd3}, - {0x90b4,0x80}, - {0x90b5,0x01}, - {0x90b6,0xc3}, - {0x90b7,0x92}, - {0x90b8,0x22}, - {0x90b9,0xd3}, - {0x90ba,0xe5}, - {0x90bb,0x5d}, - {0x90bc,0x95}, - {0x90bd,0x71}, - {0x90be,0xe5}, - {0x90bf,0x5c}, - {0x90c0,0x95}, - {0x90c1,0x70}, - {0x90c2,0x40}, - {0x90c3,0x03}, - {0x90c4,0xd3}, - {0x90c5,0x80}, - {0x90c6,0x01}, - {0x90c7,0xc3}, - {0x90c8,0x92}, - {0x90c9,0x23}, - {0x90ca,0xd3}, - {0x90cb,0xe5}, - {0x90cc,0x5f}, - {0x90cd,0x95}, - {0x90ce,0x73}, - {0x90cf,0xe5}, - {0x90d0,0x5e}, - {0x90d1,0x95}, - {0x90d2,0x72}, - {0x90d3,0x40}, - {0x90d4,0x03}, - {0x90d5,0xd3}, - {0x90d6,0x80}, - {0x90d7,0x01}, - {0x90d8,0xc3}, - {0x90d9,0x92}, - {0x90da,0x24}, - {0x90db,0xd3}, - {0x90dc,0xe5}, - {0x90dd,0x61}, - {0x90de,0x95}, - {0x90df,0x75}, - {0x90e0,0xe5}, - {0x90e1,0x60}, - {0x90e2,0x95}, - {0x90e3,0x74}, - {0x90e4,0x40}, - {0x90e5,0x03}, - {0x90e6,0xd3}, - {0x90e7,0x80}, - {0x90e8,0x01}, - {0x90e9,0xc3}, - {0x90ea,0x92}, - {0x90eb,0x25}, - {0x90ec,0xd3}, - {0x90ed,0xe5}, - {0x90ee,0x63}, - {0x90ef,0x95}, - {0x90f0,0x77}, - {0x90f1,0xe5}, - {0x90f2,0x62}, - {0x90f3,0x95}, - {0x90f4,0x76}, - {0x90f5,0x40}, - {0x90f6,0x03}, - {0x90f7,0xd3}, - {0x90f8,0x80}, - {0x90f9,0x01}, - {0x90fa,0xc3}, - {0x90fb,0x92}, - {0x90fc,0x26}, - {0x90fd,0x22}, - {0x90fe,0xe5}, - {0x90ff,0x7e}, - {0x9100,0x64}, - {0x9101,0x01}, - {0x9102,0x70}, - {0x9103,0x50}, - {0x9104,0x12}, - {0x9105,0x02}, - {0x9106,0x39}, - {0x9107,0xe5}, - {0x9108,0x7d}, - {0x9109,0x12}, - {0x910a,0x01}, - {0x910b,0x7b}, - {0x910c,0xfe}, - {0x910d,0xe4}, - {0x910e,0x8f}, - {0x910f,0x69}, - {0x9110,0x8e}, - {0x9111,0x68}, - {0x9112,0xf5}, - {0x9113,0x67}, - {0x9114,0xf5}, - {0x9115,0x66}, - {0x9116,0x12}, - {0x9117,0x01}, - {0x9118,0xfc}, - {0x9119,0x7b}, - {0x911a,0xff}, - {0x911b,0xfa}, - {0x911c,0xf9}, - {0x911d,0xf8}, - {0x911e,0x12}, - {0x911f,0x01}, - {0x9120,0xf1}, - {0x9121,0xc0}, - {0x9122,0x04}, - {0x9123,0xc0}, - {0x9124,0x05}, - {0x9125,0xc0}, - {0x9126,0x06}, - {0x9127,0xc0}, - {0x9128,0x07}, - {0x9129,0x12}, - {0x912a,0x01}, - {0x912b,0x73}, - {0x912c,0xab}, - {0x912d,0x07}, - {0x912e,0xfa}, - {0x912f,0xe4}, - {0x9130,0xf9}, - {0x9131,0xf8}, - {0x9132,0xd0}, - {0x9133,0x07}, - {0x9134,0xd0}, - {0x9135,0x06}, - {0x9136,0xd0}, - {0x9137,0x05}, - {0x9138,0xd0}, - {0x9139,0x04}, - {0x913a,0x12}, - {0x913b,0x02}, - {0x913c,0x67}, - {0x913d,0x85}, - {0x913e,0x69}, - {0x913f,0x66}, - {0x9140,0x85}, - {0x9141,0x7d}, - {0x9142,0x67}, - {0x9143,0x12}, - {0x9144,0x02}, - {0x9145,0x39}, - {0x9146,0xe5}, - {0x9147,0x7d}, - {0x9148,0x12}, - {0x9149,0x02}, - {0x914a,0x95}, - {0x914b,0xe4}, - {0x914c,0x93}, - {0x914d,0xf5}, - {0x914e,0x68}, - {0x914f,0x74}, - {0x9150,0x01}, - {0x9151,0x93}, - {0x9152,0xf5}, - {0x9153,0x69}, - {0x9154,0x90}, - {0x9155,0x50}, - {0x9156,0x82}, - {0x9157,0xe5}, - {0x9158,0x66}, - {0x9159,0xf0}, - {0x915a,0xa3}, - {0x915b,0xe5}, - {0x915c,0x67}, - {0x915d,0xf0}, - {0x915e,0xa3}, - {0x915f,0xe5}, - {0x9160,0x68}, - {0x9161,0xf0}, - {0x9162,0xa3}, - {0x9163,0xe5}, - {0x9164,0x69}, - {0x9165,0xf0}, - {0x9166,0x22}, - {0x9167,0x56}, - {0x9168,0x0c}, - {0x9169,0x04}, - {0x916a,0x00}, - {0x916b,0x00}, - {0x916c,0x00}, - {0x916d,0xc8}, - {0x916e,0x01}, - {0x916f,0x2c}, - {0x9170,0x01}, - {0x9171,0x5e}, - {0x9172,0x01}, - {0x9173,0x8b}, - {0x9174,0x01}, - {0x9175,0xb8}, - {0x9176,0x01}, - {0x9177,0xe5}, - {0x9178,0x02}, - {0x9179,0x12}, - {0x917a,0x02}, - {0x917b,0x3f}, - {0x917c,0x02}, - {0x917d,0x6c}, - {0x917e,0x02}, - {0x917f,0x99}, - {0x9180,0x02}, - {0x9181,0xc6}, - {0x9182,0x02}, - {0x9183,0xf3}, - {0x9184,0x07}, - {0x9185,0x20}, - {0x9186,0x12}, - {0x9187,0x28}, - {0x9188,0x1e}, - {0x9189,0x18}, - {0x918a,0x18}, - {0x918b,0x28}, - {0x918c,0x1e}, - {0x918d,0x18}, - {0x918e,0x12}, - {0x918f,0x28}, - {0x9190,0x1e}, - {0x9191,0x18}, - {0x9192,0x12}, - {0x9193,0x28}, - {0x9194,0x18}, - {0x9195,0x18}, - {0x9196,0x12}, - {0x9197,0x20}, - {0x9198,0x18}, - {0x9199,0x28}, - {0x919a,0x1c}, - {0x919b,0x30}, - {0x919c,0x24}, - {0x919d,0x10}, - {0x919e,0x1c}, - {0x919f,0x18}, - {0x91a0,0x24}, - {0x91a1,0x1c}, - {0x91a2,0x14}, - {0x91a3,0x24}, - {0x91a4,0x1c}, - {0x91a5,0x28}, - {0x91a6,0x0c}, - {0x91a7,0x30}, - {0x91a8,0x14}, - {0x91a9,0x10}, - {0x91aa,0x0c}, - {0x91ab,0x18}, - {0x91ac,0x14}, - {0x91ad,0x1c}, - {0x91ae,0x20}, - {0x91af,0x24}, - {0x91b0,0x28}, - {0x91b1,0x0c}, - {0x91b2,0x14}, - {0x91b3,0x14}, - {0x91b4,0x1c}, - {0x91b5,0x1c}, - {0x91b6,0x14}, - {0x91b7,0x24}, - {0x91b8,0x1c}, - {0x91b9,0x2c}, - {0x91ba,0x14}, - {0x91bb,0x34}, - {0x91bc,0x1c}, - {0x91bd,0x1c}, - {0x91be,0x08}, - {0x91bf,0x24}, - {0x91c0,0x10}, - {0x91c1,0x19}, - {0x91c2,0x19}, - {0x91c3,0x1c}, - {0x91c4,0x19}, - {0x91c5,0x19}, - {0x91c6,0x10}, - {0x91c7,0x10}, - {0x91c8,0x10}, - {0x91c9,0x10}, - {0x91ca,0x10}, - {0x91cb,0x00}, - {0x91cc,0x00}, - {0x91cd,0x00}, - {0x91ce,0x00}, - {0x91cf,0x00}, - {0x91d0,0x12}, - {0x91d1,0x10}, - {0x91d2,0x86}, - {0x91d3,0x30}, - {0x91d4,0x36}, - {0x91d5,0x40}, - {0x91d6,0xe5}, - {0x91d7,0x24}, - {0x91d8,0x54}, - {0x91d9,0x1f}, - {0x91da,0xff}, - {0x91db,0x60}, - {0x91dc,0x0e}, - {0x91dd,0x64}, - {0x91de,0x1f}, - {0x91df,0x60}, - {0x91e0,0x0a}, - {0x91e1,0xe5}, - {0x91e2,0x7c}, - {0x91e3,0x65}, - {0x91e4,0x7d}, - {0x91e5,0x60}, - {0x91e6,0x04}, - {0x91e7,0xe5}, - {0x91e8,0x7d}, - {0x91e9,0x70}, - {0x91ea,0x18}, - {0x91eb,0xbf}, - {0x91ec,0x1f}, - {0x91ed,0x02}, - {0x91ee,0xb2}, - {0x91ef,0x37}, - {0x91f0,0xe5}, - {0x91f1,0x7c}, - {0x91f2,0xb5}, - {0x91f3,0x7d}, - {0x91f4,0x02}, - {0x91f5,0xc2}, - {0x91f6,0x37}, - {0x91f7,0xe5}, - {0x91f8,0x7d}, - {0x91f9,0x70}, - {0x91fa,0x02}, - {0x91fb,0xd2}, - {0x91fc,0x37}, - {0x91fd,0xc2}, - {0x91fe,0x02}, - {0x91ff,0xd2}, - {0x9200,0x01}, - {0x9201,0xd2}, - {0x9202,0x00}, - {0x9203,0xc2}, - {0x9204,0x3e}, - {0x9205,0x12}, - {0x9206,0x0f}, - {0x9207,0x73}, - {0x9208,0xc2}, - {0x9209,0x3e}, - {0x920a,0x12}, - {0x920b,0x13}, - {0x920c,0x01}, - {0x920d,0x30}, - {0x920e,0x37}, - {0x920f,0x03}, - {0x9210,0x02}, - {0x9211,0x16}, - {0x9212,0xa4}, - {0x9213,0x02}, - {0x9214,0x16}, - {0x9215,0xb5}, - {0x9216,0xd2}, - {0x9217,0x3e}, - {0x9218,0x12}, - {0x9219,0x0f}, - {0x921a,0x73}, - {0x921b,0xd2}, - {0x921c,0x3e}, - {0x921d,0x12}, - {0x921e,0x13}, - {0x921f,0x01}, - {0x9220,0x12}, - {0x9221,0x16}, - {0x9222,0xa4}, - {0x9223,0xe5}, - {0x9224,0x32}, - {0x9225,0xd3}, - {0x9226,0x95}, - {0x9227,0x7d}, - {0x9228,0x40}, - {0x9229,0x05}, - {0x922a,0xe4}, - {0x922b,0x95}, - {0x922c,0x7d}, - {0x922d,0x40}, - {0x922e,0x06}, - {0x922f,0xc2}, - {0x9230,0x02}, - {0x9231,0xd2}, - {0x9232,0x01}, - {0x9233,0xd2}, - {0x9234,0x00}, - {0x9235,0x22}, - {0x9236,0x12}, - {0x9237,0x10}, - {0x9238,0x86}, - {0x9239,0xc3}, - {0x923a,0x30}, - {0x923b,0x25}, - {0x923c,0x0c}, - {0x923d,0xe5}, - {0x923e,0x61}, - {0x923f,0x95}, - {0x9240,0x75}, - {0x9241,0xff}, - {0x9242,0xe5}, - {0x9243,0x60}, - {0x9244,0x95}, - {0x9245,0x74}, - {0x9246,0xfe}, - {0x9247,0x80}, - {0x9248,0x0a}, - {0x9249,0xe5}, - {0x924a,0x75}, - {0x924b,0x95}, - {0x924c,0x61}, - {0x924d,0xff}, - {0x924e,0xe5}, - {0x924f,0x74}, - {0x9250,0x95}, - {0x9251,0x60}, - {0x9252,0xfe}, - {0x9253,0x8e}, - {0x9254,0x0a}, - {0x9255,0x8f}, - {0x9256,0x0b}, - {0x9257,0x30}, - {0x9258,0x03}, - {0x9259,0x26}, - {0x925a,0x12}, - {0x925b,0x02}, - {0x925c,0xa9}, - {0x925d,0x50}, - {0x925e,0x03}, - {0x925f,0x30}, - {0x9260,0x27}, - {0x9261,0x07}, - {0x9262,0xc2}, - {0x9263,0x3e}, - {0x9264,0x12}, - {0x9265,0x0f}, - {0x9266,0x73}, - {0x9267,0x80}, - {0x9268,0x2f}, - {0x9269,0x05}, - {0x926a,0x31}, - {0x926b,0xe5}, - {0x926c,0x31}, - {0x926d,0xd3}, - {0x926e,0x94}, - {0x926f,0x02}, - {0x9270,0x40}, - {0x9271,0x29}, - {0x9272,0xe4}, - {0x9273,0xf5}, - {0x9274,0x31}, - {0x9275,0xc2}, - {0x9276,0x03}, - {0x9277,0xc2}, - {0x9278,0x02}, - {0x9279,0xc2}, - {0x927a,0x01}, - {0x927b,0xd2}, - {0x927c,0x00}, - {0x927d,0xd2}, - {0x927e,0x34}, - {0x927f,0x22}, - {0x9280,0x12}, - {0x9281,0x02}, - {0x9282,0xa9}, - {0x9283,0x50}, - {0x9284,0x03}, - {0x9285,0x30}, - {0x9286,0x27}, - {0x9287,0x04}, - {0x9288,0x05}, - {0x9289,0x31}, - {0x928a,0x80}, - {0x928b,0x03}, - {0x928c,0xe4}, - {0x928d,0xf5}, - {0x928e,0x31}, - {0x928f,0xe5}, - {0x9290,0x31}, - {0x9291,0xd3}, - {0x9292,0x94}, - {0x9293,0x02}, - {0x9294,0x40}, - {0x9295,0x05}, - {0x9296,0xd2}, - {0x9297,0x03}, - {0x9298,0xe4}, - {0x9299,0xf5}, - {0x929a,0x31}, - {0x929b,0x22}, - {0x929c,0xe5}, - {0x929d,0x0a}, - {0x929e,0x70}, - {0x929f,0x04}, - {0x92a0,0x7a}, - {0x92a1,0x11}, - {0x92a2,0x7b}, - {0x92a3,0x85}, - {0x92a4,0xe5}, - {0x92a5,0x0a}, - {0x92a6,0xb4}, - {0x92a7,0x01}, - {0x92a8,0x04}, - {0x92a9,0x7a}, - {0x92aa,0x11}, - {0x92ab,0x7b}, - {0x92ac,0x99}, - {0x92ad,0xe5}, - {0x92ae,0x0a}, - {0x92af,0xb4}, - {0x92b0,0x02}, - {0x92b1,0x04}, - {0x92b2,0x7a}, - {0x92b3,0x11}, - {0x92b4,0x7b}, - {0x92b5,0xad}, - {0x92b6,0x8b}, - {0x92b7,0x82}, - {0x92b8,0x8a}, - {0x92b9,0x83}, - {0x92ba,0x12}, - {0x92bb,0x09}, - {0x92bc,0xdb}, - {0x92bd,0x8f}, - {0x92be,0x37}, - {0x92bf,0x8e}, - {0x92c0,0x36}, - {0x92c1,0x8d}, - {0x92c2,0x35}, - {0x92c3,0x8c}, - {0x92c4,0x34}, - {0x92c5,0xe5}, - {0x92c6,0x82}, - {0x92c7,0x24}, - {0x92c8,0x04}, - {0x92c9,0xf5}, - {0x92ca,0x82}, - {0x92cb,0xe4}, - {0x92cc,0x35}, - {0x92cd,0x83}, - {0x92ce,0xf5}, - {0x92cf,0x83}, - {0x92d0,0x12}, - {0x92d1,0x09}, - {0x92d2,0xdb}, - {0x92d3,0x8f}, - {0x92d4,0x3b}, - {0x92d5,0x8e}, - {0x92d6,0x3a}, - {0x92d7,0x8d}, - {0x92d8,0x39}, - {0x92d9,0x8c}, - {0x92da,0x38}, - {0x92db,0xeb}, - {0x92dc,0x24}, - {0x92dd,0x08}, - {0x92de,0x12}, - {0x92df,0x02}, - {0x92e0,0x40}, - {0x92e1,0x12}, - {0x92e2,0x01}, - {0x92e3,0xc0}, - {0x92e4,0xeb}, - {0x92e5,0x24}, - {0x92e6,0x0c}, - {0x92e7,0x12}, - {0x92e8,0x02}, - {0x92e9,0x40}, - {0x92ea,0x8f}, - {0x92eb,0x43}, - {0x92ec,0x8e}, - {0x92ed,0x42}, - {0x92ee,0x8d}, - {0x92ef,0x41}, - {0x92f0,0x8c}, - {0x92f1,0x40}, - {0x92f2,0xeb}, - {0x92f3,0x24}, - {0x92f4,0x10}, - {0x92f5,0x12}, - {0x92f6,0x02}, - {0x92f7,0x40}, - {0x92f8,0x8f}, - {0x92f9,0x47}, - {0x92fa,0x8e}, - {0x92fb,0x46}, - {0x92fc,0x8d}, - {0x92fd,0x45}, - {0x92fe,0x8c}, - {0x92ff,0x44}, - {0x9300,0x22}, - {0x9301,0x30}, - {0x9302,0x3e}, - {0x9303,0x07}, - {0x9304,0x30}, - {0x9305,0x20}, - {0x9306,0x04}, - {0x9307,0xaf}, - {0x9308,0x4a}, - {0x9309,0x80}, - {0x930a,0x02}, - {0x930b,0xaf}, - {0x930c,0x7d}, - {0x930d,0x8f}, - {0x930e,0x4a}, - {0x930f,0x30}, - {0x9310,0x3e}, - {0x9311,0x07}, - {0x9312,0x30}, - {0x9313,0x21}, - {0x9314,0x04}, - {0x9315,0xaf}, - {0x9316,0x4b}, - {0x9317,0x80}, - {0x9318,0x02}, - {0x9319,0xaf}, - {0x931a,0x7d}, - {0x931b,0x8f}, - {0x931c,0x4b}, - {0x931d,0x30}, - {0x931e,0x3e}, - {0x931f,0x07}, - {0x9320,0x30}, - {0x9321,0x22}, - {0x9322,0x04}, - {0x9323,0xaf}, - {0x9324,0x4c}, - {0x9325,0x80}, - {0x9326,0x02}, - {0x9327,0xaf}, - {0x9328,0x7d}, - {0x9329,0x8f}, - {0x932a,0x4c}, - {0x932b,0x30}, - {0x932c,0x3e}, - {0x932d,0x07}, - {0x932e,0x30}, - {0x932f,0x23}, - {0x9330,0x04}, - {0x9331,0xaf}, - {0x9332,0x4d}, - {0x9333,0x80}, - {0x9334,0x02}, - {0x9335,0xaf}, - {0x9336,0x7d}, - {0x9337,0x8f}, - {0x9338,0x4d}, - {0x9339,0x30}, - {0x933a,0x3e}, - {0x933b,0x07}, - {0x933c,0x30}, - {0x933d,0x24}, - {0x933e,0x04}, - {0x933f,0xaf}, - {0x9340,0x4e}, - {0x9341,0x80}, - {0x9342,0x02}, - {0x9343,0xaf}, - {0x9344,0x7d}, - {0x9345,0x8f}, - {0x9346,0x4e}, - {0x9347,0x30}, - {0x9348,0x3e}, - {0x9349,0x07}, - {0x934a,0x30}, - {0x934b,0x25}, - {0x934c,0x04}, - {0x934d,0xaf}, - {0x934e,0x4f}, - {0x934f,0x80}, - {0x9350,0x02}, - {0x9351,0xaf}, - {0x9352,0x7d}, - {0x9353,0x8f}, - {0x9354,0x4f}, - {0x9355,0x30}, - {0x9356,0x3e}, - {0x9357,0x07}, - {0x9358,0x30}, - {0x9359,0x26}, - {0x935a,0x04}, - {0x935b,0xaf}, - {0x935c,0x50}, - {0x935d,0x80}, - {0x935e,0x02}, - {0x935f,0xaf}, - {0x9360,0x7d}, - {0x9361,0x8f}, - {0x9362,0x50}, - {0x9363,0x22}, - {0x9364,0xe5}, - {0x9365,0x0c}, - {0x9366,0xd3}, - {0x9367,0x95}, - {0x9368,0x7c}, - {0x9369,0x40}, - {0x936a,0x01}, - {0x936b,0x22}, - {0x936c,0x12}, - {0x936d,0x02}, - {0x936e,0x39}, - {0x936f,0xe5}, - {0x9370,0x0c}, - {0x9371,0x12}, - {0x9372,0x02}, - {0x9373,0x95}, - {0x9374,0xe4}, - {0x9375,0x93}, - {0x9376,0xfe}, - {0x9377,0x74}, - {0x9378,0x01}, - {0x9379,0x93}, - {0x937a,0xff}, - {0x937b,0x4e}, - {0x937c,0x60}, - {0x937d,0x21}, - {0x937e,0x8e}, - {0x937f,0x64}, - {0x9380,0x8f}, - {0x9381,0x65}, - {0x9382,0xef}, - {0x9383,0xc4}, - {0x9384,0xf8}, - {0x9385,0x54}, - {0x9386,0x0f}, - {0x9387,0xc8}, - {0x9388,0x68}, - {0x9389,0xff}, - {0x938a,0xee}, - {0x938b,0xc4}, - {0x938c,0x54}, - {0x938d,0xf0}, - {0x938e,0x48}, - {0x938f,0xfe}, - {0x9390,0x43}, - {0x9391,0x07}, - {0x9392,0x0d}, - {0x9393,0x8e}, - {0x9394,0x0d}, - {0x9395,0x8f}, - {0x9396,0x0e}, - {0x9397,0x12}, - {0x9398,0x0a}, - {0x9399,0x1d}, - {0x939a,0x30}, - {0x939b,0x33}, - {0x939c,0x22}, - {0x939d,0xc3}, - {0x939e,0x22}, - {0x939f,0x75}, - {0x93a0,0x0d}, - {0x93a1,0x00}, - {0x93a2,0x75}, - {0x93a3,0x0e}, - {0x93a4,0x0d}, - {0x93a5,0x12}, - {0x93a6,0x0a}, - {0x93a7,0x1d}, - {0x93a8,0x30}, - {0x93a9,0x33}, - {0x93aa,0x02}, - {0x93ab,0xc3}, - {0x93ac,0x22}, - {0x93ad,0x75}, - {0x93ae,0x0d}, - {0x93af,0x00}, - {0x93b0,0x75}, - {0x93b1,0x0e}, - {0x93b2,0x64}, - {0x93b3,0x12}, - {0x93b4,0x16}, - {0x93b5,0x3d}, - {0x93b6,0x75}, - {0x93b7,0x0d}, - {0x93b8,0x80}, - {0x93b9,0x75}, - {0x93ba,0x0e}, - {0x93bb,0x00}, - {0x93bc,0x12}, - {0x93bd,0x0a}, - {0x93be,0x1d}, - {0x93bf,0x85}, - {0x93c0,0x0c}, - {0x93c1,0x7d}, - {0x93c2,0xd3}, - {0x93c3,0x22}, - {0x93c4,0x12}, - {0x93c5,0x10}, - {0x93c6,0x86}, - {0x93c7,0xd2}, - {0x93c8,0x3e}, - {0x93c9,0x12}, - {0x93ca,0x0f}, - {0x93cb,0x73}, - {0x93cc,0xd2}, - {0x93cd,0x3e}, - {0x93ce,0x12}, - {0x93cf,0x13}, - {0x93d0,0x01}, - {0x93d1,0x30}, - {0x93d2,0x36}, - {0x93d3,0x26}, - {0x93d4,0x30}, - {0x93d5,0x37}, - {0x93d6,0x06}, - {0x93d7,0xe5}, - {0x93d8,0x7c}, - {0x93d9,0x65}, - {0x93da,0x7d}, - {0x93db,0x60}, - {0x93dc,0x3e}, - {0x93dd,0x20}, - {0x93de,0x37}, - {0x93df,0x04}, - {0x93e0,0xe5}, - {0x93e1,0x7d}, - {0x93e2,0x60}, - {0x93e3,0x37}, - {0x93e4,0xe5}, - {0x93e5,0x24}, - {0x93e6,0x54}, - {0x93e7,0x1f}, - {0x93e8,0xff}, - {0x93e9,0xbf}, - {0x93ea,0x1f}, - {0x93eb,0x06}, - {0x93ec,0x30}, - {0x93ed,0x25}, - {0x93ee,0x03}, - {0x93ef,0x20}, - {0x93f0,0x26}, - {0x93f1,0x29}, - {0x93f2,0x30}, - {0x93f3,0x37}, - {0x93f4,0x02}, - {0x93f5,0x80}, - {0x93f6,0x21}, - {0x93f7,0x02}, - {0x93f8,0x16}, - {0x93f9,0xb5}, - {0x93fa,0xe5}, - {0x93fb,0x7c}, - {0x93fc,0xd3}, - {0x93fd,0x95}, - {0x93fe,0x7d}, - {0x93ff,0x40}, - {0x9400,0x03}, - {0x9401,0xd3}, - {0x9402,0x80}, - {0x9403,0x01}, - {0x9404,0xc3}, - {0x9405,0x50}, - {0x9406,0x14}, - {0x9407,0x20}, - {0x9408,0x39}, - {0x9409,0x0e}, - {0x940a,0xe5}, - {0x940b,0x24}, - {0x940c,0x54}, - {0x940d,0x1f}, - {0x940e,0xff}, - {0x940f,0xbf}, - {0x9410,0x1f}, - {0x9411,0x06}, - {0x9412,0x30}, - {0x9413,0x25}, - {0x9414,0x03}, - {0x9415,0x20}, - {0x9416,0x26}, - {0x9417,0x03}, - {0x9418,0x02}, - {0x9419,0x16}, - {0x941a,0xa4}, - {0x941b,0x12}, - {0x941c,0x02}, - {0x941d,0xbd}, - {0x941e,0x22}, - {0x941f,0xc2}, - {0x9420,0x34}, - {0x9421,0x20}, - {0x9422,0x05}, - {0x9423,0x05}, - {0x9424,0x75}, - {0x9425,0x0a}, - {0x9426,0xee}, - {0x9427,0x80}, - {0x9428,0x36}, - {0x9429,0x20}, - {0x942a,0x07}, - {0x942b,0x08}, - {0x942c,0x20}, - {0x942d,0x06}, - {0x942e,0x05}, - {0x942f,0xe4}, - {0x9430,0xf5}, - {0x9431,0x0a}, - {0x9432,0x80}, - {0x9433,0x2b}, - {0x9434,0x20}, - {0x9435,0x07}, - {0x9436,0x08}, - {0x9437,0x30}, - {0x9438,0x06}, - {0x9439,0x05}, - {0x943a,0x75}, - {0x943b,0x0a}, - {0x943c,0x20}, - {0x943d,0x80}, - {0x943e,0x20}, - {0x943f,0x30}, - {0x9440,0x00}, - {0x9441,0x05}, - {0x9442,0x75}, - {0x9443,0x0a}, - {0x9444,0x01}, - {0x9445,0x80}, - {0x9446,0x18}, - {0x9447,0xe5}, - {0x9448,0x20}, - {0x9449,0x54}, - {0x944a,0x07}, - {0x944b,0xff}, - {0x944c,0xbf}, - {0x944d,0x06}, - {0x944e,0x0d}, - {0x944f,0x30}, - {0x9450,0x31}, - {0x9451,0x04}, - {0x9452,0x7f}, - {0x9453,0x12}, - {0x9454,0x80}, - {0x9455,0x02}, - {0x9456,0x7f}, - {0x9457,0x02}, - {0x9458,0x8f}, - {0x9459,0x0a}, - {0x945a,0x80}, - {0x945b,0x03}, - {0x945c,0x75}, - {0x945d,0x0a}, - {0x945e,0xfe}, - {0x945f,0x90}, - {0x9460,0x30}, - {0x9461,0x27}, - {0x9462,0xe5}, - {0x9463,0x0a}, - {0x9464,0xf0}, - {0x9465,0xe5}, - {0x9466,0x23}, - {0x9467,0x54}, - {0x9468,0xf8}, - {0x9469,0xf5}, - {0x946a,0x0a}, - {0x946b,0xe5}, - {0x946c,0x79}, - {0x946d,0x25}, - {0x946e,0x0a}, - {0x946f,0xf5}, - {0x9470,0x0a}, - {0x9471,0x90}, - {0x9472,0x30}, - {0x9473,0x26}, - {0x9474,0xe5}, - {0x9475,0x0a}, - {0x9476,0xf0}, - {0x9477,0x22}, - {0x9478,0xe5}, - {0x9479,0x0a}, - {0x947a,0x70}, - {0x947b,0x04}, - {0x947c,0x7e}, - {0x947d,0x11}, - {0x947e,0x7f}, - {0x947f,0xc1}, - {0x9480,0xe5}, - {0x9481,0x0a}, - {0x9482,0xb4}, - {0x9483,0x01}, - {0x9484,0x04}, - {0x9485,0x7e}, - {0x9486,0x11}, - {0x9487,0x7f}, - {0x9488,0xc6}, - {0x9489,0xe5}, - {0x948a,0x0a}, - {0x948b,0xb4}, - {0x948c,0x02}, - {0x948d,0x04}, - {0x948e,0x7e}, - {0x948f,0x11}, - {0x9490,0x7f}, - {0x9491,0xcb}, - {0x9492,0x8f}, - {0x9493,0x82}, - {0x9494,0x8e}, - {0x9495,0x83}, - {0x9496,0xe4}, - {0x9497,0x93}, - {0x9498,0xf5}, - {0x9499,0x2c}, - {0x949a,0x74}, - {0x949b,0x01}, - {0x949c,0x93}, - {0x949d,0xf5}, - {0x949e,0x2d}, - {0x949f,0x74}, - {0x94a0,0x02}, - {0x94a1,0x93}, - {0x94a2,0xf5}, - {0x94a3,0x2e}, - {0x94a4,0x74}, - {0x94a5,0x03}, - {0x94a6,0x93}, - {0x94a7,0xf5}, - {0x94a8,0x2f}, - {0x94a9,0x74}, - {0x94aa,0x04}, - {0x94ab,0x93}, - {0x94ac,0xf5}, - {0x94ad,0x30}, - {0x94ae,0xe5}, - {0x94af,0x0a}, - {0x94b0,0xb4}, - {0x94b1,0x01}, - {0x94b2,0x07}, - {0x94b3,0x74}, - {0x94b4,0x2c}, - {0x94b5,0x25}, - {0x94b6,0x79}, - {0x94b7,0xf8}, - {0x94b8,0x76}, - {0x94b9,0x40}, - {0x94ba,0xe5}, - {0x94bb,0x0a}, - {0x94bc,0xb4}, - {0x94bd,0x02}, - {0x94be,0x07}, - {0x94bf,0x74}, - {0x94c0,0x2c}, - {0x94c1,0x25}, - {0x94c2,0x79}, - {0x94c3,0xf8}, - {0x94c4,0x76}, - {0x94c5,0x80}, - {0x94c6,0x22}, - {0x94c7,0xc2}, - {0x94c8,0xaf}, - {0x94c9,0x90}, - {0x94ca,0x30}, - {0x94cb,0x27}, - {0x94cc,0x74}, - {0x94cd,0xfa}, - {0x94ce,0xf0}, - {0x94cf,0x12}, - {0x94d0,0x0e}, - {0x94d1,0xd3}, - {0x94d2,0x12}, - {0x94d3,0x16}, - {0x94d4,0x15}, - {0x94d5,0xe4}, - {0x94d6,0xf5}, - {0x94d7,0x33}, - {0x94d8,0xd2}, - {0x94d9,0xaf}, - {0x94da,0x12}, - {0x94db,0x0b}, - {0x94dc,0x69}, - {0x94dd,0x30}, - {0x94de,0x30}, - {0x94df,0x03}, - {0x94e0,0x12}, - {0x94e1,0x06}, - {0x94e2,0xf8}, - {0x94e3,0x30}, - {0x94e4,0x34}, - {0x94e5,0x03}, - {0x94e6,0x12}, - {0x94e7,0x14}, - {0x94e8,0x1f}, - {0x94e9,0x30}, - {0x94ea,0x3d}, - {0x94eb,0xee}, - {0x94ec,0xc2}, - {0x94ed,0x3d}, - {0x94ee,0xd2}, - {0x94ef,0x35}, - {0x94f0,0x30}, - {0x94f1,0x00}, - {0x94f2,0x05}, - {0x94f3,0x12}, - {0x94f4,0x15}, - {0x94f5,0xe8}, - {0x94f6,0x80}, - {0x94f7,0x17}, - {0x94f8,0x30}, - {0x94f9,0x07}, - {0x94fa,0x0b}, - {0x94fb,0x30}, - {0x94fc,0x06}, - {0x94fd,0x08}, - {0x94fe,0x20}, - {0x94ff,0x31}, - {0x9500,0x0e}, - {0x9501,0x12}, - {0x9502,0x12}, - {0x9503,0x36}, - {0x9504,0x80}, - {0x9505,0x09}, - {0x9506,0x20}, - {0x9507,0x07}, - {0x9508,0x06}, - {0x9509,0x30}, - {0x950a,0x06}, - {0x950b,0x03}, - {0x950c,0x12}, - {0x950d,0x0d}, - {0x950e,0xcc}, - {0x950f,0xc2}, - {0x9510,0x35}, - {0x9511,0x80}, - {0x9512,0xc7}, - {0x9513,0xc0}, - {0x9514,0xe0}, - {0x9515,0xc0}, - {0x9516,0x83}, - {0x9517,0xc0}, - {0x9518,0x82}, - {0x9519,0xc0}, - {0x951a,0xd0}, - {0x951b,0x90}, - {0x951c,0x3f}, - {0x951d,0x0d}, - {0x951e,0xe0}, - {0x951f,0xf5}, - {0x9520,0x09}, - {0x9521,0xe5}, - {0x9522,0x09}, - {0x9523,0x30}, - {0x9524,0xe0}, - {0x9525,0x2e}, - {0x9526,0xe5}, - {0x9527,0x7a}, - {0x9528,0xb4}, - {0x9529,0x01}, - {0x952a,0x09}, - {0x952b,0x90}, - {0x952c,0x3a}, - {0x952d,0x00}, - {0x952e,0xe0}, - {0x952f,0xf5}, - {0x9530,0x78}, - {0x9531,0x44}, - {0x9532,0x01}, - {0x9533,0xf0}, - {0x9534,0xe5}, - {0x9535,0x7a}, - {0x9536,0xb4}, - {0x9537,0x03}, - {0x9538,0x09}, - {0x9539,0x90}, - {0x953a,0x3a}, - {0x953b,0x00}, - {0x953c,0xe0}, - {0x953d,0xf5}, - {0x953e,0x78}, - {0x953f,0x54}, - {0x9540,0xfe}, - {0x9541,0xf0}, - {0x9542,0xe5}, - {0x9543,0x7a}, - {0x9544,0xb4}, - {0x9545,0x03}, - {0x9546,0x05}, - {0x9547,0x75}, - {0x9548,0x7a}, - {0x9549,0x00}, - {0x954a,0x80}, - {0x954b,0x02}, - {0x954c,0x05}, - {0x954d,0x7a}, - {0x954e,0x90}, - {0x954f,0x3f}, - {0x9550,0x0d}, - {0x9551,0x74}, - {0x9552,0x01}, - {0x9553,0xf0}, - {0x9554,0xd0}, - {0x9555,0xd0}, - {0x9556,0xd0}, - {0x9557,0x82}, - {0x9558,0xd0}, - {0x9559,0x83}, - {0x955a,0xd0}, - {0x955b,0xe0}, - {0x955c,0x32}, - {0x955d,0x90}, - {0x955e,0x50}, - {0x955f,0x27}, - {0x9560,0xe0}, - {0x9561,0x44}, - {0x9562,0x01}, - {0x9563,0xf0}, - {0x9564,0x90}, - {0x9565,0x50}, - {0x9566,0x34}, - {0x9567,0x74}, - {0x9568,0x80}, - {0x9569,0xf0}, - {0x956a,0xa3}, - {0x956b,0x74}, - {0x956c,0x2a}, - {0x956d,0xf0}, - {0x956e,0xa3}, - {0x956f,0x74}, - {0x9570,0x14}, - {0x9571,0xf0}, - {0x9572,0x90}, - {0x9573,0x50}, - {0x9574,0x30}, - {0x9575,0xe4}, - {0x9576,0xf0}, - {0x9577,0xa3}, - {0x9578,0x74}, - {0x9579,0x02}, - {0x957a,0xf0}, - {0x957b,0xa3}, - {0x957c,0xe4}, - {0x957d,0xf0}, - {0x957e,0xa3}, - {0x957f,0x74}, - {0x9580,0x80}, - {0x9581,0xf0}, - {0x9582,0xe4}, - {0x9583,0xf5}, - {0x9584,0x0a}, - {0x9585,0x12}, - {0x9586,0x12}, - {0x9587,0x9c}, - {0x9588,0x75}, - {0x9589,0x79}, - {0x958a,0x02}, - {0x958b,0x75}, - {0x958c,0x0a}, - {0x958d,0x01}, - {0x958e,0x12}, - {0x958f,0x14}, - {0x9590,0x78}, - {0x9591,0xd2}, - {0x9592,0x18}, - {0x9593,0xd2}, - {0x9594,0x19}, - {0x9595,0xc2}, - {0x9596,0x3c}, - {0x9597,0xc2}, - {0x9598,0x3b}, - {0x9599,0xd2}, - {0x959a,0x1a}, - {0x959b,0xd2}, - {0x959c,0x38}, - {0x959d,0xd2}, - {0x959e,0x30}, - {0x959f,0xc2}, - {0x95a0,0x35}, - {0x95a1,0xc2}, - {0x95a2,0x3d}, - {0x95a3,0x22}, - {0x95a4,0x85}, - {0x95a5,0x10}, - {0x95a6,0x11}, - {0x95a7,0x7f}, - {0x95a8,0x08}, - {0x95a9,0xe5}, - {0x95aa,0x11}, - {0x95ab,0x30}, - {0x95ac,0xe7}, - {0x95ad,0x04}, - {0x95ae,0xd2}, - {0x95af,0x29}, - {0x95b0,0x80}, - {0x95b1,0x02}, - {0x95b2,0xc2}, - {0x95b3,0x29}, - {0x95b4,0x12}, - {0x95b5,0x01}, - {0x95b6,0x6c}, - {0x95b7,0x75}, - {0x95b8,0x51}, - {0x95b9,0x0a}, - {0x95ba,0xae}, - {0x95bb,0x51}, - {0x95bc,0x15}, - {0x95bd,0x51}, - {0x95be,0xee}, - {0x95bf,0x70}, - {0x95c0,0xf9}, - {0x95c1,0xe5}, - {0x95c2,0x11}, - {0x95c3,0x25}, - {0x95c4,0xe0}, - {0x95c5,0xf5}, - {0x95c6,0x11}, - {0x95c7,0xd2}, - {0x95c8,0x28}, - {0x95c9,0x12}, - {0x95ca,0x01}, - {0x95cb,0x6c}, - {0x95cc,0x75}, - {0x95cd,0x51}, - {0x95ce,0x0a}, - {0x95cf,0xae}, - {0x95d0,0x51}, - {0x95d1,0x15}, - {0x95d2,0x51}, - {0x95d3,0xee}, - {0x95d4,0x70}, - {0x95d5,0xf9}, - {0x95d6,0xc2}, - {0x95d7,0x28}, - {0x95d8,0x12}, - {0x95d9,0x01}, - {0x95da,0x6c}, - {0x95db,0x75}, - {0x95dc,0x51}, - {0x95dd,0x05}, - {0x95de,0xae}, - {0x95df,0x51}, - {0x95e0,0x15}, - {0x95e1,0x51}, - {0x95e2,0xee}, - {0x95e3,0x70}, - {0x95e4,0xf9}, - {0x95e5,0xdf}, - {0x95e6,0xc2}, - {0x95e7,0x22}, - {0x95e8,0xe5}, - {0x95e9,0x20}, - {0x95ea,0x54}, - {0x95eb,0x07}, - {0x95ec,0xff}, - {0x95ed,0xbf}, - {0x95ee,0x01}, - {0x95ef,0x03}, - {0x95f0,0x02}, - {0x95f1,0x10}, - {0x95f2,0x00}, - {0x95f3,0xe5}, - {0x95f4,0x20}, - {0x95f5,0x54}, - {0x95f6,0x07}, - {0x95f7,0xff}, - {0x95f8,0xbf}, - {0x95f9,0x07}, - {0x95fa,0x03}, - {0x95fb,0x02}, - {0x95fc,0x11}, - {0x95fd,0xd0}, - {0x95fe,0xe5}, - {0x95ff,0x20}, - {0x9600,0x54}, - {0x9601,0x07}, - {0x9602,0xff}, - {0x9603,0xbf}, - {0x9604,0x03}, - {0x9605,0x03}, - {0x9606,0x02}, - {0x9607,0x13}, - {0x9608,0xc4}, - {0x9609,0xe5}, - {0x960a,0x20}, - {0x960b,0x54}, - {0x960c,0x07}, - {0x960d,0xff}, - {0x960e,0xbf}, - {0x960f,0x05}, - {0x9610,0x03}, - {0x9611,0x12}, - {0x9612,0x16}, - {0x9613,0xe2}, - {0x9614,0x22}, - {0x9615,0x12}, - {0x9616,0x15}, - {0x9617,0x5d}, - {0x9618,0x12}, - {0x9619,0x16}, - {0x961a,0xf0}, - {0x961b,0x50}, - {0x961c,0x04}, - {0x961d,0xd2}, - {0x961e,0x05}, - {0x961f,0x80}, - {0x9620,0x02}, - {0x9621,0xc2}, - {0x9622,0x05}, - {0x9623,0x12}, - {0x9624,0x02}, - {0x9625,0x51}, - {0x9626,0xc2}, - {0x9627,0x39}, - {0x9628,0xc2}, - {0x9629,0x36}, - {0x962a,0xc2}, - {0x962b,0x31}, - {0x962c,0xd2}, - {0x962d,0x34}, - {0x962e,0x12}, - {0x962f,0x02}, - {0x9630,0x7f}, - {0x9631,0xb5}, - {0x9632,0x07}, - {0x9633,0x03}, - {0x9634,0xd3}, - {0x9635,0x80}, - {0x9636,0x01}, - {0x9637,0xc3}, - {0x9638,0x40}, - {0x9639,0x02}, - {0x963a,0xc2}, - {0x963b,0x05}, - {0x963c,0x22}, - {0x963d,0xe4}, - {0x963e,0xff}, - {0x963f,0xfe}, - {0x9640,0xc3}, - {0x9641,0xef}, - {0x9642,0x95}, - {0x9643,0x0e}, - {0x9644,0xee}, - {0x9645,0x95}, - {0x9646,0x0d}, - {0x9647,0x50}, - {0x9648,0x15}, - {0x9649,0x7d}, - {0x964a,0x8a}, - {0x964b,0x7c}, - {0x964c,0x02}, - {0x964d,0xed}, - {0x964e,0x1d}, - {0x964f,0xaa}, - {0x9650,0x04}, - {0x9651,0x70}, - {0x9652,0x01}, - {0x9653,0x1c}, - {0x9654,0x4a}, - {0x9655,0x70}, - {0x9656,0xf6}, - {0x9657,0x0f}, - {0x9658,0xbf}, - {0x9659,0x00}, - {0x965a,0x01}, - {0x965b,0x0e}, - {0x965c,0x80}, - {0x965d,0xe2}, - {0x965e,0x22}, - {0x965f,0xc2}, - {0x9660,0x03}, - {0x9661,0xd2}, - {0x9662,0x04}, - {0x9663,0x12}, - {0x9664,0x02}, - {0x9665,0x9b}, - {0x9666,0x30}, - {0x9667,0x07}, - {0x9668,0x05}, - {0x9669,0x30}, - {0x966a,0x06}, - {0x966b,0x02}, - {0x966c,0xd2}, - {0x966d,0x36}, - {0x966e,0xc2}, - {0x966f,0x3e}, - {0x9670,0x12}, - {0x9671,0x0f}, - {0x9672,0x73}, - {0x9673,0xc2}, - {0x9674,0x3e}, - {0x9675,0x12}, - {0x9676,0x13}, - {0x9677,0x01}, - {0x9678,0xd2}, - {0x9679,0x34}, - {0x967a,0x22}, - {0x967b,0x75}, - {0x967c,0x48}, - {0x967d,0x11}, - {0x967e,0x75}, - {0x967f,0x49}, - {0x9680,0x6a}, - {0x9681,0x90}, - {0x9682,0x11}, - {0x9683,0x68}, - {0x9684,0xe4}, - {0x9685,0x93}, - {0x9686,0xf5}, - {0x9687,0x7c}, - {0x9688,0xa3}, - {0x9689,0xe4}, - {0x968a,0x93}, - {0x968b,0xf5}, - {0x968c,0x32}, - {0x968d,0xc2}, - {0x968e,0x3a}, - {0x968f,0x22}, - {0x9690,0xe4}, - {0x9691,0xff}, - {0x9692,0xef}, - {0x9693,0x25}, - {0x9694,0xe0}, - {0x9695,0x24}, - {0x9696,0x56}, - {0x9697,0xf8}, - {0x9698,0xe4}, - {0x9699,0xf6}, - {0x969a,0x08}, - {0x969b,0xf6}, - {0x969c,0x0f}, - {0x969d,0xbf}, - {0x969e,0x07}, - {0x969f,0xf2}, - {0x96a0,0x53}, - {0x96a1,0x24}, - {0x96a2,0x80}, - {0x96a3,0x22}, - {0x96a4,0xe5}, - {0x96a5,0x7d}, - {0x96a6,0xc3}, - {0x96a7,0x95}, - {0x96a8,0x7c}, - {0x96a9,0x40}, - {0x96aa,0x01}, - {0x96ab,0x22}, - {0x96ac,0xe5}, - {0x96ad,0x7d}, - {0x96ae,0x04}, - {0x96af,0xf5}, - {0x96b0,0x0c}, - {0x96b1,0x12}, - {0x96b2,0x13}, - {0x96b3,0x64}, - {0x96b4,0x22}, - {0x96b5,0xe5}, - {0x96b6,0x7d}, - {0x96b7,0x70}, - {0x96b8,0x02}, - {0x96b9,0xc3}, - {0x96ba,0x22}, - {0x96bb,0xe5}, - {0x96bc,0x7d}, - {0x96bd,0x14}, - {0x96be,0xf5}, - {0x96bf,0x0c}, - {0x96c0,0x12}, - {0x96c1,0x13}, - {0x96c2,0x64}, - {0x96c3,0x22}, - {0x96c4,0xe5}, - {0x96c5,0x7e}, - {0x96c6,0xb4}, - {0x96c7,0x01}, - {0x96c8,0x09}, - {0x96c9,0x12}, - {0x96ca,0x16}, - {0x96cb,0x7b}, - {0x96cc,0xe4}, - {0x96cd,0xf5}, - {0x96ce,0x0c}, - {0x96cf,0x12}, - {0x96d0,0x13}, - {0x96d1,0x64}, - {0x96d2,0x22}, - {0x96d3,0xe5}, - {0x96d4,0x7e}, - {0x96d5,0x24}, - {0x96d6,0xfe}, - {0x96d7,0x60}, - {0x96d8,0x06}, - {0x96d9,0x04}, - {0x96da,0x70}, - {0x96db,0x05}, - {0x96dc,0xd2}, - {0x96dd,0x39}, - {0x96de,0x22}, - {0x96df,0xc2}, - {0x96e0,0x39}, - {0x96e1,0x22}, - {0x96e2,0xe5}, - {0x96e3,0x31}, - {0x96e4,0xd3}, - {0x96e5,0x94}, - {0x96e6,0x00}, - {0x96e7,0x40}, - {0x96e8,0x03}, - {0x96e9,0x15}, - {0x96ea,0x31}, - {0x96eb,0x22}, - {0x96ec,0x12}, - {0x96ed,0x16}, - {0x96ee,0x5f}, - {0x96ef,0x22}, - {0x96f0,0x12}, - {0x96f1,0x16}, - {0x96f2,0x7b}, - {0x96f3,0xe4}, - {0x96f4,0xf5}, - {0x96f5,0x0c}, - {0x96f6,0x12}, - {0x96f7,0x13}, - {0x96f8,0x64}, - {0x96f9,0x22}, - {0x3024,0x00}, - {0x3025,0x00}, - {0x5082,0x00}, - {0x5083,0x00}, - {0x5084,0x00}, - {0x5085,0x00}, - {0x3026,0x00}, - {0x3027,0xFF}, - {0x3000,0x00}, - {0x0000,0x00} -}; -#elif (VCM_DRIVER == VCM_DRIVER_DW9710) -static struct reginfo sensor_af_firmware[] = -{ - {0x3000,0x20}, - {0x8000,0x02}, - {0x8001,0x00}, - {0x8002,0x06}, - {0x8003,0x02}, - {0x8004,0x0c}, - {0x8005,0x90}, - {0x8006,0x78}, - {0x8007,0x7f}, - {0x8008,0xe4}, - {0x8009,0xf6}, - {0x800a,0xd8}, - {0x800b,0xfd}, - {0x800c,0x75}, - {0x800d,0x81}, - {0x800e,0x7d}, - {0x800f,0x02}, - {0x8010,0x14}, - {0x8011,0xc7}, - {0x8012,0x00}, - {0x8013,0x02}, - {0x8014,0x15}, - {0x8015,0x13}, - {0x8016,0xe0}, - {0x8017,0xf5}, - {0x8018,0x71}, - {0x8019,0xa3}, - {0x801a,0xe0}, - {0x801b,0xf5}, - {0x801c,0x72}, - {0x801d,0xae}, - {0x801e,0x69}, - {0x801f,0xe4}, - {0x8020,0x85}, - {0x8021,0x6a}, - {0x8022,0x55}, - {0x8023,0x8e}, - {0x8024,0x54}, - {0x8025,0xf5}, - {0x8026,0x53}, - {0x8027,0xf5}, - {0x8028,0x52}, - {0x8029,0xab}, - {0x802a,0x55}, - {0x802b,0xaa}, - {0x802c,0x54}, - {0x802d,0xa9}, - {0x802e,0x53}, - {0x802f,0xa8}, - {0x8030,0x52}, - {0x8031,0xaf}, - {0x8032,0x2c}, - {0x8033,0xfc}, - {0x8034,0xfd}, - {0x8035,0xfe}, - {0x8036,0x12}, - {0x8037,0x08}, - {0x8038,0xa2}, - {0x8039,0x8f}, - {0x803a,0x55}, - {0x803b,0x8e}, - {0x803c,0x54}, - {0x803d,0x8d}, - {0x803e,0x53}, - {0x803f,0x8c}, - {0x8040,0x52}, - {0x8041,0xaf}, - {0x8042,0x55}, - {0x8043,0xae}, - {0x8044,0x54}, - {0x8045,0xad}, - {0x8046,0x53}, - {0x8047,0xac}, - {0x8048,0x52}, - {0x8049,0x8f}, - {0x804a,0x2b}, - {0x804b,0x8e}, - {0x804c,0x2a}, - {0x804d,0x8d}, - {0x804e,0x29}, - {0x804f,0x8c}, - {0x8050,0x28}, - {0x8051,0xae}, - {0x8052,0x6b}, - {0x8053,0xe4}, - {0x8054,0x85}, - {0x8055,0x6c}, - {0x8056,0x55}, - {0x8057,0x8e}, - {0x8058,0x54}, - {0x8059,0xf5}, - {0x805a,0x53}, - {0x805b,0xf5}, - {0x805c,0x52}, - {0x805d,0xab}, - {0x805e,0x55}, - {0x805f,0xaa}, - {0x8060,0x54}, - {0x8061,0xa9}, - {0x8062,0x53}, - {0x8063,0xa8}, - {0x8064,0x52}, - {0x8065,0xaf}, - {0x8066,0x2d}, - {0x8067,0xfc}, - {0x8068,0xfd}, - {0x8069,0xfe}, - {0x806a,0x12}, - {0x806b,0x08}, - {0x806c,0xa2}, - {0x806d,0x8f}, - {0x806e,0x55}, - {0x806f,0x8e}, - {0x8070,0x54}, - {0x8071,0x8d}, - {0x8072,0x53}, - {0x8073,0x8c}, - {0x8074,0x52}, - {0x8075,0xe5}, - {0x8076,0x2b}, - {0x8077,0x25}, - {0x8078,0x55}, - {0x8079,0xf5}, - {0x807a,0x2b}, - {0x807b,0xe5}, - {0x807c,0x2a}, - {0x807d,0x35}, - {0x807e,0x54}, - {0x807f,0xf5}, - {0x8080,0x2a}, - {0x8081,0xe5}, - {0x8082,0x29}, - {0x8083,0x35}, - {0x8084,0x53}, - {0x8085,0xf5}, - {0x8086,0x29}, - {0x8087,0xe5}, - {0x8088,0x28}, - {0x8089,0x35}, - {0x808a,0x52}, - {0x808b,0xf5}, - {0x808c,0x28}, - {0x808d,0xae}, - {0x808e,0x6d}, - {0x808f,0xe4}, - {0x8090,0x85}, - {0x8091,0x6e}, - {0x8092,0x55}, - {0x8093,0x8e}, - {0x8094,0x54}, - {0x8095,0xf5}, - {0x8096,0x53}, - {0x8097,0xf5}, - {0x8098,0x52}, - {0x8099,0xab}, - {0x809a,0x55}, - {0x809b,0xaa}, - {0x809c,0x54}, - {0x809d,0xa9}, - {0x809e,0x53}, - {0x809f,0xa8}, - {0x80a0,0x52}, - {0x80a1,0xaf}, - {0x80a2,0x2e}, - {0x80a3,0xfc}, - {0x80a4,0xfd}, - {0x80a5,0xfe}, - {0x80a6,0x12}, - {0x80a7,0x08}, - {0x80a8,0xa2}, - {0x80a9,0x8f}, - {0x80aa,0x55}, - {0x80ab,0x8e}, - {0x80ac,0x54}, - {0x80ad,0x8d}, - {0x80ae,0x53}, - {0x80af,0x8c}, - {0x80b0,0x52}, - {0x80b1,0xe5}, - {0x80b2,0x2b}, - {0x80b3,0x25}, - {0x80b4,0x55}, - {0x80b5,0xf5}, - {0x80b6,0x2b}, - {0x80b7,0xe5}, - {0x80b8,0x2a}, - {0x80b9,0x35}, - {0x80ba,0x54}, - {0x80bb,0xf5}, - {0x80bc,0x2a}, - {0x80bd,0xe5}, - {0x80be,0x29}, - {0x80bf,0x35}, - {0x80c0,0x53}, - {0x80c1,0xf5}, - {0x80c2,0x29}, - {0x80c3,0xe5}, - {0x80c4,0x28}, - {0x80c5,0x35}, - {0x80c6,0x52}, - {0x80c7,0xf5}, - {0x80c8,0x28}, - {0x80c9,0xae}, - {0x80ca,0x6f}, - {0x80cb,0xe4}, - {0x80cc,0x85}, - {0x80cd,0x70}, - {0x80ce,0x55}, - {0x80cf,0x8e}, - {0x80d0,0x54}, - {0x80d1,0xf5}, - {0x80d2,0x53}, - {0x80d3,0xf5}, - {0x80d4,0x52}, - {0x80d5,0xab}, - {0x80d6,0x55}, - {0x80d7,0xaa}, - {0x80d8,0x54}, - {0x80d9,0xa9}, - {0x80da,0x53}, - {0x80db,0xa8}, - {0x80dc,0x52}, - {0x80dd,0xaf}, - {0x80de,0x2f}, - {0x80df,0xfc}, - {0x80e0,0xfd}, - {0x80e1,0xfe}, - {0x80e2,0x12}, - {0x80e3,0x08}, - {0x80e4,0xa2}, - {0x80e5,0x8f}, - {0x80e6,0x55}, - {0x80e7,0x8e}, - {0x80e8,0x54}, - {0x80e9,0x8d}, - {0x80ea,0x53}, - {0x80eb,0x8c}, - {0x80ec,0x52}, - {0x80ed,0xe5}, - {0x80ee,0x2b}, - {0x80ef,0x25}, - {0x80f0,0x55}, - {0x80f1,0xf5}, - {0x80f2,0x2b}, - {0x80f3,0xe5}, - {0x80f4,0x2a}, - {0x80f5,0x35}, - {0x80f6,0x54}, - {0x80f7,0xf5}, - {0x80f8,0x2a}, - {0x80f9,0xe5}, - {0x80fa,0x29}, - {0x80fb,0x35}, - {0x80fc,0x53}, - {0x80fd,0xf5}, - {0x80fe,0x29}, - {0x80ff,0xe5}, - {0x8100,0x28}, - {0x8101,0x35}, - {0x8102,0x52}, - {0x8103,0xf5}, - {0x8104,0x28}, - {0x8105,0xae}, - {0x8106,0x71}, - {0x8107,0xe4}, - {0x8108,0x85}, - {0x8109,0x72}, - {0x810a,0x55}, - {0x810b,0x8e}, - {0x810c,0x54}, - {0x810d,0xf5}, - {0x810e,0x53}, - {0x810f,0xf5}, - {0x8110,0x52}, - {0x8111,0xab}, - {0x8112,0x55}, - {0x8113,0xaa}, - {0x8114,0x54}, - {0x8115,0xa9}, - {0x8116,0x53}, - {0x8117,0xa8}, - {0x8118,0x52}, - {0x8119,0xaf}, - {0x811a,0x30}, - {0x811b,0xfc}, - {0x811c,0xfd}, - {0x811d,0xfe}, - {0x811e,0x12}, - {0x811f,0x08}, - {0x8120,0xa2}, - {0x8121,0x8f}, - {0x8122,0x55}, - {0x8123,0x8e}, - {0x8124,0x54}, - {0x8125,0x8d}, - {0x8126,0x53}, - {0x8127,0x8c}, - {0x8128,0x52}, - {0x8129,0xe5}, - {0x812a,0x2b}, - {0x812b,0x25}, - {0x812c,0x55}, - {0x812d,0xf5}, - {0x812e,0x2b}, - {0x812f,0xe5}, - {0x8130,0x2a}, - {0x8131,0x35}, - {0x8132,0x54}, - {0x8133,0xf5}, - {0x8134,0x2a}, - {0x8135,0xe5}, - {0x8136,0x29}, - {0x8137,0x35}, - {0x8138,0x53}, - {0x8139,0xf5}, - {0x813a,0x29}, - {0x813b,0xe5}, - {0x813c,0x28}, - {0x813d,0x35}, - {0x813e,0x52}, - {0x813f,0xf5}, - {0x8140,0x28}, - {0x8141,0x22}, - {0x8142,0xab}, - {0x8143,0x0d}, - {0x8144,0xaa}, - {0x8145,0x0c}, - {0x8146,0xa9}, - {0x8147,0x0b}, - {0x8148,0xa8}, - {0x8149,0x0a}, - {0x814a,0xfc}, - {0x814b,0xfd}, - {0x814c,0xfe}, - {0x814d,0x12}, - {0x814e,0x08}, - {0x814f,0xa2}, - {0x8150,0x8f}, - {0x8151,0x0d}, - {0x8152,0x8e}, - {0x8153,0x0c}, - {0x8154,0x8d}, - {0x8155,0x0b}, - {0x8156,0x8c}, - {0x8157,0x0a}, - {0x8158,0x7b}, - {0x8159,0x40}, - {0x815a,0xe4}, - {0x815b,0xfa}, - {0x815c,0xf9}, - {0x815d,0xf8}, - {0x815e,0x12}, - {0x815f,0x09}, - {0x8160,0x2d}, - {0x8161,0x8f}, - {0x8162,0x0d}, - {0x8163,0x8e}, - {0x8164,0x0c}, - {0x8165,0x8d}, - {0x8166,0x0b}, - {0x8167,0x8c}, - {0x8168,0x0a}, - {0x8169,0x22}, - {0x816a,0xd2}, - {0x816b,0x29}, - {0x816c,0x90}, - {0x816d,0x30}, - {0x816e,0x1b}, - {0x816f,0xe5}, - {0x8170,0x25}, - {0x8171,0xf0}, - {0x8172,0x22}, - {0x8173,0xfe}, - {0x8174,0xe4}, - {0x8175,0xfc}, - {0x8176,0xfd}, - {0x8177,0xe5}, - {0x8178,0x3f}, - {0x8179,0x2f}, - {0x817a,0xf5}, - {0x817b,0x3f}, - {0x817c,0xe5}, - {0x817d,0x3e}, - {0x817e,0x3e}, - {0x817f,0xf5}, - {0x8180,0x3e}, - {0x8181,0xed}, - {0x8182,0x35}, - {0x8183,0x3d}, - {0x8184,0xf5}, - {0x8185,0x3d}, - {0x8186,0xec}, - {0x8187,0x35}, - {0x8188,0x3c}, - {0x8189,0xf5}, - {0x818a,0x3c}, - {0x818b,0xaf}, - {0x818c,0x3f}, - {0x818d,0xae}, - {0x818e,0x3e}, - {0x818f,0xfc}, - {0x8190,0xad}, - {0x8191,0x3d}, - {0x8192,0x78}, - {0x8193,0x08}, - {0x8194,0x12}, - {0x8195,0x09}, - {0x8196,0xd2}, - {0x8197,0x8f}, - {0x8198,0x3f}, - {0x8199,0x8e}, - {0x819a,0x3e}, - {0x819b,0x8d}, - {0x819c,0x3d}, - {0x819d,0x8c}, - {0x819e,0x3c}, - {0x819f,0x22}, - {0x81a0,0xe5}, - {0x81a1,0x49}, - {0x81a2,0x25}, - {0x81a3,0x7b}, - {0x81a4,0xf5}, - {0x81a5,0x82}, - {0x81a6,0xe4}, - {0x81a7,0x35}, - {0x81a8,0x48}, - {0x81a9,0xf5}, - {0x81aa,0x83}, - {0x81ab,0xe4}, - {0x81ac,0x93}, - {0x81ad,0xff}, - {0x81ae,0x85}, - {0x81af,0x49}, - {0x81b0,0x82}, - {0x81b1,0x85}, - {0x81b2,0x48}, - {0x81b3,0x83}, - {0x81b4,0xe4}, - {0x81b5,0x93}, - {0x81b6,0xfd}, - {0x81b7,0xc3}, - {0x81b8,0xef}, - {0x81b9,0x9d}, - {0x81ba,0xff}, - {0x81bb,0xe4}, - {0x81bc,0x94}, - {0x81bd,0x00}, - {0x81be,0x22}, - {0x81bf,0xaf}, - {0x81c0,0x2b}, - {0x81c1,0xae}, - {0x81c2,0x2a}, - {0x81c3,0xad}, - {0x81c4,0x29}, - {0x81c5,0xac}, - {0x81c6,0x28}, - {0x81c7,0x78}, - {0x81c8,0x06}, - {0x81c9,0x12}, - {0x81ca,0x09}, - {0x81cb,0xbf}, - {0x81cc,0x8f}, - {0x81cd,0x2b}, - {0x81ce,0x8e}, - {0x81cf,0x2a}, - {0x81d0,0x8d}, - {0x81d1,0x29}, - {0x81d2,0x8c}, - {0x81d3,0x28}, - {0x81d4,0xd3}, - {0x81d5,0xe5}, - {0x81d6,0x29}, - {0x81d7,0x94}, - {0x81d8,0x00}, - {0x81d9,0xe5}, - {0x81da,0x28}, - {0x81db,0x94}, - {0x81dc,0x00}, - {0x81dd,0x22}, - {0x81de,0xe5}, - {0x81df,0x0b}, - {0x81e0,0x24}, - {0x81e1,0x01}, - {0x81e2,0xff}, - {0x81e3,0xe4}, - {0x81e4,0x33}, - {0x81e5,0xfe}, - {0x81e6,0x22}, - {0x81e7,0x12}, - {0x81e8,0x08}, - {0x81e9,0xa2}, - {0x81ea,0x8f}, - {0x81eb,0x68}, - {0x81ec,0x8e}, - {0x81ed,0x67}, - {0x81ee,0x8d}, - {0x81ef,0x66}, - {0x81f0,0x8c}, - {0x81f1,0x65}, - {0x81f2,0xaf}, - {0x81f3,0x68}, - {0x81f4,0xae}, - {0x81f5,0x67}, - {0x81f6,0xad}, - {0x81f7,0x66}, - {0x81f8,0xac}, - {0x81f9,0x65}, - {0x81fa,0x22}, - {0x81fb,0xe0}, - {0x81fc,0x44}, - {0x81fd,0x01}, - {0x81fe,0xf0}, - {0x81ff,0xe0}, - {0x8200,0x44}, - {0x8201,0x02}, - {0x8202,0xf0}, - {0x8203,0xe0}, - {0x8204,0x44}, - {0x8205,0x04}, - {0x8206,0xf0}, - {0x8207,0x22}, - {0x8208,0xd2}, - {0x8209,0x09}, - {0x820a,0x90}, - {0x820b,0x30}, - {0x820c,0x18}, - {0x820d,0xe5}, - {0x820e,0x21}, - {0x820f,0xf0}, - {0x8210,0x22}, - {0x8211,0xe4}, - {0x8212,0x85}, - {0x8213,0x11}, - {0x8214,0x0d}, - {0x8215,0x85}, - {0x8216,0x10}, - {0x8217,0x0c}, - {0x8218,0xf5}, - {0x8219,0x0b}, - {0x821a,0xf5}, - {0x821b,0x0a}, - {0x821c,0xab}, - {0x821d,0x0d}, - {0x821e,0xaa}, - {0x821f,0x0c}, - {0x8220,0xa9}, - {0x8221,0x0b}, - {0x8222,0xa8}, - {0x8223,0x0a}, - {0x8224,0x22}, - {0x8225,0x90}, - {0x8226,0x30}, - {0x8227,0x42}, - {0x8228,0xe0}, - {0x8229,0xf5}, - {0x822a,0x22}, - {0x822b,0x75}, - {0x822c,0x51}, - {0x822d,0x0a}, - {0x822e,0x22}, - {0x822f,0xf5}, - {0x8230,0x82}, - {0x8231,0xe4}, - {0x8232,0x3a}, - {0x8233,0xf5}, - {0x8234,0x83}, - {0x8235,0x02}, - {0x8236,0x09}, - {0x8237,0xe5}, - {0x8238,0x8f}, - {0x8239,0x0a}, - {0x823a,0x74}, - {0x823b,0x4a}, - {0x823c,0x2f}, - {0x823d,0xf8}, - {0x823e,0xe6}, - {0x823f,0x22}, - {0x8240,0xc2}, - {0x8241,0x07}, - {0x8242,0xc2}, - {0x8243,0x06}, - {0x8244,0xc2}, - {0x8245,0x02}, - {0x8246,0xc2}, - {0x8247,0x01}, - {0x8248,0xc2}, - {0x8249,0x00}, - {0x824a,0xc2}, - {0x824b,0x03}, - {0x824c,0xd2}, - {0x824d,0x04}, - {0x824e,0x22}, - {0x824f,0xf5}, - {0x8250,0x82}, - {0x8251,0xe4}, - {0x8252,0x35}, - {0x8253,0x48}, - {0x8254,0xf5}, - {0x8255,0x83}, - {0x8256,0xe4}, - {0x8257,0x22}, - {0x8258,0x8e}, - {0x8259,0x67}, - {0x825a,0x8f}, - {0x825b,0x68}, - {0x825c,0x85}, - {0x825d,0x68}, - {0x825e,0x64}, - {0x825f,0xe5}, - {0x8260,0x68}, - {0x8261,0xae}, - {0x8262,0x67}, - {0x8263,0x78}, - {0x8264,0x06}, - {0x8265,0x22}, - {0x8266,0xe5}, - {0x8267,0x16}, - {0x8268,0x25}, - {0x8269,0xe0}, - {0x826a,0x25}, - {0x826b,0xe0}, - {0x826c,0x22}, - {0x826d,0x12}, - {0x826e,0x09}, - {0x826f,0x2d}, - {0x8270,0x8f}, - {0x8271,0x68}, - {0x8272,0x8e}, - {0x8273,0x67}, - {0x8274,0x8d}, - {0x8275,0x66}, - {0x8276,0x8c}, - {0x8277,0x65}, - {0x8278,0x22}, - {0x8279,0xe4}, - {0x827a,0x85}, - {0x827b,0x0f}, - {0x827c,0x0d}, - {0x827d,0x85}, - {0x827e,0x0e}, - {0x827f,0x0c}, - {0x8280,0xf5}, - {0x8281,0x0b}, - {0x8282,0xf5}, - {0x8283,0x0a}, - {0x8284,0x22}, - {0x8285,0x90}, - {0x8286,0x13}, - {0x8287,0x70}, - {0x8288,0xe4}, - {0x8289,0x93}, - {0x828a,0xff}, - {0x828b,0x90}, - {0x828c,0x30}, - {0x828d,0x0a}, - {0x828e,0xe0}, - {0x828f,0x22}, - {0x8290,0xc2}, - {0x8291,0x02}, - {0x8292,0xc2}, - {0x8293,0x01}, - {0x8294,0xd2}, - {0x8295,0x00}, - {0x8296,0xc2}, - {0x8297,0x03}, - {0x8298,0xc2}, - {0x8299,0x04}, - {0x829a,0x22}, - {0x829b,0x85}, - {0x829c,0x0e}, - {0x829d,0x64}, - {0x829e,0xe5}, - {0x829f,0x0e}, - {0x82a0,0xae}, - {0x82a1,0x0d}, - {0x82a2,0x78}, - {0x82a3,0x06}, - {0x82a4,0x22}, - {0x82a5,0xd2}, - {0x82a6,0x02}, - {0x82a7,0xd2}, - {0x82a8,0x01}, - {0x82a9,0xc2}, - {0x82aa,0x00}, - {0x82ab,0x22}, - {0x82ac,0x74}, - {0x82ad,0x4a}, - {0x82ae,0x25}, - {0x82af,0x0a}, - {0x82b0,0xf8}, - {0x82b1,0xe6}, - {0x82b2,0x22}, - {0x82b3,0xd3}, - {0x82b4,0xe5}, - {0x82b5,0x0b}, - {0x82b6,0x94}, - {0x82b7,0xff}, - {0x82b8,0xe5}, - {0x82b9,0x0a}, - {0x82ba,0x94}, - {0x82bb,0x00}, - {0x82bc,0x22}, - {0x82bd,0xd3}, - {0x82be,0xe5}, - {0x82bf,0x68}, - {0x82c0,0x94}, - {0x82c1,0xff}, - {0x82c2,0xe5}, - {0x82c3,0x67}, - {0x82c4,0x94}, - {0x82c5,0x00}, - {0x82c6,0x22}, - {0x82c7,0x30}, - {0x82c8,0x18}, - {0x82c9,0x4d}, - {0x82ca,0x20}, - {0x82cb,0x19}, - {0x82cc,0x4a}, - {0x82cd,0x75}, - {0x82ce,0x0a}, - {0x82cf,0x02}, - {0x82d0,0x12}, - {0x82d1,0x02}, - {0x82d2,0xac}, - {0x82d3,0xff}, - {0x82d4,0xe5}, - {0x82d5,0x4a}, - {0x82d6,0xd3}, - {0x82d7,0x9f}, - {0x82d8,0x40}, - {0x82d9,0x04}, - {0x82da,0x7f}, - {0x82db,0x00}, - {0x82dc,0x80}, - {0x82dd,0x02}, - {0x82de,0xaf}, - {0x82df,0x0a}, - {0x82e0,0x12}, - {0x82e1,0x02}, - {0x82e2,0x38}, - {0x82e3,0xff}, - {0x82e4,0xe5}, - {0x82e5,0x4b}, - {0x82e6,0xd3}, - {0x82e7,0x9f}, - {0x82e8,0x40}, - {0x82e9,0x04}, - {0x82ea,0x7f}, - {0x82eb,0x01}, - {0x82ec,0x80}, - {0x82ed,0x02}, - {0x82ee,0xaf}, - {0x82ef,0x0a}, - {0x82f0,0x12}, - {0x82f1,0x02}, - {0x82f2,0x38}, - {0x82f3,0xff}, - {0x82f4,0xe5}, - {0x82f5,0x4d}, - {0x82f6,0xd3}, - {0x82f7,0x9f}, - {0x82f8,0x40}, - {0x82f9,0x04}, - {0x82fa,0x7f}, - {0x82fb,0x03}, - {0x82fc,0x80}, - {0x82fd,0x02}, - {0x82fe,0xaf}, - {0x82ff,0x0a}, - {0x8300,0x12}, - {0x8301,0x02}, - {0x8302,0x38}, - {0x8303,0xff}, - {0x8304,0xe5}, - {0x8305,0x4e}, - {0x8306,0xd3}, - {0x8307,0x9f}, - {0x8308,0x40}, - {0x8309,0x04}, - {0x830a,0x7f}, - {0x830b,0x04}, - {0x830c,0x80}, - {0x830d,0x02}, - {0x830e,0xaf}, - {0x830f,0x0a}, - {0x8310,0x12}, - {0x8311,0x02}, - {0x8312,0x38}, - {0x8313,0xf5}, - {0x8314,0x0b}, - {0x8315,0x80}, - {0x8316,0x06}, - {0x8317,0x85}, - {0x8318,0x78}, - {0x8319,0x0a}, - {0x831a,0x85}, - {0x831b,0x4f}, - {0x831c,0x0b}, - {0x831d,0x7f}, - {0x831e,0x01}, - {0x831f,0xe4}, - {0x8320,0xfe}, - {0x8321,0x12}, - {0x8322,0x02}, - {0x8323,0xac}, - {0x8324,0xfd}, - {0x8325,0xe5}, - {0x8326,0x0b}, - {0x8327,0xc3}, - {0x8328,0x9d}, - {0x8329,0x50}, - {0x832a,0x04}, - {0x832b,0x7d}, - {0x832c,0x01}, - {0x832d,0x80}, - {0x832e,0x02}, - {0x832f,0x7d}, - {0x8330,0xff}, - {0x8331,0xac}, - {0x8332,0x0b}, - {0x8333,0xe5}, - {0x8334,0x4e}, - {0x8335,0xb5}, - {0x8336,0x0b}, - {0x8337,0x03}, - {0x8338,0xd3}, - {0x8339,0x80}, - {0x833a,0x01}, - {0x833b,0xc3}, - {0x833c,0x92}, - {0x833d,0x1f}, - {0x833e,0xe5}, - {0x833f,0x4d}, - {0x8340,0xb5}, - {0x8341,0x0b}, - {0x8342,0x03}, - {0x8343,0xd3}, - {0x8344,0x80}, - {0x8345,0x01}, - {0x8346,0xc3}, - {0x8347,0x92}, - {0x8348,0x1e}, - {0x8349,0xe5}, - {0x834a,0x4c}, - {0x834b,0xb5}, - {0x834c,0x0b}, - {0x834d,0x03}, - {0x834e,0xd3}, - {0x834f,0x80}, - {0x8350,0x01}, - {0x8351,0xc3}, - {0x8352,0x92}, - {0x8353,0x1d}, - {0x8354,0xe5}, - {0x8355,0x4b}, - {0x8356,0xb5}, - {0x8357,0x0b}, - {0x8358,0x03}, - {0x8359,0xd3}, - {0x835a,0x80}, - {0x835b,0x01}, - {0x835c,0xc3}, - {0x835d,0x92}, - {0x835e,0x1c}, - {0x835f,0xe5}, - {0x8360,0x4a}, - {0x8361,0xb5}, - {0x8362,0x0b}, - {0x8363,0x03}, - {0x8364,0xd3}, - {0x8365,0x80}, - {0x8366,0x01}, - {0x8367,0xc3}, - {0x8368,0x92}, - {0x8369,0x1b}, - {0x836a,0xe5}, - {0x836b,0x30}, - {0x836c,0xd3}, - {0x836d,0x94}, - {0x836e,0x00}, - {0x836f,0x40}, - {0x8370,0x04}, - {0x8371,0xa2}, - {0x8372,0x1f}, - {0x8373,0x80}, - {0x8374,0x01}, - {0x8375,0xc3}, - {0x8376,0x92}, - {0x8377,0x1f}, - {0x8378,0xe5}, - {0x8379,0x2f}, - {0x837a,0xd3}, - {0x837b,0x94}, - {0x837c,0x00}, - {0x837d,0x40}, - {0x837e,0x04}, - {0x837f,0xa2}, - {0x8380,0x1e}, - {0x8381,0x80}, - {0x8382,0x01}, - {0x8383,0xc3}, - {0x8384,0x92}, - {0x8385,0x1e}, - {0x8386,0xe5}, - {0x8387,0x2e}, - {0x8388,0xd3}, - {0x8389,0x94}, - {0x838a,0x00}, - {0x838b,0x40}, - {0x838c,0x04}, - {0x838d,0xa2}, - {0x838e,0x1d}, - {0x838f,0x80}, - {0x8390,0x01}, - {0x8391,0xc3}, - {0x8392,0x92}, - {0x8393,0x1d}, - {0x8394,0xe5}, - {0x8395,0x2d}, - {0x8396,0xd3}, - {0x8397,0x94}, - {0x8398,0x00}, - {0x8399,0x40}, - {0x839a,0x04}, - {0x839b,0xa2}, - {0x839c,0x1c}, - {0x839d,0x80}, - {0x839e,0x01}, - {0x839f,0xc3}, - {0x83a0,0x92}, - {0x83a1,0x1c}, - {0x83a2,0xe5}, - {0x83a3,0x2c}, - {0x83a4,0xd3}, - {0x83a5,0x94}, - {0x83a6,0x00}, - {0x83a7,0x40}, - {0x83a8,0x04}, - {0x83a9,0xa2}, - {0x83aa,0x1b}, - {0x83ab,0x80}, - {0x83ac,0x01}, - {0x83ad,0xc3}, - {0x83ae,0x92}, - {0x83af,0x1b}, - {0x83b0,0xe5}, - {0x83b1,0x23}, - {0x83b2,0x54}, - {0x83b3,0xf8}, - {0x83b4,0x70}, - {0x83b5,0x5b}, - {0x83b6,0xbf}, - {0x83b7,0x01}, - {0x83b8,0x08}, - {0x83b9,0xed}, - {0x83ba,0xf4}, - {0x83bb,0x04}, - {0x83bc,0xfd}, - {0x83bd,0x7f}, - {0x83be,0x02}, - {0x83bf,0x80}, - {0x83c0,0x06}, - {0x83c1,0xbf}, - {0x83c2,0x02}, - {0x83c3,0x02}, - {0x83c4,0x7f}, - {0x83c5,0x01}, - {0x83c6,0x0e}, - {0x83c7,0xd3}, - {0x83c8,0xed}, - {0x83c9,0x64}, - {0x83ca,0x80}, - {0x83cb,0x94}, - {0x83cc,0x80}, - {0x83cd,0x40}, - {0x83ce,0x18}, - {0x83cf,0xec}, - {0x83d0,0x2e}, - {0x83d1,0xf5}, - {0x83d2,0x0b}, - {0x83d3,0xd3}, - {0x83d4,0x95}, - {0x83d5,0x7b}, - {0x83d6,0x40}, - {0x83d7,0x2c}, - {0x83d8,0x7d}, - {0x83d9,0xff}, - {0x83da,0xef}, - {0x83db,0x60}, - {0x83dc,0x04}, - {0x83dd,0x7b}, - {0x83de,0x00}, - {0x83df,0x80}, - {0x83e0,0x02}, - {0x83e1,0x7b}, - {0x83e2,0x03}, - {0x83e3,0xaf}, - {0x83e4,0x03}, - {0x83e5,0x80}, - {0x83e6,0x18}, - {0x83e7,0xec}, - {0x83e8,0xc3}, - {0x83e9,0x9e}, - {0x83ea,0x50}, - {0x83eb,0x13}, - {0x83ec,0x7d}, - {0x83ed,0x01}, - {0x83ee,0xef}, - {0x83ef,0x60}, - {0x83f0,0x04}, - {0x83f1,0x7b}, - {0x83f2,0x00}, - {0x83f3,0x80}, - {0x83f4,0x02}, - {0x83f5,0x7b}, - {0x83f6,0x03}, - {0x83f7,0xaf}, - {0x83f8,0x03}, - {0x83f9,0xec}, - {0x83fa,0x2e}, - {0x83fb,0xf5}, - {0x83fc,0x0b}, - {0x83fd,0x80}, - {0x83fe,0x05}, - {0x83ff,0xc3}, - {0x8400,0xec}, - {0x8401,0x9e}, - {0x8402,0xf5}, - {0x8403,0x0b}, - {0x8404,0xef}, - {0x8405,0x64}, - {0x8406,0x03}, - {0x8407,0x60}, - {0x8408,0x03}, - {0x8409,0x02}, - {0x840a,0x03}, - {0x840b,0x33}, - {0x840c,0x12}, - {0x840d,0x02}, - {0x840e,0xac}, - {0x840f,0xf5}, - {0x8410,0x0b}, - {0x8411,0x12}, - {0x8412,0x01}, - {0x8413,0xde}, - {0x8414,0xe5}, - {0x8415,0x4e}, - {0x8416,0xb5}, - {0x8417,0x07}, - {0x8418,0x07}, - {0x8419,0xe4}, - {0x841a,0xb5}, - {0x841b,0x06}, - {0x841c,0x03}, - {0x841d,0xd3}, - {0x841e,0x80}, - {0x841f,0x02}, - {0x8420,0xa2}, - {0x8421,0x1f}, - {0x8422,0x92}, - {0x8423,0x1f}, - {0x8424,0xe5}, - {0x8425,0x4d}, - {0x8426,0xb5}, - {0x8427,0x07}, - {0x8428,0x07}, - {0x8429,0xe4}, - {0x842a,0xb5}, - {0x842b,0x06}, - {0x842c,0x03}, - {0x842d,0xd3}, - {0x842e,0x80}, - {0x842f,0x02}, - {0x8430,0xa2}, - {0x8431,0x1e}, - {0x8432,0x92}, - {0x8433,0x1e}, - {0x8434,0x12}, - {0x8435,0x01}, - {0x8436,0xde}, - {0x8437,0xe5}, - {0x8438,0x4c}, - {0x8439,0xb5}, - {0x843a,0x07}, - {0x843b,0x07}, - {0x843c,0xe4}, - {0x843d,0xb5}, - {0x843e,0x06}, - {0x843f,0x03}, - {0x8440,0xd3}, - {0x8441,0x80}, - {0x8442,0x02}, - {0x8443,0xa2}, - {0x8444,0x1d}, - {0x8445,0x92}, - {0x8446,0x1d}, - {0x8447,0xe5}, - {0x8448,0x4b}, - {0x8449,0xb5}, - {0x844a,0x07}, - {0x844b,0x07}, - {0x844c,0xe4}, - {0x844d,0xb5}, - {0x844e,0x06}, - {0x844f,0x03}, - {0x8450,0xd3}, - {0x8451,0x80}, - {0x8452,0x02}, - {0x8453,0xa2}, - {0x8454,0x1c}, - {0x8455,0x92}, - {0x8456,0x1c}, - {0x8457,0x12}, - {0x8458,0x01}, - {0x8459,0xde}, - {0x845a,0xe5}, - {0x845b,0x4a}, - {0x845c,0xb5}, - {0x845d,0x07}, - {0x845e,0x07}, - {0x845f,0xe4}, - {0x8460,0xb5}, - {0x8461,0x06}, - {0x8462,0x03}, - {0x8463,0xd3}, - {0x8464,0x80}, - {0x8465,0x02}, - {0x8466,0xa2}, - {0x8467,0x1b}, - {0x8468,0x92}, - {0x8469,0x1b}, - {0x846a,0xe5}, - {0x846b,0x4e}, - {0x846c,0x12}, - {0x846d,0x01}, - {0x846e,0xe0}, - {0x846f,0xad}, - {0x8470,0x0b}, - {0x8471,0x7c}, - {0x8472,0x00}, - {0x8473,0xef}, - {0x8474,0xb5}, - {0x8475,0x05}, - {0x8476,0x07}, - {0x8477,0xec}, - {0x8478,0xb5}, - {0x8479,0x06}, - {0x847a,0x03}, - {0x847b,0xd3}, - {0x847c,0x80}, - {0x847d,0x02}, - {0x847e,0xa2}, - {0x847f,0x1f}, - {0x8480,0x92}, - {0x8481,0x1f}, - {0x8482,0xe5}, - {0x8483,0x4d}, - {0x8484,0x12}, - {0x8485,0x01}, - {0x8486,0xe0}, - {0x8487,0xef}, - {0x8488,0xb5}, - {0x8489,0x05}, - {0x848a,0x07}, - {0x848b,0xee}, - {0x848c,0xb5}, - {0x848d,0x04}, - {0x848e,0x03}, - {0x848f,0xd3}, - {0x8490,0x80}, - {0x8491,0x02}, - {0x8492,0xa2}, - {0x8493,0x1e}, - {0x8494,0x92}, - {0x8495,0x1e}, - {0x8496,0xe5}, - {0x8497,0x4c}, - {0x8498,0x12}, - {0x8499,0x01}, - {0x849a,0xe0}, - {0x849b,0xad}, - {0x849c,0x0b}, - {0x849d,0x7c}, - {0x849e,0x00}, - {0x849f,0xef}, - {0x84a0,0xb5}, - {0x84a1,0x05}, - {0x84a2,0x07}, - {0x84a3,0xec}, - {0x84a4,0xb5}, - {0x84a5,0x06}, - {0x84a6,0x03}, - {0x84a7,0xd3}, - {0x84a8,0x80}, - {0x84a9,0x02}, - {0x84aa,0xa2}, - {0x84ab,0x1d}, - {0x84ac,0x92}, - {0x84ad,0x1d}, - {0x84ae,0xe5}, - {0x84af,0x4b}, - {0x84b0,0x12}, - {0x84b1,0x01}, - {0x84b2,0xe0}, - {0x84b3,0xef}, - {0x84b4,0xb5}, - {0x84b5,0x05}, - {0x84b6,0x07}, - {0x84b7,0xee}, - {0x84b8,0xb5}, - {0x84b9,0x04}, - {0x84ba,0x03}, - {0x84bb,0xd3}, - {0x84bc,0x80}, - {0x84bd,0x02}, - {0x84be,0xa2}, - {0x84bf,0x1c}, - {0x84c0,0x92}, - {0x84c1,0x1c}, - {0x84c2,0xe5}, - {0x84c3,0x4a}, - {0x84c4,0x12}, - {0x84c5,0x01}, - {0x84c6,0xe0}, - {0x84c7,0x7c}, - {0x84c8,0x00}, - {0x84c9,0xef}, - {0x84ca,0xb5}, - {0x84cb,0x0b}, - {0x84cc,0x07}, - {0x84cd,0xec}, - {0x84ce,0xb5}, - {0x84cf,0x06}, - {0x84d0,0x03}, - {0x84d1,0xd3}, - {0x84d2,0x80}, - {0x84d3,0x02}, - {0x84d4,0xa2}, - {0x84d5,0x1b}, - {0x84d6,0x92}, - {0x84d7,0x1b}, - {0x84d8,0xe5}, - {0x84d9,0x30}, - {0x84da,0xd3}, - {0x84db,0x94}, - {0x84dc,0x00}, - {0x84dd,0x40}, - {0x84de,0x04}, - {0x84df,0xa2}, - {0x84e0,0x1f}, - {0x84e1,0x80}, - {0x84e2,0x01}, - {0x84e3,0xc3}, - {0x84e4,0x92}, - {0x84e5,0x1f}, - {0x84e6,0xe5}, - {0x84e7,0x2f}, - {0x84e8,0xd3}, - {0x84e9,0x94}, - {0x84ea,0x00}, - {0x84eb,0x40}, - {0x84ec,0x04}, - {0x84ed,0xa2}, - {0x84ee,0x1e}, - {0x84ef,0x80}, - {0x84f0,0x01}, - {0x84f1,0xc3}, - {0x84f2,0x92}, - {0x84f3,0x1e}, - {0x84f4,0xe5}, - {0x84f5,0x2e}, - {0x84f6,0xd3}, - {0x84f7,0x94}, - {0x84f8,0x00}, - {0x84f9,0x40}, - {0x84fa,0x04}, - {0x84fb,0xa2}, - {0x84fc,0x1d}, - {0x84fd,0x80}, - {0x84fe,0x01}, - {0x84ff,0xc3}, - {0x8500,0x92}, - {0x8501,0x1d}, - {0x8502,0xe5}, - {0x8503,0x2d}, - {0x8504,0xd3}, - {0x8505,0x94}, - {0x8506,0x00}, - {0x8507,0x40}, - {0x8508,0x04}, - {0x8509,0xa2}, - {0x850a,0x1c}, - {0x850b,0x80}, - {0x850c,0x01}, - {0x850d,0xc3}, - {0x850e,0x92}, - {0x850f,0x1c}, - {0x8510,0xe5}, - {0x8511,0x2c}, - {0x8512,0xd3}, - {0x8513,0x94}, - {0x8514,0x00}, - {0x8515,0x40}, - {0x8516,0x04}, - {0x8517,0xa2}, - {0x8518,0x1b}, - {0x8519,0x80}, - {0x851a,0x01}, - {0x851b,0xc3}, - {0x851c,0x92}, - {0x851d,0x1b}, - {0x851e,0x85}, - {0x851f,0x0a}, - {0x8520,0x78}, - {0x8521,0xe5}, - {0x8522,0x7c}, - {0x8523,0xb5}, - {0x8524,0x0b}, - {0x8525,0x03}, - {0x8526,0x02}, - {0x8527,0x16}, - {0x8528,0x5f}, - {0x8529,0x85}, - {0x852a,0x0b}, - {0x852b,0x0c}, - {0x852c,0x12}, - {0x852d,0x0f}, - {0x852e,0x52}, - {0x852f,0xd2}, - {0x8530,0x02}, - {0x8531,0xc2}, - {0x8532,0x01}, - {0x8533,0xd2}, - {0x8534,0x00}, - {0x8535,0x75}, - {0x8536,0x31}, - {0x8537,0x03}, - {0x8538,0x22}, - {0x8539,0xe5}, - {0x853a,0x7d}, - {0x853b,0x24}, - {0x853c,0xfe}, - {0x853d,0x60}, - {0x853e,0x27}, - {0x853f,0x14}, - {0x8540,0x60}, - {0x8541,0x31}, - {0x8542,0x24}, - {0x8543,0xf8}, - {0x8544,0x60}, - {0x8545,0x3a}, - {0x8546,0x14}, - {0x8547,0x60}, - {0x8548,0x4b}, - {0x8549,0x14}, - {0x854a,0x60}, - {0x854b,0x59}, - {0x854c,0x14}, - {0x854d,0x60}, - {0x854e,0x6a}, - {0x854f,0x24}, - {0x8550,0xfd}, - {0x8551,0x70}, - {0x8552,0x03}, - {0x8553,0x02}, - {0x8554,0x05}, - {0x8555,0xee}, - {0x8556,0x24}, - {0x8557,0x10}, - {0x8558,0x60}, - {0x8559,0x03}, - {0x855a,0x02}, - {0x855b,0x06}, - {0x855c,0xe9}, - {0x855d,0xe4}, - {0x855e,0xf5}, - {0x855f,0x0a}, - {0x8560,0x12}, - {0x8561,0x12}, - {0x8562,0x48}, - {0x8563,0x02}, - {0x8564,0x06}, - {0x8565,0xd2}, - {0x8566,0x75}, - {0x8567,0x0a}, - {0x8568,0x01}, - {0x8569,0x12}, - {0x856a,0x06}, - {0x856b,0xea}, - {0x856c,0xc2}, - {0x856d,0x3c}, - {0x856e,0xd2}, - {0x856f,0x3b}, - {0x8570,0x02}, - {0x8571,0x06}, - {0x8572,0xe3}, - {0x8573,0x75}, - {0x8574,0x0a}, - {0x8575,0x02}, - {0x8576,0x12}, - {0x8577,0x06}, - {0x8578,0xea}, - {0x8579,0xd2}, - {0x857a,0x3c}, - {0x857b,0xc2}, - {0x857c,0x3b}, - {0x857d,0x02}, - {0x857e,0x06}, - {0x857f,0xe3}, - {0x8580,0x30}, - {0x8581,0x38}, - {0x8582,0x0c}, - {0x8583,0x20}, - {0x8584,0x3c}, - {0x8585,0x03}, - {0x8586,0x30}, - {0x8587,0x3b}, - {0x8588,0x06}, - {0x8589,0xe4}, - {0x858a,0xf5}, - {0x858b,0x0a}, - {0x858c,0x12}, - {0x858d,0x14}, - {0x858e,0x78}, - {0x858f,0xd2}, - {0x8590,0x18}, - {0x8591,0xc2}, - {0x8592,0x19}, - {0x8593,0x22}, - {0x8594,0x30}, - {0x8595,0x38}, - {0x8596,0x09}, - {0x8597,0x20}, - {0x8598,0x3c}, - {0x8599,0x03}, - {0x859a,0x30}, - {0x859b,0x3b}, - {0x859c,0x03}, - {0x859d,0x12}, - {0x859e,0x06}, - {0x859f,0xfb}, - {0x85a0,0xd2}, - {0x85a1,0x18}, - {0x85a2,0xd2}, - {0x85a3,0x19}, - {0x85a4,0x22}, - {0x85a5,0x30}, - {0x85a6,0x38}, - {0x85a7,0x0c}, - {0x85a8,0x20}, - {0x85a9,0x3c}, - {0x85aa,0x03}, - {0x85ab,0x30}, - {0x85ac,0x3b}, - {0x85ad,0x06}, - {0x85ae,0x75}, - {0x85af,0x0a}, - {0x85b0,0x02}, - {0x85b1,0x12}, - {0x85b2,0x14}, - {0x85b3,0x78}, - {0x85b4,0xc2}, - {0x85b5,0x18}, - {0x85b6,0xd2}, - {0x85b7,0x19}, - {0x85b8,0x22}, - {0x85b9,0x20}, - {0x85ba,0x3c}, - {0x85bb,0x06}, - {0x85bc,0x20}, - {0x85bd,0x3b}, - {0x85be,0x03}, - {0x85bf,0x02}, - {0x85c0,0x06}, - {0x85c1,0xe9}, - {0x85c2,0xe5}, - {0x85c3,0x78}, - {0x85c4,0xd3}, - {0x85c5,0x94}, - {0x85c6,0x03}, - {0x85c7,0x40}, - {0x85c8,0x04}, - {0x85c9,0x7f}, - {0x85ca,0x00}, - {0x85cb,0x80}, - {0x85cc,0x04}, - {0x85cd,0xe5}, - {0x85ce,0x78}, - {0x85cf,0x04}, - {0x85d0,0xff}, - {0x85d1,0x8f}, - {0x85d2,0x78}, - {0x85d3,0x30}, - {0x85d4,0x18}, - {0x85d5,0x06}, - {0x85d6,0x30}, - {0x85d7,0x19}, - {0x85d8,0x03}, - {0x85d9,0x12}, - {0x85da,0x06}, - {0x85db,0xfb}, - {0x85dc,0x30}, - {0x85dd,0x18}, - {0x85de,0x03}, - {0x85df,0x02}, - {0x85e0,0x06}, - {0x85e1,0xe9}, - {0x85e2,0x20}, - {0x85e3,0x19}, - {0x85e4,0x03}, - {0x85e5,0x02}, - {0x85e6,0x06}, - {0x85e7,0xe9}, - {0x85e8,0x75}, - {0x85e9,0x0a}, - {0x85ea,0x02}, - {0x85eb,0x02}, - {0x85ec,0x14}, - {0x85ed,0x78}, - {0x85ee,0xe5}, - {0x85ef,0x67}, - {0x85f0,0xd3}, - {0x85f1,0x94}, - {0x85f2,0x38}, - {0x85f3,0x40}, - {0x85f4,0x04}, - {0x85f5,0x7f}, - {0x85f6,0x34}, - {0x85f7,0x80}, - {0x85f8,0x02}, - {0x85f9,0xaf}, - {0x85fa,0x67}, - {0x85fb,0x8f}, - {0x85fc,0x67}, - {0x85fd,0xe5}, - {0x85fe,0x67}, - {0x85ff,0xc3}, - {0x8600,0x94}, - {0x8601,0x08}, - {0x8602,0x50}, - {0x8603,0x04}, - {0x8604,0x7f}, - {0x8605,0x08}, - {0x8606,0x80}, - {0x8607,0x02}, - {0x8608,0xaf}, - {0x8609,0x67}, - {0x860a,0x8f}, - {0x860b,0x67}, - {0x860c,0xe5}, - {0x860d,0x68}, - {0x860e,0xd3}, - {0x860f,0x94}, - {0x8610,0x2a}, - {0x8611,0x40}, - {0x8612,0x04}, - {0x8613,0x7f}, - {0x8614,0x2a}, - {0x8615,0x80}, - {0x8616,0x02}, - {0x8617,0xaf}, - {0x8618,0x68}, - {0x8619,0x8f}, - {0x861a,0x68}, - {0x861b,0xe5}, - {0x861c,0x68}, - {0x861d,0xc3}, - {0x861e,0x94}, - {0x861f,0x06}, - {0x8620,0x50}, - {0x8621,0x04}, - {0x8622,0x7f}, - {0x8623,0x06}, - {0x8624,0x80}, - {0x8625,0x02}, - {0x8626,0xaf}, - {0x8627,0x68}, - {0x8628,0x8f}, - {0x8629,0x68}, - {0x862a,0xaf}, - {0x862b,0x67}, - {0x862c,0xef}, - {0x862d,0x24}, - {0x862e,0xf8}, - {0x862f,0xff}, - {0x8630,0xe4}, - {0x8631,0x34}, - {0x8632,0xff}, - {0x8633,0xfe}, - {0x8634,0xe4}, - {0x8635,0x8f}, - {0x8636,0x3f}, - {0x8637,0x8e}, - {0x8638,0x3e}, - {0x8639,0xf5}, - {0x863a,0x3d}, - {0x863b,0xf5}, - {0x863c,0x3c}, - {0x863d,0xac}, - {0x863e,0x3c}, - {0x863f,0x12}, - {0x8640,0x01}, - {0x8641,0x90}, - {0x8642,0xaf}, - {0x8643,0x68}, - {0x8644,0xef}, - {0x8645,0x24}, - {0x8646,0xfa}, - {0x8647,0xff}, - {0x8648,0xe4}, - {0x8649,0x34}, - {0x864a,0xff}, - {0x864b,0x12}, - {0x864c,0x01}, - {0x864d,0x73}, - {0x864e,0xaf}, - {0x864f,0x67}, - {0x8650,0xef}, - {0x8651,0x24}, - {0x8652,0x08}, - {0x8653,0xff}, - {0x8654,0xe4}, - {0x8655,0x33}, - {0x8656,0x12}, - {0x8657,0x01}, - {0x8658,0x73}, - {0x8659,0xaf}, - {0x865a,0x68}, - {0x865b,0xef}, - {0x865c,0x24}, - {0x865d,0x06}, - {0x865e,0xff}, - {0x865f,0xe4}, - {0x8660,0x33}, - {0x8661,0xfe}, - {0x8662,0xe4}, - {0x8663,0xfc}, - {0x8664,0xfd}, - {0x8665,0xe5}, - {0x8666,0x3f}, - {0x8667,0x2f}, - {0x8668,0xf5}, - {0x8669,0x3f}, - {0x866a,0xe5}, - {0x866b,0x3e}, - {0x866c,0x3e}, - {0x866d,0xf5}, - {0x866e,0x3e}, - {0x866f,0xed}, - {0x8670,0x35}, - {0x8671,0x3d}, - {0x8672,0xf5}, - {0x8673,0x3d}, - {0x8674,0xec}, - {0x8675,0x35}, - {0x8676,0x3c}, - {0x8677,0xf5}, - {0x8678,0x3c}, - {0x8679,0xe4}, - {0x867a,0x25}, - {0x867b,0x3f}, - {0x867c,0xf5}, - {0x867d,0x37}, - {0x867e,0xe4}, - {0x867f,0x35}, - {0x8680,0x3e}, - {0x8681,0xf5}, - {0x8682,0x36}, - {0x8683,0xe4}, - {0x8684,0x35}, - {0x8685,0x3d}, - {0x8686,0xf5}, - {0x8687,0x35}, - {0x8688,0xe5}, - {0x8689,0x3c}, - {0x868a,0x34}, - {0x868b,0x08}, - {0x868c,0xf5}, - {0x868d,0x34}, - {0x868e,0xe4}, - {0x868f,0x25}, - {0x8690,0x3f}, - {0x8691,0xf5}, - {0x8692,0x3b}, - {0x8693,0xe4}, - {0x8694,0x35}, - {0x8695,0x3e}, - {0x8696,0xf5}, - {0x8697,0x3a}, - {0x8698,0xe5}, - {0x8699,0x3d}, - {0x869a,0x34}, - {0x869b,0x06}, - {0x869c,0xf5}, - {0x869d,0x39}, - {0x869e,0xe4}, - {0x869f,0x35}, - {0x86a0,0x3c}, - {0x86a1,0xf5}, - {0x86a2,0x38}, - {0x86a3,0xe5}, - {0x86a4,0x3f}, - {0x86a5,0x24}, - {0x86a6,0xfa}, - {0x86a7,0xf5}, - {0x86a8,0x43}, - {0x86a9,0xe5}, - {0x86aa,0x3e}, - {0x86ab,0x34}, - {0x86ac,0xff}, - {0x86ad,0xf5}, - {0x86ae,0x42}, - {0x86af,0xe5}, - {0x86b0,0x3d}, - {0x86b1,0x34}, - {0x86b2,0xff}, - {0x86b3,0xf5}, - {0x86b4,0x41}, - {0x86b5,0xe5}, - {0x86b6,0x3c}, - {0x86b7,0x34}, - {0x86b8,0xff}, - {0x86b9,0xf5}, - {0x86ba,0x40}, - {0x86bb,0xe4}, - {0x86bc,0x25}, - {0x86bd,0x3f}, - {0x86be,0xf5}, - {0x86bf,0x47}, - {0x86c0,0xe5}, - {0x86c1,0x3e}, - {0x86c2,0x34}, - {0x86c3,0xf8}, - {0x86c4,0xf5}, - {0x86c5,0x46}, - {0x86c6,0xe5}, - {0x86c7,0x3d}, - {0x86c8,0x34}, - {0x86c9,0xff}, - {0x86ca,0xf5}, - {0x86cb,0x45}, - {0x86cc,0xe5}, - {0x86cd,0x3c}, - {0x86ce,0x34}, - {0x86cf,0xff}, - {0x86d0,0xf5}, - {0x86d1,0x44}, - {0x86d2,0x75}, - {0x86d3,0x78}, - {0x86d4,0x02}, - {0x86d5,0x75}, - {0x86d6,0x0a}, - {0x86d7,0x01}, - {0x86d8,0x12}, - {0x86d9,0x14}, - {0x86da,0x78}, - {0x86db,0xd2}, - {0x86dc,0x18}, - {0x86dd,0xd2}, - {0x86de,0x19}, - {0x86df,0xc2}, - {0x86e0,0x3c}, - {0x86e1,0xc2}, - {0x86e2,0x3b}, - {0x86e3,0xd2}, - {0x86e4,0x1a}, - {0x86e5,0xd2}, - {0x86e6,0x38}, - {0x86e7,0xd2}, - {0x86e8,0x30}, - {0x86e9,0x22}, - {0x86ea,0x12}, - {0x86eb,0x12}, - {0x86ec,0x48}, - {0x86ed,0x75}, - {0x86ee,0x78}, - {0x86ef,0x02}, - {0x86f0,0xe4}, - {0x86f1,0xf5}, - {0x86f2,0x0a}, - {0x86f3,0x12}, - {0x86f4,0x14}, - {0x86f5,0x78}, - {0x86f6,0xd2}, - {0x86f7,0x18}, - {0x86f8,0xc2}, - {0x86f9,0x19}, - {0x86fa,0x22}, - {0x86fb,0x75}, - {0x86fc,0x0a}, - {0x86fd,0x01}, - {0x86fe,0x12}, - {0x86ff,0x14}, - {0x8700,0x78}, - {0x8701,0x22}, - {0x8702,0x90}, - {0x8703,0x38}, - {0x8704,0x04}, - {0x8705,0xe0}, - {0x8706,0xfe}, - {0x8707,0xa3}, - {0x8708,0xe0}, - {0x8709,0xfd}, - {0x870a,0xed}, - {0x870b,0xff}, - {0x870c,0xee}, - {0x870d,0x54}, - {0x870e,0x0f}, - {0x870f,0xf5}, - {0x8710,0x0e}, - {0x8711,0x8f}, - {0x8712,0x0f}, - {0x8713,0xa3}, - {0x8714,0xe0}, - {0x8715,0xfe}, - {0x8716,0xa3}, - {0x8717,0xe0}, - {0x8718,0xfd}, - {0x8719,0xed}, - {0x871a,0xff}, - {0x871b,0xee}, - {0x871c,0x54}, - {0x871d,0x07}, - {0x871e,0xf5}, - {0x871f,0x10}, - {0x8720,0x8f}, - {0x8721,0x11}, - {0x8722,0xe5}, - {0x8723,0x0e}, - {0x8724,0xc4}, - {0x8725,0xf8}, - {0x8726,0x54}, - {0x8727,0xf0}, - {0x8728,0xc8}, - {0x8729,0x68}, - {0x872a,0xf5}, - {0x872b,0x0e}, - {0x872c,0xe5}, - {0x872d,0x0f}, - {0x872e,0xc4}, - {0x872f,0x54}, - {0x8730,0x0f}, - {0x8731,0x48}, - {0x8732,0xf5}, - {0x8733,0x0f}, - {0x8734,0xe5}, - {0x8735,0x10}, - {0x8736,0xc4}, - {0x8737,0xf8}, - {0x8738,0x54}, - {0x8739,0xf0}, - {0x873a,0xc8}, - {0x873b,0x68}, - {0x873c,0xf5}, - {0x873d,0x10}, - {0x873e,0xe5}, - {0x873f,0x11}, - {0x8740,0xc4}, - {0x8741,0x54}, - {0x8742,0x0f}, - {0x8743,0x48}, - {0x8744,0xf5}, - {0x8745,0x11}, - {0x8746,0xe4}, - {0x8747,0xf5}, - {0x8748,0x17}, - {0x8749,0x75}, - {0x874a,0x16}, - {0x874b,0x04}, - {0x874c,0x12}, - {0x874d,0x02}, - {0x874e,0x66}, - {0x874f,0x24}, - {0x8750,0x34}, - {0x8751,0xf8}, - {0x8752,0xe6}, - {0x8753,0xf5}, - {0x8754,0x12}, - {0x8755,0x12}, - {0x8756,0x02}, - {0x8757,0x66}, - {0x8758,0x24}, - {0x8759,0x35}, - {0x875a,0xf8}, - {0x875b,0xe6}, - {0x875c,0xf5}, - {0x875d,0x14}, - {0x875e,0x12}, - {0x875f,0x02}, - {0x8760,0x66}, - {0x8761,0x24}, - {0x8762,0x36}, - {0x8763,0xf8}, - {0x8764,0xe6}, - {0x8765,0xf5}, - {0x8766,0x13}, - {0x8767,0x12}, - {0x8768,0x02}, - {0x8769,0x66}, - {0x876a,0x24}, - {0x876b,0x37}, - {0x876c,0xf8}, - {0x876d,0xe6}, - {0x876e,0xf5}, - {0x876f,0x15}, - {0x8770,0x12}, - {0x8771,0x02}, - {0x8772,0x79}, - {0x8773,0xaf}, - {0x8774,0x12}, - {0x8775,0x12}, - {0x8776,0x01}, - {0x8777,0x42}, - {0x8778,0x8f}, - {0x8779,0x12}, - {0x877a,0x12}, - {0x877b,0x02}, - {0x877c,0x79}, - {0x877d,0xaf}, - {0x877e,0x13}, - {0x877f,0x12}, - {0x8780,0x01}, - {0x8781,0x42}, - {0x8782,0x8f}, - {0x8783,0x13}, - {0x8784,0x12}, - {0x8785,0x02}, - {0x8786,0x11}, - {0x8787,0xaf}, - {0x8788,0x14}, - {0x8789,0xfc}, - {0x878a,0xfd}, - {0x878b,0xfe}, - {0x878c,0x12}, - {0x878d,0x08}, - {0x878e,0xa2}, - {0x878f,0x12}, - {0x8790,0x01}, - {0x8791,0x61}, - {0x8792,0x7b}, - {0x8793,0x30}, - {0x8794,0x12}, - {0x8795,0x01}, - {0x8796,0x5a}, - {0x8797,0x8f}, - {0x8798,0x14}, - {0x8799,0x12}, - {0x879a,0x02}, - {0x879b,0x11}, - {0x879c,0xaf}, - {0x879d,0x15}, - {0x879e,0xfc}, - {0x879f,0xfd}, - {0x87a0,0xfe}, - {0x87a1,0x12}, - {0x87a2,0x08}, - {0x87a3,0xa2}, - {0x87a4,0x12}, - {0x87a5,0x01}, - {0x87a6,0x61}, - {0x87a7,0xe4}, - {0x87a8,0x7b}, - {0x87a9,0x30}, - {0x87aa,0x12}, - {0x87ab,0x01}, - {0x87ac,0x5b}, - {0x87ad,0x8f}, - {0x87ae,0x15}, - {0x87af,0xc3}, - {0x87b0,0xe5}, - {0x87b1,0x13}, - {0x87b2,0x95}, - {0x87b3,0x12}, - {0x87b4,0xff}, - {0x87b5,0x0f}, - {0x87b6,0xef}, - {0x87b7,0xc3}, - {0x87b8,0x13}, - {0x87b9,0xff}, - {0x87ba,0xc3}, - {0x87bb,0x94}, - {0x87bc,0x04}, - {0x87bd,0x50}, - {0x87be,0x27}, - {0x87bf,0xe5}, - {0x87c0,0x12}, - {0x87c1,0x9f}, - {0x87c2,0x40}, - {0x87c3,0x06}, - {0x87c4,0xe5}, - {0x87c5,0x12}, - {0x87c6,0x9f}, - {0x87c7,0xfe}, - {0x87c8,0x80}, - {0x87c9,0x02}, - {0x87ca,0x7e}, - {0x87cb,0x00}, - {0x87cc,0x8e}, - {0x87cd,0x12}, - {0x87ce,0xef}, - {0x87cf,0xfd}, - {0x87d0,0xe5}, - {0x87d1,0x13}, - {0x87d2,0x2d}, - {0x87d3,0xfd}, - {0x87d4,0xe4}, - {0x87d5,0x33}, - {0x87d6,0xfc}, - {0x87d7,0xc3}, - {0x87d8,0xed}, - {0x87d9,0x95}, - {0x87da,0x0f}, - {0x87db,0xec}, - {0x87dc,0x95}, - {0x87dd,0x0e}, - {0x87de,0x50}, - {0x87df,0x02}, - {0x87e0,0x80}, - {0x87e1,0x02}, - {0x87e2,0xad}, - {0x87e3,0x0f}, - {0x87e4,0x8d}, - {0x87e5,0x13}, - {0x87e6,0xc3}, - {0x87e7,0xe5}, - {0x87e8,0x15}, - {0x87e9,0x95}, - {0x87ea,0x14}, - {0x87eb,0xff}, - {0x87ec,0xc3}, - {0x87ed,0x94}, - {0x87ee,0x04}, - {0x87ef,0x50}, - {0x87f0,0x29}, - {0x87f1,0xe5}, - {0x87f2,0x14}, - {0x87f3,0x9f}, - {0x87f4,0x40}, - {0x87f5,0x06}, - {0x87f6,0xe5}, - {0x87f7,0x14}, - {0x87f8,0x9f}, - {0x87f9,0xfe}, - {0x87fa,0x80}, - {0x87fb,0x02}, - {0x87fc,0x7e}, - {0x87fd,0x00}, - {0x87fe,0x8e}, - {0x87ff,0x14}, - {0x8800,0xef}, - {0x8801,0xfd}, - {0x8802,0xe5}, - {0x8803,0x15}, - {0x8804,0x2d}, - {0x8805,0xfd}, - {0x8806,0xe4}, - {0x8807,0x33}, - {0x8808,0xfc}, - {0x8809,0xc3}, - {0x880a,0xed}, - {0x880b,0x95}, - {0x880c,0x11}, - {0x880d,0xec}, - {0x880e,0x95}, - {0x880f,0x10}, - {0x8810,0x50}, - {0x8811,0x04}, - {0x8812,0xaf}, - {0x8813,0x05}, - {0x8814,0x80}, - {0x8815,0x02}, - {0x8816,0xaf}, - {0x8817,0x11}, - {0x8818,0x8f}, - {0x8819,0x15}, - {0x881a,0xe5}, - {0x881b,0x15}, - {0x881c,0xd3}, - {0x881d,0x95}, - {0x881e,0x17}, - {0x881f,0x40}, - {0x8820,0x04}, - {0x8821,0xaf}, - {0x8822,0x15}, - {0x8823,0x80}, - {0x8824,0x02}, - {0x8825,0xaf}, - {0x8826,0x17}, - {0x8827,0x8f}, - {0x8828,0x17}, - {0x8829,0xd3}, - {0x882a,0xe5}, - {0x882b,0x16}, - {0x882c,0x64}, - {0x882d,0x80}, - {0x882e,0x94}, - {0x882f,0x80}, - {0x8830,0x40}, - {0x8831,0x04}, - {0x8832,0xaf}, - {0x8833,0x15}, - {0x8834,0x80}, - {0x8835,0x02}, - {0x8836,0xaf}, - {0x8837,0x17}, - {0x8838,0x8f}, - {0x8839,0x15}, - {0x883a,0xe5}, - {0x883b,0x16}, - {0x883c,0xfd}, - {0x883d,0x33}, - {0x883e,0x95}, - {0x883f,0xe0}, - {0x8840,0xfc}, - {0x8841,0xed}, - {0x8842,0xae}, - {0x8843,0x04}, - {0x8844,0x78}, - {0x8845,0x02}, - {0x8846,0xc3}, - {0x8847,0x33}, - {0x8848,0xce}, - {0x8849,0x33}, - {0x884a,0xce}, - {0x884b,0xd8}, - {0x884c,0xf9}, - {0x884d,0xff}, - {0x884e,0x24}, - {0x884f,0x01}, - {0x8850,0xfb}, - {0x8851,0xee}, - {0x8852,0x34}, - {0x8853,0x60}, - {0x8854,0x8b}, - {0x8855,0x82}, - {0x8856,0xf5}, - {0x8857,0x83}, - {0x8858,0xe5}, - {0x8859,0x12}, - {0x885a,0xf0}, - {0x885b,0xef}, - {0x885c,0x24}, - {0x885d,0x02}, - {0x885e,0xff}, - {0x885f,0xee}, - {0x8860,0x34}, - {0x8861,0x60}, - {0x8862,0x8f}, - {0x8863,0x82}, - {0x8864,0xf5}, - {0x8865,0x83}, - {0x8866,0xe5}, - {0x8867,0x14}, - {0x8868,0xf0}, - {0x8869,0xed}, - {0x886a,0xae}, - {0x886b,0x04}, - {0x886c,0x78}, - {0x886d,0x02}, - {0x886e,0xc3}, - {0x886f,0x33}, - {0x8870,0xce}, - {0x8871,0x33}, - {0x8872,0xce}, - {0x8873,0xd8}, - {0x8874,0xf9}, - {0x8875,0xff}, - {0x8876,0x24}, - {0x8877,0x03}, - {0x8878,0xfd}, - {0x8879,0xee}, - {0x887a,0x34}, - {0x887b,0x60}, - {0x887c,0x8d}, - {0x887d,0x82}, - {0x887e,0xf5}, - {0x887f,0x83}, - {0x8880,0xe5}, - {0x8881,0x13}, - {0x8882,0xf0}, - {0x8883,0xef}, - {0x8884,0x24}, - {0x8885,0x04}, - {0x8886,0xff}, - {0x8887,0xee}, - {0x8888,0x34}, - {0x8889,0x60}, - {0x888a,0x8f}, - {0x888b,0x82}, - {0x888c,0xf5}, - {0x888d,0x83}, - {0x888e,0xe5}, - {0x888f,0x15}, - {0x8890,0xf0}, - {0x8891,0x15}, - {0x8892,0x16}, - {0x8893,0xc3}, - {0x8894,0xe5}, - {0x8895,0x16}, - {0x8896,0x64}, - {0x8897,0x80}, - {0x8898,0x94}, - {0x8899,0x80}, - {0x889a,0x40}, - {0x889b,0x03}, - {0x889c,0x02}, - {0x889d,0x07}, - {0x889e,0x4c}, - {0x889f,0xc2}, - {0x88a0,0x30}, - {0x88a1,0x22}, - {0x88a2,0xe8}, - {0x88a3,0x8f}, - {0x88a4,0xf0}, - {0x88a5,0xa4}, - {0x88a6,0xcc}, - {0x88a7,0x8b}, - {0x88a8,0xf0}, - {0x88a9,0xa4}, - {0x88aa,0x2c}, - {0x88ab,0xfc}, - {0x88ac,0xe9}, - {0x88ad,0x8e}, - {0x88ae,0xf0}, - {0x88af,0xa4}, - {0x88b0,0x2c}, - {0x88b1,0xfc}, - {0x88b2,0x8a}, - {0x88b3,0xf0}, - {0x88b4,0xed}, - {0x88b5,0xa4}, - {0x88b6,0x2c}, - {0x88b7,0xfc}, - {0x88b8,0xea}, - {0x88b9,0x8e}, - {0x88ba,0xf0}, - {0x88bb,0xa4}, - {0x88bc,0xcd}, - {0x88bd,0xa8}, - {0x88be,0xf0}, - {0x88bf,0x8b}, - {0x88c0,0xf0}, - {0x88c1,0xa4}, - {0x88c2,0x2d}, - {0x88c3,0xcc}, - {0x88c4,0x38}, - {0x88c5,0x25}, - {0x88c6,0xf0}, - {0x88c7,0xfd}, - {0x88c8,0xe9}, - {0x88c9,0x8f}, - {0x88ca,0xf0}, - {0x88cb,0xa4}, - {0x88cc,0x2c}, - {0x88cd,0xcd}, - {0x88ce,0x35}, - {0x88cf,0xf0}, - {0x88d0,0xfc}, - {0x88d1,0xeb}, - {0x88d2,0x8e}, - {0x88d3,0xf0}, - {0x88d4,0xa4}, - {0x88d5,0xfe}, - {0x88d6,0xa9}, - {0x88d7,0xf0}, - {0x88d8,0xeb}, - {0x88d9,0x8f}, - {0x88da,0xf0}, - {0x88db,0xa4}, - {0x88dc,0xcf}, - {0x88dd,0xc5}, - {0x88de,0xf0}, - {0x88df,0x2e}, - {0x88e0,0xcd}, - {0x88e1,0x39}, - {0x88e2,0xfe}, - {0x88e3,0xe4}, - {0x88e4,0x3c}, - {0x88e5,0xfc}, - {0x88e6,0xea}, - {0x88e7,0xa4}, - {0x88e8,0x2d}, - {0x88e9,0xce}, - {0x88ea,0x35}, - {0x88eb,0xf0}, - {0x88ec,0xfd}, - {0x88ed,0xe4}, - {0x88ee,0x3c}, - {0x88ef,0xfc}, - {0x88f0,0x22}, - {0x88f1,0x75}, - {0x88f2,0xf0}, - {0x88f3,0x08}, - {0x88f4,0x75}, - {0x88f5,0x82}, - {0x88f6,0x00}, - {0x88f7,0xef}, - {0x88f8,0x2f}, - {0x88f9,0xff}, - {0x88fa,0xee}, - {0x88fb,0x33}, - {0x88fc,0xfe}, - {0x88fd,0xcd}, - {0x88fe,0x33}, - {0x88ff,0xcd}, - {0x8900,0xcc}, - {0x8901,0x33}, - {0x8902,0xcc}, - {0x8903,0xc5}, - {0x8904,0x82}, - {0x8905,0x33}, - {0x8906,0xc5}, - {0x8907,0x82}, - {0x8908,0x9b}, - {0x8909,0xed}, - {0x890a,0x9a}, - {0x890b,0xec}, - {0x890c,0x99}, - {0x890d,0xe5}, - {0x890e,0x82}, - {0x890f,0x98}, - {0x8910,0x40}, - {0x8911,0x0c}, - {0x8912,0xf5}, - {0x8913,0x82}, - {0x8914,0xee}, - {0x8915,0x9b}, - {0x8916,0xfe}, - {0x8917,0xed}, - {0x8918,0x9a}, - {0x8919,0xfd}, - {0x891a,0xec}, - {0x891b,0x99}, - {0x891c,0xfc}, - {0x891d,0x0f}, - {0x891e,0xd5}, - {0x891f,0xf0}, - {0x8920,0xd6}, - {0x8921,0xe4}, - {0x8922,0xce}, - {0x8923,0xfb}, - {0x8924,0xe4}, - {0x8925,0xcd}, - {0x8926,0xfa}, - {0x8927,0xe4}, - {0x8928,0xcc}, - {0x8929,0xf9}, - {0x892a,0xa8}, - {0x892b,0x82}, - {0x892c,0x22}, - {0x892d,0xb8}, - {0x892e,0x00}, - {0x892f,0xc1}, - {0x8930,0xb9}, - {0x8931,0x00}, - {0x8932,0x59}, - {0x8933,0xba}, - {0x8934,0x00}, - {0x8935,0x2d}, - {0x8936,0xec}, - {0x8937,0x8b}, - {0x8938,0xf0}, - {0x8939,0x84}, - {0x893a,0xcf}, - {0x893b,0xce}, - {0x893c,0xcd}, - {0x893d,0xfc}, - {0x893e,0xe5}, - {0x893f,0xf0}, - {0x8940,0xcb}, - {0x8941,0xf9}, - {0x8942,0x78}, - {0x8943,0x18}, - {0x8944,0xef}, - {0x8945,0x2f}, - {0x8946,0xff}, - {0x8947,0xee}, - {0x8948,0x33}, - {0x8949,0xfe}, - {0x894a,0xed}, - {0x894b,0x33}, - {0x894c,0xfd}, - {0x894d,0xec}, - {0x894e,0x33}, - {0x894f,0xfc}, - {0x8950,0xeb}, - {0x8951,0x33}, - {0x8952,0xfb}, - {0x8953,0x10}, - {0x8954,0xd7}, - {0x8955,0x03}, - {0x8956,0x99}, - {0x8957,0x40}, - {0x8958,0x04}, - {0x8959,0xeb}, - {0x895a,0x99}, - {0x895b,0xfb}, - {0x895c,0x0f}, - {0x895d,0xd8}, - {0x895e,0xe5}, - {0x895f,0xe4}, - {0x8960,0xf9}, - {0x8961,0xfa}, - {0x8962,0x22}, - {0x8963,0x78}, - {0x8964,0x18}, - {0x8965,0xef}, - {0x8966,0x2f}, - {0x8967,0xff}, - {0x8968,0xee}, - {0x8969,0x33}, - {0x896a,0xfe}, - {0x896b,0xed}, - {0x896c,0x33}, - {0x896d,0xfd}, - {0x896e,0xec}, - {0x896f,0x33}, - {0x8970,0xfc}, - {0x8971,0xc9}, - {0x8972,0x33}, - {0x8973,0xc9}, - {0x8974,0x10}, - {0x8975,0xd7}, - {0x8976,0x05}, - {0x8977,0x9b}, - {0x8978,0xe9}, - {0x8979,0x9a}, - {0x897a,0x40}, - {0x897b,0x07}, - {0x897c,0xec}, - {0x897d,0x9b}, - {0x897e,0xfc}, - {0x897f,0xe9}, - {0x8980,0x9a}, - {0x8981,0xf9}, - {0x8982,0x0f}, - {0x8983,0xd8}, - {0x8984,0xe0}, - {0x8985,0xe4}, - {0x8986,0xc9}, - {0x8987,0xfa}, - {0x8988,0xe4}, - {0x8989,0xcc}, - {0x898a,0xfb}, - {0x898b,0x22}, - {0x898c,0x75}, - {0x898d,0xf0}, - {0x898e,0x10}, - {0x898f,0xef}, - {0x8990,0x2f}, - {0x8991,0xff}, - {0x8992,0xee}, - {0x8993,0x33}, - {0x8994,0xfe}, - {0x8995,0xed}, - {0x8996,0x33}, - {0x8997,0xfd}, - {0x8998,0xcc}, - {0x8999,0x33}, - {0x899a,0xcc}, - {0x899b,0xc8}, - {0x899c,0x33}, - {0x899d,0xc8}, - {0x899e,0x10}, - {0x899f,0xd7}, - {0x89a0,0x07}, - {0x89a1,0x9b}, - {0x89a2,0xec}, - {0x89a3,0x9a}, - {0x89a4,0xe8}, - {0x89a5,0x99}, - {0x89a6,0x40}, - {0x89a7,0x0a}, - {0x89a8,0xed}, - {0x89a9,0x9b}, - {0x89aa,0xfd}, - {0x89ab,0xec}, - {0x89ac,0x9a}, - {0x89ad,0xfc}, - {0x89ae,0xe8}, - {0x89af,0x99}, - {0x89b0,0xf8}, - {0x89b1,0x0f}, - {0x89b2,0xd5}, - {0x89b3,0xf0}, - {0x89b4,0xda}, - {0x89b5,0xe4}, - {0x89b6,0xcd}, - {0x89b7,0xfb}, - {0x89b8,0xe4}, - {0x89b9,0xcc}, - {0x89ba,0xfa}, - {0x89bb,0xe4}, - {0x89bc,0xc8}, - {0x89bd,0xf9}, - {0x89be,0x22}, - {0x89bf,0xe8}, - {0x89c0,0x60}, - {0x89c1,0x0f}, - {0x89c2,0xec}, - {0x89c3,0xc3}, - {0x89c4,0x13}, - {0x89c5,0xfc}, - {0x89c6,0xed}, - {0x89c7,0x13}, - {0x89c8,0xfd}, - {0x89c9,0xee}, - {0x89ca,0x13}, - {0x89cb,0xfe}, - {0x89cc,0xef}, - {0x89cd,0x13}, - {0x89ce,0xff}, - {0x89cf,0xd8}, - {0x89d0,0xf1}, - {0x89d1,0x22}, - {0x89d2,0xe8}, - {0x89d3,0x60}, - {0x89d4,0x0f}, - {0x89d5,0xef}, - {0x89d6,0xc3}, - {0x89d7,0x33}, - {0x89d8,0xff}, - {0x89d9,0xee}, - {0x89da,0x33}, - {0x89db,0xfe}, - {0x89dc,0xed}, - {0x89dd,0x33}, - {0x89de,0xfd}, - {0x89df,0xec}, - {0x89e0,0x33}, - {0x89e1,0xfc}, - {0x89e2,0xd8}, - {0x89e3,0xf1}, - {0x89e4,0x22}, - {0x89e5,0xe4}, - {0x89e6,0x93}, - {0x89e7,0xfc}, - {0x89e8,0x74}, - {0x89e9,0x01}, - {0x89ea,0x93}, - {0x89eb,0xfd}, - {0x89ec,0x74}, - {0x89ed,0x02}, - {0x89ee,0x93}, - {0x89ef,0xfe}, - {0x89f0,0x74}, - {0x89f1,0x03}, - {0x89f2,0x93}, - {0x89f3,0xff}, - {0x89f4,0x22}, - {0x89f5,0xd0}, - {0x89f6,0x83}, - {0x89f7,0xd0}, - {0x89f8,0x82}, - {0x89f9,0xf8}, - {0x89fa,0xe4}, - {0x89fb,0x93}, - {0x89fc,0x70}, - {0x89fd,0x12}, - {0x89fe,0x74}, - {0x89ff,0x01}, - {0x8a00,0x93}, - {0x8a01,0x70}, - {0x8a02,0x0d}, - {0x8a03,0xa3}, - {0x8a04,0xa3}, - {0x8a05,0x93}, - {0x8a06,0xf8}, - {0x8a07,0x74}, - {0x8a08,0x01}, - {0x8a09,0x93}, - {0x8a0a,0xf5}, - {0x8a0b,0x82}, - {0x8a0c,0x88}, - {0x8a0d,0x83}, - {0x8a0e,0xe4}, - {0x8a0f,0x73}, - {0x8a10,0x74}, - {0x8a11,0x02}, - {0x8a12,0x93}, - {0x8a13,0x68}, - {0x8a14,0x60}, - {0x8a15,0xef}, - {0x8a16,0xa3}, - {0x8a17,0xa3}, - {0x8a18,0xa3}, - {0x8a19,0x80}, - {0x8a1a,0xdf}, - {0x8a1b,0x75}, - {0x8a1c,0x12}, - {0x8a1d,0x0a}, - {0x8a1e,0xa2}, - {0x8a1f,0xaf}, - {0x8a20,0x92}, - {0x8a21,0x32}, - {0x8a22,0xc2}, - {0x8a23,0xaf}, - {0x8a24,0xc2}, - {0x8a25,0x33}, - {0x8a26,0x12}, - {0x8a27,0x01}, - {0x8a28,0x6a}, - {0x8a29,0x12}, - {0x8a2a,0x02}, - {0x8a2b,0x08}, - {0x8a2c,0x12}, - {0x8a2d,0x01}, - {0x8a2e,0x6a}, - {0x8a2f,0x75}, - {0x8a30,0x51}, - {0x8a31,0x05}, - {0x8a32,0xaf}, - {0x8a33,0x51}, - {0x8a34,0x15}, - {0x8a35,0x51}, - {0x8a36,0xef}, - {0x8a37,0x70}, - {0x8a38,0xf9}, - {0x8a39,0xd2}, - {0x8a3a,0x28}, - {0x8a3b,0x12}, - {0x8a3c,0x01}, - {0x8a3d,0x6c}, - {0x8a3e,0x75}, - {0x8a3f,0x51}, - {0x8a40,0x0a}, - {0x8a41,0xaf}, - {0x8a42,0x51}, - {0x8a43,0x15}, - {0x8a44,0x51}, - {0x8a45,0xef}, - {0x8a46,0x70}, - {0x8a47,0xf9}, - {0x8a48,0xc2}, - {0x8a49,0x29}, - {0x8a4a,0x12}, - {0x8a4b,0x01}, - {0x8a4c,0x6c}, - {0x8a4d,0x75}, - {0x8a4e,0x51}, - {0x8a4f,0x05}, - {0x8a50,0xaf}, - {0x8a51,0x51}, - {0x8a52,0x15}, - {0x8a53,0x51}, - {0x8a54,0xef}, - {0x8a55,0x70}, - {0x8a56,0xf9}, - {0x8a57,0xc2}, - {0x8a58,0x28}, - {0x8a59,0x12}, - {0x8a5a,0x01}, - {0x8a5b,0x6c}, - {0x8a5c,0x75}, - {0x8a5d,0x51}, - {0x8a5e,0x05}, - {0x8a5f,0xaf}, - {0x8a60,0x51}, - {0x8a61,0x15}, - {0x8a62,0x51}, - {0x8a63,0xef}, - {0x8a64,0x70}, - {0x8a65,0xf9}, - {0x8a66,0x75}, - {0x8a67,0x13}, - {0x8a68,0x18}, - {0x8a69,0x12}, - {0x8a6a,0x0b}, - {0x8a6b,0x5b}, - {0x8a6c,0x75}, - {0x8a6d,0x51}, - {0x8a6e,0x0a}, - {0x8a6f,0xaf}, - {0x8a70,0x51}, - {0x8a71,0x15}, - {0x8a72,0x51}, - {0x8a73,0xef}, - {0x8a74,0x70}, - {0x8a75,0xf9}, - {0x8a76,0xd2}, - {0x8a77,0x28}, - {0x8a78,0x12}, - {0x8a79,0x01}, - {0x8a7a,0x6c}, - {0x8a7b,0x12}, - {0x8a7c,0x02}, - {0x8a7d,0x25}, - {0x8a7e,0xaf}, - {0x8a7f,0x51}, - {0x8a80,0x15}, - {0x8a81,0x51}, - {0x8a82,0xef}, - {0x8a83,0x70}, - {0x8a84,0xf9}, - {0x8a85,0xc2}, - {0x8a86,0x28}, - {0x8a87,0x12}, - {0x8a88,0x01}, - {0x8a89,0x6c}, - {0x8a8a,0x75}, - {0x8a8b,0x51}, - {0x8a8c,0x0a}, - {0x8a8d,0xaf}, - {0x8a8e,0x51}, - {0x8a8f,0x15}, - {0x8a90,0x51}, - {0x8a91,0xef}, - {0x8a92,0x70}, - {0x8a93,0xf9}, - {0x8a94,0x30}, - {0x8a95,0x11}, - {0x8a96,0x03}, - {0x8a97,0x02}, - {0x8a98,0x0b}, - {0x8a99,0x12}, - {0x8a9a,0x12}, - {0x8a9b,0x01}, - {0x8a9c,0x6a}, - {0x8a9d,0x12}, - {0x8a9e,0x02}, - {0x8a9f,0x08}, - {0x8aa0,0xe5}, - {0x8aa1,0x10}, - {0x8aa2,0xf5}, - {0x8aa3,0x13}, - {0x8aa4,0x12}, - {0x8aa5,0x0b}, - {0x8aa6,0x5b}, - {0x8aa7,0x75}, - {0x8aa8,0x51}, - {0x8aa9,0x0a}, - {0x8aaa,0xaf}, - {0x8aab,0x51}, - {0x8aac,0x15}, - {0x8aad,0x51}, - {0x8aae,0xef}, - {0x8aaf,0x70}, - {0x8ab0,0xf9}, - {0x8ab1,0xd2}, - {0x8ab2,0x28}, - {0x8ab3,0x12}, - {0x8ab4,0x01}, - {0x8ab5,0x6c}, - {0x8ab6,0x12}, - {0x8ab7,0x02}, - {0x8ab8,0x25}, - {0x8ab9,0xaf}, - {0x8aba,0x51}, - {0x8abb,0x15}, - {0x8abc,0x51}, - {0x8abd,0xef}, - {0x8abe,0x70}, - {0x8abf,0xf9}, - {0x8ac0,0xc2}, - {0x8ac1,0x28}, - {0x8ac2,0x12}, - {0x8ac3,0x01}, - {0x8ac4,0x6c}, - {0x8ac5,0x75}, - {0x8ac6,0x51}, - {0x8ac7,0x0a}, - {0x8ac8,0xaf}, - {0x8ac9,0x51}, - {0x8aca,0x15}, - {0x8acb,0x51}, - {0x8acc,0xef}, - {0x8acd,0x70}, - {0x8ace,0xf9}, - {0x8acf,0x30}, - {0x8ad0,0x11}, - {0x8ad1,0x04}, - {0x8ad2,0x15}, - {0x8ad3,0x12}, - {0x8ad4,0x80}, - {0x8ad5,0x45}, - {0x8ad6,0x12}, - {0x8ad7,0x01}, - {0x8ad8,0x6a}, - {0x8ad9,0x12}, - {0x8ada,0x02}, - {0x8adb,0x08}, - {0x8adc,0x85}, - {0x8add,0x11}, - {0x8ade,0x13}, - {0x8adf,0x12}, - {0x8ae0,0x15}, - {0x8ae1,0xa4}, - {0x8ae2,0xc2}, - {0x8ae3,0x09}, - {0x8ae4,0x12}, - {0x8ae5,0x02}, - {0x8ae6,0x0a}, - {0x8ae7,0x75}, - {0x8ae8,0x51}, - {0x8ae9,0x0a}, - {0x8aea,0xaf}, - {0x8aeb,0x51}, - {0x8aec,0x15}, - {0x8aed,0x51}, - {0x8aee,0xef}, - {0x8aef,0x70}, - {0x8af0,0xf9}, - {0x8af1,0xd2}, - {0x8af2,0x28}, - {0x8af3,0x12}, - {0x8af4,0x01}, - {0x8af5,0x6c}, - {0x8af6,0x12}, - {0x8af7,0x02}, - {0x8af8,0x25}, - {0x8af9,0xaf}, - {0x8afa,0x51}, - {0x8afb,0x15}, - {0x8afc,0x51}, - {0x8afd,0xef}, - {0x8afe,0x70}, - {0x8aff,0xf9}, - {0x8b00,0xc2}, - {0x8b01,0x28}, - {0x8b02,0x12}, - {0x8b03,0x01}, - {0x8b04,0x6c}, - {0x8b05,0x75}, - {0x8b06,0x51}, - {0x8b07,0x0a}, - {0x8b08,0xaf}, - {0x8b09,0x51}, - {0x8b0a,0x15}, - {0x8b0b,0x51}, - {0x8b0c,0xef}, - {0x8b0d,0x70}, - {0x8b0e,0xf9}, - {0x8b0f,0x30}, - {0x8b10,0x11}, - {0x8b11,0x06}, - {0x8b12,0x15}, - {0x8b13,0x12}, - {0x8b14,0xd2}, - {0x8b15,0x33}, - {0x8b16,0x80}, - {0x8b17,0x03}, - {0x8b18,0xe4}, - {0x8b19,0xf5}, - {0x8b1a,0x12}, - {0x8b1b,0x12}, - {0x8b1c,0x01}, - {0x8b1d,0x6a}, - {0x8b1e,0x12}, - {0x8b1f,0x02}, - {0x8b20,0x08}, - {0x8b21,0xc2}, - {0x8b22,0x29}, - {0x8b23,0x12}, - {0x8b24,0x01}, - {0x8b25,0x6c}, - {0x8b26,0x75}, - {0x8b27,0x51}, - {0x8b28,0x05}, - {0x8b29,0xaf}, - {0x8b2a,0x51}, - {0x8b2b,0x15}, - {0x8b2c,0x51}, - {0x8b2d,0xef}, - {0x8b2e,0x70}, - {0x8b2f,0xf9}, - {0x8b30,0xd2}, - {0x8b31,0x28}, - {0x8b32,0x12}, - {0x8b33,0x01}, - {0x8b34,0x6c}, - {0x8b35,0x75}, - {0x8b36,0x51}, - {0x8b37,0x05}, - {0x8b38,0xaf}, - {0x8b39,0x51}, - {0x8b3a,0x15}, - {0x8b3b,0x51}, - {0x8b3c,0xef}, - {0x8b3d,0x70}, - {0x8b3e,0xf9}, - {0x8b3f,0x12}, - {0x8b40,0x01}, - {0x8b41,0x6a}, - {0x8b42,0x75}, - {0x8b43,0x51}, - {0x8b44,0x05}, - {0x8b45,0xaf}, - {0x8b46,0x51}, - {0x8b47,0x15}, - {0x8b48,0x51}, - {0x8b49,0xef}, - {0x8b4a,0x70}, - {0x8b4b,0xf9}, - {0x8b4c,0xa2}, - {0x8b4d,0x32}, - {0x8b4e,0x92}, - {0x8b4f,0xaf}, - {0x8b50,0xe5}, - {0x8b51,0x12}, - {0x8b52,0xd3}, - {0x8b53,0x94}, - {0x8b54,0x00}, - {0x8b55,0x40}, - {0x8b56,0x03}, - {0x8b57,0x02}, - {0x8b58,0x0a}, - {0x8b59,0x22}, - {0x8b5a,0x22}, - {0x8b5b,0x12}, - {0x8b5c,0x15}, - {0x8b5d,0xa4}, - {0x8b5e,0xc2}, - {0x8b5f,0x09}, - {0x8b60,0x90}, - {0x8b61,0x30}, - {0x8b62,0x18}, - {0x8b63,0xe5}, - {0x8b64,0x21}, - {0x8b65,0xf0}, - {0x8b66,0x22}, - {0x8b67,0xe5}, - {0x8b68,0x33}, - {0x8b69,0x70}, - {0x8b6a,0x03}, - {0x8b6b,0x02}, - {0x8b6c,0x0c}, - {0x8b6d,0x8f}, - {0x8b6e,0xc2}, - {0x8b6f,0xaf}, - {0x8b70,0xaf}, - {0x8b71,0x33}, - {0x8b72,0xe4}, - {0x8b73,0xf5}, - {0x8b74,0x33}, - {0x8b75,0xd2}, - {0x8b76,0xaf}, - {0x8b77,0x90}, - {0x8b78,0x30}, - {0x8b79,0x25}, - {0x8b7a,0xe0}, - {0x8b7b,0xf5}, - {0x8b7c,0x7d}, - {0x8b7d,0x90}, - {0x8b7e,0x50}, - {0x8b7f,0x82}, - {0x8b80,0xe0}, - {0x8b81,0xf5}, - {0x8b82,0x65}, - {0x8b83,0xa3}, - {0x8b84,0xe0}, - {0x8b85,0xf5}, - {0x8b86,0x66}, - {0x8b87,0xa3}, - {0x8b88,0xe0}, - {0x8b89,0xf5}, - {0x8b8a,0x67}, - {0x8b8b,0xa3}, - {0x8b8c,0xe0}, - {0x8b8d,0xf5}, - {0x8b8e,0x68}, - {0x8b8f,0xef}, - {0x8b90,0x12}, - {0x8b91,0x09}, - {0x8b92,0xf5}, - {0x8b93,0x0b}, - {0x8b94,0xbb}, - {0x8b95,0x03}, - {0x8b96,0x0b}, - {0x8b97,0xd3}, - {0x8b98,0x04}, - {0x8b99,0x0b}, - {0x8b9a,0xee}, - {0x8b9b,0x05}, - {0x8b9c,0x0c}, - {0x8b9d,0x12}, - {0x8b9e,0x06}, - {0x8b9f,0x0c}, - {0x8ba0,0x00}, - {0x8ba1,0x08}, - {0x8ba2,0x0c}, - {0x8ba3,0x1f}, - {0x8ba4,0x10}, - {0x8ba5,0x0c}, - {0x8ba6,0x33}, - {0x8ba7,0x12}, - {0x8ba8,0x0c}, - {0x8ba9,0x38}, - {0x8baa,0x20}, - {0x8bab,0x0c}, - {0x8bac,0x46}, - {0x8bad,0x21}, - {0x8bae,0x0c}, - {0x8baf,0x4b}, - {0x8bb0,0x30}, - {0x8bb1,0x0c}, - {0x8bb2,0x74}, - {0x8bb3,0x50}, - {0x8bb4,0x0c}, - {0x8bb5,0x56}, - {0x8bb6,0xd8}, - {0x8bb7,0x00}, - {0x8bb8,0x00}, - {0x8bb9,0x0c}, - {0x8bba,0x81}, - {0x8bbb,0x30}, - {0x8bbc,0x00}, - {0x8bbd,0x03}, - {0x8bbe,0x02}, - {0x8bbf,0x0c}, - {0x8bc0,0x81}, - {0x8bc1,0x20}, - {0x8bc2,0x07}, - {0x8bc3,0x06}, - {0x8bc4,0x20}, - {0x8bc5,0x06}, - {0x8bc6,0x03}, - {0x8bc7,0xc3}, - {0x8bc8,0x80}, - {0x8bc9,0x01}, - {0x8bca,0xd3}, - {0x8bcb,0x92}, - {0x8bcc,0x36}, - {0x8bcd,0xd2}, - {0x8bce,0x07}, - {0x8bcf,0xc2}, - {0x8bd0,0x06}, - {0x8bd1,0x80}, - {0x8bd2,0x16}, - {0x8bd3,0x30}, - {0x8bd4,0x00}, - {0x8bd5,0x03}, - {0x8bd6,0x02}, - {0x8bd7,0x0c}, - {0x8bd8,0x81}, - {0x8bd9,0x20}, - {0x8bda,0x07}, - {0x8bdb,0x06}, - {0x8bdc,0x20}, - {0x8bdd,0x06}, - {0x8bde,0x03}, - {0x8bdf,0xc3}, - {0x8be0,0x80}, - {0x8be1,0x01}, - {0x8be2,0xd3}, - {0x8be3,0x92}, - {0x8be4,0x36}, - {0x8be5,0xd2}, - {0x8be6,0x07}, - {0x8be7,0xd2}, - {0x8be8,0x06}, - {0x8be9,0x12}, - {0x8bea,0x02}, - {0x8beb,0x90}, - {0x8bec,0x80}, - {0x8bed,0x1e}, - {0x8bee,0x30}, - {0x8bef,0x00}, - {0x8bf0,0x03}, - {0x8bf1,0x02}, - {0x8bf2,0x0c}, - {0x8bf3,0x81}, - {0x8bf4,0xc2}, - {0x8bf5,0x07}, - {0x8bf6,0xd2}, - {0x8bf7,0x06}, - {0x8bf8,0x12}, - {0x8bf9,0x02}, - {0x8bfa,0xa5}, - {0x8bfb,0xc2}, - {0x8bfc,0x04}, - {0x8bfd,0x02}, - {0x8bfe,0x0c}, - {0x8bff,0x81}, - {0x8c00,0x12}, - {0x8c01,0x02}, - {0x8c02,0x40}, - {0x8c03,0x30}, - {0x8c04,0x05}, - {0x8c05,0x06}, - {0x8c06,0xe4}, - {0x8c07,0xf5}, - {0x8c08,0x0c}, - {0x8c09,0x12}, - {0x8c0a,0x0f}, - {0x8c0b,0x52}, - {0x8c0c,0xc2}, - {0x8c0d,0x31}, - {0x8c0e,0xd2}, - {0x8c0f,0x34}, - {0x8c10,0x80}, - {0x8c11,0x6f}, - {0x8c12,0x30}, - {0x8c13,0x07}, - {0x8c14,0x6c}, - {0x8c15,0x30}, - {0x8c16,0x06}, - {0x8c17,0x69}, - {0x8c18,0x12}, - {0x8c19,0x02}, - {0x8c1a,0x90}, - {0x8c1b,0xd2}, - {0x8c1c,0x31}, - {0x8c1d,0x80}, - {0x8c1e,0x62}, - {0x8c1f,0x20}, - {0x8c20,0x07}, - {0x8c21,0x03}, - {0x8c22,0x30}, - {0x8c23,0x06}, - {0x8c24,0x09}, - {0x8c25,0xe5}, - {0x8c26,0x7d}, - {0x8c27,0x64}, - {0x8c28,0x0e}, - {0x8c29,0x70}, - {0x8c2a,0x56}, - {0x8c2b,0x20}, - {0x8c2c,0x00}, - {0x8c2d,0x53}, - {0x8c2e,0x12}, - {0x8c2f,0x05}, - {0x8c30,0x39}, - {0x8c31,0x80}, - {0x8c32,0x4e}, - {0x8c33,0x12}, - {0x8c34,0x07}, - {0x8c35,0x02}, - {0x8c36,0x80}, - {0x8c37,0x49}, - {0x8c38,0x30}, - {0x8c39,0x05}, - {0x8c3a,0x46}, - {0x8c3b,0x20}, - {0x8c3c,0x07}, - {0x8c3d,0x43}, - {0x8c3e,0x20}, - {0x8c3f,0x06}, - {0x8c40,0x40}, - {0x8c41,0x12}, - {0x8c42,0x16}, - {0x8c43,0xc4}, - {0x8c44,0x80}, - {0x8c45,0x3b}, - {0x8c46,0x12}, - {0x8c47,0x13}, - {0x8c48,0x10}, - {0x8c49,0x80}, - {0x8c4a,0x36}, - {0x8c4b,0x20}, - {0x8c4c,0x07}, - {0x8c4d,0x33}, - {0x8c4e,0x20}, - {0x8c4f,0x06}, - {0x8c50,0x30}, - {0x8c51,0x12}, - {0x8c52,0x16}, - {0x8c53,0xd3}, - {0x8c54,0x80}, - {0x8c55,0x2b}, - {0x8c56,0xe5}, - {0x8c57,0x7d}, - {0x8c58,0x64}, - {0x8c59,0x01}, - {0x8c5a,0x70}, - {0x8c5b,0x25}, - {0x8c5c,0xd2}, - {0x8c5d,0x35}, - {0x8c5e,0x90}, - {0x8c5f,0x50}, - {0x8c60,0x82}, - {0x8c61,0xe5}, - {0x8c62,0x73}, - {0x8c63,0xf0}, - {0x8c64,0xa3}, - {0x8c65,0xe5}, - {0x8c66,0x74}, - {0x8c67,0xf0}, - {0x8c68,0xa3}, - {0x8c69,0xe5}, - {0x8c6a,0x75}, - {0x8c6b,0xf0}, - {0x8c6c,0xa3}, - {0x8c6d,0xe5}, - {0x8c6e,0x76}, - {0x8c6f,0xf0}, - {0x8c70,0xc2}, - {0x8c71,0x35}, - {0x8c72,0x80}, - {0x8c73,0x0d}, - {0x8c74,0x90}, - {0x8c75,0x50}, - {0x8c76,0x82}, - {0x8c77,0x30}, - {0x8c78,0x33}, - {0x8c79,0x05}, - {0x8c7a,0x74}, - {0x8c7b,0x55}, - {0x8c7c,0xf0}, - {0x8c7d,0x80}, - {0x8c7e,0x02}, - {0x8c7f,0xe4}, - {0x8c80,0xf0}, - {0x8c81,0x20}, - {0x8c82,0x07}, - {0x8c83,0x06}, - {0x8c84,0x30}, - {0x8c85,0x06}, - {0x8c86,0x03}, - {0x8c87,0x30}, - {0x8c88,0x04}, - {0x8c89,0x05}, - {0x8c8a,0x90}, - {0x8c8b,0x30}, - {0x8c8c,0x25}, - {0x8c8d,0xe4}, - {0x8c8e,0xf0}, - {0x8c8f,0x22}, - {0x8c90,0xc0}, - {0x8c91,0xe0}, - {0x8c92,0xc0}, - {0x8c93,0xf0}, - {0x8c94,0xc0}, - {0x8c95,0x83}, - {0x8c96,0xc0}, - {0x8c97,0x82}, - {0x8c98,0xc0}, - {0x8c99,0xd0}, - {0x8c9a,0x75}, - {0x8c9b,0xd0}, - {0x8c9c,0x00}, - {0x8c9d,0xc0}, - {0x8c9e,0x00}, - {0x8c9f,0xc0}, - {0x8ca0,0x01}, - {0x8ca1,0xc0}, - {0x8ca2,0x02}, - {0x8ca3,0xc0}, - {0x8ca4,0x03}, - {0x8ca5,0xc0}, - {0x8ca6,0x04}, - {0x8ca7,0xc0}, - {0x8ca8,0x05}, - {0x8ca9,0xc0}, - {0x8caa,0x06}, - {0x8cab,0xc0}, - {0x8cac,0x07}, - {0x8cad,0x90}, - {0x8cae,0x3f}, - {0x8caf,0x0c}, - {0x8cb0,0xe0}, - {0x8cb1,0xf5}, - {0x8cb2,0x08}, - {0x8cb3,0xe5}, - {0x8cb4,0x08}, - {0x8cb5,0x20}, - {0x8cb6,0xe3}, - {0x8cb7,0x03}, - {0x8cb8,0x02}, - {0x8cb9,0x0d}, - {0x8cba,0x41}, - {0x8cbb,0x30}, - {0x8cbc,0x35}, - {0x8cbd,0x03}, - {0x8cbe,0x02}, - {0x8cbf,0x0d}, - {0x8cc0,0x41}, - {0x8cc1,0x90}, - {0x8cc2,0x60}, - {0x8cc3,0x16}, - {0x8cc4,0xe0}, - {0x8cc5,0xf5}, - {0x8cc6,0x69}, - {0x8cc7,0xa3}, - {0x8cc8,0xe0}, - {0x8cc9,0xf5}, - {0x8cca,0x6a}, - {0x8ccb,0x90}, - {0x8ccc,0x60}, - {0x8ccd,0x1e}, - {0x8cce,0xe0}, - {0x8ccf,0xf5}, - {0x8cd0,0x6b}, - {0x8cd1,0xa3}, - {0x8cd2,0xe0}, - {0x8cd3,0xf5}, - {0x8cd4,0x6c}, - {0x8cd5,0x90}, - {0x8cd6,0x60}, - {0x8cd7,0x26}, - {0x8cd8,0xe0}, - {0x8cd9,0xf5}, - {0x8cda,0x6d}, - {0x8cdb,0xa3}, - {0x8cdc,0xe0}, - {0x8cdd,0xf5}, - {0x8cde,0x6e}, - {0x8cdf,0x90}, - {0x8ce0,0x60}, - {0x8ce1,0x2e}, - {0x8ce2,0xe0}, - {0x8ce3,0xf5}, - {0x8ce4,0x6f}, - {0x8ce5,0xa3}, - {0x8ce6,0xe0}, - {0x8ce7,0xf5}, - {0x8ce8,0x70}, - {0x8ce9,0x90}, - {0x8cea,0x60}, - {0x8ceb,0x36}, - {0x8cec,0x12}, - {0x8ced,0x00}, - {0x8cee,0x16}, - {0x8cef,0x12}, - {0x8cf0,0x01}, - {0x8cf1,0xbf}, - {0x8cf2,0x40}, - {0x8cf3,0x06}, - {0x8cf4,0x75}, - {0x8cf5,0x2a}, - {0x8cf6,0xff}, - {0x8cf7,0x75}, - {0x8cf8,0x2b}, - {0x8cf9,0xff}, - {0x8cfa,0x85}, - {0x8cfb,0x2a}, - {0x8cfc,0x73}, - {0x8cfd,0x85}, - {0x8cfe,0x2b}, - {0x8cff,0x74}, - {0x8d00,0x90}, - {0x8d01,0x60}, - {0x8d02,0x1a}, - {0x8d03,0xe0}, - {0x8d04,0xf5}, - {0x8d05,0x69}, - {0x8d06,0xa3}, - {0x8d07,0xe0}, - {0x8d08,0xf5}, - {0x8d09,0x6a}, - {0x8d0a,0x90}, - {0x8d0b,0x60}, - {0x8d0c,0x22}, - {0x8d0d,0xe0}, - {0x8d0e,0xf5}, - {0x8d0f,0x6b}, - {0x8d10,0xa3}, - {0x8d11,0xe0}, - {0x8d12,0xf5}, - {0x8d13,0x6c}, - {0x8d14,0x90}, - {0x8d15,0x60}, - {0x8d16,0x2a}, - {0x8d17,0xe0}, - {0x8d18,0xf5}, - {0x8d19,0x6d}, - {0x8d1a,0xa3}, - {0x8d1b,0xe0}, - {0x8d1c,0xf5}, - {0x8d1d,0x6e}, - {0x8d1e,0x90}, - {0x8d1f,0x60}, - {0x8d20,0x32}, - {0x8d21,0xe0}, - {0x8d22,0xf5}, - {0x8d23,0x6f}, - {0x8d24,0xa3}, - {0x8d25,0xe0}, - {0x8d26,0xf5}, - {0x8d27,0x70}, - {0x8d28,0x90}, - {0x8d29,0x60}, - {0x8d2a,0x3a}, - {0x8d2b,0x12}, - {0x8d2c,0x00}, - {0x8d2d,0x16}, - {0x8d2e,0x12}, - {0x8d2f,0x01}, - {0x8d30,0xbf}, - {0x8d31,0x40}, - {0x8d32,0x06}, - {0x8d33,0x75}, - {0x8d34,0x2a}, - {0x8d35,0xff}, - {0x8d36,0x75}, - {0x8d37,0x2b}, - {0x8d38,0xff}, - {0x8d39,0x85}, - {0x8d3a,0x2a}, - {0x8d3b,0x75}, - {0x8d3c,0x85}, - {0x8d3d,0x2b}, - {0x8d3e,0x76}, - {0x8d3f,0xd2}, - {0x8d40,0x3d}, - {0x8d41,0xe5}, - {0x8d42,0x08}, - {0x8d43,0x30}, - {0x8d44,0xe5}, - {0x8d45,0x44}, - {0x8d46,0x90}, - {0x8d47,0x56}, - {0x8d48,0x90}, - {0x8d49,0xe0}, - {0x8d4a,0xf5}, - {0x8d4b,0x55}, - {0x8d4c,0xe5}, - {0x8d4d,0x7a}, - {0x8d4e,0x24}, - {0x8d4f,0x02}, - {0x8d50,0xff}, - {0x8d51,0xe4}, - {0x8d52,0x33}, - {0x8d53,0xfe}, - {0x8d54,0xad}, - {0x8d55,0x55}, - {0x8d56,0xc3}, - {0x8d57,0xef}, - {0x8d58,0x9d}, - {0x8d59,0x74}, - {0x8d5a,0x80}, - {0x8d5b,0xf8}, - {0x8d5c,0x6e}, - {0x8d5d,0x98}, - {0x8d5e,0x50}, - {0x8d5f,0x02}, - {0x8d60,0x80}, - {0x8d61,0x01}, - {0x8d62,0xc3}, - {0x8d63,0x92}, - {0x8d64,0x27}, - {0x8d65,0xaf}, - {0x8d66,0x55}, - {0x8d67,0xef}, - {0x8d68,0x24}, - {0x8d69,0x02}, - {0x8d6a,0xff}, - {0x8d6b,0xe4}, - {0x8d6c,0x33}, - {0x8d6d,0xfe}, - {0x8d6e,0xc3}, - {0x8d6f,0xef}, - {0x8d70,0x95}, - {0x8d71,0x7a}, - {0x8d72,0x74}, - {0x8d73,0x80}, - {0x8d74,0xf8}, - {0x8d75,0x6e}, - {0x8d76,0x98}, - {0x8d77,0x50}, - {0x8d78,0x02}, - {0x8d79,0x80}, - {0x8d7a,0x02}, - {0x8d7b,0xa2}, - {0x8d7c,0x27}, - {0x8d7d,0x92}, - {0x8d7e,0x27}, - {0x8d7f,0x30}, - {0x8d80,0x27}, - {0x8d81,0x04}, - {0x8d82,0xaf}, - {0x8d83,0x55}, - {0x8d84,0x80}, - {0x8d85,0x02}, - {0x8d86,0xaf}, - {0x8d87,0x7a}, - {0x8d88,0x8f}, - {0x8d89,0x7a}, - {0x8d8a,0xe5}, - {0x8d8b,0x08}, - {0x8d8c,0x30}, - {0x8d8d,0xe1}, - {0x8d8e,0x08}, - {0x8d8f,0x90}, - {0x8d90,0x30}, - {0x8d91,0x24}, - {0x8d92,0xe0}, - {0x8d93,0xf5}, - {0x8d94,0x33}, - {0x8d95,0xe4}, - {0x8d96,0xf0}, - {0x8d97,0x90}, - {0x8d98,0x3f}, - {0x8d99,0x0c}, - {0x8d9a,0xe5}, - {0x8d9b,0x08}, - {0x8d9c,0xf0}, - {0x8d9d,0xd0}, - {0x8d9e,0x07}, - {0x8d9f,0xd0}, - {0x8da0,0x06}, - {0x8da1,0xd0}, - {0x8da2,0x05}, - {0x8da3,0xd0}, - {0x8da4,0x04}, - {0x8da5,0xd0}, - {0x8da6,0x03}, - {0x8da7,0xd0}, - {0x8da8,0x02}, - {0x8da9,0xd0}, - {0x8daa,0x01}, - {0x8dab,0xd0}, - {0x8dac,0x00}, - {0x8dad,0xd0}, - {0x8dae,0xd0}, - {0x8daf,0xd0}, - {0x8db0,0x82}, - {0x8db1,0xd0}, - {0x8db2,0x83}, - {0x8db3,0xd0}, - {0x8db4,0xf0}, - {0x8db5,0xd0}, - {0x8db6,0xe0}, - {0x8db7,0x32}, - {0x8db8,0x30}, - {0x8db9,0x04}, - {0x8dba,0x03}, - {0x8dbb,0x02}, - {0x8dbc,0x0e}, - {0x8dbd,0xa3}, - {0x8dbe,0xd2}, - {0x8dbf,0x04}, - {0x8dc0,0xe5}, - {0x8dc1,0x7d}, - {0x8dc2,0xb4}, - {0x8dc3,0x01}, - {0x8dc4,0x06}, - {0x8dc5,0x12}, - {0x8dc6,0x16}, - {0x8dc7,0xa4}, - {0x8dc8,0x02}, - {0x8dc9,0x0e}, - {0x8dca,0x9c}, - {0x8dcb,0xe5}, - {0x8dcc,0x7d}, - {0x8dcd,0xb4}, - {0x8dce,0x02}, - {0x8dcf,0x06}, - {0x8dd0,0x12}, - {0x8dd1,0x16}, - {0x8dd2,0xb5}, - {0x8dd3,0x02}, - {0x8dd4,0x0e}, - {0x8dd5,0x9c}, - {0x8dd6,0xe5}, - {0x8dd7,0x7d}, - {0x8dd8,0xb4}, - {0x8dd9,0x03}, - {0x8dda,0x05}, - {0x8ddb,0xe4}, - {0x8ddc,0xf5}, - {0x8ddd,0x0c}, - {0x8dde,0x80}, - {0x8ddf,0x08}, - {0x8de0,0xe5}, - {0x8de1,0x7d}, - {0x8de2,0xb4}, - {0x8de3,0x04}, - {0x8de4,0x09}, - {0x8de5,0x85}, - {0x8de6,0x7b}, - {0x8de7,0x0c}, - {0x8de8,0x12}, - {0x8de9,0x0f}, - {0x8dea,0x52}, - {0x8deb,0x02}, - {0x8dec,0x0e}, - {0x8ded,0x9c}, - {0x8dee,0xe5}, - {0x8def,0x7d}, - {0x8df0,0x64}, - {0x8df1,0x0f}, - {0x8df2,0x70}, - {0x8df3,0x1f}, - {0x8df4,0x12}, - {0x8df5,0x02}, - {0x8df6,0xbd}, - {0x8df7,0x40}, - {0x8df8,0x06}, - {0x8df9,0x7e}, - {0x8dfa,0x00}, - {0x8dfb,0x7f}, - {0x8dfc,0xff}, - {0x8dfd,0x80}, - {0x8dfe,0x04}, - {0x8dff,0xae}, - {0x8e00,0x67}, - {0x8e01,0xaf}, - {0x8e02,0x68}, - {0x8e03,0x12}, - {0x8e04,0x02}, - {0x8e05,0x58}, - {0x8e06,0xc3}, - {0x8e07,0x33}, - {0x8e08,0xce}, - {0x8e09,0x33}, - {0x8e0a,0xce}, - {0x8e0b,0xd8}, - {0x8e0c,0xf9}, - {0x8e0d,0x12}, - {0x8e0e,0x0e}, - {0x8e0f,0xa4}, - {0x8e10,0x02}, - {0x8e11,0x0e}, - {0x8e12,0x9c}, - {0x8e13,0xe5}, - {0x8e14,0x7d}, - {0x8e15,0x64}, - {0x8e16,0x10}, - {0x8e17,0x60}, - {0x8e18,0x03}, - {0x8e19,0x02}, - {0x8e1a,0x0e}, - {0x8e1b,0x9c}, - {0x8e1c,0xf5}, - {0x8e1d,0x65}, - {0x8e1e,0xf5}, - {0x8e1f,0x66}, - {0x8e20,0xf5}, - {0x8e21,0x67}, - {0x8e22,0xab}, - {0x8e23,0x68}, - {0x8e24,0xaa}, - {0x8e25,0x67}, - {0x8e26,0xa9}, - {0x8e27,0x66}, - {0x8e28,0xa8}, - {0x8e29,0x65}, - {0x8e2a,0x12}, - {0x8e2b,0x01}, - {0x8e2c,0xa0}, - {0x8e2d,0xfe}, - {0x8e2e,0xe4}, - {0x8e2f,0xfc}, - {0x8e30,0xfd}, - {0x8e31,0x12}, - {0x8e32,0x01}, - {0x8e33,0xe7}, - {0x8e34,0xe4}, - {0x8e35,0x7b}, - {0x8e36,0xff}, - {0x8e37,0xfa}, - {0x8e38,0xf9}, - {0x8e39,0xf8}, - {0x8e3a,0x12}, - {0x8e3b,0x02}, - {0x8e3c,0x6d}, - {0x8e3d,0x85}, - {0x8e3e,0x49}, - {0x8e3f,0x82}, - {0x8e40,0x85}, - {0x8e41,0x48}, - {0x8e42,0x83}, - {0x8e43,0xe4}, - {0x8e44,0x93}, - {0x8e45,0xff}, - {0x8e46,0xe4}, - {0x8e47,0xfc}, - {0x8e48,0xfd}, - {0x8e49,0xfe}, - {0x8e4a,0xe5}, - {0x8e4b,0x68}, - {0x8e4c,0x2f}, - {0x8e4d,0xf5}, - {0x8e4e,0x68}, - {0x8e4f,0xee}, - {0x8e50,0x35}, - {0x8e51,0x67}, - {0x8e52,0xf5}, - {0x8e53,0x67}, - {0x8e54,0xed}, - {0x8e55,0x35}, - {0x8e56,0x66}, - {0x8e57,0xf5}, - {0x8e58,0x66}, - {0x8e59,0xec}, - {0x8e5a,0x35}, - {0x8e5b,0x65}, - {0x8e5c,0xf5}, - {0x8e5d,0x65}, - {0x8e5e,0x12}, - {0x8e5f,0x02}, - {0x8e60,0xbd}, - {0x8e61,0x40}, - {0x8e62,0x04}, - {0x8e63,0x7f}, - {0x8e64,0xff}, - {0x8e65,0x80}, - {0x8e66,0x04}, - {0x8e67,0xae}, - {0x8e68,0x67}, - {0x8e69,0xaf}, - {0x8e6a,0x68}, - {0x8e6b,0x12}, - {0x8e6c,0x02}, - {0x8e6d,0x58}, - {0x8e6e,0xc3}, - {0x8e6f,0x33}, - {0x8e70,0xce}, - {0x8e71,0x33}, - {0x8e72,0xce}, - {0x8e73,0xd8}, - {0x8e74,0xf9}, - {0x8e75,0x12}, - {0x8e76,0x0e}, - {0x8e77,0xa4}, - {0x8e78,0xe4}, - {0x8e79,0xf5}, - {0x8e7a,0x66}, - {0x8e7b,0xf5}, - {0x8e7c,0x66}, - {0x8e7d,0xe5}, - {0x8e7e,0x66}, - {0x8e7f,0xd3}, - {0x8e80,0x95}, - {0x8e81,0x7b}, - {0x8e82,0x50}, - {0x8e83,0x15}, - {0x8e84,0xaf}, - {0x8e85,0x66}, - {0x8e86,0xe5}, - {0x8e87,0x49}, - {0x8e88,0x2f}, - {0x8e89,0x12}, - {0x8e8a,0x02}, - {0x8e8b,0x4f}, - {0x8e8c,0x93}, - {0x8e8d,0xc3}, - {0x8e8e,0x95}, - {0x8e8f,0x68}, - {0x8e90,0xe4}, - {0x8e91,0x95}, - {0x8e92,0x67}, - {0x8e93,0x50}, - {0x8e94,0x04}, - {0x8e95,0x05}, - {0x8e96,0x66}, - {0x8e97,0x80}, - {0x8e98,0xe4}, - {0x8e99,0x85}, - {0x8e9a,0x66}, - {0x8e9b,0x7c}, - {0x8e9c,0x90}, - {0x8e9d,0x30}, - {0x8e9e,0x25}, - {0x8e9f,0xe4}, - {0x8ea0,0xf0}, - {0x8ea1,0xd2}, - {0x8ea2,0x34}, - {0x8ea3,0x22}, - {0x8ea4,0xf5}, - {0x8ea5,0x68}, - {0x8ea6,0x8e}, - {0x8ea7,0x67}, - {0x8ea8,0x85}, - {0x8ea9,0x67}, - {0x8eaa,0x10}, - {0x8eab,0x85}, - {0x8eac,0x68}, - {0x8ead,0x11}, - {0x8eae,0x12}, - {0x8eaf,0x0a}, - {0x8eb0,0x1b}, - {0x8eb1,0x22}, - {0x8eb2,0x12}, - {0x8eb3,0x02}, - {0x8eb4,0x85}, - {0x8eb5,0xb5}, - {0x8eb6,0x07}, - {0x8eb7,0x03}, - {0x8eb8,0xd3}, - {0x8eb9,0x80}, - {0x8eba,0x01}, - {0x8ebb,0xc3}, - {0x8ebc,0x40}, - {0x8ebd,0x03}, - {0x8ebe,0x02}, - {0x8ebf,0x0f}, - {0x8ec0,0x51}, - {0x8ec1,0x90}, - {0x8ec2,0x30}, - {0x8ec3,0x04}, - {0x8ec4,0xe0}, - {0x8ec5,0x44}, - {0x8ec6,0x20}, - {0x8ec7,0xf0}, - {0x8ec8,0xa3}, - {0x8ec9,0xe0}, - {0x8eca,0x44}, - {0x8ecb,0x40}, - {0x8ecc,0xf0}, - {0x8ecd,0x90}, - {0x8ece,0x50}, - {0x8ecf,0x25}, - {0x8ed0,0xe0}, - {0x8ed1,0x44}, - {0x8ed2,0x04}, - {0x8ed3,0xf0}, - {0x8ed4,0x90}, - {0x8ed5,0x50}, - {0x8ed6,0x03}, - {0x8ed7,0xe0}, - {0x8ed8,0x54}, - {0x8ed9,0xfd}, - {0x8eda,0xf0}, - {0x8edb,0x90}, - {0x8edc,0x50}, - {0x8edd,0x27}, - {0x8ede,0xe0}, - {0x8edf,0x44}, - {0x8ee0,0x01}, - {0x8ee1,0xf0}, - {0x8ee2,0x90}, - {0x8ee3,0x50}, - {0x8ee4,0x31}, - {0x8ee5,0xe4}, - {0x8ee6,0xf0}, - {0x8ee7,0x90}, - {0x8ee8,0x50}, - {0x8ee9,0x33}, - {0x8eea,0xf0}, - {0x8eeb,0x90}, - {0x8eec,0x30}, - {0x8eed,0x1e}, - {0x8eee,0x12}, - {0x8eef,0x01}, - {0x8ef0,0xfb}, - {0x8ef1,0x90}, - {0x8ef2,0x30}, - {0x8ef3,0x18}, - {0x8ef4,0x12}, - {0x8ef5,0x01}, - {0x8ef6,0xfb}, - {0x8ef7,0x90}, - {0x8ef8,0x30}, - {0x8ef9,0x1b}, - {0x8efa,0x12}, - {0x8efb,0x01}, - {0x8efc,0xfb}, - {0x8efd,0xe0}, - {0x8efe,0xf5}, - {0x8eff,0x25}, - {0x8f00,0x90}, - {0x8f01,0x30}, - {0x8f02,0x18}, - {0x8f03,0xe0}, - {0x8f04,0xf5}, - {0x8f05,0x21}, - {0x8f06,0x90}, - {0x8f07,0x60}, - {0x8f08,0x00}, - {0x8f09,0x74}, - {0x8f0a,0xf5}, - {0x8f0b,0xf0}, - {0x8f0c,0x90}, - {0x8f0d,0x3f}, - {0x8f0e,0x01}, - {0x8f0f,0xe4}, - {0x8f10,0xf0}, - {0x8f11,0xa3}, - {0x8f12,0xf0}, - {0x8f13,0x90}, - {0x8f14,0x3f}, - {0x8f15,0x01}, - {0x8f16,0xe0}, - {0x8f17,0x44}, - {0x8f18,0x08}, - {0x8f19,0xf0}, - {0x8f1a,0xe0}, - {0x8f1b,0x44}, - {0x8f1c,0x20}, - {0x8f1d,0xf0}, - {0x8f1e,0x90}, - {0x8f1f,0x3f}, - {0x8f20,0x05}, - {0x8f21,0x74}, - {0x8f22,0x30}, - {0x8f23,0xf0}, - {0x8f24,0xa3}, - {0x8f25,0x74}, - {0x8f26,0x24}, - {0x8f27,0xf0}, - {0x8f28,0x90}, - {0x8f29,0x3f}, - {0x8f2a,0x0b}, - {0x8f2b,0xe0}, - {0x8f2c,0x44}, - {0x8f2d,0x0f}, - {0x8f2e,0xf0}, - {0x8f2f,0x90}, - {0x8f30,0x3f}, - {0x8f31,0x01}, - {0x8f32,0xe0}, - {0x8f33,0x44}, - {0x8f34,0x02}, - {0x8f35,0xf0}, - {0x8f36,0xc2}, - {0x8f37,0x8c}, - {0x8f38,0x75}, - {0x8f39,0x89}, - {0x8f3a,0x03}, - {0x8f3b,0x75}, - {0x8f3c,0xa8}, - {0x8f3d,0x07}, - {0x8f3e,0x75}, - {0x8f3f,0xb8}, - {0x8f40,0x04}, - {0x8f41,0xe4}, - {0x8f42,0xf5}, - {0x8f43,0xd8}, - {0x8f44,0xf5}, - {0x8f45,0xe8}, - {0x8f46,0x90}, - {0x8f47,0x30}, - {0x8f48,0x01}, - {0x8f49,0xe0}, - {0x8f4a,0x44}, - {0x8f4b,0x40}, - {0x8f4c,0xf0}, - {0x8f4d,0xe0}, - {0x8f4e,0x54}, - {0x8f4f,0xbf}, - {0x8f50,0xf0}, - {0x8f51,0x22}, - {0x8f52,0xe5}, - {0x8f53,0x0c}, - {0x8f54,0xd3}, - {0x8f55,0x95}, - {0x8f56,0x7b}, - {0x8f57,0x40}, - {0x8f58,0x01}, - {0x8f59,0x22}, - {0x8f5a,0xe5}, - {0x8f5b,0x49}, - {0x8f5c,0x25}, - {0x8f5d,0x0c}, - {0x8f5e,0x12}, - {0x8f5f,0x02}, - {0x8f60,0x4f}, - {0x8f61,0x93}, - {0x8f62,0x75}, - {0x8f63,0x0d}, - {0x8f64,0x00}, - {0x8f65,0xf5}, - {0x8f66,0x0e}, - {0x8f67,0x45}, - {0x8f68,0x0d}, - {0x8f69,0x70}, - {0x8f6a,0x05}, - {0x8f6b,0x85}, - {0x8f6c,0x64}, - {0x8f6d,0x0f}, - {0x8f6e,0x80}, - {0x8f6f,0x1b}, - {0x8f70,0x12}, - {0x8f71,0x02}, - {0x8f72,0x9b}, - {0x8f73,0xc3}, - {0x8f74,0x33}, - {0x8f75,0xce}, - {0x8f76,0x33}, - {0x8f77,0xce}, - {0x8f78,0xd8}, - {0x8f79,0xf9}, - {0x8f7a,0xf5}, - {0x8f7b,0x0e}, - {0x8f7c,0x8e}, - {0x8f7d,0x0d}, - {0x8f7e,0x85}, - {0x8f7f,0x0d}, - {0x8f80,0x10}, - {0x8f81,0xf5}, - {0x8f82,0x11}, - {0x8f83,0x12}, - {0x8f84,0x0a}, - {0x8f85,0x1b}, - {0x8f86,0x30}, - {0x8f87,0x33}, - {0x8f88,0x63}, - {0x8f89,0xc3}, - {0x8f8a,0x22}, - {0x8f8b,0xe5}, - {0x8f8c,0x0f}, - {0x8f8d,0xd3}, - {0x8f8e,0x94}, - {0x8f8f,0x10}, - {0x8f90,0x40}, - {0x8f91,0x33}, - {0x8f92,0xe5}, - {0x8f93,0x0f}, - {0x8f94,0xd3}, - {0x8f95,0x94}, - {0x8f96,0x60}, - {0x8f97,0x40}, - {0x8f98,0x05}, - {0x8f99,0x75}, - {0x8f9a,0x0f}, - {0x8f9b,0x58}, - {0x8f9c,0x80}, - {0x8f9d,0x11}, - {0x8f9e,0xe5}, - {0x8f9f,0x0f}, - {0x8fa0,0xd3}, - {0x8fa1,0x94}, - {0x8fa2,0x40}, - {0x8fa3,0x40}, - {0x8fa4,0x04}, - {0x8fa5,0x74}, - {0x8fa6,0xf0}, - {0x8fa7,0x80}, - {0x8fa8,0x02}, - {0x8fa9,0x74}, - {0x8faa,0xf8}, - {0x8fab,0x25}, - {0x8fac,0x0f}, - {0x8fad,0xf5}, - {0x8fae,0x0f}, - {0x8faf,0x75}, - {0x8fb0,0x0d}, - {0x8fb1,0x00}, - {0x8fb2,0x85}, - {0x8fb3,0x0f}, - {0x8fb4,0x0e}, - {0x8fb5,0x12}, - {0x8fb6,0x02}, - {0x8fb7,0x9b}, - {0x8fb8,0xc3}, - {0x8fb9,0x33}, - {0x8fba,0xce}, - {0x8fbb,0x33}, - {0x8fbc,0xce}, - {0x8fbd,0xd8}, - {0x8fbe,0xf9}, - {0x8fbf,0xf5}, - {0x8fc0,0x0e}, - {0x8fc1,0x8e}, - {0x8fc2,0x0d}, - {0x8fc3,0x80}, - {0x8fc4,0x0a}, - {0x8fc5,0xe4}, - {0x8fc6,0xf5}, - {0x8fc7,0x0f}, - {0x8fc8,0x75}, - {0x8fc9,0x0d}, - {0x8fca,0x80}, - {0x8fcb,0xf5}, - {0x8fcc,0x0e}, - {0x8fcd,0xf5}, - {0x8fce,0x64}, - {0x8fcf,0x85}, - {0x8fd0,0x0d}, - {0x8fd1,0x10}, - {0x8fd2,0x85}, - {0x8fd3,0x0e}, - {0x8fd4,0x11}, - {0x8fd5,0x12}, - {0x8fd6,0x0a}, - {0x8fd7,0x1b}, - {0x8fd8,0x30}, - {0x8fd9,0x33}, - {0x8fda,0x02}, - {0x8fdb,0xc3}, - {0x8fdc,0x22}, - {0x8fdd,0xe5}, - {0x8fde,0x0f}, - {0x8fdf,0x60}, - {0x8fe0,0x0b}, - {0x8fe1,0x75}, - {0x8fe2,0x10}, - {0x8fe3,0x00}, - {0x8fe4,0x75}, - {0x8fe5,0x11}, - {0x8fe6,0x32}, - {0x8fe7,0x12}, - {0x8fe8,0x16}, - {0x8fe9,0x3d}, - {0x8fea,0x80}, - {0x8feb,0x9f}, - {0x8fec,0x85}, - {0x8fed,0x0c}, - {0x8fee,0x7c}, - {0x8fef,0xd3}, - {0x8ff0,0x22}, - {0x8ff1,0x30}, - {0x8ff2,0x3e}, - {0x8ff3,0x09}, - {0x8ff4,0x30}, - {0x8ff5,0x20}, - {0x8ff6,0x06}, - {0x8ff7,0xae}, - {0x8ff8,0x56}, - {0x8ff9,0xaf}, - {0x8ffa,0x57}, - {0x8ffb,0x80}, - {0x8ffc,0x04}, - {0x8ffd,0xae}, - {0x8ffe,0x69}, - {0x8fff,0xaf}, - {0x9000,0x6a}, - {0x9001,0x8e}, - {0x9002,0x56}, - {0x9003,0x8f}, - {0x9004,0x57}, - {0x9005,0x30}, - {0x9006,0x3e}, - {0x9007,0x09}, - {0x9008,0x30}, - {0x9009,0x21}, - {0x900a,0x06}, - {0x900b,0xae}, - {0x900c,0x58}, - {0x900d,0xaf}, - {0x900e,0x59}, - {0x900f,0x80}, - {0x9010,0x04}, - {0x9011,0xae}, - {0x9012,0x6b}, - {0x9013,0xaf}, - {0x9014,0x6c}, - {0x9015,0x8e}, - {0x9016,0x58}, - {0x9017,0x8f}, - {0x9018,0x59}, - {0x9019,0x30}, - {0x901a,0x3e}, - {0x901b,0x09}, - {0x901c,0x30}, - {0x901d,0x22}, - {0x901e,0x06}, - {0x901f,0xae}, - {0x9020,0x5a}, - {0x9021,0xaf}, - {0x9022,0x5b}, - {0x9023,0x80}, - {0x9024,0x04}, - {0x9025,0xae}, - {0x9026,0x6d}, - {0x9027,0xaf}, - {0x9028,0x6e}, - {0x9029,0x8e}, - {0x902a,0x5a}, - {0x902b,0x8f}, - {0x902c,0x5b}, - {0x902d,0x30}, - {0x902e,0x3e}, - {0x902f,0x09}, - {0x9030,0x30}, - {0x9031,0x23}, - {0x9032,0x06}, - {0x9033,0xae}, - {0x9034,0x5c}, - {0x9035,0xaf}, - {0x9036,0x5d}, - {0x9037,0x80}, - {0x9038,0x04}, - {0x9039,0xae}, - {0x903a,0x6f}, - {0x903b,0xaf}, - {0x903c,0x70}, - {0x903d,0x8e}, - {0x903e,0x5c}, - {0x903f,0x8f}, - {0x9040,0x5d}, - {0x9041,0x30}, - {0x9042,0x3e}, - {0x9043,0x09}, - {0x9044,0x30}, - {0x9045,0x24}, - {0x9046,0x06}, - {0x9047,0xae}, - {0x9048,0x5e}, - {0x9049,0xaf}, - {0x904a,0x5f}, - {0x904b,0x80}, - {0x904c,0x04}, - {0x904d,0xae}, - {0x904e,0x71}, - {0x904f,0xaf}, - {0x9050,0x72}, - {0x9051,0x8e}, - {0x9052,0x5e}, - {0x9053,0x8f}, - {0x9054,0x5f}, - {0x9055,0x30}, - {0x9056,0x3e}, - {0x9057,0x09}, - {0x9058,0x30}, - {0x9059,0x25}, - {0x905a,0x06}, - {0x905b,0xae}, - {0x905c,0x60}, - {0x905d,0xaf}, - {0x905e,0x61}, - {0x905f,0x80}, - {0x9060,0x04}, - {0x9061,0xae}, - {0x9062,0x73}, - {0x9063,0xaf}, - {0x9064,0x74}, - {0x9065,0x8e}, - {0x9066,0x60}, - {0x9067,0x8f}, - {0x9068,0x61}, - {0x9069,0x30}, - {0x906a,0x3e}, - {0x906b,0x09}, - {0x906c,0x30}, - {0x906d,0x26}, - {0x906e,0x06}, - {0x906f,0xae}, - {0x9070,0x62}, - {0x9071,0xaf}, - {0x9072,0x63}, - {0x9073,0x80}, - {0x9074,0x04}, - {0x9075,0xae}, - {0x9076,0x75}, - {0x9077,0xaf}, - {0x9078,0x76}, - {0x9079,0x8e}, - {0x907a,0x62}, - {0x907b,0x8f}, - {0x907c,0x63}, - {0x907d,0x22}, - {0x907e,0x30}, - {0x907f,0x36}, - {0x9080,0x4e}, - {0x9081,0x12}, - {0x9082,0x10}, - {0x9083,0xf6}, - {0x9084,0xe5}, - {0x9085,0x32}, - {0x9086,0xd3}, - {0x9087,0x95}, - {0x9088,0x7c}, - {0x9089,0x40}, - {0x908a,0x0c}, - {0x908b,0xe5}, - {0x908c,0x32}, - {0x908d,0x04}, - {0x908e,0xf5}, - {0x908f,0x0c}, - {0x9090,0x12}, - {0x9091,0x0f}, - {0x9092,0x52}, - {0x9093,0xd2}, - {0x9094,0x37}, - {0x9095,0x80}, - {0x9096,0x44}, - {0x9097,0xe5}, - {0x9098,0x7b}, - {0x9099,0xb5}, - {0x909a,0x7c}, - {0x909b,0x04}, - {0x909c,0x7f}, - {0x909d,0x01}, - {0x909e,0x80}, - {0x909f,0x02}, - {0x90a0,0x7f}, - {0x90a1,0x00}, - {0x90a2,0xef}, - {0x90a3,0x24}, - {0x90a4,0xfb}, - {0x90a5,0xd3}, - {0x90a6,0x64}, - {0x90a7,0x80}, - {0x90a8,0xf8}, - {0x90a9,0xe5}, - {0x90aa,0x7c}, - {0x90ab,0x64}, - {0x90ac,0x80}, - {0x90ad,0x98}, - {0x90ae,0x40}, - {0x90af,0x12}, - {0x90b0,0xc2}, - {0x90b1,0x37}, - {0x90b2,0xe5}, - {0x90b3,0x7b}, - {0x90b4,0xb5}, - {0x90b5,0x7c}, - {0x90b6,0x04}, - {0x90b7,0x7f}, - {0x90b8,0x01}, - {0x90b9,0x80}, - {0x90ba,0x02}, - {0x90bb,0x7f}, - {0x90bc,0x00}, - {0x90bd,0xef}, - {0x90be,0x24}, - {0x90bf,0xfa}, - {0x90c0,0x80}, - {0x90c1,0x06}, - {0x90c2,0xd2}, - {0x90c3,0x37}, - {0x90c4,0xe5}, - {0x90c5,0x7c}, - {0x90c6,0x24}, - {0x90c7,0x02}, - {0x90c8,0xf5}, - {0x90c9,0x0c}, - {0x90ca,0x12}, - {0x90cb,0x0f}, - {0x90cc,0x52}, - {0x90cd,0x80}, - {0x90ce,0x0c}, - {0x90cf,0xe5}, - {0x90d0,0x7c}, - {0x90d1,0x70}, - {0x90d2,0x0f}, - {0x90d3,0x12}, - {0x90d4,0x10}, - {0x90d5,0xf6}, - {0x90d6,0xc2}, - {0x90d7,0x03}, - {0x90d8,0x12}, - {0x90d9,0x16}, - {0x90da,0xa4}, - {0x90db,0xd2}, - {0x90dc,0x02}, - {0x90dd,0xd2}, - {0x90de,0x01}, - {0x90df,0xd2}, - {0x90e0,0x00}, - {0x90e1,0x22}, - {0x90e2,0x30}, - {0x90e3,0x03}, - {0x90e4,0x08}, - {0x90e5,0xc2}, - {0x90e6,0x03}, - {0x90e7,0xc2}, - {0x90e8,0x04}, - {0x90e9,0x12}, - {0x90ea,0x02}, - {0x90eb,0xa5}, - {0x90ec,0x22}, - {0x90ed,0xe4}, - {0x90ee,0xf5}, - {0x90ef,0x0c}, - {0x90f0,0x12}, - {0x90f1,0x0f}, - {0x90f2,0x52}, - {0x90f3,0xd2}, - {0x90f4,0x03}, - {0x90f5,0x22}, - {0x90f6,0x12}, - {0x90f7,0x16}, - {0x90f8,0x90}, - {0x90f9,0xc2}, - {0x90fa,0x3e}, - {0x90fb,0x12}, - {0x90fc,0x0f}, - {0x90fd,0xf1}, - {0x90fe,0xc2}, - {0x90ff,0x3e}, - {0x9100,0x12}, - {0x9101,0x12}, - {0x9102,0xad}, - {0x9103,0x22}, - {0x9104,0xd3}, - {0x9105,0xe5}, - {0x9106,0x57}, - {0x9107,0x95}, - {0x9108,0x6a}, - {0x9109,0xe5}, - {0x910a,0x56}, - {0x910b,0x95}, - {0x910c,0x69}, - {0x910d,0x40}, - {0x910e,0x03}, - {0x910f,0xd3}, - {0x9110,0x80}, - {0x9111,0x01}, - {0x9112,0xc3}, - {0x9113,0x92}, - {0x9114,0x20}, - {0x9115,0xd3}, - {0x9116,0xe5}, - {0x9117,0x59}, - {0x9118,0x95}, - {0x9119,0x6c}, - {0x911a,0xe5}, - {0x911b,0x58}, - {0x911c,0x95}, - {0x911d,0x6b}, - {0x911e,0x40}, - {0x911f,0x03}, - {0x9120,0xd3}, - {0x9121,0x80}, - {0x9122,0x01}, - {0x9123,0xc3}, - {0x9124,0x92}, - {0x9125,0x21}, - {0x9126,0xd3}, - {0x9127,0xe5}, - {0x9128,0x5b}, - {0x9129,0x95}, - {0x912a,0x6e}, - {0x912b,0xe5}, - {0x912c,0x5a}, - {0x912d,0x95}, - {0x912e,0x6d}, - {0x912f,0x40}, - {0x9130,0x03}, - {0x9131,0xd3}, - {0x9132,0x80}, - {0x9133,0x01}, - {0x9134,0xc3}, - {0x9135,0x92}, - {0x9136,0x22}, - {0x9137,0xd3}, - {0x9138,0xe5}, - {0x9139,0x5d}, - {0x913a,0x95}, - {0x913b,0x70}, - {0x913c,0xe5}, - {0x913d,0x5c}, - {0x913e,0x95}, - {0x913f,0x6f}, - {0x9140,0x40}, - {0x9141,0x03}, - {0x9142,0xd3}, - {0x9143,0x80}, - {0x9144,0x01}, - {0x9145,0xc3}, - {0x9146,0x92}, - {0x9147,0x23}, - {0x9148,0xd3}, - {0x9149,0xe5}, - {0x914a,0x5f}, - {0x914b,0x95}, - {0x914c,0x72}, - {0x914d,0xe5}, - {0x914e,0x5e}, - {0x914f,0x95}, - {0x9150,0x71}, - {0x9151,0x40}, - {0x9152,0x03}, - {0x9153,0xd3}, - {0x9154,0x80}, - {0x9155,0x01}, - {0x9156,0xc3}, - {0x9157,0x92}, - {0x9158,0x24}, - {0x9159,0xd3}, - {0x915a,0xe5}, - {0x915b,0x61}, - {0x915c,0x95}, - {0x915d,0x74}, - {0x915e,0xe5}, - {0x915f,0x60}, - {0x9160,0x95}, - {0x9161,0x73}, - {0x9162,0x40}, - {0x9163,0x03}, - {0x9164,0xd3}, - {0x9165,0x80}, - {0x9166,0x01}, - {0x9167,0xc3}, - {0x9168,0x92}, - {0x9169,0x25}, - {0x916a,0xd3}, - {0x916b,0xe5}, - {0x916c,0x63}, - {0x916d,0x95}, - {0x916e,0x76}, - {0x916f,0xe5}, - {0x9170,0x62}, - {0x9171,0x95}, - {0x9172,0x75}, - {0x9173,0x40}, - {0x9174,0x03}, - {0x9175,0xd3}, - {0x9176,0x80}, - {0x9177,0x01}, - {0x9178,0xc3}, - {0x9179,0x92}, - {0x917a,0x26}, - {0x917b,0x22}, - {0x917c,0x12}, - {0x917d,0x11}, - {0x917e,0x04}, - {0x917f,0x30}, - {0x9180,0x36}, - {0x9181,0x40}, - {0x9182,0xe5}, - {0x9183,0x24}, - {0x9184,0x54}, - {0x9185,0x1f}, - {0x9186,0xff}, - {0x9187,0x60}, - {0x9188,0x0e}, - {0x9189,0x64}, - {0x918a,0x1f}, - {0x918b,0x60}, - {0x918c,0x0a}, - {0x918d,0xe5}, - {0x918e,0x7b}, - {0x918f,0x65}, - {0x9190,0x7c}, - {0x9191,0x60}, - {0x9192,0x04}, - {0x9193,0xe5}, - {0x9194,0x7c}, - {0x9195,0x70}, - {0x9196,0x18}, - {0x9197,0xbf}, - {0x9198,0x1f}, - {0x9199,0x02}, - {0x919a,0xb2}, - {0x919b,0x37}, - {0x919c,0xe5}, - {0x919d,0x7b}, - {0x919e,0xb5}, - {0x919f,0x7c}, - {0x91a0,0x02}, - {0x91a1,0xc2}, - {0x91a2,0x37}, - {0x91a3,0xe5}, - {0x91a4,0x7c}, - {0x91a5,0x70}, - {0x91a6,0x02}, - {0x91a7,0xd2}, - {0x91a8,0x37}, - {0x91a9,0xc2}, - {0x91aa,0x02}, - {0x91ab,0xd2}, - {0x91ac,0x01}, - {0x91ad,0xd2}, - {0x91ae,0x00}, - {0x91af,0xc2}, - {0x91b0,0x3e}, - {0x91b1,0x12}, - {0x91b2,0x0f}, - {0x91b3,0xf1}, - {0x91b4,0xc2}, - {0x91b5,0x3e}, - {0x91b6,0x12}, - {0x91b7,0x12}, - {0x91b8,0xad}, - {0x91b9,0x30}, - {0x91ba,0x37}, - {0x91bb,0x03}, - {0x91bc,0x02}, - {0x91bd,0x16}, - {0x91be,0xa4}, - {0x91bf,0x02}, - {0x91c0,0x16}, - {0x91c1,0xb5}, - {0x91c2,0xd2}, - {0x91c3,0x3e}, - {0x91c4,0x12}, - {0x91c5,0x0f}, - {0x91c6,0xf1}, - {0x91c7,0xd2}, - {0x91c8,0x3e}, - {0x91c9,0x12}, - {0x91ca,0x12}, - {0x91cb,0xad}, - {0x91cc,0x12}, - {0x91cd,0x16}, - {0x91ce,0xa4}, - {0x91cf,0xe5}, - {0x91d0,0x32}, - {0x91d1,0xd3}, - {0x91d2,0x95}, - {0x91d3,0x7c}, - {0x91d4,0x40}, - {0x91d5,0x05}, - {0x91d6,0xe4}, - {0x91d7,0x95}, - {0x91d8,0x7c}, - {0x91d9,0x40}, - {0x91da,0x06}, - {0x91db,0xc2}, - {0x91dc,0x02}, - {0x91dd,0xd2}, - {0x91de,0x01}, - {0x91df,0xd2}, - {0x91e0,0x00}, - {0x91e1,0x22}, - {0x91e2,0x12}, - {0x91e3,0x11}, - {0x91e4,0x04}, - {0x91e5,0xc3}, - {0x91e6,0x30}, - {0x91e7,0x25}, - {0x91e8,0x0c}, - {0x91e9,0xe5}, - {0x91ea,0x61}, - {0x91eb,0x95}, - {0x91ec,0x74}, - {0x91ed,0xff}, - {0x91ee,0xe5}, - {0x91ef,0x60}, - {0x91f0,0x95}, - {0x91f1,0x73}, - {0x91f2,0xfe}, - {0x91f3,0x80}, - {0x91f4,0x0a}, - {0x91f5,0xe5}, - {0x91f6,0x74}, - {0x91f7,0x95}, - {0x91f8,0x61}, - {0x91f9,0xff}, - {0x91fa,0xe5}, - {0x91fb,0x73}, - {0x91fc,0x95}, - {0x91fd,0x60}, - {0x91fe,0xfe}, - {0x91ff,0x8e}, - {0x9200,0x0a}, - {0x9201,0x8f}, - {0x9202,0x0b}, - {0x9203,0x30}, - {0x9204,0x03}, - {0x9205,0x26}, - {0x9206,0x12}, - {0x9207,0x02}, - {0x9208,0xb3}, - {0x9209,0x50}, - {0x920a,0x03}, - {0x920b,0x30}, - {0x920c,0x27}, - {0x920d,0x07}, - {0x920e,0xc2}, - {0x920f,0x3e}, - {0x9210,0x12}, - {0x9211,0x0f}, - {0x9212,0xf1}, - {0x9213,0x80}, - {0x9214,0x2f}, - {0x9215,0x05}, - {0x9216,0x31}, - {0x9217,0xe5}, - {0x9218,0x31}, - {0x9219,0xd3}, - {0x921a,0x94}, - {0x921b,0x02}, - {0x921c,0x40}, - {0x921d,0x29}, - {0x921e,0xe4}, - {0x921f,0xf5}, - {0x9220,0x31}, - {0x9221,0xc2}, - {0x9222,0x03}, - {0x9223,0xc2}, - {0x9224,0x02}, - {0x9225,0xc2}, - {0x9226,0x01}, - {0x9227,0xd2}, - {0x9228,0x00}, - {0x9229,0xd2}, - {0x922a,0x34}, - {0x922b,0x22}, - {0x922c,0x12}, - {0x922d,0x02}, - {0x922e,0xb3}, - {0x922f,0x50}, - {0x9230,0x03}, - {0x9231,0x30}, - {0x9232,0x27}, - {0x9233,0x04}, - {0x9234,0x05}, - {0x9235,0x31}, - {0x9236,0x80}, - {0x9237,0x03}, - {0x9238,0xe4}, - {0x9239,0xf5}, - {0x923a,0x31}, - {0x923b,0xe5}, - {0x923c,0x31}, - {0x923d,0xd3}, - {0x923e,0x94}, - {0x923f,0x02}, - {0x9240,0x40}, - {0x9241,0x05}, - {0x9242,0xd2}, - {0x9243,0x03}, - {0x9244,0xe4}, - {0x9245,0xf5}, - {0x9246,0x31}, - {0x9247,0x22}, - {0x9248,0xe5}, - {0x9249,0x0a}, - {0x924a,0x70}, - {0x924b,0x04}, - {0x924c,0x7a}, - {0x924d,0x13}, - {0x924e,0x7b}, - {0x924f,0x81}, - {0x9250,0xe5}, - {0x9251,0x0a}, - {0x9252,0xb4}, - {0x9253,0x01}, - {0x9254,0x04}, - {0x9255,0x7a}, - {0x9256,0x13}, - {0x9257,0x7b}, - {0x9258,0x95}, - {0x9259,0xe5}, - {0x925a,0x0a}, - {0x925b,0xb4}, - {0x925c,0x02}, - {0x925d,0x04}, - {0x925e,0x7a}, - {0x925f,0x13}, - {0x9260,0x7b}, - {0x9261,0xa9}, - {0x9262,0x8b}, - {0x9263,0x82}, - {0x9264,0x8a}, - {0x9265,0x83}, - {0x9266,0x12}, - {0x9267,0x09}, - {0x9268,0xe5}, - {0x9269,0x8f}, - {0x926a,0x37}, - {0x926b,0x8e}, - {0x926c,0x36}, - {0x926d,0x8d}, - {0x926e,0x35}, - {0x926f,0x8c}, - {0x9270,0x34}, - {0x9271,0xe5}, - {0x9272,0x82}, - {0x9273,0x24}, - {0x9274,0x04}, - {0x9275,0xf5}, - {0x9276,0x82}, - {0x9277,0xe4}, - {0x9278,0x35}, - {0x9279,0x83}, - {0x927a,0xf5}, - {0x927b,0x83}, - {0x927c,0x12}, - {0x927d,0x09}, - {0x927e,0xe5}, - {0x927f,0x8f}, - {0x9280,0x3b}, - {0x9281,0x8e}, - {0x9282,0x3a}, - {0x9283,0x8d}, - {0x9284,0x39}, - {0x9285,0x8c}, - {0x9286,0x38}, - {0x9287,0xeb}, - {0x9288,0x24}, - {0x9289,0x08}, - {0x928a,0x12}, - {0x928b,0x02}, - {0x928c,0x2f}, - {0x928d,0x12}, - {0x928e,0x01}, - {0x928f,0x97}, - {0x9290,0xeb}, - {0x9291,0x24}, - {0x9292,0x0c}, - {0x9293,0x12}, - {0x9294,0x02}, - {0x9295,0x2f}, - {0x9296,0x8f}, - {0x9297,0x43}, - {0x9298,0x8e}, - {0x9299,0x42}, - {0x929a,0x8d}, - {0x929b,0x41}, - {0x929c,0x8c}, - {0x929d,0x40}, - {0x929e,0xeb}, - {0x929f,0x24}, - {0x92a0,0x10}, - {0x92a1,0x12}, - {0x92a2,0x02}, - {0x92a3,0x2f}, - {0x92a4,0x8f}, - {0x92a5,0x47}, - {0x92a6,0x8e}, - {0x92a7,0x46}, - {0x92a8,0x8d}, - {0x92a9,0x45}, - {0x92aa,0x8c}, - {0x92ab,0x44}, - {0x92ac,0x22}, - {0x92ad,0x30}, - {0x92ae,0x3e}, - {0x92af,0x07}, - {0x92b0,0x30}, - {0x92b1,0x20}, - {0x92b2,0x04}, - {0x92b3,0xaf}, - {0x92b4,0x4a}, - {0x92b5,0x80}, - {0x92b6,0x02}, - {0x92b7,0xaf}, - {0x92b8,0x7c}, - {0x92b9,0x8f}, - {0x92ba,0x4a}, - {0x92bb,0x30}, - {0x92bc,0x3e}, - {0x92bd,0x07}, - {0x92be,0x30}, - {0x92bf,0x21}, - {0x92c0,0x04}, - {0x92c1,0xaf}, - {0x92c2,0x4b}, - {0x92c3,0x80}, - {0x92c4,0x02}, - {0x92c5,0xaf}, - {0x92c6,0x7c}, - {0x92c7,0x8f}, - {0x92c8,0x4b}, - {0x92c9,0x30}, - {0x92ca,0x3e}, - {0x92cb,0x07}, - {0x92cc,0x30}, - {0x92cd,0x22}, - {0x92ce,0x04}, - {0x92cf,0xaf}, - {0x92d0,0x4c}, - {0x92d1,0x80}, - {0x92d2,0x02}, - {0x92d3,0xaf}, - {0x92d4,0x7c}, - {0x92d5,0x8f}, - {0x92d6,0x4c}, - {0x92d7,0x30}, - {0x92d8,0x3e}, - {0x92d9,0x07}, - {0x92da,0x30}, - {0x92db,0x23}, - {0x92dc,0x04}, - {0x92dd,0xaf}, - {0x92de,0x4d}, - {0x92df,0x80}, - {0x92e0,0x02}, - {0x92e1,0xaf}, - {0x92e2,0x7c}, - {0x92e3,0x8f}, - {0x92e4,0x4d}, - {0x92e5,0x30}, - {0x92e6,0x3e}, - {0x92e7,0x07}, - {0x92e8,0x30}, - {0x92e9,0x24}, - {0x92ea,0x04}, - {0x92eb,0xaf}, - {0x92ec,0x4e}, - {0x92ed,0x80}, - {0x92ee,0x02}, - {0x92ef,0xaf}, - {0x92f0,0x7c}, - {0x92f1,0x8f}, - {0x92f2,0x4e}, - {0x92f3,0x30}, - {0x92f4,0x3e}, - {0x92f5,0x07}, - {0x92f6,0x30}, - {0x92f7,0x25}, - {0x92f8,0x04}, - {0x92f9,0xaf}, - {0x92fa,0x4f}, - {0x92fb,0x80}, - {0x92fc,0x02}, - {0x92fd,0xaf}, - {0x92fe,0x7c}, - {0x92ff,0x8f}, - {0x9300,0x4f}, - {0x9301,0x30}, - {0x9302,0x3e}, - {0x9303,0x07}, - {0x9304,0x30}, - {0x9305,0x26}, - {0x9306,0x04}, - {0x9307,0xaf}, - {0x9308,0x50}, - {0x9309,0x80}, - {0x930a,0x02}, - {0x930b,0xaf}, - {0x930c,0x7c}, - {0x930d,0x8f}, - {0x930e,0x50}, - {0x930f,0x22}, - {0x9310,0xe5}, - {0x9311,0x7d}, - {0x9312,0x64}, - {0x9313,0x01}, - {0x9314,0x70}, - {0x9315,0x47}, - {0x9316,0xe5}, - {0x9317,0x49}, - {0x9318,0x25}, - {0x9319,0x7c}, - {0x931a,0x12}, - {0x931b,0x01}, - {0x931c,0xa4}, - {0x931d,0xfe}, - {0x931e,0xe4}, - {0x931f,0x8f}, - {0x9320,0x68}, - {0x9321,0x8e}, - {0x9322,0x67}, - {0x9323,0xf5}, - {0x9324,0x66}, - {0x9325,0xf5}, - {0x9326,0x65}, - {0x9327,0x12}, - {0x9328,0x01}, - {0x9329,0xf2}, - {0x932a,0x7b}, - {0x932b,0xff}, - {0x932c,0xfa}, - {0x932d,0xf9}, - {0x932e,0xf8}, - {0x932f,0x12}, - {0x9330,0x01}, - {0x9331,0xe7}, - {0x9332,0xc0}, - {0x9333,0x05}, - {0x9334,0xc0}, - {0x9335,0x06}, - {0x9336,0xc0}, - {0x9337,0x07}, - {0x9338,0x12}, - {0x9339,0x01}, - {0x933a,0xa0}, - {0x933b,0xab}, - {0x933c,0x07}, - {0x933d,0xfa}, - {0x933e,0xe4}, - {0x933f,0xf9}, - {0x9340,0xf8}, - {0x9341,0xd0}, - {0x9342,0x07}, - {0x9343,0xd0}, - {0x9344,0x06}, - {0x9345,0xd0}, - {0x9346,0x05}, - {0x9347,0x12}, - {0x9348,0x02}, - {0x9349,0x6d}, - {0x934a,0x85}, - {0x934b,0x68}, - {0x934c,0x65}, - {0x934d,0x85}, - {0x934e,0x7c}, - {0x934f,0x66}, - {0x9350,0xe5}, - {0x9351,0x49}, - {0x9352,0x25}, - {0x9353,0x7c}, - {0x9354,0x12}, - {0x9355,0x02}, - {0x9356,0x4f}, - {0x9357,0x93}, - {0x9358,0x75}, - {0x9359,0x67}, - {0x935a,0x00}, - {0x935b,0xf5}, - {0x935c,0x68}, - {0x935d,0x90}, - {0x935e,0x50}, - {0x935f,0x82}, - {0x9360,0xe5}, - {0x9361,0x65}, - {0x9362,0xf0}, - {0x9363,0xa3}, - {0x9364,0xe5}, - {0x9365,0x66}, - {0x9366,0xf0}, - {0x9367,0xa3}, - {0x9368,0xe5}, - {0x9369,0x67}, - {0x936a,0xf0}, - {0x936b,0xa3}, - {0x936c,0xe5}, - {0x936d,0x68}, - {0x936e,0xf0}, - {0x936f,0x22}, - {0x9370,0x56}, - {0x9371,0x0c}, - {0x9372,0x04}, - {0x9373,0x00}, - {0x9374,0x2a}, - {0x9375,0x35}, - {0x9376,0x40}, - {0x9377,0x49}, - {0x9378,0x52}, - {0x9379,0x5b}, - {0x937a,0x64}, - {0x937b,0x6d}, - {0x937c,0x76}, - {0x937d,0x7f}, - {0x937e,0x88}, - {0x937f,0x91}, - {0x9380,0x07}, - {0x9381,0x20}, - {0x9382,0x12}, - {0x9383,0x28}, - {0x9384,0x1e}, - {0x9385,0x18}, - {0x9386,0x18}, - {0x9387,0x28}, - {0x9388,0x1e}, - {0x9389,0x18}, - {0x938a,0x12}, - {0x938b,0x28}, - {0x938c,0x1e}, - {0x938d,0x18}, - {0x938e,0x12}, - {0x938f,0x28}, - {0x9390,0x18}, - {0x9391,0x18}, - {0x9392,0x12}, - {0x9393,0x20}, - {0x9394,0x18}, - {0x9395,0x28}, - {0x9396,0x1c}, - {0x9397,0x30}, - {0x9398,0x24}, - {0x9399,0x10}, - {0x939a,0x1c}, - {0x939b,0x18}, - {0x939c,0x24}, - {0x939d,0x1c}, - {0x939e,0x14}, - {0x939f,0x24}, - {0x93a0,0x1c}, - {0x93a1,0x28}, - {0x93a2,0x0c}, - {0x93a3,0x30}, - {0x93a4,0x14}, - {0x93a5,0x10}, - {0x93a6,0x0c}, - {0x93a7,0x18}, - {0x93a8,0x14}, - {0x93a9,0x1c}, - {0x93aa,0x20}, - {0x93ab,0x24}, - {0x93ac,0x28}, - {0x93ad,0x0c}, - {0x93ae,0x14}, - {0x93af,0x14}, - {0x93b0,0x1c}, - {0x93b1,0x1c}, - {0x93b2,0x14}, - {0x93b3,0x24}, - {0x93b4,0x1c}, - {0x93b5,0x2c}, - {0x93b6,0x14}, - {0x93b7,0x34}, - {0x93b8,0x1c}, - {0x93b9,0x1c}, - {0x93ba,0x08}, - {0x93bb,0x24}, - {0x93bc,0x10}, - {0x93bd,0x19}, - {0x93be,0x19}, - {0x93bf,0x1c}, - {0x93c0,0x19}, - {0x93c1,0x19}, - {0x93c2,0x10}, - {0x93c3,0x10}, - {0x93c4,0x10}, - {0x93c5,0x10}, - {0x93c6,0x10}, - {0x93c7,0x00}, - {0x93c8,0x00}, - {0x93c9,0x00}, - {0x93ca,0x00}, - {0x93cb,0x00}, - {0x93cc,0x12}, - {0x93cd,0x11}, - {0x93ce,0x04}, - {0x93cf,0xd2}, - {0x93d0,0x3e}, - {0x93d1,0x12}, - {0x93d2,0x0f}, - {0x93d3,0xf1}, - {0x93d4,0xd2}, - {0x93d5,0x3e}, - {0x93d6,0x12}, - {0x93d7,0x12}, - {0x93d8,0xad}, - {0x93d9,0x30}, - {0x93da,0x36}, - {0x93db,0x26}, - {0x93dc,0x30}, - {0x93dd,0x37}, - {0x93de,0x06}, - {0x93df,0xe5}, - {0x93e0,0x7b}, - {0x93e1,0x65}, - {0x93e2,0x7c}, - {0x93e3,0x60}, - {0x93e4,0x3e}, - {0x93e5,0x20}, - {0x93e6,0x37}, - {0x93e7,0x04}, - {0x93e8,0xe5}, - {0x93e9,0x7c}, - {0x93ea,0x60}, - {0x93eb,0x37}, - {0x93ec,0xe5}, - {0x93ed,0x24}, - {0x93ee,0x54}, - {0x93ef,0x1f}, - {0x93f0,0xff}, - {0x93f1,0xbf}, - {0x93f2,0x1f}, - {0x93f3,0x06}, - {0x93f4,0x30}, - {0x93f5,0x25}, - {0x93f6,0x03}, - {0x93f7,0x20}, - {0x93f8,0x26}, - {0x93f9,0x29}, - {0x93fa,0x30}, - {0x93fb,0x37}, - {0x93fc,0x02}, - {0x93fd,0x80}, - {0x93fe,0x21}, - {0x93ff,0x02}, - {0x9400,0x16}, - {0x9401,0xb5}, - {0x9402,0xe5}, - {0x9403,0x7b}, - {0x9404,0xd3}, - {0x9405,0x95}, - {0x9406,0x7c}, - {0x9407,0x40}, - {0x9408,0x03}, - {0x9409,0xd3}, - {0x940a,0x80}, - {0x940b,0x01}, - {0x940c,0xc3}, - {0x940d,0x50}, - {0x940e,0x14}, - {0x940f,0x20}, - {0x9410,0x39}, - {0x9411,0x0e}, - {0x9412,0xe5}, - {0x9413,0x24}, - {0x9414,0x54}, - {0x9415,0x1f}, - {0x9416,0xff}, - {0x9417,0xbf}, - {0x9418,0x1f}, - {0x9419,0x06}, - {0x941a,0x30}, - {0x941b,0x25}, - {0x941c,0x03}, - {0x941d,0x20}, - {0x941e,0x26}, - {0x941f,0x03}, - {0x9420,0x02}, - {0x9421,0x16}, - {0x9422,0xa4}, - {0x9423,0x12}, - {0x9424,0x02}, - {0x9425,0xc7}, - {0x9426,0x22}, - {0x9427,0xc2}, - {0x9428,0x34}, - {0x9429,0x20}, - {0x942a,0x07}, - {0x942b,0x08}, - {0x942c,0x20}, - {0x942d,0x06}, - {0x942e,0x05}, - {0x942f,0xe4}, - {0x9430,0xf5}, - {0x9431,0x0a}, - {0x9432,0x80}, - {0x9433,0x2b}, - {0x9434,0x20}, - {0x9435,0x07}, - {0x9436,0x08}, - {0x9437,0x30}, - {0x9438,0x06}, - {0x9439,0x05}, - {0x943a,0x75}, - {0x943b,0x0a}, - {0x943c,0x20}, - {0x943d,0x80}, - {0x943e,0x20}, - {0x943f,0x30}, - {0x9440,0x00}, - {0x9441,0x05}, - {0x9442,0x75}, - {0x9443,0x0a}, - {0x9444,0x01}, - {0x9445,0x80}, - {0x9446,0x18}, - {0x9447,0xe5}, - {0x9448,0x20}, - {0x9449,0x54}, - {0x944a,0x07}, - {0x944b,0xff}, - {0x944c,0xbf}, - {0x944d,0x06}, - {0x944e,0x0d}, - {0x944f,0x30}, - {0x9450,0x31}, - {0x9451,0x04}, - {0x9452,0x7f}, - {0x9453,0x12}, - {0x9454,0x80}, - {0x9455,0x02}, - {0x9456,0x7f}, - {0x9457,0x02}, - {0x9458,0x8f}, - {0x9459,0x0a}, - {0x945a,0x80}, - {0x945b,0x03}, - {0x945c,0x75}, - {0x945d,0x0a}, - {0x945e,0xfe}, - {0x945f,0x90}, - {0x9460,0x30}, - {0x9461,0x27}, - {0x9462,0xe5}, - {0x9463,0x0a}, - {0x9464,0xf0}, - {0x9465,0xe5}, - {0x9466,0x23}, - {0x9467,0x54}, - {0x9468,0xf8}, - {0x9469,0xf5}, - {0x946a,0x0a}, - {0x946b,0xe5}, - {0x946c,0x78}, - {0x946d,0x25}, - {0x946e,0x0a}, - {0x946f,0xf5}, - {0x9470,0x0a}, - {0x9471,0x90}, - {0x9472,0x30}, - {0x9473,0x26}, - {0x9474,0xe5}, - {0x9475,0x0a}, - {0x9476,0xf0}, - {0x9477,0x22}, - {0x9478,0xe5}, - {0x9479,0x0a}, - {0x947a,0x70}, - {0x947b,0x04}, - {0x947c,0x7e}, - {0x947d,0x13}, - {0x947e,0x7f}, - {0x947f,0xbd}, - {0x9480,0xe5}, - {0x9481,0x0a}, - {0x9482,0xb4}, - {0x9483,0x01}, - {0x9484,0x04}, - {0x9485,0x7e}, - {0x9486,0x13}, - {0x9487,0x7f}, - {0x9488,0xc2}, - {0x9489,0xe5}, - {0x948a,0x0a}, - {0x948b,0xb4}, - {0x948c,0x02}, - {0x948d,0x04}, - {0x948e,0x7e}, - {0x948f,0x13}, - {0x9490,0x7f}, - {0x9491,0xc7}, - {0x9492,0x8f}, - {0x9493,0x82}, - {0x9494,0x8e}, - {0x9495,0x83}, - {0x9496,0xe4}, - {0x9497,0x93}, - {0x9498,0xf5}, - {0x9499,0x2c}, - {0x949a,0x74}, - {0x949b,0x01}, - {0x949c,0x93}, - {0x949d,0xf5}, - {0x949e,0x2d}, - {0x949f,0x74}, - {0x94a0,0x02}, - {0x94a1,0x93}, - {0x94a2,0xf5}, - {0x94a3,0x2e}, - {0x94a4,0x74}, - {0x94a5,0x03}, - {0x94a6,0x93}, - {0x94a7,0xf5}, - {0x94a8,0x2f}, - {0x94a9,0x74}, - {0x94aa,0x04}, - {0x94ab,0x93}, - {0x94ac,0xf5}, - {0x94ad,0x30}, - {0x94ae,0xe5}, - {0x94af,0x0a}, - {0x94b0,0xb4}, - {0x94b1,0x01}, - {0x94b2,0x07}, - {0x94b3,0x74}, - {0x94b4,0x2c}, - {0x94b5,0x25}, - {0x94b6,0x78}, - {0x94b7,0xf8}, - {0x94b8,0x76}, - {0x94b9,0x40}, - {0x94ba,0xe5}, - {0x94bb,0x0a}, - {0x94bc,0xb4}, - {0x94bd,0x02}, - {0x94be,0x07}, - {0x94bf,0x74}, - {0x94c0,0x2c}, - {0x94c1,0x25}, - {0x94c2,0x78}, - {0x94c3,0xf8}, - {0x94c4,0x76}, - {0x94c5,0x80}, - {0x94c6,0x22}, - {0x94c7,0xc2}, - {0x94c8,0xaf}, - {0x94c9,0x90}, - {0x94ca,0x30}, - {0x94cb,0x27}, - {0x94cc,0x74}, - {0x94cd,0xfa}, - {0x94ce,0xf0}, - {0x94cf,0x12}, - {0x94d0,0x0e}, - {0x94d1,0xb2}, - {0x94d2,0x12}, - {0x94d3,0x16}, - {0x94d4,0x15}, - {0x94d5,0xe4}, - {0x94d6,0xf5}, - {0x94d7,0x33}, - {0x94d8,0xd2}, - {0x94d9,0xaf}, - {0x94da,0x12}, - {0x94db,0x0b}, - {0x94dc,0x67}, - {0x94dd,0x30}, - {0x94de,0x30}, - {0x94df,0x03}, - {0x94e0,0x12}, - {0x94e1,0x07}, - {0x94e2,0x02}, - {0x94e3,0x30}, - {0x94e4,0x34}, - {0x94e5,0x03}, - {0x94e6,0x12}, - {0x94e7,0x14}, - {0x94e8,0x27}, - {0x94e9,0x30}, - {0x94ea,0x3d}, - {0x94eb,0xee}, - {0x94ec,0xc2}, - {0x94ed,0x3d}, - {0x94ee,0xd2}, - {0x94ef,0x35}, - {0x94f0,0x30}, - {0x94f1,0x00}, - {0x94f2,0x05}, - {0x94f3,0x12}, - {0x94f4,0x15}, - {0x94f5,0xe8}, - {0x94f6,0x80}, - {0x94f7,0x17}, - {0x94f8,0x30}, - {0x94f9,0x07}, - {0x94fa,0x0b}, - {0x94fb,0x30}, - {0x94fc,0x06}, - {0x94fd,0x08}, - {0x94fe,0x20}, - {0x94ff,0x31}, - {0x9500,0x0e}, - {0x9501,0x12}, - {0x9502,0x11}, - {0x9503,0xe2}, - {0x9504,0x80}, - {0x9505,0x09}, - {0x9506,0x20}, - {0x9507,0x07}, - {0x9508,0x06}, - {0x9509,0x30}, - {0x950a,0x06}, - {0x950b,0x03}, - {0x950c,0x12}, - {0x950d,0x0d}, - {0x950e,0xb8}, - {0x950f,0xc2}, - {0x9510,0x35}, - {0x9511,0x80}, - {0x9512,0xc7}, - {0x9513,0xc0}, - {0x9514,0xe0}, - {0x9515,0xc0}, - {0x9516,0x83}, - {0x9517,0xc0}, - {0x9518,0x82}, - {0x9519,0xc0}, - {0x951a,0xd0}, - {0x951b,0x90}, - {0x951c,0x3f}, - {0x951d,0x0d}, - {0x951e,0xe0}, - {0x951f,0xf5}, - {0x9520,0x09}, - {0x9521,0xe5}, - {0x9522,0x09}, - {0x9523,0x30}, - {0x9524,0xe0}, - {0x9525,0x2e}, - {0x9526,0xe5}, - {0x9527,0x79}, - {0x9528,0xb4}, - {0x9529,0x01}, - {0x952a,0x09}, - {0x952b,0x90}, - {0x952c,0x3a}, - {0x952d,0x00}, - {0x952e,0xe0}, - {0x952f,0xf5}, - {0x9530,0x77}, - {0x9531,0x44}, - {0x9532,0x01}, - {0x9533,0xf0}, - {0x9534,0xe5}, - {0x9535,0x79}, - {0x9536,0xb4}, - {0x9537,0x03}, - {0x9538,0x09}, - {0x9539,0x90}, - {0x953a,0x3a}, - {0x953b,0x00}, - {0x953c,0xe0}, - {0x953d,0xf5}, - {0x953e,0x77}, - {0x953f,0x54}, - {0x9540,0xfe}, - {0x9541,0xf0}, - {0x9542,0xe5}, - {0x9543,0x79}, - {0x9544,0xb4}, - {0x9545,0x03}, - {0x9546,0x05}, - {0x9547,0x75}, - {0x9548,0x79}, - {0x9549,0x00}, - {0x954a,0x80}, - {0x954b,0x02}, - {0x954c,0x05}, - {0x954d,0x79}, - {0x954e,0x90}, - {0x954f,0x3f}, - {0x9550,0x0d}, - {0x9551,0x74}, - {0x9552,0x01}, - {0x9553,0xf0}, - {0x9554,0xd0}, - {0x9555,0xd0}, - {0x9556,0xd0}, - {0x9557,0x82}, - {0x9558,0xd0}, - {0x9559,0x83}, - {0x955a,0xd0}, - {0x955b,0xe0}, - {0x955c,0x32}, - {0x955d,0x90}, - {0x955e,0x50}, - {0x955f,0x27}, - {0x9560,0xe0}, - {0x9561,0x44}, - {0x9562,0x01}, - {0x9563,0xf0}, - {0x9564,0x90}, - {0x9565,0x50}, - {0x9566,0x34}, - {0x9567,0x74}, - {0x9568,0x80}, - {0x9569,0xf0}, - {0x956a,0xa3}, - {0x956b,0x74}, - {0x956c,0x2a}, - {0x956d,0xf0}, - {0x956e,0xa3}, - {0x956f,0x74}, - {0x9570,0x14}, - {0x9571,0xf0}, - {0x9572,0x90}, - {0x9573,0x50}, - {0x9574,0x30}, - {0x9575,0xe4}, - {0x9576,0xf0}, - {0x9577,0xa3}, - {0x9578,0x74}, - {0x9579,0x02}, - {0x957a,0xf0}, - {0x957b,0xa3}, - {0x957c,0xe4}, - {0x957d,0xf0}, - {0x957e,0xa3}, - {0x957f,0x74}, - {0x9580,0x80}, - {0x9581,0xf0}, - {0x9582,0xe4}, - {0x9583,0xf5}, - {0x9584,0x0a}, - {0x9585,0x12}, - {0x9586,0x12}, - {0x9587,0x48}, - {0x9588,0x75}, - {0x9589,0x78}, - {0x958a,0x02}, - {0x958b,0x75}, - {0x958c,0x0a}, - {0x958d,0x01}, - {0x958e,0x12}, - {0x958f,0x14}, - {0x9590,0x78}, - {0x9591,0xd2}, - {0x9592,0x18}, - {0x9593,0xd2}, - {0x9594,0x19}, - {0x9595,0xc2}, - {0x9596,0x3c}, - {0x9597,0xc2}, - {0x9598,0x3b}, - {0x9599,0xd2}, - {0x959a,0x1a}, - {0x959b,0xd2}, - {0x959c,0x38}, - {0x959d,0xd2}, - {0x959e,0x30}, - {0x959f,0xc2}, - {0x95a0,0x35}, - {0x95a1,0xc2}, - {0x95a2,0x3d}, - {0x95a3,0x22}, - {0x95a4,0x85}, - {0x95a5,0x13}, - {0x95a6,0x14}, - {0x95a7,0x7f}, - {0x95a8,0x08}, - {0x95a9,0xe5}, - {0x95aa,0x14}, - {0x95ab,0x30}, - {0x95ac,0xe7}, - {0x95ad,0x04}, - {0x95ae,0xd2}, - {0x95af,0x29}, - {0x95b0,0x80}, - {0x95b1,0x02}, - {0x95b2,0xc2}, - {0x95b3,0x29}, - {0x95b4,0x12}, - {0x95b5,0x01}, - {0x95b6,0x6c}, - {0x95b7,0x75}, - {0x95b8,0x51}, - {0x95b9,0x0a}, - {0x95ba,0xae}, - {0x95bb,0x51}, - {0x95bc,0x15}, - {0x95bd,0x51}, - {0x95be,0xee}, - {0x95bf,0x70}, - {0x95c0,0xf9}, - {0x95c1,0xe5}, - {0x95c2,0x14}, - {0x95c3,0x25}, - {0x95c4,0xe0}, - {0x95c5,0xf5}, - {0x95c6,0x14}, - {0x95c7,0xd2}, - {0x95c8,0x28}, - {0x95c9,0x12}, - {0x95ca,0x01}, - {0x95cb,0x6c}, - {0x95cc,0x75}, - {0x95cd,0x51}, - {0x95ce,0x0a}, - {0x95cf,0xae}, - {0x95d0,0x51}, - {0x95d1,0x15}, - {0x95d2,0x51}, - {0x95d3,0xee}, - {0x95d4,0x70}, - {0x95d5,0xf9}, - {0x95d6,0xc2}, - {0x95d7,0x28}, - {0x95d8,0x12}, - {0x95d9,0x01}, - {0x95da,0x6c}, - {0x95db,0x75}, - {0x95dc,0x51}, - {0x95dd,0x05}, - {0x95de,0xae}, - {0x95df,0x51}, - {0x95e0,0x15}, - {0x95e1,0x51}, - {0x95e2,0xee}, - {0x95e3,0x70}, - {0x95e4,0xf9}, - {0x95e5,0xdf}, - {0x95e6,0xc2}, - {0x95e7,0x22}, - {0x95e8,0xe5}, - {0x95e9,0x20}, - {0x95ea,0x54}, - {0x95eb,0x07}, - {0x95ec,0xff}, - {0x95ed,0xbf}, - {0x95ee,0x01}, - {0x95ef,0x03}, - {0x95f0,0x02}, - {0x95f1,0x10}, - {0x95f2,0x7e}, - {0x95f3,0xe5}, - {0x95f4,0x20}, - {0x95f5,0x54}, - {0x95f6,0x07}, - {0x95f7,0xff}, - {0x95f8,0xbf}, - {0x95f9,0x07}, - {0x95fa,0x03}, - {0x95fb,0x02}, - {0x95fc,0x11}, - {0x95fd,0x7c}, - {0x95fe,0xe5}, - {0x95ff,0x20}, - {0x9600,0x54}, - {0x9601,0x07}, - {0x9602,0xff}, - {0x9603,0xbf}, - {0x9604,0x03}, - {0x9605,0x03}, - {0x9606,0x02}, - {0x9607,0x13}, - {0x9608,0xcc}, - {0x9609,0xe5}, - {0x960a,0x20}, - {0x960b,0x54}, - {0x960c,0x07}, - {0x960d,0xff}, - {0x960e,0xbf}, - {0x960f,0x05}, - {0x9610,0x03}, - {0x9611,0x12}, - {0x9612,0x16}, - {0x9613,0xe2}, - {0x9614,0x22}, - {0x9615,0x12}, - {0x9616,0x15}, - {0x9617,0x5d}, - {0x9618,0x12}, - {0x9619,0x16}, - {0x961a,0xf0}, - {0x961b,0x50}, - {0x961c,0x04}, - {0x961d,0xd2}, - {0x961e,0x05}, - {0x961f,0x80}, - {0x9620,0x02}, - {0x9621,0xc2}, - {0x9622,0x05}, - {0x9623,0x12}, - {0x9624,0x02}, - {0x9625,0x40}, - {0x9626,0xc2}, - {0x9627,0x39}, - {0x9628,0xc2}, - {0x9629,0x36}, - {0x962a,0xc2}, - {0x962b,0x31}, - {0x962c,0xd2}, - {0x962d,0x34}, - {0x962e,0x12}, - {0x962f,0x02}, - {0x9630,0x85}, - {0x9631,0xb5}, - {0x9632,0x07}, - {0x9633,0x03}, - {0x9634,0xd3}, - {0x9635,0x80}, - {0x9636,0x01}, - {0x9637,0xc3}, - {0x9638,0x40}, - {0x9639,0x02}, - {0x963a,0xc2}, - {0x963b,0x05}, - {0x963c,0x22}, - {0x963d,0xe4}, - {0x963e,0xff}, - {0x963f,0xfe}, - {0x9640,0xc3}, - {0x9641,0xef}, - {0x9642,0x95}, - {0x9643,0x11}, - {0x9644,0xee}, - {0x9645,0x95}, - {0x9646,0x10}, - {0x9647,0x50}, - {0x9648,0x15}, - {0x9649,0x7d}, - {0x964a,0x8a}, - {0x964b,0x7c}, - {0x964c,0x02}, - {0x964d,0xed}, - {0x964e,0x1d}, - {0x964f,0xaa}, - {0x9650,0x04}, - {0x9651,0x70}, - {0x9652,0x01}, - {0x9653,0x1c}, - {0x9654,0x4a}, - {0x9655,0x70}, - {0x9656,0xf6}, - {0x9657,0x0f}, - {0x9658,0xbf}, - {0x9659,0x00}, - {0x965a,0x01}, - {0x965b,0x0e}, - {0x965c,0x80}, - {0x965d,0xe2}, - {0x965e,0x22}, - {0x965f,0xc2}, - {0x9660,0x03}, - {0x9661,0xd2}, - {0x9662,0x04}, - {0x9663,0x12}, - {0x9664,0x02}, - {0x9665,0xa5}, - {0x9666,0x30}, - {0x9667,0x07}, - {0x9668,0x05}, - {0x9669,0x30}, - {0x966a,0x06}, - {0x966b,0x02}, - {0x966c,0xd2}, - {0x966d,0x36}, - {0x966e,0xc2}, - {0x966f,0x3e}, - {0x9670,0x12}, - {0x9671,0x0f}, - {0x9672,0xf1}, - {0x9673,0xc2}, - {0x9674,0x3e}, - {0x9675,0x12}, - {0x9676,0x12}, - {0x9677,0xad}, - {0x9678,0xd2}, - {0x9679,0x34}, - {0x967a,0x22}, - {0x967b,0x75}, - {0x967c,0x48}, - {0x967d,0x13}, - {0x967e,0x75}, - {0x967f,0x49}, - {0x9680,0x73}, - {0x9681,0x90}, - {0x9682,0x13}, - {0x9683,0x71}, - {0x9684,0xe4}, - {0x9685,0x93}, - {0x9686,0xf5}, - {0x9687,0x7b}, - {0x9688,0xa3}, - {0x9689,0xe4}, - {0x968a,0x93}, - {0x968b,0xf5}, - {0x968c,0x32}, - {0x968d,0xc2}, - {0x968e,0x3a}, - {0x968f,0x22}, - {0x9690,0xe4}, - {0x9691,0xff}, - {0x9692,0xef}, - {0x9693,0x25}, - {0x9694,0xe0}, - {0x9695,0x24}, - {0x9696,0x56}, - {0x9697,0xf8}, - {0x9698,0xe4}, - {0x9699,0xf6}, - {0x969a,0x08}, - {0x969b,0xf6}, - {0x969c,0x0f}, - {0x969d,0xbf}, - {0x969e,0x07}, - {0x969f,0xf2}, - {0x96a0,0x53}, - {0x96a1,0x24}, - {0x96a2,0x80}, - {0x96a3,0x22}, - {0x96a4,0xe5}, - {0x96a5,0x7c}, - {0x96a6,0xc3}, - {0x96a7,0x95}, - {0x96a8,0x7b}, - {0x96a9,0x40}, - {0x96aa,0x01}, - {0x96ab,0x22}, - {0x96ac,0xe5}, - {0x96ad,0x7c}, - {0x96ae,0x04}, - {0x96af,0xf5}, - {0x96b0,0x0c}, - {0x96b1,0x12}, - {0x96b2,0x0f}, - {0x96b3,0x52}, - {0x96b4,0x22}, - {0x96b5,0xe5}, - {0x96b6,0x7c}, - {0x96b7,0x70}, - {0x96b8,0x02}, - {0x96b9,0xc3}, - {0x96ba,0x22}, - {0x96bb,0xe5}, - {0x96bc,0x7c}, - {0x96bd,0x14}, - {0x96be,0xf5}, - {0x96bf,0x0c}, - {0x96c0,0x12}, - {0x96c1,0x0f}, - {0x96c2,0x52}, - {0x96c3,0x22}, - {0x96c4,0xe5}, - {0x96c5,0x7d}, - {0x96c6,0xb4}, - {0x96c7,0x01}, - {0x96c8,0x09}, - {0x96c9,0x12}, - {0x96ca,0x16}, - {0x96cb,0x7b}, - {0x96cc,0xe4}, - {0x96cd,0xf5}, - {0x96ce,0x0c}, - {0x96cf,0x12}, - {0x96d0,0x0f}, - {0x96d1,0x52}, - {0x96d2,0x22}, - {0x96d3,0xe5}, - {0x96d4,0x7d}, - {0x96d5,0x24}, - {0x96d6,0xfe}, - {0x96d7,0x60}, - {0x96d8,0x06}, - {0x96d9,0x04}, - {0x96da,0x70}, - {0x96db,0x05}, - {0x96dc,0xd2}, - {0x96dd,0x39}, - {0x96de,0x22}, - {0x96df,0xc2}, - {0x96e0,0x39}, - {0x96e1,0x22}, - {0x96e2,0xe5}, - {0x96e3,0x31}, - {0x96e4,0xd3}, - {0x96e5,0x94}, - {0x96e6,0x00}, - {0x96e7,0x40}, - {0x96e8,0x03}, - {0x96e9,0x15}, - {0x96ea,0x31}, - {0x96eb,0x22}, - {0x96ec,0x12}, - {0x96ed,0x16}, - {0x96ee,0x5f}, - {0x96ef,0x22}, - {0x96f0,0x12}, - {0x96f1,0x16}, - {0x96f2,0x7b}, - {0x96f3,0xe4}, - {0x96f4,0xf5}, - {0x96f5,0x0c}, - {0x96f6,0x12}, - {0x96f7,0x0f}, - {0x96f8,0x52}, - {0x96f9,0x22}, - {0x3024,0x00}, - {0x3025,0x00}, - {0x5082,0x00}, - {0x5083,0x00}, - {0x5084,0x00}, - {0x5085,0x00}, - {0x3026,0x00}, - {0x3027,0xFF}, - {0x3000,0x00}, - {0x0000,0x00} -}; -#endif - diff --git a/drivers/media/video/ov7675.c b/drivers/media/video/ov7675.c deleted file mode 100755 index 4c10b58ee8f4..000000000000 --- a/drivers/media/video/ov7675.c +++ /dev/null @@ -1,2821 +0,0 @@ - -/* -o* Driver for MT9M001 CMOS Image Sensor from Micron - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_OV7675 -#define SENSOR_V4L2_IDENT V4L2_IDENT_OV7675 -#define SENSOR_ID 0x76 -#define SENSOR_MIN_WIDTH 640//176 -#define SENSOR_MIN_HEIGHT 480//144 -#define SENSOR_MAX_WIDTH 640 -#define SENSOR_MAX_HEIGHT 480 -#define SENSOR_INIT_WIDTH 640 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 480 -#define SENSOR_INIT_WINSEQADR sensor_vga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_YUYV8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 0 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 0 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 1 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 - -#define CONFIG_SENSOR_I2C_SPEED 250000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -struct reginfo -{ - u8 reg; - u8 val; -}; - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); - -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_OV7675_USER_DEFINED_SERIES -#include "ov7675_user_series.c" -#else -/* init 640X480 VGA */ -static struct reginfo sensor_init_data[] = -{ - {0x12, 0x80}, - {0x11, 0x80}, - {0x2a, 0x00}, - {0x2b, 0x00}, - {0x92, 0x66}, - {0x93, 0x00}, - {0x3a, 0x0c}, - {0x3D, 0xC0}, - {0x12, 0x00}, - {0x15, 0x00}, - {0xc1, 0x7f}, - {0x17, 0x13}, - {0x18, 0x01}, - {0x32, 0xbF}, - {0x19, 0x03}, - {0x1a, 0x7b}, - {0x03, 0x0a}, - {0x0c, 0x00}, - {0x3e, 0x00}, - {0x70, 0x3a}, - {0x71, 0x35}, - {0x72, 0x11}, - {0x73, 0xf0}, - {0xa2, 0x02}, - {0x13, 0xe0}, - //{0x00, 0x00}, - {0x10, 0x00}, - {0x14, 0x28}, - {0xa5, 0x06}, - {0xab, 0x07}, - {0x24, 0x58}, - {0x25, 0x48}, - {0x26, 0x93}, - {0x9f, 0x78}, - {0xa0, 0x68}, - {0xa1, 0x03}, - {0xa6, 0xD8}, - {0xa7, 0xD8}, - {0xa8, 0xf0}, - {0xa9, 0x90}, - {0xaa, 0x14}, - {0x13, 0xe5}, - {0x0e, 0x61}, - {0x0f, 0x4b}, - {0x16, 0x02}, - {0x1e, 0x17}, //0x07//0x27 - {0x21, 0x02}, - {0x22, 0x91}, - {0x29, 0x07}, - {0x33, 0x0b}, - {0x35, 0x0b}, - {0x37, 0x1d}, - {0x38, 0x71}, - {0x39, 0x2a}, - {0x3c, 0x78}, - {0x4d, 0x40}, - {0x4e, 0x20}, - {0x69, 0x00}, - {0x6b, 0x0a}, - {0x74, 0x10}, - {0x8d, 0x4f}, - {0x8e, 0x00}, - {0x8f, 0x00}, - {0x90, 0x00}, - {0x91, 0x00}, - {0x96, 0x00}, - {0x9a, 0x80}, - {0xb0, 0x84}, - {0xb1, 0x0c}, - {0xb2, 0x0e}, - {0xb3, 0x82}, - {0xb8, 0x0a}, - {0xbb, 0xa1}, - {0x0d, 0x60}, - {0x42, 0x80}, - {0x62, 0x00}, - {0x63, 0x00}, - {0x64, 0x10}, - {0x65, 0x07}, - {0x66, 0x05}, - {0x94, 0x10}, - {0x95, 0x12}, - {0x7a, 0x20},// {0x7a, 0x24}, - {0x7b, 0x16},// {0x7b, 0x04}, - {0x7c, 0x23},// {0x7c, 0x07}, - {0x7d, 0x3c},// {0x7d, 0x12}, - {0x7e, 0x5c},// {0x7e, 0x2f}, - {0x7f, 0x69},// {0x7f, 0x3f}, - {0x80, 0x75},// {0x80, 0x4d}, - {0x81, 0x7e},// {0x81, 0x5a}, - {0x82, 0x88},// {0x82, 0x69}, - {0x83, 0x8f},// {0x83, 0x74}, - {0x84, 0x96},// {0x84, 0x7f}, - {0x85, 0xa3},// {0x85, 0x91}, - {0x86, 0xaf},// {0x86, 0x9e}, - {0x87, 0xc4},// {0x87, 0xbb}, - {0x88, 0xd7},// {0x88, 0xd2}, - {0x89, 0xe8},// {0x89, 0xe5}, - {0x43, 0x0a}, - {0x44, 0xf0}, - {0x45, 0x34}, - {0x46, 0x58}, - {0x47, 0x28}, - {0x48, 0x3a}, - {0x59, 0x88}, - {0x5a, 0x88}, - {0x5b, 0xc2}, - {0x5c, 0x60}, - {0x5d, 0x58}, - {0x5e, 0x10}, - {0x6c, 0x0a}, - {0x6d, 0x55}, - {0x6e, 0x11}, - {0x6f, 0x9e}, - {0x6a, 0x40}, - {0x01, 0x56}, - {0x02, 0x44}, - {0x13, 0xe7}, - {0x4f, 0x95}, - {0x50, 0x99}, - {0x51, 0x04}, - {0x52, 0x1a}, - {0x53, 0x7f}, - {0x54, 0x99}, - {0x58, 0x1a}, - {0x3f, 0x02}, - {0x75, 0x63}, - {0x76, 0xe1}, - {0x4c, 0x00}, - {0x77, 0x04},//0x01 - {0x4b, 0x09}, - {0xc9, 0x60}, - {0x41, 0x38}, - {0x56, 0x40}, - {0x34, 0x11}, - {0x3b, 0xaa}, - {0xa4, 0x88}, - {0x96, 0x00}, - {0x97, 0x30}, - {0x98, 0x20}, - {0x99, 0x30}, - {0x9a, 0x84}, - {0x9b, 0x29}, - {0x9c, 0x03}, - {0x9d, 0x99}, - {0x9e, 0x99}, - {0x78, 0x04}, - {0x79, 0x01}, - {0xc8, 0xf0}, - {0x79, 0x0f}, - {0xc8, 0x00}, - {0x79, 0x10}, - {0xc8, 0x7e}, - {0x79, 0x0a}, - {0xc8, 0x80}, - {0x79, 0x0b}, - {0xc8, 0x01}, - {0x79, 0x0c}, - {0xc8, 0x0f}, - {0x79, 0x0d}, - {0xc8, 0x20}, - {0x79, 0x09}, - {0xc8, 0x80}, - {0x79, 0x02}, - {0xc8, 0xc0}, - {0x79, 0x03}, - {0xc8, 0x40}, - {0x79, 0x05}, - {0xc8, 0x30}, - {0x79, 0x26}, - {0x00, 0x00} -}; - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {0x00,0x00} -}; - -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - {0x0, 0x0}, -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - {0x17, 0x13}, - {0x18, 0x01}, - {0x32, 0xbf}, - {0x19, 0x03}, - {0x1a, 0x7b}, - {0x03, 0x0a}, - {0x00,0x00} -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {0x00,0x00} -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - {0x00,0x00} -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {0x00,0x00} -}; -#endif -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {0x00, 0x00} -}; - - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0x84, 0x6C}, //Contrast 4 - {0x85, 0x78}, - {0x86, 0x8C}, - {0x87, 0x9E}, - {0x88, 0xBB}, - {0x89, 0xD2}, - {0x8A, 0xE6}, - {0x6C, 0x40}, - {0x6D, 0x30}, - {0x6E, 0x48}, - {0x6F, 0x60}, - {0x70, 0x70}, - {0x71, 0x70}, - {0x72, 0x70}, - {0x73, 0x70}, - {0x74, 0x60}, - {0x75, 0x60}, - {0x76, 0x50}, - {0x77, 0x48}, - {0x78, 0x3A}, - {0x79, 0x2E}, - {0x7A, 0x28}, - {0x7B, 0x22}, - - {0x0f, 0x4a}, //Saturation 3 - {0x27, 0x80}, - {0x28, 0x80}, - {0x2c, 0x80}, - {0x62, 0x60}, - {0x63, 0xe0}, - {0x64, 0x04}, - {0x65, 0x00}, - {0x66, 0x01}, - {0x24, 0x70}, - {0x25, 0x64}, - - {0x4f, 0x2e}, //Brightness 3 - {0x50, 0x31}, - {0x51, 0x02}, - {0x52, 0x0e}, - {0x53, 0x1e}, - {0x54, 0x2d}, - - {0x11, 0x80}, - {0x14, 0x2a}, - {0x13, 0xe7}, - {0x66, 0x05}, - - {0x00, 0x00} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0x7C,0x04}, //Contrast 5 - {0x7D,0x09}, - {0x7E,0x13}, - {0x7F,0x29}, - {0x80,0x35}, - {0x81,0x41}, - {0x82,0x4D}, - {0x83,0x59}, - {0x84,0x64}, - {0x85,0x6F}, - {0x86,0x85}, - {0x87,0x97}, - {0x88,0xB7}, - {0x89,0xCF}, - {0x8A,0xE3}, - {0x6C,0x40}, - {0x6D,0x50}, - {0x6E,0x50}, - {0x6F,0x58}, - {0x70,0x60}, - {0x71,0x60}, - {0x72,0x60}, - {0x73,0x60}, - {0x74,0x58}, - {0x75,0x58}, - {0x76,0x58}, - {0x77,0x48}, - {0x78,0x40}, - {0x79,0x30}, - {0x7A,0x28}, - {0x7B,0x26}, - - - - {0x4f,0x3a}, //Saturation 4 - {0x50,0x3d}, - {0x51,0x03}, - {0x52,0x12}, - {0x53,0x26}, - {0x54,0x38}, - {0x4f, 0x2e}, //Brightness 3 - {0x50, 0x31}, - {0x51, 0x02}, - {0x52, 0x0e}, - {0x53, 0x1e}, - {0x54, 0x2d}, - - {0x11,0x80}, - {0x14,0x0a}, - {0x13,0xc7}, - {0x66,0x05}, - {0x00, 0x00} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x7C,0x04}, //Contrast 5 - {0x7D,0x09}, - {0x7E,0x13}, - {0x7F,0x29}, - {0x80,0x35}, - {0x81,0x41}, - {0x82,0x4D}, - {0x83,0x59}, - {0x84,0x64}, - {0x85,0x6F}, - {0x86,0x85}, - {0x87,0x97}, - {0x88,0xB7}, - {0x89,0xCF}, - {0x8A,0xE3}, - {0x6C,0x40}, - {0x6D,0x50}, - {0x6E,0x50}, - {0x6F,0x58}, - {0x70,0x60}, - {0x71,0x60}, - {0x72,0x60}, - {0x73,0x60}, - {0x74,0x58}, - {0x75,0x58}, - {0x76,0x58}, - {0x77,0x48}, - {0x78,0x40}, - {0x79,0x30}, - {0x7A,0x28}, - {0x7B,0x26}, - - - - {0x4f,0x3a}, //Saturation 4 - {0x50,0x3d}, - {0x51,0x03}, - {0x52,0x12}, - {0x53,0x26}, - {0x54,0x38}, - {0x4f, 0x2e}, //Brightness 3 - {0x50, 0x31}, - {0x51, 0x02}, - {0x52, 0x0e}, - {0x53, 0x1e}, - {0x54, 0x2d}, - - {0x11,0x80}, - {0x14,0x0a}, - {0x13,0xc7}, - {0x66,0x05}, - {0x00, 0x00} -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0x84, 0x6C}, //Contrast 4 - {0x85, 0x78}, - {0x86, 0x8C}, - {0x87, 0x9E}, - {0x88, 0xBB}, - {0x89, 0xD2}, - {0x8A, 0xE6}, - {0x6C, 0x40}, - {0x6D, 0x30}, - {0x6E, 0x48}, - {0x6F, 0x60}, - {0x70, 0x70}, - {0x71, 0x70}, - {0x72, 0x70}, - {0x73, 0x70}, - {0x74, 0x60}, - {0x75, 0x60}, - {0x76, 0x50}, - {0x77, 0x48}, - {0x78, 0x3A}, - {0x79, 0x2E}, - {0x7A, 0x28}, - {0x7B, 0x22}, - - {0x0f, 0x4a}, //Saturation 3 - {0x27, 0x80}, - {0x28, 0x80}, - {0x2c, 0x80}, - {0x62, 0x60}, - {0x63, 0xe0}, - {0x64, 0x04}, - {0x65, 0x00}, - {0x66, 0x01}, - {0x24, 0x70}, - {0x25, 0x64}, - - {0x4f, 0x2e}, //Brightness 3 - {0x50, 0x31}, - {0x51, 0x02}, - {0x52, 0x0e}, - {0x53, 0x1e}, - {0x54, 0x2d}, - - {0x11,0x80}, - {0x14,0x2a}, - {0x13,0xe7}, - {0x66,0x05}, - - {0x00, 0x00} - - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x84, 0x6C}, //Contrast 4 - {0x85, 0x78}, - {0x86, 0x8C}, - {0x87, 0x9E}, - {0x88, 0xBB}, - {0x89, 0xD2}, - {0x8A, 0xE6}, - {0x6C, 0x40}, - {0x6D, 0x30}, - {0x6E, 0x48}, - {0x6F, 0x60}, - {0x70, 0x70}, - {0x71, 0x70}, - {0x72, 0x70}, - {0x73, 0x70}, - {0x74, 0x60}, - {0x75, 0x60}, - {0x76, 0x50}, - {0x77, 0x48}, - {0x78, 0x3A}, - {0x79, 0x2E}, - {0x7A, 0x28}, - {0x7B, 0x22}, - - {0x0f, 0x4a}, //Saturation 3 - {0x27, 0x80}, - {0x28, 0x80}, - {0x2c, 0x80}, - {0x62, 0x60}, - {0x63, 0xe0}, - {0x64, 0x04}, - {0x65, 0x00}, - {0x66, 0x01}, - {0x24, 0x70}, - {0x25, 0x64}, - - {0x4f, 0x2e}, //Brightness 3 - {0x50, 0x31}, - {0x51, 0x02}, - {0x52, 0x0e}, - {0x53, 0x1e}, - {0x54, 0x2d}, - - {0x11, 0x80}, - {0x14, 0x2a}, - {0x13, 0xe7}, - {0x66, 0x05}, - {0x00, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - // Brightness -2 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x49}, - {0x339a, 0x20}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness1[]= -{ - // Brightness -1 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x49}, - {0x339a, 0x10}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - // Brightness 0 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x00}, - {0x3390, 0x41}, - {0x339a, 0x00}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - // Brightness +1 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x41}, - {0x339a, 0x10}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - // Brightness +2 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x41}, - {0x339a, 0x20}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - // Brightness +3 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, //bit[2] enable - {0x3390, 0x41}, //bit[3] sign of brightness - {0x339a, 0x30}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x3a,0x0d}, - {0x67,0x80}, - {0x68,0x80}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {0x3a,0x1d}, - {0x67,0x80}, - {0x68,0x80}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x3a,0x1d}, - {0x67,0x40}, - {0x68,0xa0}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - //Negative - {0x3a,0x2d}, - {0x67,0x80}, - {0x68,0x80}, - {0x00, 0x00} -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - // Bluish - {0x3a,0x1d}, - {0x67,0xc0}, - {0x68,0x80}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish - {0x3a,0x1d}, - {0x67,0x40}, - {0x68,0x40}, - {0x00, 0x00} -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure1[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - {0x00, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {0x00, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast2[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - {0x00, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - {0x00, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {0x00, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {0x00, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ -{0x00, 0x00} -}; - -static struct reginfo sensor_SceneNight[] = -{ -{0x00, 0x00} -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom1[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom2[] = -{ - {0x0, 0x0}, -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {0x0, 0x0}, -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif -static const struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -static int sensor_deactivate(struct i2c_client *client); - - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - unsigned int winseqe_cur_addr; - struct sensor_datafmt fmt; - -} sensor_info_priv_t; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, u8 reg, u8 val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[1]; - - buf[0] = reg & 0xFF; - buf[1] = val; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - udelay(50); - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) -{ - int err,cnt; - u8 buf[1]; - struct i2c_msg msg[2]; - - buf[0] = reg; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 1; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - - while (regarray[i].reg != 0) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - i++; - } - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != 0) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - if (on == 0) - mdelay(1); - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(20); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_power_end: - return ret; -} - -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - int ret; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - ret = sensor_write(client, 0x12, 0x80); - if (ret != 0) - { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); //delay 5 microseconds - - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - sensor->info_priv.winseqe_cur_addr = (int)SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - - return 0; -sensor_INIT_ERR: - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} - -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - //u8 reg_val; - - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - sensor_ioctrl(icd, Sensor_PowerDown, 1); - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - msleep(100); - return 0; -} -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - - return 0; - -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - const struct v4l2_queryctrl *qctrl; - struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - char readval; - int ret=0, set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - //winseqe_set_addr = sensor_ClrFmt_YUYV; - sensor_read(client, 0x3a, &readval); - sensor_write(client,0x3a, readval&0xf7); - sensor_read(client,0x3d,&readval); - sensor_write(client,0x3d,readval&0xfe); - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - //winseqe_set_addr = sensor_ClrFmt_UYVY; - sensor_read(client, 0x3a, &readval); - sensor_write(client,0x3a, readval|0x08); - sensor_read(client,0x3d,&readval); - sensor_write(client,0x3d,readval&0xfe); - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - winseqe_set_addr = sensor_svga; - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - winseqe_set_addr = sensor_vga; //sensor_sxga; - set_w = 1280; - set_h = 1024; - } - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) { - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - } else { /* ddl@rock-chips.com : Video */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - } - #endif - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - - sensor->info_priv.winseqe_cur_addr = (int)winseqe_set_addr; - - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - #if CONFIG_SENSOR_Effect - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - #endif - #if CONFIG_SENSOR_WhiteBalance - if (sensor->info_priv.whiteBalance != 0) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - #endif - sensor->info_priv.snap2preview = true; - } else if (sensor_fmt_videochk(sd,mf) == true) { /* ddl@rock-chips.com : Video */ - #if CONFIG_SENSOR_Effect - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - #endif - #if CONFIG_SENSOR_WhiteBalance - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - #endif - sensor->info_priv.video2preview = true; - } else if ((sensor->info_priv.snap2preview == true) || (sensor->info_priv.video2preview == true)) { - #if CONFIG_SENSOR_Effect - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - #endif - #if CONFIG_SENSOR_WhiteBalance - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - #endif - sensor->info_priv.video2preview = false; - sensor->info_priv.snap2preview = false; - } - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; - -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - set_w = 1280; - set_h = 1024; - } - else - { - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - - mf->width = set_w; - mf->height = set_h; - mf->colorspace = fmt->colorspace; - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV9650 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((*value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value > 0) && ((digitalzoom_cur + *value) > digitalzoom_total)) - { - *value = digitalzoom_total - digitalzoom_cur; - } - - if ((*value < 0) && ((digitalzoom_cur + *value) < 0)) - { - *value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += *value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, *value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char pid = 0; - int ret; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - /* soft reset */ - ret = sensor_write(client, 0x12, 0x80); - if (ret != 0) - { - SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); - return -ENODEV; - } - mdelay(50); //delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x0a, &pid); - if (ret != 0) { - SENSOR_TR("%s read chip id high byte failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - - return ret; -} - -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0; -#if CONFIG_SENSOR_Flash - int i; -#endif - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - sensor->sensor_gpio_res = NULL; - for (i=0; isensor_io_request->gpio_res[i].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[i].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[i]; - } - } - if (sensor->sensor_gpio_res == NULL) { - SENSOR_TR("%s %s obtain gpio resource failed when RK29_CAM_SUBDEV_IOREQUEST \n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - sensor->info_priv.fmt = sensor_colour_fmts[0]; - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - - diff --git a/drivers/media/video/ov7690.c b/drivers/media/video/ov7690.c deleted file mode 100755 index 2ef56d08c597..000000000000 --- a/drivers/media/video/ov7690.c +++ /dev/null @@ -1,2598 +0,0 @@ -/* -o* Driver for MT9M001 CMOS Image Sensor from Micron - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_OV7690 -#define SENSOR_V4L2_IDENT V4L2_IDENT_OV7690 -#define SENSOR_ID 0x76 -#define SENSOR_MIN_WIDTH 176 -#define SENSOR_MIN_HEIGHT 144 -#define SENSOR_MAX_WIDTH 640 -#define SENSOR_MAX_HEIGHT 480 -#define SENSOR_INIT_WIDTH 640 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 480 -#define SENSOR_INIT_WINSEQADR sensor_vga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_YUYV8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 0 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 1 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 - -#define CONFIG_SENSOR_I2C_SPEED 250000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING|\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -struct reginfo -{ - u8 reg; - u8 val; -}; - - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); - -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_OV7690_USER_DEFINED_SERIES -#include "ov7690_user_series.c" -#else - -/* init 640X480 VGA */ -static struct reginfo sensor_init_data[] = -{ - {0x12, 0x80}, - {0x49, 0x0c}, - {0x0c, 0x06}, - {0x48, 0x42}, - {0x41, 0x43}, - {0x4c, 0x73}, - {0x81, 0xff}, - {0x21, 0x44}, - {0x16, 0x03}, - {0x39, 0x80}, - {0x1e, 0xb1}, -// formate - {0x12, 0x00}, - {0x82, 0x03}, - {0xd0, 0x48}, - {0x80, 0x7F}, - {0x3e, 0x30}, - {0x22, 0x00}, -// resolution - {0x17, 0x69}, - {0x18, 0xa4}, - {0x19, 0x0c}, - {0x1a, 0xf6}, - - {0xc8, 0x02}, - {0xc9, 0x80}, - {0xca, 0x01}, - {0xcb, 0xe0}, - - {0xcc, 0x02}, - {0xcd, 0x80}, - {0xce, 0x01}, - {0xcf, 0xe0}, -// Lens Correction - {0x85, 0x90}, - {0x86, 0x00}, - {0x87, 0x00}, - {0x88, 0x10}, - {0x89, 0x30}, - {0x8a, 0x29}, - {0x8b, 0x26}, -// Color Matrix - {0xbb, 0x80}, - {0xbc, 0x62}, - {0xbd, 0x1e}, - {0xbe, 0x26}, - {0xbf, 0x7b}, - {0xc0, 0xac}, - {0xc1, 0x1e}, -// Edge + Denoise - {0xb7, 0x05c}, - {0xb8, 0x09}, - {0xb9, 0x00}, //0x07//0x27 - {0xba, 0x18}, -// UVAdjust - {0x5a, 0x4a}, - {0x5b, 0x9f}, - {0x5c, 0x48}, - {0x5d, 0x32}, -// AEC/AGC target - {0x24, 0x78}, - {0x25, 0x68}, - {0x26, 0xb3}, -// Gamma - {0xa3, 0x0b}, - {0xa4, 0x15}, - {0xa5, 0x2a}, - {0xa6, 0x51}, - {0xa7, 0x63}, - {0xa8, 0x74}, - {0xa9, 0x83}, - {0xaa, 0x91}, - {0xab, 0x9e}, - {0xac, 0xaa}, - {0xad, 0xbe}, - {0xae, 0xce}, - {0xaf, 0xe5}, - {0xb0, 0xf3}, - {0xb1, 0xfb}, - {0xb2, 0x06}, -//simple - {0x8e, 0x92}, - {0x96, 0xff}, - {0x97, 0x00}, -// Advance - {0x8c, 0x5d}, - {0x8d, 0x11}, - {0x8e, 0x12}, - {0x8f, 0x11}, - {0x90, 0x50}, - {0x91, 0x22}, - {0x92, 0xd1}, - {0x93, 0xa7}, - {0x94, 0x23}, - {0x95, 0x3b}, - {0x96, 0xff}, - {0x97, 0x00}, - {0x98, 0x4a}, - {0x99, 0x46}, - {0x9a, 0x3d}, - {0x9b, 0x3a}, - {0x9c, 0xf0}, - {0x9d, 0xf0}, - {0x9e, 0xf0}, - {0x9f, 0xff}, - {0xa0, 0x56}, - {0xa1, 0x55}, - {0xa2, 0x13}, -// General Control - {0x50, 0x4c}, - {0x51, 0x3f}, - {0x21, 0x57}, - {0x20, 0x00}, - - {0x14, 0x29}, - {0x13, 0xf7}, - {0x11, 0x01}, - {0xd2, 0x06}, - - {0x2a, 0x30}, - {0x2b, 0x0b}, - {0x2c, 0x00} -}; - -/* 1280x720 */ -static struct reginfo sensor_720p[]= -{ - {0x00 ,0x00} - -}; - -/* 1600X1200 UXGA */ -static struct reginfo sensor_uxga[] = -{ - {0x00, 0x00} -}; - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {0x0, 0x0} -}; -/* 1024X768 SXGA */ -static struct reginfo sensor_xga[] = -{ - {0x0, 0x0} -}; -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - {0x00, 0x00} -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - {0x16,0x03}, - {0x17,0x69}, - {0x18,0xa4}, - {0x19,0x0c}, - {0x1a,0xf6}, - {0x22,0x00}, - {0xc8,0x02}, - {0xc9,0x80}, - {0xca,0x01}, - {0xcb,0xe0}, - {0xcc,0x02}, - {0xcd,0x80}, - {0xce,0x01}, - {0xcf,0xe0}, - {0x00,0x00} -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {0x00,0x00} -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - {0x16,0x03}, - {0x17,0x69}, - {0x18,0xa4}, - {0x19,0x06}, - {0x1a,0xf6}, - {0x22,0x10}, - {0xc8,0x02}, - {0xc9,0x80}, - {0xca,0x00}, - {0xcb,0xf0}, - {0xcc,0x01}, - {0xcd,0x40}, - {0xce,0x00}, - {0xcf,0xf0}, - {0x00,0x00} -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {0x16,0x40}, - {0x17,0x83}, - {0x18,0x96}, - {0x19,0x06}, - {0x1a,0xf6}, - {0x22,0x10}, - {0xc8,0x02}, - {0xc9,0x4b}, - {0xca,0x00}, - {0xcb,0xf0}, - {0xcc,0x00}, - {0xcd,0xb0}, - {0xce,0x00}, - {0xcf,0x90}, - {0x00,0x00} -}; -#endif -#if 0 -/* 160X120 QQVGA*/ -static struct reginfo ov2655_qqvga[] = -{ - {0x0, 0x0}, -}; - - - -static struct reginfo ov2655_Sharpness_auto[] = -{ - {0x3306, 0x00}, -}; - -static struct reginfo ov2655_Sharpness1[] = -{ - {0x3306, 0x08}, - {0x3371, 0x00}, -}; - -static struct reginfo ov2655_Sharpness2[][3] = -{ - //Sharpness 2 - {0x3306, 0x08}, - {0x3371, 0x01}, -}; - -static struct reginfo ov2655_Sharpness3[] = -{ - //default - {0x3306, 0x08}, - {0x332d, 0x02}, -}; -static struct reginfo ov2655_Sharpness4[]= -{ - //Sharpness 4 - {0x3306, 0x08}, - {0x332d, 0x03}, -}; - -static struct reginfo ov2655_Sharpness5[] = -{ - //Sharpness 5 - {0x3306, 0x08}, - {0x332d, 0x04}, -}; -#endif - -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {0x00, 0x00} -}; - - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0x13, 0xf7}, - {0x00, 0x00} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0x13, 0xf5}, - {0x01, 0x40}, - {0x02, 0x5d}, - {0x03, 0x40}, - {0x00, 0x00} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - {0x13, 0xf5}, - {0x01, 0x44}, - {0x02, 0x55}, - {0x03, 0x40}, - {0x00, 0x00} -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - {0x13, 0xf5}, - {0x01, 0x5b}, - {0x02, 0x4c}, - {0x03, 0x40}, - {0x00, 0x00} - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - {0x13, 0xf5}, - {0x01, 0x62}, - {0x02, 0x40}, - {0x03, 0x41}, - {0x00, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - // Brightness -2 - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness1[]= -{ - // Brightness -1 - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - // Brightness 0 - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - // Brightness +1 - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - // Brightness +2 - - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - // Brightness +3 - - {0x0000, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0xd2,0x06}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {0xd2,0x1e}, - {0xda,0x80}, - {0xdb,0x80}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0xd2,0x1e}, - {0xda,0x40}, - {0xdb,0xa0}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - //Negative - {0xd2,0x46}, - {0x00, 0x00} -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - // Bluish - {0xd2,0x1e}, - {0xda,0xa0}, - {0xdb,0x40}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish - {0xd2,0x1e}, - {0xda,0x60}, - {0xdb,0x60}, - {0x00, 0x00} -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure1[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - {0x00, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {0x00, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast2[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - {0x00, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - {0x00, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {0x00, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {0x00, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ -{0x00, 0x00} -}; - -static struct reginfo sensor_SceneNight[] = -{ -{0x00, 0x00} -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom1[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom2[] = -{ - {0x0, 0x0}, -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {0x0, 0x0}, -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif -static const struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - unsigned int winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int funmodule_state; -} sensor_info_priv_t; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, u8 reg, u8 val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[1]; - - buf[0] = reg & 0xFF; - buf[1] = val; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - udelay(50); - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) -{ - int err,cnt; - u8 buf[1]; - struct i2c_msg msg[2]; - - buf[0] = reg; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 1; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - - while (regarray[i].reg != 0) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - i++; - } - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != 0) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - if (on == 0) - mdelay(1); - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(20); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_power_end: - return ret; -} - -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} - -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - int ret; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - ret = sensor_write(client, 0x12, 0x80); - if (ret != 0) - { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - mdelay(5); //delay 5 microseconds - - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - - sensor->info_priv.winseqe_cur_addr = (int)SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - - return 0; -sensor_INIT_ERR: - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} - -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - //u8 reg_val; - - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - sensor_ioctrl(icd, Sensor_PowerDown, 1); - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - msleep(100); - return 0; -} -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - - return 0; - -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - char readval; - int ret=0, set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - //winseqe_set_addr = sensor_ClrFmt_YUYV; - sensor_read(client, 0x3a, &readval); - sensor_write(client,0x3a, readval&0xf7); - sensor_read(client,0x3d,&readval); - sensor_write(client,0x3d,readval&0xfe); - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - //winseqe_set_addr = sensor_ClrFmt_UYVY; - sensor_read(client, 0x3a, &readval); - sensor_write(client,0x3a, readval|0x08); - sensor_read(client,0x3d,&readval); - sensor_write(client,0x3d,readval&0xfe); - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - winseqe_set_addr = sensor_svga; - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 720)) && sensor_720p[0].reg) - { - winseqe_set_addr = sensor_720p; - set_w = 1280; - set_h = 720; - } - else if (((set_w <= 1024) && (set_h <= 768)) && sensor_xga[0].reg) - { - winseqe_set_addr = sensor_xga; - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - winseqe_set_addr = sensor_vga; //sensor_sxga; - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && sensor_uxga[0].reg) - { - winseqe_set_addr = sensor_uxga; - set_w = 1600; - set_h = 1200; - } - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) { - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - } else { /* ddl@rock-chips.com : Video */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - } - #endif - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - - sensor->info_priv.winseqe_cur_addr = (int)winseqe_set_addr; - - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - #if CONFIG_SENSOR_Effect - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - #endif - #if CONFIG_SENSOR_WhiteBalance - if (sensor->info_priv.whiteBalance != 0) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - #endif - sensor->info_priv.snap2preview = true; - } else if (sensor_fmt_videochk(sd,mf) == true) { /* ddl@rock-chips.com : Video */ - #if CONFIG_SENSOR_Effect - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - #endif - #if CONFIG_SENSOR_WhiteBalance - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - #endif - sensor->info_priv.video2preview = true; - } else if ((sensor->info_priv.snap2preview == true) || (sensor->info_priv.video2preview == true)) { - #if CONFIG_SENSOR_Effect - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - #endif - #if CONFIG_SENSOR_WhiteBalance - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - #endif - sensor->info_priv.video2preview = false; - sensor->info_priv.snap2preview = false; - } - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; - -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - mf->colorspace = fmt->colorspace; - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV2655 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value > 0) && ((digitalzoom_cur + value) > digitalzoom_total)) - { - value = digitalzoom_total - digitalzoom_cur; - } - - if ((value < 0) && ((digitalzoom_cur + value) < 0)) - { - value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char pid = 0; - int ret; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - /* soft reset */ - ret = sensor_write(client, 0x12, 0x80); - if (ret != 0) - { - SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); - return -ENODEV; - } - mdelay(50); //delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x0a, &pid); - if (ret != 0) { - SENSOR_TR("%s read chip id high byte failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - - return ret; -} - -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0; -#if CONFIG_SENSOR_Flash - int i; -#endif - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - if (sensor->sensor_io_request->gpio_res[0].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[0].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[0]; - } else if (sensor->sensor_io_request->gpio_res[1].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[1].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[1]; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, -}; -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - - sensor->info_priv.fmt = sensor_colour_fmts[0]; - - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - - diff --git a/drivers/media/video/ov9650.c b/drivers/media/video/ov9650.c deleted file mode 100755 index ead02a2f7587..000000000000 --- a/drivers/media/video/ov9650.c +++ /dev/null @@ -1,2362 +0,0 @@ -/* -o* Driver for MT9M001 CMOS Image Sensor from Micron - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME ov9650 -#define SENSOR_V4L2_IDENT V4L2_IDENT_OV9650 -#define SENSOR_ID 0x96 -#define SENSOR_MIN_WIDTH 176 -#define SENSOR_MIN_HEIGHT 144 -#define SENSOR_MAX_WIDTH 1280 -#define SENSOR_MAX_HEIGHT 1024 -#define SENSOR_INIT_WIDTH 320 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 240 -#define SENSOR_INIT_WINSEQADR sensor_qvga - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 0 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 0 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 - -#define CONFIG_SENSOR_I2C_SPEED 100000 /* Hz */ - -#define CONFIG_SENSOR_TR 1 -#define CONFIG_SENSOR_DEBUG 1 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define MIN(x,y) ((xy) ? x: y) - -#if (CONFIG_SENSOR_TR) - #define SENSOR_TR(format, ...) printk(format, ## __VA_ARGS__) - #if (CONFIG_SENSOR_DEBUG) - #define SENSOR_DG(format, ...) printk(format, ## __VA_ARGS__) - #else - #define SENSOR_DG(format, ...) - #endif -#else - #define SENSOR_TR(format, ...) -#endif - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -struct reginfo -{ - u8 reg; - u8 val; -}; - -/* init 320X240 QVGA */ -static struct reginfo sensor_init_data[] = -{ - {0x12, 0x80}, - {0x11, 0x00},//0x82:Ϊ20Ø‘£»//0x02£ºÎª10Ø‘£» - {0x6b, 0x0a}, - {0x6a, 0x64}, - {0x3b, 0x09}, // night mode - {0x13, 0xe0}, - {0x01, 0x80}, - {0x02, 0x80}, -// {0x00, 0x00}, //jyk_0913, this setting is useless, but cause init unfinished! - {0x10, 0x00}, - {0x13, 0xe5}, - {0x39, 0x50}, - {0x38, 0x92}, - {0x37, 0x00}, - {0x35, 0x81}, - {0x0e, 0x20}, - {0x1e, 0x24},//34£ºµÚÒ»¸öˮƽÏßÓÐÒì³£ -> ;//04: <- ;//14: ;//Ðýת¶È - {0xA8, 0x80}, - {0x12, 0x10}, - {0x04, 0x00}, - {0x0c, 0x04}, - {0x0d, 0x80}, - {0x18, 0xc7}, - {0x17, 0x27}, - {0x32, 0xbd}, - {0x03, 0x36}, - {0x1a, 0x1e}, - {0x19, 0x00}, - {0x3f, 0xa6}, - {0x14, 0x1e},//½µµÍÔöÒæ£¬¼õСÔêÉù - {0x15, 0x00},//0x02 - {0x41, 0x02}, - {0x42, 0x08}, - {0x1b, 0x00}, - {0x16, 0x06}, - {0x33, 0xe2}, - {0x34, 0xbf}, - {0x96, 0x04}, - {0x3a, 0x00}, - {0x8e, 0x00}, - {0x3c, 0x77}, - {0x8B, 0x06}, - {0x94, 0x88}, - {0x95, 0x88}, - {0x40, 0xc1}, - {0x29, 0x3f}, - {0x0f, 0x42}, - {0x3d, 0x92}, - {0x69, 0x40}, - {0x5C, 0xb9}, - {0x5D, 0x96}, - {0x5E, 0x10}, - {0x59, 0xc0}, - {0x5A, 0xaf}, - {0x5B, 0x55}, - {0x43, 0xf0}, - {0x44, 0x10}, - {0x45, 0x68}, - {0x46, 0x96}, - {0x47, 0x60}, - {0x48, 0x80}, - {0x5F, 0xe0}, - {0x60, 0x8c}, - {0x61, 0x20}, - {0xa5, 0xd9}, - {0xa4, 0x74}, - {0x8d, 0x02}, - {0x13, 0xe7}, - {0x4f, 0x46}, - {0x50, 0x49}, - {0x51, 0x04}, - {0x52, 0x16}, - {0x53, 0x2e}, - {0x54, 0x43}, - {0x55, 0x40}, - {0x56, 0x40}, - {0x57, 0x40}, - {0x58, 0x0d}, - {0x8C, 0x23}, - {0x3E, 0x02}, - {0xa9, 0xb8}, - {0xaa, 0x92}, - {0xab, 0x0a}, - {0x8f, 0xdf}, - {0x90, 0x00}, - {0x91, 0x00}, - {0x9f, 0x00}, - {0xa0, 0x00}, - {0x3A, 0x0D}, - {0x24, 0x70}, - {0x25, 0x64}, - {0x26, 0xc3}, - {0x0f, 0x4a}, - {0x27, 0x20}, - {0x28, 0x20}, - {0x2c, 0x20}, - {0x2a, 0x10}, - {0x2b, 0x40}, - {0x6c, 0x40}, - {0x6d, 0x30}, - {0x6e, 0x4b}, - {0x6f, 0x60}, - {0x70, 0x70}, - {0x71, 0x70}, - {0x72, 0x70}, - {0x73, 0x70}, - {0x74, 0x60}, - {0x75, 0x60}, - {0x76, 0x50}, - {0x77, 0x48}, - {0x78, 0x3a}, - {0x79, 0x2e}, - {0x7a, 0x28}, - {0x7b, 0x22}, - {0x7c, 0x04}, - {0x7d, 0x07}, - {0x7e, 0x10}, - {0x7f, 0x28}, - {0x80, 0x36}, - {0x81, 0x44}, - {0x82, 0x52}, - {0x83, 0x60}, - {0x84, 0x6c}, - {0x85, 0x78}, - {0x86, 0x8c}, - {0x87, 0x9e}, - {0x88, 0xbb}, - {0x89, 0xd2}, - {0x8a, 0xe6}, - - {0x00,0x00} -}; - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ {0x04, 0x00}, - {0xa8, 0x80}, - {0x0c, 0x00}, - {0x0d, 0x00}, - {0x11, 0x80}, - {0x6b, 0x0a}, - {0x6a, 0x41}, - {0x12, 0x00}, - {0x18, 0xbd}, - {0x17, 0x1d}, - {0x32, 0xbd}, - {0x03, 0x12}, - {0x1a, 0x81}, - {0x19, 0x01}, - {0x39, 0x43}, - {0x38, 0x12}, - {0x35, 0x91}, - {0x92, 0x00}, - {0x93, 0x00}, - {0x2a, 0x10}, - {0x2b, 0x34}, - {0x00,0x00} -}; - -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - {0x0, 0x0}, -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - {0xa8, 0x80}, - {0x0c, 0x04}, - {0x0d, 0x80}, - {0x11, 0x00}, - {0x6b, 0x0a}, - {0x6a, 0x3e}, - {0x12, 0x40}, - {0x18, 0xc7}, - {0x17, 0x27}, - {0x32, 0xbd}, - {0x03, 0x00}, - {0x1a, 0x3d}, - {0x19, 0x01}, - {0x39, 0x50}, - {0x38, 0x92}, - {0x35, 0x81}, - {0x92, 0x00}, - {0x93, 0x00}, - {0x2a, 0x10}, - {0x2b, 0x40}, - {0x00,0x00} -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {0x0c ,0x04}, - {0x0d ,0x80}, - {0x11 ,0x80}, - {0x12 ,0x20}, - {0x13 ,0xe5}, - {0x18 ,0xc7}, - {0x17 ,0x27}, - {0x03 ,0x00}, - {0x1a ,0x3d}, - {0x19 ,0x01}, - {0x39 ,0x50}, - {0x38 ,0x92}, - {0x35 ,0x81}, - {0x00,0x00} -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - {0x12, 0x10}, - {0xa8, 0x80}, - {0x04, 0x00}, - {0x0c, 0x04}, - {0x0d, 0x80}, - {0x18, 0xc7}, - {0x17, 0x27}, - {0x32, 0xbd}, - {0x03, 0x36}, - {0x1a, 0x1e}, - {0x19, 0x00}, - {0x11, 0x00}, - {0x6b, 0x0a}, - {0x92, 0x00}, - {0x93, 0x00}, - {0x2a, 0x10}, - {0x2b, 0x40}, - {0x6a, 0x3e}, - {0x3b, 0x09}, - {0x00,0x00} -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {0x0c ,0x04}, - {0x0d ,0x80}, - {0x11 ,0x80}, - {0x12 ,0x08}, - {0x13 ,0xe5}, - {0x18 ,0xc7}, - {0x17 ,0x27}, - {0x03 ,0x00}, - {0x1a ,0x3d}, - {0x19 ,0x01}, - {0x39 ,0x50}, - {0x38 ,0x92}, - {0x35 ,0x81}, - {0x00,0x00} -}; - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0x84, 0x6C}, //Contrast 4 - {0x85, 0x78}, - {0x86, 0x8C}, - {0x87, 0x9E}, - {0x88, 0xBB}, - {0x89, 0xD2}, - {0x8A, 0xE6}, - {0x6C, 0x40}, - {0x6D, 0x30}, - {0x6E, 0x48}, - {0x6F, 0x60}, - {0x70, 0x70}, - {0x71, 0x70}, - {0x72, 0x70}, - {0x73, 0x70}, - {0x74, 0x60}, - {0x75, 0x60}, - {0x76, 0x50}, - {0x77, 0x48}, - {0x78, 0x3A}, - {0x79, 0x2E}, - {0x7A, 0x28}, - {0x7B, 0x22}, - - {0x0f, 0x4a}, //Saturation 3 - {0x27, 0x80}, - {0x28, 0x80}, - {0x2c, 0x80}, - {0x62, 0x60}, - {0x63, 0xe0}, - {0x64, 0x04}, - {0x65, 0x00}, - {0x66, 0x01}, - {0x24, 0x70}, - {0x25, 0x64}, - - {0x4f, 0x2e}, //Brightness 3 - {0x50, 0x31}, - {0x51, 0x02}, - {0x52, 0x0e}, - {0x53, 0x1e}, - {0x54, 0x2d}, - - {0x11, 0x80}, - {0x14, 0x2a}, - {0x13, 0xe7}, - {0x66, 0x05}, - - {0x00, 0x00} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0x7C,0x04}, //Contrast 5 - {0x7D,0x09}, - {0x7E,0x13}, - {0x7F,0x29}, - {0x80,0x35}, - {0x81,0x41}, - {0x82,0x4D}, - {0x83,0x59}, - {0x84,0x64}, - {0x85,0x6F}, - {0x86,0x85}, - {0x87,0x97}, - {0x88,0xB7}, - {0x89,0xCF}, - {0x8A,0xE3}, - {0x6C,0x40}, - {0x6D,0x50}, - {0x6E,0x50}, - {0x6F,0x58}, - {0x70,0x60}, - {0x71,0x60}, - {0x72,0x60}, - {0x73,0x60}, - {0x74,0x58}, - {0x75,0x58}, - {0x76,0x58}, - {0x77,0x48}, - {0x78,0x40}, - {0x79,0x30}, - {0x7A,0x28}, - {0x7B,0x26}, - - - - {0x4f,0x3a}, //Saturation 4 - {0x50,0x3d}, - {0x51,0x03}, - {0x52,0x12}, - {0x53,0x26}, - {0x54,0x38}, - {0x4f, 0x2e}, //Brightness 3 - {0x50, 0x31}, - {0x51, 0x02}, - {0x52, 0x0e}, - {0x53, 0x1e}, - {0x54, 0x2d}, - - {0x11,0x80}, - {0x14,0x0a}, - {0x13,0xc7}, - {0x66,0x05}, - {0x00, 0x00} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x7C,0x04}, //Contrast 5 - {0x7D,0x09}, - {0x7E,0x13}, - {0x7F,0x29}, - {0x80,0x35}, - {0x81,0x41}, - {0x82,0x4D}, - {0x83,0x59}, - {0x84,0x64}, - {0x85,0x6F}, - {0x86,0x85}, - {0x87,0x97}, - {0x88,0xB7}, - {0x89,0xCF}, - {0x8A,0xE3}, - {0x6C,0x40}, - {0x6D,0x50}, - {0x6E,0x50}, - {0x6F,0x58}, - {0x70,0x60}, - {0x71,0x60}, - {0x72,0x60}, - {0x73,0x60}, - {0x74,0x58}, - {0x75,0x58}, - {0x76,0x58}, - {0x77,0x48}, - {0x78,0x40}, - {0x79,0x30}, - {0x7A,0x28}, - {0x7B,0x26}, - - - - {0x4f,0x3a}, //Saturation 4 - {0x50,0x3d}, - {0x51,0x03}, - {0x52,0x12}, - {0x53,0x26}, - {0x54,0x38}, - {0x4f, 0x2e}, //Brightness 3 - {0x50, 0x31}, - {0x51, 0x02}, - {0x52, 0x0e}, - {0x53, 0x1e}, - {0x54, 0x2d}, - - {0x11,0x80}, - {0x14,0x0a}, - {0x13,0xc7}, - {0x66,0x05}, - {0x00, 0x00} -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0x84, 0x6C}, //Contrast 4 - {0x85, 0x78}, - {0x86, 0x8C}, - {0x87, 0x9E}, - {0x88, 0xBB}, - {0x89, 0xD2}, - {0x8A, 0xE6}, - {0x6C, 0x40}, - {0x6D, 0x30}, - {0x6E, 0x48}, - {0x6F, 0x60}, - {0x70, 0x70}, - {0x71, 0x70}, - {0x72, 0x70}, - {0x73, 0x70}, - {0x74, 0x60}, - {0x75, 0x60}, - {0x76, 0x50}, - {0x77, 0x48}, - {0x78, 0x3A}, - {0x79, 0x2E}, - {0x7A, 0x28}, - {0x7B, 0x22}, - - {0x0f, 0x4a}, //Saturation 3 - {0x27, 0x80}, - {0x28, 0x80}, - {0x2c, 0x80}, - {0x62, 0x60}, - {0x63, 0xe0}, - {0x64, 0x04}, - {0x65, 0x00}, - {0x66, 0x01}, - {0x24, 0x70}, - {0x25, 0x64}, - - {0x4f, 0x2e}, //Brightness 3 - {0x50, 0x31}, - {0x51, 0x02}, - {0x52, 0x0e}, - {0x53, 0x1e}, - {0x54, 0x2d}, - - {0x11,0x80}, - {0x14,0x2a}, - {0x13,0xe7}, - {0x66,0x05}, - - {0x00, 0x00} - - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x84, 0x6C}, //Contrast 4 - {0x85, 0x78}, - {0x86, 0x8C}, - {0x87, 0x9E}, - {0x88, 0xBB}, - {0x89, 0xD2}, - {0x8A, 0xE6}, - {0x6C, 0x40}, - {0x6D, 0x30}, - {0x6E, 0x48}, - {0x6F, 0x60}, - {0x70, 0x70}, - {0x71, 0x70}, - {0x72, 0x70}, - {0x73, 0x70}, - {0x74, 0x60}, - {0x75, 0x60}, - {0x76, 0x50}, - {0x77, 0x48}, - {0x78, 0x3A}, - {0x79, 0x2E}, - {0x7A, 0x28}, - {0x7B, 0x22}, - - {0x0f, 0x4a}, //Saturation 3 - {0x27, 0x80}, - {0x28, 0x80}, - {0x2c, 0x80}, - {0x62, 0x60}, - {0x63, 0xe0}, - {0x64, 0x04}, - {0x65, 0x00}, - {0x66, 0x01}, - {0x24, 0x70}, - {0x25, 0x64}, - - {0x4f, 0x2e}, //Brightness 3 - {0x50, 0x31}, - {0x51, 0x02}, - {0x52, 0x0e}, - {0x53, 0x1e}, - {0x54, 0x2d}, - - {0x11, 0x80}, - {0x14, 0x2a}, - {0x13, 0xe7}, - {0x66, 0x05}, - {0x00, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - // Brightness -2 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x49}, - {0x339a, 0x20}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness1[]= -{ - // Brightness -1 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x49}, - {0x339a, 0x10}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - // Brightness 0 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x00}, - {0x3390, 0x41}, - {0x339a, 0x00}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - // Brightness +1 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x41}, - {0x339a, 0x10}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - // Brightness +2 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x41}, - {0x339a, 0x20}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - // Brightness +3 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, //bit[2] enable - {0x3390, 0x41}, //bit[3] sign of brightness - {0x339a, 0x30}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x3a,0x0d}, - {0x67,0x80}, - {0x68,0x80}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {0x3a,0x1d}, - {0x67,0x80}, - {0x68,0x80}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x3a,0x1d}, - {0x67,0x40}, - {0x68,0xa0}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - //Negative - {0x3a,0x2d}, - {0x67,0x80}, - {0x68,0x80}, - {0x00, 0x00} -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - // Bluish - {0x3a,0x1d}, - {0x67,0xc0}, - {0x68,0x80}, - {0x00, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish - {0x3a,0x1d}, - {0x67,0x40}, - {0x68,0x40}, - {0x00, 0x00} -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure1[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - {0x00, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {0x00, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast2[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - {0x00, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - {0x00, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {0x00, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {0x00, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ -{0x00, 0x00} -}; - -static struct reginfo sensor_SceneNight[] = -{ -{0x00, 0x00} -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom1[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom2[] = -{ - {0x0, 0x0}, -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {0x0, 0x0}, -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif -static const struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static const struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -#define COL_FMT(_name, _depth, _fourcc, _colorspace) \ - { .name = _name, .depth = _depth, .fourcc = _fourcc, \ - .colorspace = _colorspace } - -#define JPG_FMT(_name, _depth, _fourcc) \ - COL_FMT(_name, _depth, _fourcc, V4L2_COLORSPACE_JPEG) - -static const struct soc_camera_data_format sensor_colour_formats[] = { - JPG_FMT(SENSOR_NAME_STRING(UYVY), 16, V4L2_PIX_FMT_UYVY), - JPG_FMT(SENSOR_NAME_STRING(YUYV), 16, V4L2_PIX_FMT_YUYV), -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int flash; - int exposure; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - unsigned int winseqe_cur_addr; - -} sensor_info_priv_t; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - unsigned int pixfmt; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, u8 reg, u8 val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[1]; - - buf[0] = reg & 0xFF; - buf[1] = val; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt--) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg failed, try to write again!\n",SENSOR_NAME_STRING()); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[2]; - - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 1; - err = -EAGAIN; - while ((cnt--) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg failed, try to read again! reg:0x%x \n",SENSOR_NAME_STRING(),val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err; - int i = 0; - - while (regarray[i].reg != 0) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err != 0) - { - SENSOR_TR("%s..write failed current i = %d\n", SENSOR_NAME_STRING(),i); - return err; - } - i++; - } - return 0; -} - -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = sd->priv; - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - int ret; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* soft reset */ - ret = sensor_write(client, 0x12, 0x80); - if (ret != 0) - { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); //delay 5 microseconds - - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.winseqe_cur_addr = (int)SENSOR_INIT_WINSEQADR; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - sensor_set_flash(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - #endif - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,icd->user_width,icd->user_height); - - return 0; -sensor_INIT_ERR: - return ret; -} - -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct soc_camera_link *icl; - - - if (pm_msg.event == PM_EVENT_SUSPEND) - { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) - { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } - else - { - icl = to_soc_camera_link(icd); - if (icl->power) { - ret = icl->power(icd->pdev, 0); - if (ret < 0) - return -EINVAL; - } - } - } - else - { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl; - int ret; - - icl = to_soc_camera_link(icd); - if (icl->power) { - ret = icl->power(icd->pdev, 0); - if (ret < 0) - return -EINVAL; - } - - return 0; - -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_format *f) -{ - struct i2c_client *client = sd->priv; - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - struct v4l2_pix_format *pix = &f->fmt.pix; - - pix->width = icd->user_width; - pix->height = icd->user_height; - pix->pixelformat = sensor->pixfmt; - pix->field = V4L2_FIELD_NONE; - pix->colorspace = V4L2_COLORSPACE_JPEG; - - return 0; -} -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f) -{ - struct i2c_client *client = sd->priv; - struct sensor *sensor = to_sensor(client); - struct v4l2_pix_format *pix = &f->fmt.pix; - struct reginfo *winseqe_set_addr; - int ret, set_w,set_h; - - set_w = pix->width; - set_h = pix->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - winseqe_set_addr = sensor_sxga; - set_w = 1280; - set_h = 1024; - } - else if (sensor_qvga[0].reg) - { - winseqe_set_addr = sensor_qvga; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = 320; - set_h = 240; - } - else - { - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,pix->width,pix->height); - return -EINVAL; - } - - if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) - { - ret = sensor_write_array(client, winseqe_set_addr); - if (ret != 0) - { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - return ret; - } - - sensor->info_priv.winseqe_cur_addr = (int)winseqe_set_addr; - mdelay(250); - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_TR("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - return 0; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_format *f) -{ - struct v4l2_pix_format *pix = &f->fmt.pix; - bool bayer = pix->pixelformat == V4L2_PIX_FMT_UYVY || - pix->pixelformat == V4L2_PIX_FMT_YUYV; - - /* - * With Bayer format enforce even side lengths, but let the user play - * with the starting pixel - */ - - if (pix->height > SENSOR_MAX_HEIGHT) - pix->height = SENSOR_MAX_HEIGHT; - else if (pix->height < SENSOR_MIN_HEIGHT) - pix->height = SENSOR_MIN_HEIGHT; - else if (bayer) - pix->height = ALIGN(pix->height, 2); - - if (pix->width > SENSOR_MAX_WIDTH) - pix->width = SENSOR_MAX_WIDTH; - else if (pix->width < SENSOR_MIN_WIDTH) - pix->width = SENSOR_MIN_WIDTH; - else if (bayer) - pix->width = ALIGN(pix->width, 2); - - return 0; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = sd->priv; - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV9650 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((*value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value > 0) && ((digitalzoom_cur + *value) > digitalzoom_total)) - { - *value = digitalzoom_total - digitalzoom_cur; - } - - if ((*value < 0) && ((digitalzoom_cur + *value) < 0)) - { - *value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += *value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, *value); - return 0; - } - - return -EINVAL; -} -#endif -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = sd->priv; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = sd->priv; - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = sd->priv; - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = sd->priv; - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char pid = 0; - int ret; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - /* soft reset */ - ret = sensor_write(client, 0x12, 0x80); - if (ret != 0) - { - SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); - return -ENODEV; - } - mdelay(5); //delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x0a, &pid); - if (ret != 0) { - SENSOR_TR("%s read chip id high byte failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - icd->formats = sensor_colour_formats; - icd->num_formats = ARRAY_SIZE(sensor_colour_formats); - - return 0; - -sensor_video_probe_err: - - return ret; -} - -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_fmt = sensor_s_fmt, - .g_fmt = sensor_g_fmt, - .try_fmt = sensor_try_fmt, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - icd->y_skip_top = 0; - - ret = sensor_video_probe(icd, client); - if (ret) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - } - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - - diff --git a/drivers/media/video/rk2928_camera.c b/drivers/media/video/rk2928_camera.c deleted file mode 100644 index 5d0e26ce1928..000000000000 --- a/drivers/media/video/rk2928_camera.c +++ /dev/null @@ -1,264 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ - -#include -#include -#include -#include -#ifndef PMEM_CAM_SIZE -#include "../../../arch/arm/plat-rk/rk_camera.c" -#else -/***************************************************************************************** - * camera devices - * author: ddl@rock-chips.com - *****************************************************************************************/ -#ifdef CONFIG_VIDEO_RK29 - -static int rk_sensor_iomux(int pin) -{ - iomux_set_gpio_mode(pin); - return 0; -} -#define PMEM_CAM_BASE 0 //just for compile ,no meaning -#include "../../../arch/arm/plat-rk/rk_camera.c" - - -static u64 rockchip_device_camera_dmamask = 0xffffffffUL; -#if RK_SUPPORT_CIF0 -static struct resource rk_camera_resource_host_0[] = { - [0] = { - .start = RK2928_CIF_PHYS, - .end = RK2928_CIF_PHYS + RK2928_CIF_SIZE - 1, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = IRQ_CIF, - .end = IRQ_CIF, - .flags = IORESOURCE_IRQ, - } -}; -#endif -#if RK_SUPPORT_CIF1 -static struct resource rk_camera_resource_host_1[] = { - [0] = { - .start = RK2928_CIF_PHYS, - .end = RK2928_CIF_PHYS+ RK2928_CIF_SIZE - 1, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = IRQ_CIF, - .end = IRQ_CIF, - .flags = IORESOURCE_IRQ, - } -}; -#endif - -/*platform_device : */ -#if RK_SUPPORT_CIF0 - struct platform_device rk_device_camera_host_0 = { - .name = RK29_CAM_DRV_NAME, - .id = RK_CAM_PLATFORM_DEV_ID_0, /* This is used to put cameras on this interface */ - .num_resources = ARRAY_SIZE(rk_camera_resource_host_0), - .resource = rk_camera_resource_host_0, - .dev = { - .dma_mask = &rockchip_device_camera_dmamask, - .coherent_dma_mask = 0xffffffffUL, - .platform_data = &rk_camera_platform_data, - } -}; -#endif - -#if RK_SUPPORT_CIF1 -/*platform_device : */ - struct platform_device rk_device_camera_host_1 = { - .name = RK29_CAM_DRV_NAME, - .id = RK_CAM_PLATFORM_DEV_ID_1, /* This is used to put cameras on this interface */ - .num_resources = ARRAY_SIZE(rk_camera_resource_host_1), - .resource = rk_camera_resource_host_1, - .dev = { - .dma_mask = &rockchip_device_camera_dmamask, - .coherent_dma_mask = 0xffffffffUL, - .platform_data = &rk_camera_platform_data, - } -}; -#endif - -static void rk_init_camera_plateform_data(void) -{ - int i,dev_idx; - - dev_idx = 0; - for (i=0; i max_resolution) - max_resolution = new_camera[i].resolution; - i++; - } - - if (max_resolution < PMEM_SENSOR_FULL_RESOLUTION_CIF_1) - max_resolution = PMEM_SENSOR_FULL_RESOLUTION_CIF_1; - if (max_resolution < PMEM_SENSOR_FULL_RESOLUTION_CIF_0) - max_resolution = PMEM_SENSOR_FULL_RESOLUTION_CIF_0; - - switch (max_resolution) - { - case 0x800000: - default: - { - cam_ipp_mem = 0x800000; - cam_pmem = 0x1900000; - break; - } - - case 0x500000: - { - cam_ipp_mem = 0x800000; - cam_pmem = 0x1400000; - break; - } - - case 0x300000: - { - cam_ipp_mem = 0x600000; - cam_pmem = 0xf00000; - break; - } - - case 0x200000: - { - cam_ipp_mem = 0x600000; - cam_pmem = 0xc00000; - break; - } - - case 0x100000: - { - cam_ipp_mem = 0x600000; - cam_pmem = 0xa00000; - break; - } - - case 0x30000: - { - cam_ipp_mem = 0x600000; - cam_pmem = 0x600000; - break; - } - } - - - rk_camera_platform_data.meminfo.vbase = rk_camera_platform_data.meminfo_cif1.vbase = NULL; -#if defined(CONFIG_VIDEO_RKCIF_WORK_SIMUL_OFF) || ((RK_SUPPORT_CIF0 && RK_SUPPORT_CIF1) == 0) - rk_camera_platform_data.meminfo.name = "camera_ipp_mem"; - rk_camera_platform_data.meminfo.start = board_mem_reserve_add("camera_ipp_mem",cam_ipp_mem); - rk_camera_platform_data.meminfo.size= cam_ipp_mem; - - memcpy(&rk_camera_platform_data.meminfo_cif1,&rk_camera_platform_data.meminfo,sizeof(struct rk29camera_mem_res)); -#else - rk_camera_platform_data.meminfo.name = "camera_ipp_mem_0"; - rk_camera_platform_data.meminfo.start = board_mem_reserve_add("camera_ipp_mem_0",PMEM_CAMIPP_NECESSARY_CIF_0); - rk_camera_platform_data.meminfo.size= PMEM_CAMIPP_NECESSARY_CIF_0; - - rk_camera_platform_data.meminfo_cif1.name = "camera_ipp_mem_1"; - rk_camera_platform_data.meminfo_cif1.start =board_mem_reserve_add("camera_ipp_mem_1",PMEM_CAMIPP_NECESSARY_CIF_1); - rk_camera_platform_data.meminfo_cif1.size= PMEM_CAMIPP_NECESSARY_CIF_1; -#endif - - #if PMEM_CAM_NECESSARY - android_pmem_cam_pdata.start = board_mem_reserve_add((char*)(android_pmem_cam_pdata.name),cam_pmem); - android_pmem_cam_pdata.size= cam_pmem; - #endif - -} -static int rk_register_camera_devices(void) -{ - int i; - int host_registered_0,host_registered_1; - struct rkcamera_platform_data *new_camera; - - rk_init_camera_plateform_data(); - - host_registered_0 = 0; - host_registered_1 = 0; - for (i=0; idev.device_info.dev.init_name,"end")==NULL) { - if (new_camera->dev.link_info.bus_id == RK_CAM_PLATFORM_DEV_ID_1) { - host_registered_1 = 1; - } else if (new_camera->dev.link_info.bus_id == RK_CAM_PLATFORM_DEV_ID_0) { - host_registered_0 = 1; - } - new_camera++; - } - } - #if RK_SUPPORT_CIF0 - if (host_registered_0) { - platform_device_register(&rk_device_camera_host_0); - } - #endif - #if RK_SUPPORT_CIF1 - if (host_registered_1) { - platform_device_register(&rk_device_camera_host_1); - } - #endif - - for (i=0; i -#include - -#ifndef PMEM_CAM_SIZE -#include "../../../arch/arm/plat-rk/rk_camera.c" -#else - -/***************************************************************************************** - * camera devices - * author: ddl@rock-chips.com - *****************************************************************************************/ -#ifdef CONFIG_VIDEO_RK29 -static int rk_sensor_iomux(int pin) -{ - switch (pin) - { - case RK29_PIN0_PA0: - case RK29_PIN0_PA1: - case RK29_PIN0_PA2: - case RK29_PIN0_PA3: - case RK29_PIN0_PA4: - { - break; - } - case RK29_PIN0_PA5: - { - rk29_mux_api_set(GPIO0A5_FLASHDQS_NAME,0); - break; - } - case RK29_PIN0_PA6: - { - rk29_mux_api_set(GPIO0A6_MIIMD_NAME,0); - break; - } - case RK29_PIN0_PA7: - { - rk29_mux_api_set(GPIO0A7_MIIMDCLK_NAME,0); - break; - } - case RK29_PIN0_PB0: - { - rk29_mux_api_set(GPIO0B0_EBCSDCE0_SMCADDR0_HOSTDATA0_NAME,0); - break; - } - case RK29_PIN0_PB1: - { - rk29_mux_api_set(GPIO0B1_EBCSDCE1_SMCADDR1_HOSTDATA1_NAME,0); - break; - } - case RK29_PIN0_PB2: - { - rk29_mux_api_set(GPIO0B2_EBCSDCE2_SMCADDR2_HOSTDATA2_NAME,0); - break; - } - case RK29_PIN0_PB3: - { - rk29_mux_api_set(GPIO0B3_EBCBORDER0_SMCADDR3_HOSTDATA3_NAME,0); - break; - } - case RK29_PIN0_PB4: - { - rk29_mux_api_set(GPIO0B4_EBCBORDER1_SMCWEN_NAME,0); - break; - } - case RK29_PIN0_PB5: - { - rk29_mux_api_set(GPIO0B5_EBCVCOM_SMCBLSN0_NAME,0); - break; - } - case RK29_PIN0_PB6: - { - rk29_mux_api_set(GPIO0B6_EBCSDSHR_SMCBLSN1_HOSTINT_NAME,0); - break; - } - case RK29_PIN0_PB7: - { - rk29_mux_api_set(GPIO0B7_EBCGDOE_SMCOEN_NAME,0); - break; - } - case RK29_PIN0_PC0: - { - rk29_mux_api_set(GPIO0C0_EBCGDSP_SMCDATA8_NAME,0); - break; - } - case RK29_PIN0_PC1: - { - rk29_mux_api_set(GPIO0C1_EBCGDR1_SMCDATA9_NAME,0); - break; - } - case RK29_PIN0_PC2: - { - rk29_mux_api_set(GPIO0C2_EBCSDCE0_SMCDATA10_NAME,0); - break; - } - case RK29_PIN0_PC3: - { - rk29_mux_api_set(GPIO0C3_EBCSDCE1_SMCDATA11_NAME,0); - break; - } - case RK29_PIN0_PC4: - { - rk29_mux_api_set(GPIO0C4_EBCSDCE2_SMCDATA12_NAME,0); - break; - } - case RK29_PIN0_PC5: - { - rk29_mux_api_set(GPIO0C5_EBCSDCE3_SMCDATA13_NAME,0); - break; - } - case RK29_PIN0_PC6: - { - rk29_mux_api_set(GPIO0C6_EBCSDCE4_SMCDATA14_NAME,0); - break; - } - case RK29_PIN0_PC7: - { - rk29_mux_api_set(GPIO0C7_EBCSDCE5_SMCDATA15_NAME,0); - break; - } - case RK29_PIN0_PD0: - { - rk29_mux_api_set(GPIO0D0_EBCSDOE_SMCADVN_NAME,0); - break; - } - case RK29_PIN0_PD1: - { - rk29_mux_api_set(GPIO0D1_EBCGDCLK_SMCADDR4_HOSTDATA4_NAME,0); - break; - } - case RK29_PIN0_PD2: - { - rk29_mux_api_set(GPIO0D2_FLASHCSN1_NAME,0); - break; - } - case RK29_PIN0_PD3: - { - rk29_mux_api_set(GPIO0D3_FLASHCSN2_NAME,0); - break; - } - case RK29_PIN0_PD4: - { - rk29_mux_api_set(GPIO0D4_FLASHCSN3_NAME,0); - break; - } - case RK29_PIN0_PD5: - { - rk29_mux_api_set(GPIO0D5_FLASHCSN4_NAME,0); - break; - } - case RK29_PIN0_PD6: - { - rk29_mux_api_set(GPIO0D6_FLASHCSN5_NAME,0); - break; - } - case RK29_PIN0_PD7: - { - rk29_mux_api_set(GPIO0D7_FLASHCSN6_NAME,0); - break; - } - case RK29_PIN1_PA0: - { - rk29_mux_api_set(GPIO1A0_FLASHCS7_MDDRTQ_NAME,0); - break; - } - case RK29_PIN1_PA1: - { - rk29_mux_api_set(GPIO1A1_SMCCSN0_NAME,0); - break; - } - case RK29_PIN1_PA2: - { - rk29_mux_api_set(GPIO1A2_SMCCSN1_NAME,0); - break; - } - case RK29_PIN1_PA3: - { - rk29_mux_api_set(GPIO1A3_EMMCDETECTN_SPI1CS1_NAME,0); - break; - } - case RK29_PIN1_PA4: - { - rk29_mux_api_set(GPIO1A4_EMMCWRITEPRT_SPI0CS1_NAME,0); - break; - } - case RK29_PIN1_PA5: - { - rk29_mux_api_set(GPIO1A5_EMMCPWREN_PWM3_NAME,0); - break; - } - case RK29_PIN1_PA6: - { - rk29_mux_api_set(GPIO1A6_I2C1SDA_NAME,0); - break; - } - case RK29_PIN1_PA7: - { - rk29_mux_api_set(GPIO1A7_I2C1SCL_NAME,0); - break; - } - case RK29_PIN1_PB0: - { - rk29_mux_api_set(GPIO1B0_VIPDATA0_NAME,0); - break; - } - case RK29_PIN1_PB1: - { - rk29_mux_api_set(GPIO1B1_VIPDATA1_NAME,0); - break; - } - case RK29_PIN1_PB2: - { - rk29_mux_api_set(GPIO1B2_VIPDATA2_NAME,0); - break; - } - case RK29_PIN1_PB3: - { - rk29_mux_api_set(GPIO1B3_VIPDATA3_NAME,0); - break; - } - case RK29_PIN1_PB4: - { - rk29_mux_api_set(GPIO1B4_VIPCLKOUT_NAME,0); - break; - } - case RK29_PIN1_PB5: - { - rk29_mux_api_set(GPIO1B5_PWM0_NAME,0); - break; - } - case RK29_PIN1_PB6: - { - rk29_mux_api_set(GPIO1B6_UART0SIN_NAME,0); - break; - } - case RK29_PIN1_PB7: - { - rk29_mux_api_set(GPIO1B7_UART0SOUT_NAME,0); - break; - } - case RK29_PIN1_PC0: - { - rk29_mux_api_set(GPIO1C0_UART0CTSN_SDMMC1DETECTN_NAME,0); - break; - } - case RK29_PIN1_PC1: - { - rk29_mux_api_set(GPIO1C1_UART0RTSN_SDMMC1WRITEPRT_NAME,0); - break; - } - case RK29_PIN1_PC2: - { - rk29_mux_api_set(GPIO1C2_SDMMC1CMD_NAME,0); - break; - } - case RK29_PIN1_PC3: - { - rk29_mux_api_set(GPIO1C3_SDMMC1DATA0_NAME,0); - break; - } - case RK29_PIN1_PC4: - { - rk29_mux_api_set(GPIO1C4_SDMMC1DATA1_NAME,0); - break; - } - case RK29_PIN1_PC5: - { - rk29_mux_api_set(GPIO1C5_SDMMC1DATA2_NAME,0); - break; - } - case RK29_PIN1_PC6: - { - rk29_mux_api_set(GPIO1C6_SDMMC1DATA3_NAME,0); - break; - } - case RK29_PIN1_PC7: - { - rk29_mux_api_set(GPIO1C7_SDMMC1CLKOUT_NAME,0); - break; - } - case RK29_PIN1_PD0: - { - rk29_mux_api_set(GPIO1D0_SDMMC0CLKOUT_NAME,0); - break; - } - case RK29_PIN1_PD1: - { - rk29_mux_api_set(GPIO1D1_SDMMC0CMD_NAME,0); - break; - } - case RK29_PIN1_PD2: - { - rk29_mux_api_set(GPIO1D2_SDMMC0DATA0_NAME,0); - break; - } - case RK29_PIN1_PD3: - { - rk29_mux_api_set(GPIO1D3_SDMMC0DATA1_NAME,0); - break; - } - case RK29_PIN1_PD4: - { - rk29_mux_api_set(GPIO1D4_SDMMC0DATA2_NAME,0); - break; - } - case RK29_PIN1_PD5: - { - rk29_mux_api_set(GPIO1D5_SDMMC0DATA3_NAME,0); - break; - } - case RK29_PIN1_PD6: - { - rk29_mux_api_set(GPIO1D6_SDMMC0DATA4_NAME,0); - break; - } - case RK29_PIN1_PD7: - { - rk29_mux_api_set(GPIO1D7_SDMMC0DATA5_NAME,0); - break; - } - case RK29_PIN2_PA0: - { - rk29_mux_api_set(GPIO2A0_SDMMC0DATA6_NAME,0); - break; - } - case RK29_PIN2_PA1: - { - rk29_mux_api_set(GPIO2A1_SDMMC0DATA7_NAME,0); - break; - } - case RK29_PIN2_PA2: - { - rk29_mux_api_set(GPIO2A2_SDMMC0DETECTN_NAME,0); - break; - } - case RK29_PIN2_PA3: - { - rk29_mux_api_set(GPIO2A3_SDMMC0WRITEPRT_PWM2_NAME,0); - break; - } - case RK29_PIN2_PA4: - { - rk29_mux_api_set(GPIO2A4_UART1SIN_NAME,0); - break; - } - case RK29_PIN2_PA5: - { - rk29_mux_api_set(GPIO2A5_UART1SOUT_NAME,0); - break; - } - case RK29_PIN2_PA6: - { - rk29_mux_api_set(GPIO2A6_UART2CTSN_NAME,0); - break; - } - case RK29_PIN2_PA7: - { - rk29_mux_api_set(GPIO2A7_UART2RTSN_NAME,0); - break; - } - case RK29_PIN2_PB0: - { - rk29_mux_api_set(GPIO2B0_UART2SIN_NAME,0); - break; - } - case RK29_PIN2_PB1: - { - rk29_mux_api_set(GPIO2B1_UART2SOUT_NAME,0); - break; - } - case RK29_PIN2_PB2: - { - rk29_mux_api_set(GPIO2B2_UART3SIN_NAME,0); - break; - } - case RK29_PIN2_PB3: - { - rk29_mux_api_set(GPIO2B3_UART3SOUT_NAME,0); - break; - } - case RK29_PIN2_PB4: - { - rk29_mux_api_set(GPIO2B4_UART3CTSN_I2C3SDA_NAME,0); - break; - } - case RK29_PIN2_PB5: - { - rk29_mux_api_set(GPIO2B5_UART3RTSN_I2C3SCL_NAME,0); - break; - } - case RK29_PIN2_PB6: - { - rk29_mux_api_set(GPIO2B6_I2C0SDA_NAME,0); - break; - } - case RK29_PIN2_PB7: - { - rk29_mux_api_set(GPIO2B7_I2C0SCL_NAME,0); - break; - } - case RK29_PIN2_PC0: - { - rk29_mux_api_set(GPIO2C0_SPI0CLK_NAME,0); - break; - } - case RK29_PIN2_PC1: - { - rk29_mux_api_set(GPIO2C1_SPI0CSN0_NAME,0); - break; - } - case RK29_PIN2_PC2: - { - rk29_mux_api_set(GPIO2C2_SPI0TXD_NAME,0); - break; - } - case RK29_PIN2_PC3: - { - rk29_mux_api_set(GPIO2C3_SPI0RXD_NAME,0); - break; - } - case RK29_PIN2_PC4: - { - rk29_mux_api_set(GPIO2C4_SPI1CLK_NAME,0); - break; - } - case RK29_PIN2_PC5: - { - rk29_mux_api_set(GPIO2C5_SPI1CSN0_NAME,0); - break; - } - case RK29_PIN2_PC6: - { - rk29_mux_api_set(GPIO2C6_SPI1TXD_NAME,0); - break; - } - case RK29_PIN2_PC7: - { - rk29_mux_api_set(GPIO2C7_SPI1RXD_NAME,0); - break; - } - case RK29_PIN2_PD0: - { - rk29_mux_api_set(GPIO2D0_I2S0CLK_MIIRXCLKIN_NAME,0); - break; - } - case RK29_PIN2_PD1: - { - rk29_mux_api_set(GPIO2D1_I2S0SCLK_MIICRS_NAME,0); - break; - } - case RK29_PIN2_PD2: - { - rk29_mux_api_set(GPIO2D2_I2S0LRCKRX_MIITXERR_NAME,0); - break; - } - case RK29_PIN2_PD3: - { - rk29_mux_api_set(GPIO2D3_I2S0SDI_MIICOL_NAME,0); - break; - } - case RK29_PIN2_PD4: - { - rk29_mux_api_set(GPIO2D4_I2S0SDO0_MIIRXD2_NAME,0); - break; - } - case RK29_PIN2_PD5: - { - rk29_mux_api_set(GPIO2D5_I2S0SDO1_MIIRXD3_NAME,0); - break; - } - case RK29_PIN2_PD6: - { - rk29_mux_api_set(GPIO2D6_I2S0SDO2_MIITXD2_NAME,0); - break; - } - case RK29_PIN2_PD7: - { - rk29_mux_api_set(GPIO2D7_I2S0SDO3_MIITXD3_NAME,0); - break; - } - case RK29_PIN3_PA0: - { - rk29_mux_api_set(GPIO3A0_I2S1CLK_NAME,0); - break; - } - case RK29_PIN3_PA1: - { - rk29_mux_api_set(GPIO3A1_I2S1SCLK_NAME,0); - break; - } - case RK29_PIN3_PA2: - { - rk29_mux_api_set(GPIO3A2_I2S1LRCKRX_NAME,0); - break; - } - case RK29_PIN3_PA3: - { - rk29_mux_api_set(GPIO3A3_I2S1SDI_NAME,0); - break; - } - case RK29_PIN3_PA4: - { - rk29_mux_api_set(GPIO3A4_I2S1SDO_NAME,0); - break; - } - case RK29_PIN3_PA5: - { - rk29_mux_api_set(GPIO3A5_I2S1LRCKTX_NAME,0); - break; - } - case RK29_PIN3_PA6: - { - rk29_mux_api_set(GPIO3A6_SMCADDR14_HOSTDATA14_NAME,0); - break; - } - case RK29_PIN3_PA7: - { - rk29_mux_api_set(GPIO3A7_SMCADDR15_HOSTDATA15_NAME,0); - break; - } - case RK29_PIN3_PB0: - { - rk29_mux_api_set(GPIO3B0_EMMCLKOUT_NAME,0); - break; - } - case RK29_PIN3_PB1: - { - rk29_mux_api_set(GPIO3B1_EMMCMD_NAME,0); - break; - } - case RK29_PIN3_PB2: - { - rk29_mux_api_set(GPIO3B2_EMMCDATA0_NAME,0); - break; - } - case RK29_PIN3_PB3: - { - rk29_mux_api_set(GPIO3B3_EMMCDATA1_NAME,0); - break; - } - case RK29_PIN3_PB4: - { - rk29_mux_api_set(GPIO3B4_EMMCDATA2_NAME,0); - break; - } - case RK29_PIN3_PB5: - { - rk29_mux_api_set(GPIO3B5_EMMCDATA3_NAME,0); - break; - } - case RK29_PIN3_PB6: - { - rk29_mux_api_set(GPIO3B6_EMMCDATA4_NAME,0); - break; - } - case RK29_PIN3_PB7: - { - rk29_mux_api_set(GPIO3B7_EMMCDATA5_NAME,0); - break; - } - case RK29_PIN3_PC0: - { - rk29_mux_api_set(GPIO3C0_EMMCDATA6_NAME,0); - break; - } - case RK29_PIN3_PC1: - { - rk29_mux_api_set(GPIO3C1_EMMCDATA7_NAME,0); - break; - } - case RK29_PIN3_PC2: - { - rk29_mux_api_set(GPIO3C2_SMCADDR13_HOSTDATA13_NAME,0); - break; - } - case RK29_PIN3_PC3: - { - rk29_mux_api_set(GPIO3C3_SMCADDR10_HOSTDATA10_NAME,0); - break; - } - case RK29_PIN3_PC4: - { - rk29_mux_api_set(GPIO3C4_SMCADDR11_HOSTDATA11_NAME,0); - break; - } - case RK29_PIN3_PC5: - { - rk29_mux_api_set(GPIO3C5_SMCADDR12_HOSTDATA12_NAME,0); - break; - } - case RK29_PIN3_PC6: - { - rk29_mux_api_set(GPIO3C6_SMCADDR16_HOSTDATA16_NAME,0); - break; - } - case RK29_PIN3_PC7: - { - rk29_mux_api_set(GPIO3C7_SMCADDR17_HOSTDATA17_NAME,0); - break; - } - case RK29_PIN3_PD0: - { - rk29_mux_api_set(GPIO3D0_SMCADDR18_HOSTADDR0_NAME,0); - break; - } - case RK29_PIN3_PD1: - { - rk29_mux_api_set(GPIO3D1_SMCADDR19_HOSTADDR1_NAME,0); - break; - } - case RK29_PIN3_PD2: - { - rk29_mux_api_set(GPIO3D2_HOSTCSN_NAME,0); - break; - } - case RK29_PIN3_PD3: - { - rk29_mux_api_set(GPIO3D3_HOSTRDN_NAME,0); - break; - } - case RK29_PIN3_PD4: - { - rk29_mux_api_set(GPIO3D4_HOSTWRN_NAME,0); - break; - } - case RK29_PIN3_PD5: - { - rk29_mux_api_set(GPIO3D5_SMCADDR7_HOSTDATA7_NAME,0); - break; - } - case RK29_PIN3_PD6: - { - rk29_mux_api_set(GPIO3D6_SMCADDR8_HOSTDATA8_NAME,0); - break; - } - case RK29_PIN3_PD7: - { - rk29_mux_api_set(GPIO3D7_SMCADDR9_HOSTDATA9_NAME,0); - break; - } - case RK29_PIN4_PA0: - case RK29_PIN4_PA1: - case RK29_PIN4_PA2: - case RK29_PIN4_PA3: - case RK29_PIN4_PA4: - { - break; - } - case RK29_PIN4_PA5: - { - rk29_mux_api_set(GPIO4A5_OTG0DRVVBUS_NAME,0); - break; - } - case RK29_PIN4_PA6: - { - rk29_mux_api_set(GPIO4A6_OTG1DRVVBUS_NAME,0); - break; - } - case RK29_PIN4_PA7: - { - rk29_mux_api_set(GPIO4A7_SPDIFTX_NAME,0); - break; - } - case RK29_PIN4_PB0: - { - rk29_mux_api_set(GPIO4B0_FLASHDATA8_NAME,0); - break; - } - case RK29_PIN4_PB1: - { - rk29_mux_api_set(GPIO4B1_FLASHDATA9_NAME,0); - break; - } - case RK29_PIN4_PB2: - { - rk29_mux_api_set(GPIO4B2_FLASHDATA10_NAME,0); - break; - } - case RK29_PIN4_PB3: - { - rk29_mux_api_set(GPIO4B3_FLASHDATA11_NAME,0); - break; - } - case RK29_PIN4_PB4: - { - rk29_mux_api_set(GPIO4B4_FLASHDATA12_NAME,0); - break; - } - case RK29_PIN4_PB5: - { - rk29_mux_api_set(GPIO4B5_FLASHDATA13_NAME,0); - break; - } - case RK29_PIN4_PB6: - { - rk29_mux_api_set(GPIO4B6_FLASHDATA14_NAME ,0); - break; - } - case RK29_PIN4_PB7: - { - rk29_mux_api_set(GPIO4B7_FLASHDATA15_NAME,0); - break; - } - case RK29_PIN4_PC0: - { - rk29_mux_api_set(GPIO4C0_RMIICLKOUT_RMIICLKIN_NAME,0); - break; - } - case RK29_PIN4_PC1: - { - rk29_mux_api_set(GPIO4C1_RMIITXEN_MIITXEN_NAME,0); - break; - } - case RK29_PIN4_PC2: - { - rk29_mux_api_set(GPIO4C2_RMIITXD1_MIITXD1_NAME,0); - break; - } - case RK29_PIN4_PC3: - { - rk29_mux_api_set(GPIO4C3_RMIITXD0_MIITXD0_NAME,0); - break; - } - case RK29_PIN4_PC4: - { - rk29_mux_api_set(GPIO4C4_RMIIRXERR_MIIRXERR_NAME,0); - break; - } - case RK29_PIN4_PC5: - { - rk29_mux_api_set(GPIO4C5_RMIICSRDVALID_MIIRXDVALID_NAME,0); - break; - } - case RK29_PIN4_PC6: - { - rk29_mux_api_set(GPIO4C6_RMIIRXD1_MIIRXD1_NAME,0); - break; - } - - case RK29_PIN4_PC7: - { - rk29_mux_api_set(GPIO4C7_RMIIRXD0_MIIRXD0_NAME,0); - break; - } - case RK29_PIN4_PD0: - case RK29_PIN4_PD1: - { - rk29_mux_api_set(GPIO4D10_CPUTRACEDATA10_NAME,0); - break; - } - case RK29_PIN4_PD2: - case RK29_PIN4_PD3: - { - rk29_mux_api_set(GPIO4D32_CPUTRACEDATA32_NAME,0); - break; - } - case RK29_PIN4_PD4: - { - rk29_mux_api_set(GPIO4D4_CPUTRACECLK_NAME,0); - break; - } - case RK29_PIN4_PD5: - { - rk29_mux_api_set(GPIO4D5_CPUTRACECTL_NAME,0); - break; - } - case RK29_PIN4_PD6: - { - rk29_mux_api_set(GPIO4D6_I2S0LRCKTX0_NAME,0); - break; - } - case RK29_PIN4_PD7: - { - rk29_mux_api_set(GPIO4D7_I2S0LRCKTX1_NAME,0); - break; - } - case RK29_PIN5_PA0: - case RK29_PIN5_PA1: - case RK29_PIN5_PA2: - { - break; - } - case RK29_PIN5_PA3: - { - rk29_mux_api_set(GPIO5A3_MIITXCLKIN_NAME,0); - break; - } - case RK29_PIN5_PA4: - { - rk29_mux_api_set(GPIO5A4_TSSYNC_NAME,0); - break; - } - case RK29_PIN5_PA5: - { - rk29_mux_api_set(GPIO5A5_HSADCDATA0_NAME,0); - break; - } - case RK29_PIN5_PA6: - { - rk29_mux_api_set(GPIO5A6_HSADCDATA1_NAME,0); - break; - } - case RK29_PIN5_PA7: - { - rk29_mux_api_set(GPIO5A7_HSADCDATA2_NAME,0); - break; - } - case RK29_PIN5_PB0: - { - rk29_mux_api_set(GPIO5B0_HSADCDATA3_NAME,0); - break; - } - case RK29_PIN5_PB1: - { - rk29_mux_api_set(GPIO5B1_HSADCDATA4_NAME,0); - break; - } - case RK29_PIN5_PB2: - { - rk29_mux_api_set(GPIO5B2_HSADCDATA5_NAME,0); - break; - } - case RK29_PIN5_PB3: - { - rk29_mux_api_set(GPIO5B3_HSADCDATA6_NAME,0); - break; - } - case RK29_PIN5_PB4: - { - rk29_mux_api_set(GPIO5B4_HSADCDATA7_NAME,0); - break; - } - case RK29_PIN5_PB5: - { - rk29_mux_api_set(GPIO5B5_HSADCDATA8_NAME,0); - break; - } - case RK29_PIN5_PB6: - { - rk29_mux_api_set(GPIO5B6_HSADCDATA9_NAME,0); - break; - } - case RK29_PIN5_PB7: - { - rk29_mux_api_set(GPIO5B7_HSADCCLKOUTGPSCLK_NAME,0); - break; - } - case RK29_PIN5_PC0: - { - rk29_mux_api_set(GPIO5C0_EBCSDDO0_SMCDATA0_NAME,0); - break; - } - case RK29_PIN5_PC1: - { - rk29_mux_api_set(GPIO5C1_EBCSDDO1_SMCDATA1_NAME,0); - break; - } - case RK29_PIN5_PC2: - { - rk29_mux_api_set(GPIO5C2_EBCSDDO2_SMCDATA2_NAME,0); - break; - } - case RK29_PIN5_PC3: - { - rk29_mux_api_set(GPIO5C3_EBCSDDO3_SMCDATA3_NAME,0); - break; - } - case RK29_PIN5_PC4: - { - rk29_mux_api_set(GPIO5C4_EBCSDDO4_SMCDATA4_NAME,0); - break; - } - case RK29_PIN5_PC5: - { - rk29_mux_api_set(GPIO5C5_EBCSDDO5_SMCDATA5_NAME,0); - break; - } - case RK29_PIN5_PC6: - { - rk29_mux_api_set(GPIO5C6_EBCSDDO6_SMCDATA6_NAME,0); - break; - } - case RK29_PIN5_PC7: - { - rk29_mux_api_set(GPIO5C7_EBCSDDO7_SMCDATA7_NAME,0); - break; - } - case RK29_PIN5_PD0: - { - rk29_mux_api_set(GPIO5D0_EBCSDLE_SMCADDR5_HOSTDATA5_NAME,0); - break; - } - case RK29_PIN5_PD1: - { - rk29_mux_api_set(GPIO5D1_EBCSDCLK_SMCADDR6_HOSTDATA6_NAME,0); - break; - } - case RK29_PIN5_PD2: - { - rk29_mux_api_set(GPIO5D2_PWM1_UART1SIRIN_NAME,0); - break; - } - case RK29_PIN5_PD3: - { - rk29_mux_api_set(GPIO5D3_I2C2SDA_NAME,0); - break; - } - case RK29_PIN5_PD4: - { - rk29_mux_api_set(GPIO5D4_I2C2SCL_NAME,0); - break; - } - case RK29_PIN5_PD5: - { - rk29_mux_api_set(GPIO5D5_SDMMC0PWREN_NAME,0); - break; - } - case RK29_PIN5_PD6: - { - rk29_mux_api_set(GPIO5D6_SDMMC1PWREN_NAME,0); - break; - } - case RK29_PIN5_PD7: - case RK29_PIN6_PA0: - case RK29_PIN6_PA1: - case RK29_PIN6_PA2: - case RK29_PIN6_PA3: - case RK29_PIN6_PA4: - case RK29_PIN6_PA5: - case RK29_PIN6_PA6: - case RK29_PIN6_PA7: - case RK29_PIN6_PB0: - case RK29_PIN6_PB1: - case RK29_PIN6_PB2: - case RK29_PIN6_PB3: - case RK29_PIN6_PB4: - case RK29_PIN6_PB5: - case RK29_PIN6_PB6: - case RK29_PIN6_PB7: - case RK29_PIN6_PC0: - case RK29_PIN6_PC1: - case RK29_PIN6_PC2: - case RK29_PIN6_PC3: - { - break; - } - case RK29_PIN6_PC4: - case RK29_PIN6_PC5: - { - rk29_mux_api_set(GPIO6C54_CPUTRACEDATA54_NAME,0); - break; - } - case RK29_PIN6_PC6: - case RK29_PIN6_PC7: - { - rk29_mux_api_set(GPIO6C76_CPUTRACEDATA76_NAME,0); - break; - } - case RK29_PIN6_PD0: - case RK29_PIN6_PD1: - case RK29_PIN6_PD2: - case RK29_PIN6_PD3: - case RK29_PIN6_PD4: - case RK29_PIN6_PD5: - case RK29_PIN6_PD6: - case RK29_PIN6_PD7: - { - break; - } - default: - { - printk("Pin=%d isn't RK29 GPIO, Please init it's iomux yourself!",pin); - break; - } - } - return 0; -} -#include "../../../arch/arm/plat-rk/rk_camera.c" - -#if (CONFIG_SENSOR_IIC_ADDR_0 != 0x00) -static struct i2c_board_info rk29_i2c_cam_info_0[] = { - { - I2C_BOARD_INFO(SENSOR_NAME_0, CONFIG_SENSOR_IIC_ADDR_0>>1) - }, -}; - -static struct soc_camera_link rk29_iclink_0 = { - .bus_id = RK29_CAM_PLATFORM_DEV_ID, - .power = rk_sensor_power, -#if (CONFIG_SENSOR_RESET_PIN_0 != INVALID_GPIO) - .reset = rk_sensor_reset, -#endif - .powerdown = rk_sensor_powerdown, - .board_info = &rk29_i2c_cam_info_0[0], - .i2c_adapter_id = CONFIG_SENSOR_IIC_ADAPTER_ID_0, - .module_name = SENSOR_NAME_0, -}; - -/*platform_device : soc-camera need */ -static struct platform_device rk29_soc_camera_pdrv_0 = { - .name = "soc-camera-pdrv", - .id = 0, - .dev = { - .init_name = SENSOR_DEVICE_NAME_0, - .platform_data = &rk29_iclink_0, - }, -}; -#endif -#if (CONFIG_SENSOR_IIC_ADDR_1 != 0x00) -static struct i2c_board_info rk29_i2c_cam_info_1[] = { - { - I2C_BOARD_INFO(SENSOR_NAME_1, CONFIG_SENSOR_IIC_ADDR_1>>1) - }, -}; - -static struct soc_camera_link rk29_iclink_1 = { - .bus_id = RK29_CAM_PLATFORM_DEV_ID, - .power = rk_sensor_power, -#if (CONFIG_SENSOR_RESET_PIN_1 != INVALID_GPIO) - .reset = rk_sensor_reset, -#endif - .powerdown = rk_sensor_powerdown, - .board_info = &rk29_i2c_cam_info_1[0], - .i2c_adapter_id = CONFIG_SENSOR_IIC_ADAPTER_ID_1, - .module_name = SENSOR_NAME_1, -}; - -/*platform_device : soc-camera need */ -static struct platform_device rk29_soc_camera_pdrv_1 = { - .name = "soc-camera-pdrv", - .id = 1, - .dev = { - .init_name = SENSOR_DEVICE_NAME_1, - .platform_data = &rk29_iclink_1, - }, -}; -#endif - -static u64 rockchip_device_camera_dmamask = 0xffffffffUL; -static struct resource rk29_camera_resource[] = { - [0] = { - .start = RK29_VIP_PHYS, - .end = RK29_VIP_PHYS + RK29_VIP_SIZE - 1, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = IRQ_VIP, - .end = IRQ_VIP, - .flags = IORESOURCE_IRQ, - } -}; - -/*platform_device : */ -static struct platform_device rk29_device_camera = { - .name = RK29_CAM_DRV_NAME, - .id = RK29_CAM_PLATFORM_DEV_ID, /* This is used to put cameras on this interface */ - .num_resources = ARRAY_SIZE(rk29_camera_resource), - .resource = rk29_camera_resource, - .dev = { - .dma_mask = &rockchip_device_camera_dmamask, - .coherent_dma_mask = 0xffffffffUL, - .platform_data = &rk_camera_platform_data, - } -}; - -static void rk_init_camera_plateform_data(void) -{ - int i,dev_idx; - - dev_idx = 0; - for (i=0; i - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - */ -#ifdef CONFIG_ARCH_RK29 -#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 - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR|S_IWGRP); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING"rk29xx_camera: " fmt , ## arg); } while (0) - -#define RK29CAMERA_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define RK29CAMERA_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - -// VIP Reg Offset -#define RK29_VIP_AHBR_CTRL 0x00 -#define RK29_VIP_INT_MASK 0x04 -#define RK29_VIP_INT_STS 0x08 -#define RK29_VIP_STS 0x0c -#define RK29_VIP_CTRL 0x10 -#define RK29_VIP_CAPTURE_F1SA_Y 0x14 -#define RK29_VIP_CAPTURE_F1SA_UV 0x18 -#define RK29_VIP_CAPTURE_F1SA_Cr 0x1c -#define RK29_VIP_CAPTURE_F2SA_Y 0x20 -#define RK29_VIP_CAPTURE_F2SA_UV 0x24 -#define RK29_VIP_CAPTURE_F2SA_Cr 0x28 -#define RK29_VIP_FB_SR 0x2c -#define RK29_VIP_FS 0x30 -#define RK29_VIP_VIPRESERVED 0x34 -#define RK29_VIP_CROP 0x38 -#define RK29_VIP_CRM 0x3c -#define RK29_VIP_RESET 0x40 -#define RK29_VIP_L_SFT 0x44 - -//The key register bit descrition -// VIP_CTRL Reg -#define DISABLE_CAPTURE (0x00<<0) -#define ENABLE_CAPTURE (0x01<<0) -#define HSY_HIGH_ACTIVE (0x00<<1) -#define HSY_LOW_ACTIVE (0x01<<1) -#define VIP_CCIR656 (0x00<<2) -#define VIP_SENSOR (0x01<<2) -#define SENSOR_UYVY (0x00<<3) -#define SENSOR_YUYV (0x01<<3) -#define VIP_YUV (0x00<<4) -#define VIP_RAW (0x01<<4) -#define CON_OR_PIN (0x00<<5) -#define ONEFRAME (0x01<<5) -#define VIPREGYUV420 (0x00<<6) -#define VIPREGYUV422 (0x01<<6) -#define FIELD0_START (0x00<<7) -#define FIELD1_START (0x01<<7) -#define CONTINUOUS (0x00<<8) -#define PING_PONG (0x01<<8) -#define POSITIVE_EDGE (0x00<<9) -#define NEGATIVE_EDGE (0x01<<9) -#define VIPREGNTSC (0x00<<10) -#define VIPREGPAL (0x01<<10) -#define VIP_DATA_LITTLEEND (0x00<<11) -#define VIP_DATA_BIGEND (0x01<<11) -#define VSY_LOW_ACTIVE (0x00<<12) -#define VSY_HIGH_ACTIVE (0x01<<12) -#define VIP_RAWINPUT_BYPASS (0x00<<13) -#define VIP_RAWINPUT_POSITIVE_EDGE (0x01<<13) -#define VIP_RAWINPUT_NEGATIVE_EDGE (0x02<<13) - -// GRF_SOC_CON0 Reg -#define GRF_SOC_CON0_Reg 0xbc -#define VIP_AXIMASTER (0x00<<0) -#define VIP_AHBMASTER (0x01<<2) - -// GRF_OS_REG0 -#define GRF_OS_REG0 0xd0 -#define VIP_ACLK_DIV_HCLK_1 (0x00<<0) -#define VIP_ACLK_DIV_HCLK_2 (0x01<<0) - - -#define MIN(x,y) ((xy) ? x: y) -#define RK29_SENSOR_24MHZ 24 /* MHz */ -#define RK29_SENSOR_48MHZ 48 - -#define write_vip_reg(addr, val) __raw_writel(val, addr+(rk29_camdev_info_ptr->base)) -#define read_vip_reg(addr) __raw_readl(addr+(rk29_camdev_info_ptr->base)) -#define mask_vip_reg(addr, msk, val) write_vip_reg(addr, (val)|((~(msk))&read_vip_reg(addr))) - -#define write_grf_reg(addr, val) __raw_writel(val, addr+RK29_GRF_BASE) -#define read_grf_reg(addr) __raw_readl(addr+RK29_GRF_BASE) -#define mask_grf_reg(addr, msk, val) write_vip_reg(addr, (val)|((~(msk))&read_vip_reg(addr))) - -#ifdef CONFIG_VIDEO_RK29_DIGITALZOOM_IPP_OFF -#define CAM_WORKQUEUE_IS_EN() ((pcdev->host_width != pcdev->icd->user_width) || (pcdev->host_height != pcdev->icd->user_height)\ - || (pcdev->icd_cb.sensor_cb)) -#define CAM_IPPWORK_IS_EN() ((pcdev->host_width != pcdev->icd->user_width) || (pcdev->host_height != pcdev->icd->user_height)) -#else -#define CAM_WORKQUEUE_IS_EN() (true) -#define CAM_IPPWORK_IS_EN() ((pcdev->zoominfo.a.c.width != pcdev->icd->user_width) || (pcdev->zoominfo.a.c.height != pcdev->icd->user_height)) -#endif -//Configure Macro -/* -* Driver Version Note -* -*v0.0.x : this driver is 2.6.32 kernel driver; -*v0.1.x : this driver is 3.0.8 kernel driver; -*v0.2.x : this driver is rk30 3.0.8 kernel driver; -*v0.3.x : this driver is camera-isp driver; -* -*v0.x.1 : this driver first support rk2918; -*v0.x.2 : fix this driver support v4l2 format is V4L2_PIX_FMT_NV12 and V4L2_PIX_FMT_NV16,is not V4L2_PIX_FMT_YUV420 -* and V4L2_PIX_FMT_YUV422P; -*v0.x.3 : this driver support VIDIOC_ENUM_FRAMEINTERVALS; -*v0.x.4 : this driver support digital zoom; -*v0.x.5 : this driver support test framerate and query framerate from board file configuration; -*v0.x.6 : this driver improve test framerate method; -*v0.x.7 : this driver product resolution by IPP crop and scale, which user request but sensor can't support; -* note: this version is only provide yifang client, which is not official version; -*v0.x.8 : this driver and rk29_camera.c support upto 3 back-sensors and upto 3 front-sensors; -*v0.x.9 : camera io code is compatible for rk29xx and rk30xx -*v0.x.a : fix error when calculate crop left-top point coordinate; -* note: this version provided as patch camera_patch_v1.1 -*v0.x.b : fix sensor autofocus thread may in running when reinit sensor if sensor haven't stream on in first init; -*v0.x.c : fix work queue havn't been finished after close device; -*v0.x.d : fix error when calculate crop left-top point coordinate; -*v0.x.f : fix struct rk29_camera_work may be reentrant. -*v0.x.11: add support zoom by arm; -*/ -#define RK29_CAM_VERSION_CODE KERNEL_VERSION(0, 1, 0x11) - -/* limit to rk29 hardware capabilities */ -#define RK29_CAM_BUS_PARAM (SOCAM_MASTER |\ - SOCAM_HSYNC_ACTIVE_HIGH |\ - SOCAM_HSYNC_ACTIVE_LOW |\ - SOCAM_VSYNC_ACTIVE_HIGH |\ - SOCAM_VSYNC_ACTIVE_LOW |\ - SOCAM_PCLK_SAMPLE_RISING |\ - SOCAM_PCLK_SAMPLE_FALLING|\ - SOCAM_DATA_ACTIVE_HIGH |\ - SOCAM_DATA_ACTIVE_LOW|\ - SOCAM_DATAWIDTH_8|SOCAM_DATAWIDTH_10|\ - SOCAM_MCLK_24MHZ |SOCAM_MCLK_48MHZ) - -#define RK29_CAM_W_MIN 48 -#define RK29_CAM_H_MIN 32 -#define RK29_CAM_W_MAX 3856 /* ddl@rock-chips.com : 10M Pixel */ -#define RK29_CAM_H_MAX 2764 -#define RK29_CAM_FRAME_INVAL_INIT 3 -#define RK29_CAM_FRAME_INVAL_DC 3 /* ddl@rock-chips.com : */ -#define RK29_CAM_FRAME_MEASURE 5 - -#define RK29_CAM_AXI 0 -#define RK29_CAM_AHB 1 -#define CONFIG_RK29_CAM_WORK_BUS RK29_CAM_AXI - -extern void videobuf_dma_contig_free(struct videobuf_queue *q, struct videobuf_buffer *buf); -extern dma_addr_t videobuf_to_dma_contig(struct videobuf_buffer *buf); - -/* buffer for one video frame */ -struct rk29_buffer -{ - /* common v4l buffer stuff -- must be first */ - struct videobuf_buffer vb; - enum v4l2_mbus_pixelcode code; - int inwork; -}; -enum rk29_camera_reg_state -{ - Reg_Invalidate, - Reg_Validate -}; - -struct rk29_camera_reg -{ - unsigned int VipCtrl; - unsigned int VipCrop; - unsigned int VipFs; - unsigned int VipIntMsk; - unsigned int VipCrm; - enum rk29_camera_reg_state Inval; -}; -struct rk29_camera_work -{ - struct videobuf_buffer *vb; - struct rk29_camera_dev *pcdev; - struct work_struct work; - struct list_head queue; - unsigned int index; -}; -struct rk29_camera_frmivalenum -{ - struct v4l2_frmivalenum fival; - struct rk29_camera_frmivalenum *nxt; -}; -struct rk29_camera_frmivalinfo -{ - struct soc_camera_device *icd; - struct rk29_camera_frmivalenum *fival_list; -}; -struct rk29_camera_zoominfo -{ - struct semaphore sem; - struct v4l2_crop a; - int zoom_rate; -}; -#if CAMERA_VIDEOBUF_ARM_ACCESS -struct rk29_camera_vbinfo -{ - unsigned int phy_addr; - void __iomem *vir_addr; - unsigned int size; -}; -#endif -struct rk29_camera_dev -{ - struct soc_camera_host soc_host; - struct device *dev; - /* RK2827x is only supposed to handle one camera on its Quick Capture - * interface. If anyone ever builds hardware to enable more than - * one camera, they will have to modify this driver too */ - struct soc_camera_device *icd; - - struct clk *aclk_ddr_lcdc; - struct clk *aclk_disp_matrix; - - struct clk *hclk_cpu_display; - struct clk *vip_slave; - - struct clk *vip_out; - struct clk *vip_input; - struct clk *vip_bus; - - struct clk *hclk_disp_matrix; - struct clk *vip_matrix; - - struct clk *pd_display; - - void __iomem *base; - void __iomem *grf_base; - int frame_inval; /* ddl@rock-chips.com : The first frames is invalidate */ - unsigned int irq; - unsigned int fps; - unsigned long frame_interval; - unsigned int pixfmt; - unsigned int vipmem_phybase; - void __iomem *vipmem_virbase; - unsigned int vipmem_size; - unsigned int vipmem_bsize; -#if CAMERA_VIDEOBUF_ARM_ACCESS - struct rk29_camera_vbinfo *vbinfo; - unsigned int vbinfo_count; -#endif - int host_width; - int host_height; - int icd_width; - int icd_height; - - struct rk29camera_platform_data *pdata; - struct resource *res; - - struct list_head capture; - struct rk29_camera_zoominfo zoominfo; - - spinlock_t lock; - - struct videobuf_buffer *active; - struct rk29_camera_reg reginfo_suspend; - struct workqueue_struct *camera_wq; - struct rk29_camera_work *camera_work; - struct list_head camera_work_queue; - spinlock_t camera_work_lock; - unsigned int camera_work_count; - struct hrtimer fps_timer; - struct work_struct camera_reinit_work; - int icd_init; - rk29_camera_sensor_cb_s icd_cb; - struct rk29_camera_frmivalinfo icd_frmival[2]; -}; - -static const struct v4l2_queryctrl rk29_camera_controls[] = -{ - #ifdef CONFIG_VIDEO_RK29_DIGITALZOOM_IPP_ON - { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 100, - .maximum = 300, - .step = 5, - .default_value = 100, - }, - #endif -}; - -static DEFINE_MUTEX(camera_lock); -static const char *rk29_cam_driver_description = "RK29_Camera"; -static struct rk29_camera_dev *rk29_camdev_info_ptr; - -static int rk29_camera_s_stream(struct soc_camera_device *icd, int enable); - - -/* - * Videobuf operations - */ -static int rk29_videobuf_setup(struct videobuf_queue *vq, unsigned int *count, - unsigned int *size) -{ - struct soc_camera_device *icd = vq->priv_data; - struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); - struct rk29_camera_dev *pcdev = ici->priv; - int bytes_per_line = soc_mbus_bytes_per_line(icd->user_width, - icd->current_fmt->host_fmt); - int bytes_per_line_host = soc_mbus_bytes_per_line(pcdev->host_width, - icd->current_fmt->host_fmt); - int i; - struct rk29_camera_work *wk; - - dev_dbg(&icd->dev, "count=%d, size=%d\n", *count, *size); - - if (bytes_per_line < 0) - return bytes_per_line; - - /* planar capture requires Y, U and V buffers to be page aligned */ - *size = PAGE_ALIGN(bytes_per_line*icd->user_height); /* Y pages UV pages, yuv422*/ - pcdev->vipmem_bsize = PAGE_ALIGN(bytes_per_line_host * pcdev->host_height); - - - if (CAM_WORKQUEUE_IS_EN()) { - #ifdef CONFIG_VIDEO_RK29_DIGITALZOOM_IPP_OFF - if (CAM_IPPWORK_IS_EN()) - #endif - { - BUG_ON(pcdev->vipmem_sizevipmem_bsize); - if (*count > pcdev->vipmem_size/pcdev->vipmem_bsize) { /* Buffers must be limited, when this resolution is genered by IPP */ - *count = pcdev->vipmem_size/pcdev->vipmem_bsize; - } - } - if ((pcdev->camera_work_count != *count) && pcdev->camera_work) { - kfree(pcdev->camera_work); - pcdev->camera_work = NULL; - pcdev->camera_work_count = 0; - } - - if (pcdev->camera_work == NULL) { - pcdev->camera_work = wk = kzalloc(sizeof(struct rk29_camera_work)*(*count), GFP_KERNEL); - if (pcdev->camera_work == NULL) { - RK29CAMERA_TR("\n %s kmalloc fail\n", __FUNCTION__); - BUG(); - } - INIT_LIST_HEAD(&pcdev->camera_work_queue); - - for (i=0; i<(*count); i++) { - wk->index = i; - list_add_tail(&wk->queue, &pcdev->camera_work_queue); - wk++; - } - pcdev->camera_work_count = (*count); - } -#if CAMERA_VIDEOBUF_ARM_ACCESS - if (pcdev->vbinfo && (pcdev->vbinfo_count != *count)) { - kfree(pcdev->vbinfo); - pcdev->vbinfo = NULL; - pcdev->vbinfo_count = 0x00; - } - - if (pcdev->vbinfo == NULL) { - pcdev->vbinfo = kzalloc(sizeof(struct rk29_camera_vbinfo)*(*count), GFP_KERNEL); - if (pcdev->vbinfo == NULL) { - RK29CAMERA_TR("\n %s vbinfo kmalloc fail\n", __FUNCTION__); - BUG(); - } - pcdev->vbinfo_count = *count; - } -#endif - } - - RK29CAMERA_DG("%s..%d.. videobuf size:%d, vipmem_buf size:%d, count:%d \n",__FUNCTION__,__LINE__, *size,pcdev->vipmem_size, *count); - - return 0; -} -static void rk29_videobuf_free(struct videobuf_queue *vq, struct rk29_buffer *buf) -{ - struct soc_camera_device *icd = vq->priv_data; - - dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %zd\n", __func__, - &buf->vb, buf->vb.baddr, buf->vb.bsize); - - /* ddl@rock-chips.com: buf_release called soc_camera_streamoff and soc_camera_close*/ - if (buf->vb.state == VIDEOBUF_NEEDS_INIT) - return; - - if (in_interrupt()) - BUG(); - /* - * This waits until this buffer is out of danger, i.e., until it is no - * longer in STATE_QUEUED or STATE_ACTIVE - */ - //videobuf_waiton(vq, &buf->vb, 0, 0); - videobuf_dma_contig_free(vq, &buf->vb); - dev_dbg(&icd->dev, "%s freed\n", __func__); - buf->vb.state = VIDEOBUF_NEEDS_INIT; - return; -} -static int rk29_videobuf_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb, enum v4l2_field field) -{ - struct soc_camera_device *icd = vq->priv_data; - struct rk29_buffer *buf; - int ret; - int bytes_per_line = soc_mbus_bytes_per_line(icd->user_width, - icd->current_fmt->host_fmt); - if (bytes_per_line < 0) - return bytes_per_line; - - buf = container_of(vb, struct rk29_buffer, vb); - - dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %zd\n", __func__, - vb, vb->baddr, vb->bsize); - - //RK29CAMERA_TR("\n%s..%d.. \n",__FUNCTION__,__LINE__); - - /* Added list head initialization on alloc */ - WARN_ON(!list_empty(&vb->queue)); - - /* This can be useful if you want to see if we actually fill - * the buffer with something */ - //memset((void *)vb->baddr, 0xaa, vb->bsize); - - BUG_ON(NULL == icd->current_fmt); - - if (buf->code != icd->current_fmt->code || - vb->width != icd->user_width || - vb->height != icd->user_height || - vb->field != field) { - buf->code = icd->current_fmt->code; - vb->width = icd->user_width; - vb->height = icd->user_height; - vb->field = field; - vb->state = VIDEOBUF_NEEDS_INIT; - } - - vb->size = bytes_per_line*vb->height; /* ddl@rock-chips.com : fmt->depth is coorect */ - if (0 != vb->baddr && vb->bsize < vb->size) { - ret = -EINVAL; - goto out; - } - - if (vb->state == VIDEOBUF_NEEDS_INIT) { - ret = videobuf_iolock(vq, vb, NULL); - if (ret) { - goto fail; - } - vb->state = VIDEOBUF_PREPARED; - } - //RK29CAMERA_TR("\n%s..%d.. \n",__FUNCTION__,__LINE__); - return 0; -fail: - rk29_videobuf_free(vq, buf); -out: - return ret; -} - -static inline void rk29_videobuf_capture(struct videobuf_buffer *vb) -{ - unsigned int y_addr,uv_addr; - struct rk29_camera_dev *pcdev = rk29_camdev_info_ptr; - - if (vb) { - if (CAM_WORKQUEUE_IS_EN()) { - y_addr = pcdev->vipmem_phybase + vb->i*pcdev->vipmem_bsize; - uv_addr = y_addr + pcdev->host_width*pcdev->host_height; - - if (y_addr > (pcdev->vipmem_phybase + pcdev->vipmem_size - pcdev->vipmem_bsize)) { - RK29CAMERA_TR("vipmem for IPP is overflow! %dx%d -> %dx%d vb_index:%d\n",pcdev->host_width,pcdev->host_height, - pcdev->icd->user_width,pcdev->icd->user_height, vb->i); - BUG(); - } - } else { - y_addr = vb->boff; - uv_addr = y_addr + vb->width * vb->height; - } - write_vip_reg(RK29_VIP_CAPTURE_F1SA_Y, y_addr); - write_vip_reg(RK29_VIP_CAPTURE_F1SA_UV, uv_addr); - write_vip_reg(RK29_VIP_CAPTURE_F2SA_Y, y_addr); - write_vip_reg(RK29_VIP_CAPTURE_F2SA_UV, uv_addr); - write_vip_reg(RK29_VIP_FB_SR, 0x00000002);//frame1 has been ready to receive data,frame 2 is not used - } -} -/* Locking: Caller holds q->irqlock */ -static void rk29_videobuf_queue(struct videobuf_queue *vq, - struct videobuf_buffer *vb) -{ - struct soc_camera_device *icd = vq->priv_data; - struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); - struct rk29_camera_dev *pcdev = ici->priv; - struct rk29_camera_vbinfo *vb_info; - - dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %zd\n", __func__, - vb, vb->baddr, vb->bsize); - - vb->state = VIDEOBUF_QUEUED; - - if (list_empty(&pcdev->capture)) { - list_add_tail(&vb->queue, &pcdev->capture); - } else { - if (list_entry(pcdev->capture.next, struct videobuf_buffer, queue) != vb) - list_add_tail(&vb->queue, &pcdev->capture); - else - BUG(); /* ddl@rock-chips.com : The same videobuffer queue again */ - } -#if CAMERA_VIDEOBUF_ARM_ACCESS - if (pcdev->vbinfo) { - vb_info = pcdev->vbinfo+vb->i; - if ((vb_info->phy_addr != vb->boff) || (vb_info->size != vb->bsize)) { - if (vb_info->vir_addr) { - iounmap(vb_info->vir_addr); - release_mem_region(vb_info->phy_addr, vb_info->size); - vb_info->vir_addr = NULL; - vb_info->phy_addr = 0x00; - vb_info->size = 0x00; - } - - if (request_mem_region(vb->boff,vb->bsize,"rk29_camera_vb")) { - vb_info->vir_addr = ioremap_cached(vb->boff,vb->bsize); - } - - if (vb_info->vir_addr) { - vb_info->size = vb->bsize; - vb_info->phy_addr = vb->boff; - } else { - RK29CAMERA_TR("%s..%d:ioremap videobuf %d failed\n",__FUNCTION__,__LINE__, vb->i); - } - } - } -#endif - if (!pcdev->active) { - pcdev->active = vb; - rk29_videobuf_capture(vb); - } -} -static int rk29_pixfmt2ippfmt(unsigned int pixfmt, int *ippfmt) -{ - switch (pixfmt) - { - case V4L2_PIX_FMT_NV16: - case V4L2_PIX_FMT_YUV422P: - { - *ippfmt = IPP_Y_CBCR_H2V1; - break; - } - case V4L2_PIX_FMT_NV12: - case V4L2_PIX_FMT_YUV420: - { - *ippfmt = IPP_Y_CBCR_H2V2; - break; - } - default: - goto rk29_pixfmt2ippfmt_err; - } - - return 0; -rk29_pixfmt2ippfmt_err: - return -1; -} -#if (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_IPP) -static int rk29_camera_scale_crop_ipp(struct work_struct *work) -{ - struct rk29_camera_work *camera_work = container_of(work, struct rk29_camera_work, work); - struct videobuf_buffer *vb = camera_work->vb; - struct rk29_camera_dev *pcdev = camera_work->pcdev; - struct rk29_ipp_req ipp_req; - unsigned long int flags; - int src_y_offset,src_uv_offset,dst_y_offset,dst_uv_offset,src_y_size,dst_y_size; - int scale_times,w,h,vipdata_base; - int ret = 0; - - /* - *ddl@rock-chips.com: - * IPP Dest image resolution is 2047x1088, so scale operation break up some times - */ - if ((pcdev->icd->user_width > 0x7f0) || (pcdev->icd->user_height > 0x430)) { - scale_times = MAX((pcdev->icd->user_width/0x7f0),(pcdev->icd->user_height/0x430)); - scale_times++; - } else { - scale_times = 1; - } - - memset(&ipp_req, 0, sizeof(struct rk29_ipp_req)); - - ipp_req.timeout = 100; - ipp_req.flag = IPP_ROT_0; - ipp_req.src0.w = pcdev->zoominfo.a.c.width/scale_times; - ipp_req.src0.h = pcdev->zoominfo.a.c.height/scale_times; - ipp_req.src_vir_w = pcdev->host_width; - rk29_pixfmt2ippfmt(pcdev->pixfmt, &ipp_req.src0.fmt); - ipp_req.dst0.w = pcdev->icd->user_width/scale_times; - ipp_req.dst0.h = pcdev->icd->user_height/scale_times; - ipp_req.dst_vir_w = pcdev->icd->user_width; - rk29_pixfmt2ippfmt(pcdev->pixfmt, &ipp_req.dst0.fmt); - - vipdata_base = pcdev->vipmem_phybase + vb->i*pcdev->vipmem_bsize; - src_y_size = pcdev->host_width*pcdev->host_height; - dst_y_size = pcdev->icd->user_width*pcdev->icd->user_height; - - for (h=0; hzoominfo.a.c.top + h*pcdev->zoominfo.a.c.height/scale_times)* pcdev->host_width - + pcdev->zoominfo.a.c.left + w*pcdev->zoominfo.a.c.width/scale_times; - src_uv_offset = (pcdev->zoominfo.a.c.top + h*pcdev->zoominfo.a.c.height/scale_times)* pcdev->host_width/2 - + pcdev->zoominfo.a.c.left + w*pcdev->zoominfo.a.c.width/scale_times; - - dst_y_offset = pcdev->icd->user_width*pcdev->icd->user_height*h/scale_times + pcdev->icd->user_width*w/scale_times; - dst_uv_offset = pcdev->icd->user_width*pcdev->icd->user_height*h/scale_times/2 + pcdev->icd->user_width*w/scale_times; - - ipp_req.src0.YrgbMst = vipdata_base + src_y_offset; - ipp_req.src0.CbrMst = vipdata_base + src_y_size + src_uv_offset; - ipp_req.dst0.YrgbMst = vb->boff + dst_y_offset; - ipp_req.dst0.CbrMst = vb->boff + dst_y_size + dst_uv_offset; - - if (ipp_blit_sync(&ipp_req)) { - spin_lock_irqsave(&pcdev->lock, flags); - vb->state = VIDEOBUF_ERROR; - spin_unlock_irqrestore(&pcdev->lock, flags); - - RK29CAMERA_TR("Capture image(vb->i:0x%x) which IPP operated is error:\n",vb->i); - RK29CAMERA_TR("widx:%d hidx:%d ",w,h); - RK29CAMERA_TR("%dx%d@(%d,%d)->%dx%d\n",pcdev->zoominfo.a.c.width,pcdev->zoominfo.a.c.height,pcdev->zoominfo.a.c.left,pcdev->zoominfo.a.c.top,pcdev->icd->user_width,pcdev->icd->user_height); - RK29CAMERA_TR("ipp_req.src0.YrgbMst:0x%x ipp_req.src0.CbrMst:0x%x \n", ipp_req.src0.YrgbMst,ipp_req.src0.CbrMst); - RK29CAMERA_TR("ipp_req.src0.w:0x%x ipp_req.src0.h:0x%x \n",ipp_req.src0.w,ipp_req.src0.h); - RK29CAMERA_TR("ipp_req.src0.fmt:0x%x\n",ipp_req.src0.fmt); - RK29CAMERA_TR("ipp_req.dst0.YrgbMst:0x%x ipp_req.dst0.CbrMst:0x%x \n",ipp_req.dst0.YrgbMst,ipp_req.dst0.CbrMst); - RK29CAMERA_TR("ipp_req.dst0.w:0x%x ipp_req.dst0.h:0x%x \n",ipp_req.dst0.w ,ipp_req.dst0.h); - RK29CAMERA_TR("ipp_req.dst0.fmt:0x%x\n",ipp_req.dst0.fmt); - RK29CAMERA_TR("ipp_req.src_vir_w:0x%x ipp_req.dst_vir_w :0x%x\n",ipp_req.src_vir_w ,ipp_req.dst_vir_w); - RK29CAMERA_TR("ipp_req.timeout:0x%x ipp_req.flag :0x%x\n",ipp_req.timeout,ipp_req.flag); - - goto rk29_camera_scale_crop_ipp_end; - } - } - } - -rk29_camera_scale_crop_ipp_end: - return ret; -} -#endif -#if (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_ARM) -static int rk29_camera_scale_crop_arm(struct work_struct *work) -{ - struct rk29_camera_work *camera_work = container_of(work, struct rk29_camera_work, work); - struct videobuf_buffer *vb = camera_work->vb; - struct rk29_camera_dev *pcdev = camera_work->pcdev; - struct rk29_camera_vbinfo *vb_info; - unsigned char *psY,*pdY,*psUV,*pdUV; - unsigned char *src,*dst; - unsigned long src_phy,dst_phy; - int srcW,srcH,cropW,cropH,dstW,dstH; - long zoomindstxIntInv,zoomindstyIntInv; - long x,y; - long yCoeff00,yCoeff01,xCoeff00,xCoeff01; - long sX,sY; - long r0,r1,a,b,c,d; - int ret = 0; - - - src_phy = pcdev->vipmem_phybase + vb->i*pcdev->vipmem_bsize; - src = psY = (unsigned char*)(pcdev->vipmem_virbase + vb->i*pcdev->vipmem_bsize); - psUV = psY + pcdev->host_width*pcdev->host_height; - srcW = pcdev->host_width; - srcH = pcdev->host_height; - cropW = pcdev->zoominfo.a.c.width; - cropH = pcdev->zoominfo.a.c.height; - psY = psY + pcdev->host_width - pcdev->zoominfo.a.c.width; - psUV = psUV + pcdev->host_width - pcdev->zoominfo.a.c.width; - - vb_info = pcdev->vbinfo+vb->i; - dst_phy = vb_info->phy_addr; - dst = pdY = (unsigned char*)vb_info->vir_addr; - pdUV = pdY + pcdev->icd->user_width*pcdev->icd->user_height; - dstW = pcdev->icd->user_width; - dstH = pcdev->icd->user_height; - - zoomindstxIntInv = ((unsigned long)cropW<<16)/dstW + 1; - zoomindstyIntInv = ((unsigned long)cropH<<16)/dstH + 1; - - //y - //for(y = 0; y> 16); - - for(x = 0; x> 16); - - a = psY[sY*srcW + sX]; - b = psY[sY*srcW + sX + 1]; - c = psY[(sY+1)*srcW + sX]; - d = psY[(sY+1)*srcW + sX + 1]; - - r0 = (a * xCoeff01 + b * xCoeff00)>>16 ; - r1 = (c * xCoeff01 + d * xCoeff00)>>16 ; - r0 = (r0 * yCoeff01 + r1 * yCoeff00)>>16; - - pdY[x] = r0; - } - pdY += dstW; - } - - dstW /= 2; - dstH /= 2; - srcW /= 2; - srcH /= 2; - - //UV - //for(y = 0; y> 16); - - for(x = 0; x> 16); - - //U - a = psUV[(sY*srcW + sX)*2]; - b = psUV[(sY*srcW + sX + 1)*2]; - c = psUV[((sY+1)*srcW + sX)*2]; - d = psUV[((sY+1)*srcW + sX + 1)*2]; - - r0 = (a * xCoeff01 + b * xCoeff00)>>16 ; - r1 = (c * xCoeff01 + d * xCoeff00)>>16 ; - r0 = (r0 * yCoeff01 + r1 * yCoeff00)>>16; - - pdUV[x*2] = r0; - - //V - a = psUV[(sY*srcW + sX)*2 + 1]; - b = psUV[(sY*srcW + sX + 1)*2 + 1]; - c = psUV[((sY+1)*srcW + sX)*2 + 1]; - d = psUV[((sY+1)*srcW + sX + 1)*2 + 1]; - - r0 = (a * xCoeff01 + b * xCoeff00)>>16 ; - r1 = (c * xCoeff01 + d * xCoeff00)>>16 ; - r0 = (r0 * yCoeff01 + r1 * yCoeff00)>>16; - - pdUV[x*2 + 1] = r0; - } - pdUV += dstW*2; - } - -rk29_camera_scale_crop_arm_end: - - dmac_flush_range((void*)src,(void*)(src+pcdev->vipmem_bsize)); - outer_flush_range((phys_addr_t)src_phy,(phys_addr_t)(src_phy+pcdev->vipmem_bsize)); - - dmac_flush_range((void*)dst,(void*)(dst+vb_info->size)); - outer_flush_range((phys_addr_t)dst_phy,(phys_addr_t)(dst_phy+vb_info->size)); - - return ret; -} -#endif - -static void rk29_camera_capture_process(struct work_struct *work) -{ - struct rk29_camera_work *camera_work = container_of(work, struct rk29_camera_work, work); - struct videobuf_buffer *vb = camera_work->vb; - struct rk29_camera_dev *pcdev = camera_work->pcdev; - //enum v4l2_mbus_pixelcode icd_code = pcdev->icd->current_fmt->code; - unsigned long flags = 0; - int err = 0; - - if (!CAM_WORKQUEUE_IS_EN()) - goto rk29_camera_capture_process_end; - - down(&pcdev->zoominfo.sem); - if (pcdev->icd_cb.scale_crop_cb) - err = (pcdev->icd_cb.scale_crop_cb)(work); - up(&pcdev->zoominfo.sem); - - if (pcdev->icd_cb.sensor_cb) - (pcdev->icd_cb.sensor_cb)(vb); - -rk29_camera_capture_process_end: - if (err) { - vb->state = VIDEOBUF_ERROR; - } else { - if ((vb->state == VIDEOBUF_QUEUED) || (vb->state == VIDEOBUF_ACTIVE)) { - vb->state = VIDEOBUF_DONE; - vb->field_count++; - } - } - wake_up(&(camera_work->vb->done)); - spin_lock_irqsave(&pcdev->camera_work_lock, flags); - list_add_tail(&camera_work->queue, &pcdev->camera_work_queue); - spin_unlock_irqrestore(&pcdev->camera_work_lock, flags); - return; -} -static irqreturn_t rk29_camera_irq(int irq, void *data) -{ - struct rk29_camera_dev *pcdev = data; - struct videobuf_buffer *vb; - struct rk29_camera_work *wk; - static struct timeval first_tv; - struct timeval tv; - - read_vip_reg(RK29_VIP_INT_STS); /* clear vip interrupte single */ - /* ddl@rock-chps.com : Current VIP is run in One Frame Mode, Frame 1 is validate */ - if (read_vip_reg(RK29_VIP_FB_SR) & 0x01) { - if (!pcdev->fps) { - do_gettimeofday(&first_tv); - } - pcdev->fps++; - if (!pcdev->active) - goto RK29_CAMERA_IRQ_END; - - if (pcdev->frame_inval>0) { - pcdev->frame_inval--; - rk29_videobuf_capture(pcdev->active); - goto RK29_CAMERA_IRQ_END; - } else if (pcdev->frame_inval) { - RK29CAMERA_TR("frame_inval : %0x",pcdev->frame_inval); - pcdev->frame_inval = 0; - } - - if(pcdev->fps == RK29_CAM_FRAME_MEASURE) { - do_gettimeofday(&tv); - pcdev->frame_interval = ((tv.tv_sec*1000000 + tv.tv_usec) - (first_tv.tv_sec*1000000 + first_tv.tv_usec)) - /(RK29_CAM_FRAME_MEASURE-1); - } - - vb = pcdev->active; - /* ddl@rock-chips.com : this vb may be deleted from queue */ - if ((vb->state == VIDEOBUF_QUEUED) || (vb->state == VIDEOBUF_ACTIVE)) { - list_del_init(&vb->queue); - } - - pcdev->active = NULL; - if (!list_empty(&pcdev->capture)) { - pcdev->active = list_entry(pcdev->capture.next, struct videobuf_buffer, queue); - if (pcdev->active) { - rk29_videobuf_capture(pcdev->active); - } - } - - if (pcdev->active == NULL) { - RK29CAMERA_DG("%s video_buf queue is empty!\n",__FUNCTION__); - } - - do_gettimeofday(&vb->ts); - if (CAM_WORKQUEUE_IS_EN()) { - if (!list_empty(&pcdev->camera_work_queue)) { - wk = list_entry(pcdev->camera_work_queue.next, struct rk29_camera_work, queue); - list_del_init(&wk->queue); - INIT_WORK(&(wk->work), rk29_camera_capture_process); - wk->vb = vb; - wk->pcdev = pcdev; - queue_work(pcdev->camera_wq, &(wk->work)); - } - } else { - if ((vb->state == VIDEOBUF_QUEUED) || (vb->state == VIDEOBUF_ACTIVE)) { - vb->state = VIDEOBUF_DONE; - vb->field_count++; - } - wake_up(&vb->done); - } - } - -RK29_CAMERA_IRQ_END: - return IRQ_HANDLED; -} - - -static void rk29_videobuf_release(struct videobuf_queue *vq, - struct videobuf_buffer *vb) -{ - struct rk29_buffer *buf = container_of(vb, struct rk29_buffer, vb); - struct soc_camera_device *icd = vq->priv_data; - struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); - struct rk29_camera_dev *pcdev = ici->priv; - struct rk29_camera_vbinfo *vb_info =NULL; - -#ifdef DEBUG - dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__, - vb, vb->baddr, vb->bsize); - - switch (vb->state) - { - case VIDEOBUF_ACTIVE: - dev_dbg(&icd->dev, "%s (active)\n", __func__); - break; - case VIDEOBUF_QUEUED: - dev_dbg(&icd->dev, "%s (queued)\n", __func__); - break; - case VIDEOBUF_PREPARED: - dev_dbg(&icd->dev, "%s (prepared)\n", __func__); - break; - default: - dev_dbg(&icd->dev, "%s (unknown)\n", __func__); - break; - } -#endif - if (vb == pcdev->active) { - RK29CAMERA_DG("%s Wait for this video buf(0x%x) write finished!\n ",__FUNCTION__,(unsigned int)vb); - interruptible_sleep_on_timeout(&vb->done, msecs_to_jiffies(500)); - RK29CAMERA_DG("%s This video buf(0x%x) write finished, release now!!\n",__FUNCTION__,(unsigned int)vb); - } - - flush_workqueue(pcdev->camera_wq); -#if CAMERA_VIDEOBUF_ARM_ACCESS - if (pcdev->vbinfo) { - vb_info = pcdev->vbinfo + vb->i; - - if (vb_info->vir_addr) { - iounmap(vb_info->vir_addr); - release_mem_region(vb_info->phy_addr, vb_info->size); - memset(vb_info, 0x00, sizeof(struct rk29_camera_vbinfo)); - } - - } -#endif - rk29_videobuf_free(vq, buf); -} - -static struct videobuf_queue_ops rk29_videobuf_ops = -{ - .buf_setup = rk29_videobuf_setup, - .buf_prepare = rk29_videobuf_prepare, - .buf_queue = rk29_videobuf_queue, - .buf_release = rk29_videobuf_release, -}; - -static void rk29_camera_init_videobuf(struct videobuf_queue *q, - struct soc_camera_device *icd) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); - struct rk29_camera_dev *pcdev = ici->priv; - - /* We must pass NULL as dev pointer, then all pci_* dma operations - * transform to normal dma_* ones. */ - videobuf_queue_dma_contig_init(q, - &rk29_videobuf_ops, - ici->v4l2_dev.dev, &pcdev->lock, - V4L2_BUF_TYPE_VIDEO_CAPTURE, - V4L2_FIELD_NONE, - sizeof(struct rk29_buffer), - icd,&icd->video_lock); -} -static int rk29_camera_activate(struct rk29_camera_dev *pcdev, struct soc_camera_device *icd) -{ - unsigned long sensor_bus_flags = SOCAM_MCLK_24MHZ; - struct clk *parent; - - RK29CAMERA_DG("%s..%d.. \n",__FUNCTION__,__LINE__); - if (!pcdev->aclk_ddr_lcdc || !pcdev->aclk_disp_matrix || !pcdev->hclk_cpu_display || - !pcdev->vip_slave || !pcdev->vip_out || !pcdev->vip_input || !pcdev->vip_bus || !pcdev->pd_display || - IS_ERR(pcdev->aclk_ddr_lcdc) || IS_ERR(pcdev->aclk_disp_matrix) || IS_ERR(pcdev->hclk_cpu_display) || IS_ERR(pcdev->pd_display) || - IS_ERR(pcdev->vip_slave) || IS_ERR(pcdev->vip_out) || IS_ERR(pcdev->vip_input) || IS_ERR(pcdev->vip_bus)) { - - RK29CAMERA_TR(KERN_ERR "failed to get vip_clk(axi) source\n"); - goto RK29_CAMERA_ACTIVE_ERR; - } - - if (!pcdev->hclk_disp_matrix || !pcdev->vip_matrix || - IS_ERR(pcdev->hclk_disp_matrix) || IS_ERR(pcdev->vip_matrix)) { - - RK29CAMERA_TR(KERN_ERR "failed to get vip_clk(ahb) source\n"); - goto RK29_CAMERA_ACTIVE_ERR; - } - - clk_enable(pcdev->pd_display); - - clk_enable(pcdev->aclk_ddr_lcdc); - clk_enable(pcdev->aclk_disp_matrix); - - clk_enable(pcdev->hclk_cpu_display); - clk_enable(pcdev->vip_slave); - -#if (CONFIG_RK29_CAM_WORK_BUS==RK29_CAM_AHB) - clk_enable(pcdev->hclk_disp_matrix); - clk_enable(pcdev->vip_matrix); -#endif - - clk_enable(pcdev->vip_input); - clk_enable(pcdev->vip_bus); - - //if (icd->ops->query_bus_param) /* ddl@rock-chips.com : Query Sensor's xclk */ - //sensor_bus_flags = icd->ops->query_bus_param(icd); - - if (sensor_bus_flags & SOCAM_MCLK_48MHZ) { - parent = clk_get(NULL, "clk48m"); - if (!parent || IS_ERR(parent)) - goto RK29_CAMERA_ACTIVE_ERR; - } else if (sensor_bus_flags & SOCAM_MCLK_27MHZ) { - parent = clk_get(NULL, "extclk"); - if (!parent || IS_ERR(parent)) - goto RK29_CAMERA_ACTIVE_ERR; - } else { - parent = clk_get(NULL, "xin24m"); - if (!parent || IS_ERR(parent)) - goto RK29_CAMERA_ACTIVE_ERR; - } - - clk_set_parent(pcdev->vip_out, parent); - - clk_enable(pcdev->vip_out); - rk29_mux_api_set(GPIO1B4_VIPCLKOUT_NAME, GPIO1L_VIP_CLKOUT); - ndelay(10); - -#if (CONFIG_RK29_CAM_WORK_BUS==RK29_CAM_AHB) - write_grf_reg(GRF_SOC_CON0_Reg, read_grf_reg(GRF_SOC_CON0_Reg)|VIP_AHBMASTER); //VIP Config to AHB - write_grf_reg(GRF_OS_REG0, read_grf_reg(GRF_OS_REG0)&(~VIP_ACLK_DIV_HCLK_2)); //aclk:hclk = 1:1 -#else - write_grf_reg(GRF_SOC_CON0_Reg, read_grf_reg(GRF_SOC_CON0_Reg)&(~VIP_AHBMASTER)); //VIP Config to AXI - write_grf_reg(GRF_OS_REG0, read_grf_reg(GRF_OS_REG0)|VIP_ACLK_DIV_HCLK_2); //aclk:hclk = 2:1 -#endif - ndelay(10); - - write_vip_reg(RK29_VIP_RESET, 0x76543210); /* ddl@rock-chips.com : vip software reset */ - udelay(10); - - write_vip_reg(RK29_VIP_AHBR_CTRL, 0x07); /* ddl@rock-chips.com : vip ahb burst 16 */ - write_vip_reg(RK29_VIP_INT_MASK, 0x01); //capture complete interrupt enable - write_vip_reg(RK29_VIP_CRM, 0x00000000); //Y/CB/CR color modification - - return 0; -RK29_CAMERA_ACTIVE_ERR: - return -ENODEV; -} - -static void rk29_camera_deactivate(struct rk29_camera_dev *pcdev) -{ - //pcdev->active = NULL; - - write_vip_reg(RK29_VIP_CTRL, 0); - read_vip_reg(RK29_VIP_INT_STS); //clear vip interrupte single - - rk29_mux_api_set(GPIO1B4_VIPCLKOUT_NAME, GPIO1L_GPIO1B4); - clk_disable(pcdev->vip_out); - - clk_disable(pcdev->vip_input); - clk_disable(pcdev->vip_bus); - -#if (CONFIG_RK29_CAM_WORK_BUS==RK29_CAM_AHB) - clk_disable(pcdev->hclk_disp_matrix); - clk_disable(pcdev->vip_matrix); -#endif - - clk_disable(pcdev->hclk_cpu_display); - clk_disable(pcdev->vip_slave); - - clk_disable(pcdev->aclk_ddr_lcdc); - clk_disable(pcdev->aclk_disp_matrix); - - clk_disable(pcdev->pd_display); - return; -} - -/* The following two functions absolutely depend on the fact, that - * there can be only one camera on RK28 quick capture interface */ -static int rk29_camera_add_device(struct soc_camera_device *icd) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); - struct rk29_camera_dev *pcdev = ici->priv; - struct device *control = to_soc_camera_control(icd); - struct v4l2_subdev *sd; - int ret,i,icd_catch; - struct rk29_camera_frmivalenum *fival_list,*fival_nxt; - - mutex_lock(&camera_lock); - - if (pcdev->icd) { - ret = -EBUSY; - goto ebusy; - } - - RK29CAMERA_DG("RK29 Camera driver attached to %s\n",dev_name(icd->pdev)); - - pcdev->frame_inval = RK29_CAM_FRAME_INVAL_INIT; - pcdev->active = NULL; - pcdev->icd = NULL; - pcdev->reginfo_suspend.Inval = Reg_Invalidate; - pcdev->zoominfo.zoom_rate = 100; - - /* ddl@rock-chips.com: capture list must be reset, because this list may be not empty, - * if app havn't dequeue all videobuf before close camera device; - */ - INIT_LIST_HEAD(&pcdev->capture); - - ret = rk29_camera_activate(pcdev,icd); - if (ret) - goto ebusy; - - /* ddl@rock-chips.com : v4l2_subdev is not created when ici->ops->add called in soc_camera_probe */ - if (control) { - sd = dev_get_drvdata(control); - v4l2_subdev_call(sd, core, ioctl, RK29_CAM_SUBDEV_IOREQUEST,(void*)pcdev->pdata); - #if 0 - ret = v4l2_subdev_call(sd,core, init, 0); - if (ret) - goto ebusy; - #endif - v4l2_subdev_call(sd, core, ioctl, RK29_CAM_SUBDEV_CB_REGISTER,(void*)(&pcdev->icd_cb)); - } - - pcdev->icd = icd; - pcdev->icd_init = 0; - - icd_catch = 0; - for (i=0; i<2; i++) { - if (pcdev->icd_frmival[i].icd == icd) - icd_catch = 1; - if (pcdev->icd_frmival[i].icd == NULL) { - pcdev->icd_frmival[i].icd = icd; - icd_catch = 1; - } - } - - if (icd_catch == 0) { - fival_list = pcdev->icd_frmival[0].fival_list; - fival_nxt = fival_list; - while(fival_nxt != NULL) { - fival_nxt = fival_list->nxt; - kfree(fival_list); - fival_list = fival_nxt; - } - pcdev->icd_frmival[0].icd = icd; - pcdev->icd_frmival[0].fival_list = kzalloc(sizeof(struct rk29_camera_frmivalenum),GFP_KERNEL); - } -ebusy: - mutex_unlock(&camera_lock); - - return ret; -} -static void rk29_camera_remove_device(struct soc_camera_device *icd) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); - struct rk29_camera_dev *pcdev = ici->priv; - struct v4l2_subdev *sd = soc_camera_to_subdev(icd); - struct rk29_camera_vbinfo *vb_info; - unsigned int i; - - mutex_lock(&camera_lock); - BUG_ON(icd != pcdev->icd); - - RK29CAMERA_DG("RK29 Camera driver detached from %s\n",dev_name(icd->pdev)); - - /* ddl@rock-chips.com: Application will call VIDIOC_STREAMOFF before close device, but - stream may be turn on again before close device, if suspend and resume happened. */ - if (read_vip_reg(RK29_VIP_CTRL) & ENABLE_CAPTURE) { - rk29_camera_s_stream(icd,0); - } - - v4l2_subdev_call(sd, core, ioctl, RK29_CAM_SUBDEV_DEACTIVATE,NULL); - rk29_camera_deactivate(pcdev); - - if (pcdev->camera_work) { - kfree(pcdev->camera_work); - pcdev->camera_work = NULL; - pcdev->camera_work_count = 0; - INIT_LIST_HEAD(&pcdev->camera_work_queue); - } -#if CAMERA_VIDEOBUF_ARM_ACCESS - if (pcdev->vbinfo) { - vb_info = pcdev->vbinfo; - for (i=0; ivbinfo_count; i++) { - if (vb_info->vir_addr) { - iounmap(vb_info->vir_addr); - release_mem_region(vb_info->phy_addr, vb_info->size); - memset(vb_info, 0x00, sizeof(struct rk29_camera_vbinfo)); - } - vb_info++; - } - kfree(pcdev->vbinfo); - pcdev->vbinfo = NULL; - pcdev->vbinfo_count = 0; - } -#endif - pcdev->active = NULL; - pcdev->icd = NULL; - pcdev->icd_cb.sensor_cb = NULL; - pcdev->reginfo_suspend.Inval = Reg_Invalidate; - /* ddl@rock-chips.com: capture list must be reset, because this list may be not empty, - * if app havn't dequeue all videobuf before close camera device; - */ - INIT_LIST_HEAD(&pcdev->capture); - - mutex_unlock(&camera_lock); - RK29CAMERA_DG("%s exit\n",__FUNCTION__); - - return; -} -static int rk29_camera_set_bus_param(struct soc_camera_device *icd, __u32 pixfmt) -{ - unsigned long bus_flags, camera_flags, common_flags; - unsigned int vip_ctrl_val = 0; - const struct soc_mbus_pixelfmt *fmt; - int ret = 0; - - RK29CAMERA_DG("%s..%d..\n",__FUNCTION__,__LINE__); - - fmt = soc_mbus_get_fmtdesc(icd->current_fmt->code); - if (!fmt) - return -EINVAL; - - bus_flags = RK29_CAM_BUS_PARAM; - /* If requested data width is supported by the platform, use it */ - switch (fmt->bits_per_sample) { - case 10: - if (!(bus_flags & SOCAM_DATAWIDTH_10)) - return -EINVAL; - break; - case 9: - if (!(bus_flags & SOCAM_DATAWIDTH_9)) - return -EINVAL; - break; - case 8: - if (!(bus_flags & SOCAM_DATAWIDTH_8)) - return -EINVAL; - break; - default: - return -EINVAL; - } - - if (icd->ops->query_bus_param) - camera_flags = icd->ops->query_bus_param(icd); - else - camera_flags = 0; - - common_flags = soc_camera_bus_param_compatible(camera_flags, bus_flags); - if (!common_flags) { - ret = -EINVAL; - goto RK29_CAMERA_SET_BUS_PARAM_END; - } - - ret = icd->ops->set_bus_param(icd, common_flags); - if (ret < 0) - goto RK29_CAMERA_SET_BUS_PARAM_END; - - vip_ctrl_val = read_vip_reg(RK29_VIP_CTRL); - if (common_flags & SOCAM_PCLK_SAMPLE_FALLING) { - vip_ctrl_val |= NEGATIVE_EDGE; - } else { - vip_ctrl_val &= ~NEGATIVE_EDGE; - } - if (common_flags & SOCAM_HSYNC_ACTIVE_LOW) { - vip_ctrl_val |= HSY_LOW_ACTIVE; - } else { - vip_ctrl_val &= ~HSY_LOW_ACTIVE; - } - if (common_flags & SOCAM_VSYNC_ACTIVE_HIGH) { - vip_ctrl_val |= VSY_HIGH_ACTIVE; - } else { - vip_ctrl_val &= ~VSY_HIGH_ACTIVE; - } - - /* ddl@rock-chips.com : Don't enable capture here, enable in stream_on */ - //vip_ctrl_val |= ENABLE_CAPTURE; - - write_vip_reg(RK29_VIP_CTRL, vip_ctrl_val); - RK29CAMERA_DG("%s..ctrl:0x%x CtrReg=%x AXI_AHB:0x%x aclk_hclk:0x%x \n",__FUNCTION__,vip_ctrl_val,read_vip_reg(RK29_VIP_CTRL), - read_grf_reg(GRF_SOC_CON0_Reg)&VIP_AHBMASTER, read_grf_reg(GRF_OS_REG0)&VIP_ACLK_DIV_HCLK_2); - -RK29_CAMERA_SET_BUS_PARAM_END: - if (ret) - RK29CAMERA_TR("\n%s..%d.. ret = %d \n",__FUNCTION__,__LINE__, ret); - return ret; -} - -static int rk29_camera_try_bus_param(struct soc_camera_device *icd, __u32 pixfmt) -{ - unsigned long bus_flags, camera_flags; - int ret; - - bus_flags = RK29_CAM_BUS_PARAM; - if (icd->ops->query_bus_param) { - camera_flags = icd->ops->query_bus_param(icd); - } else { - camera_flags = 0; - } - ret = soc_camera_bus_param_compatible(camera_flags, bus_flags) ; - - if (ret < 0) - dev_warn(icd->dev.parent, - "Flags incompatible: camera %lx, host %lx\n", - camera_flags, bus_flags); - return ret; -} - -static const struct soc_mbus_pixelfmt rk29_camera_formats[] = { - { - .fourcc = V4L2_PIX_FMT_NV12, - .name = "YUV420 NV12", - .bits_per_sample = 8, - .packing = SOC_MBUS_PACKING_1_5X8, - .order = SOC_MBUS_ORDER_LE, - },{ - .fourcc = V4L2_PIX_FMT_NV16, - .name = "YUV422 NV16", - .bits_per_sample = 8, - .packing = SOC_MBUS_PACKING_2X8_PADHI, - .order = SOC_MBUS_ORDER_LE, - },{ - .fourcc = V4L2_PIX_FMT_YUV420, - .name = "NV12(v0.0.1)", - .bits_per_sample = 8, - .packing = SOC_MBUS_PACKING_1_5X8, - .order = SOC_MBUS_ORDER_LE, - },{ - .fourcc = V4L2_PIX_FMT_YUV422P, - .name = "NV16(v0.0.1)", - .bits_per_sample = 8, - .packing = SOC_MBUS_PACKING_2X8_PADHI, - .order = SOC_MBUS_ORDER_LE, - } -}; - -static void rk29_camera_setup_format(struct soc_camera_device *icd, __u32 host_pixfmt, enum v4l2_mbus_pixelcode icd_code, struct v4l2_rect *rect) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); - struct rk29_camera_dev *pcdev = ici->priv; - unsigned int vip_fs = 0,vip_crop = 0; - unsigned int vip_ctrl_val = VIP_SENSOR|ONEFRAME|DISABLE_CAPTURE; - - switch (host_pixfmt) - { - case V4L2_PIX_FMT_NV16: - case V4L2_PIX_FMT_YUV422P: /* ddl@rock-chips.com: V4L2_PIX_FMT_YUV422P is V4L2_PIX_FMT_NV16 actually in 0.0.1 driver */ - vip_ctrl_val |= VIPREGYUV422; - pcdev->frame_inval = RK29_CAM_FRAME_INVAL_DC; - pcdev->pixfmt = host_pixfmt; - break; - case V4L2_PIX_FMT_NV12: - case V4L2_PIX_FMT_YUV420: /* ddl@rock-chips.com: V4L2_PIX_FMT_YUV420 is V4L2_PIX_FMT_NV12 actually in 0.0.1 driver */ - vip_ctrl_val |= VIPREGYUV420; - if (pcdev->frame_inval != RK29_CAM_FRAME_INVAL_INIT) - pcdev->frame_inval = RK29_CAM_FRAME_INVAL_INIT; - pcdev->pixfmt = host_pixfmt; - break; - default: /* ddl@rock-chips.com : vip output format is hold when pixfmt is invalidate */ - if (pcdev->frame_inval != RK29_CAM_FRAME_INVAL_INIT) - pcdev->frame_inval = RK29_CAM_FRAME_INVAL_INIT; - pcdev->pixfmt = host_pixfmt; - break; - } - - switch (icd_code) - { - case V4L2_MBUS_FMT_UYVY8_2X8: - vip_ctrl_val |= (SENSOR_UYVY|VIP_YUV); - break; - case V4L2_MBUS_FMT_YUYV8_2X8: - vip_ctrl_val |= (SENSOR_YUYV|VIP_YUV); - break; - default : - vip_ctrl_val |= (read_vip_reg(RK29_VIP_CTRL) & SENSOR_YUYV); - break; - } - - write_vip_reg(RK29_VIP_CTRL, vip_ctrl_val); /* ddl@rock-chips.com: VIP capture mode and capture format must be set before FS register set */ - - read_vip_reg(RK29_VIP_INT_STS); /* clear vip interrupte single */ - - if (vip_ctrl_val & ONEFRAME) { - vip_crop = ((rect->left<<16) + rect->top); - vip_fs = (((rect->width + rect->left)<<16) + (rect->height+rect->top)); - } else if (vip_ctrl_val & PING_PONG) { - BUG(); - } - - write_vip_reg(RK29_VIP_CROP, vip_crop); - write_vip_reg(RK29_VIP_FS, vip_fs); - - write_vip_reg(RK29_VIP_FB_SR, 0x00000003); - - pcdev->host_width = rect->width; - pcdev->host_height = rect->height; - - RK29CAMERA_DG("%s.. crop:0x%x fs:0x%x ctrl:0x%x CtrlReg:0x%x\n",__FUNCTION__,vip_crop,vip_fs,vip_ctrl_val,read_vip_reg(RK29_VIP_CTRL)); - return; -} - -static int rk29_camera_get_formats(struct soc_camera_device *icd, unsigned int idx, - struct soc_camera_format_xlate *xlate) -{ - struct v4l2_subdev *sd = soc_camera_to_subdev(icd); - struct device *dev = icd->dev.parent; - int formats = 0, ret; - enum v4l2_mbus_pixelcode code; - const struct soc_mbus_pixelfmt *fmt; - - ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code); - if (ret < 0) - /* No more formats */ - return 0; - - fmt = soc_mbus_get_fmtdesc(code); - if (!fmt) { - dev_err(dev, "Invalid format code #%u: %d\n", idx, code); - return 0; - } - - ret = rk29_camera_try_bus_param(icd, fmt->bits_per_sample); - if (ret < 0) - return 0; - - switch (code) { - case V4L2_MBUS_FMT_UYVY8_2X8: - case V4L2_MBUS_FMT_YUYV8_2X8: - formats++; - if (xlate) { - xlate->host_fmt = &rk29_camera_formats[0]; - xlate->code = code; - xlate++; - dev_dbg(dev, "Providing format %s using code %d\n", - rk29_camera_formats[0].name,code); - } - - formats++; - if (xlate) { - xlate->host_fmt = &rk29_camera_formats[1]; - xlate->code = code; - xlate++; - dev_dbg(dev, "Providing format %s using code %d\n", - rk29_camera_formats[1].name,code); - } - - formats++; - if (xlate) { - xlate->host_fmt = &rk29_camera_formats[2]; - xlate->code = code; - xlate++; - dev_dbg(dev, "Providing format %s using code %d\n", - rk29_camera_formats[2].name,code); - } - - formats++; - if (xlate) { - xlate->host_fmt = &rk29_camera_formats[3]; - xlate->code = code; - xlate++; - dev_dbg(dev, "Providing format %s using code %d\n", - rk29_camera_formats[3].name,code);; - } - break; - default: - break; - } - - return formats; -} - -static void rk29_camera_put_formats(struct soc_camera_device *icd) -{ - return; -} - -static int rk29_camera_set_crop(struct soc_camera_device *icd, - struct v4l2_crop *a) -{ - struct v4l2_subdev *sd = soc_camera_to_subdev(icd); - struct v4l2_mbus_framefmt mf; - u32 fourcc = icd->current_fmt->host_fmt->fourcc; - int ret; - - ret = v4l2_subdev_call(sd, video, g_mbus_fmt, &mf); - if (ret < 0) - return ret; - - if ((mf.width < (a->c.left + a->c.width)) || (mf.height < (a->c.top + a->c.height))) { - - mf.width = a->c.left + a->c.width; - mf.height = a->c.top + a->c.height; - - v4l_bound_align_image(&mf.width, RK29_CAM_W_MIN, RK29_CAM_W_MAX, 1, - &mf.height, RK29_CAM_H_MIN, RK29_CAM_H_MAX, 0, - fourcc == V4L2_PIX_FMT_NV16 ?4 : 0); - - ret = v4l2_subdev_call(sd, video, s_mbus_fmt, &mf); - if (ret < 0) - return ret; - } - - rk29_camera_setup_format(icd, fourcc, mf.code, &a->c); - - icd->user_width = mf.width; - icd->user_height = mf.height; - - return 0; -} - -static int rk29_camera_set_fmt(struct soc_camera_device *icd, - struct v4l2_format *f) -{ - struct device *dev = icd->dev.parent; - struct v4l2_subdev *sd = soc_camera_to_subdev(icd); - const struct soc_camera_format_xlate *xlate = NULL; - struct soc_camera_host *ici =to_soc_camera_host(icd->dev.parent); - struct rk29_camera_dev *pcdev = ici->priv; - struct v4l2_pix_format *pix = &f->fmt.pix; - struct v4l2_mbus_framefmt mf; - struct v4l2_rect rect; - int ret,usr_w,usr_h,icd_width,icd_height; - int stream_on = 0; - - usr_w = pix->width; - usr_h = pix->height; - RK29CAMERA_DG("%s enter width:%d height:%d\n",__FUNCTION__,usr_w,usr_h); - - xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat); - if (!xlate) { - dev_err(dev, "Format %x not found\n", pix->pixelformat); - ret = -EINVAL; - goto RK29_CAMERA_SET_FMT_END; - } - - /* ddl@rock-chips.com: sensor init code transmit in here after open */ - if (pcdev->icd_init == 0) { - v4l2_subdev_call(sd,core, init, 0); - pcdev->icd_init = 1; - } - - stream_on = read_vip_reg(RK29_VIP_CTRL); - if (stream_on & ENABLE_CAPTURE) - write_vip_reg(RK29_VIP_CTRL, (stream_on & (~ENABLE_CAPTURE))); - - mf.width = pix->width; - mf.height = pix->height; - mf.field = pix->field; - mf.colorspace = pix->colorspace; - mf.code = xlate->code; - - ret = v4l2_subdev_call(sd, video, s_mbus_fmt, &mf); - - if (mf.code != xlate->code) - return -EINVAL; - - icd_width = mf.width; - icd_height = mf.height; - #ifdef CONFIG_VIDEO_RK29_WORK_IPP - if ((mf.width != usr_w) || (mf.height != usr_h)) { - if (unlikely((mf.width <16) || (mf.width > 8190) || (mf.height < 16) || (mf.height > 8190))) { - RK29CAMERA_TR("Senor and IPP both invalid source resolution(%dx%d)\n",mf.width,mf.height); - ret = -EINVAL; - goto RK29_CAMERA_SET_FMT_END; - } - if (unlikely((usr_w <16)||(usr_h < 16))) { - RK29CAMERA_TR("Senor and IPP both invalid destination resolution(%dx%d)\n",usr_w,usr_h); - ret = -EINVAL; - goto RK29_CAMERA_SET_FMT_END; - } - } - #endif - icd->sense = NULL; - - if (!ret) { - - if (mf.width*usr_h == mf.height*usr_w) { - rect.width = mf.width; - rect.height = mf.height; - } else { - int ratio; - if (usr_w > usr_h) { - if (mf.width > usr_w) { - ratio = MIN((mf.width*10/usr_w),(mf.height*10/usr_h))-1; - rect.width = usr_w*ratio/10; - rect.height = usr_h*ratio/10; - } else { - ratio = MAX((usr_w*10/mf.width),(usr_h*10/mf.height))+1; - rect.width = usr_w*10/ratio; - rect.height = usr_h*10/ratio; - } - } else { - if (mf.height > usr_h) { - ratio = MIN((mf.width*10/usr_w),(mf.height*10/usr_h))-1; - rect.width = usr_w*ratio/10; - rect.height = usr_h*ratio/10; - } else { - ratio = MAX((usr_w*10/mf.width),(usr_h*10/mf.height))+1; - rect.width = usr_w*10/ratio; - rect.height = usr_h*10/ratio; - } - } - } - - rect.left = (mf.width - rect.width)/2; - rect.top = (mf.height - rect.height)/2; - - down(&pcdev->zoominfo.sem); - pcdev->zoominfo.a.c.width = rect.width*100/pcdev->zoominfo.zoom_rate; - pcdev->zoominfo.a.c.width &= ~0x03; - pcdev->zoominfo.a.c.height = rect.height*100/pcdev->zoominfo.zoom_rate; - pcdev->zoominfo.a.c.height &= ~0x03; - pcdev->zoominfo.a.c.left = ((rect.width - pcdev->zoominfo.a.c.width)/2 + rect.left)&(~0x01); - pcdev->zoominfo.a.c.top = ((rect.height - pcdev->zoominfo.a.c.height)/2 + rect.top)&(~0x01); - up(&pcdev->zoominfo.sem); - - /* ddl@rock-chips.com: IPP work limit check */ - if ((pcdev->zoominfo.a.c.width != usr_w) || (pcdev->zoominfo.a.c.height != usr_h)) { - if (usr_w > 0x7f0) { - if (((usr_w>>1)&0x3f) && (((usr_w>>1)&0x3f) <= 8)) { - RK29CAMERA_TR("IPP Destination resolution(%dx%d, ((%d div 1) mod 64)=%d is <= 8)",usr_w,usr_h, usr_w, (int)((usr_w>>1)&0x3f)); - ret = -EINVAL; - goto RK29_CAMERA_SET_FMT_END; - } - } else { - if ((usr_w&0x3f) && ((usr_w&0x3f) <= 8)) { - RK29CAMERA_TR("IPP Destination resolution(%dx%d, %d mod 64=%d is <= 8)",usr_w,usr_h, usr_w, (int)(usr_w&0x3f)); - ret = -EINVAL; - goto RK29_CAMERA_SET_FMT_END; - } - } - } - - /* ddl@rock-chips.com: Crop is doing by IPP, not by VIP in rk2918 */ - rect.left = 0; - rect.top = 0; - rect.width = mf.width; - rect.height = mf.height; - - RK29CAMERA_DG("%s..%s Sensor output:%dx%d VIP output:%dx%d (zoom: %dx%d@(%d,%d)->%dx%d)\n",__FUNCTION__,xlate->host_fmt->name, - mf.width, mf.height,rect.width,rect.height, pcdev->zoominfo.a.c.width,pcdev->zoominfo.a.c.height, pcdev->zoominfo.a.c.left,pcdev->zoominfo.a.c.top, - pix->width, pix->height); - - - rk29_camera_setup_format(icd, pix->pixelformat, mf.code, &rect); - - if (CAM_IPPWORK_IS_EN()) { - BUG_ON(pcdev->vipmem_phybase == 0); - } - pcdev->icd_width = icd_width; - pcdev->icd_height = icd_height; - - pix->width = usr_w; - pix->height = usr_h; - pix->field = mf.field; - pix->colorspace = mf.colorspace; - icd->current_fmt = xlate; - } - -RK29_CAMERA_SET_FMT_END: - if (stream_on & ENABLE_CAPTURE) - write_vip_reg(RK29_VIP_CTRL, (read_vip_reg(RK29_VIP_CTRL) | ENABLE_CAPTURE)); - if (ret) - RK29CAMERA_TR("\n%s: Driver isn't support %dx%d resolution which user request!\n",__FUNCTION__,usr_w,usr_h); - return ret; -} -static bool rk29_camera_fmt_capturechk(struct v4l2_format *f) -{ - bool ret = false; - - if ((f->fmt.pix.width == 1024) && (f->fmt.pix.height == 768)) { - ret = true; - } else if ((f->fmt.pix.width == 1280) && (f->fmt.pix.height == 1024)) { - ret = true; - } else if ((f->fmt.pix.width == 1600) && (f->fmt.pix.height == 1200)) { - ret = true; - } else if ((f->fmt.pix.width == 2048) && (f->fmt.pix.height == 1536)) { - ret = true; - } else if ((f->fmt.pix.width == 2592) && (f->fmt.pix.height == 1944)) { - ret = true; - } - - if (ret == true) - RK29CAMERA_DG("%s %dx%d is capture format\n", __FUNCTION__, f->fmt.pix.width, f->fmt.pix.height); - return ret; -} -static int rk29_camera_try_fmt(struct soc_camera_device *icd, - struct v4l2_format *f) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); - struct rk29_camera_dev *pcdev = ici->priv; - struct v4l2_subdev *sd = soc_camera_to_subdev(icd); - const struct soc_camera_format_xlate *xlate; - struct v4l2_pix_format *pix = &f->fmt.pix; - __u32 pixfmt = pix->pixelformat; - int ret,usr_w,usr_h,i; - bool is_capture = rk29_camera_fmt_capturechk(f); - bool vipmem_is_overflow = false; - struct v4l2_mbus_framefmt mf; - int bytes_per_line_host; - - usr_w = pix->width; - usr_h = pix->height; - RK29CAMERA_DG("%s enter width:%d height:%d\n",__FUNCTION__,usr_w,usr_h); - - xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); - if (!xlate) { - dev_err(icd->dev.parent, "Format (%c%c%c%c) not found\n", pixfmt & 0xFF, (pixfmt >> 8) & 0xFF, - (pixfmt >> 16) & 0xFF, (pixfmt >> 24) & 0xFF); - ret = -EINVAL; - RK29CAMERA_TR("%s(version:%c%c%c) support format:\n",rk29_cam_driver_description,(RK29_CAM_VERSION_CODE&0xff0000)>>16, - (RK29_CAM_VERSION_CODE&0xff00)>>8,(RK29_CAM_VERSION_CODE&0xff)); - for (i = 0; i < icd->num_user_formats; i++) - RK29CAMERA_TR("(%c%c%c%c)-%s\n", - icd->user_formats[i].host_fmt->fourcc & 0xFF, (icd->user_formats[i].host_fmt->fourcc >> 8) & 0xFF, - (icd->user_formats[i].host_fmt->fourcc >> 16) & 0xFF, (icd->user_formats[i].host_fmt->fourcc >> 24) & 0xFF, - icd->user_formats[i].host_fmt->name); - goto RK29_CAMERA_TRY_FMT_END; - } - /* limit to rk29 hardware capabilities */ - v4l_bound_align_image(&pix->width, RK29_CAM_W_MIN, RK29_CAM_W_MAX, 1, - &pix->height, RK29_CAM_H_MIN, RK29_CAM_H_MAX, 0, - pixfmt == V4L2_PIX_FMT_NV16 ? 4 : 0); - - pix->bytesperline = soc_mbus_bytes_per_line(pix->width, - xlate->host_fmt); - if (pix->bytesperline < 0) - return pix->bytesperline; - - /* limit to sensor capabilities */ - mf.width = pix->width; - mf.height = pix->height; - mf.field = pix->field; - mf.colorspace = pix->colorspace; - mf.code = xlate->code; - - ret = v4l2_subdev_call(sd, video, try_mbus_fmt, &mf); - if (ret < 0) - goto RK29_CAMERA_TRY_FMT_END; - RK29CAMERA_DG("%s mf.width:%d mf.height:%d\n",__FUNCTION__,mf.width,mf.height); - #ifdef CONFIG_VIDEO_RK29_WORK_IPP - if ((mf.width != usr_w) || (mf.height != usr_h)) { - bytes_per_line_host = soc_mbus_bytes_per_line(mf.width,icd->current_fmt->host_fmt); - if (is_capture) { - vipmem_is_overflow = (PAGE_ALIGN(bytes_per_line_host*mf.height) > pcdev->vipmem_size); - } else { - /* Assume preview buffer minimum is 4 */ - vipmem_is_overflow = (PAGE_ALIGN(bytes_per_line_host*mf.height)*4 > pcdev->vipmem_size); - } - if (vipmem_is_overflow == false) { - pix->width = usr_w; - pix->height = usr_h; - } else { - RK29CAMERA_TR("vipmem for IPP is overflow, This resolution(%dx%d -> %dx%d) is invalidate!\n",mf.width,mf.height,usr_w,usr_h); - pix->width = mf.width; - pix->height = mf.height; - } - - if ((mf.width < usr_w) || (mf.height < usr_h)) { - if (((usr_w>>1) > mf.width) || ((usr_h>>1) > mf.height)) { - RK29CAMERA_TR("The aspect ratio(%dx%d/%dx%d) is bigger than 2 !\n",mf.width,mf.height,usr_w,usr_h); - pix->width = mf.width; - pix->height = mf.height; - } - } - } - #else - pix->width = mf.width; - pix->height = mf.height; - #endif - pix->colorspace = mf.colorspace; - - switch (mf.field) { - case V4L2_FIELD_ANY: - case V4L2_FIELD_NONE: - pix->field = V4L2_FIELD_NONE; - break; - default: - /* TODO: support interlaced at least in pass-through mode */ - dev_err(icd->dev.parent, "Field type %d unsupported.\n", - mf.field); - goto RK29_CAMERA_TRY_FMT_END; - } - -RK29_CAMERA_TRY_FMT_END: - if (ret) - RK29CAMERA_TR("\n%s..%d.. ret = %d \n",__FUNCTION__,__LINE__, ret); - return ret; -} - -static int rk29_camera_reqbufs(struct soc_camera_device *icd, - struct v4l2_requestbuffers *p) -{ - int i; - - /* This is for locking debugging only. I removed spinlocks and now I - * check whether .prepare is ever called on a linked buffer, or whether - * a dma IRQ can occur for an in-work or unlinked buffer. Until now - * it hadn't triggered */ - for (i = 0; i < p->count; i++) { - struct rk29_buffer *buf = container_of(icd->vb_vidq.bufs[i], - struct rk29_buffer, vb); - buf->inwork = 0; - INIT_LIST_HEAD(&buf->vb.queue); - } - - return 0; -} - -static unsigned int rk29_camera_poll(struct file *file, poll_table *pt) -{ - struct soc_camera_device *icd = file->private_data; - struct rk29_buffer *buf; - - buf = list_entry(icd->vb_vidq.stream.next, struct rk29_buffer, - vb.stream); - - poll_wait(file, &buf->vb.done, pt); - - if (buf->vb.state == VIDEOBUF_DONE || - buf->vb.state == VIDEOBUF_ERROR) - return POLLIN|POLLRDNORM; - - return 0; -} - -static int rk29_camera_querycap(struct soc_camera_host *ici, - struct v4l2_capability *cap) -{ - struct rk29_camera_dev *pcdev = ici->priv; - char orientation[5]; - int i; - - strlcpy(cap->card, dev_name(pcdev->icd->pdev), sizeof(cap->card)); - - memset(orientation,0x00,sizeof(orientation)); - for (i=0; ipdata->info[i].dev_name!=NULL) && (strcmp(dev_name(pcdev->icd->pdev), pcdev->pdata->info[i].dev_name) == 0)) { - sprintf(orientation,"-%d",pcdev->pdata->info[i].orientation); - } - } - - if (orientation[0] != '-') { - RK29CAMERA_TR("%s: %s is not registered in rk29_camera_platform_data, orientation apply default value",__FUNCTION__,dev_name(pcdev->icd->pdev)); - if (strstr(dev_name(pcdev->icd->pdev),"front")) - strcat(cap->card,"-270"); - else - strcat(cap->card,"-90"); - } else { - strcat(cap->card,orientation); - } - - cap->version = RK29_CAM_VERSION_CODE; - cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING; - - return 0; -} - -static int rk29_camera_suspend(struct soc_camera_device *icd, pm_message_t state) -{ - struct soc_camera_host *ici = - to_soc_camera_host(icd->dev.parent); - struct rk29_camera_dev *pcdev = ici->priv; - struct v4l2_subdev *sd; - int ret = 0,tmp; - - mutex_lock(&camera_lock); - if ((pcdev->icd == icd) && (icd->ops->suspend)) { - rk29_camera_s_stream(icd, 0); - sd = soc_camera_to_subdev(icd); - v4l2_subdev_call(sd, video, s_stream, 0); - ret = icd->ops->suspend(icd, state); - - pcdev->reginfo_suspend.VipCtrl = read_vip_reg(RK29_VIP_CTRL); - pcdev->reginfo_suspend.VipCrop = read_vip_reg(RK29_VIP_CROP); - pcdev->reginfo_suspend.VipFs = read_vip_reg(RK29_VIP_FS); - pcdev->reginfo_suspend.VipIntMsk = read_vip_reg(RK29_VIP_INT_MASK); - pcdev->reginfo_suspend.VipCrm = read_vip_reg(RK29_VIP_CRM); - - tmp = pcdev->reginfo_suspend.VipFs>>16; /* ddl@rock-chips.com */ - tmp += pcdev->reginfo_suspend.VipCrop>>16; - pcdev->reginfo_suspend.VipFs = (pcdev->reginfo_suspend.VipFs & 0xffff) | (tmp<<16); - - pcdev->reginfo_suspend.Inval = Reg_Validate; - rk29_camera_deactivate(pcdev); - - RK29CAMERA_DG("%s Enter Success...\n", __FUNCTION__); - } else { - RK29CAMERA_DG("%s icd has been deattach, don't need enter suspend\n", __FUNCTION__); - } - mutex_unlock(&camera_lock); - return ret; -} - -static int rk29_camera_resume(struct soc_camera_device *icd) -{ - struct soc_camera_host *ici = - to_soc_camera_host(icd->dev.parent); - struct rk29_camera_dev *pcdev = ici->priv; - struct v4l2_subdev *sd; - int ret = 0; - - mutex_lock(&camera_lock); - if ((pcdev->icd == icd) && (icd->ops->resume)) { - if (pcdev->reginfo_suspend.Inval == Reg_Validate) { - rk29_camera_activate(pcdev, icd); - write_vip_reg(RK29_VIP_INT_MASK, pcdev->reginfo_suspend.VipIntMsk); - write_vip_reg(RK29_VIP_CRM, pcdev->reginfo_suspend.VipCrm); - write_vip_reg(RK29_VIP_CTRL, pcdev->reginfo_suspend.VipCtrl&~ENABLE_CAPTURE); - write_vip_reg(RK29_VIP_CROP, pcdev->reginfo_suspend.VipCrop); - write_vip_reg(RK29_VIP_FS, pcdev->reginfo_suspend.VipFs); - - rk29_videobuf_capture(pcdev->active); - rk29_camera_s_stream(icd, 1); - pcdev->reginfo_suspend.Inval = Reg_Invalidate; - } else { - RK29CAMERA_TR("Resume fail, vip register recored is invalidate!!\n"); - goto rk29_camera_resume_end; - } - - ret = icd->ops->resume(icd); - sd = soc_camera_to_subdev(icd); - v4l2_subdev_call(sd, video, s_stream, 1); - - RK29CAMERA_DG("%s Enter success\n",__FUNCTION__); - } else { - RK29CAMERA_DG("%s icd has been deattach, don't need enter resume\n", __FUNCTION__); - } - -rk29_camera_resume_end: - mutex_unlock(&camera_lock); - return ret; -} - -static void rk29_camera_reinit_work(struct work_struct *work) -{ - struct device *control; - struct v4l2_subdev *sd; - struct v4l2_mbus_framefmt mf; - const struct soc_camera_format_xlate *xlate; - int ret; - - write_vip_reg(RK29_VIP_CTRL, (read_vip_reg(RK29_VIP_CTRL)&(~ENABLE_CAPTURE))); - - control = to_soc_camera_control(rk29_camdev_info_ptr->icd); - sd = dev_get_drvdata(control); - v4l2_subdev_call(sd, video, s_stream, 0); /* ddl@rock-chips.com: Avoid sensor autofocus thread is running */ - ret = v4l2_subdev_call(sd,core, init, 1); - - mf.width = rk29_camdev_info_ptr->icd->user_width; - mf.height = rk29_camdev_info_ptr->icd->user_height; - xlate = soc_camera_xlate_by_fourcc(rk29_camdev_info_ptr->icd, rk29_camdev_info_ptr->icd->current_fmt->host_fmt->fourcc); - mf.code = xlate->code; - - ret |= v4l2_subdev_call(sd, video, s_mbus_fmt, &mf); - v4l2_subdev_call(sd, video, s_stream, 1); - write_vip_reg(RK29_VIP_CTRL, (read_vip_reg(RK29_VIP_CTRL)|ENABLE_CAPTURE)); - - RK29CAMERA_TR("Camera host haven't recevie data from sensor,Reinit sensor now! ret:0x%x\n",ret); -} -static enum hrtimer_restart rk29_camera_fps_func(struct hrtimer *timer) -{ - struct rk29_camera_frmivalenum *fival_nxt=NULL,*fival_pre=NULL, *fival_rec=NULL; - int rec_flag,i; - - RK29CAMERA_DG("rk29_camera_fps_func fps:0x%x\n",rk29_camdev_info_ptr->fps); - if (rk29_camdev_info_ptr->fps < 2) { - RK29CAMERA_TR("Camera host haven't recevie data from sensor,Reinit sensor delay!\n"); - INIT_WORK(&rk29_camdev_info_ptr->camera_reinit_work, rk29_camera_reinit_work); - queue_work(rk29_camdev_info_ptr->camera_wq,&(rk29_camdev_info_ptr->camera_reinit_work)); - } else { - for (i=0; i<2; i++) { - if (rk29_camdev_info_ptr->icd == rk29_camdev_info_ptr->icd_frmival[i].icd) { - fival_nxt = rk29_camdev_info_ptr->icd_frmival[i].fival_list; - } - } - - rec_flag = 0; - fival_pre = fival_nxt; - while (fival_nxt != NULL) { - - RK29CAMERA_DG("%s %c%c%c%c %dx%d framerate : %d/%d\n", dev_name(&rk29_camdev_info_ptr->icd->dev), - fival_nxt->fival.pixel_format & 0xFF, (fival_nxt->fival.pixel_format >> 8) & 0xFF, - (fival_nxt->fival.pixel_format >> 16) & 0xFF, (fival_nxt->fival.pixel_format >> 24), - fival_nxt->fival.width, fival_nxt->fival.height, fival_nxt->fival.discrete.denominator, - fival_nxt->fival.discrete.numerator); - - if (((fival_nxt->fival.pixel_format == rk29_camdev_info_ptr->pixfmt) - && (fival_nxt->fival.height == rk29_camdev_info_ptr->icd->user_height) - && (fival_nxt->fival.width == rk29_camdev_info_ptr->icd->user_width)) - || (fival_nxt->fival.discrete.denominator == 0)) { - - fival_nxt->fival.index = 0; - fival_nxt->fival.width = rk29_camdev_info_ptr->icd->user_width; - fival_nxt->fival.height= rk29_camdev_info_ptr->icd->user_height; - fival_nxt->fival.pixel_format = rk29_camdev_info_ptr->pixfmt; - fival_nxt->fival.discrete.denominator = rk29_camdev_info_ptr->frame_interval; - fival_nxt->fival.reserved[1] = (rk29_camdev_info_ptr->icd_width<<16) - |(rk29_camdev_info_ptr->icd_height); - fival_nxt->fival.discrete.numerator = 1000000; - fival_nxt->fival.type = V4L2_FRMIVAL_TYPE_DISCRETE; - - rec_flag = 1; - fival_rec = fival_nxt; - } - fival_pre = fival_nxt; - fival_nxt = fival_nxt->nxt; - } - - if ((rec_flag == 0) && fival_pre) { - fival_pre->nxt = kzalloc(sizeof(struct rk29_camera_frmivalenum), GFP_ATOMIC); - if (fival_pre->nxt != NULL) { - fival_pre->nxt->fival.index = fival_pre->fival.index++; - fival_pre->nxt->fival.width = rk29_camdev_info_ptr->icd->user_width; - fival_pre->nxt->fival.height= rk29_camdev_info_ptr->icd->user_height; - fival_pre->nxt->fival.pixel_format = rk29_camdev_info_ptr->pixfmt; - - fival_pre->nxt->fival.discrete.denominator = rk29_camdev_info_ptr->frame_interval; - - fival_pre->nxt->fival.reserved[1] = (rk29_camdev_info_ptr->icd_width<<16) - |(rk29_camdev_info_ptr->icd_height); - - fival_pre->nxt->fival.discrete.numerator = 1000000; - fival_pre->nxt->fival.type = V4L2_FRMIVAL_TYPE_DISCRETE; - rec_flag = 1; - fival_rec = fival_pre->nxt; - } - } - } - - return HRTIMER_NORESTART; -} -static int rk29_camera_s_stream(struct soc_camera_device *icd, int enable) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); - struct rk29_camera_dev *pcdev = ici->priv; - int vip_ctrl_val; - int ret; - - WARN_ON(pcdev->icd != icd); - pcdev->frame_interval = 0; - vip_ctrl_val = read_vip_reg(RK29_VIP_CTRL); - if (enable) { - pcdev->fps = 0; - hrtimer_cancel(&pcdev->fps_timer); - hrtimer_start(&pcdev->fps_timer,ktime_set(1, 0),HRTIMER_MODE_REL); - vip_ctrl_val |= ENABLE_CAPTURE; - } else { - vip_ctrl_val &= ~ENABLE_CAPTURE; - ret = hrtimer_cancel(&pcdev->fps_timer); - ret |= flush_work(&rk29_camdev_info_ptr->camera_reinit_work); - RK29CAMERA_DG("STREAM_OFF cancel timer and flush work:0x%x \n", ret); - } - write_vip_reg(RK29_VIP_CTRL, vip_ctrl_val); - - RK29CAMERA_DG("%s.. enable : 0x%x \n", __FUNCTION__, enable); - return 0; -} -int rk29_camera_enum_frameintervals(struct soc_camera_device *icd, struct v4l2_frmivalenum *fival) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); - struct rk29_camera_dev *pcdev = ici->priv; - struct rk29_camera_frmivalenum *fival_list = NULL; - struct v4l2_frmivalenum *fival_head=NULL; - int i,ret = 0,index; - - index = fival->index & 0x00ffffff; - if ((fival->index & 0xff000000) == 0xff000000) { /* ddl@rock-chips.com: detect framerate */ - for (i=0; i<2; i++) { - if (pcdev->icd_frmival[i].icd == icd) { - fival_list = pcdev->icd_frmival[i].fival_list; - } - } - - if (fival_list != NULL) { - i = 0; - while (fival_list != NULL) { - if ((fival->pixel_format == fival_list->fival.pixel_format) - && (fival->height == fival_list->fival.height) - && (fival->width == fival_list->fival.width)) { - if (i == index) - break; - i++; - } - fival_list = fival_list->nxt; - } - - if ((i==index) && (fival_list != NULL)) { - memcpy(fival, &fival_list->fival, sizeof(struct v4l2_frmivalenum)); - } else { - ret = -EINVAL; - } - } else { - RK29CAMERA_TR("%s: fival_list is NULL\n",__FUNCTION__); - ret = -EINVAL; - } - } else { - - for (i=0; ipdata->info[i].dev_name && (strcmp(dev_name(pcdev->icd->pdev),pcdev->pdata->info[i].dev_name) == 0)) { - fival_head = pcdev->pdata->info[i].fival; - } - } - - if (fival_head == NULL) { - RK29CAMERA_TR("%s: %s is not registered in rk29_camera_platform_data!!",__FUNCTION__,dev_name(pcdev->icd->pdev)); - ret = -EINVAL; - goto rk29_camera_enum_frameintervals_end; - } - - i = 0; - while (fival_head->width && fival_head->height) { - if ((fival->pixel_format == fival_head->pixel_format) - && (fival->height == fival_head->height) - && (fival->width == fival_head->width)) { - if (i == index) { - break; - } - i++; - } - fival_head++; - } - - if ((i == index) && (fival->height == fival_head->height) && (fival->width == fival_head->width)) { - memcpy(fival, fival_head, sizeof(struct v4l2_frmivalenum)); - RK29CAMERA_DG("%s %dx%d@%c%c%c%c framerate : %d/%d\n", dev_name(rk29_camdev_info_ptr->icd->pdev), - fival->width, fival->height, - fival->pixel_format & 0xFF, (fival->pixel_format >> 8) & 0xFF, - (fival->pixel_format >> 16) & 0xFF, (fival->pixel_format >> 24), - fival->discrete.denominator,fival->discrete.numerator); - } else { - if (index == 0) - RK29CAMERA_TR("%s have not catch %dx%d@%c%c%c%c index(%d) framerate\n",dev_name(rk29_camdev_info_ptr->icd->pdev), - fival->width,fival->height, - fival->pixel_format & 0xFF, (fival->pixel_format >> 8) & 0xFF, - (fival->pixel_format >> 16) & 0xFF, (fival->pixel_format >> 24), - index); - else - RK29CAMERA_DG("%s have not catch %dx%d@%c%c%c%c index(%d) framerate\n",dev_name(rk29_camdev_info_ptr->icd->pdev), - fival->width,fival->height, - fival->pixel_format & 0xFF, (fival->pixel_format >> 8) & 0xFF, - (fival->pixel_format >> 16) & 0xFF, (fival->pixel_format >> 24), - index); - ret = -EINVAL; - } - } -rk29_camera_enum_frameintervals_end: - return ret; -} - -#ifdef CONFIG_VIDEO_RK29_DIGITALZOOM_IPP_ON -static int rk29_camera_set_digit_zoom(struct soc_camera_device *icd, - const struct v4l2_queryctrl *qctrl, int zoom_rate) -{ - struct v4l2_crop a; - struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); - struct rk29_camera_dev *pcdev = ici->priv; - -/* ddl@rock-chips.com : The largest resolution is 2047x1088, so larger resolution must be operated some times - (Assume operate times is 4),but resolution which ipp can operate ,it is width and height must be even. */ - a.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - a.c.width = pcdev->host_width*100/zoom_rate; - a.c.width &= ~0x03; - a.c.height = pcdev->host_height*100/zoom_rate; - a.c.height &= ~0x03; - - a.c.left = ((pcdev->host_width - a.c.width)>>1)&(~0x01); - a.c.top = ((pcdev->host_height - a.c.height)>>1)&(~0x01); - - down(&pcdev->zoominfo.sem); - pcdev->zoominfo.a.c.height = a.c.height; - pcdev->zoominfo.a.c.width = a.c.width; - pcdev->zoominfo.a.c.top = a.c.top; - pcdev->zoominfo.a.c.left = a.c.left; - up(&pcdev->zoominfo.sem); - - RK29CAMERA_DG("%s..zoom_rate:%d (%dx%d at (%d,%d)-> %dx%d)\n",__FUNCTION__, zoom_rate,a.c.width, a.c.height, a.c.left, a.c.top, pcdev->host_width, pcdev->host_height ); - - return 0; -} -#endif -static inline struct v4l2_queryctrl const *rk29_camera_soc_camera_find_qctrl( - struct soc_camera_host_ops *ops, int id) -{ - int i; - - for (i = 0; i < ops->num_controls; i++) - if (ops->controls[i].id == id) - return &ops->controls[i]; - - return NULL; -} - - -static int rk29_camera_set_ctrl(struct soc_camera_device *icd, - struct v4l2_control *sctrl) -{ - - struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); - const struct v4l2_queryctrl *qctrl; - struct rk29_camera_dev *pcdev = ici->priv; - int ret = 0; - - qctrl = rk29_camera_soc_camera_find_qctrl(ici->ops, sctrl->id); - if (!qctrl) { - ret = -ENOIOCTLCMD; - goto rk29_camera_set_ctrl_end; - } - - switch (sctrl->id) - { - #ifdef CONFIG_VIDEO_RK29_DIGITALZOOM_IPP_ON - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((sctrl->value < qctrl->minimum) || (sctrl->value > qctrl->maximum)){ - ret = -EINVAL; - goto rk29_camera_set_ctrl_end; - } - ret = rk29_camera_set_digit_zoom(icd, qctrl, sctrl->value); - if (ret == 0) { - pcdev->zoominfo.zoom_rate = sctrl->value; - } else { - goto rk29_camera_set_ctrl_end; - } - break; - } - #endif - default: - ret = -ENOIOCTLCMD; - break; - } -rk29_camera_set_ctrl_end: - return ret; -} - -static struct soc_camera_host_ops rk29_soc_camera_host_ops = -{ - .owner = THIS_MODULE, - .add = rk29_camera_add_device, - .remove = rk29_camera_remove_device, - .suspend = rk29_camera_suspend, - .resume = rk29_camera_resume, - .enum_frameinervals = rk29_camera_enum_frameintervals, - .set_crop = rk29_camera_set_crop, - .get_formats = rk29_camera_get_formats, - .put_formats = rk29_camera_put_formats, - .set_fmt = rk29_camera_set_fmt, - .try_fmt = rk29_camera_try_fmt, - .init_videobuf = rk29_camera_init_videobuf, - .reqbufs = rk29_camera_reqbufs, - .poll = rk29_camera_poll, - .querycap = rk29_camera_querycap, - .set_bus_param = rk29_camera_set_bus_param, - .s_stream = rk29_camera_s_stream, /* ddl@rock-chips.com : Add stream control for host */ - .set_ctrl = rk29_camera_set_ctrl, - .controls = rk29_camera_controls, - .num_controls = ARRAY_SIZE(rk29_camera_controls) - -}; -static int rk29_camera_probe(struct platform_device *pdev) -{ - struct rk29_camera_dev *pcdev; - struct resource *res; - struct rk29_camera_frmivalenum *fival_list,*fival_nxt; - int irq,i; - int err = 0; - - RK29CAMERA_TR("RK29 Camera driver version: v%d.%d.%d Zoom by %s\n",(RK29_CAM_VERSION_CODE&0xff0000)>>16, - (RK29_CAM_VERSION_CODE&0xff00)>>8,RK29_CAM_VERSION_CODE&0xff,CAMERA_SCALE_CROP_MACHINE); - - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - irq = platform_get_irq(pdev, 0); - if (!res || irq < 0) { - err = -ENODEV; - goto exit; - } - - pcdev = kzalloc(sizeof(*pcdev), GFP_KERNEL); - if (!pcdev) { - dev_err(&pdev->dev, "Could not allocate pcdev\n"); - err = -ENOMEM; - goto exit_alloc; - } - rk29_camdev_info_ptr = pcdev; - - /*config output clk*/ - pcdev->aclk_ddr_lcdc = clk_get(&pdev->dev, "aclk_ddr_lcdc"); - pcdev->aclk_disp_matrix = clk_get(&pdev->dev, "aclk_disp_matrix"); - - pcdev->hclk_cpu_display = clk_get(&pdev->dev, "hclk_cpu_display"); - pcdev->vip_slave = clk_get(&pdev->dev, "vip_slave"); - pcdev->vip_out = clk_get(&pdev->dev,"vip_out"); - pcdev->vip_input = clk_get(&pdev->dev,"vip_input"); - pcdev->vip_bus = clk_get(&pdev->dev, "vip_bus"); - - pcdev->hclk_disp_matrix = clk_get(&pdev->dev,"hclk_disp_matrix"); - pcdev->vip_matrix = clk_get(&pdev->dev,"vip_matrix"); - - pcdev->pd_display = clk_get(&pdev->dev,"pd_display"); - - pcdev->zoominfo.zoom_rate = 100; - - if (!pcdev->aclk_ddr_lcdc || !pcdev->aclk_disp_matrix || !pcdev->hclk_cpu_display || - !pcdev->vip_slave || !pcdev->vip_out || !pcdev->vip_input || !pcdev->vip_bus || !pcdev->pd_display || - IS_ERR(pcdev->aclk_ddr_lcdc) || IS_ERR(pcdev->aclk_disp_matrix) || IS_ERR(pcdev->hclk_cpu_display) || IS_ERR(pcdev->pd_display) || - IS_ERR(pcdev->vip_slave) || IS_ERR(pcdev->vip_out) || IS_ERR(pcdev->vip_input) || IS_ERR(pcdev->vip_bus)) { - - RK29CAMERA_TR(KERN_ERR "failed to get vip_clk(axi) source\n"); - err = -ENOENT; - goto exit_reqmem; - } - - if (!pcdev->hclk_disp_matrix || !pcdev->vip_matrix || - IS_ERR(pcdev->hclk_disp_matrix) || IS_ERR(pcdev->vip_matrix)) { - - RK29CAMERA_TR(KERN_ERR "failed to get vip_clk(ahb) source\n"); - err = -ENOENT; - goto exit_reqmem; - } - - dev_set_drvdata(&pdev->dev, pcdev); - pcdev->res = res; - - pcdev->pdata = pdev->dev.platform_data; /* ddl@rock-chips.com : Request IO in init function */ - if (pcdev->pdata && pcdev->pdata->io_init) { - pcdev->pdata->io_init(); - } - #ifdef CONFIG_VIDEO_RK29_WORK_IPP - if (pcdev->pdata && (strcmp(pcdev->pdata->meminfo.name,"camera_ipp_mem")==0)) { - pcdev->vipmem_phybase = pcdev->pdata->meminfo.start; - pcdev->vipmem_size = pcdev->pdata->meminfo.size; - - if (!request_mem_region(pcdev->vipmem_phybase,pcdev->vipmem_size,"rk29_vipmem")) { - err = -EBUSY; - goto exit_ioremap_vipmem; - } - pcdev->vipmem_virbase = ioremap_cached(pcdev->vipmem_phybase,pcdev->vipmem_size); - if (pcdev->vipmem_virbase == NULL) { - dev_err(pcdev->dev, "ioremap() of vip internal memory(Ex:IPP process/raw process) failed\n"); - err = -ENXIO; - goto exit_ioremap_vipmem; - } - - RK29CAMERA_DG("\n%s Memory(start:0x%x size:0x%x) for IPP obtain \n",__FUNCTION__, pcdev->pdata->meminfo.start,pcdev->pdata->meminfo.size); - } else { - RK29CAMERA_TR("\n%s Memory for IPP have not obtain! IPP Function is fail\n",__FUNCTION__); - pcdev->vipmem_phybase = 0; - pcdev->vipmem_size = 0; - pcdev->vipmem_virbase = 0; - } - #endif - INIT_LIST_HEAD(&pcdev->capture); - INIT_LIST_HEAD(&pcdev->camera_work_queue); - spin_lock_init(&pcdev->lock); - spin_lock_init(&pcdev->camera_work_lock); - sema_init(&pcdev->zoominfo.sem,1); - - /* - * Request the regions. - */ - if (!request_mem_region(res->start, res->end - res->start + 1, - RK29_CAM_DRV_NAME)) { - err = -EBUSY; - goto exit_reqmem; - } - - pcdev->base = ioremap(res->start, res->end - res->start + 1); - if (pcdev->base == NULL) { - dev_err(pcdev->dev, "ioremap() of registers failed\n"); - err = -ENXIO; - goto exit_ioremap; - } - - pcdev->irq = irq; - pcdev->dev = &pdev->dev; - - /* config buffer address */ - /* request irq */ - err = request_irq(pcdev->irq, rk29_camera_irq, 0, RK29_CAM_DRV_NAME, - pcdev); - if (err) { - dev_err(pcdev->dev, "Camera interrupt register failed \n"); - goto exit_reqirq; - } - - pcdev->camera_wq = create_workqueue("rk_camera_workqueue"); - if (pcdev->camera_wq == NULL) - goto exit_free_irq; - INIT_WORK(&pcdev->camera_reinit_work, rk29_camera_reinit_work); - - for (i=0; i<2; i++) { - pcdev->icd_frmival[i].icd = NULL; - pcdev->icd_frmival[i].fival_list = kzalloc(sizeof(struct rk29_camera_frmivalenum),GFP_KERNEL); - - } - - pcdev->soc_host.drv_name = RK29_CAM_DRV_NAME; - pcdev->soc_host.ops = &rk29_soc_camera_host_ops; - pcdev->soc_host.priv = pcdev; - pcdev->soc_host.v4l2_dev.dev = &pdev->dev; - pcdev->soc_host.nr = pdev->id; - - err = soc_camera_host_register(&pcdev->soc_host); - if (err) - goto exit_free_irq; - - hrtimer_init(&pcdev->fps_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - pcdev->fps_timer.function = rk29_camera_fps_func; - pcdev->icd_cb.sensor_cb = NULL; - -#if (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_IPP) - pcdev->icd_cb.scale_crop_cb = rk29_camera_scale_crop_ipp; -#elif (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_ARM) - pcdev->icd_cb.scale_crop_cb = rk29_camera_scale_crop_arm; -#endif - RK29CAMERA_DG("%s..%s..%d \n",__FUNCTION__,__FILE__,__LINE__); - return 0; - -exit_free_irq: - - for (i=0; i<2; i++) { - fival_list = pcdev->icd_frmival[i].fival_list; - fival_nxt = fival_list; - while(fival_nxt != NULL) { - fival_nxt = fival_list->nxt; - kfree(fival_list); - fival_list = fival_nxt; - } - } - - free_irq(pcdev->irq, pcdev); - if (pcdev->camera_wq) { - destroy_workqueue(pcdev->camera_wq); - pcdev->camera_wq = NULL; - } -exit_reqirq: - iounmap(pcdev->base); -exit_ioremap: - release_mem_region(res->start, res->end - res->start + 1); -exit_ioremap_vipmem: - if (pcdev->vipmem_virbase) - iounmap(pcdev->vipmem_virbase); - release_mem_region(pcdev->vipmem_phybase,pcdev->vipmem_size); -exit_reqmem: - if (pcdev->aclk_ddr_lcdc) { - clk_put(pcdev->aclk_ddr_lcdc); - pcdev->aclk_ddr_lcdc = NULL; - } - if (pcdev->aclk_disp_matrix) { - clk_put(pcdev->aclk_disp_matrix); - pcdev->aclk_disp_matrix = NULL; - } - if (pcdev->hclk_cpu_display) { - clk_put(pcdev->hclk_cpu_display); - pcdev->hclk_cpu_display = NULL; - } - if (pcdev->vip_slave) { - clk_put(pcdev->vip_slave); - pcdev->vip_slave = NULL; - } - if (pcdev->vip_out) { - clk_put(pcdev->vip_out); - pcdev->vip_out = NULL; - } - if (pcdev->vip_input) { - clk_put(pcdev->vip_input); - pcdev->vip_input = NULL; - } - if (pcdev->vip_bus) { - clk_put(pcdev->vip_bus); - pcdev->vip_bus = NULL; - } - if (pcdev->hclk_disp_matrix) { - clk_put(pcdev->hclk_disp_matrix); - pcdev->hclk_disp_matrix = NULL; - } - if (pcdev->vip_matrix) { - clk_put(pcdev->vip_matrix); - pcdev->vip_matrix = NULL; - } - kfree(pcdev); -exit_alloc: - rk29_camdev_info_ptr = NULL; -exit: - return err; -} - -static int __devexit rk29_camera_remove(struct platform_device *pdev) -{ - struct rk29_camera_dev *pcdev = platform_get_drvdata(pdev); - struct resource *res; - struct rk29_camera_frmivalenum *fival_list,*fival_nxt; - int i; - - free_irq(pcdev->irq, pcdev); - - if (pcdev->camera_wq) { - destroy_workqueue(pcdev->camera_wq); - pcdev->camera_wq = NULL; - } - - for (i=0; i<2; i++) { - fival_list = pcdev->icd_frmival[i].fival_list; - fival_nxt = fival_list; - while(fival_nxt != NULL) { - fival_nxt = fival_list->nxt; - kfree(fival_list); - fival_list = fival_nxt; - } - } - - soc_camera_host_unregister(&pcdev->soc_host); - - iounmap((void __iomem*)pcdev->vipmem_phybase); - release_mem_region(pcdev->vipmem_phybase, pcdev->vipmem_size); - - res = pcdev->res; - release_mem_region(res->start, res->end - res->start + 1); - - if (pcdev->pdata && pcdev->pdata->io_deinit) { /* ddl@rock-chips.com : Free IO in deinit function */ - pcdev->pdata->io_deinit(0); - pcdev->pdata->io_deinit(1); - } - - kfree(pcdev); - rk29_camdev_info_ptr = NULL; - dev_info(&pdev->dev, "RK28 Camera driver unloaded\n"); - - return 0; -} - -static struct platform_driver rk29_camera_driver = -{ - .driver = { - .name = RK29_CAM_DRV_NAME, - }, - .probe = rk29_camera_probe, - .remove = __devexit_p(rk29_camera_remove), -}; - - -static int __devinit rk29_camera_init(void) -{ - RK29CAMERA_DG("%s..%s..%d \n",__FUNCTION__,__FILE__,__LINE__); - return platform_driver_register(&rk29_camera_driver); -} - -static void __exit rk29_camera_exit(void) -{ - platform_driver_unregister(&rk29_camera_driver); -} - -device_initcall_sync(rk29_camera_init); -module_exit(rk29_camera_exit); - -MODULE_DESCRIPTION("RK29 Soc Camera Host driver"); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); -#endif diff --git a/drivers/media/video/rk29_camera_pingpong.c b/drivers/media/video/rk29_camera_pingpong.c deleted file mode 100644 index a1088e480775..000000000000 --- a/drivers/media/video/rk29_camera_pingpong.c +++ /dev/null @@ -1,1353 +0,0 @@ -/* - * V4L2 Driver for RK28 camera host - * - * Copyright (C) 2006, Sascha Hauer, Pengutronix - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - */ - -#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 - -// VIP Reg Offset -#define RK29_VIP_AHBR_CTRL 0x00 -#define RK29_VIP_INT_MASK 0x04 -#define RK29_VIP_INT_STS 0x08 -#define RK29_VIP_STS 0x0c -#define RK29_VIP_CTRL 0x10 -#define RK29_VIP_CAPTURE_F1SA_Y 0x14 -#define RK29_VIP_CAPTURE_F1SA_UV 0x18 -#define RK29_VIP_CAPTURE_F1SA_Cr 0x1c -#define RK29_VIP_CAPTURE_F2SA_Y 0x20 -#define RK29_VIP_CAPTURE_F2SA_UV 0x24 -#define RK29_VIP_CAPTURE_F2SA_Cr 0x28 -#define RK29_VIP_FB_SR 0x2c -#define RK29_VIP_FS 0x30 -#define RK29_VIP_VIPRESERVED 0x34 -#define RK29_VIP_CROP 0x38 -#define RK29_VIP_CRM 0x3c -#define RK29_VIP_RESET 0x40 -#define RK29_VIP_L_SFT 0x44 - -//The key register bit descrition -// VIP_CTRL Reg -#define DISABLE_CAPTURE (0x00<<0) -#define ENABLE_CAPTURE (0x01<<0) -#define HSY_HIGH_ACTIVE (0x00<<1) -#define HSY_LOW_ACTIVE (0x01<<1) -#define VIP_CCIR656 (0x00<<2) -#define VIP_SENSOR (0x01<<2) -#define SENSOR_UYVY (0x00<<3) -#define SENSOR_YUYV (0x01<<3) -#define VIP_YUV (0x00<<4) -#define VIP_RAW (0x01<<4) -#define CON_OR_PIN (0x00<<5) -#define ONEFRAME (0x01<<5) -#define VIPREGYUV420 (0x00<<6) -#define VIPREGYUV422 (0x01<<6) -#define FIELD0_START (0x00<<7) -#define FIELD1_START (0x01<<7) -#define CONTINUOUS (0x00<<8) -#define PING_PONG (0x01<<8) -#define POSITIVE_EDGE (0x00<<9) -#define NEGATIVE_EDGE (0x01<<9) -#define VIPREGNTSC (0x00<<10) -#define VIPREGPAL (0x01<<10) -#define VIP_DATA_LITTLEEND (0x00<<11) -#define VIP_DATA_BIGEND (0x01<<11) -#define VSY_LOW_ACTIVE (0x00<<12) -#define VSY_HIGH_ACTIVE (0x01<<12) -#define VIP_RAWINPUT_BYPASS (0x00<<13) -#define VIP_RAWINPUT_POSITIVE_EDGE (0x01<<13) -#define VIP_RAWINPUT_NEGATIVE_EDGE (0x02<<13) - -//VIP_FB_SR -#define VIP_F1_NOREADY (0x00<<0) -#define VIP_F1_READY (0x01<<0) -#define VIP_F2_NOREADY (0x00<<1) -#define VIP_F2_READY (0x01<<1) -#define VIP_FRAME_NOLOSS (0x00<<2) -#define VIP_FRAME_LOSS (0x01<<2) -#define VIP_F1_IS_LATEST (0x00<<3) -#define VIP_F2_IS_LATEST (0x01<<3) - -// GRF_SOC_CON0 Reg -#define GRF_SOC_CON0_Reg 0xbc -#define VIP_AXIMASTER (0x00<<0) -#define VIP_AHBMASTER (0x01<<2) - -// GRF_OS_REG0 -#define GRF_OS_REG0 0xd0 -#define VIP_ACLK_DIV_HCLK_1 (0x00<<0) -#define VIP_ACLK_DIV_HCLK_2 (0x01<<0) - - -#define MIN(x,y) ((xy) ? x: y) -#define RK29_SENSOR_24MHZ 24 /* MHz */ -#define RK29_SENSOR_48MHZ 48 - -#define write_vip_reg(addr, val) __raw_writel(val, addr+(rk29_camdev_info_ptr->base)) -#define read_vip_reg(addr) __raw_readl(addr+(rk29_camdev_info_ptr->base)) -#define mask_vip_reg(addr, msk, val) write_vip_reg(addr, (val)|((~(msk))&read_vip_reg(addr))) - -#define write_grf_reg(addr, val) __raw_writel(val, addr+RK29_GRF_BASE) -#define read_grf_reg(addr) __raw_readl(addr+RK29_GRF_BASE) -#define mask_grf_reg(addr, msk, val) write_vip_reg(addr, (val)|((~(msk))&read_vip_reg(addr))) - -//Configure Macro -#define CONFIG_RK29CAMERA_TR 1 -#define CONFIG_RK29CAMERA_DEBUG 1 -#if (CONFIG_RK29CAMERA_TR) - #define RK29CAMERA_TR(format, ...) printk(format, ## __VA_ARGS__) - #if (CONFIG_RK29CAMERA_DEBUG) - #define RK29CAMERA_DG(format, ...) printk(format, ## __VA_ARGS__) - #else - #define RK29CAMERA_DG(format, ...) - #endif -#else - #define RK29CAMERA_TR(format, ...) - #define RK29CAMERA_DG(format, ...) -#endif - -#define RK29_CAM_VERSION_CODE KERNEL_VERSION(0, 0, 1) - -/* limit to rk29 hardware capabilities */ -#define RK29_CAM_BUS_PARAM (SOCAM_MASTER |\ - SOCAM_HSYNC_ACTIVE_HIGH |\ - SOCAM_HSYNC_ACTIVE_LOW |\ - SOCAM_VSYNC_ACTIVE_HIGH |\ - SOCAM_VSYNC_ACTIVE_LOW |\ - SOCAM_PCLK_SAMPLE_RISING |\ - SOCAM_PCLK_SAMPLE_FALLING|\ - SOCAM_DATA_ACTIVE_HIGH |\ - SOCAM_DATA_ACTIVE_LOW|\ - SOCAM_DATAWIDTH_8|SOCAM_DATAWIDTH_10|\ - SOCAM_MCLK_24MHZ |SOCAM_MCLK_48MHZ) - -#define RK29_CAM_W_MIN 48 -#define RK29_CAM_H_MIN 32 -#define RK29_CAM_W_MAX 3856 /* ddl@rock-chips.com : 10M Pixel */ -#define RK29_CAM_H_MAX 2764 -#define RK29_CAM_FRAME_INVAL_INIT 3 -#define RK29_CAM_FRAME_INVAL_DC 1 /* ddl@rock-chips.com : */ - -// Variable and Function Declare -extern void videobuf_dma_contig_free(struct videobuf_queue *q, struct videobuf_buffer *buf); -extern dma_addr_t videobuf_to_dma_contig(struct videobuf_buffer *buf); -extern void videobuf_queue_dma_contig_init(struct videobuf_queue *q, - struct videobuf_queue_ops *ops, - struct device *dev, - spinlock_t *irqlock, - enum v4l2_buf_type type, - enum v4l2_field field, - unsigned int msize, - void *priv); - -/* buffer for one video frame */ -struct rk29_buffer -{ - /* common v4l buffer stuff -- must be first */ - struct videobuf_buffer vb; - const struct soc_camera_data_format *fmt; - int inwork; -}; -enum rk29_camera_reg_state -{ - Reg_Invalidate, - Reg_Validate -}; - -struct rk29_camera_reg -{ - unsigned int VipCtrl; - unsigned int VipCrop; - unsigned int VipFs; - unsigned int VipIntMsk; - unsigned int VipCrm; - enum rk29_camera_reg_state Inval; -}; -struct rk29_camera_dev -{ - struct soc_camera_host soc_host; - struct device *dev; - /* RK2827x is only supposed to handle one camera on its Quick Capture - * interface. If anyone ever builds hardware to enable more than - * one camera, they will have to modify this driver too */ - struct soc_camera_device *icd; - struct clk *clk; - void __iomem *base; - int frame_inval; /* ddl@rock-chips.com : The first frames is invalidate */ - unsigned int irq; - - struct rk29camera_platform_data *pdata; - struct resource *res; - - struct list_head capture; - - spinlock_t lock; - - struct videobuf_buffer *active1; - struct videobuf_buffer *active2; - struct videobuf_queue *vb_vidq_ptr; - struct rk29_camera_reg reginfo_suspend; - - struct hrtimer frame_timer; -}; -static DEFINE_MUTEX(camera_lock); -static const char *rk29_cam_driver_description = "RK29_Camera"; -static struct rk29_camera_dev *rk29_camdev_info_ptr; -static int rk29_first; - -static int rk29_camera_s_stream(struct soc_camera_device *icd, int enable); - - -/* - * Videobuf operations - */ -static int rk29_videobuf_setup(struct videobuf_queue *vq, unsigned int *count, - unsigned int *size) -{ - struct soc_camera_device *icd = vq->priv_data; - int bytes_per_pixel = (icd->current_fmt->depth + 7) >> 3; - - dev_dbg(&icd->dev, "count=%d, size=%d\n", *count, *size); - - /* planar capture requires Y, U and V buffers to be page aligned */ - *size = PAGE_ALIGN( icd->user_width * icd->user_height * bytes_per_pixel); /* Y pages UV pages, yuv422*/ - - RK29CAMERA_DG("\n%s..%d.. size = %d\n",__FUNCTION__,__LINE__, *size); - - return 0; -} -static void rk29_videobuf_free(struct videobuf_queue *vq, struct rk29_buffer *buf) -{ - struct soc_camera_device *icd = vq->priv_data; - - dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %zd\n", __func__, - &buf->vb, buf->vb.baddr, buf->vb.bsize); - - /* ddl@rock-chips.com: buf_release called soc_camera_streamoff and soc_camera_close*/ - if (buf->vb.state == VIDEOBUF_NEEDS_INIT) - return; - - if (in_interrupt()) - BUG(); - - videobuf_dma_contig_free(vq, &buf->vb); - dev_dbg(&icd->dev, "%s freed\n", __func__); - buf->vb.state = VIDEOBUF_NEEDS_INIT; - return; -} -static int rk29_videobuf_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb, enum v4l2_field field) -{ - struct soc_camera_device *icd = vq->priv_data; - struct rk29_buffer *buf; - int ret; - - buf = container_of(vb, struct rk29_buffer, vb); - - dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %zd\n", __func__, - vb, vb->baddr, vb->bsize); - - //RK29CAMERA_TR("\n%s..%d.. \n",__FUNCTION__,__LINE__); - - /* Added list head initialization on alloc */ - WARN_ON(!list_empty(&vb->queue)); - - /* This can be useful if you want to see if we actually fill - * the buffer with something */ - //memset((void *)vb->baddr, 0xaa, vb->bsize); - - BUG_ON(NULL == icd->current_fmt); - - if (buf->fmt != icd->current_fmt || - vb->width != icd->user_width || - vb->height != icd->user_height || - vb->field != field) { - buf->fmt = icd->current_fmt; - vb->width = icd->user_width; - vb->height = icd->user_height; - vb->field = field; - vb->state = VIDEOBUF_NEEDS_INIT; - } - - vb->size = vb->width * vb->height * ((buf->fmt->depth + 7) >> 3) ; /* ddl@rock-chips.com : fmt->depth is coorect */ - if (0 != vb->baddr && vb->bsize < vb->size) { - ret = -EINVAL; - goto out; - } - - if (vb->state == VIDEOBUF_NEEDS_INIT) { - ret = videobuf_iolock(vq, vb, NULL); - if (ret) { - goto fail; - } - vb->state = VIDEOBUF_PREPARED; - } - return 0; -fail: - rk29_videobuf_free(vq, buf); -out: - return ret; -} - -static inline void rk29_videobuf_capture(struct videobuf_buffer *vb) -{ - unsigned int size; - int fb_sr; - struct rk29_camera_dev *pcdev = rk29_camdev_info_ptr; - - if (vb) { - size = vb->width * vb->height; /* Y pages UV pages, yuv422*/ - fb_sr = read_vip_reg(RK29_VIP_FB_SR); - if (fb_sr & VIP_F1_READY) { - write_vip_reg(RK29_VIP_CAPTURE_F1SA_Y, vb->boff); - write_vip_reg(RK29_VIP_CAPTURE_F1SA_UV, vb->boff + size); - write_vip_reg(RK29_VIP_FB_SR, read_vip_reg(RK29_VIP_FB_SR)&(~VIP_F1_READY)); - pcdev->active1 = vb; - RK29CAMERA_DG("f1 Start.. vb->boff:0x%x f2 vb->boff:0x%x FB_SR:0x%x, active1:0x%x, active2:0x%x\n",(unsigned int)vb->boff,read_vip_reg(RK29_VIP_CAPTURE_F2SA_Y), read_vip_reg(RK29_VIP_FB_SR)&0x03, - (unsigned int)pcdev->active1,(unsigned int)pcdev->active2); - } else if (fb_sr & VIP_F2_READY) { - write_vip_reg(RK29_VIP_CAPTURE_F2SA_Y, vb->boff); - write_vip_reg(RK29_VIP_CAPTURE_F2SA_UV, vb->boff + size); - write_vip_reg(RK29_VIP_FB_SR, read_vip_reg(RK29_VIP_FB_SR)&(~VIP_F2_READY)); - pcdev->active2 = vb; - RK29CAMERA_DG("f2 Start..vb->boff:0x%x f1 vb->boff:0x%x FB_SR:0x%x, active1:0x%x, active2:0x%x\n",(unsigned int)vb->boff,read_vip_reg(RK29_VIP_CAPTURE_F1SA_Y), read_vip_reg(RK29_VIP_FB_SR)&0x03, - (unsigned int)pcdev->active1,(unsigned int)pcdev->active2); - } - } -} -/* Locking: Caller holds q->irqlock */ -static void rk29_videobuf_queue(struct videobuf_queue *vq, - struct videobuf_buffer *vb) -{ - struct soc_camera_device *icd = vq->priv_data; - struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); - struct rk29_camera_dev *pcdev = ici->priv; - unsigned int size; - - dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %zd\n", __func__, - vb, vb->baddr, vb->bsize); - - vb->state = VIDEOBUF_QUEUED; - - if (!list_empty(&pcdev->capture)) { - list_add_tail(&vb->queue, &pcdev->capture); - } else { - if (list_entry(pcdev->capture.next, struct videobuf_buffer, queue) != vb) - list_add_tail(&vb->queue, &pcdev->capture); - else - BUG(); /* ddl@rock-chips.com : The same videobuffer queue again */ - } - - if (!pcdev->active1) { - rk29_videobuf_capture(vb); - } -} -static irqreturn_t rk29_camera_irq(int irq, void *data) -{ - struct rk29_camera_dev *pcdev = data; - struct videobuf_buffer *vb=NULL,**nxt_active,**active; - struct list_head *next_head; - int fb_sr,vip_ctrl; - - read_vip_reg(RK29_VIP_INT_STS); /* clear vip interrupte single */ - - /* ddl@rock-chps.com : Current VIP is run in One Frame Mode, Frame 1 is validate */ - fb_sr = read_vip_reg(RK29_VIP_FB_SR); - vip_ctrl = read_vip_reg(RK29_VIP_CTRL); - if (fb_sr & (VIP_F1_READY|VIP_F2_READY)) { - #if 0 - if (pcdev->frame_inval>0) { - if (((fb_sr & (VIP_F1_READY|VIP_F2_READY)) == (VIP_F1_READY|VIP_F2_READY)) && (vip_ctrl & PING_PONG)){ - write_vip_reg(RK29_VIP_FB_SR, read_vip_reg(RK29_VIP_FB_SR)&(~(VIP_F1_READY|VIP_F2_READY))); - pcdev->frame_inval -= 2; - } else if (fb_sr & VIP_F1_READY) { - write_vip_reg(RK29_VIP_FB_SR, read_vip_reg(RK29_VIP_FB_SR)&(~VIP_F1_READY)); - pcdev->frame_inval--; - } else if ((fb_sr & VIP_F2_READY) && (vip_ctrl & PING_PONG)) { - write_vip_reg(RK29_VIP_FB_SR, read_vip_reg(RK29_VIP_FB_SR)&(~VIP_F2_READY)); - pcdev->frame_inval--; - } - - if (pcdev->frame_inval>=0) - goto RK29_CAMERA_IRQ_END; - } else if (pcdev->frame_inval) { - RK29CAMERA_TR("frame_inval : %0x",pcdev->frame_inval); - pcdev->frame_inval = 0; - } - - - if (((fb_sr & (VIP_F1_READY|VIP_F2_READY)) == (VIP_F1_READY|VIP_F2_READY)) && (vip_ctrl & PING_PONG)) { - if ((read_vip_reg(RK29_VIP_FB_SR)&VIP_F2_IS_LATEST) == VIP_F2_IS_LATEST) { - vb = pcdev->active2; - write_vip_reg(RK29_VIP_FB_SR, read_vip_reg(RK29_VIP_FB_SR)&(~VIP_F1_READY)); - } else { - vb = pcdev->active1; - write_vip_reg(RK29_VIP_FB_SR, read_vip_reg(RK29_VIP_FB_SR)&(~VIP_F2_READY)); - } - } else - #endif - - if (fb_sr & VIP_F1_READY) { - vb = pcdev->active1; - if (rk29_first == 0) { - rk29_first = 1; - list_del_init(&vb->queue); - write_vip_reg(RK29_VIP_FB_SR, read_vip_reg(RK29_VIP_FB_SR)&(~VIP_F1_READY)); - goto RK29_CAMERA_IRQ_END1; - } - } else if ((fb_sr & VIP_F2_READY) && (vip_ctrl & PING_PONG)) { - vb = pcdev->active2; - } - - if (!vb) { - goto RK29_CAMERA_IRQ_END; - } - - /* ddl@rock-chips.com : this vb may be deleted from queue */ - if ((vb->state == VIDEOBUF_QUEUED) || (vb->state == VIDEOBUF_ACTIVE)) { - list_del_init(&vb->queue); - - vb->state = VIDEOBUF_DONE; - do_gettimeofday(&vb->ts); - vb->field_count++; - } - - wake_up(&vb->done); -RK29_CAMERA_IRQ_END1: - hrtimer_start(&pcdev->frame_timer, - ktime_set(0, 10000), - HRTIMER_MODE_REL); - } - -RK29_CAMERA_IRQ_END: - return IRQ_HANDLED; -} - - -static enum hrtimer_restart rk29_camera_timer_func(struct hrtimer *timer) -{ - struct rk29_camera_dev *pcdev = container_of(timer, struct rk29_camera_dev, frame_timer); - struct videobuf_buffer *vb=NULL,**nxt_active; - int fb_sr; - - fb_sr = read_vip_reg(RK29_VIP_FB_SR); - if (fb_sr & VIP_F1_READY) { - nxt_active = &pcdev->active1; - } else if (fb_sr & VIP_F2_READY) { - nxt_active = &pcdev->active2; - } - - *nxt_active = NULL; - if (!list_empty(&pcdev->capture)) { - *nxt_active = list_entry(pcdev->capture.next, struct videobuf_buffer, queue); - if (*nxt_active) { - rk29_videobuf_capture(*nxt_active); - list_del_init(&(*nxt_active)->queue); - } - } - - if (*nxt_active == NULL) { - RK29CAMERA_DG("%s video_buf queue is empty!\n",__FUNCTION__); - } - - return HRTIMER_NORESTART; -} - -static void rk29_videobuf_release(struct videobuf_queue *vq, - struct videobuf_buffer *vb) -{ - struct rk29_buffer *buf = container_of(vb, struct rk29_buffer, vb); - struct soc_camera_device *icd = vq->priv_data; - struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); - struct rk29_camera_dev *pcdev = ici->priv; - -#ifdef DEBUG - dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__, - vb, vb->baddr, vb->bsize); - - switch (vb->state) - { - case VIDEOBUF_ACTIVE: - dev_dbg(&icd->dev, "%s (active)\n", __func__); - break; - case VIDEOBUF_QUEUED: - dev_dbg(&icd->dev, "%s (queued)\n", __func__); - break; - case VIDEOBUF_PREPARED: - dev_dbg(&icd->dev, "%s (prepared)\n", __func__); - break; - default: - dev_dbg(&icd->dev, "%s (unknown)\n", __func__); - break; - } -#endif - if ((vb == pcdev->active1) || (vb == pcdev->active2)) { - RK29CAMERA_DG("%s Wait for this video buf(0x%x) write finished!\n ",__FUNCTION__,(unsigned int)vb); - interruptible_sleep_on_timeout(&vb->done, 100); - RK29CAMERA_DG("%s This video buf(0x%x) write finished, release now!!\n",__FUNCTION__,(unsigned int)vb); - } - rk29_videobuf_free(vq, buf); -} - -static struct videobuf_queue_ops rk29_videobuf_ops = -{ - .buf_setup = rk29_videobuf_setup, - .buf_prepare = rk29_videobuf_prepare, - .buf_queue = rk29_videobuf_queue, - .buf_release = rk29_videobuf_release, -}; - -static void rk29_camera_init_videobuf(struct videobuf_queue *q, - struct soc_camera_device *icd) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); - struct rk29_camera_dev *pcdev = ici->priv; - - /* We must pass NULL as dev pointer, then all pci_* dma operations - * transform to normal dma_* ones. */ - videobuf_queue_dma_contig_init(q, - &rk29_videobuf_ops, - ici->v4l2_dev.dev, &pcdev->lock, - V4L2_BUF_TYPE_VIDEO_CAPTURE, - V4L2_FIELD_NONE, - sizeof(struct rk29_buffer), - icd); - pcdev->vb_vidq_ptr = q; /* ddl@rock-chips.com */ -} -static int rk29_camera_activate(struct rk29_camera_dev *pcdev, struct soc_camera_device *icd) -{ - unsigned long sensor_bus_flags = SOCAM_MCLK_24MHZ; - struct clk *parent; - - RK29CAMERA_DG("\n%s..%d.. \n",__FUNCTION__,__LINE__); - if (!pcdev->clk || IS_ERR(pcdev->clk)) - RK29CAMERA_TR(KERN_ERR "failed to get vip_clk source\n"); - - //if (icd->ops->query_bus_param) /* ddl@rock-chips.com : Query Sensor's xclk */ - //sensor_bus_flags = icd->ops->query_bus_param(icd); - - if (sensor_bus_flags & SOCAM_MCLK_48MHZ) { - parent = clk_get(NULL, "clk48m"); - if (!parent || IS_ERR(parent)) - goto RK29_CAMERA_ACTIVE_ERR; - } else if (sensor_bus_flags & SOCAM_MCLK_27MHZ) { - parent = clk_get(NULL, "extclk"); - if (!parent || IS_ERR(parent)) - goto RK29_CAMERA_ACTIVE_ERR; - } else { - parent = clk_get(NULL, "xin24m"); - if (!parent || IS_ERR(parent)) - goto RK29_CAMERA_ACTIVE_ERR; - } - - clk_set_parent(pcdev->clk, parent); - - clk_enable(pcdev->clk); - rk29_mux_api_set(GPIO1B4_VIPCLKOUT_NAME, GPIO1L_VIP_CLKOUT); - ndelay(10); - - //write_grf_reg(GRF_SOC_CON0_Reg, read_grf_reg(GRF_SOC_CON0_Reg)|VIP_AHBMASTER); //VIP Config to AHB - write_grf_reg(GRF_SOC_CON0_Reg, read_grf_reg(GRF_SOC_CON0_Reg)&(~VIP_AHBMASTER)); //VIP Config to AXI - write_grf_reg(GRF_OS_REG0, read_grf_reg(GRF_OS_REG0)&(~VIP_ACLK_DIV_HCLK_2)); //aclk:hclk = 1:1 - //write_grf_reg(GRF_OS_REG0, read_grf_reg(GRF_OS_REG0)|VIP_ACLK_DIV_HCLK_2); //aclk:hclk = 2:1 - - write_vip_reg(RK29_VIP_RESET, 0x76543210); /* ddl@rock-chips.com : vip software reset */ - udelay(10); - - write_vip_reg(RK29_VIP_AHBR_CTRL, 0x07); /* ddl@rock-chips.com : vip ahb burst 16 */ - write_vip_reg(RK29_VIP_INT_MASK, 0x01); //capture complete interrupt enable - write_vip_reg(RK29_VIP_CRM, 0x00000000); //Y/CB/CR color modification - - return 0; -RK29_CAMERA_ACTIVE_ERR: - return -ENODEV; -} - -static void rk29_camera_deactivate(struct rk29_camera_dev *pcdev) -{ - pcdev->active1 = NULL; - pcdev->active2 = NULL; - - write_vip_reg(RK29_VIP_CTRL, 0); - read_vip_reg(RK29_VIP_INT_STS); //clear vip interrupte single - - rk29_mux_api_set(GPIO1B4_VIPCLKOUT_NAME, GPIO1L_GPIO1B4); - clk_disable(pcdev->clk); - - return; -} - -/* The following two functions absolutely depend on the fact, that - * there can be only one camera on RK28 quick capture interface */ -static int rk29_camera_add_device(struct soc_camera_device *icd) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); - struct rk29_camera_dev *pcdev = ici->priv; - struct device *control = to_soc_camera_control(icd); - struct v4l2_subdev *sd; - int ret; - - mutex_lock(&camera_lock); - - if (pcdev->icd) { - ret = -EBUSY; - goto ebusy; - } - - dev_info(&icd->dev, "RK29 Camera driver attached to camera %d\n", - icd->devnum); - - pcdev->frame_inval = RK29_CAM_FRAME_INVAL_INIT; - pcdev->active1 = NULL; - pcdev->active2 = NULL; - pcdev->icd = NULL; - pcdev->reginfo_suspend.Inval = Reg_Invalidate; - /* ddl@rock-chips.com: capture list must be reset, because this list may be not empty, - * if app havn't dequeue all videobuf before close camera device; - */ - INIT_LIST_HEAD(&pcdev->capture); - - ret = rk29_camera_activate(pcdev,icd); - if (ret) - goto ebusy; - - /* ddl@rock-chips.com : v4l2_subdev is not created when ici->ops->add called in soc_camera_probe */ - if (control) { - sd = dev_get_drvdata(control); - ret = v4l2_subdev_call(sd,core, init, 0); - if (ret) - goto ebusy; - } - - pcdev->icd = icd; - -ebusy: - mutex_unlock(&camera_lock); - - return ret; -} -static void rk29_camera_remove_device(struct soc_camera_device *icd) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); - struct rk29_camera_dev *pcdev = ici->priv; - - BUG_ON(icd != pcdev->icd); - - dev_info(&icd->dev, "RK29 Camera driver detached from camera %d\n", - icd->devnum); - - rk29_camera_deactivate(pcdev); - - /* ddl@rock-chips.com: Call videobuf_mmap_free here for free the struct video_buffer which malloc in videobuf_alloc */ - if (pcdev->vb_vidq_ptr) { - videobuf_mmap_free(pcdev->vb_vidq_ptr); - pcdev->vb_vidq_ptr = NULL; - } - - pcdev->active1 = NULL; - pcdev->active2 = NULL; - pcdev->icd = NULL; - pcdev->reginfo_suspend.Inval = Reg_Invalidate; - /* ddl@rock-chips.com: capture list must be reset, because this list may be not empty, - * if app havn't dequeue all videobuf before close camera device; - */ - INIT_LIST_HEAD(&pcdev->capture); - - return; -} - -static int rk29_camera_set_bus_param(struct soc_camera_device *icd, __u32 pixfmt) -{ - unsigned long bus_flags, camera_flags, common_flags; - unsigned int vip_ctrl_val = 0; - int ret = 0; - - RK29CAMERA_DG("\n%s..%d..\n",__FUNCTION__,__LINE__); - - bus_flags = RK29_CAM_BUS_PARAM; - if (icd->ops->query_bus_param) - camera_flags = icd->ops->query_bus_param(icd); - else - camera_flags = 0; - - common_flags = soc_camera_bus_param_compatible(camera_flags, bus_flags); - if (!common_flags) { - ret = -EINVAL; - goto RK29_CAMERA_SET_BUS_PARAM_END; - } - - ret = icd->ops->set_bus_param(icd, common_flags); - if (ret < 0) - goto RK29_CAMERA_SET_BUS_PARAM_END; - - if (common_flags & SOCAM_DATAWIDTH_8) { - icd->buswidth = 8; - } else if (common_flags & SOCAM_DATAWIDTH_10) { - icd->buswidth = 10; - } - - vip_ctrl_val = read_vip_reg(RK29_VIP_CTRL); - if (common_flags & SOCAM_PCLK_SAMPLE_FALLING) { - vip_ctrl_val |= NEGATIVE_EDGE; - } else { - vip_ctrl_val &= ~NEGATIVE_EDGE; - } - if (common_flags & SOCAM_HSYNC_ACTIVE_LOW) { - vip_ctrl_val |= HSY_LOW_ACTIVE; - } else { - vip_ctrl_val &= ~HSY_LOW_ACTIVE; - } - if (common_flags & SOCAM_VSYNC_ACTIVE_HIGH) { - vip_ctrl_val |= VSY_HIGH_ACTIVE; - } else { - vip_ctrl_val &= ~VSY_HIGH_ACTIVE; - } - - /* ddl@rock-chips.com : Don't enable capture here, enable in stream_on */ - //vip_ctrl_val |= ENABLE_CAPTURE; - - write_vip_reg(RK29_VIP_CTRL, vip_ctrl_val); - RK29CAMERA_DG("\n%s..CtrReg=%x \n",__FUNCTION__,read_vip_reg(RK29_VIP_CTRL)); - -RK29_CAMERA_SET_BUS_PARAM_END: - if (ret) - RK29CAMERA_TR("\n%s..%d.. ret = %d \n",__FUNCTION__,__LINE__, ret); - return ret; -} - -static int rk29_camera_try_bus_param(struct soc_camera_device *icd, __u32 pixfmt) -{ - unsigned long bus_flags, camera_flags; - int ret; - - bus_flags = RK29_CAM_BUS_PARAM; - if (icd->ops->query_bus_param) { - camera_flags = icd->ops->query_bus_param(icd); - } else { - camera_flags = 0; - } - ret = soc_camera_bus_param_compatible(camera_flags, bus_flags) ; - - if (ret < 0) - dev_warn(icd->dev.parent, - "Flags incompatible: camera %lx, host %lx\n", - camera_flags, bus_flags); - return ret; -} -static const struct soc_camera_data_format rk29_camera_formats[] = { - { - .name = "Planar YUV420 12 bit", - .depth = 12, - .fourcc = V4L2_PIX_FMT_YUV420, - .colorspace = V4L2_COLORSPACE_JPEG, - },{ - .name = "Planar YUV422 16 bit", - .depth = 16, - .fourcc = V4L2_PIX_FMT_YUV422P, - .colorspace = V4L2_COLORSPACE_JPEG, - },{ - .name = "Raw Bayer RGB 10 bit", - .depth = 16, - .fourcc = V4L2_PIX_FMT_SGRBG10, - .colorspace = V4L2_COLORSPACE_SRGB, - } -}; - -static void rk29_camera_setup_format(struct soc_camera_device *icd, __u32 host_pixfmt, __u32 cam_pixfmt, struct v4l2_rect *rect) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); - struct rk29_camera_dev *pcdev = ici->priv; - unsigned int vip_fs = 0,vip_crop = 0; - unsigned int vip_ctrl_val = VIP_SENSOR|PING_PONG|DISABLE_CAPTURE; - - switch (host_pixfmt) - { - case V4L2_PIX_FMT_YUV422P: - vip_ctrl_val |= VIPREGYUV422; - pcdev->frame_inval = RK29_CAM_FRAME_INVAL_DC; - break; - case V4L2_PIX_FMT_YUV420: - vip_ctrl_val |= VIPREGYUV420; - if (pcdev->frame_inval != RK29_CAM_FRAME_INVAL_INIT) - pcdev->frame_inval = RK29_CAM_FRAME_INVAL_INIT; - break; - case V4L2_PIX_FMT_SGRBG10: - vip_ctrl_val |= (VIP_RAW | VIP_SENSOR | VIP_DATA_LITTLEEND); - pcdev->frame_inval = RK29_CAM_FRAME_INVAL_DC; - break; - default: /* ddl@rock-chips.com : vip output format is hold when pixfmt is invalidate */ - vip_ctrl_val |= (read_vip_reg(RK29_VIP_CTRL) & VIPREGYUV422); - break; - } - - switch (cam_pixfmt) - { - case V4L2_PIX_FMT_UYVY: - vip_ctrl_val |= SENSOR_UYVY; - break; - case V4L2_PIX_FMT_YUYV: - vip_ctrl_val |= SENSOR_YUYV; - break; - default : - vip_ctrl_val |= (read_vip_reg(RK29_VIP_CTRL) & SENSOR_YUYV); - break; - } - - write_vip_reg(RK29_VIP_CTRL, vip_ctrl_val); /* ddl@rock-chips.com: VIP capture mode and capture format must be set before FS register set */ - - read_vip_reg(RK29_VIP_INT_STS); /* clear vip interrupte single */ - - if (vip_ctrl_val & ONEFRAME) { - vip_crop = ((rect->left<<16) + rect->top); - vip_fs = (((rect->width + rect->left)<<16) + (rect->height+rect->top)); - } else if (vip_ctrl_val & PING_PONG) { - if (rect->left ||rect->top ) { - RK29CAMERA_DG("\n %s..PingPang not support Crop \n",__FUNCTION__); - BUG(); - } - vip_crop = 0; - vip_fs = (((rect->width + rect->left)<<16) + (rect->height+rect->top)); - } - - write_vip_reg(RK29_VIP_CROP, vip_crop); - write_vip_reg(RK29_VIP_FS, vip_fs); - - write_vip_reg(RK29_VIP_FB_SR, (VIP_F2_READY|VIP_F1_READY)); - - RK29CAMERA_DG("\n%s.. crop:0x%x fs:0x%x CtrlReg:0x%x\n",__FUNCTION__,vip_crop,vip_fs,read_vip_reg(RK29_VIP_CTRL)); - return; -} - -static int rk29_camera_get_formats(struct soc_camera_device *icd, int idx, - struct soc_camera_format_xlate *xlate) -{ - struct device *dev = icd->dev.parent; - int formats = 0, buswidth, ret; - - buswidth = 8; - - ret = rk29_camera_try_bus_param(icd, buswidth); - if (ret < 0) - return 0; - - switch (icd->formats[idx].fourcc) { - case V4L2_PIX_FMT_UYVY: - case V4L2_PIX_FMT_YUYV: - formats++; - if (xlate) { - xlate->host_fmt = &rk29_camera_formats[0]; - xlate->cam_fmt = icd->formats + idx; - xlate->buswidth = buswidth; - xlate++; - dev_dbg(dev, "Providing format %s using %s\n", - rk29_camera_formats[0].name, - icd->formats[idx].name); - } - - formats++; - if (xlate) { - xlate->host_fmt = &rk29_camera_formats[1]; - xlate->cam_fmt = icd->formats + idx; - xlate->buswidth = buswidth; - xlate++; - dev_dbg(dev, "Providing format %s using %s\n", - rk29_camera_formats[1].name, - icd->formats[idx].name); - } - break; - case V4L2_PIX_FMT_SGRBG10: - formats++; - if (xlate) { - xlate->host_fmt = &rk29_camera_formats[2]; - xlate->cam_fmt = icd->formats + idx; - xlate->buswidth = 10; - xlate++; - dev_dbg(dev, "Providing format %s using %s\n", - rk29_camera_formats[2].name, - icd->formats[idx].name); - } - break; - default: - break; - } - - return formats; -} - -static void rk29_camera_put_formats(struct soc_camera_device *icd) -{ - return; -} - -static int rk29_camera_set_crop(struct soc_camera_device *icd, - struct v4l2_crop *a) -{ - struct v4l2_subdev *sd = soc_camera_to_subdev(icd); - struct v4l2_format f; - struct v4l2_pix_format *pix = &f.fmt.pix; - int ret; - - f.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - - ret = v4l2_subdev_call(sd, video, g_fmt, &f); - if (ret < 0) - return ret; - - if ((pix->width < (a->c.left + a->c.width)) || (pix->height < (a->c.top + a->c.height))) { - - pix->width = a->c.left + a->c.width; - pix->height = a->c.top + a->c.height; - - v4l_bound_align_image(&pix->width, RK29_CAM_W_MIN, RK29_CAM_W_MAX, 1, - &pix->height, RK29_CAM_H_MIN, RK29_CAM_H_MAX, 0, - icd->current_fmt->fourcc == V4L2_PIX_FMT_YUV422P ?4 : 0); - - ret = v4l2_subdev_call(sd, video, s_fmt, &f); - if (ret < 0) - return ret; - } - - rk29_camera_setup_format(icd, icd->current_fmt->fourcc, pix->pixelformat, &a->c); - - icd->user_width = pix->width; - icd->user_height = pix->height; - - return 0; -} - -static int rk29_camera_set_fmt(struct soc_camera_device *icd, - struct v4l2_format *f) -{ - struct device *dev = icd->dev.parent; - struct v4l2_subdev *sd = soc_camera_to_subdev(icd); - const struct soc_camera_data_format *cam_fmt = NULL; - const struct soc_camera_format_xlate *xlate = NULL; - struct v4l2_pix_format *pix = &f->fmt.pix; - struct v4l2_format cam_f = *f; - struct v4l2_rect rect; - int ret; - - RK29CAMERA_DG("\n%s..%d.. \n",__FUNCTION__,__LINE__); - - xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat); - if (!xlate) { - dev_err(dev, "Format %x not found\n", pix->pixelformat); - ret = -EINVAL; - goto RK29_CAMERA_SET_FMT_END; - } - - cam_fmt = xlate->cam_fmt; - - cam_f.fmt.pix.pixelformat = cam_fmt->fourcc; - ret = v4l2_subdev_call(sd, video, s_fmt, &cam_f); - cam_f.fmt.pix.pixelformat = pix->pixelformat; - *pix = cam_f.fmt.pix; - - icd->sense = NULL; - - if (!ret) { - rect.left = 0; - rect.top = 0; - rect.width = pix->width; - rect.height = pix->height; - - RK29CAMERA_DG("\n%s..%s..%s \n",__FUNCTION__,xlate->host_fmt->name, cam_fmt->name); - rk29_camera_setup_format(icd, pix->pixelformat, cam_fmt->fourcc, &rect); - - icd->buswidth = xlate->buswidth; - icd->current_fmt = xlate->host_fmt; - } - -RK29_CAMERA_SET_FMT_END: - if (ret) - RK29CAMERA_TR("\n%s..%d.. ret = %d \n",__FUNCTION__,__LINE__, ret); - return ret; -} - -static int rk29_camera_try_fmt(struct soc_camera_device *icd, - struct v4l2_format *f) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); - struct v4l2_subdev *sd = soc_camera_to_subdev(icd); - const struct soc_camera_format_xlate *xlate; - struct v4l2_pix_format *pix = &f->fmt.pix; - __u32 pixfmt = pix->pixelformat; - enum v4l2_field field; - int ret; - - RK29CAMERA_DG("\n%s..%d.. \n",__FUNCTION__,__LINE__); - - xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); - if (!xlate) { - dev_err(ici->v4l2_dev.dev, "Format %x not found\n", pixfmt); - ret = -EINVAL; - goto RK29_CAMERA_TRY_FMT_END; - } - /* limit to rk29 hardware capabilities */ - v4l_bound_align_image(&pix->width, RK29_CAM_W_MIN, RK29_CAM_W_MAX, 1, - &pix->height, RK29_CAM_H_MIN, RK29_CAM_H_MAX, 0, - pixfmt == V4L2_PIX_FMT_YUV422P ? 4 : 0); - - pix->bytesperline = pix->width * DIV_ROUND_UP(xlate->host_fmt->depth, 8); - pix->sizeimage = pix->height * pix->bytesperline; - - /* camera has to see its format, but the user the original one */ - pix->pixelformat = xlate->cam_fmt->fourcc; - /* limit to sensor capabilities */ - ret = v4l2_subdev_call(sd, video, try_fmt, f); - pix->pixelformat = pixfmt; - - field = pix->field; - - if (field == V4L2_FIELD_ANY) { - pix->field = V4L2_FIELD_NONE; - } else if (field != V4L2_FIELD_NONE) { - dev_err(icd->dev.parent, "Field type %d unsupported.\n", field); - ret = -EINVAL; - goto RK29_CAMERA_TRY_FMT_END; - } - -RK29_CAMERA_TRY_FMT_END: - if (ret) - RK29CAMERA_TR("\n%s..%d.. ret = %d \n",__FUNCTION__,__LINE__, ret); - return ret; -} - -static int rk29_camera_reqbufs(struct soc_camera_file *icf, - struct v4l2_requestbuffers *p) -{ - int i; - - /* This is for locking debugging only. I removed spinlocks and now I - * check whether .prepare is ever called on a linked buffer, or whether - * a dma IRQ can occur for an in-work or unlinked buffer. Until now - * it hadn't triggered */ - for (i = 0; i < p->count; i++) { - struct rk29_buffer *buf = container_of(icf->vb_vidq.bufs[i], - struct rk29_buffer, vb); - buf->inwork = 0; - INIT_LIST_HEAD(&buf->vb.queue); - } - - return 0; -} - -static unsigned int rk29_camera_poll(struct file *file, poll_table *pt) -{ - struct soc_camera_file *icf = file->private_data; - struct rk29_buffer *buf; - - buf = list_entry(icf->vb_vidq.stream.next, struct rk29_buffer, - vb.stream); - - poll_wait(file, &buf->vb.done, pt); - - if (buf->vb.state == VIDEOBUF_DONE || - buf->vb.state == VIDEOBUF_ERROR) - return POLLIN|POLLRDNORM; - - return 0; -} - -static int rk29_camera_querycap(struct soc_camera_host *ici, - struct v4l2_capability *cap) -{ - /* cap->name is set by the firendly caller:-> */ - strlcpy(cap->card, rk29_cam_driver_description, sizeof(cap->card)); - cap->version = RK29_CAM_VERSION_CODE; - cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING; - - return 0; -} - -static int rk29_camera_suspend(struct soc_camera_device *icd, pm_message_t state) -{ - struct soc_camera_host *ici = - to_soc_camera_host(icd->dev.parent); - struct rk29_camera_dev *pcdev = ici->priv; - int ret = 0,tmp; - - if ((pcdev->icd == icd) && (icd->ops->suspend)) { - rk29_camera_s_stream(icd, 0); - ret = icd->ops->suspend(icd, state); - - pcdev->reginfo_suspend.VipCtrl = read_vip_reg(RK29_VIP_CTRL); - pcdev->reginfo_suspend.VipCrop = read_vip_reg(RK29_VIP_CROP); - pcdev->reginfo_suspend.VipFs = read_vip_reg(RK29_VIP_FS); - pcdev->reginfo_suspend.VipIntMsk = read_vip_reg(RK29_VIP_INT_MASK); - pcdev->reginfo_suspend.VipCrm = read_vip_reg(RK29_VIP_CRM); - - tmp = pcdev->reginfo_suspend.VipFs>>16; /* ddl@rock-chips.com */ - tmp += pcdev->reginfo_suspend.VipCrop>>16; - pcdev->reginfo_suspend.VipFs = (pcdev->reginfo_suspend.VipFs & 0xffff) | (tmp<<16); - - pcdev->reginfo_suspend.Inval = Reg_Validate; - rk29_camera_deactivate(pcdev); - - RK29CAMERA_DG("%s Enter Success...\n", __FUNCTION__); - } else { - RK29CAMERA_DG("%s icd has been deattach, don't need enter suspend\n", __FUNCTION__); - } - - return ret; -} - -static int rk29_camera_resume(struct soc_camera_device *icd) -{ - struct soc_camera_host *ici = - to_soc_camera_host(icd->dev.parent); - struct rk29_camera_dev *pcdev = ici->priv; - int ret = 0; - - if ((pcdev->icd == icd) && (icd->ops->resume)) { - if (pcdev->reginfo_suspend.Inval == Reg_Validate) { - rk29_camera_activate(pcdev, icd); - write_vip_reg(RK29_VIP_INT_MASK, pcdev->reginfo_suspend.VipIntMsk); - write_vip_reg(RK29_VIP_CRM, pcdev->reginfo_suspend.VipCrm); - write_vip_reg(RK29_VIP_CTRL, pcdev->reginfo_suspend.VipCtrl&~ENABLE_CAPTURE); - write_vip_reg(RK29_VIP_CROP, pcdev->reginfo_suspend.VipCrop); - write_vip_reg(RK29_VIP_FS, pcdev->reginfo_suspend.VipFs); - write_vip_reg(RK29_VIP_FB_SR, (VIP_F2_READY|VIP_F1_READY)); - - if (pcdev->active1) - rk29_videobuf_capture(pcdev->active1); - - if (pcdev->active2) - rk29_videobuf_capture(pcdev->active2); - - rk29_camera_s_stream(icd, 1); - } - ret = icd->ops->resume(icd); - - RK29CAMERA_DG("%s Enter success\n",__FUNCTION__); - } else { - RK29CAMERA_DG("%s icd has been deattach, don't need enter resume\n", __FUNCTION__); - } - - return ret; -} - -static int rk29_camera_s_stream(struct soc_camera_device *icd, int enable) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); - struct rk29_camera_dev *pcdev = ici->priv; - int vip_ctrl_val; - - WARN_ON(pcdev->icd != icd); - - vip_ctrl_val = read_vip_reg(RK29_VIP_CTRL); - if (enable) { - vip_ctrl_val |= ENABLE_CAPTURE; - } else { - vip_ctrl_val &= ~ENABLE_CAPTURE; - } - write_vip_reg(RK29_VIP_CTRL, vip_ctrl_val); - - RK29CAMERA_DG("%s.. enable : %d\n", __FUNCTION__, enable); - return 0; -} - -static struct soc_camera_host_ops rk29_soc_camera_host_ops = -{ - .owner = THIS_MODULE, - .add = rk29_camera_add_device, - .remove = rk29_camera_remove_device, - .suspend = rk29_camera_suspend, - .resume = rk29_camera_resume, - .set_crop = rk29_camera_set_crop, - .get_formats = rk29_camera_get_formats, - .put_formats = rk29_camera_put_formats, - .set_fmt = rk29_camera_set_fmt, - .try_fmt = rk29_camera_try_fmt, - .init_videobuf = rk29_camera_init_videobuf, - .reqbufs = rk29_camera_reqbufs, - .poll = rk29_camera_poll, - .querycap = rk29_camera_querycap, - .set_bus_param = rk29_camera_set_bus_param, - .s_stream = rk29_camera_s_stream /* ddl@rock-chips.com : Add stream control for host */ -}; -static int rk29_camera_probe(struct platform_device *pdev) -{ - struct rk29_camera_dev *pcdev; - struct resource *res; - int irq; - int err = 0; - - RK29CAMERA_DG("\n%s..%s..%d \n",__FUNCTION__,__FILE__,__LINE__); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - irq = platform_get_irq(pdev, 0); - if (!res || irq < 0) { - err = -ENODEV; - goto exit; - } - - pcdev = kzalloc(sizeof(*pcdev), GFP_KERNEL); - if (!pcdev) { - dev_err(&pdev->dev, "Could not allocate pcdev\n"); - err = -ENOMEM; - goto exit_alloc; - } - rk29_camdev_info_ptr = pcdev; - - /*config output clk*/ - pcdev->clk = clk_get(&pdev->dev, "vip_out"); - if (!pcdev->clk || IS_ERR(pcdev->clk)) { - RK29CAMERA_TR(KERN_ERR "failed to get vip_clk source\n"); - err = -ENOENT; - goto exit_eclkget; - } - - dev_set_drvdata(&pdev->dev, pcdev); - pcdev->res = res; - - pcdev->pdata = pdev->dev.platform_data; /* ddl@rock-chips.com : Request IO in init function */ - if (pcdev->pdata && pcdev->pdata->io_init) { - pcdev->pdata->io_init(); - } - - INIT_LIST_HEAD(&pcdev->capture); - spin_lock_init(&pcdev->lock); - - /* - * Request the regions. - */ - if (!request_mem_region(res->start, res->end - res->start + 1, - RK29_CAM_DRV_NAME)) { - err = -EBUSY; - goto exit_reqmem; - } - - pcdev->base = ioremap(res->start, res->end - res->start + 1); - if (pcdev->base == NULL) { - dev_err(pcdev->dev, "ioremap() of registers failed\n"); - err = -ENXIO; - goto exit_ioremap; - } - - pcdev->irq = irq; - pcdev->dev = &pdev->dev; - - /* config buffer address */ - /* request irq */ - err = request_irq(pcdev->irq, rk29_camera_irq, 0, RK29_CAM_DRV_NAME, - pcdev); - if (err) { - dev_err(pcdev->dev, "Camera interrupt register failed \n"); - goto exit_reqirq; - } - - pcdev->soc_host.drv_name = RK29_CAM_DRV_NAME; - pcdev->soc_host.ops = &rk29_soc_camera_host_ops; - pcdev->soc_host.priv = pcdev; - pcdev->soc_host.v4l2_dev.dev = &pdev->dev; - pcdev->soc_host.nr = pdev->id; - - err = soc_camera_host_register(&pcdev->soc_host); - if (err) - goto exit_free_irq; - - hrtimer_init(&pcdev->frame_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - pcdev->frame_timer.function = rk29_camera_timer_func; - - RK29CAMERA_DG("\n%s..%s..%d \n",__FUNCTION__,__FILE__,__LINE__); - return 0; - -exit_free_irq: - free_irq(pcdev->irq, pcdev); -exit_reqirq: - iounmap(pcdev->base); -exit_ioremap: - release_mem_region(res->start, res->end - res->start + 1); -exit_reqmem: - clk_put(pcdev->clk); -exit_eclkget: - kfree(pcdev); -exit_alloc: - rk29_camdev_info_ptr = NULL; -exit: - return err; -} - -static int __devexit rk29_camera_remove(struct platform_device *pdev) -{ - struct rk29_camera_dev *pcdev = platform_get_drvdata(pdev); - struct resource *res; - - free_irq(pcdev->irq, pcdev); - - soc_camera_host_unregister(&pcdev->soc_host); - - res = pcdev->res; - release_mem_region(res->start, res->end - res->start + 1); - - if (pcdev->pdata && pcdev->pdata->io_deinit) { /* ddl@rock-chips.com : Free IO in deinit function */ - pcdev->pdata->io_deinit(); - } - - kfree(pcdev); - rk29_camdev_info_ptr = NULL; - dev_info(&pdev->dev, "RK28 Camera driver unloaded\n"); - - return 0; -} - -static struct platform_driver rk29_camera_driver = -{ - .driver = { - .name = RK29_CAM_DRV_NAME, - }, - .probe = rk29_camera_probe, - .remove = __devexit_p(rk29_camera_remove), -}; - - -static int __devinit rk29_camera_init(void) -{ - RK29CAMERA_DG("\n%s..%s..%d \n",__FUNCTION__,__FILE__,__LINE__); - return platform_driver_register(&rk29_camera_driver); -} - -static void __exit rk29_camera_exit(void) -{ - platform_driver_unregister(&rk29_camera_driver); -} - -device_initcall_sync(rk29_camera_init); -module_exit(rk29_camera_exit); - -MODULE_DESCRIPTION("RK29 Soc Camera Host driver"); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); diff --git a/drivers/media/video/rk30_camera_oneframe.c b/drivers/media/video/rk30_camera_oneframe.c deleted file mode 100644 index cbf31e02ecc0..000000000000 --- a/drivers/media/video/rk30_camera_oneframe.c +++ /dev/null @@ -1,3897 +0,0 @@ -/* - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#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 "../../video/rockchip/rga/rga.h" -#include "../../soc/rockchip/rk_camera.h" -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define CAMMODULE_NAME "rk_cam_cif" - -#define wprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_ERR "%s(%d): " fmt,CAMMODULE_NAME,__LINE__,## arg); } while (0) - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_ERR"%s(%d): " fmt,CAMMODULE_NAME,__LINE__,## arg); } while (0) - -#define RKCAMERA_TR(format, ...) printk(KERN_ERR "%s(%d):" format,CAMMODULE_NAME,__LINE__,## __VA_ARGS__) -#define RKCAMERA_DG1(format, ...) wprintk(1, format, ## __VA_ARGS__) -#define RKCAMERA_DG2(format, ...) dprintk(2, format, ## __VA_ARGS__) -#define debug_printk(format, ...) dprintk(3, format, ## __VA_ARGS__) - -/* CIF Reg Offset*/ -#define CIF_CIF_CTRL 0x00 -#define CIF_CIF_INTEN 0x04 -#define CIF_CIF_INTSTAT 0x08 -#define CIF_CIF_FOR 0x0c -#define CIF_CIF_LINE_NUM_ADDR 0x10 -#define CIF_CIF_FRM0_ADDR_Y 0x14 -#define CIF_CIF_FRM0_ADDR_UV 0x18 -#define CIF_CIF_FRM1_ADDR_Y 0x1c -#define CIF_CIF_FRM1_ADDR_UV 0x20 -#define CIF_CIF_VIR_LINE_WIDTH 0x24 -#define CIF_CIF_SET_SIZE 0x28 -#define CIF_CIF_SCM_ADDR_Y 0x2c -#define CIF_CIF_SCM_ADDR_U 0x30 -#define CIF_CIF_SCM_ADDR_V 0x34 -#define CIF_CIF_WB_UP_FILTER 0x38 -#define CIF_CIF_WB_LOW_FILTER 0x3c -#define CIF_CIF_WBC_CNT 0x40 -#define CIF_CIF_CROP 0x44 -#define CIF_CIF_SCL_CTRL 0x48 -#define CIF_CIF_SCL_DST 0x4c -#define CIF_CIF_SCL_FCT 0x50 -#define CIF_CIF_SCL_VALID_NUM 0x54 -#define CIF_CIF_LINE_LOOP_CTR 0x58 -#define CIF_CIF_FRAME_STATUS 0x60 -#define CIF_CIF_CUR_DST 0x64 -#define CIF_CIF_LAST_LINE 0x68 -#define CIF_CIF_LAST_PIX 0x6c - -/*The key register bit descrition*/ -/* CIF_CTRL Reg , ignore SCM,WBC,ISP,*/ -#define DISABLE_CAPTURE (0x00<<0) -#define ENABLE_CAPTURE (0x01<<0) -#define MODE_ONEFRAME (0x00<<1) -#define MODE_PINGPONG (0x01<<1) -#define MODE_LINELOOP (0x02<<1) -#define AXI_BURST_16 (0x0F << 12) - -/*CIF_CIF_INTEN*/ -#define FRAME_END_EN (0x01<<1) -#define BUS_ERR_EN (0x01<<6) -#define SCL_ERR_EN (0x01<<7) - -/*CIF_CIF_FOR*/ -#define VSY_HIGH_ACTIVE (0x01<<0) -#define VSY_LOW_ACTIVE (0x00<<0) -#define HSY_LOW_ACTIVE (0x01<<1) -#define HSY_HIGH_ACTIVE (0x00<<1) -#define INPUT_MODE_YUV (0x00<<2) -#define INPUT_MODE_PAL (0x02<<2) -#define INPUT_MODE_NTSC (0x03<<2) -#define INPUT_MODE_RAW (0x04<<2) -#define INPUT_MODE_JPEG (0x05<<2) -#define INPUT_MODE_MIPI (0x06<<2) -#define YUV_INPUT_ORDER_UYVY(ori) (ori & (~(0x03<<5))) -#define YUV_INPUT_ORDER_YVYU(ori) ((ori & (~(0x01<<6)))|(0x01<<5)) -#define YUV_INPUT_ORDER_VYUY(ori) ((ori & (~(0x01<<5))) | (0x1<<6)) -#define YUV_INPUT_ORDER_YUYV(ori) (ori|(0x03<<5)) -#define YUV_INPUT_422 (0x00<<7) -#define YUV_INPUT_420 (0x01<<7) -#define INPUT_420_ORDER_EVEN (0x00<<8) -#define INPUT_420_ORDER_ODD (0x01<<8) -#define CCIR_INPUT_ORDER_ODD (0x00<<9) -#define CCIR_INPUT_ORDER_EVEN (0x01<<9) -#define RAW_DATA_WIDTH_8 (0x00<<11) -#define RAW_DATA_WIDTH_10 (0x01<<11) -#define RAW_DATA_WIDTH_12 (0x02<<11) -#define YUV_OUTPUT_422 (0x00<<16) -#define YUV_OUTPUT_420 (0x01<<16) -#define OUTPUT_420_ORDER_EVEN (0x00<<17) -#define OUTPUT_420_ORDER_ODD (0x01<<17) -#define RAWD_DATA_LITTLE_ENDIAN (0x00<<18) -#define RAWD_DATA_BIG_ENDIAN (0x01<<18) -#define UV_STORAGE_ORDER_UVUV (0x00<<19) -#define UV_STORAGE_ORDER_VUVU (0x01<<19) - -/*CIF_CIF_SCL_CTRL*/ -#define ENABLE_SCL_DOWN (0x01<<0) -#define DISABLE_SCL_DOWN (0x00<<0) -#define ENABLE_SCL_UP (0x01<<1) -#define DISABLE_SCL_UP (0x00<<1) -#define ENABLE_YUV_16BIT_BYPASS (0x01<<4) -#define DISABLE_YUV_16BIT_BYPASS (0x00<<4) -#define ENABLE_RAW_16BIT_BYPASS (0x01<<5) -#define DISABLE_RAW_16BIT_BYPASS (0x00<<5) -#define ENABLE_32BIT_BYPASS (0x01<<6) -#define DISABLE_32BIT_BYPASS (0x00<<6) - -struct regmap *rk_cif_grf_base; -extern struct rk29camera_platform_data rk_camera_platform_data; - -#define MIN(x,y) ((xy) ? x: y) -#define RK_SENSOR_24MHZ 24*1000*1000 /* MHz */ -#define RK_SENSOR_48MHZ 48 - -#define write_cif_reg(base,addr, val) __raw_writel(val, addr+(base)) -#define read_cif_reg(base,addr) __raw_readl(addr+(base)) -#define mask_cif_reg(addr, msk, val) write_cif_reg(addr, (val)|((~(msk))&read_cif_reg(addr))) - - -static u32 CRU_PCLK_REG30; -static u32 ENANABLE_INVERT_PCLK_CIF0; -static u32 DISABLE_INVERT_PCLK_CIF0; -static u32 CHIP_NAME; - -static inline void write_grf_reg(unsigned int addr, unsigned int val) -{ - if (rk_cif_grf_base) - regmap_write(rk_cif_grf_base, addr, val); -} - -static inline unsigned int read_grf_reg(unsigned int addr) -{ - unsigned int val; - if (rk_cif_grf_base) - regmap_read(rk_cif_grf_base, addr, &val); - - return val; -} - -#define CAM_WORKQUEUE_IS_EN() (true) -#define CAM_IPPWORK_IS_EN() (false)/*((pcdev->zoominfo.a.c.width != pcdev->icd->user_width) || (pcdev->zoominfo.a.c.height != pcdev->icd->user_height))*/ - -#define IS_CIF0() (true)/*(pcdev->hostid == RK_CAM_PLATFORM_DEV_ID_0)*/ -#if (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_IPP) -#define CROP_ALIGN_BYTES (0x03) -#define CIF_DO_CROP 0 -#elif (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_ARM) -#define CROP_ALIGN_BYTES (0x0f) -#define CIF_DO_CROP 0 -#elif (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_RGA) -#define CROP_ALIGN_BYTES (0x03) -#define CIF_DO_CROP 0 -#elif(CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_PP) -#define CROP_ALIGN_BYTES (0x0F) -#define CIF_DO_CROP 1 -#endif - -/* -*v0.1.0 : this driver is 3.10 kernel driver; - copy and updata from v0.3.0x19; - support rk312x; -*v0.1.1: - 1. spin lock in struct rk_cif_clk is not neccessary,and scheduled func clk_get called in this spin lock scope - cause warning, so remove this spin lock . -*v0.1.2: - 1. rk3126 and rk3128 use different dts file. -*v0.1.3: - 1. i2c 1 and wifi use the common io in rk3128,so just enable i2c1 in rk3126 dts file -*v0.1.4: - 1. When cif was at work, the aclk is closed ,may cause bus abnormal ,so sleep 100ms before close aclk -*v0.1.5: - 1. Improve the code to support all configuration.reset,af,flash... -*v0.1.6: - 1. Delete SOCAM_DATAWIDTH_8 in SENSOR_BUS_PARAM parameters,it conflict with V4L2_MBUS_PCLK_SAMPLE_FALLING. -*v0.1.7: - 1. Add power and powerdown controled by PMU. -*v0.1.8: - 1. Support front and rear camera support are the same. -*v0.1.9: - 1. Support pingpong mode. - 2. Fix cif_clk_out cannot close which base on XIN24M and cannot turn to 0 - 3. Move Camera Sensor Macro from rk_camera.h to rk_camera_sensor_info.h - 4. Support flash control when preview size == picture size -*v0.1.a: - 1. Support rk3288 cif driver - 2. Query and upload iommu info -*v0.1.b: - 1. Vpu_service compatible has change ,fix it. -*v0.1.c: - 1. setting cif capture en bit can't stop cif really,reset cif instead. -*v0.1.d: - 1. use of_find_node_by_name to get vpu node instead of of_find_compatible_node -*v0.1.e: - 1. support focus mode. -*v0.1.f: - 1. focus mode have some bug,fix it. -*v0.2.0: - 1. support rk3368. -*v0.3.0: -* 1. supprot rk3228h -*v0.4.0: -* 1.cif uses dmabuf,in this case,vb->boff is buffer fd. -*v0.5.0: -* 1. Only register cif driver here. -*v0.5.1: -* 1. fix fival_list alloc and free with API does't match. -*v0.6.0: -* 1. support px30. -*/ -#define RK_CAM_VERSION_CODE KERNEL_VERSION(0, 6, 0) -static int version = RK_CAM_VERSION_CODE; -module_param(version, int, S_IRUGO); - -/* limit to rk29 hardware capabilities */ -#define RK_CAM_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_HSYNC_ACTIVE_HIGH |\ - V4L2_MBUS_HSYNC_ACTIVE_LOW |\ - V4L2_MBUS_VSYNC_ACTIVE_HIGH |\ - V4L2_MBUS_VSYNC_ACTIVE_LOW |\ - V4L2_MBUS_PCLK_SAMPLE_RISING |\ - V4L2_MBUS_PCLK_SAMPLE_FALLING|\ - V4L2_MBUS_DATA_ACTIVE_HIGH |\ - V4L2_MBUS_DATA_ACTIVE_LOW|\ - SOCAM_DATAWIDTH_8|SOCAM_DATAWIDTH_10|\ - SOCAM_MCLK_24MHZ |SOCAM_MCLK_48MHZ) - -#define RK_CAM_W_MIN 48 -#define RK_CAM_H_MIN 32 -#define RK_CAM_W_MAX 3856 /* ddl@rock-chips.com : 10M Pixel */ -#define RK_CAM_H_MAX 2764 -#define RK_CAM_FRAME_INVAL_INIT 0 -#define RK_CAM_FRAME_INVAL_DC 0 /* ddl@rock-chips.com : */ -#define RK30_CAM_FRAME_MEASURE 5 - - -extern void videobuf_dma_contig_free(struct videobuf_queue *q, struct videobuf_buffer *buf); -extern dma_addr_t videobuf_to_dma_contig(struct videobuf_buffer *buf); -/* buffer for one video frame */ -struct rk_camera_buffer -{ - /* common v4l buffer stuff -- must be first */ - struct videobuf_buffer vb; - u32 code; - int inwork; -}; - -#define RK_CAMERA_MODE_DMA_SG -#ifdef RK_CAMERA_MODE_DMA_SG -#define DMABUF_MAX_FRAME 32 -struct rk_camera_dma_buf_s { - struct dma_buf *dma_buf; - struct dma_buf_attachment *attach; - struct sg_table *sgt; - dma_addr_t dma_addr; - int fd; -}; -#endif -enum rk_camera_reg_state -{ - Reg_Invalidate, - Reg_Validate -}; - -struct rk_camera_reg -{ - unsigned int cifCtrl; - unsigned int cifCrop; - unsigned int cifFs; - unsigned int cifIntEn; - unsigned int cifFmt; - unsigned int cifVirWidth; - unsigned int cifScale; -/* unsigned int VipCrm;*/ - enum rk_camera_reg_state Inval; -}; -struct rk_camera_work -{ - struct videobuf_buffer *vb; - struct rk_camera_dev *pcdev; - struct work_struct work; - struct list_head queue; - unsigned int index; -}; -struct rk_camera_frmivalenum -{ - struct v4l2_frmivalenum fival; - struct rk_camera_frmivalenum *nxt; -}; -struct rk_camera_frmivalinfo -{ - struct soc_camera_device *icd; - struct rk_camera_frmivalenum *fival_list; -}; -struct rk_camera_zoominfo -{ - struct semaphore sem; - struct v4l2_crop a; - int vir_width; - int vir_height; - int zoom_rate; -}; -#if CAMERA_VIDEOBUF_ARM_ACCESS -struct rk29_camera_vbinfo -{ - unsigned long phy_addr; - void __iomem *vir_addr; - unsigned int size; -}; -#endif -struct rk_camera_timer{ - struct rk_camera_dev *pcdev; - struct hrtimer timer; - bool istarted; -}; - -struct rk_cif_clk -{ - struct clk *aclk_cif; - struct clk *hclk_cif; - struct clk *cif_clk_in; - struct clk *cif_clk_out; - struct clk *pclk_cif; - struct reset_control *cif_rst; - - bool on; -}; - -struct rk_cif_crop -{ - spinlock_t lock; - struct v4l2_rect c; - struct v4l2_rect bounds; -}; - -struct rk_cif_irqinfo -{ - unsigned int irq; - unsigned long cifirq_idx; - unsigned long cifirq_normal_idx; - unsigned long cifirq_abnormal_idx; - - unsigned long dmairq_idx; - spinlock_t lock; -}; - -struct rk_camera_dev -{ - struct soc_camera_host soc_host; - struct device *dev; - /* - * RK2827x is only supposed to handle one camera on its Quick Capture - * interface. If anyone ever builds hardware to enable more than - * one camera, they will have to modify this driver too - */ - struct soc_camera_device *icd; - void __iomem *base; - /* ddl@rock-chips.com : The first frames is invalidate */ - int frame_inval; - - unsigned int fps; - unsigned int last_fps; - unsigned long frame_interval; - unsigned int pixfmt; - /*for ipp */ - unsigned long vipmem_phybase; - void __iomem *vipmem_virbase; - unsigned int vipmem_size; - unsigned int vipmem_bsize; -#if CAMERA_VIDEOBUF_ARM_ACCESS - struct rk29_camera_vbinfo *vbinfo; - unsigned int vbinfo_count; -#endif - int host_width; - int host_height; - int host_left; /*sensor output size ?*/ - int host_top; - int hostid; - int icd_width; - int icd_height; - int capture_pingpong; - - struct rk_cif_crop cropinfo; - struct rk_cif_irqinfo irqinfo; - - struct rk29camera_platform_data *pdata; - struct resource *res; - struct list_head capture; - struct rk_camera_zoominfo zoominfo; - - spinlock_t lock; - - struct videobuf_buffer *active; - struct videobuf_buffer *active1; - struct videobuf_buffer *active_delay; - struct rk_camera_reg reginfo_suspend; - struct workqueue_struct *camera_wq; - struct rk_camera_work *camera_work; - struct list_head camera_work_queue; - spinlock_t camera_work_lock; - unsigned int camera_work_count; - struct rk_camera_timer fps_timer; - struct rk_camera_work camera_reinit_work; - int icd_init; - rk29_camera_sensor_cb_s icd_cb; - struct rk_camera_frmivalinfo icd_frmival[2]; - bool timer_get_fps; - unsigned int reinit_times; - struct videobuf_queue *video_vq; - atomic_t stop_cif; - wait_queue_head_t cif_stop_done; - volatile bool cif_stopped; - struct timeval first_tv; - int chip_id; -#ifdef RK_CAMERA_MODE_DMA_SG - struct rk_camera_dma_buf_s dma_buffer[DMABUF_MAX_FRAME]; - int dma_buf_cnt; -#endif - struct iommu_domain *domain; -}; - -static const struct v4l2_queryctrl rk_camera_controls[] = -{ - { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 100, - .maximum = 300, - .step = 5, - .default_value = 100, - } -}; - -static struct rk_cif_clk cif_clk[2]; -struct rk_camera_dev *priv_camera_dev; - -static DEFINE_MUTEX(camera_lock); -static const char *rk_cam_driver_description = "RK_Camera"; - -static int rk_camera_s_stream(struct soc_camera_device *icd, int enable); -static void rk_camera_capture_process(struct work_struct *work); - -static void rk_camera_diffchips(const char *rockchip_name) -{ - if (strstr(rockchip_name, "3128") || strstr(rockchip_name, "3126")) { - CHIP_NAME = 3126; - } else if (strstr(rockchip_name, "3288")) { - CHIP_NAME = 3288; - } else if (strstr(rockchip_name, "3368") || - strstr(rockchip_name, "px5") || - strstr(rockchip_name, "px5-evb")) { - CHIP_NAME = 3368; - } else if (strstr(rockchip_name, "3228h")) { - CRU_PCLK_REG30 = 0x0410; - ENANABLE_INVERT_PCLK_CIF0 = ((0x1 << 31) | (0x1 << 15)); - DISABLE_INVERT_PCLK_CIF0 = ((0x1 << 31) | (0x0 << 15)); - CHIP_NAME = 3228; - } else if (strstr(rockchip_name, "px30") || - strstr(rockchip_name, "3326")) { - CRU_PCLK_REG30 = 0x0430; - ENANABLE_INVERT_PCLK_CIF0 = ((0x1 << 28) | (0x1 << 12)); - DISABLE_INVERT_PCLK_CIF0 = ((0x1 << 28) | (0x0 << 12)); - CHIP_NAME = 3326; - } -} -static inline void rk_cru_set_soft_reset(int idx) -{ - struct rk_cif_clk *clk; - clk = &cif_clk[idx]; - - if (clk->cif_rst) { - reset_control_assert(clk->cif_rst); - udelay(5); - reset_control_deassert(clk->cif_rst); - } -} - -static void rk_camera_cif_reset(struct rk_camera_dev *pcdev, int only_rst) -{ - int ctrl_reg, inten_reg, crop_reg, set_size_reg, for_reg; - int vir_line_width_reg, scl_reg, y_reg, uv_reg; - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - if (only_rst == true) { - rk_cru_set_soft_reset(0); - } else { - ctrl_reg = read_cif_reg(pcdev->base, CIF_CIF_CTRL); - if (ctrl_reg & ENABLE_CAPTURE) - write_cif_reg(pcdev->base, CIF_CIF_CTRL, - ctrl_reg & ~ENABLE_CAPTURE); - - crop_reg = read_cif_reg(pcdev->base, CIF_CIF_CROP); - set_size_reg = read_cif_reg(pcdev->base, CIF_CIF_SET_SIZE); - inten_reg = read_cif_reg(pcdev->base, CIF_CIF_INTEN); - for_reg = read_cif_reg(pcdev->base, CIF_CIF_FOR); - vir_line_width_reg = read_cif_reg(pcdev->base, - CIF_CIF_VIR_LINE_WIDTH); - scl_reg = read_cif_reg(pcdev->base, CIF_CIF_SCL_CTRL); - y_reg = read_cif_reg(pcdev->base, CIF_CIF_FRM0_ADDR_Y); - uv_reg = read_cif_reg(pcdev->base, CIF_CIF_FRM0_ADDR_UV); - - rk_cru_set_soft_reset(0); - - write_cif_reg(pcdev->base, CIF_CIF_CTRL, - ctrl_reg & ~ENABLE_CAPTURE); - write_cif_reg(pcdev->base, CIF_CIF_INTEN, inten_reg); - write_cif_reg(pcdev->base, CIF_CIF_CROP, crop_reg); - write_cif_reg(pcdev->base, CIF_CIF_SET_SIZE, set_size_reg); - write_cif_reg(pcdev->base, CIF_CIF_FOR, for_reg); - write_cif_reg(pcdev->base, CIF_CIF_VIR_LINE_WIDTH, - vir_line_width_reg); - write_cif_reg(pcdev->base, CIF_CIF_SCL_CTRL, scl_reg); - write_cif_reg(pcdev->base, CIF_CIF_FRM0_ADDR_Y, y_reg); - write_cif_reg(pcdev->base, CIF_CIF_FRM0_ADDR_UV, uv_reg); - write_cif_reg(pcdev->base, CIF_CIF_FRM1_ADDR_Y, y_reg); - write_cif_reg(pcdev->base, CIF_CIF_FRM1_ADDR_UV, uv_reg); - } - return; -} - -#ifdef RK_CAMERA_MODE_DMA_SG -static int rk_camera_dma_attach_device(struct rk_camera_dev *pcdev) -{ - struct iommu_domain *domain = pcdev->domain; - struct device *dev = pcdev->dev; - int ret; - - ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32)); - if (ret) - return ret; - - if (domain) { - dma_set_max_seg_size(pcdev->dev, DMA_BIT_MASK(32)); - ret = iommu_attach_device(domain, dev); - if (ret) { - dev_err(dev, "Failed to attach iommu device!\n"); - return ret; - } - - if (!common_iommu_setup_dma_ops(dev, 0x10000000, SZ_2G, domain->ops)) { - dev_err(dev, "Failed to set dma_ops!\n"); - iommu_detach_device(domain, dev); - ret = -ENODEV; - } - } - - return ret; -} - -static void rk_camera_dma_detach_device(struct rk_camera_dev *pcdev) -{ - struct iommu_domain *domain = pcdev->domain; - struct device *dev = pcdev->dev; - - if (domain) - iommu_detach_device(domain, dev); -} - -static int rk_camera_dmabuf_cb(struct rk_camera_dev *pcdev, - struct videobuf_buffer *vb, - bool on) -{ - struct dma_buf *dma_buffer; - struct dma_buf_attachment *attach; - struct sg_table *sgt; - dma_addr_t dma_addr; - int index = 0; - int ret = 0; - - if (on) { - index = vb->i; - if (index >= DMABUF_MAX_FRAME) { - RKCAMERA_TR("index (%d) is wrong, max support is %d.\n", index, DMABUF_MAX_FRAME); - return -EINVAL; - } - if (pcdev->dma_buf_cnt == 0) { - ret = rk_camera_dma_attach_device(pcdev); - if (ret) { - RKCAMERA_TR("rk_camera_dma_attach_device fail\n"); - return ret; - } - } - - dma_buffer = dma_buf_get(vb->boff); - if (IS_ERR(dma_buffer)) { - RKCAMERA_TR("dma_buf_get fail\n"); - return PTR_ERR(dma_buffer); - } - attach = dma_buf_attach(dma_buffer, pcdev->dev); - if (IS_ERR(attach)) { - RKCAMERA_TR("dma_buf_attach fail\n"); - dma_buf_put(dma_buffer); - return PTR_ERR(attach); - } - sgt = dma_buf_map_attachment(attach, DMA_BIDIRECTIONAL); - if (IS_ERR(sgt)) { - RKCAMERA_TR("dma_buf_map_attachment fail\n"); - dma_buf_detach(dma_buffer, attach); - dma_buf_put(dma_buffer); - return PTR_ERR(sgt); - } - dma_addr = sg_dma_address(sgt->sgl); - - pcdev->dma_buffer[index].dma_addr = dma_addr; - pcdev->dma_buffer[index].attach = attach; - pcdev->dma_buffer[index].dma_buf = dma_buffer; - pcdev->dma_buffer[index].sgt = sgt; - pcdev->dma_buffer[index].fd = vb->boff; - pcdev->dma_buf_cnt++; - - RKCAMERA_DG1 - ("dma buf map: dma_addr 0x%lx, attach %p, dma_buf %p,sgt %p,fd 0x%x,buf_cnt %d, index %d\n", - (unsigned long)dma_addr, - attach, - dma_buffer, - sgt, - (int)vb->boff, - pcdev->dma_buf_cnt, - index); - } else { - index = vb->i; - if (index >= DMABUF_MAX_FRAME) { - RKCAMERA_TR("index (%d) is wrong, max support is %d.\n", index, DMABUF_MAX_FRAME); - return -EINVAL; - } - if (pcdev->dma_buf_cnt == 0) { - RKCAMERA_DG1("dma_buf_cnt is %d.\n", pcdev->dma_buf_cnt); - return ret; - } - attach = pcdev->dma_buffer[index].attach; - dma_buffer = pcdev->dma_buffer[index].dma_buf; - sgt = pcdev->dma_buffer[index].sgt; - RKCAMERA_DG1 - ("dma buf unmap: attach %p,dma_buf %p,sgt %p,fd 0x%x,buf_cnt %d,index %d\n", - attach, - dma_buffer, - sgt, - (int)vb->boff, - pcdev->dma_buf_cnt, - index); - dma_buf_unmap_attachment(attach, sgt, DMA_BIDIRECTIONAL); - dma_buf_detach(dma_buffer, attach); - dma_buf_put(dma_buffer); - if (pcdev->dma_buf_cnt == 1) - rk_camera_dma_detach_device(pcdev); - pcdev->dma_buf_cnt--; - pcdev->dma_buffer[index].fd = -1; - } - - return ret; -} -#endif - -/* - * Videobuf operations - */ -static int rk_videobuf_setup(struct videobuf_queue *vq, unsigned int *count, - unsigned int *size) -{ - struct soc_camera_device *icd = vq->priv_data; - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/ - struct rk_camera_dev *pcdev = ici->priv; - unsigned int i; - struct rk_camera_work *wk; - - struct soc_mbus_pixelfmt fmt; - int bytes_per_line; - int bytes_per_line_host; - fmt.packing = SOC_MBUS_PACKING_1_5X8; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - - bytes_per_line = soc_mbus_bytes_per_line(icd->user_width, - icd->current_fmt->host_fmt); - if(icd->current_fmt->host_fmt->fourcc == V4L2_PIX_FMT_RGB565) - bytes_per_line_host = soc_mbus_bytes_per_line(pcdev->host_width, - &fmt); - else if(icd->current_fmt->host_fmt->fourcc == V4L2_PIX_FMT_RGB24) - bytes_per_line_host = pcdev->host_width*3; - else - bytes_per_line_host = soc_mbus_bytes_per_line(pcdev->host_width, - icd->current_fmt->host_fmt); - /* dev_dbg(&icd->dev, "count=%d, size=%d\n", *count, *size);*/ /*yzm*/ - - if (bytes_per_line_host < 0) - return bytes_per_line_host; - - /* planar capture requires Y, U and V buffers to be page aligned */ - *size = PAGE_ALIGN(bytes_per_line*icd->user_height); /* Y pages UV pages, yuv422*/ - pcdev->vipmem_bsize = PAGE_ALIGN(bytes_per_line_host * pcdev->host_height); - - if (CAM_WORKQUEUE_IS_EN()) { - - if (CAM_IPPWORK_IS_EN()) { - BUG_ON(pcdev->vipmem_sizevipmem_bsize); - if (*count > pcdev->vipmem_size/pcdev->vipmem_bsize) { /* Buffers must be limited, when this resolution is genered by IPP */ - *count = pcdev->vipmem_size/pcdev->vipmem_bsize; - } - } - - if ((pcdev->camera_work_count != *count) && pcdev->camera_work) { - kfree(pcdev->camera_work); - pcdev->camera_work = NULL; - pcdev->camera_work_count = 0; - } - - if (pcdev->camera_work == NULL) { - pcdev->camera_work = kzalloc( - sizeof(struct rk_camera_work) * (*count), - GFP_KERNEL); - if (pcdev->camera_work == NULL) { - RKCAMERA_TR("kmalloc failed\n"); - BUG(); - } - wk = pcdev->camera_work; - INIT_LIST_HEAD(&pcdev->camera_work_queue); - - for (i = 0; i < (*count); i++) { - wk->index = i; - list_add_tail(&wk->queue, - &pcdev->camera_work_queue); - wk++; - } - pcdev->camera_work_count = (*count); - } -#if CAMERA_VIDEOBUF_ARM_ACCESS - if (pcdev->vbinfo && (pcdev->vbinfo_count != *count)) { - kfree(pcdev->vbinfo); - pcdev->vbinfo = NULL; - pcdev->vbinfo_count = 0x00; - } - - if (!pcdev->vbinfo) { - pcdev->vbinfo = kzalloc( - sizeof(struct rk29_camera_vbinfo) * (*count), - GFP_KERNEL); - if (!pcdev->vbinfo) { - RKCAMERA_TR("vbinfo kmalloc fail\n"); - WARN_ON(1); - } - memset(pcdev->vbinfo, - 0, - sizeof(struct rk29_camera_vbinfo) * (*count)); - pcdev->vbinfo_count = *count; - } -#endif - } - #ifdef RK_CAMERA_MODE_DMA_SG - pcdev->dma_buf_cnt = 0; - for (i = 0; i < DMABUF_MAX_FRAME; i++) - pcdev->dma_buffer[i].fd = -1; - #endif - pcdev->video_vq = vq; - RKCAMERA_DG1("videobuf size:%d, vipmem_buf size:%d, count:%d \n",*size,pcdev->vipmem_size, *count); - - return 0; -} -static void rk_videobuf_free(struct videobuf_queue *vq, struct rk_camera_buffer *buf) -{ - struct soc_camera_device *icd = vq->priv_data; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - - dev_dbg(icd->control, "%s (vb=0x%p) 0x%08lx %zd\n", __func__,/*yzm*/ - &buf->vb, buf->vb.baddr, buf->vb.bsize); - - /* ddl@rock-chips.com: buf_release called soc_camera_streamoff and soc_camera_close*/ - if (buf->vb.state == VIDEOBUF_NEEDS_INIT) - return; - - BUG_ON(in_interrupt()); - - /* - * This waits until this buffer is out of danger, i.e., until it is no - * longer in STATE_QUEUED or STATE_ACTIVE - */ - videobuf_waiton(vq, &buf->vb, 0, 0); - videobuf_dma_contig_free(vq, &buf->vb); - buf->vb.state = VIDEOBUF_NEEDS_INIT; - return; -} -static int rk_videobuf_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb, enum v4l2_field field) -{ - struct soc_camera_device *icd = vq->priv_data; -#ifdef RK_CAMERA_MODE_DMA_SG - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); - struct rk_camera_dev *pcdev = ici->priv; -#endif - struct rk_camera_buffer *buf; - int ret; - int bytes_per_line = soc_mbus_bytes_per_line(icd->user_width, - icd->current_fmt->host_fmt); - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - if ((bytes_per_line < 0) || (vb->boff == 0) || (vb->boff == -1)) - return -EINVAL; - - buf = container_of(vb, struct rk_camera_buffer, vb); - - /* Added list head initialization on alloc */ - WARN_ON(!list_empty(&vb->queue)); - - BUG_ON(NULL == icd->current_fmt); - - if (buf->code != icd->current_fmt->code || - vb->width != icd->user_width || - vb->height != icd->user_height || - vb->field != field) { - buf->code = icd->current_fmt->code; - vb->width = icd->user_width; - vb->height = icd->user_height; - vb->field = field; - vb->state = VIDEOBUF_NEEDS_INIT; - } - - vb->size = bytes_per_line*vb->height; /* ddl@rock-chips.com : fmt->depth is coorect */ - if (0 != vb->baddr && vb->bsize < vb->size) { - ret = -EINVAL; - goto out; - } - - if (vb->state == VIDEOBUF_NEEDS_INIT) { - ret = videobuf_iolock(vq, vb, NULL); - if (ret) { - goto fail; - } - #ifdef RK_CAMERA_MODE_DMA_SG - rk_camera_dmabuf_cb(pcdev, vb, true); - #endif - vb->state = VIDEOBUF_PREPARED; - } - return 0; -fail: - rk_videobuf_free(vq, buf); -out: - return ret; -} - -static inline void rk_videobuf_capture(struct videobuf_buffer *vb,struct rk_camera_dev *rk_pcdev) -{ - unsigned long y_addr,uv_addr; - struct rk_camera_dev *pcdev = rk_pcdev; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - - if (vb) { - if (CAM_WORKQUEUE_IS_EN() & CAM_IPPWORK_IS_EN()) { - y_addr = pcdev->vipmem_phybase + vb->i*pcdev->vipmem_bsize; - uv_addr = y_addr + pcdev->zoominfo.vir_width*pcdev->zoominfo.vir_height; - if (y_addr > (pcdev->vipmem_phybase + pcdev->vipmem_size - pcdev->vipmem_bsize)) { - RKCAMERA_TR("vipmem for IPP is overflow! %dx%d -> %dx%d vb_index:%d\n",pcdev->host_width,pcdev->host_height, - pcdev->icd->user_width,pcdev->icd->user_height, vb->i); - BUG(); - } - } else { - #ifdef RK_CAMERA_MODE_DMA_SG - y_addr = (unsigned long)pcdev->dma_buffer[vb->i].dma_addr; - uv_addr = y_addr + vb->width * vb->height; - #else - y_addr = vb->boff; - uv_addr = y_addr + vb->width * vb->height; - #endif - } -#if defined(CONFIG_ARCH_RK3188) - rk_camera_cif_reset(pcdev,false); -#endif - write_cif_reg(pcdev->base,CIF_CIF_FRM0_ADDR_Y, y_addr); - write_cif_reg(pcdev->base,CIF_CIF_FRM0_ADDR_UV, uv_addr); - write_cif_reg(pcdev->base,CIF_CIF_FRM1_ADDR_Y, y_addr); - write_cif_reg(pcdev->base,CIF_CIF_FRM1_ADDR_UV, uv_addr); - write_cif_reg(pcdev->base,CIF_CIF_FRAME_STATUS, 0x00000002);//frame1 has been ready to receive data,frame 2 is not used - } -} - -static inline void rk_videobuf_capture_mix(struct videobuf_buffer *vb, - struct rk_camera_dev *rk_pcdev, - int fmt_ready) -{ - unsigned long y_addr, uv_addr; - struct rk_camera_dev *pcdev = rk_pcdev; - - debug_printk("/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", - __FILE__, __LINE__, __func__); - - if (vb) { -#ifdef RK_CAMERA_MODE_DMA_SG - y_addr = (unsigned long)pcdev->dma_buffer[vb->i].dma_addr; - uv_addr = y_addr + vb->width * vb->height; -#else - y_addr = vb->boff; - uv_addr = y_addr + vb->width * vb->height; -#endif - switch (fmt_ready) { - case 0: - write_cif_reg(pcdev->base, - CIF_CIF_FRM0_ADDR_Y, y_addr); - write_cif_reg(pcdev->base, - CIF_CIF_FRM0_ADDR_UV, uv_addr); - write_cif_reg(pcdev->base, - CIF_CIF_FRAME_STATUS, 0x10000000); - break; - case 1: - write_cif_reg(pcdev->base, - CIF_CIF_FRM1_ADDR_Y, y_addr); - write_cif_reg(pcdev->base, - CIF_CIF_FRM1_ADDR_UV, uv_addr); - write_cif_reg(pcdev->base, - CIF_CIF_FRAME_STATUS, 0x10000000); - break; - default: - RKCAMERA_TR("%s(%d): fmt_ready(%d) is wrong!\n", - __func__, __LINE__, fmt_ready); - break; - } - } -} - -/* Locking: Caller holds q->irqlock */ -static void rk_videobuf_queue(struct videobuf_queue *vq, - struct videobuf_buffer *vb) -{ - struct soc_camera_device *icd = vq->priv_data; - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/ - struct rk_camera_dev *pcdev = ici->priv; -#if CAMERA_VIDEOBUF_ARM_ACCESS - struct rk29_camera_vbinfo *vb_info; -#endif - - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - vb->state = VIDEOBUF_QUEUED; - if (list_empty(&pcdev->capture)) { - list_add_tail(&vb->queue, &pcdev->capture); - } else { - if (list_entry(pcdev->capture.next, struct videobuf_buffer, queue) != vb) - list_add_tail(&vb->queue, &pcdev->capture); - else - BUG(); /* ddl@rock-chips.com : The same videobuffer queue again */ - } -#if CAMERA_VIDEOBUF_ARM_ACCESS - if (pcdev->vbinfo) { - vb_info = pcdev->vbinfo+vb->i; - if ((vb_info->phy_addr != vb->boff) || (vb_info->size != vb->bsize)) { - if (vb_info->vir_addr) { - iounmap(vb_info->vir_addr); - release_mem_region(vb_info->phy_addr, vb_info->size); - vb_info->vir_addr = NULL; - vb_info->phy_addr = 0x00; - vb_info->size = 0x00; - } - - if (request_mem_region(vb->boff,vb->bsize,"rk_camera_vb")) { - vb_info->vir_addr = ioremap_cached(vb->boff,vb->bsize); - } - - if (vb_info->vir_addr) { - vb_info->size = vb->bsize; - vb_info->phy_addr = vb->boff; - } else { - RKCAMERA_TR("ioremap videobuf %d failed\n",vb->i); - } - } - } -#endif - if (pcdev->capture_pingpong) { - if (!pcdev->active) { - pcdev->active = vb; - rk_videobuf_capture_mix(vb, pcdev, 0); - list_del_init(&vb->queue); - } else if (!pcdev->active1) { - pcdev->active1 = vb; - rk_videobuf_capture_mix(vb, pcdev, 1); - list_del_init(&vb->queue); - } - } else { - if (!pcdev->active) { - pcdev->active = vb; - rk_videobuf_capture(vb, pcdev); - if (atomic_read(&pcdev->stop_cif) == false) - write_cif_reg(pcdev->base, CIF_CIF_CTRL, - (read_cif_reg(pcdev->base, - CIF_CIF_CTRL) | - ENABLE_CAPTURE)); - } - } -} - -#if (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_RGA) -static int rk_pixfmt2rgafmt(unsigned int pixfmt, int *ippfmt) -{ - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - switch (pixfmt) - { - case V4L2_PIX_FMT_YUV420: - case V4L2_PIX_FMT_UYVY: /* yuv 422, but sensor has defined this format(in fact ,should be defined yuv 420), treat this as yuv 420.*/ - case V4L2_PIX_FMT_YUYV: - { - *ippfmt = RK_FORMAT_YCbCr_420_SP; - break; - } - case V4L2_PIX_FMT_YVU420: - case V4L2_PIX_FMT_VYUY: - case V4L2_PIX_FMT_YVYU: - { - *ippfmt = RK_FORMAT_YCrCb_420_SP; - break; - } - case V4L2_PIX_FMT_RGB565: - { - *ippfmt = RK_FORMAT_RGB_565; - break; - } - case V4L2_PIX_FMT_RGB24: - { - *ippfmt = RK_FORMAT_RGB_888; - break; - } - default: - goto rk_pixfmt2rgafmt_err; - } - - return 0; -rk_pixfmt2rgafmt_err: - return -1; -} -#endif -#if (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_PP) -static int rk_camera_scale_crop_pp(struct work_struct *work){ - struct rk_camera_work *camera_work = container_of(work, struct rk_camera_work, work); - struct videobuf_buffer *vb = camera_work->vb; - struct rk_camera_dev *pcdev = camera_work->pcdev; - int vipdata_base; - unsigned long int flags; - int scale_times,w,h; - int src_y_offset; - - return 0; -} -#endif -#if (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_RGA) -extern rga_service_info rga_service; -extern int rga_blit_sync(rga_session *session, struct rga_req *req); -extern void rga_service_session_clear(rga_session *session); -static int rk_camera_scale_crop_rga(struct work_struct *work){ - struct rk_camera_work *camera_work = container_of(work, struct rk_camera_work, work); - struct videobuf_buffer *vb = camera_work->vb; - struct rk_camera_dev *pcdev = camera_work->pcdev; - int vipdata_base; - unsigned long int flags; - int scale_times,w,h; - int src_y_offset; - struct rga_req req; - rga_session session; - int rga_times = 3; - const struct soc_mbus_pixelfmt *fmt; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - return 0; -} - -#endif -#if (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_IPP) - -static int rk_camera_scale_crop_ipp(struct work_struct *work) -{ - - return 0; -} -#endif -static void rk_camera_capture_process(struct work_struct *work) -{ - struct rk_camera_work *camera_work = container_of(work, struct rk_camera_work, work); - struct videobuf_buffer *vb = camera_work->vb; - struct rk_camera_dev *pcdev = camera_work->pcdev; - unsigned long flags = 0; - int err = 0; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - - if (atomic_read(&pcdev->stop_cif)==true) { - err = -EINVAL; - goto rk_camera_capture_process_end; - } - - if (!CAM_WORKQUEUE_IS_EN()) { - err = -EINVAL; - goto rk_camera_capture_process_end; - } - - down(&pcdev->zoominfo.sem); - if (pcdev->icd_cb.scale_crop_cb){ - err = (pcdev->icd_cb.scale_crop_cb)(work); - } - up(&pcdev->zoominfo.sem); - - if (pcdev->icd_cb.sensor_cb) - (pcdev->icd_cb.sensor_cb)(vb); - -rk_camera_capture_process_end: - if (err) { - vb->state = VIDEOBUF_ERROR; - } else { - if ((vb->state == VIDEOBUF_QUEUED) || (vb->state == VIDEOBUF_ACTIVE)) { - vb->state = VIDEOBUF_DONE; - vb->field_count++; - } - } - spin_lock_irqsave(&pcdev->camera_work_lock, flags); - list_add_tail(&camera_work->queue, &pcdev->camera_work_queue); - spin_unlock_irqrestore(&pcdev->camera_work_lock, flags); - wake_up(&(camera_work->vb->done)); /* ddl@rock-chips.com : v0.3.9 */ - return; -} - -static void rk_camera_cifrest_delay(struct work_struct *work) -{ - struct rk_camera_work *camera_work = container_of(work, struct rk_camera_work, work); - struct rk_camera_dev *pcdev = camera_work->pcdev; - unsigned long flags = 0; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - mdelay(1); - rk_camera_cif_reset(pcdev,false); - - spin_lock_irqsave(&pcdev->camera_work_lock, flags); - list_add_tail(&camera_work->queue, &pcdev->camera_work_queue); - spin_unlock_irqrestore(&pcdev->camera_work_lock, flags); - - spin_lock_irqsave(&pcdev->lock,flags); - if (atomic_read(&pcdev->stop_cif) == false) { - write_cif_reg(pcdev->base,CIF_CIF_CTRL, (read_cif_reg(pcdev->base,CIF_CIF_CTRL) | ENABLE_CAPTURE)); - RKCAMERA_DG2("After reset cif, enable capture again!\n"); - } - spin_unlock_irqrestore(&pcdev->lock,flags); - return; -} - -static inline irqreturn_t rk_camera_cifirq(int irq, void *data) -{ - struct rk_camera_dev *pcdev = data; - struct rk_camera_work *wk; - unsigned int reg_cifctrl, reg_lastpix, reg_lastline; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - - write_cif_reg(pcdev->base,CIF_CIF_INTSTAT,0x0200); /* clear vip interrupte single */ - - reg_cifctrl = read_cif_reg(pcdev->base,CIF_CIF_CTRL); - reg_lastpix = read_cif_reg(pcdev->base,CIF_CIF_LAST_PIX); - reg_lastline = read_cif_reg(pcdev->base,CIF_CIF_LAST_LINE); - - pcdev->irqinfo.cifirq_idx++; - if ((reg_lastline != pcdev->host_height) /*|| (reg_lastpix != pcdev->host_width)*/) { - pcdev->irqinfo.cifirq_abnormal_idx = pcdev->irqinfo.cifirq_idx; - RKCAMERA_DG2("Cif irq-%ld is error, %dx%d != %dx%d\n",pcdev->irqinfo.cifirq_abnormal_idx, - reg_lastpix,reg_lastline,pcdev->host_width,pcdev->host_height); - } else { - pcdev->irqinfo.cifirq_normal_idx = pcdev->irqinfo.cifirq_idx; - } - - if(reg_cifctrl & ENABLE_CAPTURE) { - write_cif_reg(pcdev->base,CIF_CIF_CTRL, (reg_cifctrl & ~ENABLE_CAPTURE)); - } - - if (pcdev->irqinfo.cifirq_abnormal_idx>0) { - if ((pcdev->irqinfo.cifirq_idx - pcdev->irqinfo.cifirq_abnormal_idx) == 1 ) { - if (!list_empty(&pcdev->camera_work_queue)) { - RKCAMERA_DG2("Receive cif irq-%ld and queue work to cif reset\n",pcdev->irqinfo.cifirq_idx); - wk = list_entry(pcdev->camera_work_queue.next, struct rk_camera_work, queue); - list_del_init(&wk->queue); - INIT_WORK(&(wk->work), rk_camera_cifrest_delay); - wk->pcdev = pcdev; - queue_work(pcdev->camera_wq, &(wk->work)); - } - } - } - - return IRQ_HANDLED; -} - -static inline irqreturn_t rk_camera_dmairq(int irq, void *data) -{ - struct rk_camera_dev *pcdev = data; - struct videobuf_buffer *vb; - struct rk_camera_work *wk; - struct timeval tv; - unsigned long reg_cifctrl; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - - reg_cifctrl = read_cif_reg(pcdev->base,CIF_CIF_CTRL); - /* ddl@rock-chps.com : Current VIP is run in One Frame Mode, Frame 1 is validate */ - if (read_cif_reg(pcdev->base,CIF_CIF_FRAME_STATUS) & 0x01) { //frame 0 ready yzm - write_cif_reg(pcdev->base,CIF_CIF_INTSTAT,0x01); /* clear vip interrupte single */ - - pcdev->irqinfo.dmairq_idx++; - if (pcdev->irqinfo.cifirq_abnormal_idx == pcdev->irqinfo.dmairq_idx) { - write_cif_reg(pcdev->base,CIF_CIF_FRAME_STATUS, 0x00000002); - goto end; - } - - if (!pcdev->fps) { - do_gettimeofday(&pcdev->first_tv); - } - pcdev->fps++; - if (!pcdev->active) - goto end; - if (pcdev->frame_inval>0) { - pcdev->frame_inval--; - rk_videobuf_capture(pcdev->active,pcdev); - goto end; - } else if (pcdev->frame_inval) { - RKCAMERA_TR("frame_inval : %0x",pcdev->frame_inval); - pcdev->frame_inval = 0; - } - - if(pcdev->fps == RK30_CAM_FRAME_MEASURE) { - do_gettimeofday(&tv); - pcdev->frame_interval = ((tv.tv_sec*1000000 + tv.tv_usec) - (pcdev->first_tv.tv_sec*1000000 + pcdev->first_tv.tv_usec)) - /(RK30_CAM_FRAME_MEASURE-1); - } - - vb = pcdev->active; - if (!vb) { - printk("no acticve buffer!!!\n"); - goto end; - } - - /* ddl@rock-chips.com : this vb may be deleted from queue */ - if ((vb->state == VIDEOBUF_QUEUED) || (vb->state == VIDEOBUF_ACTIVE)) { - list_del_init(&vb->queue); - } - pcdev->active = NULL; - if (!list_empty(&pcdev->capture)) { - pcdev->active = list_entry(pcdev->capture.next, struct videobuf_buffer, queue); - if (pcdev->active) { - WARN_ON(pcdev->active->state != VIDEOBUF_QUEUED); - rk_videobuf_capture(pcdev->active,pcdev); - } - } - if (pcdev->active == NULL) { - RKCAMERA_DG1("video_buf queue is empty!\n"); - } - - do_gettimeofday(&vb->ts); - if (CAM_WORKQUEUE_IS_EN()) { - if (!list_empty(&pcdev->camera_work_queue)) { - wk = list_entry(pcdev->camera_work_queue.next, struct rk_camera_work, queue); - list_del_init(&wk->queue); - INIT_WORK(&(wk->work), rk_camera_capture_process); - wk->vb = vb; - wk->pcdev = pcdev; - queue_work(pcdev->camera_wq, &(wk->work)); - } - } else { - if ((vb->state == VIDEOBUF_QUEUED) || (vb->state == VIDEOBUF_ACTIVE)) { - vb->state = VIDEOBUF_DONE; - vb->field_count++; - } - wake_up(&vb->done); - } - } - -end: - if((reg_cifctrl & ENABLE_CAPTURE) == 0) - write_cif_reg(pcdev->base,CIF_CIF_CTRL, (reg_cifctrl | ENABLE_CAPTURE)); - return IRQ_HANDLED; -} - -static inline irqreturn_t rk_camera_dmairq_pingpong(int irq, void *data) -{ - struct rk_camera_dev *pcdev = data; - struct videobuf_buffer *vb; - struct timeval tv; - unsigned long reg_cifctrl; - struct videobuf_buffer **active = 0; - struct videobuf_buffer *active_buf = NULL; - unsigned long tmp_cif_frmst; - unsigned int frame_num = 0; - int flag = 0; - - debug_printk("/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", - __FILE__, __LINE__, __func__); - - tmp_cif_frmst = read_cif_reg(pcdev->base, CIF_CIF_FRAME_STATUS); - RKCAMERA_DG1("%s(%d): tmp_cif_frmst: 0x%lx\n", - __func__, __LINE__, tmp_cif_frmst); - - reg_cifctrl = read_cif_reg(pcdev->base, CIF_CIF_CTRL); - - /* ddl@rock-chps.com : - * Current VIP is run in One Frame Mode, Frame 1 is validate - * - * frame 0 ready yzm - */ - if (read_cif_reg(pcdev->base, CIF_CIF_FRAME_STATUS) & 0x01) { - /* clear vip interrupte single */ - write_cif_reg(pcdev->base, CIF_CIF_INTSTAT, 0x01); - - pcdev->irqinfo.dmairq_idx++; - if (pcdev->irqinfo.cifirq_abnormal_idx == - pcdev->irqinfo.dmairq_idx) { - write_cif_reg(pcdev->base, CIF_CIF_FRAME_STATUS, - 0x10000002); - - goto end; - } - - if (!pcdev->fps) - do_gettimeofday(&pcdev->first_tv); - - pcdev->fps++; - if (!pcdev->active) - goto end; - if (pcdev->frame_inval > 0) { - pcdev->frame_inval--; - rk_videobuf_capture_mix(pcdev->active, pcdev, 0); - - goto end; - } else if (pcdev->frame_inval) { - RKCAMERA_TR("frame_inval : %0x", pcdev->frame_inval); - pcdev->frame_inval = 0; - } - - if (pcdev->fps == RK30_CAM_FRAME_MEASURE) { - do_gettimeofday(&tv); - pcdev->frame_interval = - ((tv.tv_sec * 1000000 + tv.tv_usec) - - (pcdev->first_tv.tv_sec * 1000000 + - pcdev->first_tv.tv_usec)) - / (RK30_CAM_FRAME_MEASURE - 1); - } - - frame_num = tmp_cif_frmst >> 16; - frame_num = (frame_num % 2); - - if (frame_num) { - active = &pcdev->active; - flag = 0; - } else if (!frame_num) { - active = &pcdev->active1; - flag = 1; - } else { - RKCAMERA_TR("%s(%d): irq frame error\n", - __func__, __LINE__); - goto end; - } - - if (!(*active)) { - RKCAMERA_TR("%s(%d): active = NULL\n", - __func__, __LINE__); - goto end; - } - - vb = *active; - if (!vb) { - RKCAMERA_TR("%s(%d): no active buffer\n", - __func__, __LINE__); - goto end; - } - - if (!list_empty(&pcdev->capture)) { - active_buf = list_entry(pcdev->capture.next, - struct videobuf_buffer, queue); - if (active_buf) { - RKCAMERA_DG1("flag = %d, active_buf->i: %d\n", - flag, active_buf->i); - WARN_ON(active_buf->state != VIDEOBUF_QUEUED); - if (flag == 0) { - pcdev->active_delay = pcdev->active; - pcdev->active = active_buf; - } else if (flag == 1) { - pcdev->active_delay = pcdev->active1; - pcdev->active1 = active_buf; - } else { - RKCAMERA_DG1("irq frame status erro or no a suitable buf!\n"); - goto end; - } - rk_videobuf_capture_mix(active_buf, - pcdev, flag); - list_del_init(&active_buf->queue); - } else { - RKCAMERA_TR("video_buf queue is empty!\n"); - } - } else { - RKCAMERA_TR("video_buf queue is empty!\n"); - goto end; - } - - vb = pcdev->active_delay; - if (!vb) { - RKCAMERA_TR("no acticve buffer!!!\n"); - goto end; - } - - /* ddl@rock-chips.com : - * this vb may be deleted from queue - */ - if ((vb->state == VIDEOBUF_QUEUED) || - (vb->state == VIDEOBUF_ACTIVE)) - list_del_init(&vb->queue); - - do_gettimeofday(&vb->ts); - if ((vb->state == VIDEOBUF_QUEUED) || - (vb->state == VIDEOBUF_ACTIVE)) { - vb->state = VIDEOBUF_DONE; - vb->field_count++; - } - - wake_up(&vb->done); - } - -end: - if ((reg_cifctrl & ENABLE_CAPTURE) == 0) - write_cif_reg(pcdev->base, CIF_CIF_CTRL, - (reg_cifctrl | ENABLE_CAPTURE)); - return IRQ_HANDLED; -} - -static irqreturn_t rk_camera_irq(int irq, void *data) -{ - struct rk_camera_dev *pcdev = data; - unsigned int reg_intstat; - - //should set value in cif irq - static int rec_stop_cif = 0; - - spin_lock(&pcdev->lock); - - - reg_intstat = read_cif_reg(pcdev->base,CIF_CIF_INTSTAT); - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s() ,reg_intstat 0x%x\n", __FILE__, __LINE__,__FUNCTION__,reg_intstat); - if (reg_intstat & 0x0200){ - rk_camera_cifirq(irq,data); - if(atomic_read(&pcdev->stop_cif)) - rec_stop_cif ++; - if(rec_stop_cif){ - debug_printk("receive cif stop request, recevie cif irq,reg_intstat = 0x%x\n",reg_intstat); - } - } - - if (reg_intstat & 0x01){ - if(rec_stop_cif == 1){ - pcdev->cif_stopped = true; - rec_stop_cif = 0; - write_cif_reg(pcdev->base,CIF_CIF_INTEN, 0x0); - //workaround: disabled capen can't stop cif really,so should reset instead. - rk_camera_cif_reset(pcdev,false); - debug_printk("receive cif stop request,recevie dma irq ,reg_intstat = 0x%x\n",reg_intstat); - wake_up(&pcdev->cif_stop_done); - } else { - if (pcdev->capture_pingpong) - rk_camera_dmairq_pingpong(irq, data); - else - rk_camera_dmairq(irq,data); - } - } - -//end: - spin_unlock(&pcdev->lock); - return IRQ_HANDLED; -} - - -static void rk_videobuf_release(struct videobuf_queue *vq, - struct videobuf_buffer *vb) -{ - struct rk_camera_buffer *buf = container_of(vb, struct rk_camera_buffer, vb); - struct soc_camera_device *icd = vq->priv_data; - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); - struct rk_camera_dev *pcdev = ici->priv; -#if CAMERA_VIDEOBUF_ARM_ACCESS - struct rk29_camera_vbinfo *vb_info =NULL; -#endif - -#ifdef DEBUG - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__, - vb, vb->baddr, vb->bsize); - - switch (vb->state) - { - case VIDEOBUF_ACTIVE: - dev_dbg(&icd->dev, "%s (active)\n", __func__); - break; - case VIDEOBUF_QUEUED: - dev_dbg(&icd->dev, "%s (queued)\n", __func__); - break; - case VIDEOBUF_PREPARED: - dev_dbg(&icd->dev, "%s (prepared)\n", __func__); - break; - default: - dev_dbg(&icd->dev, "%s (unknown)\n", __func__); - break; - } -#endif - - flush_workqueue(pcdev->camera_wq); - #ifdef RK_CAMERA_MODE_DMA_SG - rk_camera_dmabuf_cb(pcdev, vb, false); - #endif - rk_videobuf_free(vq, buf); - -#if CAMERA_VIDEOBUF_ARM_ACCESS - if ((pcdev->vbinfo) && (vb->i < pcdev->vbinfo_count)) { - vb_info = pcdev->vbinfo + vb->i; - - if (vb_info->vir_addr) { - iounmap(vb_info->vir_addr); - release_mem_region(vb_info->phy_addr, vb_info->size); - memset(vb_info, 0x00, sizeof(struct rk29_camera_vbinfo)); - } - - } -#endif -} - -static struct videobuf_queue_ops rk_videobuf_ops = -{ - .buf_setup = rk_videobuf_setup, - .buf_prepare = rk_videobuf_prepare, - .buf_queue = rk_videobuf_queue, - .buf_release = rk_videobuf_release, -}; - -static void rk_camera_init_videobuf(struct videobuf_queue *q, - struct soc_camera_device *icd) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); - struct rk_camera_dev *pcdev = ici->priv; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - /* We must pass NULL as dev pointer, then all pci_* dma operations - * transform to normal dma_* ones. */ - videobuf_queue_dma_contig_init(q, - &rk_videobuf_ops, - ici->v4l2_dev.dev, &pcdev->lock, - V4L2_BUF_TYPE_VIDEO_CAPTURE, - V4L2_FIELD_NONE, - sizeof(struct rk_camera_buffer), - icd,&(ici->host_lock) ); -} - -static int rk_camera_mclk_ctrl(int cif_idx, int on, int clk_rate) -{ - int err = 0, cif; - struct rk_cif_clk *clk; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - cif = cif_idx - RK29_CAM_PLATFORM_DEV_ID; - if ((cif < 0) || (cif > 1)) { - RKCAMERA_TR("cif index(%d) is invalidate\n", cif_idx); - err = -1; - goto rk_camera_clk_ctrl_end; - } - - clk = &cif_clk[cif]; - if ((CHIP_NAME == 3228) || (CHIP_NAME == 3326)) { - if (!clk->aclk_cif || !clk->hclk_cif || !clk->cif_clk_out) { - RKCAMERA_TR("failed to get cif clock source\n"); - err = -ENOENT; - goto rk_camera_clk_ctrl_end; - } - } else { - if (!clk->aclk_cif || !clk->hclk_cif || - !clk->cif_clk_in || !clk->cif_clk_out) { - RKCAMERA_TR("failed to get cif clock source\n"); - err = -ENOENT; - goto rk_camera_clk_ctrl_end; - } - } - - /* spin_lock(&clk->lock); */ - if (on && !clk->on) { - rockchip_set_system_status(SYS_STATUS_ISP); - if (CHIP_NAME == 3368) - clk_prepare_enable(clk->pclk_cif); - - clk_prepare_enable(clk->aclk_cif); - clk_prepare_enable(clk->hclk_cif); - if ((CHIP_NAME != 3228) || (CHIP_NAME != 3326)) - clk_prepare_enable(clk->cif_clk_in); - - clk_prepare_enable(clk->cif_clk_out); - clk_set_rate(clk->cif_clk_out, clk_rate); - pm_runtime_get_sync(priv_camera_dev->dev); - clk->on = true; - } else if (!on && clk->on) { - pm_runtime_put(priv_camera_dev->dev); - clk_set_rate(clk->cif_clk_out,36000000);/*just for close clk which base on XIN24M */ - clk_disable_unprepare(clk->aclk_cif); - clk_disable_unprepare(clk->hclk_cif); - if ((CHIP_NAME != 3228) || (CHIP_NAME != 3326)) - clk_disable_unprepare(clk->cif_clk_in); - clk_disable_unprepare(clk->cif_clk_out); - if (CHIP_NAME == 3368) - clk_disable_unprepare(clk->pclk_cif); - rockchip_clear_system_status(SYS_STATUS_ISP); - clk->on = false; - } - /* spin_unlock(&clk->lock); */ -rk_camera_clk_ctrl_end: - return err; -} - -static int rk_camera_activate(struct rk_camera_dev *pcdev, struct soc_camera_device *icd) -{ - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - rk_camera_mclk_ctrl(RK29_CAM_PLATFORM_DEV_ID, 1, 24000000); - - write_cif_reg(pcdev->base, CIF_CIF_CTRL, - AXI_BURST_16 | MODE_ONEFRAME | DISABLE_CAPTURE); - - return 0; -} - -static void rk_camera_deactivate(struct rk_camera_dev *pcdev) -{ - /* - * ddl@rock-chips.com : - * Cif clk control in rk_sensor_power which in rk_camera.c - */ - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - rk_camera_mclk_ctrl(RK29_CAM_PLATFORM_DEV_ID, 0, 24000000); - - return; -} - -/* - * The following two functions absolutely depend on the fact, that - * there can be only one camera on RK28 quick capture interface - */ -static int rk_camera_add_device(struct soc_camera_device *icd) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); - /*Initialize in rk_camra_prob*/ - struct rk_camera_dev *pcdev = ici->priv; - struct device *control = to_soc_camera_control(icd); - struct v4l2_subdev *sd; - int ret, i, icd_catch; - struct rk_camera_frmivalenum *fival_list, *fival_nxt; - struct v4l2_cropcap cropcap; - struct v4l2_mbus_framefmt mf; - const struct soc_camera_format_xlate *xlate = NULL; - - mutex_lock(&camera_lock); - if (pcdev->icd) { - ret = -EBUSY; - goto ebusy; - } - - RKCAMERA_DG1("%s driver attached to %s\n", - RK29_CAM_DRV_NAME, - dev_name(icd->pdev)); - - pcdev->frame_inval = RK_CAM_FRAME_INVAL_INIT; - pcdev->active = NULL; - pcdev->active1 = NULL; - pcdev->icd = NULL; - pcdev->reginfo_suspend.Inval = Reg_Invalidate; - pcdev->zoominfo.zoom_rate = 100; - pcdev->fps_timer.istarted = false; - - /* - * ddl@rock-chips.com: - * capture list must be reset, because this list may be not empty, - * if app havn't dequeue all videobuf before close camera device; - */ - INIT_LIST_HEAD(&pcdev->capture); - - ret = rk_camera_activate(pcdev, icd); - if (ret) - goto ebusy; - /* - * ddl@rock-chips.com : - * v4l2_subdev is not created when ici->ops->add called in - * soc_camera_probe - * - * TRUE in open ,FALSE in kernel start - */ - if (control) { - sd = dev_get_drvdata(control); - v4l2_subdev_call(sd, core, ioctl, RK29_CAM_SUBDEV_IOREQUEST, - (void *)pcdev->pdata); - v4l2_subdev_call(sd, core, ioctl, RK29_CAM_SUBDEV_CB_REGISTER, - (void *)(&pcdev->icd_cb)); - if (v4l2_subdev_call(sd, video, cropcap, &cropcap) == 0) { - memcpy(&pcdev->cropinfo.bounds, &cropcap.bounds, - sizeof(struct v4l2_rect)); - } else { - xlate = soc_camera_xlate_by_fourcc(icd, - V4L2_PIX_FMT_NV12); - mf.width = 10000; - mf.height = 10000; - mf.field = V4L2_FIELD_NONE; - mf.code = xlate->code; - mf.reserved[6] = 0xfe5a; - v4l2_subdev_call(sd, video, try_mbus_fmt, &mf); - - pcdev->cropinfo.bounds.left = 0; - pcdev->cropinfo.bounds.top = 0; - pcdev->cropinfo.bounds.width = mf.width; - pcdev->cropinfo.bounds.height = mf.height; - } - } - - pcdev->icd = icd; - pcdev->icd_init = 0; - icd_catch = 0; - for (i = 0; i < 2; i++) { - if (pcdev->icd_frmival[i].icd == icd) - icd_catch = 1; - if (!pcdev->icd_frmival[i].icd) { - pcdev->icd_frmival[i].icd = icd; - icd_catch = 1; - } - } - if (icd_catch == 0) { - fival_list = pcdev->icd_frmival[0].fival_list; - fival_nxt = fival_list; - while (fival_nxt) { - fival_nxt = fival_list->nxt; - kfree(fival_list); - fival_list = fival_nxt; - } - pcdev->icd_frmival[0].icd = icd; - pcdev->icd_frmival[0].fival_list = - kzalloc(sizeof(struct rk_camera_frmivalenum), - GFP_KERNEL); - } -ebusy: - mutex_unlock(&camera_lock); - - return ret; -} -static void rk_camera_remove_device(struct soc_camera_device *icd) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); - struct rk_camera_dev *pcdev = ici->priv; -#if CAMERA_VIDEOBUF_ARM_ACCESS - struct rk29_camera_vbinfo *vb_info; - unsigned int i; -#endif - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - - mutex_lock(&camera_lock); - BUG_ON(icd != pcdev->icd); - - RKCAMERA_DG1("%s driver detached from %s\n",RK29_CAM_DRV_NAME,dev_name(icd->pdev)); - - /* ddl@rock-chips.com: Application will call VIDIOC_STREAMOFF before close device, but - stream may be turn on again before close device, if suspend and resume happened. */ - /*if (read_cif_reg(pcdev->base,CIF_CIF_CTRL) & ENABLE_CAPTURE) {*/ - if ((atomic_read(&pcdev->stop_cif) == false) && pcdev->fps_timer.istarted) { /* ddl@rock-chips.com: v0.3.0x15*/ - rk_camera_s_stream(icd,0); - } - /* move DEACTIVATE into generic_sensor_s_power*/ - /* v4l2_subdev_call(sd, core, ioctl, RK29_CAM_SUBDEV_DEACTIVATE,NULL);*/ - /* if stream off is not been executed,timer is running.*/ - if(pcdev->fps_timer.istarted){ - hrtimer_cancel(&pcdev->fps_timer.timer); - pcdev->fps_timer.istarted = false; - } - flush_work(&(pcdev->camera_reinit_work.work)); - flush_workqueue((pcdev->camera_wq)); - - if (pcdev->camera_work) { - kfree(pcdev->camera_work); - pcdev->camera_work = NULL; - pcdev->camera_work_count = 0; - INIT_LIST_HEAD(&pcdev->camera_work_queue); - } - rk_camera_deactivate(pcdev); -#if CAMERA_VIDEOBUF_ARM_ACCESS - if (pcdev->vbinfo) { - vb_info = pcdev->vbinfo; - for (i=0; ivbinfo_count; i++) { - if (vb_info->vir_addr) { - iounmap(vb_info->vir_addr); - release_mem_region(vb_info->phy_addr, vb_info->size); - memset(vb_info, 0x00, sizeof(struct rk29_camera_vbinfo)); - } - vb_info++; - } - kfree(pcdev->vbinfo); - pcdev->vbinfo = NULL; - pcdev->vbinfo_count = 0; - } -#endif - pcdev->active = NULL; - pcdev->active1 = NULL; - pcdev->icd = NULL; - pcdev->icd_cb.sensor_cb = NULL; - pcdev->reginfo_suspend.Inval = Reg_Invalidate; - /* ddl@rock-chips.com: capture list must be reset, because this list may be not empty, - * if app havn't dequeue all videobuf before close camera device; - */ - INIT_LIST_HEAD(&pcdev->capture); - - mutex_unlock(&camera_lock); - - return; -} - -static int rk_camera_set_bus_param(struct soc_camera_device *icd) -{ - unsigned long bus_flags, camera_flags, common_flags = 0; - unsigned int cif_for = 0; - const struct soc_mbus_pixelfmt *fmt; - int ret = 0; - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); - struct rk_camera_dev *pcdev = ici->priv; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - fmt = soc_mbus_get_fmtdesc(icd->current_fmt->code); - if (!fmt) - return -EINVAL; - - bus_flags = RK_CAM_BUS_PARAM; - /* If requested data width is supported by the platform, use it */ - switch (fmt->bits_per_sample) { - case 10: - if (!(bus_flags & SOCAM_DATAWIDTH_10)) - return -EINVAL; - break; - case 9: - if (!(bus_flags & SOCAM_DATAWIDTH_9)) - return -EINVAL; - break; - case 8: - if (!(bus_flags & SOCAM_DATAWIDTH_8)) - return -EINVAL; - break; - default: - return -EINVAL; - } - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - if (icd->ops->query_bus_param) - camera_flags = icd->ops->query_bus_param(icd); - else - camera_flags = 0; - -/**************yzm************ - common_flags = soc_camera_bus_param_compatible(camera_flags, bus_flags); - if (!common_flags) { - ret = -EINVAL; - goto RK_CAMERA_SET_BUS_PARAM_END; - } -*/ -/***************yzm************end*/ - - - common_flags = camera_flags; - ret = icd->ops->set_bus_param(icd, common_flags); - if (ret < 0) - goto RK_CAMERA_SET_BUS_PARAM_END; - - cif_for = read_cif_reg(pcdev->base,CIF_CIF_FOR); - - if (common_flags & V4L2_MBUS_PCLK_SAMPLE_FALLING) { - if (IS_CIF0()) { - if ((CHIP_NAME == 3228) || (CHIP_NAME == 3326)) - write_grf_reg(CRU_PCLK_REG30, - read_grf_reg(CRU_PCLK_REG30) | ENANABLE_INVERT_PCLK_CIF0); - else - clk_set_phase(cif_clk[0].pclk_cif, 180); - } else { - clk_set_phase(cif_clk[1].pclk_cif, 180); - } - } else { - if(IS_CIF0()){ - if (CHIP_NAME == 3228) - write_grf_reg(CRU_PCLK_REG30, - (read_grf_reg(CRU_PCLK_REG30) & 0xFFFF7FFF) | DISABLE_INVERT_PCLK_CIF0); - else if (CHIP_NAME == 3326) - write_grf_reg(CRU_PCLK_REG30, - (read_grf_reg(CRU_PCLK_REG30) & 0xFFFFEFFF) | DISABLE_INVERT_PCLK_CIF0); - else - clk_set_phase(cif_clk[0].pclk_cif, 0); - } else { - clk_set_phase(cif_clk[1].pclk_cif, 0); - } - } - - if (common_flags & V4L2_MBUS_HSYNC_ACTIVE_LOW) { - cif_for |= HSY_LOW_ACTIVE; - } else { - cif_for &= ~HSY_LOW_ACTIVE; - } - if (common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH) { - cif_for |= VSY_HIGH_ACTIVE; - } else { - cif_for &= ~VSY_HIGH_ACTIVE; - } - - // ddl@rock-chips.com : Don't enable capture here, enable in stream_on - //vip_ctrl_val |= ENABLE_CAPTURE; - write_cif_reg(pcdev->base,CIF_CIF_FOR, cif_for); - RKCAMERA_DG1("CIF_CIF_FOR: 0x%x \n",cif_for); - -RK_CAMERA_SET_BUS_PARAM_END: - if (ret) - RKCAMERA_TR("rk_camera_set_bus_param ret = %d \n", ret); - return ret; -} - -static int rk_camera_try_bus_param(struct soc_camera_device *icd, __u32 pixfmt) -{ -/* unsigned long bus_flags, camera_flags;*/ -/* int ret;*/ - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); -/**********yzm*********** - - bus_flags = RK_CAM_BUS_PARAM; - if (icd->ops->query_bus_param) { - camera_flags = icd->ops->query_bus_param(icd); //generic_sensor_query_bus_param() - } else { - camera_flags = 0; - } - ret = soc_camera_bus_param_compatible(camera_flags, bus_flags) ; - - if (ret < 0) - dev_warn(icd->dev.parent, - "Flags incompatible: camera %lx, host %lx\n", - camera_flags, bus_flags); - - return ret; -*///************yzm **************end - return 0; - -} - -static const struct soc_mbus_pixelfmt rk_camera_formats[] = { - { - .fourcc = V4L2_PIX_FMT_NV12, - .name = "YUV420 NV12", - .bits_per_sample = 8, - .packing = SOC_MBUS_PACKING_1_5X8, - .order = SOC_MBUS_ORDER_LE, - },{ - .fourcc = V4L2_PIX_FMT_NV16, - .name = "YUV422 NV16", - .bits_per_sample = 8, - .packing = SOC_MBUS_PACKING_2X8_PADHI, - .order = SOC_MBUS_ORDER_LE, - },{ - .fourcc = V4L2_PIX_FMT_NV21, - .name = "YUV420 NV21", - .bits_per_sample = 8, - .packing = SOC_MBUS_PACKING_1_5X8, - .order = SOC_MBUS_ORDER_LE, - },{ - .fourcc = V4L2_PIX_FMT_NV61, - .name = "YUV422 NV61", - .bits_per_sample = 8, - .packing = SOC_MBUS_PACKING_2X8_PADHI, - .order = SOC_MBUS_ORDER_LE, - },{ - .fourcc = V4L2_PIX_FMT_RGB565, - .name = "RGB565", - .bits_per_sample = 8, - .packing = SOC_MBUS_PACKING_2X8_PADHI, - .order = SOC_MBUS_ORDER_LE, - },{ - .fourcc = V4L2_PIX_FMT_RGB24, - .name = "RGB888", - .bits_per_sample = 8, - .packing = SOC_MBUS_PACKING_2X8_PADHI, - .order = SOC_MBUS_ORDER_LE, - } - -}; - -static void rk_camera_setup_format(struct soc_camera_device *icd, __u32 host_pixfmt, u32 icd_code, struct v4l2_rect *rect) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); - struct rk_camera_dev *pcdev = ici->priv; - struct v4l2_subdev *sd = soc_camera_to_subdev(icd); - unsigned int cif_fs = 0,cif_crop = 0; - unsigned int cif_fmt_val; - const struct soc_mbus_pixelfmt *fmt; - struct rk_camera_device_signal_config dev_sig_cnf; - - v4l2_subdev_call(sd, core, ioctl, RK29_CAM_SUBDEV_GET_INTERFACE, &dev_sig_cnf); - if (dev_sig_cnf.type == RK_CAMERA_DEVICE_CVBS_NTSC) - cif_fmt_val = INPUT_MODE_NTSC | YUV_OUTPUT_420; - else if (dev_sig_cnf.type == RK_CAMERA_DEVICE_CVBS_PAL) - cif_fmt_val = INPUT_MODE_PAL | YUV_OUTPUT_420; - else - cif_fmt_val = INPUT_MODE_YUV | YUV_INPUT_422 | INPUT_420_ORDER_EVEN | OUTPUT_420_ORDER_EVEN; - - if (dev_sig_cnf.type == RK_CAMERA_DEVICE_BT601_8 || - dev_sig_cnf.type == RK_CAMERA_DEVICE_CVBS_DEINTERLACE || - dev_sig_cnf.type == RK_CAMERA_DEVICE_BT601_PIONGPONG) { - if (dev_sig_cnf.dvp.vsync == RK_CAMERA_DEVICE_SIGNAL_HIGH_LEVEL) - cif_fmt_val |= VSY_HIGH_ACTIVE; - else - cif_fmt_val |= VSY_LOW_ACTIVE; - - if (dev_sig_cnf.dvp.hsync == RK_CAMERA_DEVICE_SIGNAL_HIGH_LEVEL) - cif_fmt_val |= HSY_HIGH_ACTIVE; - else - cif_fmt_val |= HSY_LOW_ACTIVE; - } - - pcdev->capture_pingpong = 0; - if (dev_sig_cnf.type == RK_CAMERA_DEVICE_BT601_PIONGPONG) - pcdev->capture_pingpong = 1; - - if (dev_sig_cnf.code) - icd_code = dev_sig_cnf.code; - fmt = soc_mbus_get_fmtdesc(icd_code); - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - if((host_pixfmt == V4L2_PIX_FMT_RGB565) || (host_pixfmt == V4L2_PIX_FMT_RGB24)){ - if(fmt->fourcc == V4L2_PIX_FMT_NV12) - host_pixfmt = V4L2_PIX_FMT_NV12; - else if(fmt->fourcc == V4L2_PIX_FMT_NV21) - host_pixfmt = V4L2_PIX_FMT_NV21; - } - switch (host_pixfmt) - { - case V4L2_PIX_FMT_NV16: - cif_fmt_val &= ~YUV_OUTPUT_422; - cif_fmt_val &= ~UV_STORAGE_ORDER_UVUV; - pcdev->frame_inval = RK_CAM_FRAME_INVAL_DC; - pcdev->pixfmt = host_pixfmt; - break; - case V4L2_PIX_FMT_NV61: - cif_fmt_val &= ~YUV_OUTPUT_422; - cif_fmt_val |= UV_STORAGE_ORDER_VUVU; - pcdev->frame_inval = RK_CAM_FRAME_INVAL_DC; - pcdev->pixfmt = host_pixfmt; - break; - case V4L2_PIX_FMT_NV12: - cif_fmt_val |= YUV_OUTPUT_420; - cif_fmt_val &= ~UV_STORAGE_ORDER_UVUV; - if (pcdev->frame_inval != RK_CAM_FRAME_INVAL_INIT) - pcdev->frame_inval = RK_CAM_FRAME_INVAL_INIT; - pcdev->pixfmt = host_pixfmt; - break; - case V4L2_PIX_FMT_NV21: - cif_fmt_val |= YUV_OUTPUT_420; - cif_fmt_val |= UV_STORAGE_ORDER_VUVU; - if (pcdev->frame_inval != RK_CAM_FRAME_INVAL_INIT) - pcdev->frame_inval = RK_CAM_FRAME_INVAL_INIT; - pcdev->pixfmt = host_pixfmt; - break; - default: /* ddl@rock-chips.com : vip output format is hold when pixfmt is invalidate */ - cif_fmt_val |= YUV_OUTPUT_422; - break; - } - switch (icd_code) - { - case MEDIA_BUS_FMT_UYVY8_2X8: - cif_fmt_val = YUV_INPUT_ORDER_UYVY(cif_fmt_val); - break; - case MEDIA_BUS_FMT_YUYV8_2X8: - cif_fmt_val = YUV_INPUT_ORDER_YUYV(cif_fmt_val); - break; - case MEDIA_BUS_FMT_YVYU8_2X8: - cif_fmt_val = YUV_INPUT_ORDER_YVYU(cif_fmt_val); - break; - case MEDIA_BUS_FMT_VYUY8_2X8: - cif_fmt_val = YUV_INPUT_ORDER_VYUY(cif_fmt_val); - break; - default : - cif_fmt_val = YUV_INPUT_ORDER_YUYV(cif_fmt_val); - break; - } - - mdelay(100); - rk_camera_cif_reset(pcdev,true); - - write_cif_reg(pcdev->base,CIF_CIF_CTRL,AXI_BURST_16|MODE_ONEFRAME|DISABLE_CAPTURE); /* ddl@rock-chips.com : vip ahb burst 16 */ - //write_cif_reg(pcdev->base,CIF_CIF_INTEN, 0x01|0x200); /*capture complete interrupt enable*/ - - write_cif_reg(pcdev->base,CIF_CIF_FOR,cif_fmt_val); /* ddl@rock-chips.com: VIP capture mode and capture format must be set before FS register set */ - - write_cif_reg(pcdev->base,CIF_CIF_INTSTAT,0xFFFFFFFF); - - cif_crop = ((rect->left + dev_sig_cnf.crop.left) + - ((rect->top + dev_sig_cnf.crop.top) << 16)); - - if (dev_sig_cnf.crop.width || dev_sig_cnf.crop.height) - cif_fs = (dev_sig_cnf.crop.width + - (dev_sig_cnf.crop.height << 16)); - else - cif_fs = (rect->width + (rect->height << 16)); - - write_cif_reg(pcdev->base,CIF_CIF_CROP, cif_crop); - write_cif_reg(pcdev->base,CIF_CIF_SET_SIZE, cif_fs); - write_cif_reg(pcdev->base,CIF_CIF_VIR_LINE_WIDTH, rect->width); - if (pcdev->capture_pingpong) - write_cif_reg(pcdev->base, CIF_CIF_FRAME_STATUS, 0x10000002); - else - write_cif_reg(pcdev->base, CIF_CIF_FRAME_STATUS, 0x00000003); - - /*MUST bypass scale */ - write_cif_reg(pcdev->base,CIF_CIF_SCL_CTRL,0x10); - RKCAMERA_DG1("CIF_CIF_CROP:0x%x CIF_CIF_FS:0x%x CIF_CIF_FOR:0x%x\n", - cif_crop, cif_fs, cif_fmt_val); - return; -} - -static int rk_camera_get_formats(struct soc_camera_device *icd, unsigned int idx, - struct soc_camera_format_xlate *xlate) -{ - struct v4l2_subdev *sd = soc_camera_to_subdev(icd); - struct device *dev = icd->parent; - int formats = 0, ret; - u32 code; - const struct soc_mbus_pixelfmt *fmt; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code); - if (ret < 0) - /* No more formats */ - return 0; - - fmt = soc_mbus_get_fmtdesc(code); - if (!fmt) { - dev_err(dev, "Invalid format code #%u: %d\n", idx, code); - return 0; - } - - ret = rk_camera_try_bus_param(icd, fmt->bits_per_sample); - if (ret < 0) - return 0; - - switch (code) { - case MEDIA_BUS_FMT_UYVY8_2X8: - case MEDIA_BUS_FMT_YUYV8_2X8: - case MEDIA_BUS_FMT_YVYU8_2X8: - case MEDIA_BUS_FMT_VYUY8_2X8: - { - -#if (CONFIG_CAMERA_SCALE_CROP_MACHINE != RK_CAM_SCALE_CROP_RGA) - formats++; - if (xlate) { - xlate->host_fmt = &rk_camera_formats[0]; - xlate->code = code; - xlate++; - dev_dbg(dev, "Providing format %s using code %d\n", - rk_camera_formats[0].name,code); - } - - formats++; - if (xlate) { - xlate->host_fmt = &rk_camera_formats[1]; - xlate->code = code; - xlate++; - dev_dbg(dev, "Providing format %s using code %d\n", - rk_camera_formats[1].name,code); - } - - formats++; - if (xlate) { - xlate->host_fmt = &rk_camera_formats[2]; - xlate->code = code; - xlate++; - dev_dbg(dev, "Providing format %s using code %d\n", - rk_camera_formats[2].name,code); - } - - formats++; - if (xlate) { - xlate->host_fmt = &rk_camera_formats[3]; - xlate->code = code; - xlate++; - dev_dbg(dev, "Providing format %s using code %d\n", - rk_camera_formats[3].name,code); - } - break; -#else - formats++; - if (xlate) { - xlate->host_fmt = &rk_camera_formats[4]; - xlate->code = code; - xlate++; - dev_dbg(dev, "Providing format %s using code %d\n", - rk_camera_formats[4].name,code); - } - formats++; - if (xlate) { - xlate->host_fmt = &rk_camera_formats[5]; - xlate->code = code; - xlate++; - dev_dbg(dev, "Providing format %s using code %d\n", - rk_camera_formats[5].name,code); - } - break; -#endif - } - default: - break; - } - - return formats; -} - -static void rk_camera_put_formats(struct soc_camera_device *icd) -{ - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - return; -} -static int rk_camera_cropcap(struct soc_camera_device *icd, struct v4l2_cropcap *cropcap) -{ - struct v4l2_subdev *sd = soc_camera_to_subdev(icd); - int ret=0; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - ret = v4l2_subdev_call(sd, video, cropcap, cropcap); - if (ret != 0) - goto end; - /* ddl@rock-chips.com: driver decide the cropping rectangle */ - memset(&cropcap->defrect,0x00,sizeof(struct v4l2_rect)); -end: - return ret; -} -static int rk_camera_get_crop(struct soc_camera_device *icd,struct v4l2_crop *crop) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); - struct rk_camera_dev *pcdev = ici->priv; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - spin_lock(&pcdev->cropinfo.lock); - memcpy(&crop->c,&pcdev->cropinfo.c,sizeof(struct v4l2_rect)); - spin_unlock(&pcdev->cropinfo.lock); - - return 0; -} -static int rk_camera_set_crop(struct soc_camera_device *icd, - const struct v4l2_crop *crop) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); - struct rk_camera_dev *pcdev = ici->priv; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - spin_lock(&pcdev->cropinfo.lock); - memcpy(&pcdev->cropinfo.c,&crop->c,sizeof(struct v4l2_rect)); - spin_unlock(&pcdev->cropinfo.lock); - return 0; -} -static bool rk_camera_fmt_capturechk(struct v4l2_format *f) -{ - bool ret = false; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - if (f->fmt.pix.priv == 0xfefe5a5a) { - ret = true; - } - - if ((f->fmt.pix.width == 1024) && (f->fmt.pix.height == 768)) { - ret = true; - } else if ((f->fmt.pix.width == 1280) && (f->fmt.pix.height == 1024)) { - ret = true; - } else if ((f->fmt.pix.width == 1600) && (f->fmt.pix.height == 1200)) { - ret = true; - } else if ((f->fmt.pix.width == 2048) && (f->fmt.pix.height == 1536)) { - ret = true; - } else if ((f->fmt.pix.width == 2592) && (f->fmt.pix.height == 1944)) { - ret = true; - } else if ((f->fmt.pix.width == 3264) && (f->fmt.pix.height == 2448)) { - ret = true; - } - - if (ret == true) - RKCAMERA_DG1("%dx%d is capture format\n",f->fmt.pix.width, f->fmt.pix.height); - return ret; -} - -static int rk_camera_get_fmt(struct soc_camera_device *icd, - struct v4l2_format *f) -{ - struct v4l2_pix_format *pix = &f->fmt.pix; - struct v4l2_subdev *sd = soc_camera_to_subdev(icd); - struct rk_camera_device_signal_config dev_sig_cnf; - - v4l2_subdev_call(sd, core, ioctl, - RK29_CAM_SUBDEV_GET_INTERFACE, &dev_sig_cnf); - if (dev_sig_cnf.crop.width > 32 && dev_sig_cnf.crop.width <= 8192) { - pix->width = dev_sig_cnf.crop.width; - pix->height = dev_sig_cnf.crop.height; - RKCAMERA_DG1("rk_camera_get_fmt: f->fmt->pixsize %dx%d\n", - f->fmt.pix.width, f->fmt.pix.height); - } - - return 0; -} - -static int rk_camera_set_fmt(struct soc_camera_device *icd, - struct v4l2_format *f) -{ - struct device *dev = icd->parent; - struct v4l2_subdev *sd = soc_camera_to_subdev(icd); - const struct soc_camera_format_xlate *xlate = NULL; - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); - struct rk_camera_dev *pcdev = ici->priv; - struct v4l2_pix_format *pix = &f->fmt.pix; - struct v4l2_mbus_framefmt mf; - struct v4l2_rect rect; - int ret,usr_w,usr_h,sensor_w,sensor_h; - int stream_on = 0; - int ratio, bounds_aspect; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - usr_w = pix->width; - usr_h = pix->height; - - RKCAMERA_DG1("enter width:%d height:%d\n",usr_w,usr_h); - xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat); - if (!xlate) { - dev_err(dev, "Format %x not found\n", pix->pixelformat); - ret = -EINVAL; - goto RK_CAMERA_SET_FMT_END; - } - - /* ddl@rock-chips.com: sensor init code transmit in here after open */ - if (pcdev->icd_init == 0) { - v4l2_subdev_call(sd,core, init, 0); - pcdev->icd_init = 1; - return 0; - } - stream_on = read_cif_reg(pcdev->base,CIF_CIF_CTRL); - if (stream_on & ENABLE_CAPTURE) - write_cif_reg(pcdev->base,CIF_CIF_CTRL, (stream_on & (~ENABLE_CAPTURE))); - - mf.width = pix->width; - mf.height = pix->height; - mf.field = pix->field; - mf.colorspace = pix->colorspace; - mf.code = xlate->code; - mf.reserved[0] = pix->priv; /* ddl@rock-chips.com : v0.3.3 */ - mf.reserved[1] = 0; - - ret = v4l2_subdev_call(sd, video, s_mbus_fmt, &mf); - if (mf.code != xlate->code) - return -EINVAL; - - if ((pcdev->cropinfo.c.width == pcdev->cropinfo.bounds.width) && - (pcdev->cropinfo.c.height == pcdev->cropinfo.bounds.height)) { - bounds_aspect = (pcdev->cropinfo.bounds.width*10/pcdev->cropinfo.bounds.height); - if ((mf.width*10/mf.height) != bounds_aspect) { - RKCAMERA_DG1("User request fov unchanged in %dx%d, But sensor %dx%d is croped, so switch to full resolution %dx%d\n", - usr_w,usr_h,mf.width, mf.height,pcdev->cropinfo.bounds.width,pcdev->cropinfo.bounds.height); - - mf.width = pcdev->cropinfo.bounds.width/4; - mf.height = pcdev->cropinfo.bounds.height/4; - - mf.field = pix->field; - mf.colorspace = pix->colorspace; - mf.code = xlate->code; - mf.reserved[0] = pix->priv; - mf.reserved[1] = 0; - - ret = v4l2_subdev_call(sd, video, s_mbus_fmt, &mf); - if (mf.code != xlate->code) - return -EINVAL; - } - } - - sensor_w = mf.width; - sensor_h = mf.height; - - ratio = ((mf.width*mf.reserved[1])/100)&(~0x03); /* 4 align*/ - mf.width -= ratio; - - ratio = ((ratio*mf.height/mf.width)+1)&(~0x01); /* 2 align*/ - mf.height -= ratio; - - if ((mf.width != usr_w) || (mf.height != usr_h)) { - - if (unlikely((mf.width <16) || (mf.width > 8190) || (mf.height < 16) || (mf.height > 8190))) { - RKCAMERA_TR("Senor and IPP both invalid source resolution(%dx%d)\n",mf.width,mf.height); - ret = -EINVAL; - goto RK_CAMERA_SET_FMT_END; - } - if (unlikely((usr_w <16)||(usr_h < 16))) { - RKCAMERA_TR("Senor and IPP both invalid destination resolution(%dx%d)\n",usr_w,usr_h); - ret = -EINVAL; - goto RK_CAMERA_SET_FMT_END; - } - - spin_lock(&pcdev->cropinfo.lock); - if (((mf.width*10/mf.height) != (usr_w*10/usr_h))) { - if ((pcdev->cropinfo.c.width == 0)&&(pcdev->cropinfo.c.height == 0)) { - /*Scale + Crop center is for keep aspect ratio unchange*/ - ratio = ((mf.width*10/usr_w) >= (mf.height*10/usr_h))?(mf.height*10/usr_h):(mf.width*10/usr_w); - pcdev->host_width = ratio*usr_w/10; - pcdev->host_height = ratio*usr_h/10; - pcdev->host_width &= ~CROP_ALIGN_BYTES; - pcdev->host_height &= ~CROP_ALIGN_BYTES; - - pcdev->host_left = ((sensor_w-pcdev->host_width )>>1); - pcdev->host_top = ((sensor_h-pcdev->host_height)>>1); - } else { - /*Scale + crop(user define)*/ - pcdev->host_width = pcdev->cropinfo.c.width*mf.width/pcdev->cropinfo.bounds.width; - pcdev->host_height = pcdev->cropinfo.c.height*mf.height/pcdev->cropinfo.bounds.height; - pcdev->host_left = (pcdev->cropinfo.c.left*mf.width/pcdev->cropinfo.bounds.width); - pcdev->host_top = (pcdev->cropinfo.c.top*mf.height/pcdev->cropinfo.bounds.height); - } - - pcdev->host_left &= (~0x01); - pcdev->host_top &= (~0x01); - } else { - if ((pcdev->cropinfo.c.width == 0)&&(pcdev->cropinfo.c.height == 0)) { - /*Crop Center for cif can work , then scale*/ - pcdev->host_width = mf.width; - pcdev->host_height = mf.height; - pcdev->host_left = ((sensor_w - mf.width)>>1)&(~0x01); - pcdev->host_top = ((sensor_h - mf.height)>>1)&(~0x01); - } else { - /*Crop center for cif can work + crop(user define), then scale */ - pcdev->host_width = pcdev->cropinfo.c.width*mf.width/pcdev->cropinfo.bounds.width; - pcdev->host_height = pcdev->cropinfo.c.height*mf.height/pcdev->cropinfo.bounds.height; - pcdev->host_left = (pcdev->cropinfo.c.left*mf.width/pcdev->cropinfo.bounds.width)+((sensor_w - mf.width)>>1); - pcdev->host_top = (pcdev->cropinfo.c.top*mf.height/pcdev->cropinfo.bounds.height)+((sensor_h - mf.height)>>1); - } - - pcdev->host_left &= (~0x01); - pcdev->host_top &= (~0x01); - } - spin_unlock(&pcdev->cropinfo.lock); - } else { - spin_lock(&pcdev->cropinfo.lock); - if ((pcdev->cropinfo.c.width == 0)&&(pcdev->cropinfo.c.height == 0)) { - pcdev->host_width = mf.width; - pcdev->host_height = mf.height; - pcdev->host_left = 0; - pcdev->host_top = 0; - } else { - pcdev->host_width = pcdev->cropinfo.c.width*mf.width/pcdev->cropinfo.bounds.width; - pcdev->host_height = pcdev->cropinfo.c.height*mf.height/pcdev->cropinfo.bounds.height; - pcdev->host_left = (pcdev->cropinfo.c.left*mf.width/pcdev->cropinfo.bounds.width); - pcdev->host_top = (pcdev->cropinfo.c.top*mf.height/pcdev->cropinfo.bounds.height); - } - spin_unlock(&pcdev->cropinfo.lock); - } - - icd->sense = NULL; - if (!ret) { - rect.width = pcdev->host_width; - rect.height = pcdev->host_height; - rect.left = pcdev->host_left; - rect.top = pcdev->host_top; - - down(&pcdev->zoominfo.sem); -#if CIF_DO_CROP /* this crop is only for digital zoom*/ - pcdev->zoominfo.a.c.left = 0; - pcdev->zoominfo.a.c.top = 0; - pcdev->zoominfo.a.c.width = pcdev->host_width*100/pcdev->zoominfo.zoom_rate; - pcdev->zoominfo.a.c.width &= ~CROP_ALIGN_BYTES; - pcdev->zoominfo.a.c.height = pcdev->host_height*100/pcdev->zoominfo.zoom_rate; - pcdev->zoominfo.a.c.height &= ~CROP_ALIGN_BYTES; - pcdev->zoominfo.vir_width = pcdev->zoominfo.a.c.width; - pcdev->zoominfo.vir_height = pcdev->zoominfo.a.c.height; - /*recalculate the CIF width & height*/ - rect.width = pcdev->zoominfo.a.c.width ; - rect.height = pcdev->zoominfo.a.c.height; - rect.left = ((((pcdev->host_width - pcdev->zoominfo.a.c.width)>>1))+pcdev->host_left)&(~0x01); - rect.top = ((((pcdev->host_height - pcdev->zoominfo.a.c.height)>>1))+pcdev->host_top)&(~0x01); -#else - pcdev->zoominfo.a.c.width = pcdev->host_width*100/pcdev->zoominfo.zoom_rate; - pcdev->zoominfo.a.c.width &= ~CROP_ALIGN_BYTES; - pcdev->zoominfo.a.c.height = pcdev->host_height*100/pcdev->zoominfo.zoom_rate; - pcdev->zoominfo.a.c.height &= ~CROP_ALIGN_BYTES; - /*now digital zoom use ipp to do crop and scale*/ - if(pcdev->zoominfo.zoom_rate != 100){ - pcdev->zoominfo.a.c.left = ((pcdev->host_width - pcdev->zoominfo.a.c.width)>>1)&(~0x01); - pcdev->zoominfo.a.c.top = ((pcdev->host_height - pcdev->zoominfo.a.c.height)>>1)&(~0x01); - } else { - pcdev->zoominfo.a.c.left = 0; - pcdev->zoominfo.a.c.top = 0; - } - pcdev->zoominfo.vir_width = pcdev->host_width; - pcdev->zoominfo.vir_height = pcdev->host_height; -#endif - up(&pcdev->zoominfo.sem); - - /* ddl@rock-chips.com: IPP work limit check */ - if ((pcdev->zoominfo.a.c.width != usr_w) || (pcdev->zoominfo.a.c.height != usr_h)) { - if (usr_w > 0x7f0) { - if (((usr_w>>1)&0x3f) && (((usr_w>>1)&0x3f) <= 8)) { - RKCAMERA_TR("IPP Destination resolution(%dx%d, ((%d div 1) mod 64)=%d is <= 8)",usr_w,usr_h, usr_w, (int)((usr_w>>1)&0x3f)); - ret = -EINVAL; - goto RK_CAMERA_SET_FMT_END; - } - } else { - if ((usr_w&0x3f) && ((usr_w&0x3f) <= 8)) { - RKCAMERA_TR("IPP Destination resolution(%dx%d, %d mod 64=%d is <= 8)",usr_w,usr_h, usr_w, (int)(usr_w&0x3f)); - ret = -EINVAL; - goto RK_CAMERA_SET_FMT_END; - } - } - } - - RKCAMERA_DG1("%s CIF Host:%dx%d@(%d,%d) Sensor:%dx%d->%dx%d User crop:(%d,%d,%d,%d)in(%d,%d) (zoom: %dx%d@(%d,%d)->%dx%d)\n",xlate->host_fmt->name, - pcdev->host_width,pcdev->host_height,pcdev->host_left,pcdev->host_top, - sensor_w,sensor_h,mf.width,mf.height, - pcdev->cropinfo.c.left,pcdev->cropinfo.c.top,pcdev->cropinfo.c.width,pcdev->cropinfo.c.height, - pcdev->cropinfo.bounds.width,pcdev->cropinfo.bounds.height, - pcdev->zoominfo.a.c.width,pcdev->zoominfo.a.c.height, pcdev->zoominfo.a.c.left,pcdev->zoominfo.a.c.top, - pix->width, pix->height); - - rk_camera_setup_format(icd, pix->pixelformat, mf.code, &rect); - - if (CAM_IPPWORK_IS_EN()) { - BUG_ON(pcdev->vipmem_phybase == 0); - } - pix->width = usr_w; - pix->height = usr_h; - pix->field = mf.field; - pix->colorspace = mf.colorspace; - icd->current_fmt = xlate; - pcdev->icd_width = mf.width; - pcdev->icd_height = mf.height; - } - -RK_CAMERA_SET_FMT_END: - if (stream_on & ENABLE_CAPTURE) - write_cif_reg(pcdev->base,CIF_CIF_CTRL, (read_cif_reg(pcdev->base,CIF_CIF_CTRL) | ENABLE_CAPTURE)); - if (ret) - RKCAMERA_TR("\n%s..%d.. ret = %d \n",__FUNCTION__,__LINE__, ret); - return ret; -} - -static int rk_camera_try_fmt(struct soc_camera_device *icd, - struct v4l2_format *f) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); - struct rk_camera_dev *pcdev = ici->priv; - struct v4l2_subdev *sd = soc_camera_to_subdev(icd); - const struct soc_camera_format_xlate *xlate; - struct v4l2_pix_format *pix = &f->fmt.pix; - __u32 pixfmt = pix->pixelformat; - int ret,usr_w,usr_h,i; - bool is_capture = rk_camera_fmt_capturechk(f); /* testing f is in line with the already set*/ - bool vipmem_is_overflow = false; - struct v4l2_mbus_framefmt mf; - int bytes_per_line_host; - - usr_w = pix->width; - usr_h = pix->height; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); - if (!xlate) { - /*dev_err(icd->dev.parent, "Format (%c%c%c%c) not found\n", pixfmt & 0xFF, (pixfmt >> 8) & 0xFF,*/ - dev_err(icd->parent, "Format (%c%c%c%c) not found\n", pixfmt & 0xFF, (pixfmt >> 8) & 0xFF, - (pixfmt >> 16) & 0xFF, (pixfmt >> 24) & 0xFF); - ret = -EINVAL; - RKCAMERA_TR("%s(version:%c%c%c) support format:\n",rk_cam_driver_description,(RK_CAM_VERSION_CODE&0xff0000)>>16, - (RK_CAM_VERSION_CODE&0xff00)>>8,(RK_CAM_VERSION_CODE&0xff)); - for (i = 0; i < icd->num_user_formats; i++) - RKCAMERA_TR("(%c%c%c%c)-%s\n", - icd->user_formats[i].host_fmt->fourcc & 0xFF, (icd->user_formats[i].host_fmt->fourcc >> 8) & 0xFF, - (icd->user_formats[i].host_fmt->fourcc >> 16) & 0xFF, (icd->user_formats[i].host_fmt->fourcc >> 24) & 0xFF, - icd->user_formats[i].host_fmt->name); - goto RK_CAMERA_TRY_FMT_END; - } - /* limit to rk29 hardware capabilities */ - v4l_bound_align_image(&pix->width, RK_CAM_W_MIN, RK_CAM_W_MAX, 1, - &pix->height, RK_CAM_H_MIN, RK_CAM_H_MAX, 0, - pixfmt == V4L2_PIX_FMT_NV16 ? 4 : 0); - - pix->bytesperline = soc_mbus_bytes_per_line(pix->width, - xlate->host_fmt); - if (pix->bytesperline < 0) - return pix->bytesperline; - - /* limit to sensor capabilities */ - memset(&mf, 0x00, sizeof(struct v4l2_mbus_framefmt)); - mf.width = pix->width; - mf.height = pix->height; - mf.field = pix->field; - mf.colorspace = pix->colorspace; - mf.code = xlate->code; - /* ddl@rock-chips.com : It is query max resolution only. */ - if ((usr_w == 10000) && (usr_h == 10000)) - mf.reserved[6] = 0xfe5a; - ret = v4l2_subdev_call(sd, video, try_mbus_fmt, &mf); - if (ret < 0) - goto RK_CAMERA_TRY_FMT_END; - - /*query resolution.*/ - if((usr_w == 10000) && (usr_h == 10000)) { - pix->width = mf.width; - pix->height = mf.height; - RKCAMERA_DG1("Sensor resolution : %dx%d\n",mf.width,mf.height); - goto RK_CAMERA_TRY_FMT_END; - } else { - RKCAMERA_DG1("user demand: %dx%d sensor output: %dx%d \n",usr_w,usr_h,mf.width,mf.height); - } - - if ((mf.width != usr_w) || (mf.height != usr_h)) { - bytes_per_line_host = soc_mbus_bytes_per_line(mf.width,icd->current_fmt->host_fmt); - if (is_capture) { - vipmem_is_overflow = (PAGE_ALIGN(bytes_per_line_host*mf.height) > pcdev->vipmem_size); - } else { - /* Assume preview buffer minimum is 4 */ - vipmem_is_overflow = (PAGE_ALIGN(bytes_per_line_host*mf.height)*4 > pcdev->vipmem_size); - } - if (vipmem_is_overflow == false) { - pix->width = usr_w; - pix->height = usr_h; - } else { - /*RKCAMERA_TR("vipmem for IPP is overflow, This resolution(%dx%d -> %dx%d) is invalidate!\n",mf.width,mf.height,usr_w,usr_h);*/ - pix->width = mf.width; - pix->height = mf.height; - } - /* ddl@rock-chips.com: Invalidate these code, because sensor need interpolate */ - #if 0 - if ((mf.width < usr_w) || (mf.height < usr_h)) { - if (((usr_w>>1) > mf.width) || ((usr_h>>1) > mf.height)) { - RKCAMERA_TR("The aspect ratio(%dx%d/%dx%d) is bigger than 2 !\n",mf.width,mf.height,usr_w,usr_h); - pix->width = mf.width; - pix->height = mf.height; - } - } - #endif - } - - pix->colorspace = mf.colorspace; - - switch (mf.field) { - case V4L2_FIELD_ANY: - case V4L2_FIELD_NONE: - pix->field = V4L2_FIELD_NONE; - break; - default: - /* TODO: support interlaced at least in pass-through mode */ - dev_err(icd->parent, "Field type %d unsupported.\n", - mf.field); - goto RK_CAMERA_TRY_FMT_END; - } - -RK_CAMERA_TRY_FMT_END: - if (ret<0) - RKCAMERA_TR("\n%s..%d.. ret = %d \n",__FUNCTION__,__LINE__, ret); - return ret; -} - -static int rk_camera_reqbufs(struct soc_camera_device *icd, - struct v4l2_requestbuffers *p) -{ - int i; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - /* This is for locking debugging only. I removed spinlocks and now I - * check whether .prepare is ever called on a linked buffer, or whether - * a dma IRQ can occur for an in-work or unlinked buffer. Until now - * it hadn't triggered */ - for (i = 0; i < p->count; i++) { - struct rk_camera_buffer *buf = container_of(icd->vb_vidq.bufs[i], - struct rk_camera_buffer, vb); - buf->inwork = 0; - INIT_LIST_HEAD(&buf->vb.queue); - } - - return 0; -} - -static unsigned int rk_camera_poll(struct file *file, poll_table *pt) -{ - struct soc_camera_device *icd = file->private_data; - struct rk_camera_buffer *buf; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - buf = list_entry(icd->vb_vidq.stream.next, struct rk_camera_buffer, - vb.stream); - - poll_wait(file, &buf->vb.done, pt); - - if (buf->vb.state == VIDEOBUF_DONE || - buf->vb.state == VIDEOBUF_ERROR) - return POLLIN|POLLRDNORM; - - return 0; -} -/* -*card: sensor name _ facing _ device index - orientation _ fov horizontal _ fov vertical -* 10 5 1 3 3 3 + 5 < 32 -*/ - -static int rk_camera_querycap(struct soc_camera_host *ici, - struct v4l2_capability *cap) -{ - struct rk_camera_dev *pcdev = ici->priv; - struct rkcamera_platform_data *new_camera; - char orientation[5]; - char fov[9]; - int i; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - - strlcpy(cap->card, dev_name(pcdev->icd->pdev), 18); - memset(orientation,0x00,sizeof(orientation)); - - i=0; - new_camera = pcdev->pdata->register_dev_new; - while(new_camera != NULL){ - if (strcmp(dev_name(pcdev->icd->pdev), new_camera->dev_name) == 0) { - sprintf(orientation,"-%d",new_camera->orientation); - sprintf(fov,"_%d_%d",new_camera->fov_h,new_camera->fov_v); - } - new_camera = new_camera->next_camera; - } - - if (orientation[0] != '-') { - RKCAMERA_TR("%s: %s is not registered in rk29_camera_platform_data, orientation apply default value",__FUNCTION__,dev_name(pcdev->icd->pdev)); - if (strstr(dev_name(pcdev->icd->pdev),"front")) - strcat(cap->card,"-270"); - else - strcat(cap->card,"-90"); - } else { - strcat(cap->card,orientation); - } - - /* ddl@rock-chips.com: v0.3.f */ - strcat(cap->card, fov); - cap->reserved[0] = pcdev->pdata->iommu_enabled; - cap->version = RK_CAM_VERSION_CODE; - cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING; - cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; - cap->reserved[0] = pcdev->pdata->iommu_enabled; - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - return 0; -} -static int rk_camera_suspend(struct soc_camera_device *icd, pm_message_t state) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); - struct rk_camera_dev *pcdev = ici->priv; - struct v4l2_subdev *sd; - int ret = 0; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - mutex_lock(&camera_lock); - if ((pcdev->icd == icd) && (icd->ops->suspend)) { - rk_camera_s_stream(icd, 0); - sd = soc_camera_to_subdev(icd); - v4l2_subdev_call(sd, video, s_stream, 0); - ret = icd->ops->suspend(icd, state); - - pcdev->reginfo_suspend.cifCtrl = read_cif_reg(pcdev->base,CIF_CIF_CTRL); - pcdev->reginfo_suspend.cifCrop = read_cif_reg(pcdev->base,CIF_CIF_CROP); - pcdev->reginfo_suspend.cifFs = read_cif_reg(pcdev->base,CIF_CIF_SET_SIZE); - pcdev->reginfo_suspend.cifIntEn = read_cif_reg(pcdev->base,CIF_CIF_INTEN); - pcdev->reginfo_suspend.cifFmt= read_cif_reg(pcdev->base,CIF_CIF_FOR); - pcdev->reginfo_suspend.cifVirWidth = read_cif_reg(pcdev->base,CIF_CIF_VIR_LINE_WIDTH); - pcdev->reginfo_suspend.cifScale= read_cif_reg(pcdev->base,CIF_CIF_SCL_CTRL); - - pcdev->reginfo_suspend.Inval = Reg_Validate; - rk_camera_deactivate(pcdev); - - RKCAMERA_DG1("%s Enter Success...\n", __FUNCTION__); - } else { - RKCAMERA_DG1("%s icd has been deattach, don't need enter suspend\n", __FUNCTION__); - } - mutex_unlock(&camera_lock); - return ret; -} - -static int rk_camera_resume(struct soc_camera_device *icd) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); - struct rk_camera_dev *pcdev = ici->priv; - struct v4l2_subdev *sd; - int ret = 0; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - mutex_lock(&camera_lock); - if ((pcdev->icd == icd) && (icd->ops->resume)) { - if (pcdev->reginfo_suspend.Inval == Reg_Validate) { - rk_camera_activate(pcdev, icd); - write_cif_reg(pcdev->base,CIF_CIF_CTRL, pcdev->reginfo_suspend.cifCtrl&~ENABLE_CAPTURE); - write_cif_reg(pcdev->base,CIF_CIF_INTEN, pcdev->reginfo_suspend.cifIntEn); - write_cif_reg(pcdev->base,CIF_CIF_CROP, pcdev->reginfo_suspend.cifCrop); - write_cif_reg(pcdev->base,CIF_CIF_SET_SIZE, pcdev->reginfo_suspend.cifFs); - write_cif_reg(pcdev->base,CIF_CIF_FOR, pcdev->reginfo_suspend.cifFmt); - write_cif_reg(pcdev->base,CIF_CIF_VIR_LINE_WIDTH,pcdev->reginfo_suspend.cifVirWidth); - write_cif_reg(pcdev->base,CIF_CIF_SCL_CTRL, pcdev->reginfo_suspend.cifScale); - rk_videobuf_capture(pcdev->active,pcdev); - rk_camera_s_stream(icd, 1); - pcdev->reginfo_suspend.Inval = Reg_Invalidate; - } else { - RKCAMERA_TR("Resume fail, vip register recored is invalidate!!\n"); - goto rk_camera_resume_end; - } - - ret = icd->ops->resume(icd); - sd = soc_camera_to_subdev(icd); - v4l2_subdev_call(sd, video, s_stream, 1); - - RKCAMERA_DG1("%s Enter success\n",__FUNCTION__); - } else { - RKCAMERA_DG1("%s icd has been deattach, don't need enter resume\n", __FUNCTION__); - } - -rk_camera_resume_end: - mutex_unlock(&camera_lock); - return ret; -} - -static void rk_camera_reinit_work(struct work_struct *work) -{ - struct v4l2_subdev *sd; - struct rk_camera_work *camera_work = container_of(work, struct rk_camera_work, work); - struct rk_camera_dev *pcdev = camera_work->pcdev; - struct v4l2_mbus_framefmt mf; - int index = 0; - unsigned long flags = 0; - int ctrl; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - //return; - - if(pcdev->icd == NULL) - return; - sd = soc_camera_to_subdev(pcdev->icd); - /*dump regs*/ - { - RKCAMERA_TR("CIF_CIF_CTRL = 0x%x\n",read_cif_reg(pcdev->base,CIF_CIF_CTRL)); - RKCAMERA_TR("CIF_CIF_INTEN = 0x%x\n",read_cif_reg(pcdev->base,CIF_CIF_INTEN)); - RKCAMERA_TR("CIF_CIF_INTSTAT = 0x%x\n",read_cif_reg(pcdev->base,CIF_CIF_INTSTAT)); - RKCAMERA_TR("CIF_CIF_FOR = 0x%x\n",read_cif_reg(pcdev->base,CIF_CIF_FOR)); - RKCAMERA_TR("CIF_CIF_CROP = 0x%x\n",read_cif_reg(pcdev->base,CIF_CIF_CROP)); - RKCAMERA_TR("CIF_CIF_SET_SIZE = 0x%x\n",read_cif_reg(pcdev->base,CIF_CIF_SET_SIZE)); - RKCAMERA_TR("CIF_CIF_SCL_CTRL = 0x%x\n",read_cif_reg(pcdev->base,CIF_CIF_SCL_CTRL)); - RKCAMERA_TR("CIF_CIF_LAST_LINE = 0X%x\n",read_cif_reg(pcdev->base,CIF_CIF_LAST_LINE)); - RKCAMERA_TR("CIF_CIF_LAST_PIX = 0X%x\n",read_cif_reg(pcdev->base,CIF_CIF_LAST_PIX)); - RKCAMERA_TR("CIF_CIF_VIR_LINE_WIDTH = 0X%x\n",read_cif_reg(pcdev->base,CIF_CIF_VIR_LINE_WIDTH)); - RKCAMERA_TR("CIF_CIF_LINE_NUM_ADDR = 0X%x\n",read_cif_reg(pcdev->base,CIF_CIF_LINE_NUM_ADDR)); - RKCAMERA_TR("CIF_CIF_FRM0_ADDR_Y = 0X%x\n",read_cif_reg(pcdev->base,CIF_CIF_FRM0_ADDR_Y)); - RKCAMERA_TR("CIF_CIF_FRM0_ADDR_UV = 0X%x\n",read_cif_reg(pcdev->base,CIF_CIF_FRM0_ADDR_UV)); - RKCAMERA_TR("CIF_CIF_FRAME_STATUS = 0X%x\n",read_cif_reg(pcdev->base,CIF_CIF_FRAME_STATUS)); - RKCAMERA_TR("CIF_CIF_SCL_VALID_NUM = 0X%x\n",read_cif_reg(pcdev->base,CIF_CIF_SCL_VALID_NUM)); - RKCAMERA_TR("CIF_CIF_CUR_DST = 0X%x\n",read_cif_reg(pcdev->base,CIF_CIF_CUR_DST)); - RKCAMERA_TR("CIF_CIF_LINE_NUM_ADDR = 0X%x\n",read_cif_reg(pcdev->base,CIF_CIF_LINE_NUM_ADDR)); - } - - /*ddl@rock-chips.com v0.3.0x13*/ - ctrl = read_cif_reg(pcdev->base, CIF_CIF_CTRL); - if (pcdev->reinit_times == 1) { - if (ctrl & ENABLE_CAPTURE) { - RKCAMERA_TR("Sensor data transfer may be error, so reset CIF and reinit sensor for resume!\n"); - pcdev->irqinfo.cifirq_idx = pcdev->irqinfo.dmairq_idx; - rk_camera_cif_reset(pcdev, false); - - v4l2_subdev_call(sd, core, init, 0); - mf.width = pcdev->icd_width; - mf.height = pcdev->icd_height; - mf.field = V4L2_FIELD_NONE; - mf.code = pcdev->icd->current_fmt->code; - mf.reserved[0] = 0x5afe; - mf.reserved[1] = 0; - - v4l2_subdev_call(sd, video, s_mbus_fmt, &mf); - write_cif_reg(pcdev->base, CIF_CIF_CTRL, - (read_cif_reg(pcdev->base, CIF_CIF_CTRL) | - ENABLE_CAPTURE)); - } else if (pcdev->irqinfo.cifirq_idx != pcdev->irqinfo.dmairq_idx) { - RKCAMERA_TR("CIF may be error, so reset cif for resume\n"); - pcdev->irqinfo.cifirq_idx = pcdev->irqinfo.dmairq_idx; - rk_camera_cif_reset(pcdev, false); - write_cif_reg(pcdev->base, CIF_CIF_CTRL, - (read_cif_reg(pcdev->base, CIF_CIF_CTRL) | - ENABLE_CAPTURE)); - } - return; - } - - atomic_set(&pcdev->stop_cif,true); - write_cif_reg(pcdev->base,CIF_CIF_CTRL, (read_cif_reg(pcdev->base,CIF_CIF_CTRL)&(~ENABLE_CAPTURE))); - RKCAMERA_DG1("the reinit times = %d\n",pcdev->reinit_times); - - if(pcdev->video_vq && pcdev->video_vq->irqlock){ - spin_lock_irqsave(pcdev->video_vq->irqlock, flags); - for (index = 0; index < VIDEO_MAX_FRAME; index++) { - if (NULL == pcdev->video_vq->bufs[index]) - continue; - - if (pcdev->video_vq->bufs[index]->state == VIDEOBUF_QUEUED) { - list_del_init(&pcdev->video_vq->bufs[index]->queue); - pcdev->video_vq->bufs[index]->state = VIDEOBUF_NEEDS_INIT; - wake_up_all(&pcdev->video_vq->bufs[index]->done); - printk("wake up video buffer index = %d !!!\n",index); - } - } - spin_unlock_irqrestore(pcdev->video_vq->irqlock, flags); - }else{ - RKCAMERA_TR("video queue has somthing wrong !!\n"); - } - - RKCAMERA_TR("the %d reinit times ,wake up video buffers!\n ",pcdev->reinit_times); -} -static enum hrtimer_restart rk_camera_fps_func(struct hrtimer *timer) -{ - struct rk_camera_frmivalenum *fival_nxt=NULL,*fival_pre=NULL, *fival_rec=NULL; - struct rk_camera_timer *fps_timer = container_of(timer, struct rk_camera_timer, timer); - struct rk_camera_dev *pcdev = fps_timer->pcdev; - int rec_flag,i; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - RKCAMERA_DG1("rk_camera_fps_func fps:0x%x\n",pcdev->fps); - if ((pcdev->fps < 1) || (pcdev->last_fps == pcdev->fps)) { - RKCAMERA_TR("Camera host haven't recevie data from sensor,last fps = %d,pcdev->fps = %d,cif_irq: %ld,dma_irq: %ld!\n", - pcdev->last_fps,pcdev->fps,pcdev->irqinfo.cifirq_idx, pcdev->irqinfo.dmairq_idx); - pcdev->camera_reinit_work.pcdev = pcdev; - /*INIT_WORK(&(pcdev->camera_reinit_work.work), rk_camera_reinit_work);*/ - pcdev->reinit_times++; - queue_work(pcdev->camera_wq,&(pcdev->camera_reinit_work.work)); - } else if(!pcdev->timer_get_fps) { - pcdev->timer_get_fps = true; - for (i=0; i<2; i++) { - if (pcdev->icd == pcdev->icd_frmival[i].icd) { - fival_nxt = pcdev->icd_frmival[i].fival_list; - } - } - - rec_flag = 0; - fival_pre = fival_nxt; - while (fival_nxt != NULL) { - - RKCAMERA_DG1("%s %c%c%c%c %dx%d framerate : %d/%d\n", dev_name(pcdev->icd->control), - fival_nxt->fival.pixel_format & 0xFF, (fival_nxt->fival.pixel_format >> 8) & 0xFF, - (fival_nxt->fival.pixel_format >> 16) & 0xFF, (fival_nxt->fival.pixel_format >> 24), - fival_nxt->fival.width, fival_nxt->fival.height, fival_nxt->fival.discrete.denominator, - fival_nxt->fival.discrete.numerator); - - if (((fival_nxt->fival.pixel_format == pcdev->pixfmt) - && (fival_nxt->fival.height == pcdev->icd->user_height) - && (fival_nxt->fival.width == pcdev->icd->user_width)) - || (fival_nxt->fival.discrete.denominator == 0)) { - - if (fival_nxt->fival.discrete.denominator == 0) { - fival_nxt->fival.index = 0; - fival_nxt->fival.width = pcdev->icd->user_width; - fival_nxt->fival.height= pcdev->icd->user_height; - fival_nxt->fival.pixel_format = pcdev->pixfmt; - fival_nxt->fival.discrete.denominator = pcdev->frame_interval; - fival_nxt->fival.reserved[1] = (pcdev->icd_width<<16) - |(pcdev->icd_height); - fival_nxt->fival.discrete.numerator = 1000000; - fival_nxt->fival.type = V4L2_FRMIVAL_TYPE_DISCRETE; - } - rec_flag = 1; - fival_rec = fival_nxt; - } - fival_pre = fival_nxt; - fival_nxt = fival_nxt->nxt; - } - - if ((rec_flag == 0) && fival_pre) { - fival_pre->nxt = kzalloc( - sizeof(struct rk_camera_frmivalenum), - GFP_ATOMIC); - if (fival_pre->nxt) { - fival_pre->nxt->fival.index = - fival_pre->fival.index++; - fival_pre->nxt->fival.width = - pcdev->icd->user_width; - fival_pre->nxt->fival.height = - pcdev->icd->user_height; - fival_pre->nxt->fival.pixel_format = - pcdev->pixfmt; - - fival_pre->nxt->fival.discrete.denominator = - pcdev->frame_interval; - fival_pre->nxt->fival.reserved[1] = - (pcdev->icd_width << 16) | - (pcdev->icd_height); - fival_pre->nxt->fival.discrete.numerator = - 1000000; - fival_pre->nxt->fival.type = - V4L2_FRMIVAL_TYPE_DISCRETE; - rec_flag = 1; - fival_rec = fival_pre->nxt; - } - } - } - - if ((pcdev->last_fps != pcdev->fps) && (pcdev->reinit_times)) /*ddl@rock-chips.com v0.3.0x13*/ - pcdev->reinit_times = 0; - - pcdev->last_fps = pcdev->fps ; - pcdev->fps_timer.timer.node.expires= ktime_add_us(pcdev->fps_timer.timer.node.expires, ktime_to_us(ktime_set(3, 0))); - pcdev->fps_timer.timer._softexpires= ktime_add_us(pcdev->fps_timer.timer._softexpires, ktime_to_us(ktime_set(3, 0))); - /*return HRTIMER_NORESTART;*/ - if(pcdev->reinit_times >=2) - return HRTIMER_NORESTART; - else - return HRTIMER_RESTART; -} -static int rk_camera_s_stream(struct soc_camera_device *icd, int enable) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); - struct rk_camera_dev *pcdev = ici->priv; - int cif_ctrl_val; - int ret; - unsigned long flags; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - WARN_ON(pcdev->icd != icd); - - cif_ctrl_val = read_cif_reg(pcdev->base,CIF_CIF_CTRL); - if (enable) { - pcdev->fps = 0; - pcdev->last_fps = 0; - pcdev->frame_interval = 0; - hrtimer_cancel(&(pcdev->fps_timer.timer)); - pcdev->fps_timer.pcdev = pcdev; - pcdev->timer_get_fps = false; - pcdev->reinit_times = 0; - - spin_lock_irqsave(&pcdev->lock,flags); - atomic_set(&pcdev->stop_cif,false); - pcdev->cif_stopped = false; - pcdev->irqinfo.cifirq_idx = 0; - pcdev->irqinfo.cifirq_normal_idx = 0; - pcdev->irqinfo.cifirq_abnormal_idx = 0; - pcdev->irqinfo.dmairq_idx = 0; - - write_cif_reg(pcdev->base,CIF_CIF_INTEN, 0x01|0x200); /*capture complete interrupt enable*/ - cif_ctrl_val |= ENABLE_CAPTURE; - write_cif_reg(pcdev->base,CIF_CIF_CTRL, cif_ctrl_val); - spin_unlock_irqrestore(&pcdev->lock,flags); - printk("%s:stream enable CIF_CIF_CTRL 0x%x\n",__func__,read_cif_reg(pcdev->base,CIF_CIF_CTRL)); - hrtimer_start(&(pcdev->fps_timer.timer),ktime_set(3, 0),HRTIMER_MODE_REL); - pcdev->fps_timer.istarted = true; - } else { - /*cancel timer before stop cif*/ - ret = hrtimer_cancel(&pcdev->fps_timer.timer); - pcdev->fps_timer.istarted = false; - flush_work(&(pcdev->camera_reinit_work.work)); - - cif_ctrl_val &= ~ENABLE_CAPTURE; - spin_lock_irqsave(&pcdev->lock, flags); - //write_cif_reg(pcdev->base,CIF_CIF_CTRL, cif_ctrl_val); - atomic_set(&pcdev->stop_cif,true); - //write_cif_reg(pcdev->base,CIF_CIF_INTEN, 0x0); - spin_unlock_irqrestore(&pcdev->lock, flags); - - init_waitqueue_head(&pcdev->cif_stop_done); - if (wait_event_timeout(pcdev->cif_stop_done, pcdev->cif_stopped, msecs_to_jiffies(1000)) == 0) { - RKCAMERA_TR("%s:%d, wait cif stop timeout!",__func__,__LINE__); - pcdev->cif_stopped = true; - } - - flush_workqueue((pcdev->camera_wq)); - //msleep(100); - } - /*must be reinit,or will be somthing wrong in irq process.*/ - if(enable == false) { - pcdev->active = NULL; - pcdev->active1 = NULL; - INIT_LIST_HEAD(&pcdev->capture); - } - RKCAMERA_DG1("s_stream: enable : 0x%x , CIF_CIF_CTRL = 0x%x\n",enable,read_cif_reg(pcdev->base,CIF_CIF_CTRL)); - return 0; -} -int rk_camera_enum_frameintervals(struct soc_camera_device *icd, struct v4l2_frmivalenum *fival) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); - struct rk_camera_dev *pcdev = ici->priv; - struct v4l2_subdev *sd = soc_camera_to_subdev(icd); - struct rk_camera_frmivalenum *fival_list = NULL; - struct v4l2_frmivalenum *fival_head = NULL; - struct rkcamera_platform_data *new_camera; - int i,ret = 0,index; - const struct soc_camera_format_xlate *xlate; - struct v4l2_mbus_framefmt mf; - __u32 pixfmt; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - index = fival->index & 0x00ffffff; - if ((fival->index & 0xff000000) == 0xff000000) { /* ddl@rock-chips.com: detect framerate */ - for (i=0; i<2; i++) { - if (pcdev->icd_frmival[i].icd == icd) { - fival_list = pcdev->icd_frmival[i].fival_list; - } - } - - if (fival_list != NULL) { - i = 0; - while (fival_list != NULL) { - if ((fival->pixel_format == fival_list->fival.pixel_format) - && (fival->height == fival_list->fival.height) - && (fival->width == fival_list->fival.width)) { - if (i == index) - break; - i++; - } - fival_list = fival_list->nxt; - } - - if ((i==index) && (fival_list != NULL)) { - memcpy(fival, &fival_list->fival, sizeof(struct v4l2_frmivalenum)); - } else { - ret = -EINVAL; - } - } else { - RKCAMERA_TR("%s: fival_list is NULL\n",__FUNCTION__); - ret = -EINVAL; - } - } else { - - if (fival_head) { - i = 0; - while (fival_head->width && fival_head->height) { - if ((fival->pixel_format == fival_head->pixel_format) - && (fival->height == fival_head->height) - && (fival->width == fival_head->width)) { - if (i == index) { - break; - } - i++; - } - fival_head++; - } - - if ((i == index) && (fival->height == fival_head->height) && (fival->width == fival_head->width)) { - memcpy(fival, fival_head, sizeof(struct v4l2_frmivalenum)); - - pixfmt = fival->pixel_format; /* ddl@rock-chips.com: v0.3.9 */ - xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); - memset(&mf,0x00,sizeof(struct v4l2_mbus_framefmt)); - mf.width = fival->width; - mf.height = fival->height; - mf.code = xlate->code; - - v4l2_subdev_call(sd, video, try_mbus_fmt, &mf); - - fival->reserved[1] = (mf.width<<16)|(mf.height); - - RKCAMERA_DG1("%s %dx%d@%c%c%c%c framerate : %d/%d\n", dev_name(pcdev->icd->pdev), - fival->width, fival->height, - fival->pixel_format & 0xFF, (fival->pixel_format >> 8) & 0xFF, - (fival->pixel_format >> 16) & 0xFF, (fival->pixel_format >> 24), - fival->discrete.denominator,fival->discrete.numerator); - } else { - if (index == 0) - RKCAMERA_TR("%s have not catch %d%d@%c%c%c%c index(%d) framerate\n",dev_name(pcdev->icd->pdev), - fival->width,fival->height, - fival->pixel_format & 0xFF, (fival->pixel_format >> 8) & 0xFF, - (fival->pixel_format >> 16) & 0xFF, (fival->pixel_format >> 24), - index); - else - RKCAMERA_DG1("%s have not catch %d%d@%c%c%c%c index(%d) framerate\n",dev_name(pcdev->icd->pdev), - fival->width,fival->height, - fival->pixel_format & 0xFF, (fival->pixel_format >> 8) & 0xFF, - (fival->pixel_format >> 16) & 0xFF, (fival->pixel_format >> 24), - index); - ret = -EINVAL; - goto rk_camera_enum_frameintervals_end; - } - } else { - i = 0x00; - new_camera = pcdev->pdata->register_dev_new; - while(new_camera != NULL){ - if (strcmp(new_camera->dev_name, dev_name(pcdev->icd->pdev)) == 0) { - i = 0x01; - break; - } - new_camera = new_camera->next_camera; - } - - if (i == 0x00) { - printk(KERN_ERR "%s(%d): %s have not found in new_camera[] and rk_camera_platform_data!", - __FUNCTION__,__LINE__,dev_name(pcdev->icd->pdev)); - } else { - - pixfmt = fival->pixel_format; /* ddl@rock-chips.com: v0.3.9 */ - xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); - memset(&mf,0x00,sizeof(struct v4l2_mbus_framefmt)); - mf.width = fival->width; - mf.height = fival->height; - mf.code = xlate->code; - - v4l2_subdev_call(sd, video, try_mbus_fmt, &mf); - - fival->discrete.numerator= 1000; - fival->discrete.denominator = 15000; - fival->type = V4L2_FRMIVAL_TYPE_DISCRETE; - fival->reserved[1] = (mf.width<<16)|(mf.height); - } - } - } -rk_camera_enum_frameintervals_end: - return ret; -} - -static int rk_camera_set_digit_zoom(struct soc_camera_device *icd, - const struct v4l2_queryctrl *qctrl, int zoom_rate) -{ - struct v4l2_crop a; - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); - struct rk_camera_dev *pcdev = ici->priv; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - -#if CIF_DO_CROP - unsigned long tmp_cifctrl; -#endif - - /*change the crop and scale parameters*/ - -#if CIF_DO_CROP - a.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - /*a.c.width = pcdev->host_width*100/zoom_rate;*/ - a.c.width = pcdev->host_width*100/zoom_rate; - a.c.width &= ~CROP_ALIGN_BYTES; - a.c.height = pcdev->host_height*100/zoom_rate; - a.c.height &= ~CROP_ALIGN_BYTES; - a.c.left = (((pcdev->host_width - a.c.width)>>1)+pcdev->host_left)&(~0x01); - a.c.top = (((pcdev->host_height - a.c.height)>>1)+pcdev->host_top)&(~0x01); - atomic_set(&pcdev->stop_cif,true); - tmp_cifctrl = read_cif_reg(pcdev->base,CIF_CIF_CTRL); - write_cif_reg(pcdev->base,CIF_CIF_CTRL, (tmp_cifctrl & ~ENABLE_CAPTURE)); - hrtimer_cancel(&(pcdev->fps_timer.timer)); - flush_workqueue((pcdev->camera_wq)); - - down(&pcdev->zoominfo.sem); - pcdev->zoominfo.a.c.left = 0; - pcdev->zoominfo.a.c.top = 0; - pcdev->zoominfo.a.c.width = a.c.width; - pcdev->zoominfo.a.c.height = a.c.height; - pcdev->zoominfo.vir_width = pcdev->zoominfo.a.c.width; - pcdev->zoominfo.vir_height = pcdev->zoominfo.a.c.height; - pcdev->frame_inval = 1; - write_cif_reg(pcdev->base,CIF_CIF_CROP, (a.c.left + (a.c.top<<16))); - write_cif_reg(pcdev->base,CIF_CIF_SET_SIZE, ((a.c.width ) + (a.c.height<<16))); - write_cif_reg(pcdev->base,CIF_CIF_VIR_LINE_WIDTH, a.c.width); - if (pcdev->capture_pingpong) { - write_cif_reg(pcdev->base, CIF_CIF_FRAME_STATUS, 0x10000002); - if (pcdev->active) - rk_videobuf_capture_mix(pcdev->active, pcdev, 0); - } else { - /*frame1 has been ready to receive data,frame 2 is not used*/ - write_cif_reg(pcdev->base, CIF_CIF_FRAME_STATUS, 0x00000002); - if (pcdev->active) - rk_videobuf_capture(pcdev->active, pcdev); - } - if(tmp_cifctrl & ENABLE_CAPTURE) - write_cif_reg(pcdev->base,CIF_CIF_CTRL, (tmp_cifctrl | ENABLE_CAPTURE)); - up(&pcdev->zoominfo.sem); - - atomic_set(&pcdev->stop_cif,false); - hrtimer_start(&(pcdev->fps_timer.timer),ktime_set(3, 0),HRTIMER_MODE_REL); - RKCAMERA_DG1("zoom_rate:%d (%dx%d at (%d,%d)-> %dx%d)\n", zoom_rate,a.c.width, a.c.height, a.c.left, a.c.top, icd->user_width, icd->user_height ); -#else - a.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - a.c.width = pcdev->host_width*100/zoom_rate; - a.c.width &= ~CROP_ALIGN_BYTES; - a.c.height = pcdev->host_height*100/zoom_rate; - a.c.height &= ~CROP_ALIGN_BYTES; - a.c.left = (pcdev->host_width - a.c.width)>>1; - a.c.top = (pcdev->host_height - a.c.height)>>1; - - down(&pcdev->zoominfo.sem); - pcdev->zoominfo.a.c.height = a.c.height; - pcdev->zoominfo.a.c.width = a.c.width; - pcdev->zoominfo.a.c.top = a.c.top; - pcdev->zoominfo.a.c.left = a.c.left; - pcdev->zoominfo.vir_width = pcdev->host_width; - pcdev->zoominfo.vir_height= pcdev->host_height; - up(&pcdev->zoominfo.sem); - - RKCAMERA_DG1("zoom_rate:%d (%dx%d at (%d,%d)-> %dx%d)\n", zoom_rate,a.c.width, a.c.height, a.c.left, a.c.top, icd->user_width, icd->user_height ); -#endif - - return 0; -} - -static inline struct v4l2_queryctrl const *rk_camera_soc_camera_find_qctrl( - struct soc_camera_host_ops *ops, int id) -{ - - int i; - for (i = 0; i < ops->num_controls; i++) - if (ops->controls[i].id == id) - return &ops->controls[i]; - - return NULL; -} - - -static int rk_camera_set_ctrl(struct soc_camera_device *icd, - struct v4l2_control *sctrl) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); - const struct v4l2_queryctrl *qctrl; - struct rk_camera_dev *pcdev = ici->priv; - - int ret = 0; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - qctrl = rk_camera_soc_camera_find_qctrl(ici->ops, sctrl->id); - if (!qctrl) { - ret = -ENOIOCTLCMD; - goto rk_camera_set_ctrl_end; - } - - switch (sctrl->id) - { - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((sctrl->value < qctrl->minimum) || (sctrl->value > qctrl->maximum)){ - ret = -EINVAL; - goto rk_camera_set_ctrl_end; - } - ret = rk_camera_set_digit_zoom(icd, qctrl, sctrl->value); - if (ret == 0) { - pcdev->zoominfo.zoom_rate = sctrl->value; - } else { - goto rk_camera_set_ctrl_end; - } - break; - } - default: - ret = -ENOIOCTLCMD; - break; - } -rk_camera_set_ctrl_end: - return ret; -} - -static struct soc_camera_host_ops rk_soc_camera_host_ops = -{ - .owner = THIS_MODULE, - .add = rk_camera_add_device, - .remove = rk_camera_remove_device, - .suspend = rk_camera_suspend, - .resume = rk_camera_resume, - .enum_frameinervals = rk_camera_enum_frameintervals, - .cropcap = rk_camera_cropcap, - .set_crop = rk_camera_set_crop, - .get_crop = rk_camera_get_crop, - .get_formats = rk_camera_get_formats, - .put_formats = rk_camera_put_formats, - .get_fmt = rk_camera_get_fmt, - .set_fmt = rk_camera_set_fmt, - .try_fmt = rk_camera_try_fmt, - .init_videobuf = rk_camera_init_videobuf, - .reqbufs = rk_camera_reqbufs, - .poll = rk_camera_poll, - .querycap = rk_camera_querycap, - .set_bus_param = rk_camera_set_bus_param, - .s_stream = rk_camera_s_stream, /* ddl@rock-chips.com : Add stream control for host */ - .set_ctrl = rk_camera_set_ctrl, - .controls = rk_camera_controls, - .num_controls = ARRAY_SIZE(rk_camera_controls) -}; - -static int rk_camera_cif_iomux(struct device *dev) -{ - - struct pinctrl *pinctrl; - struct pinctrl_state *state; - int retval = 0; - char state_str[20] = {0}; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - strcpy(state_str,"cif_pin_all"); - - if(CHIP_NAME == 3288){ - write_grf_reg(0x0380, ((1 << 1) | (1 << (1 + 16)))); - }else if(CHIP_NAME == 3368){ - write_grf_reg(0x0900, ((1 << 1) | (1 << (1 + 16)))); - } - - /*mux CIF0_CLKOUT*/ - - pinctrl = devm_pinctrl_get(dev); - if (IS_ERR(pinctrl)) { - printk(KERN_EMERG "%s:Get pinctrl failed!\n",__func__); - return -1; - } - state = pinctrl_lookup_state(pinctrl, - state_str); - if (IS_ERR(state)){ - dev_err(dev, "%s:could not get %s pinstate\n",__func__,state_str); - return -1; - } - - if (!IS_ERR(state)) { - retval = pinctrl_select_state(pinctrl, state); - if (retval){ - dev_err(dev, - "%s:could not set %s pins\n",__func__,state_str); - return -1; - - } - } - return 0; -} - -static int rk_camera_pltfrm_init(struct device *dev, - struct rk_camera_dev *pcdev) -{ - int err; - struct rk_cif_clk *clk = NULL; - const char *compatible = NULL; - struct device_node *node = NULL, *vpu_node = NULL; - int vpu_iommu_enabled = 0; - struct iommu_domain *domain = NULL; - struct iommu_group *group = NULL; - struct rk29camera_platform_data *data = pcdev->pdata; - - err = of_property_read_string(dev->of_node->parent, - "compatible", - &compatible); - if (err < 0) { - dev_err(dev, "Get rockchip compatible failed!!!!!!"); - return -ENODEV; - } - data->rockchip_name = compatible; - RKCAMERA_TR("chip name is %s\n", data->rockchip_name); - - rk_camera_diffchips(data->rockchip_name); - - vpu_node = of_find_node_by_name(NULL, "vpu_service"); - if (vpu_node) { - err = of_property_read_u32(vpu_node, - "iommu_enabled", - &vpu_iommu_enabled); - data->iommu_enabled = vpu_iommu_enabled; - of_node_put(vpu_node); - } else { - dev_err(dev, "get vpu_node failed, vpu_iommu_enabled == 0!\n"); - } - - /* get grf base */ - node = of_parse_phandle(dev->of_node, "rockchip,grf", 0); - if (node) { - rk_cif_grf_base = syscon_node_to_regmap(node); - if (IS_ERR(rk_cif_grf_base)) - dev_err(dev, "%s regmap grf faile, d.\n", compatible); - - of_node_put(node); - } - - if (IS_CIF0()) { - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$/is_cif0\n"); - clk = &cif_clk[0]; - if ((CHIP_NAME == 3368) || (CHIP_NAME == 3326)) - clk->pclk_cif = - devm_clk_get(dev, "pclk_cif"); - clk->aclk_cif = devm_clk_get(dev, "aclk_cif0"); - clk->hclk_cif = devm_clk_get(dev, "hclk_cif0"); - if ((CHIP_NAME != 3228) && (CHIP_NAME != 3326)) - clk->cif_clk_in = devm_clk_get(dev, "cif0_in"); - clk->cif_clk_out = devm_clk_get(dev, "cif0_out"); - clk->cif_rst = devm_reset_control_get(dev, "rst_cif"); - if (IS_ERR_OR_NULL(clk->cif_rst)) { - printk(KERN_ERR "no cif reset resource define\n"); - clk->cif_rst = NULL; - } - /* spin_lock_init(&cif_clk[0].lock); */ - clk->on = false; - rk_camera_cif_iomux(dev); - } else { - clk = &cif_clk[1]; - - clk->aclk_cif = devm_clk_get(dev, "aclk_cif0"); - clk->hclk_cif = devm_clk_get(dev, "hclk_cif0"); - if ((CHIP_NAME != 3228) || (CHIP_NAME != 3326)) - clk->cif_clk_in = devm_clk_get(dev, "cif0_in"); - clk->cif_clk_out = devm_clk_get(dev, "cif0_out"); - /* spin_lock_init(&cif_clk[1].lock); */ - clk->on = false; - rk_camera_cif_iomux(dev); - } - - node = of_parse_phandle(dev->of_node, "iommus", 0); - if (node) { - /* iommu domain */ - domain = iommu_domain_alloc(&platform_bus_type); - if (!domain) - goto err_return; - - err = iommu_get_dma_cookie(domain); - if (err) - goto err_free_domain; - - group = iommu_group_get(dev); - if (!group) { - group = iommu_group_alloc(); - if (IS_ERR(group)) { - dev_err(dev, "Failed to alloc IOMMU group\n"); - goto err_put_cookie; - } - - err = iommu_group_add_device(group, dev); - iommu_group_put(group); - if (err) { - dev_err(dev, "failed to add device to IOMMU group\n"); - goto err_put_cookie; - } - } - - pcdev->domain = domain; - } else { - pcdev->domain = NULL; - } - - return 0; -err_put_cookie: - if (domain) - iommu_put_dma_cookie(domain); - -err_free_domain: - if (domain) - iommu_domain_free(domain); - -err_return: - return err; -} - -static const struct of_device_id rk_cif_of_match[] = { - {.compatible = "rockchip,cif", - .data = (void *)&rk_camera_platform_data}, - {}, -}; - -static int rk_camera_probe(struct platform_device *pdev) -{ - struct rk_camera_dev *pcdev; - struct resource *res; - struct rk_camera_frmivalenum *fival_list, *fival_nxt; - int irq, i; - int err = 0; - const struct of_device_id *match; - struct device_node *node = pdev->dev.of_node; - - RKCAMERA_TR("%s version: v%d.%d.%d Zoom by %s", - RK29_CAM_DRV_NAME, - (RK_CAM_VERSION_CODE & 0xff0000) >> 16, - (RK_CAM_VERSION_CODE & 0xff00) >> 8, - RK_CAM_VERSION_CODE & 0xff, - CAMERA_SCALE_CROP_MACHINE); - - pdev->id = RK_CAM_PLATFORM_DEV_ID_0; - - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - irq = platform_get_irq(pdev, 0); - if (!res || IS_ERR_VALUE(irq)) { - err = -ENODEV; - goto exit; - } - - pcdev = devm_kzalloc(&pdev->dev, - sizeof(struct rk_camera_dev), - GFP_KERNEL); - if (IS_ERR_OR_NULL(pcdev)) { - dev_err(&pdev->dev, "Could not allocate pcdev\n"); - err = -ENOMEM; - goto exit; - } - match = of_match_node(rk_cif_of_match, node); - pcdev->pdata = (struct rk29camera_platform_data *)match->data; - err = rk_camera_pltfrm_init(&pdev->dev, pcdev); - if (IS_ERR_VALUE(err)) { - dev_err(&pdev->dev, "pltfrm init failed\n"); - goto exit; - } - if (!rk_camera_platform_data.sensor_mclk) - rk_camera_platform_data.sensor_mclk = rk_camera_mclk_ctrl; - - pcdev->zoominfo.zoom_rate = 100; - pcdev->hostid = pdev->id; /* get host id*/ -#ifdef CONFIG_SOC_RK3028 - pcdev->chip_id = rk3028_version_val(); -#else - pcdev->chip_id = -1; -#endif - - dev_set_drvdata(&pdev->dev, pcdev); - pcdev->res = res; - if (pcdev->pdata && pcdev->pdata->io_init) - pcdev->pdata->io_init(); - - INIT_LIST_HEAD(&pcdev->capture); - INIT_LIST_HEAD(&pcdev->camera_work_queue); - spin_lock_init(&pcdev->lock); - spin_lock_init(&pcdev->camera_work_lock); - - memset(&pcdev->cropinfo.c, 0x00, sizeof(struct v4l2_rect)); - spin_lock_init(&pcdev->cropinfo.lock); - sema_init(&pcdev->zoominfo.sem, 1); - - /* - * Request the regions. - */ - if (res) { - pcdev->base = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR_OR_NULL(pcdev->base)) { - dev_err(pcdev->dev, "ioremap() of registers failed\n"); - err = -ENXIO; - goto exit; - } - } - pcdev->irqinfo.irq = irq; - pcdev->dev = &pdev->dev; - priv_camera_dev = pcdev; - - /* config buffer address */ - /* request irq */ - if (irq > 0) { - err = devm_request_irq(&pdev->dev, - irq, - rk_camera_irq, - IRQF_SHARED, - RK29_CAM_DRV_NAME, - pcdev); - if (IS_ERR_VALUE(err)) { - dev_err(&pdev->dev, "Camera interrupt register failed\n"); - goto exit; - } - } - - if (IS_CIF0()) - pcdev->camera_wq = create_workqueue("rk_cam_wkque_cif0"); - else - pcdev->camera_wq = create_workqueue("rk_cam_wkque_cif1"); - if (!pcdev->camera_wq) { - dev_err(&pdev->dev, "Create workqueue failed!\n"); - goto exit_free_irq; - } - - pcdev->camera_reinit_work.pcdev = pcdev; - INIT_WORK(&(pcdev->camera_reinit_work.work), rk_camera_reinit_work); - - for (i = 0; i < 2; i++) { - pcdev->icd_frmival[i].icd = NULL; - pcdev->icd_frmival[i].fival_list = - kzalloc(sizeof(struct rk_camera_frmivalenum), - GFP_KERNEL); - if (IS_ERR_OR_NULL(pcdev->icd_frmival[i].fival_list)) { - dev_err(&pdev->dev, "Couldn't allocate fival_list[%d]\n", - i); - err = -ENOMEM; - goto exit; - } - } - - pcdev->soc_host.drv_name = RK29_CAM_DRV_NAME; - pcdev->soc_host.ops = &rk_soc_camera_host_ops; - pcdev->soc_host.priv = pcdev; - pcdev->soc_host.v4l2_dev.dev = &pdev->dev; - pcdev->soc_host.nr = pdev->id; - pdev->dev.of_node = NULL; - debug_printk("/$$$$$$$$$$$$$$$$$$$$$$/next soc_camera_host_register\n"); - err = soc_camera_host_register(&pcdev->soc_host); - if (err) { - dev_err(&pdev->dev, "soc_camera_host_register failed\n"); - goto exit_free_irq; - } - - pm_runtime_enable(&pdev->dev); - - pcdev->fps_timer.pcdev = pcdev; - hrtimer_init(&pcdev->fps_timer.timer, - CLOCK_MONOTONIC, - HRTIMER_MODE_REL); - pcdev->fps_timer.timer.function = rk_camera_fps_func; - pcdev->icd_cb.sensor_cb = NULL; - -#if (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_IPP) - pcdev->icd_cb.scale_crop_cb = rk_camera_scale_crop_ipp; -#elif (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_ARM) - pcdev->icd_cb.scale_crop_cb = rk_camera_scale_crop_arm; -#elif (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_RGA) - pcdev->icd_cb.scale_crop_cb = rk_camera_scale_crop_rga; -#elif(CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_PP) - pcdev->icd_cb.scale_crop_cb = rk_camera_scale_crop_pp; -#endif - - return 0; - -exit_free_irq: - for (i = 0; i < 2; i++) { - fival_list = pcdev->icd_frmival[i].fival_list; - fival_nxt = fival_list; - while (fival_nxt) { - fival_nxt = fival_list->nxt; - kfree(fival_list); - fival_list = fival_nxt; - } - } - - if (pcdev->camera_wq) { - destroy_workqueue(pcdev->camera_wq); - pcdev->camera_wq = NULL; - } -exit: - return err; -} - -static int rk_camera_remove(struct platform_device *pdev) -{ - struct rk_camera_dev *pcdev = platform_get_drvdata(pdev); - struct rk_camera_frmivalenum *fival_list, *fival_nxt; - int i; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - if (pcdev->camera_wq) { - destroy_workqueue(pcdev->camera_wq); - pcdev->camera_wq = NULL; - } - - for (i = 0; i < 2; i++) { - fival_list = pcdev->icd_frmival[i].fival_list; - fival_nxt = fival_list; - while (fival_nxt) { - fival_nxt = fival_list->nxt; - kfree(fival_list); - fival_list = fival_nxt; - } - } - - soc_camera_host_unregister(&pcdev->soc_host); - - /* ddl@rock-chips.com : Free IO in deinit function */ - if (pcdev->pdata && pcdev->pdata->io_deinit) { - pcdev->pdata->io_deinit(0); - pcdev->pdata->io_deinit(1); - } - - pm_runtime_disable(&pdev->dev); - - if (pcdev->domain) { - iommu_group_remove_device(&pdev->dev); - iommu_put_dma_cookie(pcdev->domain); - iommu_domain_free(pcdev->domain); - } - - dev_info(&pdev->dev, "RK28 Camera driver unloaded\n"); - - return 0; -} - -static struct platform_driver rk_camera_driver = -{ - .driver = { - .name = RK29_CAM_DRV_NAME, - .of_match_table = of_match_ptr(rk_cif_of_match), - }, - .probe = rk_camera_probe, - .remove = (rk_camera_remove), -}; - -static int rk_camera_init_async(void *unused) -{ - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - platform_driver_register(&rk_camera_driver); - return 0; -} - -static int __init rk_camera_init(void) -{ - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - kthread_run(rk_camera_init_async, NULL, "rk_camera_init"); - return 0; -} - -static void __exit rk_camera_exit(void) -{ - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - platform_driver_unregister(&rk_camera_driver); -} - -device_initcall_sync(rk_camera_init); -module_exit(rk_camera_exit); - -MODULE_DESCRIPTION("RKSoc Camera Host driver"); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); diff --git a/drivers/media/video/rk30_camera_pingpong.c b/drivers/media/video/rk30_camera_pingpong.c deleted file mode 100644 index 06625aab2cab..000000000000 --- a/drivers/media/video/rk30_camera_pingpong.c +++ /dev/null @@ -1,3447 +0,0 @@ -/* - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#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 "../../video/rockchip/rga/rga.h" - -/*******yzm********* - -#include -#if (defined(CONFIG_ARCH_RK2928) || defined(CONFIG_ARCH_RK3026)) -#include -#include -#include -#define SOFT_RST_CIF1 (SOFT_RST_MAX+1) -#endif -*/ -#include - -#include -#include -#include -#include -#include -#include -#include - -static int debug = 0; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define CAMMODULE_NAME "rk_cam_cif" - -#define wprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_ERR "%s(%d): " fmt,CAMMODULE_NAME,__LINE__,## arg); } while (0) - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_ERR"%s(%d): " fmt,CAMMODULE_NAME,__LINE__,## arg); } while (0) - -#define RKCAMERA_TR(format, ...) printk(KERN_ERR "%s(%d):" format,CAMMODULE_NAME,__LINE__,## __VA_ARGS__) -#define RKCAMERA_DG1(format, ...) wprintk(1, format, ## __VA_ARGS__) -#define RKCAMERA_DG2(format, ...) dprintk(2, format, ## __VA_ARGS__) -#define debug_printk(format, ...) dprintk(3, format, ## __VA_ARGS__) - -/* CIF Reg Offset*/ -#define CIF_CIF_CTRL 0x00 -#define CIF_CIF_INTEN 0x04 -#define CIF_CIF_INTSTAT 0x08 -#define CIF_CIF_FOR 0x0c -#define CIF_CIF_LINE_NUM_ADDR 0x10 -#define CIF_CIF_FRM0_ADDR_Y 0x14 -#define CIF_CIF_FRM0_ADDR_UV 0x18 -#define CIF_CIF_FRM1_ADDR_Y 0x1c -#define CIF_CIF_FRM1_ADDR_UV 0x20 -#define CIF_CIF_VIR_LINE_WIDTH 0x24 -#define CIF_CIF_SET_SIZE 0x28 -#define CIF_CIF_SCM_ADDR_Y 0x2c -#define CIF_CIF_SCM_ADDR_U 0x30 -#define CIF_CIF_SCM_ADDR_V 0x34 -#define CIF_CIF_WB_UP_FILTER 0x38 -#define CIF_CIF_WB_LOW_FILTER 0x3c -#define CIF_CIF_WBC_CNT 0x40 -#define CIF_CIF_CROP 0x44 -#define CIF_CIF_SCL_CTRL 0x48 -#define CIF_CIF_SCL_DST 0x4c -#define CIF_CIF_SCL_FCT 0x50 -#define CIF_CIF_SCL_VALID_NUM 0x54 -#define CIF_CIF_LINE_LOOP_CTR 0x58 -#define CIF_CIF_FRAME_STATUS 0x60 -#define CIF_CIF_CUR_DST 0x64 -#define CIF_CIF_LAST_LINE 0x68 -#define CIF_CIF_LAST_PIX 0x6c - -/*The key register bit descrition*/ -/* CIF_CTRL Reg , ignore SCM,WBC,ISP,*/ -#define DISABLE_CAPTURE (0x00<<0) -#define ENABLE_CAPTURE (0x01<<0) -#define MODE_ONEFRAME (0x00<<1) -#define MODE_PINGPONG (0x01<<1) -#define MODE_LINELOOP (0x02<<1) -#define AXI_BURST_16 (0x0F << 12) - -/*CIF_CIF_INTEN*/ -#define FRAME_END_EN (0x01<<1) -#define BUS_ERR_EN (0x01<<6) -#define SCL_ERR_EN (0x01<<7) - -/*CIF_CIF_FOR*/ -#define VSY_HIGH_ACTIVE (0x01<<0) -#define VSY_LOW_ACTIVE (0x00<<0) -#define HSY_LOW_ACTIVE (0x01<<1) -#define HSY_HIGH_ACTIVE (0x00<<1) -#define INPUT_MODE_YUV (0x00<<2) -#define INPUT_MODE_PAL (0x02<<2) -#define INPUT_MODE_NTSC (0x03<<2) -#define INPUT_MODE_RAW (0x04<<2) -#define INPUT_MODE_JPEG (0x05<<2) -#define INPUT_MODE_MIPI (0x06<<2) -#define YUV_INPUT_ORDER_UYVY(ori) (ori & (~(0x03<<5))) -#define YUV_INPUT_ORDER_YVYU(ori) ((ori & (~(0x01<<6)))|(0x01<<5)) -#define YUV_INPUT_ORDER_VYUY(ori) ((ori & (~(0x01<<5))) | (0x1<<6)) -#define YUV_INPUT_ORDER_YUYV(ori) (ori|(0x03<<5)) -#define YUV_INPUT_422 (0x00<<7) -#define YUV_INPUT_420 (0x01<<7) -#define INPUT_420_ORDER_EVEN (0x00<<8) -#define INPUT_420_ORDER_ODD (0x01<<8) -#define CCIR_INPUT_ORDER_ODD (0x00<<9) -#define CCIR_INPUT_ORDER_EVEN (0x01<<9) -#define RAW_DATA_WIDTH_8 (0x00<<11) -#define RAW_DATA_WIDTH_10 (0x01<<11) -#define RAW_DATA_WIDTH_12 (0x02<<11) -#define YUV_OUTPUT_422 (0x00<<16) -#define YUV_OUTPUT_420 (0x01<<16) -#define OUTPUT_420_ORDER_EVEN (0x00<<17) -#define OUTPUT_420_ORDER_ODD (0x01<<17) -#define RAWD_DATA_LITTLE_ENDIAN (0x00<<18) -#define RAWD_DATA_BIG_ENDIAN (0x01<<18) -#define UV_STORAGE_ORDER_UVUV (0x00<<19) -#define UV_STORAGE_ORDER_VUVU (0x01<<19) - -/*CIF_CIF_SCL_CTRL*/ -#define ENABLE_SCL_DOWN (0x01<<0) -#define DISABLE_SCL_DOWN (0x00<<0) -#define ENABLE_SCL_UP (0x01<<1) -#define DISABLE_SCL_UP (0x00<<1) -#define ENABLE_YUV_16BIT_BYPASS (0x01<<4) -#define DISABLE_YUV_16BIT_BYPASS (0x00<<4) -#define ENABLE_RAW_16BIT_BYPASS (0x01<<5) -#define DISABLE_RAW_16BIT_BYPASS (0x00<<5) -#define ENABLE_32BIT_BYPASS (0x01<<6) -#define DISABLE_32BIT_BYPASS (0x00<<6) - -//CIF_CIF_FRAME_STATUS -#define CIF_F0_READY (0x01<<0) -#define CIF_F1_READY (0x01<<1) - -extern void __iomem *rk_cif_grf_base; -extern void __iomem *rk_cif_cru_base; - -#define MIN(x,y) ((xy) ? x: y) -#define RK_SENSOR_24MHZ 24*1000*1000 /* MHz */ -#define RK_SENSOR_48MHZ 48 - -#define __raw_readl(p) (*(unsigned int *)(p)) -#define __raw_writel(v,p) (*(unsigned int *)(p) = (v)) - -#define write_cif_reg(base,addr, val) __raw_writel(val, addr+(base)) -#define read_cif_reg(base,addr) __raw_readl(addr+(base)) -#define mask_cif_reg(addr, msk, val) write_cif_reg(addr, (val)|((~(msk))&read_cif_reg(addr))) - -/* -#if defined(CONFIG_ARCH_RK30) || defined(CONFIG_ARCH_RK3188) -//CRU,PIXCLOCK -#define CRU_PCLK_REG30 0xbc -#define ENANABLE_INVERT_PCLK_CIF0 ((0x1<<24)|(0x1<<8)) -#define DISABLE_INVERT_PCLK_CIF0 ((0x1<<24)|(0x0<<8)) -#define ENANABLE_INVERT_PCLK_CIF1 ((0x1<<28)|(0x1<<12)) -#define DISABLE_INVERT_PCLK_CIF1 ((0x1<<28)|(0x0<<12)) - -#define CRU_CIF_RST_REG30 0x128 -#define MASK_RST_CIF0 (0x01 << 30) -#define MASK_RST_CIF1 (0x01 << 31) -#define RQUEST_RST_CIF0 (0x01 << 14) -#define RQUEST_RST_CIF1 (0x01 << 15) - -#define write_cru_reg(addr, val) __raw_writel(val, addr+RK30_CRU_BASE) -#define read_cru_reg(addr) __raw_readl(addr+RK30_CRU_BASE) -#define mask_cru_reg(addr, msk, val) write_cru_reg(addr,(val)|((~(msk))&read_cru_reg(addr))) -#endif -*/ -/*********yzm**********/ - -static u32 CRU_PCLK_REG30; -static u32 CRU_CLK_OUT; -static u32 CRU_CLKSEL29_CON; -static u32 ENANABLE_INVERT_PCLK_CIF0; -static u32 DISABLE_INVERT_PCLK_CIF0; -static u32 ENANABLE_INVERT_PCLK_CIF1; -static u32 DISABLE_INVERT_PCLK_CIF1; -static u32 CHIP_NAME; - -#define write_cru_reg(addr, val) __raw_writel(val, addr+RK_CRU_VIRT) -#define read_cru_reg(addr) __raw_readl(addr+RK_CRU_VIRT) -#define mask_cru_reg(addr, msk, val) write_cru_reg(addr,(val)|((~(msk))&read_cru_reg(addr))) - -#define rk3368_write_cru_reg(addr, val) __raw_writel(val, addr+rk_cif_cru_base) -#define rk3368_read_cru_reg(addr) __raw_readl(addr+rk_cif_cru_base) -#define rk3368_mask_cru_reg(addr, msk, val) rk3368_write_cru_reg(addr,(val)|((~(msk))&rk3368_read_cru_reg(addr))) - -/*********yzm*********end*/ -/* -#if defined(CONFIG_ARCH_RK2928) -#define write_cru_reg(addr, val) -#define read_cru_reg(addr) 0 -#define mask_cru_reg(addr, msk, val) -#endif -*/ - -/* -#if defined(CONFIG_ARCH_RK3066B) || defined(CONFIG_ARCH_RK3188) -//GRF_IO_CON3 0x100 -#define CIF_DRIVER_STRENGTH_2MA (0x00 << 12) -#define CIF_DRIVER_STRENGTH_4MA (0x01 << 12) -#define CIF_DRIVER_STRENGTH_8MA (0x02 << 12) -#define CIF_DRIVER_STRENGTH_12MA (0x03 << 12) -#define CIF_DRIVER_STRENGTH_MASK (0x03 << 28) - -//GRF_IO_CON4 0x104 -#define CIF_CLKOUT_AMP_3V3 (0x00 << 10) -#define CIF_CLKOUT_AMP_1V8 (0x01 << 10) -#define CIF_CLKOUT_AMP_MASK (0x01 << 26) - -#define write_grf_reg(addr, val) __raw_writel(val, addr+RK30_GRF_BASE) -#define read_grf_reg(addr) __raw_readl(addr+RK30_GRF_BASE) -#define mask_grf_reg(addr, msk, val) write_grf_reg(addr,(val)|((~(msk))&read_grf_reg(addr))) -#else -#define write_grf_reg(addr, val) -#define read_grf_reg(addr) 0 -#define mask_grf_reg(addr, msk, val) -#endif -*/ -#define CAM_WORKQUEUE_IS_EN() (false)//(true) -#define CAM_IPPWORK_IS_EN() (false)/*((pcdev->zoominfo.a.c.width != pcdev->icd->user_width) || (pcdev->zoominfo.a.c.height != pcdev->icd->user_height))*/ - -#define IS_CIF0() (true)/*(pcdev->hostid == RK_CAM_PLATFORM_DEV_ID_0)*/ -#if (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_IPP) -#define CROP_ALIGN_BYTES (0x03) -#define CIF_DO_CROP 0 -#elif (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_ARM) -#define CROP_ALIGN_BYTES (0x0f) -#define CIF_DO_CROP 0 -#elif (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_RGA) -#define CROP_ALIGN_BYTES (0x03) -#define CIF_DO_CROP 0 -#elif(CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_PP) -#define CROP_ALIGN_BYTES (0x0F) -#define CIF_DO_CROP 1 -#endif - -/* -*v0.1.0 : this driver is 3.10 kernel driver; - copy and updata from v0.3.0x19; - support rk312x; -*v0.1.1: - 1. spin lock in struct rk_cif_clk is not neccessary,and scheduled func clk_get called in this spin lock scope - cause warning, so remove this spin lock . -*v0.1.2: - 1. rk3126 and rk3128 use different dts file. -*v0.1.3: - 1. i2c 1 and wifi use the common io in rk3128,so just enable i2c1 in rk3126 dts file -*v0.1.4: - 1. When cif was at work, the aclk is closed ,may cause bus abnormal ,so sleep 100ms before close aclk -*v0.1.5: - 1. Improve the code to support all configuration.reset,af,flash... -*v0.1.6: - 1. Delete SOCAM_DATAWIDTH_8 in SENSOR_BUS_PARAM parameters,it conflict with V4L2_MBUS_PCLK_SAMPLE_FALLING. -*v0.1.7: - 1. Add power and powerdown controled by PMU. -*v0.1.8: - 1. Support front and rear camera support are the same. -*v0.1.9: - 1. Support pingpong mode. - 2. Fix cif_clk_out cannot close which base on XIN24M and cannot turn to 0. - 3. Move Camera Sensor Macro from rk_camera.h to rk_camera_sensor_info.h -*v0.1.a: - 1. Support rk3368. -*/ -#define RK_CAM_VERSION_CODE KERNEL_VERSION(0, 1, 0xa) -static int version = RK_CAM_VERSION_CODE; -module_param(version, int, S_IRUGO); - -/* limit to rk29 hardware capabilities */ -#define RK_CAM_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_HSYNC_ACTIVE_HIGH |\ - V4L2_MBUS_HSYNC_ACTIVE_LOW |\ - V4L2_MBUS_VSYNC_ACTIVE_HIGH |\ - V4L2_MBUS_VSYNC_ACTIVE_LOW |\ - V4L2_MBUS_PCLK_SAMPLE_RISING |\ - V4L2_MBUS_PCLK_SAMPLE_FALLING|\ - V4L2_MBUS_DATA_ACTIVE_HIGH |\ - V4L2_MBUS_DATA_ACTIVE_LOW|\ - SOCAM_DATAWIDTH_8|SOCAM_DATAWIDTH_10|\ - SOCAM_MCLK_24MHZ |SOCAM_MCLK_48MHZ) - -#define RK_CAM_W_MIN 48 -#define RK_CAM_H_MIN 32 -#define RK_CAM_W_MAX 3856 /* ddl@rock-chips.com : 10M Pixel */ -#define RK_CAM_H_MAX 2764 -#define RK_CAM_FRAME_INVAL_INIT 0 -#define RK_CAM_FRAME_INVAL_DC 0 /* ddl@rock-chips.com : */ -#define RK30_CAM_FRAME_MEASURE 5 - - -extern void videobuf_dma_contig_free(struct videobuf_queue *q, struct videobuf_buffer *buf); -extern dma_addr_t videobuf_to_dma_contig(struct videobuf_buffer *buf); -/* buffer for one video frame */ -struct rk_camera_buffer -{ - /* common v4l buffer stuff -- must be first */ - struct videobuf_buffer vb; - enum v4l2_mbus_pixelcode code; - int inwork; -}; -enum rk_camera_reg_state -{ - Reg_Invalidate, - Reg_Validate -}; - -struct rk_camera_reg -{ - unsigned int cifCtrl; - unsigned int cifCrop; - unsigned int cifFs; - unsigned int cifIntEn; - unsigned int cifFmt; - unsigned int cifVirWidth; - unsigned int cifScale; -/* unsigned int VipCrm;*/ - enum rk_camera_reg_state Inval; -}; -struct rk_camera_work -{ - struct videobuf_buffer *vb; - struct rk_camera_dev *pcdev; - struct work_struct work; - struct list_head queue; - unsigned int index; -}; -struct rk_camera_frmivalenum -{ - struct v4l2_frmivalenum fival; - struct rk_camera_frmivalenum *nxt; -}; -struct rk_camera_frmivalinfo -{ - struct soc_camera_device *icd; - struct rk_camera_frmivalenum *fival_list; -}; -struct rk_camera_zoominfo -{ - struct semaphore sem; - struct v4l2_crop a; - int vir_width; - int vir_height; - int zoom_rate; -}; -#if CAMERA_VIDEOBUF_ARM_ACCESS -struct rk29_camera_vbinfo -{ - unsigned long phy_addr; - void __iomem *vir_addr; - unsigned int size; -}; -#endif -struct rk_camera_timer{ - struct rk_camera_dev *pcdev; - struct hrtimer timer; - bool istarted; -}; -struct rk_cif_clk -{ - /************must modify start************/ - struct clk *pd_cif; - struct clk *aclk_cif; - struct clk *hclk_cif; - struct clk *cif_clk_in; - struct clk *cif_clk_out; - /************must modify end************/ - - // spinlock_t lock; - bool on; -}; - -struct rk_cif_crop -{ - spinlock_t lock; - struct v4l2_rect c; - struct v4l2_rect bounds; -}; - -struct rk_cif_irqinfo -{ - unsigned int irq; - unsigned long cifirq_idx; - unsigned long cifirq_normal_idx; - unsigned long cifirq_abnormal_idx; - - unsigned long dmairq_idx; - spinlock_t lock; -}; - -struct rk_camera_dev -{ - struct soc_camera_host soc_host; - struct device *dev; - /* RK2827x is only supposed to handle one camera on its Quick Capture - * interface. If anyone ever builds hardware to enable more than - * one camera, they will have to modify this driver too */ - struct soc_camera_device *icd; - void __iomem *base; - int frame_inval; /* ddl@rock-chips.com : The first frames is invalidate */ - - unsigned int fps; - unsigned int last_fps; - unsigned long frame_interval; - unsigned int pixfmt; - /*for ipp */ - unsigned long vipmem_phybase; - void __iomem *vipmem_virbase; - unsigned int vipmem_size; - unsigned int vipmem_bsize; -#if CAMERA_VIDEOBUF_ARM_ACCESS - struct rk29_camera_vbinfo *vbinfo; - unsigned int vbinfo_count; -#endif - int host_width; - int host_height; - int host_left; /*sensor output size ?*/ - int host_top; - int hostid; - int icd_width; - int icd_height; - - struct rk_cif_crop cropinfo; - struct rk_cif_irqinfo irqinfo; - - struct rk29camera_platform_data *pdata; - struct resource *res; - struct list_head capture; - struct rk_camera_zoominfo zoominfo; - - spinlock_t lock; - - struct videobuf_buffer *active0; - struct videobuf_buffer *active1; - int active_buf; - struct rk_camera_reg reginfo_suspend; - struct workqueue_struct *camera_wq; - struct rk_camera_work *camera_work; - struct list_head camera_work_queue; - spinlock_t camera_work_lock; - unsigned int camera_work_count; - struct rk_camera_timer fps_timer; - struct rk_camera_work camera_reinit_work; - int icd_init; - rk29_camera_sensor_cb_s icd_cb; - struct rk_camera_frmivalinfo icd_frmival[2]; - bool timer_get_fps; - unsigned int reinit_times; - struct videobuf_queue *video_vq; - atomic_t stop_cif; - struct timeval first_tv; - - int chip_id; -}; - -static const struct v4l2_queryctrl rk_camera_controls[] = -{ - { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 100, - .maximum = 300, - .step = 5, - .default_value = 100, - } -}; - -static struct rk_cif_clk cif_clk[2]; - -static DEFINE_MUTEX(camera_lock); -static const char *rk_cam_driver_description = "RK_Camera"; - -static int rk_camera_s_stream(struct soc_camera_device *icd, int enable); -static void rk_camera_capture_process(struct work_struct *work); - -static void rk_camera_diffchips(const char *rockchip_name) -{ - if(strstr(rockchip_name,"3128")||strstr(rockchip_name,"3126")) - { - CRU_PCLK_REG30 = 0xbc; - ENANABLE_INVERT_PCLK_CIF0 = ((0x1<<23)|(0x1<<7)); - DISABLE_INVERT_PCLK_CIF0 = ((0x1<<23)|(0x0<<7)); - ENANABLE_INVERT_PCLK_CIF1 = ENANABLE_INVERT_PCLK_CIF0; - DISABLE_INVERT_PCLK_CIF1 = DISABLE_INVERT_PCLK_CIF0; - - CRU_CLK_OUT = 0xdc; - CRU_CLKSEL29_CON = 0xb8; - - CHIP_NAME = 3126; - }else if(strstr(rockchip_name,"3368")) - { - CRU_PCLK_REG30 = 0x154; - ENANABLE_INVERT_PCLK_CIF0 = ((0x1<<29)|(0x1<<13)); - DISABLE_INVERT_PCLK_CIF0 = ((0x1<<29)|(0x0<<13)); - ENANABLE_INVERT_PCLK_CIF1 = ENANABLE_INVERT_PCLK_CIF0; - DISABLE_INVERT_PCLK_CIF1 = DISABLE_INVERT_PCLK_CIF0; - - //CRU_CLK_OUT = 0x16c; - CHIP_NAME = 3368; - } -} -static inline void rk_cru_set_soft_reset(u32 idx, bool on , u32 RK_CRU_SOFTRST_CON) -{ - u32 val = 0; - void __iomem *reg; - - if(CHIP_NAME == 3368) - reg = (void*)(rk_cif_cru_base + RK_CRU_SOFTRST_CON); - else - reg = (void*)(RK_CRU_VIRT + RK_CRU_SOFTRST_CON); - - if(CHIP_NAME == 3126){ - val = on ? 0x10001U << 14 : 0x10000U << 14; - }else if(CHIP_NAME == 3368){ - val = on ? 0x10001U << 8 : 0x10000U << 8; - } - writel_relaxed(val, reg); - dsb(); -} - -static void rk_camera_cif_reset(struct rk_camera_dev *pcdev, int only_rst) -{ - int ctrl_reg,inten_reg,crop_reg,set_size_reg,for_reg,vir_line_width_reg,scl_reg,y_reg,uv_reg; - u32 RK_CRU_SOFTRST_CON = 0; - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - if(strstr(pcdev->pdata->rockchip_name,"3128")||strstr(pcdev->pdata->rockchip_name,"3126")) - RK_CRU_SOFTRST_CON = RK312X_CRU_SOFTRSTS_CON(6); - else if(strstr(pcdev->pdata->rockchip_name,"3368")) - RK_CRU_SOFTRST_CON = RK3368_CRU_SOFTRSTS_CON(6); - - if (only_rst == true) { - rk_cru_set_soft_reset(0, true ,RK_CRU_SOFTRST_CON); - udelay(5); - rk_cru_set_soft_reset(0, false ,RK_CRU_SOFTRST_CON); - } else { - ctrl_reg = read_cif_reg(pcdev->base,CIF_CIF_CTRL); - if (ctrl_reg & ENABLE_CAPTURE) { - write_cif_reg(pcdev->base,CIF_CIF_CTRL, ctrl_reg&~ENABLE_CAPTURE); - } - crop_reg = read_cif_reg(pcdev->base,CIF_CIF_CROP); - set_size_reg = read_cif_reg(pcdev->base,CIF_CIF_SET_SIZE); - inten_reg = read_cif_reg(pcdev->base,CIF_CIF_INTEN); - for_reg = read_cif_reg(pcdev->base,CIF_CIF_FOR); - vir_line_width_reg = read_cif_reg(pcdev->base,CIF_CIF_VIR_LINE_WIDTH); - scl_reg = read_cif_reg(pcdev->base,CIF_CIF_SCL_CTRL); - y_reg = read_cif_reg(pcdev->base, CIF_CIF_FRM0_ADDR_Y); - uv_reg = read_cif_reg(pcdev->base, CIF_CIF_FRM0_ADDR_UV); - - rk_cru_set_soft_reset(0, true ,RK_CRU_SOFTRST_CON); - udelay(5); - rk_cru_set_soft_reset(0, false ,RK_CRU_SOFTRST_CON); - - write_cif_reg(pcdev->base,CIF_CIF_CTRL, ctrl_reg&~ENABLE_CAPTURE); - write_cif_reg(pcdev->base,CIF_CIF_INTEN, inten_reg); - write_cif_reg(pcdev->base,CIF_CIF_CROP, crop_reg); - write_cif_reg(pcdev->base,CIF_CIF_SET_SIZE, set_size_reg); - write_cif_reg(pcdev->base,CIF_CIF_FOR, for_reg); - write_cif_reg(pcdev->base,CIF_CIF_VIR_LINE_WIDTH,vir_line_width_reg); - write_cif_reg(pcdev->base,CIF_CIF_SCL_CTRL,scl_reg); - write_cif_reg(pcdev->base,CIF_CIF_FRM0_ADDR_Y,y_reg); /*ddl@rock-chips.com v0.3.0x13 */ - write_cif_reg(pcdev->base,CIF_CIF_FRM0_ADDR_UV,uv_reg); - } - return; -} - - -/* - * Videobuf operations - */ -static int rk_videobuf_setup(struct videobuf_queue *vq, unsigned int *count, - unsigned int *size) -{ - struct soc_camera_device *icd = vq->priv_data; - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/ - struct rk_camera_dev *pcdev = ici->priv; - unsigned int i; - struct rk_camera_work *wk; - - struct soc_mbus_pixelfmt fmt; - int bytes_per_line; - int bytes_per_line_host; - fmt.packing = SOC_MBUS_PACKING_1_5X8; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - bytes_per_line = soc_mbus_bytes_per_line(icd->user_width, - icd->current_fmt->host_fmt); - if(icd->current_fmt->host_fmt->fourcc == V4L2_PIX_FMT_RGB565) - bytes_per_line_host = soc_mbus_bytes_per_line(pcdev->host_width, - &fmt); - else if(icd->current_fmt->host_fmt->fourcc == V4L2_PIX_FMT_RGB24) - bytes_per_line_host = pcdev->host_width*3; - else - bytes_per_line_host = soc_mbus_bytes_per_line(pcdev->host_width, - icd->current_fmt->host_fmt); - /* dev_dbg(&icd->dev, "count=%d, size=%d\n", *count, *size);*/ /*yzm*/ - - if (bytes_per_line_host < 0) - return bytes_per_line_host; - - /* planar capture requires Y, U and V buffers to be page aligned */ - *size = PAGE_ALIGN(bytes_per_line*icd->user_height); /* Y pages UV pages, yuv422*/ - pcdev->vipmem_bsize = PAGE_ALIGN(bytes_per_line_host * pcdev->host_height); - - if (CAM_WORKQUEUE_IS_EN()) { - - if (CAM_IPPWORK_IS_EN()) { - BUG_ON(pcdev->vipmem_sizevipmem_bsize); - if (*count > pcdev->vipmem_size/pcdev->vipmem_bsize) { /* Buffers must be limited, when this resolution is genered by IPP */ - *count = pcdev->vipmem_size/pcdev->vipmem_bsize; - } - } - - if ((pcdev->camera_work_count != *count) && pcdev->camera_work) { - kfree(pcdev->camera_work); - pcdev->camera_work = NULL; - pcdev->camera_work_count = 0; - } - - if (pcdev->camera_work == NULL) { - pcdev->camera_work = wk = kzalloc(sizeof(struct rk_camera_work)*(*count), GFP_KERNEL); - if (pcdev->camera_work == NULL) { - RKCAMERA_TR("kmalloc failed\n"); - BUG(); - } - INIT_LIST_HEAD(&pcdev->camera_work_queue); - - for (i=0; i<(*count); i++) { - wk->index = i; - list_add_tail(&wk->queue, &pcdev->camera_work_queue); - wk++; - } - pcdev->camera_work_count = (*count); - } -#if CAMERA_VIDEOBUF_ARM_ACCESS - if (pcdev->vbinfo && (pcdev->vbinfo_count != *count)) { - kfree(pcdev->vbinfo); - pcdev->vbinfo = NULL; - pcdev->vbinfo_count = 0x00; - } - - if (pcdev->vbinfo == NULL) { - pcdev->vbinfo = kzalloc(sizeof(struct rk29_camera_vbinfo)*(*count), GFP_KERNEL); - if (pcdev->vbinfo == NULL) { - RKCAMERA_TR("vbinfo kmalloc fail\n"); - BUG(); - } - memset(pcdev->vbinfo,0,sizeof(struct rk29_camera_vbinfo)*(*count)); - pcdev->vbinfo_count = *count; - } -#endif - } - pcdev->video_vq = vq; - RKCAMERA_DG1("videobuf size:%d, vipmem_buf size:%d, count:%d \n",*size,pcdev->vipmem_size, *count); - - return 0; -} -static void rk_videobuf_free(struct videobuf_queue *vq, struct rk_camera_buffer *buf) -{ - struct soc_camera_device *icd = vq->priv_data; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - - dev_dbg(icd->control, "%s (vb=0x%p) 0x%08lx %zd\n", __func__,/*yzm*/ - &buf->vb, buf->vb.baddr, buf->vb.bsize); - - /* ddl@rock-chips.com: buf_release called soc_camera_streamoff and soc_camera_close*/ - if (buf->vb.state == VIDEOBUF_NEEDS_INIT) - return; - - if (in_interrupt()) - BUG(); - /* - * This waits until this buffer is out of danger, i.e., until it is no - * longer in STATE_QUEUED or STATE_ACTIVE - */ - videobuf_waiton(vq, &buf->vb, 0, 0); - videobuf_dma_contig_free(vq, &buf->vb); - /*dev_dbg(&icd->dev, "%s freed\n", __func__);*/ /*yzm*/ - buf->vb.state = VIDEOBUF_NEEDS_INIT; - return; -} -static int rk_videobuf_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb, enum v4l2_field field) -{ - struct soc_camera_device *icd = vq->priv_data; - struct rk_camera_buffer *buf; - int ret; - int bytes_per_line = soc_mbus_bytes_per_line(icd->user_width, - icd->current_fmt->host_fmt); - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - if ((bytes_per_line < 0) || (vb->boff == 0)) - return -EINVAL; - - buf = container_of(vb, struct rk_camera_buffer, vb); - - /*dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %zd\n", __func__,*/ /*yzm*/ - /* vb, vb->baddr, vb->bsize);*/ /*yzm*/ - - /* Added list head initialization on alloc */ - WARN_ON(!list_empty(&vb->queue)); - - BUG_ON(NULL == icd->current_fmt); - - if (buf->code != icd->current_fmt->code || - vb->width != icd->user_width || - vb->height != icd->user_height || - vb->field != field) { - buf->code = icd->current_fmt->code; - vb->width = icd->user_width; - vb->height = icd->user_height; - vb->field = field; - vb->state = VIDEOBUF_NEEDS_INIT; - } - - vb->size = bytes_per_line*vb->height; /* ddl@rock-chips.com : fmt->depth is coorect */ - if (0 != vb->baddr && vb->bsize < vb->size) { - ret = -EINVAL; - goto out; - } - - if (vb->state == VIDEOBUF_NEEDS_INIT) { - ret = videobuf_iolock(vq, vb, NULL); - if (ret) { - goto fail; - } - vb->state = VIDEOBUF_PREPARED; - } - - return 0; -fail: - rk_videobuf_free(vq, buf); -out: - return ret; -} - -static inline void rk_videobuf_capture(struct videobuf_buffer *vb,struct rk_camera_dev *rk_pcdev, int fmt_ready) -{ - unsigned long y_addr,uv_addr; - struct rk_camera_dev *pcdev = rk_pcdev; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - - if (vb) { - if (CAM_WORKQUEUE_IS_EN() & CAM_IPPWORK_IS_EN()) { - y_addr = pcdev->vipmem_phybase + vb->i*pcdev->vipmem_bsize; - uv_addr = y_addr + pcdev->zoominfo.vir_width*pcdev->zoominfo.vir_height; - if (y_addr > (pcdev->vipmem_phybase + pcdev->vipmem_size - pcdev->vipmem_bsize)) { - RKCAMERA_TR("vipmem for IPP is overflow! %dx%d -> %dx%d vb_index:%d\n",pcdev->host_width,pcdev->host_height, - pcdev->icd->user_width,pcdev->icd->user_height, vb->i); - BUG(); - } - } else { - y_addr = vb->boff; - uv_addr = y_addr + vb->width * vb->height; - } -#if defined(CONFIG_ARCH_RK3188) - rk_camera_cif_reset(pcdev,false); -#endif - - switch(fmt_ready) - { - case 0: - write_cif_reg(pcdev->base,CIF_CIF_FRM0_ADDR_Y, y_addr); - write_cif_reg(pcdev->base,CIF_CIF_FRM0_ADDR_UV, uv_addr); - break; - case 1: - write_cif_reg(pcdev->base,CIF_CIF_FRM1_ADDR_Y, y_addr); - write_cif_reg(pcdev->base,CIF_CIF_FRM1_ADDR_UV, uv_addr); - break; - default: - printk("%s(%d): fmt_ready(%d) is wrong!\n", __FUNCTION__, __LINE__,fmt_ready); - break; - } - - } -} -/* Locking: Caller holds q->irqlock */ -static void rk_videobuf_queue(struct videobuf_queue *vq, - struct videobuf_buffer *vb) -{ - struct soc_camera_device *icd = vq->priv_data; - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/ - struct rk_camera_dev *pcdev = ici->priv; -#if CAMERA_VIDEOBUF_ARM_ACCESS - struct rk29_camera_vbinfo *vb_info; -#endif - - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - vb->state = VIDEOBUF_QUEUED; - if (list_empty(&pcdev->capture)) { - list_add_tail(&vb->queue, &pcdev->capture); - } else { - if (list_entry(pcdev->capture.next, struct videobuf_buffer, queue) != vb) - list_add_tail(&vb->queue, &pcdev->capture); - else - BUG(); /* ddl@rock-chips.com : The same videobuffer queue again */ - } -#if CAMERA_VIDEOBUF_ARM_ACCESS - if (pcdev->vbinfo) { - vb_info = pcdev->vbinfo+vb->i; - if ((vb_info->phy_addr != vb->boff) || (vb_info->size != vb->bsize)) { - if (vb_info->vir_addr) { - iounmap(vb_info->vir_addr); - release_mem_region(vb_info->phy_addr, vb_info->size); - vb_info->vir_addr = NULL; - vb_info->phy_addr = 0x00; - vb_info->size = 0x00; - } - - if (request_mem_region(vb->boff,vb->bsize,"rk_camera_vb")) { - vb_info->vir_addr = ioremap_cached(vb->boff,vb->bsize); - } - - if (vb_info->vir_addr) { - vb_info->size = vb->bsize; - vb_info->phy_addr = vb->boff; - } else { - RKCAMERA_TR("ioremap videobuf %d failed\n",vb->i); - } - } - } -#endif - - if (!pcdev->active0) { - pcdev->active0 = vb; - rk_videobuf_capture(vb,pcdev,0); - /*if (atomic_read(&pcdev->stop_cif) == false) { //ddl@rock-chips.com v0.3.0x13 - write_cif_reg(pcdev->base,CIF_CIF_CTRL, (read_cif_reg(pcdev->base,CIF_CIF_CTRL) | ENABLE_CAPTURE)); - } */ - list_del_init(&(vb->queue)); - } else if (!pcdev->active1) { - pcdev->active1 = vb; - rk_videobuf_capture(vb,pcdev,1); - /*if (atomic_read(&pcdev->stop_cif) == false) { //ddl@rock-chips.com v0.3.0x13 - write_cif_reg(pcdev->base,CIF_CIF_CTRL, (read_cif_reg(pcdev->base,CIF_CIF_CTRL) | ENABLE_CAPTURE)); - } */ - list_del_init(&(vb->queue)); - } - -} - -#if (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_RGA) -static int rk_pixfmt2rgafmt(unsigned int pixfmt, int *ippfmt) -{ - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - switch (pixfmt) - { - case V4L2_PIX_FMT_YUV420: - case V4L2_PIX_FMT_UYVY: /* yuv 422, but sensor has defined this format(in fact ,should be defined yuv 420), treat this as yuv 420.*/ - case V4L2_PIX_FMT_YUYV: - { - *ippfmt = RK_FORMAT_YCbCr_420_SP; - break; - } - case V4L2_PIX_FMT_YVU420: - case V4L2_PIX_FMT_VYUY: - case V4L2_PIX_FMT_YVYU: - { - *ippfmt = RK_FORMAT_YCrCb_420_SP; - break; - } - case V4L2_PIX_FMT_RGB565: - { - *ippfmt = RK_FORMAT_RGB_565; - break; - } - case V4L2_PIX_FMT_RGB24: - { - *ippfmt = RK_FORMAT_RGB_888; - break; - } - default: - goto rk_pixfmt2rgafmt_err; - } - - return 0; -rk_pixfmt2rgafmt_err: - return -1; -} -#endif -#if (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_PP) -static int rk_camera_scale_crop_pp(struct work_struct *work){ - struct rk_camera_work *camera_work = container_of(work, struct rk_camera_work, work); - struct videobuf_buffer *vb = camera_work->vb; - struct rk_camera_dev *pcdev = camera_work->pcdev; - int vipdata_base; - unsigned long int flags; - int scale_times,w,h; - int src_y_offset; - int ret = 0; - - return ret; -} -#endif -#if (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_RGA) -extern rga_service_info rga_service; -extern int rga_blit_sync(rga_session *session, struct rga_req *req); -extern void rga_service_session_clear(rga_session *session); -static int rk_camera_scale_crop_rga(struct work_struct *work){ - struct rk_camera_work *camera_work = container_of(work, struct rk_camera_work, work); - struct videobuf_buffer *vb = camera_work->vb; - struct rk_camera_dev *pcdev = camera_work->pcdev; - int vipdata_base; - unsigned long int flags; - int scale_times,w,h; - int src_y_offset; - struct rga_req req; - rga_session session; - int rga_times = 3; - const struct soc_mbus_pixelfmt *fmt; - int ret = 0; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - return ret; - -} - -#endif -#if (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_IPP) - -static int rk_camera_scale_crop_ipp(struct work_struct *work) -{ - - return 0; -} -#endif -static void rk_camera_capture_process(struct work_struct *work) -{ - struct rk_camera_work *camera_work = container_of(work, struct rk_camera_work, work); - struct videobuf_buffer *vb = camera_work->vb; - struct rk_camera_dev *pcdev = camera_work->pcdev; - /*enum v4l2_mbus_pixelcode icd_code = pcdev->icd->current_fmt->code; */ - unsigned long flags = 0; - int err = 0; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - - if (atomic_read(&pcdev->stop_cif)==true) { - err = -EINVAL; - goto rk_camera_capture_process_end; - } - - if (!CAM_WORKQUEUE_IS_EN()) { - err = -EINVAL; - goto rk_camera_capture_process_end; - } - - down(&pcdev->zoominfo.sem); - if (pcdev->icd_cb.scale_crop_cb){ - err = (pcdev->icd_cb.scale_crop_cb)(work); - } - up(&pcdev->zoominfo.sem); - - if (pcdev->icd_cb.sensor_cb) - (pcdev->icd_cb.sensor_cb)(vb); - -rk_camera_capture_process_end: - if (err) { - vb->state = VIDEOBUF_ERROR; - } else { - if ((vb->state == VIDEOBUF_QUEUED) || (vb->state == VIDEOBUF_ACTIVE)) { - vb->state = VIDEOBUF_DONE; - vb->field_count++; - } - } - spin_lock_irqsave(&pcdev->camera_work_lock, flags); - list_add_tail(&camera_work->queue, &pcdev->camera_work_queue); - spin_unlock_irqrestore(&pcdev->camera_work_lock, flags); - wake_up(&(camera_work->vb->done)); /* ddl@rock-chips.com : v0.3.9 */ - return; -} - -static void rk_camera_cifrest_delay(struct work_struct *work) -{ - struct rk_camera_work *camera_work = container_of(work, struct rk_camera_work, work); - struct rk_camera_dev *pcdev = camera_work->pcdev; - unsigned long flags = 0; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - mdelay(1); - rk_camera_cif_reset(pcdev,false); - - spin_lock_irqsave(&pcdev->camera_work_lock, flags); - list_add_tail(&camera_work->queue, &pcdev->camera_work_queue); - spin_unlock_irqrestore(&pcdev->camera_work_lock, flags); - - spin_lock_irqsave(&pcdev->lock,flags); - if (atomic_read(&pcdev->stop_cif) == false) { - write_cif_reg(pcdev->base,CIF_CIF_CTRL, (read_cif_reg(pcdev->base,CIF_CIF_CTRL) | ENABLE_CAPTURE)); - RKCAMERA_DG2("After reset cif, enable capture again!\n"); - } - spin_unlock_irqrestore(&pcdev->lock,flags); - return; -} - -static inline irqreturn_t rk_camera_cifirq(int irq, void *data) -{ - struct rk_camera_dev *pcdev = data; - struct rk_camera_work *wk; - unsigned int reg_cifctrl, reg_lastpix, reg_lastline; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - - write_cif_reg(pcdev->base,CIF_CIF_INTSTAT,0x0200); /* clear vip interrupte single */ - - reg_cifctrl = read_cif_reg(pcdev->base,CIF_CIF_CTRL); - reg_lastpix = read_cif_reg(pcdev->base,CIF_CIF_LAST_PIX); - reg_lastline = read_cif_reg(pcdev->base,CIF_CIF_LAST_LINE); - - pcdev->irqinfo.cifirq_idx++; - if ((reg_lastline != pcdev->host_height) /*|| (reg_lastpix != pcdev->host_width)*/) { - pcdev->irqinfo.cifirq_abnormal_idx = pcdev->irqinfo.cifirq_idx; - RKCAMERA_DG2("Cif irq-%ld is error, %dx%d != %dx%d\n",pcdev->irqinfo.cifirq_abnormal_idx, - reg_lastpix,reg_lastline,pcdev->host_width,pcdev->host_height); - } else { - pcdev->irqinfo.cifirq_normal_idx = pcdev->irqinfo.cifirq_idx; - } -/* - if(reg_cifctrl & ENABLE_CAPTURE) { - write_cif_reg(pcdev->base,CIF_CIF_CTRL, (reg_cifctrl & ~ENABLE_CAPTURE)); - } -*/ - if (pcdev->irqinfo.cifirq_abnormal_idx>0) { - if ((pcdev->irqinfo.cifirq_idx - pcdev->irqinfo.cifirq_abnormal_idx) == 1 ) { - if (!list_empty(&pcdev->camera_work_queue)) { - RKCAMERA_DG2("Receive cif irq-%ld and queue work to cif reset\n",pcdev->irqinfo.cifirq_idx); - wk = list_entry(pcdev->camera_work_queue.next, struct rk_camera_work, queue); - list_del_init(&wk->queue); - INIT_WORK(&(wk->work), rk_camera_cifrest_delay); - wk->pcdev = pcdev; - queue_work(pcdev->camera_wq, &(wk->work)); - } - } - } - - return IRQ_HANDLED; -} - -static inline irqreturn_t rk_camera_dmairq(int irq, void *data) -{ - struct rk_camera_dev *pcdev = data; - struct videobuf_buffer *vb; - struct rk_camera_work *wk; - struct timeval tv; - unsigned long reg_cifctrl; - unsigned long tmp_cif_frmst; - struct videobuf_buffer **active = 0; - struct videobuf_buffer *active_buf = NULL; - int flag = 0; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - - reg_cifctrl = read_cif_reg(pcdev->base,CIF_CIF_CTRL); - tmp_cif_frmst = read_cif_reg(pcdev->base,CIF_CIF_FRAME_STATUS); - /* ddl@rock-chps.com : Current VIP is run in Pingpong Frame Mode */ - if (tmp_cif_frmst & (CIF_F0_READY | CIF_F1_READY)) { //frame 0 or 1 ready yzm - write_cif_reg(pcdev->base,CIF_CIF_INTSTAT,0x01); /* clear vip interrupte single */ - - pcdev->irqinfo.dmairq_idx++; - if (pcdev->irqinfo.cifirq_abnormal_idx == pcdev->irqinfo.dmairq_idx) { - write_cif_reg(pcdev->base,CIF_CIF_FRAME_STATUS, 0x00000003); - goto end; - } - - if (!pcdev->fps) {//µÚÒ»´Î½øÈëÖÐ¶Ï - do_gettimeofday(&pcdev->first_tv); - } - - if((tmp_cif_frmst & CIF_F0_READY) && (tmp_cif_frmst & CIF_F1_READY)){ - printk("%s:f0 && f1 ready ,need to resart cif!!!!!\n",__func__); - reg_cifctrl &=~ENABLE_CAPTURE; - - goto end; - } - pcdev->fps++; - - if (tmp_cif_frmst & CIF_F0_READY){ - active = &pcdev->active0; - flag = 0; - } else if (tmp_cif_frmst & CIF_F1_READY){ - active = &pcdev->active1; - flag = 1; - } else { - printk("irq frame status erro \n"); - goto end; - } - if (!(*active)){ - printk("active = NULL\n"); - goto end; - } - - if (pcdev->frame_inval>0) {//¹ØÓÚ¹ýÂËǰ¼¸Ö¡µÄ£¬ÏÖÔÚûÓÐÓõ½ - pcdev->frame_inval--; - rk_videobuf_capture(*active,pcdev,flag); - } else if (pcdev->frame_inval) { - RKCAMERA_TR("frame_inval : %0x",pcdev->frame_inval); - pcdev->frame_inval = 0; - } - - if(pcdev->fps == RK30_CAM_FRAME_MEASURE) {//¹ýÂËǰ¼¸Ö¡,¿ªÊ¼¶¨Ê± - do_gettimeofday(&tv); - pcdev->frame_interval = ((tv.tv_sec*1000000 + tv.tv_usec) - (pcdev->first_tv.tv_sec*1000000 + pcdev->first_tv.tv_usec)) - /(RK30_CAM_FRAME_MEASURE-1); - } - - vb = *active; - - if (!vb) { - printk("no acticve buffer!!!\n"); - goto end; - } - - if (!list_empty(&pcdev->capture)) { - active_buf = list_entry(pcdev->capture.next, struct videobuf_buffer, queue); - if (active_buf) { - - WARN_ON(active_buf->state != VIDEOBUF_QUEUED); - if ((flag == 0) && ((active_buf->i)%2 == 0)){ - pcdev->active0 = active_buf; - } else if ((flag == 1) && ((active_buf->i)%2 == 1)){ - pcdev->active1 = active_buf; - }else{ - RKCAMERA_DG1("irq frame status erro or no a suitable buf!\n"); - goto end; - } - rk_videobuf_capture(active_buf,pcdev,flag); - list_del_init(&(active_buf->queue)); - } - }else{ - RKCAMERA_DG1("video_buf queue is empty!\n"); - goto end; - } - - do_gettimeofday(&vb->ts); - if (CAM_WORKQUEUE_IS_EN()) { - if (!list_empty(&pcdev->camera_work_queue)) { - wk = list_entry(pcdev->camera_work_queue.next, struct rk_camera_work, queue); - list_del_init(&wk->queue); - INIT_WORK(&(wk->work), rk_camera_capture_process); - wk->vb = vb; - wk->pcdev = pcdev; - queue_work(pcdev->camera_wq, &(wk->work)); - } - } else { - if ((vb->state == VIDEOBUF_QUEUED) || (vb->state == VIDEOBUF_ACTIVE)) { - vb->state = VIDEOBUF_DONE; - vb->field_count++; - } - wake_up(&vb->done); - } - } - -end: - if((reg_cifctrl & ENABLE_CAPTURE) == 0) - write_cif_reg(pcdev->base,CIF_CIF_CTRL, (reg_cifctrl | ENABLE_CAPTURE)); - return IRQ_HANDLED; -} - -static irqreturn_t rk_camera_irq(int irq, void *data) -{ - struct rk_camera_dev *pcdev = data; - unsigned long reg_intstat; - - - spin_lock(&pcdev->lock); - - if(atomic_read(&pcdev->stop_cif) == true) { - write_cif_reg(pcdev->base,CIF_CIF_INTSTAT,0xffffffff); - goto end; - } - - reg_intstat = read_cif_reg(pcdev->base,CIF_CIF_INTSTAT); - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s() ,reg_intstat 0x%lx\n", __FILE__, __LINE__,__FUNCTION__,reg_intstat); - if (reg_intstat & 0x0200) - rk_camera_cifirq(irq,data); - - if (reg_intstat & 0x01) - rk_camera_dmairq(irq,data); - -end: - spin_unlock(&pcdev->lock); - return IRQ_HANDLED; -} - - -static void rk_videobuf_release(struct videobuf_queue *vq, - struct videobuf_buffer *vb) -{ - struct rk_camera_buffer *buf = container_of(vb, struct rk_camera_buffer, vb); - struct soc_camera_device *icd = vq->priv_data; - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/ - struct rk_camera_dev *pcdev = ici->priv; -#if CAMERA_VIDEOBUF_ARM_ACCESS - struct rk29_camera_vbinfo *vb_info =NULL; -#endif - -#ifdef DEBUG - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__, - vb, vb->baddr, vb->bsize); - - switch (vb->state) - { - case VIDEOBUF_ACTIVE: - dev_dbg(&icd->dev, "%s (active)\n", __func__); - break; - case VIDEOBUF_QUEUED: - dev_dbg(&icd->dev, "%s (queued)\n", __func__); - break; - case VIDEOBUF_PREPARED: - dev_dbg(&icd->dev, "%s (prepared)\n", __func__); - break; - default: - dev_dbg(&icd->dev, "%s (unknown)\n", __func__); - break; - } -#endif - - flush_workqueue(pcdev->camera_wq); - - rk_videobuf_free(vq, buf); - -#if CAMERA_VIDEOBUF_ARM_ACCESS - if ((pcdev->vbinfo) && (vb->i < pcdev->vbinfo_count)) { - vb_info = pcdev->vbinfo + vb->i; - - if (vb_info->vir_addr) { - iounmap(vb_info->vir_addr); - release_mem_region(vb_info->phy_addr, vb_info->size); - memset(vb_info, 0x00, sizeof(struct rk29_camera_vbinfo)); - } - - } -#endif -} - -static struct videobuf_queue_ops rk_videobuf_ops = -{ - .buf_setup = rk_videobuf_setup, - .buf_prepare = rk_videobuf_prepare, - .buf_queue = rk_videobuf_queue, - .buf_release = rk_videobuf_release, -}; - -static void rk_camera_init_videobuf(struct videobuf_queue *q, - struct soc_camera_device *icd) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/ - struct rk_camera_dev *pcdev = ici->priv; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - /* We must pass NULL as dev pointer, then all pci_* dma operations - * transform to normal dma_* ones. */ - videobuf_queue_dma_contig_init(q, - &rk_videobuf_ops, - ici->v4l2_dev.dev, &pcdev->lock, - V4L2_BUF_TYPE_VIDEO_CAPTURE, - V4L2_FIELD_NONE, - sizeof(struct rk_camera_buffer), - icd,&(ici->host_lock) ); -} - -static int rk_camera_mclk_ctrl(int cif_idx, int on, int clk_rate) -{ - int err = 0,cif; - struct rk_cif_clk *clk; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - - cif = cif_idx - RK29_CAM_PLATFORM_DEV_ID; - if ((cif<0)||(cif>1)) { - RKCAMERA_TR(KERN_ERR "cif index(%d) is invalidate\n",cif_idx); - err = -1; - goto rk_camera_clk_ctrl_end; - } - - clk = &cif_clk[cif]; - - if(!clk->aclk_cif || !clk->hclk_cif || !clk->cif_clk_in || !clk->cif_clk_out) { - RKCAMERA_TR(KERN_ERR "failed to get cif clock source\n"); - err = -ENOENT; - goto rk_camera_clk_ctrl_end; - } - - //spin_lock(&clk->lock); - if (on && !clk->on) { - if(CHIP_NAME != 3368) - clk_prepare_enable(clk->pd_cif); /*yzm*/ - clk_prepare_enable(clk->aclk_cif); - clk_prepare_enable(clk->hclk_cif); - clk_prepare_enable(clk->cif_clk_in); - clk_prepare_enable(clk->cif_clk_out); - clk_set_rate(clk->cif_clk_out,clk_rate); - clk->on = true; - } else if (!on && clk->on) { - clk_set_rate(clk->cif_clk_out,36000000);/*yzm :just for close clk which base on XIN24M */ - msleep(100); - clk_disable_unprepare(clk->aclk_cif); - clk_disable_unprepare(clk->hclk_cif); - clk_disable_unprepare(clk->cif_clk_in); - if(CHIP_NAME == 3126){ - write_cru_reg(CRU_CLKSEL29_CON, 0x007c0000); - write_cru_reg(CRU_CLK_OUT, 0x00800080); - } - clk_disable_unprepare(clk->cif_clk_out); - if(CHIP_NAME != 3368) - clk_disable_unprepare(clk->pd_cif); - clk->on = false; - } - //spin_unlock(&clk->lock); -rk_camera_clk_ctrl_end: - return err; -} -static int rk_camera_activate(struct rk_camera_dev *pcdev, struct soc_camera_device *icd) -{ - /* - * ddl@rock-chips.com : Cif clk control in rk_sensor_power which in rk_camera.c - */ - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - write_cif_reg(pcdev->base,CIF_CIF_CTRL,AXI_BURST_16|MODE_PINGPONG|DISABLE_CAPTURE); /* ddl@rock-chips.com : vip ahb burst 16 */ - //write_cif_reg(pcdev->base,CIF_CIF_INTEN, 0x01); //capture complete interrupt enable - return 0; -} - -static void rk_camera_deactivate(struct rk_camera_dev *pcdev) -{ - /* - * ddl@rock-chips.com : Cif clk control in rk_sensor_power which in rk_camera.c - */ - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - - return; -} - -/* The following two functions absolutely depend on the fact, that - * there can be only one camera on RK28 quick capture interface */ -static int rk_camera_add_device(struct soc_camera_device *icd) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/ - struct rk_camera_dev *pcdev = ici->priv; /*Initialize in rk_camra_prob*/ - struct device *control = to_soc_camera_control(icd); - struct v4l2_subdev *sd; - int ret,i,icd_catch; - struct rk_camera_frmivalenum *fival_list,*fival_nxt; - struct v4l2_cropcap cropcap; - struct v4l2_mbus_framefmt mf; - const struct soc_camera_format_xlate *xlate = NULL; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - - mutex_lock(&camera_lock); - - if (pcdev->icd) { - ret = -EBUSY; - goto ebusy; - } - - RKCAMERA_DG1("%s driver attached to %s\n",RK29_CAM_DRV_NAME,dev_name(icd->pdev)); - - pcdev->frame_inval = RK_CAM_FRAME_INVAL_INIT; - //pcdev->active = NULL; - pcdev->active0 = NULL; - pcdev->active1 = NULL; - pcdev->active_buf = 0; - pcdev->icd = NULL; - pcdev->reginfo_suspend.Inval = Reg_Invalidate; - pcdev->zoominfo.zoom_rate = 100; - pcdev->fps_timer.istarted = false; - - /* ddl@rock-chips.com: capture list must be reset, because this list may be not empty, - * if app havn't dequeue all videobuf before close camera device; - */ - INIT_LIST_HEAD(&pcdev->capture); - - ret = rk_camera_activate(pcdev,icd); - if (ret) - goto ebusy; - /* ddl@rock-chips.com : v4l2_subdev is not created when ici->ops->add called in soc_camera_probe */ - if (control) { //TRUE in open ,FALSE in kernel start - sd = dev_get_drvdata(control); - v4l2_subdev_call(sd, core, ioctl, RK29_CAM_SUBDEV_IOREQUEST,(void*)pcdev->pdata); - #if 0 - ret = v4l2_subdev_call(sd,core, init, 0); - if (ret) - goto ebusy; - #endif - /* call generic_sensor_ioctl*/ - v4l2_subdev_call(sd, core, ioctl, RK29_CAM_SUBDEV_CB_REGISTER,(void*)(&pcdev->icd_cb)); - /* call generic_sensor_cropcap*/ - if (v4l2_subdev_call(sd, video, cropcap, &cropcap) == 0) { - memcpy(&pcdev->cropinfo.bounds ,&cropcap.bounds,sizeof(struct v4l2_rect)); - } else { - xlate = soc_camera_xlate_by_fourcc(icd, V4L2_PIX_FMT_NV12); - mf.width = 10000; - mf.height = 10000; - mf.field = V4L2_FIELD_NONE; - mf.code = xlate->code; - mf.reserved[6] = 0xfefe5a5a; - v4l2_subdev_call(sd, video, try_mbus_fmt, &mf); - - pcdev->cropinfo.bounds.left = 0; - pcdev->cropinfo.bounds.top = 0; - pcdev->cropinfo.bounds.width = mf.width; - pcdev->cropinfo.bounds.height = mf.height; - } - } - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - pcdev->icd = icd; - pcdev->icd_init = 0; - - icd_catch = 0; - for (i=0; i<2; i++) { - if (pcdev->icd_frmival[i].icd == icd) - icd_catch = 1; - if (pcdev->icd_frmival[i].icd == NULL) { - pcdev->icd_frmival[i].icd = icd; - icd_catch = 1; - } - } - if (icd_catch == 0) { - fival_list = pcdev->icd_frmival[0].fival_list; - fival_nxt = fival_list; - while(fival_nxt != NULL) { - fival_nxt = fival_list->nxt; - kfree(fival_list); - fival_list = fival_nxt; - } - pcdev->icd_frmival[0].icd = icd; - pcdev->icd_frmival[0].fival_list = kzalloc(sizeof(struct rk_camera_frmivalenum),GFP_KERNEL); - } -ebusy: - mutex_unlock(&camera_lock); - - return ret; -} -static void rk_camera_remove_device(struct soc_camera_device *icd) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/ - struct rk_camera_dev *pcdev = ici->priv; - /*struct v4l2_subdev *sd = soc_camera_to_subdev(icd);*/ -#if CAMERA_VIDEOBUF_ARM_ACCESS - struct rk29_camera_vbinfo *vb_info; - unsigned int i; -#endif - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - - mutex_lock(&camera_lock); - BUG_ON(icd != pcdev->icd); - - RKCAMERA_DG1("%s driver detached from %s\n",RK29_CAM_DRV_NAME,dev_name(icd->pdev)); - - /* ddl@rock-chips.com: Application will call VIDIOC_STREAMOFF before close device, but - stream may be turn on again before close device, if suspend and resume happened. */ - /*if (read_cif_reg(pcdev->base,CIF_CIF_CTRL) & ENABLE_CAPTURE) {*/ - if ((atomic_read(&pcdev->stop_cif) == false) && pcdev->fps_timer.istarted) { /* ddl@rock-chips.com: v0.3.0x15*/ - rk_camera_s_stream(icd,0); - } - /* move DEACTIVATE into generic_sensor_s_power*/ - /* v4l2_subdev_call(sd, core, ioctl, RK29_CAM_SUBDEV_DEACTIVATE,NULL);*/ /*yzm*/ - /* if stream off is not been executed,timer is running.*/ - if(pcdev->fps_timer.istarted){ - hrtimer_cancel(&pcdev->fps_timer.timer); - pcdev->fps_timer.istarted = false; - } - flush_work(&(pcdev->camera_reinit_work.work)); - flush_workqueue((pcdev->camera_wq)); - - if (pcdev->camera_work) { - kfree(pcdev->camera_work); - pcdev->camera_work = NULL; - pcdev->camera_work_count = 0; - INIT_LIST_HEAD(&pcdev->camera_work_queue); - } - rk_camera_deactivate(pcdev); -#if CAMERA_VIDEOBUF_ARM_ACCESS - if (pcdev->vbinfo) { - vb_info = pcdev->vbinfo; - for (i=0; ivbinfo_count; i++) { - if (vb_info->vir_addr) { - iounmap(vb_info->vir_addr); - release_mem_region(vb_info->phy_addr, vb_info->size); - memset(vb_info, 0x00, sizeof(struct rk29_camera_vbinfo)); - } - vb_info++; - } - kfree(pcdev->vbinfo); - pcdev->vbinfo = NULL; - pcdev->vbinfo_count = 0; - } -#endif - //pcdev->active = NULL; - pcdev->active0 = NULL; - pcdev->active1 = NULL; - pcdev->active_buf = 0; - pcdev->icd = NULL; - pcdev->icd_cb.sensor_cb = NULL; - pcdev->reginfo_suspend.Inval = Reg_Invalidate; - /* ddl@rock-chips.com: capture list must be reset, because this list may be not empty, - * if app havn't dequeue all videobuf before close camera device; - */ - INIT_LIST_HEAD(&pcdev->capture); - - mutex_unlock(&camera_lock); - - return; -} -static int rk_camera_set_bus_param(struct soc_camera_device *icd, __u32 pixfmt) -{ - unsigned long bus_flags, camera_flags, common_flags = 0; - unsigned int cif_for = 0; - const struct soc_mbus_pixelfmt *fmt; - int ret = 0; - struct soc_camera_host *ici = to_soc_camera_host(icd->parent); /*yzm*/ - struct rk_camera_dev *pcdev = ici->priv; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - fmt = soc_mbus_get_fmtdesc(icd->current_fmt->code); - if (!fmt) - return -EINVAL; - - bus_flags = RK_CAM_BUS_PARAM; - /* If requested data width is supported by the platform, use it */ - switch (fmt->bits_per_sample) { - case 10: - if (!(bus_flags & SOCAM_DATAWIDTH_10)) - return -EINVAL; - break; - case 9: - if (!(bus_flags & SOCAM_DATAWIDTH_9)) - return -EINVAL; - break; - case 8: - if (!(bus_flags & SOCAM_DATAWIDTH_8)) - return -EINVAL; - break; - default: - return -EINVAL; - } - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - if (icd->ops->query_bus_param) - camera_flags = icd->ops->query_bus_param(icd); - else - camera_flags = 0; - -/**************yzm************ - common_flags = soc_camera_bus_param_compatible(camera_flags, bus_flags); - if (!common_flags) { - ret = -EINVAL; - goto RK_CAMERA_SET_BUS_PARAM_END; - } -*/ -/***************yzm************end*/ - - - common_flags = camera_flags; - ret = icd->ops->set_bus_param(icd, common_flags); - if (ret < 0) - goto RK_CAMERA_SET_BUS_PARAM_END; - - cif_for = read_cif_reg(pcdev->base,CIF_CIF_FOR); - - if (common_flags & V4L2_MBUS_PCLK_SAMPLE_FALLING) { - if(IS_CIF0()) { - if(CHIP_NAME == 3368) - rk3368_write_cru_reg(CRU_PCLK_REG30, rk3368_read_cru_reg(CRU_PCLK_REG30) | ENANABLE_INVERT_PCLK_CIF0); - else - write_cru_reg(CRU_PCLK_REG30, read_cru_reg(CRU_PCLK_REG30) | ENANABLE_INVERT_PCLK_CIF0); - } else { - if(CHIP_NAME == 3368) - rk3368_write_cru_reg(CRU_PCLK_REG30, rk3368_read_cru_reg(CRU_PCLK_REG30) | ENANABLE_INVERT_PCLK_CIF1); - else - write_cru_reg(CRU_PCLK_REG30, read_cru_reg(CRU_PCLK_REG30) | ENANABLE_INVERT_PCLK_CIF1); - } - } else { - if(IS_CIF0()){ - if(CHIP_NAME == 3368) - rk3368_write_cru_reg(CRU_PCLK_REG30, (rk3368_read_cru_reg(CRU_PCLK_REG30) & 0xFFFFEFF ) | DISABLE_INVERT_PCLK_CIF0); - else - write_cru_reg(CRU_PCLK_REG30, (read_cru_reg(CRU_PCLK_REG30) & 0xFFFFEFF ) | DISABLE_INVERT_PCLK_CIF0); - } else { - if(CHIP_NAME == 3368) - rk3368_write_cru_reg(CRU_PCLK_REG30, (rk3368_read_cru_reg(CRU_PCLK_REG30) & 0xFFFEFFF) | DISABLE_INVERT_PCLK_CIF1); - else - write_cru_reg(CRU_PCLK_REG30, (read_cru_reg(CRU_PCLK_REG30) & 0xFFFEFFF) | DISABLE_INVERT_PCLK_CIF1); - } - } - - if (common_flags & V4L2_MBUS_HSYNC_ACTIVE_LOW) { - cif_for |= HSY_LOW_ACTIVE; - } else { - cif_for &= ~HSY_LOW_ACTIVE; - } - if (common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH) { - cif_for |= VSY_HIGH_ACTIVE; - } else { - cif_for &= ~VSY_HIGH_ACTIVE; - } - - // ddl@rock-chips.com : Don't enable capture here, enable in stream_on - //vip_ctrl_val |= ENABLE_CAPTURE; - write_cif_reg(pcdev->base,CIF_CIF_FOR, cif_for); - RKCAMERA_DG1("CIF_CIF_FOR: 0x%x \n",cif_for); - -RK_CAMERA_SET_BUS_PARAM_END: - if (ret) - RKCAMERA_TR("rk_camera_set_bus_param ret = %d \n", ret); - return ret; -} - -static int rk_camera_try_bus_param(struct soc_camera_device *icd, __u32 pixfmt) -{ -/* unsigned long bus_flags, camera_flags;*/ -/* int ret;*/ - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); -/**********yzm*********** - - bus_flags = RK_CAM_BUS_PARAM; - if (icd->ops->query_bus_param) { - camera_flags = icd->ops->query_bus_param(icd); //generic_sensor_query_bus_param() - } else { - camera_flags = 0; - } - ret = soc_camera_bus_param_compatible(camera_flags, bus_flags) ; - - if (ret < 0) - dev_warn(icd->dev.parent, - "Flags incompatible: camera %lx, host %lx\n", - camera_flags, bus_flags); - - return ret; -*///************yzm **************end - return 0; - -} - -static const struct soc_mbus_pixelfmt rk_camera_formats[] = { - { - .fourcc = V4L2_PIX_FMT_NV12, - .name = "YUV420 NV12", - .bits_per_sample = 8, - .packing = SOC_MBUS_PACKING_1_5X8, - .order = SOC_MBUS_ORDER_LE, - },{ - .fourcc = V4L2_PIX_FMT_NV16, - .name = "YUV422 NV16", - .bits_per_sample = 8, - .packing = SOC_MBUS_PACKING_2X8_PADHI, - .order = SOC_MBUS_ORDER_LE, - },{ - .fourcc = V4L2_PIX_FMT_NV21, - .name = "YUV420 NV21", - .bits_per_sample = 8, - .packing = SOC_MBUS_PACKING_1_5X8, - .order = SOC_MBUS_ORDER_LE, - },{ - .fourcc = V4L2_PIX_FMT_NV61, - .name = "YUV422 NV61", - .bits_per_sample = 8, - .packing = SOC_MBUS_PACKING_2X8_PADHI, - .order = SOC_MBUS_ORDER_LE, - },{ - .fourcc = V4L2_PIX_FMT_RGB565, - .name = "RGB565", - .bits_per_sample = 8, - .packing = SOC_MBUS_PACKING_2X8_PADHI, - .order = SOC_MBUS_ORDER_LE, - },{ - .fourcc = V4L2_PIX_FMT_RGB24, - .name = "RGB888", - .bits_per_sample = 8, - .packing = SOC_MBUS_PACKING_2X8_PADHI, - .order = SOC_MBUS_ORDER_LE, - } - -}; - -static void rk_camera_setup_format(struct soc_camera_device *icd, __u32 host_pixfmt, enum v4l2_mbus_pixelcode icd_code, struct v4l2_rect *rect) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/ - struct rk_camera_dev *pcdev = ici->priv; - unsigned int cif_fs = 0,cif_crop = 0; - unsigned int cif_fmt_val = read_cif_reg(pcdev->base,CIF_CIF_FOR) | INPUT_MODE_YUV|YUV_INPUT_422|INPUT_420_ORDER_EVEN|OUTPUT_420_ORDER_EVEN; - - const struct soc_mbus_pixelfmt *fmt; - fmt = soc_mbus_get_fmtdesc(icd_code); - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - if((host_pixfmt == V4L2_PIX_FMT_RGB565) || (host_pixfmt == V4L2_PIX_FMT_RGB24)){ - if(fmt->fourcc == V4L2_PIX_FMT_NV12) - host_pixfmt = V4L2_PIX_FMT_NV12; - else if(fmt->fourcc == V4L2_PIX_FMT_NV21) - host_pixfmt = V4L2_PIX_FMT_NV21; - } - switch (host_pixfmt) - { - case V4L2_PIX_FMT_NV16: - cif_fmt_val &= ~YUV_OUTPUT_422; - cif_fmt_val &= ~UV_STORAGE_ORDER_UVUV; - pcdev->frame_inval = RK_CAM_FRAME_INVAL_DC; - pcdev->pixfmt = host_pixfmt; - break; - case V4L2_PIX_FMT_NV61: - cif_fmt_val &= ~YUV_OUTPUT_422; - cif_fmt_val |= UV_STORAGE_ORDER_VUVU; - pcdev->frame_inval = RK_CAM_FRAME_INVAL_DC; - pcdev->pixfmt = host_pixfmt; - break; - case V4L2_PIX_FMT_NV12: - cif_fmt_val |= YUV_OUTPUT_420; - cif_fmt_val &= ~UV_STORAGE_ORDER_UVUV; - if (pcdev->frame_inval != RK_CAM_FRAME_INVAL_INIT) - pcdev->frame_inval = RK_CAM_FRAME_INVAL_INIT; - pcdev->pixfmt = host_pixfmt; - break; - case V4L2_PIX_FMT_NV21: - cif_fmt_val |= YUV_OUTPUT_420; - cif_fmt_val |= UV_STORAGE_ORDER_VUVU; - if (pcdev->frame_inval != RK_CAM_FRAME_INVAL_INIT) - pcdev->frame_inval = RK_CAM_FRAME_INVAL_INIT; - pcdev->pixfmt = host_pixfmt; - break; - default: /* ddl@rock-chips.com : vip output format is hold when pixfmt is invalidate */ - cif_fmt_val |= YUV_OUTPUT_422; - break; - } - switch (icd_code) - { - case V4L2_MBUS_FMT_UYVY8_2X8: - cif_fmt_val = YUV_INPUT_ORDER_UYVY(cif_fmt_val); - break; - case V4L2_MBUS_FMT_YUYV8_2X8: - cif_fmt_val = YUV_INPUT_ORDER_YUYV(cif_fmt_val); - break; - case V4L2_MBUS_FMT_YVYU8_2X8: - cif_fmt_val = YUV_INPUT_ORDER_YVYU(cif_fmt_val); - break; - case V4L2_MBUS_FMT_VYUY8_2X8: - cif_fmt_val = YUV_INPUT_ORDER_VYUY(cif_fmt_val); - break; - default : - cif_fmt_val = YUV_INPUT_ORDER_YUYV(cif_fmt_val); - break; - } - - mdelay(100); - rk_camera_cif_reset(pcdev,true); - - write_cif_reg(pcdev->base,CIF_CIF_CTRL,AXI_BURST_16|MODE_PINGPONG|DISABLE_CAPTURE); /* ddl@rock-chips.com : vip ahb burst 16 */ - //write_cif_reg(pcdev->base,CIF_CIF_INTEN, 0x01|0x200); /*capture complete interrupt enable*/ - - write_cif_reg(pcdev->base,CIF_CIF_FOR,cif_fmt_val); /* ddl@rock-chips.com: VIP capture mode and capture format must be set before FS register set */ - - write_cif_reg(pcdev->base,CIF_CIF_INTSTAT,0xFFFFFFFF); - /*if((read_cif_reg(pcdev->base,CIF_CIF_CTRL) & MODE_PINGPONG) - ||(read_cif_reg(pcdev->base,CIF_CIF_CTRL) & MODE_LINELOOP)) { - BUG(); - } else*/{ /* this is one frame mode*/ - cif_crop = (rect->left + (rect->top <<16)); - cif_fs = (rect->width + (rect->height <<16)); - } - - write_cif_reg(pcdev->base,CIF_CIF_CROP, cif_crop); - write_cif_reg(pcdev->base,CIF_CIF_SET_SIZE, cif_fs); - write_cif_reg(pcdev->base,CIF_CIF_VIR_LINE_WIDTH, rect->width); - write_cif_reg(pcdev->base,CIF_CIF_FRAME_STATUS, 0x00000003); - - /*MUST bypass scale */ - write_cif_reg(pcdev->base,CIF_CIF_SCL_CTRL,0x10); - RKCAMERA_DG1("CIF_CIF_CROP:0x%x CIF_CIF_FS:0x%x CIF_CIF_FOR:0x%x\n",cif_crop,cif_fs,cif_fmt_val); - return; -} - -static int rk_camera_get_formats(struct soc_camera_device *icd, unsigned int idx, - struct soc_camera_format_xlate *xlate) -{ - struct v4l2_subdev *sd = soc_camera_to_subdev(icd); - struct device *dev = icd->parent;/*yzm*/ - int formats = 0, ret; - enum v4l2_mbus_pixelcode code; - const struct soc_mbus_pixelfmt *fmt; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code); /*call generic_sensor_enum_fmt()*/ - if (ret < 0) - /* No more formats */ - return 0; - - fmt = soc_mbus_get_fmtdesc(code); - if (!fmt) { - dev_err(dev, "Invalid format code #%u: %d\n", idx, code); - return 0; - } - - ret = rk_camera_try_bus_param(icd, fmt->bits_per_sample); - if (ret < 0) - return 0; - - switch (code) { - case V4L2_MBUS_FMT_UYVY8_2X8: - case V4L2_MBUS_FMT_YUYV8_2X8: - case V4L2_MBUS_FMT_YVYU8_2X8: - case V4L2_MBUS_FMT_VYUY8_2X8: - { - -#if (CONFIG_CAMERA_SCALE_CROP_MACHINE != RK_CAM_SCALE_CROP_RGA) - formats++; - if (xlate) { - xlate->host_fmt = &rk_camera_formats[0]; - xlate->code = code; - xlate++; - dev_dbg(dev, "Providing format %s using code %d\n", - rk_camera_formats[0].name,code); - } - - formats++; - if (xlate) { - xlate->host_fmt = &rk_camera_formats[1]; - xlate->code = code; - xlate++; - dev_dbg(dev, "Providing format %s using code %d\n", - rk_camera_formats[1].name,code); - } - - formats++; - if (xlate) { - xlate->host_fmt = &rk_camera_formats[2]; - xlate->code = code; - xlate++; - dev_dbg(dev, "Providing format %s using code %d\n", - rk_camera_formats[2].name,code); - } - - formats++; - if (xlate) { - xlate->host_fmt = &rk_camera_formats[3]; - xlate->code = code; - xlate++; - dev_dbg(dev, "Providing format %s using code %d\n", - rk_camera_formats[3].name,code); - } - break; -#else - formats++; - if (xlate) { - xlate->host_fmt = &rk_camera_formats[4]; - xlate->code = code; - xlate++; - dev_dbg(dev, "Providing format %s using code %d\n", - rk_camera_formats[4].name,code); - } - formats++; - if (xlate) { - xlate->host_fmt = &rk_camera_formats[5]; - xlate->code = code; - xlate++; - dev_dbg(dev, "Providing format %s using code %d\n", - rk_camera_formats[5].name,code); - } - break; -#endif - } - default: - break; - } - - return formats; -} - -static void rk_camera_put_formats(struct soc_camera_device *icd) -{ - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - return; -} -static int rk_camera_cropcap(struct soc_camera_device *icd, struct v4l2_cropcap *cropcap) -{ - struct v4l2_subdev *sd = soc_camera_to_subdev(icd); - int ret=0; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - ret = v4l2_subdev_call(sd, video, cropcap, cropcap); - if (ret != 0) - goto end; - /* ddl@rock-chips.com: driver decide the cropping rectangle */ - memset(&cropcap->defrect,0x00,sizeof(struct v4l2_rect)); -end: - return ret; -} -static int rk_camera_get_crop(struct soc_camera_device *icd,struct v4l2_crop *crop) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/ - struct rk_camera_dev *pcdev = ici->priv; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - spin_lock(&pcdev->cropinfo.lock); - memcpy(&crop->c,&pcdev->cropinfo.c,sizeof(struct v4l2_rect)); - spin_unlock(&pcdev->cropinfo.lock); - - return 0; -} -static int rk_camera_set_crop(struct soc_camera_device *icd, - const struct v4l2_crop *crop) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/ - struct rk_camera_dev *pcdev = ici->priv; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - spin_lock(&pcdev->cropinfo.lock); - memcpy(&pcdev->cropinfo.c,&crop->c,sizeof(struct v4l2_rect)); - spin_unlock(&pcdev->cropinfo.lock); - return 0; -} -static bool rk_camera_fmt_capturechk(struct v4l2_format *f) -{ - bool ret = false; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - if (f->fmt.pix.priv == 0xfefe5a5a) { - ret = true; - } - - if ((f->fmt.pix.width == 1024) && (f->fmt.pix.height == 768)) { - ret = true; - } else if ((f->fmt.pix.width == 1280) && (f->fmt.pix.height == 1024)) { - ret = true; - } else if ((f->fmt.pix.width == 1600) && (f->fmt.pix.height == 1200)) { - ret = true; - } else if ((f->fmt.pix.width == 2048) && (f->fmt.pix.height == 1536)) { - ret = true; - } else if ((f->fmt.pix.width == 2592) && (f->fmt.pix.height == 1944)) { - ret = true; - } else if ((f->fmt.pix.width == 3264) && (f->fmt.pix.height == 2448)) { - ret = true; - } - - if (ret == true) - RKCAMERA_DG1("%dx%d is capture format\n",f->fmt.pix.width, f->fmt.pix.height); - return ret; -} -static int rk_camera_set_fmt(struct soc_camera_device *icd, - struct v4l2_format *f) -{ - struct device *dev = icd->parent;/*yzm*/ - struct v4l2_subdev *sd = soc_camera_to_subdev(icd); - const struct soc_camera_format_xlate *xlate = NULL; - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/ - struct rk_camera_dev *pcdev = ici->priv; - struct v4l2_pix_format *pix = &f->fmt.pix; - struct v4l2_mbus_framefmt mf; - struct v4l2_rect rect; - int ret,usr_w,usr_h,sensor_w,sensor_h; - int stream_on = 0; - int ratio, bounds_aspect; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - usr_w = pix->width; - usr_h = pix->height; - - RKCAMERA_DG1("enter width:%d height:%d\n",usr_w,usr_h); - xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat); - if (!xlate) { - dev_err(dev, "Format %x not found\n", pix->pixelformat); - ret = -EINVAL; - goto RK_CAMERA_SET_FMT_END; - } - - /* ddl@rock-chips.com: sensor init code transmit in here after open */ - if (pcdev->icd_init == 0) { - v4l2_subdev_call(sd,core, init, 0); /*call generic_sensor_init()*/ - pcdev->icd_init = 1; - return 0; /*directly return !!!!!!*/ - } - stream_on = read_cif_reg(pcdev->base,CIF_CIF_CTRL); - if (stream_on & ENABLE_CAPTURE) - write_cif_reg(pcdev->base,CIF_CIF_CTRL, (stream_on & (~ENABLE_CAPTURE))); - - mf.width = pix->width; - mf.height = pix->height; - mf.field = pix->field; - mf.colorspace = pix->colorspace; - mf.code = xlate->code; - mf.reserved[0] = pix->priv; /* ddl@rock-chips.com : v0.3.3 */ - mf.reserved[1] = 0; - - ret = v4l2_subdev_call(sd, video, s_mbus_fmt, &mf); /*generic_sensor_s_fmt*/ - if (mf.code != xlate->code) - return -EINVAL; - - if ((pcdev->cropinfo.c.width == pcdev->cropinfo.bounds.width) && - (pcdev->cropinfo.c.height == pcdev->cropinfo.bounds.height)) { - bounds_aspect = (pcdev->cropinfo.bounds.width*10/pcdev->cropinfo.bounds.height); - if ((mf.width*10/mf.height) != bounds_aspect) { - RKCAMERA_DG1("User request fov unchanged in %dx%d, But sensor %dx%d is croped, so switch to full resolution %dx%d\n", - usr_w,usr_h,mf.width, mf.height,pcdev->cropinfo.bounds.width,pcdev->cropinfo.bounds.height); - - mf.width = pcdev->cropinfo.bounds.width/4; - mf.height = pcdev->cropinfo.bounds.height/4; - - mf.field = pix->field; - mf.colorspace = pix->colorspace; - mf.code = xlate->code; - mf.reserved[0] = pix->priv; - mf.reserved[1] = 0; - - ret = v4l2_subdev_call(sd, video, s_mbus_fmt, &mf); - if (mf.code != xlate->code) - return -EINVAL; - } - } - - sensor_w = mf.width; - sensor_h = mf.height; - - ratio = ((mf.width*mf.reserved[1])/100)&(~0x03); /* 4 align*/ - mf.width -= ratio; - - ratio = ((ratio*mf.height/mf.width)+1)&(~0x01); /* 2 align*/ - mf.height -= ratio; - - if ((mf.width != usr_w) || (mf.height != usr_h)) { - - if (unlikely((mf.width <16) || (mf.width > 8190) || (mf.height < 16) || (mf.height > 8190))) { - RKCAMERA_TR("Senor and IPP both invalid source resolution(%dx%d)\n",mf.width,mf.height); - ret = -EINVAL; - goto RK_CAMERA_SET_FMT_END; - } - if (unlikely((usr_w <16)||(usr_h < 16))) { - RKCAMERA_TR("Senor and IPP both invalid destination resolution(%dx%d)\n",usr_w,usr_h); - ret = -EINVAL; - goto RK_CAMERA_SET_FMT_END; - } - - spin_lock(&pcdev->cropinfo.lock); - if (((mf.width*10/mf.height) != (usr_w*10/usr_h))) { - if ((pcdev->cropinfo.c.width == 0)&&(pcdev->cropinfo.c.height == 0)) { - /*Scale + Crop center is for keep aspect ratio unchange*/ - ratio = ((mf.width*10/usr_w) >= (mf.height*10/usr_h))?(mf.height*10/usr_h):(mf.width*10/usr_w); - pcdev->host_width = ratio*usr_w/10; - pcdev->host_height = ratio*usr_h/10; - pcdev->host_width &= ~CROP_ALIGN_BYTES; - pcdev->host_height &= ~CROP_ALIGN_BYTES; - - pcdev->host_left = ((sensor_w-pcdev->host_width )>>1); - pcdev->host_top = ((sensor_h-pcdev->host_height)>>1); - } else { - /*Scale + crop(user define)*/ - pcdev->host_width = pcdev->cropinfo.c.width*mf.width/pcdev->cropinfo.bounds.width; - pcdev->host_height = pcdev->cropinfo.c.height*mf.height/pcdev->cropinfo.bounds.height; - pcdev->host_left = (pcdev->cropinfo.c.left*mf.width/pcdev->cropinfo.bounds.width); - pcdev->host_top = (pcdev->cropinfo.c.top*mf.height/pcdev->cropinfo.bounds.height); - } - - pcdev->host_left &= (~0x01); - pcdev->host_top &= (~0x01); - } else { - if ((pcdev->cropinfo.c.width == 0)&&(pcdev->cropinfo.c.height == 0)) { - /*Crop Center for cif can work , then scale*/ - pcdev->host_width = mf.width; - pcdev->host_height = mf.height; - pcdev->host_left = ((sensor_w - mf.width)>>1)&(~0x01); - pcdev->host_top = ((sensor_h - mf.height)>>1)&(~0x01); - } else { - /*Crop center for cif can work + crop(user define), then scale */ - pcdev->host_width = pcdev->cropinfo.c.width*mf.width/pcdev->cropinfo.bounds.width; - pcdev->host_height = pcdev->cropinfo.c.height*mf.height/pcdev->cropinfo.bounds.height; - pcdev->host_left = (pcdev->cropinfo.c.left*mf.width/pcdev->cropinfo.bounds.width)+((sensor_w - mf.width)>>1); - pcdev->host_top = (pcdev->cropinfo.c.top*mf.height/pcdev->cropinfo.bounds.height)+((sensor_h - mf.height)>>1); - } - - pcdev->host_left &= (~0x01); - pcdev->host_top &= (~0x01); - } - spin_unlock(&pcdev->cropinfo.lock); - } else { - spin_lock(&pcdev->cropinfo.lock); - if ((pcdev->cropinfo.c.width == 0)&&(pcdev->cropinfo.c.height == 0)) { - pcdev->host_width = mf.width; - pcdev->host_height = mf.height; - pcdev->host_left = 0; - pcdev->host_top = 0; - } else { - pcdev->host_width = pcdev->cropinfo.c.width*mf.width/pcdev->cropinfo.bounds.width; - pcdev->host_height = pcdev->cropinfo.c.height*mf.height/pcdev->cropinfo.bounds.height; - pcdev->host_left = (pcdev->cropinfo.c.left*mf.width/pcdev->cropinfo.bounds.width); - pcdev->host_top = (pcdev->cropinfo.c.top*mf.height/pcdev->cropinfo.bounds.height); - } - spin_unlock(&pcdev->cropinfo.lock); - } - - icd->sense = NULL; - if (!ret) { - rect.width = pcdev->host_width; - rect.height = pcdev->host_height; - rect.left = pcdev->host_left; - rect.top = pcdev->host_top; - - down(&pcdev->zoominfo.sem); -#if CIF_DO_CROP /* this crop is only for digital zoom*/ - pcdev->zoominfo.a.c.left = 0; - pcdev->zoominfo.a.c.top = 0; - pcdev->zoominfo.a.c.width = pcdev->host_width*100/pcdev->zoominfo.zoom_rate; - pcdev->zoominfo.a.c.width &= ~CROP_ALIGN_BYTES; - pcdev->zoominfo.a.c.height = pcdev->host_height*100/pcdev->zoominfo.zoom_rate; - pcdev->zoominfo.a.c.height &= ~CROP_ALIGN_BYTES; - pcdev->zoominfo.vir_width = pcdev->zoominfo.a.c.width; - pcdev->zoominfo.vir_height = pcdev->zoominfo.a.c.height; - /*recalculate the CIF width & height*/ - rect.width = pcdev->zoominfo.a.c.width ; - rect.height = pcdev->zoominfo.a.c.height; - rect.left = ((((pcdev->host_width - pcdev->zoominfo.a.c.width)>>1))+pcdev->host_left)&(~0x01); - rect.top = ((((pcdev->host_height - pcdev->zoominfo.a.c.height)>>1))+pcdev->host_top)&(~0x01); -#else - pcdev->zoominfo.a.c.width = pcdev->host_width*100/pcdev->zoominfo.zoom_rate; - pcdev->zoominfo.a.c.width &= ~CROP_ALIGN_BYTES; - pcdev->zoominfo.a.c.height = pcdev->host_height*100/pcdev->zoominfo.zoom_rate; - pcdev->zoominfo.a.c.height &= ~CROP_ALIGN_BYTES; - /*now digital zoom use ipp to do crop and scale*/ - if(pcdev->zoominfo.zoom_rate != 100){ - pcdev->zoominfo.a.c.left = ((pcdev->host_width - pcdev->zoominfo.a.c.width)>>1)&(~0x01); - pcdev->zoominfo.a.c.top = ((pcdev->host_height - pcdev->zoominfo.a.c.height)>>1)&(~0x01); - } else { - pcdev->zoominfo.a.c.left = 0; - pcdev->zoominfo.a.c.top = 0; - } - pcdev->zoominfo.vir_width = pcdev->host_width; - pcdev->zoominfo.vir_height = pcdev->host_height; -#endif - up(&pcdev->zoominfo.sem); - - /* ddl@rock-chips.com: IPP work limit check */ - if ((pcdev->zoominfo.a.c.width != usr_w) || (pcdev->zoominfo.a.c.height != usr_h)) { - if (usr_w > 0x7f0) { - if (((usr_w>>1)&0x3f) && (((usr_w>>1)&0x3f) <= 8)) { - RKCAMERA_TR("IPP Destination resolution(%dx%d, ((%d div 1) mod 64)=%d is <= 8)",usr_w,usr_h, usr_w, (int)((usr_w>>1)&0x3f)); - ret = -EINVAL; - goto RK_CAMERA_SET_FMT_END; - } - } else { - if ((usr_w&0x3f) && ((usr_w&0x3f) <= 8)) { - RKCAMERA_TR("IPP Destination resolution(%dx%d, %d mod 64=%d is <= 8)",usr_w,usr_h, usr_w, (int)(usr_w&0x3f)); - ret = -EINVAL; - goto RK_CAMERA_SET_FMT_END; - } - } - } - - RKCAMERA_DG1("%s CIF Host:%dx%d@(%d,%d) Sensor:%dx%d->%dx%d User crop:(%d,%d,%d,%d)in(%d,%d) (zoom: %dx%d@(%d,%d)->%dx%d)\n",xlate->host_fmt->name, - pcdev->host_width,pcdev->host_height,pcdev->host_left,pcdev->host_top, - sensor_w,sensor_h,mf.width,mf.height, - pcdev->cropinfo.c.left,pcdev->cropinfo.c.top,pcdev->cropinfo.c.width,pcdev->cropinfo.c.height, - pcdev->cropinfo.bounds.width,pcdev->cropinfo.bounds.height, - pcdev->zoominfo.a.c.width,pcdev->zoominfo.a.c.height, pcdev->zoominfo.a.c.left,pcdev->zoominfo.a.c.top, - pix->width, pix->height); - - rk_camera_setup_format(icd, pix->pixelformat, mf.code, &rect); - - if (CAM_IPPWORK_IS_EN()) { - BUG_ON(pcdev->vipmem_phybase == 0); - } - pix->width = usr_w; - pix->height = usr_h; - pix->field = mf.field; - pix->colorspace = mf.colorspace; - icd->current_fmt = xlate; - pcdev->icd_width = mf.width; - pcdev->icd_height = mf.height; - } - -RK_CAMERA_SET_FMT_END: - if (stream_on & ENABLE_CAPTURE) - write_cif_reg(pcdev->base,CIF_CIF_CTRL, (read_cif_reg(pcdev->base,CIF_CIF_CTRL) | ENABLE_CAPTURE)); - if (ret) - RKCAMERA_TR("\n%s..%d.. ret = %d \n",__FUNCTION__,__LINE__, ret); - return ret; -} - -static int rk_camera_try_fmt(struct soc_camera_device *icd, - struct v4l2_format *f) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/ - struct rk_camera_dev *pcdev = ici->priv; - struct v4l2_subdev *sd = soc_camera_to_subdev(icd); - const struct soc_camera_format_xlate *xlate; - struct v4l2_pix_format *pix = &f->fmt.pix; - __u32 pixfmt = pix->pixelformat; - int ret,usr_w,usr_h,i; - bool is_capture = rk_camera_fmt_capturechk(f); /* testing f is in line with the already set*/ - bool vipmem_is_overflow = false; - struct v4l2_mbus_framefmt mf; - int bytes_per_line_host; - - usr_w = pix->width; - usr_h = pix->height; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); - if (!xlate) { - /*dev_err(icd->dev.parent, "Format (%c%c%c%c) not found\n", pixfmt & 0xFF, (pixfmt >> 8) & 0xFF,*/ - dev_err(icd->parent, "Format (%c%c%c%c) not found\n", pixfmt & 0xFF, (pixfmt >> 8) & 0xFF,/*yzm*/ - (pixfmt >> 16) & 0xFF, (pixfmt >> 24) & 0xFF); - ret = -EINVAL; - RKCAMERA_TR("%s(version:%c%c%c) support format:\n",rk_cam_driver_description,(RK_CAM_VERSION_CODE&0xff0000)>>16, - (RK_CAM_VERSION_CODE&0xff00)>>8,(RK_CAM_VERSION_CODE&0xff)); - for (i = 0; i < icd->num_user_formats; i++) - RKCAMERA_TR("(%c%c%c%c)-%s\n", - icd->user_formats[i].host_fmt->fourcc & 0xFF, (icd->user_formats[i].host_fmt->fourcc >> 8) & 0xFF, - (icd->user_formats[i].host_fmt->fourcc >> 16) & 0xFF, (icd->user_formats[i].host_fmt->fourcc >> 24) & 0xFF, - icd->user_formats[i].host_fmt->name); - goto RK_CAMERA_TRY_FMT_END; - } - /* limit to rk29 hardware capabilities */ - v4l_bound_align_image(&pix->width, RK_CAM_W_MIN, RK_CAM_W_MAX, 1, - &pix->height, RK_CAM_H_MIN, RK_CAM_H_MAX, 0, - pixfmt == V4L2_PIX_FMT_NV16 ? 4 : 0); - - pix->bytesperline = soc_mbus_bytes_per_line(pix->width, - xlate->host_fmt); - if (pix->bytesperline < 0) - return pix->bytesperline; - - /* limit to sensor capabilities */ - memset(&mf,0x00,sizeof(struct v4l2_mbus_framefmt)); - mf.width = pix->width; - mf.height = pix->height; - mf.field = pix->field; - mf.colorspace = pix->colorspace; - mf.code = xlate->code; - /* ddl@rock-chips.com : It is query max resolution only. */ - if ((usr_w == 10000) && (usr_h == 10000)) { - mf.reserved[6] = 0xfefe5a5a; - } - /* call generic_sensor_try_fmt()*/ - ret = v4l2_subdev_call(sd, video, try_mbus_fmt, &mf); - if (ret < 0) - goto RK_CAMERA_TRY_FMT_END; - - /*query resolution.*/ - if((usr_w == 10000) && (usr_h == 10000)) { - pix->width = mf.width; - pix->height = mf.height; - RKCAMERA_DG1("Sensor resolution : %dx%d\n",mf.width,mf.height); - goto RK_CAMERA_TRY_FMT_END; - } else { - RKCAMERA_DG1("user demand: %dx%d sensor output: %dx%d \n",usr_w,usr_h,mf.width,mf.height); - } - - if ((mf.width != usr_w) || (mf.height != usr_h)) { - bytes_per_line_host = soc_mbus_bytes_per_line(mf.width,icd->current_fmt->host_fmt); - if (is_capture) { - vipmem_is_overflow = (PAGE_ALIGN(bytes_per_line_host*mf.height) > pcdev->vipmem_size); - } else { - /* Assume preview buffer minimum is 4 */ - vipmem_is_overflow = (PAGE_ALIGN(bytes_per_line_host*mf.height)*4 > pcdev->vipmem_size); - } - if (vipmem_is_overflow == false) { - pix->width = usr_w; - pix->height = usr_h; - } else { - /*RKCAMERA_TR("vipmem for IPP is overflow, This resolution(%dx%d -> %dx%d) is invalidate!\n",mf.width,mf.height,usr_w,usr_h);*/ /*yzm*/ - pix->width = mf.width; - pix->height = mf.height; - } - /* ddl@rock-chips.com: Invalidate these code, because sensor need interpolate */ - #if 0 - if ((mf.width < usr_w) || (mf.height < usr_h)) { - if (((usr_w>>1) > mf.width) || ((usr_h>>1) > mf.height)) { - RKCAMERA_TR("The aspect ratio(%dx%d/%dx%d) is bigger than 2 !\n",mf.width,mf.height,usr_w,usr_h); - pix->width = mf.width; - pix->height = mf.height; - } - } - #endif - } - - pix->colorspace = mf.colorspace; - - switch (mf.field) { - case V4L2_FIELD_ANY: - case V4L2_FIELD_NONE: - pix->field = V4L2_FIELD_NONE; - break; - default: - /* TODO: support interlaced at least in pass-through mode */ - dev_err(icd->parent, "Field type %d unsupported.\n", - mf.field); - goto RK_CAMERA_TRY_FMT_END; - } - -RK_CAMERA_TRY_FMT_END: - if (ret<0) - RKCAMERA_TR("\n%s..%d.. ret = %d \n",__FUNCTION__,__LINE__, ret); - return ret; -} - -static int rk_camera_reqbufs(struct soc_camera_device *icd, - struct v4l2_requestbuffers *p) -{ - int i; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - /* This is for locking debugging only. I removed spinlocks and now I - * check whether .prepare is ever called on a linked buffer, or whether - * a dma IRQ can occur for an in-work or unlinked buffer. Until now - * it hadn't triggered */ - for (i = 0; i < p->count; i++) { - struct rk_camera_buffer *buf = container_of(icd->vb_vidq.bufs[i], - struct rk_camera_buffer, vb); - buf->inwork = 0; - INIT_LIST_HEAD(&buf->vb.queue); - } - - return 0; -} - -static unsigned int rk_camera_poll(struct file *file, poll_table *pt) -{ - struct soc_camera_device *icd = file->private_data; - struct rk_camera_buffer *buf; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - buf = list_entry(icd->vb_vidq.stream.next, struct rk_camera_buffer, - vb.stream); - - poll_wait(file, &buf->vb.done, pt); - - if (buf->vb.state == VIDEOBUF_DONE || - buf->vb.state == VIDEOBUF_ERROR) - return POLLIN|POLLRDNORM; - - return 0; -} -/* -*card: sensor name _ facing _ device index - orientation _ fov horizontal _ fov vertical -* 10 5 1 3 3 3 + 5 < 32 -*/ - -static int rk_camera_querycap(struct soc_camera_host *ici, - struct v4l2_capability *cap) -{ - struct rk_camera_dev *pcdev = ici->priv; - struct rkcamera_platform_data *new_camera; - char orientation[5]; - char fov[9]; - int i; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - - strlcpy(cap->card, dev_name(pcdev->icd->pdev), 18); - memset(orientation,0x00,sizeof(orientation)); - - i=0; - new_camera = pcdev->pdata->register_dev_new; - while(new_camera != NULL){ - if (strcmp(dev_name(pcdev->icd->pdev), new_camera->dev_name) == 0) { - sprintf(orientation,"-%d",new_camera->orientation); - sprintf(fov,"_%d_%d",new_camera->fov_h,new_camera->fov_v); - } - new_camera = new_camera->next_camera; - } - - if (orientation[0] != '-') { - RKCAMERA_TR("%s: %s is not registered in rk29_camera_platform_data, orientation apply default value",__FUNCTION__,dev_name(pcdev->icd->pdev)); - if (strstr(dev_name(pcdev->icd->pdev),"front")) - strcat(cap->card,"-270"); - else - strcat(cap->card,"-90"); - } else { - strcat(cap->card,orientation); - } - - strcat(cap->card,fov); /* ddl@rock-chips.com: v0.3.f */ - cap->version = RK_CAM_VERSION_CODE; - cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING; - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - return 0; -} -static int rk_camera_suspend(struct soc_camera_device *icd, pm_message_t state) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/ - struct rk_camera_dev *pcdev = ici->priv; - struct v4l2_subdev *sd; - int ret = 0; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - mutex_lock(&camera_lock); - if ((pcdev->icd == icd) && (icd->ops->suspend)) { - rk_camera_s_stream(icd, 0); - sd = soc_camera_to_subdev(icd); - v4l2_subdev_call(sd, video, s_stream, 0); - ret = icd->ops->suspend(icd, state); - - pcdev->reginfo_suspend.cifCtrl = read_cif_reg(pcdev->base,CIF_CIF_CTRL); - pcdev->reginfo_suspend.cifCrop = read_cif_reg(pcdev->base,CIF_CIF_CROP); - pcdev->reginfo_suspend.cifFs = read_cif_reg(pcdev->base,CIF_CIF_SET_SIZE); - pcdev->reginfo_suspend.cifIntEn = read_cif_reg(pcdev->base,CIF_CIF_INTEN); - pcdev->reginfo_suspend.cifFmt= read_cif_reg(pcdev->base,CIF_CIF_FOR); - pcdev->reginfo_suspend.cifVirWidth = read_cif_reg(pcdev->base,CIF_CIF_VIR_LINE_WIDTH); - pcdev->reginfo_suspend.cifScale= read_cif_reg(pcdev->base,CIF_CIF_SCL_CTRL); - - pcdev->reginfo_suspend.Inval = Reg_Validate; - rk_camera_deactivate(pcdev); - - RKCAMERA_DG1("%s Enter Success...\n", __FUNCTION__); - } else { - RKCAMERA_DG1("%s icd has been deattach, don't need enter suspend\n", __FUNCTION__); - } - mutex_unlock(&camera_lock); - return ret; -} - -static int rk_camera_resume(struct soc_camera_device *icd) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/ - struct rk_camera_dev *pcdev = ici->priv; - struct v4l2_subdev *sd; - int ret = 0; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - mutex_lock(&camera_lock); - if ((pcdev->icd == icd) && (icd->ops->resume)) { - if (pcdev->reginfo_suspend.Inval == Reg_Validate) { - rk_camera_activate(pcdev, icd); - write_cif_reg(pcdev->base,CIF_CIF_CTRL, pcdev->reginfo_suspend.cifCtrl&~ENABLE_CAPTURE); - write_cif_reg(pcdev->base,CIF_CIF_INTEN, pcdev->reginfo_suspend.cifIntEn); - write_cif_reg(pcdev->base,CIF_CIF_CROP, pcdev->reginfo_suspend.cifCrop); - write_cif_reg(pcdev->base,CIF_CIF_SET_SIZE, pcdev->reginfo_suspend.cifFs); - write_cif_reg(pcdev->base,CIF_CIF_FOR, pcdev->reginfo_suspend.cifFmt); - write_cif_reg(pcdev->base,CIF_CIF_VIR_LINE_WIDTH,pcdev->reginfo_suspend.cifVirWidth); - write_cif_reg(pcdev->base,CIF_CIF_SCL_CTRL, pcdev->reginfo_suspend.cifScale); - //rk_videobuf_capture(pcdev->active,pcdev); - rk_videobuf_capture(pcdev->active0,pcdev,0); - rk_videobuf_capture(pcdev->active1,pcdev,1); - rk_camera_s_stream(icd, 1); - pcdev->reginfo_suspend.Inval = Reg_Invalidate; - } else { - RKCAMERA_TR("Resume fail, vip register recored is invalidate!!\n"); - goto rk_camera_resume_end; - } - - ret = icd->ops->resume(icd); - sd = soc_camera_to_subdev(icd); - v4l2_subdev_call(sd, video, s_stream, 1); - - RKCAMERA_DG1("%s Enter success\n",__FUNCTION__); - } else { - RKCAMERA_DG1("%s icd has been deattach, don't need enter resume\n", __FUNCTION__); - } - -rk_camera_resume_end: - mutex_unlock(&camera_lock); - return ret; -} - -static void rk_camera_reinit_work(struct work_struct *work) -{ - struct v4l2_subdev *sd; - struct rk_camera_work *camera_work = container_of(work, struct rk_camera_work, work); - struct rk_camera_dev *pcdev = camera_work->pcdev; - /*struct soc_camera_link *tmp_soc_cam_link;*/ - struct v4l2_mbus_framefmt mf; - int index = 0; - unsigned long flags = 0; - int ctrl; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - //return; - - if(pcdev->icd == NULL) - return; - sd = soc_camera_to_subdev(pcdev->icd); - /*tmp_soc_cam_desc = to_soc_camera_link(pcdev->icd);*/ /*yzm*/ - /*dump regs*/ - { - RKCAMERA_TR("CIF_CIF_CTRL = 0x%x\n",read_cif_reg(pcdev->base,CIF_CIF_CTRL)); - RKCAMERA_TR("CIF_CIF_INTEN = 0x%x\n",read_cif_reg(pcdev->base,CIF_CIF_INTEN)); - RKCAMERA_TR("CIF_CIF_INTSTAT = 0x%x\n",read_cif_reg(pcdev->base,CIF_CIF_INTSTAT)); - RKCAMERA_TR("CIF_CIF_FOR = 0x%x\n",read_cif_reg(pcdev->base,CIF_CIF_FOR)); - RKCAMERA_TR("CIF_CIF_CROP = 0x%x\n",read_cif_reg(pcdev->base,CIF_CIF_CROP)); - RKCAMERA_TR("CIF_CIF_SET_SIZE = 0x%x\n",read_cif_reg(pcdev->base,CIF_CIF_SET_SIZE)); - RKCAMERA_TR("CIF_CIF_SCL_CTRL = 0x%x\n",read_cif_reg(pcdev->base,CIF_CIF_SCL_CTRL)); - if(CHIP_NAME == 3368) - RKCAMERA_TR("CRU_PCLK_REG30 = 0X%x\n",rk3368_read_cru_reg(CRU_PCLK_REG30)); - else - RKCAMERA_TR("CRU_PCLK_REG30 = 0X%x\n",read_cru_reg(CRU_PCLK_REG30)); - RKCAMERA_TR("CIF_CIF_LAST_LINE = 0X%x\n",read_cif_reg(pcdev->base,CIF_CIF_LAST_LINE)); - - RKCAMERA_TR("CIF_CIF_LAST_PIX = 0X%x\n",read_cif_reg(pcdev->base,CIF_CIF_LAST_PIX)); - RKCAMERA_TR("CIF_CIF_VIR_LINE_WIDTH = 0X%x\n",read_cif_reg(pcdev->base,CIF_CIF_VIR_LINE_WIDTH)); - RKCAMERA_TR("CIF_CIF_LINE_NUM_ADDR = 0X%x\n",read_cif_reg(pcdev->base,CIF_CIF_LINE_NUM_ADDR)); - RKCAMERA_TR("CIF_CIF_FRM0_ADDR_Y = 0X%x\n",read_cif_reg(pcdev->base,CIF_CIF_FRM0_ADDR_Y)); - RKCAMERA_TR("CIF_CIF_FRM0_ADDR_UV = 0X%x\n",read_cif_reg(pcdev->base,CIF_CIF_FRM0_ADDR_UV)); - RKCAMERA_TR("CIF_CIF_FRAME_STATUS = 0X%x\n",read_cif_reg(pcdev->base,CIF_CIF_FRAME_STATUS)); - RKCAMERA_TR("CIF_CIF_SCL_VALID_NUM = 0X%x\n",read_cif_reg(pcdev->base,CIF_CIF_SCL_VALID_NUM)); - RKCAMERA_TR("CIF_CIF_CUR_DST = 0X%x\n",read_cif_reg(pcdev->base,CIF_CIF_CUR_DST)); - RKCAMERA_TR("CIF_CIF_LINE_NUM_ADDR = 0X%x\n",read_cif_reg(pcdev->base,CIF_CIF_LINE_NUM_ADDR)); - } - - ctrl = read_cif_reg(pcdev->base,CIF_CIF_CTRL); /*ddl@rock-chips.com v0.3.0x13*/ - if (pcdev->reinit_times == 1) { - if (ctrl & ENABLE_CAPTURE) { - RKCAMERA_TR("Sensor data transfer may be error, so reset CIF and reinit sensor for resume!\n"); - pcdev->irqinfo.cifirq_idx = pcdev->irqinfo.dmairq_idx; - rk_camera_cif_reset(pcdev,false); - - - v4l2_subdev_call(sd,core, init, 0); - - mf.width = pcdev->icd_width; - mf.height = pcdev->icd_height; - mf.field = V4L2_FIELD_NONE; - mf.code = pcdev->icd->current_fmt->code; - mf.reserved[0] = 0x5a5afefe; - mf.reserved[1] = 0; - - v4l2_subdev_call(sd, video, s_mbus_fmt, &mf); - - write_cif_reg(pcdev->base,CIF_CIF_CTRL, (read_cif_reg(pcdev->base,CIF_CIF_CTRL)|ENABLE_CAPTURE)); - } else if (pcdev->irqinfo.cifirq_idx != pcdev->irqinfo.dmairq_idx) { - RKCAMERA_TR("CIF may be error, so reset cif for resume\n"); - pcdev->irqinfo.cifirq_idx = pcdev->irqinfo.dmairq_idx; - rk_camera_cif_reset(pcdev,false); - write_cif_reg(pcdev->base,CIF_CIF_CTRL, (read_cif_reg(pcdev->base,CIF_CIF_CTRL)|ENABLE_CAPTURE)); - } - return; - } - - atomic_set(&pcdev->stop_cif,true); - write_cif_reg(pcdev->base,CIF_CIF_CTRL, (read_cif_reg(pcdev->base,CIF_CIF_CTRL)&(~ENABLE_CAPTURE))); - RKCAMERA_DG1("the reinit times = %d\n",pcdev->reinit_times); - - if(pcdev->video_vq && pcdev->video_vq->irqlock){ - spin_lock_irqsave(pcdev->video_vq->irqlock, flags); - for (index = 0; index < VIDEO_MAX_FRAME; index++) { - if (NULL == pcdev->video_vq->bufs[index]) - continue; - - if (pcdev->video_vq->bufs[index]->state == VIDEOBUF_QUEUED) { - list_del_init(&pcdev->video_vq->bufs[index]->queue); - pcdev->video_vq->bufs[index]->state = VIDEOBUF_NEEDS_INIT; - wake_up_all(&pcdev->video_vq->bufs[index]->done); - printk("wake up video buffer index = %d !!!\n",index); - } - } - spin_unlock_irqrestore(pcdev->video_vq->irqlock, flags); - }else{ - RKCAMERA_TR("video queue has somthing wrong !!\n"); - } - - RKCAMERA_TR("the %d reinit times ,wake up video buffers!\n ",pcdev->reinit_times); -} -static enum hrtimer_restart rk_camera_fps_func(struct hrtimer *timer) -{ - struct rk_camera_frmivalenum *fival_nxt=NULL,*fival_pre=NULL, *fival_rec=NULL; - struct rk_camera_timer *fps_timer = container_of(timer, struct rk_camera_timer, timer); - struct rk_camera_dev *pcdev = fps_timer->pcdev; - int rec_flag,i; - /*static unsigned int last_fps = 0;*/ - /*struct soc_camera_link *tmp_soc_cam_link;*/ /*yzm*/ - /*tmp_soc_cam_link = to_soc_camera_link(pcdev->icd);*/ /*yzm*/ - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - RKCAMERA_DG1("rk_camera_fps_func fps:0x%x\n",pcdev->fps); - if ((pcdev->fps < 1) || (pcdev->last_fps == pcdev->fps)) { - RKCAMERA_TR("Camera host haven't recevie data from sensor,last fps = %d,pcdev->fps = %d,cif_irq: %ld,dma_irq: %ld!\n", - pcdev->last_fps,pcdev->fps,pcdev->irqinfo.cifirq_idx, pcdev->irqinfo.dmairq_idx); - pcdev->camera_reinit_work.pcdev = pcdev; - /*INIT_WORK(&(pcdev->camera_reinit_work.work), rk_camera_reinit_work);*/ - pcdev->reinit_times++; - queue_work(pcdev->camera_wq,&(pcdev->camera_reinit_work.work));//Æô¶¯¹¤×÷¶ÓÁжÔÓ¦µÄº¯Êý - } else if(!pcdev->timer_get_fps) { - pcdev->timer_get_fps = true; - for (i=0; i<2; i++) { - if (pcdev->icd == pcdev->icd_frmival[i].icd) { - fival_nxt = pcdev->icd_frmival[i].fival_list; - } - } - - rec_flag = 0; - fival_pre = fival_nxt; - while (fival_nxt != NULL) { - - RKCAMERA_DG1("%s %c%c%c%c %dx%d framerate : %d/%d\n", dev_name(pcdev->icd->control), /*yzm*/ - fival_nxt->fival.pixel_format & 0xFF, (fival_nxt->fival.pixel_format >> 8) & 0xFF, - (fival_nxt->fival.pixel_format >> 16) & 0xFF, (fival_nxt->fival.pixel_format >> 24), - fival_nxt->fival.width, fival_nxt->fival.height, fival_nxt->fival.discrete.denominator, - fival_nxt->fival.discrete.numerator); - - if (((fival_nxt->fival.pixel_format == pcdev->pixfmt) - && (fival_nxt->fival.height == pcdev->icd->user_height) - && (fival_nxt->fival.width == pcdev->icd->user_width)) - || (fival_nxt->fival.discrete.denominator == 0)) { - - if (fival_nxt->fival.discrete.denominator == 0) { - fival_nxt->fival.index = 0; - fival_nxt->fival.width = pcdev->icd->user_width; - fival_nxt->fival.height= pcdev->icd->user_height; - fival_nxt->fival.pixel_format = pcdev->pixfmt; - fival_nxt->fival.discrete.denominator = pcdev->frame_interval; - fival_nxt->fival.reserved[1] = (pcdev->icd_width<<16) - |(pcdev->icd_height); - fival_nxt->fival.discrete.numerator = 1000000; - fival_nxt->fival.type = V4L2_FRMIVAL_TYPE_DISCRETE; - } - rec_flag = 1; - fival_rec = fival_nxt; - } - fival_pre = fival_nxt; - fival_nxt = fival_nxt->nxt; - } - - if ((rec_flag == 0) && fival_pre) { - fival_pre->nxt = kzalloc(sizeof(struct rk_camera_frmivalenum), GFP_ATOMIC); - if (fival_pre->nxt != NULL) { - fival_pre->nxt->fival.index = fival_pre->fival.index++; - fival_pre->nxt->fival.width = pcdev->icd->user_width; - fival_pre->nxt->fival.height= pcdev->icd->user_height; - fival_pre->nxt->fival.pixel_format = pcdev->pixfmt; - - fival_pre->nxt->fival.discrete.denominator = pcdev->frame_interval; - fival_pre->nxt->fival.reserved[1] = (pcdev->icd_width<<16) - |(pcdev->icd_height); - fival_pre->nxt->fival.discrete.numerator = 1000000; - fival_pre->nxt->fival.type = V4L2_FRMIVAL_TYPE_DISCRETE; - rec_flag = 1; - fival_rec = fival_pre->nxt; - } - } - } - - if ((pcdev->last_fps != pcdev->fps) && (pcdev->reinit_times)) /*ddl@rock-chips.com v0.3.0x13*/ - pcdev->reinit_times = 0; - - pcdev->last_fps = pcdev->fps ; - pcdev->fps_timer.timer.node.expires= ktime_add_us(pcdev->fps_timer.timer.node.expires, ktime_to_us(ktime_set(3, 0))); - pcdev->fps_timer.timer._softexpires= ktime_add_us(pcdev->fps_timer.timer._softexpires, ktime_to_us(ktime_set(3, 0))); - /*return HRTIMER_NORESTART;*/ - if(pcdev->reinit_times >=2) - return HRTIMER_NORESTART; - else - return HRTIMER_RESTART; -} -static int rk_camera_s_stream(struct soc_camera_device *icd, int enable) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/ - struct rk_camera_dev *pcdev = ici->priv; - int cif_ctrl_val; - int ret; - unsigned long flags; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - WARN_ON(pcdev->icd != icd); - - cif_ctrl_val = read_cif_reg(pcdev->base,CIF_CIF_CTRL); - if (enable) { - pcdev->fps = 0; - pcdev->last_fps = 0; - pcdev->frame_interval = 0; - hrtimer_cancel(&(pcdev->fps_timer.timer)); - pcdev->fps_timer.pcdev = pcdev; - pcdev->timer_get_fps = false; - pcdev->reinit_times = 0; - - spin_lock_irqsave(&pcdev->lock,flags); - atomic_set(&pcdev->stop_cif,false); - pcdev->irqinfo.cifirq_idx = 0; - pcdev->irqinfo.cifirq_normal_idx = 0; - pcdev->irqinfo.cifirq_abnormal_idx = 0; - pcdev->irqinfo.dmairq_idx = 0; - - write_cif_reg(pcdev->base,CIF_CIF_INTEN, 0x01|0x200); /*capture complete interrupt enable*/ - cif_ctrl_val |= ENABLE_CAPTURE; - write_cif_reg(pcdev->base,CIF_CIF_CTRL, cif_ctrl_val); - spin_unlock_irqrestore(&pcdev->lock,flags); - printk("%s:stream enable CIF_CIF_CTRL 0x%lx\n",__func__,read_cif_reg(pcdev->base,CIF_CIF_CTRL)); - hrtimer_start(&(pcdev->fps_timer.timer),ktime_set(3, 0),HRTIMER_MODE_REL); - pcdev->fps_timer.istarted = true; - } else { - /*cancel timer before stop cif*/ - ret = hrtimer_cancel(&pcdev->fps_timer.timer); - pcdev->fps_timer.istarted = false; - flush_work(&(pcdev->camera_reinit_work.work)); - - cif_ctrl_val &= ~ENABLE_CAPTURE; - spin_lock_irqsave(&pcdev->lock, flags); - write_cif_reg(pcdev->base,CIF_CIF_CTRL, cif_ctrl_val); - atomic_set(&pcdev->stop_cif,true); - write_cif_reg(pcdev->base,CIF_CIF_INTEN, 0x0); - spin_unlock_irqrestore(&pcdev->lock, flags); - flush_workqueue((pcdev->camera_wq)); - msleep(100); - } - /*must be reinit,or will be somthing wrong in irq process.*/ - if(enable == false) { - //pcdev->active = NULL; - pcdev->active0 = NULL; - pcdev->active1 = NULL; - pcdev->active_buf = 0; - INIT_LIST_HEAD(&pcdev->capture); - } - RKCAMERA_DG1("s_stream: enable : 0x%x , CIF_CIF_CTRL = 0x%x\n",enable,read_cif_reg(pcdev->base,CIF_CIF_CTRL)); - return 0; -} -int rk_camera_enum_frameintervals(struct soc_camera_device *icd, struct v4l2_frmivalenum *fival) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/ - struct rk_camera_dev *pcdev = ici->priv; - struct v4l2_subdev *sd = soc_camera_to_subdev(icd); - struct rk_camera_frmivalenum *fival_list = NULL; - struct v4l2_frmivalenum *fival_head = NULL; - struct rkcamera_platform_data *new_camera; - int i,ret = 0,index; - const struct soc_camera_format_xlate *xlate; - struct v4l2_mbus_framefmt mf; - __u32 pixfmt; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - index = fival->index & 0x00ffffff; - if ((fival->index & 0xff000000) == 0xff000000) { /* ddl@rock-chips.com: detect framerate */ - for (i=0; i<2; i++) { - if (pcdev->icd_frmival[i].icd == icd) { - fival_list = pcdev->icd_frmival[i].fival_list; - } - } - - if (fival_list != NULL) { - i = 0; - while (fival_list != NULL) { - if ((fival->pixel_format == fival_list->fival.pixel_format) - && (fival->height == fival_list->fival.height) - && (fival->width == fival_list->fival.width)) { - if (i == index) - break; - i++; - } - fival_list = fival_list->nxt; - } - - if ((i==index) && (fival_list != NULL)) { - memcpy(fival, &fival_list->fival, sizeof(struct v4l2_frmivalenum)); - } else { - ret = -EINVAL; - } - } else { - RKCAMERA_TR("%s: fival_list is NULL\n",__FUNCTION__); - ret = -EINVAL; - } - } else { - - if (fival_head) { - i = 0; - while (fival_head->width && fival_head->height) { - if ((fival->pixel_format == fival_head->pixel_format) - && (fival->height == fival_head->height) - && (fival->width == fival_head->width)) { - if (i == index) { - break; - } - i++; - } - fival_head++; - } - - if ((i == index) && (fival->height == fival_head->height) && (fival->width == fival_head->width)) { - memcpy(fival, fival_head, sizeof(struct v4l2_frmivalenum)); - - pixfmt = fival->pixel_format; /* ddl@rock-chips.com: v0.3.9 */ - xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); - memset(&mf,0x00,sizeof(struct v4l2_mbus_framefmt)); - mf.width = fival->width; - mf.height = fival->height; - mf.code = xlate->code; - - v4l2_subdev_call(sd, video, try_mbus_fmt, &mf); - - fival->reserved[1] = (mf.width<<16)|(mf.height); - - RKCAMERA_DG1("%s %dx%d@%c%c%c%c framerate : %d/%d\n", dev_name(pcdev->icd->pdev), - fival->width, fival->height, - fival->pixel_format & 0xFF, (fival->pixel_format >> 8) & 0xFF, - (fival->pixel_format >> 16) & 0xFF, (fival->pixel_format >> 24), - fival->discrete.denominator,fival->discrete.numerator); - } else { - if (index == 0) - RKCAMERA_TR("%s have not catch %d%d@%c%c%c%c index(%d) framerate\n",dev_name(pcdev->icd->pdev), - fival->width,fival->height, - fival->pixel_format & 0xFF, (fival->pixel_format >> 8) & 0xFF, - (fival->pixel_format >> 16) & 0xFF, (fival->pixel_format >> 24), - index); - else - RKCAMERA_DG1("%s have not catch %d%d@%c%c%c%c index(%d) framerate\n",dev_name(pcdev->icd->pdev), - fival->width,fival->height, - fival->pixel_format & 0xFF, (fival->pixel_format >> 8) & 0xFF, - (fival->pixel_format >> 16) & 0xFF, (fival->pixel_format >> 24), - index); - ret = -EINVAL; - goto rk_camera_enum_frameintervals_end; - } - } else { - i = 0x00; - new_camera = pcdev->pdata->register_dev_new; - while(new_camera != NULL){ - if (strcmp(new_camera->dev_name, dev_name(pcdev->icd->pdev)) == 0) { - i = 0x01; - break; - } - new_camera = new_camera->next_camera; - } - - if (i == 0x00) { - printk(KERN_ERR "%s(%d): %s have not found in new_camera[] and rk_camera_platform_data!", - __FUNCTION__,__LINE__,dev_name(pcdev->icd->pdev)); - } else { - - pixfmt = fival->pixel_format; /* ddl@rock-chips.com: v0.3.9 */ - xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); - memset(&mf,0x00,sizeof(struct v4l2_mbus_framefmt)); - mf.width = fival->width; - mf.height = fival->height; - mf.code = xlate->code; - - v4l2_subdev_call(sd, video, try_mbus_fmt, &mf); - - fival->discrete.numerator= 1000; - fival->discrete.denominator = 15000; - fival->type = V4L2_FRMIVAL_TYPE_DISCRETE; - fival->reserved[1] = (mf.width<<16)|(mf.height); - } - } - } -rk_camera_enum_frameintervals_end: - return ret; -} - -static int rk_camera_set_digit_zoom(struct soc_camera_device *icd, - const struct v4l2_queryctrl *qctrl, int zoom_rate) -{ - struct v4l2_crop a; - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/ - struct rk_camera_dev *pcdev = ici->priv; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - -#if CIF_DO_CROP - unsigned long tmp_cifctrl; -#endif - - /*change the crop and scale parameters*/ - -#if CIF_DO_CROP - a.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - /*a.c.width = pcdev->host_width*100/zoom_rate;*/ - a.c.width = pcdev->host_width*100/zoom_rate; - a.c.width &= ~CROP_ALIGN_BYTES; - a.c.height = pcdev->host_height*100/zoom_rate; - a.c.height &= ~CROP_ALIGN_BYTES; - a.c.left = (((pcdev->host_width - a.c.width)>>1)+pcdev->host_left)&(~0x01); - a.c.top = (((pcdev->host_height - a.c.height)>>1)+pcdev->host_top)&(~0x01); - atomic_set(&pcdev->stop_cif,true); - tmp_cifctrl = read_cif_reg(pcdev->base,CIF_CIF_CTRL); - write_cif_reg(pcdev->base,CIF_CIF_CTRL, (tmp_cifctrl & ~ENABLE_CAPTURE)); - hrtimer_cancel(&(pcdev->fps_timer.timer)); - flush_workqueue((pcdev->camera_wq)); - - down(&pcdev->zoominfo.sem); - pcdev->zoominfo.a.c.left = 0; - pcdev->zoominfo.a.c.top = 0; - pcdev->zoominfo.a.c.width = a.c.width; - pcdev->zoominfo.a.c.height = a.c.height; - pcdev->zoominfo.vir_width = pcdev->zoominfo.a.c.width; - pcdev->zoominfo.vir_height = pcdev->zoominfo.a.c.height; - pcdev->frame_inval = 1; - write_cif_reg(pcdev->base,CIF_CIF_CROP, (a.c.left + (a.c.top<<16))); - write_cif_reg(pcdev->base,CIF_CIF_SET_SIZE, ((a.c.width ) + (a.c.height<<16))); - write_cif_reg(pcdev->base,CIF_CIF_VIR_LINE_WIDTH, a.c.width); - write_cif_reg(pcdev->base,CIF_CIF_FRAME_STATUS, 0x00000002);//frame1 has been ready to receive data,frame 2 is not used - //if(pcdev->active) - //rk_videobuf_capture(pcdev->active,pcdev); - if(pcdev->active0) - rk_videobuf_capture(pcdev->active0,pcdev,0); - if(pcdev->active1) - rk_videobuf_capture(pcdev->active1,pcdev,1); - if(tmp_cifctrl & ENABLE_CAPTURE) - write_cif_reg(pcdev->base,CIF_CIF_CTRL, (tmp_cifctrl | ENABLE_CAPTURE)); - up(&pcdev->zoominfo.sem); - - atomic_set(&pcdev->stop_cif,false); - hrtimer_start(&(pcdev->fps_timer.timer),ktime_set(3, 0),HRTIMER_MODE_REL); - RKCAMERA_DG1("zoom_rate:%d (%dx%d at (%d,%d)-> %dx%d)\n", zoom_rate,a.c.width, a.c.height, a.c.left, a.c.top, icd->user_width, icd->user_height ); -#else - a.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - a.c.width = pcdev->host_width*100/zoom_rate; - a.c.width &= ~CROP_ALIGN_BYTES; - a.c.height = pcdev->host_height*100/zoom_rate; - a.c.height &= ~CROP_ALIGN_BYTES; - a.c.left = (pcdev->host_width - a.c.width)>>1; - a.c.top = (pcdev->host_height - a.c.height)>>1; - - down(&pcdev->zoominfo.sem); - pcdev->zoominfo.a.c.height = a.c.height; - pcdev->zoominfo.a.c.width = a.c.width; - pcdev->zoominfo.a.c.top = a.c.top; - pcdev->zoominfo.a.c.left = a.c.left; - pcdev->zoominfo.vir_width = pcdev->host_width; - pcdev->zoominfo.vir_height= pcdev->host_height; - up(&pcdev->zoominfo.sem); - - RKCAMERA_DG1("zoom_rate:%d (%dx%d at (%d,%d)-> %dx%d)\n", zoom_rate,a.c.width, a.c.height, a.c.left, a.c.top, icd->user_width, icd->user_height ); -#endif - - return 0; -} - -static inline struct v4l2_queryctrl const *rk_camera_soc_camera_find_qctrl( - struct soc_camera_host_ops *ops, int id) -{ - - int i; - for (i = 0; i < ops->num_controls; i++) - if (ops->controls[i].id == id) - return &ops->controls[i]; - - return NULL; -} - - -static int rk_camera_set_ctrl(struct soc_camera_device *icd, - struct v4l2_control *sctrl) -{ - struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/ - const struct v4l2_queryctrl *qctrl; - struct rk_camera_dev *pcdev = ici->priv; - - int ret = 0; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - qctrl = rk_camera_soc_camera_find_qctrl(ici->ops, sctrl->id); - if (!qctrl) { - ret = -ENOIOCTLCMD; - goto rk_camera_set_ctrl_end; - } - - switch (sctrl->id) - { - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((sctrl->value < qctrl->minimum) || (sctrl->value > qctrl->maximum)){ - ret = -EINVAL; - goto rk_camera_set_ctrl_end; - } - ret = rk_camera_set_digit_zoom(icd, qctrl, sctrl->value); - if (ret == 0) { - pcdev->zoominfo.zoom_rate = sctrl->value; - } else { - goto rk_camera_set_ctrl_end; - } - break; - } - default: - ret = -ENOIOCTLCMD; - break; - } -rk_camera_set_ctrl_end: - return ret; -} - -static struct soc_camera_host_ops rk_soc_camera_host_ops = -{ - .owner = THIS_MODULE, - .add = rk_camera_add_device, - .remove = rk_camera_remove_device, - .suspend = rk_camera_suspend, - .resume = rk_camera_resume, - .enum_frameinervals = rk_camera_enum_frameintervals, - .cropcap = rk_camera_cropcap, - .set_crop = rk_camera_set_crop, - .get_crop = rk_camera_get_crop, - .get_formats = rk_camera_get_formats, - .put_formats = rk_camera_put_formats, - .set_fmt = rk_camera_set_fmt, - .try_fmt = rk_camera_try_fmt, - .init_videobuf = rk_camera_init_videobuf, - .reqbufs = rk_camera_reqbufs, - .poll = rk_camera_poll, - .querycap = rk_camera_querycap, - .set_bus_param = rk_camera_set_bus_param, - .s_stream = rk_camera_s_stream, /* ddl@rock-chips.com : Add stream control for host */ - .set_ctrl = rk_camera_set_ctrl, - .controls = rk_camera_controls, - .num_controls = ARRAY_SIZE(rk_camera_controls) -}; - -/**********yzm***********/ -static int rk_camera_cif_iomux(struct device *dev) -{ - - struct pinctrl *pinctrl; - struct pinctrl_state *state; - int retval = 0; - char state_str[20] = {0}; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - if(CHIP_NAME == 3368) - strcpy(state_str,"cif_pin_all"); - else - strcpy(state_str,"cif_pin_jpe"); - - /*__raw_writel(((1<<1)|(1<<(1+16))),RK_GRF_VIRT+0x0380);*/ - - - /*mux CIF0_CLKOUT*/ - - pinctrl = devm_pinctrl_get(dev); - if (IS_ERR(pinctrl)) { - printk(KERN_EMERG "%s:Get pinctrl failed!\n",__func__); - return -1; - } - state = pinctrl_lookup_state(pinctrl, - state_str); - if (IS_ERR(state)){ - dev_err(dev, "%s:could not get %s pinstate\n",__func__,state_str); - return -1; - } - - if (!IS_ERR(state)) { - retval = pinctrl_select_state(pinctrl, state); - if (retval){ - dev_err(dev, - "%s:could not set %s pins\n",__func__,state_str); - return -1; - - } - } - return 0; - -} -/***********yzm***********/ -static int rk_camera_probe(struct platform_device *pdev) -{ - struct rk_camera_dev *pcdev; - struct resource *res; - struct rk_camera_frmivalenum *fival_list,*fival_nxt; - int irq,i; - int err = 0; - struct rk_cif_clk *clk=NULL; - struct device *dev_cif = ((struct rk29camera_platform_data*)pdev->dev.platform_data)->cif_dev;/*yzm*/ - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - RKCAMERA_TR("%s version: v%d.%d.%d Zoom by %s",RK29_CAM_DRV_NAME,(RK_CAM_VERSION_CODE&0xff0000)>>16, - (RK_CAM_VERSION_CODE&0xff00)>>8,RK_CAM_VERSION_CODE&0xff,CAMERA_SCALE_CROP_MACHINE); - - if ((pdev->id == RK_CAM_PLATFORM_DEV_ID_1) && (RK_SUPPORT_CIF1 == 0)) { - RKCAMERA_TR("%s(%d): This chip is not support CIF1!!\n",__FUNCTION__,__LINE__); - BUG(); - } - - if ((pdev->id == RK_CAM_PLATFORM_DEV_ID_0) && (RK_SUPPORT_CIF0 == 0)) { - RKCAMERA_TR("%s(%d): This chip is not support CIF0!!\n",__FUNCTION__,__LINE__); - BUG(); - } - -/***********yzm**********/ - rk_camera_diffchips(((struct rk29camera_platform_data*)pdev->dev.platform_data)->rockchip_name); - - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - irq = platform_get_irq(pdev, 0); - - /* irq = irq_of_parse_and_map(dev_cif->of_node, 0); - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n res = [%x--%x] \n",res->start , res->end); - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n irq_num = %d\n", irq); - */ - if (!res || irq < 0) { - err = -ENODEV; - goto exit; - } - pcdev = kzalloc(sizeof(*pcdev), GFP_KERNEL); - if (!pcdev) { - dev_err(&pdev->dev, "Could not allocate pcdev\n"); - err = -ENOMEM; - goto exit_alloc; - } - - pcdev->zoominfo.zoom_rate = 100; - pcdev->hostid = pdev->id; /* get host id*/ - #ifdef CONFIG_SOC_RK3028 - pcdev->chip_id = rk3028_version_val(); - #else - pcdev->chip_id = -1; - #endif - - /***********yzm***********/ - if (IS_CIF0()) { - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$/is_cif0\n"); - clk = &cif_clk[0]; - if(CHIP_NAME != 3368) - cif_clk[0].pd_cif = devm_clk_get(dev_cif, "pd_cif0"); - cif_clk[0].aclk_cif = devm_clk_get(dev_cif, "aclk_cif0"); - cif_clk[0].hclk_cif = devm_clk_get(dev_cif, "hclk_cif0"); - cif_clk[0].cif_clk_in = devm_clk_get(dev_cif, "cif0_in"); - cif_clk[0].cif_clk_out = devm_clk_get(dev_cif, "cif0_out"); - //spin_lock_init(&cif_clk[0].lock); - cif_clk[0].on = false; - rk_camera_cif_iomux(dev_cif);/*yzm*/ - } else { - clk = &cif_clk[1]; - if(CHIP_NAME != 3368) - cif_clk[1].pd_cif = devm_clk_get(dev_cif, "pd_cif0");/*cif0 only yzm*/ - cif_clk[1].aclk_cif = devm_clk_get(dev_cif, "aclk_cif0"); - cif_clk[1].hclk_cif = devm_clk_get(dev_cif, "hclk_cif0"); - cif_clk[1].cif_clk_in = devm_clk_get(dev_cif, "cif0_in"); - cif_clk[1].cif_clk_out = devm_clk_get(dev_cif, "cif0_out"); - //spin_lock_init(&cif_clk[1].lock); - cif_clk[1].on = false; - rk_camera_cif_iomux(dev_cif);/*yzm*/ - } - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - /***********yzm**********/ - dev_set_drvdata(&pdev->dev, pcdev); - pcdev->res = res; - pcdev->pdata = pdev->dev.platform_data; /* ddl@rock-chips.com : Request IO in init function */ - /*= rk_camera_platform_data */ - if (pcdev->pdata && pcdev->pdata->io_init) { - - pcdev->pdata->io_init();/* call rk_sensor_io_init()*/ - - if (pcdev->pdata->sensor_mclk == NULL) - pcdev->pdata->sensor_mclk = rk_camera_mclk_ctrl; - } - - INIT_LIST_HEAD(&pcdev->capture); - INIT_LIST_HEAD(&pcdev->camera_work_queue); - spin_lock_init(&pcdev->lock); - spin_lock_init(&pcdev->camera_work_lock); - - memset(&pcdev->cropinfo.c,0x00,sizeof(struct v4l2_rect)); - spin_lock_init(&pcdev->cropinfo.lock); - sema_init(&pcdev->zoominfo.sem,1); - - /* - * Request the regions. - */ - if(res) { - if (!request_mem_region(res->start, res->end - res->start + 1, - RK29_CAM_DRV_NAME)) { - err = -EBUSY; - goto exit_reqmem_vip; - } - pcdev->base = ioremap(res->start, res->end - res->start + 1); - if (pcdev->base == NULL) { - dev_err(pcdev->dev, "ioremap() of registers failed\n"); - err = -ENXIO; - goto exit_ioremap_vip; - } - } - - pcdev->irqinfo.irq = irq; - pcdev->dev = &pdev->dev; - - /* config buffer address */ - /* request irq */ - if(irq > 0){ - err = request_irq(pcdev->irqinfo.irq, rk_camera_irq, 0, RK29_CAM_DRV_NAME, - pcdev); - if (err) { - dev_err(pcdev->dev, "Camera interrupt register failed \n"); - goto exit_reqirq; - } - } - - if(IS_CIF0()) { - pcdev->camera_wq = create_workqueue("rk_cam_wkque_cif0"); - } else { - pcdev->camera_wq = create_workqueue("rk_cam_wkque_cif1"); - } - if (pcdev->camera_wq == NULL) { - RKCAMERA_TR("%s(%d): Create workqueue failed!\n",__FUNCTION__,__LINE__); - goto exit_free_irq; - } - - pcdev->camera_reinit_work.pcdev = pcdev; - INIT_WORK(&(pcdev->camera_reinit_work.work), rk_camera_reinit_work); - - for (i=0; i<2; i++) { - pcdev->icd_frmival[i].icd = NULL; - pcdev->icd_frmival[i].fival_list = kzalloc(sizeof(struct rk_camera_frmivalenum),GFP_KERNEL); - - } - pcdev->soc_host.drv_name = RK29_CAM_DRV_NAME; - pcdev->soc_host.ops = &rk_soc_camera_host_ops; - pcdev->soc_host.priv = pcdev; /*to itself,csll in rk_camera_add_device*/ - pcdev->soc_host.v4l2_dev.dev = &pdev->dev; - pcdev->soc_host.nr = pdev->id; - debug_printk("/$$$$$$$$$$$$$$$$$$$$$$/next soc_camera_host_register\n"); - err = soc_camera_host_register(&pcdev->soc_host); - - - if (err) { - RKCAMERA_TR("%s(%d): soc_camera_host_register failed\n",__FUNCTION__,__LINE__); - goto exit_free_irq; - } - pcdev->fps_timer.pcdev = pcdev; - hrtimer_init(&(pcdev->fps_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - pcdev->fps_timer.timer.function = rk_camera_fps_func; - pcdev->icd_cb.sensor_cb = NULL; - -#if (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_IPP) - pcdev->icd_cb.scale_crop_cb = rk_camera_scale_crop_ipp; -#elif (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_ARM) - pcdev->icd_cb.scale_crop_cb = rk_camera_scale_crop_arm; -#elif (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_RGA) - pcdev->icd_cb.scale_crop_cb = rk_camera_scale_crop_rga; -#elif(CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_PP) - pcdev->icd_cb.scale_crop_cb = rk_camera_scale_crop_pp; -#endif - return 0; - -exit_free_irq: - - for (i=0; i<2; i++) { - fival_list = pcdev->icd_frmival[i].fival_list; - fival_nxt = fival_list; - while(fival_nxt != NULL) { - fival_nxt = fival_list->nxt; - kfree(fival_list); - fival_list = fival_nxt; - } - } - - free_irq(pcdev->irqinfo.irq, pcdev); - if (pcdev->camera_wq) { - destroy_workqueue(pcdev->camera_wq); - pcdev->camera_wq = NULL; - } -exit_reqirq: - iounmap(pcdev->base); -exit_ioremap_vip: - release_mem_region(res->start, res->end - res->start + 1); -exit_reqmem_vip: - if (clk) { - if(CHIP_NAME != 3368){ - if (clk->pd_cif) - clk_put(clk->pd_cif); - } - if (clk->aclk_cif) - clk_put(clk->aclk_cif); - if (clk->hclk_cif) - clk_put(clk->hclk_cif); - if (clk->cif_clk_in) - clk_put(clk->cif_clk_in); - if (clk->cif_clk_out) - clk_put(clk->cif_clk_out); - } - kfree(pcdev); -exit_alloc: - -exit: - return err; -} - -static int __exit rk_camera_remove(struct platform_device *pdev) -{ - struct rk_camera_dev *pcdev = platform_get_drvdata(pdev); - struct resource *res; - struct rk_camera_frmivalenum *fival_list,*fival_nxt; - int i; - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - - free_irq(pcdev->irqinfo.irq, pcdev); - - if (pcdev->camera_wq) { - destroy_workqueue(pcdev->camera_wq); - pcdev->camera_wq = NULL; - } - - for (i=0; i<2; i++) { - fival_list = pcdev->icd_frmival[i].fival_list; - fival_nxt = fival_list; - while(fival_nxt != NULL) { - fival_nxt = fival_list->nxt; - kfree(fival_list); - fival_list = fival_nxt; - } - } - - soc_camera_host_unregister(&pcdev->soc_host); - - res = pcdev->res; - iounmap((void __iomem*)pcdev->base); - release_mem_region(res->start, res->end - res->start + 1); - if (pcdev->pdata && pcdev->pdata->io_deinit) { /* ddl@rock-chips.com : Free IO in deinit function */ - pcdev->pdata->io_deinit(0); - pcdev->pdata->io_deinit(1); - } - - kfree(pcdev); - - dev_info(&pdev->dev, "RK28 Camera driver unloaded\n"); - - return 0; -} - -static struct platform_driver rk_camera_driver = -{ - .driver = { - .name = RK29_CAM_DRV_NAME, /*host */ - }, - .probe = rk_camera_probe, - .remove = (rk_camera_remove), -}; - -static int rk_camera_init_async(void *unused) -{ - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - platform_driver_register(&rk_camera_driver); - return 0; -} - -static int __init rk_camera_init(void) -{ - - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); - - kthread_run(rk_camera_init_async, NULL, "rk_camera_init"); - - return 0; -} - -static void __exit rk_camera_exit(void) -{ - debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__); - - platform_driver_unregister(&rk_camera_driver); -} - -device_initcall_sync(rk_camera_init); -module_exit(rk_camera_exit); - -MODULE_DESCRIPTION("RKSoc Camera Host driver"); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); diff --git a/drivers/media/video/rk_camsys/Kconfig b/drivers/media/video/rk_camsys/Kconfig deleted file mode 100644 index b8914e70cedc..000000000000 --- a/drivers/media/video/rk_camsys/Kconfig +++ /dev/null @@ -1,22 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -config CAMSYS_DRV - tristate "camsys driver " - default n - -menu "RockChip camera system driver" - depends on CAMSYS_DRV - -source "drivers/media/video/rk_camsys/ext_flashled_drv/Kconfig" - -config CAMSYS_MRV - tristate "camsys driver for marvin isp " - default n - ---help--- - -config CAMSYS_CIF - tristate "camsys driver for cif " - default n - ---help--- - -endmenu - diff --git a/drivers/media/video/rk_camsys/Makefile b/drivers/media/video/rk_camsys/Makefile deleted file mode 100644 index 6ac6c7dff01b..000000000000 --- a/drivers/media/video/rk_camsys/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# Makefile for rockchip camsys driver -# -obj-$(CONFIG_CAMSYS_DRV) += camsys_drv.o -obj-$(CONFIG_CAMSYS_MRV) += camsys_marvin.o camsys_mipicsi_phy.o camsys_soc_priv.o -obj-$(CONFIG_CAMSYS_MRV) += camsys_soc_rk3288.o -obj-$(CONFIG_CAMSYS_MRV) += camsys_soc_rk3368.o -obj-$(CONFIG_CAMSYS_MRV) += camsys_soc_rk3366.o -obj-$(CONFIG_CAMSYS_MRV) += camsys_soc_rk3399.o -obj-$(CONFIG_CAMSYS_MRV) += camsys_soc_rk3326.o -obj-$(CONFIG_CAMSYS_CIF) += camsys_cif.o -obj-y += ext_flashled_drv/ - diff --git a/drivers/media/video/rk_camsys/camsys_cif.c b/drivers/media/video/rk_camsys/camsys_cif.c deleted file mode 100644 index fce0784e6b1c..000000000000 --- a/drivers/media/video/rk_camsys/camsys_cif.c +++ /dev/null @@ -1,385 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include "camsys_cif.h" - -static const char miscdev_cif0_name[] = CAMSYS_CIF0_DEVNAME; -static const char miscdev_cif1_name[] = CAMSYS_CIF1_DEVNAME; - -static int camsys_cif_iomux_cb(camsys_extdev_t *extdev, void *ptr) -{ - unsigned int cif_vol_sel; -#if 0 - if (extdev->dev_cfg & CAMSYS_DEVCFG_FLASHLIGHT) { - iomux_set(ISP_FLASH_TRIG); - if (extdev->fl.fl.io != 0xffffffff) { - iomux_set(ISP_FL_TRIG); - } - } - - if (extdev->dev_cfg & CAMSYS_DEVCFG_PREFLASHLIGHT) { - iomux_set(ISP_PRELIGHT_TRIG); - } - - if (extdev->dev_cfg & CAMSYS_DEVCFG_SHUTTER) { - iomux_set(ISP_SHUTTER_OPEN); - iomux_set(ISP_SHUTTER_TRIG); - } - - iomux_set(CIF0_CLKOUT); -#endif - - struct pinctrl *pinctrl; - struct pinctrl_state *state; - int retval = 0; - char state_str[20] = {0}; - - struct device *dev = &(extdev->pdev->dev); - - if (extdev->phy.type == CamSys_Phy_Cif) { - if ((extdev->phy.info.cif.fmt >= CamSys_Fmt_Raw_8b) && - (extdev->phy.info.cif.fmt <= CamSys_Fmt_Raw_12b)) { - - strcpy(state_str, "isp_dvp8bit"); - - } - - if ((extdev->phy.info.cif.fmt >= CamSys_Fmt_Raw_10b) && - (extdev->phy.info.cif.fmt <= CamSys_Fmt_Raw_12b)) { - strcpy(state_str, "isp_dvp10bit"); - } - - if (extdev->phy.info.cif.fmt == CamSys_Fmt_Raw_12b) { - strcpy(state_str, "isp_dvp12bit"); - - } - } else { - strcpy(state_str, "default"); - } - - /*mux CIF0_CLKOUT*/ - - pinctrl = devm_pinctrl_get(dev); - if (IS_ERR(pinctrl)) { - camsys_err("%s:Get pinctrl failed!\n", __func__); - return -1; - } - state = pinctrl_lookup_state(pinctrl, - state_str); - if (IS_ERR(state)) { - dev_err(dev, - "%s:could not get %s pinstate\n", - __func__, state_str); - return -1; - } - - if (!IS_ERR(state)) { - retval = pinctrl_select_state(pinctrl, state); - if (retval) { - dev_err(dev, - "%s:could not set %s pins\n", - __func__, state_str); - return -1; - - } - } - - /*set 1.8v vol domain for rk32*/ - __raw_writel(((1<<1)|(1<<(1+16))), RK_GRF_VIRT+0x0380); - __raw_writel(0xffffffff, RK_GRF_VIRT+0x01d4); - - /*set cif vol domain*/ - if (extdev->phy.type == CamSys_Phy_Cif) { - - #if 0 - if (!IS_ERR_OR_NULL(extdev->dovdd.ldo)) { - if (extdev->dovdd.max_uv >= 25000000) { - __raw_writel(((1<<1)|(1<<(1+16))), - RK30_GRF_BASE+0x018c); - } else { - __raw_writel((1<<(1+16)), RK30_GRF_BASE+0x018c); - } - } else { - __raw_writel(((1<<1)|(1<<(1+16))), - RK30_GRF_BASE+0x018c); - } - #else - - /*set 1.8v vol domain*/ - __raw_writel(((1<<1)|(1<<(1+16))), RK_GRF_VIRT+0x0380); - #endif - - /*set driver strength*/ - /* __raw_writel(0xffffffff, RK_GRF_VIRT+0x01dc);*/ - } - - return 0; -} -static int camsys_cif_clkin_cb(void *ptr, unsigned int on) -{ - camsys_dev_t *camsys_dev = (camsys_dev_t *)ptr; - camsys_cif_clk_t *clk = (camsys_cif_clk_t *)camsys_dev->clk; - - spin_lock(&clk->lock); - if (on && !clk->in_on) { - clk_prepare_enable(clk->aclk_cif); - clk_prepare_enable(clk->hclk_cif); - clk_prepare_enable(clk->cif_clk_in); - - clk->in_on = true; - camsys_trace(1, "%s clock in turn on", - dev_name(camsys_dev->miscdev.this_device)); - } else if (!on && clk->in_on) { - clk_disable_unprepare(clk->hclk_cif); - clk_disable_unprepare(clk->cif_clk_in); - clk_disable_unprepare(clk->pd_cif); - clk->in_on = false; - camsys_trace(1, "%s clock in turn off", - dev_name(camsys_dev->miscdev.this_device)); - } - spin_unlock(&clk->lock); - return 0; -} - -static int camsys_cif_clkout_cb(void *ptr, unsigned int on, unsigned int clkin) -{ - camsys_dev_t *camsys_dev = (camsys_dev_t *)ptr; - camsys_cif_clk_t *clk = (camsys_cif_clk_t *)camsys_dev->clk; - struct clk *cif_clk_out_div; - - spin_lock(&clk->lock); - if (on && (clk->out_on != on)) { - clk_prepare_enable(clk->cif_clk_out); - clk_set_rate(clk->cif_clk_out, clkin); - - clk->out_on = on; - camsys_trace(1, "%s clock out(rate: %dHz) turn on", - dev_name(camsys_dev->miscdev.this_device), - clk->out_on); - } else if (!on && clk->out_on) { - if (strcmp(dev_name(camsys_dev->miscdev.this_device), - miscdev_cif1_name) == 0) { - cif_clk_out_div = clk_get(NULL, "cif1_out_div"); - } else{ - cif_clk_out_div = clk_get(NULL, "cif0_out_div"); - if (IS_ERR_OR_NULL(cif_clk_out_div)) { - cif_clk_out_div = - clk_get(NULL, "cif_out_div"); - } - } - - if (!IS_ERR_OR_NULL(cif_clk_out_div)) { - clk_set_parent(clk->cif_clk_out, cif_clk_out_div); - clk_put(cif_clk_out_div); - } else { - camsys_warn("%s clock out may be not off!", - dev_name(camsys_dev->miscdev.this_device)); - } - clk_disable_unprepare(clk->cif_clk_out); - clk->out_on = 0; - - camsys_trace(1, "%s clock out turn off", - dev_name(camsys_dev->miscdev.this_device)); - } - spin_unlock(&clk->lock); - - /* __raw_writel(0x00, CRU_PCLK_REG30+RK30_CRU_BASE);*/ - - return 0; -} - -static irqreturn_t camsys_cif_irq(int irq, void *data) -{ - camsys_dev_t *camsys_dev = (camsys_dev_t *)data; - camsys_irqstas_t *irqsta; - camsys_irqpool_t *irqpool; - unsigned int intsta, frmsta; - - intsta = __raw_readl(camsys_dev->devmems.registermem->vir_base + - CIF_INITSTA); - frmsta = __raw_readl(camsys_dev->devmems.registermem->vir_base + - CIF_FRAME_STATUS); - printk("get oneframe, intsta = 0x%x \n", intsta); - - if (intsta & 0x200) { - __raw_writel(0x200, - camsys_dev->devmems.registermem->vir_base + - CIF_INITSTA); - __raw_writel(0xf000, - camsys_dev->devmems.registermem->vir_base + - CIF_CTRL); - } - - if (intsta &0x01) { - __raw_writel(0x01, - camsys_dev->devmems.registermem->vir_base + - CIF_INITSTA); - __raw_writel(0x02, - camsys_dev->devmems.registermem->vir_base + - CIF_FRAME_STATUS); - __raw_writel(0xf001, - camsys_dev->devmems.registermem->vir_base + - CIF_CTRL); - } - - spin_lock(&camsys_dev->irq.lock); - list_for_each_entry(irqpool, &camsys_dev->irq.irq_pool, list) { - spin_lock(&irqpool->lock); - if (!list_empty(&irqpool->deactive)) { - irqsta = list_first_entry - (&irqpool->deactive, camsys_irqstas_t, list); - irqsta->sta.mis = intsta; - irqsta->sta.ris = intsta; - list_del_init(&irqsta->list); - list_add_tail(&irqsta->list, &irqpool->active); - irqsta = list_first_entry - (&irqpool->active, camsys_irqstas_t, list); - /*wake_up_all(&camsys_dev->irq.irq_done);*/ - wake_up(&irqpool->done); - } - spin_unlock(&irqpool->lock); - } - spin_unlock(&camsys_dev->irq.lock); - - return IRQ_HANDLED; -} - -static int camsys_cif_remove(struct platform_device *pdev) -{ - camsys_dev_t *camsys_dev = platform_get_drvdata(pdev); - camsys_cif_clk_t *cif_clk; - - if (camsys_dev->clk != NULL) { - cif_clk = (camsys_cif_clk_t *)camsys_dev->clk; - if (cif_clk->out_on) - camsys_cif_clkout_cb(camsys_dev->clk, 0, 0); - if (cif_clk->in_on) - camsys_cif_clkin_cb(camsys_dev->clk, 0); - - if (cif_clk->pd_cif) - clk_put(cif_clk->pd_cif); - if (cif_clk->aclk_cif) - clk_put(cif_clk->aclk_cif); - if (cif_clk->hclk_cif) - clk_put(cif_clk->hclk_cif); - if (cif_clk->cif_clk_in) - clk_put(cif_clk->cif_clk_in); - if (cif_clk->cif_clk_out) - clk_put(cif_clk->cif_clk_out); - - kfree(cif_clk); - cif_clk = NULL; - } - - return 0; -} - -int camsys_cif_probe_cb(struct platform_device *pdev, camsys_dev_t *camsys_dev) -{ - int err = 0; - camsys_cif_clk_t *cif_clk; - - /*Irq init*/ - err = request_irq(camsys_dev->irq.irq_id, - camsys_cif_irq, 0, CAMSYS_CIF_IRQNAME, - camsys_dev); - if (err) { - camsys_err("request irq for %s failed", CAMSYS_CIF_IRQNAME); - goto end; - } - - /*Clk and Iomux init*/ - cif_clk = kzalloc(sizeof(camsys_cif_clk_t), GFP_KERNEL); - if (cif_clk == NULL) { - camsys_err("Allocate camsys_cif_clk_t failed!"); - err = -EINVAL; - goto end; - } - - if (strcmp(dev_name(&pdev->dev), CAMSYS_PLATFORM_CIF1_NAME) == 0) { - cif_clk->aclk_cif = devm_clk_get(&pdev->dev, "g_aclk_vip"); - cif_clk->hclk_cif = devm_clk_get(&pdev->dev, "g_hclk_vip"); - cif_clk->cif_clk_in = devm_clk_get(&pdev->dev, "g_pclkin_cif"); - cif_clk->cif_clk_out = devm_clk_get(&pdev->dev, "clk_cif_out"); - spin_lock_init(&cif_clk->lock); - cif_clk->in_on = false; - cif_clk->out_on = false; - } else { - cif_clk->aclk_cif = devm_clk_get(&pdev->dev, "g_aclk_vip"); - cif_clk->hclk_cif = devm_clk_get(&pdev->dev, "g_hclk_vip"); - cif_clk->cif_clk_in = devm_clk_get(&pdev->dev, "g_pclkin_ci"); - cif_clk->cif_clk_out = devm_clk_get(&pdev->dev, "clk_cif_out"); - spin_lock_init(&cif_clk->lock); - cif_clk->in_on = false; - cif_clk->out_on = false; - } - - /* - *clk_prepare_enable(cif_clk->aclk_cif); - clk_prepare_enable(cif_clk->hclk_cif); - clk_prepare_enable(cif_clk->cif_clk_in); - clk_prepare_enable(cif_clk->cif_clk_out); - */ - - camsys_dev->clk = (void *)cif_clk; - camsys_dev->clkin_cb = camsys_cif_clkin_cb; - camsys_dev->clkout_cb = camsys_cif_clkout_cb; - camsys_dev->iomux = camsys_cif_iomux_cb; - - /*Misc device init*/ - camsys_dev->miscdev.minor = MISC_DYNAMIC_MINOR; - if (strcmp(dev_name(&pdev->dev), CAMSYS_PLATFORM_CIF1_NAME) == 0) { - camsys_dev->miscdev.name = miscdev_cif1_name; - camsys_dev->miscdev.nodename = miscdev_cif1_name; - } else { - camsys_dev->miscdev.name = miscdev_cif0_name; - camsys_dev->miscdev.nodename = miscdev_cif0_name; - } - camsys_dev->miscdev.fops = &camsys_fops; - err = misc_register(&camsys_dev->miscdev); - if (err < 0) { - camsys_trace(1, - "Register /dev/%s misc device failed", - camsys_dev->miscdev.name); - goto misc_register_failed; - } else { - camsys_trace(1, - "Register /dev/%s misc device success", - camsys_dev->miscdev.name); - } - - /*Variable init*/ - if (strcmp(dev_name(&pdev->dev), CAMSYS_PLATFORM_CIF1_NAME) == 0) { - camsys_dev->dev_id = CAMSYS_DEVID_CIF_1; - } else { - camsys_dev->dev_id = CAMSYS_DEVID_CIF_0; - } - camsys_dev->platform_remove = camsys_cif_remove; - - return 0; - -misc_register_failed: - if (!IS_ERR(camsys_dev->miscdev.this_device)) { - misc_deregister(&camsys_dev->miscdev); - } - - if (cif_clk) { - - if (cif_clk->pd_cif) - clk_put(cif_clk->pd_cif); - if (cif_clk->aclk_cif) - clk_put(cif_clk->aclk_cif); - if (cif_clk->hclk_cif) - clk_put(cif_clk->hclk_cif); - if (cif_clk->cif_clk_in) - clk_put(cif_clk->cif_clk_in); - if (cif_clk->cif_clk_out) - clk_put(cif_clk->cif_clk_out); - - kfree(cif_clk); - cif_clk = NULL; - } - -end: - return err; -} -EXPORT_SYMBOL_GPL(camsys_cif_probe_cb); - diff --git a/drivers/media/video/rk_camsys/camsys_cif.h b/drivers/media/video/rk_camsys/camsys_cif.h deleted file mode 100644 index bd8f24c8533a..000000000000 --- a/drivers/media/video/rk_camsys/camsys_cif.h +++ /dev/null @@ -1,64 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __CAMSYS_CIF_H__ -#define __CAMSYS_CIF_H__ - -#include "camsys_internal.h" - -#define CAMSYS_CIF_IRQNAME "CifIrq" - - -#define CIF_BASE 0x00 -#define CIF_CTRL (CIF_BASE) -#define CIF_INITSTA (CIF_BASE+0x08) -#define CIF_FRAME_STATUS (CIF_BASE+0x60) -#define CIF_LAST_LINE (CIF_BASE+0x68) -#define CIF_LAST_PIX (CIF_BASE+0x6c) -#define CRU_PCLK_REG30 0xbc - - -#if defined(CONFIG_ARCH_RK3066B) || defined(CONFIG_ARCH_RK3188) \ - || defined(CONFIG_ARCH_ROCKCHIP) -/*GRF_IO_CON3 0x100*/ -#define CIF_DRIVER_STRENGTH_2MA (0x00 << 12) -#define CIF_DRIVER_STRENGTH_4MA (0x01 << 12) -#define CIF_DRIVER_STRENGTH_8MA (0x02 << 12) -#define CIF_DRIVER_STRENGTH_12MA (0x03 << 12) -#define CIF_DRIVER_STRENGTH_MASK (0x03 << 28) - -/*GRF_IO_CON4 0x104*/ -#define CIF_CLKOUT_AMP_3V3 (0x00 << 10) -#define CIF_CLKOUT_AMP_1V8 (0x01 << 10) -#define CIF_CLKOUT_AMP_MASK (0x01 << 26) - -#define write_grf_reg(addr, val) \ - __raw_writel(val, addr+RK_GRF_VIRT) -#define read_grf_reg(addr) \ - __raw_readl(addr+RK_GRF_VIRT) -#define mask_grf_reg(addr, msk, val) \ - write_grf_reg(addr, (val)|((~(msk))&read_grf_reg(addr))) -#else -#define write_grf_reg(addr, val) -#define read_grf_reg(addr) 0 -#define mask_grf_reg(addr, msk, val) -#endif - - -typedef struct camsys_cif_clk_s { - struct clk *pd_cif; - struct clk *aclk_cif; - struct clk *hclk_cif; - struct clk *cif_clk_in; - bool in_on; - - struct clk *cif_clk_out; - unsigned int out_on; - - spinlock_t lock; -} camsys_cif_clk_t; - - -int camsys_cif_probe_cb( -struct platform_device *pdev, camsys_dev_t *camsys_dev); - -#endif - diff --git a/drivers/media/video/rk_camsys/camsys_drv.c b/drivers/media/video/rk_camsys/camsys_drv.c deleted file mode 100644 index ba47c656ed62..000000000000 --- a/drivers/media/video/rk_camsys/camsys_drv.c +++ /dev/null @@ -1,1737 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include - -#include "camsys_cif.h" -#include "camsys_marvin.h" -#include "camsys_mipicsi_phy.h" -#include "camsys_gpio.h" -#include "camsys_soc_priv.h" -#include "ext_flashled_drv/rk_ext_fshled_ctl.h" - -unsigned int camsys_debug = 0; -module_param(camsys_debug, int, S_IRUGO|S_IWUSR); -static int drv_version = CAMSYS_DRIVER_VERSION; -module_param(drv_version, int, S_IRUGO); -static int head_version = CAMSYS_HEAD_VERSION; -module_param(head_version, int, S_IRUGO); - - -typedef struct camsys_devs_s { - spinlock_t lock; - struct list_head devs; -} camsys_devs_t; - -static camsys_devs_t camsys_devs; - -static int camsys_i2c_write(camsys_i2c_info_t *i2cinfo, camsys_dev_t - *camsys_dev) -{ - int err = 0, i, j; - unsigned char buf[8], *bufp; - unsigned short msg_times, totallen, onelen; - struct i2c_msg msg[1]; - struct i2c_adapter *adapter; - - adapter = i2c_get_adapter(i2cinfo->bus_num); - if (adapter == NULL) { - camsys_err("Get %d i2c adapter is failed!", i2cinfo->bus_num); - err = -EINVAL; - goto end; - } - - if (i2cinfo->i2cbuf_directly) { - if (camsys_dev->devmems.i2cmem == NULL) { - camsys_err("%s has not i2c mem, it isn't support i2c buf write!", - dev_name(camsys_dev->miscdev.this_device)); - err = -EINVAL; - goto end; - } - totallen = (i2cinfo->i2cbuf_bytes & 0xffff); - onelen = (i2cinfo->i2cbuf_bytes & 0xffff0000)>>16; - msg_times = totallen/onelen; - if (totallen > camsys_dev->devmems.i2cmem->size) { - camsys_err( - "Want to write 0x%x bytes, i2c memory(size: 0x%x) is overlap", - totallen, camsys_dev->devmems.i2cmem->size); - err = -EINVAL; - goto end; - } - bufp = (unsigned char *)camsys_dev->devmems.i2cmem->vir_base; - } else { - for (i = 0; i < i2cinfo->reg_size; i++) { - buf[i] = (i2cinfo->reg_addr >> - ((i2cinfo->reg_size-1-i)*8))&0xff; - } - for (j = 0; j < i2cinfo->val_size; j++) { - /* ddl@rock-chips.com: v0.a.0 */ - buf[i+j] = (i2cinfo->val >> - ((i2cinfo->val_size-1-j)*8))&0xff; - } - bufp = buf; - onelen = i2cinfo->val_size + i2cinfo->reg_size; - msg_times = 1; - } - - err = -EAGAIN; - msg->addr = (i2cinfo->slave_addr >> 1); - msg->flags = 0; - msg->len = onelen; - for (i = 0; i < msg_times; i++) { - msg->buf = bufp + i * onelen; - err = i2c_transfer(adapter, msg, 1); - if (err < 0) { - camsys_err("i2c write dev(addr:0x%x) failed!,err = %d", - i2cinfo->slave_addr, err); - udelay(10); - } - } - -end: - return err; -} - -static int camsys_i2c_read( -camsys_i2c_info_t *i2cinfo, camsys_dev_t *camsys_dev) -{ - int err = 0, i, retry = 2, tmp, num_msg; - unsigned char buf[8]; - struct i2c_msg msg[2]; - struct i2c_adapter *adapter; - - adapter = i2c_get_adapter(i2cinfo->bus_num); - if (adapter == NULL) { - camsys_err("Get %d i2c adapter is failed!", i2cinfo->bus_num); - err = -EINVAL; - goto end; - } - - num_msg = 0; - if (i2cinfo->reg_size) { - for (i = 0; i < i2cinfo->reg_size; i++) { - buf[i] = (i2cinfo->reg_addr>>((i2cinfo->reg_size-1-i)*8))&0xff; - } - - msg[0].addr = (i2cinfo->slave_addr>>1); - msg[0].flags = 0; - msg[0].buf = buf; - msg[0].len = i2cinfo->reg_size; - num_msg++; - } - - msg[1].addr = (i2cinfo->slave_addr>>1); - msg[1].flags = I2C_M_RD; - msg[1].buf = buf; - msg[1].len = (unsigned short)i2cinfo->val_size; - err = -EAGAIN; - num_msg++; - - while ((retry-- > 0) && (err < 0)) { - if (num_msg == 1) { - err = i2c_transfer(adapter, &msg[1], num_msg); - } else { - err = i2c_transfer(adapter, msg, num_msg); - } - - if (err >= 0) { - err = 0; - } else { - camsys_err("i2c read dev(addr:0x%x) failed,try" - "again-%d!", i2cinfo->slave_addr, retry); - udelay(10); - } - } - - if (err == 0) { - i2cinfo->val = 0x00; - for (i = 0; i < i2cinfo->val_size; i++) { - tmp = buf[i]; - i2cinfo->val |= (tmp<<((i2cinfo->val_size-1-i)*8)); - } - } - -end: - return err; -} - -static int camsys_extdev_register(camsys_devio_name_t *devio, camsys_dev_t - *camsys_dev) -{ - int err = 0, i; - camsys_extdev_t *extdev; - camsys_regulator_info_t *regulator_info; - camsys_regulator_t *regulator; - camsys_gpio_info_t *gpio_info; - camsys_gpio_t *gpio; - - if ((devio->dev_id & CAMSYS_DEVID_EXTERNAL) == 0) { - err = -EINVAL; - camsys_err("dev_id: 0x%x is not support for camsys!", - devio->dev_id); - goto end; - } - - extdev = camsys_find_extdev(devio->dev_id, camsys_dev); - if (extdev != NULL) { - if (strcmp(extdev->dev_name, devio->dev_name) == 0) { - err = 0; - } else { - err = -EINVAL; - camsys_warn( - "Extdev(dev_id: 0x%x dev_name: %s) has been registered in %s!", - extdev->dev_id, - extdev->dev_name, - dev_name(camsys_dev->miscdev.this_device)); - } - goto end; - } - - extdev = kzalloc(sizeof(camsys_extdev_t), GFP_KERNEL); - if (extdev == NULL) { - camsys_err("alloc camsys_extdev_t failed!"); - err = -ENOMEM; - goto end; - } - - extdev->dev_cfg = devio->dev_cfg; - extdev->fl.fl.active = devio->fl.fl.active; - extdev->fl.ext_fsh_dev = NULL; - - if (strlen(devio->fl.fl_drv_name) && - (strcmp(devio->fl.fl_drv_name, "Internal") != 0) - && (strcmp(devio->fl.fl_drv_name, "NC") != 0)) { - - extdev->fl.ext_fsh_dev = - camsys_register_ext_fsh_dev(&devio->fl); - if (extdev->fl.ext_fsh_dev == NULL) { - camsys_err("register ext flash %s failed!", - devio->fl.fl_drv_name); - err = -EINVAL; - goto fail; - } - } - regulator_info = &devio->avdd; - regulator = &extdev->avdd; - for (i = (CamSys_Vdd_Start_Tag+1); i < CamSys_Vdd_End_Tag; i++) { - if (strcmp(regulator_info->name, "NC")) { - regulator->ldo = - regulator_get(NULL, regulator_info->name); - if (IS_ERR_OR_NULL(regulator->ldo)) { - camsys_err( - "Get %s regulator for dev_id 0x%x failed!", - regulator_info->name, devio->dev_id); - err = -EINVAL; - goto fail; - } - - regulator->min_uv = regulator_info->min_uv; - regulator->max_uv = regulator_info->max_uv; - camsys_trace(1, - "Get %s regulator(min: %duv max: %duv) for dev_id 0x%x success", - regulator_info->name, regulator->min_uv, - regulator->max_uv, - devio->dev_id); - } else { - regulator->ldo = NULL; - regulator->min_uv = 0; - regulator->max_uv = 0; - } - - regulator++; - regulator_info++; - } - - gpio_info = &devio->pwrdn; - gpio = &extdev->pwrdn; - for (i = (CamSys_Gpio_Start_Tag+1); i < CamSys_Gpio_End_Tag; i++) { - if (strcmp(gpio_info->name, "NC")) { - gpio->io = camsys_gpio_get(gpio_info->name); - if (!gpio_is_valid(gpio->io)) { - camsys_err( - "Get %s gpio for dev_id 0x%x failed!", - gpio_info->name, - devio->dev_id); - err = -EINVAL; - goto fail; - } - if (gpio_request(gpio->io, "camsys_gpio") < 0) { - camsys_err("Request %s(%d) failed", - gpio_info->name, gpio->io); - } - gpio->active = gpio_info->active; - camsys_trace(1, - "Get %s(%d) gpio(active: %d) for dev_id 0x%x success!", - gpio_info->name, gpio->io, - gpio->active, devio->dev_id); - } else { - gpio->io = 0xffffffff; - gpio->active = 0xffffffff; - } - - gpio++; - gpio_info++; - } - - extdev->pdev = camsys_dev->pdev; - extdev->phy = devio->phy; - extdev->clk = devio->clk; - extdev->dev_id = devio->dev_id; - mutex_lock(&camsys_dev->extdevs.mut); - list_add_tail(&extdev->list, &camsys_dev->extdevs.list); - mutex_unlock(&camsys_dev->extdevs.mut); - - camsys_dev->iomux(extdev, (void *)camsys_dev); - - memcpy(extdev->dev_name, devio->dev_name, sizeof(extdev->dev_name)); - camsys_trace(1, "Extdev(dev_id: 0x%x dev_name: %s) register success", - extdev->dev_id, - extdev->dev_name); - - return 0; -fail: - if (extdev) { - kfree(extdev); - extdev = NULL; - } -end: - - return err; -} - -static int camsys_extdev_deregister(unsigned int dev_id, camsys_dev_t - *camsys_dev, bool all) -{ - int err = 0, i; - camsys_extdev_t *extdev; - camsys_regulator_t *regulator; - camsys_gpio_t *gpio; - - if (all == false) { - if ((dev_id & CAMSYS_DEVID_EXTERNAL) == 0) { - err = -EINVAL; - camsys_err("dev_id: 0x%x is not support for %s!", - dev_id, - dev_name(camsys_dev->miscdev.this_device)); - goto end; - } - - extdev = camsys_find_extdev(dev_id, camsys_dev); - if (extdev == NULL) { - err = -EINVAL; - camsys_warn("Extdev(dev_id: 0x%x) isn't registered in %s!", - dev_id, - dev_name(camsys_dev->miscdev.this_device)); - goto end; - } - - regulator = &extdev->avdd; - for (i = (CamSys_Vdd_Start_Tag + 1); - i < CamSys_Vdd_End_Tag; i++) { - if (!IS_ERR_OR_NULL(regulator->ldo)) { - while (regulator_is_enabled(regulator->ldo) > 0) - regulator_disable(regulator->ldo); - regulator_put(regulator->ldo); - } - regulator++; - } - - gpio = &extdev->pwrdn; - for (i = (CamSys_Gpio_Start_Tag + 1); - i < CamSys_Gpio_End_Tag; i++) { - if (gpio->io != 0xffffffff) { - gpio_free(gpio->io); - } - gpio++; - } - - if (extdev->fl.ext_fsh_dev != NULL) { - camsys_deregister_ext_fsh_dev(extdev->fl.ext_fsh_dev); - } - /* spin_lock(&camsys_dev->lock); */ - mutex_lock(&camsys_dev->extdevs.mut); - list_del_init(&extdev->list); - list_del_init(&extdev->active); - /* spin_unlock(&camsys_dev->lock); */ - mutex_unlock(&camsys_dev->extdevs.mut); - - camsys_trace(1, "Extdev(dev_id: 0x%x) is deregister success", - extdev->dev_id); - kfree(extdev); - extdev = NULL; - - } else { - /* spin_lock(&camsys_dev->lock); */ - mutex_lock(&camsys_dev->extdevs.mut); - while (!list_empty(&camsys_dev->extdevs.list)) { - extdev = list_first_entry(&camsys_dev->extdevs.list, - camsys_extdev_t, - list); - if (extdev) { - regulator = &extdev->avdd; - for (i = (CamSys_Vdd_Start_Tag+1); - i < CamSys_Vdd_End_Tag; i++) { - if (!IS_ERR(regulator->ldo)) { - while ( - regulator_is_enabled( - regulator->ldo) > 0) - regulator_disable( - regulator->ldo); - regulator_put( - regulator->ldo); - } - regulator++; - } - - gpio = &extdev->pwrdn; - for (i = (CamSys_Gpio_Start_Tag+1); - i < CamSys_Gpio_End_Tag; i++) { - if (gpio->io != 0xffffffff) { - gpio_free(gpio->io); - } - gpio++; - } - - if (extdev->fl.ext_fsh_dev != NULL) { - camsys_deregister_ext_fsh_dev( - extdev->fl.ext_fsh_dev); - } - camsys_trace(1, - "Extdev(dev_id: 0x%x) is deregister success", - extdev->dev_id); - list_del_init(&extdev->list); - list_del_init(&extdev->active); - kfree(extdev); - extdev = NULL; - } - } - /* spin_unlock(&camsys_dev->lock); */ - mutex_unlock(&camsys_dev->extdevs.mut); - camsys_trace(1, "All extdev is deregister success!"); - } - -end: - return err; - -} -static int camsys_sysctl_external(camsys_sysctrl_t *devctl, - camsys_dev_t *camsys_dev) -{ - int i; - int err = 0; - camsys_extdev_t *extdev, *extdev2; - - /* External */ - for (i = 0; i < 8; i++) { - if ((devctl->dev_mask & (1<<(i+24))) == 0) - continue; - - extdev = camsys_find_extdev((1 << (i+24)), camsys_dev); - if (!extdev) { - camsys_err("Can not find dev_id 0x%x device in %s!", - (1<<(i+24)), - dev_name(camsys_dev->miscdev.this_device)); - return -EINVAL; - } - camsys_sysctl_extdev( - extdev, devctl, camsys_dev); - - if (devctl->ops == CamSys_ClkIn) { - if (devctl->on) { - list_add_tail(&extdev->active, - &camsys_dev->extdevs.active); - } else { - if (list_empty( - &camsys_dev->extdevs.active)) - continue; - - list_for_each_entry(extdev2, - &camsys_dev->extdevs.active, - active) { - if (extdev2 == extdev) { - list_del_init(&extdev->active); - break; - } - } - } - } else if (devctl->ops == CamSys_Flash_Trigger) { - err = camsys_ext_fsh_ctrl(extdev->fl.ext_fsh_dev, - devctl->rev[0], devctl->on); - } - } - - return 0; -} -static int camsys_sysctl(camsys_sysctrl_t *devctl, camsys_dev_t *camsys_dev) -{ - int err = 0; - - /* spin_lock(&camsys_dev->lock); */ - mutex_lock(&camsys_dev->extdevs.mut); - - /* Internal */ - if (camsys_dev->dev_id & devctl->dev_mask) { - switch (devctl->ops) { - case CamSys_ClkIn: { - camsys_dev->clkin_cb(camsys_dev, devctl->on); - break; - } - - case CamSys_Rst: { - camsys_dev->reset_cb(camsys_dev, devctl->on); - break; - } - case CamSys_Flash_Trigger: { - camsys_dev->flash_trigger_cb( - camsys_dev, devctl->rev[0], devctl->on); - break; - } - case CamSys_IOMMU: { - if (camsys_dev->iommu_cb(camsys_dev, devctl) < 0) { - err = -1; - } - break; - } - default: - break; - - } - } - - camsys_sysctl_external(devctl, camsys_dev); - - /* spin_unlock(&camsys_dev->lock); */ - mutex_unlock(&camsys_dev->extdevs.mut); - return err; -} - -static int camsys_phy_ops(camsys_extdev_t *extdev, camsys_sysctrl_t *devctl, - void *ptr) -{ - camsys_dev_t *camsys_dev = (camsys_dev_t *)ptr; - camsys_mipiphy_t *mipiphy; - int err = 0; - - if (extdev->phy.type == CamSys_Phy_Mipi) { - mipiphy = (camsys_mipiphy_t *)devctl->rev; - if (devctl->on == 0) { - mipiphy->phy_index = extdev->phy.info.mipi.phy_index; - mipiphy->bit_rate = 0; - mipiphy->data_en_bit = 0x00; - } else { - if ((mipiphy->bit_rate == 0) || - (mipiphy->data_en_bit == 0)) { - *mipiphy = extdev->phy.info.mipi; - } - if (mipiphy->phy_index != - extdev->phy.info.mipi.phy_index) { - camsys_warn( - "mipiphy->phy_index(%d) != " - "extdev->phy.info.mipi.phy_index(%d)!", - mipiphy->phy_index, - extdev->phy.info.mipi.phy_index); - mipiphy->phy_index = - extdev->phy.info.mipi.phy_index; - } - } - err = camsys_dev->mipiphy[mipiphy->phy_index].ops(ptr, mipiphy); - if (err < 0) { - camsys_err("extdev(0x%x) mipi phy ops config failed!", - extdev->dev_id); - } - } - - return err; -} - -static int camsys_irq_connect(camsys_irqcnnt_t *irqcnnt, camsys_dev_t - *camsys_dev) -{ - int err = 0, i; - bool find_pool = false; - camsys_irqpool_t *irqpool, *n; - unsigned long int flags; - - if ((irqcnnt->mis != MRV_ISP_MIS) && - (irqcnnt->mis != MRV_MIPI_MIS) && - (irqcnnt->mis != MRV_MI_MIS) && - (irqcnnt->mis != MRV_JPG_MIS) && - (irqcnnt->mis != MRV_JPG_ERR_MIS)) { - - camsys_err("this thread(pid: %d) irqcnnt->mis(0x%x) is invalidate," - "irq connect failed!", - irqcnnt->pid, irqcnnt->mis); - - err = -EINVAL; - goto end; - } - - spin_lock_irqsave(&camsys_dev->irq.lock, flags); - if (!list_empty(&camsys_dev->irq.irq_pool)) { - list_for_each_entry_safe(irqpool, n, - &camsys_dev->irq.irq_pool, list) { - if (irqpool->pid == -1) { - list_del_init(&irqpool->list); - kfree(irqpool); - irqpool = NULL; - } else { - if (irqpool->pid == irqcnnt->pid) - find_pool = true; - } - } - } - spin_unlock_irqrestore(&camsys_dev->irq.lock, flags); - - if (find_pool) { - camsys_warn("this thread(pid: %d) had been connect irq!", - irqcnnt->pid); - goto end; - } - - irqpool = kzalloc(sizeof(camsys_irqpool_t), GFP_KERNEL); - if (!irqpool) { - err = -ENOMEM; - goto end; - } - if (irqpool) { - spin_lock_init(&irqpool->lock); - irqpool->pid = irqcnnt->pid; - irqpool->timeout = irqcnnt->timeout; - irqpool->mis = irqcnnt->mis; - irqpool->icr = irqcnnt->icr; - INIT_LIST_HEAD(&irqpool->active); - INIT_LIST_HEAD(&irqpool->deactive); - init_waitqueue_head(&irqpool->done); - for (i = 0; - i < CAMSYS_IRQPOOL_NUM; - i++) { - list_add_tail(&irqpool->pool[i].list, - &irqpool->deactive); - } - } - - spin_lock_irqsave(&camsys_dev->irq.lock, flags); - list_add_tail(&irqpool->list, &camsys_dev->irq.irq_pool); - spin_unlock_irqrestore(&camsys_dev->irq.lock, flags); - camsys_trace(1, - "Thread(pid: %d) connect %s irq success! mis: 0x%x icr: 0x%x", - irqpool->pid, dev_name(camsys_dev->miscdev.this_device), - irqpool->mis, irqpool->icr); - -end: - return err; -} -static int active_list_isnot_empty(camsys_irqpool_t *irqpool) -{ - int err; - unsigned long int flags; - - spin_lock_irqsave(&irqpool->lock, flags); - err = list_empty(&irqpool->active); - spin_unlock_irqrestore(&irqpool->lock, flags); - - return !err; -} -static int camsys_irq_wait(camsys_irqsta_t *irqsta, camsys_dev_t *camsys_dev) -{ - int err = 0; - bool find_pool = false; - camsys_irqstas_t *irqstas; - camsys_irqpool_t *irqpool; - unsigned long int flags; - - spin_lock_irqsave(&camsys_dev->irq.lock, flags); - if (!list_empty(&camsys_dev->irq.irq_pool)) { - list_for_each_entry(irqpool, &camsys_dev->irq.irq_pool, list) { - if (irqpool->pid == irqsta->pid) { - find_pool = true; - break; - } - } - } - spin_unlock_irqrestore(&camsys_dev->irq.lock, flags); - - if (find_pool == false) { - camsys_err( - "this thread(pid: %d) hasn't been connect irq, so wait irq failed!", - irqsta->pid); - err = -EINVAL; - goto end; - } - - spin_lock_irqsave(&irqpool->lock, flags); - if (!list_empty(&irqpool->active)) { - irqstas = list_first_entry(&irqpool->active, - camsys_irqstas_t, list); - *irqsta = irqstas->sta; - list_del_init(&irqstas->list); - list_add_tail(&irqstas->list, &irqpool->deactive); - spin_unlock_irqrestore(&irqpool->lock, flags); - } else { - spin_unlock_irqrestore(&irqpool->lock, flags); - - wait_event_interruptible_timeout(irqpool->done, - active_list_isnot_empty(irqpool), - usecs_to_jiffies(irqpool->timeout)); - - if (irqpool->pid == irqsta->pid) { - if (active_list_isnot_empty(irqpool)) { - spin_lock_irqsave(&irqpool->lock, flags); - irqstas = list_first_entry( - &irqpool->active, - camsys_irqstas_t, list); - *irqsta = irqstas->sta; - list_del_init(&irqstas->list); - list_add_tail( - &irqstas->list, - &irqpool->deactive); - spin_unlock_irqrestore(&irqpool->lock, flags); - } else { - err = -EAGAIN; - } - } else { - camsys_warn( - "Thread(pid: %d) has been disconnect!", - irqsta->pid); - err = -EAGAIN; - } - } - - if (err == 0) { - camsys_trace(3, - "Thread(pid: %d) has been wake up for irq(mis: 0x%x ris:0x%x)!", - irqsta->pid, irqsta->mis, irqsta->ris); - } - -end: - return err; -} - -static int camsys_irq_disconnect(camsys_irqcnnt_t *irqcnnt, camsys_dev_t -*camsys_dev, bool all) -{ - int err = 0; - bool find_pool = false; - camsys_irqpool_t *irqpool; - unsigned long int flags; - - if (all == false) { - spin_lock_irqsave(&camsys_dev->irq.lock, flags); - if (!list_empty(&camsys_dev->irq.irq_pool)) { - list_for_each_entry(irqpool, &camsys_dev->irq.irq_pool, list) { - if (irqpool->pid == irqcnnt->pid) { - find_pool = true; - irqpool->pid = -1; - break; - } - } - } - spin_unlock_irqrestore(&camsys_dev->irq.lock, flags); - - if (find_pool == false) { - camsys_err( - "this thread(pid: %d) have not been connect irq!" - "disconnect failed", - irqcnnt->pid); - } else { - wake_up_all(&irqpool->done); - } - - camsys_trace(1, "Thread(pid: %d) disconnect %s irq success!", - irqcnnt->pid, - dev_name(camsys_dev->miscdev.this_device)); - } else { - spin_lock_irqsave(&camsys_dev->irq.lock, flags); - while (!list_empty(&camsys_dev->irq.irq_pool)) { - irqpool = list_first_entry(&camsys_dev->irq.irq_pool, - camsys_irqpool_t, list); - list_del_init(&irqpool->list); - irqpool->pid = 0; - wake_up_all(&irqpool->done); - kfree(irqpool); - irqpool = NULL; - } - spin_unlock_irqrestore(&camsys_dev->irq.lock, flags); - - camsys_trace(1, "All thread disconnect %s irq success!", - dev_name(camsys_dev->miscdev.this_device)); - } - - return err; -} - -static int camsys_querymem(camsys_dev_t *camsys_dev, camsys_querymem_t *qmem) -{ - int err = 0; - - if (qmem->mem_type == CamSys_Mmap_RegisterMem) { - if (camsys_dev->devmems.registermem == NULL) { - camsys_err("%s register memory isn't been register!", - dev_name(camsys_dev->miscdev.this_device)); - err = -EINVAL; - goto end; - } - - qmem->mem_size = camsys_dev->devmems.registermem->size; - qmem->mem_offset = CamSys_Mmap_RegisterMem*PAGE_SIZE; - } else if (qmem->mem_type == CamSys_Mmap_I2cMem) { - if (camsys_dev->devmems.i2cmem == NULL) { - camsys_err("%s i2c memory isn't been register!", - dev_name(camsys_dev->miscdev.this_device)); - err = -EINVAL; - goto end; - } - - qmem->mem_size = camsys_dev->devmems.i2cmem->size; - qmem->mem_offset = CamSys_Mmap_I2cMem*PAGE_SIZE; - } else { - camsys_err( - "%d memory type have not in %s memory list", - qmem->mem_type, - dev_name(camsys_dev->miscdev.this_device)); - err = -EINVAL; - goto end; - } - - return 0; -end: - return err; -} -static int camsys_open(struct inode *inode, struct file *file) -{ - int err = 0; - int minor = iminor(inode); - camsys_dev_t *camsys_dev; - unsigned int i, phycnt; - - spin_lock(&camsys_devs.lock); - list_for_each_entry(camsys_dev, &camsys_devs.devs, list) { - if (camsys_dev->miscdev.minor == minor) { - file->private_data = (void *)(camsys_dev); - break; - } - } - spin_unlock(&camsys_devs.lock); - if (atomic_read(&camsys_dev->refcount) >= 1) { - camsys_err("%s has been opened!", - dev_name(camsys_dev->miscdev.this_device)); - err = -EBUSY; - goto end; - } - INIT_LIST_HEAD(&camsys_dev->extdevs.active); - - if (camsys_dev->mipiphy != NULL) { - phycnt = camsys_dev->mipiphy[0].phycnt; - - for (i = 0; i < phycnt; i++) { - if (camsys_dev->mipiphy[i].clkin_cb != NULL) { - camsys_dev->mipiphy[i].clkin_cb(camsys_dev, 1); - } - } - } - - - if (file->private_data == NULL) { - camsys_err("Cann't find camsys_dev!"); - err = -ENODEV; - goto end; - } else { - atomic_inc(&camsys_dev->refcount); - camsys_trace(1, - "%s(%p) is opened!", - dev_name(camsys_dev->miscdev.this_device), camsys_dev); - } - -end: - return err; -} - -static int camsys_release(struct inode *inode, struct file *file) -{ - camsys_dev_t *camsys_dev = (camsys_dev_t *)file->private_data; - unsigned int i, phycnt; - camsys_sysctrl_t devctl; - camsys_iommu_t *iommu_par; - int index; - - camsys_irq_disconnect(NULL, camsys_dev, true); - - if (camsys_dev->mipiphy != NULL) { - phycnt = camsys_dev->mipiphy[0].phycnt; - - for (i = 0; i < phycnt; i++) { - if (camsys_dev->mipiphy[i].clkin_cb != NULL) { - camsys_dev->mipiphy[i].clkin_cb(camsys_dev, 0); - } - } - } - /* - * iommu resource might not been released when mediaserver process - * died unexpectly, so we force to release the iommu resource here - */ - devctl.dev_mask = camsys_dev->dev_id; - devctl.ops = CamSys_IOMMU; - devctl.on = 0; - iommu_par = (camsys_iommu_t *)(devctl.rev); - /* used as force release flag */ - iommu_par->client_fd = -1; - for (index = 0; index < CAMSYS_DMA_BUF_MAX_NUM ; index++) { - if (camsys_dev->iommu_cb(camsys_dev, &devctl) != 0) - break; - } - - atomic_dec(&camsys_dev->refcount); - camsys_trace(1, - "%s(%p) is closed", - dev_name(camsys_dev->miscdev.this_device), - camsys_dev); - - return 0; -} - -/* -* The ioctl() implementation -*/ - -typedef struct camsys_querymem_s_32 { - camsys_mmap_type_t mem_type; - unsigned int mem_offset; - unsigned int mem_size; -} camsys_querymem_32_t; - -#define CAMSYS_QUREYMEM_32 \ - _IOR(CAMSYS_IOC_MAGIC, 11, camsys_querymem_32_t) - -static long camsys_ioctl_compat(struct file *filp, unsigned int cmd, unsigned - long arg) -{ - long err = 0; - camsys_dev_t *camsys_dev = (camsys_dev_t *)filp->private_data; - - if (_IOC_TYPE(cmd) != CAMSYS_IOC_MAGIC) { - camsys_err( - "ioctl type(%c!=%c) is invalidate\n", - _IOC_TYPE(cmd), CAMSYS_IOC_MAGIC); - err = -ENOTTY; - goto end; - } - if (_IOC_NR(cmd) > CAMSYS_IOC_MAXNR) { - camsys_err("ioctl index(%d>%d) is invalidate\n", - _IOC_NR(cmd), CAMSYS_IOC_MAXNR); - err = -ENOTTY; - goto end; - } - - if (_IOC_DIR(cmd) & _IOC_READ) - err = !access_ok( - VERIFY_WRITE, - (void __user *)arg, - _IOC_SIZE(cmd)); - else if (_IOC_DIR(cmd) & _IOC_WRITE) - err = !access_ok( - VERIFY_READ, - (void __user *)arg, - _IOC_SIZE(cmd)); - - if (err) { - camsys_err( - "ioctl(0x%x) operation not permitted for %s", - cmd, dev_name(camsys_dev->miscdev.this_device)); - err = -EFAULT; - goto end; - } - - switch (cmd) { - - case CAMSYS_VERCHK: { - camsys_version_t camsys_ver; - - camsys_ver.drv_ver = CAMSYS_DRIVER_VERSION; - camsys_ver.head_ver = CAMSYS_HEAD_VERSION; - if (copy_to_user((void __user *)arg, - (void *)&camsys_ver, - sizeof(camsys_version_t))) - return -EFAULT; - } - case CAMSYS_QUREYIOMMU: { - int iommu_enabled = 0; - struct device_node *vpu_node = NULL; - int vpu_iommu_enabled = 0; - - vpu_node = of_find_node_by_name(NULL, "vpu_service"); - if (vpu_node) { - of_property_read_u32(vpu_node, - "iommu_enabled", &vpu_iommu_enabled); - of_property_read_u32(camsys_dev->pdev->dev.of_node, - "rockchip,isp,iommu-enable", &iommu_enabled); - of_node_put(vpu_node); - if (iommu_enabled != vpu_iommu_enabled) { - camsys_err( - "iommu status not consistent," - "check the dts file !isp:%d,vpu:%d", - iommu_enabled, vpu_iommu_enabled); - return -EFAULT; - } - } - - - if (copy_to_user((void __user *)arg, - (void *)&iommu_enabled, - sizeof(iommu_enabled))) - return -EFAULT; - - break; - } - case CAMSYS_I2CRD: { - camsys_i2c_info_t i2cinfo; - - if (copy_from_user((void *)&i2cinfo, - (void __user *)arg, - sizeof(camsys_i2c_info_t))) - return -EFAULT; - - err = camsys_i2c_read(&i2cinfo, camsys_dev); - if (err == 0) { - if (copy_to_user((void __user *)arg, (void *)&i2cinfo, - sizeof(camsys_i2c_info_t))) - return -EFAULT; - } - break; - } - - case CAMSYS_I2CWR: { - camsys_i2c_info_t i2cinfo; - - if (copy_from_user((void *)&i2cinfo, (void __user *)arg, - sizeof(camsys_i2c_info_t))) - return -EFAULT; - - err = camsys_i2c_write(&i2cinfo, camsys_dev); - break; - } - - case CAMSYS_SYSCTRL: { - camsys_sysctrl_t devctl; - - if (copy_from_user((void *)&devctl, (void __user *)arg, - sizeof(camsys_sysctrl_t))) - return -EFAULT; - - err = camsys_sysctl(&devctl, camsys_dev); - if ((err == 0) && (devctl.ops == CamSys_IOMMU)) { - if (copy_to_user((void __user *)arg, (void *)&devctl, - sizeof(camsys_sysctrl_t))) - return -EFAULT; - } - break; - } - - case CAMSYS_REGRD: { - break; - } - - case CAMSYS_REGWR: { - break; - } - - case CAMSYS_REGISTER_DEVIO: { - camsys_devio_name_t devio; - - if (copy_from_user((void *)&devio, (void __user *)arg, - sizeof(camsys_devio_name_t))) - return -EFAULT; - - err = camsys_extdev_register(&devio, camsys_dev); - break; - } - - case CAMSYS_DEREGISTER_DEVIO: { - unsigned int dev_id; - - if (copy_from_user((void *)&dev_id, (void __user *)arg, - sizeof(unsigned int))) - return -EFAULT; - - err = camsys_extdev_deregister(dev_id, camsys_dev, false); - break; - } - - case CAMSYS_IRQCONNECT: { - camsys_irqcnnt_t irqcnnt; - - if (copy_from_user((void *)&irqcnnt, (void __user *)arg, - sizeof(camsys_irqcnnt_t))) - return -EFAULT; - - err = camsys_irq_connect(&irqcnnt, camsys_dev); - - break; - } - - case CAMSYS_IRQWAIT: { - camsys_irqsta_t irqsta; - if (copy_from_user((void *)&irqsta, (void __user *)arg, - sizeof(camsys_irqsta_t))) - return -EFAULT; - err = camsys_irq_wait(&irqsta, camsys_dev); - if (err == 0) { - if (copy_to_user((void __user *)arg, (void *)&irqsta, - sizeof(camsys_irqsta_t))) - return -EFAULT; - } - break; - } - - case CAMSYS_IRQDISCONNECT: { - camsys_irqcnnt_t irqcnnt; - - if (copy_from_user((void *)&irqcnnt, (void __user *)arg, - sizeof(camsys_irqcnnt_t))) - return -EFAULT; - err = camsys_irq_disconnect(&irqcnnt, camsys_dev, false); - break; - } - - case CAMSYS_QUREYMEM_32: { - camsys_querymem_t qmem; - camsys_querymem_32_t qmem32; - - if (copy_from_user((void *)&qmem32, (void __user *)arg, - sizeof(camsys_querymem_32_t))) - return -EFAULT; - - qmem.mem_type = qmem32.mem_type; - err = camsys_querymem(camsys_dev, &qmem); - if (err == 0) { - qmem32.mem_offset = (unsigned int)qmem.mem_offset; - qmem32.mem_size = qmem.mem_size; - if (copy_to_user((void __user *)arg, (void *)&qmem32, - sizeof(camsys_querymem_32_t))) - return -EFAULT; - } - break; - } - default: - break; - } - -end: - return err; - -} - -static long camsys_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) -{ - long err = 0; - camsys_dev_t *camsys_dev = (camsys_dev_t *)filp->private_data; - - if (_IOC_TYPE(cmd) != CAMSYS_IOC_MAGIC) { - camsys_err("ioctl type(%c!=%c) is invalidate\n", - _IOC_TYPE(cmd), CAMSYS_IOC_MAGIC); - err = -ENOTTY; - goto end; - } - if (_IOC_NR(cmd) > CAMSYS_IOC_MAXNR) { - camsys_err("ioctl index(%d>%d) is invalidate\n", - _IOC_NR(cmd), CAMSYS_IOC_MAXNR); - err = -ENOTTY; - goto end; - } - - if (_IOC_DIR(cmd) & _IOC_READ) - err = !access_ok(VERIFY_WRITE, - (void __user *)arg, _IOC_SIZE(cmd)); - else if (_IOC_DIR(cmd) & _IOC_WRITE) - err = !access_ok(VERIFY_READ, - (void __user *)arg, _IOC_SIZE(cmd)); - - if (err) { - camsys_err("ioctl(0x%x) operation not permitted for %s", - cmd, dev_name(camsys_dev->miscdev.this_device)); - err = -EFAULT; - goto end; - } - - switch (cmd) { - case CAMSYS_VERCHK: { - camsys_version_t camsys_ver; - - camsys_ver.drv_ver = CAMSYS_DRIVER_VERSION; - camsys_ver.head_ver = CAMSYS_HEAD_VERSION; - if (copy_to_user((void __user *)arg, (void *)&camsys_ver, - sizeof(camsys_version_t))) - return -EFAULT; - break; - } - case CAMSYS_QUREYIOMMU: { - int iommu_enabled = 0; - struct device_node *vpu_node = NULL; - int vpu_iommu_enabled = 0; - - vpu_node = of_find_node_by_name(NULL, "vpu_service"); - if (vpu_node) { - of_property_read_u32(vpu_node, - "iommu_enabled", &vpu_iommu_enabled); - of_property_read_u32(camsys_dev->pdev->dev.of_node, - "rockchip,isp,iommu-enable", &iommu_enabled); - of_node_put(vpu_node); - if (iommu_enabled != vpu_iommu_enabled) { - camsys_err( - "iommu status not consistent," - "check the dts file !isp:%d,vpu:%d", - iommu_enabled, vpu_iommu_enabled); - return -EFAULT; - } - } - - if (copy_to_user((void __user *)arg, (void *)&iommu_enabled, - sizeof(iommu_enabled))) - return -EFAULT; - break; - } - case CAMSYS_I2CRD: { - camsys_i2c_info_t i2cinfo; - - if (copy_from_user((void *)&i2cinfo, (void __user *)arg, - sizeof(camsys_i2c_info_t))) - return -EFAULT; - - err = camsys_i2c_read(&i2cinfo, camsys_dev); - if (err == 0) { - if (copy_to_user((void __user *)arg, (void *)&i2cinfo, - sizeof(camsys_i2c_info_t))) - return -EFAULT; - } - break; - } - - case CAMSYS_I2CWR: { - camsys_i2c_info_t i2cinfo; - - if (copy_from_user((void *)&i2cinfo, (void __user *)arg, - sizeof(camsys_i2c_info_t))) - return -EFAULT; - - err = camsys_i2c_write(&i2cinfo, camsys_dev); - break; - } - - case CAMSYS_SYSCTRL: { - camsys_sysctrl_t devctl; - - if (copy_from_user((void *)&devctl, (void __user *)arg, - sizeof(camsys_sysctrl_t))) - return -EFAULT; - - err = camsys_sysctl(&devctl, camsys_dev); - if ((err == 0) && (devctl.ops == CamSys_IOMMU)) { - if (copy_to_user((void __user *)arg, (void *)&devctl, - sizeof(camsys_sysctrl_t))) - return -EFAULT; - } - break; - } - - case CAMSYS_REGRD: { - - break; - } - - case CAMSYS_REGWR: { - - break; - } - - case CAMSYS_REGISTER_DEVIO: - { - camsys_devio_name_t devio; - - if (copy_from_user((void *)&devio, (void __user *)arg, - sizeof(camsys_devio_name_t))) - return -EFAULT; - - err = camsys_extdev_register(&devio, camsys_dev); - break; - } - - case CAMSYS_DEREGISTER_DEVIO: - { - unsigned int dev_id; - - if (copy_from_user((void *)&dev_id, - (void __user *)arg, - sizeof(unsigned int))) - return -EFAULT; - - err = camsys_extdev_deregister(dev_id, camsys_dev, false); - break; - } - - case CAMSYS_IRQCONNECT: - { - camsys_irqcnnt_t irqcnnt; - - if (copy_from_user((void *)&irqcnnt, (void __user *)arg, - sizeof(camsys_irqcnnt_t))) - return -EFAULT; - - err = camsys_irq_connect(&irqcnnt, camsys_dev); - - break; - } - - case CAMSYS_IRQWAIT: - { - camsys_irqsta_t irqsta; - if (copy_from_user((void *)&irqsta, (void __user *)arg, - sizeof(camsys_irqsta_t))) - return -EFAULT; - err = camsys_irq_wait(&irqsta, camsys_dev); - if (err == 0) { - if (copy_to_user((void __user *)arg, (void *)&irqsta, - sizeof(camsys_irqsta_t))) - return -EFAULT; - } - break; - } - - case CAMSYS_IRQDISCONNECT: - { - camsys_irqcnnt_t irqcnnt; - - if (copy_from_user((void *)&irqcnnt, (void __user *)arg, - sizeof(camsys_irqcnnt_t))) - return -EFAULT; - err = camsys_irq_disconnect(&irqcnnt, camsys_dev, false); - break; - } - - case CAMSYS_QUREYMEM: - { - camsys_querymem_t qmem; - - if (copy_from_user((void *)&qmem, (void __user *)arg, - sizeof(camsys_querymem_t))) - return -EFAULT; - - err = camsys_querymem(camsys_dev, &qmem); - if (err == 0) { - if (copy_to_user((void __user *)arg, (void *)&qmem, - sizeof(camsys_querymem_t))) - return -EFAULT; - } - break; - } - - default: - break; - } - -end: - return err; - -} -/* - * VMA operations. - */ -static void camsys_vm_open(struct vm_area_struct *vma) -{ - camsys_meminfo_t *meminfo = (camsys_meminfo_t *)vma->vm_private_data; - - meminfo->vmas++; - return; -} - -static void camsys_vm_close(struct vm_area_struct *vma) -{ - camsys_meminfo_t *meminfo = (camsys_meminfo_t *)vma->vm_private_data; - - meminfo->vmas--; - return; -} - -static const struct vm_operations_struct camsys_vm_ops = { - .open = camsys_vm_open, - .close = camsys_vm_close, -}; - -int camsys_mmap(struct file *flip, struct vm_area_struct *vma) -{ - camsys_dev_t *camsys_dev = (camsys_dev_t *)flip->private_data; - unsigned long addr, start, size; - camsys_mmap_type_t mem_type; - camsys_meminfo_t *meminfo; - int ret = 0; - - mem_type = vma->vm_pgoff; - - if (mem_type == CamSys_Mmap_RegisterMem) { - if (camsys_dev->devmems.registermem != NULL) { - meminfo = camsys_dev->devmems.registermem; - } else { - camsys_err("this camsys device has not register mem!"); - ret = -EINVAL; - goto done; - } - } else if (mem_type == CamSys_Mmap_I2cMem) { - if (camsys_dev->devmems.i2cmem != NULL) { - meminfo = camsys_dev->devmems.i2cmem; - } else { - camsys_err("this camsys device has not i2c mem!"); - ret = -EINVAL; - goto done; - } - } else { - camsys_err("mmap buffer type %d is invalidate!", mem_type); - ret = -EINVAL; - goto done; - } - - size = vma->vm_end - vma->vm_start; - if (size > meminfo->size) { - ret = -ENOMEM; - camsys_err( - "mmap size(0x%lx) > memory size(0x%x), so failed!", - size, meminfo->size); - goto done; - } - - start = vma->vm_start; - addr = __phys_to_pfn(meminfo->phy_base); - - if (remap_pfn_range(vma, start, - addr, size, pgprot_noncached(vma->vm_page_prot))) { - ret = -EAGAIN; - goto done; - } - - vma->vm_ops = &camsys_vm_ops; - vma->vm_flags |= VM_IO; - vma->vm_flags |= VM_ACCOUNT; - vma->vm_private_data = (void *)meminfo; - camsys_vm_open(vma); - -done: - return ret; -} - -struct file_operations camsys_fops = { - .owner = THIS_MODULE, - .open = camsys_open, - .release = camsys_release, - .unlocked_ioctl = camsys_ioctl, - .mmap = camsys_mmap, - .compat_ioctl = camsys_ioctl_compat, -}; - -static int camsys_platform_probe(struct platform_device *pdev) -{ - int err = 0; - camsys_dev_t *camsys_dev; - struct resource register_res; - struct device *dev = &pdev->dev; - unsigned long i2cmem; - camsys_meminfo_t *meminfo, *meminfo_fail; - unsigned int irq_id; - const char *compatible = NULL; - - err = of_property_read_string(dev->of_node, "compatible", &compatible); - if (err < 0) { - camsys_err("get compatible failed!"); - } else { - camsys_trace(1, "compatible is %s\n", compatible); - } - if (strstr(compatible, "rk3368")) - CHIP_TYPE = 3368; - else if (strstr(compatible, "rk3288")) - CHIP_TYPE = 3288; - else if (strstr(compatible, "rk3366")) - CHIP_TYPE = 3366; - else if (strstr(compatible, "rk3399")) - CHIP_TYPE = 3399; - else if (strstr(compatible, "px30") || strstr(compatible, "rk3326")) - CHIP_TYPE = 3326; - camsys_soc_init(CHIP_TYPE); - - err = of_address_to_resource(dev->of_node, 0, ®ister_res); - if (err < 0) { - camsys_err( - "Get register resource from %s platform device failed!", - pdev->name); - err = -ENODEV; - goto fail_end; - } - - /* map irqs */ - irq_id = irq_of_parse_and_map(dev->of_node, 0); - if (!irq_id) { - camsys_err("Get irq resource from %s platform device failed!", - pdev->name); - err = -ENODEV; - goto fail_end; - } - - camsys_dev = (camsys_dev_t *)devm_kzalloc(&pdev->dev, - sizeof(camsys_dev_t), - GFP_KERNEL); - if (camsys_dev == NULL) { - camsys_err("Allocate camsys_dev for %s platform device failed", - pdev->name); - err = -ENOMEM; - goto fail_end; - } - - /* spin_lock_init(&camsys_dev->lock); */ - mutex_init(&camsys_dev->extdevs.mut); - INIT_LIST_HEAD(&camsys_dev->extdevs.list); - INIT_LIST_HEAD(&camsys_dev->extdevs.active); - INIT_LIST_HEAD(&camsys_dev->list); - - /* IRQ init */ - camsys_dev->irq.irq_id = irq_id; - spin_lock_init(&camsys_dev->irq.lock); - INIT_LIST_HEAD(&camsys_dev->irq.irq_pool); - /* init_waitqueue_head(&camsys_dev->irq.irq_done); */ - - INIT_LIST_HEAD(&camsys_dev->devmems.memslist); - - /* get soc operation */ - camsys_dev->soc = (void *)camsys_soc_get(); - if (camsys_dev->soc == NULL) { - err = -ENODEV; - goto fail_end; - } - - /* Register mem init */ - meminfo = kzalloc(sizeof(camsys_meminfo_t), GFP_KERNEL); - if (meminfo == NULL) { - err = -ENOMEM; - goto request_mem_fail; - } - - meminfo->vir_base = - (unsigned long)devm_ioremap_resource(dev, ®ister_res); - if (!meminfo->vir_base) { - camsys_err("%s ioremap %s failed", - dev_name(&pdev->dev), - CAMSYS_REGISTER_MEM_NAME); - err = -ENXIO; - kfree(meminfo); - goto request_mem_fail; - } - camsys_dev->rk_isp_base = meminfo->vir_base; - - strlcpy(meminfo->name, CAMSYS_REGISTER_MEM_NAME, sizeof(meminfo->name)); - meminfo->phy_base = register_res.start; - meminfo->size = register_res.end - register_res.start + 1; - list_add_tail(&meminfo->list, &camsys_dev->devmems.memslist); - - /* I2c mem init */ - i2cmem = __get_free_page(GFP_KERNEL); - if (i2cmem == 0) { - camsys_err("Allocate i2cmem failed!"); - err = -ENOMEM; - goto request_mem_fail; - } - SetPageReserved(virt_to_page(i2cmem)); - - meminfo = kzalloc(sizeof(camsys_meminfo_t), GFP_KERNEL); - if (meminfo == NULL) { - err = -ENOMEM; - goto request_mem_fail; - } - strlcpy(meminfo->name, CAMSYS_I2C_MEM_NAME, sizeof(meminfo->name)); - meminfo->vir_base = i2cmem; - meminfo->phy_base = virt_to_phys((void *)i2cmem); - meminfo->size = PAGE_SIZE; - list_add_tail(&meminfo->list, &camsys_dev->devmems.memslist); - - { - unsigned int *tmpp; - - tmpp = (unsigned int *)meminfo->vir_base; - *tmpp = 0xfa561243; - } - - /* Special init */ - { - if (camsys_mipiphy_probe_cb(pdev, camsys_dev) < 0) { - camsys_err("Mipi phy probe failed!"); - } - } - - #if (defined(CONFIG_CAMSYS_MRV)) - camsys_mrv_probe_cb(pdev, camsys_dev); - #elif (defined(CONFIG_CAMSYS_CIF)) - camsys_cif_probe_cb(pdev, camsys_dev); - #else - camsys_err("camsys driver haven't been complie!!!"); - #endif - - camsys_trace(1, - "%s memory:", dev_name(&pdev->dev)); - list_for_each_entry(meminfo, &camsys_dev->devmems.memslist, list) { - if (strcmp(meminfo->name, CAMSYS_I2C_MEM_NAME) == 0) { - camsys_dev->devmems.i2cmem = meminfo; - camsys_trace(1, - " I2c memory (phy: 0x%lx vir: 0x%lx size: 0x%x)", - meminfo->phy_base, - meminfo->vir_base, - meminfo->size); - } - if (strcmp(meminfo->name, CAMSYS_REGISTER_MEM_NAME) == 0) { - camsys_dev->devmems.registermem = meminfo; - camsys_trace(1, - " Register memory (phy: 0x%lx vir: 0x%lx size: 0x%x)", - meminfo->phy_base, - meminfo->vir_base, - meminfo->size); - } - } - - camsys_dev->phy_cb = camsys_phy_ops; - camsys_dev->pdev = pdev; - - platform_set_drvdata(pdev, (void *)camsys_dev); - /* Camsys_devs list add */ - spin_lock(&camsys_devs.lock); - list_add_tail(&camsys_dev->list, &camsys_devs.devs); - spin_unlock(&camsys_devs.lock); - - camsys_init_ext_fsh_module(); - camsys_trace(1, "Probe %s device success ", dev_name(&pdev->dev)); - return 0; -request_mem_fail: - if (camsys_dev != NULL) { - while (!list_empty(&camsys_dev->devmems.memslist)) { - meminfo_fail = list_first_entry( - &camsys_dev->devmems.memslist, - camsys_meminfo_t, list); - if (!meminfo_fail) - continue; - - list_del_init(&meminfo_fail->list); - if (strcmp(meminfo_fail->name, - CAMSYS_REGISTER_MEM_NAME) == 0) { - iounmap((void __iomem *)meminfo_fail->vir_base); - release_mem_region( - meminfo_fail->phy_base, - meminfo_fail->size); - } else if (strcmp(meminfo_fail->name, - CAMSYS_I2C_MEM_NAME) == 0) { - kfree((void *)meminfo_fail->vir_base); - } - kfree(meminfo_fail); - meminfo_fail = NULL; - } - - devm_kfree(&pdev->dev, camsys_dev); - camsys_dev = NULL; - } -fail_end: - return -1; -} -static int camsys_platform_remove(struct platform_device *pdev) -{ - camsys_dev_t *camsys_dev = platform_get_drvdata(pdev); - camsys_meminfo_t *meminfo; - - if (camsys_dev) { - while (!list_empty(&camsys_dev->devmems.memslist)) { - meminfo = list_first_entry( - &camsys_dev->devmems.memslist, - camsys_meminfo_t, list); - if (!meminfo) - continue; - - list_del_init(&meminfo->list); - if (strcmp(meminfo->name, - CAMSYS_REGISTER_MEM_NAME) == 0) { - iounmap((void __iomem *)meminfo->vir_base); - release_mem_region(meminfo->phy_base, - meminfo->size); - } else if (strcmp(meminfo->name, - CAMSYS_I2C_MEM_NAME) == 0) { - kfree((void *)meminfo->vir_base); - } - kfree(meminfo); - meminfo = NULL; - } - if (camsys_dev->irq.irq_id) { - free_irq(camsys_dev->irq.irq_id, camsys_dev); - camsys_irq_disconnect(NULL, camsys_dev, true); - } - - if (!list_empty(&camsys_dev->extdevs.list)) { - camsys_extdev_deregister(0, camsys_dev, true); - } - if (camsys_dev->mipiphy != NULL) { - camsys_dev->mipiphy->remove(pdev); - } - if (camsys_dev->cifphy.remove) - camsys_dev->cifphy.remove(pdev); - camsys_dev->platform_remove(pdev); - - misc_deregister(&camsys_dev->miscdev); - - spin_lock(&camsys_devs.lock); - list_del_init(&camsys_dev->list); - spin_unlock(&camsys_devs.lock); - - camsys_deinit_ext_fsh_module(); - - kfree(camsys_dev); - camsys_dev = NULL; - } else { - camsys_err("This platform device havn't obtain camsys_dev!"); - } - - return 0; -} - - -static const struct of_device_id cif_of_match[] = { - { .compatible = "rockchip,isp" }, - { /* sentinel */ } -}; -MODULE_DEVICE_TABLE(of, cif_of_match); - -static struct platform_driver camsys_platform_driver = { - .driver = { - .name = CAMSYS_PLATFORM_DRV_NAME, - .of_match_table = of_match_ptr(cif_of_match), - }, - .probe = camsys_platform_probe, - .remove = (camsys_platform_remove), -}; - -MODULE_ALIAS(CAMSYS_PLATFORM_DRV_NAME); -static int __init camsys_platform_init(void) -{ - printk("CamSys driver version: v%d.%d.%d, " - "CamSys head file version: v%d.%d.%d\n", - (CAMSYS_DRIVER_VERSION&0xff0000) >> 16, - (CAMSYS_DRIVER_VERSION&0xff00) >> 8, - CAMSYS_DRIVER_VERSION&0xff, - (CAMSYS_HEAD_VERSION&0xff0000) >> 16, - (CAMSYS_HEAD_VERSION&0xff00) >> 8, - CAMSYS_HEAD_VERSION&0xff); - - spin_lock_init(&camsys_devs.lock); - INIT_LIST_HEAD(&camsys_devs.devs); - platform_driver_register(&camsys_platform_driver); - - return 0; -} - -static void __exit camsys_platform_exit(void) -{ - platform_driver_unregister(&camsys_platform_driver); - camsys_soc_deinit(); -} - -module_init(camsys_platform_init); -module_exit(camsys_platform_exit); - -MODULE_DESCRIPTION("RockChip Camera System"); -MODULE_AUTHOR(""); -MODULE_LICENSE("GPL"); - diff --git a/drivers/media/video/rk_camsys/camsys_gpio.h b/drivers/media/video/rk_camsys/camsys_gpio.h deleted file mode 100644 index 4858cde26ef5..000000000000 --- a/drivers/media/video/rk_camsys/camsys_gpio.h +++ /dev/null @@ -1,93 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __RKCAMSYS_GPIO_H__ -#define __RKCAMSYS_GPIO_H__ - -#if defined(CONFIG_ARCH_ROCKCHIP) -#define RK30_PIN0_PA0 (0) -#define NUM_GROUP (32) -#define GPIO_BANKS (9) -#endif -extern unsigned int CHIP_TYPE; - -static inline unsigned int camsys_gpio_group_pin(unsigned char *io_name) -{ - char *pin_char = NULL; - int pin = -1; - - if (strstr(io_name, "PA")) { - pin_char = strstr(io_name, "PA"); - pin_char += 2; - pin = *pin_char - 0x30; - } else if (strstr(io_name, "PB")) { - pin_char = strstr(io_name, "PB"); - pin_char += 2; - pin = *pin_char - 0x30; - pin += 8; - } else if (strstr(io_name, "PC")) { - pin_char = strstr(io_name, "PC"); - pin_char += 2; - pin = *pin_char - 0x30; - pin += 16; - } else if (strstr(io_name, "PD")) { - pin_char = strstr(io_name, "PD"); - pin_char += 2; - pin = *pin_char - 0x30; - pin += 24; - } - return pin; -} - -static inline unsigned int camsys_gpio_group(unsigned char *io_name) -{ - unsigned int group = 0; - - if (strstr(io_name, "PIN0")) - group = 0; - else if (strstr(io_name, "PIN1")) - group = 1; - else if (strstr(io_name, "PIN2")) - group = 2; - else if (strstr(io_name, "PIN3")) - group = 3; - else if (strstr(io_name, "PIN4")) - group = 4; - else if (strstr(io_name, "PIN5")) - group = 5; - else if (strstr(io_name, "PIN6")) - group = 6; - else if (strstr(io_name, "PIN7")) - group = 7; - else if (strstr(io_name, "PIN8")) - group = 8; - return group; -} - -static inline unsigned int camsys_gpio_get(unsigned char *io_name) -{ - unsigned int gpio = 0; - unsigned int group = 0; - int group_pin = 0; -#if (defined(CONFIG_ARCH_RK3066B) || defined(CONFIG_ARCH_RK3188) ||\ - defined(CONFIG_ARCH_RK319X) || defined(CONFIG_ARCH_ROCKCHIP)) - if (strstr(io_name, "RK30_")) { - gpio = RK30_PIN0_PA0; - group = camsys_gpio_group(io_name); - group_pin = camsys_gpio_group_pin(io_name); - if (group_pin == -1) - gpio = 0xffffffff; - else { - if (group >= GPIO_BANKS) - gpio = 0xffffffff; - else - gpio += group * NUM_GROUP + group_pin; - } - /* gpio0_D is unavailable on rk3288. */ - if (!strstr(io_name, "PIN0") && 3288 == CHIP_TYPE) - gpio -= 8; - } -#endif - return gpio; -} - -#endif - diff --git a/drivers/media/video/rk_camsys/camsys_internal.h b/drivers/media/video/rk_camsys/camsys_internal.h deleted file mode 100644 index e4bd2433deae..000000000000 --- a/drivers/media/video/rk_camsys/camsys_internal.h +++ /dev/null @@ -1,507 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __RKCAMSYS_INTERNAL_H__ -#define __RKCAMSYS_INTERNAL_H__ - -#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 -#include -#include -#include -#include -#include -#include - -/* -* C A M S Y S D R I V E R V E R S I O N -* -*v0.0.1: -* 1) test version; -*v0.0.2: -* 1) add mipi csi phy; -*v0.0.3: -* 1) add support cif phy for marvin; -*v0.0.4: -* 1) add clock information in struct camsys_devio_name_s; -*v0.0.5: -* 1) set isp clock at 32MHz; -*v0.0.6: -* 1) iomux d0 d1 for cif phy raw10 in rk319x after i2c operated; -* 2) check mis value in camsys_irq_connect; - 3) add soft rest callback; -*v0.7.0: - 1) check extdev is activate or not before delete from - camsys_dev active list; -*v0.8.0: - 1) fix deregister a unregister extdev oops - in camsys_extdev_deregister; -*v0.9.0: 1) set isp freq to 210M -*v0.a.0: - 1) fix camsys_i2c_write and camsys_i2c_write - can't support reg_size=0; -*v0.b.0: - 1) control ddr freq by marvin self other than by clk unit. -*v0.c.0: -* 1) add flash_trigger_out control -*v0.d.0: -* 1) add Isp_SoftRst for rk3288; -*v0.e.0: -* 1) isp_clk 208.8M for 1lane, isp_clk 416.6M for 2lane; -*v0.f.0: - 1) mi_mis register may read erro, this may cause - mistaken mi frame_end irqs. -*v0.0x10.0: - 1) add flash_prelight control. -*v0.0x11.0: - 1) raise qos of isp up to the same as lcdc. -*v0.0x12.0: - 1) support iommu. -*v0.0x13.0: - 1) camsys_extdev_register return failed when this - dev_id has been registered; - 2) add support JPG irq connect; -*v0.0x14.0: - 1) camsys_extdev_register return -EBUSY when this - dev_id has been registered; -*v0.0x15.0: - 1) check extdev name when dev_id has been registered; -*v0.0x16.0: - 1) enable or disable IOMMU just depending - on CONFIG_ROCKCHIP_IOMMU. -*v0.0x17.0: - 1) isp iommu status depend on vpu iommu status. -*v0.0x18.0: - 1) add flashlight RT8547 driver - 2) support torch mode -*v0.0x19.0: - 1) set CONFIG_CAMSYS_DRV disable as default, - enable in defconfig file if needed. -*v0.0x1a.0: - 1) vpu_node changed from "vpu_service" to "rockchip,vpu_sub" -*v0.0x1b.0: - 1) use of_find_node_by_name to get vpu node - instead of of_find_compatible_node -*v0.0x1c.0: - 1) support rk3368. -*v0.0x1d.0: - 1) enable aclk_rga for rk3368, otherwise, - isp reset will cause system halted. -*v0.0x1e.0: - 1) dts remove aclk_rga, change aclk_isp - from to <&clk_gates16 0>. - 2) add rl3369 pd_isp enable/disable. -*v0.0x1f.0: - 1) GPIO(gpio7 GPIO_B5) is EBUSY - when register after factory reset, - but after power on ,it's normal. -*v0.0x20.0: - 1) rk3368 camera: hold vio0 noc clock during the camera work, - fixed isp iommu stall failed. -*v0.0x21.0: - 1) add isp-dvp-d4d11 iomux support. -*v0.0x21.1: - 1) support rk3368-sheep kernel ver4.4. -*v0.0x21.2: - 1) support rk3399. -*v0.0x21.3: - 1) some modifications. -*v0.0x21.4: - 1) modify for rk3399. -*v0.0x21.5: - 1) modify for mipiphy hsfreqrange. -*v0.0x21.6: - 1) support drm iommu. -*v0.0x21.7: -* 1) remove memset function wrong called code. -*v0.0x21.8: -* 1) flash module exist risk, fix up it. -*v0.0x21.9: - 1) fix drm iommu crash. - if process cameraserver was died during streaming, iommu resource - was not released correctly. when cameraserver was recovered and - streaming again, iommu resource may be conflicted. -*v0.0x21.0xa: - 1) clock clk_vio0_noc would cause mipi lcdc no display on 3368h, remove it. -*v0.0x21.0xb: - 1) some log is boring, so set print level more high. -*v0.0x21.0xc: - 1) support rk3288. -*v0.0x21.0xd: - 1) modify mipiphy_hsfreqrange for 3368. -*v0.0x21.0xe - 1) correct mipiphy_hsfreqrange of 3368. - 2) add csi-phy timing setting for 3368. -*v0.0x21.0xf: - 1) add reference count for marvin. -*v0.0x22.0: - 1) delete node in irqpool list when thread disconnect. -*v0.0x22.1: - 1) gpio0_D is unavailable on rk3288 with current pinctrl driver. -*v0.0x22.2: - 1) modify the condition of DRM iommu, which makes code more readable - by using of_parse_phandle to check whether the "iommus" phandle exists - in the isp device node. -*v0.0x22.3: - 1) switch TX1/RX1 D-PHY of rk3288/3399 to RX status before - it's initialization to avoid conflicting with sensor output. -*v0.0x22.4: - 1) enable SYS_STATUS_ISP status set. -*v0.0x22.5: - 1) gpio base start from 1000,adapt to it. -*v0.0x22.6: - 1) revert v0.0x22.3. -*v0.0x22.7: - 1) read MRV_MIPI_FRAME register in camsys_mrv_irq, and pass the value - fs_id and fe_id into isp library. -*v0.0x22.8: - 1) 3399 power management is wrong, correct it. -*v0.0x23.0: - 1) replace current->pid with irqsta->pid. -*v0.0x24.0: - 1) function is the same as commit in v0.0x22.3 but now is better way. -*v0.0x25.0: - 1) support px30. -*v0.0x26.0: - 1) v0.0x21.9 may not fix all the case of iommu issue caused by the - unexpected termination of process cameraserver, so we force to release - all iommu resource in |.release| of fops aganin if needed. -*v0.0x27.0: - 1) revert v0.0x22.5. -*v0.0x28.0: - 1) fix isp soft reset failure for rk3326. - reset on too high aclk rate will result in bus dead, so we reduce the aclk - before reset and then recover it after reset. -*v0.0x28.1: - 1) another reasonable solution of isp soft reset failure for rk3326. - reset on too high isp_clk rate will result in bus dead. - The signoff isp_clk rate is 350M, and the recommended rate - on reset from IC is NOT greater than 300M. -*v0.0x29.0: - 1) fix camera mipi phy config for rk3288. - CSIHOST_PHY_SHUTDOWNZ and CSIHOST_DPHY_RSTZ is - csi host control interface;so DPHY_RX1_SRC_SEL_MASK - should be set DPHY_RX1_SRC_SEL_CSI. -*v0.0x30.0: - 1) rk3326 and other platform power management implementation. -*/ - -#define CAMSYS_DRIVER_VERSION KERNEL_VERSION(0, 0x30, 0) - -#define CAMSYS_PLATFORM_DRV_NAME "RockChip-CamSys" -#define CAMSYS_PLATFORM_MARVIN_NAME "Platform_MarvinDev" -#define CAMSYS_PLATFORM_CIF0_NAME "Platform_Cif0Dev" -#define CAMSYS_PLATFORM_CIF1_NAME "Platform_Cif1Dev" - -#define CAMSYS_REGISTER_RES_NAME "CamSys_RegMem" -#define CAMSYS_REGISTER_MIPIPHY_RES_NAME "CamSys_RegMem_MipiPhy" -#define CAMSYS_IRQ_RES_NAME "CamSys_Irq" - -#define CAMSYS_REGISTER_MEM_NAME CAMSYS_REGISTER_RES_NAME -#define CAMSYS_I2C_MEM_NAME "CamSys_I2cMem" -#define CAMSYS_MIPIPHY_MEM_NAME \ - CAMSYS_REGISTER_MIPIPHY_RES_NAME - -#define CAMSYS_NAMELEN_MIN(a) \ - ((strlen(a) > (CAMSYS_NAME_LEN-1))?(CAMSYS_NAME_LEN-1):strlen(a)) -#define CAMSYS_IRQPOOL_NUM 128 -#define CAMSYS_DMA_BUF_MAX_NUM 32 - -extern unsigned int camsys_debug; - -#define camsys_trace(level, msg, ...) \ - do { \ - if (camsys_debug >= level) \ - printk("D%d:%s(%d): " msg "\n", level,\ - __FUNCTION__, __LINE__, ## __VA_ARGS__); \ - } while (0) - -#define camsys_warn(msg, ...) \ - printk(KERN_ERR "W:%s(%d): " msg "\n", __FUNCTION__,\ - __LINE__, ## __VA_ARGS__) -#define camsys_err(msg, ...) \ - printk(KERN_ERR "E:%s(%d): " msg "\n", __FUNCTION__,\ - __LINE__, ## __VA_ARGS__) - -typedef struct camsys_irqstas_s { - camsys_irqsta_t sta; - struct list_head list; -} camsys_irqstas_t; - -typedef struct camsys_irqpool_s { - pid_t pid; - unsigned int timeout;/* us */ - unsigned int mis; - unsigned int icr; - spinlock_t lock;/* lock for list */ - camsys_irqstas_t pool[CAMSYS_IRQPOOL_NUM]; - struct list_head active; - struct list_head deactive; - - struct list_head list; - - wait_queue_head_t done; -} camsys_irqpool_t; - -typedef struct camsys_irq_s { - unsigned int irq_id; - /* lock for timeout and irq_connect in ioctl */ - spinlock_t lock; - struct list_head irq_pool; -} camsys_irq_t; - -typedef struct camsys_meminfo_s { - unsigned char name[32]; - unsigned long phy_base; - unsigned long vir_base; - unsigned int size; - unsigned int vmas; - struct list_head list; -} camsys_meminfo_t; - -typedef struct camsys_devmems_s { - camsys_meminfo_t *registermem; - camsys_meminfo_t *i2cmem; - struct list_head memslist; -} camsys_devmems_t; - -typedef struct camsys_regulator_s { - struct regulator *ldo; - int min_uv; - int max_uv; -} camsys_regulator_t; - -typedef struct camsys_gpio_s { - unsigned int io; - unsigned int active; -} camsys_gpio_t; -typedef struct camsys_flash_s { - camsys_gpio_t fl; - camsys_gpio_t fl_en; - void *ext_fsh_dev; -} camsys_flash_t; -typedef struct camsys_extdev_s { - unsigned char dev_name[CAMSYS_NAME_LEN]; - unsigned int dev_id; - camsys_regulator_t avdd; - camsys_regulator_t dovdd; - camsys_regulator_t dvdd; - camsys_regulator_t afvdd; - camsys_gpio_t pwrdn; - camsys_gpio_t rst; - camsys_gpio_t afpwr; - camsys_gpio_t afpwrdn; - camsys_gpio_t pwren; - camsys_flash_t fl; - camsys_extdev_phy_t phy; - camsys_extdev_clk_t clk; - unsigned int dev_cfg; - struct platform_device *pdev; - struct list_head list; - struct list_head active; -} camsys_extdev_t; - - typedef struct camsys_phyinfo_s { - unsigned int phycnt; - void *clk; - camsys_meminfo_t *reg; - int (*clkin_cb)(void *ptr, unsigned int on); - int (*ops)(void *ptr, camsys_mipiphy_t *phy); - int (*remove)(struct platform_device *pdev); -} camsys_phyinfo_t; - -typedef struct camsys_exdevs_s { - struct mutex mut; - struct list_head list; - struct list_head active; -} camsys_exdevs_t; - -typedef struct camsys_dma_buf_s { - struct dma_buf *dma_buf; - struct dma_buf_attachment *attach; - struct sg_table *sgt; - dma_addr_t dma_addr; - int fd; -} camsys_dma_buf_t; - -typedef struct camsys_dev_s { - unsigned int dev_id; - camsys_irq_t irq; - camsys_devmems_t devmems; - struct miscdevice miscdev; - void *clk; - camsys_phyinfo_t *mipiphy; - camsys_phyinfo_t cifphy; - - camsys_exdevs_t extdevs; - struct list_head list; - struct platform_device *pdev; - - void *soc; - - camsys_meminfo_t *csiphy_reg; - camsys_meminfo_t *dsiphy_reg; - camsys_meminfo_t *isp0_reg; - - unsigned long rk_grf_base; - unsigned long rk_cru_base; - unsigned long rk_isp_base; - atomic_t refcount; - struct iommu_domain *domain; - camsys_dma_buf_t dma_buf[CAMSYS_DMA_BUF_MAX_NUM]; - int dma_buf_cnt; - - int (*clkin_cb)(void *ptr, unsigned int on); - int (*clkout_cb)(void *ptr, unsigned int on, unsigned int clk); - int (*reset_cb)(void *ptr, unsigned int on); - - int (*phy_cb) - (camsys_extdev_t *extdev, - camsys_sysctrl_t *devctl, void *ptr); - int (*iomux)(camsys_extdev_t *extdev, void *ptr); - int (*platform_remove)(struct platform_device *pdev); - int (*flash_trigger_cb)(void *ptr, int mode, unsigned int on); - int (*iommu_cb)(void *ptr, camsys_sysctrl_t *devctl); -} camsys_dev_t; - - -static inline camsys_extdev_t *camsys_find_extdev( -unsigned int dev_id, camsys_dev_t *camsys_dev) -{ - camsys_extdev_t *extdev = NULL; - - if (!list_empty(&camsys_dev->extdevs.list)) { - list_for_each_entry(extdev, - &camsys_dev->extdevs.list, list) { - if (extdev->dev_id == dev_id) { - return extdev; - } - } - } - return NULL; -} - -static inline camsys_meminfo_t *camsys_find_devmem( -char *name, camsys_dev_t *camsys_dev) -{ - camsys_meminfo_t *devmem; - - if (!list_empty(&camsys_dev->devmems.memslist)) { - list_for_each_entry(devmem, - &camsys_dev->devmems.memslist, list) { - if (strcmp(devmem->name, name) == 0) { - return devmem; - } - } - } - camsys_err("%s memory have not been find in %s!", - name, dev_name(camsys_dev->miscdev.this_device)); - return NULL; -} - -static inline int camsys_sysctl_extdev( -camsys_extdev_t *extdev, camsys_sysctrl_t *devctl, camsys_dev_t *camsys_dev) -{ - int err = 0; - camsys_regulator_t *regulator; - camsys_gpio_t *gpio; - - if ((devctl->ops > CamSys_Vdd_Start_Tag) && - (devctl->ops < CamSys_Vdd_End_Tag)) { - regulator = &extdev->avdd; - regulator += devctl->ops-1; - - if (!IS_ERR_OR_NULL(regulator->ldo)) { - if (devctl->on) { - err = regulator_set_voltage( - regulator->ldo, regulator->min_uv, - regulator->max_uv); - err |= regulator_enable(regulator->ldo); - camsys_trace(1, - "Sysctl %d success, regulator set (%d,%d) uv!", - devctl->ops, regulator->min_uv, - regulator->max_uv); - } else { - while (regulator_is_enabled(regulator->ldo) > 0) - regulator_disable(regulator->ldo); - camsys_trace(1, - "Sysctl %d success, regulator off!", - devctl->ops); - } - } else { - err = -EINVAL; - goto end; - } - } else if ((devctl->ops > CamSys_Gpio_Start_Tag) && - (devctl->ops < CamSys_Gpio_End_Tag)) { - gpio = &extdev->pwrdn; - gpio += devctl->ops - CamSys_Gpio_Start_Tag -1; - - if (gpio->io != 0xffffffff) { - if (devctl->on) { - gpio_direction_output(gpio->io, gpio->active); - gpio_set_value(gpio->io, gpio->active); - camsys_trace(1, - "Sysctl %d success, gpio(%d) set %d", - devctl->ops, gpio->io, gpio->active); - } else { - gpio_direction_output(gpio->io, !gpio->active); - gpio_set_value(gpio->io, !gpio->active); - camsys_trace(1, - "Sysctl %d success, gpio(%d) set %d", - devctl->ops, gpio->io, !gpio->active); - } - } else { - camsys_trace(1, "Sysctl %d not do, because gpio is NULL", - devctl->ops); - err = -EINVAL; - goto end; - } - } else if (devctl->ops == CamSys_ClkIn) { - if (camsys_dev->clkout_cb) - camsys_dev->clkout_cb - (camsys_dev, devctl->on, - extdev->clk.in_rate); - } else if (devctl->ops == CamSys_Phy) { - if (camsys_dev->phy_cb) - (camsys_dev->phy_cb) - (extdev, devctl, - (void *)camsys_dev); - } - -end: - return err; -} - -extern struct file_operations camsys_fops; -#endif diff --git a/drivers/media/video/rk_camsys/camsys_marvin.c b/drivers/media/video/rk_camsys/camsys_marvin.c deleted file mode 100644 index a8860fc6a0f3..000000000000 --- a/drivers/media/video/rk_camsys/camsys_marvin.c +++ /dev/null @@ -1,1244 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include "camsys_marvin.h" -#include "camsys_soc_priv.h" -#include "camsys_gpio.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -static const char miscdev_name[] = CAMSYS_MARVIN_DEVNAME; - -static int camsys_mrv_iomux_cb(camsys_extdev_t *extdev, void *ptr) -{ - struct pinctrl *pinctrl; - struct pinctrl_state *state; - int retval = 0; - char state_str[64] = {0}; - camsys_dev_t *camsys_dev = (camsys_dev_t *)ptr; - struct device *dev = &(extdev->pdev->dev); - camsys_soc_priv_t *soc; - - /* DVP IO Config */ - - if (extdev->phy.type == CamSys_Phy_Cif) { - switch (extdev->phy.info.cif.fmt) { - case CamSys_Fmt_Raw_8b: - case CamSys_Fmt_Yuv420_8b: - case CamSys_Fmt_Yuv422_8b:{ - if (extdev->phy.info.cif.cifio == - CamSys_SensorBit0_CifBit0) { - strcpy(state_str, "isp_dvp8bit0"); - } else if (extdev->phy.info.cif.cifio == - CamSys_SensorBit0_CifBit2) { - strcpy(state_str, "isp_dvp8bit2"); - } else if (extdev->phy.info.cif.cifio == - CamSys_SensorBit0_CifBit4) { - strcpy(state_str, "isp_dvp8bit4"); - } else { - camsys_err("extdev->phy.info.cif.cifio:0x%x is invalidate!", - extdev->phy.info.cif.cifio); - goto fail; - } - - break; - } - - case CamSys_Fmt_Raw_10b:{ - strcpy(state_str, "isp_dvp10bit"); - break; - } - - case CamSys_Fmt_Raw_12b:{ - strcpy(state_str, "isp_dvp12bit"); - break; - } - - default:{ - camsys_err("extdev->phy.info.cif.fmt: 0x%x is invalidate!", - extdev->phy.info.cif.fmt); - goto fail; - } - } - } else { - if (extdev->dev_cfg & CAMSYS_DEVCFG_FLASHLIGHT) { - if (extdev->dev_cfg & CAMSYS_DEVCFG_PREFLASHLIGHT) { - strcpy(state_str, "isp_mipi_fl_prefl"); - } else { - strcpy(state_str, "isp_mipi_fl"); - } - { - /*mux triggerout as gpio*/ - /*get gpio index*/ - int flash_trigger_io; - enum of_gpio_flags flags; - - flash_trigger_io = - of_get_named_gpio_flags( - camsys_dev->pdev->dev.of_node, - "rockchip,gpios", 0, &flags); - if (gpio_is_valid(flash_trigger_io)) { - flash_trigger_io = - of_get_named_gpio_flags( - camsys_dev->pdev->dev.of_node, - "rockchip,gpios", 0, &flags); - gpio_request(flash_trigger_io, - "camsys_gpio"); - gpio_direction_output( - flash_trigger_io, - (~(extdev->fl.fl.active) & - 0x1)); - } - } - } else { - if (CHIP_TYPE == 3399) { - strcpy(state_str, "cif_clkout"); - } else { - strcpy(state_str, "default"); - } - } - } - - camsys_trace(1, "marvin pinctrl select: %s", state_str); - - pinctrl = devm_pinctrl_get(dev); - if (IS_ERR(pinctrl)) { - camsys_err("devm_pinctrl_get failed!"); - goto fail; - } - state = pinctrl_lookup_state(pinctrl, - state_str); - if (IS_ERR(state)) { - camsys_err("pinctrl_lookup_state failed!"); - goto fail; - } - - if (!IS_ERR(state)) { - retval = pinctrl_select_state(pinctrl, state); - if (retval) { - camsys_err("pinctrl_select_state failed!"); - goto fail; - } - } - - if (camsys_dev->soc) { - soc = (camsys_soc_priv_t *)camsys_dev->soc; - if (soc->soc_cfg) { - (soc->soc_cfg)(camsys_dev, Cif_IoDomain_Cfg, - (void *)&extdev->dovdd.min_uv); - (soc->soc_cfg)(camsys_dev, Clk_DriverStrength_Cfg, - (void *)&extdev->clk.driver_strength); - } else { - camsys_err("camsys_dev->soc->soc_cfg is NULL!"); - } - } else { - camsys_err("camsys_dev->soc is NULL!"); - } - - return 0; -fail: - return -1; -} - -static int camsys_mrv_flash_trigger_cb(void *ptr, int mode, unsigned int on) -{ - camsys_dev_t *camsys_dev = (camsys_dev_t *)ptr; - struct device *dev = &(camsys_dev->pdev->dev); - int flash_trigger_io; - struct pinctrl *pinctrl; - struct pinctrl_state *state; - char state_str[63] = {0}; - int retval = 0; - enum of_gpio_flags flags; - camsys_extdev_t *extdev = NULL; - - if (!on) { - strcpy(state_str, "isp_flash_as_gpio"); - pinctrl = devm_pinctrl_get(dev); - if (IS_ERR(pinctrl)) { - camsys_err("devm_pinctrl_get failed!"); - } - state = pinctrl_lookup_state(pinctrl, state_str); - if (IS_ERR(state)) { - camsys_err("pinctrl_lookup_state failed!"); - } - - if (!IS_ERR(state)) { - retval = pinctrl_select_state(pinctrl, state); - if (retval) { - camsys_err("pinctrl_select_state failed!"); - } - } - - /*get gpio index*/ - flash_trigger_io = of_get_named_gpio_flags( - camsys_dev->pdev->dev.of_node, - "rockchip,gpios", 0, &flags); - if (gpio_is_valid(flash_trigger_io)) { - flash_trigger_io = of_get_named_gpio_flags( - camsys_dev->pdev->dev.of_node, - "rockchip,gpios", 0, &flags); - gpio_request(flash_trigger_io, "camsys_gpio"); - /*get flash io active pol*/ - if (!list_empty(&camsys_dev->extdevs.list)) { - list_for_each_entry( - extdev, &camsys_dev->extdevs.list, - list) { - if (extdev->dev_cfg & - CAMSYS_DEVCFG_FLASHLIGHT) { - gpio_direction_output( - flash_trigger_io, - (~(extdev->fl.fl.active) - & 0x1)); - } - } - } - } - } else { - strcpy(state_str, "isp_flash_as_trigger_out"); - pinctrl = devm_pinctrl_get(dev); - if (IS_ERR(pinctrl)) { - camsys_err("devm_pinctrl_get failed!"); - } - state = pinctrl_lookup_state(pinctrl, - state_str); - if (IS_ERR(state)) { - camsys_err("pinctrl_lookup_state failed!"); - } - - if (!IS_ERR(state)) { - retval = pinctrl_select_state(pinctrl, state); - if (retval) { - camsys_err("pinctrl_select_state failed!"); - } - - } - } - return retval; -} -static struct device *rockchip_get_sysmmu_device_by_compatible( -const char *compt) -{ - struct device_node *dn = NULL; - struct platform_device *pd = NULL; - struct device *ret = NULL; - - dn = of_find_compatible_node(NULL, NULL, compt); - if (!dn) { - camsys_err("can't find device node %s \r\n", compt); - return NULL; - } - - pd = of_find_device_by_node(dn); - if (!pd) { - camsys_err( - "can't find platform device in device node %s \r\n", - compt); - return NULL; - } - ret = &pd->dev; - - return ret; - -} -#ifdef CONFIG_IOMMU_API -static inline void platform_set_sysmmu( -struct device *iommu, struct device *dev) -{ - dev->archdata.iommu = iommu; -} -#else -static inline void platform_set_sysmmu( -struct device *iommu, struct device *dev) -{ -} -#endif - - -static int camsys_mrv_iommu_cb(void *ptr, camsys_sysctrl_t *devctl) -{ - struct device *iommu_dev = NULL, *dev = NULL; - struct file *file = NULL; - struct ion_client *client = NULL; - struct ion_handle *handle = NULL; - camsys_iommu_t *iommu = NULL; - int ret = 0, iommu_enabled = 0; - camsys_dev_t *camsys_dev = (camsys_dev_t *)ptr; - - of_property_read_u32(camsys_dev->pdev->dev.of_node, - "rockchip,isp,iommu-enable", &iommu_enabled); - if (iommu_enabled != 1) { - camsys_err("isp iommu have not been enabled!\n"); - ret = -1; - goto iommu_end; - } - - if (strstr(camsys_dev->miscdev.name, "camsys_marvin1")) { - iommu_dev = - rockchip_get_sysmmu_device_by_compatible - (ISP1_IOMMU_COMPATIBLE_NAME); - } else { - if (CHIP_TYPE == 3399) { - iommu_dev = - rockchip_get_sysmmu_device_by_compatible - (ISP0_IOMMU_COMPATIBLE_NAME); - } else{ - iommu_dev = - rockchip_get_sysmmu_device_by_compatible - (ISP_IOMMU_COMPATIBLE_NAME); - } - } - - if (!iommu_dev) { - camsys_err("get iommu device erro!\n"); - ret = -1; - goto iommu_end; - } - dev = &(camsys_dev->pdev->dev); - iommu = (camsys_iommu_t *)(devctl->rev); - file = fget(iommu->client_fd); - if (!file) { - camsys_err("get client_fd file erro!\n"); - ret = -1; - goto iommu_end; - } - - client = file->private_data; - - if (!client) { - camsys_err("get ion_client erro!\n"); - ret = -1; - goto iommu_end; - } - - fput(file); - - handle = ion_import_dma_buf(client, iommu->map_fd); - - camsys_trace(1, "map fd %d ,client fd %d\n", - iommu->map_fd, iommu->client_fd); - if (!handle) { - camsys_err("get ion_handle erro!\n"); - ret = -1; - goto iommu_end; - } - if (devctl->on) { - platform_set_sysmmu(iommu_dev, dev); - ret = rockchip_iovmm_activate(dev); - ret = ion_map_iommu(dev, client, handle, - &(iommu->linear_addr), &(iommu->len)); - } else { - ion_unmap_iommu(dev, client, handle); - platform_set_sysmmu(iommu_dev, dev); - rockchip_iovmm_deactivate(dev); - } -iommu_end: - return ret; -} - -static int camsys_drm_dma_attach_device(camsys_dev_t *camsys_dev) -{ - struct iommu_domain *domain = camsys_dev->domain; - struct device *dev = &camsys_dev->pdev->dev; - int ret; - - ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32)); - if (ret) - return ret; - - dma_set_max_seg_size(dev, DMA_BIT_MASK(32)); - ret = iommu_attach_device(domain, dev); - if (ret) { - dev_err(dev, "Failed to attach iommu device\n"); - return ret; - } - - if (!common_iommu_setup_dma_ops(dev, 0x10000000, SZ_2G, domain->ops)) { - dev_err(dev, "Failed to set dma_ops\n"); - iommu_detach_device(domain, dev); - ret = -ENODEV; - } - - return ret; -} - -static void camsys_drm_dma_detach_device(camsys_dev_t *camsys_dev) -{ - struct iommu_domain *domain = camsys_dev->domain; - struct device *dev = &camsys_dev->pdev->dev; - - iommu_detach_device(domain, dev); -} - -static int camsys_mrv_drm_iommu_cb(void *ptr, camsys_sysctrl_t *devctl) -{ - struct device *dev = NULL; - camsys_iommu_t *iommu = NULL; - struct dma_buf *dma_buf; - struct dma_buf_attachment *attach; - struct sg_table *sgt; - dma_addr_t dma_addr; - int index = 0; - int ret = 0; - camsys_dev_t *camsys_dev = (camsys_dev_t *)ptr; - - dev = &camsys_dev->pdev->dev; - iommu = (camsys_iommu_t *)(devctl->rev); - if (devctl->on) { - /*ummap mapped fd first*/ - int cur_mapped_cnt = camsys_dev->dma_buf_cnt; - - for (index = 0; index < cur_mapped_cnt; index++) { - if (camsys_dev->dma_buf[index].fd == iommu->map_fd) - break; - } - if (index != cur_mapped_cnt) { - attach = camsys_dev->dma_buf[index].attach; - dma_buf = camsys_dev->dma_buf[index].dma_buf; - sgt = camsys_dev->dma_buf[index].sgt; - camsys_trace - ( - 2, - "exist mapped buf, release it before map: attach %p," - "dma_buf %p,sgt %p,fd %d,index %d", - attach, - dma_buf, - sgt, - iommu->map_fd, - index); - dma_buf_unmap_attachment - (attach, - sgt, - DMA_BIDIRECTIONAL); - dma_buf_detach(dma_buf, attach); - dma_buf_put(dma_buf); - if (camsys_dev->dma_buf_cnt == 1) - camsys_drm_dma_detach_device(camsys_dev); - camsys_dev->dma_buf_cnt--; - camsys_dev->dma_buf[index].fd = -1; - } - /*get a free slot*/ - for (index = 0; index < CAMSYS_DMA_BUF_MAX_NUM; index++) - if (camsys_dev->dma_buf[index].fd == -1) - break; - - if (index == CAMSYS_DMA_BUF_MAX_NUM) - return -ENOMEM; - - if (camsys_dev->dma_buf_cnt == 0) { - ret = camsys_drm_dma_attach_device(camsys_dev); - if (ret) - return ret; - } - - dma_buf = dma_buf_get(iommu->map_fd); - if (IS_ERR(dma_buf)) - return PTR_ERR(dma_buf); - attach = dma_buf_attach(dma_buf, dev); - if (IS_ERR(attach)) { - dma_buf_put(dma_buf); - return PTR_ERR(attach); - } - sgt = dma_buf_map_attachment(attach, DMA_BIDIRECTIONAL); - if (IS_ERR(sgt)) { - dma_buf_detach(dma_buf, attach); - dma_buf_put(dma_buf); - return PTR_ERR(sgt); - } - dma_addr = sg_dma_address(sgt->sgl); - camsys_dev->dma_buf[index].dma_addr = dma_addr; - camsys_dev->dma_buf[index].attach = attach; - camsys_dev->dma_buf[index].dma_buf = dma_buf; - camsys_dev->dma_buf[index].sgt = sgt; - camsys_dev->dma_buf[index].fd = iommu->map_fd; - iommu->linear_addr = dma_addr; - iommu->len = sg_dma_len(sgt->sgl); - camsys_dev->dma_buf_cnt++; - camsys_trace - ( - 2, - "dma buf map: dma_addr 0x%lx,attach %p," - "dma_buf %p,sgt %p,fd %d,buf_cnt %d", - (unsigned long)dma_addr, - attach, - dma_buf, - sgt, - iommu->map_fd, - camsys_dev->dma_buf_cnt); - } else { - if ( - (camsys_dev->dma_buf_cnt == 0) || - (index < 0) || - (index >= CAMSYS_DMA_BUF_MAX_NUM)) - return -EINVAL; - - for (index = 0; index < CAMSYS_DMA_BUF_MAX_NUM; index++) { - if (camsys_dev->dma_buf[index].fd == iommu->map_fd || - /* force release */ - (camsys_dev->dma_buf[index].fd != -1 && - iommu->client_fd == -1)) - break; - } - if (index == CAMSYS_DMA_BUF_MAX_NUM) { - camsys_warn("can't find map fd %d", iommu->map_fd); - return -EINVAL; - } - attach = camsys_dev->dma_buf[index].attach; - dma_buf = camsys_dev->dma_buf[index].dma_buf; - sgt = camsys_dev->dma_buf[index].sgt; - dma_addr = sg_dma_address(sgt->sgl); - camsys_trace - ( - 2, - "dma buf unmap: dma_addr 0x%lx,attach %p," - "dma_buf %p,sgt %p,index %d", - (unsigned long)dma_addr, - attach, - dma_buf, - sgt, - index); - dma_buf_unmap_attachment(attach, sgt, DMA_BIDIRECTIONAL); - dma_buf_detach(dma_buf, attach); - dma_buf_put(dma_buf); - if (camsys_dev->dma_buf_cnt == 1) - camsys_drm_dma_detach_device(camsys_dev); - - camsys_dev->dma_buf_cnt--; - camsys_dev->dma_buf[index].fd = -1; - } - - return ret; -} - -static int camsys_mrv_reset_cb(void *ptr, unsigned int on) -{ - camsys_dev_t *camsys_dev = (camsys_dev_t *)ptr; - camsys_soc_priv_t *soc; - - if (camsys_dev->soc) { - soc = (camsys_soc_priv_t *)camsys_dev->soc; - if (soc->soc_cfg) { - (soc->soc_cfg) - (camsys_dev, Isp_SoftRst, - (void *)(unsigned long)on); - } else { - camsys_err("camsys_dev->soc->soc_cfg is NULL!"); - } - } else { - camsys_err("camsys_dev->soc is NULL!"); - } - - return 0; -} - -static int camsys_mrv_clkin_cb(void *ptr, unsigned int on) -{ - camsys_dev_t *camsys_dev = (camsys_dev_t *)ptr; - camsys_mrv_clk_t *clk = (camsys_mrv_clk_t *)camsys_dev->clk; - unsigned long isp_clk; - - if (CHIP_TYPE == 3399) { - if (on && !clk->in_on) { - rockchip_set_system_status(SYS_STATUS_ISP); - if (on == 1) - isp_clk = 210000000; - else - isp_clk = 420000000; - - if (strstr(camsys_dev->miscdev.name, - "camsys_marvin1")) { - clk_set_rate(clk->clk_isp1, isp_clk); - clk_prepare_enable(clk->hclk_isp1_noc); - clk_prepare_enable(clk->hclk_isp1_wrapper); - clk_prepare_enable(clk->aclk_isp1_noc); - clk_prepare_enable(clk->aclk_isp1_wrapper); - clk_prepare_enable(clk->clk_isp1); - - clk_prepare_enable(clk->cif_clk_out); - clk_prepare_enable(clk->pclk_dphy_ref); - clk_prepare_enable(clk->pclk_dphytxrx); - - clk_prepare_enable(clk->pclkin_isp); - clk_prepare_enable(clk->cif_clk_out); - } else { - clk_set_rate(clk->clk_isp0, isp_clk); - clk_prepare_enable(clk->hclk_isp0_noc); - clk_prepare_enable(clk->hclk_isp0_wrapper); - clk_prepare_enable(clk->aclk_isp0_noc); - clk_prepare_enable(clk->aclk_isp0_wrapper); - clk_prepare_enable(clk->clk_isp0); - clk_prepare_enable(clk->cif_clk_out); - clk_prepare_enable(clk->pclk_dphyrx); - clk_prepare_enable(clk->pclk_dphy_ref); - } - - clk->in_on = true; - pm_runtime_get_sync(&camsys_dev->pdev->dev); - camsys_trace(1, "%s clock(f: %ld Hz) in turn on", - dev_name(camsys_dev->miscdev.this_device), - isp_clk); - camsys_mrv_reset_cb(ptr, 1); - udelay(100); - camsys_mrv_reset_cb(ptr, 0); - } else if (!on && clk->in_on) { - pm_runtime_put_sync(&camsys_dev->pdev->dev); - if (strstr(camsys_dev->miscdev.name, - "camsys_marvin1")) { - clk_disable_unprepare(clk->hclk_isp1_noc); - clk_disable_unprepare(clk->hclk_isp1_wrapper); - clk_disable_unprepare(clk->aclk_isp1_noc); - clk_disable_unprepare(clk->aclk_isp1_wrapper); - clk_disable_unprepare(clk->clk_isp1); - - clk_disable_unprepare(clk->cif_clk_out); - clk_disable_unprepare(clk->pclk_dphytxrx); - clk_disable_unprepare(clk->pclk_dphy_ref); - - clk_disable_unprepare(clk->pclkin_isp); - } else { - clk_disable_unprepare(clk->hclk_isp0_noc); - clk_disable_unprepare(clk->hclk_isp0_wrapper); - clk_disable_unprepare(clk->aclk_isp0_noc); - clk_disable_unprepare(clk->aclk_isp0_wrapper); - clk_disable_unprepare(clk->clk_isp0); - - clk_disable_unprepare(clk->cif_clk_out); - clk_disable_unprepare(clk->pclk_dphyrx); - clk_disable_unprepare(clk->pclk_dphy_ref); - } - - rockchip_clear_system_status(SYS_STATUS_ISP); - clk->in_on = false; - camsys_trace(1, "%s clock in turn off", - dev_name(camsys_dev->miscdev.this_device)); - } - } else{ - if (on && !clk->in_on) { - rockchip_set_system_status(SYS_STATUS_ISP); - - if (CHIP_TYPE == 3288) { - isp_clk = 420000000; - camsys_trace(1, "%s isp_clk: 420Mhz; CHIP TYPE is %d", - dev_name(camsys_dev->miscdev.this_device), - CHIP_TYPE); - } else { - if (on == 1) - isp_clk = 210000000; - else - isp_clk = 420000000; - } - - clk_set_rate(clk->isp, isp_clk); - clk_set_rate(clk->isp_jpe, isp_clk); - - /* clk_prepare_enable(clk->pd_isp); */ - clk_prepare_enable(clk->aclk_isp); - clk_prepare_enable(clk->hclk_isp); - clk_prepare_enable(clk->isp); - clk_prepare_enable(clk->isp_jpe); - clk_prepare_enable(clk->pclkin_isp); - if (CHIP_TYPE == 3368 || CHIP_TYPE == 3366 || - CHIP_TYPE == 3326) { - clk_prepare_enable(clk->cif_clk_out); - clk_prepare_enable(clk->pclk_dphyrx); - } else { - clk_prepare_enable(clk->clk_mipi_24m); - } - clk->in_on = true; - pm_runtime_get_sync(&camsys_dev->pdev->dev); - camsys_trace(1, "%s clock(f: %ld Hz) in turn on", - dev_name(camsys_dev->miscdev.this_device), isp_clk); - camsys_mrv_reset_cb(ptr, 1); - udelay(100); - camsys_mrv_reset_cb(ptr, 0); - } else if (!on && clk->in_on) { - pm_runtime_put_sync(&camsys_dev->pdev->dev); - clk_disable_unprepare(clk->aclk_isp); - clk_disable_unprepare(clk->hclk_isp); - clk_disable_unprepare(clk->isp); - clk_disable_unprepare(clk->isp_jpe); - clk_disable_unprepare(clk->pclkin_isp); - if (CHIP_TYPE == 3368 || CHIP_TYPE == 3366 || - CHIP_TYPE == 3326) { - clk_disable_unprepare(clk->cif_clk_out); - clk_disable_unprepare(clk->pclk_dphyrx); - } else { - clk_disable_unprepare(clk->clk_mipi_24m); - } - /* clk_disable_unprepare(clk->pd_isp); */ - - rockchip_clear_system_status(SYS_STATUS_ISP); - clk->in_on = false; - camsys_trace(1, "%s clock in turn off", - dev_name(camsys_dev->miscdev.this_device)); - } - } - - return 0; -} - -static int camsys_mrv_clkout_cb(void *ptr, unsigned int on, unsigned int inclk) -{ - camsys_dev_t *camsys_dev = (camsys_dev_t *)ptr; - camsys_mrv_clk_t *clk = (camsys_mrv_clk_t *)camsys_dev->clk; - - mutex_lock(&clk->lock); - if (on && (clk->out_on != on)) { - clk_set_rate(clk->cif_clk_out, inclk); - clk_prepare_enable(clk->cif_clk_out); - clk->out_on = on; - camsys_trace(1, "%s clock out(rate: %dHz) turn on", - dev_name(camsys_dev->miscdev.this_device), - inclk); - } else if (!on && clk->out_on) { - if (!IS_ERR_OR_NULL(clk->cif_clk_pll)) { - clk_set_parent(clk->cif_clk_out, - clk->cif_clk_pll); - } else { - camsys_warn("%s clock out may be not off!", - dev_name(camsys_dev->miscdev.this_device)); - } - - clk_disable_unprepare(clk->cif_clk_out); - clk->out_on = 0; - - camsys_trace(1, "%s clock out turn off", - dev_name(camsys_dev->miscdev.this_device)); - } - mutex_unlock(&clk->lock); - - return 0; -} -static irqreturn_t camsys_mrv_irq(int irq, void *data) -{ - camsys_dev_t *camsys_dev = (camsys_dev_t *)data; - camsys_irqstas_t *irqsta; - camsys_irqpool_t *irqpool; - unsigned int isp_mis, mipi_mis, mi_mis, *mis, jpg_mis, jpg_err_mis; - unsigned int mi_ris, mi_imis; - static unsigned int mipi_frame; - - isp_mis = __raw_readl((void volatile *) - (camsys_dev->devmems.registermem->vir_base + - MRV_ISP_MIS)); - mipi_mis = __raw_readl((void volatile *) - (camsys_dev->devmems.registermem->vir_base + - MRV_MIPI_MIS)); - jpg_mis = __raw_readl((void volatile *) - (camsys_dev->devmems.registermem->vir_base + - MRV_JPG_MIS)); - jpg_err_mis = __raw_readl((void volatile *) - (camsys_dev->devmems.registermem->vir_base + - MRV_JPG_ERR_MIS)); - mi_mis = __raw_readl((void volatile *) - (camsys_dev->devmems.registermem->vir_base + - MRV_MI_MIS)); - - mi_ris = __raw_readl((void volatile *) - (camsys_dev->devmems.registermem->vir_base + - MRV_MI_RIS)); - mi_imis = __raw_readl((void volatile *) - (camsys_dev->devmems.registermem->vir_base + - MRV_MI_IMIS)); - while ((mi_ris & mi_imis) != mi_mis) { - camsys_trace(2, "mi_mis status erro,mi_mis 0x%x," - "mi_ris 0x%x,imis 0x%x\n", - mi_mis, mi_ris, mi_imis); - mi_mis = __raw_readl((void volatile *) - (camsys_dev->devmems.registermem->vir_base + - MRV_MI_MIS)); - mi_ris = __raw_readl((void volatile *) - (camsys_dev->devmems.registermem->vir_base + - MRV_MI_RIS)); - mi_imis = __raw_readl((void volatile *) - (camsys_dev->devmems.registermem->vir_base + - MRV_MI_IMIS)); - } - - if (isp_mis & MIS_V_START) { - mipi_frame = __raw_readl((void *) - (camsys_dev->devmems.registermem->vir_base + - MRV_MIPI_FRAME)); - camsys_trace(2, "mipi_frame: 0x%08x \r\n", mipi_frame); - } - - __raw_writel(isp_mis, (void volatile *) - (camsys_dev->devmems.registermem->vir_base + - MRV_ISP_ICR)); - __raw_writel(mipi_mis, (void volatile *) - (camsys_dev->devmems.registermem->vir_base + - MRV_MIPI_ICR)); - __raw_writel(jpg_mis, (void volatile *) - (camsys_dev->devmems.registermem->vir_base + - MRV_JPG_ICR)); - __raw_writel(jpg_err_mis, (void volatile *) - (camsys_dev->devmems.registermem->vir_base + - MRV_JPG_ERR_ICR)); - __raw_writel(mi_mis, (void volatile *) - (camsys_dev->devmems.registermem->vir_base + - MRV_MI_ICR)); - - spin_lock(&camsys_dev->irq.lock); - if (!list_empty(&camsys_dev->irq.irq_pool)) { - list_for_each_entry(irqpool, &camsys_dev->irq.irq_pool, list) { - if (irqpool->pid != 0) { - switch (irqpool->mis) { - case MRV_ISP_MIS: - { - mis = &isp_mis; - break; - } - - case MRV_MIPI_MIS: - { - mis = &mipi_mis; - break; - } - case MRV_MI_MIS: - { - mis = &mi_mis; - break; - } - - case MRV_JPG_MIS: - { - mis = &jpg_mis; - break; - } - - case MRV_JPG_ERR_MIS: - { - mis = &jpg_err_mis; - break; - } - - default: - { - camsys_trace(2, - "Thread(pid:%d) irqpool mis(%d) is invalidate", - irqpool->pid, irqpool->mis); - goto end; - } - } - - if (*mis != 0) { - spin_lock(&irqpool->lock); - if (!list_empty(&irqpool->deactive)) { - irqsta = - list_first_entry( - &irqpool->deactive, - camsys_irqstas_t, - list); - irqsta->sta.mis = *mis; - irqsta->sta.fs_id = - mipi_frame & 0xFFFF; - irqsta->sta.fe_id = - (mipi_frame >> 16) - & 0xFFFF; - list_del_init(&irqsta->list); - list_add_tail(&irqsta->list, - &irqpool->active); - wake_up(&irqpool->done); - } - spin_unlock(&irqpool->lock); - } - } - } - } -end: - spin_unlock(&camsys_dev->irq.lock); - - return IRQ_HANDLED; -} - -static int camsys_mrv_remove_cb(struct platform_device *pdev) -{ - camsys_dev_t *camsys_dev = platform_get_drvdata(pdev); - camsys_mrv_clk_t *mrv_clk = NULL; - - if (camsys_dev->clk != NULL) { - - mrv_clk = (camsys_mrv_clk_t *)camsys_dev->clk; - if (mrv_clk->out_on) - camsys_mrv_clkout_cb(mrv_clk, 0, 0); - if (mrv_clk->in_on) - camsys_mrv_clkin_cb(mrv_clk, 0); - - if (!IS_ERR_OR_NULL(mrv_clk->pd_isp)) { - devm_clk_put(&pdev->dev, mrv_clk->pd_isp); - } - if (!IS_ERR_OR_NULL(mrv_clk->aclk_isp)) { - devm_clk_put(&pdev->dev, mrv_clk->aclk_isp); - } - if (!IS_ERR_OR_NULL(mrv_clk->hclk_isp)) { - devm_clk_put(&pdev->dev, mrv_clk->hclk_isp); - } - if (!IS_ERR_OR_NULL(mrv_clk->isp)) { - devm_clk_put(&pdev->dev, mrv_clk->isp); - } - if (!IS_ERR_OR_NULL(mrv_clk->isp_jpe)) { - devm_clk_put(&pdev->dev, mrv_clk->isp_jpe); - } - if (!IS_ERR_OR_NULL(mrv_clk->pclkin_isp)) { - devm_clk_put(&pdev->dev, mrv_clk->pclkin_isp); - } - if (!IS_ERR_OR_NULL(mrv_clk->cif_clk_out)) { - devm_clk_put(&pdev->dev, mrv_clk->cif_clk_out); - } - if (!IS_ERR_OR_NULL(mrv_clk->clk_vio0_noc)) { - devm_clk_put(&pdev->dev, mrv_clk->clk_vio0_noc); - } - - if (!IS_ERR_OR_NULL(mrv_clk->hclk_isp0_noc)) { - devm_clk_put(&pdev->dev, mrv_clk->hclk_isp0_noc); - } - if (!IS_ERR_OR_NULL(mrv_clk->hclk_isp0_wrapper)) { - devm_clk_put(&pdev->dev, mrv_clk->hclk_isp0_wrapper); - } - if (!IS_ERR_OR_NULL(mrv_clk->hclk_isp1_noc)) { - devm_clk_put(&pdev->dev, mrv_clk->hclk_isp1_noc); - } - if (!IS_ERR_OR_NULL(mrv_clk->hclk_isp1_wrapper)) { - devm_clk_put(&pdev->dev, mrv_clk->hclk_isp1_wrapper); - } - if (!IS_ERR_OR_NULL(mrv_clk->aclk_isp0_noc)) { - devm_clk_put(&pdev->dev, mrv_clk->aclk_isp0_noc); - } - - if (!IS_ERR_OR_NULL(mrv_clk->aclk_isp0_wrapper)) { - devm_clk_put(&pdev->dev, mrv_clk->aclk_isp0_wrapper); - } - if (!IS_ERR_OR_NULL(mrv_clk->aclk_isp1_noc)) { - devm_clk_put(&pdev->dev, mrv_clk->aclk_isp1_noc); - } - if (!IS_ERR_OR_NULL(mrv_clk->aclk_isp1_wrapper)) { - devm_clk_put(&pdev->dev, mrv_clk->aclk_isp1_wrapper); - } - if (!IS_ERR_OR_NULL(mrv_clk->clk_isp0)) { - devm_clk_put(&pdev->dev, mrv_clk->clk_isp0); - } - if (!IS_ERR_OR_NULL(mrv_clk->clk_isp1)) { - devm_clk_put(&pdev->dev, mrv_clk->clk_isp1); - } - if (!IS_ERR_OR_NULL(mrv_clk->pclkin_isp1)) { - devm_clk_put(&pdev->dev, mrv_clk->pclkin_isp1); - } - pm_runtime_disable(&pdev->dev); - kfree(mrv_clk); - mrv_clk = NULL; - } - - camsys_drm_dma_detach_device(camsys_dev); - iommu_group_remove_device(&camsys_dev->pdev->dev); - iommu_put_dma_cookie(camsys_dev->domain); - iommu_domain_free(camsys_dev->domain); - - return 0; -} -int camsys_mrv_probe_cb(struct platform_device *pdev, camsys_dev_t *camsys_dev) -{ - int err = 0; - camsys_mrv_clk_t *mrv_clk = NULL; - struct resource register_res; - struct iommu_domain *domain = NULL; - struct iommu_group *group; - struct device_node *np; - - err = of_address_to_resource(pdev->dev.of_node, 0, ®ister_res); - if (err < 0) { - camsys_err( - "Get register resource from %s platform device failed!", - pdev->name); - } - - err = request_irq(camsys_dev->irq.irq_id, camsys_mrv_irq, - IRQF_SHARED, CAMSYS_MARVIN_IRQNAME, - camsys_dev); - if (err) { - camsys_err("request irq for %s failed", CAMSYS_MARVIN_IRQNAME); - goto end; - } - - /* Clk and Iomux init */ - mrv_clk = kzalloc(sizeof(camsys_mrv_clk_t), GFP_KERNEL); - if (mrv_clk == NULL) { - camsys_err("Allocate camsys_mrv_clk_t failed!"); - err = -EINVAL; - goto clk_failed; - } - if (CHIP_TYPE == 3368 || CHIP_TYPE == 3366 || - CHIP_TYPE == 3326) { - pm_runtime_enable(&pdev->dev); - /* mrv_clk->pd_isp = devm_clk_get(&pdev->dev, "pd_isp"); */ - mrv_clk->aclk_isp = devm_clk_get(&pdev->dev, "aclk_isp"); - mrv_clk->hclk_isp = devm_clk_get(&pdev->dev, "hclk_isp"); - mrv_clk->isp = devm_clk_get(&pdev->dev, "clk_isp"); - mrv_clk->isp_jpe = devm_clk_get(&pdev->dev, "clk_isp_jpe"); - mrv_clk->pclkin_isp = devm_clk_get(&pdev->dev, "pclkin_isp"); - mrv_clk->cif_clk_out = devm_clk_get(&pdev->dev, "clk_cif_out"); - mrv_clk->cif_clk_pll = devm_clk_get(&pdev->dev, "clk_cif_pll"); - mrv_clk->pclk_dphyrx = devm_clk_get(&pdev->dev, "pclk_dphyrx"); - if (CHIP_TYPE == 3368) { - mrv_clk->clk_vio0_noc = - devm_clk_get(&pdev->dev, "clk_vio0_noc"); - if (IS_ERR_OR_NULL(mrv_clk->clk_vio0_noc)) { - camsys_err("Get %s clock resouce failed!\n", - miscdev_name); - err = -EINVAL; - goto clk_failed; - } - - } - - if (IS_ERR_OR_NULL(mrv_clk->aclk_isp) || - IS_ERR_OR_NULL(mrv_clk->hclk_isp) || - IS_ERR_OR_NULL(mrv_clk->isp) || - IS_ERR_OR_NULL(mrv_clk->isp_jpe) || - IS_ERR_OR_NULL(mrv_clk->pclkin_isp) || - IS_ERR_OR_NULL(mrv_clk->cif_clk_out) || - IS_ERR_OR_NULL(mrv_clk->pclk_dphyrx)) { - camsys_err("Get %s clock resouce failed!\n", - miscdev_name); - err = -EINVAL; - goto clk_failed; - } - - clk_set_rate(mrv_clk->isp, 210000000); - clk_set_rate(mrv_clk->isp_jpe, 210000000); - - } else if (CHIP_TYPE == 3399) { - - pm_runtime_enable(&pdev->dev); - if (register_res.start == 0xff920000) { - mrv_clk->hclk_isp1_noc = - devm_clk_get(&pdev->dev, "hclk_isp1_noc"); - mrv_clk->hclk_isp1_wrapper = - devm_clk_get(&pdev->dev, "hclk_isp1_wrapper"); - mrv_clk->aclk_isp1_noc = - devm_clk_get(&pdev->dev, "aclk_isp1_noc"); - mrv_clk->aclk_isp1_wrapper = - devm_clk_get(&pdev->dev, "aclk_isp1_wrapper"); - mrv_clk->clk_isp1 = - devm_clk_get(&pdev->dev, "clk_isp1"); - mrv_clk->pclkin_isp = - devm_clk_get(&pdev->dev, "pclk_isp1"); - mrv_clk->pclk_dphytxrx = - devm_clk_get(&pdev->dev, "pclk_dphytxrx"); - } else{ - mrv_clk->hclk_isp0_noc = - devm_clk_get(&pdev->dev, "hclk_isp0_noc"); - mrv_clk->hclk_isp0_wrapper = - devm_clk_get(&pdev->dev, "hclk_isp0_wrapper"); - mrv_clk->aclk_isp0_noc = - devm_clk_get(&pdev->dev, "aclk_isp0_noc"); - mrv_clk->aclk_isp0_wrapper = - devm_clk_get(&pdev->dev, "aclk_isp0_wrapper"); - mrv_clk->clk_isp0 = - devm_clk_get(&pdev->dev, "clk_isp0"); - mrv_clk->pclk_dphyrx = - devm_clk_get(&pdev->dev, "pclk_dphyrx"); - } - mrv_clk->cif_clk_out = - devm_clk_get(&pdev->dev, "clk_cif_out"); - mrv_clk->cif_clk_pll = - devm_clk_get(&pdev->dev, "clk_cif_pll"); - mrv_clk->pclk_dphy_ref = - devm_clk_get(&pdev->dev, "pclk_dphy_ref"); - if (register_res.start == 0xff920000) { - if (IS_ERR_OR_NULL(mrv_clk->hclk_isp1_noc) || - IS_ERR_OR_NULL(mrv_clk->hclk_isp1_wrapper) || - IS_ERR_OR_NULL(mrv_clk->aclk_isp1_noc) || - IS_ERR_OR_NULL(mrv_clk->aclk_isp1_wrapper) || - IS_ERR_OR_NULL(mrv_clk->clk_isp1) || - IS_ERR_OR_NULL(mrv_clk->cif_clk_out) || - IS_ERR_OR_NULL(mrv_clk->cif_clk_pll) || - IS_ERR_OR_NULL(mrv_clk->pclkin_isp) || - IS_ERR_OR_NULL(mrv_clk->pclk_dphytxrx)) { - camsys_err("Get %s clock resouce failed!\n", - miscdev_name); - err = -EINVAL; - goto clk_failed; - } - } else{ - if (IS_ERR_OR_NULL(mrv_clk->hclk_isp0_noc) || - IS_ERR_OR_NULL(mrv_clk->hclk_isp0_wrapper) || - IS_ERR_OR_NULL(mrv_clk->aclk_isp0_noc) || - IS_ERR_OR_NULL(mrv_clk->aclk_isp0_wrapper) || - IS_ERR_OR_NULL(mrv_clk->clk_isp0) || - IS_ERR_OR_NULL(mrv_clk->cif_clk_out) || - IS_ERR_OR_NULL(mrv_clk->cif_clk_pll) || - IS_ERR_OR_NULL(mrv_clk->pclk_dphyrx)) { - camsys_err("Get %s clock resouce failed!\n", - miscdev_name); - err = -EINVAL; - goto clk_failed; - } - } - } else{ - pm_runtime_enable(&pdev->dev); - /*mrv_clk->pd_isp = */ - /* devm_clk_get(&pdev->dev, "pd_isp");*/ - mrv_clk->aclk_isp = - devm_clk_get(&pdev->dev, "aclk_isp"); - mrv_clk->hclk_isp = - devm_clk_get(&pdev->dev, "hclk_isp"); - mrv_clk->isp = - devm_clk_get(&pdev->dev, "clk_isp"); - mrv_clk->isp_jpe = - devm_clk_get(&pdev->dev, "clk_isp_jpe"); - mrv_clk->pclkin_isp = - devm_clk_get(&pdev->dev, "pclkin_isp"); - mrv_clk->cif_clk_out = - devm_clk_get(&pdev->dev, "clk_cif_out"); - mrv_clk->cif_clk_pll = - devm_clk_get(&pdev->dev, "clk_cif_pll"); - mrv_clk->clk_mipi_24m = - devm_clk_get(&pdev->dev, "clk_mipi_24m"); - - if ( - /*IS_ERR_OR_NULL(mrv_clk->pd_isp) ||*/ - IS_ERR_OR_NULL(mrv_clk->aclk_isp) || - IS_ERR_OR_NULL(mrv_clk->hclk_isp) || - IS_ERR_OR_NULL(mrv_clk->isp) || - IS_ERR_OR_NULL(mrv_clk->isp_jpe) || - IS_ERR_OR_NULL(mrv_clk->pclkin_isp) || - IS_ERR_OR_NULL(mrv_clk->cif_clk_out) || - IS_ERR_OR_NULL(mrv_clk->clk_mipi_24m)) { - camsys_err("Get %s clock resouce failed!\n", - miscdev_name); - err = -EINVAL; - goto clk_failed; - } - - clk_set_rate(mrv_clk->isp, 210000000); - clk_set_rate(mrv_clk->isp_jpe, 210000000); - } - - - mutex_init(&mrv_clk->lock); - - mrv_clk->in_on = false; - mrv_clk->out_on = 0; - - np = of_parse_phandle(pdev->dev.of_node, "iommus", 0); - if (np) { - int index = 0; - /* iommu domain */ - domain = iommu_domain_alloc(&platform_bus_type); - if (!domain) - goto clk_failed; - - err = iommu_get_dma_cookie(domain); - if (err) - goto err_free_domain; - - group = iommu_group_get(&pdev->dev); - if (!group) { - group = iommu_group_alloc(); - if (IS_ERR(group)) { - dev_err(&pdev->dev, "Failed to allocate IOMMU group\n"); - goto err_put_cookie; - } - - err = iommu_group_add_device(group, &pdev->dev); - iommu_group_put(group); - if (err) { - dev_err(&pdev->dev, "failed to add device to IOMMU group\n"); - goto err_put_cookie; - } - } - camsys_dev->domain = domain; - camsys_dev->dma_buf_cnt = 0; - camsys_dev->iommu_cb = camsys_mrv_drm_iommu_cb; - for (index = 0; index < CAMSYS_DMA_BUF_MAX_NUM; index++) - camsys_dev->dma_buf[index].fd = -1; - } else { - camsys_dev->iommu_cb = camsys_mrv_iommu_cb; - } - - camsys_dev->clk = (void *)mrv_clk; - camsys_dev->clkin_cb = camsys_mrv_clkin_cb; - camsys_dev->clkout_cb = camsys_mrv_clkout_cb; - camsys_dev->reset_cb = camsys_mrv_reset_cb; - camsys_dev->iomux = camsys_mrv_iomux_cb; - camsys_dev->flash_trigger_cb = camsys_mrv_flash_trigger_cb; - - camsys_dev->miscdev.minor = MISC_DYNAMIC_MINOR; - camsys_dev->miscdev.name = miscdev_name; - camsys_dev->miscdev.nodename = miscdev_name; - camsys_dev->miscdev.fops = &camsys_fops; - - if (CHIP_TYPE == 3399) { - if (register_res.start == 0xff920000) { - camsys_dev->miscdev.name = "camsys_marvin1"; - camsys_dev->miscdev.nodename = "camsys_marvin1"; - } - } - - err = misc_register(&camsys_dev->miscdev); - if (err < 0) { - camsys_err("misc register %s failed!", miscdev_name); - goto misc_register_failed; - } - /* Variable init */ - camsys_dev->dev_id = CAMSYS_DEVID_MARVIN; - camsys_dev->platform_remove = camsys_mrv_remove_cb; - - return 0; -misc_register_failed: - if (!IS_ERR_OR_NULL(camsys_dev->miscdev.this_device)) - misc_deregister(&camsys_dev->miscdev); -err_put_cookie: - if (domain) - iommu_put_dma_cookie(domain); -err_free_domain: - if (domain) - iommu_domain_free(domain); -clk_failed: - if (mrv_clk != NULL) { - if (!IS_ERR_OR_NULL(mrv_clk->pd_isp)) - clk_put(mrv_clk->pd_isp); - - if (!IS_ERR_OR_NULL(mrv_clk->aclk_isp)) - clk_put(mrv_clk->aclk_isp); - - if (!IS_ERR_OR_NULL(mrv_clk->hclk_isp)) - clk_put(mrv_clk->hclk_isp); - - if (!IS_ERR_OR_NULL(mrv_clk->isp)) - clk_put(mrv_clk->isp); - - if (!IS_ERR_OR_NULL(mrv_clk->isp_jpe)) - clk_put(mrv_clk->isp_jpe); - - if (!IS_ERR_OR_NULL(mrv_clk->pclkin_isp)) - clk_put(mrv_clk->pclkin_isp); - - if (!IS_ERR_OR_NULL(mrv_clk->cif_clk_out)) - clk_put(mrv_clk->cif_clk_out); - - if (CHIP_TYPE == 3368 || CHIP_TYPE == 3366 || - CHIP_TYPE == 3326) { - if (!IS_ERR_OR_NULL(mrv_clk->pclk_dphyrx)) - clk_put(mrv_clk->pclk_dphyrx); - - if (!IS_ERR_OR_NULL(mrv_clk->clk_vio0_noc)) - clk_put(mrv_clk->clk_vio0_noc); - } - - kfree(mrv_clk); - mrv_clk = NULL; - } - -end: - return err; -} -EXPORT_SYMBOL_GPL(camsys_mrv_probe_cb); - diff --git a/drivers/media/video/rk_camsys/camsys_marvin.h b/drivers/media/video/rk_camsys/camsys_marvin.h deleted file mode 100644 index 06eed36f4ef2..000000000000 --- a/drivers/media/video/rk_camsys/camsys_marvin.h +++ /dev/null @@ -1,85 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __CAMSYS_MARVIN_H__ -#define __CAMSYS_MARVIN_H__ - -#include "camsys_internal.h" - -#define CAMSYS_MARVIN_IRQNAME "MarvinIrq" - -#define MIS_V_START BIT(6) - -#define MRV_ISP_BASE 0x400 -#define MRV_ISP_RIS (MRV_ISP_BASE + 0x1c0) -#define MRV_ISP_MIS (MRV_ISP_BASE + 0x1c4) -#define MRV_ISP_ICR (MRV_ISP_BASE + 0x1c8) - -#define MRV_MIPI_BASE 0x1C00 -#define MRV_MIPI_MIS (MRV_MIPI_BASE + 0x10) -#define MRV_MIPI_ICR (MRV_MIPI_BASE + 0x14) -#define MRV_MIPI_FRAME (MRV_MIPI_BASE + 0x40) - -#define MRV_MI_BASE (0x1400) - -#define MRV_MI_MP_Y_OFFS_CNT_START (MRV_MI_BASE + 0x14) -#define MRV_MI_INIT (MRV_MI_BASE + 0x4) -#define MRV_MI_MP_Y_BASE_AD (MRV_MI_BASE + 0x8) -#define MRV_MI_Y_BASE_AD_SHD (MRV_MI_BASE + 0x78) -#define MRV_MI_Y_OFFS_CNT_SHD (MRV_MI_BASE + 0x80) -#define MRV_MI_IMIS (MRV_MI_BASE + 0xf8) -#define MRV_MI_RIS (MRV_MI_BASE + 0xfc) -#define MRV_MI_MIS (MRV_MI_BASE + 0x100) -#define MRV_MI_ICR (MRV_MI_BASE + 0x104) - -#define MRV_FLASH_CONFIG (0x664) - -#define MRV_JPG_BASE (0x1800) -#define MRV_JPG_ERR_RIS (MRV_JPG_BASE + 0x6C) -#define MRV_JPG_ERR_MIS (MRV_JPG_BASE + 0x70) -#define MRV_JPG_ERR_ICR (MRV_JPG_BASE + 0x74) -#define MRV_JPG_MIS (MRV_JPG_BASE + 0x84) -#define MRV_JPG_RIS (MRV_JPG_BASE + 0x80) -#define MRV_JPG_ICR (MRV_JPG_BASE + 0x88) - -typedef enum IO_USE_TYPE_e { - USE_AS_GPIO, - USE_AS_ISP_INTERNAL, -} IO_USE_TYPE_t; - -typedef struct camsys_mrv_clk_s { - struct clk *pd_isp; - struct clk *hclk_isp; - struct clk *aclk_isp; - struct clk *isp; - struct clk *isp_jpe; - struct clk *pclkin_isp; - struct clk *clk_mipi_24m; - struct clk *clk_vio0_noc; - bool in_on; - - struct clk *cif_clk_out; - struct clk *cif_clk_pll; - struct clk *pclk_dphyrx; - - unsigned int out_on; - - struct clk *hclk_isp0_noc; - struct clk *hclk_isp0_wrapper; - struct clk *hclk_isp1_noc; - struct clk *hclk_isp1_wrapper; - struct clk *aclk_isp0_noc; - struct clk *aclk_isp0_wrapper; - struct clk *aclk_isp1_noc; - struct clk *aclk_isp1_wrapper; - struct clk *clk_isp0; - struct clk *clk_isp1; - struct clk *pclkin_isp1; - struct clk *pclk_dphy_ref; - struct clk *pclk_dphytxrx; - - struct mutex lock; -} camsys_mrv_clk_t; - -int camsys_mrv_probe_cb(struct platform_device *pdev, camsys_dev_t *camsys_dev); - -#endif - diff --git a/drivers/media/video/rk_camsys/camsys_mipicsi_phy.c b/drivers/media/video/rk_camsys/camsys_mipicsi_phy.c deleted file mode 100644 index fb4b0ab4b4f5..000000000000 --- a/drivers/media/video/rk_camsys/camsys_mipicsi_phy.c +++ /dev/null @@ -1,293 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include "camsys_soc_priv.h" -#include "camsys_mipicsi_phy.h" - -unsigned int CHIP_TYPE; -unsigned long rk_grf_base; -unsigned long rk_cru_base; -unsigned long rk_isp_base; - -static int camsys_mipiphy_clkin_cb(void *ptr, unsigned int on) -{ - camsys_mipiphy_clk_t *clk; - camsys_dev_t *camsys_dev = (camsys_dev_t *)ptr; - unsigned int i, phycnt; - - if (camsys_dev->mipiphy != NULL) { - phycnt = camsys_dev->mipiphy[0].phycnt; - - for (i = 0; i < phycnt; i++) { - if (camsys_dev->mipiphy[i].clk != NULL) { - clk = (camsys_mipiphy_clk_t *) - camsys_dev->mipiphy[i].clk; - if (on && !clk->on) { - if (!IS_ERR_OR_NULL(clk->hclk)) - clk_prepare_enable(clk->hclk); - clk->on = on; - } else if (!on && clk->on) { - if (!IS_ERR_OR_NULL(clk->hclk)) - clk_disable_unprepare - (clk->hclk); - clk->on = on; - } - } - } - } - if (on) - camsys_trace(2, "%s mipiphy clk turn on", - dev_name(camsys_dev->miscdev.this_device)); - else - camsys_trace(2, "%s mipiphy clk turn off", - dev_name(camsys_dev->miscdev.this_device)); - - return 0; -} - -static int camsys_mipiphy_ops(void *ptr, camsys_mipiphy_t *phy) -{ - camsys_dev_t *camsys_dev = (camsys_dev_t *)ptr; - camsys_mipiphy_soc_para_t para; - camsys_soc_priv_t *soc; - - if (camsys_dev->soc) { - soc = (camsys_soc_priv_t *)camsys_dev->soc; - if (soc->soc_cfg) { - para.camsys_dev = camsys_dev; - para.phy = phy; - (soc->soc_cfg)(camsys_dev, Mipi_Phy_Cfg, (void *)¶); - } else { - camsys_err("camsys_dev->soc->soc_cfg is NULL!"); - } - } else { - camsys_err("camsys_dev->soc is NULL!"); - } - - return 0; -} - -static int camsys_mipiphy_remove_cb(struct platform_device *pdev) -{ - camsys_dev_t *camsys_dev = platform_get_drvdata(pdev); - camsys_mipiphy_clk_t *phyclk; - unsigned int i = 0; - unsigned long vir_base = camsys_dev->mipiphy[i].reg->vir_base; - - if (camsys_dev->mipiphy != NULL) { - for (i = 0; i < camsys_dev->mipiphy[0].phycnt; i++) { - if (camsys_dev->mipiphy[i].reg != NULL) { - if (camsys_dev->mipiphy[i].reg->vir_base != 0) { - iounmap((void __iomem *)vir_base); - vir_base = 0; - } - kfree(camsys_dev->mipiphy[i].reg); - camsys_dev->mipiphy[i].reg = NULL; - } - - if (camsys_dev->mipiphy[i].clk != NULL) { - phyclk = - (camsys_mipiphy_clk_t *) - camsys_dev->mipiphy[i].clk; - devm_clk_put(&pdev->dev, phyclk->hclk); - - kfree(camsys_dev->mipiphy[i].clk); - camsys_dev->mipiphy[i].clk = NULL; - } - } - } - if (CHIP_TYPE == 3368 || CHIP_TYPE == 3366 || - CHIP_TYPE == 3399 || CHIP_TYPE == 3326) { - if (camsys_dev->csiphy_reg != NULL) { - kfree(camsys_dev->csiphy_reg); - camsys_dev->csiphy_reg = NULL; - } - - if (camsys_dev->dsiphy_reg != NULL) { - kfree(camsys_dev->dsiphy_reg); - camsys_dev->dsiphy_reg = NULL; - } - } - - return 0; -} - -int camsys_mipiphy_probe_cb( -struct platform_device *pdev, camsys_dev_t *camsys_dev) -{ - struct device *dev = &pdev->dev; - camsys_meminfo_t *meminfo; - camsys_phyinfo_t *mipiphy; - unsigned int mipiphy_cnt, phyreg[2]; - char str[31]; - struct clk *clk; - camsys_mipiphy_clk_t *phyclk; - int err, i; - struct device_node *node; - - err = of_property_read_u32(dev->of_node, - "rockchip,isp,mipiphy", &mipiphy_cnt); - if (err < 0) { - camsys_err("get property(rockchip,isp,mipiphy) failed!"); - goto fail; - } else { - camsys_trace(2, "%s have %d mipi phy\n", - dev_name(&pdev->dev), mipiphy_cnt); - } - - mipiphy = kzalloc(sizeof(camsys_phyinfo_t)*mipiphy_cnt, GFP_KERNEL); - if (mipiphy == NULL) { - err = -ENOMEM; - camsys_err("malloc camsys_phyinfo_t failed!"); - goto fail; - } - - camsys_dev->mipiphy = mipiphy; - - memset(str, 0x00, sizeof(str)); - for (i = 0; i < mipiphy_cnt; i++) { - meminfo = NULL; - sprintf(str, "rockchip,isp,mipiphy%d,reg", i); - if (of_property_read_u32_array( - dev->of_node, str, phyreg, 2 - ) == 0 - ) { - meminfo = kzalloc(sizeof(camsys_meminfo_t), GFP_KERNEL); - if (meminfo == NULL) { - camsys_err( - "malloc camsys_meminfo_t for mipiphy%d failed!", - i); - } else { - meminfo->vir_base = - (unsigned long) - ioremap(phyreg[0], phyreg[1]); - if (!meminfo->vir_base) { - camsys_err("%s ioremap %s failed", - dev_name(&pdev->dev), str); - } else { - strlcpy(meminfo->name, - CAMSYS_MIPIPHY_MEM_NAME, - sizeof(meminfo->name)); - meminfo->phy_base = phyreg[0]; - meminfo->size = phyreg[1]; - } - camsys_dev->mipiphy[i].reg = meminfo; - } - } - - sprintf(str, "hclk_mipiphy%d", i); - - clk = devm_clk_get(&pdev->dev, str); - if (!IS_ERR_OR_NULL(clk)) { - phyclk = - kzalloc(sizeof(camsys_mipiphy_clk_t), - GFP_KERNEL); - if (phyclk == NULL) { - camsys_err("malloc camsys_mipiphy_clk_t for %s failed!", - str); - } else { - phyclk->hclk = clk; - } - - camsys_dev->mipiphy[i].clk = (void *)phyclk; - } - - camsys_dev->mipiphy[i].phycnt = mipiphy_cnt; - camsys_dev->mipiphy[i].clkin_cb = camsys_mipiphy_clkin_cb; - camsys_dev->mipiphy[i].ops = camsys_mipiphy_ops; - camsys_dev->mipiphy[i].remove = camsys_mipiphy_remove_cb; - - if (meminfo != NULL) { - camsys_trace(1, "%s mipi phy%d probe success " - "(reg_phy: 0x%lx reg_vir: 0x%lx size: 0x%x)\n", - dev_name(&pdev->dev), i, meminfo->phy_base, - meminfo->vir_base, meminfo->size); - } else { - camsys_trace(1, "%s mipi phy%d probe success " - "(reg_phy: 0x%x reg_vir: 0x%x size: 0x%x)\n", - dev_name(&pdev->dev), i, 0, 0, 0); - } - - } - - if (CHIP_TYPE == 3368 || CHIP_TYPE == 3366 || - CHIP_TYPE == 3399 || CHIP_TYPE == 3288 || CHIP_TYPE == 3326) { - - if (CHIP_TYPE == 3399) { - camsys_dev->dsiphy_reg = - kzalloc(sizeof(camsys_meminfo_t), GFP_KERNEL); - if (camsys_dev->dsiphy_reg == NULL) { - camsys_err("malloc camsys_meminfo_t for dsiphy_reg failed!"); - err = -ENOMEM; - goto fail; - } - - if (of_property_read_u32_array( - dev->of_node, - "rockchip,isp,dsiphy,reg", phyreg, 2 - ) == 0 - ) { - camsys_dev->dsiphy_reg->vir_base = - (unsigned long) - ioremap(phyreg[0], phyreg[1]); - if (!camsys_dev->dsiphy_reg->vir_base) { - camsys_err("%s ioremap %s failed", - dev_name(&pdev->dev), - "rockchip,isp,dsiphy,reg"); - } else { - strlcpy(camsys_dev->dsiphy_reg->name, - "Dsi-DPHY", - sizeof(camsys_dev->dsiphy_reg->name)); - camsys_dev->dsiphy_reg->phy_base = phyreg[0]; - camsys_dev->dsiphy_reg->size = phyreg[1]; - } - } - - } else { - camsys_dev->csiphy_reg = - kzalloc(sizeof(camsys_meminfo_t), GFP_KERNEL); - if (camsys_dev->csiphy_reg == NULL) { - camsys_err("malloc camsys_meminfo_t for csiphy_reg failed!"); - err = -ENOMEM; - goto fail; - } - - if (of_property_read_u32_array( - dev->of_node, - "rockchip,isp,csiphy,reg", phyreg, 2 - ) == 0 - ) { - camsys_dev->csiphy_reg->vir_base = - (unsigned long) - ioremap(phyreg[0], phyreg[1]); - if (!camsys_dev->csiphy_reg->vir_base) { - camsys_err("%s ioremap %s failed", - dev_name(&pdev->dev), - "rockchip,isp,csiphy,reg"); - } else { - strlcpy(camsys_dev->csiphy_reg->name, - "Csi-DPHY", - sizeof(camsys_dev->csiphy_reg->name)); - camsys_dev->csiphy_reg->phy_base = - phyreg[0]; - camsys_dev->csiphy_reg->size = - phyreg[1]; - } - } - } - - /* get cru base */ - node = of_parse_phandle(dev->of_node, "rockchip,cru", 0); - camsys_dev->rk_cru_base = (unsigned long)of_iomap(node, 0); - camsys_trace(2, "rk_cru_base=0x%lx", camsys_dev->rk_cru_base); - /* get grf base */ - node = of_parse_phandle(dev->of_node, "rockchip,grf", 0); - camsys_dev->rk_grf_base = (unsigned long)of_iomap(node, 0); - camsys_trace(2, "rk_grf_base=0x%lx", camsys_dev->rk_grf_base); - } - - return 0; - -fail: - - return err; -} - diff --git a/drivers/media/video/rk_camsys/camsys_mipicsi_phy.h b/drivers/media/video/rk_camsys/camsys_mipicsi_phy.h deleted file mode 100644 index 97ad2237b136..000000000000 --- a/drivers/media/video/rk_camsys/camsys_mipicsi_phy.h +++ /dev/null @@ -1,15 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __CAMSYS_MIPICSI_PHY_H__ -#define __CAMSYS_MIPICSI_PHY_H__ - -#include "camsys_internal.h" - -typedef struct camsys_mipiphy_clk_s { - struct clk *hclk; - - unsigned int on; -} camsys_mipiphy_clk_t; - -int camsys_mipiphy_probe_cb -(struct platform_device *pdev, camsys_dev_t *camsys_dev); -#endif diff --git a/drivers/media/video/rk_camsys/camsys_soc_priv.c b/drivers/media/video/rk_camsys/camsys_soc_priv.c deleted file mode 100644 index 2bdd07b42cb0..000000000000 --- a/drivers/media/video/rk_camsys/camsys_soc_priv.c +++ /dev/null @@ -1,80 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ - -#include "camsys_soc_priv.h" - - -static camsys_soc_priv_t *camsys_soc_p; - -#ifdef CONFIG_ARM64 -extern int camsys_rk3368_cfg( - camsys_dev_t *camsys_dev, camsys_soc_cfg_t cfg_cmd, void *cfg_para); -extern int camsys_rk3366_cfg( - camsys_dev_t *camsys_dev, camsys_soc_cfg_t cfg_cmd, void *cfg_para); -extern int camsys_rk3399_cfg( - camsys_dev_t *camsys_dev, camsys_soc_cfg_t cfg_cmd, void *cfg_para); -extern int camsys_rk3326_cfg( - camsys_dev_t *camsys_dev, camsys_soc_cfg_t cfg_cmd, void *cfg_para); -#else -extern int camsys_rk3288_cfg( - camsys_dev_t *camsys_dev, camsys_soc_cfg_t cfg_cmd, void *cfg_para); -#endif -camsys_soc_priv_t *camsys_soc_get(void) -{ - if (camsys_soc_p != NULL) { - return camsys_soc_p; - } else { - return NULL; - } -} - -int camsys_soc_init(unsigned int chip_type) -{ - camsys_soc_p = kzalloc(sizeof(camsys_soc_priv_t), GFP_KERNEL); - if (camsys_soc_p == NULL) { - camsys_err("malloc camsys_soc_priv_t failed!"); - goto fail; - } - -#ifdef CONFIG_ARM64 - if (chip_type == 3368) { - strlcpy(camsys_soc_p->name, "camsys_rk3368", 31); - camsys_soc_p->soc_cfg = camsys_rk3368_cfg; - camsys_trace(2, "rk3368 exit!"); - } else if (chip_type == 3366) { - strlcpy(camsys_soc_p->name, "camsys_rk3366", 31); - camsys_soc_p->soc_cfg = camsys_rk3366_cfg; - camsys_trace(2, "rk3366 exit!"); - } else if (chip_type == 3399) { - strlcpy(camsys_soc_p->name, "camsys_rk3399", 31); - camsys_soc_p->soc_cfg = camsys_rk3399_cfg; - camsys_trace(2, "rk3399 exit!"); - } else if (chip_type == 3326) { - strlcpy(camsys_soc_p->name, "camsys_rk3326", 31); - camsys_soc_p->soc_cfg = camsys_rk3326_cfg; - camsys_trace(2, "rk3326 exit!"); - } -#else - if (chip_type == 3288) { - strlcpy(camsys_soc_p->name, "camsys_rk3288", 31); - camsys_soc_p->soc_cfg = camsys_rk3288_cfg; - camsys_trace(2, "rk3288 exit!"); - } -#endif - - return 0; -fail: - if (camsys_soc_p != NULL) { - kfree(camsys_soc_p); - camsys_soc_p = NULL; - } - return -1; -} - -int camsys_soc_deinit(void) -{ - if (camsys_soc_p != NULL) { - kfree(camsys_soc_p); - camsys_soc_p = NULL; - } - return 0; -} diff --git a/drivers/media/video/rk_camsys/camsys_soc_priv.h b/drivers/media/video/rk_camsys/camsys_soc_priv.h deleted file mode 100644 index 459d0ee15f69..000000000000 --- a/drivers/media/video/rk_camsys/camsys_soc_priv.h +++ /dev/null @@ -1,41 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __RKCAMSYS_SOC_PRIV_H__ -#define __RKCAMSYS_SOC_PRIV_H__ - -#include "camsys_internal.h" - -typedef struct camsys_mipiphy_soc_para_s { - camsys_dev_t *camsys_dev; - camsys_mipiphy_t *phy; -} camsys_mipiphy_soc_para_t; - -typedef enum camsys_soc_cfg_e { - Clk_DriverStrength_Cfg = 0, - Cif_IoDomain_Cfg, - Mipi_Phy_Cfg, - - Isp_SoftRst, -} camsys_soc_cfg_t; - -typedef struct camsys_soc_priv_s { - char name[32]; - - int (*soc_cfg) - (camsys_dev_t *camsys_dev, - camsys_soc_cfg_t cfg_cmd, - void *cfg_para - ); - -} camsys_soc_priv_t; - -extern camsys_soc_priv_t *camsys_soc_get(void); -extern int camsys_soc_init(unsigned int); -extern int camsys_soc_deinit(void); - -extern unsigned long rk_grf_base; -extern unsigned long rk_cru_base; -extern unsigned long rk_isp_base; -extern unsigned int CHIP_TYPE; - -#endif - diff --git a/drivers/media/video/rk_camsys/camsys_soc_rk3288.c b/drivers/media/video/rk_camsys/camsys_soc_rk3288.c deleted file mode 100644 index 9c8769f464c1..000000000000 --- a/drivers/media/video/rk_camsys/camsys_soc_rk3288.c +++ /dev/null @@ -1,404 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifdef CONFIG_ARM -#include "camsys_soc_priv.h" -#include "camsys_soc_rk3288.h" - -struct mipiphy_hsfreqrange_s { - unsigned int range_l; - unsigned int range_h; - unsigned char cfg_bit; -}; - -static struct mipiphy_hsfreqrange_s mipiphy_hsfreqrange[] = { - {80, 90, 0x00}, - {90, 100, 0x10}, - {100, 110, 0x20}, - {110, 130, 0x01}, - {130, 140, 0x11}, - {140, 150, 0x21}, - {150, 170, 0x02}, - {170, 180, 0x12}, - {180, 200, 0x22}, - {200, 220, 0x03}, - {220, 240, 0x13}, - {240, 250, 0x23}, - {250, 270, 0x4}, - {270, 300, 0x14}, - {300, 330, 0x5}, - {330, 360, 0x15}, - {360, 400, 0x25}, - {400, 450, 0x06}, - {450, 500, 0x16}, - {500, 550, 0x07}, - {550, 600, 0x17}, - {600, 650, 0x08}, - {650, 700, 0x18}, - {700, 750, 0x09}, - {750, 800, 0x19}, - {800, 850, 0x29}, - {850, 900, 0x39}, - {900, 950, 0x0a}, - {950, 1000, 0x1a} - -}; - -static int camsys_rk3288_mipiphy0_wr_reg( -unsigned char addr, unsigned char data, camsys_mipiphy_soc_para_t *para) -{ - /* TESTCLK=1 */ - write_grf_reg(GRF_SOC_CON14_OFFSET, - DPHY_RX0_TESTCLK_MASK | DPHY_RX0_TESTCLK); - /* TESTEN =1,TESTDIN=addr */ - write_grf_reg(GRF_SOC_CON14_OFFSET, - ((addr << DPHY_RX0_TESTDIN_OFFSET) - | DPHY_RX0_TESTDIN_MASK | DPHY_RX0_TESTEN | - DPHY_RX0_TESTEN_MASK)); - /* TESTCLK=0 */ - write_grf_reg(GRF_SOC_CON14_OFFSET, - DPHY_RX0_TESTCLK_MASK); - - if (data != 0xff) { /* write data ? */ - /* TESTEN =0,TESTDIN=data */ - write_grf_reg(GRF_SOC_CON14_OFFSET, - ((data << DPHY_RX0_TESTDIN_OFFSET) - | DPHY_RX0_TESTDIN_MASK | DPHY_RX0_TESTEN_MASK)); - - /* TESTCLK=1 */ - write_grf_reg(GRF_SOC_CON14_OFFSET, - DPHY_RX0_TESTCLK_MASK | - DPHY_RX0_TESTCLK); - } - return 0; -} - -#if 0 -static int camsys_rk3288_mipiphy0_rd_reg(unsigned char addr) -{ - return read_grf_reg(GRF_SOC_STATUS21); -} -#endif - -static int camsys_rk3288_mipiphy1_wr_reg( -unsigned int phy_virt, unsigned char addr, unsigned char data) -{ - /* TESTEN =1,TESTDIN=addr */ - write_csihost_reg(CSIHOST_PHY_TEST_CTRL1, (0x00010000 | addr)); - /* TESTCLK=0 */ - write_csihost_reg(CSIHOST_PHY_TEST_CTRL0, 0x00000000); - /* TESTEN =0,TESTDIN=data */ - write_csihost_reg(CSIHOST_PHY_TEST_CTRL1, (0x00000000 | data)); - /* TESTCLK=1 */ - write_csihost_reg(CSIHOST_PHY_TEST_CTRL0, 0x00000002); - - return 0; -} - -static int camsys_rk3288_mipiphy1_rd_reg( -unsigned int phy_virt, unsigned char addr) -{ - return (read_csihost_reg - (((CSIHOST_PHY_TEST_CTRL1) & 0xff00)) >> 8); -} - -static int camsys_rk3288_mipihpy_cfg( -camsys_mipiphy_soc_para_t *para) -{ - unsigned char hsfreqrange = 0xff, i; - struct mipiphy_hsfreqrange_s *hsfreqrange_p; - unsigned int phy_virt, phy_index; - unsigned int *base; - unsigned int data_en_bit, data_en_num = 0; - - phy_index = para->phy->phy_index; - if (para->camsys_dev->mipiphy[phy_index].reg != NULL) { - phy_virt = - para->camsys_dev->mipiphy[phy_index].reg->vir_base; - } else { - phy_virt = 0x00; - } - - if ((para->phy->bit_rate == 0) || - (para->phy->data_en_bit == 0)) { - if (para->phy->phy_index == 0) { - base = - (unsigned int *) - para->camsys_dev->devmems.registermem->vir_base; - *(base + (MRV_MIPI_BASE + MRV_MIPI_CTRL) / 4) - &= ~(0x0f << 8); - camsys_trace(1, "mipi phy 0 standby!"); - } else if (para->phy->phy_index == 1) { - /* SHUTDOWNZ=0 */ - write_csihost_reg - (CSIHOST_PHY_SHUTDOWNZ, 0x00000000); - /* RSTZ=0 */ - write_csihost_reg(CSIHOST_DPHY_RSTZ, 0x00000000); - - camsys_trace(1, "mipi phy 1 standby!"); - } - - return 0; - } - - hsfreqrange_p = mipiphy_hsfreqrange; - for (i = 0; - i < - (sizeof(mipiphy_hsfreqrange) / - sizeof(struct mipiphy_hsfreqrange_s)); - i++) { - if ((para->phy->bit_rate > hsfreqrange_p->range_l) && - (para->phy->bit_rate <= hsfreqrange_p->range_h)) { - hsfreqrange = hsfreqrange_p->cfg_bit; - break; - } - hsfreqrange_p++; - } - - if (hsfreqrange == 0xff) { - camsys_err("mipi phy config bitrate %d Mbps isn't supported!", - para->phy->bit_rate); - hsfreqrange = 0x00; - } - hsfreqrange <<= 1; - - if (para->phy->phy_index == 0) { - write_grf_reg(GRF_SOC_CON6_OFFSET, - MIPI_PHY_DPHYSEL_OFFSET_MASK - | (para->phy->phy_index - << MIPI_PHY_DPHYSEL_OFFSET_BIT)); - - /* set lane num */ - write_grf_reg(GRF_SOC_CON10_OFFSET, - DPHY_RX0_ENABLE_MASK - | (para->phy->data_en_bit - << DPHY_RX0_ENABLE_OFFSET_BITS)); - /* set lan turndisab as 1 */ - write_grf_reg(GRF_SOC_CON10_OFFSET, - DPHY_RX0_TURN_DISABLE_MASK - | (0xf - << DPHY_RX0_TURN_DISABLE_OFFSET_BITS)); - write_grf_reg(GRF_SOC_CON10_OFFSET, - (0x0 << 4) | (0xf << 20)); - /* set lan turnrequest as 0 */ - write_grf_reg(GRF_SOC_CON15_OFFSET, - DPHY_RX0_TURN_REQUEST_MASK - | (0x0 - << DPHY_RX0_TURN_REQUEST_OFFSET_BITS)); - - /* phy start */ - { - /* TESTCLK=1 */ - write_grf_reg(GRF_SOC_CON14_OFFSET, - DPHY_RX0_TESTCLK_MASK - | DPHY_RX0_TESTCLK); - /* TESTCLR=1 */ - write_grf_reg(GRF_SOC_CON14_OFFSET, - DPHY_RX0_TESTCLR_MASK - | DPHY_RX0_TESTCLR); - udelay(100); - /* TESTCLR=0 zyc */ - write_grf_reg(GRF_SOC_CON14_OFFSET, - DPHY_RX0_TESTCLR_MASK); - udelay(100); - - /* set clock lane */ - camsys_rk3288_mipiphy0_wr_reg - (0x34, 0x15, para); - if (para->phy->data_en_bit >= 0x00) - camsys_rk3288_mipiphy0_wr_reg - (0x44, hsfreqrange, para); - if (para->phy->data_en_bit >= 0x01) - camsys_rk3288_mipiphy0_wr_reg( - 0x54, hsfreqrange, para); - if (para->phy->data_en_bit >= 0x04) { - camsys_rk3288_mipiphy0_wr_reg - (0x84, hsfreqrange, para); - camsys_rk3288_mipiphy0_wr_reg - (0x94, hsfreqrange, para); - } - - /* Normal operation */ - camsys_rk3288_mipiphy0_wr_reg(0x0, -1, para); - /* TESTCLK=1 */ - write_grf_reg(GRF_SOC_CON14_OFFSET, - DPHY_RX0_TESTCLK_MASK - | DPHY_RX0_TESTCLK); - /* TESTEN =0 */ - write_grf_reg(GRF_SOC_CON14_OFFSET, - (DPHY_RX0_TESTEN_MASK)); - } - - base = - (unsigned int *) - para->camsys_dev->devmems.registermem->vir_base; - *(base + (MRV_MIPI_BASE + MRV_MIPI_CTRL) / 4) - |= (0x0f << 8); - - } else if (para->phy->phy_index == 1) { - /* 7. Set BASEDIR_N to the desired values. */ - /* Real IC route must set firstly */ - write_grf_reg(GRF_SOC_CON14_OFFSET, - DPHY_TX1RX1_BASEDIR_REC - | DPHY_TX1RX1_BASEDIR_OFFSET); - /* 1'b1: MIPI PHY TX1RX1 1'b0: MIPI PHY RX0 */ - write_grf_reg(GRF_SOC_CON6_OFFSET, - MIPI_PHY_DPHYSEL_OFFSET_MASK - | (para->phy->phy_index - << MIPI_PHY_DPHYSEL_OFFSET_BIT)); - /* 1'b1: CSI host 1'b0: DSI host1 */ - write_grf_reg(GRF_SOC_CON6_OFFSET, - DSI_CSI_TESTBUS_SEL_MASK - | (1 - << DSI_CSI_TESTBUS_SEL_OFFSET_BIT)); - /* 1'b1: isp 1'b0: csi host */ - write_grf_reg(GRF_SOC_CON14_OFFSET, - DPHY_RX1_SRC_SEL_CSI - | DPHY_RX1_SRC_SEL_MASK); - /* 1.Set RSTZ = 1'b0 */ - write_csihost_reg(CSIHOST_DPHY_RSTZ, 0x00000000); - /* 2. Set SHUTDOWNZ = 1'b0. */ - write_csihost_reg(CSIHOST_PHY_SHUTDOWNZ, 0x00000000); - /* 3. Set TESTCLEAR = 1'b1. */ - write_csihost_reg(CSIHOST_PHY_TEST_CTRL0, 0x00000001); - /* 4.Apply REFCLK signal with the appropriate frequency; */ - /* 5. Apply CFG_CLK signal with the appropriate frequency; */ - /* 6. Set MASTERSLAVEZ = 1'b1 (for MASTER) / 1'b0 (for SLAVE). */ - write_grf_reg(GRF_SOC_CON14_OFFSET, - DPHY_TX1RX1_SLAVEZ - | DPHY_TX1RX1_MASTERSLAVEZ_MASK); - /* 8. Set all REQUEST inputs to zero. */ - write_grf_reg(GRF_SOC_CON15_OFFSET, - DPHY_TX1RX1_TURN_REQUEST_MASK - | (0x0 - << DPHY_TX1RX1_TURN_REQUEST_OFFSET_BITS)); - /* MIPI DPHY TX1RX1 disable turn around control */ - write_grf_reg(GRF_SOC_CON9_OFFSET, - DPHY_TX1RX1_TURN_DISABLE_MASK - | (0xf - << DPHY_TX1RX1_TURN_DISABLE_OFFSET_BITS)); - /* MIPI DPHY TX1RX1 force lane into receive mode */ - /* wait for stop sta */ - write_grf_reg(GRF_SOC_CON9_OFFSET, - (DPHY_TX1RX1_FORCE_RX_MODE_OFFSET_BITS - << 4) - | DPHY_TX1RX1_FORCE_RX_MODE_MASK); - /* 9. Wait for 15 ns. */ - udelay(1); - /* 10. Set TESTCLR to low. */ - write_csihost_reg(CSIHOST_PHY_TEST_CTRL0, 0x00000002); - /* 11. Wait for 15 ns. */ - udelay(1); - camsys_rk3288_mipiphy1_wr_reg(phy_virt, 0x34, 0x15); - /* 12. Configure Test Code 0x44 hsfreqrange. */ - camsys_rk3288_mipiphy1_wr_reg(phy_virt, 0x44, hsfreqrange); - camsys_rk3288_mipiphy1_rd_reg(phy_virt, 0x0); - write_csihost_reg(CSIHOST_PHY_TEST_CTRL0, 0x00000002); - write_csihost_reg(CSIHOST_PHY_TEST_CTRL1, 0x00000000); - /* 15.Set ENABLE_N=1'b1. */ - data_en_bit = para->phy->data_en_bit; - data_en_bit = data_en_bit >> 1; - data_en_num = 0; - while (data_en_bit) { - data_en_num++; - data_en_bit = data_en_bit >> 1; - } - write_csihost_reg(CSIHOST_N_LANES, data_en_num); - write_grf_reg(GRF_SOC_CON14_OFFSET, - DPHY_TX1RX1_ENABLECLK - | DPHY_TX1RX1_ENABLECLK_MASK); - /* 16. Wait for 5 ns. */ - udelay(1); - /* 17. Set SHUTDOWNZ = 1'b1. */ - write_csihost_reg(CSIHOST_PHY_SHUTDOWNZ, 0x00000001); - /* 18. Wait for 5 ns. */ - udelay(1); - /* 19.Set RSTZ = 1'b1 */ - write_csihost_reg - (CSIHOST_DPHY_RSTZ, 0x00000001); - } else { - camsys_err("mipi phy index %d is invalidate!", - para->phy->phy_index); - goto fail; -} - - camsys_trace(1, "mipi phy(%d) turn on(lane: 0x%x bit_rate: %dMbps)", - para->phy->phy_index, - para->phy->data_en_bit, - para->phy->bit_rate); - - return 0; - -fail: - return -1; -} - -#define MRV_AFM_BASE 0x0000 -#define VI_IRCL 0x0014 - -int camsys_rk3288_cfg( -camsys_dev_t *camsys_dev, camsys_soc_cfg_t cfg_cmd, void *cfg_para) -{ - unsigned int *para_int; - - switch (cfg_cmd) { - case Clk_DriverStrength_Cfg: { - para_int = (unsigned int *)cfg_para; - __raw_writel((((*para_int) & 0x03) << 3)|(0x03 << 3), - (void *)(camsys_dev->rk_grf_base + 0x01d4)); - break; - } - - case Cif_IoDomain_Cfg: { - para_int = (unsigned int *)cfg_para; - if (*para_int < 28000000) { - /* 1.8v IO */ - __raw_writel - (((1 << 1) | (1 << (1 + 16))), - (void *)(camsys_dev->rk_grf_base + 0x0380)); - } else { - /* 3.3v IO */ - __raw_writel - (((0 << 1) | (1 << (1 + 16))), - (void *)(camsys_dev->rk_grf_base + 0x0380)); - } - break; - } - - case Mipi_Phy_Cfg: { - camsys_mipiphy_soc_para_t *para - = (camsys_mipiphy_soc_para_t *)cfg_para; - - if (para->phy->dir == CamSys_Mipiphy_Tx && - para->phy->phy_index == 1) { - /* TX1/RX1 DPHY switch to RX status */ - __raw_writel(0xa000a000, - (void *)(camsys_dev->rk_grf_base + 0x027c)); - } else { - camsys_rk3288_mipihpy_cfg - ((camsys_mipiphy_soc_para_t *)cfg_para); - } - break; - } - - case Isp_SoftRst: { /* ddl@rock-chips.com: v0.d.0 */ - unsigned int reset; - - reset = (unsigned int)cfg_para; - if (reset == 1) - __raw_writel(0x80, (void *)(camsys_dev->rk_isp_base + - MRV_AFM_BASE + VI_IRCL)); - else - __raw_writel(0x00, (void *)(camsys_dev->rk_isp_base + - MRV_AFM_BASE + VI_IRCL)); - camsys_trace(2, "Isp self soft rst: %d", reset); - break; - } - - default: { - camsys_warn("cfg_cmd: 0x%x isn't support", cfg_cmd); - break; - } - } - - return 0; -} -#endif /* CONFIG_ARM */ diff --git a/drivers/media/video/rk_camsys/camsys_soc_rk3288.h b/drivers/media/video/rk_camsys/camsys_soc_rk3288.h deleted file mode 100644 index 223cf98707b4..000000000000 --- a/drivers/media/video/rk_camsys/camsys_soc_rk3288.h +++ /dev/null @@ -1,130 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __RKCAMSYS_SOC_RK3288_H__ -#define __RKCAMSYS_SOC_RK3288_H__ - -#include "camsys_internal.h" - -/*MARVIN REGISTER*/ -#define MRV_MIPI_BASE 0x1C00 -#define MRV_MIPI_CTRL 0x00 - -/* -*GRF_SOC_CON14 -*bit 0 dphy_rx0_testclr -*bit 1 dphy_rx0_testclk -*bit 2 dphy_rx0_testen -*bit 3:10 dphy_rx0_testdin -*/ -#define GRF_SOC_CON14_OFFSET (0x027c) -#define DPHY_RX0_TESTCLR_MASK (0x1 << 16) -#define DPHY_RX0_TESTCLK_MASK (0x1 << 17) -#define DPHY_RX0_TESTEN_MASK (0x1 << 18) -#define DPHY_RX0_TESTDIN_MASK (0xff << 19) - -#define DPHY_RX0_TESTCLR (0x1 << 0) -#define DPHY_RX0_TESTCLK (0x1 << 1) -#define DPHY_RX0_TESTEN (0x1 << 2) -#define DPHY_RX0_TESTDIN_OFFSET (3) - -#define DPHY_TX1RX1_ENABLECLK_MASK (0x1 << 28) -#define DPHY_RX1_SRC_SEL_MASK (0x1 << 29) -#define DPHY_TX1RX1_MASTERSLAVEZ_MASK (0x1 << 30) -#define DPHY_TX1RX1_BASEDIR_OFFSET (0x1 << 31) - -#define DPHY_TX1RX1_ENABLECLK (0x1 << 12) -#define DPHY_TX1RX1_DISABLECLK (0x0 << 12) -#define DPHY_RX1_SRC_SEL_ISP (0x1 << 13) -#define DPHY_RX1_SRC_SEL_CSI (0x0 << 13) -#define DPHY_TX1RX1_SLAVEZ (0x0 << 14) -#define DPHY_TX1RX1_BASEDIR_REC (0x1 << 15) - -/* -*GRF_SOC_CON6 -*bit 0 grf_con_disable_isp -*bit 1 grf_con_isp_dphy_sel 1'b0 mipi phy rx0 -*/ -#define GRF_SOC_CON6_OFFSET (0x025c) -#define MIPI_PHY_DISABLE_ISP_MASK (0x1 << 16) -#define MIPI_PHY_DISABLE_ISP (0x0 << 0) - -#define DSI_CSI_TESTBUS_SEL_MASK (0x1 << 30) -#define DSI_CSI_TESTBUS_SEL_OFFSET_BIT (14) - -#define MIPI_PHY_DPHYSEL_OFFSET_MASK (0x1 << 17) -#define MIPI_PHY_DPHYSEL_OFFSET_BIT (0x1) - -/* -*GRF_SOC_CON10 -*bit12:15 grf_dphy_rx0_enable -*bit 0:3 turn disable -*/ -#define GRF_SOC_CON10_OFFSET (0x026c) -#define DPHY_RX0_TURN_DISABLE_MASK (0xf << 16) -#define DPHY_RX0_TURN_DISABLE_OFFSET_BITS (0x0) -#define DPHY_RX0_ENABLE_MASK (0xf << 28) -#define DPHY_RX0_ENABLE_OFFSET_BITS (12) - -/* -*GRF_SOC_CON9 -*bit12:15 grf_dphy_rx0_enable -*bit 0:3 turn disable -*/ -#define GRF_SOC_CON9_OFFSET (0x0268) -#define DPHY_TX1RX1_TURN_DISABLE_MASK (0xf << 16) -#define DPHY_TX1RX1_TURN_DISABLE_OFFSET_BITS (0x0) -#define DPHY_TX1RX1_ENABLE_MASK (0xf << 28) -#define DPHY_TX1RX1_ENABLE_OFFSET_BITS (12) -#define DPHY_TX1RX1_FORCE_RX_MODE_MASK (0xf << 20) -#define DPHY_TX1RX1_FORCE_RX_MODE_OFFSET_BITS (0x0) - -/* -*GRF_SOC_CON15 -*bit 0:3 turn request -*/ -#define GRF_SOC_CON15_OFFSET (0x03a4) -#define DPHY_RX0_TURN_REQUEST_MASK (0xf << 16) -#define DPHY_RX0_TURN_REQUEST_OFFSET_BITS (0x0) - -#define DPHY_TX1RX1_TURN_REQUEST_MASK (0xf << 20) -#define DPHY_TX1RX1_TURN_REQUEST_OFFSET_BITS (0x0) - -#define GRF_SOC_STATUS21 (0x2D4) - -#define CSIHOST_PHY_TEST_CTRL0 (0x30) -#define CSIHOST_PHY_TEST_CTRL1 (0x34) -#define CSIHOST_PHY_SHUTDOWNZ (0x08) -#define CSIHOST_DPHY_RSTZ (0x0c) -#define CSIHOST_N_LANES (0x04) -#define CSIHOST_CSI2_RESETN (0x10) -#define CSIHOST_PHY_STATE (0x14) -#define CSIHOST_DATA_IDS1 (0x18) -#define CSIHOST_DATA_IDS2 (0x1C) -#define CSIHOST_ERR1 (0x20) -#define CSIHOST_ERR2 (0x24) - -#define write_grf_reg(addr, val) \ - __raw_writel(val, (void *)(addr + para->camsys_dev->rk_grf_base)) -#define read_grf_reg(addr) \ - __raw_readl((void *)(addr + para->camsys_dev->rk_grf_base)) -#define mask_grf_reg(addr, msk, val) \ - write_grf_reg(addr, (val) | ((~(msk)) & read_grf_reg(addr))) -#ifdef CONFIG_ARM64 -#define cru_writel(v, o) \ - do {writel(v, RK_CRU_VIRT + (o)); } \ - while (0) - -#define write_csihost_reg(addr, val) \ - __raw_writel(val, addr + (void __force __iomem *)(phy_virt)) -#define read_csihost_reg(addr) \ - __raw_readl(addr + (void __force __iomem *)(phy_virt)) -#else -#define cru_writel(v, o) \ - do {writel(v, RK_CRU_VIRT + (o)); dsb(); } \ - while (0) - -#define write_csihost_reg(addr, val) \ - __raw_writel(val, addr + IOMEM(phy_virt)) -#define read_csihost_reg(addr) \ - __raw_readl(addr + IOMEM(phy_virt)) -#endif -#endif diff --git a/drivers/media/video/rk_camsys/camsys_soc_rk3326.c b/drivers/media/video/rk_camsys/camsys_soc_rk3326.c deleted file mode 100644 index 1131912a1387..000000000000 --- a/drivers/media/video/rk_camsys/camsys_soc_rk3326.c +++ /dev/null @@ -1,239 +0,0 @@ -/* - ************************************************************************* - * Copyright (C) 2018 Fuzhou Rockchip Electronics Co., Ltd. - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - ************************************************************************* - */ - -#ifdef CONFIG_ARM64 -#include "camsys_soc_priv.h" -#include "camsys_soc_rk3326.h" -#include "camsys_marvin.h" - -struct mipiphy_hsfreqrange_s { - unsigned int range_l; - unsigned int range_h; - unsigned char cfg_bit; -}; - -static struct mipiphy_hsfreqrange_s mipiphy_hsfreqrange[] = { - {80, 110, 0x00}, - {110, 150, 0x01}, - {150, 200, 0x02}, - {200, 250, 0x03}, - {250, 300, 0x04}, - {300, 400, 0x05}, - {400, 500, 0x06}, - {500, 600, 0x07}, - {600, 700, 0x08}, - {700, 800, 0x09}, - {800, 1000, 0xa}, - {1000, 1100, 0xb}, - {1100, 1250, 0xc}, - {1250, 1350, 0xd}, - {1350, 1500, 0xe} -}; - -static int camsys_rk3326_mipihpy_cfg(camsys_mipiphy_soc_para_t *para) -{ - unsigned char hsfreqrange = 0xff, i; - struct mipiphy_hsfreqrange_s *hsfreqrange_p; - unsigned long csiphy_virt; - //unsigned long base; - - if (para->camsys_dev->csiphy_reg) { - csiphy_virt = - (unsigned long)para->camsys_dev->csiphy_reg->vir_base; - } else { - csiphy_virt = 0x00; - } - if (para->phy->bit_rate == 0 || - para->phy->data_en_bit == 0) { - if (para->phy->phy_index == 0) { - write_grf_reg(GRF_PD_VI_CON_OFFSET, - DPHY_CSIPHY_CLKLANE_EN_OFFSET_MASK | - (0 << DPHY_CSIPHY_CLKLANE_EN_OFFSET_BITS)); - write_grf_reg(GRF_PD_VI_CON_OFFSET, - DPHY_CSIPHY_DATALANE_EN_OFFSET_MASK | - (0 << DPHY_CSIPHY_DATALANE_EN_OFFSET_BITS)); - camsys_trace(1, "mipi phy 0 standby!"); - } - - return 0; - } - - hsfreqrange_p = mipiphy_hsfreqrange; - for (i = 0; - i < (sizeof(mipiphy_hsfreqrange) / - sizeof(struct mipiphy_hsfreqrange_s)); - i++) { - if ((para->phy->bit_rate > hsfreqrange_p->range_l) && - (para->phy->bit_rate <= hsfreqrange_p->range_h)) { - hsfreqrange = hsfreqrange_p->cfg_bit; - break; - } - hsfreqrange_p++; - } - - if (hsfreqrange == 0xff) { - camsys_err("mipi phy config bitrate %d Mbps isn't supported!", - para->phy->bit_rate); - hsfreqrange = 0x00; - } - - if (para->phy->phy_index == 0) { - /* phy start */ - write_csiphy_reg(MIPI_CSI_DPHY_CTRL_PWRCTL_OFFSET, 0xe4); - - /* set data lane num and enable clock lane */ - write_csiphy_reg(MIPI_CSI_DPHY_CTRL_LANE_ENABLE_OFFSET, - ((para->phy->data_en_bit << MIPI_CSI_DPHY_CTRL_DATALANE_ENABLE_OFFSET_BIT) | - (0x1 << MIPI_CSI_DPHY_CTRL_CLKLANE_ENABLE_OFFSET_BIT) | 0x1)); - /* Reset dphy analog part */ - write_csiphy_reg(MIPI_CSI_DPHY_CTRL_PWRCTL_OFFSET, 0xe0); - usleep_range(500, 1000); - /* Reset dphy digital part */ - write_csiphy_reg(MIPI_CSI_DPHY_CTRL_DIG_RST_OFFSET, 0x1e); - write_csiphy_reg(MIPI_CSI_DPHY_CTRL_DIG_RST_OFFSET, 0x1f); - /* not into receive mode/wait stopstate */ - write_grf_reg(GRF_PD_VI_CON_OFFSET, - DPHY_CSIPHY_FORCERXMODE_OFFSET_MASK | - (0x0 << DPHY_CSIPHY_FORCERXMODE_OFFSET_BITS)); - - write_csiphy_reg((MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET + 0x100), - hsfreqrange | - (read_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x100) & (~0xf))); - - if (para->phy->data_en_bit > 0x00) { - write_csiphy_reg((MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x180), hsfreqrange | - (read_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x180) & (~0xf))); - } - if (para->phy->data_en_bit > 0x02) { - write_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x200, hsfreqrange | - (read_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x200) & (~0xf))); - } - if (para->phy->data_en_bit > 0x04) { - write_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x280, hsfreqrange | - (read_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x280) & (~0xf))); - write_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x300, hsfreqrange | - (read_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x300) & (~0xf))); - } - - write_grf_reg(GRF_PD_VI_CON_OFFSET, - DPHY_CSIPHY_CLKLANE_EN_OFFSET_MASK | - (1 << DPHY_CSIPHY_CLKLANE_EN_OFFSET_BITS)); - write_grf_reg(GRF_PD_VI_CON_OFFSET, - DPHY_CSIPHY_DATALANE_EN_OFFSET_MASK | - (0x0f << DPHY_CSIPHY_DATALANE_EN_OFFSET_BITS)); - - } else { - camsys_err("mipi phy index %d is invalidate!", - para->phy->phy_index); - goto fail; - } - - camsys_trace(1, "mipi phy(%d) turn on(lane: 0x%x bit_rate: %dMbps)", - para->phy->phy_index, - para->phy->data_en_bit, para->phy->bit_rate); - - return 0; - -fail: - return -1; -} - -#define VI_IRCL 0x0014 -/** - * reset on too high isp_clk rate will result in bus dead. - * The signoff isp_clk rate is 350M, and the recommended rate - * on reset from IC is NOT greater than 300M. - */ -#define SAFETY_RESET_ISPCLK_RATE_LIMIT 300000000 -int camsys_rk3326_cfg -( - camsys_dev_t *camsys_dev, - camsys_soc_cfg_t cfg_cmd, - void *cfg_para -) -{ - unsigned int *para_int; - - switch (cfg_cmd) { - case Clk_DriverStrength_Cfg: { - para_int = (unsigned int *)cfg_para; - __raw_writel((((*para_int) & 0x03) << 6) | (0x03 << 22), - (void *)(camsys_dev->rk_grf_base + 0x104));//m0 cifclk_out - break; - } - - case Cif_IoDomain_Cfg: { - para_int = (unsigned int *)cfg_para; - if (*para_int < 28000000) { - /* 1.8v IO */ - __raw_writel((1 << GRF_IO_VSEL_VCCIO3_BITS) | GRF_IO_VSEL_VCCIO3_MASK, - (void *)(camsys_dev->rk_grf_base + GRF_IO_VSEL_OFFSET)); - } else { - /* 3.3v IO */ - __raw_writel((0 << GRF_IO_VSEL_VCCIO3_BITS) | GRF_IO_VSEL_VCCIO3_MASK, - (void *)(camsys_dev->rk_grf_base + GRF_IO_VSEL_OFFSET)); - } - break; - } - - case Mipi_Phy_Cfg: { - camsys_rk3326_mipihpy_cfg - ((camsys_mipiphy_soc_para_t *)cfg_para); - break; - } - - case Isp_SoftRst: {/* ddl@rock-chips.com: v0.d.0 */ - unsigned long reset; - - reset = (unsigned long)cfg_para; - - if (reset == 1) { - camsys_mrv_clk_t *clk = - (camsys_mrv_clk_t *)camsys_dev->clk; - long old_ispclk_rate = clk_get_rate(clk->isp); - - /* check the isp_clk before isp reset operation */ - if (old_ispclk_rate > SAFETY_RESET_ISPCLK_RATE_LIMIT) - clk_set_rate(clk->isp, - SAFETY_RESET_ISPCLK_RATE_LIMIT); - __raw_writel(0x80, (void *)(camsys_dev->rk_isp_base + - VI_IRCL)); - usleep_range(100, 200); - __raw_writel(0x00, (void *)(camsys_dev->rk_isp_base + - VI_IRCL)); - /* restore the old ispclk after reset */ - if (old_ispclk_rate != SAFETY_RESET_ISPCLK_RATE_LIMIT) - clk_set_rate(clk->isp, old_ispclk_rate); - } - camsys_trace(2, "Isp self soft rst: %ld", reset); - break; - } - default: - { - camsys_warn("cfg_cmd: 0x%x isn't support", cfg_cmd); - break; - } - - } - - return 0; -} -#endif /* CONFIG_ARM64 */ diff --git a/drivers/media/video/rk_camsys/camsys_soc_rk3326.h b/drivers/media/video/rk_camsys/camsys_soc_rk3326.h deleted file mode 100644 index 0ea76ce253ed..000000000000 --- a/drivers/media/video/rk_camsys/camsys_soc_rk3326.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - ************************************************************************* - * Copyright (C) 2018 Fuzhou Rockchip Electronics Co., Ltd. - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - ************************************************************************* - */ - -#ifndef __RKCAMSYS_SOC_RK3326_H__ -#define __RKCAMSYS_SOC_RK3326_H__ - -#include "camsys_internal.h" - -/* MARVIN REGISTER */ -#define MRV_MIPI_BASE 0x1C00 -#define MRV_MIPI_CTRL 0x00 - -#define GRF_IO_VSEL_OFFSET (0x0180) -#define GRF_IO_VSEL_VCCIO3_MASK (0x1 << 20) -#define GRF_IO_VSEL_VCCIO3_BITS (4) -#define GRF_PD_VI_CON_OFFSET (0x0430) -/* bit 13-14 */ -#define ISP_CIF_IF_DATAWIDTH_MASK (0x3 << 29) -#define ISP_CIF_IF_DATAWIDTH_8B (0x0 << 13) -#define ISP_CIF_IF_DATAWIDTH_10B (0x1 << 13) -#define ISP_CIF_IF_DATAWIDTH_12B (0x2 << 13) - -/* bit 9 */ -#define DPHY_CSIPHY_CLK_INV_SEL_MASK (0x1 << 25) -#define DPHY_CSIPHY_CLK_INV_SEL (0x1 << 9) -/* bit 8 */ -#define DPHY_CSIPHY_CLKLANE_EN_OFFSET_MASK (0x1 << 24)//???? -#define DPHY_CSIPHY_CLKLANE_EN_OFFSET_BITS (8) -/* bit 4-7 */ -#define DPHY_CSIPHY_DATALANE_EN_OFFSET_MASK (0xF << 20)//????? -#define DPHY_CSIPHY_DATALANE_EN_OFFSET_BITS (4) -/* bit 0-3 */ -#define DPHY_CSIPHY_FORCERXMODE_OFFSET_MASK (0xF << 16) -#define DPHY_CSIPHY_FORCERXMODE_OFFSET_BITS (0) - -/* LOW POWER MODE SET */ -/* base */ -#define MIPI_CSI_DPHY_CTRL_LANE_ENABLE_OFFSET (0x00) -#define MIPI_CSI_DPHY_CTRL_DATALANE_ENABLE_OFFSET_BIT (2) -#define MIPI_CSI_DPHY_CTRL_CLKLANE_ENABLE_OFFSET_BIT (6) -#define MIPI_CSI_DPHY_CTRL_PWRCTL_OFFSET (0x04) -#define MIPI_CSI_DPHY_CTRL_DIG_RST_OFFSET (0x80) -#define MIPI_CSI_DPHY_CTRL_SIG_INV_OFFSET (0x84) - -/* Configure the count time of the THS-SETTLE by protocol. */ -#define MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET (0x00) -/* MSB enable for pin_rxdatahs_ - * 1: enable - * 0: disable - */ -#define MIPI_CSI_DPHY_LANEX_MSB_EN_OFFSET (0x38) - -#define write_grf_reg(addr, val) \ - __raw_writel(val, (void *)(addr + para->camsys_dev->rk_grf_base)) -#define read_grf_reg(addr) \ - __raw_readl((void *)(addr + para->camsys_dev->rk_grf_base)) -#define mask_grf_reg(addr, msk, val) \ - write_grf_reg(addr, (val) | ((~(msk)) & read_grf_reg(addr))) - -#define write_cru_reg(addr, val) \ - __raw_writel(val, (void *)(addr + para->camsys_dev->rk_cru_base)) -/* csi phy */ -#define write_csiphy_reg(addr, val) \ - __raw_writel(val, (void *)(addr + csiphy_virt)) -#define read_csiphy_reg(addr) \ - __raw_readl((void *)(addr + csiphy_virt)) - -#endif diff --git a/drivers/media/video/rk_camsys/camsys_soc_rk3366.c b/drivers/media/video/rk_camsys/camsys_soc_rk3366.c deleted file mode 100644 index 1dcef7c86555..000000000000 --- a/drivers/media/video/rk_camsys/camsys_soc_rk3366.c +++ /dev/null @@ -1,257 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifdef CONFIG_ARM64 -#include "camsys_soc_priv.h" -#include "camsys_soc_rk3366.h" - -struct mipiphy_hsfreqrange_s { - unsigned int range_l; - unsigned int range_h; - unsigned char cfg_bit; -}; - -static struct mipiphy_hsfreqrange_s mipiphy_hsfreqrange[] = { - {80, 110, 0x00}, - {110, 150, 0x01}, - {150, 200, 0x02}, - {200, 250, 0x03}, - {250, 300, 0x04}, - {300, 400, 0x05}, - {400, 500, 0x06}, - {500, 600, 0x07}, - {600, 700, 0x08}, - {700, 800, 0x09}, - {800, 1000, 0xa}, - {1000, 1100, 0xb}, - {1100, 1250, 0xc}, - {1250, 1350, 0xd}, - {1350, 1500, 0xe} -}; - -#if 0 -static int camsys_rk3368_mipiphy_wr_reg( -unsigned long phy_virt, unsigned char addr, unsigned char data) -{ - /*TESTEN =1,TESTDIN=addr */ - write_csihost_reg(CSIHOST_PHY_TEST_CTRL1, (0x00010000 | addr)); - /*TESTCLK=0 */ - write_csihost_reg(CSIHOST_PHY_TEST_CTRL0, 0x00000000); - udelay(10); - /*TESTEN =0,TESTDIN=data */ - write_csihost_reg(CSIHOST_PHY_TEST_CTRL1, (0x00000000 | data)); - /*TESTCLK=1 */ - write_csihost_reg(CSIHOST_PHY_TEST_CTRL0, 0x00000002); - udelay(10); - - return 0; -} - -static int camsys_rk3368_mipiphy_rd_reg( -unsigned long phy_virt, unsigned char addr) -{ - return (read_csihost_reg(((CSIHOST_PHY_TEST_CTRL1) & 0xff00))>>8); -} - -static int camsys_rk3368_csiphy_wr_reg( -unsigned long csiphy_virt, unsigned char addr, unsigned char data) -{ - write_csiphy_reg(addr, data); - return 0; -} - -static int camsys_rk3368_csiphy_rd_reg( -unsigned long csiphy_virt, unsigned char addr) -{ - return read_csiphy_reg(addr); -} -#endif -static int camsys_rk3366_mipihpy_cfg( -camsys_mipiphy_soc_para_t *para) -{ - unsigned char hsfreqrange = 0xff, i; - struct mipiphy_hsfreqrange_s *hsfreqrange_p; - unsigned long phy_virt, phy_index; - unsigned long base; - unsigned long csiphy_virt; - - phy_index = para->phy->phy_index; - if (para->camsys_dev->mipiphy[phy_index].reg != NULL) { - phy_virt = para->camsys_dev->mipiphy[phy_index].reg->vir_base; - } else { - phy_virt = 0x00; - } - if (para->camsys_dev->csiphy_reg != NULL) { - csiphy_virt = - (unsigned long)para->camsys_dev->csiphy_reg->vir_base; - } else { - csiphy_virt = 0x00; - } - if ((para->phy->bit_rate == 0) || - (para->phy->data_en_bit == 0)) { - if (para->phy->phy_index == 0) { - base = - (unsigned long) - para->camsys_dev->devmems.registermem->vir_base; - *((unsigned int *) - (base + (MRV_MIPI_BASE + MRV_MIPI_CTRL))) - &= ~(0x0f << 8); - camsys_trace(1, "mipi phy 0 standby!"); - } - - return 0; - } - - hsfreqrange_p = mipiphy_hsfreqrange; - for (i = 0; - i < - (sizeof(mipiphy_hsfreqrange)/ - sizeof(struct mipiphy_hsfreqrange_s)); - i++) { - - if ((para->phy->bit_rate > hsfreqrange_p->range_l) && - (para->phy->bit_rate <= hsfreqrange_p->range_h)) { - hsfreqrange = hsfreqrange_p->cfg_bit; - break; - } - hsfreqrange_p++; - } - - if (hsfreqrange == 0xff) { - camsys_err("mipi phy config bitrate %d Mbps isn't supported!", - para->phy->bit_rate); - hsfreqrange = 0x00; - } - - if (para->phy->phy_index == 0) { - /* isp select */ - /*write_grf_reg - (GRF_SOC_CON6_OFFSET, ISP_MIPI_CSI_HOST_SEL_OFFSET_MASK - | (1 << ISP_MIPI_CSI_HOST_SEL_OFFSET_BIT)); - */ - /* phy start */ - write_csiphy_reg(MIPI_CSI_DPHY_CTRL_PWRCTL_OFFSET, 0xe4); - - /* set data lane num and enable clock lane */ - write_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET, - ((para->phy->data_en_bit << 2) | (0x1 << 6) | 0x1)); - /* Reset dphy analog part */ - write_csiphy_reg(MIPI_CSI_DPHY_CTRL_PWRCTL_OFFSET, 0xe0); - usleep_range(500, 1000); - /* Reset dphy digital part */ - write_csiphy_reg(MIPI_CSI_DPHY_CTRL_DIG_RST_OFFSET, 0x1e); - write_csiphy_reg(MIPI_CSI_DPHY_CTRL_DIG_RST_OFFSET, 0x1f); - - write_grf_reg(GRF_SOC_CON6_OFFSET, - MIPI_CSI_DPHY_RX_FORCERXMODE_MASK | - MIPI_CSI_DPHY_RX_FORCERXMODE_BIT); - - write_csiphy_reg - ((MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET + 0x100), - hsfreqrange | - (read_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x100) & (~0xf))); - - if (para->phy->data_en_bit > 0x00) { - write_csiphy_reg((MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x180), hsfreqrange | - (read_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x180) & (~0xf))); - } - if (para->phy->data_en_bit > 0x02) { - write_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x200, hsfreqrange | - (read_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x200) & (~0xf))); - } - if (para->phy->data_en_bit > 0x04) { - write_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x280, hsfreqrange | - (read_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x280) & (~0xf))); - write_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x300, hsfreqrange | - (read_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x300) & (~0xf))); - } - /* - * MIPI CTRL bit8:11 SHUTDOWN_LANE are invert - * connect to dphy pin_enable_x - */ - base = - (unsigned long) - para->camsys_dev->devmems.registermem->vir_base; - *((unsigned int *)(base + (MRV_MIPI_BASE + MRV_MIPI_CTRL))) - &= ~(0x0f << 8); - } else { - camsys_err("mipi phy index %d is invalidate!", - para->phy->phy_index); - goto fail; - } - - camsys_trace(1, "mipi phy(%d) turn on(lane: 0x%x bit_rate: %dMbps)", - para->phy->phy_index, para->phy->data_en_bit, para->phy->bit_rate); - - return 0; - -fail: - return -1; -} - -#define MRV_AFM_BASE 0x0000 -#define VI_IRCL 0x0014 -int camsys_rk3366_cfg( -camsys_dev_t *camsys_dev, camsys_soc_cfg_t cfg_cmd, void *cfg_para) -{ - unsigned int *para_int; - - switch (cfg_cmd) { - case Clk_DriverStrength_Cfg: { - para_int = (unsigned int *)cfg_para; - __raw_writel((((*para_int) & 0x03) << 3) | (0x03 << 3), - (void *)(camsys_dev->rk_grf_base + 0x204)); - /* set 0xffffffff to max all */ - break; - } - - case Cif_IoDomain_Cfg: { - para_int = (unsigned int *)cfg_para; - if (*para_int < 28000000) { - /* 1.8v IO */ - __raw_writel(((1 << 1) | (1 << (1 + 16))), - (void *)(camsys_dev->rk_grf_base + 0x0900)); - } else { - /* 3.3v IO */ - __raw_writel(((0 << 1) | (1 << (1 + 16))), - (void *)(camsys_dev->rk_grf_base + 0x0900)); - } - break; - } - - case Mipi_Phy_Cfg: { - camsys_rk3366_mipihpy_cfg - ((camsys_mipiphy_soc_para_t *)cfg_para); - break; - } - - case Isp_SoftRst: /* ddl@rock-chips.com: v0.d.0 */ { - unsigned long reset; - reset = (unsigned long)cfg_para; - if (reset == 1) - __raw_writel(0x80, (void *)(camsys_dev->rk_isp_base + - MRV_AFM_BASE + VI_IRCL)); - else - __raw_writel(0x00, (void *)(camsys_dev->rk_isp_base + - MRV_AFM_BASE + VI_IRCL)); - camsys_trace(2, "Isp self soft rst: %ld", reset); - break; - } - - default: { - camsys_warn("cfg_cmd: 0x%x isn't support", cfg_cmd); - break; - } - - } - - return 0; -} -#endif /* CONFIG_ARM64 */ diff --git a/drivers/media/video/rk_camsys/camsys_soc_rk3366.h b/drivers/media/video/rk_camsys/camsys_soc_rk3366.h deleted file mode 100644 index 99f6793fa133..000000000000 --- a/drivers/media/video/rk_camsys/camsys_soc_rk3366.h +++ /dev/null @@ -1,123 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __RKCAMSYS_SOC_RK3366_H__ -#define __RKCAMSYS_SOC_RK3366_H__ - -#include "camsys_internal.h" - -/*MARVIN REGISTER*/ -#define MRV_MIPI_BASE 0x1C00 -#define MRV_MIPI_CTRL 0x00 - -/* -*#define CSIHOST_PHY_TEST_CTRL0_OFFSET 0x0030 -#define DPHY_TX1RX1_TESTCLR (1<<0) -#define DPHY_TX1RX1_TESTCLK (1<<1) - -#define CSIHOST_PHY_TEST_CTRL1_OFFSET 0x0034 -#define DPHY_TX1RX1_TESTDIN_OFFSET_BITS (0) -#define DPHY_TX1RX1_TESTDOUT_OFFSET_BITS (8) -#define DPHY_TX1RX1_TESTEN (16) -*/ - -#define GRF_SOC_STATUS21 (0x2D4) - -#define CSIHOST_PHY_TEST_CTRL0 (0x30) -#define CSIHOST_PHY_TEST_CTRL1 (0x34) -#define CSIHOST_N_LANES (0x04) -#define CSIHOST_PHY_SHUTDOWNZ (0x08) -#define CSIHOST_CSI2_RESETN (0x10) -#define CSIHOST_DPHY_RSTZ (0x0c) -#define CSIHOST_PHY_STATE (0x14) -#define CSIHOST_DATA_IDS1 (0x18) -#define CSIHOST_DATA_IDS2 (0x1C) -#define CSIHOST_ERR1 (0x20) -#define CSIHOST_ERR2 (0x24) - -/* -*GRF_SOC_CON6 -*dphy_rx_forcerxmode 11:8 -*isp_mipi_csi_host_sel:1 -*disable_isp:0 -*bit 0 grf_con_disable_isp -*bit 1 isp_mipi_csi_host_sel 1'b0: mipi csi host -*/ -#define GRF_SOC_CON6_OFFSET (0x0418) -/*bit 0*/ -#define MIPI_PHY_DISABLE_ISP_MASK (0x1 << 16) -#define MIPI_PHY_DISABLE_ISP (0x0 << 0) -/*bit 1*/ -#define ISP_MIPI_CSI_HOST_SEL_OFFSET_MASK (0x1 << 17) -#define ISP_MIPI_CSI_HOST_SEL_OFFSET_BIT (0x1) -/*bit 6*/ -#define DPHY_RX_CLK_INV_SEL_MASK (0x1 << 22) -#define DPHY_RX_CLK_INV_SEL (0x1 << 6) -/*bit 11:8*/ -#define DPHY_RX_FORCERXMODE_OFFSET_MASK (0xF << 24) -#define DPHY_RX_FORCERXMODE_OFFSET_BITS (8) - -/*GRF_SOC_CON7*/ -/*dphy_tx0_forcerxmode*/ -#define GRF_SOC_CON7_OFFSET (0x041c) -/*bit 10:7*/ -#define FORCETXSTOPMODE_OFFSET_BITS (7) -#define FORCETXSTOPMODE_MASK (0xF << 23) - -#define DPHY_TX0_FORCERXMODE (6) -#define DPHY_TX0_FORCERXMODE_MASK (0x01 << 22) -/*bit 5*/ -#define LANE0_TURNDISABLE_BITS (5) -#define LANE0_TURNDISABLE_MASK (0x01 << 21) - -#define GRF_SOC_STATUS13 (0x04b4) -/*dphy_rx_rxclkactivehs*/ -/*dphy_rx_direction*/ -/*dphy_rx_ulpsactivenot_0...3*/ - -/*LOW POWER MODE SET*/ -/*base*/ -#define MIPI_CSI_DPHY_CTRL_LANE_ENABLE_OFFSET (0x00) -#define MIPI_CSI_DPHY_CTRL_LANE_ENABLE_OFFSET_BIT (2) - -#define MIPI_CSI_DPHY_CTRL_PWRCTL_OFFSET (0x04) -#define MIPI_CSI_DPHY_CTRL_DIG_RST_OFFSET (0x80) -#define MIPI_CSI_DPHY_CTRL_SIG_INV_OFFSET (0x84) - -/*Configure the count time of the THS-SETTLE by protocol.*/ -#define MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET (0x00) -/*MSB enable for pin_rxdatahs_ -*1: enable -*0: disable -*/ -#define MIPI_CSI_DPHY_LANEX_MSB_EN_OFFSET (0x38) - -#define MIPI_CSI_DPHY_RX_FORCERXMODE_MASK (0x0f << 24) -#define MIPI_CSI_DPHY_RX_FORCERXMODE_BIT (0 << 8) - -#define CSIHOST_N_LANES_OFFSET 0x04 -#define CSIHOST_N_LANES_OFFSET_BIT (0) - -#define write_grf_reg(addr, val) \ - __raw_writel(val, (void *)(addr + para->camsys_dev->rk_grf_base)) -#define read_grf_reg(addr) \ - __raw_readl((void *)(addr + para->camsys_dev->rk_grf_base)) -#define mask_grf_reg(addr, msk, val) \ - write_grf_reg(addr, (val) | ((~(msk)) & read_grf_reg(addr))) - -#define write_cru_reg(addr, val) \ - __raw_writel(val, (void *)(addr + para->camsys_dev->rk_cru_base)) - -/*#define cru_writel(v, o) do {writel(v, RK_CRU_VIRT + (o)); dsb();} \ -* while (0) -*/ - -#define write_csihost_reg(addr, val) \ - __raw_writel(val, (void *)(addr + phy_virt)) -#define read_csihost_reg(addr) \ - __raw_readl((void *)(addr + phy_virt)) -/*csi phy*/ -#define write_csiphy_reg(addr, val) \ - __raw_writel(val, (void *)(addr + csiphy_virt)) -#define read_csiphy_reg(addr) \ - __raw_readl((void *)(addr + csiphy_virt)) - -#endif diff --git a/drivers/media/video/rk_camsys/camsys_soc_rk3368.c b/drivers/media/video/rk_camsys/camsys_soc_rk3368.c deleted file mode 100644 index 74dbcbcb535d..000000000000 --- a/drivers/media/video/rk_camsys/camsys_soc_rk3368.c +++ /dev/null @@ -1,257 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifdef CONFIG_ARM64 -#include "camsys_soc_priv.h" -#include "camsys_soc_rk3368.h" - - -struct mipiphy_hsfreqrange_s { - unsigned int range_l; - unsigned int range_h; - unsigned char cfg_bit; -}; - -static struct mipiphy_hsfreqrange_s mipiphy_hsfreqrange[] = { - {80, 110, 0x00}, - {110, 150, 0x01}, - {150, 200, 0x02}, - {200, 250, 0x03}, - {250, 300, 0x04}, - {300, 400, 0x05}, - {400, 500, 0x06}, - {500, 600, 0x07}, - {600, 700, 0x08}, - {700, 800, 0x09}, - {800, 1000, 0xa}, - {1000, 1100, 0xb}, - {1100, 1250, 0xc}, - {1250, 1350, 0xd}, - {1350, 1500, 0xe} -}; - -#if 0 -static int camsys_rk3368_mipiphy_wr_reg -(unsigned long phy_virt, unsigned char addr, unsigned char data) -{ - /*TESTEN =1,TESTDIN=addr */ - write_csihost_reg(CSIHOST_PHY_TEST_CTRL1, (0x00010000 | addr)); - /*TESTCLK=0 */ - write_csihost_reg(CSIHOST_PHY_TEST_CTRL0, 0x00000000); - udelay(10); - /*TESTEN =0,TESTDIN=data */ - write_csihost_reg(CSIHOST_PHY_TEST_CTRL1, (0x00000000 | data)); - /*TESTCLK=1 */ - write_csihost_reg(CSIHOST_PHY_TEST_CTRL0, 0x00000002); - udelay(10); - - return 0; -} - -static int camsys_rk3368_mipiphy_rd_reg -(unsigned long phy_virt, unsigned char addr) -{ - return (read_csihost_reg(((CSIHOST_PHY_TEST_CTRL1)&0xff00))>>8); -} - -static int camsys_rk3368_csiphy_wr_reg -(unsigned long csiphy_virt, unsigned char addr, unsigned char data) -{ - write_csiphy_reg(addr, data); - return 0; -} - -static int camsys_rk3368_csiphy_rd_reg -(unsigned long csiphy_virt, unsigned char addr) -{ - return read_csiphy_reg(addr); -} -#endif -static int camsys_rk3368_mipihpy_cfg(camsys_mipiphy_soc_para_t *para) -{ - unsigned char hsfreqrange = 0xff, i; - struct mipiphy_hsfreqrange_s *hsfreqrange_p; - unsigned long phy_virt, phy_index; - unsigned long base; - unsigned long csiphy_virt; - - phy_index = para->phy->phy_index; - if (para->camsys_dev->mipiphy[phy_index].reg != NULL) { - phy_virt = para->camsys_dev->mipiphy[phy_index].reg->vir_base; - } else { - phy_virt = 0x00; - } - if (para->camsys_dev->csiphy_reg != NULL) { - csiphy_virt = - (unsigned long)para->camsys_dev->csiphy_reg->vir_base; - } else { - csiphy_virt = 0x00; - } - if ((para->phy->bit_rate == 0) || - (para->phy->data_en_bit == 0)) { - if (para->phy->phy_index == 0) { - base = - (unsigned long) - para->camsys_dev->devmems.registermem->vir_base; - *((unsigned int *) - (base + (MRV_MIPI_BASE + MRV_MIPI_CTRL))) - &= ~(0x0f << 8); - camsys_trace(1, "mipi phy 0 standby!"); - } - - return 0; - } - - hsfreqrange_p = mipiphy_hsfreqrange; - for (i = 0; - i < (sizeof(mipiphy_hsfreqrange)/ - sizeof(struct mipiphy_hsfreqrange_s)); - i++) { - - if ((para->phy->bit_rate > hsfreqrange_p->range_l) && - (para->phy->bit_rate <= hsfreqrange_p->range_h)) { - hsfreqrange = hsfreqrange_p->cfg_bit; - break; - } - hsfreqrange_p++; - } - - if (hsfreqrange == 0xff) { - camsys_err("mipi phy config bitrate %d Mbps isn't supported!", - para->phy->bit_rate); - hsfreqrange = 0x00; - } - - if (para->phy->phy_index == 0) { - /* isp select */ - write_grf_reg(GRF_SOC_CON6_OFFSET, ISP_MIPI_CSI_HOST_SEL_OFFSET_MASK - | (1 << ISP_MIPI_CSI_HOST_SEL_OFFSET_BIT)); - - /* phy start */ - write_csiphy_reg(MIPI_CSI_DPHY_CTRL_PWRCTL_OFFSET, 0xe4); - - /* set data lane num and enable clock lane */ - write_csiphy_reg(MIPI_CSI_DPHY_CTRL_LANE_ENABLE_OFFSET, - ((para->phy->data_en_bit << MIPI_CSI_DPHY_CTRL_LANE_ENABLE_OFFSET_BIT) | - (0x1 << 6) | 0x1)); - /* Reset dphy analog part */ - write_csiphy_reg(MIPI_CSI_DPHY_CTRL_PWRCTL_OFFSET, 0xe0); - usleep_range(500, 1000); - /* Reset dphy digital part */ - write_csiphy_reg(MIPI_CSI_DPHY_CTRL_DIG_RST_OFFSET, 0x1e); - write_csiphy_reg(MIPI_CSI_DPHY_CTRL_DIG_RST_OFFSET, 0x1f); - - write_grf_reg(GRF_SOC_CON6_OFFSET, - MIPI_CSI_DPHY_RX_FORCERXMODE_MASK | - (0x0 << MIPI_CSI_DPHY_RX_FORCERXMODE_BIT)); - - write_csiphy_reg((MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET + 0x100), - hsfreqrange | - (read_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x100) & (~0xf))); - - if (para->phy->data_en_bit > 0x00) { - write_csiphy_reg((MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x180), hsfreqrange | - (read_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x180) & (~0xf))); - } - if (para->phy->data_en_bit > 0x02) { - write_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x200, hsfreqrange | - (read_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x200) & (~0xf))); - } - if (para->phy->data_en_bit > 0x04) { - write_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x280, hsfreqrange | - (read_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x280) & (~0xf))); - write_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x300, hsfreqrange | - (read_csiphy_reg(MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET - + 0x300) & (~0xf))); - } - /* - * MIPI CTRL bit8:11 SHUTDOWN_LANE are invert - * connect to dphy pin_enable_x - */ - base = (unsigned long)para->camsys_dev->devmems.registermem->vir_base; - *((unsigned int *)(base + (MRV_MIPI_BASE + MRV_MIPI_CTRL))) - &= ~(0x0f << 8); - } else { - camsys_err("mipi phy index %d is invalidate!", - para->phy->phy_index); - goto fail; - } - - camsys_trace(1, "mipi phy(%d) turn on(lane: 0x%x bit_rate: %dMbps)", - para->phy->phy_index, - para->phy->data_en_bit, para->phy->bit_rate); - - return 0; - -fail: - return -1; -} - -#define MRV_AFM_BASE 0x0000 -#define VI_IRCL 0x0014 -int camsys_rk3368_cfg( -camsys_dev_t *camsys_dev, camsys_soc_cfg_t cfg_cmd, void *cfg_para) -{ - unsigned int *para_int; - - switch (cfg_cmd) { - case Clk_DriverStrength_Cfg: { - para_int = (unsigned int *)cfg_para; - __raw_writel((((*para_int) & 0x03) << 3) | (0x03 << 3), - (void *)(camsys_dev->rk_grf_base + 0x204)); - /* set 0xffffffff to max all */ - break; - } - - case Cif_IoDomain_Cfg: { - para_int = (unsigned int *)cfg_para; - if (*para_int < 28000000) { - /* 1.8v IO */ - __raw_writel(((1 << 1) | (1 << (1 + 16))), - (void *)(camsys_dev->rk_grf_base + 0x0900)); - } else { - /* 3.3v IO */ - __raw_writel(((0 << 1) | (1 << (1 + 16))), - (void *)(camsys_dev->rk_grf_base + 0x0900)); - } - break; - } - - case Mipi_Phy_Cfg: { - camsys_rk3368_mipihpy_cfg - ((camsys_mipiphy_soc_para_t *)cfg_para); - break; - } - - case Isp_SoftRst: {/* ddl@rock-chips.com: v0.d.0 */ - unsigned long reset; - - reset = (unsigned long)cfg_para; - - if (reset == 1) - __raw_writel(0x80, (void *)(camsys_dev->rk_isp_base + - MRV_AFM_BASE + VI_IRCL)); - else - __raw_writel(0x00, (void *)(camsys_dev->rk_isp_base + - MRV_AFM_BASE + VI_IRCL)); - camsys_trace(2, "Isp self soft rst: %ld", reset); - break; - } - - default: - { - camsys_warn("cfg_cmd: 0x%x isn't support", cfg_cmd); - break; - } - - } - - return 0; -} -#endif /* CONFIG_ARM64 */ diff --git a/drivers/media/video/rk_camsys/camsys_soc_rk3368.h b/drivers/media/video/rk_camsys/camsys_soc_rk3368.h deleted file mode 100644 index 7bfb32dce7f0..000000000000 --- a/drivers/media/video/rk_camsys/camsys_soc_rk3368.h +++ /dev/null @@ -1,123 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __RKCAMSYS_SOC_RK3368_H__ -#define __RKCAMSYS_SOC_RK3368_H__ - -#include "camsys_internal.h" - -/*MARVIN REGISTER*/ -#define MRV_MIPI_BASE 0x1C00 -#define MRV_MIPI_CTRL 0x00 - -/* -*#define CSIHOST_PHY_TEST_CTRL0_OFFSET 0x0030 -#define DPHY_TX1RX1_TESTCLR (1<<0) -#define DPHY_TX1RX1_TESTCLK (1<<1) - -#define CSIHOST_PHY_TEST_CTRL1_OFFSET 0x0034 -#define DPHY_TX1RX1_TESTDIN_OFFSET_BITS (0) -#define DPHY_TX1RX1_TESTDOUT_OFFSET_BITS (8) -#define DPHY_TX1RX1_TESTEN (16) -*/ - -#define GRF_SOC_STATUS21 (0x2D4) - -#define CSIHOST_PHY_TEST_CTRL0 (0x30) -#define CSIHOST_PHY_TEST_CTRL1 (0x34) -#define CSIHOST_N_LANES (0x04) -#define CSIHOST_PHY_SHUTDOWNZ (0x08) -#define CSIHOST_CSI2_RESETN (0x10) -#define CSIHOST_DPHY_RSTZ (0x0c) -#define CSIHOST_PHY_STATE (0x14) -#define CSIHOST_DATA_IDS1 (0x18) -#define CSIHOST_DATA_IDS2 (0x1C) -#define CSIHOST_ERR1 (0x20) -#define CSIHOST_ERR2 (0x24) - -/* -*GRF_SOC_CON6 -*dphy_rx_forcerxmode 11:8 -*isp_mipi_csi_host_sel:1 -*disable_isp:0 -*bit 0 grf_con_disable_isp -*bit 1 isp_mipi_csi_host_sel 1'b0: mipi csi host -*/ -#define GRF_SOC_CON6_OFFSET (0x0418) -/*bit 0*/ -#define MIPI_PHY_DISABLE_ISP_MASK (0x1 << 16) -#define MIPI_PHY_DISABLE_ISP (0x0 << 0) -/*bit 1*/ -#define ISP_MIPI_CSI_HOST_SEL_OFFSET_MASK (0x1 << 17) -#define ISP_MIPI_CSI_HOST_SEL_OFFSET_BIT (0x1) -/*bit 6*/ -#define DPHY_RX_CLK_INV_SEL_MASK (0x1 << 22) -#define DPHY_RX_CLK_INV_SEL (0x1 << 6) -/*bit 11:8*/ -#define DPHY_RX_FORCERXMODE_OFFSET_MASK (0xF << 24) -#define DPHY_RX_FORCERXMODE_OFFSET_BITS (8) - -/*GRF_SOC_CON7*/ -/*dphy_tx0_forcerxmode*/ -#define GRF_SOC_CON7_OFFSET (0x041c) -/*bit 10:7*/ -#define FORCETXSTOPMODE_OFFSET_BITS (7) -#define FORCETXSTOPMODE_MASK (0xF << 23) - -#define DPHY_TX0_FORCERXMODE (6) -#define DPHY_TX0_FORCERXMODE_MASK (0x01 << 22) -/*bit 5*/ -#define LANE0_TURNDISABLE_BITS (5) -#define LANE0_TURNDISABLE_MASK (0x01 << 21) - -#define GRF_SOC_STATUS13 (0x04b4) -/*dphy_rx_rxclkactivehs*/ -/*dphy_rx_direction*/ -/*dphy_rx_ulpsactivenot_0...3*/ - -/*LOW POWER MODE SET*/ -/*base*/ -#define MIPI_CSI_DPHY_CTRL_LANE_ENABLE_OFFSET (0x00) -#define MIPI_CSI_DPHY_CTRL_LANE_ENABLE_OFFSET_BIT (2) - -#define MIPI_CSI_DPHY_CTRL_PWRCTL_OFFSET (0x04) -#define MIPI_CSI_DPHY_CTRL_DIG_RST_OFFSET (0x80) -#define MIPI_CSI_DPHY_CTRL_SIG_INV_OFFSET (0x84) - -/*Configure the count time of the THS-SETTLE by protocol.*/ -#define MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET (0x00) -/*MSB enable for pin_rxdatahs_ -*1: enable -*0: disable -*/ -#define MIPI_CSI_DPHY_LANEX_MSB_EN_OFFSET (0x38) - -#define MIPI_CSI_DPHY_RX_FORCERXMODE_MASK (0x0f << 24) -#define MIPI_CSI_DPHY_RX_FORCERXMODE_BIT (8) - -#define CSIHOST_N_LANES_OFFSET 0x04 -#define CSIHOST_N_LANES_OFFSET_BIT (0) - -#define write_grf_reg(addr, val) \ - __raw_writel(val, (void *)(addr + para->camsys_dev->rk_grf_base)) -#define read_grf_reg(addr) \ - __raw_readl((void *)(addr + para->camsys_dev->rk_grf_base)) -#define mask_grf_reg(addr, msk, val) \ - write_grf_reg(addr, (val) | ((~(msk)) & read_grf_reg(addr))) - -#define write_cru_reg(addr, val) \ - __raw_writel(val, (void *)(addr + para->camsys_dev->rk_cru_base)) - -/*#define cru_writel(v, o) do {writel(v, RK_CRU_VIRT + (o)); dsb();} \ -* while (0) -*/ - -#define write_csihost_reg(addr, val) \ - __raw_writel(val, (void *)(addr + phy_virt)) -#define read_csihost_reg(addr) \ - __raw_readl((void *)(addr + phy_virt)) -/*csi phy*/ -#define write_csiphy_reg(addr, val) \ - __raw_writel(val, (void *)(addr + csiphy_virt)) -#define read_csiphy_reg(addr) \ - __raw_readl((void *)(addr + csiphy_virt)) - -#endif diff --git a/drivers/media/video/rk_camsys/camsys_soc_rk3399.c b/drivers/media/video/rk_camsys/camsys_soc_rk3399.c deleted file mode 100644 index 8f5d57693ed3..000000000000 --- a/drivers/media/video/rk_camsys/camsys_soc_rk3399.c +++ /dev/null @@ -1,427 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifdef CONFIG_ARM64 -#include "camsys_soc_priv.h" -#include "camsys_soc_rk3399.h" - -struct mipiphy_hsfreqrange_s { - unsigned int range_l; - unsigned int range_h; - unsigned char cfg_bit; -}; - -static struct mipiphy_hsfreqrange_s mipiphy_hsfreqrange[] = { - {80, 90, 0x00}, - {90, 100, 0x10}, - {100, 110, 0x20}, - {110, 130, 0x01}, - {130, 140, 0x11}, - {140, 150, 0x21}, - {150, 170, 0x02}, - {170, 180, 0x12}, - {180, 200, 0x22}, - {200, 220, 0x03}, - {220, 240, 0x13}, - {240, 250, 0x23}, - {250, 270, 0x04}, - {270, 300, 0x14}, - {300, 330, 0x05}, - {330, 360, 0x15}, - {360, 400, 0x25}, - {400, 450, 0x06}, - {450, 500, 0x16}, - {500, 550, 0x07}, - {550, 600, 0x17}, - {600, 650, 0x08}, - {650, 700, 0x18}, - {700, 750, 0x09}, - {750, 800, 0x19}, - {800, 850, 0x29}, - {850, 900, 0x39}, - {900, 950, 0x0a}, - {950, 1000, 0x1a}, - {1000, 1050, 0x2a}, - {1100, 1150, 0x3a}, - {1150, 1200, 0x0b}, - {1200, 1250, 0x1b}, - {1250, 1300, 0x2b}, - {1300, 1350, 0x0c}, - {1350, 1400, 0x1c}, - {1400, 1450, 0x2c}, - {1450, 1500, 0x3c} -}; - -static char camsys_rk3399_mipiphy0_rd_reg(camsys_mipiphy_soc_para_t *para, unsigned char addr) -{ - /*TESTCLK=1*/ - write_grf_reg(GRF_SOC_CON25_OFFSET, DPHY_RX0_TESTCLK_MASK | - (1 << DPHY_RX0_TESTCLK_BIT)); - /*TESTEN =1,TESTDIN=addr*/ - write_grf_reg(GRF_SOC_CON25_OFFSET, - ((addr << DPHY_RX0_TESTDIN_BIT) | - DPHY_RX0_TESTDIN_MASK | - (1 << DPHY_RX0_TESTEN_BIT) | - DPHY_RX0_TESTEN_MASK)); - /*TESTCLK=0*/ - write_grf_reg(GRF_SOC_CON25_OFFSET, DPHY_RX0_TESTCLK_MASK); - - return read_grf_reg(GRF_SOC_STATUS1)&0xff; -} - -static int camsys_rk3399_mipiphy0_wr_reg -(camsys_mipiphy_soc_para_t *para, unsigned char addr, unsigned char data) -{ - /*TESTCLK=1*/ - write_grf_reg(GRF_SOC_CON25_OFFSET, DPHY_RX0_TESTCLK_MASK | - (1 << DPHY_RX0_TESTCLK_BIT)); - /*TESTEN =1,TESTDIN=addr*/ - write_grf_reg(GRF_SOC_CON25_OFFSET, - ((addr << DPHY_RX0_TESTDIN_BIT) | - DPHY_RX0_TESTDIN_MASK | - (1 << DPHY_RX0_TESTEN_BIT) | - DPHY_RX0_TESTEN_MASK)); - /*TESTCLK=0*/ - write_grf_reg(GRF_SOC_CON25_OFFSET, DPHY_RX0_TESTCLK_MASK); - - if (data != 0xff) { /*write data ?*/ - /*TESTEN =0,TESTDIN=data*/ - write_grf_reg(GRF_SOC_CON25_OFFSET, - ((data << DPHY_RX0_TESTDIN_BIT) | - DPHY_RX0_TESTDIN_MASK | - DPHY_RX0_TESTEN_MASK)); - - /*TESTCLK=1*/ - write_grf_reg(GRF_SOC_CON25_OFFSET, DPHY_RX0_TESTCLK_MASK | - (1 << DPHY_RX0_TESTCLK_BIT)); - } - return 0; -} - -static char camsys_rk3399_mipiphy1_wr_reg -(unsigned long dsiphy_virt, unsigned char addr, unsigned char data) -{ - /*TESTEN =1,TESTDIN=addr*/ - write_dsihost_reg(DSIHOST_PHY_TEST_CTRL1, (0x00010000 | addr)); - /*TESTCLK=0*/ - write_dsihost_reg(DSIHOST_PHY_TEST_CTRL0, 0x00000000); - /*TESTEN =0,TESTDIN=data*/ - write_dsihost_reg(DSIHOST_PHY_TEST_CTRL1, (0x00000000 | data)); - /*TESTCLK=1 */ - write_dsihost_reg(DSIHOST_PHY_TEST_CTRL0, 0x00000002); - - return 0; -} - -static int camsys_rk3399_mipiphy1_rd_reg(unsigned long dsiphy_virt, unsigned char addr) -{ - /*TESTEN =1,TESTDIN=addr*/ - write_dsihost_reg(DSIHOST_PHY_TEST_CTRL1, (0x00010000 | addr)); - /*TESTCLK=0*/ - write_dsihost_reg(DSIHOST_PHY_TEST_CTRL0, 0x00000000); - return (read_dsihost_reg(DSIHOST_PHY_TEST_CTRL1)>>8); -} - -static int camsys_rk3399_mipihpy_cfg -(camsys_mipiphy_soc_para_t *para) -{ - unsigned char hsfreqrange = 0xff, i; - struct mipiphy_hsfreqrange_s *hsfreqrange_p; - unsigned long phy_virt, phy_index; - unsigned long base; - unsigned long csiphy_virt; - unsigned long dsiphy_virt; - unsigned long vir_base = 0; - unsigned char settle_bypass = 0; - unsigned char settle_en = 0; - unsigned char manu_hsfreqrange = 0x04; - - phy_index = para->phy->phy_index; - if (para->camsys_dev->mipiphy[phy_index].reg != NULL) { - phy_virt = para->camsys_dev->mipiphy[phy_index].reg->vir_base; - } else { - phy_virt = 0x00; - } - if (para->camsys_dev->csiphy_reg != NULL) { - csiphy_virt = - (unsigned long)para->camsys_dev->csiphy_reg->vir_base; - } else { - csiphy_virt = 0x00; - } - if (para->camsys_dev->dsiphy_reg != NULL) { - dsiphy_virt = - (unsigned long)para->camsys_dev->dsiphy_reg->vir_base; - } else { - dsiphy_virt = 0x00; - } - - if ((para->phy->bit_rate == 0) || - (para->phy->data_en_bit == 0)) { - if (para->phy->phy_index == 0) { - base = - (para->camsys_dev->devmems.registermem->vir_base); - *((unsigned int *) - (base + (MRV_MIPI_BASE + MRV_MIPI_CTRL))) - &= ~(0x0f << 8); - camsys_trace(1, "mipi phy 0 standby!"); - } - - return 0; - } - - hsfreqrange_p = mipiphy_hsfreqrange; - for (i = 0; - i < (sizeof(mipiphy_hsfreqrange)/ - sizeof(struct mipiphy_hsfreqrange_s)); - i++) { - if ((para->phy->bit_rate > hsfreqrange_p->range_l) && - (para->phy->bit_rate <= hsfreqrange_p->range_h)) { - hsfreqrange = hsfreqrange_p->cfg_bit; - break; - } - hsfreqrange_p++; - } - - if (hsfreqrange == 0xff) { - camsys_err("mipi phy config bitrate %d Mbps isn't supported!", - para->phy->bit_rate); - hsfreqrange = 0x00; - } - hsfreqrange <<= 1; - if (para->phy->phy_index == 0) { - if (strstr(para->camsys_dev->miscdev.name, "camsys_marvin1")) { - camsys_err("miscdev.name = %s,mipi phy index %d is invalidate\n", - para->camsys_dev->miscdev.name, - para->phy->phy_index); - goto fail; - } - - write_grf_reg(GRF_SOC_CON21_OFFSET, - DPHY_RX0_FORCERXMODE_MASK | - (0x0 << DPHY_RX0_FORCERXMODE_BIT) | - DPHY_RX0_FORCETXSTOPMODE_MASK | - (0x0 << DPHY_RX0_FORCETXSTOPMODE_BIT)); - - /* set lane num*/ - write_grf_reg(GRF_SOC_CON21_OFFSET, - DPHY_RX0_ENABLE_MASK | - (para->phy->data_en_bit << DPHY_RX0_ENABLE_BIT)); - - /* set lan turndisab as 1*/ - write_grf_reg(GRF_SOC_CON21_OFFSET, - DPHY_RX0_TURNDISABLE_MASK | - (0xf << DPHY_RX0_TURNDISABLE_BIT)); - write_grf_reg(GRF_SOC_CON21_OFFSET, (0x0<<4) | (0xf<<20)); - - /* set lan turnrequest as 0 */ - write_grf_reg(GRF_SOC_CON9_OFFSET, - DPHY_RX0_TURNREQUEST_MASK | - (0x0 << DPHY_RX0_TURNREQUEST_BIT)); - - /*phy start*/ - { - write_grf_reg(GRF_SOC_CON25_OFFSET, - DPHY_RX0_TESTCLK_MASK | - (0x1 << DPHY_RX0_TESTCLK_BIT)); /*TESTCLK=1 */ - write_grf_reg(GRF_SOC_CON25_OFFSET, - DPHY_RX0_TESTCLR_MASK | - (0x1 << DPHY_RX0_TESTCLR_BIT)); /*TESTCLR=1*/ - udelay(100); - /*TESTCLR=0 zyc*/ - write_grf_reg(GRF_SOC_CON25_OFFSET, - DPHY_RX0_TESTCLR_MASK); - udelay(100); - /*set clock lane*/ - camsys_rk3399_mipiphy0_wr_reg - (para, 0x34, settle_bypass); - /*HS hsfreqrange & lane 0 settle bypass*/ - camsys_rk3399_mipiphy0_wr_reg - (para, 0x44, hsfreqrange | settle_bypass); - camsys_rk3399_mipiphy0_wr_reg - (para, 0x54, settle_bypass); - camsys_rk3399_mipiphy0_wr_reg - (para, 0x84, settle_bypass); - camsys_rk3399_mipiphy0_wr_reg - (para, 0x94, settle_bypass); - camsys_rk3399_mipiphy0_wr_reg - (para, 0x75, (settle_en << 7) | manu_hsfreqrange); - camsys_rk3399_mipiphy0_rd_reg(para, 0x75); - /*Normal operation*/ - camsys_rk3399_mipiphy0_wr_reg(para, 0x0, -1); - write_grf_reg(GRF_SOC_CON25_OFFSET, - DPHY_RX0_TESTCLK_MASK | - (1 << DPHY_RX0_TESTCLK_BIT)); /*TESTCLK=1*/ - /*TESTEN =0 */ - write_grf_reg(GRF_SOC_CON25_OFFSET, - (DPHY_RX0_TESTEN_MASK)); - } - - base = (para->camsys_dev->devmems.registermem->vir_base); - *((unsigned int *)(base + (MRV_MIPI_BASE+MRV_MIPI_CTRL))) |= - (0x0f<<8); - - } else if (para->phy->phy_index == 1) { - - if (!strstr(para->camsys_dev->miscdev.name, "camsys_marvin1")) { - camsys_err - ("miscdev.name = %s,mipi phy index %d is invalidate\n", - para->camsys_dev->miscdev.name, - para->phy->phy_index); - goto fail; - } - - write_grf_reg(GRF_SOC_CON23_OFFSET, - DPHY_RX0_FORCERXMODE_MASK | - (0x0 << DPHY_RX0_FORCERXMODE_BIT) | - DPHY_RX0_FORCETXSTOPMODE_MASK | - (0x0 << DPHY_RX0_FORCETXSTOPMODE_BIT)); - write_grf_reg(GRF_SOC_CON24_OFFSET, - DPHY_TX1RX1_MASTERSLAVEZ_MASK | - (0x0 << DPHY_TX1RX1_MASTERSLAVEZ_BIT) | - DPHY_TX1RX1_BASEDIR_MASK | - (0x1 << DPHY_TX1RX1_BASEDIR_BIT) | - DPHY_RX1_MASK | 0x0 << DPHY_RX1_SEL_BIT); - - /* set lane num*/ - write_grf_reg(GRF_SOC_CON23_OFFSET, - DPHY_TX1RX1_ENABLE_MASK | - (para->phy->data_en_bit << DPHY_TX1RX1_ENABLE_BIT)); - - /* set lan turndisab as 1*/ - write_grf_reg(GRF_SOC_CON23_OFFSET, - DPHY_TX1RX1_TURNDISABLE_MASK | - (0xf << DPHY_TX1RX1_TURNDISABLE_BIT)); - write_grf_reg(GRF_SOC_CON23_OFFSET, (0x0<<4)|(0xf<<20)); - - /* set lan turnrequest as 0*/ - write_grf_reg(GRF_SOC_CON24_OFFSET, - DPHY_TX1RX1_TURNREQUEST_MASK | - (0x0 << DPHY_TX1RX1_TURNREQUEST_BIT)); - /*phy1 start*/ - { - char res_val = 0; - res_val = read_dsihost_reg(DSIHOST_PHY_SHUTDOWNZ); - res_val &= 0xfffffffe; - /*SHUTDOWNZ=0*/ - write_dsihost_reg(DSIHOST_PHY_SHUTDOWNZ, res_val); - vir_base = (unsigned long)ioremap(0xff910000, 0x10000); - /*__raw_writel(0x60000, (void*)(0x1c00+vir_base));*/ - res_val = 0; - res_val = read_dsihost_reg(DSIHOST_DPHY_RSTZ); - res_val &= 0xfffffffd; - /*RSTZ=0*/ - write_dsihost_reg(DSIHOST_DPHY_RSTZ, res_val); - /*TESTCLK=1*/ - write_dsihost_reg(DSIHOST_PHY_TEST_CTRL0, 0x00000002); - /*TESTCLR=1 TESTCLK=1 */ - write_dsihost_reg(DSIHOST_PHY_TEST_CTRL0, 0x00000003); - udelay(100); - /*TESTCLR=0 TESTCLK=1*/ - write_dsihost_reg(DSIHOST_PHY_TEST_CTRL0, 0x00000002); - udelay(100); - /*set clock lane*/ - camsys_rk3399_mipiphy1_wr_reg - (dsiphy_virt, 0x34, settle_bypass); - /*HS hsfreqrange & lane 0 settle bypass*/ - camsys_rk3399_mipiphy1_wr_reg - (dsiphy_virt, 0x44, hsfreqrange | settle_bypass); - camsys_rk3399_mipiphy1_wr_reg - (dsiphy_virt, 0x54, settle_bypass); - camsys_rk3399_mipiphy1_wr_reg - (dsiphy_virt, 0x84, settle_bypass); - camsys_rk3399_mipiphy1_wr_reg - (dsiphy_virt, 0x94, settle_bypass); - camsys_rk3399_mipiphy1_wr_reg - (dsiphy_virt, 0x75, (settle_en << 7) | manu_hsfreqrange); - camsys_rk3399_mipiphy1_rd_reg(dsiphy_virt, 0x75); - /*TESTCLK=1*/ - write_dsihost_reg(DSIHOST_PHY_TEST_CTRL0, 0x00000002); - /*TESTEN =0*/ - write_dsihost_reg(DSIHOST_PHY_TEST_CTRL1, 0x00000000); - /*SHUTDOWNZ=1*//*RSTZ=1*/ - /*__raw_writel(0x60f00, (void*)(0x1c00+vir_base));*/ - write_dsihost_reg(DSIHOST_DPHY_RSTZ, 0x00000002); - } - - } else { - camsys_err("mipi phy index %d is invalidate!", - para->phy->phy_index); - goto fail; - } - - camsys_trace(1, "mipi phy(%d) turn on(lane: 0x%x bit_rate: %dMbps)", - para->phy->phy_index, para->phy->data_en_bit, - para->phy->bit_rate); - - return 0; - -fail: - return -1; -} - -#define MRV_AFM_BASE 0x0000 -#define VI_IRCL 0x0014 -int camsys_rk3399_cfg -(camsys_dev_t *camsys_dev, camsys_soc_cfg_t cfg_cmd, void *cfg_para) -{ - unsigned int *para_int; - - switch (cfg_cmd) { - case Clk_DriverStrength_Cfg: { - para_int = (unsigned int *)cfg_para; - __raw_writel((((*para_int) & 0x03) << 3) | (0x03 << 3), - (void *)(camsys_dev->rk_grf_base + 0x204)); - break; - } - - case Cif_IoDomain_Cfg: { - para_int = (unsigned int *)cfg_para; - if (*para_int < 28000000) { - /* 1.8v IO */ - __raw_writel(((1 << 1) | (1 << (1 + 16))), - (void *)(camsys_dev->rk_grf_base + 0x0900)); - } else { - /* 3.3v IO */ - __raw_writel(((0 << 1) | (1 << (1 + 16))), - (void *)(camsys_dev->rk_grf_base + 0x0900)); - } - break; - } - - case Mipi_Phy_Cfg: { - camsys_mipiphy_soc_para_t *para - = (camsys_mipiphy_soc_para_t *)cfg_para; - - if (para->phy->dir == CamSys_Mipiphy_Tx && - para->phy->phy_index == 1) { - /* TX1/RX1 DPHY switch to RX status */ - __raw_writel(0x300020, - (void *)(camsys_dev->rk_grf_base + 0x6260)); - } else { - camsys_rk3399_mipihpy_cfg - ((camsys_mipiphy_soc_para_t *)cfg_para); - } - break; - } - - case Isp_SoftRst: /* ddl@rock-chips.com: v0.d.0 */ { - unsigned long reset; - reset = (unsigned long)cfg_para; - - if (reset == 1) - __raw_writel(0x80, (void *)(camsys_dev->rk_isp_base + - MRV_AFM_BASE + VI_IRCL)); - else - __raw_writel(0x00, (void *)(camsys_dev->rk_isp_base + - MRV_AFM_BASE + VI_IRCL)); - break; - } - - default: { - camsys_warn("cfg_cmd: 0x%x isn't support", cfg_cmd); - break; - } - - } - - return 0; -} -#endif /* CONFIG_ARM64 */ diff --git a/drivers/media/video/rk_camsys/camsys_soc_rk3399.h b/drivers/media/video/rk_camsys/camsys_soc_rk3399.h deleted file mode 100644 index 9df66e79c55b..000000000000 --- a/drivers/media/video/rk_camsys/camsys_soc_rk3399.h +++ /dev/null @@ -1,177 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __RKCAMSYS_SOC_RK3399_H__ -#define __RKCAMSYS_SOC_RK3399_H__ - -#include "camsys_internal.h" - -/*MARVIN REGISTER*/ -#define MRV_MIPI_BASE 0x1C00 -#define MRV_MIPI_CTRL 0x00 - -/* -*#define CSIHOST_PHY_TEST_CTRL0_OFFSET 0x0030 -#define DPHY_TX1RX1_TESTCLR (1<<0) -#define DPHY_TX1RX1_TESTCLK (1<<1) - -#define CSIHOST_PHY_TEST_CTRL1_OFFSET 0x0034 -#define DPHY_TX1RX1_TESTDIN_OFFSET_BITS (0) -#define DPHY_TX1RX1_TESTDOUT_OFFSET_BITS (8) -#define DPHY_TX1RX1_TESTEN (16) -*/ - -#define GRF_SOC_STATUS21 (0x2D4) -#define GRF_SOC_STATUS1 (0x0e2a4) - -#define CSIHOST_PHY_TEST_CTRL0 (0x30) -#define CSIHOST_PHY_TEST_CTRL1 (0x34) -#define CSIHOST_N_LANES (0x04) -#define CSIHOST_PHY_SHUTDOWNZ (0x08) -#define CSIHOST_CSI2_RESETN (0x10) -#define CSIHOST_DPHY_RSTZ (0x0c) -#define CSIHOST_PHY_STATE (0x14) -#define CSIHOST_DATA_IDS1 (0x18) -#define CSIHOST_DATA_IDS2 (0x1C) -#define CSIHOST_ERR1 (0x20) -#define CSIHOST_ERR2 (0x24) - -/* -*GRF_SOC_CON6 -*dphy_rx_forcerxmode 11:8 -*isp_mipi_csi_host_sel:1 -*disable_isp:0 -*bit 0 grf_con_disable_isp -*bit 1 isp_mipi_csi_host_sel 1'b0: mipi csi host -*/ -#define GRF_SOC_CON6_OFFSET (0x0418) -/*bit 0*/ -#define MIPI_PHY_DISABLE_ISP_MASK (0x1 << 16) -#define MIPI_PHY_DISABLE_ISP (0x0 << 0) -/*bit 1*/ -#define ISP_MIPI_CSI_HOST_SEL_OFFSET_MASK (0x1 << 17) -#define ISP_MIPI_CSI_HOST_SEL_OFFSET_BIT (0x1) -/*bit 6*/ -#define DPHY_RX_CLK_INV_SEL_MASK (0x1 << 22) -#define DPHY_RX_CLK_INV_SEL (0x1 << 6) -/*bit 11:8*/ -#define DPHY_RX_FORCERXMODE_OFFSET_MASK (0xF << 24) -#define DPHY_RX_FORCERXMODE_OFFSET_BITS (8) - -/*GRF_SOC_CON7*/ -/*dphy_tx0_forcerxmode*/ -#define GRF_SOC_CON7_OFFSET (0x041c) -/*bit 10:7*/ -#define FORCETXSTOPMODE_OFFSET_BITS (7) -#define FORCETXSTOPMODE_MASK (0xF << 23) - -#define DPHY_TX0_FORCERXMODE (6) -#define DPHY_TX0_FORCERXMODE_MASK (0x01 << 22) -/*bit 5*/ -#define LANE0_TURNDISABLE_BITS (5) -#define LANE0_TURNDISABLE_MASK (0x01 << 21) - -#define GRF_SOC_STATUS13 (0x04b4) - -#define GRF_SOC_CON9_OFFSET (0x6224) -#define DPHY_RX0_TURNREQUEST_MASK (0xF << 16) -#define DPHY_RX0_TURNREQUEST_BIT (0) - -#define GRF_SOC_CON21_OFFSET (0x6254) -#define DPHY_RX0_FORCERXMODE_MASK (0xF << 20) -#define DPHY_RX0_FORCERXMODE_BIT (4) -#define DPHY_RX0_FORCETXSTOPMODE_MASK (0xF << 24) -#define DPHY_RX0_FORCETXSTOPMODE_BIT (8) -#define DPHY_RX0_TURNDISABLE_MASK (0xF << 28) -#define DPHY_RX0_TURNDISABLE_BIT (12) -#define DPHY_RX0_ENABLE_MASK (0xF << 16) -#define DPHY_RX0_ENABLE_BIT (0) - -#define GRF_SOC_CON23_OFFSET (0x625c) -#define DPHY_TX1RX1_TURNDISABLE_MASK (0xF << 28) -#define DPHY_TX1RX1_TURNDISABLE_BIT (12) -#define DPHY_TX1RX1_FORCERXMODE_MASK (0xF << 20) -#define DPHY_TX1RX1_FORCERXMODE_BIT (4) -#define DPHY_TX1RX1_FORCETXSTOPMODE_MASK (0xF << 24) -#define DPHY_TX1RX1_FORCETXSTOPMODE_BIT (8) -#define DPHY_TX1RX1_ENABLE_MASK (0xF << 16) -#define DPHY_TX1RX1_ENABLE_BIT (0) - -#define GRF_SOC_CON24_OFFSET (0x6260) -#define DPHY_TX1RX1_MASTERSLAVEZ_MASK (0x1 << 23) -#define DPHY_TX1RX1_MASTERSLAVEZ_BIT (7) -#define DPHY_TX1RX1_BASEDIR_MASK (0x1 << 21) -#define DPHY_TX1RX1_BASEDIR_BIT (5) -#define DPHY_RX1_MASK (0x1 << 20) -#define DPHY_RX1_SEL_BIT (4) - -#define DPHY_TX1RX1_TURNREQUEST_MASK (0xF << 16) -#define DPHY_TX1RX1_TURNREQUEST_BIT (0) - -#define GRF_SOC_CON25_OFFSET (0x6264) -#define DPHY_RX0_TESTCLK_MASK (0x1 << 25) -#define DPHY_RX0_TESTCLK_BIT (9) -#define DPHY_RX0_TESTCLR_MASK (0x1 << 26) -#define DPHY_RX0_TESTCLR_BIT (10) -#define DPHY_RX0_TESTDIN_MASK (0xFF << 16) -#define DPHY_RX0_TESTDIN_BIT (0) -#define DPHY_RX0_TESTEN_MASK (0x1 << 24) -#define DPHY_RX0_TESTEN_BIT (8) - -/*dphy_rx_rxclkactivehs*/ -/*dphy_rx_direction*/ -/*dphy_rx_ulpsactivenot_0...3*/ - -/*LOW POWER MODE SET*/ -/*base*/ -#define MIPI_CSI_DPHY_CTRL_LANE_ENABLE_OFFSET (0x00) -#define MIPI_CSI_DPHY_CTRL_LANE_ENABLE_OFFSET_BIT (2) - -#define MIPI_CSI_DPHY_CTRL_PWRCTL_OFFSET (0x04) -#define MIPI_CSI_DPHY_CTRL_DIG_RST_OFFSET (0x80) -#define MIPI_CSI_DPHY_CTRL_SIG_INV_OFFSET (0x84) - -/*Configure the count time of the THS-SETTLE by protocol.*/ -#define MIPI_CSI_DPHY_LANEX_THS_SETTLE_OFFSET (0x00) -/*MSB enable for pin_rxdatahs_ -*1: enable -*0: disable -*/ -#define MIPI_CSI_DPHY_LANEX_MSB_EN_OFFSET (0x38) - -#define CSIHOST_N_LANES_OFFSET 0x04 -#define CSIHOST_N_LANES_OFFSET_BIT (0) - -#define DSIHOST_PHY_SHUTDOWNZ (0x00a0) -#define DSIHOST_DPHY_RSTZ (0x00a0) -#define DSIHOST_PHY_TEST_CTRL0 (0x00b4) -#define DSIHOST_PHY_TEST_CTRL1 (0x00b8) - -#define write_grf_reg(addr, val) \ - __raw_writel(val, (void *)(addr + para->camsys_dev->rk_grf_base)) -#define read_grf_reg(addr) \ - __raw_readl((void *)(addr + para->camsys_dev->rk_grf_base)) -#define mask_grf_reg(addr, msk, val) \ - write_grf_reg(addr, (val) | ((~(msk)) & read_grf_reg(addr))) - -#define write_cru_reg(addr, val) \ - __raw_writel(val, (void *)(addr + para->camsys_dev->rk_cru_base)) - -/*#define cru_writel(v, o) do {writel(v, RK_CRU_VIRT + (o)); dsb();} \ -* while (0) -*/ - -#define write_csihost_reg(addr, val) \ - __raw_writel(val, (void *)(addr + phy_virt)) -#define read_csihost_reg(addr) \ - __raw_readl((void *)(addr + phy_virt)) -/*csi phy*/ -#define write_csiphy_reg(addr, val) \ - __raw_writel(val, (void *)(addr + csiphy_virt)) -#define read_csiphy_reg(addr) \ - __raw_readl((void *)(addr + csiphy_virt)) - -#define write_dsihost_reg(addr, val) \ - __raw_writel(val, (void *)(addr + dsiphy_virt)) -#define read_dsihost_reg(addr) \ - __raw_readl((void *)(addr + dsiphy_virt)) - -#endif diff --git a/drivers/media/video/rk_camsys/ext_flashled_drv/Kconfig b/drivers/media/video/rk_camsys/ext_flashled_drv/Kconfig deleted file mode 100644 index b12c5b78d1d3..000000000000 --- a/drivers/media/video/rk_camsys/ext_flashled_drv/Kconfig +++ /dev/null @@ -1,27 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -config FLASHLIGHT - bool "Flashlight Support" - default n - help - This option enables the led sysfs class in /sys/class/flashlight. - -config LEDS_RT8547 - bool "LED Support for RT8547" - select RT_FLASH_LED - default n - help - This option enabled support for RT8547 LED drivers - -config LEDS_RT8547_DBG - bool "LED RT8547 Debug Info" - depends on LEDS_RT8547 - default n - help - This option enabled RT8547 LED drivers debug option - -config RT_FLASH_LED - bool "Richtek flash LED driver support" - depends on FLASHLIGHT - default n - help - Say Y here to enable Richtek's flash LED driver HAL architecture diff --git a/drivers/media/video/rk_camsys/ext_flashled_drv/Makefile b/drivers/media/video/rk_camsys/ext_flashled_drv/Makefile deleted file mode 100644 index c0fb3bf73c91..000000000000 --- a/drivers/media/video/rk_camsys/ext_flashled_drv/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -obj-$(CONFIG_FLASHLIGHT) += flashlight.o rk_ext_fshled_ctl.o -obj-$(CONFIG_RT_FLASH_LED) += rtfled.o -obj-$(CONFIG_LEDS_RT8547) += leds-rt8547.o diff --git a/drivers/media/video/rk_camsys/ext_flashled_drv/flashlight.c b/drivers/media/video/rk_camsys/ext_flashled_drv/flashlight.c deleted file mode 100755 index e0f9a85cc4ec..000000000000 --- a/drivers/media/video/rk_camsys/ext_flashled_drv/flashlight.c +++ /dev/null @@ -1,335 +0,0 @@ -/* drivers/leds/flashlight.c - * Flashlight Class Device Driver - * - * Copyright (C) 2013 Richtek Technology Corp. - * Author: Patrick Chang - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - */ - -#include -#include -#include "flashlight.h" -#include -#include -#include - -static struct class *flashlight_class; - -static int flashlight_suspend(struct device *dev, pm_message_t state) -{ - struct flashlight_device *flashlight_dev = to_flashlight_device(dev); - - if (flashlight_dev->ops) - flashlight_dev->ops->suspend(flashlight_dev, state); - return 0; -} - -static int flashlight_resume(struct device *dev) -{ - struct flashlight_device *flashlight_dev = to_flashlight_device(dev); - - if (flashlight_dev->ops) - flashlight_dev->ops->resume(flashlight_dev); - return 0; -} - -static void flashlight_device_release(struct device *dev) -{ - struct flashlight_device *flashlight_dev = to_flashlight_device(dev); - - kfree(flashlight_dev); -} - -/** - * flashlight_device_register - create and register a new object of - * flashlight_device class. - * @name: the name of the new object(must be the same as the name of the - * respective framebuffer device). - * @parent: a pointer to the parent device - * @devdata: an optional pointer to be stored for private driver use. The - * methods may retrieve it by using bl_get_data(flashlight_dev). - * @ops: the flashlight operations structure. - * - * Creates and registers new flashlight device. Returns either an - * ERR_PTR() or a pointer to the newly allocated device. - */ -struct flashlight_device *flashlight_device_register(const char *name, - struct device *parent, - void *devdata, - const struct flashlight_ops - *ops, - const struct - flashlight_properties - *props) -{ - struct flashlight_device *flashlight_dev; - int rc; - - pr_debug("flashlight_device_register: name=%s\n", name); - flashlight_dev = kzalloc(sizeof(*flashlight_dev), GFP_KERNEL); - if (!flashlight_dev) - return ERR_PTR(-ENOMEM); - - mutex_init(&flashlight_dev->ops_lock); - flashlight_dev->dev.class = flashlight_class; - flashlight_dev->dev.parent = parent; - flashlight_dev->dev.release = flashlight_device_release; - dev_set_name(&flashlight_dev->dev, name); - dev_set_drvdata(&flashlight_dev->dev, devdata); - /* Copy properties */ - if (props) { - memcpy(&flashlight_dev->props, props, - sizeof(struct flashlight_properties)); - } - rc = device_register(&flashlight_dev->dev); - if (rc) { - kfree(flashlight_dev); - return ERR_PTR(rc); - } - flashlight_dev->ops = ops; - return flashlight_dev; -} -EXPORT_SYMBOL(flashlight_device_register); - -/** - * flashlight_device_unregister - unregisters a flashlight device object. - * @flashlight_dev: the flashlight device object to be unregistered and freed. - * - * Unregisters a previously registered via flashlight_device_register object. - */ -void flashlight_device_unregister(struct flashlight_device *flashlight_dev) -{ - if (!flashlight_dev) - return; - - mutex_lock(&flashlight_dev->ops_lock); - flashlight_dev->ops = NULL; - mutex_unlock(&flashlight_dev->ops_lock); - device_unregister(&flashlight_dev->dev); -} -EXPORT_SYMBOL(flashlight_device_unregister); - -int flashlight_list_color_temperature(struct flashlight_device *flashlight_dev, - int selector) -{ - if (flashlight_dev->ops && flashlight_dev->ops->list_color_temperature) - return flashlight_dev->ops-> - list_color_temperature(flashlight_dev, selector); - return -EINVAL; -} -EXPORT_SYMBOL(flashlight_list_color_temperature); - -int flashlight_set_color_temperature(struct flashlight_device *flashlight_dev, - int minK, int maxK) -{ - int selector = 0; - int rc; - - if ((flashlight_dev->ops == NULL) || - (flashlight_dev->ops->set_color_temperature == NULL)) - return -EINVAL; - for (selector = 0;; selector++) { - rc = flashlight_list_color_temperature(flashlight_dev, - selector); - if (rc < 0) - return rc; - if (rc >= minK && rc <= maxK) { - mutex_lock(&flashlight_dev->ops_lock); - rc = flashlight_dev->ops-> - set_color_temperature(flashlight_dev, rc); - mutex_unlock(&flashlight_dev->ops_lock); - if (rc == 0) - flashlight_dev->props.color_temperature = rc; - return rc; - } - - } - return -EINVAL; -} -EXPORT_SYMBOL(flashlight_set_color_temperature); - -int flashlight_set_torch_brightness(struct flashlight_device *flashlight_dev, - int brightness_level) -{ - int rc; - - if ((flashlight_dev->ops == NULL) || - (flashlight_dev->ops->set_torch_brightness == NULL)) - return -EINVAL; - if (brightness_level > flashlight_dev->props.torch_max_brightness) - return -EINVAL; - mutex_lock(&flashlight_dev->ops_lock); - rc = flashlight_dev->ops->set_torch_brightness(flashlight_dev, - brightness_level); - mutex_unlock(&flashlight_dev->ops_lock); - if (rc < 0) - return rc; - flashlight_dev->props.torch_brightness = brightness_level; - return rc; - -} -EXPORT_SYMBOL(flashlight_set_torch_brightness); - -int flashlight_set_strobe_brightness(struct flashlight_device *flashlight_dev, - int brightness_level) -{ - int rc; - - if ((flashlight_dev->ops == NULL) || - (flashlight_dev->ops->set_strobe_brightness == NULL)) - return -EINVAL; - if (brightness_level > flashlight_dev->props.strobe_max_brightness) - return -EINVAL; - mutex_lock(&flashlight_dev->ops_lock); - rc = flashlight_dev->ops->set_strobe_brightness(flashlight_dev, - brightness_level); - mutex_unlock(&flashlight_dev->ops_lock); - if (rc < 0) - return rc; - flashlight_dev->props.strobe_brightness = brightness_level; - return rc; -} -EXPORT_SYMBOL(flashlight_set_strobe_brightness); - -int flashlight_list_strobe_timeout(struct flashlight_device *flashlight_dev, - int selector) -{ - if (flashlight_dev->ops && flashlight_dev->ops->list_strobe_timeout) { - return flashlight_dev->ops->list_strobe_timeout(flashlight_dev, - selector); - } - return -EINVAL; -} -EXPORT_SYMBOL(flashlight_list_strobe_timeout); - -int flashlight_set_strobe_timeout(struct flashlight_device *flashlight_dev, - int min_ms, int max_ms) -{ - int selector = 0; - int rc = -EINVAL; - int timeout; - - if ((flashlight_dev->ops == NULL) || - (flashlight_dev->ops->set_strobe_timeout == NULL)) - return -EINVAL; - for (selector = 0;; selector++) { - timeout = - flashlight_list_strobe_timeout(flashlight_dev, selector); - if (timeout < 0) - return timeout; - if (timeout >= min_ms && timeout <= max_ms) { - mutex_lock(&flashlight_dev->ops_lock); - rc = flashlight_dev->ops-> - set_strobe_timeout(flashlight_dev, timeout); - mutex_unlock(&flashlight_dev->ops_lock); - if (rc == 0) - flashlight_dev->props.strobe_timeout = timeout; - return rc; - } - } - return -EINVAL; -} -EXPORT_SYMBOL(flashlight_set_strobe_timeout); - -int flashlight_set_mode(struct flashlight_device *flashlight_dev, int mode) -{ - int rc; - - if (mode >= FLASHLIGHT_MODE_MAX || mode < 0) - return -EINVAL; - if ((flashlight_dev->ops == NULL) || - (flashlight_dev->ops->set_mode == NULL)) { - flashlight_dev->props.mode = mode; - return 0; - } - mutex_lock(&flashlight_dev->ops_lock); - rc = flashlight_dev->ops->set_mode(flashlight_dev, mode); - mutex_unlock(&flashlight_dev->ops_lock); - if (rc < 0) - return rc; - flashlight_dev->props.mode = mode; - return rc; -} -EXPORT_SYMBOL(flashlight_set_mode); - -int flashlight_strobe(struct flashlight_device *flashlight_dev) -{ - if (flashlight_dev->props.mode == FLASHLIGHT_MODE_FLASH - || flashlight_dev->props.mode == FLASHLIGHT_MODE_MIXED) { - if (flashlight_dev->ops == NULL || - flashlight_dev->ops->strobe == NULL) - return -EINVAL; - return flashlight_dev->ops->strobe(flashlight_dev); - } - return -EINVAL; -} -EXPORT_SYMBOL(flashlight_strobe); - -static int flashlight_match_device_by_name(struct device *dev, const void *data) -{ - const char *name = data; - - return strcmp(dev_name(dev), name) == 0; -} - -struct flashlight_device *find_flashlight_by_name(char *name) -{ - struct device *dev; - - if (!name) - return (struct flashlight_device *)NULL; - dev = class_find_device(flashlight_class, NULL, (void*)name, - flashlight_match_device_by_name); - - return dev ? to_flashlight_device(dev) : NULL; - -} -EXPORT_SYMBOL(find_flashlight_by_name); - -int flashlight_strobe_charge(struct flashlight_device *flashlight_dev, - flashlight_charge_event_cb cb, void *data, - int start) -{ - - if (flashlight_dev->ops->strobe_charge) - return flashlight_dev->ops->strobe_charge(flashlight_dev, - cb, data, start); - if (flashlight_dev->props.type == FLASHLIGHT_TYPE_LED) { - if (cb) - cb(data, 0); - return 0; - } - return -EINVAL; -} -EXPORT_SYMBOL(flashlight_strobe_charge); - -static void __exit flashlight_class_exit(void) -{ - class_destroy(flashlight_class); -} - -static int __init flashlight_class_init(void) -{ - flashlight_class = class_create(THIS_MODULE, "flashlight"); - if (IS_ERR(flashlight_class)) { - pr_err( - "Unable to create flashlight class; errno = %ld\n", - PTR_ERR(flashlight_class)); - return PTR_ERR(flashlight_class); - } - - flashlight_class->suspend = flashlight_suspend; - flashlight_class->resume = flashlight_resume; - return 0; -} -subsys_initcall(flashlight_class_init); -module_exit(flashlight_class_exit); - -MODULE_DESCRIPTION("Flashlight Class Device"); -MODULE_AUTHOR("Patrick Chang "); -MODULE_VERSION("1.0.0_G"); -MODULE_LICENSE("GPL"); diff --git a/drivers/media/video/rk_camsys/ext_flashled_drv/flashlight.h b/drivers/media/video/rk_camsys/ext_flashled_drv/flashlight.h deleted file mode 100755 index 48b1ea22db81..000000000000 --- a/drivers/media/video/rk_camsys/ext_flashled_drv/flashlight.h +++ /dev/null @@ -1,138 +0,0 @@ -/* include/linux/leds/flashlight.h - * Header of Flashlight Class Device Driver - * - * Copyright (C) 2013 Richtek Technology Corp. - * Patrick Chang - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#ifndef LINUX_LEDS_FLASHLIGHT_H -#define LINUX_LEDS_FLASHLIGHT_H - -#include -#include - -typedef enum flashlight_type { - FLASHLIGHT_TYPE_XENON = 0, - FLASHLIGHT_TYPE_LED, - FLASHLIFHT_TYPE_BULB, - FLASHLIGHT_TYPE_MAX, -} flashlight_type_t; -typedef enum flashlight_mode { - FLASHLIGHT_MODE_OFF = 0, - FLASHLIGHT_MODE_TORCH, - FLASHLIGHT_MODE_FLASH, - /* MIXED mode means TORCH + FLASH */ - FLASHLIGHT_MODE_MIXED, - FLASHLIGHT_MODE_MAX, -} flashlight_mode_t; - -struct flashlight_device; - -typedef int (*flashlight_charge_event_cb) (void *data, int remains); - -struct flashlight_ops { - int (*set_torch_brightness)(struct flashlight_device *, int); - int (*set_strobe_brightness)(struct flashlight_device *, int); - int (*set_strobe_timeout)(struct flashlight_device *, int); - int (*list_strobe_timeout)(struct flashlight_device *, int); - int (*set_mode)(struct flashlight_device *, int); - int (*set_color_temperature)(struct flashlight_device *, int); - int (*list_color_temperature)(struct flashlight_device *, int); - int (*strobe_charge)(struct flashlight_device *, - flashlight_charge_event_cb, void *, int); - int (*strobe)(struct flashlight_device *); - int (*suspend)(struct flashlight_device *, pm_message_t); - int (*resume)(struct flashlight_device *); -}; - -struct flashlight_properties { - /* Flashlight type */ - enum flashlight_type type; - /* Xenon type flashlight doesn't support torch mode */ - enum flashlight_mode mode; - /* Color temperature, unit: K, 0 means unknown */ - int color_temperature; - int torch_brightness; - int torch_max_brightness; - int strobe_brightness; - int strobe_max_brightness; - int strobe_delay; - int strobe_timeout; - const char *alias_name; -}; - -struct flashlight_device { - /* Flashlight properties */ - struct flashlight_properties props; - const struct flashlight_ops *ops; - struct mutex ops_lock; - struct device dev; -}; - -extern struct flashlight_device *flashlight_device_register(const char *name, - struct device *parent, - void *devdata, - const struct - flashlight_ops * ops, - const struct - flashlight_properties - *props); -extern void flashlight_device_unregister(struct flashlight_device - *flashlight_dev); -extern struct flashlight_device *find_flashlight_by_name(char *name); -extern int flashlight_list_color_temperature(struct flashlight_device - *flashlight_dev, int selector); -extern int flashlight_set_color_temperature(struct flashlight_device - *flashlight_dev, int minK, - int maxK); -extern int flashlight_set_torch_brightness(struct flashlight_device - *flashlight_dev, - int brightness_level); -extern int flashlight_set_strobe_brightness(struct flashlight_device - *flashlight_dev, - int brightness_level); -extern int flashlight_list_strobe_timeout(struct flashlight_device - *flashlight_dev, int selector); -extern int flashlight_set_strobe_timeout(struct flashlight_device - *flashlight_dev, int min_ms, - int max_ms); -extern int flashlight_set_mode(struct flashlight_device *flashlight_dev, - int mode); - -extern int flashlight_strobe(struct flashlight_device *flashlight_dev); - -/* flashlight_charge_event_cb(void *data, int remains) - * description : - * callback function of flashlight charging progress - * arguments : - * @data : data pass by flashlight_strobe_charge() - * @remains : remained time to full chargerd, unit : ms ; 0 means ready - * return : 0 means succeess, otherwise see definitions in errno.h - */ - -/* flashlight_strobe_chargestruct flashlight_device *flashlight_dev, - * flashlight_charge_event_cb cb, void *data, int start) - * description : - * flashlight start / stop charging - * @flashlight_dev : flashlight devices - * @flashlight_charge_event_cb : callback function to report progress - * @data : bypass to callback function - * @start : 1 means start; 0 means stop - */ -extern int flashlight_strobe_charge(struct flashlight_device *flashlight_dev, - flashlight_charge_event_cb cb, void *data, - int start); - -#define to_flashlight_device(obj) \ - container_of(obj, struct flashlight_device, dev) - -static inline void *flashlight_get_data(struct flashlight_device - *flashlight_dev) -{ - return dev_get_drvdata(&flashlight_dev->dev); -} -#endif /*LINUX_LEDS_FLASHLIGHT_H */ diff --git a/drivers/media/video/rk_camsys/ext_flashled_drv/leds-rt8547.c b/drivers/media/video/rk_camsys/ext_flashled_drv/leds-rt8547.c deleted file mode 100644 index 770db3cad87d..000000000000 --- a/drivers/media/video/rk_camsys/ext_flashled_drv/leds-rt8547.c +++ /dev/null @@ -1,887 +0,0 @@ -/* - * drivers/leds/leds-rt8547.c - * Driver for Richtek RT8547 LED Flash IC - * - * Copyright (C) 2014 Richtek Technology Corp. - * cy_huang - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include -#ifdef CONFIG_OF -#include -#endif /* #ifdef CONFIG_OF */ -#ifdef CONFIG_DEBUG_FS -#include -#include -#endif /* #ifdef CONFIG_DEBUG_FS */ - -#include "rtfled.h" -#include "leds-rt8547.h" - -struct rt8547_chip { - rt_fled_info_t base; - struct device *dev; - struct rt8547_platform_data *pdata; - spinlock_t io_lock; - unsigned char suspend:1; - int in_use_mode; - struct platform_device rt_fled_pdev; -#ifdef CONFIG_DEBUG_FS - struct flashlight_device *fled_dev; - unsigned char reg_addr; - unsigned char reg_data; -#endif /* #ifdef CONFIG_DEBUG_FS */ -}; - -#ifdef CONFIG_DEBUG_FS -struct rt_debug_st { - void *info; - int id; -}; - -enum { - RT8547_DBG_REG, - RT8547_DBG_DATA, - RT8547_DBG_REGS, - RT8547_DBG_FLED, - RT8547_DBG_MAX -}; - -static struct dentry *debugfs_rt_dent; -static struct dentry *debugfs_file[RT8547_DBG_MAX]; -static struct rt_debug_st rtdbg_data[RT8547_DBG_MAX]; -#endif /* #ifdef CONFIG_DEBUG_FS */ - -static unsigned char rt8547_reg_initval[] = { - 0x06, /* REG 0x01 */ - 0x12, /* REG 0x02 */ - 0x02, /* REG 0x03 */ - 0x0F, /* REG 0x04 */ -}; - -static inline int rt8547_send_bit(struct rt8547_platform_data *pdata, - unsigned char bit) -{ - if (bit) { - gpio_set_value(pdata->flset_gpio, (~(pdata->flset_active) & 0x1)); - udelay(RT8547_SHORT_DELAY); - gpio_set_value(pdata->flset_gpio, ((pdata->flset_active) & 0x1)); - udelay(RT8547_LONG_DELAY); - } else { - gpio_set_value(pdata->flset_gpio, (~(pdata->flset_active) & 0x1)); - udelay(RT8547_LONG_DELAY); - gpio_set_value(pdata->flset_gpio, ((pdata->flset_active) & 0x1)); - udelay(RT8547_SHORT_DELAY); - } - return 0; -} - -static inline int rt8547_send_byte(struct rt8547_platform_data *pdata, - unsigned char byte) -{ - int i; - - /*Send order is high bit to low bit */ - for (i = 7; i >= 0; i--) - rt8547_send_bit(pdata, byte & (0x1 << i)); - return 0; -} - -static inline int rt8547_send_special_byte(struct rt8547_platform_data *pdata, - unsigned char byte) -{ - int i; - - /*Only send three bit for register address */ - for (i = 2; i >= 0; i--) - rt8547_send_bit(pdata, byte & (0x1 << i)); - return 0; -} - -static inline int rt8547_start_xfer(struct rt8547_platform_data *pdata) -{ - gpio_set_value(pdata->flset_gpio, ((pdata->flset_active) & 0x1)); - udelay(RT8547_START_DELAY); - return 0; -} - -static inline int rt8547_stop_xfer(struct rt8547_platform_data *pdata) -{ - /*Redundant one bit as the stop condition */ - rt8547_send_bit(pdata, 1); - return 0; -} - -static int rt8547_send_data(struct rt8547_chip *chip, unsigned char reg, - unsigned char data) -{ - struct rt8547_platform_data *pdata = chip->pdata; - unsigned long flags; - unsigned char xfer_data[3]; /*0: adddr, 1: reg, 2: reg data*/ - - xfer_data[0] = RT8547_ONEWIRE_ADDR; - xfer_data[1] = reg; - xfer_data[2] = data; - RT_DBG("rt8547-> 0: 0x%02x, 1: 0x%02x, 2: 0x%02x\n", xfer_data[0], - xfer_data[1], xfer_data[2]); - spin_lock_irqsave(&chip->io_lock, flags); - rt8547_start_xfer(pdata); - rt8547_send_byte(pdata, xfer_data[0]); - rt8547_send_special_byte(pdata, xfer_data[1]); - rt8547_send_byte(pdata, xfer_data[2]); - rt8547_stop_xfer(pdata); - spin_unlock_irqrestore(&chip->io_lock, flags); - /*write back to reg array*/ - rt8547_reg_initval[reg - 1] = data; - return 0; -} - -#ifdef CONFIG_DEBUG_FS -static int reg_debug_open(struct inode *inode, struct file *file) -{ - file->private_data = inode->i_private; - return 0; -} - -static int get_parameters(char *buf, long int *param1, int num_of_par) -{ - char *token; - int base, cnt; - - token = strsep(&buf, " "); - - for (cnt = 0; cnt < num_of_par; cnt++) { - if (token != NULL) { - if ((token[1] == 'x') || (token[1] == 'X')) - base = 16; - else - base = 10; - - if (kstrtoul(token, base, ¶m1[cnt]) != 0) - return -EINVAL; - - token = strsep(&buf, " "); - } else - return -EINVAL; - } - return 0; -} - -static ssize_t reg_debug_read(struct file *filp, char __user *ubuf, - size_t count, loff_t *ppos) -{ - struct rt_debug_st *st = filp->private_data; - struct rt8547_chip *di = st->info; - char lbuf[1000]; - int i = 0, j = 0; - - lbuf[0] = '\0'; - switch (st->id) { - case RT8547_DBG_REG: - snprintf(lbuf, sizeof(lbuf), "0x%x\n", di->reg_addr); - break; - case RT8547_DBG_DATA: - di->reg_data = rt8547_reg_initval[di->reg_addr - 1]; - snprintf(lbuf, sizeof(lbuf), "0x%x\n", di->reg_data); - break; - case RT8547_DBG_REGS: - for (i = RT8547_FLED_REG0; i < RT8547_FLED_REGMAX; i++) - j += snprintf(lbuf + j, 20, "0x%02x:%02x\n", i, - rt8547_reg_initval[i - 1]); - break; - case RT8547_DBG_FLED: - snprintf(lbuf, sizeof(lbuf), "%d\n", di->in_use_mode); - break; - default: - return -EINVAL; - - } - return simple_read_from_buffer(ubuf, count, ppos, lbuf, strlen(lbuf)); -} - -static ssize_t reg_debug_write(struct file *filp, - const char __user *ubuf, size_t cnt, - loff_t *ppos) -{ - struct rt_debug_st *st = filp->private_data; - struct rt8547_chip *di = st->info; - char lbuf[32]; - int rc; - long int param[5]; - - if (cnt > sizeof(lbuf) - 1) - return -EINVAL; - - rc = copy_from_user(lbuf, ubuf, cnt); - if (rc) - return -EFAULT; - - lbuf[cnt] = '\0'; - - switch (st->id) { - case RT8547_DBG_REG: - rc = get_parameters(lbuf, param, 1); - if ((param[0] < RT8547_FLED_REGMAX) && (rc == 0)) { - if ((param[0] >= RT8547_FLED_REG0 - && param[0] <= RT8547_FLED_REG3)) - di->reg_addr = (unsigned char)param[0]; - else - rc = -EINVAL; - } else - rc = -EINVAL; - break; - case RT8547_DBG_DATA: - rc = get_parameters(lbuf, param, 1); - if ((param[0] <= 0xff) && (rc == 0)) { - rt8547_send_data(di, di->reg_addr, - (unsigned char)param[0]); - } else - rc = -EINVAL; - break; - case RT8547_DBG_FLED: - if (!di->fled_dev) - di->fled_dev = find_flashlight_by_name("rt-flash-led"); - rc = get_parameters(lbuf, param, 1); - if ((param[0] <= FLASHLIGHT_MODE_FLASH) && (rc == 0) - && di->fled_dev) { - switch (param[0]) { - case FLASHLIGHT_MODE_TORCH: - flashlight_set_torch_brightness(di->fled_dev, - 2); - flashlight_set_mode(di->fled_dev, - FLASHLIGHT_MODE_TORCH); - break; - case FLASHLIGHT_MODE_FLASH: - flashlight_set_strobe_timeout(di->fled_dev, - 256, 256); - flashlight_set_strobe_brightness(di->fled_dev, - 18); - flashlight_set_mode(di->fled_dev, - FLASHLIGHT_MODE_FLASH); - flashlight_strobe(di->fled_dev); - break; - case FLASHLIGHT_MODE_OFF: - flashlight_set_mode(di->fled_dev, - FLASHLIGHT_MODE_OFF); - break; - } - } else - rc = -EINVAL; - break; - default: - return -EINVAL; - } - if (rc == 0) - rc = cnt; - return rc; -} - -static const struct file_operations reg_debug_ops = { - .open = reg_debug_open, - .write = reg_debug_write, - .read = reg_debug_read -}; - -static void rt8547_create_debugfs(struct rt8547_chip *chip) -{ - RT_DBG("add debugfs for RT8547\n"); - debugfs_rt_dent = debugfs_create_dir("rt8547_dbg", 0); - if (!IS_ERR(debugfs_rt_dent)) { - rtdbg_data[0].info = chip; - rtdbg_data[0].id = RT8547_DBG_REG; - debugfs_file[0] = debugfs_create_file("reg", - S_IFREG | S_IRUGO, - debugfs_rt_dent, - (void *)&rtdbg_data[0], - ®_debug_ops); - - rtdbg_data[1].info = chip; - rtdbg_data[1].id = RT8547_DBG_DATA; - debugfs_file[1] = debugfs_create_file("data", - S_IFREG | S_IRUGO, - debugfs_rt_dent, - (void *)&rtdbg_data[1], - ®_debug_ops); - - rtdbg_data[2].info = chip; - rtdbg_data[2].id = RT8547_DBG_REGS; - debugfs_file[2] = debugfs_create_file("regs", - S_IFREG | S_IRUGO, - debugfs_rt_dent, - (void *)&rtdbg_data[2], - ®_debug_ops); - - rtdbg_data[3].info = chip; - rtdbg_data[3].id = RT8547_DBG_FLED; - debugfs_file[3] = debugfs_create_file("fled", - S_IFREG | S_IRUGO, - debugfs_rt_dent, - (void *)&rtdbg_data[3], - ®_debug_ops); - } else { - dev_err(chip->dev, "create debugfs failed\n"); - } -} - -static void rt8547_remove_debugfs(void) -{ - if (!IS_ERR(debugfs_rt_dent)) - debugfs_remove_recursive(debugfs_rt_dent); -} -#endif /* #ifdef CONFIG_DEBUG_FS */ - -static inline void rt8547_fled_power_on(struct rt8547_platform_data *pdata) -{ - if (gpio_is_valid(pdata->flset_gpio)) - gpio_set_value(pdata->flset_gpio, ((pdata->flset_active) & 0x1)); -} - -static inline void rt8547_fled_power_off(struct rt8547_platform_data *pdata) -{ - if (gpio_is_valid(pdata->flset_gpio)) - gpio_set_value(pdata->flset_gpio, (~(pdata->flset_active) & 0x1)); - udelay(RT8547_STOP_DELAY); -} - -static inline void rt8547_fled_ctrl_en(struct rt8547_platform_data *pdata, - int en) -{ - if (gpio_is_valid(pdata->ctl_gpio)){ - if (en) - gpio_set_value(pdata->ctl_gpio, ((pdata->ctl_active) & 0x1)); - else - gpio_set_value(pdata->ctl_gpio, (~(pdata->ctl_active) & 0x1)); - } - RT_DBG("en %d\n", en); -} - -static inline void rt8547_fled_flash_en(struct rt8547_platform_data *pdata, - int en) -{ - if (gpio_is_valid(pdata->flen_gpio)){ - if (en) - gpio_set_value(pdata->flen_gpio, ((pdata->flen_active) & 0x1)); - else - gpio_set_value(pdata->flen_gpio, (~(pdata->flen_active) & 0x1)); - } - RT_DBG("en %d\n", en); -} - -static int rt8547_fled_init(struct rt_fled_info *info) -{ - RT_DBG("\n"); - return 0; -} - -static int rt8547_fled_resume(struct rt_fled_info *info) -{ - struct rt8547_chip *fi = (struct rt8547_chip *)info; - - RT_DBG("\n"); - fi->suspend = 0; - return 0; -} - -static int rt8547_fled_suspend(struct rt_fled_info *info, pm_message_t state) -{ - struct rt8547_chip *fi = (struct rt8547_chip *)info; - - RT_DBG("\n"); - fi->suspend = 1; - return 0; -} - -static int rt8547_fled_set_mode(struct rt_fled_info *info, - flashlight_mode_t mode) -{ - struct rt8547_chip *fi = (struct rt8547_chip *)info; - unsigned char tmp = 0; - int ret = 0; - - RT_DBG("mode=%d\n", mode); - switch (mode) { - case FLASHLIGHT_MODE_TORCH: - if (fi->in_use_mode == FLASHLIGHT_MODE_OFF) - rt8547_fled_power_on(fi->pdata); - tmp = rt8547_reg_initval[RT8547_FLED_REG2 - 1]; - tmp |= RT8547_MODESEL_MASK; - rt8547_send_data(fi, RT8547_FLED_REG2, tmp); - rt8547_fled_ctrl_en(fi->pdata, 1); - rt8547_fled_flash_en(fi->pdata, 1); - fi->in_use_mode = mode; - break; - case FLASHLIGHT_MODE_FLASH: - if (fi->in_use_mode == FLASHLIGHT_MODE_OFF) - rt8547_fled_power_on(fi->pdata); - tmp = rt8547_reg_initval[RT8547_FLED_REG2 - 1]; - tmp &= ~RT8547_MODESEL_MASK; - rt8547_send_data(fi, RT8547_FLED_REG2, tmp); - fi->in_use_mode = mode; - break; - case FLASHLIGHT_MODE_OFF: - rt8547_fled_flash_en(fi->pdata, 0); - rt8547_fled_ctrl_en(fi->pdata, 0); - if (fi->in_use_mode != FLASHLIGHT_MODE_OFF) - rt8547_fled_power_off(fi->pdata); - fi->in_use_mode = mode; - break; - case FLASHLIGHT_MODE_MIXED: - default: - ret = -EINVAL; - } - return 0; -} - -static int rt8547_fled_get_mode(struct rt_fled_info *info) -{ - struct rt8547_chip *fi = (struct rt8547_chip *)info; - - RT_DBG("\n"); - return fi->in_use_mode; -} - -static int rt8547_fled_strobe(struct rt_fled_info *info) -{ - struct rt8547_chip *fi = (struct rt8547_chip *)info; - - RT_DBG("\n"); - rt8547_fled_flash_en(fi->pdata, 0); - rt8547_fled_ctrl_en(fi->pdata, 0); - rt8547_fled_ctrl_en(fi->pdata, 1); - rt8547_fled_flash_en(fi->pdata, 1); - return 0; -} - -static int rt8547_fled_torch_current_list(struct rt_fled_info *info, - int selector) -{ - RT_DBG("selector=%d\n", selector); - return 25000 + selector * 25000; /* unit: uA */ -} - -static int rt8547_fled_strobe_current_list(struct rt_fled_info *info, - int selector) -{ - RT_DBG("selector=%d\n", selector); - return 100000 + selector * 50000; /* unit: uA */ -} - -static int rt8547_fled_timeout_level_list(struct rt_fled_info *info, - int selector) -{ - RT_DBG("selector=%d\n", selector); - return 100000 + selector * 50000; /* unit: uA */ -} - -static int rt8547_fled_lv_protection_list(struct rt_fled_info *info, - int selector) -{ - RT_DBG("selector=%d\n", selector); - return 3000 + selector * 100; /* unit: mV */ -} - -static int rt8547_fled_strobe_timeout_list(struct rt_fled_info *info, - int selector) -{ - RT_DBG("selector=%d\n", selector); - return 64 + selector * 32; /* unit: mS */ -} - -static int rt8547_fled_set_torch_current_sel(struct rt_fled_info *info, - int selector) -{ - - struct rt8547_chip *fi = (struct rt8547_chip *)info; - unsigned char tmp = 0; - - RT_DBG("selector=%d\n", selector); - tmp = rt8547_reg_initval[RT8547_FLED_REG2 - 1]; - tmp &= ~RT8547_TCLEVEL_MASK; - tmp |= selector; - rt8547_send_data(fi, RT8547_FLED_REG2, tmp); - return 0; -} - -static int rt8547_fled_set_strobe_current_sel(struct rt_fled_info *info, - int selector) -{ - struct rt8547_chip *fi = (struct rt8547_chip *)info; - unsigned char tmp = 0; - - RT_DBG("selector=%d\n", selector); - tmp = rt8547_reg_initval[RT8547_FLED_REG1 - 1]; - tmp &= ~RT8547_SCLEVEL_MASK; - tmp |= selector; - rt8547_send_data(fi, RT8547_FLED_REG1, tmp); - return 0; -} - -static int rt8547_fled_set_timeout_level_sel(struct rt_fled_info *info, - int selector) -{ - struct rt8547_chip *fi = (struct rt8547_chip *)info; - unsigned char tmp = 0; - - RT_DBG("selector=%d\n", selector); - if (selector > RT8547_TOL_MAX) - return -EINVAL; - tmp = rt8547_reg_initval[RT8547_FLED_REG1 - 1]; - tmp &= ~RT8547_TOCLEVEL_MASK; - tmp |= (selector << RT8547_TOCLEVEL_SHFT); - rt8547_send_data(fi, RT8547_FLED_REG1, tmp); - return 0; -} - -static int rt8547_fled_set_lv_protection_sel(struct rt_fled_info *info, - int selector) -{ - struct rt8547_chip *fi = (struct rt8547_chip *)info; - unsigned char tmp = 0; - - RT_DBG("selector=%d\n", selector); - if (selector > RT8547_LVP_MAX) - return -EINVAL; - tmp = rt8547_reg_initval[RT8547_FLED_REG0 - 1]; - tmp &= ~RT8547_LVP_MASK; - tmp |= selector; - rt8547_send_data(fi, RT8547_FLED_REG0, tmp); - return 0; -} - -static int rt8547_fled_set_strobe_timeout_sel(struct rt_fled_info *info, - int selector) -{ - struct rt8547_chip *fi = (struct rt8547_chip *)info; - unsigned char tmp = 0; - - RT_DBG("selector=%d\n", selector); - if (selector > RT8547_STO_MAX) - return -EINVAL; - tmp = rt8547_reg_initval[RT8547_FLED_REG3 - 1]; - tmp &= ~RT8547_STO_MASK; - tmp |= selector; - rt8547_send_data(fi, RT8547_FLED_REG3, tmp); - return 0; -} - -static int rt8547_fled_get_torch_current_sel(struct rt_fled_info *info) -{ - int selector = - rt8547_reg_initval[RT8547_FLED_REG2 - 1] & RT8547_TCLEVEL_MASK; - - return selector; -} - -static int rt8547_fled_get_strobe_current_sel(struct rt_fled_info *info) -{ - int selector = - rt8547_reg_initval[RT8547_FLED_REG1 - 1] & RT8547_SCLEVEL_MASK; - - return selector; -} - -static int rt8547_fled_get_timeout_level_sel(struct rt_fled_info *info) -{ - int selector = - rt8547_reg_initval[RT8547_FLED_REG1 - 1] & RT8547_TOCLEVEL_MASK; - - selector >>= RT8547_TOCLEVEL_SHFT; - return selector; -} - -static int rt8547_fled_get_lv_protection_sel(struct rt_fled_info *info) -{ - int selector = - rt8547_reg_initval[RT8547_FLED_REG0 - 1] & RT8547_LVP_MASK; - - return selector; -} - -static int rt8547_fled_get_strobe_timeout_sel(struct rt_fled_info *info) -{ - int selector = - rt8547_reg_initval[RT8547_FLED_REG3 - 1] & RT8547_STO_MASK; - - return selector; -} - -static struct rt_fled_hal rt8547_fled_hal = { - .fled_init = rt8547_fled_init, - .fled_suspend = rt8547_fled_suspend, - .fled_resume = rt8547_fled_resume, - .fled_set_mode = rt8547_fled_set_mode, - .fled_get_mode = rt8547_fled_get_mode, - .fled_strobe = rt8547_fled_strobe, - .fled_torch_current_list = rt8547_fled_torch_current_list, - .fled_strobe_current_list = rt8547_fled_strobe_current_list, - .fled_timeout_level_list = rt8547_fled_timeout_level_list, - .fled_lv_protection_list = rt8547_fled_lv_protection_list, - .fled_strobe_timeout_list = rt8547_fled_strobe_timeout_list, - /* method to set */ - .fled_set_torch_current_sel = rt8547_fled_set_torch_current_sel, - .fled_set_strobe_current_sel = rt8547_fled_set_strobe_current_sel, - .fled_set_timeout_level_sel = rt8547_fled_set_timeout_level_sel, - .fled_set_lv_protection_sel = rt8547_fled_set_lv_protection_sel, - .fled_set_strobe_timeout_sel = rt8547_fled_set_strobe_timeout_sel, - /* method to get */ - .fled_get_torch_current_sel = rt8547_fled_get_torch_current_sel, - .fled_get_strobe_current_sel = rt8547_fled_get_strobe_current_sel, - .fled_get_timeout_level_sel = rt8547_fled_get_timeout_level_sel, - .fled_get_lv_protection_sel = rt8547_fled_get_lv_protection_sel, - .fled_get_strobe_timeout_sel = rt8547_fled_get_strobe_timeout_sel, -}; - -static struct flashlight_properties rt8547_fled_props = { - .type = FLASHLIGHT_TYPE_LED, - .torch_brightness = 2, - .torch_max_brightness = 15, - .strobe_brightness = 18, - .strobe_max_brightness = 30, - .strobe_delay = 2, - .strobe_timeout = 544, - .alias_name = "rt8547-fled", -}; - -static void rt8547_parse_dt(struct rt8547_platform_data *pdata, - struct device *dev) -{ -#ifdef CONFIG_OF - struct device_node *np = dev->of_node; - u32 tmp; - - if (of_property_read_u32(np, "rt,def_lvp", &tmp) < 0) { - dev_warn(dev, "use 3V as the default lvp\n"); - } else { - if (tmp > RT8547_LVP_MAX) - tmp = RT8547_LVP_MAX; - rt8547_reg_initval[RT8547_FLED_REG0 - 1] &= ~RT8547_LVP_MASK; - rt8547_reg_initval[RT8547_FLED_REG0 - 1] |= tmp; - } - - if (of_property_read_u32(np, "rt,def_tol", &tmp) < 0) { - dev_warn(dev, "use 100mA as the default timeout level\n"); - } else { - if (tmp > RT8547_TOL_MAX) - tmp = RT8547_TOL_MAX; - tmp <<= RT8547_TOCLEVEL_SHFT; - rt8547_reg_initval[RT8547_FLED_REG1 - 1] &= - ~RT8547_TOCLEVEL_MASK; - rt8547_reg_initval[RT8547_FLED_REG1 - 1] |= tmp; - } - pdata->flen_gpio = of_get_named_gpio(np, "rt,flen_gpio", 0); - pdata->ctl_gpio = of_get_named_gpio(np, "rt,ctl_gpio", 0); - pdata->flset_gpio = of_get_named_gpio(np, "rt,flset_gpio", 0); -#endif /* #ifdef CONFIG_OF */ -} - -static void rt8547_parse_pdata(struct rt8547_platform_data *pdata, - struct device *dev) -{ - u32 tmp; - - tmp = pdata->def_lvp; - rt8547_reg_initval[RT8547_FLED_REG0 - 1] &= ~RT8547_LVP_MASK; - rt8547_reg_initval[RT8547_FLED_REG0 - 1] |= tmp; - - tmp = pdata->def_tol; - tmp <<= RT8547_TOCLEVEL_SHFT; - rt8547_reg_initval[RT8547_FLED_REG1 - 1] &= ~RT8547_TOCLEVEL_MASK; - rt8547_reg_initval[RT8547_FLED_REG1 - 1] |= tmp; -} - -static int rt8547_io_init(struct rt8547_platform_data *pdata, - struct device *dev) -{ - int rc = 0; - - if (gpio_is_valid(pdata->flen_gpio)) { - rc = gpio_request_one(pdata->flen_gpio, ((~(pdata->flen_active) & 0x1) ? GPIOF_OUT_INIT_HIGH:GPIOF_OUT_INIT_LOW), - "rt8547_flen"); - if (rc < 0) { - dev_err(dev, "request rt8547 flash en pin fail\n"); - goto gpio_request1; - } - - } - - if(gpio_is_valid(pdata->ctl_gpio)){ - rc = gpio_request_one(pdata->ctl_gpio, ((~(pdata->ctl_active) & 0x1) ? GPIOF_OUT_INIT_HIGH:GPIOF_OUT_INIT_LOW), - "rt8547_ctl"); - if (rc < 0) { - dev_err(dev, "request rt8547 ctl pin fail\n"); - goto gpio_request2; - } - } - - if(gpio_is_valid(pdata->flset_gpio)){ - rc = gpio_request_one(pdata->flset_gpio, ((~(pdata->flset_active) & 0x1) ? GPIOF_OUT_INIT_HIGH:GPIOF_OUT_INIT_LOW), - "rt8547_flset"); - if (rc < 0) { - dev_err(dev, "request rt8547 flash set pin fail\n"); - /*GPIO(gpio7 GPIO_B5) is EBUSY when register after factory data reset, but after power on ,it's normal*/ - /*goto gpio_request3;*/ - } - } - return 0; -/* -gpio_request3: - if(gpio_is_valid(pdata->ctl_gpio)) - gpio_free(pdata->ctl_gpio); -*/ -gpio_request2: - if (gpio_is_valid(pdata->flen_gpio)) - gpio_free(pdata->flen_gpio); -gpio_request1: - return rc; - -} - -static int rt8547_io_deinit(struct rt8547_platform_data *pdata) -{ - if (gpio_is_valid(pdata->flen_gpio)){ - gpio_direction_input(pdata->flen_gpio); - gpio_free(pdata->flen_gpio); - } - if(gpio_is_valid(pdata->ctl_gpio)){ - gpio_direction_input(pdata->ctl_gpio); - gpio_free(pdata->ctl_gpio); - } - if(gpio_is_valid(pdata->flset_gpio)){ - gpio_direction_input(pdata->flset_gpio); - gpio_free(pdata->flset_gpio); - } - return 0; -} - -static void rt8547_reg_init(struct rt8547_chip *chip) -{ - RT_DBG("\n"); - rt8547_send_data(chip, RT8547_FLED_REG0, - rt8547_reg_initval[RT8547_FLED_REG0 - 1]); - rt8547_send_data(chip, RT8547_FLED_REG1, - rt8547_reg_initval[RT8547_FLED_REG1 - 1]); - rt8547_send_data(chip, RT8547_FLED_REG2, - rt8547_reg_initval[RT8547_FLED_REG2 - 1]); - rt8547_send_data(chip, RT8547_FLED_REG3, - rt8547_reg_initval[RT8547_FLED_REG3 - 1]); -} - -static void rt8547_release(struct device *dev) -{ -} - -static int rt8547_led_probe(struct platform_device *pdev) -{ - struct rt8547_platform_data *pdata = pdev->dev.platform_data; - struct rt8547_chip *chip; - bool use_dt = pdev->dev.of_node; - int ret = 0; - - chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL); - if (!chip) - return -ENOMEM; - if (use_dt) { - pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); - if (!pdata) - goto err_probe; - rt8547_parse_dt(pdata, &pdev->dev); - } else { - if (!pdata) - goto err_probe; - rt8547_parse_pdata(pdata, &pdev->dev); - } - - ret = rt8547_io_init(pdata, &pdev->dev); - if (ret < 0) - goto err_io; - - chip->dev = &pdev->dev; - chip->pdata = pdata; - spin_lock_init(&chip->io_lock); - chip->in_use_mode = FLASHLIGHT_MODE_OFF; - platform_set_drvdata(pdev, chip); - - rt8547_fled_power_on(pdata); - rt8547_reg_init(chip); - rt8547_fled_power_off(pdata); - - chip->base.hal = &rt8547_fled_hal; - chip->base.init_props = &rt8547_fled_props; - chip->rt_fled_pdev.dev.parent = &pdev->dev; - chip->rt_fled_pdev.dev.release = rt8547_release; - chip->rt_fled_pdev.name = "rt-flash-led"; - chip->rt_fled_pdev.id = -1; - ret = platform_device_register(&chip->rt_fled_pdev); - if (ret < 0) { - dev_err(&pdev->dev, "register rtfled fail\n"); - goto err_io; - } -#ifdef CONFIG_DEBUG_FS - rt8547_create_debugfs(chip); -#endif /* #ifdef CONFIG_DEBUG_FS */ - dev_info(&pdev->dev, "driver successfully registered\n"); - return 0; -err_io: - if (use_dt) - devm_kfree(&pdev->dev, pdata); -err_probe: - devm_kfree(&pdev->dev, chip); - return ret; -} - -static int rt8547_led_remove(struct platform_device *pdev) -{ - struct rt8547_chip *chip = platform_get_drvdata(pdev); - -#ifdef CONFIG_DEBUG_FS - rt8547_remove_debugfs(); -#endif /* #ifdef CONFIG_DEBUG_FS */ - platform_device_unregister(&chip->rt_fled_pdev); - rt8547_io_deinit(chip->pdata); - return 0; -} - -static const struct of_device_id rt_match_table[] = { - {.compatible = "rt,rt8547",}, - {}, -}; - -static struct platform_driver rt8547_led_driver = { - .driver = { - .name = "rt8547", - .owner = THIS_MODULE, - .of_match_table = rt_match_table, - }, - .probe = rt8547_led_probe, - .remove = rt8547_led_remove, -}; - -static int rt8547_led_init(void) -{ - return platform_driver_register(&rt8547_led_driver); -} - -module_init(rt8547_led_init); - -static void rt8547_led_exit(void) -{ - platform_driver_unregister(&rt8547_led_driver); -} - -module_exit(rt8547_led_exit); - -MODULE_LICENSE("GPL"); -MODULE_AUTHOR("CY Huang "); -MODULE_DESCRIPTION("LED Flash Driver for RT8547"); -MODULE_VERSION(RT8547_DRV_VER); diff --git a/drivers/media/video/rk_camsys/ext_flashled_drv/leds-rt8547.h b/drivers/media/video/rk_camsys/ext_flashled_drv/leds-rt8547.h deleted file mode 100755 index a1a7a8e75498..000000000000 --- a/drivers/media/video/rk_camsys/ext_flashled_drv/leds-rt8547.h +++ /dev/null @@ -1,84 +0,0 @@ -/* include/linux/leds-rt8547.h - * Include file of driver to Richtek RT8547 LED Flash IC - * - * Copyright (C) 2014 Richtek Technology Corporation - * Author: CY_Huang - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#ifndef __LINUX_LEDS_RT8547_H -#define __LINUX_LEDS_RT8547_H - -#define RT8547_DRV_VER "1.0.2_G" - -enum { - RT8547_FLED_REG0 = 0x01, - RT8547_FLED_REG1, - RT8547_FLED_REG2, - RT8547_FLED_REG3, - RT8547_FLED_REGMAX, -}; - -enum { - RT8547_LVP_3V, - RT8547_LVP_3P1V, - RT8547_LVP_3P2V, - RT8547_LVP_3P3V, - RT8547_LVP_3P4V, - RT8547_LVP_3P5V, - RT8547_LVP_3P6V, - RT8547_LVP_3P7V, - RT8547_LVP_3P8V, - RT8547_LVP_MAX = RT8547_LVP_3P8V, -}; - -enum { - RT8547_TOL_100mA, - RT8547_TOL_150mA, - RT8547_TOL_200mA, - RT8547_TOL_250mA, - RT8547_TOL_300mA, - RT8547_TOL_350mA, - RT8547_TOL_400mA, - RT8547_TOL_MAX = RT8547_TOL_400mA, -}; - -#define RT8547_STO_MAX 36 - -#define RT8547_LVP_MASK 0x0F -#define RT8547_TOCLEVEL_MASK 0xE0 -#define RT8547_TOCLEVEL_SHFT 5 -#define RT8547_SCLEVEL_MASK 0x1F -#define RT8547_SWRST_MASK 0x20 -#define RT8547_MODESEL_MASK 0x10 -#define RT8547_TCLEVEL_MASK 0x0F -#define RT8547_STO_MASK 0x3F - -struct rt8547_platform_data { - int flen_gpio; - int flen_active; - int ctl_gpio; - int ctl_active; - int flset_gpio; - int flset_active; - unsigned char def_lvp:4; - unsigned char def_tol:3; -}; - -/* one wire protocol parameter */ -#define RT8547_ONEWIRE_ADDR 0x99 -#define RT8547_LONG_DELAY 9 -#define RT8547_SHORT_DELAY 4 -#define RT8547_START_DELAY 10 -#define RT8547_STOP_DELAY 1500 - -#ifdef CONFIG_LEDS_RT8547_DBG -#define RT_DBG(fmt, args...) pr_info("%s: " fmt, __func__, ##args) -#else -#define RT_DBG(fmt, args...) -#endif /* #ifdef CONFIG_LEDS_RT8547_DBG */ - -#endif /* #ifndef __LINUX_LEDS_RT8547_H */ diff --git a/drivers/media/video/rk_camsys/ext_flashled_drv/rk_ext_fshled_ctl.c b/drivers/media/video/rk_camsys/ext_flashled_drv/rk_ext_fshled_ctl.c deleted file mode 100644 index 120a183fd5d1..000000000000 --- a/drivers/media/video/rk_camsys/ext_flashled_drv/rk_ext_fshled_ctl.c +++ /dev/null @@ -1,180 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#include "rk_ext_fshled_ctl.h" -#include "../camsys_gpio.h" -#include "flashlight.h" -#include "leds-rt8547.h" - -typedef struct ext_fsh_info_s{ - struct platform_device pdev; - char* dev_model; - struct list_head list; -}ext_fsh_info_t; - -struct ext_fsh_dev_list_s{ - struct list_head dev_list; -}; - -static struct ext_fsh_dev_list_s g_ext_fsh_devs; - -int camsys_init_ext_fsh_module(void) -{ - camsys_trace(1,"init external flash module"); - INIT_LIST_HEAD(&g_ext_fsh_devs.dev_list); - return 0; -} - -int camsys_deinit_ext_fsh_module(void) -{ - ext_fsh_info_t* cur_fsh_info = NULL; - camsys_trace(1,"deinit external flash module"); - if (!list_empty(&g_ext_fsh_devs.dev_list)) { - list_for_each_entry(cur_fsh_info, &g_ext_fsh_devs.dev_list, list) { - if (cur_fsh_info) { - platform_device_unregister(&cur_fsh_info->pdev); - list_del_init(&cur_fsh_info->list); - /* free after unregister device ?*/ - kfree(cur_fsh_info->pdev.dev.platform_data); - kfree(cur_fsh_info); - cur_fsh_info = NULL; - } - } - } - - INIT_LIST_HEAD(&g_ext_fsh_devs.dev_list); - return 0; -} - -static void camsys_ext_fsh_release(struct device *dev) -{ -} - -void* camsys_register_ext_fsh_dev(camsys_flash_info_t *fsh_info) -{ - ext_fsh_info_t* new_dev = NULL; - if(strcmp(fsh_info->fl_drv_name,"rt8547") == 0){ - struct rt8547_platform_data* new_rt_dev = NULL; - new_dev = kzalloc(sizeof(ext_fsh_info_t),GFP_KERNEL); - if(!new_dev){ - camsys_err("register new ext flash dev erro !"); - goto fail0; - } - - new_rt_dev = kzalloc(sizeof(*new_rt_dev), GFP_KERNEL); - if(!new_rt_dev){ - camsys_err("register new ext flash dev erro !"); - goto fail1; - } - - new_dev->pdev.id = -1; - new_dev->pdev.name = fsh_info->fl_drv_name; - new_dev->pdev.dev.release = camsys_ext_fsh_release; - new_dev->pdev.dev.platform_data = (void*)new_rt_dev; - new_dev->dev_model = "rt-flash-led"; - - new_rt_dev->flen_gpio = camsys_gpio_get(fsh_info->fl_en.name); - new_rt_dev->flen_active = fsh_info->fl_en.active; - camsys_trace(1,"flen name :%s,gpio %d,active %d \n",fsh_info->fl_en.name,new_rt_dev->flen_gpio,new_rt_dev->flen_active); - new_rt_dev->flset_gpio = camsys_gpio_get(fsh_info->fl.name ); - new_rt_dev->flset_active = fsh_info->fl.active; - camsys_trace(1,"flset name :%s, gpio %d, active %d \n",fsh_info->fl.name,new_rt_dev->flset_gpio,new_rt_dev->flset_active); - new_rt_dev->ctl_gpio = -1; - new_rt_dev->def_lvp = RT8547_LVP_3V; - new_rt_dev->def_tol = RT8547_TOL_100mA; - - // new_rt_dev->def_lvp = RT8547_LVP_MAX; - // new_rt_dev->def_tol = RT8547_TOL_MAX; - - if(platform_device_register(&new_dev->pdev) < 0){ - camsys_err("register rtfled fail\n"); - kfree(new_rt_dev); - goto fail1; - } - - list_add_tail(&new_dev->list, &g_ext_fsh_devs.dev_list); - camsys_trace(1,"register new rt led dev success !"); - } - - return (void*)new_dev; -fail1: - if(new_dev) - kfree(new_dev); -fail0: - return NULL; -} - -int camsys_deregister_ext_fsh_dev(void* dev) -{ - ext_fsh_info_t* cur_fsh_info = NULL; - if (!list_empty(&g_ext_fsh_devs.dev_list)) { - list_for_each_entry(cur_fsh_info, &g_ext_fsh_devs.dev_list, list) { - if (dev == cur_fsh_info) { - camsys_trace(1,"unregister ext flsh dev !"); - platform_device_unregister(&cur_fsh_info->pdev); - list_del_init(&cur_fsh_info->list); - /* free after unregister device ?*/ - kfree(cur_fsh_info->pdev.dev.platform_data); - kfree(cur_fsh_info); - return 0; - } - } - } - return 0; -} - -/******************************* -mode: - 0: CAM_ENGINE_FLASH_OFF = 0x00, - 1: CAM_ENGINE_FLASH_AUTO = 0x01, - 2: CAM_ENGINE_FLASH_ON = 0x02, - 3: CAM_ENGINE_FLASH_RED_EYE = 0x03, - 5: CAM_ENGINE_FLASH_TORCH = 0x05 -********************************/ -int camsys_ext_fsh_ctrl(void* dev,int mode,unsigned int on) -{ - ext_fsh_info_t* cur_fsh_info = NULL; - struct flashlight_device *fled_dev = NULL; - if (!list_empty(&g_ext_fsh_devs.dev_list)) { - list_for_each_entry(cur_fsh_info, &g_ext_fsh_devs.dev_list, list) { - if (dev == cur_fsh_info) { - break; - } - } - } - if(cur_fsh_info == NULL){ - camsys_err("this flash dev have not been registered !"); - return -1; - } - - fled_dev = find_flashlight_by_name(cur_fsh_info->dev_model); - if(fled_dev == NULL){ - camsys_err("--find_flashlight_by_name return NULL!--"); - return -1; - } - switch(mode){ - case 0: /* off */ - /* set flashlight mode to Off */ - flashlight_set_mode(fled_dev, FLASHLIGHT_MODE_OFF); - break; - case 2: /* flash on */ - /* set strobe timeout to 256ms */ - //flashlight_set_strobe_timeout(fled_dev, 256, 256); - flashlight_set_strobe_timeout(fled_dev, 512, 512); - /* set strobe brightness to to index 18 (1A), refer to the datasheet for the others */ - flashlight_set_strobe_brightness(fled_dev, 18); - /* set flashlight mode to Strobe */ - flashlight_set_mode(fled_dev, FLASHLIGHT_MODE_FLASH); - flashlight_strobe(fled_dev); - break; - case 5: /* torch */ - /* set the torch brightness index 2 (75mA), refer to the datasheet for index current value. */ - flashlight_set_torch_brightness(fled_dev, 2); - /* set flashlight mode to Torch */ - flashlight_set_mode(fled_dev, FLASHLIGHT_MODE_TORCH); - break; - default: - camsys_err("not support this mode %d !",mode); - } - - return 0; -} - diff --git a/drivers/media/video/rk_camsys/ext_flashled_drv/rk_ext_fshled_ctl.h b/drivers/media/video/rk_camsys/ext_flashled_drv/rk_ext_fshled_ctl.h deleted file mode 100644 index 4fe98441e358..000000000000 --- a/drivers/media/video/rk_camsys/ext_flashled_drv/rk_ext_fshled_ctl.h +++ /dev/null @@ -1,11 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __RK_EXT_FSHLED_H__ -#define __RK_EXT_FSHLED_H__ -#include "../camsys_internal.h" -//register flash dev -extern int camsys_init_ext_fsh_module(void); -extern int camsys_deinit_ext_fsh_module(void); -extern void* camsys_register_ext_fsh_dev(camsys_flash_info_t *fsh_info); -extern int camsys_deregister_ext_fsh_dev(void* dev); -extern int camsys_ext_fsh_ctrl(void* dev,int mode,unsigned int on); -#endif diff --git a/drivers/media/video/rk_camsys/ext_flashled_drv/rtfled.c b/drivers/media/video/rk_camsys/ext_flashled_drv/rtfled.c deleted file mode 100755 index 841743148595..000000000000 --- a/drivers/media/video/rk_camsys/ext_flashled_drv/rtfled.c +++ /dev/null @@ -1,401 +0,0 @@ -/* drivers/leds/rtfled.c - * Richtek Flash LED Universal Architecture - * - * Copyright (C) 2013 Richtek Technology Corp. - * Author: Patrick Chang - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - */ - -#include -#include -#include -#include "rtfled.h" -#include -#include - -#define RTFLED_INFO(format, args...) \ - pr_info("%s:%s() line-%d: " format, \ - ALIAS_NAME, __func__, __LINE__, ## args) -#define RTFLED_WARN(format, args...) \ - pr_warn("%s:%s() line-%d: " format, \ - ALIAS_NAME, __func__, __LINE__, ## args) -#define RTFLED_ERR(format, args...) \ - pr_err("%s:%s() line-%d: " format, \ - ALIAS_NAME, __func__, __LINE__, ## args) - -#define RT_FLED_DEVICE "rt-flash-led" -#define ALIAS_NAME RT_FLED_DEVICE - -rt_fled_info_t *rt_fled_get_info_by_name(char *name) -{ - struct flashlight_device *flashlight_dev; - - flashlight_dev = find_flashlight_by_name(name ? name : RT_FLED_DEVICE); - if (flashlight_dev == NULL) - return (rt_fled_info_t *) NULL; - return flashlight_get_data(flashlight_dev); -} -EXPORT_SYMBOL(rt_fled_get_info_by_name); - -static int rtfled_set_torch_brightness(struct flashlight_device *flashlight_dev, - int brightness_sel) -{ - rt_fled_info_t *info = flashlight_get_data(flashlight_dev); - - return info->hal->fled_set_torch_current_sel(info, brightness_sel); -} - -static int rtfled_set_strobe_brightness(struct flashlight_device - *flashlight_dev, int brightness_sel) -{ - rt_fled_info_t *info = flashlight_get_data(flashlight_dev); - - return info->hal->fled_set_strobe_current_sel(info, brightness_sel); -} - -static int rtfled_set_strobe_timeout(struct flashlight_device *flashlight_dev, - int timeout) -{ - rt_fled_info_t *info = flashlight_get_data(flashlight_dev); - - int sel; - - return info->hal->fled_set_strobe_timeout(info, timeout, timeout, &sel); -} - -static int rtfled_list_strobe_timeout(struct flashlight_device *flashlight_dev, - int selector) -{ - rt_fled_info_t *info = flashlight_get_data(flashlight_dev); - - return info->hal->fled_strobe_timeout_list(info, selector); -} - -static int rtfled_set_mode(struct flashlight_device *flashlight_dev, int mode) -{ - rt_fled_info_t *info = flashlight_get_data(flashlight_dev); - - return info->hal->fled_set_mode(info, mode); -} - -static int rtfled_strobe(struct flashlight_device *flashlight_dev) -{ - rt_fled_info_t *info = flashlight_get_data(flashlight_dev); - - return info->hal->fled_strobe(info); -} - -static int rtfled_set_color_temperature(struct flashlight_device - *flashlight_dev, int color_temp) -{ - /* Doesn't support color temperature */ - return -EINVAL; -} - -static int rtfled_list_color_temperature(struct flashlight_device - *flashlight_dev, int selector) -{ - /* Doesn't support color temperature */ - return -EINVAL; -} - -static int rtfled_suspend(struct flashlight_device *flashlight_dev, - pm_message_t state) -{ - rt_fled_info_t *info = flashlight_get_data(flashlight_dev); - - if (info->hal->fled_suspend) - return info->hal->fled_suspend(info, state); - return 0; -} - -static int rtfled_resume(struct flashlight_device *flashlight_dev) -{ - rt_fled_info_t *info = flashlight_get_data(flashlight_dev); - - if (info->hal->fled_resume) - return info->hal->fled_resume(info); - return 0; -} - -static struct flashlight_ops rtfled_impl_ops = { - .set_torch_brightness = rtfled_set_torch_brightness, - .set_strobe_brightness = rtfled_set_strobe_brightness, - .set_strobe_timeout = rtfled_set_strobe_timeout, - .list_strobe_timeout = rtfled_list_strobe_timeout, - .set_mode = rtfled_set_mode, - .strobe = rtfled_strobe, - .set_color_temperature = rtfled_set_color_temperature, - .list_color_temperature = rtfled_list_color_temperature, - .suspend = rtfled_suspend, - .resume = rtfled_resume, -}; - -static void rfled_shutdown(struct platform_device *pdev) -{ - struct rt_fled_info *info = platform_get_drvdata(pdev); - - if (info->hal->fled_shutdown) - info->hal->fled_shutdown(info); -} - -static int rtled_impl_set_torch_current(struct rt_fled_info *info, - int min_uA, int max_uA, int *selector) -{ - int sel = 0; - int rc; - - for (sel = 0;; sel++) { - rc = info->hal->fled_torch_current_list(info, sel); - if (rc < 0) - return rc; - if (rc >= min_uA && rc <= max_uA) { - *selector = sel; - return info->hal->fled_set_torch_current_sel(info, sel); - } - } - return -EINVAL; -} - -static int rtled_impl_set_strobe_current(struct rt_fled_info *info, - int min_uA, int max_uA, int *selector) -{ - int sel = 0; - int rc; - - for (sel = 0;; sel++) { - rc = info->hal->fled_strobe_current_list(info, sel); - if (rc < 0) - return rc; - if (rc >= min_uA && rc <= max_uA) { - *selector = sel; - return info->hal->fled_set_strobe_current_sel(info, - sel); - } - } - return -EINVAL; -} - -static int rtled_impl_set_timeout_level(struct rt_fled_info *info, - int min_uA, int max_uA, int *selector) -{ - int sel = 0; - int rc; - - for (sel = 0;; sel++) { - rc = info->hal->fled_timeout_level_list(info, sel); - if (rc < 0) - return rc; - if (rc >= min_uA && rc <= max_uA) { - *selector = sel; - return info->hal->fled_set_timeout_level_sel(info, sel); - } - } - return -EINVAL; -} - -static int rtled_impl_set_lv_protection(struct rt_fled_info *info, - int min_mV, int max_mV, int *selector) -{ - int sel = 0; - int rc; - - for (sel = 0;; sel++) { - rc = info->hal->fled_lv_protection_list(info, sel); - if (rc < 0) - return rc; - if (rc >= min_mV && rc <= max_mV) { - *selector = sel; - return info->hal->fled_set_lv_protection_sel(info, sel); - } - } - return -EINVAL; -} - -static int rtled_impl_set_strobe_timeout(struct rt_fled_info *info, - int min_ms, int max_ms, int *selector) -{ - int sel = 0; - int rc; - - for (sel = 0;; sel++) { - rc = info->hal->fled_strobe_timeout_list(info, sel); - if (rc < 0) - return rc; - if (rc >= min_ms && rc <= max_ms) { - *selector = sel; - return info->hal->fled_set_strobe_timeout_sel(info, - sel); - } - } - return -EINVAL; -} - -static int rtled_impl_get_torch_current(struct rt_fled_info *info) -{ - int sel = info->hal->fled_get_torch_current_sel(info); - - if (sel < 0) - return sel; - return info->hal->fled_torch_current_list(info, sel); -} - -static int rtled_impl_get_strobe_current(struct rt_fled_info *info) -{ - int sel = info->hal->fled_get_strobe_current_sel(info); - - if (sel < 0) - return sel; - return info->hal->fled_strobe_current_list(info, sel); -} - -static int rtled_impl_get_timeout_level(struct rt_fled_info *info) -{ - int sel = info->hal->fled_get_timeout_level_sel(info); - - if (sel < 0) - return sel; - return info->hal->fled_timeout_level_list(info, sel); -} - -static int rtled_impl_get_lv_protection(struct rt_fled_info *info) -{ - int sel = info->hal->fled_get_lv_protection_sel(info); - - if (sel < 0) - return sel; - return info->hal->fled_lv_protection_list(info, sel); -} - -static int rtled_impl_get_strobe_timeout(struct rt_fled_info *info) -{ - int sel = info->hal->fled_get_strobe_timeout_sel(info); - - if (sel < 0) - return sel; - return info->hal->fled_strobe_timeout_list(info, sel); -} - -#define HAL_NOT_IMPLEMENTED(x) (hal->x == NULL) -#define CHECK_HAL_IMPLEMENTED(x) \ - do { \ - if (hal->x == NULL) \ - return -EINVAL; \ - } while (0) - -static int rtfled_check_hal_implement(struct rt_fled_hal *hal) -{ - if (HAL_NOT_IMPLEMENTED(fled_set_torch_current)) - hal->fled_set_torch_current = rtled_impl_set_torch_current; - if (HAL_NOT_IMPLEMENTED(fled_set_strobe_current)) - hal->fled_set_strobe_current = rtled_impl_set_strobe_current; - if (HAL_NOT_IMPLEMENTED(fled_set_timeout_level)) - hal->fled_set_timeout_level = rtled_impl_set_timeout_level; - if (HAL_NOT_IMPLEMENTED(fled_set_lv_protection)) - hal->fled_set_lv_protection = rtled_impl_set_lv_protection; - if (HAL_NOT_IMPLEMENTED(fled_set_strobe_timeout)) - hal->fled_set_strobe_timeout = rtled_impl_set_strobe_timeout; - if (HAL_NOT_IMPLEMENTED(fled_get_torch_current)) - hal->fled_get_torch_current = rtled_impl_get_torch_current; - if (HAL_NOT_IMPLEMENTED(fled_get_strobe_current)) - hal->fled_get_strobe_current = rtled_impl_get_strobe_current; - if (HAL_NOT_IMPLEMENTED(fled_get_timeout_level)) - hal->fled_get_timeout_level = rtled_impl_get_timeout_level; - if (HAL_NOT_IMPLEMENTED(fled_get_lv_protection)) - hal->fled_get_lv_protection = rtled_impl_get_lv_protection; - if (HAL_NOT_IMPLEMENTED(fled_get_strobe_timeout)) - hal->fled_get_strobe_timeout = rtled_impl_get_strobe_timeout; - CHECK_HAL_IMPLEMENTED(fled_set_mode); - CHECK_HAL_IMPLEMENTED(fled_get_mode); - CHECK_HAL_IMPLEMENTED(fled_strobe); - CHECK_HAL_IMPLEMENTED(fled_torch_current_list); - CHECK_HAL_IMPLEMENTED(fled_strobe_current_list); - CHECK_HAL_IMPLEMENTED(fled_timeout_level_list); - CHECK_HAL_IMPLEMENTED(fled_lv_protection_list); - CHECK_HAL_IMPLEMENTED(fled_strobe_timeout_list); - CHECK_HAL_IMPLEMENTED(fled_set_torch_current_sel); - CHECK_HAL_IMPLEMENTED(fled_set_strobe_current_sel); - CHECK_HAL_IMPLEMENTED(fled_set_timeout_level_sel); - CHECK_HAL_IMPLEMENTED(fled_set_lv_protection_sel); - CHECK_HAL_IMPLEMENTED(fled_set_strobe_timeout_sel); - CHECK_HAL_IMPLEMENTED(fled_get_torch_current_sel); - CHECK_HAL_IMPLEMENTED(fled_get_strobe_current_sel); - CHECK_HAL_IMPLEMENTED(fled_get_timeout_level_sel); - CHECK_HAL_IMPLEMENTED(fled_get_lv_protection_sel); - CHECK_HAL_IMPLEMENTED(fled_get_strobe_timeout_sel); - return 0; -} - -static int rtfled_probe(struct platform_device *pdev) -{ - rt_fled_info_t *info = dev_get_drvdata(pdev->dev.parent); - int rc; - - BUG_ON(info == NULL); - BUG_ON(info->hal == NULL); - - RTFLED_INFO("Richtek FlashLED Driver is probing\n"); - rc = rtfled_check_hal_implement(info->hal); - if (rc < 0) { - RTFLED_ERR("HAL implemented uncompletedly\n"); - goto err_check_hal; - } - platform_set_drvdata(pdev, info); - info->flashlight_dev = - flashlight_device_register(info->name ? info->name : RT_FLED_DEVICE, - &pdev->dev, info, &rtfled_impl_ops, - info->init_props); - if (info->hal->fled_init) { - rc = info->hal->fled_init(info); - if (rc < 0) { - RTFLED_ERR("Initialization failed\n"); - goto err_init; - } - } - RTFLED_INFO("Richtek FlashLED Driver initialized successfully\n"); - return 0; -err_init: - flashlight_device_unregister(info->flashlight_dev); -err_check_hal: - return rc; -} - -static int rtfled_remove(struct platform_device *pdev) -{ - rt_fled_info_t *info = platform_get_drvdata(pdev); - - platform_set_drvdata(pdev, NULL); - flashlight_device_unregister(info->flashlight_dev); - return 0; -} - -static struct platform_driver rt_flash_led_driver = { - .driver = { - .name = RT_FLED_DEVICE, - .owner = THIS_MODULE, - }, - .shutdown = rfled_shutdown, - .probe = rtfled_probe, - .remove = rtfled_remove, -}; - -static int rtfled_init(void) -{ - return platform_driver_register(&rt_flash_led_driver); -} -subsys_initcall(rtfled_init); - -static void rtfled_exit(void) -{ - platform_driver_unregister(&rt_flash_led_driver); -} -module_exit(rtfled_exit); - -MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Patrick Chang - * - *This program is free software; you can redistribute it and/or modify - *it under the terms of the GNU General Public License version 2 as - *published by the Free Software Foundation; either version 2 - *of the License, or (at your option) any later version. - */ - -#ifndef LINUX_LEDS_RTFLED_H -#define LINUX_LEDS_RTFLED_H -#include "flashlight.h" - -struct rt_fled_info; -typedef int (*rt_hal_fled_init) (struct rt_fled_info *info); -typedef int (*rt_hal_fled_suspend) (struct rt_fled_info *info, - pm_message_t state); -typedef int (*rt_hal_fled_resume) (struct rt_fled_info *info); -typedef int (*rt_hal_fled_set_mode) (struct rt_fled_info *info, - flashlight_mode_t mode); -typedef int (*rt_hal_fled_get_mode) (struct rt_fled_info *info); -typedef int (*rt_hal_fled_strobe) (struct rt_fled_info *info); - -/* - *Return value : -EINVAL => selector parameter is out of range, - *otherwise current in uA - */ -typedef int (*rt_hal_fled_torch_current_list) (struct rt_fled_info *info, - int selector); -typedef int (*rt_hal_fled_strobe_current_list) (struct rt_fled_info *info, - int selector); -typedef int (*rt_hal_fled_timeout_level_list) (struct rt_fled_info *info, - int selector); -/* - *Return value : -EINVAL => selector parameter is out of range, - *otherwise voltage in mV - */ -typedef int (*rt_hal_fled_lv_protection_list) (struct rt_fled_info *info, - int selector); -/* - *Return value : -EINVAL => selector parameter is out of range, - *otherwise time in ms - */ -typedef int (*rt_hal_fled_strobe_timeout_list) (struct rt_fled_info *info, - int selector); -typedef int (*rt_hal_fled_set_torch_current) (struct rt_fled_info *info, - int min_uA, int max_uA, - int *selector); -typedef int (*rt_hal_fled_set_strobe_current) (struct rt_fled_info *info, - int min_uA, int max_uA, - int *selector); -typedef int (*rt_hal_fled_set_timeout_level) (struct rt_fled_info *info, - int min_uA, int max_uA, - int *selector); -typedef int (*rt_hal_fled_set_lv_protection) (struct rt_fled_info *info, - int min_mV, int max_mV, - int *selector); -typedef int (*rt_hal_fled_set_strobe_timeout) (struct rt_fled_info *info, - int min_ms, int max_ms, - int *selector); -typedef int (*rt_hal_fled_set_torch_current_sel) (struct rt_fled_info *info, - int selector); -typedef int (*rt_hal_fled_set_strobe_current_sel) (struct rt_fled_info *info, - int selector); -typedef int (*rt_hal_fled_set_timeout_level_sel) (struct rt_fled_info *info, - int selector); -typedef int (*rt_hal_fled_set_lv_protection_sel) (struct rt_fled_info *info, - int selector); -typedef int (*rt_hal_fled_set_strobe_timeout_sel) (struct rt_fled_info *info, - int selector); -typedef int (*rt_hal_fled_get_torch_current_sel) (struct rt_fled_info *info); -typedef int (*rt_hal_fled_get_strobe_current_sel) (struct rt_fled_info *info); -typedef int (*rt_hal_fled_get_timeout_level_sel) (struct rt_fled_info *info); -typedef int (*rt_hal_fled_get_lv_protection_sel) (struct rt_fled_info *info); -typedef int (*rt_hal_fled_get_strobe_timeout_sel) (struct rt_fled_info *info); -typedef int (*rt_hal_fled_get_torch_current) (struct rt_fled_info *info); -typedef int (*rt_hal_fled_get_strobe_current) (struct rt_fled_info *info); -typedef int (*rt_hal_fled_get_timeout_level) (struct rt_fled_info *info); -typedef int (*rt_hal_fled_get_lv_protection) (struct rt_fled_info *info); -typedef int (*rt_hal_fled_get_strobe_timeout) (struct rt_fled_info *info); -typedef void (*rt_hal_fled_shutdown) (struct rt_fled_info *info); - -struct rt_fled_hal { - rt_hal_fled_init fled_init; - rt_hal_fled_suspend fled_suspend; - rt_hal_fled_resume fled_resume; - rt_hal_fled_set_mode fled_set_mode; - rt_hal_fled_get_mode fled_get_mode; - rt_hal_fled_strobe fled_strobe; - rt_hal_fled_torch_current_list fled_torch_current_list; - rt_hal_fled_strobe_current_list fled_strobe_current_list; - rt_hal_fled_timeout_level_list fled_timeout_level_list; - rt_hal_fled_lv_protection_list fled_lv_protection_list; - rt_hal_fled_strobe_timeout_list fled_strobe_timeout_list; - /*method to set */ - rt_hal_fled_set_torch_current_sel fled_set_torch_current_sel; - rt_hal_fled_set_strobe_current_sel fled_set_strobe_current_sel; - rt_hal_fled_set_timeout_level_sel fled_set_timeout_level_sel; - rt_hal_fled_set_lv_protection_sel fled_set_lv_protection_sel; - rt_hal_fled_set_strobe_timeout_sel fled_set_strobe_timeout_sel; - /*method to set, optional */ - rt_hal_fled_set_torch_current fled_set_torch_current; - rt_hal_fled_set_strobe_current fled_set_strobe_current; - rt_hal_fled_set_timeout_level fled_set_timeout_level; - rt_hal_fled_set_lv_protection fled_set_lv_protection; - rt_hal_fled_set_strobe_timeout fled_set_strobe_timeout; - /*method to get */ - rt_hal_fled_get_torch_current_sel fled_get_torch_current_sel; - rt_hal_fled_get_strobe_current_sel fled_get_strobe_current_sel; - rt_hal_fled_get_timeout_level_sel fled_get_timeout_level_sel; - rt_hal_fled_get_lv_protection_sel fled_get_lv_protection_sel; - rt_hal_fled_get_strobe_timeout_sel fled_get_strobe_timeout_sel; - /*method to get, optional */ - rt_hal_fled_get_torch_current fled_get_torch_current; - rt_hal_fled_get_strobe_current fled_get_strobe_current; - rt_hal_fled_get_timeout_level fled_get_timeout_level; - rt_hal_fled_get_lv_protection fled_get_lv_protection; - rt_hal_fled_get_strobe_timeout fled_get_strobe_timeout; - /*PM shutdown, optional */ - rt_hal_fled_shutdown fled_shutdown; -}; - -typedef struct rt_fled_info { - struct rt_fled_hal *hal; - struct flashlight_device *flashlight_dev; - const struct flashlight_properties *init_props; - char *name; - char *chip_name; -} rt_fled_info_t; - -/*Public funtions - *argument - * @name : Flash LED's name;pass NULL menas "rt-flash-led" - */ - -rt_fled_info_t *rt_fled_get_info_by_name(char *name); - -/*Usage : - *fled_info = rt_fled_get_info_by_name("FlashLED1"); - *fled_info->hal->fled_set_strobe_current(fled_info, - * 150, 200); - */ - -#endif /*LINUX_LEDS_RTFLED_H */ diff --git a/drivers/media/video/s5k5ca.c b/drivers/media/video/s5k5ca.c deleted file mode 100755 index 87628b0c482c..000000000000 --- a/drivers/media/video/s5k5ca.c +++ /dev/null @@ -1,6097 +0,0 @@ -/* - * Driver for OV5642 CMOS Image Sensor from OmniVision - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -//#include -#include -#include -#include "s5k5ca.h" - -#define CURRENT_8MA - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_S5K5CA -#define SENSOR_V4L2_IDENT V4L2_IDENT_S5K5CA -#define SENSOR_ID 0x05ca -#define SENSOR_ID_REG SEQUENCE_END -#define SENSOR_RESET_REG SEQUENCE_END -#define SENSOR_RESET_VAL 0x00 -#define SENSOR_MIN_WIDTH 640 -#define SENSOR_MIN_HEIGHT 480 -#define SENSOR_MAX_WIDTH 2048 -#define SENSOR_MAX_HEIGHT 1536 -#define SENSOR_INIT_WIDTH 640 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 480 -#define SENSOR_INIT_WINSEQADR sensor_vga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_UYVY8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 1 -#define CONFIG_SENSOR_AntiBanding 0 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 0 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 -#define CONFIG_SENSOR_Focus 0 - - -#define CONFIG_SENSOR_I2C_SPEED 400000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) - -#if CONFIG_SENSOR_Focus -#define SENSOR_AF_MODE_INFINITY 0 -#define SENSOR_AF_MODE_MACRO 1 -#define SENSOR_AF_MODE_FIXED 2 -#define SENSOR_AF_MODE_AUTO 3 -#define SENSOR_AF_MODE_CONTINUOUS 4 -#define SENSOR_AF_MODE_CLOSE 5 -#endif - -/* init 640X480 SVGA */ -static struct reginfo sensor_init_data[] = -{ - {0xFCFC, 0xD000}, //Reset // - {0x0010, 0x0001}, //Clear host interrupt so main will wait // - {0x1030, 0x0000}, //ARM go // - {0x0014, 0x0001}, //Wait100mSec // - {SEQUENCE_WAIT_MS,100}, //DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - - //tp - {0x0028, 0x7000}, - {0x002A, 0x2CF8}, - {0x0F12, 0xB510}, - {0x0F12, 0x4827}, - {0x0F12, 0x21C0}, - {0x0F12, 0x8041}, - {0x0F12, 0x4825}, - {0x0F12, 0x4A26}, - {0x0F12, 0x3020}, - {0x0F12, 0x8382}, - {0x0F12, 0x1D12}, - {0x0F12, 0x83C2}, - {0x0F12, 0x4822}, - {0x0F12, 0x3040}, - {0x0F12, 0x8041}, - {0x0F12, 0x4821}, - {0x0F12, 0x4922}, - {0x0F12, 0x3060}, - {0x0F12, 0x8381}, - {0x0F12, 0x1D09}, - {0x0F12, 0x83C1}, - {0x0F12, 0x4821}, - {0x0F12, 0x491D}, - {0x0F12, 0x8802}, - {0x0F12, 0x3980}, - {0x0F12, 0x804A}, - {0x0F12, 0x8842}, - {0x0F12, 0x808A}, - {0x0F12, 0x8882}, - {0x0F12, 0x80CA}, - {0x0F12, 0x88C2}, - {0x0F12, 0x810A}, - {0x0F12, 0x8902}, - {0x0F12, 0x491C}, - {0x0F12, 0x80CA}, - {0x0F12, 0x8942}, - {0x0F12, 0x814A}, - {0x0F12, 0x8982}, - {0x0F12, 0x830A}, - {0x0F12, 0x89C2}, - {0x0F12, 0x834A}, - {0x0F12, 0x8A00}, - {0x0F12, 0x4918}, - {0x0F12, 0x8188}, - {0x0F12, 0x4918}, - {0x0F12, 0x4819}, - {0x0F12, 0xF000}, - {0x0F12, 0xFA0C},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x4918}, - {0x0F12, 0x4819}, - {0x0F12, 0x6341}, - {0x0F12, 0x4919}, - {0x0F12, 0x4819}, - {0x0F12, 0xF000}, - {0x0F12, 0xFA05},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x4816}, - {0x0F12, 0x4918}, - {0x0F12, 0x3840}, - {0x0F12, 0x62C1}, - {0x0F12, 0x4918}, - {0x0F12, 0x3880}, - {0x0F12, 0x63C1}, - {0x0F12, 0x4917}, - {0x0F12, 0x6301}, - {0x0F12, 0x4917}, - {0x0F12, 0x3040}, - {0x0F12, 0x6181}, - {0x0F12, 0x4917}, - {0x0F12, 0x4817}, - {0x0F12, 0xF000}, - {0x0F12, 0xF9F5},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x4917}, - {0x0F12, 0x4817}, - {0x0F12, 0xF000}, - {0x0F12, 0xF9F1},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x4917}, - {0x0F12, 0x4817}, - {0x0F12, 0xF000}, - {0x0F12, 0xF9ED},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0xBC10}, - {0x0F12, 0xBC08}, - {0x0F12, 0x4718}, - {0x0F12, 0x1100}, - {0x0F12, 0xD000}, - {0x0F12, 0x267C}, - {0x0F12, 0x0000}, - {0x0F12, 0x2CE8}, - {0x0F12, 0x0000}, - {0x0F12, 0x3274}, - {0x0F12, 0x7000}, - {0x0F12, 0xF400}, - {0x0F12, 0xD000}, - {0x0F12, 0xF520}, - {0x0F12, 0xD000}, - {0x0F12, 0x2DF1}, - {0x0F12, 0x7000}, - {0x0F12, 0x89A9}, - {0x0F12, 0x0000}, - {0x0F12, 0x2E43}, - {0x0F12, 0x7000}, - {0x0F12, 0x0140}, - {0x0F12, 0x7000}, - {0x0F12, 0x2E75},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x7000}, - {0x0F12, 0xB4F7}, - {0x0F12, 0x0000}, - {0x0F12, 0x2EFF},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x7000}, - {0x0F12, 0x2F23},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x7000}, - {0x0F12, 0x2FCD},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x7000}, - {0x0F12, 0x2FE1},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x7000}, - {0x0F12, 0x2FB5},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x7000}, - {0x0F12, 0x013D}, - {0x0F12, 0x0001}, - {0x0F12, 0x3067},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x7000}, - {0x0F12, 0x5823}, - {0x0F12, 0x0000}, - {0x0F12, 0x30B5},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x7000}, - {0x0F12, 0xD789}, - {0x0F12, 0x0000}, - {0x0F12, 0xB570}, - {0x0F12, 0x6804}, - {0x0F12, 0x6845}, - {0x0F12, 0x6881}, - {0x0F12, 0x6840}, - {0x0F12, 0x2900}, - {0x0F12, 0x6880}, - {0x0F12, 0xD007}, - {0x0F12, 0x49C2},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x8949}, - {0x0F12, 0x084A}, - {0x0F12, 0x1880}, - {0x0F12, 0xF000}, - {0x0F12, 0xF9B8},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x80A0}, - {0x0F12, 0xE000}, - {0x0F12, 0x80A0}, - {0x0F12, 0x88A0}, - {0x0F12, 0x2800}, - {0x0F12, 0xD010}, - {0x0F12, 0x68A9}, - {0x0F12, 0x6828}, - {0x0F12, 0x084A}, - {0x0F12, 0x1880}, - {0x0F12, 0xF000}, - {0x0F12, 0xF9AC},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x8020}, - {0x0F12, 0x1D2D}, - {0x0F12, 0xCD03}, - {0x0F12, 0x084A}, - {0x0F12, 0x1880}, - {0x0F12, 0xF000}, - {0x0F12, 0xF9A5},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x8060}, - {0x0F12, 0xBC70}, - {0x0F12, 0xBC08}, - {0x0F12, 0x4718}, - {0x0F12, 0x2000}, - {0x0F12, 0x8060}, - {0x0F12, 0x8020}, - {0x0F12, 0xE7F8}, - {0x0F12, 0xB510}, - {0x0F12, 0xF000}, - //BEGIN: DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0xF9A0}, - //{0x0F12, 0x48B2}, - //{0x0F12, 0x8A40}, - //{0x0F12, 0x2800}, - //{0x0F12, 0xD00C}, - //END: DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x48B1}, - {0x0F12, 0x49B2}, - {0x0F12, 0x8800}, - {0x0F12, 0x4AB2}, - {0x0F12, 0x2805}, - {0x0F12, 0xD003}, - {0x0F12, 0x4BB1}, - {0x0F12, 0x795B}, - {0x0F12, 0x2B00}, - {0x0F12, 0xD005}, - {0x0F12, 0x2001}, - {0x0F12, 0x8008}, - {0x0F12, 0x8010}, - {0x0F12, 0xBC10}, - {0x0F12, 0xBC08}, - {0x0F12, 0x4718}, - {0x0F12, 0x2800}, - {0x0F12, 0xD1FA}, - {0x0F12, 0x2000}, - {0x0F12, 0x8008}, - {0x0F12, 0x8010}, - {0x0F12, 0xE7F6}, - {0x0F12, 0xB5F8}, - {0x0F12, 0x2407}, - {0x0F12, 0x2C06}, - {0x0F12, 0xD035}, - {0x0F12, 0x2C07}, - {0x0F12, 0xD033}, - {0x0F12, 0x48A3}, - {0x0F12, 0x8BC1}, - {0x0F12, 0x2900}, - {0x0F12, 0xD02A}, - {0x0F12, 0x00A2}, - {0x0F12, 0x1815}, - {0x0F12, 0x4AA4}, - {0x0F12, 0x6DEE}, - {0x0F12, 0x8A92}, - {0x0F12, 0x4296}, - {0x0F12, 0xD923}, - {0x0F12, 0x0028}, - {0x0F12, 0x3080}, - {0x0F12, 0x0007}, - {0x0F12, 0x69C0}, - {0x0F12, 0xF000}, - {0x0F12, 0xF96D},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x1C71}, - {0x0F12, 0x0280}, - {0x0F12, 0xF000}, - {0x0F12, 0xF969},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x0006}, - {0x0F12, 0x4898}, - {0x0F12, 0x0061}, - {0x0F12, 0x1808}, - {0x0F12, 0x8D80}, - {0x0F12, 0x0A01}, - {0x0F12, 0x0600}, - {0x0F12, 0x0E00}, - {0x0F12, 0x1A08}, - {0x0F12, 0xF000}, - {0x0F12, 0xF96C},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x0002}, - {0x0F12, 0x6DE9}, - {0x0F12, 0x6FE8}, - {0x0F12, 0x1A08}, - {0x0F12, 0x4351}, - {0x0F12, 0x0300}, - {0x0F12, 0x1C49}, - {0x0F12, 0xF000}, - {0x0F12, 0xF955},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x0401}, - {0x0F12, 0x0430}, - {0x0F12, 0x0C00}, - {0x0F12, 0x4301}, - {0x0F12, 0x61F9}, - {0x0F12, 0xE004}, - {0x0F12, 0x00A2}, - {0x0F12, 0x4990}, - {0x0F12, 0x1810}, - {0x0F12, 0x3080}, - {0x0F12, 0x61C1}, - {0x0F12, 0x1E64}, - {0x0F12, 0xD2C5}, - {0x0F12, 0x2006}, - {0x0F12, 0xF000}, - {0x0F12, 0xF95B},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x2007}, - {0x0F12, 0xF000}, - {0x0F12, 0xF958},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0xBCF8}, - {0x0F12, 0xBC08}, - {0x0F12, 0x4718}, - {0x0F12, 0xB510}, - {0x0F12, 0xF000}, - {0x0F12, 0xF95A},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x2800}, - {0x0F12, 0xD00A}, - {0x0F12, 0x4881}, - {0x0F12, 0x8B81}, - {0x0F12, 0x0089}, - {0x0F12, 0x1808}, - {0x0F12, 0x6DC1}, - {0x0F12, 0x4883}, - {0x0F12, 0x8A80}, - {0x0F12, 0x4281}, - {0x0F12, 0xD901}, - {0x0F12, 0x2001}, - {0x0F12, 0xE7A1}, - {0x0F12, 0x2000}, - {0x0F12, 0xE79F}, - {0x0F12, 0xB5F8}, - {0x0F12, 0x0004}, - {0x0F12, 0x4F80}, - {0x0F12, 0x227D}, - {0x0F12, 0x8938}, - {0x0F12, 0x0152}, - {0x0F12, 0x4342}, - {0x0F12, 0x487E}, - {0x0F12, 0x9000}, - {0x0F12, 0x8A01}, - {0x0F12, 0x0848}, - {0x0F12, 0x1810}, - {0x0F12, 0xF000}, - {0x0F12, 0xF91F},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x210F}, - {0x0F12, 0xF000}, - {0x0F12, 0xF942},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x497A}, - {0x0F12, 0x8C49}, - {0x0F12, 0x090E}, - {0x0F12, 0x0136}, - {0x0F12, 0x4306}, - {0x0F12, 0x4979}, - {0x0F12, 0x2C00}, - {0x0F12, 0xD003}, - {0x0F12, 0x2001}, - {0x0F12, 0x0240}, - {0x0F12, 0x4330}, - {0x0F12, 0x8108}, - {0x0F12, 0x4876}, - {0x0F12, 0x2C00}, - {0x0F12, 0x8D00}, - {0x0F12, 0xD001}, - {0x0F12, 0x2501}, - {0x0F12, 0xE000}, - {0x0F12, 0x2500}, - {0x0F12, 0x4972}, - {0x0F12, 0x4328}, - {0x0F12, 0x8008}, - {0x0F12, 0x207D}, - {0x0F12, 0x00C0}, - {0x0F12, 0xF000}, - {0x0F12, 0xF930},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x2C00}, - {0x0F12, 0x496E}, - {0x0F12, 0x0328}, - {0x0F12, 0x4330}, - {0x0F12, 0x8108}, - {0x0F12, 0x88F8}, - {0x0F12, 0x2C00}, - {0x0F12, 0x01AA}, - {0x0F12, 0x4310}, - {0x0F12, 0x8088}, - {0x0F12, 0x2C00},//DTS2012071201781: add by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0xD00B},//DTS2012071201781: add by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x9800}, - {0x0F12, 0x8A01}, - {0x0F12, 0x4869},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0xF000}, - {0x0F12, 0xF8F1}, - {0x0F12, 0x4969},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x8809}, - {0x0F12, 0x4348}, - {0x0F12, 0x0400}, - {0x0F12, 0x0C00}, - {0x0F12, 0xF000}, - {0x0F12, 0xF918}, - {0x0F12, 0x0020}, - {0x0F12, 0xF000}, - {0x0F12, 0xF91D}, - {0x0F12, 0x4865},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x7004}, - {0x0F12, 0xE7A1},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0xB510}, - {0x0F12, 0x0004}, - {0x0F12, 0xF000}, - {0x0F12, 0xF91E}, - {0x0F12, 0x6020}, - {0x0F12, 0x4962},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x8B49}, - {0x0F12, 0x0789}, - {0x0F12, 0xD001}, - {0x0F12, 0x0040}, - {0x0F12, 0x6020}, - {0x0F12, 0xE74A},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0xB510}, - {0x0F12, 0xF000}, - {0x0F12, 0xF91B}, - {0x0F12, 0x485E},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x8880}, - {0x0F12, 0x0601}, - {0x0F12, 0x4853},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x1609}, - {0x0F12, 0x8141}, - {0x0F12, 0xE740},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0xB5F8}, - {0x0F12, 0x000F}, - {0x0F12, 0x4C54},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x3420}, - {0x0F12, 0x2500}, - {0x0F12, 0x5765}, - {0x0F12, 0x0039}, - {0x0F12, 0xF000}, - {0x0F12, 0xF913}, - {0x0F12, 0x9000}, - {0x0F12, 0x2600}, - {0x0F12, 0x57A6}, - {0x0F12, 0x4C4B},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x42AE}, - {0x0F12, 0xD01B}, - {0x0F12, 0x4D53},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x8AE8}, - {0x0F12, 0x2800}, - {0x0F12, 0xD013}, - {0x0F12, 0x484C},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x8A01}, - {0x0F12, 0x8B80}, - {0x0F12, 0x4378}, - {0x0F12, 0xF000}, - {0x0F12, 0xF8B5}, - {0x0F12, 0x89A9}, - {0x0F12, 0x1A41}, - {0x0F12, 0x484D},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x3820}, - {0x0F12, 0x8AC0}, - {0x0F12, 0x4348}, - {0x0F12, 0x17C1}, - {0x0F12, 0x0D89}, - {0x0F12, 0x1808}, - {0x0F12, 0x1280}, - {0x0F12, 0x8961}, - {0x0F12, 0x1A08}, - {0x0F12, 0x8160}, - {0x0F12, 0xE003}, - {0x0F12, 0x88A8}, - {0x0F12, 0x0600}, - {0x0F12, 0x1600}, - {0x0F12, 0x8160}, - {0x0F12, 0x200A}, - {0x0F12, 0x5E20}, - {0x0F12, 0x42B0}, - {0x0F12, 0xD011}, - {0x0F12, 0xF000}, - {0x0F12, 0xF8AB}, - {0x0F12, 0x1D40}, - {0x0F12, 0x00C3}, - {0x0F12, 0x1A18}, - {0x0F12, 0x214B}, - {0x0F12, 0xF000}, - {0x0F12, 0xF897}, - {0x0F12, 0x211F}, - {0x0F12, 0xF000}, - {0x0F12, 0xF8BA}, - {0x0F12, 0x210A}, - {0x0F12, 0x5E61}, - {0x0F12, 0x0FC9}, - {0x0F12, 0x0149}, - {0x0F12, 0x4301}, - {0x0F12, 0x483C},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x81C1}, - {0x0F12, 0x9800}, - {0x0F12, 0xE748},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0xB5F1}, - {0x0F12, 0xB082}, - {0x0F12, 0x2500}, - {0x0F12, 0x4839},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x9001}, - {0x0F12, 0x2400}, - {0x0F12, 0x2028}, - {0x0F12, 0x4368}, - {0x0F12, 0x4A39}, - {0x0F12, 0x4937},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x1887}, - {0x0F12, 0x1840}, - {0x0F12, 0x9000}, - {0x0F12, 0x9800}, - {0x0F12, 0x0066}, - {0x0F12, 0x9A01}, - {0x0F12, 0x1980}, - {0x0F12, 0x218C}, - {0x0F12, 0x5A09}, - {0x0F12, 0x8A80}, - {0x0F12, 0x8812}, - {0x0F12, 0xF000}, - {0x0F12, 0xF8CA}, - {0x0F12, 0x53B8}, - {0x0F12, 0x1C64}, - {0x0F12, 0x2C14}, - {0x0F12, 0xDBF1}, - {0x0F12, 0x1C6D}, - {0x0F12, 0x2D03}, - {0x0F12, 0xDBE6}, - {0x0F12, 0x9802}, - {0x0F12, 0x6800}, - {0x0F12, 0x0600}, - {0x0F12, 0x0E00}, - {0x0F12, 0xF000}, - {0x0F12, 0xF8C5}, - {0x0F12, 0xBCFE}, - {0x0F12, 0xBC08}, - {0x0F12, 0x4718}, - {0x0F12, 0xB570}, - {0x0F12, 0x6805}, - {0x0F12, 0x2404}, - {0x0F12, 0xF000}, - {0x0F12, 0xF8C5}, - {0x0F12, 0x2800}, - {0x0F12, 0xD103}, - {0x0F12, 0xF000}, - {0x0F12, 0xF8C9}, - {0x0F12, 0x2800}, - {0x0F12, 0xD000}, - {0x0F12, 0x2400}, - {0x0F12, 0x3540}, - {0x0F12, 0x88E8}, - {0x0F12, 0x0500}, - {0x0F12, 0xD403}, - {0x0F12, 0x4822}, - {0x0F12, 0x89C0}, - {0x0F12, 0x2800}, - {0x0F12, 0xD002}, - {0x0F12, 0x2008}, - {0x0F12, 0x4304}, - {0x0F12, 0xE001}, - {0x0F12, 0x2010}, - {0x0F12, 0x4304}, - {0x0F12, 0x481F}, - {0x0F12, 0x8B80}, - {0x0F12, 0x0700}, - {0x0F12, 0x0F81}, - {0x0F12, 0x2001}, - {0x0F12, 0x2900}, - {0x0F12, 0xD000}, - {0x0F12, 0x4304}, - {0x0F12, 0x491C}, - {0x0F12, 0x8B0A}, - {0x0F12, 0x42A2}, - {0x0F12, 0xD004}, - {0x0F12, 0x0762}, - {0x0F12, 0xD502}, - {0x0F12, 0x4A19}, - {0x0F12, 0x3220}, - {0x0F12, 0x8110}, - {0x0F12, 0x830C}, - {0x0F12, 0xE693},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x0C3C}, - //BEGIN: DTS2012071201781: del by huyouhua 00136760 at 2012-7-20 - //{0x0F12, 0x7000}, - //{0x0F12, 0x3274}, - //END: DTS2012071201781: del by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x7000}, - {0x0F12, 0x26E8}, - {0x0F12, 0x7000}, - {0x0F12, 0x6100}, - {0x0F12, 0xD000}, - {0x0F12, 0x6500}, - {0x0F12, 0xD000}, - {0x0F12, 0x1A7C}, - {0x0F12, 0x7000}, - {0x0F12, 0x1120}, - {0x0F12, 0x7000}, - {0x0F12, 0xFFFF}, - {0x0F12, 0x0000}, - {0x0F12, 0x3374}, - {0x0F12, 0x7000}, - {0x0F12, 0x1D6C}, - {0x0F12, 0x7000}, - {0x0F12, 0x167C}, - {0x0F12, 0x7000}, - {0x0F12, 0xF400}, - {0x0F12, 0xD000}, - {0x0F12, 0x2C2C}, - {0x0F12, 0x7000}, - {0x0F12, 0x40A0}, - {0x0F12, 0x00DD}, - {0x0F12, 0xF520}, - {0x0F12, 0xD000}, - {0x0F12, 0x2C29}, - {0x0F12, 0x7000}, - {0x0F12, 0x1A54}, - {0x0F12, 0x7000}, - {0x0F12, 0x1564}, - {0x0F12, 0x7000}, - {0x0F12, 0xF2A0}, - {0x0F12, 0xD000}, - {0x0F12, 0x2440}, - {0x0F12, 0x7000},//DTS2012071201781: add by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x3274},//DTS2012071201781: add by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x7000}, - {0x0F12, 0x05A0}, - {0x0F12, 0x7000}, - {0x0F12, 0x2894}, - {0x0F12, 0x7000}, - {0x0F12, 0x1224}, - {0x0F12, 0x7000}, - {0x0F12, 0xB000}, - {0x0F12, 0xD000}, - {0x0F12, 0x4778}, - {0x0F12, 0x46C0}, - {0x0F12, 0xC000}, - {0x0F12, 0xE59F}, - {0x0F12, 0xFF1C}, - {0x0F12, 0xE12F}, - {0x0F12, 0x1A3F}, - {0x0F12, 0x0001}, - {0x0F12, 0x4778}, - {0x0F12, 0x46C0}, - {0x0F12, 0xF004}, - {0x0F12, 0xE51F}, - {0x0F12, 0x1F48}, - {0x0F12, 0x0001}, - {0x0F12, 0x4778}, - {0x0F12, 0x46C0}, - {0x0F12, 0xC000}, - {0x0F12, 0xE59F}, - {0x0F12, 0xFF1C}, - {0x0F12, 0xE12F}, - {0x0F12, 0x24BD}, - {0x0F12, 0x0000}, - {0x0F12, 0x4778}, - {0x0F12, 0x46C0}, - {0x0F12, 0xC000}, - {0x0F12, 0xE59F}, - {0x0F12, 0xFF1C}, - {0x0F12, 0xE12F}, - {0x0F12, 0x36DD}, - {0x0F12, 0x0000}, - {0x0F12, 0x4778}, - {0x0F12, 0x46C0}, - {0x0F12, 0xC000}, - {0x0F12, 0xE59F}, - {0x0F12, 0xFF1C}, - {0x0F12, 0xE12F}, - {0x0F12, 0xB4CF}, - {0x0F12, 0x0000}, - {0x0F12, 0x4778}, - {0x0F12, 0x46C0}, - {0x0F12, 0xC000}, - {0x0F12, 0xE59F}, - {0x0F12, 0xFF1C}, - {0x0F12, 0xE12F}, - {0x0F12, 0xB5D7}, - {0x0F12, 0x0000}, - {0x0F12, 0x4778}, - {0x0F12, 0x46C0}, - {0x0F12, 0xC000}, - {0x0F12, 0xE59F}, - {0x0F12, 0xFF1C}, - {0x0F12, 0xE12F}, - {0x0F12, 0x36ED}, - {0x0F12, 0x0000}, - {0x0F12, 0x4778}, - {0x0F12, 0x46C0}, - {0x0F12, 0xC000}, - {0x0F12, 0xE59F}, - {0x0F12, 0xFF1C}, - {0x0F12, 0xE12F}, - {0x0F12, 0xF53F}, - {0x0F12, 0x0000}, - {0x0F12, 0x4778}, - {0x0F12, 0x46C0}, - {0x0F12, 0xC000}, - {0x0F12, 0xE59F}, - {0x0F12, 0xFF1C}, - {0x0F12, 0xE12F}, - {0x0F12, 0xF5D9}, - {0x0F12, 0x0000}, - {0x0F12, 0x4778}, - {0x0F12, 0x46C0}, - {0x0F12, 0xC000}, - {0x0F12, 0xE59F}, - {0x0F12, 0xFF1C}, - {0x0F12, 0xE12F}, - {0x0F12, 0x013D}, - {0x0F12, 0x0001}, - {0x0F12, 0x4778}, - {0x0F12, 0x46C0}, - {0x0F12, 0xC000}, - {0x0F12, 0xE59F}, - {0x0F12, 0xFF1C}, - {0x0F12, 0xE12F}, - {0x0F12, 0xF5C9}, - {0x0F12, 0x0000}, - {0x0F12, 0x4778}, - {0x0F12, 0x46C0}, - {0x0F12, 0xC000}, - {0x0F12, 0xE59F}, - {0x0F12, 0xFF1C}, - {0x0F12, 0xE12F}, - {0x0F12, 0xFAA9}, - {0x0F12, 0x0000}, - {0x0F12, 0x4778}, - {0x0F12, 0x46C0}, - {0x0F12, 0xC000}, - {0x0F12, 0xE59F}, - {0x0F12, 0xFF1C}, - {0x0F12, 0xE12F}, - {0x0F12, 0x3723}, - {0x0F12, 0x0000}, - {0x0F12, 0x4778}, - {0x0F12, 0x46C0}, - {0x0F12, 0xC000}, - {0x0F12, 0xE59F}, - {0x0F12, 0xFF1C}, - {0x0F12, 0xE12F}, - {0x0F12, 0x5823}, - {0x0F12, 0x0000}, - {0x0F12, 0x4778}, - {0x0F12, 0x46C0}, - {0x0F12, 0xC000}, - {0x0F12, 0xE59F}, - {0x0F12, 0xFF1C}, - {0x0F12, 0xE12F}, - {0x0F12, 0xD771}, - {0x0F12, 0x0000}, - {0x0F12, 0x4778}, - {0x0F12, 0x46C0}, - {0x0F12, 0xC000}, - {0x0F12, 0xE59F}, - {0x0F12, 0xFF1C}, - {0x0F12, 0xE12F}, - {0x0F12, 0xD75B}, - {0x0F12, 0x0000}, - {0x0F12, 0x7E77},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x0000}, - //end tp - - //======================================================== - // CIs/APs/An setting - 400LsB sYsCLK 32MHz - //======================================================== - // This regis are for FACTORY ONLY. If you change it without prior notification, - // YOU are REsIBLE for the FAILURE that will happen in the future. - //======================================================== - {0x0028, 0x7000},//DTS2012071201781: add by huyouhua 00136760 at 2012-7-20 - - {0x002A, 0x157A}, - {0x0F12, 0x0001}, - {0x002A, 0x1578}, - {0x0F12, 0x0001}, - {0x002A, 0x1576}, - {0x0F12, 0x0020}, - {0x002A, 0x1574}, - {0x0F12, 0x0006}, - {0x002A, 0x156E}, - {0x0F12, 0x0001}, // slope calibration tolerance in units of 1/256 - {0x002A, 0x1568}, - {0x0F12, 0x00FC}, - - //ADC control - {0x002A, 0x155A}, - {0x0F12, 0x01CC}, //ADC sAT of 450mV for 10bit default in EVT1 - {0x002A, 0x157E}, - {0x0F12, 0x0C80}, // 3200 Max. Reset ramp DCLK counts {default 2048 0x800} - {0x0F12, 0x0578}, // 1400 Max. Reset ramp DCLK counts for x3.5 - {0x002A, 0x157C}, - {0x0F12, 0x0190}, // 400 Reset ramp for x1 in DCLK counts - {0x002A, 0x1570}, - {0x0F12, 0x00A0}, // 160 LsB - {0x0F12, 0x0010}, // reset threshold - {0x002A, 0x12C4}, - {0x0F12, 0x006A}, // 106 additional timing columns. - {0x002A, 0x12C8}, - {0x0F12, 0x08AC}, // 2220 ADC columns in normal mode including Hold & Latch - {0x0F12, 0x0050}, // 80 addition of ADC columns in Y-ave mode {default 244 0x74} - - {0x002A, 0x1696}, // based on APs guidelines - {0x0F12, 0x0000}, // based on APs guidelines - {0x0F12, 0x0000}, // default. 1492 used for ADC dark characteristics - {0x0F12, 0x00C6}, // default. 1492 used for ADC dark characteristics - {0x0F12, 0x00C6}, - //BEGIN: DTS2012071201781: add by huyouhua 00136760 at 2012-7-20 - {0x002A, 0x12B8}, - {0x0F12, 0x0B00}, //#senHal_ExpMinPixels //disable CINTR 0 - //END: DTS2012071201781: add by huyouhua 00136760 at 2012-7-20 - {0x002A, 0x1690}, // when set double sampling is activated - requires different set of pointers - {0x0F12, 0x0001}, - - {0x002A, 0x12B0}, // comp and pixel bias control 0xF40E - default for EVT1 - {0x0F12, 0x0055}, // comp and pixel bias control 0xF40E for binning mode - {0x0F12, 0x005A}, - - {0x002A, 0x337A}, // [7] - is used for rest-only mode {EVT0 value is 0xD and HW 0x6} - {0x0F12, 0x0006}, - {0x0F12, 0x0068}, - //BEGIN:DTS2012071201781: del by huyouhua 00136760 at 2012-7-20 - //{0x002A, 0x169E}, - //{0x0F12, 0x0007}, - //{0x002A, 0x0BF6}, - //{0x0F12, 0x0000}, - //END:DTS2012071201781: del by huyouhua 00136760 at 2012-7-20 - - {0x002A, 0x327C}, - {0x0F12, 0x1000}, - {0x0F12, 0x6998}, - {0x0F12, 0x0078}, - {0x0F12, 0x04FE}, - {0x0F12, 0x8800}, -#if defined(CURRENT_4MA) - {0x002A, 0x3274}, - {0x0F12, 0x0155}, //set IO driving current 4mA for Data - {0x0F12, 0x0155}, //set IO driving current 4ma for Data - {0x0F12, 0x1555}, //set IO driving current - {0x0F12, 0x0555}, //set IO driving current 4ma for PCLK/HSYNC/Vsync -#elif defined(CURRENT_8MA) - {0x002A, 0x3274}, - {0x0F12, 0x02aa}, //set IO driving current 8mA for Data - {0x0F12, 0x02aa}, //set IO driving current - {0x0F12, 0x1555}, //set IO driving current - {0x0F12, 0x059a}, //set IO driving current -#elif defined(CURRENT_12MA) - {0x002A, 0x3274}, - {0x0F12, 0x03ff}, //set IO driving current 12mA for Data - {0x0F12, 0x03ff}, //set IO driving current - {0x0F12, 0x1555}, //set IO driving current - {0x0F12, 0x05df}, //set IO driving current - //BEGIN: DTS2012071201781 add by huyouhua 00136760 at 2012-7-23 -#elif defined(CURRENT_SLIM) - {0x002A, 0x3274}, - {0x0F12, 0x0155},//------- //#Tune_TP_IO_DrivingCurrent_D0_D4_cs10Set IO driving current--------------- - {0x0F12, 0x0155},//------- //#Tune_TP_IO_DrivingCurrent_D9_D5_cs10Set IO driving current--------------- - {0x0F12, 0x1555},//------- //#Tune_TP_IO_DrivingCurrent_GPIO_cd10 Set IO driving current--------------- - //{0x0F12, 0x05DF}//0x0555},//------- - //059A//05DF//#Tune_TP_IO_DrivingCurrent_CLKs_cd10 Set IO driving current- - {0x0F12, 0x059A},//0x0555},//------- - //059A//05DF//#Tune_TP_IO_DrivingCurrent_CLKs_cd10 Set IO driving current- - //595,59A,5DA,5DF - //END: DTS2012071201781 add by huyouhua 00136760 at 2012-7-23 -#endif - - //BEGIN: DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x002A, 0x169E}, - {0x0F12, 0x0007}, //evt1_senHal_Dblr2Value // [3:0]- specifies the target (default 7)- DCLK = 64MHz instead of 116MHz. - {0x002A, 0x0BF6}, - {0x0F12, 0x0000}, //from ALEX //Enable Bayer Downscaler - //END: DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0028, 0x7000}, - {0x002A, 0x12D2}, - {0x0F12, 0x0003}, //senHal_pContSenModesRegsArray[0][0]2 700012D2 - {0x0F12, 0x0003}, //senHal_pContSenModesRegsArray[0][1]2 700012D4 - {0x0F12, 0x0003}, //senHal_pContSenModesRegsArray[0][2]2 700012D6 - {0x0F12, 0x0003}, //senHal_pContSenModesRegsArray[0][3]2 700012D8 - {0x0F12, 0x0884}, //senHal_pContSenModesRegsArray[1][0]2 700012DA - {0x0F12, 0x08CF}, //senHal_pContSenModesRegsArray[1][1]2 700012DC - {0x0F12, 0x0500}, //senHal_pContSenModesRegsArray[1][2]2 700012DE - {0x0F12, 0x054B}, //senHal_pContSenModesRegsArray[1][3]2 700012E0 - {0x0F12, 0x0001}, //senHal_pContSenModesRegsArray[2][0]2 700012E2 - {0x0F12, 0x0001}, //senHal_pContSenModesRegsArray[2][1]2 700012E4 - {0x0F12, 0x0001}, //senHal_pContSenModesRegsArray[2][2]2 700012E6 - {0x0F12, 0x0001}, //senHal_pContSenModesRegsArray[2][3]2 700012E8 - {0x0F12, 0x0885}, //senHal_pContSenModesRegsArray[3][0]2 700012EA - {0x0F12, 0x0467}, //senHal_pContSenModesRegsArray[3][1]2 700012EC - {0x0F12, 0x0501}, //senHal_pContSenModesRegsArray[3][2]2 700012EE - {0x0F12, 0x02A5}, //senHal_pContSenModesRegsArray[3][3]2 700012F0 - {0x0F12, 0x0001}, //senHal_pContSenModesRegsArray[4][0]2 700012F2 - {0x0F12, 0x046A}, //senHal_pContSenModesRegsArray[4][1]2 700012F4 - {0x0F12, 0x0001}, //senHal_pContSenModesRegsArray[4][2]2 700012F6 - {0x0F12, 0x02A8}, //senHal_pContSenModesRegsArray[4][3]2 700012F8 - {0x0F12, 0x0885}, //senHal_pContSenModesRegsArray[5][0]2 700012FA - {0x0F12, 0x08D0}, //senHal_pContSenModesRegsArray[5][1]2 700012FC - {0x0F12, 0x0501}, //senHal_pContSenModesRegsArray[5][2]2 700012FE - {0x0F12, 0x054C}, //senHal_pContSenModesRegsArray[5][3]2 70001300 - {0x0F12, 0x0006}, //senHal_pContSenModesRegsArray[6][0]2 70001302 - {0x0F12, 0x0020}, //senHal_pContSenModesRegsArray[6][1]2 70001304 - {0x0F12, 0x0006}, //senHal_pContSenModesRegsArray[6][2]2 70001306 - {0x0F12, 0x0020}, //senHal_pContSenModesRegsArray[6][3]2 70001308 - {0x0F12, 0x0881}, //senHal_pContSenModesRegsArray[7][0]2 7000130A - {0x0F12, 0x0463}, //senHal_pContSenModesRegsArray[7][1]2 7000130C - {0x0F12, 0x04FD}, //senHal_pContSenModesRegsArray[7][2]2 7000130E - {0x0F12, 0x02A1}, //senHal_pContSenModesRegsArray[7][3]2 70001310 - {0x0F12, 0x0006}, //senHal_pContSenModesRegsArray[8][0]2 70001312 - {0x0F12, 0x0489}, //senHal_pContSenModesRegsArray[8][1]2 70001314 - {0x0F12, 0x0006}, //senHal_pContSenModesRegsArray[8][2]2 70001316 - {0x0F12, 0x02C7}, //senHal_pContSenModesRegsArray[8][3]2 70001318 - {0x0F12, 0x0881}, //senHal_pContSenModesRegsArray[9][0]2 7000131A - {0x0F12, 0x08CC}, //senHal_pContSenModesRegsArray[9][1]2 7000131C - {0x0F12, 0x04FD}, //senHal_pContSenModesRegsArray[9][2]2 7000131E - {0x0F12, 0x0548}, //senHal_pContSenModesRegsArray[9][3]2 70001320 - {0x0F12, 0x03A2}, //senHal_pContSenModesRegsArray[10][0] 2 70001322 - {0x0F12, 0x01D3}, //senHal_pContSenModesRegsArray[10][1] 2 70001324 - {0x0F12, 0x01E0}, //senHal_pContSenModesRegsArray[10][2] 2 70001326 - {0x0F12, 0x00F2}, //senHal_pContSenModesRegsArray[10][3] 2 70001328 - {0x0F12, 0x03F2}, //senHal_pContSenModesRegsArray[11][0] 2 7000132A - {0x0F12, 0x0223}, //senHal_pContSenModesRegsArray[11][1] 2 7000132C - {0x0F12, 0x0230}, //senHal_pContSenModesRegsArray[11][2] 2 7000132E - {0x0F12, 0x0142}, //senHal_pContSenModesRegsArray[11][3] 2 70001330 - {0x0F12, 0x03A2}, //senHal_pContSenModesRegsArray[12][0] 2 70001332 - {0x0F12, 0x063C}, //senHal_pContSenModesRegsArray[12][1] 2 70001334 - {0x0F12, 0x01E0}, //senHal_pContSenModesRegsArray[12][2] 2 70001336 - {0x0F12, 0x0399}, //senHal_pContSenModesRegsArray[12][3] 2 70001338 - {0x0F12, 0x03F2}, //senHal_pContSenModesRegsArray[13][0] 2 7000133A - {0x0F12, 0x068C}, //senHal_pContSenModesRegsArray[13][1] 2 7000133C - {0x0F12, 0x0230}, //senHal_pContSenModesRegsArray[13][2] 2 7000133E - {0x0F12, 0x03E9}, //senHal_pContSenModesRegsArray[13][3] 2 70001340 - {0x0F12, 0x0002}, //senHal_pContSenModesRegsArray[14][0] 2 70001342 - {0x0F12, 0x0002}, //senHal_pContSenModesRegsArray[14][1] 2 70001344 - {0x0F12, 0x0002}, //senHal_pContSenModesRegsArray[14][2] 2 70001346 - {0x0F12, 0x0002}, //senHal_pContSenModesRegsArray[14][3] 2 70001348 - {0x0F12, 0x003C}, //senHal_pContSenModesRegsArray[15][0] 2 7000134A - {0x0F12, 0x003C}, //senHal_pContSenModesRegsArray[15][1] 2 7000134C - {0x0F12, 0x003C}, //senHal_pContSenModesRegsArray[15][2] 2 7000134E - {0x0F12, 0x003C}, //senHal_pContSenModesRegsArray[15][3] 2 70001350 - {0x0F12, 0x01D3}, //senHal_pContSenModesRegsArray[16][0] 2 70001352 - {0x0F12, 0x01D3}, //senHal_pContSenModesRegsArray[16][1] 2 70001354 - {0x0F12, 0x00F2}, //senHal_pContSenModesRegsArray[16][2] 2 70001356 - {0x0F12, 0x00F2}, //senHal_pContSenModesRegsArray[16][3] 2 70001358 - {0x0F12, 0x020B}, //senHal_pContSenModesRegsArray[17][0] 2 7000135A - {0x0F12, 0x024A}, //senHal_pContSenModesRegsArray[17][1] 2 7000135C - {0x0F12, 0x012A}, //senHal_pContSenModesRegsArray[17][2] 2 7000135E - {0x0F12, 0x0169}, //senHal_pContSenModesRegsArray[17][3] 2 70001360 - {0x0F12, 0x0002}, //senHal_pContSenModesRegsArray[18][0] 2 70001362 - {0x0F12, 0x046B}, //senHal_pContSenModesRegsArray[18][1] 2 70001364 - {0x0F12, 0x0002}, //senHal_pContSenModesRegsArray[18][2] 2 70001366 - {0x0F12, 0x02A9}, //senHal_pContSenModesRegsArray[18][3] 2 70001368 - {0x0F12, 0x0419}, //senHal_pContSenModesRegsArray[19][0] 2 7000136A - {0x0F12, 0x04A5}, //senHal_pContSenModesRegsArray[19][1] 2 7000136C - {0x0F12, 0x0257}, //senHal_pContSenModesRegsArray[19][2] 2 7000136E - {0x0F12, 0x02E3}, //senHal_pContSenModesRegsArray[19][3] 2 70001370 - {0x0F12, 0x0630}, //senHal_pContSenModesRegsArray[20][0] 2 70001372 - {0x0F12, 0x063C}, //senHal_pContSenModesRegsArray[20][1] 2 70001374 - {0x0F12, 0x038D}, //senHal_pContSenModesRegsArray[20][2] 2 70001376 - {0x0F12, 0x0399}, //senHal_pContSenModesRegsArray[20][3] 2 70001378 - {0x0F12, 0x0668}, //senHal_pContSenModesRegsArray[21][0] 2 7000137A - {0x0F12, 0x06B3}, //senHal_pContSenModesRegsArray[21][1] 2 7000137C - {0x0F12, 0x03C5}, //senHal_pContSenModesRegsArray[21][2] 2 7000137E - {0x0F12, 0x0410}, //senHal_pContSenModesRegsArray[21][3] 2 70001380 - {0x0F12, 0x0001}, //senHal_pContSenModesRegsArray[22][0] 2 70001382 - {0x0F12, 0x0001}, //senHal_pContSenModesRegsArray[22][1] 2 70001384 - {0x0F12, 0x0001}, //senHal_pContSenModesRegsArray[22][2] 2 70001386 - {0x0F12, 0x0001}, //senHal_pContSenModesRegsArray[22][3] 2 70001388 - {0x0F12, 0x03A2}, //senHal_pContSenModesRegsArray[23][0] 2 7000138A - {0x0F12, 0x01D3}, //senHal_pContSenModesRegsArray[23][1] 2 7000138C - {0x0F12, 0x01E0}, //senHal_pContSenModesRegsArray[23][2] 2 7000138E - {0x0F12, 0x00F2}, //senHal_pContSenModesRegsArray[23][3] 2 70001390 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[24][0] 2 70001392 - {0x0F12, 0x0461}, //senHal_pContSenModesRegsArray[24][1] 2 70001394 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[24][2] 2 70001396 - {0x0F12, 0x029F}, //senHal_pContSenModesRegsArray[24][3] 2 70001398 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[25][0] 2 7000139A - {0x0F12, 0x063C}, //senHal_pContSenModesRegsArray[25][1] 2 7000139C - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[25][2] 2 7000139E - {0x0F12, 0x0399}, //senHal_pContSenModesRegsArray[25][3] 2 700013A0 - {0x0F12, 0x003D}, //senHal_pContSenModesRegsArray[26][0] 2 700013A2 - {0x0F12, 0x003D}, //senHal_pContSenModesRegsArray[26][1] 2 700013A4 - {0x0F12, 0x003D}, //senHal_pContSenModesRegsArray[26][2] 2 700013A6 - {0x0F12, 0x003D}, //senHal_pContSenModesRegsArray[26][3] 2 700013A8 - {0x0F12, 0x01D0}, //senHal_pContSenModesRegsArray[27][0] 2 700013AA - {0x0F12, 0x01D0}, //senHal_pContSenModesRegsArray[27][1] 2 700013AC - {0x0F12, 0x00EF}, //senHal_pContSenModesRegsArray[27][2] 2 700013AE - {0x0F12, 0x00EF}, //senHal_pContSenModesRegsArray[27][3] 2 700013B0 - {0x0F12, 0x020C}, //senHal_pContSenModesRegsArray[28][0] 2 700013B2 - {0x0F12, 0x024B}, //senHal_pContSenModesRegsArray[28][1] 2 700013B4 - {0x0F12, 0x012B}, //senHal_pContSenModesRegsArray[28][2] 2 700013B6 - {0x0F12, 0x016A}, //senHal_pContSenModesRegsArray[28][3] 2 700013B8 - {0x0F12, 0x039F}, //senHal_pContSenModesRegsArray[29][0] 2 700013BA - {0x0F12, 0x045E}, //senHal_pContSenModesRegsArray[29][1] 2 700013BC - {0x0F12, 0x01DD}, //senHal_pContSenModesRegsArray[29][2] 2 700013BE - {0x0F12, 0x029C}, //senHal_pContSenModesRegsArray[29][3] 2 700013C0 - {0x0F12, 0x041A}, //senHal_pContSenModesRegsArray[30][0] 2 700013C2 - {0x0F12, 0x04A6}, //senHal_pContSenModesRegsArray[30][1] 2 700013C4 - {0x0F12, 0x0258}, //senHal_pContSenModesRegsArray[30][2] 2 700013C6 - {0x0F12, 0x02E4}, //senHal_pContSenModesRegsArray[30][3] 2 700013C8 - {0x0F12, 0x062D}, //senHal_pContSenModesRegsArray[31][0] 2 700013CA - {0x0F12, 0x0639}, //senHal_pContSenModesRegsArray[31][1] 2 700013CC - {0x0F12, 0x038A}, //senHal_pContSenModesRegsArray[31][2] 2 700013CE - {0x0F12, 0x0396}, //senHal_pContSenModesRegsArray[31][3] 2 700013D0 - {0x0F12, 0x0669}, //senHal_pContSenModesRegsArray[32][0] 2 700013D2 - {0x0F12, 0x06B4}, //senHal_pContSenModesRegsArray[32][1] 2 700013D4 - {0x0F12, 0x03C6}, //senHal_pContSenModesRegsArray[32][2] 2 700013D6 - {0x0F12, 0x0411}, //senHal_pContSenModesRegsArray[32][3] 2 700013D8 - {0x0F12, 0x087C}, //senHal_pContSenModesRegsArray[33][0] 2 700013DA - {0x0F12, 0x08C7}, //senHal_pContSenModesRegsArray[33][1] 2 700013DC - {0x0F12, 0x04F8}, //senHal_pContSenModesRegsArray[33][2] 2 700013DE - {0x0F12, 0x0543}, //senHal_pContSenModesRegsArray[33][3] 2 700013E0 - {0x0F12, 0x0040}, //senHal_pContSenModesRegsArray[34][0] 2 700013E2 - {0x0F12, 0x0040}, //senHal_pContSenModesRegsArray[34][1] 2 700013E4 - {0x0F12, 0x0040}, //senHal_pContSenModesRegsArray[34][2] 2 700013E6 - {0x0F12, 0x0040}, //senHal_pContSenModesRegsArray[34][3] 2 700013E8 - {0x0F12, 0x01D0}, //senHal_pContSenModesRegsArray[35][0] 2 700013EA - {0x0F12, 0x01D0}, //senHal_pContSenModesRegsArray[35][1] 2 700013EC - {0x0F12, 0x00EF}, //senHal_pContSenModesRegsArray[35][2] 2 700013EE - {0x0F12, 0x00EF}, //senHal_pContSenModesRegsArray[35][3] 2 700013F0 - {0x0F12, 0x020F}, //senHal_pContSenModesRegsArray[36][0] 2 700013F2 - {0x0F12, 0x024E}, //senHal_pContSenModesRegsArray[36][1] 2 700013F4 - {0x0F12, 0x012E}, //senHal_pContSenModesRegsArray[36][2] 2 700013F6 - {0x0F12, 0x016D}, //senHal_pContSenModesRegsArray[36][3] 2 700013F8 - {0x0F12, 0x039F}, //senHal_pContSenModesRegsArray[37][0] 2 700013FA - {0x0F12, 0x045E}, //senHal_pContSenModesRegsArray[37][1] 2 700013FC - {0x0F12, 0x01DD}, //senHal_pContSenModesRegsArray[37][2] 2 700013FE - {0x0F12, 0x029C}, //senHal_pContSenModesRegsArray[37][3] 2 70001400 - {0x0F12, 0x041D}, //senHal_pContSenModesRegsArray[38][0] 2 70001402 - {0x0F12, 0x04A9}, //senHal_pContSenModesRegsArray[38][1] 2 70001404 - {0x0F12, 0x025B}, //senHal_pContSenModesRegsArray[38][2] 2 70001406 - {0x0F12, 0x02E7}, //senHal_pContSenModesRegsArray[38][3] 2 70001408 - {0x0F12, 0x062D}, //senHal_pContSenModesRegsArray[39][0] 2 7000140A - {0x0F12, 0x0639}, //senHal_pContSenModesRegsArray[39][1] 2 7000140C - {0x0F12, 0x038A}, //senHal_pContSenModesRegsArray[39][2] 2 7000140E - {0x0F12, 0x0396}, //senHal_pContSenModesRegsArray[39][3] 2 70001410 - {0x0F12, 0x066C}, //senHal_pContSenModesRegsArray[40][0] 2 70001412 - {0x0F12, 0x06B7}, //senHal_pContSenModesRegsArray[40][1] 2 70001414 - {0x0F12, 0x03C9}, //senHal_pContSenModesRegsArray[40][2] 2 70001416 - {0x0F12, 0x0414}, //senHal_pContSenModesRegsArray[40][3] 2 70001418 - {0x0F12, 0x087C}, //senHal_pContSenModesRegsArray[41][0] 2 7000141A - {0x0F12, 0x08C7}, //senHal_pContSenModesRegsArray[41][1] 2 7000141C - {0x0F12, 0x04F8}, //senHal_pContSenModesRegsArray[41][2] 2 7000141E - {0x0F12, 0x0543}, //senHal_pContSenModesRegsArray[41][3] 2 70001420 - {0x0F12, 0x0040}, //senHal_pContSenModesRegsArray[42][0] 2 70001422 - {0x0F12, 0x0040}, //senHal_pContSenModesRegsArray[42][1] 2 70001424 - {0x0F12, 0x0040}, //senHal_pContSenModesRegsArray[42][2] 2 70001426 - {0x0F12, 0x0040}, //senHal_pContSenModesRegsArray[42][3] 2 70001428 - {0x0F12, 0x01D0}, //senHal_pContSenModesRegsArray[43][0] 2 7000142A - {0x0F12, 0x01D0}, //senHal_pContSenModesRegsArray[43][1] 2 7000142C - {0x0F12, 0x00EF}, //senHal_pContSenModesRegsArray[43][2] 2 7000142E - {0x0F12, 0x00EF}, //senHal_pContSenModesRegsArray[43][3] 2 70001430 - {0x0F12, 0x020F}, //senHal_pContSenModesRegsArray[44][0] 2 70001432 - {0x0F12, 0x024E}, //senHal_pContSenModesRegsArray[44][1] 2 70001434 - {0x0F12, 0x012E}, //senHal_pContSenModesRegsArray[44][2] 2 70001436 - {0x0F12, 0x016D}, //senHal_pContSenModesRegsArray[44][3] 2 70001438 - {0x0F12, 0x039F}, //senHal_pContSenModesRegsArray[45][0] 2 7000143A - {0x0F12, 0x045E}, //senHal_pContSenModesRegsArray[45][1] 2 7000143C - {0x0F12, 0x01DD}, //senHal_pContSenModesRegsArray[45][2] 2 7000143E - {0x0F12, 0x029C}, //senHal_pContSenModesRegsArray[45][3] 2 70001440 - {0x0F12, 0x041D}, //senHal_pContSenModesRegsArray[46][0] 2 70001442 - {0x0F12, 0x04A9}, //senHal_pContSenModesRegsArray[46][1] 2 70001444 - {0x0F12, 0x025B}, //senHal_pContSenModesRegsArray[46][2] 2 70001446 - {0x0F12, 0x02E7}, //senHal_pContSenModesRegsArray[46][3] 2 70001448 - {0x0F12, 0x062D}, //senHal_pContSenModesRegsArray[47][0] 2 7000144A - {0x0F12, 0x0639}, //senHal_pContSenModesRegsArray[47][1] 2 7000144C - {0x0F12, 0x038A}, //senHal_pContSenModesRegsArray[47][2] 2 7000144E - {0x0F12, 0x0396}, //senHal_pContSenModesRegsArray[47][3] 2 70001450 - {0x0F12, 0x066C}, //senHal_pContSenModesRegsArray[48][0] 2 70001452 - {0x0F12, 0x06B7}, //senHal_pContSenModesRegsArray[48][1] 2 70001454 - {0x0F12, 0x03C9}, //senHal_pContSenModesRegsArray[48][2] 2 70001456 - {0x0F12, 0x0414}, //senHal_pContSenModesRegsArray[48][3] 2 70001458 - {0x0F12, 0x087C}, //senHal_pContSenModesRegsArray[49][0] 2 7000145A - {0x0F12, 0x08C7}, //senHal_pContSenModesRegsArray[49][1] 2 7000145C - {0x0F12, 0x04F8}, //senHal_pContSenModesRegsArray[49][2] 2 7000145E - {0x0F12, 0x0543}, //senHal_pContSenModesRegsArray[49][3] 2 70001460 - {0x0F12, 0x003D}, //senHal_pContSenModesRegsArray[50][0] 2 70001462 - {0x0F12, 0x003D}, //senHal_pContSenModesRegsArray[50][1] 2 70001464 - {0x0F12, 0x003D}, //senHal_pContSenModesRegsArray[50][2] 2 70001466 - {0x0F12, 0x003D}, //senHal_pContSenModesRegsArray[50][3] 2 70001468 - {0x0F12, 0x01D2}, //senHal_pContSenModesRegsArray[51][0] 2 7000146A - {0x0F12, 0x01D2}, //senHal_pContSenModesRegsArray[51][1] 2 7000146C - {0x0F12, 0x00F1}, //senHal_pContSenModesRegsArray[51][2] 2 7000146E - {0x0F12, 0x00F1}, //senHal_pContSenModesRegsArray[51][3] 2 70001470 - {0x0F12, 0x020C}, //senHal_pContSenModesRegsArray[52][0] 2 70001472 - {0x0F12, 0x024B}, //senHal_pContSenModesRegsArray[52][1] 2 70001474 - {0x0F12, 0x012B}, //senHal_pContSenModesRegsArray[52][2] 2 70001476 - {0x0F12, 0x016A}, //senHal_pContSenModesRegsArray[52][3] 2 70001478 - {0x0F12, 0x03A1}, //senHal_pContSenModesRegsArray[53][0] 2 7000147A - {0x0F12, 0x0460}, //senHal_pContSenModesRegsArray[53][1] 2 7000147C - {0x0F12, 0x01DF}, //senHal_pContSenModesRegsArray[53][2] 2 7000147E - {0x0F12, 0x029E}, //senHal_pContSenModesRegsArray[53][3] 2 70001480 - {0x0F12, 0x041A}, //senHal_pContSenModesRegsArray[54][0] 2 70001482 - {0x0F12, 0x04A6}, //senHal_pContSenModesRegsArray[54][1] 2 70001484 - {0x0F12, 0x0258}, //senHal_pContSenModesRegsArray[54][2] 2 70001486 - {0x0F12, 0x02E4}, //senHal_pContSenModesRegsArray[54][3] 2 70001488 - {0x0F12, 0x062F}, //senHal_pContSenModesRegsArray[55][0] 2 7000148A - {0x0F12, 0x063B}, //senHal_pContSenModesRegsArray[55][1] 2 7000148C - {0x0F12, 0x038C}, //senHal_pContSenModesRegsArray[55][2] 2 7000148E - {0x0F12, 0x0398}, //senHal_pContSenModesRegsArray[55][3] 2 70001490 - {0x0F12, 0x0669}, //senHal_pContSenModesRegsArray[56][0] 2 70001492 - {0x0F12, 0x06B4}, //senHal_pContSenModesRegsArray[56][1] 2 70001494 - {0x0F12, 0x03C6}, //senHal_pContSenModesRegsArray[56][2] 2 70001496 - {0x0F12, 0x0411}, //senHal_pContSenModesRegsArray[56][3] 2 70001498 - {0x0F12, 0x087E}, //senHal_pContSenModesRegsArray[57][0] 2 7000149A - {0x0F12, 0x08C9}, //senHal_pContSenModesRegsArray[57][1] 2 7000149C - {0x0F12, 0x04FA}, //senHal_pContSenModesRegsArray[57][2] 2 7000149E - {0x0F12, 0x0545}, //senHal_pContSenModesRegsArray[57][3] 2 700014A0 - {0x0F12, 0x03A2}, //senHal_pContSenModesRegsArray[58][0] 2 700014A2 - {0x0F12, 0x01D3}, //senHal_pContSenModesRegsArray[58][1] 2 700014A4 - {0x0F12, 0x01E0}, //senHal_pContSenModesRegsArray[58][2] 2 700014A6 - {0x0F12, 0x00F2}, //senHal_pContSenModesRegsArray[58][3] 2 700014A8 - {0x0F12, 0x03AF}, //senHal_pContSenModesRegsArray[59][0] 2 700014AA - {0x0F12, 0x01E0}, //senHal_pContSenModesRegsArray[59][1] 2 700014AC - {0x0F12, 0x01ED}, //senHal_pContSenModesRegsArray[59][2] 2 700014AE - {0x0F12, 0x00FF}, //senHal_pContSenModesRegsArray[59][3] 2 700014B0 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[60][0] 2 700014B2 - {0x0F12, 0x0461}, //senHal_pContSenModesRegsArray[60][1] 2 700014B4 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[60][2] 2 700014B6 - {0x0F12, 0x029F}, //senHal_pContSenModesRegsArray[60][3] 2 700014B8 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[61][0] 2 700014BA - {0x0F12, 0x046E}, //senHal_pContSenModesRegsArray[61][1] 2 700014BC - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[61][2] 2 700014BE - {0x0F12, 0x02AC}, //senHal_pContSenModesRegsArray[61][3] 2 700014C0 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[62][0] 2 700014C2 - {0x0F12, 0x063C}, //senHal_pContSenModesRegsArray[62][1] 2 700014C4 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[62][2] 2 700014C6 - {0x0F12, 0x0399}, //senHal_pContSenModesRegsArray[62][3] 2 700014C8 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[63][0] 2 700014CA - {0x0F12, 0x0649}, //senHal_pContSenModesRegsArray[63][1] 2 700014CC - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[63][2] 2 700014CE - {0x0F12, 0x03A6}, //senHal_pContSenModesRegsArray[63][3] 2 700014D0 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[64][0] 2 700014D2 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[64][1] 2 700014D4 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[64][2] 2 700014D6 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[64][3] 2 700014D8 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[65][0] 2 700014DA - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[65][1] 2 700014DC - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[65][2] 2 700014DE - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[65][3] 2 700014E0 - {0x0F12, 0x03AA}, //senHal_pContSenModesRegsArray[66][0] 2 700014E2 - {0x0F12, 0x01DB}, //senHal_pContSenModesRegsArray[66][1] 2 700014E4 - {0x0F12, 0x01E8}, //senHal_pContSenModesRegsArray[66][2] 2 700014E6 - {0x0F12, 0x00FA}, //senHal_pContSenModesRegsArray[66][3] 2 700014E8 - {0x0F12, 0x03B7}, //senHal_pContSenModesRegsArray[67][0] 2 700014EA - {0x0F12, 0x01E8}, //senHal_pContSenModesRegsArray[67][1] 2 700014EC - {0x0F12, 0x01F5}, //senHal_pContSenModesRegsArray[67][2] 2 700014EE - {0x0F12, 0x0107}, //senHal_pContSenModesRegsArray[67][3] 2 700014F0 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[68][0] 2 700014F2 - {0x0F12, 0x0469}, //senHal_pContSenModesRegsArray[68][1] 2 700014F4 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[68][2] 2 700014F6 - {0x0F12, 0x02A7}, //senHal_pContSenModesRegsArray[68][3] 2 700014F8 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[69][0] 2 700014FA - {0x0F12, 0x0476}, //senHal_pContSenModesRegsArray[69][1] 2 700014FC - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[69][2] 2 700014FE - {0x0F12, 0x02B4}, //senHal_pContSenModesRegsArray[69][3] 2 70001500 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[70][0] 2 70001502 - {0x0F12, 0x0644}, //senHal_pContSenModesRegsArray[70][1] 2 70001504 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[70][2] 2 70001506 - {0x0F12, 0x03A1}, //senHal_pContSenModesRegsArray[70][3] 2 70001508 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[71][0] 2 7000150A - {0x0F12, 0x0651}, //senHal_pContSenModesRegsArray[71][1] 2 7000150C - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[71][2] 2 7000150E - {0x0F12, 0x03AE}, //senHal_pContSenModesRegsArray[71][3] 2 70001510 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[72][0] 2 70001512 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[72][1] 2 70001514 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[72][2] 2 70001516 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[72][3] 2 70001518 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[73][0] 2 7000151A - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[73][1] 2 7000151C - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[73][2] 2 7000151E - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[73][3] 2 70001520 - {0x0F12, 0x0001}, //senHal_pContSenModesRegsArray[74][0] 2 70001522 - {0x0F12, 0x0001}, //senHal_pContSenModesRegsArray[74][1] 2 70001524 - {0x0F12, 0x0001}, //senHal_pContSenModesRegsArray[74][2] 2 70001526 - {0x0F12, 0x0001}, //senHal_pContSenModesRegsArray[74][3] 2 70001528 - {0x0F12, 0x000F}, //senHal_pContSenModesRegsArray[75][0] 2 7000152A - {0x0F12, 0x000F}, //senHal_pContSenModesRegsArray[75][1] 2 7000152C - {0x0F12, 0x000F}, //senHal_pContSenModesRegsArray[75][2] 2 7000152E - {0x0F12, 0x000F}, //senHal_pContSenModesRegsArray[75][3] 2 70001530 - {0x0F12, 0x05AD}, //senHal_pContSenModesRegsArray[76][0] 2 70001532 - {0x0F12, 0x03DE}, //senHal_pContSenModesRegsArray[76][1] 2 70001534 - {0x0F12, 0x030A}, //senHal_pContSenModesRegsArray[76][2] 2 70001536 - {0x0F12, 0x021C}, //senHal_pContSenModesRegsArray[76][3] 2 70001538 - {0x0F12, 0x062F}, //senHal_pContSenModesRegsArray[77][0] 2 7000153A - {0x0F12, 0x0460}, //senHal_pContSenModesRegsArray[77][1] 2 7000153C - {0x0F12, 0x038C}, //senHal_pContSenModesRegsArray[77][2] 2 7000153E - {0x0F12, 0x029E}, //senHal_pContSenModesRegsArray[77][3] 2 70001540 - {0x0F12, 0x07FC}, //senHal_pContSenModesRegsArray[78][0] 2 70001542 - {0x0F12, 0x0847}, //senHal_pContSenModesRegsArray[78][1] 2 70001544 - {0x0F12, 0x0478}, //senHal_pContSenModesRegsArray[78][2] 2 70001546 - {0x0F12, 0x04C3}, //senHal_pContSenModesRegsArray[78][3] 2 70001548 - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[79][0] 2 7000154A - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[79][1] 2 7000154C - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[79][2] 2 7000154E - {0x0F12, 0x0000}, //senHal_pContSenModesRegsArray[79][3] 2 70001550 - - - //============================================================ - // AF Interface setting - //============================================================ - {0x0028, 0x7000},//DTS2012071201781: add by huyouhua 00136760 at 2012-7-20 - {0x002A, 0x01D4}, - {0x0F12, 0x0000}, //REG_TC_IPRM_AuxGpios : 0 - no Flash - {0x002A, 0x01DE}, - {0x0F12, 0x0003}, //REG_TC_IPRM_CM_Init_AfModeType : 3 - AFD_VCM_I2C - {0x0F12, 0x0000}, //REG_TC_IPRM_CM_Init_PwmConfig1 : 0 - no PWM - {0x002A, 0x01E4}, - {0x0F12, 0x0041}, //REG_TC_IPRM_CM_Init_GpioConfig1 : 4 - GPIO4 - {0x002A, 0x01E8}, - {0x0F12, 0x2A0C}, //REG_TC_IPRM_CM_Init_Mi2cBits : MSCL - GPIO1 MSDA - GPIO2 Device ID {0C} - {0x0F12, 0x0190}, //REG_TC_IPRM_CM_Init_Mi2cRateKhz : MI2C Speed - 400KHz - //BEGIN: DTS2012071201781: add by huyouhua 00136760 at 2012-7-20 - {0x002A, 0x1196}, //afd_usFlags 0100=low,0000=high - {0x0F12, 0x0000}, - //END: DTS2012071201781: add by huyouhua 00136760 at 2012-7-20 - //============================================================ - // AF Parameter setting - //============================================================ - // AF Window Settings - {0x002A, 0x025A}, - {0x0F12, 0x0100}, //#REG_TC_AF_FstWinStartX - {0x0F12, 0x00E3}, //#REG_TC_AF_FstWinStartY //DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x0200}, //#REG_TC_AF_FstWinSizeX - {0x0F12, 0x0238}, //#REG_TC_AF_FstWinSizeY - {0x0F12, 0x018C}, //#REG_TC_AF_ScndWinStartX - {0x0F12, 0x0166}, //#REG_TC_AF_ScndWinStartY //DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x00E6}, //#REG_TC_AF_ScndWinSizeX - {0x0F12, 0x0132}, //#REG_TC_AF_ScndWinSizeY - {0x0F12, 0x0001}, //#REG_TC_AF_WinSizesUpdated - - // AF Setot Settings - {0x002A, 0x0586}, - {0x0F12, 0x00FF}, //#skl_af_StatOvlpExpFactor - - // AF Scene Settings - {0x002A, 0x115E}, - {0x0F12, 0x0003}, //#af_scene_usSaturatedScene - - // AF Fine Search Settings - {0x002A, 0x10D4}, - {0x0F12, 0x1000}, //FineSearch Disable //#af_search_usSingleAfFlags - {0x002A, 0x10DE}, - {0x0F12, 0x0004}, //#af_search_usFinePeakCount - {0x002A, 0x106C}, - {0x0F12, 0x0202}, //#af_pos_usFineStepNumSize - - // AF Peak Threshold Setting - {0x002A, 0x10CA}, //#af_search_usPeakThr - {0x0F12, 0x00C0}, - - // AF Default Position - {0x002A, 0x1060}, - {0x0F12, 0x003C}, //#af_pos_usHomePos //DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x783C}, //#af_pos_usLowConfPos //DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - - // AF LowConfThr Setting - {0x002A, 0x10F4}, //LowEdgeBoth GRAD - {0x0F12, 0x0280}, - {0x002A, 0x1100}, //LowLight HPF - {0x0F12, 0x03A0}, - {0x0F12, 0x0320}, - - {0x002A, 0x1134}, - {0x0F12, 0x0030},//af_stat_usMinStatVal - - // AF low Br Th - {0x002A, 0x1154}, // normBrThr - {0x0F12, 0x0060}, - - // AF Policy - {0x002A, 0x10E2}, - {0x0F12, 0x0000}, //#af_search_usCapturePolicy: Focus_Priority, 0002 : Shutter_Priority_Fixed, 0001 : Shutter_Priority_Last_BFP 0000: Shutter_Priority_Current - {0x002A, 0x1072}, - {0x0F12, 0x003C}, //#af_pos_usCaptureFixedPo// 0x0008 - - // AF Lens Position Table Settings - {0x002A, 0x1074}, - //BEGIN: DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x0010}, //#af_pos_usTableLastInd// 16 Steps 091222 - {0x0F12, 0x003C}, //#af_pos_usTable_0_// af_pos_usTable - {0x0F12, 0x003F}, //#af_pos_usTable_1_ - {0x0F12, 0x0042}, //#af_pos_usTable_2_ - {0x0F12, 0x0045}, //#af_pos_usTable_3_ - {0x0F12, 0x0048}, //#af_pos_usTable_4_ - {0x0F12, 0x004B}, //#af_pos_usTable_5_ - {0x0F12, 0x004E}, //#af_pos_usTable_6_ - {0x0F12, 0x0051}, //#af_pos_usTable_7_ - {0x0F12, 0x0054}, //#af_pos_usTable_8_ - {0x0F12, 0x0057}, //#af_pos_usTable_9_ - {0x0F12, 0x005A}, //#af_pos_usTable_10_ - {0x0F12, 0x005E}, //#af_pos_usTable_11_ - {0x0F12, 0x0061}, //#af_pos_usTable_12_ - {0x0F12, 0x0064}, //#af_pos_usTable_13_ - {0x0F12, 0x0068}, //#af_pos_usTable_14_ - {0x0F12, 0x006C}, //#af_pos_usTable_15_ - {0x0F12, 0x0078}, //#af_pos_usTable_16_ - //END: DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x002A, 0x0252}, - {0x0F12, 0x0003}, //init - //BEGIN: DTS2012071201781: del by huyouhua 00136760 at 2012-7-20 - //{0x002A, 0x12B8}, //disable CINTR 0 - //{0x0F12, 0x1000}, - //END: DTS2012071201781: del by huyouhua 00136760 at 2012-7-20 - //============================================================ - // ISP-FE Setting - //============================================================ - {0x002A, 0x158A}, - {0x0F12, 0xEAF0}, - {0x002A, 0x15C6}, - {0x0F12, 0x0020}, - {0x0F12, 0x0060}, - {0x002A, 0x15BC}, - {0x0F12, 0x0200}, - - {0x002A, 0x1608}, - {0x0F12, 0x0100}, - {0x0F12, 0x0100}, - {0x0F12, 0x0100}, - {0x0F12, 0x0100}, - //BEGIN: DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x002A, 0x0530}, - {0x0F12, 0x5DC0}, //#lt_uMaxExp1 60ms - {0x0F12, 0x0000}, - {0x0F12, 0x6D60}, //#lt_uMaxExp2 70ms - {0x0F12, 0x0000}, - {0x002A, 0x167C}, - {0x0F12, 0x9C40}, //#evt1_lt_uMaxExp3 100ms - {0x0F12, 0x0000}, - {0x0F12, 0x3880},//BB80 //#evt1_lt_uMaxExp4 120ms - {0x0F12, 0x0001},//0000 - // Set capture exposure time - {0x002A, 0x0538}, - {0x0F12, 0x5DC0}, //#lt_uCapMaxExp160ms - {0x0F12, 0x0000}, - {0x0F12, 0x6D60}, //#lt_uCapMaxExp270ms - {0x0F12, 0x0000}, - {0x002A, 0x1684}, - {0x0F12, 0x9C40}, //#evt1_lt_uCapMaxExp3 100ms - {0x0F12, 0x0000}, - {0x0F12, 0xBB80}, //#evt1_lt_uCapMaxExp4 120ms - {0x0F12, 0x0000}, - // Set gain - {0x002A, 0x0540}, - {0x0F12, 0x0150}, //#lt_uMaxAnGain1 - {0x0F12, 0x0280}, //#lt_uMaxAnGain2 - {0x002A, 0x168C}, - {0x0F12, 0x02A0}, //#evt1_lt_uMaxAnGain3 - {0x0F12, 0x0800}, //#evt1_lt_uMaxAnGain4 - - {0x002A, 0x0544}, - {0x0F12, 0x0100}, //#lt_uMaxDigGain - {0x0F12, 0x0A00}, //#lt_uMaxTotGain - - {0x002A, 1694}, - {0x0F12, 0001}, //#evt1_senHal_bExpandForbid //expand forbidde zone - - //002A 051A - //0F12 0111 //#lt_uLimitHigh - //0F12 00F0 //#lt_uLimitLow - - //============================================================ - //Tuning part - //============================================================ - //Calibrations go here - //============================================================ - //Anti-Shading - //============================================================ - // param_start TVAR_ash_GASAlpha - {0x0028, 0x7000}, - {0x002A, 0x06CE}, - {0x0F12, 0x00FE}, //TVAR_ash_GASAlpha[0] - {0x0F12, 0x00E0}, //TVAR_ash_GASAlpha[1] - {0x0F12, 0x00F0}, //TVAR_ash_GASAlpha[2] - {0x0F12, 0x00FE}, //TVAR_ash_GASAlpha[3] - {0x0F12, 0x00F0}, //TVAR_ash_GASAlpha[4] - {0x0F12, 0x00E0}, //TVAR_ash_GASAlpha[5] - {0x0F12, 0x00C0}, //TVAR_ash_GASAlpha[6] - {0x0F12, 0x00E0}, //TVAR_ash_GASAlpha[7] - {0x0F12, 0x00EF}, //TVAR_ash_GASAlpha[8] - {0x0F12, 0x00FF}, //TVAR_ash_GASAlpha[9] - {0x0F12, 0x00F9}, //TVAR_ash_GASAlpha[10] - {0x0F12, 0x00E0}, //TVAR_ash_GASAlpha[11] - {0x0F12, 0x00CE}, //TVAR_ash_GASAlpha[12] - {0x0F12, 0x00FF}, //TVAR_ash_GASAlpha[13] - {0x0F12, 0x0100}, //TVAR_ash_GASAlpha[14] - {0x0F12, 0x00E0}, //TVAR_ash_GASAlpha[15] - {0x0F12, 0x00DF}, //TVAR_ash_GASAlpha[16] - {0x0F12, 0x00F4}, //TVAR_ash_GASAlpha[17] - {0x0F12, 0x00F3}, //TVAR_ash_GASAlpha[18] - {0x0F12, 0x00F5}, //TVAR_ash_GASAlpha[19] - {0x0F12, 0x00E0}, //TVAR_ash_GASAlpha[20] - {0x0F12, 0x00E9}, //TVAR_ash_GASAlpha[21] - {0x0F12, 0x00E6}, //TVAR_ash_GASAlpha[22] - {0x0F12, 0x00F6}, //TVAR_ash_GASAlpha[23] - {0x0F12, 0x00CE}, //TVAR_ash_GASAlpha[24] - {0x0F12, 0x00E9}, //TVAR_ash_GASAlpha[25] - {0x0F12, 0x00E6}, //TVAR_ash_GASAlpha[26] - {0x0F12, 0x00F6}, //TVAR_ash_GASAlpha[27] - // param_end TVAR_ash_GASAlpha - // param_start TVAR_ash_GASOutdoorAlpha - {0x002A, 0x0706}, - {0x0F12, 0x00E4}, //TVAR_ash_GASOutdoorAlpha[0] - {0x0F12, 0x00E9}, //TVAR_ash_GASOutdoorAlpha[1] - {0x0F12, 0x00E6}, //TVAR_ash_GASOutdoorAlpha[2] - {0x0F12, 0x00F6}, //TVAR_ash_GASOutdoorAlpha[3] - // param_end TVAR_ash_GASOutdoorAlpha - // param_start ash_GASBeta - {0x002A, 0x070E}, - {0x0F12, 0x0060}, //ash_GASBeta[0] - {0x0F12, 0x002B}, //ash_GASBeta[1] - {0x0F12, 0x002F}, //ash_GASBeta[2] - {0x0F12, 0x0000}, //ash_GASBeta[3] - {0x0F12, 0x0052}, //ash_GASBeta[4] - {0x0F12, 0x0026}, //ash_GASBeta[5] - {0x0F12, 0x0029}, //ash_GASBeta[6] - {0x0F12, 0x0000}, //ash_GASBeta[7] - {0x0F12, 0x0010}, //ash_GASBeta[8] - {0x0F12, 0x0026}, //ash_GASBeta[9] - {0x0F12, 0x0028}, //ash_GASBeta[10] - {0x0F12, 0x0000}, //ash_GASBeta[11] - {0x0F12, 0x0010}, //ash_GASBeta[12] - {0x0F12, 0x0026}, //ash_GASBeta[13] - {0x0F12, 0x0027}, //ash_GASBeta[14] - {0x0F12, 0x0000}, //ash_GASBeta[15] - {0x0F12, 0x0023}, //ash_GASBeta[16] - {0x0F12, 0x001F}, //ash_GASBeta[17] - {0x0F12, 0x001F}, //ash_GASBeta[18] - {0x0F12, 0x0000}, //ash_GASBeta[19] - {0x0F12, 0x0025}, //ash_GASBeta[20] - {0x0F12, 0x0017}, //ash_GASBeta[21] - {0x0F12, 0x0016}, //ash_GASBeta[22] - {0x0F12, 0x0000}, //ash_GASBeta[23] - {0x0F12, 0x0025}, //ash_GASBeta[24] - {0x0F12, 0x0017}, //ash_GASBeta[25] - {0x0F12, 0x0016}, //ash_GASBeta[26] - {0x0F12, 0x0000}, //ash_GASBeta[27] - // param_end ash_GASBeta - // param_start ash_GASOutdoorBeta - {0x002A, 0x0746}, - {0x0F12, 0x0025}, //ash_GASOutdoorBeta[0] - {0x0F12, 0x0017}, //ash_GASOutdoorBeta[1] - {0x0F12, 0x0016}, //ash_GASOutdoorBeta[2] - {0x0F12, 0x0000}, //ash_GASOutdoorBeta[3] - // param_end ash_GASOutdoorBeta - {0x002A, 0x075A}, - {0x0F12, 0x0000}, //ash_bParabolicEstimation - {0x0F12, 0x0400}, //ash_uParabolicCenterX - {0x0F12, 0x0300}, //ash_uParabolicCenterY - {0x0F12, 0x0010}, //ash_uParabolicScalingA - {0x0F12, 0x0011}, //ash_uParabolicScalingB - // param_start TVAR_ash_pGAS - {0x002A, 0x347C}, - {0x0F12, 0x025B}, //TVAR_ash_pGAS[0] - {0x0F12, 0x01B4}, //TVAR_ash_pGAS[1] - {0x0F12, 0x0156}, //TVAR_ash_pGAS[2] - {0x0F12, 0x0112}, //TVAR_ash_pGAS[3] - {0x0F12, 0x00EE}, //TVAR_ash_pGAS[4] - {0x0F12, 0x00D8}, //TVAR_ash_pGAS[5] - {0x0F12, 0x00CE}, //TVAR_ash_pGAS[6] - {0x0F12, 0x00D4}, //TVAR_ash_pGAS[7] - {0x0F12, 0x00E6}, //TVAR_ash_pGAS[8] - {0x0F12, 0x010B}, //TVAR_ash_pGAS[9] - {0x0F12, 0x0141}, //TVAR_ash_pGAS[10] - {0x0F12, 0x019F}, //TVAR_ash_pGAS[11] - {0x0F12, 0x027A}, //TVAR_ash_pGAS[12] - {0x0F12, 0x01CD}, //TVAR_ash_pGAS[13] - {0x0F12, 0x0174}, //TVAR_ash_pGAS[14] - {0x0F12, 0x0115}, //TVAR_ash_pGAS[15] - {0x0F12, 0x00D8}, //TVAR_ash_pGAS[16] - {0x0F12, 0x00B2}, //TVAR_ash_pGAS[17] - {0x0F12, 0x009C}, //TVAR_ash_pGAS[18] - {0x0F12, 0x0092}, //TVAR_ash_pGAS[19] - {0x0F12, 0x009A}, //TVAR_ash_pGAS[20] - {0x0F12, 0x00B0}, //TVAR_ash_pGAS[21] - {0x0F12, 0x00D9}, //TVAR_ash_pGAS[22] - {0x0F12, 0x0111}, //TVAR_ash_pGAS[23] - {0x0F12, 0x015F}, //TVAR_ash_pGAS[24] - {0x0F12, 0x01DD}, //TVAR_ash_pGAS[25] - {0x0F12, 0x0176}, //TVAR_ash_pGAS[26] - {0x0F12, 0x0128}, //TVAR_ash_pGAS[27] - {0x0F12, 0x00D1}, //TVAR_ash_pGAS[28] - {0x0F12, 0x0097}, //TVAR_ash_pGAS[29] - {0x0F12, 0x006F}, //TVAR_ash_pGAS[30] - {0x0F12, 0x0056}, //TVAR_ash_pGAS[31] - {0x0F12, 0x004D}, //TVAR_ash_pGAS[32] - {0x0F12, 0x0057}, //TVAR_ash_pGAS[33] - {0x0F12, 0x0073}, //TVAR_ash_pGAS[34] - {0x0F12, 0x009E}, //TVAR_ash_pGAS[35] - {0x0F12, 0x00D9}, //TVAR_ash_pGAS[36] - {0x0F12, 0x0122}, //TVAR_ash_pGAS[37] - {0x0F12, 0x0173}, //TVAR_ash_pGAS[38] - {0x0F12, 0x0144}, //TVAR_ash_pGAS[39] - {0x0F12, 0x00FE}, //TVAR_ash_pGAS[40] - {0x0F12, 0x00A9}, //TVAR_ash_pGAS[41] - {0x0F12, 0x006F}, //TVAR_ash_pGAS[42] - {0x0F12, 0x0043}, //TVAR_ash_pGAS[43] - {0x0F12, 0x0028}, //TVAR_ash_pGAS[44] - {0x0F12, 0x001F}, //TVAR_ash_pGAS[45] - {0x0F12, 0x002A}, //TVAR_ash_pGAS[46] - {0x0F12, 0x0049}, //TVAR_ash_pGAS[47] - {0x0F12, 0x0079}, //TVAR_ash_pGAS[48] - {0x0F12, 0x00B6}, //TVAR_ash_pGAS[49] - {0x0F12, 0x0102}, //TVAR_ash_pGAS[50] - {0x0F12, 0x014F}, //TVAR_ash_pGAS[51] - {0x0F12, 0x012D}, //TVAR_ash_pGAS[52] - {0x0F12, 0x00E7}, //TVAR_ash_pGAS[53] - {0x0F12, 0x0094}, //TVAR_ash_pGAS[54] - {0x0F12, 0x0056}, //TVAR_ash_pGAS[55] - {0x0F12, 0x0028}, //TVAR_ash_pGAS[56] - {0x0F12, 0x000E}, //TVAR_ash_pGAS[57] - {0x0F12, 0x0007}, //TVAR_ash_pGAS[58] - {0x0F12, 0x0011}, //TVAR_ash_pGAS[59] - {0x0F12, 0x0030}, //TVAR_ash_pGAS[60] - {0x0F12, 0x0063}, //TVAR_ash_pGAS[61] - {0x0F12, 0x00A6}, //TVAR_ash_pGAS[62] - {0x0F12, 0x00F2}, //TVAR_ash_pGAS[63] - {0x0F12, 0x013D}, //TVAR_ash_pGAS[64] - {0x0F12, 0x0126}, //TVAR_ash_pGAS[65] - {0x0F12, 0x00E1}, //TVAR_ash_pGAS[66] - {0x0F12, 0x008D}, //TVAR_ash_pGAS[67] - {0x0F12, 0x004E}, //TVAR_ash_pGAS[68] - {0x0F12, 0x0022}, //TVAR_ash_pGAS[69] - {0x0F12, 0x0007}, //TVAR_ash_pGAS[70] - {0x0F12, 0x0000}, //TVAR_ash_pGAS[71] - {0x0F12, 0x000A}, //TVAR_ash_pGAS[72] - {0x0F12, 0x0028}, //TVAR_ash_pGAS[73] - {0x0F12, 0x005E}, //TVAR_ash_pGAS[74] - {0x0F12, 0x00A3}, //TVAR_ash_pGAS[75] - {0x0F12, 0x00F0}, //TVAR_ash_pGAS[76] - {0x0F12, 0x013B}, //TVAR_ash_pGAS[77] - {0x0F12, 0x0133}, //TVAR_ash_pGAS[78] - {0x0F12, 0x00EE}, //TVAR_ash_pGAS[79] - {0x0F12, 0x0099}, //TVAR_ash_pGAS[80] - {0x0F12, 0x005A}, //TVAR_ash_pGAS[81] - {0x0F12, 0x002D}, //TVAR_ash_pGAS[82] - {0x0F12, 0x0013}, //TVAR_ash_pGAS[83] - {0x0F12, 0x000B}, //TVAR_ash_pGAS[84] - {0x0F12, 0x0016}, //TVAR_ash_pGAS[85] - {0x0F12, 0x0035}, //TVAR_ash_pGAS[86] - {0x0F12, 0x006C}, //TVAR_ash_pGAS[87] - {0x0F12, 0x00B2}, //TVAR_ash_pGAS[88] - {0x0F12, 0x0100}, //TVAR_ash_pGAS[89] - {0x0F12, 0x0148}, //TVAR_ash_pGAS[90] - {0x0F12, 0x0153}, //TVAR_ash_pGAS[91] - {0x0F12, 0x0107}, //TVAR_ash_pGAS[92] - {0x0F12, 0x00B4}, //TVAR_ash_pGAS[93] - {0x0F12, 0x0078}, //TVAR_ash_pGAS[94] - {0x0F12, 0x004B}, //TVAR_ash_pGAS[95] - {0x0F12, 0x0030}, //TVAR_ash_pGAS[96] - {0x0F12, 0x002A}, //TVAR_ash_pGAS[97] - {0x0F12, 0x0036}, //TVAR_ash_pGAS[98] - {0x0F12, 0x0057}, //TVAR_ash_pGAS[99] - {0x0F12, 0x008B}, //TVAR_ash_pGAS[100] - {0x0F12, 0x00D1}, //TVAR_ash_pGAS[101] - {0x0F12, 0x0121}, //TVAR_ash_pGAS[102] - {0x0F12, 0x016A}, //TVAR_ash_pGAS[103] - {0x0F12, 0x0189}, //TVAR_ash_pGAS[104] - {0x0F12, 0x0138}, //TVAR_ash_pGAS[105] - {0x0F12, 0x00DF}, //TVAR_ash_pGAS[106] - {0x0F12, 0x00A8}, //TVAR_ash_pGAS[107] - {0x0F12, 0x007E}, //TVAR_ash_pGAS[108] - {0x0F12, 0x0065}, //TVAR_ash_pGAS[109] - {0x0F12, 0x005F}, //TVAR_ash_pGAS[110] - {0x0F12, 0x006A}, //TVAR_ash_pGAS[111] - {0x0F12, 0x008C}, //TVAR_ash_pGAS[112] - {0x0F12, 0x00BF}, //TVAR_ash_pGAS[113] - {0x0F12, 0x00FE}, //TVAR_ash_pGAS[114] - {0x0F12, 0x0150}, //TVAR_ash_pGAS[115] - {0x0F12, 0x019E}, //TVAR_ash_pGAS[116] - {0x0F12, 0x01D5}, //TVAR_ash_pGAS[117] - {0x0F12, 0x0181}, //TVAR_ash_pGAS[118] - {0x0F12, 0x0125}, //TVAR_ash_pGAS[119] - {0x0F12, 0x00EA}, //TVAR_ash_pGAS[120] - {0x0F12, 0x00C7}, //TVAR_ash_pGAS[121] - {0x0F12, 0x00B2}, //TVAR_ash_pGAS[122] - {0x0F12, 0x00AC}, //TVAR_ash_pGAS[123] - {0x0F12, 0x00BA}, //TVAR_ash_pGAS[124] - {0x0F12, 0x00D5}, //TVAR_ash_pGAS[125] - {0x0F12, 0x0100}, //TVAR_ash_pGAS[126] - {0x0F12, 0x0140}, //TVAR_ash_pGAS[127] - {0x0F12, 0x019B}, //TVAR_ash_pGAS[128] - {0x0F12, 0x0217}, //TVAR_ash_pGAS[129] - {0x0F12, 0x0280}, //TVAR_ash_pGAS[130] - {0x0F12, 0x01CC}, //TVAR_ash_pGAS[131] - {0x0F12, 0x0176}, //TVAR_ash_pGAS[132] - {0x0F12, 0x0131}, //TVAR_ash_pGAS[133] - {0x0F12, 0x010E}, //TVAR_ash_pGAS[134] - {0x0F12, 0x00FF}, //TVAR_ash_pGAS[135] - {0x0F12, 0x00FC}, //TVAR_ash_pGAS[136] - {0x0F12, 0x0103}, //TVAR_ash_pGAS[137] - {0x0F12, 0x011B}, //TVAR_ash_pGAS[138] - {0x0F12, 0x0146}, //TVAR_ash_pGAS[139] - {0x0F12, 0x018B}, //TVAR_ash_pGAS[140] - {0x0F12, 0x01F8}, //TVAR_ash_pGAS[141] - {0x0F12, 0x02DD}, //TVAR_ash_pGAS[142] - {0x0F12, 0x0232}, //TVAR_ash_pGAS[143] - {0x0F12, 0x018A}, //TVAR_ash_pGAS[144] - {0x0F12, 0x0127}, //TVAR_ash_pGAS[145] - {0x0F12, 0x00EF}, //TVAR_ash_pGAS[146] - {0x0F12, 0x00CA}, //TVAR_ash_pGAS[147] - {0x0F12, 0x00B4}, //TVAR_ash_pGAS[148] - {0x0F12, 0x00AB}, //TVAR_ash_pGAS[149] - {0x0F12, 0x00B1}, //TVAR_ash_pGAS[150] - {0x0F12, 0x00C3}, //TVAR_ash_pGAS[151] - {0x0F12, 0x00E5}, //TVAR_ash_pGAS[152] - {0x0F12, 0x0118}, //TVAR_ash_pGAS[153] - {0x0F12, 0x0168}, //TVAR_ash_pGAS[154] - {0x0F12, 0x023A}, //TVAR_ash_pGAS[155] - {0x0F12, 0x019A}, //TVAR_ash_pGAS[156] - {0x0F12, 0x013E}, //TVAR_ash_pGAS[157] - {0x0F12, 0x00E5}, //TVAR_ash_pGAS[158] - {0x0F12, 0x00B1}, //TVAR_ash_pGAS[159] - {0x0F12, 0x008E}, //TVAR_ash_pGAS[160] - {0x0F12, 0x0079}, //TVAR_ash_pGAS[161] - {0x0F12, 0x0072}, //TVAR_ash_pGAS[162] - {0x0F12, 0x0078}, //TVAR_ash_pGAS[163] - {0x0F12, 0x008E}, //TVAR_ash_pGAS[164] - {0x0F12, 0x00B2}, //TVAR_ash_pGAS[165] - {0x0F12, 0x00E1}, //TVAR_ash_pGAS[166] - {0x0F12, 0x0121}, //TVAR_ash_pGAS[167] - {0x0F12, 0x019A}, //TVAR_ash_pGAS[168] - {0x0F12, 0x014D}, //TVAR_ash_pGAS[169] - {0x0F12, 0x0100}, //TVAR_ash_pGAS[170] - {0x0F12, 0x00AE}, //TVAR_ash_pGAS[171] - {0x0F12, 0x007F}, //TVAR_ash_pGAS[172] - {0x0F12, 0x005B}, //TVAR_ash_pGAS[173] - {0x0F12, 0x0043}, //TVAR_ash_pGAS[174] - {0x0F12, 0x003B}, //TVAR_ash_pGAS[175] - {0x0F12, 0x0045}, //TVAR_ash_pGAS[176] - {0x0F12, 0x005E}, //TVAR_ash_pGAS[177] - {0x0F12, 0x0083}, //TVAR_ash_pGAS[178] - {0x0F12, 0x00B4}, //TVAR_ash_pGAS[179] - {0x0F12, 0x00EF}, //TVAR_ash_pGAS[180] - {0x0F12, 0x0139}, //TVAR_ash_pGAS[181] - {0x0F12, 0x0120}, //TVAR_ash_pGAS[182] - {0x0F12, 0x00DB}, //TVAR_ash_pGAS[183] - {0x0F12, 0x008D}, //TVAR_ash_pGAS[184] - {0x0F12, 0x005D}, //TVAR_ash_pGAS[185] - {0x0F12, 0x0037}, //TVAR_ash_pGAS[186] - {0x0F12, 0x001F}, //TVAR_ash_pGAS[187] - {0x0F12, 0x0017}, //TVAR_ash_pGAS[188] - {0x0F12, 0x0022}, //TVAR_ash_pGAS[189] - {0x0F12, 0x003D}, //TVAR_ash_pGAS[190] - {0x0F12, 0x0066}, //TVAR_ash_pGAS[191] - {0x0F12, 0x009A}, //TVAR_ash_pGAS[192] - {0x0F12, 0x00D7}, //TVAR_ash_pGAS[193] - {0x0F12, 0x011A}, //TVAR_ash_pGAS[194] - {0x0F12, 0x0108}, //TVAR_ash_pGAS[195] - {0x0F12, 0x00C7}, //TVAR_ash_pGAS[196] - {0x0F12, 0x007B}, //TVAR_ash_pGAS[197] - {0x0F12, 0x004A}, //TVAR_ash_pGAS[198] - {0x0F12, 0x0023}, //TVAR_ash_pGAS[199] - {0x0F12, 0x000B}, //TVAR_ash_pGAS[200] - {0x0F12, 0x0005}, //TVAR_ash_pGAS[201] - {0x0F12, 0x000E}, //TVAR_ash_pGAS[202] - {0x0F12, 0x002A}, //TVAR_ash_pGAS[203] - {0x0F12, 0x0055}, //TVAR_ash_pGAS[204] - {0x0F12, 0x008D}, //TVAR_ash_pGAS[205] - {0x0F12, 0x00C9}, //TVAR_ash_pGAS[206] - {0x0F12, 0x0104}, //TVAR_ash_pGAS[207] - {0x0F12, 0x0100}, //TVAR_ash_pGAS[208] - {0x0F12, 0x00C0}, //TVAR_ash_pGAS[209] - {0x0F12, 0x0076}, //TVAR_ash_pGAS[210] - {0x0F12, 0x0044}, //TVAR_ash_pGAS[211] - {0x0F12, 0x001E}, //TVAR_ash_pGAS[212] - {0x0F12, 0x0006}, //TVAR_ash_pGAS[213] - {0x0F12, 0x0000}, //TVAR_ash_pGAS[214] - {0x0F12, 0x0009}, //TVAR_ash_pGAS[215] - {0x0F12, 0x0024}, //TVAR_ash_pGAS[216] - {0x0F12, 0x0052}, //TVAR_ash_pGAS[217] - {0x0F12, 0x008B}, //TVAR_ash_pGAS[218] - {0x0F12, 0x00C8}, //TVAR_ash_pGAS[219] - {0x0F12, 0x0104}, //TVAR_ash_pGAS[220] - {0x0F12, 0x0109}, //TVAR_ash_pGAS[221] - {0x0F12, 0x00C9}, //TVAR_ash_pGAS[222] - {0x0F12, 0x007F}, //TVAR_ash_pGAS[223] - {0x0F12, 0x004D}, //TVAR_ash_pGAS[224] - {0x0F12, 0x0027}, //TVAR_ash_pGAS[225] - {0x0F12, 0x0010}, //TVAR_ash_pGAS[226] - {0x0F12, 0x000A}, //TVAR_ash_pGAS[227] - {0x0F12, 0x0014}, //TVAR_ash_pGAS[228] - {0x0F12, 0x002F}, //TVAR_ash_pGAS[229] - {0x0F12, 0x005D}, //TVAR_ash_pGAS[230] - {0x0F12, 0x0098}, //TVAR_ash_pGAS[231] - {0x0F12, 0x00D7}, //TVAR_ash_pGAS[232] - {0x0F12, 0x010E}, //TVAR_ash_pGAS[233] - {0x0F12, 0x0125}, //TVAR_ash_pGAS[234] - {0x0F12, 0x00E0}, //TVAR_ash_pGAS[235] - {0x0F12, 0x0094}, //TVAR_ash_pGAS[236] - {0x0F12, 0x0066}, //TVAR_ash_pGAS[237] - {0x0F12, 0x0040}, //TVAR_ash_pGAS[238] - {0x0F12, 0x002A}, //TVAR_ash_pGAS[239] - {0x0F12, 0x0024}, //TVAR_ash_pGAS[240] - {0x0F12, 0x002F}, //TVAR_ash_pGAS[241] - {0x0F12, 0x004C}, //TVAR_ash_pGAS[242] - {0x0F12, 0x0078}, //TVAR_ash_pGAS[243] - {0x0F12, 0x00B3}, //TVAR_ash_pGAS[244] - {0x0F12, 0x00F4}, //TVAR_ash_pGAS[245] - {0x0F12, 0x012F}, //TVAR_ash_pGAS[246] - {0x0F12, 0x0153}, //TVAR_ash_pGAS[247] - {0x0F12, 0x0108}, //TVAR_ash_pGAS[248] - {0x0F12, 0x00B9}, //TVAR_ash_pGAS[249] - {0x0F12, 0x008D}, //TVAR_ash_pGAS[250] - {0x0F12, 0x006B}, //TVAR_ash_pGAS[251] - {0x0F12, 0x0055}, //TVAR_ash_pGAS[252] - {0x0F12, 0x0050}, //TVAR_ash_pGAS[253] - {0x0F12, 0x005D}, //TVAR_ash_pGAS[254] - {0x0F12, 0x007A}, //TVAR_ash_pGAS[255] - {0x0F12, 0x00A4}, //TVAR_ash_pGAS[256] - {0x0F12, 0x00D9}, //TVAR_ash_pGAS[257] - {0x0F12, 0x011D}, //TVAR_ash_pGAS[258] - {0x0F12, 0x015E}, //TVAR_ash_pGAS[259] - {0x0F12, 0x019C}, //TVAR_ash_pGAS[260] - {0x0F12, 0x0144}, //TVAR_ash_pGAS[261] - {0x0F12, 0x00F3}, //TVAR_ash_pGAS[262] - {0x0F12, 0x00C2}, //TVAR_ash_pGAS[263] - {0x0F12, 0x00A4}, //TVAR_ash_pGAS[264] - {0x0F12, 0x0093}, //TVAR_ash_pGAS[265] - {0x0F12, 0x008F}, //TVAR_ash_pGAS[266] - {0x0F12, 0x009C}, //TVAR_ash_pGAS[267] - {0x0F12, 0x00B5}, //TVAR_ash_pGAS[268] - {0x0F12, 0x00DA}, //TVAR_ash_pGAS[269] - {0x0F12, 0x010E}, //TVAR_ash_pGAS[270] - {0x0F12, 0x015E}, //TVAR_ash_pGAS[271] - {0x0F12, 0x01C9}, //TVAR_ash_pGAS[272] - {0x0F12, 0x0239}, //TVAR_ash_pGAS[273] - {0x0F12, 0x0186}, //TVAR_ash_pGAS[274] - {0x0F12, 0x0137}, //TVAR_ash_pGAS[275] - {0x0F12, 0x00FF}, //TVAR_ash_pGAS[276] - {0x0F12, 0x00DE}, //TVAR_ash_pGAS[277] - {0x0F12, 0x00CF}, //TVAR_ash_pGAS[278] - {0x0F12, 0x00CE}, //TVAR_ash_pGAS[279] - {0x0F12, 0x00D5}, //TVAR_ash_pGAS[280] - {0x0F12, 0x00ED}, //TVAR_ash_pGAS[281] - {0x0F12, 0x0113}, //TVAR_ash_pGAS[282] - {0x0F12, 0x014E}, //TVAR_ash_pGAS[283] - {0x0F12, 0x01B0}, //TVAR_ash_pGAS[284] - {0x0F12, 0x0285}, //TVAR_ash_pGAS[285] - {0x0F12, 0x020F}, //TVAR_ash_pGAS[286] - {0x0F12, 0x0173}, //TVAR_ash_pGAS[287] - {0x0F12, 0x0112}, //TVAR_ash_pGAS[288] - {0x0F12, 0x00DE}, //TVAR_ash_pGAS[289] - {0x0F12, 0x00BF}, //TVAR_ash_pGAS[290] - {0x0F12, 0x00AD}, //TVAR_ash_pGAS[291] - {0x0F12, 0x00A8}, //TVAR_ash_pGAS[292] - {0x0F12, 0x00B3}, //TVAR_ash_pGAS[293] - {0x0F12, 0x00CC}, //TVAR_ash_pGAS[294] - {0x0F12, 0x00F2}, //TVAR_ash_pGAS[295] - {0x0F12, 0x0126}, //TVAR_ash_pGAS[296] - {0x0F12, 0x0176}, //TVAR_ash_pGAS[297] - {0x0F12, 0x024B}, //TVAR_ash_pGAS[298] - {0x0F12, 0x0180}, //TVAR_ash_pGAS[299] - {0x0F12, 0x012F}, //TVAR_ash_pGAS[300] - {0x0F12, 0x00D5}, //TVAR_ash_pGAS[301] - {0x0F12, 0x00A7}, //TVAR_ash_pGAS[302] - {0x0F12, 0x0087}, //TVAR_ash_pGAS[303] - {0x0F12, 0x0075}, //TVAR_ash_pGAS[304] - {0x0F12, 0x0072}, //TVAR_ash_pGAS[305] - {0x0F12, 0x007E}, //TVAR_ash_pGAS[306] - {0x0F12, 0x0096}, //TVAR_ash_pGAS[307] - {0x0F12, 0x00BE}, //TVAR_ash_pGAS[308] - {0x0F12, 0x00EF}, //TVAR_ash_pGAS[309] - {0x0F12, 0x012F}, //TVAR_ash_pGAS[310] - {0x0F12, 0x01A7}, //TVAR_ash_pGAS[311] - {0x0F12, 0x013C}, //TVAR_ash_pGAS[312] - {0x0F12, 0x00F5}, //TVAR_ash_pGAS[313] - {0x0F12, 0x00A5}, //TVAR_ash_pGAS[314] - {0x0F12, 0x0078}, //TVAR_ash_pGAS[315] - {0x0F12, 0x0057}, //TVAR_ash_pGAS[316] - {0x0F12, 0x0042}, //TVAR_ash_pGAS[317] - {0x0F12, 0x003D}, //TVAR_ash_pGAS[318] - {0x0F12, 0x0049}, //TVAR_ash_pGAS[319] - {0x0F12, 0x0066}, //TVAR_ash_pGAS[320] - {0x0F12, 0x008F}, //TVAR_ash_pGAS[321] - {0x0F12, 0x00C0}, //TVAR_ash_pGAS[322] - {0x0F12, 0x00FD}, //TVAR_ash_pGAS[323] - {0x0F12, 0x0144}, //TVAR_ash_pGAS[324] - {0x0F12, 0x0115}, //TVAR_ash_pGAS[325] - {0x0F12, 0x00D6}, //TVAR_ash_pGAS[326] - {0x0F12, 0x0089}, //TVAR_ash_pGAS[327] - {0x0F12, 0x005B}, //TVAR_ash_pGAS[328] - {0x0F12, 0x0036}, //TVAR_ash_pGAS[329] - {0x0F12, 0x001F}, //TVAR_ash_pGAS[330] - {0x0F12, 0x0018}, //TVAR_ash_pGAS[331] - {0x0F12, 0x0024}, //TVAR_ash_pGAS[332] - {0x0F12, 0x0043}, //TVAR_ash_pGAS[333] - {0x0F12, 0x006F}, //TVAR_ash_pGAS[334] - {0x0F12, 0x00A5}, //TVAR_ash_pGAS[335] - {0x0F12, 0x00E0}, //TVAR_ash_pGAS[336] - {0x0F12, 0x0122}, //TVAR_ash_pGAS[337] - {0x0F12, 0x0104}, //TVAR_ash_pGAS[338] - {0x0F12, 0x00C7}, //TVAR_ash_pGAS[339] - {0x0F12, 0x007B}, //TVAR_ash_pGAS[340] - {0x0F12, 0x004A}, //TVAR_ash_pGAS[341] - {0x0F12, 0x0023}, //TVAR_ash_pGAS[342] - {0x0F12, 0x000B}, //TVAR_ash_pGAS[343] - {0x0F12, 0x0005}, //TVAR_ash_pGAS[344] - {0x0F12, 0x0010}, //TVAR_ash_pGAS[345] - {0x0F12, 0x002E}, //TVAR_ash_pGAS[346] - {0x0F12, 0x005B}, //TVAR_ash_pGAS[347] - {0x0F12, 0x0094}, //TVAR_ash_pGAS[348] - {0x0F12, 0x00D0}, //TVAR_ash_pGAS[349] - {0x0F12, 0x010C}, //TVAR_ash_pGAS[350] - {0x0F12, 0x0105}, //TVAR_ash_pGAS[351] - {0x0F12, 0x00C5}, //TVAR_ash_pGAS[352] - {0x0F12, 0x007A}, //TVAR_ash_pGAS[353] - {0x0F12, 0x0047}, //TVAR_ash_pGAS[354] - {0x0F12, 0x0021}, //TVAR_ash_pGAS[355] - {0x0F12, 0x0008}, //TVAR_ash_pGAS[356] - {0x0F12, 0x0000}, //TVAR_ash_pGAS[357] - {0x0F12, 0x0009}, //TVAR_ash_pGAS[358] - {0x0F12, 0x0026}, //TVAR_ash_pGAS[359] - {0x0F12, 0x0054}, //TVAR_ash_pGAS[360] - {0x0F12, 0x008E}, //TVAR_ash_pGAS[361] - {0x0F12, 0x00CA}, //TVAR_ash_pGAS[362] - {0x0F12, 0x0106}, //TVAR_ash_pGAS[363] - {0x0F12, 0x0116}, //TVAR_ash_pGAS[364] - {0x0F12, 0x00D3}, //TVAR_ash_pGAS[365] - {0x0F12, 0x0088}, //TVAR_ash_pGAS[366] - {0x0F12, 0x0054}, //TVAR_ash_pGAS[367] - {0x0F12, 0x002C}, //TVAR_ash_pGAS[368] - {0x0F12, 0x0012}, //TVAR_ash_pGAS[369] - {0x0F12, 0x0009}, //TVAR_ash_pGAS[370] - {0x0F12, 0x0013}, //TVAR_ash_pGAS[371] - {0x0F12, 0x002E}, //TVAR_ash_pGAS[372] - {0x0F12, 0x005C}, //TVAR_ash_pGAS[373] - {0x0F12, 0x0095}, //TVAR_ash_pGAS[374] - {0x0F12, 0x00D4}, //TVAR_ash_pGAS[375] - {0x0F12, 0x010D}, //TVAR_ash_pGAS[376] - {0x0F12, 0x013A}, //TVAR_ash_pGAS[377] - {0x0F12, 0x00EE}, //TVAR_ash_pGAS[378] - {0x0F12, 0x00A1}, //TVAR_ash_pGAS[379] - {0x0F12, 0x006F}, //TVAR_ash_pGAS[380] - {0x0F12, 0x0047}, //TVAR_ash_pGAS[381] - {0x0F12, 0x002C}, //TVAR_ash_pGAS[382] - {0x0F12, 0x0023}, //TVAR_ash_pGAS[383] - {0x0F12, 0x002D}, //TVAR_ash_pGAS[384] - {0x0F12, 0x0047}, //TVAR_ash_pGAS[385] - {0x0F12, 0x0072}, //TVAR_ash_pGAS[386] - {0x0F12, 0x00AB}, //TVAR_ash_pGAS[387] - {0x0F12, 0x00EB}, //TVAR_ash_pGAS[388] - {0x0F12, 0x0127}, //TVAR_ash_pGAS[389] - {0x0F12, 0x016C}, //TVAR_ash_pGAS[390] - {0x0F12, 0x011B}, //TVAR_ash_pGAS[391] - {0x0F12, 0x00CA}, //TVAR_ash_pGAS[392] - {0x0F12, 0x0099}, //TVAR_ash_pGAS[393] - {0x0F12, 0x0074}, //TVAR_ash_pGAS[394] - {0x0F12, 0x0059}, //TVAR_ash_pGAS[395] - {0x0F12, 0x0050}, //TVAR_ash_pGAS[396] - {0x0F12, 0x0057}, //TVAR_ash_pGAS[397] - {0x0F12, 0x0072}, //TVAR_ash_pGAS[398] - {0x0F12, 0x0099}, //TVAR_ash_pGAS[399] - {0x0F12, 0x00CB}, //TVAR_ash_pGAS[400] - {0x0F12, 0x0111}, //TVAR_ash_pGAS[401] - {0x0F12, 0x0155}, //TVAR_ash_pGAS[402] - {0x0F12, 0x01BA}, //TVAR_ash_pGAS[403] - {0x0F12, 0x015D}, //TVAR_ash_pGAS[404] - {0x0F12, 0x0107}, //TVAR_ash_pGAS[405] - {0x0F12, 0x00D3}, //TVAR_ash_pGAS[406] - {0x0F12, 0x00AE}, //TVAR_ash_pGAS[407] - {0x0F12, 0x0099}, //TVAR_ash_pGAS[408] - {0x0F12, 0x008F}, //TVAR_ash_pGAS[409] - {0x0F12, 0x0096}, //TVAR_ash_pGAS[410] - {0x0F12, 0x00AB}, //TVAR_ash_pGAS[411] - {0x0F12, 0x00CD}, //TVAR_ash_pGAS[412] - {0x0F12, 0x00FE}, //TVAR_ash_pGAS[413] - {0x0F12, 0x014D}, //TVAR_ash_pGAS[414] - {0x0F12, 0x01BC}, //TVAR_ash_pGAS[415] - {0x0F12, 0x025D}, //TVAR_ash_pGAS[416] - {0x0F12, 0x01A6}, //TVAR_ash_pGAS[417] - {0x0F12, 0x0151}, //TVAR_ash_pGAS[418] - {0x0F12, 0x0115}, //TVAR_ash_pGAS[419] - {0x0F12, 0x00F0}, //TVAR_ash_pGAS[420] - {0x0F12, 0x00DA}, //TVAR_ash_pGAS[421] - {0x0F12, 0x00D0}, //TVAR_ash_pGAS[422] - {0x0F12, 0x00D3}, //TVAR_ash_pGAS[423] - {0x0F12, 0x00E5}, //TVAR_ash_pGAS[424] - {0x0F12, 0x0108}, //TVAR_ash_pGAS[425] - {0x0F12, 0x013F}, //TVAR_ash_pGAS[426] - {0x0F12, 0x019E}, //TVAR_ash_pGAS[427] - {0x0F12, 0x0271}, //TVAR_ash_pGAS[428] - {0x0F12, 0x01B8}, //TVAR_ash_pGAS[429] - {0x0F12, 0x013B}, //TVAR_ash_pGAS[430] - {0x0F12, 0x00E6}, //TVAR_ash_pGAS[431] - {0x0F12, 0x00BB}, //TVAR_ash_pGAS[432] - {0x0F12, 0x00A5}, //TVAR_ash_pGAS[433] - {0x0F12, 0x009A}, //TVAR_ash_pGAS[434] - {0x0F12, 0x0096}, //TVAR_ash_pGAS[435] - {0x0F12, 0x00A0}, //TVAR_ash_pGAS[436] - {0x0F12, 0x00B1}, //TVAR_ash_pGAS[437] - {0x0F12, 0x00D0}, //TVAR_ash_pGAS[438] - {0x0F12, 0x00FE}, //TVAR_ash_pGAS[439] - {0x0F12, 0x0148}, //TVAR_ash_pGAS[440] - {0x0F12, 0x01EF}, //TVAR_ash_pGAS[441] - {0x0F12, 0x0133}, //TVAR_ash_pGAS[442] - {0x0F12, 0x00F9}, //TVAR_ash_pGAS[443] - {0x0F12, 0x00B0}, //TVAR_ash_pGAS[444] - {0x0F12, 0x008A}, //TVAR_ash_pGAS[445] - {0x0F12, 0x0074}, //TVAR_ash_pGAS[446] - {0x0F12, 0x0069}, //TVAR_ash_pGAS[447] - {0x0F12, 0x0068}, //TVAR_ash_pGAS[448] - {0x0F12, 0x0071}, //TVAR_ash_pGAS[449] - {0x0F12, 0x0085}, //TVAR_ash_pGAS[450] - {0x0F12, 0x00A4}, //TVAR_ash_pGAS[451] - {0x0F12, 0x00CC}, //TVAR_ash_pGAS[452] - {0x0F12, 0x0106}, //TVAR_ash_pGAS[453] - {0x0F12, 0x0161}, //TVAR_ash_pGAS[454] - {0x0F12, 0x00F6}, //TVAR_ash_pGAS[455] - {0x0F12, 0x00C0}, //TVAR_ash_pGAS[456] - {0x0F12, 0x0080}, //TVAR_ash_pGAS[457] - {0x0F12, 0x005F}, //TVAR_ash_pGAS[458] - {0x0F12, 0x0048}, //TVAR_ash_pGAS[459] - {0x0F12, 0x003B}, //TVAR_ash_pGAS[460] - {0x0F12, 0x0039}, //TVAR_ash_pGAS[461] - {0x0F12, 0x0043}, //TVAR_ash_pGAS[462] - {0x0F12, 0x0059}, //TVAR_ash_pGAS[463] - {0x0F12, 0x0078}, //TVAR_ash_pGAS[464] - {0x0F12, 0x00A0}, //TVAR_ash_pGAS[465] - {0x0F12, 0x00D5}, //TVAR_ash_pGAS[466] - {0x0F12, 0x0107}, //TVAR_ash_pGAS[467] - {0x0F12, 0x00CE}, //TVAR_ash_pGAS[468] - {0x0F12, 0x00A0}, //TVAR_ash_pGAS[469] - {0x0F12, 0x0063}, //TVAR_ash_pGAS[470] - {0x0F12, 0x0043}, //TVAR_ash_pGAS[471] - {0x0F12, 0x0029}, //TVAR_ash_pGAS[472] - {0x0F12, 0x001B}, //TVAR_ash_pGAS[473] - {0x0F12, 0x0018}, //TVAR_ash_pGAS[474] - {0x0F12, 0x0020}, //TVAR_ash_pGAS[475] - {0x0F12, 0x0037}, //TVAR_ash_pGAS[476] - {0x0F12, 0x0059}, //TVAR_ash_pGAS[477] - {0x0F12, 0x0082}, //TVAR_ash_pGAS[478] - {0x0F12, 0x00B6}, //TVAR_ash_pGAS[479] - {0x0F12, 0x00E5}, //TVAR_ash_pGAS[480] - {0x0F12, 0x00BC}, //TVAR_ash_pGAS[481] - {0x0F12, 0x008F}, //TVAR_ash_pGAS[482] - {0x0F12, 0x0054}, //TVAR_ash_pGAS[483] - {0x0F12, 0x0031}, //TVAR_ash_pGAS[484] - {0x0F12, 0x0017}, //TVAR_ash_pGAS[485] - {0x0F12, 0x0008}, //TVAR_ash_pGAS[486] - {0x0F12, 0x0006}, //TVAR_ash_pGAS[487] - {0x0F12, 0x000D}, //TVAR_ash_pGAS[488] - {0x0F12, 0x0022}, //TVAR_ash_pGAS[489] - {0x0F12, 0x0044}, //TVAR_ash_pGAS[490] - {0x0F12, 0x0070}, //TVAR_ash_pGAS[491] - {0x0F12, 0x00A3}, //TVAR_ash_pGAS[492] - {0x0F12, 0x00CF}, //TVAR_ash_pGAS[493] - {0x0F12, 0x00B7}, //TVAR_ash_pGAS[494] - {0x0F12, 0x008A}, //TVAR_ash_pGAS[495] - {0x0F12, 0x0051}, //TVAR_ash_pGAS[496] - {0x0F12, 0x002D}, //TVAR_ash_pGAS[497] - {0x0F12, 0x0013}, //TVAR_ash_pGAS[498] - {0x0F12, 0x0005}, //TVAR_ash_pGAS[499] - {0x0F12, 0x0000}, //TVAR_ash_pGAS[500] - {0x0F12, 0x0006}, //TVAR_ash_pGAS[501] - {0x0F12, 0x001A}, //TVAR_ash_pGAS[502] - {0x0F12, 0x003B}, //TVAR_ash_pGAS[503] - {0x0F12, 0x0069}, //TVAR_ash_pGAS[504] - {0x0F12, 0x009A}, //TVAR_ash_pGAS[505] - {0x0F12, 0x00C8}, //TVAR_ash_pGAS[506] - {0x0F12, 0x00C3}, //TVAR_ash_pGAS[507] - {0x0F12, 0x0093}, //TVAR_ash_pGAS[508] - {0x0F12, 0x005A}, //TVAR_ash_pGAS[509] - {0x0F12, 0x0036}, //TVAR_ash_pGAS[510] - {0x0F12, 0x001B}, //TVAR_ash_pGAS[511] - {0x0F12, 0x000D}, //TVAR_ash_pGAS[512] - {0x0F12, 0x0008}, //TVAR_ash_pGAS[513] - {0x0F12, 0x000D}, //TVAR_ash_pGAS[514] - {0x0F12, 0x0020}, //TVAR_ash_pGAS[515] - {0x0F12, 0x0041}, //TVAR_ash_pGAS[516] - {0x0F12, 0x006C}, //TVAR_ash_pGAS[517] - {0x0F12, 0x00A0}, //TVAR_ash_pGAS[518] - {0x0F12, 0x00CC}, //TVAR_ash_pGAS[519] - {0x0F12, 0x00DE}, //TVAR_ash_pGAS[520] - {0x0F12, 0x00AA}, //TVAR_ash_pGAS[521] - {0x0F12, 0x0070}, //TVAR_ash_pGAS[522] - {0x0F12, 0x004D}, //TVAR_ash_pGAS[523] - {0x0F12, 0x0032}, //TVAR_ash_pGAS[524] - {0x0F12, 0x0023}, //TVAR_ash_pGAS[525] - {0x0F12, 0x001E}, //TVAR_ash_pGAS[526] - {0x0F12, 0x0024}, //TVAR_ash_pGAS[527] - {0x0F12, 0x0036}, //TVAR_ash_pGAS[528] - {0x0F12, 0x0055}, //TVAR_ash_pGAS[529] - {0x0F12, 0x007E}, //TVAR_ash_pGAS[530] - {0x0F12, 0x00B3}, //TVAR_ash_pGAS[531] - {0x0F12, 0x00E3}, //TVAR_ash_pGAS[532] - {0x0F12, 0x010B}, //TVAR_ash_pGAS[533] - {0x0F12, 0x00D0}, //TVAR_ash_pGAS[534] - {0x0F12, 0x0091}, //TVAR_ash_pGAS[535] - {0x0F12, 0x0070}, //TVAR_ash_pGAS[536] - {0x0F12, 0x0058}, //TVAR_ash_pGAS[537] - {0x0F12, 0x0048}, //TVAR_ash_pGAS[538] - {0x0F12, 0x0044}, //TVAR_ash_pGAS[539] - {0x0F12, 0x0048}, //TVAR_ash_pGAS[540] - {0x0F12, 0x005A}, //TVAR_ash_pGAS[541] - {0x0F12, 0x0075}, //TVAR_ash_pGAS[542] - {0x0F12, 0x009A}, //TVAR_ash_pGAS[543] - {0x0F12, 0x00D2}, //TVAR_ash_pGAS[544] - {0x0F12, 0x010B}, //TVAR_ash_pGAS[545] - {0x0F12, 0x014F}, //TVAR_ash_pGAS[546] - {0x0F12, 0x010B}, //TVAR_ash_pGAS[547] - {0x0F12, 0x00C5}, //TVAR_ash_pGAS[548] - {0x0F12, 0x00A0}, //TVAR_ash_pGAS[549] - {0x0F12, 0x008A}, //TVAR_ash_pGAS[550] - {0x0F12, 0x007F}, //TVAR_ash_pGAS[551] - {0x0F12, 0x0079}, //TVAR_ash_pGAS[552] - {0x0F12, 0x007D}, //TVAR_ash_pGAS[553] - {0x0F12, 0x008A}, //TVAR_ash_pGAS[554] - {0x0F12, 0x00A1}, //TVAR_ash_pGAS[555] - {0x0F12, 0x00C6}, //TVAR_ash_pGAS[556] - {0x0F12, 0x0107}, //TVAR_ash_pGAS[557] - {0x0F12, 0x0164}, //TVAR_ash_pGAS[558] - {0x0F12, 0x01E0}, //TVAR_ash_pGAS[559] - {0x0F12, 0x014B}, //TVAR_ash_pGAS[560] - {0x0F12, 0x0107}, //TVAR_ash_pGAS[561] - {0x0F12, 0x00D7}, //TVAR_ash_pGAS[562] - {0x0F12, 0x00BF}, //TVAR_ash_pGAS[563] - {0x0F12, 0x00B2}, //TVAR_ash_pGAS[564] - {0x0F12, 0x00AE}, //TVAR_ash_pGAS[565] - {0x0F12, 0x00AF}, //TVAR_ash_pGAS[566] - {0x0F12, 0x00B8}, //TVAR_ash_pGAS[567] - {0x0F12, 0x00D1}, //TVAR_ash_pGAS[568] - {0x0F12, 0x00FE}, //TVAR_ash_pGAS[569] - {0x0F12, 0x014D}, //TVAR_ash_pGAS[570] - {0x0F12, 0x01FD}, //TVAR_ash_pGAS[571] - // param_end TVAR_ash_pGAS - {0x002A, 0x074E}, - {0x0F12, 0x0001}, //ash_bLumaMode - {0x002A, 0x0D30}, - {0x0F12, 0x025F}, //awbb_GLocusR - {0x002A, 0x0D32}, - {0x0F12, 0x0376}, //awbb_GLocusB - // param_start TVAR_ash_AwbAshCord - {0x002A, 0x06B8}, - {0x0F12, 0x00C0}, //TVAR_ash_AwbAshCord[0] - {0x0F12, 0x00E0}, //TVAR_ash_AwbAshCord[1] - {0x0F12, 0x00FA}, //TVAR_ash_AwbAshCord[2] - {0x0F12, 0x011D}, //TVAR_ash_AwbAshCord[3] - {0x0F12, 0x0144}, //TVAR_ash_AwbAshCord[4] - {0x0F12, 0x0173}, //TVAR_ash_AwbAshCord[5] - {0x0F12, 0x0180}, //TVAR_ash_AwbAshCord[6] - // param_end TVAR_ash_AwbAshCord - {0x002A, 0x0664}, - {0x0F12, 0x013E}, //seti_uContrastCenter - - //ash_CGrasAlphas - {0x002A, 0x06C6}, - {0x0F12, 0x010B}, //ash_CGrasAlphas[0] - {0x0F12, 0x0103}, //ash_CGrasAlphas[1] - {0x0F12, 0x00FC}, //ash_CGrasAlphas[2] - {0x0F12, 0x010C}, //ash_CGrasAlphas[3] - //============================================================ - //End GAS - //============================================================ - //White Balance - //============================================================ - // param_start awbb_IndoorGrZones_m_BGrid - {0x002A, 0x0C48}, - {0x0F12, 0x03C9}, //awbb_IndoorGrZones_m_BGrid[0] - {0x0F12, 0x040A}, //awbb_IndoorGrZones_m_BGrid[1] - {0x0F12, 0x038B}, //awbb_IndoorGrZones_m_BGrid[2] - {0x0F12, 0x0405}, //awbb_IndoorGrZones_m_BGrid[3] - {0x0F12, 0x0356}, //awbb_IndoorGrZones_m_BGrid[4] - {0x0F12, 0x0400}, //awbb_IndoorGrZones_m_BGrid[5] - {0x0F12, 0x0322}, //awbb_IndoorGrZones_m_BGrid[6] - {0x0F12, 0x03DF}, //awbb_IndoorGrZones_m_BGrid[7] - {0x0F12, 0x02E9}, //awbb_IndoorGrZones_m_BGrid[8] - {0x0F12, 0x03B0}, //awbb_IndoorGrZones_m_BGrid[9] - {0x0F12, 0x02B6}, //awbb_IndoorGrZones_m_BGrid[10] - {0x0F12, 0x0380}, //awbb_IndoorGrZones_m_BGrid[11] - {0x0F12, 0x0296}, //awbb_IndoorGrZones_m_BGrid[12] - {0x0F12, 0x034F}, //awbb_IndoorGrZones_m_BGrid[13] - {0x0F12, 0x027F}, //awbb_IndoorGrZones_m_BGrid[14] - {0x0F12, 0x031A}, //awbb_IndoorGrZones_m_BGrid[15] - {0x0F12, 0x026C}, //awbb_IndoorGrZones_m_BGrid[16] - {0x0F12, 0x02F5}, //awbb_IndoorGrZones_m_BGrid[17] - {0x0F12, 0x0256}, //awbb_IndoorGrZones_m_BGrid[18] - {0x0F12, 0x02DA}, //awbb_IndoorGrZones_m_BGrid[19] - {0x0F12, 0x0241}, //awbb_IndoorGrZones_m_BGrid[20] - {0x0F12, 0x02C4}, //awbb_IndoorGrZones_m_BGrid[21] - {0x0F12, 0x0228}, //awbb_IndoorGrZones_m_BGrid[22] - {0x0F12, 0x02AB}, //awbb_IndoorGrZones_m_BGrid[23] - {0x0F12, 0x0213}, //awbb_IndoorGrZones_m_BGrid[24] - {0x0F12, 0x0292}, //awbb_IndoorGrZones_m_BGrid[25] - {0x0F12, 0x01FF}, //awbb_IndoorGrZones_m_BGrid[26] - {0x0F12, 0x0278}, //awbb_IndoorGrZones_m_BGrid[27] - {0x0F12, 0x01F4}, //awbb_IndoorGrZones_m_BGrid[28] - {0x0F12, 0x025F}, //awbb_IndoorGrZones_m_BGrid[29] - {0x0F12, 0x0202}, //awbb_IndoorGrZones_m_BGrid[30] - {0x0F12, 0x0234}, //awbb_IndoorGrZones_m_BGrid[31] - {0x0F12, 0x0000}, //awbb_IndoorGrZones_m_BGrid[32] - {0x0F12, 0x0000}, //awbb_IndoorGrZones_m_BGrid[33] - {0x0F12, 0x0000}, //awbb_IndoorGrZones_m_BGrid[34] - {0x0F12, 0x0000}, //awbb_IndoorGrZones_m_BGrid[35] - {0x0F12, 0x0000}, //awbb_IndoorGrZones_m_BGrid[36] - {0x0F12, 0x0000}, //awbb_IndoorGrZones_m_BGrid[37] - {0x0F12, 0x0000}, //awbb_IndoorGrZones_m_BGrid[38] - {0x0F12, 0x0000}, //awbb_IndoorGrZones_m_BGrid[39] - // param_end awbb_IndoorGrZones_m_BGrid - {0x002A, 0x0C98}, - {0x0F12, 0x0005}, - {0x0F12, 0x0000}, //awbb_IndoorGrZones_m_GridStep - {0x002A, 0x0CA0}, - {0x0F12, 0x00E8}, - {0x0F12, 0x0000}, //awbb_IndoorGrZones_m_Boffs - // param_start awbb_LowBrGrZones_m_BGrid - {0x002A, 0x0CE0}, - {0x0F12, 0x03D4}, //awbb_LowBrGrZones_m_BGrid[0] // - {0x0F12, 0x043E}, //awbb_LowBrGrZones_m_BGrid[1] // - {0x0F12, 0x035C}, //awbb_LowBrGrZones_m_BGrid[2] // - {0x0F12, 0x0438}, //awbb_LowBrGrZones_m_BGrid[3] // - {0x0F12, 0x02F0}, //awbb_LowBrGrZones_m_BGrid[4] // - {0x0F12, 0x042D}, //awbb_LowBrGrZones_m_BGrid[5] // - {0x0F12, 0x029A}, //awbb_LowBrGrZones_m_BGrid[6] // - {0x0F12, 0x03EF}, //awbb_LowBrGrZones_m_BGrid[7] // - {0x0F12, 0x025E}, //awbb_LowBrGrZones_m_BGrid[8] // - {0x0F12, 0x0395}, //awbb_LowBrGrZones_m_BGrid[9] // - {0x0F12, 0x022E}, //awbb_LowBrGrZones_m_BGrid[10] // - {0x0F12, 0x0346}, //awbb_LowBrGrZones_m_BGrid[11] // - {0x0F12, 0x0200}, //awbb_LowBrGrZones_m_BGrid[12] // - {0x0F12, 0x02F6}, //awbb_LowBrGrZones_m_BGrid[13] // - {0x0F12, 0x01CE}, //awbb_LowBrGrZones_m_BGrid[14] // - {0x0F12, 0x02C8}, //awbb_LowBrGrZones_m_BGrid[15] // - {0x0F12, 0x01BB}, //awbb_LowBrGrZones_m_BGrid[16] // - {0x0F12, 0x0287}, //awbb_LowBrGrZones_m_BGrid[17] // - {0x0F12, 0x01E2}, //awbb_LowBrGrZones_m_BGrid[18] // - {0x0F12, 0x0239}, //awbb_LowBrGrZones_m_BGrid[19] // - {0x0F12, 0x0000}, //awbb_LowBrGrZones_m_BGrid[20] // - {0x0F12, 0x0000}, //awbb_LowBrGrZones_m_BGrid[21] // - {0x0F12, 0x0000}, //awbb_LowBrGrZones_m_BGrid[22] // - {0x0F12, 0x0000}, //awbb_LowBrGrZones_m_BGrid[23] // - // param_end awbb_LowBrGrZones_m_BGrid - {0x002A, 0x0D10}, - {0x0F12, 0x0006}, - {0x0F12, 0x0000}, //awbb_LowBrGrZones_m_GridStep - {0x002A, 0x0D18}, - {0x0F12, 0x00AE}, - {0x0F12, 0x0000}, //awbb_LowBrGrZones_m_Boffs - // param_start awbb_OutdoorGrZones_m_BGrid - {0x002A, 0x0CA4}, - {0x0F12, 0x031A},//02A8 //awbb_OutdoorGrZones_m_BGrid[0] - {0x0F12, 0x0382},//02C2 //awbb_OutdoorGrZones_m_BGrid[1] - {0x0F12, 0x02E3},//0270 //awbb_OutdoorGrZones_m_BGrid[2] - {0x0F12, 0x038B},//02B4 //awbb_OutdoorGrZones_m_BGrid[3] - {0x0F12, 0x02B7},//025C //awbb_OutdoorGrZones_m_BGrid[4] - {0x0F12, 0x035D},//02A0 //awbb_OutdoorGrZones_m_BGrid[5] - {0x0F12, 0x0297},//0240 //awbb_OutdoorGrZones_m_BGrid[6] - {0x0F12, 0x032A},//0288 //awbb_OutdoorGrZones_m_BGrid[7] - {0x0F12, 0x0285},//0230 //awbb_OutdoorGrZones_m_BGrid[8] - {0x0F12, 0x0302},//026E //awbb_OutdoorGrZones_m_BGrid[9] - {0x0F12, 0x0271},//0222 //awbb_OutdoorGrZones_m_BGrid[10] - {0x0F12, 0x02DF},//025A //awbb_OutdoorGrZones_m_BGrid[11] - {0x0F12, 0x025D},//0220 //awbb_OutdoorGrZones_m_BGrid[12] - {0x0F12, 0x02C7},//023A //awbb_OutdoorGrZones_m_BGrid[13] - {0x0F12, 0x0241},//0000 //awbb_OutdoorGrZones_m_BGrid[14] - {0x0F12, 0x02B5},//0000 //awbb_OutdoorGrZones_m_BGrid[15] - {0x0F12, 0x0229},//0000 //awbb_OutdoorGrZones_m_BGrid[16] - {0x0F12, 0x029B},//0000 //awbb_OutdoorGrZones_m_BGrid[17] - {0x0F12, 0x0212},//0000 //awbb_OutdoorGrZones_m_BGrid[18] - {0x0F12, 0x0280},//0000 //awbb_OutdoorGrZones_m_BGrid[19] - {0x0F12, 0x0205},//0000 //awbb_OutdoorGrZones_m_BGrid[20] - {0x0F12, 0x026A},//0000 //awbb_OutdoorGrZones_m_BGrid[21] - {0x0F12, 0x020A},//0000 //awbb_OutdoorGrZones_m_BGrid[22] - {0x0F12, 0x023F},//0000 //awbb_OutdoorGrZones_m_BGrid[23] - // param_end awbb_OutdoorGrZones_m_BGrid - {0x002A, 0x0CD4}, - {0x0F12, 0x0005}, - {0x0F12, 0x0000}, //awbb_OutdoorGrZones_m_GridStep - {0x002A, 0x0CDC}, - {0x0F12, 0x0157}, //01FE - {0x0F12, 0x0000}, //awbb_OutdoorGrZones_m_Boffs - //Low illumiantion - {0x002A, 0x0D1C}, - {0x0F12, 0x037C}, - {0x0F12, 0x0000}, //awbb_CrclLowT_R_c - {0x002A, 0x0D20}, - {0x0F12, 0x0157}, - {0x0F12, 0x0000}, //awbb_CrclLowT_B_c - {0x002A, 0x0D24}, - {0x0F12, 0x3EB8}, - {0x0F12, 0x0000}, //awbb_CrclLowT_Rad_c - //White locus - {0x002A, 0x0D2C}, - {0x0F12, 0x013D}, //awbb_IntcR - {0x0F12, 0x011E}, //awbb_IntcB - {0x002A, 0x0D46}, - {0x0F12, 0x0396}, //04A2 //awbb_MvEq_RBthresh - {0x002A, 0x0D5C}, - {0x0F12, 0x0584}, //awbb_LowTempRB - - //Grid Correction - // param_start awbb_GridCorr_R - {0x002A, 0x0DD4}, - {0x0F12, 0x003C}, //awbb_GridCorr_R[0] - {0x0F12, 0x0050}, //awbb_GridCorr_R[1] - {0x0F12, 0x0064}, //awbb_GridCorr_R[2] - {0x0F12, 0x0000}, //awbb_GridCorr_R[3] - {0x0F12, 0x0014}, //awbb_GridCorr_R[4] - {0x0F12, 0x0014}, //awbb_GridCorr_R[5] - {0x0F12, 0x003C}, //awbb_GridCorr_R[6] - {0x0F12, 0x0050}, //awbb_GridCorr_R[7] - {0x0F12, 0x0064}, //awbb_GridCorr_R[8] - {0x0F12, 0x0000}, //awbb_GridCorr_R[9] - {0x0F12, 0x0014}, //awbb_GridCorr_R[10] - {0x0F12, 0x0014}, //awbb_GridCorr_R[11] - {0x0F12, 0x003C}, //awbb_GridCorr_R[12] - {0x0F12, 0x0050}, //awbb_GridCorr_R[13] - {0x0F12, 0x0064}, //awbb_GridCorr_R[14] - {0x0F12, 0x0000}, //awbb_GridCorr_R[15] - {0x0F12, 0x0014}, //awbb_GridCorr_R[16] - {0x0F12, 0x0014}, //awbb_GridCorr_R[17] - // param_end awbb_GridCorr_R - // param_start awbb_GridCorr_B - {0x002A, 0x0DF8}, - {0x0F12, 0xFFEC}, //awbb_GridCorr_B[0] - {0x0F12, 0xFFEC}, //awbb_GridCorr_B[1] - {0x0F12, 0x0078}, //awbb_GridCorr_B[2] - {0x0F12, 0xFFE2}, //awbb_GridCorr_B[3] - {0x0F12, 0xFFE2}, //awbb_GridCorr_B[4] - {0x0F12, 0xFFB0}, //awbb_GridCorr_B[5] - {0x0F12, 0xFFEC}, //awbb_GridCorr_B[6] - {0x0F12, 0xFFEC}, //awbb_GridCorr_B[7] - {0x0F12, 0x0078}, //awbb_GridCorr_B[8] - {0x0F12, 0xFFE2}, //awbb_GridCorr_B[9] - {0x0F12, 0xFFE2}, //awbb_GridCorr_B[10] - {0x0F12, 0xFFB0}, //awbb_GridCorr_B[11] - {0x0F12, 0xFFEC}, //awbb_GridCorr_B[12] - {0x0F12, 0xFFEC}, //awbb_GridCorr_B[13] - {0x0F12, 0x0078}, //awbb_GridCorr_B[14] - {0x0F12, 0xFFE2}, //awbb_GridCorr_B[15] - {0x0F12, 0xFFE2}, //awbb_GridCorr_B[16] - {0x0F12, 0xFFB0}, //awbb_GridCorr_B[17] - // param_end awbb_GridCorr_B - // param_start awbb_GridConst_1 - {0x002A, 0x0E1C}, - {0x0F12, 0x02D9}, //awbb_GridConst_1[0] - {0x0F12, 0x0357}, //awbb_GridConst_1[1] - {0x0F12, 0x03D1}, //awbb_GridConst_1[2] - // param_end awbb_GridConst_1 - // param_start awbb_GridConst_2 - {0x002A, 0x0E22}, - {0x0F12, 0x0DE9}, //awbb_GridConst_2[0] - {0x0F12, 0x0EDD}, //awbb_GridConst_2[1] - {0x0F12, 0x0F42}, //awbb_GridConst_2[2] - {0x0F12, 0x0F54}, //awbb_GridConst_2[3] - {0x0F12, 0x0FAE}, //awbb_GridConst_2[4] - {0x0F12, 0x1011}, //awbb_GridConst_2[5] - // param_end awbb_GridConst_2 - {0x002A, 0x0E2E}, - {0x0F12, 0x00BA}, //awbb_GridCoeff_R_1 - {0x0F12, 0x00AF}, //awbb_GridCoeff_B_1 - {0x0F12, 0x0049}, //awbb_GridCoeff_R_2 - {0x0F12, 0x00F5}, //awbb_GridCoeff_B_2 - - {0x002A, 0x0E4A}, - {0x0F12, 0x0002}, //awbb_GridEnable - //============================================================ - //End AWB - //============================================================ - //AE - //============================================================ - //AE variation - {0x002A, 0x051A}, - {0x0F12, 0x010E}, //lt_uLimitHigh - {0x0F12, 0x00F5}, //lt_uLimitLow - //disable contrast, enable illumination - {0x002A, 0x0F76}, - {0x0F12, 0x0001}, // - - {0x002A, 0x1034}, - {0x0F12, 0x00C0}, //SARR_IllumType[0] - {0x0F12, 0x00E0}, //SARR_IllumType[1] - {0x0F12, 0x00F0}, //SARR_IllumType[2] - {0x0F12, 0x0129}, //SARR_IllumType[3] - {0x0F12, 0x0156}, //SARR_IllumType[4] - {0x0F12, 0x017F}, //SARR_IllumType[5] - {0x0F12, 0x018F}, //SARR_IllumType[6] - - {0x002A, 0x1042}, - {0x0F12, 0x0120}, //SARR_IllumTypeF[0] - {0x0F12, 0x0120}, //SARR_IllumTypeF[1] - {0x0F12, 0x0120}, //SARR_IllumTypeF[2] - {0x0F12, 0x0100}, //SARR_IllumTypeF[3] - {0x0F12, 0x0100}, //SARR_IllumTypeF[4] - {0x0F12, 0x0100}, //SARR_IllumTypeF[5] - {0x0F12, 0x0100}, //SARR_IllumTypeF[6] - - //AE target - {0x002A, 0x0F70}, - {0x0F12, 0x0046}, //TVAR_ae_BrAve - //AE Weight - {0x0028, 0x7000}, - {0x002A, 0x0f7e}, //AE weight/ - {0x0F12, 0x0101},//0000 - {0x0F12, 0x0101},//0000 - {0x0F12, 0x0101},//0000 - {0x0F12, 0x0101},//0000 - {0x0F12, 0x0101},//0101 - {0x0F12, 0x0101},//0101 - {0x0F12, 0x0101},//0101 - {0x0F12, 0x0101},//0101 - {0x0F12, 0x0101},//0101 - {0x0F12, 0x0303},//0101 - {0x0F12, 0x0303},//0101 - {0x0F12, 0x0101},//0101 - {0x0F12, 0x0101},//0101 - {0x0F12, 0x0303},//0401 - {0x0F12, 0x0303},//0104 - {0x0F12, 0x0101},//0101 - {0x0F12, 0x0101},//0101 - {0x0F12, 0x0303},//0401 - {0x0F12, 0x0303},//0104 - {0x0F12, 0x0101},//0101 - {0x0F12, 0x0101},//0101 - {0x0F12, 0x0303},//0201 - {0x0F12, 0x0303},//0102 - {0x0F12, 0x0101},//0101 - {0x0F12, 0x0101},//0101 - {0x0F12, 0x0101},//0201 - {0x0F12, 0x0101},//0102 - {0x0F12, 0x0101},//0101 - {0x0F12, 0x0101},//0101 - {0x0F12, 0x0101},//0101 - {0x0F12, 0x0101},//0101 - {0x0F12, 0x0101},//0101 - //============================================================ - //Gamma - //============================================================ - {0x002A, 0x3288}, - {0x0F12, 0x0000}, //#SARR_usDualGammaLutRGBIndoor[0][0] 0000 - {0x0F12, 0x0008}, //#SARR_usDualGammaLutRGBIndoor[0][1] 0008 - {0x0F12, 0x0013}, //#SARR_usDualGammaLutRGBIndoor[0][2] 0013 - {0x0F12, 0x002C}, //#SARR_usDualGammaLutRGBIndoor[0][3] 002C - {0x0F12, 0x0061}, //#SARR_usDualGammaLutRGBIndoor[0][4] 0061 - {0x0F12, 0x00C8}, //#SARR_usDualGammaLutRGBIndoor[0][5] 00C8 - {0x0F12, 0x0113}, //#SARR_usDualGammaLutRGBIndoor[0][6] 0113 - {0x0F12, 0x0132}, //#SARR_usDualGammaLutRGBIndoor[0][7] 0132 - {0x0F12, 0x014C}, //#SARR_usDualGammaLutRGBIndoor[0][8] 014C - {0x0F12, 0x0179}, //#SARR_usDualGammaLutRGBIndoor[0][9] 0179 - {0x0F12, 0x01A4}, //#SARR_usDualGammaLutRGBIndoor[0][10] 01A4 - {0x0F12, 0x01CD}, //#SARR_usDualGammaLutRGBIndoor[0][11] 01CD - {0x0F12, 0x01F4}, //#SARR_usDualGammaLutRGBIndoor[0][12] 01F4 - {0x0F12, 0x0239}, //#SARR_usDualGammaLutRGBIndoor[0][13] 0239 - {0x0F12, 0x0278}, //#SARR_usDualGammaLutRGBIndoor[0][14] 0278 - {0x0F12, 0x02E0}, //#SARR_usDualGammaLutRGBIndoor[0][15] 02E0 - {0x0F12, 0x0333}, //#SARR_usDualGammaLutRGBIndoor[0][16] 0333 - {0x0F12, 0x037B}, //#SARR_usDualGammaLutRGBIndoor[0][17] 037B - {0x0F12, 0x03BF}, //#SARR_usDualGammaLutRGBIndoor[0][18] 03BF - {0x0F12, 0x03FF}, //#SARR_usDualGammaLutRGBIndoor[0][19] 03FF - {0x0F12, 0x0000}, //#SARR_usDualGammaLutRGBIndoor[1][0] 0000 - {0x0F12, 0x0008}, //#SARR_usDualGammaLutRGBIndoor[1][1] 0008 - {0x0F12, 0x0013}, //#SARR_usDualGammaLutRGBIndoor[1][2] 0013 - {0x0F12, 0x002C}, //#SARR_usDualGammaLutRGBIndoor[1][3] 002C - {0x0F12, 0x0061}, //#SARR_usDualGammaLutRGBIndoor[1][4] 0061 - {0x0F12, 0x00C8}, //#SARR_usDualGammaLutRGBIndoor[1][5] 00C8 - {0x0F12, 0x0113}, //#SARR_usDualGammaLutRGBIndoor[1][6] 0113 - {0x0F12, 0x0132}, //#SARR_usDualGammaLutRGBIndoor[1][7] 0132 - {0x0F12, 0x014C}, //#SARR_usDualGammaLutRGBIndoor[1][8] 014C - {0x0F12, 0x0179}, //#SARR_usDualGammaLutRGBIndoor[1][9] 0179 - {0x0F12, 0x01A4}, //#SARR_usDualGammaLutRGBIndoor[1][10] 01A4 - {0x0F12, 0x01CD}, //#SARR_usDualGammaLutRGBIndoor[1][11] 01CD - {0x0F12, 0x01F4}, //#SARR_usDualGammaLutRGBIndoor[1][12] 01F4 - {0x0F12, 0x0239}, //#SARR_usDualGammaLutRGBIndoor[1][13] 0239 - {0x0F12, 0x0278}, //#SARR_usDualGammaLutRGBIndoor[1][14] 0278 - {0x0F12, 0x02E0}, //#SARR_usDualGammaLutRGBIndoor[1][15] 02E0 - {0x0F12, 0x0333}, //#SARR_usDualGammaLutRGBIndoor[1][16] 0333 - {0x0F12, 0x037B}, //#SARR_usDualGammaLutRGBIndoor[1][17] 037B - {0x0F12, 0x03BF}, //#SARR_usDualGammaLutRGBIndoor[1][18] 03BF - {0x0F12, 0x03FF}, //#SARR_usDualGammaLutRGBIndoor[1][19] 03FF - {0x0F12, 0x0000}, //#SARR_usDualGammaLutRGBIndoor[2][0] 0000 - {0x0F12, 0x0008}, //#SARR_usDualGammaLutRGBIndoor[2][1] 0008 - {0x0F12, 0x0013}, //#SARR_usDualGammaLutRGBIndoor[2][2] 0013 - {0x0F12, 0x002C}, //#SARR_usDualGammaLutRGBIndoor[2][3] 002C - {0x0F12, 0x0061}, //#SARR_usDualGammaLutRGBIndoor[2][4] 0061 - {0x0F12, 0x00C8}, //#SARR_usDualGammaLutRGBIndoor[2][5] 00C8 - {0x0F12, 0x0113}, //#SARR_usDualGammaLutRGBIndoor[2][6] 0113 - {0x0F12, 0x0132}, //#SARR_usDualGammaLutRGBIndoor[2][7] 0132 - {0x0F12, 0x014C}, //#SARR_usDualGammaLutRGBIndoor[2][8] 014C - {0x0F12, 0x0179}, //#SARR_usDualGammaLutRGBIndoor[2][9] 0179 - {0x0F12, 0x01A4}, //#SARR_usDualGammaLutRGBIndoor[2][10] 01A4 - {0x0F12, 0x01CD}, //#SARR_usDualGammaLutRGBIndoor[2][11] 01CD - {0x0F12, 0x01F4}, //#SARR_usDualGammaLutRGBIndoor[2][12] 01F4 - {0x0F12, 0x0239}, //#SARR_usDualGammaLutRGBIndoor[2][13] 0239 - {0x0F12, 0x0278}, //#SARR_usDualGammaLutRGBIndoor[2][14] 0278 - {0x0F12, 0x02E0}, //#SARR_usDualGammaLutRGBIndoor[2][15] 02E0 - {0x0F12, 0x0333}, //#SARR_usDualGammaLutRGBIndoor[2][16] 0333 - {0x0F12, 0x037B}, //#SARR_usDualGammaLutRGBIndoor[2][17] 037B - {0x0F12, 0x03BF}, //#SARR_usDualGammaLutRGBIndoor[2][18] 03BF - {0x0F12, 0x03FF}, //#SARR_usDualGammaLutRGBIndoor[2][19] 03FF - - {0x002A, 0x3300}, - {0x0F12, 0x0000}, //#SARR_usDualGammaLutRGBOutdoor[0][0] 0000 - {0x0F12, 0x0008}, //#SARR_usDualGammaLutRGBOutdoor[0][1] 0008 - {0x0F12, 0x0013}, //#SARR_usDualGammaLutRGBOutdoor[0][2] 0013 - {0x0F12, 0x002C}, //#SARR_usDualGammaLutRGBOutdoor[0][3] 002C - {0x0F12, 0x0061}, //#SARR_usDualGammaLutRGBOutdoor[0][4] 0061 - {0x0F12, 0x00C8}, //#SARR_usDualGammaLutRGBOutdoor[0][5] 00C8 - {0x0F12, 0x0113}, //#SARR_usDualGammaLutRGBOutdoor[0][6] 0113 - {0x0F12, 0x0132}, //#SARR_usDualGammaLutRGBOutdoor[0][7] 0132 - {0x0F12, 0x014C}, //#SARR_usDualGammaLutRGBOutdoor[0][8] 014C - {0x0F12, 0x0179}, //#SARR_usDualGammaLutRGBOutdoor[0][9] 0179 - {0x0F12, 0x01A4}, //#SARR_usDualGammaLutRGBOutdoor[0][10] 01A4 - {0x0F12, 0x01CD}, //#SARR_usDualGammaLutRGBOutdoor[0][11] 01CD - {0x0F12, 0x01F4}, //#SARR_usDualGammaLutRGBOutdoor[0][12] 01F4 - {0x0F12, 0x0239}, //#SARR_usDualGammaLutRGBOutdoor[0][13] 0239 - {0x0F12, 0x0278}, //#SARR_usDualGammaLutRGBOutdoor[0][14] 0278 - {0x0F12, 0x02E0}, //#SARR_usDualGammaLutRGBOutdoor[0][15] 02E0 - {0x0F12, 0x0333}, //#SARR_usDualGammaLutRGBOutdoor[0][16] 0333 - {0x0F12, 0x037B}, //#SARR_usDualGammaLutRGBOutdoor[0][17] 037B - {0x0F12, 0x03BF}, //#SARR_usDualGammaLutRGBOutdoor[0][18] 03BF - {0x0F12, 0x03FF}, //#SARR_usDualGammaLutRGBOutdoor[0][19] 03FF - {0x0F12, 0x0000}, //#SARR_usDualGammaLutRGBOutdoor[1][0] 0000 - {0x0F12, 0x0008}, //#SARR_usDualGammaLutRGBOutdoor[1][1] 0008 - {0x0F12, 0x0013}, //#SARR_usDualGammaLutRGBOutdoor[1][2] 0013 - {0x0F12, 0x002C}, //#SARR_usDualGammaLutRGBOutdoor[1][3] 002C - {0x0F12, 0x0061}, //#SARR_usDualGammaLutRGBOutdoor[1][4] 0061 - {0x0F12, 0x00C8}, //#SARR_usDualGammaLutRGBOutdoor[1][5] 00C8 - {0x0F12, 0x0113}, //#SARR_usDualGammaLutRGBOutdoor[1][6] 0113 - {0x0F12, 0x0132}, //#SARR_usDualGammaLutRGBOutdoor[1][7] 0132 - {0x0F12, 0x014C}, //#SARR_usDualGammaLutRGBOutdoor[1][8] 014C - {0x0F12, 0x0179}, //#SARR_usDualGammaLutRGBOutdoor[1][9] 0179 - {0x0F12, 0x01A4}, //#SARR_usDualGammaLutRGBOutdoor[1][10] 01A4 - {0x0F12, 0x01CD}, //#SARR_usDualGammaLutRGBOutdoor[1][11] 01CD - {0x0F12, 0x01F4}, //#SARR_usDualGammaLutRGBOutdoor[1][12] 01F4 - {0x0F12, 0x0239}, //#SARR_usDualGammaLutRGBOutdoor[1][13] 0239 - {0x0F12, 0x0278}, //#SARR_usDualGammaLutRGBOutdoor[1][14] 0278 - {0x0F12, 0x02E0}, //#SARR_usDualGammaLutRGBOutdoor[1][15] 02E0 - {0x0F12, 0x0333}, //#SARR_usDualGammaLutRGBOutdoor[1][16] 0333 - {0x0F12, 0x037B}, //#SARR_usDualGammaLutRGBOutdoor[1][17] 037B - {0x0F12, 0x03BF}, //#SARR_usDualGammaLutRGBOutdoor[1][18] 03BF - {0x0F12, 0x03FF}, //#SARR_usDualGammaLutRGBOutdoor[1][19] 03FF - {0x0F12, 0x0000}, //#SARR_usDualGammaLutRGBOutdoor[2][0] 0000 - {0x0F12, 0x0008}, //#SARR_usDualGammaLutRGBOutdoor[2][1] 0008 - {0x0F12, 0x0013}, //#SARR_usDualGammaLutRGBOutdoor[2][2] 0013 - {0x0F12, 0x002C}, //#SARR_usDualGammaLutRGBOutdoor[2][3] 002C - {0x0F12, 0x0061}, //#SARR_usDualGammaLutRGBOutdoor[2][4] 0061 - {0x0F12, 0x00C8}, //#SARR_usDualGammaLutRGBOutdoor[2][5] 00C8 - {0x0F12, 0x0113}, //#SARR_usDualGammaLutRGBOutdoor[2][6] 0113 - {0x0F12, 0x0132}, //#SARR_usDualGammaLutRGBOutdoor[2][7] 0132 - {0x0F12, 0x014C}, //#SARR_usDualGammaLutRGBOutdoor[2][8] 014C - {0x0F12, 0x0179}, //#SARR_usDualGammaLutRGBOutdoor[2][9] 0179 - {0x0F12, 0x01A4}, //#SARR_usDualGammaLutRGBOutdoor[2][10] 01A4 - {0x0F12, 0x01CD}, //#SARR_usDualGammaLutRGBOutdoor[2][11] 01CD - {0x0F12, 0x01F4}, //#SARR_usDualGammaLutRGBOutdoor[2][12] 01F4 - {0x0F12, 0x0239}, //#SARR_usDualGammaLutRGBOutdoor[2][13] 0239 - {0x0F12, 0x0278}, //#SARR_usDualGammaLutRGBOutdoor[2][14] 0278 - {0x0F12, 0x02E0}, //#SARR_usDualGammaLutRGBOutdoor[2][15] 02E0 - {0x0F12, 0x0333}, //#SARR_usDualGammaLutRGBOutdoor[2][16] 0333 - {0x0F12, 0x037B}, //#SARR_usDualGammaLutRGBOutdoor[2][17] 037B - {0x0F12, 0x03BF}, //#SARR_usDualGammaLutRGBOutdoor[2][18] 03BF - {0x0F12, 0x03FF}, //#SARR_usDualGammaLutRGBOutdoor[2][19] 03FF - - //============================================================ - //CCM - //============================================================ - {0x002A, 0x06A6}, - {0x0F12, 0x00C0}, //SARR_AwbCcmCord[0] - {0x0F12, 0x00F8}, //SARR_AwbCcmCord[1] - {0x0F12, 0x0112}, //SARR_AwbCcmCord[2] - {0x0F12, 0x014A}, //SARR_AwbCcmCord[3] - {0x0F12, 0x0156}, //SARR_AwbCcmCord[4] - {0x0F12, 0x017F}, //SARR_AwbCcmCord[5] - - // param_start TVAR_wbt_pBaseCcms - // Horizon - {0x002A, 0x33A4}, - {0x0F12, 0x01C3},//02D5 //TVAR_wbt_pBaseCcms[0] - {0x0F12, 0xFF89},//FF53 //TVAR_wbt_pBaseCcms[1] - {0x0F12, 0xFFE5},//FF83 //TVAR_wbt_pBaseCcms[2] - {0x0F12, 0xFF26},//FEE9 //TVAR_wbt_pBaseCcms[3] - {0x0F12, 0x028E},//01A2 //TVAR_wbt_pBaseCcms[4] - {0x0F12, 0xFF80},//FDFE //TVAR_wbt_pBaseCcms[5] - {0x0F12, 0x0002},//FFFC //TVAR_wbt_pBaseCcms[6] - {0x0F12, 0xFFA8},//FF5F //TVAR_wbt_pBaseCcms[7] - {0x0F12, 0x01F0},//02AD //TVAR_wbt_pBaseCcms[8] - {0x0F12, 0x0125},//0125 //TVAR_wbt_pBaseCcms[9] - {0x0F12, 0x0119},//0119 //TVAR_wbt_pBaseCcms[10] - {0x0F12, 0xFE5A},//FE5A //TVAR_wbt_pBaseCcms[11] - {0x0F12, 0x0179},//00D9 //TVAR_wbt_pBaseCcms[12] - {0x0F12, 0xFF8A},//FF26 //TVAR_wbt_pBaseCcms[13] - {0x0F12, 0x0180},//013C //TVAR_wbt_pBaseCcms[14] - {0x0F12, 0xFEC2},//FEC0 //TVAR_wbt_pBaseCcms[15] - {0x0F12, 0x0176},//01F3 //TVAR_wbt_pBaseCcms[16] - {0x0F12, 0x0094},//0109 //TVAR_wbt_pBaseCcms[17] - //inca - {0x0F12, 0x01C3},//022B //TVAR_wbt_pBaseCcms[18] - {0x0F12, 0xFF89},//FF73 //TVAR_wbt_pBaseCcms[19] - {0x0F12, 0xFFE5},//FFC3 //TVAR_wbt_pBaseCcms[20] - {0x0F12, 0xFF26},//FEED //TVAR_wbt_pBaseCcms[21] - {0x0F12, 0x028E},//01B9 //TVAR_wbt_pBaseCcms[22] - {0x0F12, 0xFF80},//FF0D //TVAR_wbt_pBaseCcms[23] - {0x0F12, 0x0002},//FFE7 //TVAR_wbt_pBaseCcms[24] - {0x0F12, 0xFFA8},//FFD3 //TVAR_wbt_pBaseCcms[25] - {0x0F12, 0x01F0},//022F //TVAR_wbt_pBaseCcms[26] - {0x0F12, 0x0125},//0118 //TVAR_wbt_pBaseCcms[27] - {0x0F12, 0x0119},//012C //TVAR_wbt_pBaseCcms[28] - {0x0F12, 0xFE5A},//FED0 //TVAR_wbt_pBaseCcms[29] - {0x0F12, 0x0179},//0212 //TVAR_wbt_pBaseCcms[30] - {0x0F12, 0xFF8A},//FF46 //TVAR_wbt_pBaseCcms[31] - {0x0F12, 0x0180},//01F2 //TVAR_wbt_pBaseCcms[32] - {0x0F12, 0xFEC2},//FED4 //TVAR_wbt_pBaseCcms[33] - {0x0F12, 0x0176},//018C //TVAR_wbt_pBaseCcms[34] - {0x0F12, 0x0094},//013C //TVAR_wbt_pBaseCcms[35] - //WW - {0x0F12, 0x01CA},//0121 //TVAR_wbt_pBaseCcms[36] - {0x0F12, 0xFF89},//FF8D //TVAR_wbt_pBaseCcms[37] - {0x0F12, 0xFFE0},//FFA7 //TVAR_wbt_pBaseCcms[38] - {0x0F12, 0xFF26},//FF3D //TVAR_wbt_pBaseCcms[39] - {0x0F12, 0x028E},//02D0 //TVAR_wbt_pBaseCcms[40] - {0x0F12, 0xFF80},//FE31 //TVAR_wbt_pBaseCcms[41] - {0x0F12, 0x0020},//0016 //TVAR_wbt_pBaseCcms[42] - {0x0F12, 0xFFF8},//003B //TVAR_wbt_pBaseCcms[43] - {0x0F12, 0x01E0},//02E1 //TVAR_wbt_pBaseCcms[44] - {0x0F12, 0x0120},//0175 //TVAR_wbt_pBaseCcms[45] - {0x0F12, 0x00FA},//009C //TVAR_wbt_pBaseCcms[46] - {0x0F12, 0xFF12},//FE3A //TVAR_wbt_pBaseCcms[47] - {0x0F12, 0x0179},//0189 //TVAR_wbt_pBaseCcms[48] - {0x0F12, 0xFF8A},//FF6A //TVAR_wbt_pBaseCcms[49] - {0x0F12, 0x0180},//0298 //TVAR_wbt_pBaseCcms[50] - {0x0F12, 0xFEC2},//FF14 //TVAR_wbt_pBaseCcms[51] - {0x0F12, 0x0176},//01BD //TVAR_wbt_pBaseCcms[52] - {0x0F12, 0x0094},//00FB //TVAR_wbt_pBaseCcms[53] - //CWF - {0x0F12, 0x01CA},//018A//0262 //TVAR_wbt_pBaseCcms[54] - {0x0F12, 0xFF89},//FFC9//FFAB //TVAR_wbt_pBaseCcms[55] - {0x0F12, 0xFFE0},//0005//FFFB //TVAR_wbt_pBaseCcms[56] - {0x0F12, 0xFF26},//FFC1 //TVAR_wbt_pBaseCcms[57] - {0x0F12, 0x028E},//0292 //TVAR_wbt_pBaseCcms[58] - {0x0F12, 0xFF80},//FF81 //TVAR_wbt_pBaseCcms[59] - {0x0F12, 0x0020},//0069 //TVAR_wbt_pBaseCcms[60] - {0x0F12, 0xFFF8},//0057 //TVAR_wbt_pBaseCcms[61] - {0x0F12, 0x01E0},//0296 //TVAR_wbt_pBaseCcms[62] - {0x0F12, 0x0120},//00FF//015F //TVAR_wbt_pBaseCcms[63] - {0x0F12, 0x00FA},//00E2//0112 //TVAR_wbt_pBaseCcms[64] - {0x0F12, 0xFF12},//FF4D//FF17 //TVAR_wbt_pBaseCcms[65] - {0x0F12, 0x0179},//024E //TVAR_wbt_pBaseCcms[66] - {0x0F12, 0xFF8A},//0001 //TVAR_wbt_pBaseCcms[67] - {0x0F12, 0x0180},//0276 //TVAR_wbt_pBaseCcms[68] - {0x0F12, 0xFEC2},//FEE2 //TVAR_wbt_pBaseCcms[69] - {0x0F12, 0x0176},//0236 //TVAR_wbt_pBaseCcms[70] - {0x0F12, 0x0094},//014A //TVAR_wbt_pBaseCcms[71] - //D50 - //BEGIN: DTS2012071201781 modify by huyouhua at 2012-7-24 for D65 Sat too small - //{0x0F12, 0x018A},//01C5 //TVAR_wbt_pBaseCcms[72] - //{0x0F12, 0xFFC9},//FFA8 //TVAR_wbt_pBaseCcms[73] - //{0x0F12, 0x0005},//FFBA //TVAR_wbt_pBaseCcms[74] - {0x0F12, 0x01A9},//01C5 //TVAR_wbt_pBaseCcms[72] - {0x0F12, 0xFFB6},//FFA8 //TVAR_wbt_pBaseCcms[73] - {0x0F12, 0xFFF9},//FFBA //TVAR_wbt_pBaseCcms[74] - //END: DTS2012071201781 modify by huyouhua at 2012-7-24 for D65 Sat too small - {0x0F12, 0xFF56},//FF06 //TVAR_wbt_pBaseCcms[75] - {0x0F12, 0x0230},//0258 //TVAR_wbt_pBaseCcms[76] - {0x0F12, 0xFFA0},//FF52 //TVAR_wbt_pBaseCcms[77] - //BEGIN: DTS2012071201781 modify by huyouhua at 2012-7-24 for D65 Sat too small - //{0x0F12, 0x0020},//0036 //TVAR_wbt_pBaseCcms[78] - //{0x0F12, 0xFFF8},//FFFA //TVAR_wbt_pBaseCcms[79] - //{0x0F12, 0x01E0},//01D7 //TVAR_wbt_pBaseCcms[80] - //{0x0F12, 0x00FF},//00DE //TVAR_wbt_pBaseCcms[81] - //{0x0F12, 0x00E2},//013B //TVAR_wbt_pBaseCcms[82] - //{0x0F12, 0xFF4D},//FF30 //TVAR_wbt_pBaseCcms[83] - {0x0F12, 0x000E},//0036 //TVAR_wbt_pBaseCcms[78] - {0x0F12, 0xFFE0},//FFFA //TVAR_wbt_pBaseCcms[79] - {0x0F12, 0x020A},//01D7 //TVAR_wbt_pBaseCcms[80] - {0x0F12, 0x010C},//00DE //TVAR_wbt_pBaseCcms[81] - {0x0F12, 0x00EC},//013B //TVAR_wbt_pBaseCcms[82] - {0x0F12, 0xFF36},//FF30 //TVAR_wbt_pBaseCcms[83] - //END: DTS2012071201781 modify by huyouhua at 2012-7-24 for D65 Sat too small - {0x0F12, 0x0179},//0168 //TVAR_wbt_pBaseCcms[84] - {0x0F12, 0xFF8A},//FF6F //TVAR_wbt_pBaseCcms[85] - {0x0F12, 0x0180},//0164 //TVAR_wbt_pBaseCcms[86] - {0x0F12, 0xFEC2},//FEDB //TVAR_wbt_pBaseCcms[87] - {0x0F12, 0x0176},//0195 //TVAR_wbt_pBaseCcms[88] - {0x0F12, 0x0094},//00E7 //TVAR_wbt_pBaseCcms[89] - //D65 - //BEGIN: DTS2012071201781 modify by huyouhua at 2012-7-24 for D65 Sat too small - //{0x0F12, 0x018A},//019E //TVAR_wbt_pBaseCcms[90] - //{0x0F12, 0xFFC9},//FF8A //TVAR_wbt_pBaseCcms[91] - //{0x0F12, 0x0005},//FFCE //TVAR_wbt_pBaseCcms[92] - {0x0F12, 0x01A9},//019E //TVAR_wbt_pBaseCcms[90] - {0x0F12, 0xFFB6},//FF8A //TVAR_wbt_pBaseCcms[91] - {0x0F12, 0xFFF9},//FFCE //TVAR_wbt_pBaseCcms[92] - //END: DTS2012071201781 modify by huyouhua at 2012-7-24 for D65 Sat too small - {0x0F12, 0xFF56},//FF06 //TVAR_wbt_pBaseCcms[93] - {0x0F12, 0x0230},//0258 //TVAR_wbt_pBaseCcms[94] - {0x0F12, 0xFFA0},//FF52 //TVAR_wbt_pBaseCcms[95] - //BEGIN: DTS2012071201781 modify by huyouhua at 2012-7-24 for D65 Sat too small - //{0x0F12, 0x0020},//0036 //TVAR_wbt_pBaseCcms[96] - //{0x0F12, 0xFFF8},//FFFA //TVAR_wbt_pBaseCcms[97] - //{0x0F12, 0x01E0},//01D7 //TVAR_wbt_pBaseCcms[98] - //{0x0F12, 0x00FF},//00DE //TVAR_wbt_pBaseCcms[99] - //{0x0F12, 0x00E2},//013B //TVAR_wbt_pBaseCcms[100] - //{0x0F12, 0xFF4D},//FF30 //TVAR_wbt_pBaseCcms[101] - {0x0F12, 0x000E},//0036 //TVAR_wbt_pBaseCcms[96] - {0x0F12, 0xFFE0},//FFFA //TVAR_wbt_pBaseCcms[97] - {0x0F12, 0x020A},//01D7 //TVAR_wbt_pBaseCcms[98] - {0x0F12, 0x010C},//00DE //TVAR_wbt_pBaseCcms[99] - {0x0F12, 0x00EC},//013B //TVAR_wbt_pBaseCcms[100] - {0x0F12, 0xFF36},//FF30 //TVAR_wbt_pBaseCcms[101] - //END: DTS2012071201781 modify by huyouhua at 2012-7-24 for D65 Sat too small - {0x0F12, 0x0179},//0168 //TVAR_wbt_pBaseCcms[102] - {0x0F12, 0xFF8A},//FF6F //TVAR_wbt_pBaseCcms[103] - {0x0F12, 0x0180},//0164 //TVAR_wbt_pBaseCcms[104] - {0x0F12, 0xFEC2},//FEDB //TVAR_wbt_pBaseCcms[105] - {0x0F12, 0x0176},//0195 //TVAR_wbt_pBaseCcms[106] - {0x0F12, 0x0094},//00E7 //TVAR_wbt_pBaseCcms[107] - // param_end TVAR_wbt_pBaseCcms - // param_start TVAR_wbt_pOutdoorCcm - {0x002A, 0x3380}, - {0x0F12, 0x018A},//01C7 //TVAR_wbt_pOutdoorCcm[0] - {0x0F12, 0xFFC9},//FFA0 //TVAR_wbt_pOutdoorCcm[1] - {0x0F12, 0x0005},//FFE8 //TVAR_wbt_pOutdoorCcm[2] - {0x0F12, 0xFF26},//FF11 //TVAR_wbt_pOutdoorCcm[3] - {0x0F12, 0x028E},//01F4 //TVAR_wbt_pOutdoorCcm[4] - {0x0F12, 0xFF80},//FF38 //TVAR_wbt_pOutdoorCcm[5] - {0x0F12, 0x0020},//FFDF //TVAR_wbt_pOutdoorCcm[6] - {0x0F12, 0xFFF8},//FFD3 //TVAR_wbt_pOutdoorCcm[7] - {0x0F12, 0x01E0},//01CC //TVAR_wbt_pOutdoorCcm[8] - {0x0F12, 0x00FF},//011D //TVAR_wbt_pOutdoorCcm[9] - {0x0F12, 0x00E2},//0157 //TVAR_wbt_pOutdoorCcm[10] - {0x0F12, 0xFF4D},//FF16 //TVAR_wbt_pOutdoorCcm[11] - {0x0F12, 0x0179},//01DA //TVAR_wbt_pOutdoorCcm[12] - {0x0F12, 0xFF8A},//FF3A //TVAR_wbt_pOutdoorCcm[13] - {0x0F12, 0x0180},//01B6 //TVAR_wbt_pOutdoorCcm[14] - {0x0F12, 0xFEC2},//FF2A //TVAR_wbt_pOutdoorCcm[15] - {0x0F12, 0x0176},//0176 //TVAR_wbt_pOutdoorCcm[16] - {0x0F12, 0x0094},//0114 //TVAR_wbt_pOutdoorCcm[17] - // param_end TVAR_wbt_pOutdoorCcm - //============================================================ - //AFIT - //============================================================ - // param_start afit_uNoiseIndInDoor - //============================================================ - {0x002A, 0x0764}, - {0x0F12, 0x0041}, //afit_uNoiseIndInDoor[0] - {0x0F12, 0x00A5}, //afit_uNoiseIndInDoor[1] - {0x0F12, 0x016B}, //afit_uNoiseIndInDoor[2] - {0x0F12, 0x0226}, //afit_uNoiseIndInDoor[3] - {0x0F12, 0x02EA}, //afit_uNoiseIndInDoor[4] - // param_end afit_uNoiseIndInDoor - // param_start TVAR_afit_pBaseVals - {0x002A, 0x07C4}, - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[0] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[1] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[2] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[3] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[4] - {0x0F12, 0x001E}, //TVAR_afit_pBaseVals[5] - {0x0F12, 0x03FF}, //TVAR_afit_pBaseVals[6] - {0x0F12, 0x009C}, //TVAR_afit_pBaseVals[7] - {0x0F12, 0x017C}, //TVAR_afit_pBaseVals[8] - {0x0F12, 0x03FF}, //TVAR_afit_pBaseVals[9] - {0x0F12, 0x000C}, //TVAR_afit_pBaseVals[10] - {0x0F12, 0x0010}, //TVAR_afit_pBaseVals[11] - {0x0F12, 0x0104}, //TVAR_afit_pBaseVals[12] - {0x0F12, 0x03E8}, //TVAR_afit_pBaseVals[13] - {0x0F12, 0x0023}, //TVAR_afit_pBaseVals[14] - {0x0F12, 0x012C}, //TVAR_afit_pBaseVals[15] - {0x0F12, 0x0070}, //TVAR_afit_pBaseVals[16] - {0x0F12, 0x0004}, //TVAR_afit_pBaseVals[17] - {0x0F12, 0x0004}, //TVAR_afit_pBaseVals[18] - {0x0F12, 0x01AA}, //TVAR_afit_pBaseVals[19] - {0x0F12, 0x0064}, //TVAR_afit_pBaseVals[20] - {0x0F12, 0x0064}, //TVAR_afit_pBaseVals[21] - {0x0F12, 0x000A}, //TVAR_afit_pBaseVals[22] - {0x0F12, 0x000A}, //TVAR_afit_pBaseVals[23] - {0x0F12, 0x002A}, //TVAR_afit_pBaseVals[24] - {0x0F12, 0x0024}, //TVAR_afit_pBaseVals[25] - {0x0F12, 0x002A}, //TVAR_afit_pBaseVals[26] - {0x0F12, 0x0024}, //TVAR_afit_pBaseVals[27] - {0x0F12, 0x002A}, //TVAR_afit_pBaseVals[28] - {0x0F12, 0x0024}, //TVAR_afit_pBaseVals[29] - {0x0F12, 0x0A0F}, //TVAR_afit_pBaseVals[30] - {0x0F12, 0x1701}, //TVAR_afit_pBaseVals[31] - {0x0F12, 0x0229}, //TVAR_afit_pBaseVals[32] - {0x0F12, 0x1403}, //TVAR_afit_pBaseVals[33] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[34] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[35] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[36] - {0x0F12, 0x00FF}, //TVAR_afit_pBaseVals[37] - {0x0F12, 0x053B}, //TVAR_afit_pBaseVals[38] - {0x0F12, 0x0505}, //TVAR_afit_pBaseVals[39] - {0x0F12, 0x0301}, //TVAR_afit_pBaseVals[40] - {0x0F12, 0x8007}, //TVAR_afit_pBaseVals[41] - {0x0F12, 0x051E}, //TVAR_afit_pBaseVals[42] - {0x0F12, 0x0A1E}, //TVAR_afit_pBaseVals[43] - {0x0F12, 0x0F0F}, //TVAR_afit_pBaseVals[44] - {0x0F12, 0x0A05}, //TVAR_afit_pBaseVals[45] - {0x0F12, 0x103C}, //TVAR_afit_pBaseVals[46] - {0x0F12, 0x0A28}, //TVAR_afit_pBaseVals[47] - {0x0F12, 0x0002}, //TVAR_afit_pBaseVals[48] - {0x0F12, 0x00FF}, //TVAR_afit_pBaseVals[49] - {0x0F12, 0x1002}, //TVAR_afit_pBaseVals[50] - {0x0F12, 0x001D}, //TVAR_afit_pBaseVals[51] - {0x0F12, 0x0900}, //TVAR_afit_pBaseVals[52] - {0x0F12, 0x0600}, //TVAR_afit_pBaseVals[53] - {0x0F12, 0x0504}, //TVAR_afit_pBaseVals[54] - {0x0F12, 0x0305}, //TVAR_afit_pBaseVals[55] - {0x0F12, 0x5A03}, //TVAR_afit_pBaseVals[56] - {0x0F12, 0x006E}, //TVAR_afit_pBaseVals[57] - {0x0F12, 0x0A78}, //TVAR_afit_pBaseVals[58] - {0x0F12, 0x0080}, //TVAR_afit_pBaseVals[59] - {0x0F12, 0x3232}, //TVAR_afit_pBaseVals[60] - {0x0F12, 0x0101}, //TVAR_afit_pBaseVals[61] - {0x0F12, 0x5001}, //TVAR_afit_pBaseVals[62] - {0x0F12, 0x7850}, //TVAR_afit_pBaseVals[63] - {0x0F12, 0x2878}, //TVAR_afit_pBaseVals[64] - {0x0F12, 0x0A00}, //TVAR_afit_pBaseVals[65] - {0x0F12, 0x1403}, //TVAR_afit_pBaseVals[66] - {0x0F12, 0x1E07}, //TVAR_afit_pBaseVals[67] - {0x0F12, 0x070A}, //TVAR_afit_pBaseVals[68] - {0x0F12, 0x32FF}, //TVAR_afit_pBaseVals[69] - {0x0F12, 0x5004}, //TVAR_afit_pBaseVals[70] - {0x0F12, 0x0F40}, //TVAR_afit_pBaseVals[71] - {0x0F12, 0x400F}, //TVAR_afit_pBaseVals[72] - {0x0F12, 0x0204}, //TVAR_afit_pBaseVals[73] - {0x0F12, 0x3203}, //TVAR_afit_pBaseVals[74] - {0x0F12, 0x0132}, //TVAR_afit_pBaseVals[75] - {0x0F12, 0x0101}, //TVAR_afit_pBaseVals[76] - {0x0F12, 0x5050}, //TVAR_afit_pBaseVals[77] - {0x0F12, 0x7878}, //TVAR_afit_pBaseVals[78] - {0x0F12, 0x0028}, //TVAR_afit_pBaseVals[79] - {0x0F12, 0x030A}, //TVAR_afit_pBaseVals[80] - {0x0F12, 0x0714}, //TVAR_afit_pBaseVals[81] - {0x0F12, 0x0A1E}, //TVAR_afit_pBaseVals[82] - {0x0F12, 0xFF07}, //TVAR_afit_pBaseVals[83] - {0x0F12, 0x0432}, //TVAR_afit_pBaseVals[84] - {0x0F12, 0x4050}, //TVAR_afit_pBaseVals[85] - {0x0F12, 0x0F0F}, //TVAR_afit_pBaseVals[86] - {0x0F12, 0x0440}, //TVAR_afit_pBaseVals[87] - {0x0F12, 0x0302}, //TVAR_afit_pBaseVals[88] - {0x0F12, 0x3232}, //TVAR_afit_pBaseVals[89] - {0x0F12, 0x0101}, //TVAR_afit_pBaseVals[90] - {0x0F12, 0x5001}, //TVAR_afit_pBaseVals[91] - {0x0F12, 0x7850}, //TVAR_afit_pBaseVals[92] - {0x0F12, 0x2878}, //TVAR_afit_pBaseVals[93] - {0x0F12, 0x0A00}, //TVAR_afit_pBaseVals[94] - {0x0F12, 0x1403}, //TVAR_afit_pBaseVals[95] - {0x0F12, 0x1E07}, //TVAR_afit_pBaseVals[96] - {0x0F12, 0x070A}, //TVAR_afit_pBaseVals[97] - {0x0F12, 0x32FF}, //TVAR_afit_pBaseVals[98] - {0x0F12, 0x5004}, //TVAR_afit_pBaseVals[99] - {0x0F12, 0x0F40}, //TVAR_afit_pBaseVals[100] - {0x0F12, 0x400F}, //TVAR_afit_pBaseVals[101] - {0x0F12, 0x0204}, //TVAR_afit_pBaseVals[102] - {0x0F12, 0x0003}, //TVAR_afit_pBaseVals[103] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[104] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[105] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[106] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[107] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[108] - {0x0F12, 0x001E}, //TVAR_afit_pBaseVals[109] - {0x0F12, 0x03FF}, //TVAR_afit_pBaseVals[110] - {0x0F12, 0x009C}, //TVAR_afit_pBaseVals[111] - {0x0F12, 0x017C}, //TVAR_afit_pBaseVals[112] - {0x0F12, 0x03FF}, //TVAR_afit_pBaseVals[113] - {0x0F12, 0x000C}, //TVAR_afit_pBaseVals[114] - {0x0F12, 0x0010}, //TVAR_afit_pBaseVals[115] - {0x0F12, 0x0104}, //TVAR_afit_pBaseVals[116] - {0x0F12, 0x03E8}, //TVAR_afit_pBaseVals[117] - {0x0F12, 0x0023}, //TVAR_afit_pBaseVals[118] - {0x0F12, 0x012C}, //TVAR_afit_pBaseVals[119] - {0x0F12, 0x0070}, //TVAR_afit_pBaseVals[120] - {0x0F12, 0x0004}, //TVAR_afit_pBaseVals[121] - {0x0F12, 0x0004}, //TVAR_afit_pBaseVals[122] - {0x0F12, 0x01AA}, //TVAR_afit_pBaseVals[123] - {0x0F12, 0x001E}, //TVAR_afit_pBaseVals[124] - {0x0F12, 0x001E}, //TVAR_afit_pBaseVals[125] - {0x0F12, 0x0005}, //TVAR_afit_pBaseVals[126] - {0x0F12, 0x0005}, //TVAR_afit_pBaseVals[127] - {0x0F12, 0x002A}, //TVAR_afit_pBaseVals[128] - {0x0F12, 0x0024}, //TVAR_afit_pBaseVals[129] - {0x0F12, 0x002A}, //TVAR_afit_pBaseVals[130] - {0x0F12, 0x0024}, //TVAR_afit_pBaseVals[131] - {0x0F12, 0x002A}, //TVAR_afit_pBaseVals[132] - {0x0F12, 0x0024}, //TVAR_afit_pBaseVals[133] - {0x0F12, 0x0A0F}, //TVAR_afit_pBaseVals[134] - {0x0F12, 0x1701}, //TVAR_afit_pBaseVals[135] - {0x0F12, 0x0229}, //TVAR_afit_pBaseVals[136] - {0x0F12, 0x1403}, //TVAR_afit_pBaseVals[137] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[138] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[139] - {0x0F12, 0x0101}, //TVAR_afit_pBaseVals[140] - {0x0F12, 0x00FF}, //TVAR_afit_pBaseVals[141] - {0x0F12, 0x053B}, //TVAR_afit_pBaseVals[142] - {0x0F12, 0x0505}, //TVAR_afit_pBaseVals[143] - {0x0F12, 0x0301}, //TVAR_afit_pBaseVals[144] - {0x0F12, 0x8007}, //TVAR_afit_pBaseVals[145] - {0x0F12, 0x051E}, //TVAR_afit_pBaseVals[146] - {0x0F12, 0x0A1E}, //TVAR_afit_pBaseVals[147] - {0x0F12, 0x0F0F}, //TVAR_afit_pBaseVals[148] - {0x0F12, 0x0A04}, //TVAR_afit_pBaseVals[149] - {0x0F12, 0x103C}, //TVAR_afit_pBaseVals[150] - {0x0F12, 0x0A28}, //TVAR_afit_pBaseVals[151] - {0x0F12, 0x0002}, //TVAR_afit_pBaseVals[152] - {0x0F12, 0x00FF}, //TVAR_afit_pBaseVals[153] - {0x0F12, 0x1002}, //TVAR_afit_pBaseVals[154] - {0x0F12, 0x001D}, //TVAR_afit_pBaseVals[155] - {0x0F12, 0x0900}, //TVAR_afit_pBaseVals[156] - {0x0F12, 0x0600}, //TVAR_afit_pBaseVals[157] - {0x0F12, 0x0504}, //TVAR_afit_pBaseVals[158] - {0x0F12, 0x0305}, //TVAR_afit_pBaseVals[159] - {0x0F12, 0x5F03}, //TVAR_afit_pBaseVals[160] - {0x0F12, 0x0080}, //TVAR_afit_pBaseVals[161] - {0x0F12, 0x0080}, //TVAR_afit_pBaseVals[162] - {0x0F12, 0x0080}, //TVAR_afit_pBaseVals[163] - {0x0F12, 0x3232}, //TVAR_afit_pBaseVals[164] - {0x0F12, 0x0101}, //TVAR_afit_pBaseVals[165] - {0x0F12, 0x2A01}, //TVAR_afit_pBaseVals[166] - {0x0F12, 0x3232}, //TVAR_afit_pBaseVals[167] - {0x0F12, 0x2830}, //TVAR_afit_pBaseVals[168] - {0x0F12, 0x0A00}, //TVAR_afit_pBaseVals[169] - {0x0F12, 0x1403}, //TVAR_afit_pBaseVals[170] - {0x0F12, 0x1E07}, //TVAR_afit_pBaseVals[171] - {0x0F12, 0x070A}, //TVAR_afit_pBaseVals[172] - {0x0F12, 0x32FF}, //TVAR_afit_pBaseVals[173] - {0x0F12, 0x5004}, //TVAR_afit_pBaseVals[174] - {0x0F12, 0x0F40}, //TVAR_afit_pBaseVals[175] - {0x0F12, 0x400F}, //TVAR_afit_pBaseVals[176] - {0x0F12, 0x0204}, //TVAR_afit_pBaseVals[177] - {0x0F12, 0x3203}, //TVAR_afit_pBaseVals[178] - {0x0F12, 0x0132}, //TVAR_afit_pBaseVals[179] - {0x0F12, 0x0101}, //TVAR_afit_pBaseVals[180] - {0x0F12, 0x262A}, //TVAR_afit_pBaseVals[181] - {0x0F12, 0x3032}, //TVAR_afit_pBaseVals[182] - {0x0F12, 0x0028}, //TVAR_afit_pBaseVals[183] - {0x0F12, 0x030A}, //TVAR_afit_pBaseVals[184] - {0x0F12, 0x0714}, //TVAR_afit_pBaseVals[185] - {0x0F12, 0x0A1E}, //TVAR_afit_pBaseVals[186] - {0x0F12, 0xFF07}, //TVAR_afit_pBaseVals[187] - {0x0F12, 0x0432}, //TVAR_afit_pBaseVals[188] - {0x0F12, 0x4050}, //TVAR_afit_pBaseVals[189] - {0x0F12, 0x0F0F}, //TVAR_afit_pBaseVals[190] - {0x0F12, 0x0440}, //TVAR_afit_pBaseVals[191] - {0x0F12, 0x0302}, //TVAR_afit_pBaseVals[192] - {0x0F12, 0x3232}, //TVAR_afit_pBaseVals[193] - {0x0F12, 0x0101}, //TVAR_afit_pBaseVals[194] - {0x0F12, 0x2A01}, //TVAR_afit_pBaseVals[195] - {0x0F12, 0x3226}, //TVAR_afit_pBaseVals[196] - {0x0F12, 0x2830}, //TVAR_afit_pBaseVals[197] - {0x0F12, 0x0A00}, //TVAR_afit_pBaseVals[198] - {0x0F12, 0x1403}, //TVAR_afit_pBaseVals[199] - {0x0F12, 0x1E07}, //TVAR_afit_pBaseVals[200] - {0x0F12, 0x070A}, //TVAR_afit_pBaseVals[201] - {0x0F12, 0x32FF}, //TVAR_afit_pBaseVals[202] - {0x0F12, 0x5004}, //TVAR_afit_pBaseVals[203] - {0x0F12, 0x0F40}, //TVAR_afit_pBaseVals[204] - {0x0F12, 0x400F}, //TVAR_afit_pBaseVals[205] - {0x0F12, 0x0204}, //TVAR_afit_pBaseVals[206] - {0x0F12, 0x0003}, //TVAR_afit_pBaseVals[207] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[208] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[209] - {0x0F12, 0x000f}, //TVAR_afit_pBaseVals[210]//DTS2012071201781:modify by huyouhua at 2012-7-23 - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[211] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[212] - {0x0F12, 0x001E}, //TVAR_afit_pBaseVals[213] - {0x0F12, 0x03FF}, //TVAR_afit_pBaseVals[214] - {0x0F12, 0x009C}, //TVAR_afit_pBaseVals[215] - {0x0F12, 0x017C}, //TVAR_afit_pBaseVals[216] - {0x0F12, 0x03FF}, //TVAR_afit_pBaseVals[217] - {0x0F12, 0x000C}, //TVAR_afit_pBaseVals[218] - {0x0F12, 0x0010}, //TVAR_afit_pBaseVals[219] - {0x0F12, 0x012C}, //TVAR_afit_pBaseVals[220] - {0x0F12, 0x03E8}, //TVAR_afit_pBaseVals[221] - {0x0F12, 0x0041}, //TVAR_afit_pBaseVals[222] - {0x0F12, 0x005A}, //TVAR_afit_pBaseVals[223] - {0x0F12, 0x0070}, //TVAR_afit_pBaseVals[224] - {0x0F12, 0x0004}, //TVAR_afit_pBaseVals[225] - {0x0F12, 0x0004}, //TVAR_afit_pBaseVals[226] - {0x0F12, 0x01AA}, //TVAR_afit_pBaseVals[227] - {0x0F12, 0x001E}, //TVAR_afit_pBaseVals[228] - {0x0F12, 0x001E}, //TVAR_afit_pBaseVals[229] - {0x0F12, 0x000A}, //TVAR_afit_pBaseVals[230] - {0x0F12, 0x000A}, //TVAR_afit_pBaseVals[231] - {0x0F12, 0x0032}, //TVAR_afit_pBaseVals[232] - {0x0F12, 0x0028}, //TVAR_afit_pBaseVals[233] - {0x0F12, 0x0032}, //TVAR_afit_pBaseVals[234] - {0x0F12, 0x0028}, //TVAR_afit_pBaseVals[235] - {0x0F12, 0x0032}, //TVAR_afit_pBaseVals[236] - {0x0F12, 0x0028}, //TVAR_afit_pBaseVals[237] - {0x0F12, 0x0A0F}, //TVAR_afit_pBaseVals[238] - {0x0F12, 0x1701}, //TVAR_afit_pBaseVals[239] - {0x0F12, 0x0229}, //TVAR_afit_pBaseVals[240] - {0x0F12, 0x1403}, //TVAR_afit_pBaseVals[241] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[242] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[243] - {0x0F12, 0x0404}, //TVAR_afit_pBaseVals[244] - {0x0F12, 0x00FF}, //TVAR_afit_pBaseVals[245] - {0x0F12, 0x043B}, //TVAR_afit_pBaseVals[246] - {0x0F12, 0x0505}, //TVAR_afit_pBaseVals[247] - {0x0F12, 0x0301}, //TVAR_afit_pBaseVals[248] - {0x0F12, 0x8007}, //TVAR_afit_pBaseVals[249] - {0x0F12, 0x051E}, //TVAR_afit_pBaseVals[250] - {0x0F12, 0x0A1E}, //TVAR_afit_pBaseVals[251] - {0x0F12, 0x0F0F}, //TVAR_afit_pBaseVals[252] - {0x0F12, 0x0A03}, //TVAR_afit_pBaseVals[253] - {0x0F12, 0x0A3C}, //TVAR_afit_pBaseVals[254] - {0x0F12, 0x0528}, //TVAR_afit_pBaseVals[255] - {0x0F12, 0x0002}, //TVAR_afit_pBaseVals[256] - {0x0F12, 0x00FF}, //TVAR_afit_pBaseVals[257] - {0x0F12, 0x1002}, //TVAR_afit_pBaseVals[258] - {0x0F12, 0x001D}, //TVAR_afit_pBaseVals[259] - {0x0F12, 0x0900}, //TVAR_afit_pBaseVals[260] - {0x0F12, 0x0600}, //TVAR_afit_pBaseVals[261] - {0x0F12, 0x0504}, //TVAR_afit_pBaseVals[262] - {0x0F12, 0x0305}, //TVAR_afit_pBaseVals[263] - {0x0F12, 0x6902}, //TVAR_afit_pBaseVals[264] - {0x0F12, 0x0080}, //TVAR_afit_pBaseVals[265] - {0x0F12, 0x0080}, //TVAR_afit_pBaseVals[266] - {0x0F12, 0x0080}, //TVAR_afit_pBaseVals[267] - {0x0F12, 0x2D2D}, //TVAR_afit_pBaseVals[268] - {0x0F12, 0x0101}, //TVAR_afit_pBaseVals[269] - {0x0F12, 0x2001}, //TVAR_afit_pBaseVals[270] - {0x0F12, 0x2026}, //TVAR_afit_pBaseVals[271] - {0x0F12, 0x281E}, //TVAR_afit_pBaseVals[272] - {0x0F12, 0x0A00}, //TVAR_afit_pBaseVals[273] - {0x0F12, 0x0A03}, //TVAR_afit_pBaseVals[274] - {0x0F12, 0x1E0A}, //TVAR_afit_pBaseVals[275] - {0x0F12, 0x070A}, //TVAR_afit_pBaseVals[276] - {0x0F12, 0x32FF}, //TVAR_afit_pBaseVals[277] - {0x0F12, 0x5004}, //TVAR_afit_pBaseVals[278] - {0x0F12, 0x0F40}, //TVAR_afit_pBaseVals[279] - {0x0F12, 0x400F}, //TVAR_afit_pBaseVals[280] - {0x0F12, 0x0204}, //TVAR_afit_pBaseVals[281] - {0x0F12, 0x3203}, //TVAR_afit_pBaseVals[282] - {0x0F12, 0x0132}, //TVAR_afit_pBaseVals[283] - {0x0F12, 0x0101}, //TVAR_afit_pBaseVals[284] - {0x0F12, 0x1C20}, //TVAR_afit_pBaseVals[285] - {0x0F12, 0x1C1E}, //TVAR_afit_pBaseVals[286] - {0x0F12, 0x0028}, //TVAR_afit_pBaseVals[287] - {0x0F12, 0x030A}, //TVAR_afit_pBaseVals[288] - {0x0F12, 0x0A0A}, //TVAR_afit_pBaseVals[289] - {0x0F12, 0x0A1E}, //TVAR_afit_pBaseVals[290] - {0x0F12, 0xFF07}, //TVAR_afit_pBaseVals[291] - {0x0F12, 0x0432}, //TVAR_afit_pBaseVals[292] - {0x0F12, 0x4050}, //TVAR_afit_pBaseVals[293] - {0x0F12, 0x0F0F}, //TVAR_afit_pBaseVals[294] - {0x0F12, 0x0440}, //TVAR_afit_pBaseVals[295] - {0x0F12, 0x0302}, //TVAR_afit_pBaseVals[296] - {0x0F12, 0x3232}, //TVAR_afit_pBaseVals[297] - {0x0F12, 0x0101}, //TVAR_afit_pBaseVals[298] - {0x0F12, 0x2001}, //TVAR_afit_pBaseVals[299] - {0x0F12, 0x1E1C}, //TVAR_afit_pBaseVals[300] - {0x0F12, 0x281C}, //TVAR_afit_pBaseVals[301] - {0x0F12, 0x0A00}, //TVAR_afit_pBaseVals[302] - {0x0F12, 0x0A03}, //TVAR_afit_pBaseVals[303] - {0x0F12, 0x1E0A}, //TVAR_afit_pBaseVals[304] - {0x0F12, 0x070A}, //TVAR_afit_pBaseVals[305] - {0x0F12, 0x32FF}, //TVAR_afit_pBaseVals[306] - {0x0F12, 0x5004}, //TVAR_afit_pBaseVals[307] - {0x0F12, 0x0F40}, //TVAR_afit_pBaseVals[308] - {0x0F12, 0x400F}, //TVAR_afit_pBaseVals[309] - {0x0F12, 0x0204}, //TVAR_afit_pBaseVals[310] - {0x0F12, 0x0003}, //TVAR_afit_pBaseVals[311] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[312] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[313] - {0x0F12, 0x000f}, //TVAR_afit_pBaseVals[314]//DTS2012071201781:modify by huyouhua at 2012-7-23 - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[315] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[316] - {0x0F12, 0x001E}, //TVAR_afit_pBaseVals[317] - {0x0F12, 0x03FF}, //TVAR_afit_pBaseVals[318] - {0x0F12, 0x009C}, //TVAR_afit_pBaseVals[319] - {0x0F12, 0x017C}, //TVAR_afit_pBaseVals[320] - {0x0F12, 0x03FF}, //TVAR_afit_pBaseVals[321] - {0x0F12, 0x000C}, //TVAR_afit_pBaseVals[322] - {0x0F12, 0x0010}, //TVAR_afit_pBaseVals[323] - {0x0F12, 0x012C}, //TVAR_afit_pBaseVals[324] - {0x0F12, 0x03E8}, //TVAR_afit_pBaseVals[325] - {0x0F12, 0x0050}, //TVAR_afit_pBaseVals[326] - {0x0F12, 0x00C8}, //TVAR_afit_pBaseVals[327] - {0x0F12, 0x0070}, //TVAR_afit_pBaseVals[328] - {0x0F12, 0x0004}, //TVAR_afit_pBaseVals[329] - {0x0F12, 0x0004}, //TVAR_afit_pBaseVals[330] - {0x0F12, 0x01AA}, //TVAR_afit_pBaseVals[331] - {0x0F12, 0x0014}, //TVAR_afit_pBaseVals[332] - {0x0F12, 0x0014}, //TVAR_afit_pBaseVals[333] - {0x0F12, 0x000A}, //TVAR_afit_pBaseVals[334] - {0x0F12, 0x000A}, //TVAR_afit_pBaseVals[335] - {0x0F12, 0x0032}, //TVAR_afit_pBaseVals[336] - {0x0F12, 0x0023}, //TVAR_afit_pBaseVals[337] - {0x0F12, 0x0032}, //TVAR_afit_pBaseVals[338] - {0x0F12, 0x0028}, //TVAR_afit_pBaseVals[339] - {0x0F12, 0x0032}, //TVAR_afit_pBaseVals[340] - {0x0F12, 0x0028}, //TVAR_afit_pBaseVals[341] - {0x0F12, 0x0A0F}, //TVAR_afit_pBaseVals[342] - {0x0F12, 0x1701}, //TVAR_afit_pBaseVals[343] - {0x0F12, 0x0229}, //TVAR_afit_pBaseVals[344] - {0x0F12, 0x1403}, //TVAR_afit_pBaseVals[345] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[346] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[347] - {0x0F12, 0x0404}, //TVAR_afit_pBaseVals[348] - {0x0F12, 0x00FF}, //TVAR_afit_pBaseVals[349] - {0x0F12, 0x033B}, //TVAR_afit_pBaseVals[350] - {0x0F12, 0x0505}, //TVAR_afit_pBaseVals[351] - {0x0F12, 0x0301}, //TVAR_afit_pBaseVals[352] - {0x0F12, 0x8007}, //TVAR_afit_pBaseVals[353] - {0x0F12, 0x051E}, //TVAR_afit_pBaseVals[354] - {0x0F12, 0x0A1E}, //TVAR_afit_pBaseVals[355] - {0x0F12, 0x0F0F}, //TVAR_afit_pBaseVals[356] - {0x0F12, 0x0A03}, //TVAR_afit_pBaseVals[357] - {0x0F12, 0x0A3C}, //TVAR_afit_pBaseVals[358] - {0x0F12, 0x0828}, //TVAR_afit_pBaseVals[359] - {0x0F12, 0x0002}, //TVAR_afit_pBaseVals[360] - {0x0F12, 0x00FF}, //TVAR_afit_pBaseVals[361] - {0x0F12, 0x1002}, //TVAR_afit_pBaseVals[362] - {0x0F12, 0x001D}, //TVAR_afit_pBaseVals[363] - {0x0F12, 0x0900}, //TVAR_afit_pBaseVals[364] - {0x0F12, 0x0600}, //TVAR_afit_pBaseVals[365] - {0x0F12, 0x0504}, //TVAR_afit_pBaseVals[366] - {0x0F12, 0x0305}, //TVAR_afit_pBaseVals[367] - {0x0F12, 0x6F02}, //TVAR_afit_pBaseVals[368] - {0x0F12, 0x0080}, //TVAR_afit_pBaseVals[369] - {0x0F12, 0x0080}, //TVAR_afit_pBaseVals[370] - {0x0F12, 0x0080}, //TVAR_afit_pBaseVals[371] - {0x0F12, 0x323C}, //TVAR_afit_pBaseVals[372] - {0x0F12, 0x0101}, //TVAR_afit_pBaseVals[373] - {0x0F12, 0x1A01}, //TVAR_afit_pBaseVals[374] - {0x0F12, 0x1A1E}, //TVAR_afit_pBaseVals[375] - {0x0F12, 0x2818}, //TVAR_afit_pBaseVals[376] - {0x0F12, 0x0A00}, //TVAR_afit_pBaseVals[377] - {0x0F12, 0x1403}, //TVAR_afit_pBaseVals[378] - {0x0F12, 0x1905}, //TVAR_afit_pBaseVals[379] - {0x0F12, 0x060E}, //TVAR_afit_pBaseVals[380] - {0x0F12, 0x32FF}, //TVAR_afit_pBaseVals[381] - {0x0F12, 0x5004}, //TVAR_afit_pBaseVals[382] - {0x0F12, 0x1440}, //TVAR_afit_pBaseVals[383] - {0x0F12, 0x4015}, //TVAR_afit_pBaseVals[384] - {0x0F12, 0x0204}, //TVAR_afit_pBaseVals[385] - {0x0F12, 0x3C03}, //TVAR_afit_pBaseVals[386] - {0x0F12, 0x013C}, //TVAR_afit_pBaseVals[387] - {0x0F12, 0x0101}, //TVAR_afit_pBaseVals[388] - {0x0F12, 0x141A}, //TVAR_afit_pBaseVals[389] - {0x0F12, 0x181A}, //TVAR_afit_pBaseVals[390] - {0x0F12, 0x0028}, //TVAR_afit_pBaseVals[391] - {0x0F12, 0x030A}, //TVAR_afit_pBaseVals[392] - {0x0F12, 0x0614}, //TVAR_afit_pBaseVals[393] - {0x0F12, 0x0A19}, //TVAR_afit_pBaseVals[394] - {0x0F12, 0xFF06}, //TVAR_afit_pBaseVals[395] - {0x0F12, 0x0432}, //TVAR_afit_pBaseVals[396] - {0x0F12, 0x4050}, //TVAR_afit_pBaseVals[397] - {0x0F12, 0x1514}, //TVAR_afit_pBaseVals[398] - {0x0F12, 0x0440}, //TVAR_afit_pBaseVals[399] - {0x0F12, 0x0302}, //TVAR_afit_pBaseVals[400] - {0x0F12, 0x3C3C}, //TVAR_afit_pBaseVals[401] - {0x0F12, 0x0101}, //TVAR_afit_pBaseVals[402] - {0x0F12, 0x1A01}, //TVAR_afit_pBaseVals[403] - {0x0F12, 0x1A14}, //TVAR_afit_pBaseVals[404] - {0x0F12, 0x2818}, //TVAR_afit_pBaseVals[405] - {0x0F12, 0x0A00}, //TVAR_afit_pBaseVals[406] - {0x0F12, 0x1403}, //TVAR_afit_pBaseVals[407] - {0x0F12, 0x1906}, //TVAR_afit_pBaseVals[408] - {0x0F12, 0x060A}, //TVAR_afit_pBaseVals[409] - {0x0F12, 0x32FF}, //TVAR_afit_pBaseVals[410] - {0x0F12, 0x5004}, //TVAR_afit_pBaseVals[411] - {0x0F12, 0x1440}, //TVAR_afit_pBaseVals[412] - {0x0F12, 0x4015}, //TVAR_afit_pBaseVals[413] - {0x0F12, 0x0204}, //TVAR_afit_pBaseVals[414] - {0x0F12, 0x0003}, //TVAR_afit_pBaseVals[415] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[416] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[417] - {0x0F12, 0x000f}, //TVAR_afit_pBaseVals[418]//DTS2012071201781:modify by huyouhua at 2012-7-23 - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[419] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[420] - {0x0F12, 0x001E}, //TVAR_afit_pBaseVals[421] - {0x0F12, 0x03FF}, //TVAR_afit_pBaseVals[422] - {0x0F12, 0x009C}, //TVAR_afit_pBaseVals[423] - {0x0F12, 0x017C}, //TVAR_afit_pBaseVals[424] - {0x0F12, 0x03FF}, //TVAR_afit_pBaseVals[425] - {0x0F12, 0x000C}, //TVAR_afit_pBaseVals[426] - {0x0F12, 0x0010}, //TVAR_afit_pBaseVals[427] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[428] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[429] - {0x0F12, 0x0046}, //TVAR_afit_pBaseVals[430] - {0x0F12, 0x0050}, //TVAR_afit_pBaseVals[431] - {0x0F12, 0x0070}, //TVAR_afit_pBaseVals[432] - {0x0F12, 0x0004}, //TVAR_afit_pBaseVals[433] - {0x0F12, 0x0004}, //TVAR_afit_pBaseVals[434] - {0x0F12, 0x01AA}, //TVAR_afit_pBaseVals[435] - {0x0F12, 0x0014}, //TVAR_afit_pBaseVals[436] - {0x0F12, 0x0014}, //TVAR_afit_pBaseVals[437] - {0x0F12, 0x000A}, //TVAR_afit_pBaseVals[438] - {0x0F12, 0x000A}, //TVAR_afit_pBaseVals[439] - {0x0F12, 0x002D}, //TVAR_afit_pBaseVals[440] - {0x0F12, 0x0019}, //TVAR_afit_pBaseVals[441] - {0x0F12, 0x0023}, //TVAR_afit_pBaseVals[442] - {0x0F12, 0x0023}, //TVAR_afit_pBaseVals[443] - {0x0F12, 0x0023}, //TVAR_afit_pBaseVals[444] - {0x0F12, 0x0023}, //TVAR_afit_pBaseVals[445] - {0x0F12, 0x0A0F}, //TVAR_afit_pBaseVals[446] - {0x0F12, 0x1701}, //TVAR_afit_pBaseVals[447] - {0x0F12, 0x0229}, //TVAR_afit_pBaseVals[448] - {0x0F12, 0x1403}, //TVAR_afit_pBaseVals[449] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[450] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[451] - {0x0F12, 0x0606}, //TVAR_afit_pBaseVals[452] - {0x0F12, 0x00FF}, //TVAR_afit_pBaseVals[453] - {0x0F12, 0x033B}, //TVAR_afit_pBaseVals[454] - {0x0F12, 0x0505}, //TVAR_afit_pBaseVals[455] - {0x0F12, 0x0301}, //TVAR_afit_pBaseVals[456] - {0x0F12, 0x8007}, //TVAR_afit_pBaseVals[457] - {0x0F12, 0x051E}, //TVAR_afit_pBaseVals[458] - {0x0F12, 0x0A1E}, //TVAR_afit_pBaseVals[459] - {0x0F12, 0x0000}, //TVAR_afit_pBaseVals[460] - {0x0F12, 0x0A03}, //TVAR_afit_pBaseVals[461] - {0x0F12, 0x1E3C}, //TVAR_afit_pBaseVals[462] - {0x0F12, 0x1028}, //TVAR_afit_pBaseVals[463] - {0x0F12, 0x0002}, //TVAR_afit_pBaseVals[464] - {0x0F12, 0x00FF}, //TVAR_afit_pBaseVals[465] - {0x0F12, 0x1002}, //TVAR_afit_pBaseVals[466] - {0x0F12, 0x001E}, //TVAR_afit_pBaseVals[467] - {0x0F12, 0x0900}, //TVAR_afit_pBaseVals[468] - {0x0F12, 0x0600}, //TVAR_afit_pBaseVals[469] - {0x0F12, 0x0504}, //TVAR_afit_pBaseVals[470] - {0x0F12, 0x0305}, //TVAR_afit_pBaseVals[471] - {0x0F12, 0x8002}, //TVAR_afit_pBaseVals[472] - {0x0F12, 0x0080}, //TVAR_afit_pBaseVals[473] - {0x0F12, 0x0080}, //TVAR_afit_pBaseVals[474] - {0x0F12, 0x0080}, //TVAR_afit_pBaseVals[475] - {0x0F12, 0x4646}, //TVAR_afit_pBaseVals[476] - {0x0F12, 0x0101}, //TVAR_afit_pBaseVals[477] - {0x0F12, 0x1801}, //TVAR_afit_pBaseVals[478] - {0x0F12, 0x141C}, //TVAR_afit_pBaseVals[479] - {0x0F12, 0x2812}, //TVAR_afit_pBaseVals[480] - {0x0F12, 0x0A00}, //TVAR_afit_pBaseVals[481] - {0x0F12, 0x1003}, //TVAR_afit_pBaseVals[482] - {0x0F12, 0x1405}, //TVAR_afit_pBaseVals[483] - {0x0F12, 0x050C}, //TVAR_afit_pBaseVals[484] - {0x0F12, 0x32FF}, //TVAR_afit_pBaseVals[485] - {0x0F12, 0x5204}, //TVAR_afit_pBaseVals[486] - {0x0F12, 0x1440}, //TVAR_afit_pBaseVals[487] - {0x0F12, 0x4015}, //TVAR_afit_pBaseVals[488] - {0x0F12, 0x0204}, //TVAR_afit_pBaseVals[489] - {0x0F12, 0x5003}, //TVAR_afit_pBaseVals[490] - {0x0F12, 0x0150}, //TVAR_afit_pBaseVals[491] - {0x0F12, 0x0101}, //TVAR_afit_pBaseVals[492] - {0x0F12, 0x1418}, //TVAR_afit_pBaseVals[493] - {0x0F12, 0x1214}, //TVAR_afit_pBaseVals[494] - {0x0F12, 0x0028}, //TVAR_afit_pBaseVals[495] - {0x0F12, 0x030A}, //TVAR_afit_pBaseVals[496] - {0x0F12, 0x0A10}, //TVAR_afit_pBaseVals[497] - {0x0F12, 0x0819}, //TVAR_afit_pBaseVals[498] - {0x0F12, 0xFF05}, //TVAR_afit_pBaseVals[499] - {0x0F12, 0x0432}, //TVAR_afit_pBaseVals[500] - {0x0F12, 0x4052}, //TVAR_afit_pBaseVals[501] - {0x0F12, 0x1514}, //TVAR_afit_pBaseVals[502] - {0x0F12, 0x0440}, //TVAR_afit_pBaseVals[503] - {0x0F12, 0x0302}, //TVAR_afit_pBaseVals[504] - {0x0F12, 0x5050}, //TVAR_afit_pBaseVals[505] - {0x0F12, 0x0101}, //TVAR_afit_pBaseVals[506] - {0x0F12, 0x1801}, //TVAR_afit_pBaseVals[507] - {0x0F12, 0x1414}, //TVAR_afit_pBaseVals[508] - {0x0F12, 0x2812}, //TVAR_afit_pBaseVals[509] - {0x0F12, 0x0A00}, //TVAR_afit_pBaseVals[510] - {0x0F12, 0x1003}, //TVAR_afit_pBaseVals[511] - {0x0F12, 0x190A}, //TVAR_afit_pBaseVals[512] - {0x0F12, 0x0508}, //TVAR_afit_pBaseVals[513] - {0x0F12, 0x32FF}, //TVAR_afit_pBaseVals[514] - {0x0F12, 0x5204}, //TVAR_afit_pBaseVals[515] - {0x0F12, 0x1440}, //TVAR_afit_pBaseVals[516] - {0x0F12, 0x4015}, //TVAR_afit_pBaseVals[517] - {0x0F12, 0x0204}, //TVAR_afit_pBaseVals[518] - {0x0F12, 0x0003}, //TVAR_afit_pBaseVals[519] - // param_end TVAR_afit_pBaseVals - // param_start afit_pConstBaseVals - {0x002A, 0x0BD4}, - {0x0F12, 0x7F7A}, //afit_pConstBaseVals[0] - {0x0F12, 0x779D}, //afit_pConstBaseVals[1] - {0x0F12, 0xBE7E}, //afit_pConstBaseVals[2] - {0x0F12, 0xF7BC}, //afit_pConstBaseVals[3] - {0x0F12, 0x7E06}, //afit_pConstBaseVals[4] - {0x0F12, 0x0053}, //afit_pConstBaseVals[5] - // param_end afit_pConstBaseVals - - // Fill RAM with alternative op-codes - {0x0028, 0x7000}, // start add MSW - {0x002A, 0x2CE8}, // start add LSW - {0x0F12, 0x0007}, // Modify LSB to control AWBB_YThreshLow - {0x0F12, 0x00e2}, // - {0x0F12, 0x0005}, // Modify LSB to control AWBB_YThreshLowBrLow - {0x0F12, 0x00E2}, // - ////////////////////////////////////////////////////////////////////////// - //============================================================ - //END Tuning part - //END: DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - - //================================================================================================ - //SET PLL - //================================================================================================ - //How to set - //1. MCLK - //hex(CLK you want) * 1000) - //2. System CLK - //hex((CLK you want) * 1000 / 4) - //3. PCLK - //hex((CLK you want) * 1000 / 4) - //================================================================================================ - //Set input CLK //24MHz - {0x002A, 0x01CC}, - {0x0F12, 0x5DC0}, //5FB4 //5DC0=24MCLK #REG_TC_IPRM_InClockLSBs - {0x0F12, 0x0000}, //#REG_TC_IPRM_InClockMSBs - {0x002A, 0x01EE}, - {0x0F12, 0x0002}, //#REG_TC_IPRM_UseNPviClocks //Number of PLL setting - //Set system CLK //40MHz - {0x002A, 0x01F6}, - {0x0F12, 0x38a4 }, //2904 //2BF2 //#REG_TC_IPRM_OpClk4KHz_0 - {0x0F12, 0x37A4}, //3A88 //#REG_TC_IPRM_MinOutRate4KHz_0 - {0x0F12, 0x39A4}, //3AA8 //#REG_TC_IPRM_MaxOutRate4KHz_0 - {0x0F12, 0x38A4}, //2904 //2BF2 //#REG_TC_IPRM_OpClk4KHz_1 - //Set pixel CLK //60MHz (0x3A98) - {0x0F12, 0x2EA0}, //#REG_TC_IPRM_MinOutRate4KHz_1 - {0x0F12, 0x2EE0}, //#REG_TC_IPRM_MaxOutRate4KHz_1 - //Update PLL - {0x002A, 0x0208}, - {0x0F12, 0x0001}, //#REG_TC_IPRM_InitParamsUpdated - - {SEQUENCE_WAIT_MS,100},//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - //================================================================================================ - //SET PREVIEW CONFIGURATION_0 - //# Foramt : YUV422 - //# Size: 640x480 - //# FPS : 25fps - //================================================================================================ - {0x002A, 0x026C}, - {0x0F12, 0x0280}, //0400 //#REG_0TC_PCFG_usWidth//1024 - {0x0F12, 0x01E0}, //0300 //#REG_0TC_PCFG_usHeight //768 026E - {0x0F12, 0x0005}, //#REG_0TC_PCFG_Format 0270 - {0x0F12, 0x39a4}, //3AA8 //#REG_0TC_PCFG_usMaxOut4KHzRate 0272 - {0x0F12, 0x37a4}, //3A88 //#REG_0TC_PCFG_usMinOut4KHzRate 0274 - {0x0F12, 0x0100}, //#REG_0TC_PCFG_OutClkPerPix88 0276 - {0x0F12, 0x0800}, //#REG_0TC_PCFG_uMaxBpp88 027 - {0x0F12, 0x0052}, //#REG_0TC_PCFG_PVIMask //s0050 = FALSE in MSM6290 : s0052 = TRUE in MSM6800 //reg 027A - {0x0F12, 0x4000}, //#REG_0TC_PCFG_OIFMask - {0x0F12, 0x0400}, //0x01E0},//#REG_0TC_PCFG_usJpegPacketSize //DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x0000}, //#REG_0TC_PCFG_usJpegTotalPackets - {0x0F12, 0x0000}, //#REG_0TC_PCFG_uClockInd - {0x0F12, 0x0000}, //#REG_0TC_PCFG_usFrTimeType - {0x0F12, 0x0001}, //#REG_0TC_PCFG_FrRateQualityType - {0x0F12, 0x0190}, //03E8 #REG_0TC_PCFG_usMaxFrTimeMsecMult10 min 25fps - {0x0F12, 0x0190}, //029a #REG_0TC_PCFG_usMinFrTimeMsecMult10 max 25fps - {0x0F12, 0x0000}, //#REG_0TC_PCFG_bSmearOutput - {0x0F12, 0x0000}, //#REG_0TC_PCFG_sSaturation - {0x0F12, 0x0000}, //#REG_0TC_PCFG_sSharpBlur - {0x0F12, 0x0000}, //#REG_0TC_PCFG_sColorTemp - {0x0F12, 0x0000}, //#REG_0TC_PCFG_uDeviceGammaIndex - {0x0F12, 0x0003}, //#REG_0TC_PCFG_uPrevMirror - {0x0F12, 0x0003}, //#REG_0TC_PCFG_uCaptureMirror - {0x0F12, 0x0000}, //#REG_0TC_PCFG_uRotation - //================================================================================================ - //SET PREVIEW CONFIGURATION_1 - //# Foramt : YUV422 - //# Size: 1280x720 - //# FPS : 15~15fps - //================================================================================================ - {0x002A, 0x029C}, - {0x0F12, 0x0500}, //0400 //#REG_0TC_PCFG_usWidth//1024 - {0x0F12, 0x02D0}, //0300 //#REG_0TC_PCFG_usHeight //768 026E - {0x0F12, 0x0005}, //#REG_0TC_PCFG_Format 0270 - {0x0F12, 0x2ee0}, //3AA8 //#REG_0TC_PCFG_usMaxOut4KHzRate 0272 - {0x0F12, 0x2ea0}, //3A88 //#REG_0TC_PCFG_usMinOut4KHzRate 0274 - {0x0F12, 0x0100}, //#REG_0TC_PCFG_OutClkPerPix88 0276 - {0x0F12, 0x0800}, //#REG_0TC_PCFG_uMaxBpp88 027 - {0x0F12, 0x0052}, //#REG_0TC_PCFG_PVIMask //s0050 = FALSE in MSM6290 : s0052 = TRUE in MSM6800 //reg 027A - {0x0F12, 0x4000}, //#REG_0TC_PCFG_OIFMask - {0x0F12, 0x0400}, //0x01E0}, //#REG_0TC_PCFG_usJpegPacketSize//DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x0F12, 0x0000}, //#REG_0TC_PCFG_usJpegTotalPackets - {0x0F12, 0x0001}, //#REG_0TC_PCFG_uClockInd - {0x0F12, 0x0000}, //#REG_0TC_PCFG_usFrTimeType - {0x0F12, 0x0002}, //1 //#REG_0TC_PCFG_FrRateQualityType - {0x0F12, 0x029a}, //03E8 #REG_0TC_PCFG_usMaxFrTimeMsecMult10 //15fps - {0x0F12, 0x029a}, //029a #REG_0TC_PCFG_usMinFrTimeMsecMult10 //15fps - {0x0F12, 0x0000}, //#REG_0TC_PCFG_bSmearOutput - {0x0F12, 0x0000}, //#REG_0TC_PCFG_sSaturation - {0x0F12, 0x0000}, //#REG_0TC_PCFG_sSharpBlur - {0x0F12, 0x0000}, //#REG_0TC_PCFG_sColorTemp - {0x0F12, 0x0000}, //#REG_0TC_PCFG_uDeviceGammaIndex - {0x0F12, 0x0003}, //#REG_0TC_PCFG_uPrevMirror - {0x0F12, 0x0003}, //#REG_0TC_PCFG_uCaptureMirror - {0x0F12, 0x0000}, //#REG_0TC_PCFG_uRotation - //================================================================================================ - //APPLY PREVIEW CONFIGURATION & RUN PREVIEW - //================================================================================================ - {0x002A, 0x023C}, - {0x0F12, 0x0000}, //#REG_TC_GP_ActivePrevConfig //Select preview configuration_0 - {0x002A, 0x0240}, - {0x0F12, 0x0001}, //#REG_TC_GP_PrevOpenAfterChange - {0x002A, 0x0230}, - {0x0F12, 0x0001}, //#REG_TC_GP_NewConfigSync //Update preview configuration - {0x002A, 0x023E}, - {0x0F12, 0x0001}, //#REG_TC_GP_PrevConfigChanged - {0x002A, 0x0220}, - {0x0F12, 0x0001}, //#REG_TC_GP_EnablePreview //Start preview - {0x0F12, 0x0001}, //#REG_TC_GP_EnablePreviewChanged - //================================================================================================ - //SET CAPTURE CONFIGURATION_0 - //# Foramt :YUV - //# Size: QXGA - //# FPS : 5 ~ 7.5fps - //================================================================================================ - {0x002A, 0x035C}, - {0x0F12, 0x0000}, //#REG_0TC_CCFG_uCaptureModeJpEG - {0x0F12, 0x0800}, //#REG_0TC_CCFG_usWidth - {0x0F12, 0x0600}, //#REG_0TC_CCFG_usHeight - {0x0F12, 0x0005}, //#REG_0TC_CCFG_Format//5:YUV9:JPEG - //{0x0F12, 0x39ae}, //3AA8 //#REG_0TC_CCFG_usMaxOut4KHzRate - {0x0F12, 0x39a4}, //#REG_0TC_CCFG_usMaxOut4KHzRate//DTS2012071201781:modify by huyouhua at 2012-7-23 - {0x0F12, 0x37a4}, //3A88 //#REG_0TC_CCFG_usMinOut4KHzRate - {0x0F12, 0x0100}, //#REG_0TC_CCFG_OutClkPerPix88 - {0x0F12, 0x0800}, //#REG_0TC_CCFG_uMaxBpp88 - {0x0F12, 0x0052}, //#REG_0TC_CCFG_PVIMask - {0x0F12, 0x0050}, //#REG_0TC_CCFG_OIFMask edison - //BEGIN: DTS2012071201781 modify by huyouhua at 2012-7-23 - //{0x0F12, 0x01E0}, //#REG_0TC_CCFG_usJpegPacketSize - //{0x0F12, 0x08fc}, //#REG_0TC_CCFG_usJpegTotalPackets - {0x0F12, 0x03C0}, //#REG_0TC_CCFG_usJpegPacketSize - //END: DTS2012071201781 modify by huyouhua at 2012-7-23 - {0x0F12, 0x0000}, //#REG_0TC_CCFG_uClockInd - {0x0F12, 0x0000}, //#REG_0TC_CCFG_usFrTimeType - {0x0F12, 0x0000}, //#REG_0TC_CCFG_FrRateQualityType - {0x0F12, 0x0002}, //#REG_0TC_CCFG_FrRateQualityType//DTS2012071201781:add by huyouhua at 2012-7-23 - {0x0F12, 0x07D0}, //#REG_0TC_CCFG_usMaxFrTimeMsecMult10 //5fps - {0x0F12, 0x0535}, //#REG_0TC_CCFG_usMinFrTimeMsecMult10 //7.5fps - {0x0F12, 0x0000}, //#REG_0TC_CCFG_bSmearOutput - {0x0F12, 0x0000}, //#REG_0TC_CCFG_sSaturation - {0x0F12, 0x0000}, //#REG_0TC_CCFG_sSharpBlur - {0x0F12, 0x0000}, //#REG_0TC_CCFG_sColorTemp - {0x0F12, 0x0000}, //#REG_0TC_CCFG_uDeviceGammaIndex - //================================================================================================ - //SET CAPTURE CONFIGURATION_1 - //# Foramt : - //# Size: - //# FPS : - //================================================================================================ - //Not used - {0x0028, 0xD000}, - {0x002A, 0x1000}, - {0x0F12, 0x0001}, - - {SEQUENCE_WAIT_MS,50}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_720p[]= -{ - {0x0028, 0x7000}, - {0x002A, 0x01D6}, - {0x0F12, 0x0800}, - {0x0F12, 0x0600}, - {0x0F12, 0x0000}, - {0x0F12, 0x00C0}, - {0x002A, 0x0208}, - {0x0F12, 0x0001}, - - {0x002A, 0x023C}, - {0x0F12, 0x0001}, - {0x002A, 0x0240}, - {0x0F12, 0x0001}, - {0x002A, 0x0230}, - {0x0F12, 0x0001}, - {0x002A, 0x023E}, - {0x0F12, 0x0001}, - {0x002A, 0x0220}, - {0x0F12, 0x0001}, - {0x0F12, 0x0001}, - - {SEQUENCE_END, 0x00} -}; -#if 0 -static struct reginfo sensor_1080p[]= -{ - {SEQUENCE_END, 0x00} -}; -#endif -/* 2592X1944 QSXGA */ -static struct reginfo sensor_qsxga[] = -{ - {SEQUENCE_END, 0x00} -}; -/* 2048*1536 QXGA */ -static struct reginfo sensor_qxga[] = -{ - {0x0028 ,0x7000}, - {0x002a ,0x0244},//#REG_TC_GP_ActiveCapConfig num - {0x0f12 ,0x0000}, - {0x0f12 ,0x0001},//#REG_TC_GP_CapConfigChanged - {0x002a ,0x0230}, - {0x0f12 ,0x0001},//#REG_TC_GP_NewConfigSync - {0x002a ,0x0224}, - {0x0f12 ,0x0001},//#REG_TC_GP_EnableCapture - {0x0f12 ,0x0001},//#REG_TC_GP_EnableCaptureChanged - {SEQUENCE_END, 0x00} -}; - -/* 1600X1200 UXGA */ -static struct reginfo sensor_uxga[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {SEQUENCE_END, 0x00} -}; -/* 1024X768 XGA */ -static struct reginfo sensor_xga[] = -{ - {SEQUENCE_END, 0x00} -}; -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - {SEQUENCE_END, 0x0}, -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - {0x0028, 0x7000}, - {0x002A, 0x01D6}, - {0x0F12, 0x0140}, - {0x0F12, 0x00F0}, - {0x0F12, 0x0000}, - {0x0F12, 0x0000}, - {0x002A, 0x0208}, - {0x0F12, 0x0001}, - - {0x002A, 0x023C}, - {0x0F12, 0x0000}, - {0x002A, 0x0240}, - {0x0F12, 0x0001}, - {0x002A, 0x0230}, - {0x0F12, 0x0001}, - {0x002A, 0x023E}, - {0x0F12, 0x0001}, - {0x002A, 0x0220}, - {0x0F12, 0x0001}, - {0x0F12, 0x0001}, - - {SEQUENCE_END, 0x0}, -}; -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {SEQUENCE_END, 0x0}, -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - {SEQUENCE_END, 0x0}, -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {SEQUENCE_END, 0x0}, -}; - -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {SEQUENCE_END, 0x00} -}; - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0x0028, 0x7000}, - {0x002A, 0X04D2}, - //BEGIN: DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - //{0x0F12, 0x065F}, - {0x0F12, 0x067F}, - //END: DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {SEQUENCE_END, 0x00} -}; - -//incandescent -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - {0x0028, 0x7000}, - {0x002A, 0x04D2}, - //BEGIN: DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - //{0x0F12, 0x0657}, - {0x0F12, 0x0677}, - //END: DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x002A, 0x04A0}, - {0x0F12, 0x0380}, - {0x0F12, 0x0001}, - {0x0F12, 0x0400}, - {0x0F12, 0x0001}, - {0x0F12, 0x09C0}, - {0x0F12, 0x0001}, - - {SEQUENCE_END, 0x00} -}; - -//fluorescentè§å…‰2 -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - {0x0028, 0x7000}, - {0x002A, 0x04D2}, - {0x0F12, 0x0657}, - {0x002A, 0x04A0}, - {0x0F12, 0x0400}, - {0x0F12, 0x0001}, - {0x0F12, 0x0400}, - {0x0F12, 0x0001}, - {0x0F12, 0x083C}, - {0x0F12, 0x0001}, - - {SEQUENCE_END, 0x00} -}; - -//daylight日光3 -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - {0x0028, 0x7000}, - {0x002A, 0x04D2}, - //BEGIN: DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - //{0x0F12, 0x0657}, - {0x0F12, 0x0677}, - //END: DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x002A, 0x04A0}, - {0x0F12, 0x05A0}, - {0x0F12, 0x0001}, - {0x0F12, 0x0400}, - {0x0F12, 0x0001}, - {0x0F12, 0x05F0}, - {0x0F12, 0x0001}, - - {SEQUENCE_END, 0x00} -}; - -//阴天4 -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0x0028, 0x7000}, - {0x002A, 0x04D2}, - //BEGIN: DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - //{0x0F12, 0x0657}, - {0x0F12, 0x0677}, - //END: DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {0x002A, 0x04A0}, - {0x0F12, 0x0540}, - {0x0F12, 0x0001}, - {0x0F12, 0x0400}, - {0x0F12, 0x0001}, - {0x0F12, 0x0500}, - {0x0F12, 0x0001}, - - {SEQUENCE_END, 0x00} -}; - -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy, NULL,}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x0028, 0x7000}, - {0x002A, 0x021E}, - {0x0F12, 0x0000}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {0x0028, 0x7000}, - {0x002A, 0x021E}, - {0x0F12, 0x0001}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x0028, 0x7000}, - {0x002A, 0x021E}, - {0x0F12, 0x0004}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - {0x0028, 0x7000}, - {0x002A, 0x021E}, - //BEGIN: DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - //{0x0F12, 0x0002}, - {0x0F12, 0x0003}, - //END: DTS2012071201781: modify by huyouhua 00136760 at 2012-7-20 - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Bluish[] = -{ - {0x0028, 0x7000}, - {0x002A, 0x021E}, - {0x0F12, 0x0003}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - {0x0028, 0x7000}, - {0x002A, 0x021E}, - {0x0F12, 0x0005}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif - -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast2[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - {SEQUENCE_END, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif - -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneNormal[] = -{ - {0x0028,0x7000}, - {0x002A,0x0288}, - {0x0F12,0X0190}, - {0x0F12,0X014D}, - {0x002A,0x023E}, - {0x0F12,0x0001}, - - {SEQUENCE_WAIT_MS,50}, - - {0x002A,0x023C}, - {0x0F12,0x0000}, - {0x002A,0x0240}, - {0x0F12,0x0001}, - {0x002A,0x0230}, - {0x0F12,0x0001}, - {0x002A,0x023E}, - {0x0F12,0x0001}, - {0x002A,0x0220}, - {0x0F12,0x0001}, - {0x0F12,0x0001}, - - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_SceneNight[] = -{ - {0x0028,0x7000}, - {0x002A,0x0288}, - {0x0F12,0X07D0}, - {0x0F12,0X029A}, - {0x002A,0x023E}, - {0x0F12,0x0001}, - - {SEQUENCE_WAIT_MS,50}, - - {0x002A,0x023C}, - {0x0F12,0x0000}, - {0x002A,0x0240}, - {0x0F12,0x0001}, - {0x002A,0x0230}, - {0x0F12,0x0001}, - {0x002A,0x023E}, - {0x0F12,0x0001}, - {0x002A,0x0220}, - {0x0F12,0x0001}, - {0x0F12,0x0001}, - - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneNormal, sensor_SceneNight, NULL,}; -#endif - -#if CONFIG_SENSOR_AntiBanding -static struct reginfo sensor_AntiBanding_50HZ[] = -{ - {0x0028, 0x7000}, - {0x002a, 0x04d2}, - {0x0f12, 0x065f}, - {0x002a, 0x04ba}, - {0x0f12, 0x0001}, - {0x002a, 0x04bc}, - {0x0f12, 0x0001}, - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_AntiBanding_60HZ[] = -{ - {0x0028, 0x7000}, - {0x002a, 0x04d2}, - {0x0f12, 0x065f}, - {0x002a, 0x04ba}, - {0x0f12, 0x0002}, - {0x002a, 0x04bc}, - {0x0f12, 0x0001}, - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_AntiBandingSeqe[] = {sensor_AntiBanding_50HZ, sensor_AntiBanding_60HZ, NULL,}; -#endif - -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {SEQUENCE_END, 0x0}, -}; - -static struct reginfo sensor_Zoom1[] = -{ - {SEQUENCE_END, 0x0}, -}; - -static struct reginfo sensor_Zoom2[] = -{ - {SEQUENCE_END, 0x0}, -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {SEQUENCE_END, 0x0}, -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif -static struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} , - //{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_AntiBanding - { .id = V4L2_CID_ANTIBANDING, .index = 0, .name = "50hz", .reserved = 0,}, - { .id = V4L2_CID_ANTIBANDING, .index = 1, .name = "60hz", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static const struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_AntiBanding - { - .id = V4L2_CID_ANTIBANDING, - .type = V4L2_CTRL_TYPE_MENU, - .name = "AntiBanding Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG} -}; -enum sensor_work_state -{ - sensor_work_ready = 0, - sensor_working, -}; -struct sensor_work -{ - struct i2c_client *client; - struct delayed_work dwork; - enum sensor_work_state state; -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int antibanding; - int digitalzoom; - int focus; - int auto_focus; - int affm_reinit; - int flash; - int exposure; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - bool snap2preview; - bool video2preview; - int capture_w; - int capture_h; - int preview_w; - int preview_h; - struct reginfo *winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int enable; - unsigned int funmodule_state; -} sensor_info_priv_t; - - - -struct sensor_parameter -{ - unsigned short int preview_maxlines; - unsigned short int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int capture_framerate; - unsigned short int preview_framerate; -}; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - struct sensor_parameter parameter; - struct workqueue_struct *sensor_wq; - struct sensor_work sensor_wk; - struct mutex wq_lock; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, u16 reg, u16 val) -{ - int err=0,cnt; - u8 buf[4]; - struct i2c_msg msg[1]; - - switch (reg) - { - case SEQUENCE_WAIT_MS: - { - //msleep(val); - mdelay(val); - break; - } - - case SEQUENCE_WAIT_US: - { - udelay(val); - break; - } - - case SEQUENCE_PROPERTY: - { - break; - } - default: - { - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - buf[2] = val >> 8; - buf[3] = val & 0xFF; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - } - } - return err; -} -#if 0 -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u16 reg, u16 *val) -{ - u8 buf[2]; - struct i2c_msg msg[2]; - int err = 0; - - buf[0] = (u8)reg >> 8; - buf[1] = (u8)reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = sizeof(buf); - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - err = i2c_transfer(client->adapter, msg, 2); - - if(err >= 0) { - *val = (buf[0] << 8)|(buf[1] & 0xFF); - SENSOR_DG("%s read reg(0x%x val:0x%x) success\n",SENSOR_NAME_STRING(),reg,*val); - return 0; - } else { - SENSOR_TR("%s read reg(0x%x) failed!",SENSOR_NAME_STRING(),reg); - } - - return err; -} -#endif -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - while (regarray[i].reg != SEQUENCE_END) - { - - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - - i++; - } - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} - -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != SEQUENCE_END) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif -#if CONFIG_SENSOR_Focus - -static int sensor_af_single(struct i2c_client *client) -{ - int ret = 0; - - -sensor_af_single_end: - return ret; -} - -static int sensor_af_const(struct i2c_client *client) -{ - int ret = 0; - -sensor_af_const_end: - return ret; -} - -static int sensor_af_zoneupdate(struct i2c_client *client) -{ - int ret = 0; - -sensor_af_zoneupdate_end: - return ret; -} - -static int sensor_af_init(struct i2c_client *client) -{ - int ret = 0; - - return ret; -} -#endif - -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int ret = 0; - - switch (cmd) - { - case Sensor_Reset: - { - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Reset, on); - } - break; - } - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - } - break; - } - default: - { - SENSOR_TR("%s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),cmd); - break; - } - } - -sensor_power_end: - return ret; -} - -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - int ret; - u16 pid = 0; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - sensor_ioctrl(icd,Sensor_Reset, 1); - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - udelay(50); - sensor_ioctrl(icd,Sensor_Reset, 0); - mdelay(1); - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - -#if (SENSOR_RESET_REG != SEQUENCE_END) - ret = sensor_write(client, SENSOR_RESET_REG, SENSOR_RESET_VAL); - if (ret != 0) { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); //delay 5 microseconds -#endif - - /* check if it is an sensor sensor */ -#if (SENSOR_ID_REG != SEQUENCE_END) - ret = sensor_read(client, SENSOR_ID_REG, &pid); - if (ret != 0) { - SENSOR_TR("read chip id failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - SENSOR_DG("\n %s pid = 0x%x \n", SENSOR_NAME_STRING(), pid); -#else - pid = SENSOR_ID; -#endif - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - sensor->info_priv.winseqe_cur_addr = SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - #if CONFIG_SENSOR_AntiBanding - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ANTIBANDING); - if (qctrl) - sensor->info_priv.antibanding = qctrl->default_value; - #endif - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - #endif - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); -//sensor_init_end: - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} - -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - //sensor_task_lock(client, 1); - sensor_ioctrl(icd, Sensor_PowerDown, 1); - msleep(100); - - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - - return 0; -} - -static struct reginfo sensor_suspend_sequence[]= -{ - {SEQUENCE_END,0x00} -}; - -static struct reginfo sensor_resume_sequence[]= -{ - {SEQUENCE_END,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_suspend_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - mdelay(100); - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } else { - udelay(5); - ret = sensor_write_array(client, sensor_resume_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return -EINVAL; - } - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - - return 0; -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -#if 0 -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -#endif -static struct reginfo* sensor_fmt_catch(int set_w, int set_h, int *ret_w, int *ret_h) -{ - struct reginfo *winseqe_set_addr = NULL; - - if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qcif; - *ret_w = 176; - *ret_h = 144; - } else if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qvga; - *ret_w = 320; - *ret_h = 240; - } else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_cif; - *ret_w = 352; - *ret_h = 288; - } else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_vga; - *ret_w = 640; - *ret_h = 480; - } -#if CONFIG_SENSOR_FOR_CTS - /**lzg@rockchip.com: forbid to preview with resolution 1280*1024*/ - else if (((set_w <= 800) && (set_h <= 600)) && (sensor_vga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_vga; - *ret_w = 640; - *ret_h = 480; - } -#else - else if (((set_w <= 800) && (set_h <= 600)) && (sensor_svga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_svga; - *ret_w = 800; - *ret_h = 600; - } -#endif - else if (((set_w <= 1024) && (set_h <= 768)) && (sensor_xga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_xga; - *ret_w = 1024; - *ret_h = 768; - } else if (((set_w <= 1280) && (set_h <= 720)) && (sensor_720p[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_720p; - *ret_w = 1280; - *ret_h = 720; - } else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_sxga; - *ret_w = 1280; - *ret_h = 1024; - } else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_uxga; - *ret_w = 1600; - *ret_h = 1200; - } -#if CONFIG_SENSOR_FOR_CTS - /**lzg@rockchip.com: forbid to preview with resolution 1280*1024*/ - else if (((set_w <= 1920) && (set_h <= 1080)) && (sensor_vga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_vga; - *ret_w = 640; - *ret_h = 480; - } -#else - else if (((set_w <= 1920) && (set_h <= 1080)) && (sensor_1080p[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_1080p; - *ret_w = 1920; - *ret_h = 1080; - } -#endif - else if (((set_w <= 2048) && (set_h <= 1536)) && (sensor_qxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qxga; - *ret_w = 2048; - *ret_h = 1536; - } else if (((set_w <= 2592) && (set_h <= 1944)) && (sensor_qsxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qsxga; - *ret_w = 2592; - *ret_h = 1944; - } - - return winseqe_set_addr; -} - -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct sensor *sensor = to_sensor(client); - struct reginfo *winseqe_set_addr=NULL; - int ret=0, set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - winseqe_set_addr = sensor_fmt_catch(set_w, set_h, &set_w, &set_h); - - if ((winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) && winseqe_set_addr) { - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - } else { /* ddl@rock-chips.com : Video */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - } - #endif - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - - sensor->info_priv.winseqe_cur_addr = (struct reginfo *)winseqe_set_addr; - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } else { - SENSOR_TR("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; - -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0, set_w,set_h;; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 720)) && sensor_720p[0].reg) - { - set_w = 1280; - set_h = 720; - } - else if (((set_w <= 1024) && (set_h <= 768)) && sensor_xga[0].reg) - { - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && sensor_uxga[0].reg) - { - set_w = 1600; - set_h = 1200; - } - else if (((set_w <= 2048) && (set_h <= 1536)) && sensor_qxga[0].reg) - { - set_w = 2048; - set_h = 1536; - } - else - { /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - mf->width = set_w; - mf->height = set_h; - mf->colorspace = fmt->colorspace; - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return s5k6aa identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_AntiBanding -static int sensor_set_antibanding(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_AntiBandingSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_AntiBandingSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((*value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value > 0) && ((digitalzoom_cur + *value) > digitalzoom_total)) - { - *value = digitalzoom_total - digitalzoom_cur; - } - - if ((*value < 0) && ((digitalzoom_cur + *value) < 0)) - { - *value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += *value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, *value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - #if CONFIG_SENSOR_AntiBanding - case V4L2_CID_ANTIBANDING: - { - ext_ctrl->value = sensor->info_priv.antibanding; - break; - } - #endif - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_AntiBanding - case V4L2_CID_ANTIBANDING: - { - if (ext_ctrl->value != sensor->info_priv.antibanding) - { - if (sensor_set_antibanding(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.antibanding = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} -static int sensor_s_stream(struct v4l2_subdev *sd, int enable) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - - if (enable == 1) { - sensor->info_priv.enable = 1; - } else if (enable == 0) { - sensor->info_priv.enable = 0; - } - - return 0; -} -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - int ret,pid = 0; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - - //if senor online - ret = sensor_write(client, 0x002c, 0x0000); - if (ret != 0) { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - /* soft reset */ -#if (SENSOR_RESET_REG != SEQUENCE_END) - ret = sensor_write(client, SENSOR_RESET_REG, SENSOR_RESET_VAL); - if (ret != 0) { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - mdelay(5); //delay 5 microseconds -#endif - - /* check if it is an sensor sensor */ -#if (SENSOR_ID_REG != SEQUENCE_END) - ret = sensor_read(client, SENSOR_ID_REG, &pid); - if (ret != 0) { - SENSOR_TR("read chip id failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - SENSOR_DG("\n %s pid = 0x%x \n", SENSOR_NAME_STRING(), pid); -#else - pid = SENSOR_ID; -#endif - - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - - return ret; -} -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0; -#if CONFIG_SENSOR_Flash - int i; -#endif - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - if (sensor->sensor_io_request->gpio_res[0].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[0].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[0]; - } else if (sensor->sensor_io_request->gpio_res[1].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[1].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[1]; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - memset(&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, - .s_stream = sensor_s_stream, -}; -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - //struct v4l2_subdev *sd = soc_camera_to_subdev(icd); - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - sensor->info_priv.fmt = sensor_colour_fmts[0]; - - ret = sensor_video_probe(icd, client); - if (ret) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - } - - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - //SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - printk(">>>>>>>>>>\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - - diff --git a/drivers/media/video/s5k5ca.h b/drivers/media/video/s5k5ca.h deleted file mode 100644 index 5bf5e4f4220f..000000000000 --- a/drivers/media/video/s5k5ca.h +++ /dev/null @@ -1,243 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __S5K6AA_H__ -#define __S5K6AA_H__ - -struct reginfo -{ - u16 reg; - u16 val; -}; - -/* General purpose section */ -#define REG_TC_GP_SpecialEffects 0x01EE -#define REG_TC_GP_EnablePreview 0x01F0 -#define REG_TC_GP_EnablePreviewChanged 0x01F2 -#define REG_TC_GP_EnableCapture 0x01F4 -#define REG_TC_GP_EnableCaptureChanged 0x01F6 -#define REG_TC_GP_NewConfigSync 0x01F8 -#define REG_TC_GP_PrevReqInputWidth 0x01FA -#define REG_TC_GP_PrevReqInputHeight 0x01FC -#define REG_TC_GP_PrevInputWidthOfs 0x01FE -#define REG_TC_GP_PrevInputHeightOfs 0x0200 -#define REG_TC_GP_CapReqInputWidth 0x0202 -#define REG_TC_GP_CapReqInputHeight 0x0204 -#define REG_TC_GP_CapInputWidthOfs 0x0206 -#define REG_TC_GP_CapInputHeightOfs 0x0208 -#define REG_TC_GP_PrevZoomReqInputWidth 0x020A -#define REG_TC_GP_PrevZoomReqInputHeight 0x020C -#define REG_TC_GP_PrevZoomReqInputWidthOfs 0x020E -#define REG_TC_GP_PrevZoomReqInputHeightOfs 0x0210 -#define REG_TC_GP_CapZoomReqInputWidth 0x0212 -#define REG_TC_GP_CapZoomReqInputHeight 0x0214 -#define REG_TC_GP_CapZoomReqInputWidthOfs 0x0216 -#define REG_TC_GP_CapZoomReqInputHeightOfs 0x0218 -#define REG_TC_GP_InputsChangeRequest 0x021A -#define REG_TC_GP_ActivePrevConfig 0x021C -#define REG_TC_GP_PrevConfigChanged 0x021E -#define REG_TC_GP_PrevOpenAfterChange 0x0220 -#define REG_TC_GP_ErrorPrevConfig 0x0222 -#define REG_TC_GP_ActiveCapConfig 0x0224 -#define REG_TC_GP_CapConfigChanged 0x0226 -#define REG_TC_GP_ErrorCapConfig 0x0228 -#define REG_TC_GP_PrevConfigBypassChanged 0x022A -#define REG_TC_GP_CapConfigBypassChanged 0x022C -#define REG_TC_GP_SleepMode 0x022E -#define REG_TC_GP_SleepModeChanged 0x0230 -#define REG_TC_GP_SRA_AddLow 0x0232 -#define REG_TC_GP_SRA_AddHigh 0x0234 -#define REG_TC_GP_SRA_AccessType 0x0236 -#define REG_TC_GP_SRA_Changed 0x0238 -#define REG_TC_GP_PrevMinFrTimeMsecMult10 0x023A -#define REG_TC_GP_PrevOutKHzRate 0x023C -#define REG_TC_GP_CapMinFrTimeMsecMult10 0x023E -#define REG_TC_GP_CapOutKHzRate 0x0240 - -/* Image property control section */ -#define REG_TC_UserBrightness 0x01E4 -#define REG_TC_UserContrast 0x01E6 -#define REG_TC_UserSaturation 0x01E8 -#define REG_TC_UserSharpBlur 0x01EA -#define REG_TC_UserGlamour 0x01EC - -/* Flash control section */ -#define REG_TC_FLS_Mode 0x03B6 -#define REG_TC_FLS_Threshold 0x03B8 -#define REG_TC_FLS_Polarity 0x03BA -#define REG_TC_FLS_XenonMode 0x03BC -#define REG_TC_FLS_XenonPreFlashCnt 0x03BE - -/* Extended image property control section */ -#define REG_SF_USER_LeiLow 0x03C0 -#define REG_SF_USER_LeiHigh 0x03C2 -#define REG_SF_USER_LeiChanged 0x03C4 -#define REG_SF_USER_Exposure 0x03C6 -#define REG_SF_USER_ExposureChanged 0x03CA -#define REG_SF_USER_TotalGain 0x03CC -#define REG_SF_USER_TotalGainChanged 0x03CE -#define REG_SF_USER_Rgain 0x03D0 -#define REG_SF_USER_RgainChanged 0x03D2 -#define REG_SF_USER_Ggain 0x03D4 -#define REG_SF_USER_GgainChanged 0x03D6 -#define REG_SF_USER_Bgain 0x03D8 -#define REG_SF_USER_BgainChanged 0x03DA -#define REG_SF_USER_FlickerQuant 0x03DC -#define REG_SF_USER_FlickerQuantChanged 0x03DE -#define REG_SF_USER_GASRAlphaVal 0x03E0 -#define REG_SF_USER_GASRAlphaChanged 0x03E2 -#define REG_SF_USER_GASGAlphaVal 0x03E4 -#define REG_SF_USER_GASGAlphaChanged 0x03E6 -#define REG_SF_USER_GASBAlphaVal 0x03E8 -#define REG_SF_USER_GASBAlphaChanged 0x03EA -#define REG_SF_USER_DbgIdx 0x03EC -#define REG_SF_USER_DbgVal 0x03EE -#define REG_SF_USER_DbgChanged 0x03F0 -#define REG_SF_USER_aGain 0x03F2 -#define REG_SF_USER_aGainChanged 0x03F4 -#define REG_SF_USER_dGain 0x03F6 -#define REG_SF_USER_dGainChanged 0x03F8 - -/* Output interface control section */ -#define REG_TC_OIF_EnMipiLanes 0x03FA -#define REG_TC_OIF_EnPackets 0x03FC -#define REG_TC_OIF_CfgChanged 0x03FE - -/* Debug control section */ -#define REG_TC_DBG_AutoAlgEnBits 0x0400 -#define REG_TC_DBG_IspBypass 0x0402 -#define REG_TC_DBG_ReInitCmd 0x0404 - -/* Version information section */ -#define REG_FWdate 0x012C -#define REG_FWapiVer 0x012E -#define REG_FWrevision 0x0130 -#define REG_FWpid 0x0132 -#define REG_FWprjName 0x0134 -#define REG_FWcompDate 0x0140 -#define REG_FWSFC_VER 0x014C -#define REG_FWTC_VER 0x014E -#define REG_FWrealImageLine 0x0150 -#define REG_FWsenId 0x0152 -#define REG_FWusDevIdQaVersion 0x0154 -#define REG_FWusFwCompilationBits 0x0156 -#define REG_ulSVNrevision 0x0158 -#define REG_SVNpathRomAddress 0x015C -#define REG_TRAP_N_PATCH_START_ADD 0x1B00 - -#define setot_usForceClocksSettings 0x0AEA -#define setot_usConfigClocksSettings 0x0AEC - -#define REG_0TC_CCFG_uCaptureMode 0x030C -#define REG_0TC_CCFG_usWidth 0x030E -#define REG_0TC_CCFG_usHeight 0x0310 -#define REG_0TC_CCFG_Format 0x0312 -#define REG_0TC_CCFG_usMaxOut4KHzRate 0x0314 -#define REG_0TC_CCFG_usMinOut4KHzRate 0x0316 -#define REG_0TC_CCFG_PVIMask 0x0318 -#define REG_0TC_CCFG_uClockInd 0x031A -#define REG_0TC_CCFG_usFrTimeType 0x031C -#define REG_0TC_CCFG_FrRateQualityType 0x031E -#define REG_0TC_CCFG_usMaxFrTimeMsecMult10 0x0320 -#define REG_0TC_CCFG_usMinFrTimeMsecMult10 0x0322 -#define lt_uMaxAnGain2 0x049A -#define REG_TC_GP_ActivePrevConfig 0x021C -#define REG_TC_GP_PrevOpenAfterChange 0x0220 -#define REG_TC_GP_NewConfigSync 0x01F8 -#define REG_TC_GP_PrevConfigChanged 0x021E -#define REG_TC_GP_ActiveCapConfig 0x0224 -#define REG_TC_GP_CapConfigChanged 0x0226 -#define REG_TC_GP_EnableCapture 0x01F4 -#define REG_TC_GP_EnableCaptureChanged 0x01F6 - -#define lt_uMaxExp1 0x0488 // 0x9C40 -#define lt_uMaxExp2 0x048C // 0xE848 -#define lt_uCapMaxExp1 0x0490 // 0x9C40 -#define lt_uCapMaxExp2 0x0494 // 0xE848 -#define lt_uMaxDigGain 0x049C // 0x0200 -#define lt_uMaxAnGain1 0x0498 // 0x0200 -#define lt_uMaxAnGain2 0x049A // 0x0500 - - -#define REG_1TC_CCFG_uCaptureMode 0x032E // 0x0000 -#define REG_1TC_CCFG_Cfg 0x0330 // 0x0500 -#define REG_1TC_CCFG_usWidth 0x0330 // 0x0500 -#define REG_1TC_CCFG_usHeight 0x0332 // 0x03C0 -#define REG_1TC_CCFG_Format 0x0334 // 0x0009 -#define REG_1TC_CCFG_usMaxOut4KHzRate 0x0336 // 0x1770 -#define REG_1TC_CCFG_usMinOut4KHzRate 0x0338 // 0x05DC -#define REG_1TC_CCFG_PVIMask 0x033A // 0x0042 -#define REG_1TC_CCFG_uClockInd 0x033C // 0x0000 -#define REG_1TC_CCFG_usFrTimeType 0x033E // 0x0000 -#define REG_1TC_CCFG_FrRateQualityType 0x0340 // 0x0002 -#define REG_1TC_CCFG_usMaxFrTimeMsecMult10 0x0342 // 0x1964 -#define REG_1TC_CCFG_usMinFrTimeMsecMult10 0x0344 // 0x0000 -#define REG_1TC_CCFG_sSaturation 0x0346 // 0x0000 -#define REG_1TC_CCFG_sSharpBlur 0x0348 // 0x0000 -#define REG_1TC_CCFG_sGlamour 0x034A // 0x0000 -#define REG_1TC_CCFG_sColorTemp 0x034C // 0x0000 -#define REG_1TC_CCFG_uDeviceGammaIndex 0x034E // 0x0000 -#define REG_CapConfigControls_2_ 0x0350 // 0x0000 - - -#define REG_1TC_PCFG_usWidth 0x0268 -#define REG_1TC_PCFG_usHeight 0x026A -#define REG_1TC_PCFG_Format 0x026C -#define REG_1TC_PCFG_usMaxOut4KHzRate 0x026E -#define REG_1TC_PCFG_usMinOut4KHzRate 0x0270 -#define REG_1TC_PCFG_PVIMask 0x0272 -#define REG_1TC_PCFG_uClockInd 0x0274 -#define REG_1TC_PCFG_usFrTimeType 0x0276 -#define REG_1TC_PCFG_FrRateQualityType 0x0278 -#define REG_1TC_PCFG_usMaxFrTimeMsecMult10 0x027A -#define REG_1TC_PCFG_usMinFrTimeMsecMult10 0x027C - -#define AFC_Default60Hz 0x0B2A -#define REG_TC_DBG_AutoAlgEnBits 0x0400 -#define REG_SF_USER_FlickerQuant 0x03DC -#define REG_SF_USER_FlickerQuantChanged 0x03DE - - -#define REG_2TC_PCFG_usWidth 0x028E -#define REG_2TC_PCFG_usHeight 0x0290 -#define REG_2TC_PCFG_Format 0x0292 -#define REG_2TC_PCFG_usMaxOut4KHzRate 0x0294 -#define REG_2TC_PCFG_usMinOut4KHzRate 0x0296 -#define REG_2TC_PCFG_PVIMask 0x0298 -#define REG_2TC_PCFG_uClockInd 0x029A -#define REG_2TC_PCFG_usFrTimeType 0x029C -#define REG_2TC_PCFG_FrRateQualityType 0x029E -#define REG_2TC_PCFG_usMaxFrTimeMsecMult10 0x02A0 -#define REG_2TC_PCFG_usMinFrTimeMsecMult10 0x02A2 - -#define REG_3TC_PCFG_usWidth 0x02B4 -#define REG_3TC_PCFG_usHeight 0x02B6 -#define REG_3TC_PCFG_Format 0x02B8 -#define REG_3TC_PCFG_usMaxOut4KHzRate 0x02BA -#define REG_3TC_PCFG_usMinOut4KHzRate 0x02BC -#define REG_3TC_PCFG_PVIMask 0x02BE -#define REG_3TC_PCFG_uClockInd 0x02C0 -#define REG_3TC_PCFG_usFrTimeType 0x02C2 -#define REG_3TC_PCFG_FrRateQualityType 0x02C4 -#define REG_3TC_PCFG_usMaxFrTimeMsecMult10 0x02C6 -#define REG_3TC_PCFG_usMinFrTimeMsecMult10 0x02C8 - -#define SEQUENCE_INIT 0x00 -#define SEQUENCE_NORMAL 0x01 -#define SEQUENCE_CAPTURE 0x02 -#define SEQUENCE_PREVIEW 0x03 - -#define SEQUENCE_PROPERTY 0xFFF9 -#define SEQUENCE_WAIT_MS 0xFFFA -#define SEQUENCE_WAIT_US 0xFFFB -#define SEQUENCE_END (0xFFFF) -#define SEQUENCE_FAST_SETMODE_START (0xFFFD) -#define SEQUENCE_FAST_SETMODE_END (0xFFFC) - - -/*configure register for flipe and mirror during initial*/ -#define CONFIG_SENSOR_FLIPE 0 -#define CONFIG_SENSOR_MIRROR 1 -#define CONFIG_SENSOR_MIRROR_AND_FLIPE 0 -#define CONFIG_SENSOR_NONE_FLIP_MIRROR 0 -/**configure to indicate android cts****/ -#define CONFIG_SENSOR_FOR_CTS 1 -#endif \ No newline at end of file diff --git a/drivers/media/video/s5k6aa.c b/drivers/media/video/s5k6aa.c deleted file mode 100755 index b494797b7527..000000000000 --- a/drivers/media/video/s5k6aa.c +++ /dev/null @@ -1,4818 +0,0 @@ -/* - * Driver for OV5642 CMOS Image Sensor from OmniVision - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "s5k6aa.h" -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_S5K6AA -#define SENSOR_V4L2_IDENT V4L2_IDENT_S5K66A -#define SENSOR_ID 0x06aa -#define SENSOR_ID_REG SEQUENCE_END//0x015a -#define SENSOR_RESET_REG SEQUENCE_END -#define SENSOR_RESET_VAL 0x00 -#define SENSOR_MIN_WIDTH 640 -#define SENSOR_MIN_HEIGHT 480 -#define SENSOR_MAX_WIDTH 1280 -#define SENSOR_MAX_HEIGHT 1024 -#define SENSOR_INIT_WIDTH 640 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 480 -#define SENSOR_INIT_WINSEQADR sensor_vga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_YUYV8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 0 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 0 -#define CONFIG_SENSOR_Scene 0 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 0 -#define CONFIG_SENSOR_Mirror 1 -#define CONFIG_SENSOR_Flip 0 -#define CONFIG_SENSOR_Focus 0 - - -#define CONFIG_SENSOR_I2C_SPEED 250000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) - -#if CONFIG_SENSOR_Focus -#define SENSOR_AF_MODE_INFINITY 0 -#define SENSOR_AF_MODE_MACRO 1 -#define SENSOR_AF_MODE_FIXED 2 -#define SENSOR_AF_MODE_AUTO 3 -#define SENSOR_AF_MODE_CONTINUOUS 4 -#define SENSOR_AF_MODE_CLOSE 5 -#endif - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -#if CONFIG_SENSOR_Flash -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); -#endif -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_S5K6AA_USER_DEFINED_SERIES -#include "s5k6aa_user_series.c" -#else - -/* init 640X480 SVGA */ -static struct reginfo sensor_init_data[] = -{ - {0x0010,0x0001}, // Reset - {0x1030,0x0000}, // Clear host interrupt so main will wait - {0x0014,0x0001}, // ARM go - // Wait100mSec - {SEQUENCE_WAIT_MS,50}, - // Start TP part - {0x0028,0x7000}, // start add MSW - {0x002A,0x1d60}, // start add LSW - {0x0F12,0xb570}, - {0x0F12,0x4928}, - {0x0F12,0x4828}, - {0x0F12,0x2205}, - {0x0F12,0xf000}, - {0x0F12,0xf922}, - {0x0F12,0x4927}, - {0x0F12,0x2002}, - {0x0F12,0x83c8}, - {0x0F12,0x2001}, - {0x0F12,0x3120}, - {0x0F12,0x8088}, - {0x0F12,0x4925}, - {0x0F12,0x4826}, - {0x0F12,0x2204}, - {0x0F12,0xf000}, - {0x0F12,0xf917}, - {0x0F12,0x4925}, - {0x0F12,0x4825}, - {0x0F12,0x2206}, - {0x0F12,0xf000}, - {0x0F12,0xf912}, - {0x0F12,0x4924}, - {0x0F12,0x4825}, - {0x0F12,0x2207}, - {0x0F12,0xf000}, - {0x0F12,0xf90d}, - {0x0F12,0x4924}, - {0x0F12,0x4824}, - {0x0F12,0x2208}, - {0x0F12,0xf000}, - {0x0F12,0xf908}, - {0x0F12,0x4923}, - {0x0F12,0x4824}, - {0x0F12,0x2209}, - {0x0F12,0xf000}, - {0x0F12,0xf903}, - {0x0F12,0x4923}, - {0x0F12,0x4823}, - {0x0F12,0x60c1}, - {0x0F12,0x6882}, - {0x0F12,0x1a51}, - {0x0F12,0x8201}, - {0x0F12,0x4c22}, - {0x0F12,0x2607}, - {0x0F12,0x6821}, - {0x0F12,0x0736}, - {0x0F12,0x42b1}, - {0x0F12,0xda05}, - {0x0F12,0x4820}, - {0x0F12,0x22d8}, - {0x0F12,0x1c05}, - {0x0F12,0xf000}, - {0x0F12,0xf8fa}, - {0x0F12,0x6025}, - {0x0F12,0x68a1}, - {0x0F12,0x42b1}, - {0x0F12,0xda07}, - {0x0F12,0x481b}, - {0x0F12,0x2224}, - {0x0F12,0x3824}, - {0x0F12,0xf000}, - {0x0F12,0xf8f1}, - {0x0F12,0x4819}, - {0x0F12,0x3824}, - {0x0F12,0x60a0}, - {0x0F12,0x4d18}, - {0x0F12,0x6d29}, - {0x0F12,0x42b1}, - {0x0F12,0xda07}, - {0x0F12,0x4815}, - {0x0F12,0x228f}, - {0x0F12,0x00d2}, - {0x0F12,0x30d8}, - {0x0F12,0x1c04}, - {0x0F12,0xf000}, - {0x0F12,0xf8e3}, - {0x0F12,0x652c}, - {0x0F12,0xbc70}, - {0x0F12,0xbc08}, - {0x0F12,0x4718}, - {0x0F12,0x0000}, - {0x0F12,0x1f53}, - {0x0F12,0x7000}, - {0x0F12,0x127b}, - {0x0F12,0x0000}, - {0x0F12,0x0398}, - {0x0F12,0x7000}, - {0x0F12,0x1e4d}, - {0x0F12,0x7000}, - {0x0F12,0x890d}, - {0x0F12,0x0000}, - {0x0F12,0x1e73}, - {0x0F12,0x7000}, - {0x0F12,0x27a9}, - {0x0F12,0x0000}, - {0x0F12,0x1e91}, - {0x0F12,0x7000}, - {0x0F12,0x27c5}, - {0x0F12,0x0000}, - {0x0F12,0x1ef7}, - {0x0F12,0x7000}, - {0x0F12,0x285f}, - {0x0F12,0x0000}, - {0x0F12,0x1eb3}, - {0x0F12,0x7000}, - {0x0F12,0x28ff}, - {0x0F12,0x0000}, - {0x0F12,0x206c}, - {0x0F12,0x7000}, - {0x0F12,0x04ac}, - {0x0F12,0x7000}, - {0x0F12,0x06cc}, - {0x0F12,0x7000}, - {0x0F12,0x23a4}, - {0x0F12,0x7000}, - {0x0F12,0x0704}, - {0x0F12,0x7000}, - {0x0F12,0xb510}, - {0x0F12,0x1c04}, - {0x0F12,0x484d}, - {0x0F12,0xf000}, - {0x0F12,0xf8bb}, - {0x0F12,0x4a4d}, - {0x0F12,0x4b4d}, - {0x0F12,0x8811}, - {0x0F12,0x885b}, - {0x0F12,0x8852}, - {0x0F12,0x4359}, - {0x0F12,0x1889}, - {0x0F12,0x4288}, - {0x0F12,0xd800}, - {0x0F12,0x1c08}, - {0x0F12,0x6020}, - {0x0F12,0xbc10}, - {0x0F12,0xbc08}, - {0x0F12,0x4718}, - {0x0F12,0xb510}, - {0x0F12,0x1c04}, - {0x0F12,0xf000}, - {0x0F12,0xf8b1}, - {0x0F12,0x4944}, - {0x0F12,0x8989}, - {0x0F12,0x4348}, - {0x0F12,0x0200}, - {0x0F12,0x0c00}, - {0x0F12,0x2101}, - {0x0F12,0x0349}, - {0x0F12,0xf000}, - {0x0F12,0xf8b0}, - {0x0F12,0x6020}, - {0x0F12,0xe7ed}, - {0x0F12,0xb510}, - {0x0F12,0x1c04}, - {0x0F12,0xf000}, - {0x0F12,0xf8b2}, - {0x0F12,0x6821}, - {0x0F12,0x0409}, - {0x0F12,0x0c09}, - {0x0F12,0x1a40}, - {0x0F12,0x493a}, - {0x0F12,0x6849}, - {0x0F12,0x4281}, - {0x0F12,0xd800}, - {0x0F12,0x1c08}, - {0x0F12,0xf000}, - {0x0F12,0xf8af}, - {0x0F12,0x6020}, - {0x0F12,0xe7dc}, - {0x0F12,0xb570}, - {0x0F12,0x6801}, - {0x0F12,0x040d}, - {0x0F12,0x0c2d}, - {0x0F12,0x6844}, - {0x0F12,0x4833}, - {0x0F12,0x8981}, - {0x0F12,0x1c28}, - {0x0F12,0xf000}, - {0x0F12,0xf893}, - {0x0F12,0x8060}, - {0x0F12,0x4932}, - {0x0F12,0x69c9}, - {0x0F12,0xf000}, - {0x0F12,0xf8a6}, - {0x0F12,0x1c01}, - {0x0F12,0x80a0}, - {0x0F12,0x0228}, - {0x0F12,0xf000}, - {0x0F12,0xf8a9}, - {0x0F12,0x0400}, - {0x0F12,0x0c00}, - {0x0F12,0x8020}, - {0x0F12,0x492d}, - {0x0F12,0x2300}, - {0x0F12,0x5ec9}, - {0x0F12,0x4288}, - {0x0F12,0xda02}, - {0x0F12,0x20ff}, - {0x0F12,0x3001}, - {0x0F12,0x8020}, - {0x0F12,0xbc70}, - {0x0F12,0xbc08}, - {0x0F12,0x4718}, - {0x0F12,0xb570}, - {0x0F12,0x1c04}, - {0x0F12,0x4828}, - {0x0F12,0x4926}, - {0x0F12,0x7803}, - {0x0F12,0x6a8a}, - {0x0F12,0x2b00}, - {0x0F12,0xd100}, - {0x0F12,0x6a0a}, - {0x0F12,0x4d20}, - {0x0F12,0x2b00}, - {0x0F12,0x68a8}, - {0x0F12,0xd100}, - {0x0F12,0x6868}, - {0x0F12,0x6823}, - {0x0F12,0x8dc9}, - {0x0F12,0x434a}, - {0x0F12,0x0a12}, - {0x0F12,0x429a}, - {0x0F12,0xd30d}, - {0x0F12,0x4d20}, - {0x0F12,0x26ff}, - {0x0F12,0x8828}, - {0x0F12,0x3601}, - {0x0F12,0x43b0}, - {0x0F12,0x8028}, - {0x0F12,0x6820}, - {0x0F12,0xf000}, - {0x0F12,0xf884}, - {0x0F12,0x6020}, - {0x0F12,0x8828}, - {0x0F12,0x4330}, - {0x0F12,0x8028}, - {0x0F12,0xe7da}, - {0x0F12,0x1c0a}, - {0x0F12,0x4342}, - {0x0F12,0x0a12}, - {0x0F12,0x429a}, - {0x0F12,0xd304}, - {0x0F12,0x0218}, - {0x0F12,0xf000}, - {0x0F12,0xf871}, - {0x0F12,0x6020}, - {0x0F12,0xe7f4}, - {0x0F12,0x6020}, - {0x0F12,0xe7f2}, - {0x0F12,0xb510}, - {0x0F12,0x4913}, - {0x0F12,0x8fc8}, - {0x0F12,0x2800}, - {0x0F12,0xd007}, - {0x0F12,0x2000}, - {0x0F12,0x87c8}, - {0x0F12,0x8f88}, - {0x0F12,0x4c11}, - {0x0F12,0x2800}, - {0x0F12,0xd002}, - {0x0F12,0x2008}, - {0x0F12,0x8020}, - {0x0F12,0xe77e}, - {0x0F12,0x480d}, - {0x0F12,0x3060}, - {0x0F12,0x8900}, - {0x0F12,0x2800}, - {0x0F12,0xd103}, - {0x0F12,0x480c}, - {0x0F12,0x2101}, - {0x0F12,0xf000}, - {0x0F12,0xf864}, - {0x0F12,0x2010}, - {0x0F12,0x8020}, - {0x0F12,0xe7f2}, - {0x0F12,0x0000}, - {0x0F12,0xf4b0}, - {0x0F12,0x0000}, - {0x0F12,0x2058}, - {0x0F12,0x7000}, - {0x0F12,0x1554}, - {0x0F12,0x7000}, - {0x0F12,0x0080}, - {0x0F12,0x7000}, - {0x0F12,0x046c}, - {0x0F12,0x7000}, - {0x0F12,0x0468}, - {0x0F12,0x7000}, - {0x0F12,0x1100}, - {0x0F12,0xd000}, - {0x0F12,0x01b8}, - {0x0F12,0x7000}, - {0x0F12,0x044e}, - {0x0F12,0x7000}, - {0x0F12,0x0450}, - {0x0F12,0x7000}, - {0x0F12,0x4778}, - {0x0F12,0x46c0}, - {0x0F12,0xc000}, - {0x0F12,0xe59f}, - {0x0F12,0xff1c}, - {0x0F12,0xe12f}, - {0x0F12,0x9ce7}, - {0x0F12,0x0000}, - {0x0F12,0x4778}, - {0x0F12,0x46c0}, - {0x0F12,0xf004}, - {0x0F12,0xe51f}, - {0x0F12,0x9fb8}, - {0x0F12,0x0000}, - {0x0F12,0x4778}, - {0x0F12,0x46c0}, - {0x0F12,0xc000}, - {0x0F12,0xe59f}, - {0x0F12,0xff1c}, - {0x0F12,0xe12f}, - {0x0F12,0x88df}, - {0x0F12,0x0000}, - {0x0F12,0x4778}, - {0x0F12,0x46c0}, - {0x0F12,0xc000}, - {0x0F12,0xe59f}, - {0x0F12,0xff1c}, - {0x0F12,0xe12f}, - {0x0F12,0x275d}, - {0x0F12,0x0000}, - {0x0F12,0x4778}, - {0x0F12,0x46c0}, - {0x0F12,0xc000}, - {0x0F12,0xe59f}, - {0x0F12,0xff1c}, - {0x0F12,0xe12f}, - {0x0F12,0x1ed3}, - {0x0F12,0x0000}, - {0x0F12,0x4778}, - {0x0F12,0x46c0}, - {0x0F12,0xc000}, - {0x0F12,0xe59f}, - {0x0F12,0xff1c}, - {0x0F12,0xe12f}, - {0x0F12,0x26f9}, - {0x0F12,0x0000}, - {0x0F12,0x4778}, - {0x0F12,0x46c0}, - {0x0F12,0xc000}, - {0x0F12,0xe59f}, - {0x0F12,0xff1c}, - {0x0F12,0xe12f}, - {0x0F12,0x4027}, - {0x0F12,0x0000}, - {0x0F12,0x4778}, - {0x0F12,0x46c0}, - {0x0F12,0xc000}, - {0x0F12,0xe59f}, - {0x0F12,0xff1c}, - {0x0F12,0xe12f}, - {0x0F12,0x9f03}, - {0x0F12,0x0000}, - {0x0F12,0x4778}, - {0x0F12,0x46c0}, - {0x0F12,0xf004}, - {0x0F12,0xe51f}, - {0x0F12,0xa144}, - {0x0F12,0x0000}, - {0x0F12,0x4778}, - {0x0F12,0x46c0}, - {0x0F12,0xc000}, - {0x0F12,0xe59f}, - {0x0F12,0xff1c}, - {0x0F12,0xe12f}, - {0x0F12,0x285f}, - {0x0F12,0x0000}, - {0x0F12,0x4778}, - {0x0F12,0x46c0}, - {0x0F12,0xc000}, - {0x0F12,0xe59f}, - {0x0F12,0xff1c}, - {0x0F12,0xe12f}, - {0x0F12,0x2001}, - {0x0F12,0x0000}, - {0x0F12,0x0000}, - {0x0F12,0x0000}, - {0x0F12,0xe848}, - {0x0F12,0x0001}, - {0x0F12,0xe848}, - {0x0F12,0x0001}, - {0x0F12,0x0500}, - {0x0F12,0x0000}, - {0x0F12,0x0000}, - {0x0F12,0x0000}, - // End TP part - - - // Start tuning part - - // Write memory example: - // m70003000 10CE - // Write HW register example: - // 1004 5678 - - {0x002A,0x0e3a}, // #awbb_Alpha_Comp_Mode - {0x0F12,0x02C2}, - - // Analog Settings - {0x002A,0x112a}, //#senHal_SenRegsModes3_pSenModesRegsArray3[8] - {0x0F12,0x0000}, - {0x002A,0x1132}, //#senHal_SenRegsModes3_pSenModesRegsArray3[12] - {0x0F12,0x0000}, - {0x002A,0x113e}, //#senHal_SenRegsModes3_pSenModesRegsArray3[18] - {0x0F12,0x0000}, - {0x002A,0x115c}, //#senHal_SenRegsModes3_pSenModesRegsArray3[33] - {0x0F12,0x0000}, - {0x002A,0x1164}, //#senHal_SenRegsModes3_pSenModesRegsArray3[37] - {0x0F12,0x0000}, - {0x002A,0x1174}, //#senHal_SenRegsModes3_pSenModesRegsArray3[45] - {0x0F12,0x0000}, - {0x002A,0x1178}, //#senHal_SenRegsModes3_pSenModesRegsArray3[47] - {0x0F12,0x0000}, - - {0x002A,0x077a}, //#msm_uOffsetNoBin[0][0] - {0x0F12,0x0000}, //#msm_uOffsetNoBin[0][1] - {0x0F12,0x0000}, //#msm_uOffsetNoBin[1][0] - {0x0F12,0x0000}, //#msm_uOffsetNoBin[1][1] - {0x0F12,0x0000}, //#msm_uOffsetNoBin[2][0] - {0x0F12,0x0000}, //#msm_uOffsetNoBin[2][1] - {0x0F12,0x0000}, //#msm_uOffsetNoBin[3][0] - {0x0F12,0x0000}, //#msm_uOffsetNoBin[3][1] - {0x0F12,0x0000}, - - {0x002A,0x07a2}, //#msm_sAnalogOffset[0] - {0x0F12,0x0000}, //#msm_sAnalogOffset[1] - {0x0F12,0x0000}, //#msm_sAnalogOffset[2] - {0x0F12,0x0000}, //#msm_sAnalogOffset[3] - {0x0F12,0x0000}, - - {0x002A,0x07b6}, //#msm_NonLinearOfsOutput[0] - {0x0F12,0x0000}, //#msm_NonLinearOfsOutput[1] - {0x0F12,0x0002}, //#msm_NonLinearOfsOutput[2] - {0x0F12,0x0004}, //#msm_NonLinearOfsOutput[3] - {0x0F12,0x0004}, //#msm_NonLinearOfsOutput[4] - {0x0F12,0x0005}, //#msm_NonLinearOfsOutput[5] - {0x0F12,0x0005}, - - // param_start TVAR_ash_GASAlpha - {0x002A,0x0712}, - {0x0F12,0x0149}, - {0x0F12,0x011B}, - {0x0F12,0x0120}, - {0x0F12,0x00EF}, - {0x0F12,0x00C3}, - {0x0F12,0x00D2}, - {0x0F12,0x00DC}, - {0x0F12,0x00B8}, - {0x0F12,0x0106}, - {0x0F12,0x00DE}, - {0x0F12,0x00E3}, - {0x0F12,0x00CC}, - {0x0F12,0x00BD}, - {0x0F12,0x00E1}, - {0x0F12,0x00D8}, - {0x0F12,0x00D0}, - {0x0F12,0x00BE}, - {0x0F12,0x00EC}, - {0x0F12,0x00EA}, - {0x0F12,0x00F2}, - {0x0F12,0x00BE}, - {0x0F12,0x00EB}, - {0x0F12,0x00E5}, - {0x0F12,0x00F9}, - {0x0F12,0x0100}, //0x00BE - {0x0F12,0x00D5}, - {0x0F12,0x00D8}, - {0x0F12,0x00E6}, - - // param_end TVAR_ash_GASAlpha - // param_start TVAR_ash_GASOutdoorAlpha - {0x0F12,0x00FD}, - {0x0F12,0x00F7}, - {0x0F12,0x00F3}, - {0x0F12,0x00FF}, - // param_end TVAR_ash_GASOutdoorAlpha - {0x002A,0x075A}, - {0x0F12,0x0001}, - {0x0F12,0x02A1}, - {0x0F12,0x0225}, - {0x0F12,0x000D}, - {0x0F12,0x000D}, - // param_start TVAR_ash_pGAS - {0x002A,0x247C}, - {0x0F12,0x0164}, //TVAR_ash_pGAS[0] 0128 //018C - {0x0F12,0x0122}, //TVAR_ash_pGAS[1] 00F6 //0147 - {0x0F12,0x00E4}, //TVAR_ash_pGAS[2] 00C7 //010E - {0x0F12,0x00B8}, //TVAR_ash_pGAS[3] 00B7 //00E5 - {0x0F12,0x009D}, //TVAR_ash_pGAS[4] 00AA //00C5 - {0x0F12,0x008D}, //TVAR_ash_pGAS[5] 009D //00B0 - {0x0F12,0x0083}, //TVAR_ash_pGAS[6] 0097 //00A7 - {0x0F12,0x0088}, //TVAR_ash_pGAS[7] 0097 //00AA - {0x0F12,0x009C}, //TVAR_ash_pGAS[8] 009E //00B8 - {0x0F12,0x00BB}, //TVAR_ash_pGAS[9] 00A9 //00D1 - {0x0F12,0x00E5}, //TVAR_ash_pGAS[10] 00B4 //00F7 - {0x0F12,0x0121}, //TVAR_ash_pGAS[11] 00CA //0130 - {0x0F12,0x0169}, //TVAR_ash_pGAS[12] 0105 //016F - {0x0F12,0x0138}, //TVAR_ash_pGAS[13] 00DA //0148 - {0x0F12,0x00FB}, //TVAR_ash_pGAS[14] 00B4 //010A - {0x0F12,0x00B9}, //TVAR_ash_pGAS[15] 0099 //00D2 - {0x0F12,0x008C}, //TVAR_ash_pGAS[16] 0089 //00AB - {0x0F12,0x006E}, //TVAR_ash_pGAS[17] 0077 //008F - {0x0F12,0x005B}, //TVAR_ash_pGAS[18] 006A //007B - {0x0F12,0x0053}, //TVAR_ash_pGAS[19] 0063 //0073 - {0x0F12,0x0059}, //TVAR_ash_pGAS[20] 0064 //0075 - {0x0F12,0x006B}, //TVAR_ash_pGAS[21] 006D //0085 - {0x0F12,0x0086}, //TVAR_ash_pGAS[22] 007B //009D - {0x0F12,0x00B1}, //TVAR_ash_pGAS[23] 008B //00C1 - {0x0F12,0x00E9}, //TVAR_ash_pGAS[24] 009C //00F7 - {0x0F12,0x012F}, //TVAR_ash_pGAS[25] 00BD //0134 - {0x0F12,0x0111}, //TVAR_ash_pGAS[26] 00A4 //0111 - {0x0F12,0x00D1}, //TVAR_ash_pGAS[27] 0093 //00D5 - {0x0F12,0x0094}, //TVAR_ash_pGAS[28] 0079 //00A1 - {0x0F12,0x0069}, //TVAR_ash_pGAS[29] 0063 //007B - {0x0F12,0x004A}, //TVAR_ash_pGAS[30] 004F //005F - {0x0F12,0x0036}, //TVAR_ash_pGAS[31] 0040 //004B - {0x0F12,0x002C}, //TVAR_ash_pGAS[32] 0039 //0043 - {0x0F12,0x0032}, //TVAR_ash_pGAS[33] 003B //0046 - {0x0F12,0x0042}, //TVAR_ash_pGAS[34] 0044 //0057 - {0x0F12,0x0060}, //TVAR_ash_pGAS[35] 0054 //0072 - {0x0F12,0x008A}, //TVAR_ash_pGAS[36] 006A //0093 - {0x0F12,0x00C0}, //TVAR_ash_pGAS[37] 0081 //00C7 - {0x0F12,0x0103}, //TVAR_ash_pGAS[38] 009B //00FD - {0x0F12,0x00F9}, //TVAR_ash_pGAS[39] 008D //00EA - {0x0F12,0x00B7}, //TVAR_ash_pGAS[40] 007E //00B1 - {0x0F12,0x007E}, //TVAR_ash_pGAS[41] 005F //0080 - {0x0F12,0x0054}, //TVAR_ash_pGAS[42] 0046 //005A - {0x0F12,0x0033}, //TVAR_ash_pGAS[43] 0032 //003D - {0x0F12,0x001B}, //TVAR_ash_pGAS[44] 0023 //0029 - {0x0F12,0x0013}, //TVAR_ash_pGAS[45] 001C //0021 - {0x0F12,0x0018}, //TVAR_ash_pGAS[46] 001E //0025 - {0x0F12,0x002A}, //TVAR_ash_pGAS[47] 0026 //0036 - {0x0F12,0x004A}, //TVAR_ash_pGAS[48] 0038 //0051 - {0x0F12,0x0075}, //TVAR_ash_pGAS[49] 004F //0074 - {0x0F12,0x00AC}, //TVAR_ash_pGAS[50] 006A //00A3 - {0x0F12,0x00F0}, //TVAR_ash_pGAS[51] 0088 //00DA - {0x0F12,0x00EF}, //TVAR_ash_pGAS[52] 0081 //00D2 - {0x0F12,0x00AE}, //TVAR_ash_pGAS[53] 0070 //009B - {0x0F12,0x0076}, //TVAR_ash_pGAS[54] 004F //006B - {0x0F12,0x004A}, //TVAR_ash_pGAS[55] 0034 //0043 - {0x0F12,0x0025}, //TVAR_ash_pGAS[56] 001F //0027 - {0x0F12,0x000D}, //TVAR_ash_pGAS[57] 0010 //0013 - {0x0F12,0x0004}, //TVAR_ash_pGAS[58] 0009 //000A - {0x0F12,0x000A}, //TVAR_ash_pGAS[59] 000B //000F - {0x0F12,0x001E}, //TVAR_ash_pGAS[60] 0015 //0021 - {0x0F12,0x003F}, //TVAR_ash_pGAS[61] 0026 //003D - {0x0F12,0x006C}, //TVAR_ash_pGAS[62] 0040 //0060 - {0x0F12,0x00A7}, //TVAR_ash_pGAS[63] 005D //0091 - {0x0F12,0x00EA}, //TVAR_ash_pGAS[64] 007E //00C2 - {0x0F12,0x00F6}, //TVAR_ash_pGAS[65] 007C //00C6 - {0x0F12,0x00B3}, //TVAR_ash_pGAS[66] 0068 //0094 - {0x0F12,0x007B}, //TVAR_ash_pGAS[67] 0047 //0063 - {0x0F12,0x004C}, //TVAR_ash_pGAS[68] 002C //003B - {0x0F12,0x0024}, //TVAR_ash_pGAS[69] 0017 //001E - {0x0F12,0x000B}, //TVAR_ash_pGAS[70] 0007 //0009 - {0x0F12,0x0000}, //TVAR_ash_pGAS[71] 0000 //0000 - {0x0F12,0x0007}, //TVAR_ash_pGAS[72] 0002 //0006 - {0x0F12,0x001E}, //TVAR_ash_pGAS[73] 000D //0019 - {0x0F12,0x0041}, //TVAR_ash_pGAS[74] 0020 //0035 - {0x0F12,0x0071}, //TVAR_ash_pGAS[75] 003A //005A - {0x0F12,0x00AD}, //TVAR_ash_pGAS[76] 0059 //0089 - {0x0F12,0x00F3}, //TVAR_ash_pGAS[77] 007E //00BA - {0x0F12,0x010B}, //TVAR_ash_pGAS[78] 007E //00C8 - {0x0F12,0x00C6}, //TVAR_ash_pGAS[79] 006A //0095 - {0x0F12,0x0089}, //TVAR_ash_pGAS[80] 0048 //0063 - {0x0F12,0x0058}, //TVAR_ash_pGAS[81] 002D //003D - {0x0F12,0x0032}, //TVAR_ash_pGAS[82] 0018 //0020 - {0x0F12,0x0017}, //TVAR_ash_pGAS[83] 0008 //000D - {0x0F12,0x000D}, //TVAR_ash_pGAS[84] 0001 //0004 - {0x0F12,0x0015}, //TVAR_ash_pGAS[85] 0003 //0009 - {0x0F12,0x002D}, //TVAR_ash_pGAS[86] 000E //001C - {0x0F12,0x0053}, //TVAR_ash_pGAS[87] 0021 //0038 - {0x0F12,0x0085}, //TVAR_ash_pGAS[88] 003D //005F - {0x0F12,0x00C4}, //TVAR_ash_pGAS[89] 0060 //008E - {0x0F12,0x010B}, //TVAR_ash_pGAS[90] 0086 //00BE - {0x0F12,0x012F}, //TVAR_ash_pGAS[91] 0087 //00D7 - {0x0F12,0x00E7}, //TVAR_ash_pGAS[92] 0073 //00A1 - {0x0F12,0x00A7}, //TVAR_ash_pGAS[93] 0051 //006E - {0x0F12,0x0073}, //TVAR_ash_pGAS[94] 0036 //0049 - {0x0F12,0x004E}, //TVAR_ash_pGAS[95] 0022 //002D - {0x0F12,0x0033}, //TVAR_ash_pGAS[96] 0013 //001B - {0x0F12,0x002A}, //TVAR_ash_pGAS[97] 000B //0014 - {0x0F12,0x0032}, //TVAR_ash_pGAS[98] 000D //001A - {0x0F12,0x004B}, //TVAR_ash_pGAS[99] 0019 //002C - {0x0F12,0x0072}, //TVAR_ash_pGAS[100] 002C //0048 - {0x0F12,0x00A7}, //TVAR_ash_pGAS[101] 004A //006C - {0x0F12,0x00E9}, //TVAR_ash_pGAS[102] 006F //009D - {0x0F12,0x0133}, //TVAR_ash_pGAS[103] 0093 //00D1 - {0x0F12,0x0162}, //TVAR_ash_pGAS[104] 0099 //00F3 - {0x0F12,0x0110}, //TVAR_ash_pGAS[105] 0086 //00B9 - {0x0F12,0x00CE}, //TVAR_ash_pGAS[106] 0066 //0086 - {0x0F12,0x009B}, //TVAR_ash_pGAS[107] 004A //0063 - {0x0F12,0x0078}, //TVAR_ash_pGAS[108] 0035 //0047 - {0x0F12,0x0060}, //TVAR_ash_pGAS[109] 0025 //0034 - {0x0F12,0x0057}, //TVAR_ash_pGAS[110] 001E //002E - {0x0F12,0x0061}, //TVAR_ash_pGAS[111] 0021 //0034 - {0x0F12,0x0079}, //TVAR_ash_pGAS[112] 002C //0046 - {0x0F12,0x00A2}, //TVAR_ash_pGAS[113] 0041 //0062 - {0x0F12,0x00D8}, //TVAR_ash_pGAS[114] 0061 //0087 - {0x0F12,0x011E}, //TVAR_ash_pGAS[115] 0087 //00B8 - {0x0F12,0x016E}, //TVAR_ash_pGAS[116] 00A8 //00F2 - {0x0F12,0x01A8}, //TVAR_ash_pGAS[117] 00B8 //011D - {0x0F12,0x014D}, //TVAR_ash_pGAS[118] 00A1 //00E5 - {0x0F12,0x0104}, //TVAR_ash_pGAS[119] 0084 //00B0 - {0x0F12,0x00D5}, //TVAR_ash_pGAS[120] 0069 //0089 - {0x0F12,0x00B3}, //TVAR_ash_pGAS[121] 0054 //006F - {0x0F12,0x009B}, //TVAR_ash_pGAS[122] 0044 //005D - {0x0F12,0x0095}, //TVAR_ash_pGAS[123] 003E //0057 - {0x0F12,0x009E}, //TVAR_ash_pGAS[124] 0040 //005D - {0x0F12,0x00B7}, //TVAR_ash_pGAS[125] 004C //006E - {0x0F12,0x00E1}, //TVAR_ash_pGAS[126] 0063 //008B - {0x0F12,0x0119}, //TVAR_ash_pGAS[127] 0083 //00B3 - {0x0F12,0x0166}, //TVAR_ash_pGAS[128] 00A8 //00E6 - {0x0F12,0x01C6}, //TVAR_ash_pGAS[129] 00C9 //0129 - {0x0F12,0x01F1}, //TVAR_ash_pGAS[130] 00EE //013E - {0x0F12,0x0199}, //TVAR_ash_pGAS[131] 00C4 //010D - {0x0F12,0x014D}, //TVAR_ash_pGAS[132] 00AB //00D8 - {0x0F12,0x011A}, //TVAR_ash_pGAS[133] 0091 //00B2 - {0x0F12,0x00F5}, //TVAR_ash_pGAS[134] 007B //0096 - {0x0F12,0x00DD}, //TVAR_ash_pGAS[135] 006D //0084 - {0x0F12,0x00D8}, //TVAR_ash_pGAS[136] 0066 //007E - {0x0F12,0x00E4}, //TVAR_ash_pGAS[137] 0068 //0083 - {0x0F12,0x00FB}, //TVAR_ash_pGAS[138] 0075 //0096 - {0x0F12,0x0128}, //TVAR_ash_pGAS[139] 008E //00B3 - {0x0F12,0x0166}, //TVAR_ash_pGAS[140] 00AF //00DB - {0x0F12,0x01BC}, //TVAR_ash_pGAS[141] 00D0 //0117 - {0x0F12,0x0228}, //TVAR_ash_pGAS[142] 00F7 //0151 - {0x0F12,0x0133}, //TVAR_ash_pGAS[143] 00E3 //014A - {0x0F12,0x00F7}, //TVAR_ash_pGAS[144] 00AB //0108 - {0x0F12,0x00BF}, //TVAR_ash_pGAS[145] 0086 //00D7 - {0x0F12,0x0097}, //TVAR_ash_pGAS[146] 0081 //00B5 - {0x0F12,0x0081}, //TVAR_ash_pGAS[147] 0078 //009E - {0x0F12,0x0074}, //TVAR_ash_pGAS[148] 0071 //0090 - {0x0F12,0x006A}, //TVAR_ash_pGAS[149] 006B //0089 - {0x0F12,0x006B}, //TVAR_ash_pGAS[150] 0069 //0089 - {0x0F12,0x007B}, //TVAR_ash_pGAS[151] 006A //0090 - {0x0F12,0x008F}, //TVAR_ash_pGAS[152] 006E //00A0 - {0x0F12,0x00B1}, //TVAR_ash_pGAS[153] 0071 //00B8 - {0x0F12,0x00E4}, //TVAR_ash_pGAS[154] 007D //00E6 - {0x0F12,0x0128}, //TVAR_ash_pGAS[155] 00B0 //011F - {0x0F12,0x010B}, //TVAR_ash_pGAS[156] 0096 //010B - {0x0F12,0x00D4}, //TVAR_ash_pGAS[157] 0071 //00CE - {0x0F12,0x0098}, //TVAR_ash_pGAS[158] 0061 //00A4 - {0x0F12,0x006F}, //TVAR_ash_pGAS[159] 005B //0085 - {0x0F12,0x0056}, //TVAR_ash_pGAS[160] 0051 //0073 - {0x0F12,0x0045}, //TVAR_ash_pGAS[161] 0049 //0064 - {0x0F12,0x003D}, //TVAR_ash_pGAS[162] 0043 //005D - {0x0F12,0x0040}, //TVAR_ash_pGAS[163] 0042 //005E - {0x0F12,0x004D}, //TVAR_ash_pGAS[164] 0044 //0066 - {0x0F12,0x0060}, //TVAR_ash_pGAS[165] 004C //0076 - {0x0F12,0x0081}, //TVAR_ash_pGAS[166] 0051 //008F - {0x0F12,0x00B0}, //TVAR_ash_pGAS[167] 0056 //00B7 - {0x0F12,0x00EB}, //TVAR_ash_pGAS[168] 006F //00EB - {0x0F12,0x00EC}, //TVAR_ash_pGAS[169] 006B //00D7 - {0x0F12,0x00B0}, //TVAR_ash_pGAS[170] 005B //00A3 - {0x0F12,0x007C}, //TVAR_ash_pGAS[171] 004E //007C - {0x0F12,0x0054}, //TVAR_ash_pGAS[172] 0043 //0061 - {0x0F12,0x0039}, //TVAR_ash_pGAS[173] 0037 //004C - {0x0F12,0x0029}, //TVAR_ash_pGAS[174] 002E //003F - {0x0F12,0x001E}, //TVAR_ash_pGAS[175] 0029 //0038 - {0x0F12,0x0021}, //TVAR_ash_pGAS[176] 0028 //003A - {0x0F12,0x002D}, //TVAR_ash_pGAS[177] 002B //0044 - {0x0F12,0x0044}, //TVAR_ash_pGAS[178] 0033 //0056 - {0x0F12,0x0064}, //TVAR_ash_pGAS[179] 003D //006D - {0x0F12,0x008F}, //TVAR_ash_pGAS[180] 0046 //0091 - {0x0F12,0x00C8}, //TVAR_ash_pGAS[181] 0056 //00BD - {0x0F12,0x00D6}, //TVAR_ash_pGAS[182] 0058 //00B7 - {0x0F12,0x009B}, //TVAR_ash_pGAS[183] 004C //0086 - {0x0F12,0x0068}, //TVAR_ash_pGAS[184] 003B //0062 - {0x0F12,0x0043}, //TVAR_ash_pGAS[185] 002E //0046 - {0x0F12,0x0026}, //TVAR_ash_pGAS[186] 0022 //0031 - {0x0F12,0x0013}, //TVAR_ash_pGAS[187] 0019 //0022 - {0x0F12,0x000B}, //TVAR_ash_pGAS[188] 0014 //001C - {0x0F12,0x000E}, //TVAR_ash_pGAS[189] 0014 //001E - {0x0F12,0x001C}, //TVAR_ash_pGAS[190] 0017 //0029 - {0x0F12,0x0033}, //TVAR_ash_pGAS[191] 0020 //003B - {0x0F12,0x0054}, //TVAR_ash_pGAS[192] 002C //0055 - {0x0F12,0x0080}, //TVAR_ash_pGAS[193] 0039 //0076 - {0x0F12,0x00B9}, //TVAR_ash_pGAS[194] 004A //00A0 - {0x0F12,0x00D1}, //TVAR_ash_pGAS[195] 004F //00A1 - {0x0F12,0x0094}, //TVAR_ash_pGAS[196] 0043 //0074 - {0x0F12,0x0061}, //TVAR_ash_pGAS[197] 002F //0050 - {0x0F12,0x003B}, //TVAR_ash_pGAS[198] 0022 //0033 - {0x0F12,0x001C}, //TVAR_ash_pGAS[199] 0015 //001E - {0x0F12,0x0008}, //TVAR_ash_pGAS[200] 000C //000F - {0x0F12,0x0001}, //TVAR_ash_pGAS[201] 0007 //0009 - {0x0F12,0x0004}, //TVAR_ash_pGAS[202] 0007 //000B - {0x0F12,0x0012}, //TVAR_ash_pGAS[203] 000B //0017 - {0x0F12,0x002B}, //TVAR_ash_pGAS[204] 0016 //002A - {0x0F12,0x0050}, //TVAR_ash_pGAS[205] 0023 //0044 - {0x0F12,0x007E}, //TVAR_ash_pGAS[206] 0032 //0066 - {0x0F12,0x00B6}, //TVAR_ash_pGAS[207] 0046 //008C - {0x0F12,0x00D6}, //TVAR_ash_pGAS[208] 004C //0098 - {0x0F12,0x0098}, //TVAR_ash_pGAS[209] 003E //006D - {0x0F12,0x0067}, //TVAR_ash_pGAS[210] 002a //0049 - {0x0F12,0x003D}, //TVAR_ash_pGAS[211] 001C //002B - {0x0F12,0x001D}, //TVAR_ash_pGAS[212] 000F //0016 - {0x0F12,0x0009}, //TVAR_ash_pGAS[213] 0006 //0006 - {0x0F12,0x0000}, //TVAR_ash_pGAS[214] 0001 //0000 - {0x0F12,0x0004}, //TVAR_ash_pGAS[215] 0002 //0004 - {0x0F12,0x0014}, //TVAR_ash_pGAS[216] 0007 //0010 - {0x0F12,0x002F}, //TVAR_ash_pGAS[217] 0013 //0023 - {0x0F12,0x0057}, //TVAR_ash_pGAS[218] 0021 //003E - {0x0F12,0x0085}, //TVAR_ash_pGAS[219] 0032 //0060 - {0x0F12,0x00C1}, //TVAR_ash_pGAS[220] 0048 //0085 - {0x0F12,0x00EA}, //TVAR_ash_pGAS[221] 004D //0098 - {0x0F12,0x00AA}, //TVAR_ash_pGAS[222] 0040 //006E - {0x0F12,0x0076}, //TVAR_ash_pGAS[223] 002C //0048 - {0x0F12,0x004B}, //TVAR_ash_pGAS[224] 001E //002C - {0x0F12,0x002A}, //TVAR_ash_pGAS[225] 0011 //0018 - {0x0F12,0x0015}, //TVAR_ash_pGAS[226] 0008 //0009 - {0x0F12,0x000C}, //TVAR_ash_pGAS[227] 0004 //0003 - {0x0F12,0x0012}, //TVAR_ash_pGAS[228] 0004 //0006 - {0x0F12,0x0024}, //TVAR_ash_pGAS[229] 000A //0012 - {0x0F12,0x0041}, //TVAR_ash_pGAS[230] 0017 //0026 - {0x0F12,0x006A}, //TVAR_ash_pGAS[231] 0026 //0042 - {0x0F12,0x009C}, //TVAR_ash_pGAS[232] 0039 //0063 - {0x0F12,0x00D9}, //TVAR_ash_pGAS[233] 0051 //0089 - {0x0F12,0x010A}, //TVAR_ash_pGAS[234] 0054 //00A3 - {0x0F12,0x00C9}, //TVAR_ash_pGAS[235] 0048 //0076 - {0x0F12,0x0092}, //TVAR_ash_pGAS[236] 0034 //0051 - {0x0F12,0x0065}, //TVAR_ash_pGAS[237] 0026 //0035 - {0x0F12,0x0045}, //TVAR_ash_pGAS[238] 001A //0021 - {0x0F12,0x002E}, //TVAR_ash_pGAS[239] 0012 //0013 - {0x0F12,0x0027}, //TVAR_ash_pGAS[240] 000D //000E - {0x0F12,0x002E}, //TVAR_ash_pGAS[241] 000E //0012 - {0x0F12,0x0041}, //TVAR_ash_pGAS[242] 0014 //001E - {0x0F12,0x005F}, //TVAR_ash_pGAS[243] 0021 //0032 - {0x0F12,0x008A}, //TVAR_ash_pGAS[244] 0033 //004D - {0x0F12,0x00BF}, //TVAR_ash_pGAS[245] 0048 //006F - {0x0F12,0x00FE}, //TVAR_ash_pGAS[246] 005C //0097 - {0x0F12,0x0137}, //TVAR_ash_pGAS[247] 0063 //00B7 - {0x0F12,0x00EF}, //TVAR_ash_pGAS[248] 0057 //0089 - {0x0F12,0x00B4}, //TVAR_ash_pGAS[249] 0045 //0062 - {0x0F12,0x0089}, //TVAR_ash_pGAS[250] 0036 //0048 - {0x0F12,0x006C}, //TVAR_ash_pGAS[251] 002B //0034 - {0x0F12,0x0058}, //TVAR_ash_pGAS[252] 0022 //0028 - {0x0F12,0x0051}, //TVAR_ash_pGAS[253] 001E //0023 - {0x0F12,0x0059}, //TVAR_ash_pGAS[254] 001F //0027 - {0x0F12,0x006B}, //TVAR_ash_pGAS[255] 0026 //0033 - {0x0F12,0x008B}, //TVAR_ash_pGAS[256] 0034 //0047 - {0x0F12,0x00B7}, //TVAR_ash_pGAS[257] 0047 //0061 - {0x0F12,0x00EE}, //TVAR_ash_pGAS[258] 005D //0085 - {0x0F12,0x0135}, //TVAR_ash_pGAS[259] 0070 //00B1 - {0x0F12,0x0175}, //TVAR_ash_pGAS[260] 007C //00DE - {0x0F12,0x0123}, //TVAR_ash_pGAS[261] 006B //00AA - {0x0F12,0x00E3}, //TVAR_ash_pGAS[262] 005C //0082 - {0x0F12,0x00BB}, //TVAR_ash_pGAS[263] 004E //0067 - {0x0F12,0x00A0}, //TVAR_ash_pGAS[264] 0043 //0055 - {0x0F12,0x008E}, //TVAR_ash_pGAS[265] 003B //0049 - {0x0F12,0x008A}, //TVAR_ash_pGAS[266] 0037 //0044 - {0x0F12,0x0091}, //TVAR_ash_pGAS[267] 0039 //0048 - {0x0F12,0x00A5}, //TVAR_ash_pGAS[268] 0040 //0054 - {0x0F12,0x00C4}, //TVAR_ash_pGAS[269] 0050 //0066 - {0x0F12,0x00F1}, //TVAR_ash_pGAS[270] 0064 //0083 - {0x0F12,0x012F}, //TVAR_ash_pGAS[271] 007A //00A8 - {0x0F12,0x0183}, //TVAR_ash_pGAS[272] 008D //00E0 - {0x0F12,0x01B5}, //TVAR_ash_pGAS[273] 00AD //00FE - {0x0F12,0x0163}, //TVAR_ash_pGAS[274] 0088 //00CC - {0x0F12,0x0124}, //TVAR_ash_pGAS[275] 007B //00A2 - {0x0F12,0x00F8}, //TVAR_ash_pGAS[276] 006D //0085 - {0x0F12,0x00DA}, //TVAR_ash_pGAS[277] 0062 //0072 - {0x0F12,0x00C9}, //TVAR_ash_pGAS[278] 005B //0066 - {0x0F12,0x00C4}, //TVAR_ash_pGAS[279] 0057 //0062 - {0x0F12,0x00CE}, //TVAR_ash_pGAS[280] 005A //0065 - {0x0F12,0x00E1}, //TVAR_ash_pGAS[281] 0061 //0072 - {0x0F12,0x0103}, //TVAR_ash_pGAS[282] 0073 //0085 - {0x0F12,0x0136}, //TVAR_ash_pGAS[283] 0088 //00A2 - {0x0F12,0x017F}, //TVAR_ash_pGAS[284] 009E //00D0 - {0x0F12,0x01E0}, //TVAR_ash_pGAS[285] 00BB //0103 - {0x0F12,0x0148}, //TVAR_ash_pGAS[286] 00F3 //0153 - {0x0F12,0x0108}, //TVAR_ash_pGAS[287] 00B8 //010D - {0x0F12,0x00C8}, //TVAR_ash_pGAS[288] 008D //00D8 - {0x0F12,0x009F}, //TVAR_ash_pGAS[289] 0082 //00B3 - {0x0F12,0x0082}, //TVAR_ash_pGAS[290] 0077 //009A - {0x0F12,0x0073}, //TVAR_ash_pGAS[291] 006E //008A - {0x0F12,0x0068}, //TVAR_ash_pGAS[292] 0069 //0083 - {0x0F12,0x006C}, //TVAR_ash_pGAS[293] 006A //0087 - {0x0F12,0x007E}, //TVAR_ash_pGAS[294] 0071 //0095 - {0x0F12,0x009B}, //TVAR_ash_pGAS[295] 007B //00AC - {0x0F12,0x00C2}, //TVAR_ash_pGAS[296] 0086 //00CF - {0x0F12,0x0100}, //TVAR_ash_pGAS[297] 0098 //0106 - {0x0F12,0x014D}, //TVAR_ash_pGAS[298] 00D3 //0149 - {0x0F12,0x0121}, //TVAR_ash_pGAS[299] 00A4 //0116 - {0x0F12,0x00E6}, //TVAR_ash_pGAS[300] 007E //00D6 - {0x0F12,0x00A4}, //TVAR_ash_pGAS[301] 006A //00A8 - {0x0F12,0x0078}, //TVAR_ash_pGAS[302] 0060 //0087 - {0x0F12,0x005A}, //TVAR_ash_pGAS[303] 0053 //0071 - {0x0F12,0x0046}, //TVAR_ash_pGAS[304] 0048 //0061 - {0x0F12,0x003E}, //TVAR_ash_pGAS[305] 0044 //005B - {0x0F12,0x0043}, //TVAR_ash_pGAS[306] 0045 //005E - {0x0F12,0x0052}, //TVAR_ash_pGAS[307] 004C //006D - {0x0F12,0x006B}, //TVAR_ash_pGAS[308] 0059 //0083 - {0x0F12,0x0093}, //TVAR_ash_pGAS[309] 0066 //00A4 - {0x0F12,0x00C9}, //TVAR_ash_pGAS[310] 006F //00D5 - {0x0F12,0x010D}, //TVAR_ash_pGAS[311] 008C //0113 - {0x0F12,0x0103}, //TVAR_ash_pGAS[312] 007A //00E6 - {0x0F12,0x00C3}, //TVAR_ash_pGAS[313] 0069 //00AE - {0x0F12,0x0089}, //TVAR_ash_pGAS[314] 0058 //0084 - {0x0F12,0x005E}, //TVAR_ash_pGAS[315] 004A //0065 - {0x0F12,0x003E}, //TVAR_ash_pGAS[316] 003A //004D - {0x0F12,0x002A}, //TVAR_ash_pGAS[317] 002F //003D - {0x0F12,0x001F}, //TVAR_ash_pGAS[318] 0029 //0037 - {0x0F12,0x0023}, //TVAR_ash_pGAS[319] 002a //003B - {0x0F12,0x0032}, //TVAR_ash_pGAS[320] 0031 //004B - {0x0F12,0x004E}, //TVAR_ash_pGAS[321] 003F //0063 - {0x0F12,0x0074}, //TVAR_ash_pGAS[322] 004F //0080 - {0x0F12,0x00A5}, //TVAR_ash_pGAS[323] 005C //00AB - {0x0F12,0x00E6}, //TVAR_ash_pGAS[324] 006F //00DF - {0x0F12,0x00EF}, //TVAR_ash_pGAS[325] 0068 //00C5 - {0x0F12,0x00AD}, //TVAR_ash_pGAS[326] 005C //0092 - {0x0F12,0x0076}, //TVAR_ash_pGAS[327] 0047 //006B - {0x0F12,0x004D}, //TVAR_ash_pGAS[328] 0037 //004B - {0x0F12,0x002C}, //TVAR_ash_pGAS[329] 0027 //0034 - {0x0F12,0x0015}, //TVAR_ash_pGAS[330] 001B //0023 - {0x0F12,0x000C}, //TVAR_ash_pGAS[331] 0015 //001C - {0x0F12,0x0010}, //TVAR_ash_pGAS[332] 0016 //0020 - {0x0F12,0x001F}, //TVAR_ash_pGAS[333] 001C //002E - {0x0F12,0x003B}, //TVAR_ash_pGAS[334] 0029 //0047 - {0x0F12,0x0061}, //TVAR_ash_pGAS[335] 003A //0066 - {0x0F12,0x0092}, //TVAR_ash_pGAS[336] 004B //008C - {0x0F12,0x00D2}, //TVAR_ash_pGAS[337] 005E //00BB - {0x0F12,0x00E8}, //TVAR_ash_pGAS[338] 0060 //00B0 - {0x0F12,0x00A8}, //TVAR_ash_pGAS[339] 0053 //0081 - {0x0F12,0x0071}, //TVAR_ash_pGAS[340] 003B //005A - {0x0F12,0x0046}, //TVAR_ash_pGAS[341] 002a //0039 - {0x0F12,0x0023}, //TVAR_ash_pGAS[342] 001A //0021 - {0x0F12,0x000B}, //TVAR_ash_pGAS[343] 000D //0010 - {0x0F12,0x0002}, //TVAR_ash_pGAS[344] 0007 //0009 - {0x0F12,0x0005}, //TVAR_ash_pGAS[345] 0007 //000C - {0x0F12,0x0014}, //TVAR_ash_pGAS[346] 000D //001B - {0x0F12,0x0030}, //TVAR_ash_pGAS[347] 001A //0033 - {0x0F12,0x0058}, //TVAR_ash_pGAS[348] 002B //0050 - {0x0F12,0x008A}, //TVAR_ash_pGAS[349] 003D //0078 - {0x0F12,0x00C8}, //TVAR_ash_pGAS[350] 0053 //00A1 - {0x0F12,0x00EF}, //TVAR_ash_pGAS[351] 005C //00A8 - {0x0F12,0x00AD}, //TVAR_ash_pGAS[352] 004E //007B - {0x0F12,0x0077}, //TVAR_ash_pGAS[353] 0036 //0054 - {0x0F12,0x0048}, //TVAR_ash_pGAS[354] 0023 //0032 - {0x0F12,0x0023}, //TVAR_ash_pGAS[355] 0014 //0019 - {0x0F12,0x000B}, //TVAR_ash_pGAS[356] 0007 //0008 - {0x0F12,0x0000}, //TVAR_ash_pGAS[357] 0000 //0000 - {0x0F12,0x0003}, //TVAR_ash_pGAS[358] 0000 //0004 - {0x0F12,0x0013}, //TVAR_ash_pGAS[359] 0006 //0012 - {0x0F12,0x0030}, //TVAR_ash_pGAS[360] 0012 //0028 - {0x0F12,0x0059}, //TVAR_ash_pGAS[361] 0023 //0046 - {0x0F12,0x008A}, //TVAR_ash_pGAS[362] 0034 //006B - {0x0F12,0x00CA}, //TVAR_ash_pGAS[363] 004C //0093 - {0x0F12,0x0104}, //TVAR_ash_pGAS[364] 005E //00A9 - {0x0F12,0x00C0}, //TVAR_ash_pGAS[365] 004F //007C - {0x0F12,0x0087}, //TVAR_ash_pGAS[366] 0037 //0054 - {0x0F12,0x0057}, //TVAR_ash_pGAS[367] 0024 //0034 - {0x0F12,0x0031}, //TVAR_ash_pGAS[368] 0015 //001B - {0x0F12,0x0018}, //TVAR_ash_pGAS[369] 0008 //000A - {0x0F12,0x000C}, //TVAR_ash_pGAS[370] 0001 //0002 - {0x0F12,0x0010}, //TVAR_ash_pGAS[371] 0000 //0004 - {0x0F12,0x0020}, //TVAR_ash_pGAS[372] 0005 //0012 - {0x0F12,0x003D}, //TVAR_ash_pGAS[373] 0010 //0027 - {0x0F12,0x0067}, //TVAR_ash_pGAS[374] 0021 //0045 - {0x0F12,0x009A}, //TVAR_ash_pGAS[375] 0033 //0069 - {0x0F12,0x00D9}, //TVAR_ash_pGAS[376] 004A //0090 - {0x0F12,0x0126}, //TVAR_ash_pGAS[377] 0064 //00B4 - {0x0F12,0x00E1}, //TVAR_ash_pGAS[378] 0056 //0086 - {0x0F12,0x00A3}, //TVAR_ash_pGAS[379] 003F //005C - {0x0F12,0x0071}, //TVAR_ash_pGAS[380] 002C //003C - {0x0F12,0x004C}, //TVAR_ash_pGAS[381] 001D //0024 - {0x0F12,0x0031}, //TVAR_ash_pGAS[382] 0011 //0014 - {0x0F12,0x0025}, //TVAR_ash_pGAS[383] 0008 //000D - {0x0F12,0x0029}, //TVAR_ash_pGAS[384] 0006 //000F - {0x0F12,0x003A}, //TVAR_ash_pGAS[385] 000B //001B - {0x0F12,0x0057}, //TVAR_ash_pGAS[386] 0015 //002F - {0x0F12,0x0081}, //TVAR_ash_pGAS[387] 0025 //004B - {0x0F12,0x00B4}, //TVAR_ash_pGAS[388] 0038 //006E - {0x0F12,0x00F4}, //TVAR_ash_pGAS[389] 004B //0097 - {0x0F12,0x0154}, //TVAR_ash_pGAS[390] 0072 //00CA - {0x0F12,0x0107}, //TVAR_ash_pGAS[391] 0064 //0098 - {0x0F12,0x00C6}, //TVAR_ash_pGAS[392] 004E //006E - {0x0F12,0x0095}, //TVAR_ash_pGAS[393] 003B //0050 - {0x0F12,0x0074}, //TVAR_ash_pGAS[394] 002C //0037 - {0x0F12,0x005A}, //TVAR_ash_pGAS[395] 001F //0027 - {0x0F12,0x004F}, //TVAR_ash_pGAS[396] 0018 //0020 - {0x0F12,0x0053}, //TVAR_ash_pGAS[397] 0015 //0022 - {0x0F12,0x0062}, //TVAR_ash_pGAS[398] 0018 //002D - {0x0F12,0x007F}, //TVAR_ash_pGAS[399] 0022 //0042 - {0x0F12,0x00A8}, //TVAR_ash_pGAS[400] 0032 //005B - {0x0F12,0x00DC}, //TVAR_ash_pGAS[401] 0044 //0080 - {0x0F12,0x0120}, //TVAR_ash_pGAS[402] 0054 //00AA - {0x0F12,0x0193}, //TVAR_ash_pGAS[403] 0089 //00F0 - {0x0F12,0x013B}, //TVAR_ash_pGAS[404] 0077 //00BA - {0x0F12,0x00F6}, //TVAR_ash_pGAS[405] 0065 //008E - {0x0F12,0x00C9}, //TVAR_ash_pGAS[406] 0052 //006F - {0x0F12,0x00A8}, //TVAR_ash_pGAS[407] 0043 //0058 - {0x0F12,0x0090}, //TVAR_ash_pGAS[408] 0037 //0048 - {0x0F12,0x0086}, //TVAR_ash_pGAS[409] 002F //0041 - {0x0F12,0x008A}, //TVAR_ash_pGAS[410] 002C //0042 - {0x0F12,0x0099}, //TVAR_ash_pGAS[411] 002F //004C - {0x0F12,0x00B5}, //TVAR_ash_pGAS[412] 0038 //005F - {0x0F12,0x00DD}, //TVAR_ash_pGAS[413] 0048 //007A - {0x0F12,0x0117}, //TVAR_ash_pGAS[414] 0058 //009D - {0x0F12,0x0166}, //TVAR_ash_pGAS[415] 0068 //00D2 - {0x0F12,0x01D6}, //TVAR_ash_pGAS[416] 00BC //0112 - {0x0F12,0x017D}, //TVAR_ash_pGAS[417] 0092 //00DD - {0x0F12,0x0138}, //TVAR_ash_pGAS[418] 0082 //00AF - {0x0F12,0x0108}, //TVAR_ash_pGAS[419] 006F //008F - {0x0F12,0x00E3}, //TVAR_ash_pGAS[420] 0061 //0077 - {0x0F12,0x00CD}, //TVAR_ash_pGAS[421] 0055 //0066 - {0x0F12,0x00C2}, //TVAR_ash_pGAS[422] 004E //005F - {0x0F12,0x00C7}, //TVAR_ash_pGAS[423] 004A //005F - {0x0F12,0x00D4}, //TVAR_ash_pGAS[424] 004C //006A - {0x0F12,0x00F1}, //TVAR_ash_pGAS[425] 0056 //007C - {0x0F12,0x011F}, //TVAR_ash_pGAS[426] 0066 //0097 - {0x0F12,0x015F}, //TVAR_ash_pGAS[427] 0073 //00C2 - {0x0F12,0x01B7}, //TVAR_ash_pGAS[428] 008B //00F2 - {0x0F12,0x00D1}, //TVAR_ash_pGAS[429] 0087 //00EE - {0x0F12,0x00A9}, //TVAR_ash_pGAS[430] 0069 //00C2 - {0x0F12,0x0080}, //TVAR_ash_pGAS[431] 0053 //009B - {0x0F12,0x0064}, //TVAR_ash_pGAS[432] 0052 //0085 - {0x0F12,0x0055}, //TVAR_ash_pGAS[433] 0050 //0074 - {0x0F12,0x004E}, //TVAR_ash_pGAS[434] 0050 //006A - {0x0F12,0x0047}, //TVAR_ash_pGAS[435] 004F //0067 - {0x0F12,0x004B}, //TVAR_ash_pGAS[436] 0052 //006B - {0x0F12,0x005E}, //TVAR_ash_pGAS[437] 0057 //0076 - {0x0F12,0x0077}, //TVAR_ash_pGAS[438] 005D //0089 - {0x0F12,0x0094}, //TVAR_ash_pGAS[439] 0060 //00A3 - {0x0F12,0x00BF}, //TVAR_ash_pGAS[440] 0068 //00CE - {0x0F12,0x00F1}, //TVAR_ash_pGAS[441] 0090 //0102 - {0x0F12,0x00BB}, //TVAR_ash_pGAS[442] 0050 //00C2 - {0x0F12,0x0095}, //TVAR_ash_pGAS[443] 003F //0097 - {0x0F12,0x0067}, //TVAR_ash_pGAS[444] 003A //0076 - {0x0F12,0x0049}, //TVAR_ash_pGAS[445] 003A //0062 - {0x0F12,0x0036}, //TVAR_ash_pGAS[446] 0035 //0054 - {0x0F12,0x002C}, //TVAR_ash_pGAS[447] 0033 //004B - {0x0F12,0x0027}, //TVAR_ash_pGAS[448] 0033 //0047 - {0x0F12,0x002E}, //TVAR_ash_pGAS[449] 0036 //004C - {0x0F12,0x003C}, //TVAR_ash_pGAS[450] 003B //0057 - {0x0F12,0x004F}, //TVAR_ash_pGAS[451] 0043 //006A - {0x0F12,0x006F}, //TVAR_ash_pGAS[452] 0048 //0084 - {0x0F12,0x0097}, //TVAR_ash_pGAS[453] 004A //00AE - {0x0F12,0x00C7}, //TVAR_ash_pGAS[454] 005D //00DF - {0x0F12,0x00A5}, //TVAR_ash_pGAS[455] 002D //009A - {0x0F12,0x0079}, //TVAR_ash_pGAS[456] 002D //0075 - {0x0F12,0x0052}, //TVAR_ash_pGAS[457] 002B //0058 - {0x0F12,0x0036}, //TVAR_ash_pGAS[458] 0029 //0045 - {0x0F12,0x0023}, //TVAR_ash_pGAS[459] 0023 //0039 - {0x0F12,0x0017}, //TVAR_ash_pGAS[460] 0020 //002F - {0x0F12,0x0012}, //TVAR_ash_pGAS[461] 001F //002C - {0x0F12,0x0017}, //TVAR_ash_pGAS[462] 0023 //0030 - {0x0F12,0x0024}, //TVAR_ash_pGAS[463] 0027 //003D - {0x0F12,0x0039}, //TVAR_ash_pGAS[464] 002F //0050 - {0x0F12,0x0055}, //TVAR_ash_pGAS[465] 0036 //0067 - {0x0F12,0x007A}, //TVAR_ash_pGAS[466] 003A //008B - {0x0F12,0x00A8}, //TVAR_ash_pGAS[467] 0043 //00B4 - {0x0F12,0x0097}, //TVAR_ash_pGAS[468] 001F //0080 - {0x0F12,0x0069}, //TVAR_ash_pGAS[469] 0023 //005E - {0x0F12,0x0045}, //TVAR_ash_pGAS[470] 001D //0044 - {0x0F12,0x002B}, //TVAR_ash_pGAS[471] 001A //0032 - {0x0F12,0x0018}, //TVAR_ash_pGAS[472] 0015 //0024 - {0x0F12,0x000B}, //TVAR_ash_pGAS[473] 0012 //001A - {0x0F12,0x0006}, //TVAR_ash_pGAS[474] 0010 //0017 - {0x0F12,0x000A}, //TVAR_ash_pGAS[475] 0013 //001B - {0x0F12,0x0017}, //TVAR_ash_pGAS[476] 0017 //0027 - {0x0F12,0x002B}, //TVAR_ash_pGAS[477] 001E //0039 - {0x0F12,0x0047}, //TVAR_ash_pGAS[478] 0025 //004F - {0x0F12,0x006B}, //TVAR_ash_pGAS[479] 002B //006E - {0x0F12,0x0097}, //TVAR_ash_pGAS[480] 0034 //0092 - {0x0F12,0x0092}, //TVAR_ash_pGAS[481] 0017 //006E - {0x0F12,0x0065}, //TVAR_ash_pGAS[482] 001B //004F - {0x0F12,0x0042}, //TVAR_ash_pGAS[483] 0015 //0037 - {0x0F12,0x0028}, //TVAR_ash_pGAS[484] 0011 //0023 - {0x0F12,0x0013}, //TVAR_ash_pGAS[485] 000B //0016 - {0x0F12,0x0005}, //TVAR_ash_pGAS[486] 0008 //000C - {0x0F12,0x0000}, //TVAR_ash_pGAS[487] 0006 //0008 - {0x0F12,0x0004}, //TVAR_ash_pGAS[488] 0008 //000C - {0x0F12,0x000F}, //TVAR_ash_pGAS[489] 000B //0017 - {0x0F12,0x0025}, //TVAR_ash_pGAS[490] 0012 //0028 - {0x0F12,0x0040}, //TVAR_ash_pGAS[491] 0018 //003D - {0x0F12,0x0064}, //TVAR_ash_pGAS[492] 001E //005B - {0x0F12,0x008F}, //TVAR_ash_pGAS[493] 0028 //007A - {0x0F12,0x0098}, //TVAR_ash_pGAS[494] 0014 //0068 - {0x0F12,0x006A}, //TVAR_ash_pGAS[495] 0016 //004A - {0x0F12,0x004A}, //TVAR_ash_pGAS[496] 0011 //0032 - {0x0F12,0x002E}, //TVAR_ash_pGAS[497] 000C //001D - {0x0F12,0x0016}, //TVAR_ash_pGAS[498] 0007 //0011 - {0x0F12,0x0007}, //TVAR_ash_pGAS[499] 0002 //0005 - {0x0F12,0x0000}, //TVAR_ash_pGAS[500] 0000 //0000 - {0x0F12,0x0004}, //TVAR_ash_pGAS[501] 0001 //0005 - {0x0F12,0x0011}, //TVAR_ash_pGAS[502] 0005 //000F - {0x0F12,0x0026}, //TVAR_ash_pGAS[503] 000A //001E - {0x0F12,0x0042}, //TVAR_ash_pGAS[504] 000F //0033 - {0x0F12,0x0064}, //TVAR_ash_pGAS[505] 0014 //004E - {0x0F12,0x008F}, //TVAR_ash_pGAS[506] 001E //006C - {0x0F12,0x00A9}, //TVAR_ash_pGAS[507] 0015 //006C - {0x0F12,0x007B}, //TVAR_ash_pGAS[508] 0016 //004C - {0x0F12,0x0057}, //TVAR_ash_pGAS[509] 0011 //0033 - {0x0F12,0x0039}, //TVAR_ash_pGAS[510] 000D //0020 - {0x0F12,0x0021}, //TVAR_ash_pGAS[511] 0007 //0013 - {0x0F12,0x0012}, //TVAR_ash_pGAS[512] 0003 //0008 - {0x0F12,0x000C}, //TVAR_ash_pGAS[513] 0000 //0003 - {0x0F12,0x0010}, //TVAR_ash_pGAS[514] 0000 //0006 - {0x0F12,0x001D}, //TVAR_ash_pGAS[515] 0002 //000E - {0x0F12,0x0031}, //TVAR_ash_pGAS[516] 0007 //001C - {0x0F12,0x004E}, //TVAR_ash_pGAS[517] 000C //0032 - {0x0F12,0x0071}, //TVAR_ash_pGAS[518] 0010 //004B - {0x0F12,0x009C}, //TVAR_ash_pGAS[519] 0019 //0067 - {0x0F12,0x00C6}, //TVAR_ash_pGAS[520] 0019 //0076 - {0x0F12,0x0097}, //TVAR_ash_pGAS[521] 001C //0055 - {0x0F12,0x006E}, //TVAR_ash_pGAS[522] 0016 //003A - {0x0F12,0x004E}, //TVAR_ash_pGAS[523] 0012 //0028 - {0x0F12,0x0038}, //TVAR_ash_pGAS[524] 000D //001A - {0x0F12,0x0028}, //TVAR_ash_pGAS[525] 0009 //0010 - {0x0F12,0x0022}, //TVAR_ash_pGAS[526] 0005 //000C - {0x0F12,0x0027}, //TVAR_ash_pGAS[527] 0003 //000E - {0x0F12,0x0034}, //TVAR_ash_pGAS[528] 0005 //0016 - {0x0F12,0x0047}, //TVAR_ash_pGAS[529] 0009 //0022 - {0x0F12,0x0064}, //TVAR_ash_pGAS[530] 000D //0035 - {0x0F12,0x0088}, //TVAR_ash_pGAS[531] 0011 //004F - {0x0F12,0x00B3}, //TVAR_ash_pGAS[532] 0017 //006C - {0x0F12,0x00EB}, //TVAR_ash_pGAS[533] 0024 //0089 - {0x0F12,0x00B3}, //TVAR_ash_pGAS[534] 0026 //0066 - {0x0F12,0x008A}, //TVAR_ash_pGAS[535] 0021 //0049 - {0x0F12,0x006C}, //TVAR_ash_pGAS[536] 001D //0037 - {0x0F12,0x005A}, //TVAR_ash_pGAS[537] 0018 //002A - {0x0F12,0x004B}, //TVAR_ash_pGAS[538] 0014 //0020 - {0x0F12,0x0047}, //TVAR_ash_pGAS[539] 000F //001C - {0x0F12,0x004C}, //TVAR_ash_pGAS[540] 000D //001E - {0x0F12,0x0057}, //TVAR_ash_pGAS[541] 000E //0024 - {0x0F12,0x006A}, //TVAR_ash_pGAS[542] 0012 //0030 - {0x0F12,0x0086}, //TVAR_ash_pGAS[543] 0016 //0042 - {0x0F12,0x00A9}, //TVAR_ash_pGAS[544] 0019 //005D - {0x0F12,0x00D9}, //TVAR_ash_pGAS[545] 001B //007D - {0x0F12,0x011D}, //TVAR_ash_pGAS[546] 0036 //00A9 - {0x0F12,0x00DE}, //TVAR_ash_pGAS[547] 0035 //0084 - {0x0F12,0x00B2}, //TVAR_ash_pGAS[548] 0032 //0066 - {0x0F12,0x0097}, //TVAR_ash_pGAS[549] 002E //0052 - {0x0F12,0x0087}, //TVAR_ash_pGAS[550] 002a //0045 - {0x0F12,0x007A}, //TVAR_ash_pGAS[551] 0026 //003B - {0x0F12,0x0077}, //TVAR_ash_pGAS[552] 0021 //0036 - {0x0F12,0x007A}, //TVAR_ash_pGAS[553] 001F //0038 - {0x0F12,0x0086}, //TVAR_ash_pGAS[554] 001F //003E - {0x0F12,0x0098}, //TVAR_ash_pGAS[555] 0024 //004A - {0x0F12,0x00B3}, //TVAR_ash_pGAS[556] 0027 //005E - {0x0F12,0x00DA}, //TVAR_ash_pGAS[557] 002a //0077 - {0x0F12,0x0112}, //TVAR_ash_pGAS[558] 0028 //009E - {0x0F12,0x0149}, //TVAR_ash_pGAS[559] 005C //00BC - {0x0F12,0x0114}, //TVAR_ash_pGAS[560] 004A //009C - {0x0F12,0x00EB}, //TVAR_ash_pGAS[561] 0049 //007D - {0x0F12,0x00CE}, //TVAR_ash_pGAS[562] 0046 //0069 - {0x0F12,0x00B9}, //TVAR_ash_pGAS[563] 0041 //005A - {0x0F12,0x00AD}, //TVAR_ash_pGAS[564] 003E //0052 - {0x0F12,0x00A8}, //TVAR_ash_pGAS[565] 003A //004C - {0x0F12,0x00AF}, //TVAR_ash_pGAS[566] 0037 //004D - {0x0F12,0x00B8}, //TVAR_ash_pGAS[567] 0037 //0054 - {0x0F12,0x00CB}, //TVAR_ash_pGAS[568] 003B //0060 - {0x0F12,0x00EC}, //TVAR_ash_pGAS[569] 003F //0072 - {0x0F12,0x0119}, //TVAR_ash_pGAS[570] 0040 //0093 - {0x0F12,0x0153}, //TVAR_ash_pGAS[571] 0041 //00B6 - // param_end TVAR_ash_pGAS - {0x002A,0x0F12}, - {0x0F12,0x02BC}, - {0x0F12,0x0347}, - // param_start TVAR_ash_AwbAshCord - {0x002A,0x0704}, - {0x0F12,0x00BF}, - {0x0F12,0x00E6}, - {0x0F12,0x00F2}, - {0x0F12,0x0143}, - {0x0F12,0x0178}, - {0x0F12,0x01A3}, - {0x0F12,0x01B5}, - // param_end TVAR_ash_AwbAshCord - - {0x002A,0x0754}, //#TVAR_ash_pGAS - {0x0F12,0x247C}, - {0x0F12,0x7000}, - - // - // param_start awbb_IndoorGrZones_m_BGrid - {0x002A,0x0C50}, - {0x0F12,0x03AE}, //03BE //awbb_IndoorGrZones_m_BGrid[0] 03C6 - {0x0F12,0x03DB}, //03EB //awbb_IndoorGrZones_m_BGrid[1] 03F3 - {0x0F12,0x0399}, //03A9 //awbb_IndoorGrZones_m_BGrid[2] 03B1 - {0x0F12,0x03DB}, //03EB //awbb_IndoorGrZones_m_BGrid[3] 03F3 - {0x0F12,0x0382}, //0392 //awbb_IndoorGrZones_m_BGrid[4] 039A - {0x0F12,0x03DB}, //03EB //awbb_IndoorGrZones_m_BGrid[5] 03F3 - {0x0F12,0x036B}, //037B //awbb_IndoorGrZones_m_BGrid[6] 0383 - {0x0F12,0x03CE}, //03DE //awbb_IndoorGrZones_m_BGrid[7] 03E6 - {0x0F12,0x034E}, //035E //awbb_IndoorGrZones_m_BGrid[8] 0366 - {0x0F12,0x03BD}, //03CD //awbb_IndoorGrZones_m_BGrid[9] 03D5 - {0x0F12,0x0330}, //0340 //awbb_IndoorGrZones_m_BGrid[10] 0348 - {0x0F12,0x03A8}, //03B8 //awbb_IndoorGrZones_m_BGrid[11] 03C0 - {0x0F12,0x0316}, //0326 //awbb_IndoorGrZones_m_BGrid[12] 032E - {0x0F12,0x0391}, //03A1 //awbb_IndoorGrZones_m_BGrid[13] 03A9 - {0x0F12,0x02FA}, //030A //awbb_IndoorGrZones_m_BGrid[14] 0312 - {0x0F12,0x0376}, //0386 //awbb_IndoorGrZones_m_BGrid[15] 038E - {0x0F12,0x02E0}, //02F0 //awbb_IndoorGrZones_m_BGrid[16] 02F8 - {0x0F12,0x035D}, //036D //awbb_IndoorGrZones_m_BGrid[17] 0375 - {0x0F12,0x02CC}, //02DC //awbb_IndoorGrZones_m_BGrid[18] 02E4 - {0x0F12,0x0344}, //0354 //awbb_IndoorGrZones_m_BGrid[19] 035C - {0x0F12,0x02B7}, //02C7 //awbb_IndoorGrZones_m_BGrid[20] 02CF - {0x0F12,0x032F}, //033F //awbb_IndoorGrZones_m_BGrid[21] 0347 - {0x0F12,0x02A7}, //02B7 //awbb_IndoorGrZones_m_BGrid[22] 02BF - {0x0F12,0x0318}, //0328 //awbb_IndoorGrZones_m_BGrid[23] 0330 - {0x0F12,0x0296}, //02A6 //awbb_IndoorGrZones_m_BGrid[24] 02AE - {0x0F12,0x0301}, //0311 //awbb_IndoorGrZones_m_BGrid[25] 0319 - {0x0F12,0x0286}, //0296 //awbb_IndoorGrZones_m_BGrid[26] 029E - {0x0F12,0x02ED}, //02FD //awbb_IndoorGrZones_m_BGrid[27] 0305 - {0x0F12,0x0279}, //0289 //awbb_IndoorGrZones_m_BGrid[28] 0291 - {0x0F12,0x02DB}, //02EB //awbb_IndoorGrZones_m_BGrid[29] 02F3 - {0x0F12,0x026C}, //027C //awbb_IndoorGrZones_m_BGrid[30] 0284 - {0x0F12,0x02CD}, //02DD //awbb_IndoorGrZones_m_BGrid[31] 02E5 - {0x0F12,0x025E}, //026E //awbb_IndoorGrZones_m_BGrid[32] 0276 - {0x0F12,0x02BF}, //02CF //awbb_IndoorGrZones_m_BGrid[33] 02D7 - {0x0F12,0x0252}, //0262 //awbb_IndoorGrZones_m_BGrid[34] 026A - {0x0F12,0x02B2}, //02C2 //awbb_IndoorGrZones_m_BGrid[35] 02CA - {0x0F12,0x0249}, //0259 //awbb_IndoorGrZones_m_BGrid[36] 0261 - {0x0F12,0x02A7}, //02B7 //awbb_IndoorGrZones_m_BGrid[37] 02BF - {0x0F12,0x023B}, //024B //awbb_IndoorGrZones_m_BGrid[38] 0253 - {0x0F12,0x029B}, //02AB //awbb_IndoorGrZones_m_BGrid[39] 02B3 - {0x0F12,0x0231}, //0241 //awbb_IndoorGrZones_m_BGrid[40] 0249 - {0x0F12,0x028D}, //029D //awbb_IndoorGrZones_m_BGrid[41] 02A5 - {0x0F12,0x0227}, //0237 //awbb_IndoorGrZones_m_BGrid[42] 023F - {0x0F12,0x0281}, //0291 //awbb_IndoorGrZones_m_BGrid[43] 0299 - {0x0F12,0x021D}, //022D //awbb_IndoorGrZones_m_BGrid[44] 0235 - {0x0F12,0x0277}, //0287 //awbb_IndoorGrZones_m_BGrid[45] 028F - {0x0F12,0x0216}, //0226 //awbb_IndoorGrZones_m_BGrid[46] 022E - {0x0F12,0x026E}, //027E //awbb_IndoorGrZones_m_BGrid[47] 0286 - {0x0F12,0x020C}, //021C //awbb_IndoorGrZones_m_BGrid[48] 0224 - {0x0F12,0x0263}, //0273 //awbb_IndoorGrZones_m_BGrid[49] 027B - {0x0F12,0x0204}, //0214 //awbb_IndoorGrZones_m_BGrid[50] 021C - {0x0F12,0x0257}, //0267 //awbb_IndoorGrZones_m_BGrid[51] 026F - {0x0F12,0x01F7}, //0207 //awbb_IndoorGrZones_m_BGrid[52] 020F - {0x0F12,0x024A}, //025A //awbb_IndoorGrZones_m_BGrid[53] 0262 - {0x0F12,0x01E4}, //01F4 //awbb_IndoorGrZones_m_BGrid[54] 01FC - {0x0F12,0x023D}, //024D //awbb_IndoorGrZones_m_BGrid[55] 0255 - {0x0F12,0x01CC}, //01DC //awbb_IndoorGrZones_m_BGrid[56] 01F3 - {0x0F12,0x022A}, //023A //awbb_IndoorGrZones_m_BGrid[57] 0242 - {0x0F12,0x01E5}, //01F5 //awbb_IndoorGrZones_m_BGrid[58] 01FD - {0x0F12,0x020E}, //021E //awbb_IndoorGrZones_m_BGrid[59] 0226 - {0x0F12,0x0000}, //0000 //awbb_IndoorGrZones_m_BGrid[60] 0000 - {0x0F12,0x0000}, //0000 //awbb_IndoorGrZones_m_BGrid[61] 0000 - {0x0F12,0x0000}, //0000 //awbb_IndoorGrZones_m_BGrid[62] 0000 - {0x0F12,0x0000}, //0000 //awbb_IndoorGrZones_m_BGrid[63] 0000 - {0x0F12,0x0000}, //0000 //awbb_IndoorGrZones_m_BGrid[64] 0000 - {0x0F12,0x0000}, //0000 //awbb_IndoorGrZones_m_BGrid[65] 0000 - {0x0F12,0x0000}, //0000 //awbb_IndoorGrZones_m_BGrid[66] 0000 - {0x0F12,0x0000}, //0000 //awbb_IndoorGrZones_m_BGrid[67] 0000 - {0x0F12,0x0000}, //0000 //awbb_IndoorGrZones_m_BGrid[68] 0000 - {0x0F12,0x0000}, //0000 //awbb_IndoorGrZones_m_BGrid[69] 0000 - {0x0F12,0x0000}, //0000 //awbb_IndoorGrZones_m_BGrid[70] 0000 - {0x0F12,0x0000}, //0000 //awbb_IndoorGrZones_m_BGrid[71] 0000 - {0x0F12,0x0000}, //0000 //awbb_IndoorGrZones_m_BGrid[72] 0000 - {0x0F12,0x0000}, //0000 //awbb_IndoorGrZones_m_BGrid[73] 0000 - {0x0F12,0x0000}, //0000 //awbb_IndoorGrZones_m_BGrid[74] 0000 - {0x0F12,0x0000}, //0000 //awbb_IndoorGrZones_m_BGrid[75] 0000 - {0x0F12,0x0000}, //0000 //awbb_IndoorGrZones_m_BGrid[76] 0000 - {0x0F12,0x0000}, //0000 //awbb_IndoorGrZones_m_BGrid[77] 0000 - {0x0F12,0x0000}, //0000 //awbb_IndoorGrZones_m_BGrid[78] 0000 - {0x0F12,0x0000}, //0000 //awbb_IndoorGrZones_m_BGrid[79] 0000 - // param_end awbb_IndoorGrZones_m_BGrid 0cf0 //#awbb_IndoorGrZones_m_GridStep - {0x002a,0x0cf0}, - {0x0F12,0x0004}, - {0x0F12,0x0000}, - {0x002A,0x0cf8}, //#awbb_IndoorGrZones_m_Boffs - {0x0F12,0x00f7}, //EC - {0x0F12,0x0000}, - // param_start awbb_LowBrGrZones_m_BGrid - {0x002A,0x0D84}, - {0x0F12,0x0406}, //0406 //awbb_LowBrGrZones_m_BGrid[0] 0406 - {0x0F12,0x0467}, //0467 //awbb_LowBrGrZones_m_BGrid[1] 0467 - {0x0F12,0x0371}, //0371 //awbb_LowBrGrZones_m_BGrid[2] 0371 - {0x0F12,0x04B0}, //04B0 //awbb_LowBrGrZones_m_BGrid[3] 04B0 - {0x0F12,0x02E5}, //02E5 //awbb_LowBrGrZones_m_BGrid[4] 02E5 - {0x0F12,0x0481}, //0481 //awbb_LowBrGrZones_m_BGrid[5] 0481 - {0x0F12,0x0298}, //0298 //awbb_LowBrGrZones_m_BGrid[6] 0298 - {0x0F12,0x042E}, //042E //awbb_LowBrGrZones_m_BGrid[7] 042E - {0x0F12,0x0260}, //0260 //awbb_LowBrGrZones_m_BGrid[8] 0260 - {0x0F12,0x03DE}, //03DE //awbb_LowBrGrZones_m_BGrid[9] 03DE - {0x0F12,0x022F}, //022F //awbb_LowBrGrZones_m_BGrid[10]022F - {0x0F12,0x0391}, //0391 //awbb_LowBrGrZones_m_BGrid[11]0391 - {0x0F12,0x0201}, //0201 //awbb_LowBrGrZones_m_BGrid[12]0201 - {0x0F12,0x034D}, //034D //awbb_LowBrGrZones_m_BGrid[13]034D - {0x0F12,0x01DA}, //01DA //awbb_LowBrGrZones_m_BGrid[14]01DA - {0x0F12,0x0310}, //0310 //awbb_LowBrGrZones_m_BGrid[15]0310 - {0x0F12,0x01B3}, //01B3 //awbb_LowBrGrZones_m_BGrid[16]01B3 - {0x0F12,0x02D4}, //02D4 //awbb_LowBrGrZones_m_BGrid[17]02D4 - {0x0F12,0x018F}, //018F //awbb_LowBrGrZones_m_BGrid[18]018F - {0x0F12,0x0297}, //0297 //awbb_LowBrGrZones_m_BGrid[19]0297 - {0x0F12,0x0181}, //0181 //awbb_LowBrGrZones_m_BGrid[20]0181 - {0x0F12,0x0271}, //0271 //awbb_LowBrGrZones_m_BGrid[21]0271 - {0x0F12,0x0181}, //0181 //awbb_LowBrGrZones_m_BGrid[22]0181 - {0x0F12,0x022A}, //022A //awbb_LowBrGrZones_m_BGrid[23]022A - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[24]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[25]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[26]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[27]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[28]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[29]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[30]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[31]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[32]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[33]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[34]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[35]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[36]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[37]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[38]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[39]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[40]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[41]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[42]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[43]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[44]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[45]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[46]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[47]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[48]0000 - {0x0F12,0x0000}, //0000 //awbb_LowBrGrZones_m_BGrid[49]0000 - // param_end awbb_LowBrGrZones_m_BGrid - {0x002A,0x0de8}, //#awbb_LowBrGrZones_m_GridStep - {0x0F12,0x0006}, - {0x0F12,0x0000}, - {0x002A,0x0df0}, //#awbb_LowBrGrZones_m_Boffs - {0x0F12,0x0081}, - {0x0F12,0x0000}, - // param_start awbb_OutdoorGrZones_m_BGrid - {0x002A,0x0D08}, - {0x0F12,0x0257}, //02C5 //0349 //035E //awbb_OutdoorGrZones_m_BGrid[0] 036B - {0x0F12,0x0287}, //032D //0363 //0378 //awbb_OutdoorGrZones_m_BGrid[1] 0385 - {0x0F12,0x0245}, //02B2 //032C //0341 //awbb_OutdoorGrZones_m_BGrid[2] 034E - {0x0F12,0x0287}, //0315 //036E //0383 //awbb_OutdoorGrZones_m_BGrid[3] 0390 - {0x0F12,0x0237}, //02A0 //030F //0324 //awbb_OutdoorGrZones_m_BGrid[4] 0331 - {0x0F12,0x027D}, //02FE //036E //0383 //awbb_OutdoorGrZones_m_BGrid[5] 0390 - {0x0F12,0x022A}, //0290 //02F3 //0308 //awbb_OutdoorGrZones_m_BGrid[6] 0315 - {0x0F12,0x0270}, //02E9 //035C //0371 //awbb_OutdoorGrZones_m_BGrid[7] 037E - {0x0F12,0x0220}, //0280 //02D8 //02ED //awbb_OutdoorGrZones_m_BGrid[8] 02FA - {0x0F12,0x0263}, //02D7 //0343 //0358 //awbb_OutdoorGrZones_m_BGrid[9] 0365 - {0x0F12,0x0217}, //0274 //02C5 //02DA //awbb_OutdoorGrZones_m_BGrid[10]02E7 - {0x0F12,0x0256}, //02C7 //032D //0342 //awbb_OutdoorGrZones_m_BGrid[11]034F - {0x0F12,0x020F}, //0266 //02B2 //02C7 //awbb_OutdoorGrZones_m_BGrid[12]02D4 - {0x0F12,0x024A}, //02B9 //0315 //032A //awbb_OutdoorGrZones_m_BGrid[13]0337 - {0x0F12,0x020F}, //0259 //02A0 //02B5 //awbb_OutdoorGrZones_m_BGrid[14]02C2 - {0x0F12,0x023E}, //02AF //02FE //0313 //awbb_OutdoorGrZones_m_BGrid[15]0320 - {0x0F12,0x0000}, //024F //0290 //02A5 //awbb_OutdoorGrZones_m_BGrid[16]02B2 - {0x0F12,0x0000}, //02A3 //02E9 //02FB //awbb_OutdoorGrZones_m_BGrid[17]0308 - {0x0F12,0x0000}, //0241 //0280 //0295 //awbb_OutdoorGrZones_m_BGrid[18]02A2 - {0x0F12,0x0000}, //0297 //02D7 //02EB //awbb_OutdoorGrZones_m_BGrid[19]02F8 - {0x0F12,0x0000}, //0235 //0274 //0289 //awbb_OutdoorGrZones_m_BGrid[20]0296 - {0x0F12,0x0000}, //0287 //02C7 //02DB //awbb_OutdoorGrZones_m_BGrid[21]02E8 - {0x0F12,0x0000}, //022C //0266 //027B //awbb_OutdoorGrZones_m_BGrid[22]0288 - {0x0F12,0x0000}, //027C //02B9 //02CC //awbb_OutdoorGrZones_m_BGrid[23]02D9 - {0x0F12,0x0000}, //0222 //0259 //026E //awbb_OutdoorGrZones_m_BGrid[24]027B - {0x0F12,0x0000}, //0271 //02AF //02C0 //awbb_OutdoorGrZones_m_BGrid[25]02CD - {0x0F12,0x0000}, //021A //024F //0260 //awbb_OutdoorGrZones_m_BGrid[26]026D - {0x0F12,0x0000}, //026A //02A3 //02B3 //awbb_OutdoorGrZones_m_BGrid[27]02C0 - {0x0F12,0x0000}, //0213 //0241 //0256 //awbb_OutdoorGrZones_m_BGrid[28]0263 - {0x0F12,0x0000}, //0261 //0297 //02A7 //awbb_OutdoorGrZones_m_BGrid[29]02B4 - {0x0F12,0x0000}, //0209 //0235 //024A //awbb_OutdoorGrZones_m_BGrid[30]0257 - {0x0F12,0x0000}, //0254 //0287 //029C //awbb_OutdoorGrZones_m_BGrid[31]02A9 - {0x0F12,0x0000}, //01FE //022C //023F //awbb_OutdoorGrZones_m_BGrid[32]024C - {0x0F12,0x0000}, //0248 //027C //028D //awbb_OutdoorGrZones_m_BGrid[33]029A - {0x0F12,0x0000}, //01F0 //0222 //0234 //awbb_OutdoorGrZones_m_BGrid[34]0241 - {0x0F12,0x0000}, //023A //0271 //0283 //awbb_OutdoorGrZones_m_BGrid[35]0290 - {0x0F12,0x0000}, //01D4 //021A //022C //awbb_OutdoorGrZones_m_BGrid[36]0239 - {0x0F12,0x0000}, //0228 //026A //0279 //awbb_OutdoorGrZones_m_BGrid[37]0286 - {0x0F12,0x0000}, //01EB //0213 //0225 //awbb_OutdoorGrZones_m_BGrid[38]0232 - {0x0F12,0x0000}, //0209 //0261 //0271 //awbb_OutdoorGrZones_m_BGrid[39]027E - {0x0F12,0x0000}, //0000 //0209 //021A //awbb_OutdoorGrZones_m_BGrid[40]0227 - {0x0F12,0x0000}, //0000 //0254 //0266 //awbb_OutdoorGrZones_m_BGrid[41]0273 - {0x0F12,0x0000}, //0000 //01FE //0210 //awbb_OutdoorGrZones_m_BGrid[42]021D - {0x0F12,0x0000}, //0000 //0248 //0259 //awbb_OutdoorGrZones_m_BGrid[43]0266 - {0x0F12,0x0000}, //0000 //01F0 //0205 //awbb_OutdoorGrZones_m_BGrid[44]0212 - {0x0F12,0x0000}, //0000 //023A //024A //awbb_OutdoorGrZones_m_BGrid[45]0257 - {0x0F12,0x0000}, //0000 //01D4 //01E9 //awbb_OutdoorGrZones_m_BGrid[46]0202 - {0x0F12,0x0000}, //0000 //0228 //0239 //awbb_OutdoorGrZones_m_BGrid[47]0246 - {0x0F12,0x0000}, //0000 //01EB //01F8 //awbb_OutdoorGrZones_m_BGrid[48]0209 - {0x0F12,0x0000}, //0000 //0209 //021E //awbb_OutdoorGrZones_m_BGrid[49]022B - // param_end awbb_OutdoorGrZones_m_BGrid - {0x002A,0x0d6c}, //#awbb_OutdoorGrZones_m_GridStep - {0x0F12,0x0004}, - {0x0F12,0x0000}, - {0x002A,0x0d74}, //#awbb_OutdoorGrZones_m_Boffs - {0x0F12,0x0222}, //0195 //0145 //013d //0131 - {0x0F12,0x0000}, - {0x002A,0x0e00}, //#awbb_CrclLowT_R_c - {0x0F12,0x03cf}, //034A - {0x0F12,0x0000}, - {0x002A,0x0e04}, //#awbb_CrclLowT_B_c - {0x0F12,0x012e}, //0176 - {0x0F12,0x0000}, - {0x002A,0x0e08}, //#awbb_CrclLowT_Rad_c - {0x0F12,0xdf21}, //67C3 //6fc3 //71B8 - {0x0F12,0x0000}, - {0x002A,0x0E1A}, - {0x0F12,0x0135}, //012F - {0x0F12,0x0120}, - - //// awbb_LowTempRB - //002A 0E68 - //0F12 04F2 - - // param_start SARR_usGammaLutRGBIndoor - {0x002A,0x04C8}, - {0x0F12,0x0000}, - {0x0F12,0x0004}, - {0x0F12,0x0009}, - {0x0F12,0x0015}, - {0x0F12,0x0034}, - {0x0F12,0x0088}, - {0x0F12,0x00ED}, - {0x0F12,0x0155}, - {0x0F12,0x0201}, - {0x0F12,0x0276}, - {0x0F12,0x0307}, - {0x0F12,0x0362}, - {0x0F12,0x03A9}, - {0x0F12,0x03D5}, - {0x0F12,0x03F4}, - {0x0F12,0x03FF}, - {0x0F12,0x0000}, - {0x0F12,0x0004}, - {0x0F12,0x0009}, - {0x0F12,0x0015}, - {0x0F12,0x0034}, - {0x0F12,0x0088}, - {0x0F12,0x00ED}, - {0x0F12,0x0155}, - {0x0F12,0x0201}, - {0x0F12,0x0276}, - {0x0F12,0x0307}, - {0x0F12,0x0362}, - {0x0F12,0x03A9}, - {0x0F12,0x03D5}, - {0x0F12,0x03F4}, - {0x0F12,0x03FF}, - {0x0F12,0x0000}, - {0x0F12,0x0004}, - {0x0F12,0x0009}, - {0x0F12,0x0015}, - {0x0F12,0x0034}, - {0x0F12,0x0088}, - {0x0F12,0x00ED}, - {0x0F12,0x0155}, - {0x0F12,0x0201}, - {0x0F12,0x0276}, - {0x0F12,0x0307}, - {0x0F12,0x0362}, - {0x0F12,0x03A9}, - {0x0F12,0x03D5}, - {0x0F12,0x03F4}, - {0x0F12,0x03FF}, - // param_end SARR_usGammaLutRGBIndoor - - - {0x002A,0x1000}, - {0x0F12,0x003e}, // AE Target - - // SAAR_IllumType - {0x002A,0x108E}, - {0x0F12,0x00C0}, - {0x0F12,0x00E7}, - {0x0F12,0x00F9}, - {0x0F12,0x0142}, - {0x0F12,0x0179}, - {0x0F12,0x01A4}, - {0x0F12,0x01B8}, //SAAR_IllumF - {0x0F12,0x0112}, - {0x0F12,0x0122}, - {0x0F12,0x0136}, - {0x0F12,0x00F6}, - {0x0F12,0x0100}, - {0x0F12,0x00FE}, - {0x0F12,0x0100}, - - {0x002A,0x1AC8}, - {0x0F12,0x0000}, // param_start TVAR_wbt_pBaseCcms - {0x002A,0x23A4}, - {0x0F12,0x0213}, - {0x0F12,0xFF95}, - {0x0F12,0xFFF6}, - {0x0F12,0x0067}, - {0x0F12,0x0118}, - {0x0F12,0xFF1F}, - {0x0F12,0xFF0A}, - {0x0F12,0x01A9}, - {0x0F12,0xFF6E}, - {0x0F12,0xFECE}, - {0x0F12,0x01C7}, - {0x0F12,0x012E}, - {0x0F12,0xFFE9}, - {0x0F12,0x0009}, - {0x0F12,0x01FD}, - {0x0F12,0x015B}, - {0x0F12,0xFF0C}, - {0x0F12,0x014F}, - {0x0F12,0x0213}, - {0x0F12,0xFF95}, - {0x0F12,0xFFF6}, - {0x0F12,0x0067}, - {0x0F12,0x0118}, - {0x0F12,0xFF1F}, - {0x0F12,0xFF0A}, - {0x0F12,0x01A9}, - {0x0F12,0xFF6E}, - {0x0F12,0xFECE}, - {0x0F12,0x01C7}, - {0x0F12,0x012E}, - {0x0F12,0xFFE9}, - {0x0F12,0x0009}, - {0x0F12,0x01FD}, - {0x0F12,0x015B}, - {0x0F12,0xFF0C}, - {0x0F12,0x014F}, - {0x0F12,0x0213}, - {0x0F12,0xFF95}, - {0x0F12,0xFFF6}, - {0x0F12,0x0067}, - {0x0F12,0x0118}, - {0x0F12,0xFF1F}, - {0x0F12,0xFF0A}, - {0x0F12,0x01A9}, - {0x0F12,0xFF6E}, - {0x0F12,0xFECE}, - {0x0F12,0x01C7}, - {0x0F12,0x012E}, - {0x0F12,0xFFE9}, - {0x0F12,0x0009}, - {0x0F12,0x01FD}, - {0x0F12,0x015B}, - {0x0F12,0xFF0C}, - {0x0F12,0x014F}, - {0x0F12,0x0213}, - {0x0F12,0xFF95}, - {0x0F12,0xFFF6}, - {0x0F12,0x0067}, - {0x0F12,0x0118}, - {0x0F12,0xFF1F}, - {0x0F12,0xFF0A}, - {0x0F12,0x01A9}, - {0x0F12,0xFF6E}, - {0x0F12,0xFECE}, - {0x0F12,0x01C7}, - {0x0F12,0x012E}, - {0x0F12,0xFFE9}, - {0x0F12,0x0009}, - {0x0F12,0x01FD}, - {0x0F12,0x015B}, - {0x0F12,0xFF0C}, - {0x0F12,0x014F}, - {0x0F12,0x0213}, - {0x0F12,0xFF95}, - {0x0F12,0xFFF6}, - {0x0F12,0x0067}, - {0x0F12,0x0118}, - {0x0F12,0xFF1F}, - {0x0F12,0xFF0A}, - {0x0F12,0x01A9}, - {0x0F12,0xFF6E}, - {0x0F12,0xFECE}, - {0x0F12,0x01C7}, - {0x0F12,0x012E}, - {0x0F12,0xFFE9}, - {0x0F12,0x0009}, - {0x0F12,0x01FD}, - {0x0F12,0x015B}, - {0x0F12,0xFF0C}, - {0x0F12,0x014F}, - {0x0F12,0x0213}, - {0x0F12,0xFF95}, - {0x0F12,0xFFF6}, - {0x0F12,0x0067}, - {0x0F12,0x0118}, - {0x0F12,0xFF1F}, - {0x0F12,0xFF0A}, - {0x0F12,0x01A9}, - {0x0F12,0xFF6E}, - {0x0F12,0xFECE}, - {0x0F12,0x01C7}, - {0x0F12,0x012E}, - {0x0F12,0xFFE9}, - {0x0F12,0x0009}, - {0x0F12,0x01FD}, - {0x0F12,0x015B}, - {0x0F12,0xFF0C}, - {0x0F12,0x014F}, - // param_end TVAR_wbt_pBaseCcms - // param_start TVAR_wbt_pOutdoorCcm - {0x002A,0x2380}, - {0x0F12,0x01AF}, - {0x0F12,0xFFD5}, - {0x0F12,0x001D}, - {0x0F12,0x0080}, - {0x0F12,0x00BA}, - {0x0F12,0xFF61}, - {0x0F12,0xFF21}, - {0x0F12,0x0164}, - {0x0F12,0xFF96}, - {0x0F12,0xFF0F}, - {0x0F12,0x019A}, - {0x0F12,0x0117}, - {0x0F12,0xFFE8}, - {0x0F12,0x0041}, - {0x0F12,0x01C8}, - {0x0F12,0x0173}, - {0x0F12,0xFF35}, - {0x0F12,0x013C}, // param_end TVAR_wbt_pOutdoorCcm - - {0x002A,0x06DA}, - {0x0F12,0x00BF}, - {0x0F12,0x00E6}, - {0x0F12,0x00F2}, - {0x0F12,0x0143}, - {0x0F12,0x0178}, - {0x0F12,0x01A3}, // param_start SARR_uNormBrInDoor - {0x002A,0x07E8}, - {0x0F12,0x000A}, - {0x0F12,0x0019}, - {0x0F12,0x007D}, - {0x0F12,0x01F4}, - {0x0F12,0x1388}, - // param_end SARR_uNormBrInDoor - // param_start afit_uNoiseIndInDoor - {0x002A,0x07D0}, - {0x0F12,0x0030}, - {0x0F12,0x0046}, - {0x0F12,0x0088}, - {0x0F12,0x0205}, - {0x0F12,0x02BC}, - // param_end afit_uNoiseIndInDoor - {0x002A,0x07E6}, - {0x0F12,0x0001}, - // param_start TVAR_afit_pBaseVals - {0x002A,0x0828}, - {0x0F12,0x000B}, //TVAR_afit_pBaseVals[0] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[1] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[2] - {0x0F12,0xFFAA}, //TVAR_afit_pBaseVals[3] - {0x0F12,0x0019}, //TVAR_afit_pBaseVals[4] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[5] - {0x0F12,0x0032}, //TVAR_afit_pBaseVals[6] - {0x0F12,0x000F}, //TVAR_afit_pBaseVals[7] - {0x0F12,0x00FF}, //TVAR_afit_pBaseVals[8] - {0x0F12,0x000A}, //TVAR_afit_pBaseVals[9] - {0x0F12,0x0004}, //TVAR_afit_pBaseVals[10] - {0x0F12,0x000A}, //TVAR_afit_pBaseVals[11] - {0x0F12,0x0014}, //TVAR_afit_pBaseVals[12] - {0x0F12,0x0064}, //TVAR_afit_pBaseVals[13] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[14] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[15] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[16] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[17] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[18] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[19] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[20] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[21] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[22] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[23] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[24] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[25] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[26] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[27] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[28] - {0x0F12,0x0106}, //TVAR_afit_pBaseVals[29] - {0x0F12,0x006F}, //TVAR_afit_pBaseVals[30] - {0x0F12,0x054C}, //TVAR_afit_pBaseVals[31] - {0x0F12,0x0A4C}, //TVAR_afit_pBaseVals[32] - {0x0F12,0x0203}, //TVAR_afit_pBaseVals[33] - {0x0F12,0x0203}, //TVAR_afit_pBaseVals[34] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[35] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[36] - {0x0F12,0x2828}, //TVAR_afit_pBaseVals[37] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[38] - {0x0F12,0x0230}, //TVAR_afit_pBaseVals[39] - {0x0F12,0x0480}, //TVAR_afit_pBaseVals[40] - {0x0F12,0x0804}, //TVAR_afit_pBaseVals[41] - {0x0F12,0x030A}, //TVAR_afit_pBaseVals[42] - {0x0F12,0x1403}, //TVAR_afit_pBaseVals[43] - {0x0F12,0x1414}, //TVAR_afit_pBaseVals[44] - {0x0F12,0x0014}, //TVAR_afit_pBaseVals[45] - {0x0F12,0x0500}, //TVAR_afit_pBaseVals[46] - {0x0F12,0x1414}, //TVAR_afit_pBaseVals[47] - {0x0F12,0x1414}, //TVAR_afit_pBaseVals[48] - {0x0F12,0x0A0A}, //TVAR_afit_pBaseVals[49] - {0x0F12,0x0005}, //TVAR_afit_pBaseVals[50] - {0x0F12,0x0200}, //TVAR_afit_pBaseVals[51] - {0x0F12,0x0400}, //TVAR_afit_pBaseVals[52] - {0x0F12,0x0200}, //TVAR_afit_pBaseVals[53] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[54] - {0x0F12,0x0A00}, //TVAR_afit_pBaseVals[55] - {0x0F12,0x100A}, //TVAR_afit_pBaseVals[56] - {0x0F12,0x0150}, //TVAR_afit_pBaseVals[57] - {0x0F12,0x0130}, //TVAR_afit_pBaseVals[58] - {0x0F12,0x0100}, //TVAR_afit_pBaseVals[59] - {0x0F12,0x8032}, //805A //TVAR_afit_pBaseVals[60] - {0x0F12,0x0180}, //TVAR_afit_pBaseVals[61] - {0x0F12,0x001C}, //TVAR_afit_pBaseVals[62] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[63] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[64] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[65] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[66] - {0x0F12,0x000C}, //TVAR_afit_pBaseVals[67] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[68] - {0x0F12,0x0014}, //TVAR_afit_pBaseVals[69] - {0x0F12,0x000F}, //TVAR_afit_pBaseVals[70] - {0x0F12,0x00A0}, //TVAR_afit_pBaseVals[71] - {0x0F12,0x000A}, //TVAR_afit_pBaseVals[72] - {0x0F12,0x0004}, //TVAR_afit_pBaseVals[73] - {0x0F12,0x0012}, //TVAR_afit_pBaseVals[74] - {0x0F12,0x0014}, //TVAR_afit_pBaseVals[75] - {0x0F12,0x0064}, //TVAR_afit_pBaseVals[76] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[77] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[78] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[79] - {0x0F12,0x0200}, //TVAR_afit_pBaseVals[80] - {0x0F12,0x0200}, //TVAR_afit_pBaseVals[81] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[82] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[83] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[84] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[85] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[86] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[87] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[88] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[89] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[90] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[91] - {0x0F12,0x0106}, //TVAR_afit_pBaseVals[92] - {0x0F12,0x006F}, //TVAR_afit_pBaseVals[93] - {0x0F12,0x053D}, //TVAR_afit_pBaseVals[94] - {0x0F12,0x0A3D}, //TVAR_afit_pBaseVals[95] - {0x0F12,0x0203}, //TVAR_afit_pBaseVals[96] - {0x0F12,0x0203}, //TVAR_afit_pBaseVals[97] - {0x0F12,0x0C23}, //TVAR_afit_pBaseVals[98] - {0x0F12,0x230C}, //TVAR_afit_pBaseVals[99] - {0x0F12,0x1919}, //TVAR_afit_pBaseVals[100] - {0x0F12,0x0303}, //TVAR_afit_pBaseVals[101] - {0x0F12,0x0220}, //TVAR_afit_pBaseVals[102] - {0x0F12,0x0480}, //TVAR_afit_pBaseVals[103] - {0x0F12,0x0804}, //TVAR_afit_pBaseVals[104] - {0x0F12,0x030A}, //TVAR_afit_pBaseVals[105] - {0x0F12,0x1403}, //TVAR_afit_pBaseVals[106] - {0x0F12,0x1414}, //TVAR_afit_pBaseVals[107] - {0x0F12,0x0014}, //TVAR_afit_pBaseVals[108] - {0x0F12,0x0500}, //TVAR_afit_pBaseVals[109] - {0x0F12,0x1414}, //TVAR_afit_pBaseVals[110] - {0x0F12,0x1414}, //TVAR_afit_pBaseVals[111] - {0x0F12,0x0A0A}, //TVAR_afit_pBaseVals[112] - {0x0F12,0x0005}, //TVAR_afit_pBaseVals[113] - {0x0F12,0x0200}, //TVAR_afit_pBaseVals[114] - {0x0F12,0x0400}, //TVAR_afit_pBaseVals[115] - {0x0F12,0x0200}, //TVAR_afit_pBaseVals[116] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[117] - {0x0F12,0x0500}, //TVAR_afit_pBaseVals[118] - {0x0F12,0x1008}, //TVAR_afit_pBaseVals[119] - {0x0F12,0x0160}, //TVAR_afit_pBaseVals[120] - {0x0F12,0x0150}, //TVAR_afit_pBaseVals[121] - {0x0F12,0x0100}, //TVAR_afit_pBaseVals[122] - {0x0F12,0x803C}, //8064 //TVAR_afit_pBaseVals[123] - {0x0F12,0x0180}, //TVAR_afit_pBaseVals[124] - {0x0F12,0x0016}, //TVAR_afit_pBaseVals[125] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[126] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[127] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[128] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[129] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[130] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[131] - {0x0F12,0x000F}, //TVAR_afit_pBaseVals[132] - {0x0F12,0x000F}, //TVAR_afit_pBaseVals[133] - {0x0F12,0x0050}, //TVAR_afit_pBaseVals[134] - {0x0F12,0x000A}, //TVAR_afit_pBaseVals[135] - {0x0F12,0x0003}, //TVAR_afit_pBaseVals[136] - {0x0F12,0x0019}, //TVAR_afit_pBaseVals[137] - {0x0F12,0x0014}, //TVAR_afit_pBaseVals[138] - {0x0F12,0x0064}, //TVAR_afit_pBaseVals[139] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[140] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[141] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[142] - {0x0F12,0x0002}, //TVAR_afit_pBaseVals[143] - {0x0F12,0x0002}, //TVAR_afit_pBaseVals[144] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[145] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[146] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[147] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[148] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[149] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[150] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[151] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[152] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[153] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[154] - {0x0F12,0x0106}, //TVAR_afit_pBaseVals[155] - {0x0F12,0x006F}, //TVAR_afit_pBaseVals[156] - {0x0F12,0x050A}, //TVAR_afit_pBaseVals[157] - {0x0F12,0x0A0A}, //TVAR_afit_pBaseVals[158] - {0x0F12,0x0203}, //TVAR_afit_pBaseVals[159] - {0x0F12,0x0203}, //TVAR_afit_pBaseVals[160] - {0x0F12,0x1946}, //TVAR_afit_pBaseVals[161] - {0x0F12,0x4619}, //TVAR_afit_pBaseVals[162] - {0x0F12,0x0F0F}, //TVAR_afit_pBaseVals[163] - {0x0F12,0x0606}, //TVAR_afit_pBaseVals[164] - {0x0F12,0x020F}, //TVAR_afit_pBaseVals[165] - {0x0F12,0x0480}, //TVAR_afit_pBaseVals[166] - {0x0F12,0x0804}, //TVAR_afit_pBaseVals[167] - {0x0F12,0x030A}, //TVAR_afit_pBaseVals[168] - {0x0F12,0x1403}, //TVAR_afit_pBaseVals[169] - {0x0F12,0x1414}, //TVAR_afit_pBaseVals[170] - {0x0F12,0x0014}, //TVAR_afit_pBaseVals[171] - {0x0F12,0x0500}, //TVAR_afit_pBaseVals[172] - {0x0F12,0x1414}, //TVAR_afit_pBaseVals[173] - {0x0F12,0x1414}, //TVAR_afit_pBaseVals[174] - {0x0F12,0x0A0A}, //TVAR_afit_pBaseVals[175] - {0x0F12,0x0005}, //TVAR_afit_pBaseVals[176] - {0x0F12,0x0202}, //TVAR_afit_pBaseVals[177] - {0x0F12,0x0404}, //TVAR_afit_pBaseVals[178] - {0x0F12,0x0202}, //TVAR_afit_pBaseVals[179] - {0x0F12,0x0402}, //TVAR_afit_pBaseVals[180] - {0x0F12,0x0002}, //TVAR_afit_pBaseVals[181] - {0x0F12,0x1006}, //TVAR_afit_pBaseVals[182] - {0x0F12,0x0180}, //TVAR_afit_pBaseVals[183] - {0x0F12,0x0180}, //TVAR_afit_pBaseVals[184] - {0x0F12,0x0100}, //TVAR_afit_pBaseVals[185] - {0x0F12,0x8046}, //0x8067 //TVAR_afit_pBaseVals[186] - {0x0F12,0x0180}, //TVAR_afit_pBaseVals[187] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[188] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[189] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[190] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[191] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[192] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[193] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[194] - {0x0F12,0x000F}, //TVAR_afit_pBaseVals[195] - {0x0F12,0x000F}, //TVAR_afit_pBaseVals[196] - {0x0F12,0x000A}, //TVAR_afit_pBaseVals[197] - {0x0F12,0x000A}, //TVAR_afit_pBaseVals[198] - {0x0F12,0x0003}, //TVAR_afit_pBaseVals[199] - {0x0F12,0x0019}, //TVAR_afit_pBaseVals[200] - {0x0F12,0x0014}, //TVAR_afit_pBaseVals[201] - {0x0F12,0x0064}, //TVAR_afit_pBaseVals[202] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[203] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[204] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[205] - {0x0F12,0x0002}, //TVAR_afit_pBaseVals[206] - {0x0F12,0x0002}, //TVAR_afit_pBaseVals[207] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[208] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[209] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[210] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[211] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[212] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[213] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[214] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[215] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[216] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[217] - {0x0F12,0x0106}, //TVAR_afit_pBaseVals[218] - {0x0F12,0x006F}, //TVAR_afit_pBaseVals[219] - {0x0F12,0x0505}, //TVAR_afit_pBaseVals[220] - {0x0F12,0x0A0A}, //TVAR_afit_pBaseVals[221] - {0x0F12,0x0202}, //TVAR_afit_pBaseVals[222] - {0x0F12,0x0202}, //TVAR_afit_pBaseVals[223] - {0x0F12,0x1946}, //TVAR_afit_pBaseVals[224] - {0x0F12,0x4619}, //TVAR_afit_pBaseVals[225] - {0x0F12,0x0F0F}, //TVAR_afit_pBaseVals[226] - {0x0F12,0x0606}, //TVAR_afit_pBaseVals[227] - {0x0F12,0x020F}, //TVAR_afit_pBaseVals[228] - {0x0F12,0x0480}, //TVAR_afit_pBaseVals[229] - {0x0F12,0x0804}, //TVAR_afit_pBaseVals[230] - {0x0F12,0x030A}, //TVAR_afit_pBaseVals[231] - {0x0F12,0x1403}, //TVAR_afit_pBaseVals[232] - {0x0F12,0x1414}, //TVAR_afit_pBaseVals[233] - {0x0F12,0x0014}, //TVAR_afit_pBaseVals[234] - {0x0F12,0x0500}, //TVAR_afit_pBaseVals[235] - {0x0F12,0x1414}, //TVAR_afit_pBaseVals[236] - {0x0F12,0x1414}, //TVAR_afit_pBaseVals[237] - {0x0F12,0x0A0A}, //TVAR_afit_pBaseVals[238] - {0x0F12,0x0005}, //TVAR_afit_pBaseVals[239] - {0x0F12,0x0202}, //TVAR_afit_pBaseVals[240] - {0x0F12,0x0404}, //TVAR_afit_pBaseVals[241] - {0x0F12,0x0202}, //TVAR_afit_pBaseVals[242] - {0x0F12,0x0402}, //TVAR_afit_pBaseVals[243] - {0x0F12,0x0002}, //TVAR_afit_pBaseVals[244] - {0x0F12,0x1006}, //TVAR_afit_pBaseVals[245] - {0x0F12,0x0180}, //TVAR_afit_pBaseVals[246] - {0x0F12,0x0180}, //TVAR_afit_pBaseVals[247] - {0x0F12,0x0100}, //TVAR_afit_pBaseVals[248] - {0x0F12,0x8046}, //5A //0x806B //TVAR_afit_pBaseVals[249] - {0x0F12,0x0180}, //TVAR_afit_pBaseVals[250] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[251] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[252] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[253] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[254] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[255] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[256] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[257] - {0x0F12,0x0005}, //TVAR_afit_pBaseVals[258] - {0x0F12,0x0005}, //TVAR_afit_pBaseVals[259] - {0x0F12,0x0005}, //TVAR_afit_pBaseVals[260] - {0x0F12,0x0005}, //TVAR_afit_pBaseVals[261] - {0x0F12,0x0003}, //TVAR_afit_pBaseVals[262] - {0x0F12,0x0019}, //TVAR_afit_pBaseVals[263] - {0x0F12,0x0014}, //TVAR_afit_pBaseVals[264] - {0x0F12,0x0064}, //TVAR_afit_pBaseVals[265] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[266] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[267] - {0x0F12,0x0000}, //TVAR_afit_pBaseVals[268] - {0x0F12,0x000F}, //TVAR_afit_pBaseVals[269] - {0x0F12,0x000F}, //TVAR_afit_pBaseVals[270] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[271] - {0x0F12,0x03FF}, //TVAR_afit_pBaseVals[272] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[273] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[274] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[275] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[276] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[277] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[278] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[279] - {0x0F12,0x0028}, //TVAR_afit_pBaseVals[280] - {0x0F12,0x0106}, //TVAR_afit_pBaseVals[281] - {0x0F12,0x006F}, //TVAR_afit_pBaseVals[282] - {0x0F12,0x0505}, //TVAR_afit_pBaseVals[283] - {0x0F12,0x0A0A}, //TVAR_afit_pBaseVals[284] - {0x0F12,0x0202}, //TVAR_afit_pBaseVals[285] - {0x0F12,0x0202}, //TVAR_afit_pBaseVals[286] - {0x0F12,0x1946}, //TVAR_afit_pBaseVals[287] - {0x0F12,0x4619}, //TVAR_afit_pBaseVals[288] - {0x0F12,0x0F0F}, //TVAR_afit_pBaseVals[289] - {0x0F12,0x0606}, //TVAR_afit_pBaseVals[290] - {0x0F12,0x020F}, //TVAR_afit_pBaseVals[291] - {0x0F12,0x0480}, //TVAR_afit_pBaseVals[292] - {0x0F12,0x0804}, //TVAR_afit_pBaseVals[293] - {0x0F12,0x030A}, //TVAR_afit_pBaseVals[294] - {0x0F12,0x1403}, //TVAR_afit_pBaseVals[295] - {0x0F12,0x1414}, //TVAR_afit_pBaseVals[296] - {0x0F12,0x0014}, //TVAR_afit_pBaseVals[297] - {0x0F12,0x0500}, //TVAR_afit_pBaseVals[298] - {0x0F12,0x1414}, //TVAR_afit_pBaseVals[299] - {0x0F12,0x1414}, //TVAR_afit_pBaseVals[300] - {0x0F12,0x0A0A}, //TVAR_afit_pBaseVals[301] - {0x0F12,0x0005}, //TVAR_afit_pBaseVals[302] - {0x0F12,0x0303}, //TVAR_afit_pBaseVals[303] - {0x0F12,0x0707}, //TVAR_afit_pBaseVals[304] - {0x0F12,0x0303}, //TVAR_afit_pBaseVals[305] - {0x0F12,0x0806}, //TVAR_afit_pBaseVals[306] - {0x0F12,0x0004}, //TVAR_afit_pBaseVals[307] - {0x0F12,0x1006}, //TVAR_afit_pBaseVals[308] - {0x0F12,0x0180}, //TVAR_afit_pBaseVals[309] - {0x0F12,0x0180}, //TVAR_afit_pBaseVals[310] - {0x0F12,0x0100}, //TVAR_afit_pBaseVals[311] - {0x0F12,0x8046}, //5A //0x806B //TVAR_afit_pBaseVals[312] - {0x0F12,0x0180}, //TVAR_afit_pBaseVals[313] - {0x0F12,0x0000}, ////TVAR_afit_pBaseVals[314] param_end TVAR_afit_pBaseVals - // param_sta afit_pConstBaseVals - {0x0F12,0x03FC}, - {0x0F12,0x03FF}, - {0x0F12,0x0500}, - {0x0F12,0x0400}, - {0x0F12,0x0000}, - {0x0F12,0x0000}, - {0x0F12,0x0000}, - {0x0F12,0x0300}, - {0x0F12,0x0002}, - {0x0F12,0x0300}, - {0x0F12,0x0203}, - {0x0F12,0x0003}, - {0x0F12,0x0000}, - {0x0F12,0x0204}, - {0x0F12,0x0000}, - {0x0F12,0xFDD6}, - {0x0F12,0x43C1}, - {0x0F12,0xF0FA}, - {0x0F12,0x0001}, // param_end afit_pConstBaseVals - - {0x002A,0x06d4}, //#TVAR_wbt_pOutdoorCcm - {0x0F12,0x2380}, - {0x0F12,0x7000}, - {0x002A,0x06cc}, //#TVAR_wbt_pBaseCcms - {0x0F12,0x23A4}, - {0x0F12,0x7000}, - {0x002A,0x06e8}, //#TVAR_wbt_pBaseCcmsAddr[0] - {0x0F12,0x23A4}, - {0x0F12,0x7000}, - {0x002A,0x06EC}, //#TVAR_wbt_pBaseCcmsAddr[1] - {0x0F12,0x23C8}, - {0x0F12,0x7000}, - {0x002A,0x06f0}, //#TVAR_wbt_pBaseCcmsAddr[2] - {0x0F12,0x23EC}, - {0x0F12,0x7000}, - {0x002A,0x06f4}, //#TVAR_wbt_pBaseCcmsAddr[3] - {0x0F12,0x2410}, - {0x0F12,0x7000}, - {0x002A,0x06f8}, //#TVAR_wbt_pBaseCcmsAddr[4] - {0x0F12,0x2434}, - {0x0F12,0x7000}, - {0x002A,0x06fc}, //#TVAR_wbt_pBaseCcmsAddr[5] - {0x0F12,0x2458}, - {0x0F12,0x7000}, // End tuning part - {0x1000,0x0001}, - //1000 0001 // Set host interrupt so main start run - //p10 // Wait10mSec - {SEQUENCE_WAIT_MS,20}, - - - - // Set Flicker - - //================================================================================================= - // Set Flicker - //================================================================================================= - - ////1. Auto Flicker 60Hz Start - //{0x002A, AFC_Default60Hz}, - //{0x0F12, 0x0001}, // #AFC_Default60Hz 1: Auto Flicker 60Hz start 0: Auto Flicker 50Hz start - //{0x002A, REG_TC_DBG_AutoAlgEnBits}, - //{0x0F12, 0x007F}, // #REG_TC_DBG_AutoAlgEnBits //default : 007F - - ////2. Auto Flicker 50Hz Start - //{0x002A, 0xAFC_Default60Hz}, - //{0x0F12, 0x0000}, //1: Auto Flicker 60Hz start 0: Auto Flicker 50Hz start - //{0x002A, 0xREG_TC_DBG_AutoAlgEnBits}, - //{0x0F12, 0x007F}, //default : 007F - - //3. Manual Flicker 60Hz - //{0x002A, 0xREG_TC_DBG_AutoAlgEnBits}, //default : 007F - //{0x0F12, 0x005F}, - //{0x002A, 0xREG_SF_USER_FlickerQuant}, //Flicker 50Hz:0001/60Hz:0002/off:0000 - //{0x0F12, 0x0002}, - //{0x002A, 0xREG_SF_USER_FlickerQuantChanged}, //if change 0001 write - //{0x0F12, 0x0001}, - - //4. Manual Flicker 50Hz - {0x002A, REG_TC_DBG_AutoAlgEnBits}, //default : 007F - {0x0F12, 0x005F}, - {0x002A, REG_SF_USER_FlickerQuant}, //Flicker 50Hz:0001/60Hz:0002/off:0000 - {0x0F12, 0x0001}, - {0x002A, REG_SF_USER_FlickerQuantChanged}, //if change 0001 write - {0x0F12, 0x0001}, - - //5. Flicker Off - //{0x002A, 0xREG_TC_DBG_AutoAlgEnBits}, //default : 007F - //{0x0F12, 0x005F}, - //{0x002A, 0xREG_SF_USER_FlickerQuant}, //Flicker 50Hz:0001/60Hz:0002/off:0000 - //{0x0F12, 0x0000}, - //{0x002A, 0xREG_SF_USER_FlickerQuantChanged}, //if change 0001 write - //{0x0F12, 0x0001}, - - //{0x002A, 0xAFC_ManualQuant}, - //{0x0F12, 0x0001}, - - - {0x002A,lt_uMaxExp1}, - {0x0F12,0xC350}, // #lt_uMaxExp1 : 66.6ms //30fps: 30fps-> 33.3ms->410A - {0x0F12,0x0000}, - {0x002A,lt_uMaxExp2}, - {0x0F12,0x8488}, // #lt_uMaxExp2 : 250ms - {0x0F12,0x0002}, - {0x002A,lt_uCapMaxExp1}, - {0x0F12,0xE848}, // #lt_uCapMaxExp1 : 133.3ms = 0x1045a //edison : 10fps = 100ms=0xc350 - {0x0F12,0x0001}, - {0x002A,lt_uCapMaxExp2}, - {0x0F12,0x8488}, // #lt_uCapMaxExp2 : 250ms - {0x0F12,0x0002}, - {0x002A,lt_uMaxAnGain1}, - {0x0F12,0x0280}, //0280 // #lt_uMaxAnGain1 : X 2.51¡§¡§ - {0x002A,lt_uMaxAnGain2}, - {0x0F12,0x0600}, //0500 // #lt_uMaxAnGain2 : X 6.01¡§¡§ - {0x002A,lt_uMaxDigGain}, - {0x0F12,0x0100}, //0200 // #lt_uMaxDigGain - //{0x0F12 0007 // #ae_StatMode - - //clk Settings - {0x002A,0x01b8}, // input=24MHz - {0x0F12,0x5dc0}, // #REG_TC_IPRM_InClockLSBs - {0x002A,0x01ba}, - {0x0F12,0x0000}, - {0x002A,0x01c6}, // #REG_TC_IPRM_UseNPviClocks 1 PLL configurations - {0x0F12,0x0002}, - {0x002A,0x01cc}, // 1st system CLK - {0x0F12,0x0bb8}, //1964 //#REG_TC_IPRM_sysClocks[0] - {0x0F12,0x0bb8}, //#REG_TC_IPRM_MinOutRate4KHz_0 - {0x0F12,0x0bb8}, //#REG_TC_IPRM_MaxOutRate4KHz_0 - - {0x0F12,0x1770}, //#REG_TC_IPRM_sysClocks[1] - {0x0F12,0x1770}, //2ee0 //#REG_TC_IPRM_MinOutRate4KHz_1 - {0x0F12,0x1770}, //2ee0 //#REG_TC_IPRM_MaxOutRate4KHz_1 - {0x002A,0x01e0}, //#REG_TC_IPRM_InitParamsUpdated - {0x0F12,0x0001}, - //p10 - - - //PREVIEW CONFIGURATION 0 (VGA, YUV, 6.5~12fps) - {0x002A,0x0242}, - {0x0F12,0x0280}, //0500 //Width - {0x0F12,0x01e0}, //0400 //Height - {0x0F12,0x0005}, //Format, 5:YUV422 - {0x0F12,0x1770}, //MaxOut4KHzRate, 1770 = 24M - {0x0F12,0x1770}, //MinOut4KHzRate, 1770 = 24M - {0x0F12,0x0052}, //PVIMask, default = 42 - {0x0F12,0x0001}, //ClockInd, 0-2 - {0x0F12,0x0000}, //FrTimeType, 0:Dynamic, 1:Fix for not accuarte, 2:Fix for accuarte - {0x0F12,0x0000}, //FrRateQualityType, 1:Binning enable, 2:Binning disable - {0x0F12,0x0600}, //0535 //04E2 //MaxFrTime, 14d = 33.3ms(333-6500) //7.5FPS - {0x0F12,0x0320}, //03E8 //04E2 //MinFrTime, 14d = 33.3ms(333-6500) //15 FPS - - //================================================================================================= - // Set Preview Config 1 --- For Night Mode // 4~12fps - //================================================================================================= - {0x002A, REG_1TC_PCFG_usWidth}, - {0x0F12, 0x0280}, // #REG_0TC_PCFG_usWidth - {0x002A, REG_1TC_PCFG_usHeight}, - {0x0F12, 0x01e0}, // #REG_0TC_PCFG_usHeight - {0x002A, REG_1TC_PCFG_Format}, - {0x0F12, 0x0005}, // #REG_0TC_PCFG_Format : YUV - {0x002A, REG_1TC_PCFG_usMaxOut4KHzRate}, - {0x0F12, 0x1770}, // #REG_0TC_PCFG_usMaxOut4KHzRate - {0x002A, REG_1TC_PCFG_usMinOut4KHzRate}, - {0x0F12, 0x1770}, // #REG_0TC_PCFG_usMinOut4KHzRate - {0x002A, REG_1TC_PCFG_PVIMask}, - {0x0F12, 0x0052}, // #REG_0TC_PCFG_PVIMask (x2: PCLK rising # x0: PCLK Falling) - {0x002A, REG_1TC_PCFG_uClockInd}, - {0x0F12, 0x0001}, // #REG_0TC_PCFG_uClockInd - {0x002A, REG_1TC_PCFG_usFrTimeType}, - {0x0F12, 0x0000}, // #REG_0TC_PCFG_usFrTimeType - {0x002A, REG_1TC_PCFG_FrRateQualityType}, - {0x0F12, 0x0000}, // #REG_0TC_PCFG_FrRateQualityType - {0x002A, REG_1TC_PCFG_usMaxFrTimeMsecMult10}, - {0x0F12, 0x0CE4}, //09C4 // 4FPS 029A // #REG_0TC_PCFG_usMaxFrTimeMsecMult10 : 5fps - {0x002A, REG_1TC_PCFG_usMinFrTimeMsecMult10}, - {0x0F12, 0x0320}, // // #REG_0TC_PCFG_usMinFrTimeMsecMult10 : 10fps - //WRITE 70000262 0003 // #REG_0TC_PCFG_uPrevMirror - //WRITE 70000264 0003 // #REG_0TC_PCFG_uCaptureMirror - /*lzg@rock-chips.com, FIH:image to be mirrored*/ -#if CONFIG_SENSOR_NONE_FLIP_MIRROR - {0x002A, 0x0262}, - {0x0F12, 0x0000}, - {0x002A, 0x0264}, - {0x0F12, 0x0000}, -#elif CONFIG_SENSOR_MIRROR - {0x002A, 0x0262}, - {0x0F12, 0x0001}, - {0x002A, 0x0264}, - {0x0F12, 0x0001}, -#elif CONFIG_SENSOR_FLIPE - {0x002A, 0x0262}, - {0x0F12, 0x0002}, - {0x002A, 0x0264}, - {0x0F12, 0x0002}, -#elif CONFIG_SENSOR_NONE_FLIP_MIRROR - {0x002A, 0x0262}, - {0x0F12, 0x0003}, - {0x002A, 0x0264}, - {0x0F12, 0x0003}, -#endif - //================================================================================================= - // Set Preview Config 2 --- For Video record(normal) // 12fps - //================================================================================================= - {0x002A, REG_2TC_PCFG_usWidth}, - {0x0F12, 0x0280}, // #REG_0TC_PCFG_usWidth - {0x002A, REG_2TC_PCFG_usHeight}, - {0x0F12, 0x01e0}, // #REG_0TC_PCFG_usHeight - {0x002A, REG_2TC_PCFG_Format}, - {0x0F12, 0x0005}, // #REG_0TC_PCFG_Format : YUV - {0x002A, REG_2TC_PCFG_usMaxOut4KHzRate}, - {0x0F12, 0x0BB8}, //1770 // #REG_0TC_PCFG_usMaxOut4KHzRate - {0x002A, REG_2TC_PCFG_usMinOut4KHzRate}, - {0x0F12, 0x0BB8}, //1770 // #REG_0TC_PCFG_usMinOut4KHzRate - {0x002A, REG_2TC_PCFG_PVIMask}, - {0x0F12, 0x0052}, // #REG_0TC_PCFG_PVIMask (x2: PCLK rising # x0: PCLK Falling) - {0x002A, REG_2TC_PCFG_uClockInd}, - {0x0F12, 0x0001}, // #REG_0TC_PCFG_uClockInd - {0x002A, REG_2TC_PCFG_usFrTimeType}, - {0x0F12, 0x0002}, //0 // #REG_0TC_PCFG_usFrTimeType - {0x002A, REG_2TC_PCFG_FrRateQualityType}, - {0x0F12, 0x0000}, // #REG_0TC_PCFG_FrRateQualityType - {0x002A, REG_2TC_PCFG_usMaxFrTimeMsecMult10}, - {0x0F12, 0x0320}, //07D0 //029A // #REG_0TC_PCFG_usMaxFrTimeMsecMult10 : 5fps - {0x002A, REG_2TC_PCFG_usMinFrTimeMsecMult10}, - {0x0F12, 0x0000},//0320 //03E8 // #REG_0TC_PCFG_usMinFrTimeMsecMult10 : 10fps - - - //================================================================================================= - // Set Preview Config 3 --- For Video Record(Night Mode) // 12fps - //================================================================================================= - {0x002A, REG_3TC_PCFG_usWidth}, - {0x0F12, 0x0280}, // #REG_0TC_PCFG_usWidth - {0x002A, REG_3TC_PCFG_usHeight}, - {0x0F12, 0x01e0}, // #REG_0TC_PCFG_usHeight - {0x002A, REG_3TC_PCFG_Format}, - {0x0F12, 0x0005}, // #REG_0TC_PCFG_Format : YUV - {0x002A, REG_3TC_PCFG_usMaxOut4KHzRate}, - {0x0F12, 0x0BB8}, //1770 // #REG_0TC_PCFG_usMaxOut4KHzRate - {0x002A, REG_3TC_PCFG_usMinOut4KHzRate}, - {0x0F12, 0x0BB8}, //1770 // #REG_0TC_PCFG_usMinOut4KHzRate - {0x002A, REG_3TC_PCFG_PVIMask}, - {0x0F12, 0x0052}, // #REG_0TC_PCFG_PVIMask (x2: PCLK rising # x0: PCLK Falling) - {0x002A, REG_3TC_PCFG_uClockInd}, - {0x0F12, 0x0001}, // #REG_0TC_PCFG_uClockInd - {0x002A, REG_3TC_PCFG_usFrTimeType}, - {0x0F12, 0x0002}, //0 // #REG_0TC_PCFG_usFrTimeType - {0x002A, REG_3TC_PCFG_FrRateQualityType}, - {0x0F12, 0x0000}, // #REG_0TC_PCFG_FrRateQualityType - {0x002A, REG_3TC_PCFG_usMaxFrTimeMsecMult10}, - {0x0F12, 0x03e8}, //029A // #REG_0TC_PCFG_usMaxFrTimeMsecMult10 : 5fps - {0x002A, REG_3TC_PCFG_usMinFrTimeMsecMult10}, - {0x0F12, 0x0000},//0320 //03E8 // #REG_0TC_PCFG_usMinFrTimeMsecMult10 : 10fps - - //Preview - {0x002A,0x021c}, //REG_TC_GP_ActivePrevConfig - {0x0F12,0x0000}, - {0x002A,0x0220}, //REG_TC_GP_PrevOpenAfterChange - {0x0F12,0x0001}, - {0x002A,0x01f8}, //REG_TC_GP_NewConfigSync - {0x0F12,0x0001}, - {0x002A,0x021e}, //REG_TC_GP_PrevConfigChanged - {0x0F12,0x0001}, - {0x002A,0x01f0}, //REG_TC_GP_EnablePreview - {0x0F12,0x0001}, - {0x002A,0x01f2}, //REG_TC_GP_EnablePreviewChanged - {0x0F12,0x0001}, - - - //================================================================================================= - // Set Capture Config // normal mode - //================================================================================================= - {0x002A,REG_0TC_CCFG_uCaptureMode}, - {0x0F12,0x0000}, // #REG_0TC_CCFG_uCaptureMode : AE/AWB off when caputre - {0x002A,REG_0TC_CCFG_usWidth}, - {0x0F12,0x0500}, - {0x002A,REG_0TC_CCFG_usHeight}, - {0x0F12,0x0400}, - {0x002A,REG_0TC_CCFG_Format}, - {0x0F12,0x0005}, // #REG_0TC_CCFG_Format : YUV - {0x002A,REG_0TC_CCFG_usMaxOut4KHzRate}, - {0x0F12,0x0bb8}, //05DC //0BC8 //1964 //0BB8 // #REG_0TC_CCFG_usMaxOut4KHzRate - {0x002A,REG_0TC_CCFG_usMinOut4KHzRate}, - {0x0F12,0x0bb8}, //05DC //0BA8 //1964 //0BB8 // #REG_0TC_CCFG_usMinOut4KHzRate - {0x002A,REG_0TC_CCFG_PVIMask}, - {0x0F12,0x0052}, // #REG_0TC_CCFG_PVIMask (x2: PCLK rising # x0: PCLK Falling) - {0x002A,REG_0TC_CCFG_uClockInd}, - {0x0F12,0x0000}, // #REG_0TC_CCFG_uClockInd - {0x002A,REG_0TC_CCFG_usFrTimeType}, - {0x0F12,0x0002}, //0 // #REG_0TC_CCFG_usFrTimeType - {0x002A,REG_0TC_CCFG_FrRateQualityType}, - {0x0F12,0x0002}, // #REG_0TC_CCFG_FrRateQualityType - {0x002A,REG_0TC_CCFG_usMaxFrTimeMsecMult10}, - {0x0F12,0x09C4}, //0x09C4 // #REG_0TC_CCFG_usMaxFrTimeMsecMult10 : 4fps - {0x002A,REG_0TC_CCFG_usMinFrTimeMsecMult10}, - {0x0F12,0x0000}, //03e8 // #REG_0TC_CCFG_usMinFrTimeMsecMult10 : - {SEQUENCE_END, 0x00} -}; - - - - -static struct reginfo sensor_720p[]= -{ - {SEQUENCE_END, 0x00} -}; -#if 0 -static struct reginfo sensor_1080p[]= -{ - {SEQUENCE_END, 0x00} -}; -#endif - -/* 2592X1944 QSXGA */ -static struct reginfo sensor_qsxga[] = -{ - {SEQUENCE_END, 0x00} -}; -/* 2048*1536 QXGA */ -static struct reginfo sensor_qxga[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 1600X1200 UXGA */ -static struct reginfo sensor_uxga[] = -{ - {SEQUENCE_END, 0x00} -}; - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {0x0028, 0x7000}, - //002A 03F8 - ////0F12 0079 // #REG_TC_DBG_AutoAlgEnBits, default : 007F0028 7000 - //002A 0496 - //0F12 0300 //0220 //0330 // #lt_uMaxAnGain2 - {0x002A, REG_TC_GP_ActiveCapConfig}, - {0x0F12, 0x0000}, - {0x002A, REG_TC_GP_NewConfigSync}, - {0x0F12, 0x0001}, - {0x002A, REG_TC_GP_CapConfigChanged}, - {0x0F12, 0x0001}, - {0x002A, REG_TC_GP_EnableCapture}, - {0x0F12, 0x0001}, - {0x002A, REG_TC_GP_EnableCaptureChanged}, - {0x0F12, 0x0001}, - {SEQUENCE_END, 0x00} -}; -/* 1024X768 XGA */ -static struct reginfo sensor_xga[] = -{ - {SEQUENCE_END, 0x00} -}; -#if 0 -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - {SEQUENCE_END, 0x0}, -}; -#endif -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - {0x0028, 0x7000}, - {0x002A, REG_TC_GP_ActivePrevConfig}, - {0x0F12, 0x0000}, - - {0x002A, REG_TC_GP_PrevOpenAfterChange}, - {0x0F12, 0x0001}, - {0x002A, REG_TC_GP_NewConfigSync}, - {0x0F12, 0x0001}, - {0x002A, REG_TC_GP_PrevConfigChanged}, - {0x0F12, 0x0001}, - {SEQUENCE_END, 0x0}, -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {SEQUENCE_END, 0x0}, -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - {SEQUENCE_END, 0x0}, -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {SEQUENCE_END, 0x0}, -}; -#endif -#if 0 -/* 160X120 QQVGA*/ -static struct reginfo s5k6aa_qqvga[] = -{ - - {0x300E, 0x34}, - {0x3011, 0x01}, - {0x3012, 0x10}, - {0x302a, 0x02}, - {0x302b, 0xE6}, - {0x306f, 0x14}, - {0x3362, 0x90}, - - {0x3070, 0x5d}, - {0x3072, 0x5d}, - {0x301c, 0x07}, - {0x301d, 0x07}, - - {0x3020, 0x01}, - {0x3021, 0x18}, - {0x3022, 0x00}, - {0x3023, 0x06}, - {0x3024, 0x06}, - {0x3025, 0x58}, - {0x3026, 0x02}, - {0x3027, 0x61}, - {0x3088, 0x00}, - {0x3089, 0xa0}, - {0x308a, 0x00}, - {0x308b, 0x78}, - {0x3316, 0x64}, - {0x3317, 0x25}, - {0x3318, 0x80}, - {0x3319, 0x08}, - {0x331a, 0x0a}, - {0x331b, 0x07}, - {0x331c, 0x80}, - {0x331d, 0x38}, - {0x3100, 0x00}, - {0x3302, 0x11}, - - {SEQUENCE_END, 0x0}, -}; - - - -static struct reginfo s5k6aa_Sharpness_auto[] = -{ - {SEQUENCE_END, 0x00}, -}; - -static struct reginfo s5k6aa_Sharpness1[] = -{ - {0x3306, 0x08}, - {0x3371, 0x00} -}; - -static struct reginfo s5k6aa_Sharpness2[][3] = -{ - //Sharpness 2 - {0x3306, 0x08}, - {0x3371, 0x01}, -}; - -static struct reginfo s5k6aa_Sharpness3[] = -{ - //default - {0x3306, 0x08}, - {0x332d, 0x02}, -}; -static struct reginfo s5k6aa_Sharpness4[]= -{ - //Sharpness 4 - {0x3306, 0x08}, - {0x332d, 0x03}, -}; - -static struct reginfo s5k6aa_Sharpness5[] = -{ - //Sharpness 5 - {0x3306, 0x08}, - {0x332d, 0x04}, -}; -#endif - -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {SEQUENCE_END, 0x00} -}; - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {SEQUENCE_END, 0x00} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {SEQUENCE_END, 0x00} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - {SEQUENCE_END, 0x00} -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - {SEQUENCE_END, 0x00} - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure2[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure3[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure4[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure5[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Exposure6[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast1[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast2[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast3[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast4[]= -{ - {SEQUENCE_END, 0x00} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_Contrast6[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ - {SEQUENCE_END, 0x00} -}; - -static struct reginfo sensor_SceneNight[] = -{ - {SEQUENCE_END, 0x00} -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {SEQUENCE_END, 0x0}, -}; - -static struct reginfo sensor_Zoom1[] = -{ - {SEQUENCE_END, 0x0}, -}; - -static struct reginfo sensor_Zoom2[] = -{ - {SEQUENCE_END, 0x0}, -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {SEQUENCE_END, 0x0}, -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif -static struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -//static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -//static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG} -}; -enum sensor_work_state -{ - sensor_work_ready = 0, - sensor_working, -}; -struct sensor_work -{ - struct i2c_client *client; - struct delayed_work dwork; - enum sensor_work_state state; -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int auto_focus; - int affm_reinit; - int flash; - int exposure; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - bool snap2preview; - bool video2preview; - int capture_w; - int capture_h; - int preview_w; - int preview_h; - struct reginfo *winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int enable; - unsigned int funmodule_state; -} sensor_info_priv_t; - - - -struct sensor_parameter -{ - unsigned short int preview_maxlines; - unsigned short int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int capture_framerate; - unsigned short int preview_framerate; -}; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - struct sensor_parameter parameter; - struct workqueue_struct *sensor_wq; - struct sensor_work sensor_wk; - struct mutex wq_lock; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, u16 reg, u16 val) -{ - int err=0,cnt; - u8 buf[4]; - struct i2c_msg msg[1]; - - switch (reg) - { - case SEQUENCE_WAIT_MS: - { - msleep(val); - break; - } - - case SEQUENCE_WAIT_US: - { - udelay(val); - break; - } - - case SEQUENCE_PROPERTY: - { - break; - } - default: - { - buf[0] = reg >> 8; - buf[1] = reg & 0xFF; - buf[2] = val >> 8; - buf[3] = val & 0xFF; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - } - } - return err; -} -#if 0 -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u16 reg, u16 *val) -{ - u8 buf[2]; - struct i2c_msg msg[2]; - int err = 0; - - buf[0] = (u8)reg >> 8; - buf[1] = (u8)reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = sizeof(buf); - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - err = i2c_transfer(client->adapter, msg, 2); - - if(err >= 0) { - *val = (buf[0] << 8)|(buf[1] & 0xFF); - SENSOR_DG("%s read reg(0x%x val:0x%x) success\n",SENSOR_NAME_STRING(),reg,*val); - return 0; - } else { - SENSOR_TR("%s read reg(0x%x) failed!",SENSOR_NAME_STRING(),reg); - } - - return err; -} -#endif -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - while (regarray[i].reg != SEQUENCE_END) - { - - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - - i++; - } - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} - -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != SEQUENCE_END) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif -#if CONFIG_SENSOR_Focus - -static int sensor_af_single(struct i2c_client *client) -{ - int ret = 0; - - -sensor_af_single_end: - return ret; -} - -static int sensor_af_const(struct i2c_client *client) -{ - int ret = 0; - -sensor_af_const_end: - return ret; -} - -static int sensor_af_zoneupdate(struct i2c_client *client) -{ - int ret = 0; - -sensor_af_zoneupdate_end: - return ret; -} - -static int sensor_af_init(struct i2c_client *client) -{ - int ret = 0; - - return ret; -} -#endif - -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int ret = 0; - - switch (cmd) - { - case Sensor_Reset: - { - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Reset, on); - } - break; - } - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),cmd); - break; - } - } - -sensor_power_end: - return ret; -} -#if CONFIG_SENSOR_Flash -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} -#endif -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - int ret; - u16 pid = 0; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - sensor_ioctrl(icd,Sensor_Reset, 1); - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - udelay(50); - sensor_ioctrl(icd,Sensor_Reset, 0); - mdelay(1); - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - -#if (SENSOR_RESET_REG != SEQUENCE_END) - ret = sensor_write(client, SENSOR_RESET_REG, SENSOR_RESET_VAL); - if (ret != 0) { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); //delay 5 microseconds -#endif - - /* check if it is an sensor sensor */ -#if (SENSOR_ID_REG != SEQUENCE_END) - ret = sensor_read(client, SENSOR_ID_REG, &pid); - if (ret != 0) { - SENSOR_TR("read chip id failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - SENSOR_DG("\n %s pid = 0x%x \n", SENSOR_NAME_STRING(), pid); -#else - pid = SENSOR_ID; -#endif - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - sensor->info_priv.winseqe_cur_addr = SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - - #endif - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} - -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - //sensor_task_lock(client, 1); - sensor_ioctrl(icd, Sensor_PowerDown, 1); - msleep(100); - - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - - return 0; -} - -static struct reginfo sensor_suspend_sequence[]= -{ - {0x0028, 0x7000}, - {0x002A, setot_usForceClocksSettings}, - {0x0F12, 0x001E}, - {0x002A, setot_usConfigClocksSettings}, - {0x0F12, 0x001E}, - {0x002A, REG_TC_GP_EnablePreview}, - {0x0F12, 0x0000}, - {0x002A, REG_TC_GP_EnablePreviewChanged}, - {0x0F12, 0x0001}, - {SEQUENCE_WAIT_MS, 100}, - {0x0028, 0xD000}, - {0x002A, 0xB0B0}, - {0x0F12, 0x0001}, - {SEQUENCE_WAIT_MS, 100}, - {0x002A, 0xB0B4}, - {0x0F12, 0x0000}, - {0x002A, 0xB0A0}, - {0x0F12, 0x0031}, - {0x002A, 0xB0A0}, - {0x0F12, 0x0010}, - {0x002A, 0xB0A0}, - {0x0F12, 0x0000}, - {0x0028, 0x7000}, - {0x002A, REG_TC_GP_SleepMode}, - {0x0F12, 0x0001}, - {0x002A, REG_TC_GP_SleepModeChanged}, - {0x0F12, 0x0001}, - - {SEQUENCE_END,0x00} -}; - -static struct reginfo sensor_resume_sequence[]= -{ - {0x0028, 0x7000}, - {0x002A, REG_TC_GP_SleepMode}, - {0x0F12, 0x0000}, - {0x002A, REG_TC_GP_SleepModeChanged}, - {0x0F12, 0x0001}, - {0x0028, 0xD000}, - {0x002A, 0x1000}, - {0x0F12, 0x0001}, - {0x002A, 0x003A}, - {0x0F12, 0x0000}, - {SEQUENCE_WAIT_MS, 200}, - {0x002A, 0xB0B0}, - {0x0F12, 0x0000}, - {0x002A, 0xB0A0}, - {0x0F12, 0x003B}, - {0x002A, 0xB0B4}, - {0x0F12, 0x0800}, - {SEQUENCE_WAIT_MS, 10}, - {0x0028, 0x7000}, - {0x002A, REG_TC_GP_EnablePreview}, - {0x0F12, 0x0001}, - {0x002A, REG_TC_GP_EnablePreviewChanged}, - {0x0F12, 0x0001}, - - {SEQUENCE_END,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_suspend_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - mdelay(100); - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } else { - udelay(5); - ret = sensor_write_array(client, sensor_resume_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return -EINVAL; - } - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - - return 0; -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -#if 0 -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -#endif -static struct reginfo* sensor_fmt_catch(int set_w, int set_h, int *ret_w, int *ret_h) -{ - struct reginfo *winseqe_set_addr = NULL; - - if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qcif; - *ret_w = 176; - *ret_h = 144; - } else if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qvga; - *ret_w = 320; - *ret_h = 240; - } else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_cif; - *ret_w = 352; - *ret_h = 288; - } else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_vga; - *ret_w = 640; - *ret_h = 480; - } -#if CONFIG_SENSOR_FOR_CTS - /**lzg@rockchip.com: forbid to preview with resolution 1280*1024*/ - else if (((set_w <= 800) && (set_h <= 600)) && (sensor_vga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_vga; - *ret_w = 640; - *ret_h = 480; - } -#else - else if (((set_w <= 800) && (set_h <= 600)) && (sensor_svga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_svga; - *ret_w = 800; - *ret_h = 600; - } -#endif - else if (((set_w <= 1024) && (set_h <= 768)) && (sensor_xga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_xga; - *ret_w = 1024; - *ret_h = 768; - } else if (((set_w <= 1280) && (set_h <= 720)) && (sensor_720p[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_720p; - *ret_w = 1280; - *ret_h = 720; - } else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_sxga; - *ret_w = 1280; - *ret_h = 1024; - } else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_uxga; - *ret_w = 1600; - *ret_h = 1200; - } -#if CONFIG_SENSOR_FOR_CTS - /**lzg@rockchip.com: forbid to preview with resolution 1280*1024*/ - else if (((set_w <= 1920) && (set_h <= 1080)) && (sensor_vga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_vga; - *ret_w = 640; - *ret_h = 480; - } -#else - else if (((set_w <= 1920) && (set_h <= 1080)) && (sensor_1080p[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_1080p; - *ret_w = 1920; - *ret_h = 1080; - } -#endif - else if (((set_w <= 2048) && (set_h <= 1536)) && (sensor_qxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qxga; - *ret_w = 2048; - *ret_h = 1536; - } else if (((set_w <= 2592) && (set_h <= 1944)) && (sensor_qsxga[0].reg!=SEQUENCE_END)) { - winseqe_set_addr = sensor_qsxga; - *ret_w = 2592; - *ret_h = 1944; - } - - return winseqe_set_addr; -} - -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct sensor *sensor = to_sensor(client); - struct reginfo *winseqe_set_addr=NULL; - int ret=0, set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - winseqe_set_addr = sensor_fmt_catch(set_w, set_h, &set_w, &set_h); - - if ((winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) && winseqe_set_addr) { - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - } else { /* ddl@rock-chips.com : Video */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - } - #endif - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - - sensor->info_priv.winseqe_cur_addr = (struct reginfo*)winseqe_set_addr; - - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } else { - SENSOR_TR("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; - -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - mf->colorspace = fmt->colorspace; - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return s5k6aa identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((*value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value > 0) && ((digitalzoom_cur + *value) > digitalzoom_total)) - { - *value = digitalzoom_total - digitalzoom_cur; - } - - if ((*value < 0) && ((digitalzoom_cur + *value) < 0)) - { - *value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += *value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, *value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - //struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} -static int sensor_s_stream(struct v4l2_subdev *sd, int enable) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - - if (enable == 1) { - sensor->info_priv.enable = 1; - } else if (enable == 0) { - sensor->info_priv.enable = 0; - } - - return 0; -} -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - int ret,pid = 0; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - - /* soft reset */ -#if (SENSOR_RESET_REG != SEQUENCE_END) - ret = sensor_write(client, SENSOR_RESET_REG, SENSOR_RESET_VAL); - if (ret != 0) { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - mdelay(5); //delay 5 microseconds -#endif - - /* check if it is an sensor sensor */ -#if (SENSOR_ID_REG != SEQUENCE_END) - ret = sensor_read(client, SENSOR_ID_REG, &pid); - if (ret != 0) { - SENSOR_TR("read chip id failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - SENSOR_DG("\n %s pid = 0x%x \n", SENSOR_NAME_STRING(), pid); -#else - pid = SENSOR_ID; -#endif - - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - - return ret; -} -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0; -#if CONFIG_SENSOR_Flash - int i; -#endif - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - if (sensor->sensor_io_request->gpio_res[0].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[0].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[0]; - } else if (sensor->sensor_io_request->gpio_res[1].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[1].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[1]; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, - .s_stream = sensor_s_stream, -}; -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - sensor->info_priv.fmt = sensor_colour_fmts[0]; - - ret = sensor_video_probe(icd, client); - if (ret) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - diff --git a/drivers/media/video/s5k6aa.h b/drivers/media/video/s5k6aa.h deleted file mode 100644 index 5bf5e4f4220f..000000000000 --- a/drivers/media/video/s5k6aa.h +++ /dev/null @@ -1,243 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __S5K6AA_H__ -#define __S5K6AA_H__ - -struct reginfo -{ - u16 reg; - u16 val; -}; - -/* General purpose section */ -#define REG_TC_GP_SpecialEffects 0x01EE -#define REG_TC_GP_EnablePreview 0x01F0 -#define REG_TC_GP_EnablePreviewChanged 0x01F2 -#define REG_TC_GP_EnableCapture 0x01F4 -#define REG_TC_GP_EnableCaptureChanged 0x01F6 -#define REG_TC_GP_NewConfigSync 0x01F8 -#define REG_TC_GP_PrevReqInputWidth 0x01FA -#define REG_TC_GP_PrevReqInputHeight 0x01FC -#define REG_TC_GP_PrevInputWidthOfs 0x01FE -#define REG_TC_GP_PrevInputHeightOfs 0x0200 -#define REG_TC_GP_CapReqInputWidth 0x0202 -#define REG_TC_GP_CapReqInputHeight 0x0204 -#define REG_TC_GP_CapInputWidthOfs 0x0206 -#define REG_TC_GP_CapInputHeightOfs 0x0208 -#define REG_TC_GP_PrevZoomReqInputWidth 0x020A -#define REG_TC_GP_PrevZoomReqInputHeight 0x020C -#define REG_TC_GP_PrevZoomReqInputWidthOfs 0x020E -#define REG_TC_GP_PrevZoomReqInputHeightOfs 0x0210 -#define REG_TC_GP_CapZoomReqInputWidth 0x0212 -#define REG_TC_GP_CapZoomReqInputHeight 0x0214 -#define REG_TC_GP_CapZoomReqInputWidthOfs 0x0216 -#define REG_TC_GP_CapZoomReqInputHeightOfs 0x0218 -#define REG_TC_GP_InputsChangeRequest 0x021A -#define REG_TC_GP_ActivePrevConfig 0x021C -#define REG_TC_GP_PrevConfigChanged 0x021E -#define REG_TC_GP_PrevOpenAfterChange 0x0220 -#define REG_TC_GP_ErrorPrevConfig 0x0222 -#define REG_TC_GP_ActiveCapConfig 0x0224 -#define REG_TC_GP_CapConfigChanged 0x0226 -#define REG_TC_GP_ErrorCapConfig 0x0228 -#define REG_TC_GP_PrevConfigBypassChanged 0x022A -#define REG_TC_GP_CapConfigBypassChanged 0x022C -#define REG_TC_GP_SleepMode 0x022E -#define REG_TC_GP_SleepModeChanged 0x0230 -#define REG_TC_GP_SRA_AddLow 0x0232 -#define REG_TC_GP_SRA_AddHigh 0x0234 -#define REG_TC_GP_SRA_AccessType 0x0236 -#define REG_TC_GP_SRA_Changed 0x0238 -#define REG_TC_GP_PrevMinFrTimeMsecMult10 0x023A -#define REG_TC_GP_PrevOutKHzRate 0x023C -#define REG_TC_GP_CapMinFrTimeMsecMult10 0x023E -#define REG_TC_GP_CapOutKHzRate 0x0240 - -/* Image property control section */ -#define REG_TC_UserBrightness 0x01E4 -#define REG_TC_UserContrast 0x01E6 -#define REG_TC_UserSaturation 0x01E8 -#define REG_TC_UserSharpBlur 0x01EA -#define REG_TC_UserGlamour 0x01EC - -/* Flash control section */ -#define REG_TC_FLS_Mode 0x03B6 -#define REG_TC_FLS_Threshold 0x03B8 -#define REG_TC_FLS_Polarity 0x03BA -#define REG_TC_FLS_XenonMode 0x03BC -#define REG_TC_FLS_XenonPreFlashCnt 0x03BE - -/* Extended image property control section */ -#define REG_SF_USER_LeiLow 0x03C0 -#define REG_SF_USER_LeiHigh 0x03C2 -#define REG_SF_USER_LeiChanged 0x03C4 -#define REG_SF_USER_Exposure 0x03C6 -#define REG_SF_USER_ExposureChanged 0x03CA -#define REG_SF_USER_TotalGain 0x03CC -#define REG_SF_USER_TotalGainChanged 0x03CE -#define REG_SF_USER_Rgain 0x03D0 -#define REG_SF_USER_RgainChanged 0x03D2 -#define REG_SF_USER_Ggain 0x03D4 -#define REG_SF_USER_GgainChanged 0x03D6 -#define REG_SF_USER_Bgain 0x03D8 -#define REG_SF_USER_BgainChanged 0x03DA -#define REG_SF_USER_FlickerQuant 0x03DC -#define REG_SF_USER_FlickerQuantChanged 0x03DE -#define REG_SF_USER_GASRAlphaVal 0x03E0 -#define REG_SF_USER_GASRAlphaChanged 0x03E2 -#define REG_SF_USER_GASGAlphaVal 0x03E4 -#define REG_SF_USER_GASGAlphaChanged 0x03E6 -#define REG_SF_USER_GASBAlphaVal 0x03E8 -#define REG_SF_USER_GASBAlphaChanged 0x03EA -#define REG_SF_USER_DbgIdx 0x03EC -#define REG_SF_USER_DbgVal 0x03EE -#define REG_SF_USER_DbgChanged 0x03F0 -#define REG_SF_USER_aGain 0x03F2 -#define REG_SF_USER_aGainChanged 0x03F4 -#define REG_SF_USER_dGain 0x03F6 -#define REG_SF_USER_dGainChanged 0x03F8 - -/* Output interface control section */ -#define REG_TC_OIF_EnMipiLanes 0x03FA -#define REG_TC_OIF_EnPackets 0x03FC -#define REG_TC_OIF_CfgChanged 0x03FE - -/* Debug control section */ -#define REG_TC_DBG_AutoAlgEnBits 0x0400 -#define REG_TC_DBG_IspBypass 0x0402 -#define REG_TC_DBG_ReInitCmd 0x0404 - -/* Version information section */ -#define REG_FWdate 0x012C -#define REG_FWapiVer 0x012E -#define REG_FWrevision 0x0130 -#define REG_FWpid 0x0132 -#define REG_FWprjName 0x0134 -#define REG_FWcompDate 0x0140 -#define REG_FWSFC_VER 0x014C -#define REG_FWTC_VER 0x014E -#define REG_FWrealImageLine 0x0150 -#define REG_FWsenId 0x0152 -#define REG_FWusDevIdQaVersion 0x0154 -#define REG_FWusFwCompilationBits 0x0156 -#define REG_ulSVNrevision 0x0158 -#define REG_SVNpathRomAddress 0x015C -#define REG_TRAP_N_PATCH_START_ADD 0x1B00 - -#define setot_usForceClocksSettings 0x0AEA -#define setot_usConfigClocksSettings 0x0AEC - -#define REG_0TC_CCFG_uCaptureMode 0x030C -#define REG_0TC_CCFG_usWidth 0x030E -#define REG_0TC_CCFG_usHeight 0x0310 -#define REG_0TC_CCFG_Format 0x0312 -#define REG_0TC_CCFG_usMaxOut4KHzRate 0x0314 -#define REG_0TC_CCFG_usMinOut4KHzRate 0x0316 -#define REG_0TC_CCFG_PVIMask 0x0318 -#define REG_0TC_CCFG_uClockInd 0x031A -#define REG_0TC_CCFG_usFrTimeType 0x031C -#define REG_0TC_CCFG_FrRateQualityType 0x031E -#define REG_0TC_CCFG_usMaxFrTimeMsecMult10 0x0320 -#define REG_0TC_CCFG_usMinFrTimeMsecMult10 0x0322 -#define lt_uMaxAnGain2 0x049A -#define REG_TC_GP_ActivePrevConfig 0x021C -#define REG_TC_GP_PrevOpenAfterChange 0x0220 -#define REG_TC_GP_NewConfigSync 0x01F8 -#define REG_TC_GP_PrevConfigChanged 0x021E -#define REG_TC_GP_ActiveCapConfig 0x0224 -#define REG_TC_GP_CapConfigChanged 0x0226 -#define REG_TC_GP_EnableCapture 0x01F4 -#define REG_TC_GP_EnableCaptureChanged 0x01F6 - -#define lt_uMaxExp1 0x0488 // 0x9C40 -#define lt_uMaxExp2 0x048C // 0xE848 -#define lt_uCapMaxExp1 0x0490 // 0x9C40 -#define lt_uCapMaxExp2 0x0494 // 0xE848 -#define lt_uMaxDigGain 0x049C // 0x0200 -#define lt_uMaxAnGain1 0x0498 // 0x0200 -#define lt_uMaxAnGain2 0x049A // 0x0500 - - -#define REG_1TC_CCFG_uCaptureMode 0x032E // 0x0000 -#define REG_1TC_CCFG_Cfg 0x0330 // 0x0500 -#define REG_1TC_CCFG_usWidth 0x0330 // 0x0500 -#define REG_1TC_CCFG_usHeight 0x0332 // 0x03C0 -#define REG_1TC_CCFG_Format 0x0334 // 0x0009 -#define REG_1TC_CCFG_usMaxOut4KHzRate 0x0336 // 0x1770 -#define REG_1TC_CCFG_usMinOut4KHzRate 0x0338 // 0x05DC -#define REG_1TC_CCFG_PVIMask 0x033A // 0x0042 -#define REG_1TC_CCFG_uClockInd 0x033C // 0x0000 -#define REG_1TC_CCFG_usFrTimeType 0x033E // 0x0000 -#define REG_1TC_CCFG_FrRateQualityType 0x0340 // 0x0002 -#define REG_1TC_CCFG_usMaxFrTimeMsecMult10 0x0342 // 0x1964 -#define REG_1TC_CCFG_usMinFrTimeMsecMult10 0x0344 // 0x0000 -#define REG_1TC_CCFG_sSaturation 0x0346 // 0x0000 -#define REG_1TC_CCFG_sSharpBlur 0x0348 // 0x0000 -#define REG_1TC_CCFG_sGlamour 0x034A // 0x0000 -#define REG_1TC_CCFG_sColorTemp 0x034C // 0x0000 -#define REG_1TC_CCFG_uDeviceGammaIndex 0x034E // 0x0000 -#define REG_CapConfigControls_2_ 0x0350 // 0x0000 - - -#define REG_1TC_PCFG_usWidth 0x0268 -#define REG_1TC_PCFG_usHeight 0x026A -#define REG_1TC_PCFG_Format 0x026C -#define REG_1TC_PCFG_usMaxOut4KHzRate 0x026E -#define REG_1TC_PCFG_usMinOut4KHzRate 0x0270 -#define REG_1TC_PCFG_PVIMask 0x0272 -#define REG_1TC_PCFG_uClockInd 0x0274 -#define REG_1TC_PCFG_usFrTimeType 0x0276 -#define REG_1TC_PCFG_FrRateQualityType 0x0278 -#define REG_1TC_PCFG_usMaxFrTimeMsecMult10 0x027A -#define REG_1TC_PCFG_usMinFrTimeMsecMult10 0x027C - -#define AFC_Default60Hz 0x0B2A -#define REG_TC_DBG_AutoAlgEnBits 0x0400 -#define REG_SF_USER_FlickerQuant 0x03DC -#define REG_SF_USER_FlickerQuantChanged 0x03DE - - -#define REG_2TC_PCFG_usWidth 0x028E -#define REG_2TC_PCFG_usHeight 0x0290 -#define REG_2TC_PCFG_Format 0x0292 -#define REG_2TC_PCFG_usMaxOut4KHzRate 0x0294 -#define REG_2TC_PCFG_usMinOut4KHzRate 0x0296 -#define REG_2TC_PCFG_PVIMask 0x0298 -#define REG_2TC_PCFG_uClockInd 0x029A -#define REG_2TC_PCFG_usFrTimeType 0x029C -#define REG_2TC_PCFG_FrRateQualityType 0x029E -#define REG_2TC_PCFG_usMaxFrTimeMsecMult10 0x02A0 -#define REG_2TC_PCFG_usMinFrTimeMsecMult10 0x02A2 - -#define REG_3TC_PCFG_usWidth 0x02B4 -#define REG_3TC_PCFG_usHeight 0x02B6 -#define REG_3TC_PCFG_Format 0x02B8 -#define REG_3TC_PCFG_usMaxOut4KHzRate 0x02BA -#define REG_3TC_PCFG_usMinOut4KHzRate 0x02BC -#define REG_3TC_PCFG_PVIMask 0x02BE -#define REG_3TC_PCFG_uClockInd 0x02C0 -#define REG_3TC_PCFG_usFrTimeType 0x02C2 -#define REG_3TC_PCFG_FrRateQualityType 0x02C4 -#define REG_3TC_PCFG_usMaxFrTimeMsecMult10 0x02C6 -#define REG_3TC_PCFG_usMinFrTimeMsecMult10 0x02C8 - -#define SEQUENCE_INIT 0x00 -#define SEQUENCE_NORMAL 0x01 -#define SEQUENCE_CAPTURE 0x02 -#define SEQUENCE_PREVIEW 0x03 - -#define SEQUENCE_PROPERTY 0xFFF9 -#define SEQUENCE_WAIT_MS 0xFFFA -#define SEQUENCE_WAIT_US 0xFFFB -#define SEQUENCE_END (0xFFFF) -#define SEQUENCE_FAST_SETMODE_START (0xFFFD) -#define SEQUENCE_FAST_SETMODE_END (0xFFFC) - - -/*configure register for flipe and mirror during initial*/ -#define CONFIG_SENSOR_FLIPE 0 -#define CONFIG_SENSOR_MIRROR 1 -#define CONFIG_SENSOR_MIRROR_AND_FLIPE 0 -#define CONFIG_SENSOR_NONE_FLIP_MIRROR 0 -/**configure to indicate android cts****/ -#define CONFIG_SENSOR_FOR_CTS 1 -#endif \ No newline at end of file diff --git a/drivers/media/video/sid130B.c b/drivers/media/video/sid130B.c deleted file mode 100755 index a022859546cf..000000000000 --- a/drivers/media/video/sid130B.c +++ /dev/null @@ -1,3889 +0,0 @@ -/* -o* Driver for MT9M001 CMOS Image Sensor from Micron - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME sid130B -#define SENSOR_V4L2_IDENT V4L2_IDENT_SID130B -#define SENSOR_ID 0x1B -#define SENSOR_MIN_WIDTH 176 -#define SENSOR_MIN_HEIGHT 144 -#define SENSOR_MAX_WIDTH 1600 -#define SENSOR_MAX_HEIGHT 1200 -#define SENSOR_INIT_WIDTH 800 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 600 -#define SENSOR_INIT_WINSEQADR sensor_svga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_UYVY8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 0 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 1 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 - -#define CONFIG_SENSOR_I2C_SPEED 80000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW|\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) - -struct reginfo -{ - u8 reg; - u8 val; -}; - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); - -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_SID130B_USER_DEFINED_SERIES -#include "sid130B_user_series.c" -#else -/* init 352X288 SVGA */ -static struct reginfo sensor_init_data[] = -{ -#if 0 - {0x00, 0x00}, - {0x04, 0x00}, //Group A 0x10 - {0x05, 0x0F}, //UXGA Output - {0x06, 0x86}, - {0x07, 0x08}, - - - {0x08, 0xa2}, //PLL off - {0x09, 0x12}, - {0x0A, 0x12}, - {0x10, 0x17}, - {0x11, 0x01}, - {0x12, 0x8A}, - {0x13, 0x1a}, - {0x14, 0x27}, - {0x15, 0x22}, - - {0x17, 0xCb}, - {0x18, 0x38}, - - {0x40, 0x0f}, - {0x41, 0x17}, - {0x42, 0x52}, - {0x43, 0x80}, - {0x44, 0x00}, - {0x45, 0x00}, - -//Flicker - 50Hz - Still mode , - {0x00, 0x00}, - {0x20, 0x00}, - {0x21, 0x02}, - {0x23, 0x29},//15}, - {0x00, 0x01}, - {0x35, 0x50},//3c}, - -//Flicker - 50Hz - Preview mode 24MHz MCLK - {0x00, 0x00}, - {0x24, 0x00}, - {0x25, 0xe6},//10}, - {0x27, 0x0d},//4b}, - {0x00, 0x01}, - {0x34, 0x80},//64}, - - -//AE Block - {0x00, 0x01}, - {0x10, 0x00}, - {0x11, 0x0a}, //.0c - {0x12, 0x78}, - {0x13, 0x78}, - {0x14, 0x78}, - {0x17, 0xC4}, - {0x1c, 0x05}, - - {0x36, 0x28}, //26 - - {0x40, 0x40}, //Max Again //anyuan - //{0x41, 0x20}, - //{0x42, 0x20}, - //{0x43, 0x00}, - //{0x44, 0x00}, - //{0x45, 0x01}, - //{0x46, 0x1c}, - //{0x47, 0x11}, - //{0x48, 0x15}, - //{0x49, 0x17}, - //{0x4A, 0x1a}, - //{0x4B, 0x1c}, - //{0x4C, 0x1e}, - //{0x4D, 0x1e}, - //{0x4E, 0x0f}, - //{0x4F, 0x09}, - //{0x50, 0x07}, - //{0x51, 0x05}, - //{0x52, 0x04}, - //{0x53, 0x03}, - //{0x54, 0x02}, - //{0x55, 0x01}, - //{0x66, 0x00}, - //{0x67, 0x00}, - //{0x68, 0x00}, - //{0x69, 0x00}, - //{0x6a, 0x00}, - //{0x6b, 0x00}, - - {0x70, 0xc4}, - {0x73, 0x22}, - {0x74, 0x07}, - {0x77, 0xd0}, - {0x78, 0xd8}, - {0x79, 0x70}, - // - {0x90, 0x00}, - {0x92, 0x0c}, //0bank 0x11 °ú µ¿ÀÏ - {0x95, 0x40}, //0 bank 0x40 °ú µ¿ÀÏ - //AWB Block - - {0x00, 0x02}, - {0x10, 0xD3}, - {0x11, 0x11}, - {0x13, 0x7e}, - {0x14, 0x7c}, - {0x15, 0xee}, - {0x16, 0x80}, - {0x17, 0xd0}, - {0x18, 0x80}, - {0x19, 0x98}, - {0x1A, 0x68}, - {0x1B, 0x98}, - {0x1C, 0x68}, - {0x1D, 0x90}, - {0x1E, 0x74}, - {0x20, 0xF0}, - {0x21, 0x85}, - {0x22, 0xB4}, - {0x23, 0x20}, - {0x25, 0x20}, - {0x26, 0x05}, - {0x27, 0x78}, - {0x28, 0xd8}, - {0x29, 0xb8}, - {0x2A, 0x88}, - {0x30, 0x00}, - {0x31, 0x10}, - {0x32, 0x00}, - {0x33, 0x10}, - {0x34, 0x06}, - {0x35, 0x30}, - {0x36, 0x04}, - {0x37, 0xA0}, - {0x40, 0x01}, - {0x41, 0x04}, - {0x42, 0x08}, - {0x43, 0x10}, - {0x44, 0x13}, - {0x45, 0x6B}, - {0x46, 0x82}, - - - -//CMA change -D65~A - {0x53, 0xa1}, //AWB R Gain for D30 to D20 - {0x54, 0xc0}, //AWB B Gain for D30 to D20 - {0x55, 0xa1}, //AWB R Gain for D20 to D30 - {0x56, 0xc0}, //AWB B Gain for D20 to D30 - {0x57, 0xc8}, //AWB R Gain for D65 to D30 - {0x58, 0xa0}, //AWB B Gain for D65 to D30 - {0x59, 0xc8}, //AWB R Gain for D30 to D65 - {0x5A, 0xa0}, //AWB B Gain for D30 to D65 - - {0x64, 0x00}, - {0x65, 0x00}, - {0x66, 0x00}, - {0x67, 0x00}, - {0x68, 0xa5}, - {0x69, 0xb4}, - {0x6a, 0xb3}, - {0x6b, 0xac}, - {0x6c, 0xb7}, - {0x6d, 0x98}, - {0x6e, 0xba}, - {0x6f, 0x90}, - - {0x70, 0xbf}, - {0x71, 0x9b}, - {0x72, 0xce}, - {0x73, 0x8c}, - {0x74, 0x7f}, - {0x75, 0x8c}, - {0x76, 0xad}, - {0x77, 0xba}, - {0x78, 0x8f}, - {0x79, 0x9a}, - {0x7A, 0xa3}, - {0x7B, 0xac}, - {0x7C, 0xa0}, - {0x7D, 0xa9}, - {0x7E, 0x95}, - {0x7F, 0xac}, - {0x80, 0xad}, - {0x81, 0xbc}, - {0x82, 0x98}, - {0x83, 0xa4}, - {0x84, 0x00}, - {0x85, 0x00}, - {0x86, 0x00}, - {0x87, 0x00}, - {0x88, 0xc9}, - {0x89, 0xd5}, - {0x8a, 0x70}, - {0x8b, 0x7b}, - {0x8c, 0xd0}, - {0x8d, 0xe5}, - {0x8e, 0x58}, - {0x8f, 0x70}, - - {0xB4, 0x05}, - {0xB5, 0x0F}, - {0xB6, 0x06}, - {0xB7, 0x06}, - {0xB8, 0x40}, - {0xB9, 0x10}, - {0xBA, 0x06}, - -//IDP - {0x00, 0x03}, - {0x10, 0xFF}, - {0x11, 0x1D}, - {0x12, 0x1D}, - {0x13, 0xFF}, - {0x14, 0x00}, - {0x15, 0xc0}, - -//DPC - {0x30, 0x88}, //DPCNRCTRL - {0x31, 0x14}, //DPTHR @ AGAIN = 00 - {0x32, 0x10}, //DPTHR @ AGAIN = 20 - {0x33, 0x0c}, //DPTHR @ AGAIN = 40 - {0x34, 0x08}, //DPTHR @ AGAIN = 60 - {0x35, 0x04}, //DPTHR @ AGAIN = 80 - {0x36, 0x44}, //DPTHVRNG - {0x37, 0x66}, //DPNUMBER - {0x38, 0x00}, //0x00 // NRTHR0 @ AGAIN = 00 - {0x39, 0x04}, //0x0C // NRTHR1 @ AGAIN = 20 - {0x3A, 0x04}, //0x18 // NRTHR2 @ AGAIN = 40 - {0x3B, 0x2c}, //0x30 // NRTHR3 @ AGAIN = 60 - {0x3C, 0x3c}, // NRTHR4 @ AGAIN = 80 - {0x3D, 0x04}, //NRTHVRNG0 @ AGAIN = 00 - {0x3E, 0x04}, //NRTHVRNG1 @ AGAIN = 20 - {0x3F, 0x04}, //NRTHVRNG2 @ AGAIN = 40 - {0x40, 0x2c}, //NRTHVRNG3 @ AGAIN = 60 - {0x41, 0x3c}, //NRTHVRNG4 @ AGAIN = 80 - {0x42, 0xff}, //NRTHVRNGMAX - {0x43, 0x40}, //NRTHRWGT - {0x44, 0x40}, //BASELVL - {0x45, 0x06}, //SHUMAXH - {0x46, 0x40}, //SHUMAXL - {0x47, 0x30}, //ILLUMITHDRK - -// shading - {0x50, 0x0a}, //0x00 - {0x51, 0x20}, //0x45 - {0x52, 0x12}, //0x24 - {0x53, 0x12}, //0x24 - - {0x54, 0x22}, //0x00 - {0x55, 0x18}, //0x40 - {0x56, 0x08}, //0x10 - {0x57, 0x10}, //0x20 - - {0x58, 0x22}, //0x00 - {0x59, 0x18}, //0x40 - {0x5A, 0x08}, //0x10 - {0x5B, 0x10}, //0x20 - - {0x5C, 0x25}, //0x04 - {0x5D, 0x1a}, //0x55 - {0x5E, 0x12}, //0x25 - {0x5F, 0x10}, //0x20 - - {0x60, 0x32}, //0x32 - {0x61, 0x20}, //20// - {0x62, 0x58}, //67 -// {0x63, 0x89 //8c R Center start gain -// {0x66, 0x79 //B Center start gain 73 - {0x6B, 0x00}, //01 //01 - {0x6C, 0x01}, //22 - {0x6D, 0x23}, //22 - {0x6E, 0x55}, //55 - {0x6F, 0x55}, //77 - {0x70, 0x55}, //65 - {0x71, 0x00}, //01 //AB (6) - {0x72, 0x01}, //23 (5) - {0x73, 0x23}, //33 (4) - {0x74, 0x44}, //45 (3) - {0x75, 0x45}, //55 (2) - {0x76, 0x66}, //55 (1) - {0x77, 0x00}, //01 //AB (6) - {0x78, 0x01}, //23 (5) - {0x79, 0x23}, //33 (4) - {0x7A, 0x44}, //45 (3) - {0x7B, 0x45}, //55 (2) - {0x7C, 0x66}, //55 (1) - {0x7D, 0x00}, //00 //00 - {0x7E, 0x00}, //00 //00 - {0x7F, 0x12}, //11 //12 - {0x80, 0x33}, //33 //33 //44 - {0x81, 0x44}, //33 //33 //44 - {0x82, 0x55}, //22 //44 //45 - //{0x83, 0x14}, - //{0x84, 0x0f}, - - {0x94,0x02}, - {0x95,0x80}, - {0x96,0x01}, - {0x97,0xe0}, - -//Interpolation - {0xA0, 0x3F}, - {0xA1, 0x05}, - {0xA2, 0xB7}, - {0xA3, 0xB7}, - {0xA4, 0x04}, - {0xA5, 0xFF}, - {0xA6, 0x04}, - {0xA7, 0xFF}, - {0xA8, 0x00}, - {0xA9, 0x00}, - {0xAA, 0x00}, - {0xAB, 0x00}, - {0xAC, 0x60}, - {0xAD, 0x18}, - {0xAE, 0x10}, - {0xAF, 0x20}, - {0xB0, 0x08}, - {0xB1, 0x00}, - -//Color Matrix for D65 -#if 0 - {0xC0, 0x2F}, // CMASB D20 or D30 or Dark Condition Color Matrix Selection - {0xC1, 0x66}, - {0xC2, 0xd4}, - {0xC3, 0x05}, - {0xC4, 0xf0}, - {0xC5, 0x5a}, - {0xC6, 0xf5}, - {0xC7, 0xf9}, - {0xC8, 0xbf}, - {0xC9, 0x88}, - {0xCA, 0xa0}, - {0xCB, 0x50}, - {0xCC, 0xe2}, - {0xCD, 0x00}, - {0xCE, 0x00}, -#else -{0xC0, 0x2F}, // CMASB D20 or D30 or Dark Condition Color Matrix Selection -{0xC1, 0x71}, -{0xC2, 0xcc}, -{0xC3, 0x01}, -{0xC4, 0xe8}, -{0xC5, 0x68}, -{0xC6, 0xef}, -{0xC7, 0xfa}, -{0xC8, 0xc6}, -{0xC9, 0x7e}, -{0xCA, 0xec}, -{0xCB, 0x67}, -{0xCC, 0x34}, -{0xCD, 0x3a}, -{0xCE, 0x08}, - -#endif -//Color Matrix for CWF - {0xD0, 0x2F}, - {0xD1, 0x66}, - {0xD2, 0xd4}, - {0xD3, 0x05}, - {0xD4, 0xf0}, - {0xD5, 0x5a}, - {0xD6, 0xf5}, - {0xD7, 0xe9}, - {0xD8, 0xbf}, - {0xD9, 0x88}, - {0xDA, 0xa0}, - {0xDB, 0x50}, - {0xDC, 0xe2}, - {0xDD, 0x00}, - {0xDE, 0x00}, - -//Color Matrix for A - {0xE0, 0x2F}, - {0xE1, 0x6e}, - {0xE2, 0xc7}, - {0xE3, 0x0d}, - {0xE4, 0xe3}, - {0xE5, 0x61}, - {0xE6, 0xfa}, - {0xE7, 0xe5}, - {0xE8, 0xcb}, - {0xE9, 0x8e}, - {0xEA, 0xc4}, - {0xEB, 0x04}, - {0xEC, 0xf3}, - {0xED, 0xdd}, - {0xEE, 0x06}, - -//IDP 4 - {0x00, 0x04}, - -//Gamma - r - {0x10, 0x00}, - {0x11, 0x04}, - {0x12, 0x10}, - {0x13, 0x20}, - {0x14, 0x40}, - {0x15, 0x5c}, - {0x16, 0x74}, - {0x17, 0x84}, - {0x18, 0x98}, - {0x19, 0xa4}, - {0x1A, 0xb0}, - {0x1B, 0xc8}, - {0x1C, 0xdc}, - {0x1D, 0xf0}, - {0x1E, 0xf8}, - {0x1F, 0xFF}, - -//Gamma - G - {0x20, 0x00}, - {0x21, 0x04}, - {0x22, 0x10}, - {0x23, 0x20}, - {0x24, 0x40}, - {0x25, 0x5c}, - {0x26, 0x74}, - {0x27, 0x84}, - {0x28, 0x98}, - {0x29, 0xa4}, - {0x2A, 0xb0}, - {0x2B, 0xc8}, - {0x2C, 0xdc}, - {0x2D, 0xf0}, - {0x2E, 0xf8}, - {0x2F, 0xFF}, - -//Gamma - B - {0x30, 0x00}, - {0x31, 0x04}, - {0x32, 0x10}, - {0x33, 0x20}, - {0x34, 0x40}, - {0x35, 0x5c}, - {0x36, 0x74}, - {0x37, 0x84}, - {0x38, 0x98}, - {0x39, 0xa4}, - {0x3A, 0xb0}, - {0x3B, 0xc8}, - {0x3C, 0xdc}, - {0x3D, 0xf0}, - {0x3E, 0xf8}, - {0x3F, 0xFF}, - -//DARK GAMMA - {0x40, 0x00}, - {0x41, 0x0b}, - {0x42, 0x15}, - {0x43, 0x29}, - {0x44, 0x47}, - {0x45, 0x5D}, - {0x46, 0x72}, - {0x47, 0x83}, - {0x48, 0x92}, - {0x49, 0xA0}, - {0x4A, 0xac}, - {0x4B, 0xc6}, - {0x4C, 0xdA}, - {0x4D, 0xeC}, - {0x4E, 0xf6}, - {0x4F, 0xFF}, - - {0x50, 0x00}, //DARK GAMMA on/off - -//CSC - {0x60, 0x33}, - {0x61, 0x20}, - {0x62, 0xE4}, - {0x63, 0xFA}, - {0x64, 0x13}, - {0x65, 0x25}, - {0x66, 0x07}, - {0x67, 0xF5}, - {0x68, 0xEA}, - {0x69, 0x20}, - {0x6A, 0xC8}, - {0x6B, 0xC4}, - {0x6C, 0x84}, - {0x6D, 0x04}, - {0x6E, 0x0C}, - {0x6F, 0x00}, - -//Edge -// {0x70, 0x00}, -// {0x71, 0x18}, -// {0x72, 0x18}, -// {0x73, 0x04}, -// {0x74, 0x08}, -// {0x76, 0x20}, -// {0x77, 0x04}, -// {0x78, 0x08}, -// {0x7a, 0x20}, -// {0x7d, 0x08}, -// {0X7e, 0x30}, - - {0x80, 0x22}, - {0x81, 0x14}, - {0x82, 0x14}, - {0x83, 0x04}, - {0x84, 0x06}, - {0x85, 0x06}, - {0x87, 0x04}, - {0x88, 0x10}, - {0x89, 0x06}, - {0X90, 0x06}, - {0x91, 0x03}, - {0x93, 0xe0}, - -//Cr/Cb Coring - {0x94, 0x00}, - {0x95, 0x00}, - {0x96, 0x4C}, - {0x97, 0x76}, - {0x9A, 0xf5}, - - {0xA1, 0x08}, //@ 0 - {0xA2, 0x10}, //@ 20 - {0xA3, 0x16}, //@ 40 - {0xA4, 0x20}, //@ 60 - {0xA5, 0x30}, //@ 80 - {0xA6, 0xa0}, - {0xA7, 0x06}, - {0xA8, 0x40}, - - {0xA9, 0x38}, - {0xAa, 0x35}, - - {0xAc, 0xff}, - {0xAd, 0x09}, - {0xAe, 0x96}, - {0xAf, 0x18}, - - {0xB2, 0x38}, //color suppression start - {0xB3, 0x53}, - {0xB6, 0x00}, - -//Color Saturation - {0xBC, 0x10}, - {0xBD, 0x10}, - {0xBE, 0x10}, - {0xBF, 0x10}, - {0xc0, 0x10}, - {0xc1, 0x10}, - {0xc2, 0x10}, - {0xc3, 0x10}, - {0xc4, 0x10}, - {0xc5, 0x10}, - - {0xcc, 0x04}, - {0xcd, 0x40}, - {0xce, 0x00}, - -//IDP 3 - {0x00, 0x05}, - -//Memory - {0x40, 0x15}, - {0x41, 0x28}, - {0x42, 0x04}, - {0x43, 0x15}, - {0x44, 0x28}, - {0x45, 0x04}, - {0x46, 0x15}, - {0x47, 0x28}, - {0x48, 0x04}, - -//Knee - {0x90, 0xca}, // - {0x91, 0x81}, //knee function selection/knee point H - {0x92, 0x00}, //knee point L - {0x93, 0x50}, //Knee gain - {0x94, 0x41}, //[6:4]knee start H/[2:0]Knee END H - {0x95, 0x7e}, //knee start L - {0x96, 0x48}, //knee END L - -//ADG - {0x99, 0xC0}, - {0xA0, 0x10}, - {0xA1, 0x22}, - {0xA2, 0x36}, - {0xA3, 0x49}, - {0xA4, 0x5D}, - {0xA5, 0x70}, - {0xA6, 0x82}, - {0xA7, 0x94}, - {0xA8, 0xA5}, - {0xA9, 0xB5}, - {0xAA, 0xC3}, - {0xAB, 0xD1}, - {0xAC, 0xDE}, - {0xAD, 0xEA}, - {0xAE, 0xF5}, - {0xAF, 0xFF}, - -//YXGMA - {0xB0, 0xc0}, //YGMACTRL - {0xB1, 0x04}, //YGMASLOP - {0xB8, 0x0f}, //DRKTHR1 - {0xB9, 0x10}, //DRKTHR2 - //{0xBA, 0x38}, //DRKTHR3 - //{0xBB, 0x39}, //DRKTHR4 - {0xC0, 0x03}, - {0xC1, 0x0E}, - {0xC2, 0x16}, - {0xC3, 0x24}, - {0xC4, 0x3F}, - {0xC5, 0x56}, - {0xC6, 0x6A}, - {0xC7, 0x7C}, - {0xC8, 0x8C}, - {0xC9, 0x98}, - {0xCA, 0xA2}, - {0xCB, 0xB8}, - {0xCC, 0xCD}, - {0xCD, 0xE2}, - {0xCE, 0xF0}, - {0xCF, 0xFF}, - - -// edge value adjustment - {0xe0, 0x81}, - {0xe1, 0x83}, - {0xe2, 0x07}, - {0xe3, 0x0c}, - {0xe4, 0x14}, - {0xe5, 0x1c}, - - -//Sensor on - {0x00, 0x00}, - {0x03, 0xc5}, - {0x00, 0x01}, - {0x10, 0x84}, - {0x00, 0x02}, - {0x10, 0xd3}, - {0xff, 0xff}, -#else - - {0x00, 0x00}, - {0x04, 0x00}, //Group A 0x10 - {0x05, 0x0F}, //UXGA Output - {0x06, 0x86}, - {0x07, 0x08}, - - - {0x08, 0xa2}, //PLL on - {0x09, 0x12}, - {0x0A, 0x12}, - {0x10, 0x13},//17}, - {0x11, 0x01}, - {0x12, 0x8A}, - - {0x13, 0x1a},//16}, - {0x15, 0x22},//16}, - {0x14, 0x27},//16}, - {0x17, 0xcb},//CF}, - {0x18, 0x38},//34}, - {0x41, 0x17}, - {0x42, 0x52}, - - //Flicker - 50Hz - Still mode - {0x00, 0x00}, - {0x20, 0x00}, - {0x21, 0x02}, - {0x23, 0x29},//15}, - {0x00, 0x01}, - {0x35, 0x50},//3c}, - - //Flicker - 50Hz - Preview mode 24MHz MCLK - {0x00, 0x00}, - {0x24, 0x00}, - {0x25, 0xe6},//10}, - {0x27, 0x0d},//4b}, - {0x00, 0x01}, - {0x34, 0x80},//64}, - - //AE Block - {0x00, 0x01}, - {0x10, 0x80}, - {0x11, 0x0A}, - {0x12, 0x74}, - {0x13, 0x74}, - {0x14, 0x70}, - {0x17, 0xC4}, - {0x1c, 0x02}, - - {0x19, 0x00},//0x - {0x1A, 0x00},//0x - {0x1c, 0x02}, - - {0x36, 0x26}, - - {0x40, 0x40}, //M -#if 0 - {0x41, 0x28}, - {0x42, 0x28}, - {0x43, 0x08}, - {0x44, 0x08}, - {0x45, 0x09}, - {0x46, 0x17}, - {0x47, 0x1D}, - {0x48, 0x21}, - {0x49, 0x23}, - {0x4A, 0x24}, - {0x4B, 0x26}, - {0x4C, 0x27}, - {0x4D, 0x27}, - {0x4E, 0x1A}, - {0x4F, 0x14}, - {0x50, 0x11}, - {0x51, 0x0F}, - {0x52, 0x0D}, - {0x53, 0x0C}, - {0x54, 0x0A}, - {0x55, 0x09}, -#else - {0x41, 0x20}, - {0x42, 0x20}, - {0x43, 0x00}, - {0x44, 0x00}, - {0x45, 0x01}, - {0x46, 0x0c}, - {0x47, 0x11}, - {0x48, 0x15}, - {0x49, 0x17}, - {0x4A, 0x1a}, - {0x4B, 0x1c}, - {0x4C, 0x1e}, - {0x4D, 0x1e}, - {0x4E, 0x0f}, - {0x4F, 0x09}, - {0x50, 0x07}, - {0x51, 0x05}, - {0x52, 0x04}, - {0x53, 0x03}, - {0x54, 0x02}, - {0x55, 0x01}, - {0x60, 0x7e}, - {0x61, 0xff}, - {0x62, 0xff}, - {0x63, 0xff}, - {0x64, 0xff}, - {0x65, 0x7e}, - {0x66, 0x50}, - {0x67, 0x50}, - {0x68, 0x50}, - {0x69, 0x50}, - {0x6A, 0x50}, - {0x6B, 0x00}, - {0x6C, 0x06}, - {0x9a, 0x80}, - {0x6b, 0x80}, - - -#endif - - //AWB Block - {0x00, 0x02}, - {0x10, 0xD3}, - {0x11, 0x11}, - {0x13, 0x80}, - {0x14, 0x80}, - {0x15, 0xE0},//FE}, - {0x16, 0x88}, - {0x17, 0xD0}, - {0x18, 0x78}, - {0x19, 0x98}, - {0x1A, 0x68}, - {0x1B, 0x8d}, - {0x1C, 0x68}, - {0x1D, 0x8C}, - {0x1E, 0x74}, - {0x20, 0xF0}, - {0x21, 0x70}, - {0x22, 0xa8}, - {0x23, 0x10}, - {0x25, 0x20}, - {0x26, 0x05}, - {0x27, 0x63}, - {0x28, 0x63}, - {0x29, 0xA0}, - {0x2A, 0x89}, - {0x30, 0x00}, - {0x31, 0x10}, - {0x32, 0x00}, - {0x33, 0x10}, - {0x34, 0x06}, - {0x35, 0x30}, - {0x36, 0x04}, - {0x37, 0xA0}, - {0x40, 0x01}, - {0x41, 0x04}, - {0x42, 0x08}, - {0x43, 0x10}, - {0x44, 0x13}, - {0x45, 0x6B}, - {0x46, 0x82}, - {0x52, 0x82}, - - - - //CMA change -D65~A - {0x53, 0x86}, //A - {0x54, 0xA0}, //A - {0x55, 0x88}, //A - {0x56, 0x9F}, //A - {0x57, 0xA5}, //A - {0x58, 0x89}, //A - {0x59, 0xA6}, //A - {0x5A, 0x87}, //A - - {0x64, 0x00}, //T - {0x65, 0x00}, - {0x66, 0x00}, //T - {0x67, 0x00}, - {0x68, 0xA5}, //T - {0x69, 0xB4}, - {0x6A, 0xB3}, //T - {0x6B, 0xAC}, - {0x6C, 0xB7}, //T - {0x6D, 0x98}, - {0x6E, 0xBA}, //T - {0x6F, 0x90}, - {0x70, 0xBF}, //T - {0x71, 0x9B}, - {0x72, 0xCE}, //T - {0x73, 0x8C}, - - - //IDP - - - {0x74, 0x7F}, //T - {0x75, 0x8C}, //T - {0x76, 0xAD}, //T - {0x77, 0xBA}, //T - {0x78, 0x8F}, //T - {0x79, 0x9A}, //T - {0x7A, 0xA3}, //T - {0x7B, 0xAC}, //T - {0x7C, 0xA0}, //T - {0x7D, 0xA9}, //T - {0x7E, 0x95}, //T - {0x7F, 0xAC}, //T - {0x80, 0xAD}, //T - {0x81, 0xBC}, //T - {0x82, 0x98}, //T - {0x83, 0xA4}, //T - {0x84, 0x00}, //T - {0x85, 0x00}, //T - {0x86, 0x00}, //T - {0x87, 0x00}, //T - {0x88, 0xC9}, //T - {0x89, 0xD5}, //T - {0x8A, 0x70}, //T - {0x8B, 0x7B}, //T - {0x8C, 0xD0}, //T - {0x8D, 0xE5}, //T - {0x8E, 0x58}, //T - {0x8F, 0x70}, //T - - {0xB4, 0x05}, - {0xB5, 0x0F}, - {0xB6, 0x06}, - {0xB7, 0x06}, - {0xB8, 0x40}, - {0xB9, 0x10}, - {0xBA, 0x06}, - - //IDP - {0x00, 0x03}, - {0x10, 0xFF}, - {0x11, 0x1D}, - {0x12, 0x1D}, - {0x13, 0xFB}, - {0x14, 0x00}, - {0x15, 0xc0}, - - //DPC - {0x30, 0x88}, //D - {0x31, 0x14},//04}, //D - {0x32, 0x10}, //D - {0x33, 0x0C}, //D - {0x34, 0x08}, //D - {0x35, 0x04}, //D - {0x36, 0x44}, //D - {0x37, 0x66}, //D - {0x38, 0x00}, //0 - {0x39, 0x08}, //0 - {0x3A, 0x08}, //0 - {0x3B, 0x20}, //0 - {0x3C, 0x20}, // - {0x3D, 0x04}, //N - {0x3E, 0x08}, //N - {0x3F, 0x10}, //N - {0x40, 0x10}, //N - {0x41, 0x20}, //N - {0x42, 0xFF}, //N - {0x43, 0x40},//F0}, //N - {0x44, 0x40}, //B - {0x45, 0x06},//09}, //S - {0x46, 0x40}, //S - {0x47, 0x30}, //I - - //DPC - #if 0 - //Shading - {0x50, 0x24}, //R - {0x51, 0x44}, //R - {0x52, 0x20}, //R - {0x53, 0x30}, //R - - {0x54, 0x20}, //G - {0x55, 0x20}, //G - {0x56, 0x00}, //G - {0x57, 0x10}, //G - - {0x58, 0x20}, //G - {0x59, 0x20}, //G - {0x5A, 0x00}, //G - {0x5B, 0x10}, //G - - {0x5C, 0x34}, //B - {0x5D, 0x48}, //B - {0x5E, 0x18}, //B - {0x5F, 0x2a}, //B - - {0x60, 0x32}, //# - {0x61, 0x00}, //# - {0x62, 0x67}, //# - - {0x6B, 0x23}, - {0x6C, 0x44}, - {0x6D, 0x45}, - {0x6E, 0x67}, - {0x6F, 0x8a}, - {0x70, 0x89}, - - {0x71, 0x34}, - {0x72, 0x45}, - {0x73, 0x56}, - {0x74, 0x77}, - {0x75, 0x78}, - {0x76, 0x89}, - - {0x77, 0x34}, - {0x78, 0x45}, - {0x79, 0x56}, - {0x7A, 0x77}, - {0x7B, 0x78}, - {0x7C, 0x89}, - - {0x7D, 0x22}, - {0x7E, 0x32}, - {0x7F, 0x34}, - {0x80, 0x45}, - {0x81, 0x56}, - {0x82, 0x67}, - {0x83, 0x1f}, - {0x84, 0x50}, -#endif - - //Shading - {0x50, 0x0b}, //R - {0x51, 0x0b}, //R - {0x52, 0x19}, //R - {0x53, 0x18}, //R - - {0x54, 0x10}, //G - {0x55, 0x00}, //G - {0x56, 0x08}, //G - {0x57, 0x00}, //G - - {0x58, 0x10}, //G - {0x59, 0x00}, //G - {0x5A, 0x08}, //G - {0x5B, 0x00}, //G - - {0x5C, 0x14}, //B - {0x5D, 0x0f}, //B - {0x5E, 0x24}, //B - {0x5F, 0x12}, //B - - {0x60, 0x32}, //# - {0x61, 0x00}, //# - {0x62, 0x67}, //# - - {0x6B, 0x23}, - {0x6C, 0x44}, - {0x6D, 0x44}, - {0x6E, 0x45}, - {0x6F, 0x44}, - {0x70, 0x00}, - - {0x71, 0x23}, - {0x72, 0x44}, - {0x73, 0x55}, - {0x74, 0x55}, - {0x75, 0x55}, - {0x76, 0x00}, - - {0x77, 0x23}, - {0x78, 0x44}, - {0x79, 0x55}, - {0x7A, 0x55}, - {0x7B, 0x55}, - {0x7C, 0x00}, - - {0x7D, 0x23}, - {0x7E, 0x44}, - {0x7F, 0x34}, - {0x80, 0x43}, - {0x81, 0x44}, - {0x82, 0x00}, - {0x83, 0x12}, - {0x84, 0x14}, - - - //Interpolation - {0xA0, 0x2F}, - {0xA1, 0xB7}, - {0xA2, 0xB7}, - {0xA3, 0xB7}, - {0xA4, 0x04}, - {0xA5, 0xFF}, - {0xA6, 0x06}, - {0xA7, 0xFF}, - {0xA8, 0x00}, - {0xA9, 0x00}, - {0xAA, 0x00}, - {0xAB, 0x00}, - {0xAC, 0x60}, - {0xAD, 0x18}, - {0xAE, 0x0c}, - {0xAF, 0x14}, - {0xB0, 0x08}, - {0xB1, 0x00}, - - - //Color Matrix for D65 - {0xC0, 0xAF},// C - {0xC1, 0x66}, - {0xC2, 0xd4}, - {0xC3, 0x06}, - {0xC4, 0xf0}, - {0xC5, 0x5a}, - {0xC6, 0xF6}, - {0xC7, 0xF9}, - {0xC8, 0xbf}, - {0xC9, 0x88}, - {0xCA, 0x00}, - {0xCB, 0x00}, - {0xCC, 0x00}, - {0xCD, 0x00}, - {0xCE, 0x00}, - //Color Matrix for CWF - {0xD0, 0x2F}, - {0xD1, 0x72}, - {0xD2, 0xC9}, - {0xD3, 0x04}, - {0xD4, 0xE3}, - {0xD5, 0x60}, - {0xD6, 0xFC}, - {0xD7, 0xF5}, - {0xD8, 0xb0}, - {0xD9, 0x99}, - {0xDA, 0xC3}, - {0xDB, 0x14}, - {0xDC, 0x3A}, - {0xDD, 0xAD}, - {0xDE, 0x09}, - - //Color Matrix for A - {0xE0, 0x2F}, - {0xE1, 0x5C}, - {0xE2, 0xDD}, - {0xE3, 0x06}, - {0xE4, 0xE0}, - {0xE5, 0x69}, - {0xE6, 0xF6}, - {0xE7, 0xE5}, - {0xE8, 0xAB}, - {0xE9, 0xAE}, - {0xEA, 0x6A}, - {0xEB, 0x01}, - {0xEC, 0x2D}, - {0xED, 0xEE}, - {0xEE, 0x04}, - - //IDP 2 - {0x00, 0x04}, - - //Gamma - R - {0x10, 0x00}, - {0x11, 0x06}, - {0x12, 0x0e}, - {0x13, 0x20}, - {0x14, 0x40}, - {0x15, 0x5e}, - {0x16, 0x74}, - {0x17, 0x87}, - {0x18, 0x98}, - {0x19, 0xa6}, - {0x1A, 0xb3}, - {0x1B, 0xca}, - {0x1C, 0xde}, - {0x1D, 0xf0}, - {0x1E, 0xf8}, - {0x1F, 0xff}, - - - //Gamma - G - {0x20, 0x00}, - {0x21, 0x06}, - {0x22, 0x0e}, - {0x23, 0x20}, - {0x24, 0x40}, - {0x25, 0x5e}, - {0x26, 0x74}, - {0x27, 0x87}, - {0x28, 0x98}, - {0x29, 0xa6}, - {0x2A, 0xb3}, - {0x2B, 0xca}, - {0x2C, 0xde}, - {0x2D, 0xf0}, - {0x2E, 0xf8}, - {0x2F, 0xff}, - - //Gamma - B - {0x30, 0x00}, - {0x31, 0x06}, - {0x32, 0x0e}, - {0x33, 0x20}, - {0x34, 0x40}, - {0x35, 0x5e}, - {0x36, 0x74}, - {0x37, 0x87}, - {0x38, 0x98}, - {0x39, 0xa6}, - {0x3A, 0xb3}, - {0x3B, 0xca}, - {0x3C, 0xde}, - {0x3D, 0xf0}, - {0x3E, 0xf8}, - {0x3F, 0xff}, - - //CSC - {0x60, 0x33}, - {0x61, 0x20}, - {0x62, 0xE4}, - {0x63, 0xFA}, - {0x64, 0x13}, - {0x65, 0x25}, - {0x66, 0x07}, - {0x67, 0xF5}, - {0x68, 0xEA}, - {0x69, 0x20}, - {0x6A, 0xC8}, - {0x6B, 0xC4}, - {0x6C, 0x84}, - {0x6D, 0x04}, - {0x6E, 0x0C}, - {0x6F, 0x00}, - - - //Edge - {0x80, 0xa2}, - {0x81, 0x10}, - {0x82, 0x10}, - {0x83, 0x04}, - {0x84, 0x0a}, - {0x85, 0x06}, - {0x86, 0x00}, - {0x87, 0x04}, - {0x88, 0x0a}, - {0x89, 0x06}, - {0x8a, 0x10}, - {0x8b, 0x30}, - {0x8c, 0x30}, - {0X90, 0x16}, - {0x91, 0x03}, - {0x93, 0xE0}, - - //Cr/Cb Coring - {0x94, 0x00}, - {0x95, 0x00}, - {0x96, 0x4c}, - {0x97, 0x66}, - {0x9A, 0xf5}, - {0xA1, 0x08}, - {0xA2, 0x10}, - {0xA3, 0x16}, - {0xA4, 0x14}, - {0xA5, 0x18}, - {0xA6, 0xa0}, - {0xA7, 0x06}, - {0xA8, 0x40}, - - {0xA9, 0x20}, - {0xAA, 0x28}, - {0xAc, 0xff}, - {0xAd, 0x09}, - {0xAe, 0x18}, - {0xAf, 0x18}, - - {0xB2, 0x24}, - {0xB3, 0x54}, - {0xB6, 0x08}, - - //Color Saturation - {0xBC, 0x10}, - {0xBD, 0x10}, - {0xBE, 0x10}, - {0xBF, 0x10}, - {0xc2, 0x12}, - {0xc3, 0x12}, - - //IDP 3 - {0x00, 0x05}, - - //Memory - {0x40, 0x15}, - {0x41, 0x28}, - {0x42, 0x04}, - {0x43, 0x15}, - {0x44, 0x28}, - {0x45, 0x04}, - {0x46, 0x15}, - {0x47, 0x28}, - {0x48, 0x04}, - - //Knee - {0x90, 0x00}, // - {0x91, 0x00}, //k - {0x92, 0x00}, //k - {0x93, 0x00}, //K - {0x94, 0x00}, //[ - {0x95, 0x00}, //k - {0x96, 0x00}, //k - - //ADG - #if 0 - {0x99, 0xC0}, - {0xA0, 0x10}, - {0xA1, 0x22}, - {0xA2, 0x36}, - {0xA3, 0x49}, - {0xA4, 0x5D}, - {0xA5, 0x70}, - {0xA6, 0x82}, - {0xA7, 0x94}, - {0xA8, 0xA5}, - {0xA9, 0xB5}, - {0xAA, 0xC3}, - {0xAB, 0xD1}, - {0xAC, 0xDE}, - {0xAD, 0xEA}, - {0xAE, 0xF5}, - {0xAF, 0xFF}, - //YXGMA - {0xB0, 0xc0}, //Y - {0xB1, 0x04}, //Y - {0xB8, 0x0f}, //D - {0xB9, 0x10}, //D - //{0xBA, 0x38}, / - //{0xBB, 0x39}, / - {0xC0, 0x03}, - {0xC1, 0x0E}, - {0xC2, 0x16}, - {0xC3, 0x24}, - {0xC4, 0x3F}, - {0xC5, 0x56}, - {0xC6, 0x6A}, - {0xC7, 0x7C}, - {0xC8, 0x8C}, - {0xC9, 0x98}, - {0xCA, 0xA2}, - {0xCB, 0xB8}, - {0xCC, 0xCD}, - {0xCD, 0xE2}, - {0xCE, 0xF0}, - {0xCF, 0xFF}, - #else - {0x99, 0x00}, - {0xA0, 0x00}, - {0xA1, 0x00}, - {0xA2, 0x00}, - {0xA3, 0x00}, - {0xA4, 0x00}, - {0xA5, 0x00}, - {0xA6, 0x00}, - {0xA7, 0x00}, - {0xA8, 0x00}, - {0xA9, 0x00}, - {0xAA, 0x00}, - {0xAB, 0x00}, - {0xAC, 0x00}, - {0xAD, 0x00}, - {0xAE, 0x00}, - {0xAF, 0x00}, - - //YXGMA - {0xB0, 0x00}, //Y - {0xB1, 0x00}, //Y - {0xB8, 0x00}, //D - {0xB9, 0x00}, //D - //{0xBA, 0x38}, / - //{0xBB, 0x39}, / - {0xC0, 0x00}, - {0xC1, 0x00}, - {0xC2, 0x00}, - {0xC3, 0x00}, - {0xC4, 0x00}, - {0xC5, 0x00}, - {0xC6, 0x00}, - {0xC7, 0x00}, - {0xC8, 0x00}, - {0xC9, 0x00}, - {0xCA, 0x00}, - {0xCB, 0x00}, - {0xCC, 0x00}, - {0xCD, 0x00}, - {0xCE, 0x00}, - {0xCF, 0x00}, - {0xe0, 0x01}, - {0xe1, 0x03}, - {0xe2, 0x04}, - {0xe3, 0x0c}, - {0xe4, 0x11}, - {0xe5, 0x16}, - {0xe6, 0x1b}, - {0xe7, 0x24}, - {0xe8, 0x30}, - #endif - //Sensor on - {0x00, 0x00}, - {0x03, 0xc5}, - {0x00, 0x01}, - {0x10, 0x84}, - {0x00, 0x02}, - {0x10, 0xd3}, - {0xff, 0xff}, - - -#endif -}; - -/* 1600X1200 UXGA */ -static struct reginfo sensor_uxga[] = -{ - {0x00,0x00}, - {0x04,0x10}, - {0x05,0x8f}, - {0x00,0x03}, - {0x94,0x06}, - {0x95,0x40}, - {0x96,0x04}, - {0x97,0xb0}, - {0xff, 0xff}, -}; - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {0x00,0x00}, - {0x04,0x10}, - {0x05,0x8b}, - {0x00,0x03}, - {0x94,0x05}, - {0x95,0x00}, - {0x96,0x04}, - {0x97,0x00}, - {0xff, 0xff}, -}; -static struct reginfo sensor_xga[] = -{ - {0xff, 0xff} -}; -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - {0x00,0x03}, - {0x94,0x03}, - {0x95,0x20}, - {0x96,0x02}, - {0x97,0x58}, - {0xff, 0xff} -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ - {0x00,0x00}, - {0x04,0x00}, - {0x05,0x0f}, - {0x00,0x03}, - {0x94,0x02}, //0x02 - {0x95,0x80}, //0x80 - {0x96,0x01},//0x01 - {0x97,0xe0}, //0xe0 - {0xff, 0xff}, -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {0x00,0x03}, - {0x94,0x01}, - {0x95,0x60}, - {0x96,0x01}, - {0x97,0x20}, - {0xff, 0xff}, -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - {0x00,0x03}, - {0x94,0x01}, - {0x95,0x40}, - {0x96,0x00}, - {0x97,0xf0}, - {0xff, 0xff}, -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {0x00,0x03}, - {0x94,0x00}, - {0x95,0xB0}, - {0x96,0x00}, - {0x97,0x90}, - {0xff, 0xff}, -}; -#endif -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {0xff, 0xff} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {0xff, 0xff} -}; - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]={ - {0x00, 0x02}, - {0x10, 0xd3}, - {0xff, 0xff} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0x00, 0x02}, - {0x10, 0x00}, - {0x50, 0xd0}, - {0x51, 0x88}, - {0xff, 0xff} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - {0x00, 0x02}, - {0x10, 0x00}, - {0x50, 0xaa}, - {0x51, 0x90}, - {0xff, 0xff} - -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - {0x00, 0x02}, - {0x10, 0x00}, - {0x50, 0xc2}, - {0x51, 0x9e}, - {0xff, 0xff} -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - {0x00, 0x02}, - {0x10, 0x00}, - {0x50, 0xaa}, - {0x51, 0xbe}, - {0xff, 0xff} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - // Brightness -2 - {0x00, 0x04}, - {0xb6, 0xa0}, - {0xff, 0xff} - -}; - -static struct reginfo sensor_Brightness1[]= -{ - // Brightness -1 - {0x00, 0x04}, - {0xb6, 0x90}, - {0xff, 0xff} - -}; - -static struct reginfo sensor_Brightness2[]= -{ - // Brightness 0 - {0x00, 0x04}, - {0xb6, 0x00}, - {0xff, 0xff} - -}; - -static struct reginfo sensor_Brightness3[]= -{ - // Brightness +1 - {0x00, 0x04}, - {0xb6, 0x10}, - {0xff, 0xff} - -}; - -static struct reginfo sensor_Brightness4[]= -{ - // Brightness +2 - {0x00, 0x04}, - {0xb6, 0x20}, - {0xff, 0xff} - -}; - -static struct reginfo sensor_Brightness5[]= -{ - {0x00, 0x04}, - {0xb6, 0x30}, - {0xff, 0xff} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x00, 0x04}, - {0xd9, 0x00}, - {0xff, 0xff} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {0x00, 0x04}, - {0xd9, 0x40}, - {0x00, 0x00}, - {0xff, 0xff} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x00, 0x04}, - {0xd9, 0x80}, - {0xda, 0x60}, - {0xdb, 0xa0}, - {0xff, 0xff} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - {0x00, 0x04}, - {0xd9, 0x20}, - {0xff, 0xff} -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - // Bluish - {0x00, 0x04}, - {0xd9, 0x80}, - {0xda, 0xc0}, - {0xdb, 0x60}, - {0xff, 0xff} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish - {0x00, 0x04}, - {0xd9, 0x80}, - {0xda, 0x50}, - {0xdb, 0x50}, - {0xff, 0xff} -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - //-3 - {0xff, 0xff} -}; - -static struct reginfo sensor_Exposure1[]= -{ - //-2 - {0xff, 0xff} -}; - -static struct reginfo sensor_Exposure2[]= -{ - //-0.3EV - {0xff, 0xff} -}; - -static struct reginfo sensor_Exposure3[]= -{ - //default - {0xff, 0xff} -}; - -static struct reginfo sensor_Exposure4[]= -{ - // 1 - {0xff, 0xff} -}; - -static struct reginfo sensor_Exposure5[]= -{ - // 2 - {0xff, 0xff} -}; - -static struct reginfo sensor_Exposure6[]= -{ - // 3 - {0xff, 0xff} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {0xff, 0xff} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {0xff, 0xff} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {0xff, 0xff} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - {0xff, 0xff} -}; - -static struct reginfo sensor_Contrast1[]= -{ - {0xff, 0xff} -}; - -static struct reginfo sensor_Contrast2[]= -{ - {0xff, 0xff} -}; - -static struct reginfo sensor_Contrast3[]= -{ - {0xff, 0xff} -}; - -static struct reginfo sensor_Contrast4[]= -{ - {0xff, 0xff} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - {0xff, 0xff} -}; - -static struct reginfo sensor_Contrast6[]= -{ - {0xff, 0xff} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {0xff, 0xff} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {0xff, 0xff} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {0xff, 0xff} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {0xff, 0xff} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ - {0x00, 0x01}, - {0x11, 0x0a}, - {0x00, 0x04}, - {0xb6, 0x00}, - {0xff, 0xff} -}; - -static struct reginfo sensor_SceneNight[] = -{ - {0x00, 0x01}, - {0x11, 0x14}, - {0x00, 0x04}, - {0xb6, 0x10}, - {0xff, 0xff} -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {0xff, 0xff} -}; - -static struct reginfo sensor_Zoom1[] = -{ - {0xff, 0xff} -}; - -static struct reginfo sensor_Zoom2[] = -{ - {0xff, 0xff} -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {0xff, 0xff} -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif -static struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - unsigned int winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int funmodule_state; -} sensor_info_priv_t; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, u8 reg, u8 val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[1]; - - //buf[0] = reg >> 8; - buf[0] = reg & 0xFF; - buf[1] = val; - //printk("%s----%d-----\n",__func__,__LINE__); - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} -#if 0 -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) -{ - int err,cnt; - u8 buf[1]; - struct i2c_msg msg[2]; - - // buf[0] = reg >> 8; - buf[0] = reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} -#endif -/* write a array of registers */ -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err = 0, cnt; - int i = 0; -#if CONFIG_SENSOR_I2C_RDWRCHK - char valchk; -#endif - - cnt = 0; - if (sensor_task_lock(client, 1) < 0) - goto sensor_write_array_end; - while (regarray[i].reg != 0xff) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err < 0) - { - if (cnt-- > 0) { - SENSOR_TR("%s..write failed current reg:0x%x, Write array again !\n", SENSOR_NAME_STRING(),regarray[i].reg); - i = 0; - continue; - } else { - SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING()); - err = -EPERM; - goto sensor_write_array_end; - } - } else { - #if CONFIG_SENSOR_I2C_RDWRCHK - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - #endif - } - i++; - } - -sensor_write_array_end: - sensor_task_lock(client,0); - return err; -} -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) -{ - int cnt; - int i = 0; - char valchk; - - cnt = 0; - valchk = 0; - while (regarray[i].reg != 0xff) - { - sensor_read(client, regarray[i].reg, &valchk); - if (valchk != regarray[i].val) - SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); - - i++; - } - return 0; -} -#endif -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_power_end: - return ret; -} - -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - int ret; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - msleep(100); -#if 0 - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - ret = sensor_write(client, 0x3012, 0x80); - if (ret != 0) - { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); //delay 5 microseconds - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x300a, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value << 8); - - ret = sensor_read(client, 0x300b, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - pid |= (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_INIT_ERR; - } -#endif -#if 0 - sensor_read(client,0x01,&value); - pid = (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_INIT_ERR; - } -#endif - - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - sensor_task_lock(client,0); - sensor->info_priv.winseqe_cur_addr = (int)SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} - -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - - sensor_ioctrl(icd, Sensor_PowerDown, 1); - - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - msleep(100); - - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - return 0; -} - -static struct reginfo sensor_power_down_sequence[]= -{ - {0xff,0xff} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - - return 0; - -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - const struct v4l2_queryctrl *qctrl; - struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - int ret=0, set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) &&( sensor_qcif[0].reg!=0xff)) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg!=0xff)) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=0xff)) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) &&( sensor_vga[0].reg!=0xff)) - { - winseqe_set_addr = sensor_vga; - set_w =640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && (sensor_svga[0].reg!=0xff)) - { - winseqe_set_addr = sensor_svga; - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1024) && (set_h <= 768)) &&( sensor_xga[0].reg!=0xff)) - { - winseqe_set_addr = sensor_xga; - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=0xff)) - { - winseqe_set_addr = sensor_sxga; - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=0xff)) - { - winseqe_set_addr = sensor_uxga; - set_w = 1600; - set_h = 1200; - } - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) { - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - } else { /* ddl@rock-chips.com : Video */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - } - #endif - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - - sensor->info_priv.winseqe_cur_addr = (int)winseqe_set_addr; - - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - #if CONFIG_SENSOR_Effect - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - #endif - #if CONFIG_SENSOR_WhiteBalance - if (sensor->info_priv.whiteBalance != 0) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - #endif - sensor->info_priv.snap2preview = true; - } else if (sensor_fmt_videochk(sd,mf) == true) { /* ddl@rock-chips.com : Video */ - #if CONFIG_SENSOR_Effect - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - #endif - #if CONFIG_SENSOR_WhiteBalance - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - #endif - sensor->info_priv.video2preview = true; - } else if ((sensor->info_priv.snap2preview == true) || (sensor->info_priv.video2preview == true)) { - #if CONFIG_SENSOR_Effect - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - #endif - #if CONFIG_SENSOR_WhiteBalance - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - #endif - sensor->info_priv.video2preview = false; - sensor->info_priv.snap2preview = false; - } - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; - -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) &&( sensor_qcif[0].reg!=0xff)) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg!=0xff)) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=0xff)) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) &&( sensor_vga[0].reg!=0xff)) - { - set_w =640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && (sensor_svga[0].reg!=0xff)) - { - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1024) && (set_h <= 768)) &&( sensor_xga[0].reg!=0xff)) - { - set_w = 1024; - set_h = 768; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=0xff)) - { - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=0xff)) - { - set_w = 1600; - set_h = 1200; - } - else - { - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - mf->width = set_w; - mf->height = set_h; - mf->colorspace = fmt->colorspace; - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV2655 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value > 0) && ((digitalzoom_cur + value) > digitalzoom_total)) - { - value = digitalzoom_total - digitalzoom_cur; - } - - if ((value < 0) && ((digitalzoom_cur + value) < 0)) - { - value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - int ret; - - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } -#if 0 - /* soft reset */ - ret = sensor_write(client, 0x3012, 0x80); - if (ret != 0) - { - SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); - return -ENODEV; - } - mdelay(5); //delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x300a, &value); - if (ret != 0) { - SENSOR_TR("read chip id high byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - - ret = sensor_read(client, 0x01, &value); - if (ret != 0) { - SENSOR_TR("read chip id low byte failed\n"); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - pid = (value & 0xff); - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } -#endif - - return 0; - -sensor_video_probe_err: - - return ret; -} -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0; -#if CONFIG_SENSOR_Flash - int i; -#endif - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - sensor->sensor_gpio_res = NULL; - for (i=0; isensor_io_request->gpio_res[i].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[i].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[i]; - } - } - if (sensor->sensor_gpio_res == NULL) { - SENSOR_TR("%s %s obtain gpio resource failed when RK29_CAM_SUBDEV_IOREQUEST \n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - sensor->info_priv.fmt = sensor_colour_fmts[0]; - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); diff --git a/drivers/media/video/siv120b.c b/drivers/media/video/siv120b.c deleted file mode 100755 index 6bc4b92ea13c..000000000000 --- a/drivers/media/video/siv120b.c +++ /dev/null @@ -1,2850 +0,0 @@ - -/* -o* Driver for MT9M001 CMOS Image Sensor from Micron - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_SIV120B -#define SENSOR_V4L2_IDENT V4L2_IDENT_SIV120B -#define SENSOR_ID 0x12 -#define SENSOR_MIN_WIDTH 640//176 -#define SENSOR_MIN_HEIGHT 480//144 -#define SENSOR_MAX_WIDTH 640 -#define SENSOR_MAX_HEIGHT 480 -#define SENSOR_INIT_WIDTH 640 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 480 -#define SENSOR_INIT_WINSEQADR sensor_vga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_YUYV8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 0 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 0 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 1 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 - -#define CONFIG_SENSOR_I2C_SPEED 250000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) -struct reginfo -{ - u8 reg; - u8 val; -}; - -//flash off in fixed time to prevent from too hot , zyc -struct flash_timer{ - struct soc_camera_device *icd; - struct hrtimer timer; -}; -static enum hrtimer_restart flash_off_func(struct hrtimer *timer); - -static struct flash_timer flash_off_timer; -//for user defined if user want to customize the series , zyc -#ifdef CONFIG_SIV120B_USER_DEFINED_SERIES -#include "siv120b_user_series.c" -#else -/* init 640X480 VGA */ -static struct reginfo sensor_init_data[] = -{ -//[init] -{0x00,0x00}, // -{0x04,0x04}, // -{0x13,0x17}, // #anti_black sun -{0x16,0xcf}, // #0xb6 - -{0x20,0x00}, // #P_BNKT -{0x21,0x01}, // #P_HBNKT -{0x22,0x01}, // #P_ROWFIL -{0x23,0x01}, // #P_VBNKT - -{0x40,0x00}, // #0x8b -{0x41,0x00}, // #0x96 -{0x42,0x00}, // #0xda -{0x43,0x00}, // #0x83 - -// Register setting -{0x00,0x01}, // -{0x11,0x14}, // # 6fps at lowlux -{0x12,0x78}, // # D65 target 0x74 -{0x13,0x78}, // # CWF target 0x74 -{0x14,0x78}, // # A target 0x74 -{0x34,0x7d}, // - -{0x40,0x50}, // # Max x8 - -{0x41,0x20}, // #AG_TOP1 0x28 -{0x42,0x20}, // #AG_TOP0 0x28 -{0x43,0x00}, // #AG_MIN1 0x08 -{0x44,0x00}, // #AG_MIN0 0x08 -{0x45,0x00}, // #G50_dec 0x09 -{0x46,0x0a}, // #G33_dec 0x17 -{0x47,0x10}, // #G25_dec 0x1d -{0x48,0x13}, // #G20_dec 0x21 -{0x49,0x15}, // #G12_dec 0x23 -{0x4a,0x18}, // #G09_dec 0x24 -{0x4b,0x1a}, // #G06_dec 0x26 -{0x4c,0x1d}, // #G03_dec 0x27 -{0x4d,0x20}, // #G100_inc 0x27 -{0x4e,0x10}, // #G50_inc 0x1a -{0x4f,0x0a}, // #G33_inc 0x14 -{0x50,0x08}, // #G25_inc 0x11 -{0x51,0x06}, // #G20_inc 0x0f -{0x52,0x05}, // #G12_inc 0x0d -{0x53,0x04}, // #G09_inc 0x0c -{0x54,0x02}, // #G06_inc 0x0a -{0x55,0x01}, // #G03_inc 0x09 - -//B Register Setting -{0x00,0x02}, // -{0x10,0xd3}, // -{0x11,0xc0}, // -{0x12,0x80}, // -{0x13,0x80}, // -{0x14,0x80}, // -{0x15,0xfe}, // # R gain Top -{0x16,0x70}, // # R gain bottom 0x80 -{0x17,0xea}, // # B gain Top -{0x18,0x80}, // # B gain bottom -{0x19,0xa0}, // # Cr top value -{0x1a,0x60}, // # Cr bottom value -{0x1b,0xa0}, // # Cb top value -{0x1c,0x60}, // # Cb bottom value -{0x1d,0xa0}, // -{0x1e,0x70}, // -{0x20,0xe8}, // # AWB luminous top value -{0x21,0x20}, // # AWB luminous bottom value -{0x22,0xa4}, // -{0x23,0x20}, // -{0x25,0x20}, // -{0x26,0x0f}, // -{0x27,0x10}, // # ST for outdoor enable -{0x28,0x1a}, // # ST for outdoor disable -{0x29,0xb8}, // # AWB R gain at outdoor -{0x2a,0x94}, // # AWB B gain at outdoor - -{0x30,0x00}, // -{0x31,0x10}, // -{0x32,0x00}, // -{0x33,0x10}, // -{0x34,0x02}, // -{0x35,0x76}, // -{0x36,0x01}, // -{0x37,0xd6}, // -{0x40,0x01}, // -{0x41,0x04}, // -{0x42,0x08}, // -{0x43,0x10}, // -{0x44,0x12}, // -{0x45,0x35}, // -{0x46,0x64}, // -{0x50,0x33}, // -{0x51,0x20}, // -{0x52,0xe5}, // -{0x53,0xfb}, // -{0x54,0x13}, // -{0x55,0x26}, // -{0x56,0x07}, // -{0x57,0xf5}, // -{0x58,0xea}, // -{0x59,0x21}, // - -{0x63,0x98}, // # R D30 to D20 -{0x64,0xa8}, // # B D30 to D20 -{0x65,0x98}, // # R D20 to D30 -{0x66,0xa8}, // # B D20 to D30 -{0x67,0xc8}, // # R D65 to D30 -{0x68,0x9f}, // # B D65 to D30 -{0x69,0xc8}, // # R D30 to D65 -{0x6a,0x9f}, // # B D30 to D65 - -//P Register Setting -{0x00,0x03}, // -{0x10,0xff}, // -{0x11,0x1d}, // - -{0x8c,0x10}, // - -//ading Register Setting -{0x40,0x00}, // -{0x41,0x21}, // -{0x42,0x32}, // -{0x43,0x43}, // -{0x44,0x55}, // -{0x45,0x55}, // -{0x46,0x11}, // # left R gain[7:4], right R gain[3:0] -{0x47,0x23}, // # top R gain[7:4], bottom R gain[3:0] -{0x48,0x10}, // # left Gr gain[7:4], right Gr gain[3:0] -{0x49,0x12}, // # top Gr gain[7:4], bottom Gr gain[3:0] -{0x4a,0x01}, // # left Gb gain[7:4], right Gb gain[3:0] -{0x4b,0x12}, // # top Gb gain[7:4], bottom Gb gain[3:0] -{0x4c,0x00}, // # left B gain[7:4], right B gain[3:0] -{0x4d,0x11}, // # top B gain[7:4], bottom B gain[3:0] -{0x4e,0x04}, // # X-axis center high[3:2], Y-axis center high[1:0] -{0x4f,0x50}, // # X-axis center low[7:0] -{0x50,0xf6}, // # Y-axis center low[7:0] -{0x51,0x80}, // # Shading Center Gain -{0x52,0x00}, // # Shading R Offset -{0x53,0x00}, // # Shading Gr Offset -{0x54,0x00}, // # Shading Gb Offset -{0x55,0x00}, // # Shading B Offset - -//mma -{0x30,0x0 }, // #0x0 -{0x31,0x3 }, // #0x6 -{0x32,0xA }, // #0x10 -{0x33,0x1E}, // #0x27 -{0x34,0x42}, // #0x48 -{0x35,0x5E}, // #0x62 -{0x36,0x74}, // #0x77 -{0x37,0x86}, // #0x88 -{0x38,0x96}, // #0x97 -{0x39,0xA4}, // #0xA5 -{0x3a,0xB1}, // #0xB2 -{0x3b,0xC8}, // #0xC9 -{0x3c,0xDC}, // #0xDB -{0x3d,0xEF}, // #0xED -{0x3e,0xF8}, // #0xF7 -{0x3f,0xFF}, // #0xFF - - //lor matrix (D65) - Daylight -{0x71,0x3b}, // #0x3a -{0x72,0xca}, // #0xc9 -{0x73,0xfb}, // #0xfe -{0x74,0x0f}, // #0x10 -{0x75,0x22}, // #0x23 -{0x76,0x0f}, // #0x0b -{0x77,0xf7}, // #0xfb -{0x78,0xc7}, // #0xce -{0x79,0x42}, // #0x38 - - //lor matrix (D30) - CWF -{0x7a,0x3b}, // #0x39 -{0x7b,0xcb}, // #0xcd -{0x7c,0xfa}, // #0xfa -{0x7d,0x0e}, // #0x0a -{0x7e,0x21}, // #0x29 -{0x7f,0x11}, // #0x0c -{0x80,0xf4}, // #0xf5 -{0x81,0xc4}, // #0xc7 -{0x82,0x48}, // #0x44 - - //lor matrix (D20) - A -{0x83,0x3a}, // #0x3a -{0x84,0xcd}, // #0xcc -{0x85,0xf9}, // #0xfa -{0x86,0x15}, // #0xfe -{0x87,0x26}, // #0x3a -{0x88,0x05}, // #0x08 -{0x89,0xed}, // #0xf9 -{0x8a,0xbb}, // #0xc3 -{0x8b,0x57}, // #0x44 - -//CNR -{0x17,0xC8}, // # DPCNRCTRL -{0x18,0x18}, // # DPTHR -{0x19,0x48}, // # [7:6] G DP Number Thr @ Dark | [5:0] DPTHRMIN -{0x1A,0x48}, // # [7:6] G DP Number Thr @ Normal | [5:0] DPTHRMAX -{0x1B,0x24}, // # DPTHRSLP( [7:4] @ Normal | [3:0] @ Dark ) -{0x1C,0x00}, // # NRTHR -{0x1D,0x48}, // # [7:6] C DP Number Thr @ Dark | [5:0] NRTHRMIN 0x48 -{0x1E,0x48}, // # [7:6] C DP Number Thr @ Normal | [5:0] NRTHRMAX -{0x1F,0x68}, // # NRTHRSLP( [7:4] @ Normal | [3:0] @ Dark ) 0x20 -{0x20,0x04}, // # IllumiInfo STRTNOR -{0x21,0x0f}, // # IllumiInfo STRTDRK - -{0x56,0x10}, // # lowlux shading enable -{0x57,0x92}, // # lowlux shading -{0x58,0x00}, // # lowlux shading on - -//ge gain -{0x90,0x18}, // # upper gain -{0x91,0x18}, // # down gain -{0x92,0x04}, // # upper coring value -{0x96,0x04}, // # down coring value - -{0x9f,0x10}, // # Yeugain -{0xa0,0x10}, // # Yedgain9 -{0xa9,0x12}, // # Cr saturation -{0xaa,0x12}, // # Cb saturation -{0xb9,0x10}, // # 0x13 lowlux color -{0xba,0x20}, // # 0x10 lowlux color - -{0xdd,0x4f}, // # ENHCTRL5 -{0xde,0xba}, // # NOIZCTRL - -{0xe5,0x15}, // -{0xe6,0x28}, // -{0xe7,0x04}, // - -//On -{0x00,0x01}, // -{0x10,0x80}, // - -//sor On -{0x00,0x00}, // -{0x03,0xc5}, // - -//{0x04, 0x00}, -{0x04, 0x00|1}, - -{0x05, 0x07}, -{0x20, 0x00}, -{0x21, 0x01}, -{0x23, 0x01}, -{0x34, 0x96}, -{0x11, 0x03}, -{0x12, 0x3d}, -{0xc0, 0x24}, -{0xc1, 0x00}, -{0xc2, 0x80}, -{0xc3, 0x00}, -{0xc4, 0xe0}, - -}; - - -/* 640X480 VGA @30fps for both preview & capture. */ -static struct reginfo sensor_vga[] = -{ -{0x04, 0x00}, -{0x05, 0x07}, -{0x20, 0x00}, -{0x21, 0x01}, -{0x23, 0x01}, -{0x34, 0x96}, -{0x11, 0x03}, -{0x12, 0x3d}, -{0xc0, 0x24}, -{0xc1, 0x00}, -{0xc2, 0x80}, -{0xc3, 0x00}, -{0xc4, 0xe0}, -}; - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {0x00,0x00} -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - {0x00,0x00} -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {0x00,0x00} -}; -#endif -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {0x00,0x00} - -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {0x00,0x00} - -}; - - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0x84, 0x6C}, //Contrast 4 - {0x85, 0x78}, - {0x86, 0x8C}, - {0x87, 0x9E}, - {0x88, 0xBB}, - {0x89, 0xD2}, - {0x8A, 0xE6}, - {0x6C, 0x40}, - {0x6D, 0x30}, - {0x6E, 0x48}, - {0x6F, 0x60}, - {0x70, 0x70}, - {0x71, 0x70}, - {0x72, 0x70}, - {0x73, 0x70}, - {0x74, 0x60}, - {0x75, 0x60}, - {0x76, 0x50}, - {0x77, 0x48}, - {0x78, 0x3A}, - {0x79, 0x2E}, - {0x7A, 0x28}, - {0x7B, 0x22}, - - {0x0f, 0x4a}, //Saturation 3 - {0x27, 0x80}, - {0x28, 0x80}, - {0x2c, 0x80}, - {0x62, 0x60}, - {0x63, 0xe0}, - {0x64, 0x04}, - {0x65, 0x00}, - {0x66, 0x01}, - {0x24, 0x70}, - {0x25, 0x64}, - - {0x4f, 0x2e}, //Brightness 3 - {0x50, 0x31}, - {0x51, 0x02}, - {0x52, 0x0e}, - {0x53, 0x1e}, - {0x54, 0x2d}, - - {0x11, 0x80}, - {0x14, 0x2a}, - {0x13, 0xe7}, - {0x66, 0x05}, - - -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0x7C,0x04}, //Contrast 5 - {0x7D,0x09}, - {0x7E,0x13}, - {0x7F,0x29}, - {0x80,0x35}, - {0x81,0x41}, - {0x82,0x4D}, - {0x83,0x59}, - {0x84,0x64}, - {0x85,0x6F}, - {0x86,0x85}, - {0x87,0x97}, - {0x88,0xB7}, - {0x89,0xCF}, - {0x8A,0xE3}, - {0x6C,0x40}, - {0x6D,0x50}, - {0x6E,0x50}, - {0x6F,0x58}, - {0x70,0x60}, - {0x71,0x60}, - {0x72,0x60}, - {0x73,0x60}, - {0x74,0x58}, - {0x75,0x58}, - {0x76,0x58}, - {0x77,0x48}, - {0x78,0x40}, - {0x79,0x30}, - {0x7A,0x28}, - {0x7B,0x26}, - - - - {0x4f,0x3a}, //Saturation 4 - {0x50,0x3d}, - {0x51,0x03}, - {0x52,0x12}, - {0x53,0x26}, - {0x54,0x38}, - {0x4f, 0x2e}, //Brightness 3 - {0x50, 0x31}, - {0x51, 0x02}, - {0x52, 0x0e}, - {0x53, 0x1e}, - {0x54, 0x2d}, - - {0x11,0x80}, - {0x14,0x0a}, - {0x13,0xc7}, - {0x66,0x05}, - -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - //Sunny - {0x7C,0x04}, //Contrast 5 - {0x7D,0x09}, - {0x7E,0x13}, - {0x7F,0x29}, - {0x80,0x35}, - {0x81,0x41}, - {0x82,0x4D}, - {0x83,0x59}, - {0x84,0x64}, - {0x85,0x6F}, - {0x86,0x85}, - {0x87,0x97}, - {0x88,0xB7}, - {0x89,0xCF}, - {0x8A,0xE3}, - {0x6C,0x40}, - {0x6D,0x50}, - {0x6E,0x50}, - {0x6F,0x58}, - {0x70,0x60}, - {0x71,0x60}, - {0x72,0x60}, - {0x73,0x60}, - {0x74,0x58}, - {0x75,0x58}, - {0x76,0x58}, - {0x77,0x48}, - {0x78,0x40}, - {0x79,0x30}, - {0x7A,0x28}, - {0x7B,0x26}, - - - - {0x4f,0x3a}, //Saturation 4 - {0x50,0x3d}, - {0x51,0x03}, - {0x52,0x12}, - {0x53,0x26}, - {0x54,0x38}, - {0x4f, 0x2e}, //Brightness 3 - {0x50, 0x31}, - {0x51, 0x02}, - {0x52, 0x0e}, - {0x53, 0x1e}, - {0x54, 0x2d}, - - {0x11,0x80}, - {0x14,0x0a}, - {0x13,0xc7}, - {0x66,0x05}, - -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - //Office - {0x84, 0x6C}, //Contrast 4 - {0x85, 0x78}, - {0x86, 0x8C}, - {0x87, 0x9E}, - {0x88, 0xBB}, - {0x89, 0xD2}, - {0x8A, 0xE6}, - {0x6C, 0x40}, - {0x6D, 0x30}, - {0x6E, 0x48}, - {0x6F, 0x60}, - {0x70, 0x70}, - {0x71, 0x70}, - {0x72, 0x70}, - {0x73, 0x70}, - {0x74, 0x60}, - {0x75, 0x60}, - {0x76, 0x50}, - {0x77, 0x48}, - {0x78, 0x3A}, - {0x79, 0x2E}, - {0x7A, 0x28}, - {0x7B, 0x22}, - - {0x0f, 0x4a}, //Saturation 3 - {0x27, 0x80}, - {0x28, 0x80}, - {0x2c, 0x80}, - {0x62, 0x60}, - {0x63, 0xe0}, - {0x64, 0x04}, - {0x65, 0x00}, - {0x66, 0x01}, - {0x24, 0x70}, - {0x25, 0x64}, - - {0x4f, 0x2e}, //Brightness 3 - {0x50, 0x31}, - {0x51, 0x02}, - {0x52, 0x0e}, - {0x53, 0x1e}, - {0x54, 0x2d}, - - {0x11,0x80}, - {0x14,0x2a}, - {0x13,0xe7}, - {0x66,0x05}, - - - - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x84, 0x6C}, //Contrast 4 - {0x85, 0x78}, - {0x86, 0x8C}, - {0x87, 0x9E}, - {0x88, 0xBB}, - {0x89, 0xD2}, - {0x8A, 0xE6}, - {0x6C, 0x40}, - {0x6D, 0x30}, - {0x6E, 0x48}, - {0x6F, 0x60}, - {0x70, 0x70}, - {0x71, 0x70}, - {0x72, 0x70}, - {0x73, 0x70}, - {0x74, 0x60}, - {0x75, 0x60}, - {0x76, 0x50}, - {0x77, 0x48}, - {0x78, 0x3A}, - {0x79, 0x2E}, - {0x7A, 0x28}, - {0x7B, 0x22}, - - {0x0f, 0x4a}, //Saturation 3 - {0x27, 0x80}, - {0x28, 0x80}, - {0x2c, 0x80}, - {0x62, 0x60}, - {0x63, 0xe0}, - {0x64, 0x04}, - {0x65, 0x00}, - {0x66, 0x01}, - {0x24, 0x70}, - {0x25, 0x64}, - - {0x4f, 0x2e}, //Brightness 3 - {0x50, 0x31}, - {0x51, 0x02}, - {0x52, 0x0e}, - {0x53, 0x1e}, - {0x54, 0x2d}, - - {0x11, 0x80}, - {0x14, 0x2a}, - {0x13, 0xe7}, - {0x66, 0x05}, - -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - // Brightness -2 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x49}, - {0x339a, 0x20}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness1[]= -{ - // Brightness -1 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x49}, - {0x339a, 0x10}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness2[]= -{ - // Brightness 0 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x00}, - {0x3390, 0x41}, - {0x339a, 0x00}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness3[]= -{ - // Brightness +1 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x41}, - {0x339a, 0x10}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness4[]= -{ - // Brightness +2 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, - {0x3390, 0x41}, - {0x339a, 0x20}, - {0x0000, 0x00} -}; - -static struct reginfo sensor_Brightness5[]= -{ - // Brightness +3 - {0x3301, 0xff},//bit[7]:1, enable SDE - {0x3391, 0x04}, //bit[2] enable - {0x3390, 0x41}, //bit[3] sign of brightness - {0x339a, 0x30}, - {0x0000, 0x00} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x00,0x03}, - {0xb6,0x00}, - {0xb7,0x00}, - {0xb8,0x00}, - -}; - -static struct reginfo sensor_Effect_WandB[] = -{ -//mono - {0x00,0x03}, - {0xb6,0x40}, - {0xb7,0x00}, - {0xb8,0x00}, - -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x00,0x03}, - {0xb6,0x80}, - {0xb7,0x60}, - {0xb8,0xa0}, - -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - //Negative - {0x00,0x03}, - {0xb6,0x20}, - {0xb7,0x00}, - {0xb8,0x00}, - -}; -#if 0 -static struct reginfo sensor_Effect_Bluish[] = -{ - // Bluish -- aqua - {0x00,0x03}, - {0xb6,0x80}, - {0xb7,0xc0}, - {0xb8,0x60}, - -}; -#endif -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish - {0x00,0x03}, - {0xb6,0x80}, - {0xb7,0x50}, - {0xb8,0x50}, - -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - /*sensor_Effect_Bluish,*/ sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - -}; - -static struct reginfo sensor_Exposure1[]= -{ - -}; - -static struct reginfo sensor_Exposure2[]= -{ - -}; - -static struct reginfo sensor_Exposure3[]= -{ - -}; - -static struct reginfo sensor_Exposure4[]= -{ - -}; - -static struct reginfo sensor_Exposure5[]= -{ - -}; - -static struct reginfo sensor_Exposure6[]= -{ - -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - -}; - -static struct reginfo sensor_Saturation1[]= -{ - -}; - -static struct reginfo sensor_Saturation2[]= -{ - -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - -}; - -static struct reginfo sensor_Contrast1[]= -{ - -}; - -static struct reginfo sensor_Contrast2[]= -{ - -}; - -static struct reginfo sensor_Contrast3[]= -{ - -}; - -static struct reginfo sensor_Contrast4[]= -{ - -}; - - -static struct reginfo sensor_Contrast5[]= -{ - -}; - -static struct reginfo sensor_Contrast6[]= -{ - -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - -}; - -static struct reginfo sensor_MirrorOff[]= -{ - -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - -}; - -static struct reginfo sensor_FlipOff[]= -{ - -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ -{0x00, 0x00} -}; - -static struct reginfo sensor_SceneNight[] = -{ -{0x00, 0x00} -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom1[] = -{ - {0x0, 0x0}, -}; - -static struct reginfo sensor_Zoom2[] = -{ - {0x0, 0x0}, -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {0x0, 0x0}, -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif -static struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - /* { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,*/{ .id = V4L2_CID_EFFECT, .index = 4, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -#endif -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - unsigned int winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int funmodule_state; - -} sensor_info_priv_t; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, u8 reg, u8 val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[1]; - - buf[0] = reg & 0xFF; - buf[1] = val; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt--) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) -{ - int err,cnt; - //u8 buf[2]; - u8 buf[1]; - struct i2c_msg msg[2]; - - //buf[0] = reg >> 8; - buf[0] = reg; - buf[1] = reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 1; - err = -EAGAIN; - while ((cnt--) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -#if 1 -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err; - int i = 0; - - while (regarray[i].reg != 0) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err != 0) - { - SENSOR_TR("%s..write failed current i = %d\n", SENSOR_NAME_STRING(),i); - return err; - } - i++; - } - return 0; -} -#else -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err; - int i = 0; - u8 val_read; - while (regarray[i].reg != 0) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err != 0) - { - SENSOR_TR("%s..write failed current i = %d\n", SENSOR_NAME_STRING(),i); - return err; - } - err = sensor_read(client, regarray[i].reg, &val_read); - SENSOR_TR("%s..reg[0x%x]=0x%x,0x%x\n", SENSOR_NAME_STRING(),regarray[i].reg, val_read, regarray[i].val); - i++; - } - return 0; -} -#endif -static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - int ret = 0; - - SENSOR_DG("%s %s cmd(%d) on(%d)\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd,on); - switch (cmd) - { - case Sensor_PowerDown: - { - if (icl->powerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - if(on){ - //flash off after 2 secs - hrtimer_cancel(&(flash_off_timer.timer)); - hrtimer_start(&(flash_off_timer.timer),ktime_set(0, 800*1000*1000),HRTIMER_MODE_REL); - } - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_power_end: - return ret; -} - -static enum hrtimer_restart flash_off_func(struct hrtimer *timer){ - struct flash_timer *fps_timer = container_of(timer, struct flash_timer, timer); - sensor_ioctrl(fps_timer->icd,Sensor_Flash,0); - SENSOR_DG("%s %s !!!!!!",SENSOR_NAME_STRING(),__FUNCTION__); - return 0; - -} -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - int ret, i; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; -// ret = sensor_write(client, 0x12, 0x80); -// if (ret != 0) -// { -// SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); -// ret = -ENODEV; -// goto sensor_INIT_ERR; -// } - -// mdelay(5); //delay 5 microseconds - - for(i = 0; i < sizeof(sensor_init_data)/2;i++){ - - // ret = sensor_write(client, sensor_init_data + i*2, sensor_init_data + i*2 + 1); - // printk("write to reg[0x%x] 0x%x\n",sensor_init_data[i].reg,sensor_init_data[i].val); - ret = sensor_write(client, sensor_init_data[i].reg, sensor_init_data[i].val); - //ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - // sensor_read(client,sensor_init_data[i].reg,&tmp); - // printk("read from reg[0x%x] 0x%x\n",sensor_init_data[i].reg,tmp); - } - sensor_task_lock(client,0); - - sensor->info_priv.winseqe_cur_addr = (int)SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - flash_off_timer.icd = icd; - flash_off_timer.timer.function = flash_off_func; - #endif - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} - -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - sensor_ioctrl(icd, Sensor_PowerDown, 1); - - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - msleep(100); - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - return 0; -} -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - - return 0; - -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -#if 0 -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -#endif -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - struct reginfo *winseqe_set_addr=NULL; - char readval; - int ret=0, set_w,set_h,i; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - sensor_read(client, 0x3a, &readval); - sensor_write(client,0x3a, readval&0xf7); - sensor_read(client,0x3d,&readval); - sensor_write(client,0x3d,readval&0xfe); - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - sensor_read(client, 0x3a, &readval); - sensor_write(client,0x3a, readval|0x08); - sensor_read(client,0x3d,&readval); - sensor_write(client,0x3d,readval&0xfe); - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) - { - printk("sizeof(winseqe_set_addr) %d\n",sizeof(winseqe_set_addr)); - for(i = 0; i < sizeof(winseqe_set_addr)/2;i++){ - ret |= sensor_write(client, winseqe_set_addr[i].reg, winseqe_set_addr[i].val); - //ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - goto sensor_s_fmt_end; - } - } - sensor->info_priv.winseqe_cur_addr = (int)winseqe_set_addr; - - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; - -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - set_w = 640; - set_h = 480; - } - else - { - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - mf->width = set_w; - mf->height = set_h; - mf->colorspace = fmt->colorspace; - - return ret; -} - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV9650 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - int i; - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - #if 0 - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - #else - printk("value %d qctrl->minimum %d ",value, qctrl->minimum); - printk("sizeof(sensor_EffectSeqe) %d\n",sizeof(sensor_EffectSeqe)); - printk("sizeof(sensor_EffectSeqe[%d]) %d\n",value - qctrl->minimum,sizeof(sensor_EffectSeqe[value - qctrl->minimum])); - for(i = 0; i < 4; i++) { - printk("sensor_EffectSeqe[%d][%d].reg 0x%x sensor_EffectSeqe[%d][%d].val 0x%x \n", - value - qctrl->minimum, i, sensor_EffectSeqe[value - qctrl->minimum][i].reg,value - qctrl->minimum, i,sensor_EffectSeqe[value - qctrl->minimum][i].val); - sensor_write(client, sensor_EffectSeqe[value - qctrl->minimum][i].reg, sensor_EffectSeqe[value - qctrl->minimum][i].val); - - } - - #endif - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((value > 0) && ((digitalzoom_cur + value) > digitalzoom_total)) - { - value = digitalzoom_total - digitalzoom_cur; - } - - if ((value < 0) && ((digitalzoom_cur + value) < 0)) - { - value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - //ruct i2c_client *client = v4l2_get_subdevdata(sd); - //ruct sensor *sensor = to_sensor(client); - //ruct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char pid = 0; - int ret; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - - /* soft reset */ -// ret = sensor_write(client, 0x12, 0x80); -// if (ret != 0) -// { -// SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); -// return -ENODEV; -// } - mdelay(50); //delay 5 microseconds - - /* check if it is an sensor sensor */ - ret = sensor_read(client, 0x01, &pid); - if (ret != 0) { - SENSOR_TR("%s read chip id high byte failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - - return ret; -} - -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0; -#if CONFIG_SENSOR_Flash - int i; -#endif - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - sensor->sensor_gpio_res = NULL; - for (i=0; isensor_io_request->gpio_res[i].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[i].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[i]; - } - } - if (sensor->sensor_gpio_res == NULL) { - SENSOR_TR("%s %s obtain gpio resource failed when RK29_CAM_SUBDEV_IOREQUEST \n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - //memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - sensor_controls[i].id=0xffff; - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - }else{ //two cameras are the same,need to deal diffrently ,zyc - for (i = 0; i < icd->ops->num_controls; i++) { - if(0xffff == icd->ops->controls[i].id){ - sensor_controls[i].id=V4L2_CID_FLASH; - } - } - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - sensor->info_priv.fmt = sensor_colour_fmts[0]; - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - hrtimer_init(&(flash_off_timer.timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - - diff --git a/drivers/media/video/siv121d.c b/drivers/media/video/siv121d.c deleted file mode 100755 index 2e1b0361850a..000000000000 --- a/drivers/media/video/siv121d.c +++ /dev/null @@ -1,2729 +0,0 @@ - -/* -o* Driver for MT9M001 CMOS Image Sensor from Micron - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -//#include -#include - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_SIV121D -#define SENSOR_V4L2_IDENT V4L2_IDENT_SIV121D -#define SENSOR_ID 0xde -#define SENSOR_MIN_WIDTH 640//176 -#define SENSOR_MIN_HEIGHT 480//144 -#define SENSOR_MAX_WIDTH 640 -#define SENSOR_MAX_HEIGHT 480 -#define SENSOR_INIT_WIDTH 640 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 480 -#define SENSOR_INIT_WINSEQADR sensor_vga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_YUYV8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 1 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 1 -#define CONFIG_SENSOR_Flash 0 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 - -#define CONFIG_SENSOR_I2C_SPEED 250000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) - -struct reginfo -{ - u8 reg; - u8 val; -}; - -/* init 640X480 VGA */ -static struct reginfo sensor_init_data[] = -{ - {0x00, 0x01}, - {0x03, 0x0a}, - - {0x00, 0x00}, - {0x03, 0x04}, - {0x10, 0x85}, - {0x11, 0x74}, - - {0x00, 0x01}, - //{0x03, 0x0a}, - {0x04, 0x01}, - {0x06, 0x04}, - - {0x10, 0x46}, - {0x11, 0x23}, - {0x12, 0x21}, - - {0x17, 0x86}, //ABS 1.74V - {0x18, 0x00}, - - {0x20, 0x00}, - {0x21, 0x05}, - {0x22, 0x01}, - {0x23, 0x69}, - - {0x40, 0x0F}, - {0x41, 0x90}, - {0x42, 0xd2}, - {0x43, 0x00}, - - // AE - {0x00, 0x02}, - {0x11, 0x0c}, - {0x12, 0x64}, - {0x14, 0x60}, - {0x34, 0x96}, - {0x40, 0x48}, - {0x5f, 0x01}, - {0x41, 0x28}, - {0x42, 0x28}, - {0x44, 0x08}, - {0x45, 0x08}, - {0x46, 0x15}, - {0x47, 0x1c}, - {0x48, 0x20}, - {0x49, 0x21}, - {0x4a, 0x23}, - {0x4b, 0x24}, - {0x4c, 0x25}, - {0x4d, 0x28}, - {0x4e, 0x1c}, - {0x4f, 0x15}, - {0x50, 0x12}, - {0x51, 0x10}, - {0x52, 0x0e}, - {0x53, 0x0c}, - {0x54, 0x0b}, - {0x55, 0x0a}, - {0x90, 0x80}, - {0x91, 0x80}, - {0x10, 0x80}, - - // AWB - {0x00, 0x03}, - {0x10, 0xd0}, - {0x11, 0xc1}, - {0x13, 0x7e}, //Cr target - {0x14, 0x7d}, //Cb target - {0x15, 0xd8}, // R gain Top - {0x16, 0x7c}, // R gain bottom - {0x17, 0xe0}, // B gain Top - {0x18, 0x88}, // B gain bottom 0x80 - {0x19, 0x8c}, // Cr top value 0x90 - {0x1a, 0x64}, // Cr bottom value 0x70 - {0x1b, 0x98}, // Cb top value 0x90 - {0x1c, 0x6c}, // Cb bottom value 0x70 - {0x1d, 0x94}, // 0xa0 - {0x1e, 0x6c}, // 0x60 - {0x20, 0xe8}, // AWB luminous top value - {0x21, 0x30}, // AWB luminous bottom value 0x20 - {0x22, 0xb8}, - {0x23, 0x10}, - {0x25, 0x08}, - {0x26, 0x20}, - {0x27, 0x08}, // BRTSRT - {0x28, 0x0f}, // BRTEND - {0x29, 0xba}, // BRTRGNBOT - {0x2a, 0xa0}, // BRTBGNTOP - - {0x40, 0x01}, - {0x41, 0x03}, - {0x42, 0x08}, - {0x43, 0x10}, - {0x44, 0x13}, - {0x45, 0x8f}, - {0x46, 0xfc}, - - {0x62, 0x80}, - {0x63, 0x90}, // R D30 to D20 - {0x64, 0xd0}, // B D30 to D20 - {0x65, 0x98}, // R D20 to D30 - {0x66, 0xd0}, // B D20 to D30 - - // IDP - {0x00, 0x04}, - {0x10, 0xff}, - {0x11, 0x0d},//1 d}, - {0x12, 0xfd}, - - // DPCBNR - {0x18, 0xbe}, // DPCNRCTRL - {0x19, 0x00}, // DPCTHV - {0x1A, 0x00}, // DPCTHVSLP - {0x1B, 0x00}, // DPCTHVDIFSRT - {0x1C, 0x0f}, // DPCTHVDIFSLP - {0x1d, 0xFF}, // DPCTHVMAX - - {0x1E, 0x04}, // BNRTHV 0c - {0x1F, 0x04}, // BNRTHVSLPN 10 - {0x20, 0x10}, // BNRTHVSLPD - {0x21, 0x00}, // BNRNEICNT - {0x22, 0x10}, // STRTNOR - {0x23, 0x40}, // STRTDRK - {0x24, 0x00}, - - // Gamma - {0x31, 0x08}, //0x08 - {0x32, 0x12}, //0x10 - {0x33, 0x24}, //0x1B - {0x34, 0x47}, //0x37 - {0x35, 0x64}, //0x4D - {0x36, 0x7c}, //0x60 - {0x37, 0x8f}, //0x72 - {0x38, 0x9f}, //0x82 - {0x39, 0xad}, //0x91 - {0x3a, 0xba}, //0xA0 - {0x3b, 0xcf}, //0xBA - {0x3c, 0xe2}, //0xD3 - {0x3d, 0xf0}, //0xEA - - // Shading Register Setting - {0x40, 0x06}, - {0x41, 0x44}, - {0x42, 0x44}, - {0x43, 0x20}, - {0x44, 0x22}, // left R gain[7:4], right R gain[3:0] - {0x45, 0x22}, // top R gain[7:4], bottom R gain[3:0] - {0x46, 0x00}, // left G gain[7:4], right G gain[3:0] - {0x47, 0x11}, // top G gain[7:4], bottom G gain[3:0] - {0x48, 0x00}, // left B gain[7:4], right B gain[3:0] - {0x49, 0x00}, // top B gain[7:4], bottom B gain[3:0] - {0x4a, 0x04}, // X-axis center high[3:2], Y-axis center high[1:0] - {0x4b, 0x48}, // X-axis center low[7:0] - {0x4c, 0xe8}, // Y-axis center low[7:0] - {0x4d, 0x84}, // Shading Center Gain - {0x4e, 0x00}, // Shading R Offset - {0x4f, 0x00}, // Shading Gr Offset - {0x50, 0x00}, // Shading B Offset - - // Interpolation - {0x60, 0x7f}, - {0x61, 0x08}, // INTCTRL outdoor - - // Color matrix (D65) - Daylight - {0x71, 0x34}, - {0x72, 0xCE}, - {0x73, 0xFe}, - {0x74, 0x13}, - {0x75, 0x25}, - {0x76, 0x08}, - {0x77, 0xec}, - {0x78, 0xcd}, - {0x79, 0x47}, - - // Color matrix (D20) - A - {0x83, 0x38}, //0x3c - {0x84, 0xd1}, //0xc6 - {0x85, 0xf7}, //0xff - {0x86, 0x12}, //0x12 - {0x87, 0x25}, //0x24 - {0x88, 0x09}, //0x0a - {0x89, 0xed}, //0xed - {0x8a, 0xbb}, //0xc2 - {0x8b, 0x58}, //0x51 - - {0x8c, 0x10}, //CMA select - - //G Edge - {0x90, 0x18}, //Upper gain - {0x91, 0x28}, //down gain - {0x92, 0x55}, //[7:4] upper coring [3:0] down coring - {0x9a, 0x40}, - {0x9b, 0x40}, - {0x9c, 0x38}, //edge suppress start - {0x9d, 0x30}, //edge suppress slope - - {0xa9, 0x11}, - {0xaa, 0x11}, - - {0xb9, 0x30}, // nightmode 38 at gain 0x48 5fps - {0xba, 0x44}, // nightmode 80 at gain 0x48 5fps - - {0xc0, 0x24}, - {0xc1, 0x00}, - {0xc2, 0x80}, - {0xc3, 0x00}, - {0xc4, 0xe0}, - - {0xde, 0x80}, - - {0xe5, 0x15}, //MEMSPDA - {0xe6, 0x02}, //MEMSPDB - {0xe7, 0x04}, //MEMSPDC - - //Sensor On - {0x00, 0x01}, - {0x03, 0x01} // SNR Enable - //{0xff, 0xff} -}; - - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ - {0x00,0x00} -}; - -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - {0x0, 0x0}, -}; - -/* 640X480 VGA @30fps for both preview & capture. */ -static struct reginfo sensor_vga[] = -{ - {0x00, 0x01}, - {0x06, 0x04}, - {0x12, 0x3d}, - {0x00, 0x04}, - {0xc0, 0x24}, - {0xc1, 0x00}, - {0xc2, 0x80}, - {0xc3, 0x00}, - {0xc4, 0xe0}, -}; - -/* 352X288 CIF @30fps*/ -static struct reginfo sensor_cif[] = -{ - {0x00, 0x01}, - {0x06, 0x00}, - {0x12, 0x3d}, - {0x00, 0x04}, - {0xc0, 0x11}, - {0xc1, 0x00}, - {0xc2, 0x60}, - {0xc3, 0x00}, - {0xc4, 0x20}, -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ - {0x00, 0x01}, - {0x06, 0x06}, - {0x12, 0x3d}, - {0x00, 0x04}, - {0xc0, 0x10}, - {0xc1, 0x00}, - {0xc2, 0x40}, - {0xc3, 0x00}, - {0xc4, 0xf0}, -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - {0x00, 0x01}, - {0x06, 0x02}, - {0x00, 0x04}, - {0x12, 0x3d}, - {0xc0, 0x00}, - {0xc1, 0x00}, - {0xc2, 0xb0}, - {0xc3, 0x00}, - {0xc4, 0x90}, -}; - -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - {0x00, 0x04}, - {0x12, 0x3d}, -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - {0x00, 0x04}, - {0x12, 0xcd}, -}; - - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0x00, 0x03}, - {0x10, 0xd3}, - {0xff,0xff} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0x00, 0x03}, - {0x10, 0x00}, // disable AWB - {0x60, 0xb4}, - {0x61, 0x74}, - {0xff,0xff} - -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - {0x00, 0x03}, - {0x10, 0x00}, // disable AWB - {0x60, 0xd8}, - {0x61, 0x90}, - {0xff,0xff} - -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - {0x00, 0x03}, - {0x10, 0x00}, // disable AWB - {0x60, 0x80}, - {0x61, 0xe0}, - {0xff,0xff} -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - {0x00, 0x03}, - {0x10, 0x00}, // disable AWB - {0x60, 0xb8}, - {0x61, 0xcc}, - {0xff,0xff} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - // Brightness -2 - {0x00, 0x04}, - {0xab, 0xb0}, - {0xff,0xff} -}; - -static struct reginfo sensor_Brightness1[]= -{ - // Brightness -1 - {0x00, 0x04}, - {0xab, 0xa0}, - {0xff,0xff} -}; - -static struct reginfo sensor_Brightness2[]= -{ - // Brightness 0 - {0x00, 0x04}, - {0xab, 0x82}, - {0xff,0xff} -}; - -static struct reginfo sensor_Brightness3[]= -{ - // Brightness +1 - {0x00, 0x04}, - {0xab, 0x00}, - {0xff,0xff} -}; - -static struct reginfo sensor_Brightness4[]= -{ - // Brightness +2 - {0x00, 0x04}, - {0xab, 0x10}, - {0xff,0xff} -}; - -static struct reginfo sensor_Brightness5[]= -{ - // Brightness +3 - {0x00, 0x04}, - {0xab, 0x20}, - {0xff,0xff} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0x00,0x04}, - {0x90,0x14}, - {0x91,0x18}, - {0xb6,0x00}, - {0xff,0xff} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - //mono - {0x00,0x04}, - {0x90,0x14}, - {0x91,0x18}, - {0xb6,0x40}, - {0xff,0xff} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0x00,0x04}, - {0x90, 0x14}, - {0x91, 0x18}, - {0xB6, 0x80}, - {0xB7, 0x58}, - {0xB8, 0x98}, - {0xff,0xff} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - //Negative - {0x00,0x04}, - {0x90, 0x18}, - {0x91, 0x18}, - {0xB6, 0x20}, - {0xff,0xff} -}; -/* -static struct reginfo sensor_Effect_Bluish[] = -{ - {0x00,0x04}, - {0x90, 0x14}, - {0x91, 0x18}, - {0xB6, 0x80}, - {0xB7, 0xb8}, - {0xB8, 0x50}, - {0xff,0xff} -}; -*/ -static struct reginfo sensor_Effect_Green[] = -{ - // Greenish - {0x00,0x04}, - {0x90, 0x14}, - {0x91, 0x18}, - {0xB6, 0x80}, - {0xB7, 0x68}, - {0xB8, 0x68}, - {0xff,0xff} -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - /*sensor_Effect_Bluish,*/ sensor_Effect_Green,NULL, -}; -#endif -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - {0x00,0x02}, - {0x12,0x44}, - {0x14,0x44}, - {0xff,0xff} -}; - -static struct reginfo sensor_Exposure1[]= -{ - {0x00,0x02}, - {0x12,0x54}, - {0x14,0x54}, - {0xff,0xff} -}; - -static struct reginfo sensor_Exposure2[]= -{ - {0x00,0x02}, - {0x12,0x54}, - {0x14,0x54}, - {0xff,0xff} -}; - -static struct reginfo sensor_Exposure3[]= -{ - {0x00,0x02}, - {0x12,0x78}, - {0x14,0x78}, - {0xff,0xff} -}; - -static struct reginfo sensor_Exposure4[]= -{ - {0x00,0x02}, - {0x12,0x84}, - {0x14,0x84}, - {0xff,0xff} -}; - -static struct reginfo sensor_Exposure5[]= -{ - {0x00,0x02}, - {0x12,0x94}, - {0x14,0x94}, - {0xff,0xff} -}; - -static struct reginfo sensor_Exposure6[]= -{ - {0x00,0x02}, - {0x12,0xa4}, - {0x14,0xa4}, - {0xff,0xff} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {0x00, 0x00} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {0x00, 0x00} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - // Brightness +3 - {0x00, 0x04}, - {0xa8, 0xb0}, - {0xff,0xff} -}; - -static struct reginfo sensor_Contrast1[]= -{ - // Brightness +3 - {0x00, 0x04}, - {0xa8, 0xa0}, - {0xff,0xff} -}; - -static struct reginfo sensor_Contrast2[]= -{ - // Brightness +3 - {0x00, 0x04}, - {0xa8, 0x90}, - {0xff,0xff} -}; - -static struct reginfo sensor_Contrast3[]= -{ - // Brightness +3 - {0x00, 0x04}, - {0xa8, 0x00}, - {0xff,0xff} -}; - -static struct reginfo sensor_Contrast4[]= -{ - // Brightness +3 - {0x00, 0x04}, - {0xa8, 0x10}, - {0xff,0xff} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - // Brightness +3 - {0x00, 0x04}, - {0xa8, 0x20}, - {0xff,0xff} -}; - -static struct reginfo sensor_Contrast6[]= -{ - // Brightness +3 - {0x00, 0x04}, - {0xa8, 0x30}, - {0xff,0xff} -}; -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {0x00, 0x00}, - {0xff,0xff} - -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {0x00, 0x00}, - {0xff,0xff} - -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {0x00, 0x00}, - {0xff,0xff} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {0x00, 0x00}, - {0xff,0xff} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif -#if CONFIG_SENSOR_Scene -static struct reginfo sensor_SceneAuto[] = -{ - {0x00, 0x02}, - {0x40, 0x45}, - {0x00, 0x04}, - {0xab, 0x00}, - {0xff,0xff} -}; - -static struct reginfo sensor_SceneNight[] = -{ - {0x00, 0x02}, - {0x40, 0x60}, - {0x00, 0x04}, - {0xab, 0x30}, - {0xff,0xff} -}; -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {0x00, 0x00}, - {0xff,0xff} - -}; - -static struct reginfo sensor_Zoom1[] = -{ - {0x00, 0x00}, - {0xff,0xff} -}; - -static struct reginfo sensor_Zoom2[] = -{ - {0x00, 0x00}, - {0xff,0xff} -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {0x00, 0x00}, - {0xff,0xff} -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif -static struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static const struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - unsigned int winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int funmodule_state; -} sensor_info_priv_t; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, u8 reg, u8 val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[1]; - - buf[0] = reg & 0xFF; - buf[1] = val; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) -{ - int err,cnt; - //u8 buf[2]; - u8 buf[1]; - struct i2c_msg msg[2]; - - //buf[0] = reg >> 8; - buf[0] = reg; - buf[1] = reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 1; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} -static int sensor_effect_write_array(struct i2c_client *client,struct reginfo *regarray) -{ - int err; - int i = 0; - - //for(i=0; i < sizeof(sensor_init_data) / 2;i++) - while((regarray[i].reg != 0xff) && (regarray[i].val != 0xff)) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err != 0) - { - SENSOR_TR("%s..write failed current i = %d\n", SENSOR_NAME_STRING(),i); - return err; - } - i++; - } - - return 0; - -} -/* write a array of registers */ -#if 1 -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err; - int i = 0; - - for(i=0; i < sizeof(sensor_init_data) / 2;i++) - //while((regarray[i].reg != 0xff) && (regarray[i].val != 0xff)) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err != 0) - { - SENSOR_TR("%s..write failed current i = %d\n", SENSOR_NAME_STRING(),i); - return err; - } - //i++; - } - - return 0; -} -#else -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err; - int i = 0; - u8 val_read; - while (regarray[i].reg != 0) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err != 0) - { - SENSOR_TR("%s..write failed current i = %d\n", SENSOR_NAME_STRING(),i); - return err; - } - err = sensor_read(client, regarray[i].reg, &val_read); - SENSOR_TR("%s..reg[0x%x]=0x%x,0x%x\n", SENSOR_NAME_STRING(),regarray[i].reg, val_read, regarray[i].val); - i++; - } - return 0; -} -#endif - -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_check_array(struct i2c_client *client, struct reginfo *regarray) -{ - int ret; - int i = 0; - - u8 value; - - SENSOR_DG("%s >>>>>>>>>>>>>>>>>>>>>>\n",__FUNCTION__); - for(i=0;ipowerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(2); - if (icl->reset) - icl->reset(icd->pdev); - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_power_end: - return ret; -} - -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - int ret; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - /* ret = sensor_write(client, 0x12, 0x80); - if (ret != 0) - { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); */ //delay 5 microseconds - - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - - sensor_task_lock(client,0); - - sensor->info_priv.winseqe_cur_addr = (int)SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - #endif - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} - -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - //u8 reg_val; - struct sensor *sensor = to_sensor(client); - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - sensor_ioctrl(icd, Sensor_PowerDown, 1); - msleep(100); - - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - - return 0; -} -static struct reginfo sensor_power_down_sequence[]= -{ - {0x00,0x00}, - {0x03,0x02} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - - return 0; - -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - int ret=0, set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - winseqe_set_addr = sensor_svga; - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - winseqe_set_addr = sensor_sxga; - set_w = 1280; - set_h = 1024; - } - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - - if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) { - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - } else { /* ddl@rock-chips.com : Video */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - } - #endif - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - - sensor->info_priv.winseqe_cur_addr = (int)winseqe_set_addr; - - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - if (sensor->info_priv.whiteBalance != 0) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - sensor->info_priv.snap2preview = true; - } else if (sensor_fmt_videochk(sd,mf) == true) { /* ddl@rock-chips.com : Video */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - sensor->info_priv.video2preview = true; - } else if ((sensor->info_priv.snap2preview == true) || (sensor->info_priv.video2preview == true)) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - msleep(600); - sensor->info_priv.video2preview = false; - sensor->info_priv.snap2preview = false; - } - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; - -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && sensor_qcif[0].reg) - { - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && sensor_qvga[0].reg) - { - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && sensor_cif[0].reg) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && sensor_vga[0].reg) - { - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600)) && sensor_svga[0].reg) - { - set_w = 800; - set_h = 600; - } - else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) - { - set_w = 1280; - set_h = 1024; - } - else - { - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - - mf->width = set_w; - mf->height = set_h; - - mf->colorspace = fmt->colorspace; - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV9650 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_effect_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_effect_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_effect_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_effect_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_effect_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_effect_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_effect_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_effect_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_effect_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((*value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value > 0) && ((digitalzoom_cur + *value) > digitalzoom_total)) - { - *value = digitalzoom_total - digitalzoom_cur; - } - - if ((*value < 0) && ((digitalzoom_cur + *value) < 0)) - { - *value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += *value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_effect_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, *value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char pid = 0; - int ret; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - - /* soft reset */ - /* ret = sensor_write(client, 0x12, 0x80); - if (ret != 0) - { - SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING()); - return -ENODEV; - } - mdelay(50); *///delay 5 microseconds - sensor_write(client, 0x00, 0x01); - sensor_write(client, 0x03, 0x0a); - mdelay(100); //delay 5 microseconds - sensor_write(client, 0x00, 0x01); - sensor_write(client, 0x03, 0x0a); - mdelay(100); //delay 5 microseconds - - /* check if it is an sensor sensor */ - sensor_write(client, 0x00, 0x00); - - ret = sensor_read(client, 0x01, &pid); - if (ret != 0) { - SENSOR_TR("%s read chip id high byte failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - return 0; - -sensor_video_probe_err: - - return ret; -} - -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0; - - int i; - - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - sensor->sensor_gpio_res = NULL; - for (i=0; isensor_io_request->gpio_res[i].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[i].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[i]; - } - } - if (sensor->sensor_gpio_res == NULL) { - SENSOR_TR("%s %s obtain gpio resource failed when RK29_CAM_SUBDEV_IOREQUEST \n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - - sensor->info_priv.fmt = sensor_colour_fmts[0]; - - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); - return i2c_add_driver(&sensor_i2c_driver); -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); - - diff --git a/drivers/media/video/sp0838.c b/drivers/media/video/sp0838.c deleted file mode 100644 index c107fcb99df0..000000000000 --- a/drivers/media/video/sp0838.c +++ /dev/null @@ -1,1576 +0,0 @@ -/* - * drivers/media/video/sp0838.c - * - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "generic_sensor.h" -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.1.1: -* add sensor_focus_af_const_pause_usr_cb; -*/ -static int version = KERNEL_VERSION(0,1,1); -module_param(version, int, S_IRUGO); - - - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug > level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_SP0838 -#define SENSOR_V4L2_IDENT V4L2_IDENT_SP0838 -#define SENSOR_ID 0x27 -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_PCLK_SAMPLE_RISING|V4L2_MBUS_HSYNC_ACTIVE_HIGH| V4L2_MBUS_VSYNC_ACTIVE_HIGH|\ - V4L2_MBUS_DATA_ACTIVE_LOW | SOCAM_MCLK_24MHZ) -#define SENSOR_PREVIEW_W 640 -#define SENSOR_PREVIEW_H 480 -#define SENSOR_PREVIEW_FPS 15000 // 15fps -#define SENSOR_FULLRES_L_FPS 7500 // 7.5fps -#define SENSOR_FULLRES_H_FPS 7500 // 7.5fps -#define SENSOR_720P_FPS 0 -#define SENSOR_1080P_FPS 0 - -#define SENSOR_REGISTER_LEN 1 // sensor register address bytes -#define SENSOR_VALUE_LEN 1 // sensor register value bytes - -static unsigned int SensorConfiguration = (CFG_WhiteBalance|CFG_Effect|CFG_Scene); -static unsigned int SensorChipID[] = {SENSOR_ID}; -/* Sensor Driver Configuration End */ - - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a,b) CONS4(SensorReg,SENSOR_REGISTER_LEN,Val,SENSOR_VALUE_LEN)(a,b) -#define sensor_write(client,reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_read(client,reg,v) CONS4(sensor_read_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_write_array generic_sensor_write_array - -struct sensor_parameter -{ - unsigned int PreviewDummyPixels; - unsigned int CaptureDummyPixels; - unsigned int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int PreviewPclk; - unsigned short int CapturePclk; - char awb[6]; -}; - -struct specific_sensor{ - struct generic_sensor common_sensor; - //define user data below - struct sensor_parameter parameter; - -}; - -#ifndef SP0838_MIRROR -#define SP0838_MIRROR 0 -#endif -#ifndef SP0838_FLIP -#define SP0838_FLIP 0 -#endif -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ - -/* Sensor initial setting *//* init 640X480 VGA */ -static struct rk_sensor_reg sensor_init_data[] = -{ - {0xfd , 0x00}, //P0 - {0x1B , 0x02}, -#ifdef SP0838_FRONT_DRVCAP - {0x1C , 0x03}, //add by sp_yjp,bit2: driver ability set(8mA) -#else - {0x1C , 0x07}, -#endif - {0x30 , 0x02},// 1/2ispclk - {0x27 , 0xe8}, - {0x28 , 0x0b}, // 0x0B pzt 2012-7-26 - {0x32 , 0x00}, - {0x22 , 0xc0}, - {0x26 , 0x10}, - {0x31 , 0x10|(SP0838_FLIP<<6)|(SP0838_MIRROR<<5)},//0x10}, //Upside/mirr/Pclk inv/sub - - {0x5f , 0x11}, //Bayer order - {0xfd , 0x01}, //P1 -//{0x20 , 0x68}, -//{0x21 , 0x68}, -//{0x22 , 0x7f}, -//{0x23 , 0x30}, - - - {0x25 , 0x1a}, //Awb start - {0x26 , 0xfb}, - {0x28 , 0x75}, - {0x29 , 0x4e}, - {0xfd , 0x00}, - {0xe7 , 0x03}, - {0xe7 , 0x00}, - {0xfd , 0x01}, - - {0x31 , 0x60},//64 - {0x32 , 0x18}, - {0x4d , 0xdc}, - {0x4e , 0x53}, - {0x41 , 0x8c}, - {0x42 , 0x57}, - {0x55 , 0xff}, - {0x56 , 0x00}, - {0x59 , 0x82}, - {0x5a , 0x00}, - {0x5d , 0xff}, - {0x5e , 0x6f}, - {0x57 , 0xff}, - {0x58 , 0x00}, - {0x5b , 0xff}, - {0x5c , 0xa8}, - {0x5f , 0x75}, - {0x60 , 0x00}, - {0x2d , 0x00}, - {0x2e , 0x00}, - {0x2f , 0x00}, - {0x30 , 0x00}, - {0x33 , 0x00}, - {0x34 , 0x00}, - {0x37 , 0x00}, - {0x38 , 0x00}, //awb end - {0xfd , 0x00}, //P0 - {0x33 , 0x6f}, //LSC BPC EN // 0x6f pzt 2012-7-26 - {0x51 , 0x3f}, //BPC debug start - {0x52 , 0x09}, - {0x53 , 0x00}, - {0x54 , 0x00}, - {0x55 , 0x10}, //BPC debug end - {0x4f , 0xff}, //blueedge - {0x50 , 0xff}, - {0x57 , 0x10}, //Raw filter debut start - {0x58 , 0x10}, - {0x59 , 0x10}, - {0x56 , 0x71}, //0x70 modify by sp_yjp,20120613 - - {0x5a , 0x06}, //{0x5a , 0x02}, //0x05 modify by sp_yjp,20130709 - {0x5b , 0x08},// {0x5b , 0x02}, //0x06 modify by sp_yjp,20130709 - {0x5c , 0x30}, //Raw filter debut end //0x20 modify by sp_yjp,20120613 - - {0x65 , 0x04}, //Sharpness debug start //0x03 modify by sp_yjp,20130709 - {0x66 , 0x01}, // {0x66 , 0x01},sp_wyq - {0x67 , 0x08},// {0x67 , 0x03}, //0x05 //modify by sp_yjp,20120613 - {0x68 , 0x46},// {0x68 , 0x46},//0x46 zch 20120725 - - {0x69 , 0x7f}, - {0x6a , 0x01}, - - {0x6b , 0x04},//{0x6b , 0x04}, //0x06 modify by sp_yjp,20130709 - {0x6c , 0x01}, - {0x6d , 0x06}, //Edge gain normal {0x6d , 0x03}, //0x05 //modify by sp_yjp,20120613 - {0x6e , 0x46}, //Edge gain normal {0x6e , 0x46}, //0x46 zch 20120725 - - {0x6f , 0x7f}, - {0x70 , 0x01}, - - {0x71 , 0x0a}, //ï�����ֵ//0x09 modify by sp_yjp,20130709 - {0x72 , 0x01}, //�ï½ï¿½ï¿½ï¿½ï¿½Ö? - {0x73 , 0x02}, //? //0x05 //modify by sp_yjp,20120613 - {0x74 , 0x43}, //ï¿//0x47? //modify by sp_yjp,20120613 - - - {0x75 , 0x7f}, //ʹÿ¿½ÿ¿½Î» - {0x76 , 0x01}, //Sharpness debug end - {0xcb , 0x07}, //HEQ&Saturation debug start - {0xcc , 0x04}, - {0xce , 0xff}, - {0xcf , 0x10}, - {0xd0 , 0x20}, - {0xd1 , 0x00}, - {0xd2 , 0x1c}, - {0xd3 , 0x16}, - {0xd4 , 0x00}, - {0xd6 , 0x1c}, - {0xd7 , 0x16}, - {0xdc , 0x08}, - {0xdd , 0x70}, //Contrast //0x70 //modify by sp_yjp,20130709 - {0xde , 0xa0}, //HEQ&Saturation debug end //0x90 //modify by sp_yjp,20130709 - - #if 0 - {0x7f , 0xe1}, //Color Correction start - {0x80 , 0xbc}, - {0x81 , 0xe3}, - {0x82 , 0xd7}, - {0x83 , 0xd5}, - {0x84 , 0xd4}, - {0x85 , 0xff}, - {0x86 , 0x89}, - {0x87 , 0xf8}, - {0x88 , 0x3c}, - {0x89 , 0x33}, - {0x8a , 0x0f}, //Color Correction end - #endif - - -#if 0//ÉÔºì - {0x7f , 0xee}, //Color Correction start - {0x80 , 0xc9}, - {0x81 , 0xc9}, - {0x82 , 0xd7}, - {0x83 , 0xe5}, - {0x84 , 0xc4}, - {0x85 , 0x07}, - {0x86 , 0x9a}, - {0x87 , 0xde}, - {0x88 , 0x3c}, - {0x89 , 0x33}, - {0x8a , 0x0c}, //Color Correction end -#endif - - -#if 1 -{0x7f , 0xf4},//0xed//0xe1 //Color Correction start -{0x80 , 0xbc},//0xbc//0xbc -{0x81 , 0xd0},//0xd7//0xe3 -{0x82 , 0xbe},//0xbe//0xd7 -{0x83 , 0xd5},//0xd5//0xd5 -{0x84 , 0xee},//0xee//0xd4 -{0x85 , 0xec},//0xf3//0xff -{0x86 , 0xb6},//0xaf//0x89 -{0x87 , 0xde},//0xdf//0xf8 -{0x88 , 0x3c},//0x3c//0x3c -{0x89 , 0x33},//0x33//0x33 -{0x8a , 0x0f},//0x0f//0x0f //Color Correction end -#endif - - - {0x8b , 0x00}, //gamma start - {0x8c , 0x1a}, - {0x8d , 0x29}, - {0x8e , 0x41}, - {0x8f , 0x62}, - {0x90 , 0x7c}, - {0x91 , 0x90}, - {0x92 , 0xa2}, - {0x93 , 0xaf}, - {0x94 , 0xbc}, - {0x95 , 0xc5}, - {0x96 , 0xcd}, - {0x97 , 0xd5}, - {0x98 , 0xda}, - {0x99 , 0xe3}, - {0x9a , 0xe8}, - {0x9b , 0xf0}, - {0xfd , 0x01}, //P1 - {0x8d , 0xf6}, - {0x8e , 0xfa}, //gamma end - {0xfd , 0x00}, //P0 - {0xca , 0xcf}, - - #if 0 - {0xd8 , 0x58}, //UV outdoor - {0xd9 , 0x58}, //UV indoor - {0xda , 0x50}, //UV dummy //0x48 //modify by sp_yjp,20120613 - {0xdb , 0x40}, //UV lowlight //0x48 //modify by sp_yjp,20120613 - #else - {0xd8 , 0x58}, //UV outdoor - {0xd9 , 0x58}, //UV indoor - {0xda , 0x50}, //UV dummy //0x48 //modify by sp_yjp,20120613 - {0xdb , 0x50}, //UV lowlight //0x48 //modify by sp_yjp,20120613 - #endif - - {0xb9 , 0x00}, //Ygamma start - {0xba , 0x04}, - {0xbb , 0x08}, - {0xbc , 0x10}, - {0xbd , 0x20}, - {0xbe , 0x30}, - {0xbf , 0x40}, - {0xc0 , 0x50}, - {0xc1 , 0x60}, - {0xc2 , 0x70}, - {0xc3 , 0x80}, - {0xc4 , 0x90}, - {0xc5 , 0xA0}, - {0xc6 , 0xB0}, - {0xc7 , 0xC0}, - {0xc8 , 0xD0}, - {0xc9 , 0xE0}, - {0xfd , 0x01}, //P1 - {0x89 , 0xf0}, - {0x8a , 0xff}, //Ygamma end - {0xfd , 0x00}, //P0 - {0xe8 , 0x30}, //AEdebug start - {0xe9 , 0x30}, - {0xea , 0x40}, //Alc Window sel - {0xf4 , 0x1b}, //outdoor mode sel - {0xf5 , 0x80}, - - ///{0xf7 , 0x78}, //AE target - ///{0xf8 , 0x63}, - ///{0xf9 , 0x68}, //AE target - ///{0xfa , 0x53}, - - #if 1 - {0xf7 , 0x88}, //AE target //modify by sp_yjp,20130709 - {0xf8 , 0x73}, - {0xf9 , 0x78}, //AE target - {0xfa , 0x63}, - #else - {0xf7 , 0x80}, //AE target //modify by sp_yjp,20120613 - {0xf8 , 0x6b}, - {0xf9 , 0x70}, //AE target - {0xfa , 0x5b}, - #endif - - {0xfd , 0x01}, //P1 - {0x09 , 0x31}, //AE Step 3.0 - {0x0a , 0x85}, - {0x0b , 0x0b}, //AE Step 3.0 - {0x14 , 0x20}, - {0x15 , 0x0f}, - - /* -#if 0//24M 1div 50HZ 16-8fps //modify by sp_yjp,20120613 - {0xfd , 0x00}, - {0x05 , 0x0 }, - {0x06 , 0x0 }, - {0x09 , 0x2 }, - {0x0a , 0x9d}, - {0xf0 , 0x4f}, - {0xf1 , 0x0 }, - {0xf2 , 0x5b}, - {0xf5 , 0x74}, - {0xfd , 0x01}, - {0x00 , 0xae}, - {0x0f , 0x5c}, - {0x16 , 0x5c}, - {0x17 , 0x9e}, - {0x18 , 0xa6}, - {0x1b , 0x5c}, - {0x1c , 0xa6}, - {0xb4 , 0x21}, - {0xb5 , 0x3b}, - {0xb6 , 0x4b}, - {0xb9 , 0x40}, - {0xba , 0x4f}, - {0xbb , 0x47}, - {0xbc , 0x45}, - {0xbd , 0x43}, - {0xbe , 0x42}, - {0xbf , 0x42}, - {0xc0 , 0x42}, - {0xc1 , 0x41}, - {0xc2 , 0x41}, - {0xc3 , 0x41}, - {0xc4 , 0x41}, - {0xc5 , 0x70}, //0x70 - {0xc6 , 0x41}, - {0xca , 0x70}, //0x70 - {0xcb , 0xc }, - {0xfd , 0x00}, -#else//caprure preview daylight 24M 50hz 20-8FPS maxgain:0x70 - {0xfd , 0x00}, - {0x05 , 0x0 }, - {0x06 , 0x0 }, - {0x09 , 0x1 }, - {0x0a , 0x76}, - {0xf0 , 0x62}, - {0xf1 , 0x0 }, - {0xf2 , 0x5f}, - {0xf5 , 0x78}, - {0xfd , 0x01}, - {0x00 , 0xb2}, - {0x0f , 0x60}, - {0x16 , 0x60}, - {0x17 , 0xa2}, - {0x18 , 0xaa}, - {0x1b , 0x60}, - {0x1c , 0xaa}, - {0xb4 , 0x20}, - {0xb5 , 0x3a}, - {0xb6 , 0x5e}, - {0xb9 , 0x40}, - {0xba , 0x4f}, - {0xbb , 0x47}, - {0xbc , 0x45}, - {0xbd , 0x43}, - {0xbe , 0x42}, - {0xbf , 0x42}, - {0xc0 , 0x42}, - {0xc1 , 0x41}, - {0xc2 , 0x41}, - {0xc3 , 0x41}, - {0xc4 , 0x41}, - {0xc5 , 0x70}, - {0xc6 , 0x41}, - {0xca , 0x70}, - {0xcb , 0xc }, - {0xfd , 0x00}, -#endif - */ - #if 0//zch 20130709 - //caprure preview daylight 24M 50hz 15-10FPS maxgain:0x68 - {0xfd,0x00}, - {0x05,0x00}, - {0x06,0x00}, - {0x09,0x03}, - {0x0a,0x04}, - {0xf0,0x4a}, - {0xf1,0x00}, - {0xf2,0x59}, - {0xf5,0x72}, - {0xfd,0x01}, - {0x00,0xa0}, - {0x0f,0x5a}, - {0x16,0x5a}, - {0x17,0x98}, - {0x18,0xa0}, - {0x1b,0x5a}, - {0x1c,0xa0}, - {0xb4,0x20}, - {0xb5,0x3a}, - {0xb6,0x46}, - {0xb9,0x40}, - {0xba,0x4f}, - {0xbb,0x47}, - {0xbc,0x45}, - {0xbd,0x43}, - {0xbe,0x42}, - {0xbf,0x42}, - {0xc0,0x42}, - {0xc1,0x41}, - {0xc2,0x41}, - {0xc3,0x68}, - {0xc4,0x41}, - {0xc5,0x41}, - {0xc6,0x41}, - {0xca,0x68}, - {0xcb,0x0a}, - {0xfd,0x00}, - #endif - - #if 0//2/1/2 ISP9-12fps - {0xfd,0x00}, - {0x05,0x00}, - {0x06,0x00}, - {0x09,0x00}, - {0x0a,0xa7}, - {0xf0,0x3b}, - {0xf1,0x00}, - {0xf2,0x56}, - {0xf5,0x6f}, - {0xfd,0x01}, - {0x00,0xa9}, - {0x0f,0x57}, - {0x16,0x57}, - {0x17,0x99}, - {0x18,0xa1}, - {0x1b,0x57}, - {0x1c,0xa1}, - {0xb4,0x21}, - {0xb5,0x39}, - {0xb6,0x39}, - {0xb9,0x40}, - {0xba,0x4f}, - {0xbb,0x47}, - {0xbc,0x45}, - {0xbd,0x43}, - {0xbe,0x42}, - {0xbf,0x42}, - {0xc0,0x42}, - {0xc1,0x41}, - {0xc2,0x41}, - {0xc3,0x41}, - {0xc4,0x41}, - {0xc5,0x70}, - {0xc6,0x41}, - {0xca,0x70}, - {0xcb,0x0c}, - {0xfd,0x00}, - - #endif - -#if 0//10-12fps -{0xfd,0x00}, -{0x05,0x00}, -{0x06,0x00}, -{0x09,0x00}, -{0x0a,0xa7}, -{0xf0,0x3b}, -{0xf1,0x00}, -{0xf2,0x56}, -{0xf5,0x6f}, -{0xfd,0x01}, -{0x00,0xa7}, -{0x0f,0x57}, -{0x16,0x57}, -{0x17,0x97}, -{0x18,0x9f}, -{0x1b,0x57}, -{0x1c,0x9f}, -{0xb4,0x21}, -{0xb5,0x39}, -{0xb6,0x39}, -{0xb9,0x40}, -{0xba,0x4f}, -{0xbb,0x47}, -{0xbc,0x45}, -{0xbd,0x43}, -{0xbe,0x42}, -{0xbf,0x42}, -{0xc0,0x42}, -{0xc1,0x41}, -{0xc2,0x41}, -{0xc3,0x41}, -{0xc4,0x70}, -{0xc5,0x41}, -{0xc6,0x41}, -{0xca,0x70}, -{0xcb,0x0b}, -{0xfd,0x00}, - -#endif - - -#if 1 -//sensor AE settings:6-11fps -{0xfd,0x00}, -{0x05,0x00}, -{0x06,0x00}, -{0x09,0x01}, -{0x0a,0x05}, -{0xf0,0x36}, -{0xf1,0x00}, -{0xf2,0x53}, -{0xf5,0x6c}, -{0xfd,0x01}, -{0x00,0x9c}, -{0x0f,0x54}, -{0x16,0x54}, -{0x17,0x9c}, -{0x18,0x00}, -{0x1b,0x54}, -{0x1c,0x43}, -{0xb4,0x20}, -{0xb5,0x34}, -{0xb6,0x34}, -{0xb9,0x40}, -{0xba,0x4f}, -{0xbb,0x47}, -{0xbc,0x45}, -{0xbd,0x43}, -{0xbe,0x42}, -{0xbf,0x42}, -{0xc0,0x42}, -{0xc1,0x41}, -{0xc2,0x41}, -{0xc3,0x41}, -{0xc4,0x41}, -{0xc5,0x41}, -{0xc6,0x41}, -{0xca,0x60}, -{0xcb,0x10}, -{0xfd,0x00}, -#endif - //added by yaowei@2013-06-05 - //{0xfd,0x00}, //P0 - //{0xd9,0x55}, - //{0xda,0x55}, - //{0xdb,0x55}, - //{0xdc,0xe0}, - - - {0xfd , 0x00}, //P0 - {0x32 , 0x15}, //Auto_mode set - {0x34 , 0x66}, //Isp_mode set - {0x35 , 0x40}, //out format - {0xfd , 0x00}, //P0 - SensorEnd -}; - - -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={ - - {0x47, 0x00}, - {0x48, 0x00}, - {0x49, 0x01}, - {0x4a, 0xe0}, - {0x4b, 0x00}, - {0x4c, 0x00}, - {0x4d, 0x02}, - {0x4e, 0x80}, - SensorEnd -}; -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] ={ - SensorEnd -}; -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data[] = -{ - {0x47, 0x00}, - {0x48, 0x00}, - {0x49, 0x01}, - {0x4a, 0xe0}, - {0x4b, 0x00}, - {0x4c, 0x00}, - {0x4d, 0x02}, - {0x4e, 0x80}, - - SensorEnd -}; -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[]={ - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[]={ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_softreset_data[]={ - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[]={ - SensorRegVal(0x02,0x27), - SensorEnd -}; - -///=========sp0838-modify by sp_yjp,20120529================= - -static struct rk_sensor_reg sensor_WhiteB_Auto[]= -{ - //sp0838_reg_WB_auto �Զ� - {0xfd, 0x01}, - {0x28, 0x75}, - {0x29, 0x4e}, - {0xfd, 0x00}, // AUTO 3000K~7000K - {0x32, 0x15}, - {0xfd, 0x00}, - SensorEnd -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[]= -{ - // sp0838_reg_WB_auto ���� - {0xfd, 0x00}, - {0x32, 0x05}, - {0xfd, 0x01}, - {0x28, 0x71}, - {0x29, 0x41}, - {0xfd, 0x00}, - SensorEnd -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[]= -{ - //Sunny - // sp0838_reg_WB_auto ���� - {0xfd, 0x00}, - {0x32, 0x05}, - {0xfd, 0x01}, - {0x28, 0x6b}, - {0x29, 0x48}, - {0xfd, 0x00}, - SensorEnd -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]= -{ - //Office - //sp0838_reg_WB_auto ӫ���� - {0xfd, 0x00}, - {0x32, 0x05}, - {0xfd, 0x01}, - {0x28, 0x41}, - {0x29, 0x71}, - {0xfd, 0x00}, - SensorEnd -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]= -{ - //Home - //sp0838_reg_WB_auto �׳��� - {0xfd, 0x00}, - {0x32, 0x05}, - {0xfd, 0x01}, - {0x28, 0x5a}, - {0x29, 0x62}, - {0xfd, 0x00}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; - -///=========sp0838-modify by sp_yjp,20120529================= -static struct rk_sensor_reg sensor_Brightness0[]= -{ - // Brightness -2 - {0xfd, 0x00}, - {0xdc, 0xe0}, - {0xfd, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[]= -{ - // Brightness -1 - {0xfd, 0x00}, - {0xdc, 0xf0}, - {0xfd, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[]= -{ - // Brightness 0 - {0xfd, 0x00}, - {0xdc, 0x10}, - {0xfd, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[]= -{ - // Brightness +1 - {0xfd, 0x00}, - {0xdc, 0x10}, - {0xfd, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[]= -{ - // Brightness +2 - {0xfd, 0x00}, - {0xdc, 0x20}, - {0xfd, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[]= -{ - // Brightness +3 - {0xfd, 0x00}, - {0xdc, 0x30}, - {0xfd, 0x00}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -///=========sp0838-modify by sp_yjp,20120529================= -static struct rk_sensor_reg sensor_Effect_Normal[] = -{ - {0xfd, 0x00}, - {0x62, 0x00}, - {0x63, 0x80}, - {0x64, 0x80}, - {0xfd, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = -{ - {0xfd, 0x00}, - {0x62, 0x40}, - {0x63, 0x80}, - {0x64, 0x80}, - {0xfd, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = -{ - {0xfd, 0x00}, - {0x62, 0x20}, - {0x63, 0xc0}, - {0x64, 0x20}, - {0xfd, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Negative[] = -{ - //Negative - {0xfd, 0x00}, - {0x62, 0x10}, - {0x63, 0x80}, - {0x64, 0x80}, - {0xfd, 0x00}, - SensorEnd -}; -static struct rk_sensor_reg sensor_Effect_Bluish[] = -{ - // Bluish - {0xfd, 0x00}, - {0x62, 0x20}, - {0x63, 0x20}, - {0x64, 0xf0}, - {0xfd, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = -{ - // Greenish - {0xfd, 0x00}, - {0x62, 0x20}, - {0x63, 0x20}, - {0x64, 0x20}, - {0xfd, 0x00}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; - -///=========sp0838-modify by sp_yjp,20120529================= -static struct rk_sensor_reg sensor_Exposure0[]= -{ - {0xfd, 0x00}, - {0xdc, 0xd0}, - {0xfd, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure1[]= -{ - {0xfd, 0x00}, - {0xdc, 0xe0}, - {0xfd, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure2[]= -{ - {0xfd, 0x00}, - {0xdc, 0xf0}, - {0xfd, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure3[]= -{ - {0xfd, 0x00}, - {0xdc, 0x10}, - {0xfd, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure4[]= -{ - {0xfd, 0x00}, - {0xdc, 0x10}, - {0xfd, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure5[]= -{ - {0xfd, 0x00}, - {0xdc, 0x20}, - {0xfd, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure6[]= -{ - {0xfd, 0x00}, - {0xdc, 0x30}, - {0xfd, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; - -///=========sp0838-modify by sp_yjp,20120529================= -static struct rk_sensor_reg sensor_Saturation0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -///=========sp0838-modify by sp_yjp,20120529================= -static struct rk_sensor_reg sensor_Contrast0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast2[]= -{ -SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast3[]= -{ -SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast4[]= -{ -SensorEnd -}; - - -static struct rk_sensor_reg sensor_Contrast5[]= -{ -SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast6[]= -{ -SensorEnd -}; - - - - -static struct rk_sensor_reg *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - - -/* -///=========sp0838-modify by sp_yjp,20120529================= -static struct rk_sensor_reg sensor_MirrorOn[]= -{ - {0xfd, 0x00}, //page 0 - {0x31, 0x30}, //bit6:flip bit5:mirror bit4:pclk - {0xfd, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_MirrorOff[]= -{ - {0xfd, 0x00}, //page 0 - {0x31, 0x10}, - {0xfd, 0x00}, - SensorEnd -}; -//static struct rk_sensor_reg *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; - -static struct rk_sensor_reg sensor_FlipOn[]= -{ - {0xfd, 0x00}, //page 0 - {0x31, 0x50}, - {0xfd, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_FlipOff[]= -{ - {0xfd, 0x00}, //page 0 - {0x31, 0x10}, - {0xfd, 0x00}, - SensorEnd -};*/ -//static struct rk_sensor_reg *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -///=========sp0838-modify by sp_yjp,20120529================= - -static struct rk_sensor_reg sensor_SceneAuto[] = -{ -#if 0 -//caprure preview daylight 24M 50hz 20-10FPS maxgain:0x70 -{0xfd,0x00}, -{0x05,0x00}, -{0x06,0x00}, -{0x07,0x00}, -{0x08,0x00}, -{0x09,0x01}, -{0x0a,0x76}, -{0xf0,0x62}, -{0xf1,0x00}, -{0xf2,0x5f}, -{0xf5,0x78}, -{0xfd,0x01}, -{0x00,0xae}, -{0x0f,0x60}, -{0x16,0x60}, -{0x17,0x9e}, -{0x18,0xa6}, -{0x1b,0x60}, -{0x1c,0xa6}, -{0xb4,0x20}, -{0xb5,0x3a}, -{0xb6,0x5e}, -{0xb9,0x40}, -{0xba,0x4f}, -{0xbb,0x47}, -{0xbc,0x45}, -{0xbd,0x43}, -{0xbe,0x42}, -{0xbf,0x42}, -{0xc0,0x42}, -{0xc1,0x41}, -{0xc2,0x41}, -{0xc3,0x70}, -{0xc4,0x41}, -{0xc5,0x41}, -{0xc6,0x41}, -{0xca,0x70}, -{0xcb,0x0a}, -{0x14,0x20}, -{0x15,0x0f}, -{0xfd,0x00}, -#endif -#if 0//9-12 - -{0xfd,0x00}, -{0x05,0x00}, -{0x06,0x00}, -{0x09,0x00}, -{0x0a,0xa7}, -{0xf0,0x3b}, -{0xf1,0x00}, -{0xf2,0x56}, -{0xf5,0x6f}, -{0xfd,0x01}, -{0x00,0xa9}, -{0x0f,0x57}, -{0x16,0x57}, -{0x17,0x99}, -{0x18,0xa1}, -{0x1b,0x57}, -{0x1c,0xa1}, -{0xb4,0x21}, -{0xb5,0x39}, -{0xb6,0x39}, -{0xb9,0x40}, -{0xba,0x4f}, -{0xbb,0x47}, -{0xbc,0x45}, -{0xbd,0x43}, -{0xbe,0x42}, -{0xbf,0x42}, -{0xc0,0x42}, -{0xc1,0x41}, -{0xc2,0x41}, -{0xc3,0x41}, -{0xc4,0x41}, -{0xc5,0x70}, -{0xc6,0x41}, -{0xca,0x70}, -{0xcb,0x0c}, -{0xfd,0x00}, -#endif - -#if 0//10-12 -{0xfd,0x00}, -{0x05,0x00}, -{0x06,0x00}, -{0x09,0x00}, -{0x0a,0xa7}, -{0xf0,0x3b}, -{0xf1,0x00}, -{0xf2,0x56}, -{0xf5,0x6f}, -{0xfd,0x01}, -{0x00,0xa7}, -{0x0f,0x57}, -{0x16,0x57}, -{0x17,0x97}, -{0x18,0x9f}, -{0x1b,0x57}, -{0x1c,0x9f}, -{0xb4,0x21}, -{0xb5,0x39}, -{0xb6,0x39}, -{0xb9,0x40}, -{0xba,0x4f}, -{0xbb,0x47}, -{0xbc,0x45}, -{0xbd,0x43}, -{0xbe,0x42}, -{0xbf,0x42}, -{0xc0,0x42}, -{0xc1,0x41}, -{0xc2,0x41}, -{0xc3,0x41}, -{0xc4,0x70}, -{0xc5,0x41}, -{0xc6,0x41}, -{0xca,0x70}, -{0xcb,0x0b}, -{0xfd,0x00}, - -#endif - -#if 1 - -//sensor AE settings:6-11fps -{0xfd,0x00}, -{0x05,0x00}, -{0x06,0x00}, -{0x09,0x01}, -{0x0a,0x05}, -{0xf0,0x36}, -{0xf1,0x00}, -{0xf2,0x53}, -{0xf5,0x6c}, -{0xfd,0x01}, -{0x00,0x9c}, -{0x0f,0x54}, -{0x16,0x54}, -{0x17,0x9c}, -{0x18,0x00}, -{0x1b,0x54}, -{0x1c,0x43}, -{0xb4,0x20}, -{0xb5,0x34}, -{0xb6,0x34}, -{0xb9,0x40}, -{0xba,0x4f}, -{0xbb,0x47}, -{0xbc,0x45}, -{0xbd,0x43}, -{0xbe,0x42}, -{0xbf,0x42}, -{0xc0,0x42}, -{0xc1,0x41}, -{0xc2,0x41}, -{0xc3,0x41}, -{0xc4,0x41}, -{0xc5,0x41}, -{0xc6,0x41}, -{0xca,0x60}, -{0xcb,0x10}, -{0xfd,0x00}, - -#endif - -SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = -{ -#if 0 - //caprure preview night 24M 50hz 20-6FPS maxgain:0x78 - {0xfd,0x00}, - {0x05,0x0 }, - {0x06,0x0 }, - {0x09,0x1 }, - {0x0a,0x76}, - {0xf0,0x62}, - {0xf1,0x0 }, - {0xf2,0x5f}, - {0xf5,0x78}, - {0xfd,0x01}, - {0x00,0xc0}, - {0x0f,0x60}, - {0x16,0x60}, - {0x17,0xa8}, - {0x18,0xb0}, - {0x1b,0x60}, - {0x1c,0xb0}, - {0xb4,0x20}, - {0xb5,0x3a}, - {0xb6,0x5e}, - {0xb9,0x40}, - {0xba,0x4f}, - {0xbb,0x47}, - {0xbc,0x45}, - {0xbd,0x43}, - {0xbe,0x42}, - {0xbf,0x42}, - {0xc0,0x42}, - {0xc1,0x41}, - {0xc2,0x41}, - {0xc3,0x41}, - {0xc4,0x41}, - {0xc5,0x41}, - {0xc6,0x41}, - {0xca,0x78}, - {0xcb,0x10}, - {0x14,0x20}, - {0x15,0x1f}, - {0xfd,0x00}, - #endif - #if 0 - {0xfd,0x00}, - {0x05,0x00}, - {0x06,0x00}, - {0x09,0x00}, - {0x0a,0xa7}, - {0xf0,0x3b}, - {0xf1,0x00}, - {0xf2,0x56}, - {0xf5,0x6f}, - {0xfd,0x01}, - {0x00,0xaf}, - {0x0f,0x57}, - {0x16,0x57}, - {0x17,0x9f}, - {0x18,0xa7}, - {0x1b,0x57}, - {0x1c,0xa7}, - {0xb4,0x21}, - {0xb5,0x39}, - {0xb6,0x39}, - {0xb9,0x40}, - {0xba,0x4f}, - {0xbb,0x47}, - {0xbc,0x45}, - {0xbd,0x43}, - {0xbe,0x42}, - {0xbf,0x42}, - {0xc0,0x42}, - {0xc1,0x41}, - {0xc2,0x41}, - {0xc3,0x41}, - {0xc4,0x41}, - {0xc5,0x41}, - - #endif - -#if 1 - -//sensor AE settings:6-11fps -{0xfd,0x00}, -{0x05,0x00}, -{0x06,0x00}, -{0x09,0x01}, -{0x0a,0x05}, -{0xf0,0x36}, -{0xf1,0x00}, -{0xf2,0x53}, -{0xf5,0x6c}, -{0xfd,0x01}, -{0x00,0x9c}, -{0x0f,0x54}, -{0x16,0x54}, -{0x17,0x9c}, -{0x18,0x00}, -{0x1b,0x54}, -{0x1c,0x43}, -{0xb4,0x20}, -{0xb5,0x34}, -{0xb6,0x34}, -{0xb9,0x40}, -{0xba,0x4f}, -{0xbb,0x47}, -{0xbc,0x45}, -{0xbd,0x43}, -{0xbe,0x42}, -{0xbf,0x42}, -{0xc0,0x42}, -{0xc1,0x41}, -{0xc2,0x41}, -{0xc3,0x41}, -{0xc4,0x41}, -{0xc5,0x41}, -{0xc6,0x41}, -{0xca,0x60}, -{0xcb,0x10}, -{0xfd,0x00}, - - -#endif - -SensorEnd -}; - -static struct rk_sensor_reg *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -///=========sp0838-modify by sp_yjp,20120529================= -static struct rk_sensor_reg sensor_Zoom0[] = -{ -SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = -{ -SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = -{ -SensorEnd -}; - - -static struct rk_sensor_reg sensor_Zoom3[] = -{ -SensorEnd -}; -static struct rk_sensor_reg *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; - - -///=========sp0838-modify by sp_yjp,20120529================= -static struct v4l2_querymenu sensor_menus[] = -{ -}; -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = -{ -}; - -//MUST define the current used format as the first item -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {MEDIA_BUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; -//static struct soc_camera_ops sensor_ops; - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ - -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - - SENSOR_DG("%s",__FUNCTION__); - - - return 0; -} -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - //struct generic_sensor *sensor = to_generic_sensor(client); - - SENSOR_DG("%s",__FUNCTION__); - - return 0; -} -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - return 0; -} -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh (struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - return 0; -} -static int sensor_softrest_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - return 0; -} -static int sensor_try_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf) -{ - return 0; -} - -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("Suspend"); - - } else { - SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n",pm_msg.event); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - - SENSOR_DG("Resume"); - - return 0; - -} -static int sensor_mirror_cb (struct i2c_client *client, int mirror) -{ - int err = 0; - - SENSOR_DG("mirror: %d",mirror); - - - return err; -} -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_mirror_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_mirror failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_mirror success, value:0x%x",ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - int err = 0; - - SENSOR_DG("flip: %d",flip); - - return err; -} -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_flip_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_flip failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_flip success, value:0x%x",ext_ctrl->value); - return 0; -} -/* -* the functions are focus callbacks -*/ -static int sensor_focus_init_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos){ - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client){ - return 0; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos){ - return 0; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client,int on){ - return 0; -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor* spsensor,struct soc_camera_device *icd) -{ - return; -} -/* - -#define CHIP_NAME RK29_CAM_SENSOR_NAME_SP0838 -#define DBG_DIR "fcam" -#include "./add-cam-inf.c" - -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); - diff --git a/drivers/media/video/sp2518.c b/drivers/media/video/sp2518.c deleted file mode 100644 index 1614dcbd8939..000000000000 --- a/drivers/media/video/sp2518.c +++ /dev/null @@ -1,1274 +0,0 @@ -/* - * drivers/media/video/sp2518.c - * - * Copyright (C) ROCKCHIP, Inc. - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "generic_sensor.h" -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.1.1: -* add sensor_focus_af_const_pause_usr_cb; -*/ -static int version = KERNEL_VERSION(0,1,1); -module_param(version, int, S_IRUGO); - - - -static int debug; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug > level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_SP2518 -#define SENSOR_V4L2_IDENT V4L2_IDENT_SP2518 -#define SENSOR_ID 0x53 -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER |\ - V4L2_MBUS_PCLK_SAMPLE_RISING|V4L2_MBUS_HSYNC_ACTIVE_HIGH| V4L2_MBUS_VSYNC_ACTIVE_HIGH|\ - V4L2_MBUS_DATA_ACTIVE_HIGH |SOCAM_MCLK_24MHZ) -#define SENSOR_PREVIEW_W 800 -#define SENSOR_PREVIEW_H 600 -#define SENSOR_PREVIEW_FPS 15000 // 15fps -#define SENSOR_FULLRES_L_FPS 7500 // 7.5fps -#define SENSOR_FULLRES_H_FPS 7500 // 7.5fps -#define SENSOR_720P_FPS 0 -#define SENSOR_1080P_FPS 0 - -#define SENSOR_REGISTER_LEN 1 // sensor register address bytes -#define SENSOR_VALUE_LEN 1 // sensor register value bytes - -static unsigned int SensorConfiguration = (CFG_WhiteBalance|CFG_Effect|CFG_Scene); -static unsigned int SensorChipID[] = {SENSOR_ID}; -/* Sensor Driver Configuration End */ - - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a,b) CONS4(SensorReg,SENSOR_REGISTER_LEN,Val,SENSOR_VALUE_LEN)(a,b) -#define sensor_write(client,reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_read(client,reg,v) CONS4(sensor_read_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)(client,(reg),(v)) -#define sensor_write_array generic_sensor_write_array - -struct sensor_parameter -{ - unsigned int PreviewDummyPixels; - unsigned int CaptureDummyPixels; - unsigned int preview_exposure; - unsigned short int preview_line_width; - unsigned short int preview_gain; - - unsigned short int PreviewPclk; - unsigned short int CapturePclk; - char awb[6]; -}; - -struct specific_sensor{ - struct generic_sensor common_sensor; - //define user data below - struct sensor_parameter parameter; - -}; - -/* -* Local define -*/ -//AE -#define SP2518_P0_0xf7 0x80//78 -#define SP2518_P0_0xf8 0x74//6e -#define SP2518_P0_0xf9 0x80//74 -#define SP2518_P0_0xfa 0x74//6a -//HEQ -#define SP2518_P0_0xdd 0x80 -#define SP2518_P0_0xde 0x95 -//auto lum -#define SP2518_NORMAL_Y0ffset 0x10 //0x0f modify by sp_yjp,20120813 -#define SP2518_LOWLIGHT_Y0ffset 0x20 - -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ - -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_init_data[] = { - {0xfd,0x00}, - {0x1b,0x1a},//maximum drv ability //0x02 modify by sp_yjp,20120809 - {0x0e,0x01}, - - {0x0f,0x2f}, - {0x10,0x2e}, - {0x11,0x00}, - {0x12,0x4f}, - {0x14,0x40},// 0x20 zch 20120920 - {0x16,0x02}, - {0x17,0x10}, - {0x1a,0x1f}, - {0x1e,0x81}, - {0x21,0x00}, - {0x22,0x1b}, - {0x25,0x10}, - {0x26,0x25}, - {0x27,0x6d}, - {0x2c,0x23},//31 Ronlus remove balck dot0x45}, - {0x2d,0x75}, - {0x2e,0x38},//sxga 0x18 - - {0x31,0x10},//mirror upside down - {0x44,0x03}, - {0x6f,0x00}, - {0xa0,0x04}, - {0x5f,0x01}, - {0x32,0x00}, - {0xfd,0x01}, - {0x2c,0x00}, - {0x2d,0x00}, - {0xfd,0x00}, - {0xfb,0x83}, - {0xf4,0x09}, - //Pregain - {0xfd,0x01}, - {0xc6,0x90}, - {0xc7,0x90}, - {0xc8,0x90}, - {0xc9,0x90}, - //blacklevel - {0xfd,0x00}, - {0x65,0x08}, - {0x66,0x08}, - {0x67,0x08}, - {0x68,0x08}, - - //bpc - {0x46,0xff}, - //rpc - {0xfd,0x00}, - {0xe0,0x6c}, - {0xe1,0x54}, - {0xe2,0x48}, - {0xe3,0x40}, - {0xe4,0x40}, - {0xe5,0x3e}, - {0xe6,0x3e}, - {0xe8,0x3a}, - {0xe9,0x3a}, - {0xea,0x3a}, - {0xeb,0x38}, - {0xf5,0x38}, - {0xf6,0x38}, - {0xfd,0x01}, - {0x94,0xc0},//f8 - {0x95,0x38}, - {0x9c,0x6c}, - {0x9d,0x38}, - #if 0 - ///SP2518 UXGA 24MEclk 3±¶Æµ 1·ÖƵ 50Hz fix 10fps - {0xfd , 0x00}, - {0x03 , 0x03}, - {0x04 , 0x66}, - {0x05 , 0x00}, - {0x06 , 0x8b}, - {0x07 , 0x00}, - {0x08 , 0x8b}, - {0x09 , 0x01}, - {0x0a , 0x3b}, - {0x2f , 0x00}, - {0x30 , 0x08}, - {0xf0 , 0x91}, - {0xf1 , 0x00}, - {0xfd , 0x01}, - {0x90 , 0x0a}, - {0x92 , 0x01}, - {0x98 , 0x91}, - {0x99 , 0x00}, - {0x9a , 0x01}, - {0x9b , 0x00}, - ///Status - {0xfd , 0x01}, - {0xce , 0xaa}, - {0xcf , 0x05}, - {0xd0 , 0xaa}, - {0xd1 , 0x05}, - {0xd7 , 0x93},//8d - {0xd8 , 0x00}, - {0xd9 , 0x97},//91 - {0xda , 0x00}, - {0xfd , 0x00}, - #endif - - #if 1 - /*24*3pll 13-13fps 50hz*/ - - {0xfd,0x00}, - {0x03,0x03}, - {0x04,0xf6}, - {0x05,0x00}, - {0x06,0x00}, - {0x07,0x00}, - {0x08,0x00}, - {0x09,0x00}, - {0x0a,0x8b}, - {0x2f,0x00}, - {0x30,0x08}, - {0xf0,0xa9}, - {0xf1,0x00}, - {0xfd,0x01}, - {0x90,0x07}, - {0x92,0x01}, - {0x98,0xa9}, - {0x99,0x00}, - {0x9a,0x01}, - {0x9b,0x00}, - {0xfd,0x01}, - {0xce,0x9f}, - {0xcf,0x04}, - {0xd0,0x9f}, - {0xd1,0x04}, - {0xd7,0xa5}, - {0xd8,0x00}, - {0xd9,0xa9}, - {0xda,0x00}, - {0xfd,0x00}, - - #endif - - {0xfd,0x01}, - {0xca,0x30},//mean dummy2low - {0xcb,0x50},//mean low2dummy - {0xcc,0xc0},//f8;rpc low - {0xcd,0xc0},//rpc dummy - {0xd5,0x80},//mean normal2dummy - {0xd6,0x90},//mean dummy2normal - {0xfd,0x00}, - - //lens shading - {0xfd,0x00}, - {0xa1,0x20}, - {0xa2,0x20}, - {0xa3,0x20}, - {0xa4,0xff}, - {0xa5,0x80}, - {0xa6,0x80}, - {0xfd,0x01}, - {0x64,0x1e},//28 - {0x65,0x1c},//25 - {0x66,0x1c},//2a - {0x67,0x16},//25 - {0x68,0x1c},//25 - {0x69,0x1c},//29 - {0x6a,0x1a},//28 - {0x6b,0x16},//20 - {0x6c,0x1a},//22 - {0x6d,0x1a},//22 - {0x6e,0x1a},//22 - {0x6f,0x16},//1c - {0xb8,0x04},//0a - {0xb9,0x13},//0a - {0xba,0x00},//23 - {0xbb,0x03},//14 - {0xbc,0x03},//08 - {0xbd,0x11},//08 - {0xbe,0x00},//12 - {0xbf,0x02},//00 - {0xc0,0x04},//05 - {0xc1,0x0e},//05 - {0xc2,0x00},//18 - {0xc3,0x05},//08 - //raw filter - {0xfd,0x01}, - {0xde,0x0f}, - {0xfd,0x00}, - {0x57,0x08},//raw_dif_thr - {0x58,0x08},//a - {0x56,0x08},//a - {0x59,0x10}, - - {0x5a,0xa0},//raw_rb_fac_outdoor - {0xc4,0xa0},//60raw_rb_fac_indoor - {0x43,0xa0},//40raw_rb_fac_dummy - {0xad,0x40},//raw_rb_fac_low - - {0x4f,0xa0},//raw_gf_fac_outdoor - {0xc3,0xa0},//60raw_gf_fac_indoor - {0x3f,0xa0},//40raw_gf_fac_dummy - {0x42,0x40},//raw_gf_fac_low - {0xc2,0x15}, - - {0xb6,0x80},//raw_gflt_fac_outdoor - {0xb7,0x80},//60raw_gflt_fac_normal - {0xb8,0x40},//40raw_gflt_fac_dummy - {0xb9,0x20},//raw_gflt_fac_low - - {0xfd,0x01}, - {0x50,0x0c},//raw_grgb_thr - {0x51,0x0c}, - {0x52,0x10}, - {0x53,0x10}, - {0xfd,0x00}, - // awb1 - {0xfd,0x01}, - {0x11,0x10}, - {0x12,0x1f}, - {0x16,0x1c}, - {0x18,0x00}, - {0x19,0x00}, - {0x1b,0x96}, - {0x1a,0x9a},//95 - {0x1e,0x2f}, - {0x1f,0x29}, - {0x20,0xff}, - {0x22,0xff}, - {0x28,0xce}, - {0x29,0x8a}, - {0xfd,0x00}, - {0xe7,0x03}, - {0xe7,0x00}, - {0xfd,0x01}, - {0x2a,0xf0}, - {0x2b,0x10}, - {0x2e,0x04}, - {0x2f,0x18}, - {0x21,0x60}, - {0x23,0x60}, - {0x8b,0xab}, - {0x8f,0x12}, - //awb2 - {0xfd,0x01}, - {0x1a,0x80}, - {0x1b,0x80}, - {0x43,0x80}, - //outdoor - {0x00,0xd4}, - {0x01,0xb0}, - {0x02,0x90}, - {0x03,0x78}, - //d65 - {0x35,0xd6},//d6;b0 - {0x36,0xf0},//f0;d1;e9 - {0x37,0x7a},//8a;70 - {0x38,0x9a},//dc;9a;af - //indoor - {0x39,0xab}, - {0x3a,0xca}, - {0x3b,0xa3}, - {0x3c,0xc1}, - //f - {0x31,0x82},//7d - {0x32,0xa5},//a0;74 - {0x33,0xd6},//d2 - {0x34,0xec},//e8 - {0x3d,0xa5},//a7;88 - {0x3e,0xc2},//be;bb - {0x3f,0xa7},//b3;ad - {0x40,0xc5},//c5;d0 - //Color Correction - {0xfd,0x01}, - {0x1c,0xc0}, - {0x1d,0x95}, - {0xa0,0xa6},//b8 - {0xa1,0xda},//;d5 - {0xa2,0x00},//;f2 - {0xa3,0x06},//;e8 - {0xa4,0xb2},//;95 - {0xa5,0xc7},//;03 - {0xa6,0x00},//;f2 - {0xa7,0xce},//;c4 - {0xa8,0xb2},//;ca - {0xa9,0x0c},//;3c - {0xaa,0x30},//;03 - {0xab,0x0c},//;0f - {0xac,0xc0},//b8 - {0xad,0xc0},//d5 - {0xae,0x00},//f2 - {0xaf,0xf2},//e8 - {0xb0,0xa6},//95 - {0xb1,0xe8},//03 - {0xb2,0x00},//f2 - {0xb3,0xe7},//c4 - {0xb4,0x99},//ca - {0xb5,0x0c},//3c - {0xb6,0x33},//03 - {0xb7,0x0c},//0f - //Saturation - {0xfd,0x00}, - {0xbf,0x01}, - {0xbe,0xbb}, - {0xc0,0xb0}, - {0xc1,0xf0}, - - {0xd3,0x77}, - {0xd4,0x77}, - {0xd6,0x77}, - {0xd7,0x77}, - {0xd8,0x77}, - {0xd9,0x77}, - {0xda,0x77}, - {0xdb,0x77}, - //uv_dif - {0xfd,0x00}, - {0xf3,0x03}, - {0xb0,0x00}, - {0xb1,0x23}, - //gamma1 - {0xfd,0x00},// - {0x8b,0x0 },//0 ;0 - {0x8c,0xA },//14;A - {0x8d,0x13},//24;13 - {0x8e,0x25},//3a;25 - {0x8f,0x43},//59;43 - {0x90,0x5D},//6f;5D - {0x91,0x74},//84;74 - {0x92,0x88},//95;88 - {0x93,0x9A},//a3;9A - {0x94,0xA9},//b1;A9 - {0x95,0xB5},//be;B5 - {0x96,0xC0},//c7;C0 - {0x97,0xCA},//d1;CA - {0x98,0xD4},//d9;D4 - {0x99,0xDD},//e1;DD - {0x9a,0xE6},//e9;E6 - {0x9b,0xEF},//f1;EF - {0xfd,0x01},//01;01 - {0x8d,0xF7},//f9;F7 - {0x8e,0xFF},//ff;FF - //gamma2 - {0xfd,0x00},// - {0x78,0x0 },//0 - {0x79,0xA },//14 - {0x7a,0x13},//24 - {0x7b,0x25},//3a - {0x7c,0x43},//59 - {0x7d,0x5D},//6f - {0x7e,0x74},//84 - {0x7f,0x88},//95 - {0x80,0x9A},//a3 - {0x81,0xA9},//b1 - {0x82,0xB5},//be - {0x83,0xC0},//c7 - {0x84,0xCA},//d1 - {0x85,0xD4},//d9 - {0x86,0xDD},//e1 - {0x87,0xE6},//e9 - {0x88,0xEF},//f1 - {0x89,0xF7},//f9 - {0x8a,0xFF},//ff - /*//¹â°ß¹ý¶ÈºÃ - //gamma1 - {0xfd,0x00}, - {0x8b,0x00}, - {0x8c,0x14}, - {0x8d,0x24}, - {0x8e,0x3A}, - {0x8f,0x59}, - {0x90,0x70}, - {0x91,0x85}, - {0x92,0x96}, - {0x93,0xA6}, - {0x94,0xB3}, - {0x95,0xBE}, - {0x96,0xC9}, - {0x97,0xD2}, - {0x98,0xDB}, - {0x99,0xE3}, - {0x9a,0xEB}, - {0x9b,0xF2}, - {0xfd,0x01}, - {0x8d,0xF9}, - {0x8e,0xFF}, - //gamma2 - {0xfd,0x00}, - {0x78,0x00}, - {0x79,0x14}, - {0x7a,0x24}, - {0x7b,0x3A}, - {0x7c,0x59}, - {0x7d,0x70}, - {0x7e,0x85}, - {0x7f,0x96}, - {0x80,0xA6}, - {0x81,0xB3}, - {0x82,0xBE}, - {0x83,0xC9}, - {0x84,0xD2}, - {0x85,0xDB}, - {0x86,0xE3}, - {0x87,0xEB}, - {0x88,0xF2}, - {0x89,0xF9}, - {0x8a,0xFF}, -*/ - //gamma_ae - {0xfd,0x01}, - {0x96,0x46}, - {0x97,0x14}, - {0x9f,0x06}, - //HEQ - {0xfd,0x00},// - {0xdd,SP2518_P0_0xdd},//0x80 - {0xde,SP2518_P0_0xde},//a0 - {0xdf,0x80},// - //Ytarget - {0xfd,0x00},// - {0xec,0x70},//6a - {0xed,0x86},//7c - {0xee,0x70},//65 - {0xef,0x86},//78 - {0xf7,0x80},//78 - {0xf8,0x74},//6e - {0xf9,0x80},//74 - {0xfa,0x74},//6a - //sharpen - {0xfd,0x01}, - {0xdf,0x0f}, - {0xe5,0x10}, - {0xe7,0x10}, - {0xe8,0x20}, - {0xec,0x20}, - {0xe9,0x20}, - {0xed,0x20}, - {0xea,0x10}, - {0xef,0x10}, - {0xeb,0x10}, - {0xf0,0x10}, - //;gw - {0xfd,0x01},// - {0x70,0x76},// - {0x7b,0x40},// - {0x81,0x30},// - //;Y_offset - {0xfd,0x00}, - {0xb2,0X10}, - {0xb3,0x1f}, - {0xb4,0x30}, - {0xb5,0x50}, - //;CNR - {0xfd,0x00}, - {0x5b,0x20}, - {0x61,0x80}, - {0x77,0x80}, - {0xca,0x80}, - //;YNR - {0xab,0x00}, - {0xac,0x02}, - {0xae,0x08}, - {0xaf,0x20}, - {0xfd,0x00}, - {0x31,0x10}, - {0x32,0x0d}, - {0x33,0xcf},//ef - {0x34,0x7f},//3f - - {0x35,0x40},//3 - - {0x1b,0x1a}, - {0xe7,0x03}, - {0xe7,0x00}, - - //SVGA - {0xfd,0x00}, - - {0x47,0x00}, - {0x48,0x00}, - {0x49,0x04}, - {0x4a,0xb0}, - - {0x4b,0x00}, - {0x4c,0x00}, - {0x4d,0x06}, - {0x4e,0x40}, - {0xfd,0x01}, - {0x06,0x00}, - {0x07,0x40}, - {0x08,0x00}, - {0x09,0x40}, - {0x0a,0x02}, //600 - {0x0b,0x58}, - {0x0c,0x03}, //800 - {0x0d,0x20}, - {0x0e,0x01}, - {0xfd,0x00}, - {0x5d,0x0e}, //vsync delay - - SensorEnd -}; -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={ - - {0xfd,0x00}, - {0x47,0x00}, - {0x48,0x00}, - {0x49,0x04}, - {0x4a,0xb0}, - - {0x4b,0x00}, - {0x4c,0x00}, - {0x4d,0x06}, - {0x4e,0x40}, - - {0xfd,0x01}, - {0x0e,0x00}, - {0xfd,0x00}, - SensorEnd -}; -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] ={ - SensorEnd -}; -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data[] = -{ - {0xfd,0x00}, - {0x47,0x00}, - {0x48,0x00}, - {0x49,0x04}, - {0x4a,0xb0}, - {0x4b,0x00}, - {0x4c,0x00}, - {0x4d,0x06}, - {0x4e,0x40}, - {0xfd,0x01}, - {0x06,0x00}, - {0x07,0x40}, - {0x08,0x00}, - {0x09,0x40}, - {0x0a,0x02}, //600 - {0x0b,0x58}, - {0x0c,0x03}, //800 - {0x0d,0x20}, - {0x0e,0x01}, - {0xfd,0x00}, - - SensorEnd -}; -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[]={ - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[]={ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_softreset_data[]={ - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[]={ - SensorRegVal(0x02,0), - SensorEnd -}; -/* -* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx -*/ -static struct rk_sensor_reg sensor_WhiteB_Auto[]= -{ - {0xfd, 0x01}, - {0x28, 0xce}, - {0x29, 0x8a}, - {0xfd, 0x00}, - {0x32, 0x0d}, - {0xfd, 0x00}, - SensorEnd -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[]= -{ - {0xfd,0x00}, - {0x32,0x05}, - {0xfd,0x01}, - {0x28,0xe2}, - {0x29,0x82}, - {0xfd,0x00}, - {0xfd,0x00}, - SensorEnd -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[]= -{ - {0xfd,0x00}, - {0x32,0x05}, - {0xfd,0x01}, - {0x28,0xc1}, - {0x29,0x88}, - {0xfd,0x00}, - {0xfd,0x00}, - SensorEnd -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]= -{ - {0xfd,0x00}, - {0x32,0x05}, - {0xfd,0x01}, - {0x28,0x7b}, - {0x29,0xd3}, - {0xfd,0x00}, - {0xfd,0x00}, - SensorEnd - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]= -{ - //Home - {0x3406, 0x01}, - {0x3400, 0x04}, - {0x3401, 0x58}, - {0x3402, 0x04}, - {0x3403, 0x00}, - {0x3404, 0x07}, - {0x3405, 0x24}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[]= -{ - // Brightness -2 - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[]= -{ - // Brightness -1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[]= -{ - // Brightness 0 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[]= -{ - // Brightness +1 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[]= -{ - // Brightness +2 - - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[]= -{ - // Brightness +3 - - SensorEnd -}; -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = -{ - {0xfd, 0x00}, - {0x62, 0x00}, - {0x63, 0x80}, - {0x64, 0x80}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = -{ - {0xfd, 0x00}, - {0x62, 0x20}, - {0x63, 0x80}, - {0x64, 0x80}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = -{ - {0xfd, 0x00}, - {0x62, 0x10}, - {0x63, 0xb0}, - {0x64, 0x40}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Negative[] = -{ - {0xfd, 0x00}, - {0x62, 0x04}, - {0x63, 0x80}, - {0x64, 0x80}, - SensorEnd -}; -static struct rk_sensor_reg sensor_Effect_Bluish[] = -{ - {0xfd, 0x00}, - {0x62, 0x10}, - {0x63, 0x80}, - {0x64, 0xb0}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = -{ - {0xfd, 0x00}, - {0x62, 0x10}, - {0x63, 0x50}, - {0x64, 0x50}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; - -static struct rk_sensor_reg sensor_Exposure0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure2[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure3[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure4[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure5[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure6[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; - -static struct rk_sensor_reg sensor_Saturation0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -static struct rk_sensor_reg sensor_Contrast0[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast1[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast2[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast3[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast4[]= -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Contrast5[]= -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast6[]= -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; -static struct rk_sensor_reg sensor_SceneAuto[] = -{ - {0xfd, 0x00}, - {0xb2,SP2518_NORMAL_Y0ffset}, - {0xb3,0x1f}, - - //SP2518 UXGA 24MEclk 3PLL 50Hz fix13fps - - {0xfd,0x00}, - {0x03,0x03}, - {0x04,0xf6}, - {0x05,0x00}, - {0x06,0x00}, - {0x07,0x00}, - {0x08,0x00}, - {0x09,0x00}, - {0x0a,0x8b}, - {0x2f,0x00}, - {0x30,0x08}, - {0xf0,0xa9}, - {0xf1,0x00}, - {0xfd,0x01}, - {0x90,0x07}, - {0x92,0x01}, - {0x98,0xa9}, - {0x99,0x00}, - {0x9a,0x01}, - {0x9b,0x00}, - {0xfd,0x01}, - {0xce,0x9f}, - {0xcf,0x04}, - {0xd0,0x9f}, - {0xd1,0x04}, - {0xd7,0xa5}, - {0xd8,0x00}, - {0xd9,0xa9}, - {0xda,0x00}, - {0xfd,0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = -{ - {0xfd,0x00}, - {0xb2,SP2518_LOWLIGHT_Y0ffset}, - {0xb3,0x1f}, - - //SP2518 UXGA 24MEclk 3PLL 50Hz fix 6fps - {0xfd , 0x00}, - {0x03 , 0x01}, - {0x04 , 0xfe}, - {0x05 , 0x00}, - {0x06 , 0x6d}, - {0x07 , 0x00}, - {0x08 , 0x6d}, - {0x09 , 0x04}, - {0x0a , 0xa8}, - {0xf0 , 0x55}, - {0xf1 , 0x00}, - {0xfd , 0x01}, - {0x90 , 0x10}, - {0x92 , 0x01}, - {0x98 , 0x55}, - {0x99 , 0x00}, - {0x9a , 0x01}, - {0x9b , 0x00}, - ///Status - {0xfd , 0x01}, - {0xce , 0x50}, - {0xcf , 0x05}, - {0xd0 , 0x50}, - {0xd1 , 0x05}, - {0xd7 , 0x57},//51 - {0xd8 , 0x00}, - {0xd9 , 0x5b},//55 - {0xda , 0x00}, - - {0xfd,0x00}, - SensorEnd -}; -static struct rk_sensor_reg *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -static struct rk_sensor_reg sensor_Zoom0[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = -{ - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = -{ - SensorEnd -}; - - -static struct rk_sensor_reg sensor_Zoom3[] = -{ - SensorEnd -}; -static struct rk_sensor_reg *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; - -/* -* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu -*/ -static struct v4l2_querymenu sensor_menus[] = -{ -}; -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = -{ -}; - -//MUST define the current used format as the first item -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {MEDIA_BUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; -/*static struct soc_camera_ops sensor_ops;*/ - - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ - -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - - SENSOR_DG("%s",__FUNCTION__); - - - return 0; -} -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - //struct generic_sensor *sensor = to_generic_sensor(client); - - SENSOR_DG("%s",__FUNCTION__); - - return 0; -} -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - return 0; -} -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh (struct i2c_client *client,struct v4l2_mbus_framefmt *mf, bool capture) -{ - return 0; -} -static int sensor_softrest_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client,struct rk_sensor_reg *series) -{ - return 0; -} -static int sensor_try_fmt_cb_th(struct i2c_client *client,struct v4l2_mbus_framefmt *mf) -{ - return 0; -} - -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - //struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("Suspend"); - - } else { - SENSOR_TR("pm_msg.event(0x%x) != PM_EVENT_SUSPEND\n",pm_msg.event); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - - SENSOR_DG("Resume"); - - return 0; - -} -static int sensor_mirror_cb (struct i2c_client *client, int mirror) -{ - int err = 0; - - SENSOR_DG("mirror: %d",mirror); - - - return err; -} -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_mirror_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_mirror failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_mirror success, value:0x%x",ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - int err = 0; - - SENSOR_DG("flip: %d",flip); - - return err; -} -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (sensor_flip_cb(client,ext_ctrl->value) != 0) - SENSOR_TR("sensor_flip failed, value:0x%x",ext_ctrl->value); - - SENSOR_DG("sensor_flip success, value:0x%x",ext_ctrl->value); - return 0; -} -/* -* the functions are focus callbacks -*/ -static int sensor_focus_init_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client,int pos){ - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client){ - return 0; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client){ - return 0; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos) -{ - return 0; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client,int on){ - return 0; -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor* spsensor,struct soc_camera_device *icd) -{ - return; -} - -/* -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); - - diff --git a/drivers/media/video/sp2518_old.c b/drivers/media/video/sp2518_old.c deleted file mode 100755 index bd290d9ab5f5..000000000000 --- a/drivers/media/video/sp2518_old.c +++ /dev/null @@ -1,3389 +0,0 @@ - -/* - * Driver for SP2518 CMOS Image Sensor from Superpix - * - * Copyright (C) 2008, Guennadi Liakhovetski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. -* -* History Author Data -* First Version yuanjianping 2012-09-20 -* Set P0:0x14 = 0x40 zengchaohui 2012-09-20 -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -static int debug=0; -module_param(debug, int, S_IRUGO|S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt , ## arg); } while (0) - -#define SENSOR_TR(format, ...) printk(KERN_ERR format, ## __VA_ARGS__) -#define SENSOR_DG(format, ...) dprintk(1, format, ## __VA_ARGS__) - - -#define _CONS(a,b) a##b -#define CONS(a,b) _CONS(a,b) - -#define __STR(x) #x -#define _STR(x) __STR(x) -#define STR(x) _STR(x) - -#define MIN(x,y) ((xy) ? x: y) - -/* Sensor Driver Configuration */ -#define SENSOR_NAME RK29_CAM_SENSOR_SP2518 -#define SENSOR_V4L2_IDENT V4L2_IDENT_SP2518 -#define SENSOR_ID 0x53 -#define SENSOR_ID_REG 0x02 -#define SENSOR_MIN_WIDTH 176//640 -#define SENSOR_MIN_HEIGHT 144//480 -#define SENSOR_MAX_WIDTH 1600 -#define SENSOR_MAX_HEIGHT 1200 -#define SENSOR_INIT_WIDTH 800 /* Sensor pixel size for sensor_init_data array */ -#define SENSOR_INIT_HEIGHT 600 -#define SENSOR_INIT_WINSEQADR sensor_svga -#define SENSOR_INIT_PIXFMT V4L2_MBUS_FMT_YUYV8_2X8 - -#define CONFIG_SENSOR_WhiteBalance 1 -#define CONFIG_SENSOR_Brightness 0 -#define CONFIG_SENSOR_Contrast 0 -#define CONFIG_SENSOR_Saturation 0 -#define CONFIG_SENSOR_Effect 1 -#define CONFIG_SENSOR_Scene 1 -#define CONFIG_SENSOR_DigitalZoom 0 -#define CONFIG_SENSOR_Focus 0 -#define CONFIG_SENSOR_Exposure 0 -#define CONFIG_SENSOR_Flash 0 -#define CONFIG_SENSOR_Mirror 0 -#define CONFIG_SENSOR_Flip 0 - -#define CONFIG_SENSOR_I2C_SPEED 100000 ///250000 /* Hz */ -/* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 0 -#define CONFIG_SENSOR_I2C_RDWRCHK 0 - -#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\ - SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH |\ - SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ) - -#define COLOR_TEMPERATURE_CLOUDY_DN 6500 -#define COLOR_TEMPERATURE_CLOUDY_UP 8000 -#define COLOR_TEMPERATURE_CLEARDAY_DN 5000 -#define COLOR_TEMPERATURE_CLEARDAY_UP 6500 -#define COLOR_TEMPERATURE_OFFICE_DN 3500 -#define COLOR_TEMPERATURE_OFFICE_UP 5000 -#define COLOR_TEMPERATURE_HOME_DN 2500 -#define COLOR_TEMPERATURE_HOME_UP 3500 - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SENSOR_AF_IS_ERR (0x00<<0) -#define SENSOR_AF_IS_OK (0x01<<0) -#define SENSOR_INIT_IS_ERR (0x00<<28) -#define SENSOR_INIT_IS_OK (0x01<<28) - -//AE -#define SP2518_P0_0xf7 0x80//78 - -#define SP2518_P0_0xf8 0x74//6e - -#define SP2518_P0_0xf9 0x80//74 - -#define SP2518_P0_0xfa 0x74//6a - -//HEQ - -#define SP2518_P0_0xdd 0x80 - -#define SP2518_P0_0xde 0x95 - -//auto lum -#define SP2518_NORMAL_Y0ffset 0x10 //0x0f modify by sp_yjp,20120813 -#define SP2518_LOWLIGHT_Y0ffset 0x20 - - - - - -struct reginfo -{ - u8 reg; - u8 val; -}; -///=========SP2518-modify by sp_yjp,20120529================= -/* init 640X480 VGA */ -static struct reginfo sensor_init_data[] = -{ - {0xfd,0x00}, - {0x1b,0x1a},//maximum drv ability //0x02 modify by sp_yjp,20120809 - {0x0e,0x01}, - - {0x0f,0x2f}, - {0x10,0x2e}, - {0x11,0x00}, - {0x12,0x4f}, - {0x14,0x40},// 0x20 zch 20120920 - {0x16,0x02}, - {0x17,0x10}, - {0x1a,0x1f}, - {0x1e,0x81}, - {0x21,0x00}, - {0x22,0x1b}, - {0x25,0x10}, - {0x26,0x25}, - {0x27,0x6d}, - {0x2c,0x23},//31 Ronlus remove balck dot0x45}, - {0x2d,0x75}, - {0x2e,0x38},//sxga 0x18 - - {0x31,0x10},//mirror upside down - {0x44,0x03}, - {0x6f,0x00}, - {0xa0,0x04}, - {0x5f,0x01}, - {0x32,0x00}, - {0xfd,0x01}, - {0x2c,0x00}, - {0x2d,0x00}, - {0xfd,0x00}, - {0xfb,0x83}, - {0xf4,0x09}, - //Pregain - {0xfd,0x01}, - {0xc6,0x90}, - {0xc7,0x90}, - {0xc8,0x90}, - {0xc9,0x90}, - //blacklevel - {0xfd,0x00}, - {0x65,0x08}, - {0x66,0x08}, - {0x67,0x08}, - {0x68,0x08}, - - //bpc - {0x46,0xff}, - //rpc - {0xfd,0x00}, - {0xe0,0x6c}, - {0xe1,0x54}, - {0xe2,0x48}, - {0xe3,0x40}, - {0xe4,0x40}, - {0xe5,0x3e}, - {0xe6,0x3e}, - {0xe8,0x3a}, - {0xe9,0x3a}, - {0xea,0x3a}, - {0xeb,0x38}, - {0xf5,0x38}, - {0xf6,0x38}, - {0xfd,0x01}, - {0x94,0xc0},//f8 - {0x95,0x38}, - {0x9c,0x6c}, - {0x9d,0x38}, - #if 0 - ///SP2518 UXGA 24MEclk 3±¶Æµ 1·ÖƵ 50Hz fix 10fps - {0xfd , 0x00}, - {0x03 , 0x03}, - {0x04 , 0x66}, - {0x05 , 0x00}, - {0x06 , 0x8b}, - {0x07 , 0x00}, - {0x08 , 0x8b}, - {0x09 , 0x01}, - {0x0a , 0x3b}, - {0x2f , 0x00}, - {0x30 , 0x08}, - {0xf0 , 0x91}, - {0xf1 , 0x00}, - {0xfd , 0x01}, - {0x90 , 0x0a}, - {0x92 , 0x01}, - {0x98 , 0x91}, - {0x99 , 0x00}, - {0x9a , 0x01}, - {0x9b , 0x00}, - ///Status - {0xfd , 0x01}, - {0xce , 0xaa}, - {0xcf , 0x05}, - {0xd0 , 0xaa}, - {0xd1 , 0x05}, - {0xd7 , 0x93},//8d - {0xd8 , 0x00}, - {0xd9 , 0x97},//91 - {0xda , 0x00}, - {0xfd , 0x00}, - #endif - - #if 1 - /*24*3pll 13-13fps 50hz*/ - - {0xfd,0x00}, - {0x03,0x03}, - {0x04,0xf6}, - {0x05,0x00}, - {0x06,0x00}, - {0x07,0x00}, - {0x08,0x00}, - {0x09,0x00}, - {0x0a,0x8b}, - {0x2f,0x00}, - {0x30,0x08}, - {0xf0,0xa9}, - {0xf1,0x00}, - {0xfd,0x01}, - {0x90,0x07}, - {0x92,0x01}, - {0x98,0xa9}, - {0x99,0x00}, - {0x9a,0x01}, - {0x9b,0x00}, - {0xfd,0x01}, - {0xce,0x9f}, - {0xcf,0x04}, - {0xd0,0x9f}, - {0xd1,0x04}, - {0xd7,0xa5}, - {0xd8,0x00}, - {0xd9,0xa9}, - {0xda,0x00}, - {0xfd,0x00}, - - #endif - - {0xfd,0x01}, - {0xca,0x30},//mean dummy2low - {0xcb,0x50},//mean low2dummy - {0xcc,0xc0},//f8;rpc low - {0xcd,0xc0},//rpc dummy - {0xd5,0x80},//mean normal2dummy - {0xd6,0x90},//mean dummy2normal - {0xfd,0x00}, - - //lens shading - {0xfd,0x00}, - {0xa1,0x20}, - {0xa2,0x20}, - {0xa3,0x20}, - {0xa4,0xff}, - {0xa5,0x80}, - {0xa6,0x80}, - {0xfd,0x01}, - {0x64,0x1e},//28 - {0x65,0x1c},//25 - {0x66,0x1c},//2a - {0x67,0x16},//25 - {0x68,0x1c},//25 - {0x69,0x1c},//29 - {0x6a,0x1a},//28 - {0x6b,0x16},//20 - {0x6c,0x1a},//22 - {0x6d,0x1a},//22 - {0x6e,0x1a},//22 - {0x6f,0x16},//1c - {0xb8,0x04},//0a - {0xb9,0x13},//0a - {0xba,0x00},//23 - {0xbb,0x03},//14 - {0xbc,0x03},//08 - {0xbd,0x11},//08 - {0xbe,0x00},//12 - {0xbf,0x02},//00 - {0xc0,0x04},//05 - {0xc1,0x0e},//05 - {0xc2,0x00},//18 - {0xc3,0x05},//08 - //raw filter - {0xfd,0x01}, - {0xde,0x0f}, - {0xfd,0x00}, - {0x57,0x08},//raw_dif_thr - {0x58,0x08},//a - {0x56,0x08},//a - {0x59,0x10}, - - {0x5a,0xa0},//raw_rb_fac_outdoor - {0xc4,0xa0},//60raw_rb_fac_indoor - {0x43,0xa0},//40raw_rb_fac_dummy - {0xad,0x40},//raw_rb_fac_low - - {0x4f,0xa0},//raw_gf_fac_outdoor - {0xc3,0xa0},//60raw_gf_fac_indoor - {0x3f,0xa0},//40raw_gf_fac_dummy - {0x42,0x40},//raw_gf_fac_low - {0xc2,0x15}, - - {0xb6,0x80},//raw_gflt_fac_outdoor - {0xb7,0x80},//60raw_gflt_fac_normal - {0xb8,0x40},//40raw_gflt_fac_dummy - {0xb9,0x20},//raw_gflt_fac_low - - {0xfd,0x01}, - {0x50,0x0c},//raw_grgb_thr - {0x51,0x0c}, - {0x52,0x10}, - {0x53,0x10}, - {0xfd,0x00}, - // awb1 - {0xfd,0x01}, - {0x11,0x10}, - {0x12,0x1f}, - {0x16,0x1c}, - {0x18,0x00}, - {0x19,0x00}, - {0x1b,0x96}, - {0x1a,0x9a},//95 - {0x1e,0x2f}, - {0x1f,0x29}, - {0x20,0xff}, - {0x22,0xff}, - {0x28,0xce}, - {0x29,0x8a}, - {0xfd,0x00}, - {0xe7,0x03}, - {0xe7,0x00}, - {0xfd,0x01}, - {0x2a,0xf0}, - {0x2b,0x10}, - {0x2e,0x04}, - {0x2f,0x18}, - {0x21,0x60}, - {0x23,0x60}, - {0x8b,0xab}, - {0x8f,0x12}, - //awb2 - {0xfd,0x01}, - {0x1a,0x80}, - {0x1b,0x80}, - {0x43,0x80}, - //outdoor - {0x00,0xd4}, - {0x01,0xb0}, - {0x02,0x90}, - {0x03,0x78}, - //d65 - {0x35,0xd6},//d6;b0 - {0x36,0xf0},//f0;d1;e9 - {0x37,0x7a},//8a;70 - {0x38,0x9a},//dc;9a;af - //indoor - {0x39,0xab}, - {0x3a,0xca}, - {0x3b,0xa3}, - {0x3c,0xc1}, - //f - {0x31,0x82},//7d - {0x32,0xa5},//a0;74 - {0x33,0xd6},//d2 - {0x34,0xec},//e8 - {0x3d,0xa5},//a7;88 - {0x3e,0xc2},//be;bb - {0x3f,0xa7},//b3;ad - {0x40,0xc5},//c5;d0 - //Color Correction - {0xfd,0x01}, - {0x1c,0xc0}, - {0x1d,0x95}, - {0xa0,0xa6},//b8 - {0xa1,0xda},//;d5 - {0xa2,0x00},//;f2 - {0xa3,0x06},//;e8 - {0xa4,0xb2},//;95 - {0xa5,0xc7},//;03 - {0xa6,0x00},//;f2 - {0xa7,0xce},//;c4 - {0xa8,0xb2},//;ca - {0xa9,0x0c},//;3c - {0xaa,0x30},//;03 - {0xab,0x0c},//;0f - {0xac,0xc0},//b8 - {0xad,0xc0},//d5 - {0xae,0x00},//f2 - {0xaf,0xf2},//e8 - {0xb0,0xa6},//95 - {0xb1,0xe8},//03 - {0xb2,0x00},//f2 - {0xb3,0xe7},//c4 - {0xb4,0x99},//ca - {0xb5,0x0c},//3c - {0xb6,0x33},//03 - {0xb7,0x0c},//0f - //Saturation - {0xfd,0x00}, - {0xbf,0x01}, - {0xbe,0xbb}, - {0xc0,0xb0}, - {0xc1,0xf0}, - - {0xd3,0x77}, - {0xd4,0x77}, - {0xd6,0x77}, - {0xd7,0x77}, - {0xd8,0x77}, - {0xd9,0x77}, - {0xda,0x77}, - {0xdb,0x77}, - //uv_dif - {0xfd,0x00}, - {0xf3,0x03}, - {0xb0,0x00}, - {0xb1,0x23}, - //gamma1 - {0xfd,0x00},// - {0x8b,0x0 },//0 ;0 - {0x8c,0xA },//14;A - {0x8d,0x13},//24;13 - {0x8e,0x25},//3a;25 - {0x8f,0x43},//59;43 - {0x90,0x5D},//6f;5D - {0x91,0x74},//84;74 - {0x92,0x88},//95;88 - {0x93,0x9A},//a3;9A - {0x94,0xA9},//b1;A9 - {0x95,0xB5},//be;B5 - {0x96,0xC0},//c7;C0 - {0x97,0xCA},//d1;CA - {0x98,0xD4},//d9;D4 - {0x99,0xDD},//e1;DD - {0x9a,0xE6},//e9;E6 - {0x9b,0xEF},//f1;EF - {0xfd,0x01},//01;01 - {0x8d,0xF7},//f9;F7 - {0x8e,0xFF},//ff;FF - //gamma2 - {0xfd,0x00},// - {0x78,0x0 },//0 - {0x79,0xA },//14 - {0x7a,0x13},//24 - {0x7b,0x25},//3a - {0x7c,0x43},//59 - {0x7d,0x5D},//6f - {0x7e,0x74},//84 - {0x7f,0x88},//95 - {0x80,0x9A},//a3 - {0x81,0xA9},//b1 - {0x82,0xB5},//be - {0x83,0xC0},//c7 - {0x84,0xCA},//d1 - {0x85,0xD4},//d9 - {0x86,0xDD},//e1 - {0x87,0xE6},//e9 - {0x88,0xEF},//f1 - {0x89,0xF7},//f9 - {0x8a,0xFF},//ff - /*//¹â°ß¹ý¶ÈºÃ - //gamma1 - {0xfd,0x00}, - {0x8b,0x00}, - {0x8c,0x14}, - {0x8d,0x24}, - {0x8e,0x3A}, - {0x8f,0x59}, - {0x90,0x70}, - {0x91,0x85}, - {0x92,0x96}, - {0x93,0xA6}, - {0x94,0xB3}, - {0x95,0xBE}, - {0x96,0xC9}, - {0x97,0xD2}, - {0x98,0xDB}, - {0x99,0xE3}, - {0x9a,0xEB}, - {0x9b,0xF2}, - {0xfd,0x01}, - {0x8d,0xF9}, - {0x8e,0xFF}, - //gamma2 - {0xfd,0x00}, - {0x78,0x00}, - {0x79,0x14}, - {0x7a,0x24}, - {0x7b,0x3A}, - {0x7c,0x59}, - {0x7d,0x70}, - {0x7e,0x85}, - {0x7f,0x96}, - {0x80,0xA6}, - {0x81,0xB3}, - {0x82,0xBE}, - {0x83,0xC9}, - {0x84,0xD2}, - {0x85,0xDB}, - {0x86,0xE3}, - {0x87,0xEB}, - {0x88,0xF2}, - {0x89,0xF9}, - {0x8a,0xFF}, -*/ - //gamma_ae - {0xfd,0x01}, - {0x96,0x46}, - {0x97,0x14}, - {0x9f,0x06}, - //HEQ - {0xfd,0x00},// - {0xdd,SP2518_P0_0xdd},//0x80 - {0xde,SP2518_P0_0xde},//a0 - {0xdf,0x80},// - //Ytarget - {0xfd,0x00},// - {0xec,0x70},//6a - {0xed,0x86},//7c - {0xee,0x70},//65 - {0xef,0x86},//78 - {0xf7,0x80},//78 - {0xf8,0x74},//6e - {0xf9,0x80},//74 - {0xfa,0x74},//6a - //sharpen - {0xfd,0x01}, - {0xdf,0x0f}, - {0xe5,0x10}, - {0xe7,0x10}, - {0xe8,0x20}, - {0xec,0x20}, - {0xe9,0x20}, - {0xed,0x20}, - {0xea,0x10}, - {0xef,0x10}, - {0xeb,0x10}, - {0xf0,0x10}, - //;gw - {0xfd,0x01},// - {0x70,0x76},// - {0x7b,0x40},// - {0x81,0x30},// - //;Y_offset - {0xfd,0x00}, - {0xb2,0X10}, - {0xb3,0x1f}, - {0xb4,0x30}, - {0xb5,0x50}, - //;CNR - {0xfd,0x00}, - {0x5b,0x20}, - {0x61,0x80}, - {0x77,0x80}, - {0xca,0x80}, - //;YNR - {0xab,0x00}, - {0xac,0x02}, - {0xae,0x08}, - {0xaf,0x20}, - {0xfd,0x00}, - {0x31,0x10}, - {0x32,0x0d}, - {0x33,0xcf},//ef - {0x34,0x7f},//3f - - {0x35,0x40},//3 - - {0x1b,0x1a}, - {0xe7,0x03}, - {0xe7,0x00}, - - //SP2518_config_window(WINDOW_SIZE_VGA} - #if 1 // - /* - {0xfd,0x00}, - {0x4b,0x00}, - {0x4c,0x00}, - {0x47,0x00}, - {0x48,0x00}, - {0x4d,0x06}, - {0x4e,0x40}, - {0x49,0x04}, - {0x4a,0xb0}, - - {0xfd,0x01}, - {0x06,0x00}, - {0x07,0x50}, - {0x08,0x00}, - {0x09,0x50}, - {0x0a,0x01}, //480 - {0x0b,0xe0}, - {0x0c,0x02}, //640 - {0x0d,0x80}, - {0x0e,0x01}, - {0xfd,0x00}, - */ - #else //uxga - {0xfd,0x00}, - {0x47,0x00}, - {0x48,0x00}, - {0x49,0x04}, - {0x4a,0xb0}, - - {0x4b,0x00}, - {0x4c,0x00}, - {0x4d,0x06}, - {0x4e,0x40}, - - {0xfd,0x01}, - {0x0e,0x00}, - {0xfd,0x00}, - #endif - //SVGA - {0xfd,0x00}, - - {0x47,0x00}, - {0x48,0x00}, - {0x49,0x04}, - {0x4a,0xb0}, - - {0x4b,0x00}, - {0x4c,0x00}, - {0x4d,0x06}, - {0x4e,0x40}, - {0xfd,0x01}, - {0x06,0x00}, - {0x07,0x40}, - {0x08,0x00}, - {0x09,0x40}, - {0x0a,0x02}, //600 - {0x0b,0x58}, - {0x0c,0x03}, //800 - {0x0d,0x20}, - {0x0e,0x01}, - {0xfd,0x00}, - - - {0x5d,0x0e}, //vsync delay - {0xff,0xff}//The end flag -}; - - -/* 1600X1200 UXGA */ -static struct reginfo sensor_uxga[] = -{ - {0xfd,0x00}, - {0x47,0x00}, - {0x48,0x00}, - {0x49,0x04}, - {0x4a,0xb0}, - - {0x4b,0x00}, - {0x4c,0x00}, - {0x4d,0x06}, - {0x4e,0x40}, - - {0xfd,0x01}, - {0x0e,0x00}, - {0xfd,0x00}, - {0xff,0xff}//The end flag -}; - - -/* 1280X1024 SXGA */ -static struct reginfo sensor_sxga[] = -{ -#if 0 - {0xfd,0x00}, - {0x47,0x00}, - {0x48,0x50}, - {0x49,0x04}, - {0x4a,0x00}, - - {0x4b,0x00}, - {0x4c,0x90}, - {0x4d,0x05}, - {0x4e,0x00}, - - {0xfd,0x01}, - {0x0e,0x00}, - {0xfd,0x00}, -#endif - {0xff,0xff} -}; - -/* 800X600 SVGA*/ -static struct reginfo sensor_svga[] = -{ - {0xfd,0x00}, - - {0x47,0x00}, - {0x48,0x00}, - {0x49,0x04}, - {0x4a,0xb0}, - - {0x4b,0x00}, - {0x4c,0x00}, - {0x4d,0x06}, - {0x4e,0x40}, - {0xfd,0x01}, - {0x06,0x00}, - {0x07,0x40}, - {0x08,0x00}, - {0x09,0x40}, - {0x0a,0x02}, //600 - {0x0b,0x58}, - {0x0c,0x03}, //800 - {0x0d,0x20}, - {0x0e,0x01}, - {0xfd,0x00}, - {0xff,0xff}//The end flag -}; - -/* 640X480 VGA */ -static struct reginfo sensor_vga[] = -{ -#if 0 - {0xfd,0x00}, - - {0x47,0x00}, - {0x48,0x00}, - {0x49,0x04}, - {0x4a,0xb0}, - - {0x4b,0x00}, - {0x4c,0x00}, - {0x4d,0x06}, - {0x4e,0x40}, - - {0xfd,0x01}, - {0x06,0x00}, - {0x07,0x50}, - {0x08,0x00}, - {0x09,0x50}, - {0x0a,0x01}, //480 - {0x0b,0xe0}, - {0x0c,0x02}, //640 - {0x0d,0x80}, - {0x0e,0x01}, - {0xfd,0x00}, -#endif - {0xff,0xff}//The end flag - - -}; -///=========SP2518-modify by sp_yjp,20120529================= - -/* 352X288 CIF */ -static struct reginfo sensor_cif[] = -{ - {0xfd, 0x00},{0xff,0xff} -}; - -/* 320*240 QVGA */ -static struct reginfo sensor_qvga[] = -{ -#if 0 - {0xfd,0x00}, - - {0x47,0x00}, - {0x48,0x00}, - {0x49,0x04}, - {0x4a,0xb0}, - {0x4b,0x00}, - {0x4c,0x00}, - {0x4d,0x06}, - {0x4e,0x40}, - - {0xfd,0x01}, - - {0x06,0x00}, - {0x07,0xa0}, - {0x08,0x00}, - {0x09,0xa0}, - - {0x0a,0x00}, //240 - {0x0b,0xf0}, - {0x0c,0x01}, //320 - {0x0d,0x40}, - - {0x0e,0x01}, - {0xfd,0x00}, -#endif - {0xff,0xff}//The end flag -}; - -/* 176X144 QCIF*/ -static struct reginfo sensor_qcif[] = -{ - //{0xfd, 0x00}, - {0xff,0xff} -}; - -static struct reginfo sensor_ClrFmt_YUYV[]= -{ - //{0xfd, 0x00}, - {0xff,0xff} -}; - -static struct reginfo sensor_ClrFmt_UYVY[]= -{ - //{0xfd, 0x00}, - {0xff,0xff} -}; - -///=========SP2518-modify by sp_yjp,20120529================= - -#if CONFIG_SENSOR_WhiteBalance -static struct reginfo sensor_WhiteB_Auto[]= -{ - {0xfd, 0x01}, - {0x28, 0xce}, - {0x29, 0x8a}, - {0xfd, 0x00}, - {0x32, 0x0d}, - {0xfd, 0x00}, - {0xff, 0xff} -}; -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct reginfo sensor_WhiteB_Cloudy[]= -{ - {0xfd,0x00}, - {0x32,0x05}, - {0xfd,0x01}, - {0x28,0xe2}, - {0x29,0x82}, - {0xfd,0x00}, - {0xfd,0x00}, - {0xff,0xff} -}; -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct reginfo sensor_WhiteB_ClearDay[]= -{ - {0xfd,0x00}, - {0x32,0x05}, - {0xfd,0x01}, - {0x28,0xc1}, - {0x29,0x88}, - {0xfd,0x00}, - {0xfd,0x00}, - {0xff,0xff} -}; -/* Office Colour Temperature : 3500K - 5000K */ -static struct reginfo sensor_WhiteB_TungstenLamp1[]= -{ - {0xfd,0x00}, - {0x32,0x05}, - {0xfd,0x01}, - {0x28,0x7b}, - {0x29,0xd3}, - {0xfd,0x00}, - {0xfd,0x00}, - {0xff,0xff} - -}; -/* Home Colour Temperature : 2500K - 3500K */ -static struct reginfo sensor_WhiteB_TungstenLamp2[]= -{ - {0xfd,0x00}, - {0x32,0x05}, - {0xfd,0x01}, - {0x28,0xae}, - {0x29,0xcc}, - {0xfd,0x00}, - {0xfd,0x00}, - {0xff,0xff} -}; -static struct reginfo *sensor_WhiteBalanceSeqe[] = {sensor_WhiteB_Auto, sensor_WhiteB_TungstenLamp1,sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, sensor_WhiteB_Cloudy,NULL, -}; -#endif - - -///=========SP2518-modify by sp_yjp,20120529================= -#if CONFIG_SENSOR_Brightness -static struct reginfo sensor_Brightness0[]= -{ - {0xfd, 0x00}, - {0xdc, 0xe0}, - {0xff, 0xff} -}; - -static struct reginfo sensor_Brightness1[]= -{ - {0xfd, 0x00}, - {0xdc, 0xf0}, - {0xff, 0xff} -}; - -static struct reginfo sensor_Brightness2[]= -{ - {0xfd, 0x00}, - {0xdc, 0x00}, - {0xff, 0xff} -}; - -static struct reginfo sensor_Brightness3[]= -{ - {0xfd, 0x00}, - {0xdc, 0x10}, - {0xff, 0xff} -}; - -static struct reginfo sensor_Brightness4[]= -{ - {0xfd, 0x00}, - {0xdc, 0x20}, - {0xff, 0xff} -}; - -static struct reginfo sensor_Brightness5[]= -{ - {0xfd, 0x00}, - {0xdc, 0x30}, - {0xff, 0xff} -}; -static struct reginfo *sensor_BrightnessSeqe[] = {sensor_Brightness0, sensor_Brightness1, sensor_Brightness2, sensor_Brightness3, - sensor_Brightness4, sensor_Brightness5,NULL, -}; - -#endif - -///=========SP2518-modify by sp_yjp,20120529================= -#if CONFIG_SENSOR_Effect -static struct reginfo sensor_Effect_Normal[] = -{ - {0xfd, 0x00}, - {0x62, 0x00}, - {0x63, 0x80}, - {0x64, 0x80}, - {0xff, 0xff} -}; - -static struct reginfo sensor_Effect_WandB[] = -{ - {0xfd, 0x00}, - {0x62, 0x20}, - {0x63, 0x80}, - {0x64, 0x80}, - {0xff, 0xff} -}; - -static struct reginfo sensor_Effect_Sepia[] = -{ - {0xfd, 0x00}, - {0x62, 0x10}, - {0x63, 0xb0}, - {0x64, 0x40}, - {0xff, 0xff} -}; - -static struct reginfo sensor_Effect_Negative[] = -{ - {0xfd, 0x00}, - {0x62, 0x04}, - {0x63, 0x80}, - {0x64, 0x80}, - {0xff, 0xff} -}; -static struct reginfo sensor_Effect_Bluish[] = -{ - {0xfd, 0x00}, - {0x62, 0x10}, - {0x63, 0x80}, - {0x64, 0xb0}, - {0xff, 0xff} -}; - -static struct reginfo sensor_Effect_Green[] = -{ - {0xfd, 0x00}, - {0x62, 0x10}, - {0x63, 0x50}, - {0x64, 0x50}, - {0xff, 0xff} -}; -static struct reginfo *sensor_EffectSeqe[] = {sensor_Effect_Normal, sensor_Effect_WandB, sensor_Effect_Negative,sensor_Effect_Sepia, - sensor_Effect_Bluish, sensor_Effect_Green,NULL, -}; -#endif - -///=========SP2518-modify by sp_yjp,20120529================= -#if CONFIG_SENSOR_Exposure -static struct reginfo sensor_Exposure0[]= -{ - //level -3 - {0xfd,0x00}, - {0xed,SP2518_P0_0xf7-0x18+0x04}, - {0xf7,SP2518_P0_0xf7-0x18}, - {0xf8,SP2518_P0_0xf8-0x18}, - {0xec,SP2518_P0_0xf8-0x18-0x04}, - {0xef,SP2518_P0_0xf9-0x18+0x04}, - {0xf9,SP2518_P0_0xf9-0x18}, - {0xfa,SP2518_P0_0xfa-0x18}, - {0xee,SP2518_P0_0xfa-0x18-0x04}, - - {0xfd, 0x00}, - {0xff,0xff} -}; - -static struct reginfo sensor_Exposure1[]= -{ - //level -2 - {0xfd,0x00}, - {0xed,SP2518_P0_0xf7-0x10+0x04}, - {0xf7,SP2518_P0_0xf7-0x10}, - {0xf8,SP2518_P0_0xf8-0x10}, - {0xec,SP2518_P0_0xf8-0x10-0x04}, - {0xef,SP2518_P0_0xf9-0x10+0x04}, - {0xf9,SP2518_P0_0xf9-0x10}, - {0xfa,SP2518_P0_0xfa-0x10}, - {0xee,SP2518_P0_0xfa-0x10-0x04}, - - {0xfd, 0x00}, - {0xff,0xff} -}; - -static struct reginfo sensor_Exposure2[]= -{ - //level -1 - {0xfd,0x00}, - {0xed,SP2518_P0_0xf7-0x08+0x04}, - {0xf7,SP2518_P0_0xf7-0x08}, - {0xf8,SP2518_P0_0xf8-0x08}, - {0xec,SP2518_P0_0xf8-0x08-0x04}, - {0xef,SP2518_P0_0xf9-0x08+0x04}, - {0xf9,SP2518_P0_0xf9-0x08}, - {0xfa,SP2518_P0_0xfa-0x08}, - {0xee,SP2518_P0_0xfa-0x08-0x04}, - - {0xfd, 0x00}, - {0xff,0xff} -}; - -static struct reginfo sensor_Exposure3[]= -{ - //level 0 - {0xfd,0x00}, - {0xed,SP2518_P0_0xf7+0x04}, - {0xf7,SP2518_P0_0xf7}, - {0xf8,SP2518_P0_0xf8}, - {0xec,SP2518_P0_0xf8-0x04}, - {0xef,SP2518_P0_0xf9+0x04}, - {0xf9,SP2518_P0_0xf9}, - {0xfa,SP2518_P0_0xfa}, - {0xee,SP2518_P0_0xfa-0x04}, - - {0xfd, 0x00}, - {0xff,0xff} -}; - -static struct reginfo sensor_Exposure4[]= -{ - //level +1 - {0xfd,0x00}, - {0xed,SP2518_P0_0xf7+0x08+0x04}, - {0xf7,SP2518_P0_0xf7+0x08}, - {0xf8,SP2518_P0_0xf8+0x08}, - {0xec,SP2518_P0_0xf8+0x08-0x04}, - {0xef,SP2518_P0_0xf9+0x08+0x04}, - {0xf9,SP2518_P0_0xf9+0x08}, - {0xfa,SP2518_P0_0xfa+0x08}, - {0xee,SP2518_P0_0xfa+0x08-0x04}, - - {0xfd, 0x00}, - {0xff,0xff} -}; - -static struct reginfo sensor_Exposure5[]= -{ - //level +2 - {0xfd,0x00}, - {0xed,SP2518_P0_0xf7+0x10+0x04}, - {0xf7,SP2518_P0_0xf7+0x10}, - {0xf8,SP2518_P0_0xf8+0x10}, - {0xec,SP2518_P0_0xf8+0x10-0x04}, - {0xef,SP2518_P0_0xf9+0x10+0x04}, - {0xf9,SP2518_P0_0xf9+0x10}, - {0xfa,SP2518_P0_0xfa+0x10}, - {0xee,SP2518_P0_0xfa+0x10-0x04}, - - {0xfd, 0x00}, - {0xff,0xff} -}; - -static struct reginfo sensor_Exposure6[]= -{ - //level +3 - {0xfd,0x00}, - {0xed,SP2518_P0_0xf7+0x18+0x04}, - {0xf7,SP2518_P0_0xf7+0x18}, - {0xf8,SP2518_P0_0xf8+0x18}, - {0xec,SP2518_P0_0xf8+0x18-0x04}, - {0xef,SP2518_P0_0xf9+0x18+0x04}, - {0xf9,SP2518_P0_0xf9+0x18}, - {0xfa,SP2518_P0_0xfa+0x18}, - {0xee,SP2518_P0_0xfa+0x18-0x04}, - - {0xfd, 0x00}, - {0xff,0xff} -}; - -static struct reginfo *sensor_ExposureSeqe[] = {sensor_Exposure0, sensor_Exposure1, sensor_Exposure2, sensor_Exposure3, - sensor_Exposure4, sensor_Exposure5,sensor_Exposure6,NULL, -}; -#endif - -///=========SP2518-modify by sp_yjp,20120529================= -#if CONFIG_SENSOR_Saturation -static struct reginfo sensor_Saturation0[]= -{ - {0xfd, 0x00}, - {0xff, 0xff} -}; - -static struct reginfo sensor_Saturation1[]= -{ - {0xfd, 0x00}, - {0xff, 0xff} -}; - -static struct reginfo sensor_Saturation2[]= -{ - {0xfd, 0x00}, - {0xff, 0xff} -}; -static struct reginfo *sensor_SaturationSeqe[] = {sensor_Saturation0, sensor_Saturation1, sensor_Saturation2, NULL,}; - -#endif - -///=========SP2518-modify by sp_yjp,20120529================= -#if CONFIG_SENSOR_Contrast -static struct reginfo sensor_Contrast0[]= -{ - //level -3 - {0xfd , 0x00}, - {0xdd , SP2518_P0_0xdd-0x30}, - {0xde , SP2518_P0_0xde-0x30}, - {0xff , 0xff} -}; - -static struct reginfo sensor_Contrast1[]= -{ - //level -2 - {0xfd , 0x00}, - {0xdd , SP2518_P0_0xdd-0x20}, - {0xde , SP2518_P0_0xde-0x20}, - {0xff , 0xff} -}; - -static struct reginfo sensor_Contrast2[]= -{ - //level -1 - {0xfd , 0x00}, - {0xdd , SP2518_P0_0xdd-0x10}, - {0xde , SP2518_P0_0xde-0x10}, - {0xff , 0xff} -}; - -static struct reginfo sensor_Contrast3[]= -{ - //level 0 - {0xfd , 0x00}, - {0xdd , SP2518_P0_0xdd}, - {0xde , SP2518_P0_0xde}, - {0xff , 0xff} -}; - -static struct reginfo sensor_Contrast4[]= -{ - //level +1 - {0xfd , 0x00}, - {0xdd , SP2518_P0_0xdd+0x10}, - {0xde , SP2518_P0_0xde+0x10}, - {0xff , 0xff} -}; - - -static struct reginfo sensor_Contrast5[]= -{ - //level +2 - {0xfd , 0x00}, - {0xdd , SP2518_P0_0xdd+0x20}, - {0xde , SP2518_P0_0xde+0x20}, - {0xff , 0xff} -}; - -static struct reginfo sensor_Contrast6[]= -{ - //level +3 - {0xfd , 0x00}, - {0xdd , SP2518_P0_0xdd+0x30}, - {0xde , SP2518_P0_0xde+0x30}, - {0xff , 0xff} -}; - - - - -static struct reginfo *sensor_ContrastSeqe[] = {sensor_Contrast0, sensor_Contrast1, sensor_Contrast2, sensor_Contrast3, - sensor_Contrast4, sensor_Contrast5, sensor_Contrast6, NULL, -}; - -#endif - - -///=========SP2518-modify by sp_yjp,20120529================= -#if CONFIG_SENSOR_Mirror -static struct reginfo sensor_MirrorOn[]= -{ - {0xfd, 0x00}, - {0x31, 0x30}, - {0xff, 0xff} -}; - -static struct reginfo sensor_MirrorOff[]= -{ - {0xfd, 0x00}, - {0x31, 0x10}, - {0xff, 0xff} -}; -static struct reginfo *sensor_MirrorSeqe[] = {sensor_MirrorOff, sensor_MirrorOn,NULL,}; -#endif -#if CONFIG_SENSOR_Flip -static struct reginfo sensor_FlipOn[]= -{ - {0xfd, 0x00}, - {0x31, 0x50}, - {0xff, 0xff} -}; - -static struct reginfo sensor_FlipOff[]= -{ - {0xfd, 0x00}, - {0x31, 0x10}, - {0xff, 0xff} -}; -static struct reginfo *sensor_FlipSeqe[] = {sensor_FlipOff, sensor_FlipOn,NULL,}; - -#endif - -///=========SP2518-modify by sp_yjp,20120529================= -#if CONFIG_SENSOR_Scene//? zch -static struct reginfo sensor_SceneAuto[] = -{ - #if 1 - {0xfd, 0x00}, - {0xb2,SP2518_NORMAL_Y0ffset}, - {0xb3,0x1f}, - - //SP2518 UXGA 24MEclk 3PLL 50Hz fix13fps - - {0xfd,0x00}, - {0x03,0x03}, - {0x04,0xf6}, - {0x05,0x00}, - {0x06,0x00}, - {0x07,0x00}, - {0x08,0x00}, - {0x09,0x00}, - {0x0a,0x8b}, - {0x2f,0x00}, - {0x30,0x08}, - {0xf0,0xa9}, - {0xf1,0x00}, - {0xfd,0x01}, - {0x90,0x07}, - {0x92,0x01}, - {0x98,0xa9}, - {0x99,0x00}, - {0x9a,0x01}, - {0x9b,0x00}, - {0xfd,0x01}, - {0xce,0x9f}, - {0xcf,0x04}, - {0xd0,0x9f}, - {0xd1,0x04}, - {0xd7,0xa5}, - {0xd8,0x00}, - {0xd9,0xa9}, - {0xda,0x00}, - {0xfd,0x00}, - - #endif - - {0xfd, 0x00}, - {0xff, 0xff} -}; - -static struct reginfo sensor_SceneNight[] = -{ - #if 1 - {0xfd,0x00}, - {0xb2,SP2518_LOWLIGHT_Y0ffset}, - {0xb3,0x1f}, - - //SP2518 UXGA 24MEclk 3PLL 50Hz fix 6fps - {0xfd , 0x00}, - {0x03 , 0x01}, - {0x04 , 0xfe}, - {0x05 , 0x00}, - {0x06 , 0x6d}, - {0x07 , 0x00}, - {0x08 , 0x6d}, - {0x09 , 0x04}, - {0x0a , 0xa8}, - {0xf0 , 0x55}, - {0xf1 , 0x00}, - {0xfd , 0x01}, - {0x90 , 0x10}, - {0x92 , 0x01}, - {0x98 , 0x55}, - {0x99 , 0x00}, - {0x9a , 0x01}, - {0x9b , 0x00}, - ///Status - {0xfd , 0x01}, - {0xce , 0x50}, - {0xcf , 0x05}, - {0xd0 , 0x50}, - {0xd1 , 0x05}, - {0xd7 , 0x57},//51 - {0xd8 , 0x00}, - {0xd9 , 0x5b},//55 - {0xda , 0x00}, - #endif - - {0xfd,0x00}, - {0xff,0xff} -}; - - - -static struct reginfo *sensor_SceneSeqe[] = {sensor_SceneAuto, sensor_SceneNight,NULL,}; - -#endif - -///=========SP2518-modify by sp_yjp,20120529================= -#if CONFIG_SENSOR_DigitalZoom -static struct reginfo sensor_Zoom0[] = -{ - {0xfd,0x00}, - {0xff,0xff} -}; - -static struct reginfo sensor_Zoom1[] = -{ - {0xfd,0x00}, - {0xff,0xff} -}; - -static struct reginfo sensor_Zoom2[] = -{ - {0xfd,0x00}, - {0xff,0xff} -}; - - -static struct reginfo sensor_Zoom3[] = -{ - {0xfd,0x00}, - {0xff,0xff} -}; -static struct reginfo *sensor_ZoomSeqe[] = {sensor_Zoom0, sensor_Zoom1, sensor_Zoom2, sensor_Zoom3, NULL,}; -#endif - - -///=========SP2518-modify by sp_yjp,20120529================= -static const struct v4l2_querymenu sensor_menus[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 0, .name = "auto", .reserved = 0, }, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 1, .name = "incandescent", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 2, .name = "fluorescent", .reserved = 0,}, { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 3, .name = "daylight", .reserved = 0,}, - { .id = V4L2_CID_DO_WHITE_BALANCE, .index = 4, .name = "cloudy-daylight", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Effect - { .id = V4L2_CID_EFFECT, .index = 0, .name = "none", .reserved = 0, }, { .id = V4L2_CID_EFFECT, .index = 1, .name = "mono", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 2, .name = "negative", .reserved = 0,}, { .id = V4L2_CID_EFFECT, .index = 3, .name = "sepia", .reserved = 0,}, - { .id = V4L2_CID_EFFECT, .index = 4, .name = "posterize", .reserved = 0,} ,{ .id = V4L2_CID_EFFECT, .index = 5, .name = "aqua", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Scene - { .id = V4L2_CID_SCENE, .index = 0, .name = "auto", .reserved = 0,} ,{ .id = V4L2_CID_SCENE, .index = 1, .name = "night", .reserved = 0,}, - #endif - - #if CONFIG_SENSOR_Flash - { .id = V4L2_CID_FLASH, .index = 0, .name = "off", .reserved = 0, }, { .id = V4L2_CID_FLASH, .index = 1, .name = "auto", .reserved = 0,}, - { .id = V4L2_CID_FLASH, .index = 2, .name = "on", .reserved = 0,}, { .id = V4L2_CID_FLASH, .index = 3, .name = "torch", .reserved = 0,}, - #endif -}; - -static const struct v4l2_queryctrl sensor_controls[] = -{ - #if CONFIG_SENSOR_WhiteBalance - { - .id = V4L2_CID_DO_WHITE_BALANCE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "White Balance Control", - .minimum = 0, - .maximum = 4, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Brightness - { - .id = V4L2_CID_BRIGHTNESS, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Brightness Control", - .minimum = -3, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Effect - { - .id = V4L2_CID_EFFECT, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Effect Control", - .minimum = 0, - .maximum = 5, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Exposure - { - .id = V4L2_CID_EXPOSURE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Exposure Control", - .minimum = 0, - .maximum = 6, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Saturation - { - .id = V4L2_CID_SATURATION, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Saturation Control", - .minimum = 0, - .maximum = 2, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Contrast - { - .id = V4L2_CID_CONTRAST, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Contrast Control", - .minimum = -3, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Mirror - { - .id = V4L2_CID_HFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Mirror Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Flip - { - .id = V4L2_CID_VFLIP, - .type = V4L2_CTRL_TYPE_BOOLEAN, - .name = "Flip Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 1, - }, - #endif - - #if CONFIG_SENSOR_Scene - { - .id = V4L2_CID_SCENE, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Scene Control", - .minimum = 0, - .maximum = 1, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_DigitalZoom - { - .id = V4L2_CID_ZOOM_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_ZOOM_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "DigitalZoom Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif - - #if CONFIG_SENSOR_Focus - { - .id = V4L2_CID_FOCUS_RELATIVE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = -1, - .maximum = 1, - .step = 1, - .default_value = 0, - }, { - .id = V4L2_CID_FOCUS_ABSOLUTE, - .type = V4L2_CTRL_TYPE_INTEGER, - .name = "Focus Control", - .minimum = 0, - .maximum = 255, - .step = 1, - .default_value = 125, - }, - #endif - - #if CONFIG_SENSOR_Flash - { - .id = V4L2_CID_FLASH, - .type = V4L2_CTRL_TYPE_MENU, - .name = "Flash Control", - .minimum = 0, - .maximum = 3, - .step = 1, - .default_value = 0, - }, - #endif -}; - -static int sensor_probe(struct i2c_client *client, const struct i2c_device_id *did); -static int sensor_video_probe(struct soc_camera_device *icd, struct i2c_client *client); -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl); -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl); -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg); -static int sensor_resume(struct soc_camera_device *icd); -static int sensor_set_bus_param(struct soc_camera_device *icd,unsigned long flags); -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd); -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value); -static int sensor_deactivate(struct i2c_client *client); - -static struct soc_camera_ops sensor_ops = -{ - .suspend = sensor_suspend, - .resume = sensor_resume, - .set_bus_param = sensor_set_bus_param, - .query_bus_param = sensor_query_bus_param, - .controls = sensor_controls, - .menus = sensor_menus, - .num_controls = ARRAY_SIZE(sensor_controls), - .num_menus = ARRAY_SIZE(sensor_menus), -}; - -/* only one fixed colorspace per pixelcode */ -struct sensor_datafmt { - enum v4l2_mbus_pixelcode code; - enum v4l2_colorspace colorspace; -}; - -/* Find a data format by a pixel code in an array */ -static const struct sensor_datafmt *sensor_find_datafmt( - enum v4l2_mbus_pixelcode code, const struct sensor_datafmt *fmt, - int n) -{ - int i; - for (i = 0; i < n; i++) - if (fmt[i].code == code) - return fmt + i; - - return NULL; -} - -static const struct sensor_datafmt sensor_colour_fmts[] = { - {V4L2_MBUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_JPEG} -}; - -typedef struct sensor_info_priv_s -{ - int whiteBalance; - int brightness; - int contrast; - int saturation; - int effect; - int scene; - int digitalzoom; - int focus; - int flash; - int exposure; - bool snap2preview; - bool video2preview; - unsigned char mirror; /* HFLIP */ - unsigned char flip; /* VFLIP */ - unsigned int winseqe_cur_addr; - struct sensor_datafmt fmt; - unsigned int funmodule_state; -} sensor_info_priv_t; - -struct sensor -{ - struct v4l2_subdev subdev; - struct i2c_client *client; - sensor_info_priv_t info_priv; - int model; /* V4L2_IDENT_OV* codes from v4l2-chip-ident.h */ -#if CONFIG_SENSOR_I2C_NOSCHED - atomic_t tasklock_cnt; -#endif - struct rk29camera_platform_data *sensor_io_request; - struct rk29camera_gpio_res *sensor_gpio_res; -}; - -static struct sensor* to_sensor(const struct i2c_client *client) -{ - return container_of(i2c_get_clientdata(client), struct sensor, subdev); -} - -static int sensor_task_lock(struct i2c_client *client, int lock) -{ -#if CONFIG_SENSOR_I2C_NOSCHED - int cnt = 3; - struct sensor *sensor = to_sensor(client); - - if (lock) { - if (atomic_read(&sensor->tasklock_cnt) == 0) { - while ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt>0)) { - SENSOR_TR("\n %s will obtain i2c in atomic, but i2c bus is locked! Wait...\n",SENSOR_NAME_STRING()); - msleep(35); - cnt--; - } - if ((atomic_read(&client->adapter->bus_lock.count) < 1) && (cnt<=0)) { - SENSOR_TR("\n %s obtain i2c fail in atomic!!\n",SENSOR_NAME_STRING()); - goto sensor_task_lock_err; - } - preempt_disable(); - } - - atomic_add(1, &sensor->tasklock_cnt); - } else { - if (atomic_read(&sensor->tasklock_cnt) > 0) { - atomic_sub(1, &sensor->tasklock_cnt); - - if (atomic_read(&sensor->tasklock_cnt) == 0) - preempt_enable(); - } - } - return 0; -sensor_task_lock_err: - return -1; -#else - return 0; -#endif - -} - -/* sensor register write */ -static int sensor_write(struct i2c_client *client, u8 reg, u8 val) -{ - int err,cnt; - u8 buf[2]; - struct i2c_msg msg[1]; - - buf[0] = reg & 0xFF; - buf[1] = val; - - msg->addr = client->addr; - msg->flags = client->flags; - msg->buf = buf; - msg->len = sizeof(buf); - msg->scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg->read_type = 0; /* fpga i2c:0==I2C_NORMAL : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 3; - err = -EAGAIN; - - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 1); - - if (err >= 0) { - return 0; - } else { - SENSOR_TR("\n %s write reg(0x%x, val:0x%x) failed, try to write again!\n",SENSOR_NAME_STRING(),reg, val); - udelay(10); - } - } - - return err; -} - -/* sensor register read */ -static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) -{ - int err,cnt; - //u8 buf[2]; - u8 buf[1]; - struct i2c_msg msg[2]; - - //buf[0] = reg >> 8; - buf[0] = reg; - buf[1] = reg & 0xFF; - - msg[0].addr = client->addr; - msg[0].flags = client->flags; - msg[0].buf = buf; - msg[0].len = sizeof(buf); - msg[0].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[0].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - msg[1].addr = client->addr; - msg[1].flags = client->flags|I2C_M_RD; - msg[1].buf = buf; - msg[1].len = 1; - msg[1].scl_rate = CONFIG_SENSOR_I2C_SPEED; /* ddl@rock-chips.com : 100kHz */ - msg[1].read_type = 2; /* fpga i2c:0==I2C_NO_STOP : direct use number not enum for don't want include spi_fpga.h */ - - cnt = 1; - err = -EAGAIN; - while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ - err = i2c_transfer(client->adapter, msg, 2); - - if (err >= 0) { - *val = buf[0]; - return 0; - } else { - SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val); - udelay(10); - } - } - - return err; -} - -/* write a array of registers */ -#if 1 -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err; - int i = 0; - - //for(i=0; i < sizeof(sensor_init_data) / 2;i++) - while((regarray[i].reg != 0xff) || (regarray[i].val != 0xff)) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err != 0) - { - SENSOR_TR("%s..write failed current i = %d\n", SENSOR_NAME_STRING(),i); - return err; - } - i++; - } - - return 0; -} -#else -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) -{ - int err; - int i = 0; - u8 val_read; - while (regarray[i].reg != 0) - { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err != 0) - { - SENSOR_TR("%s..write failed current i = %d\n", SENSOR_NAME_STRING(),i); - return err; - } - err = sensor_read(client, regarray[i].reg, &val_read); - SENSOR_TR("%s..reg[0x%x]=0x%x,0x%x\n", SENSOR_NAME_STRING(),regarray[i].reg, val_read, regarray[i].val); - i++; - } - return 0; -} -#endif - -#if CONFIG_SENSOR_I2C_RDWRCHK -static int sensor_check_array(struct i2c_client *client, struct reginfo *regarray) -{ - int ret; - int i = 0; - - u8 value; - - SENSOR_DG("%s >>>>>>>>>>>>>>>>>>>>>>\n",__FUNCTION__); - for(i=0;ipowerdown) { - ret = icl->powerdown(icd->pdev, on); - if (ret == RK29_CAM_IO_SUCCESS) { - if (on == 0) { - mdelay(20); // 2 modify by sp_yjp,20120831 - if (icl->reset) - icl->reset(icd->pdev); - mdelay(50); // add by sp_yjp,20120831 - } - } else if (ret == RK29_CAM_EIO_REQUESTFAIL) { - ret = -ENODEV; - goto sensor_power_end; - } - } - break; - } - case Sensor_Flash: - { - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - if (sensor->sensor_io_request && sensor->sensor_io_request->sensor_ioctrl) { - sensor->sensor_io_request->sensor_ioctrl(icd->pdev,Cam_Flash, on); - } - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown!",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_power_end: - return ret; -} - -static int sensor_init(struct v4l2_subdev *sd, u32 val) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - const struct sensor_datafmt *fmt; - int ret; - - SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__); - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - msleep(10); - if (sensor_ioctrl(icd, Sensor_PowerDown, 1) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - msleep(10); - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_INIT_ERR; - } - msleep(10); - - /* soft reset */ - if (sensor_task_lock(client,1)<0) - goto sensor_INIT_ERR; - /* ret = sensor_write(client, 0x12, 0x80); - if (ret != 0) - { - SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_INIT_ERR; - } - - mdelay(5); */ //delay 5 microseconds - - ret = sensor_write_array(client, sensor_init_data); - if (ret != 0) - { - SENSOR_TR("error: %s initial failed\n",SENSOR_NAME_STRING()); - goto sensor_INIT_ERR; - } - - sensor_task_lock(client,0); - - sensor->info_priv.winseqe_cur_addr = (int)SENSOR_INIT_WINSEQADR; - fmt = sensor_find_datafmt(SENSOR_INIT_PIXFMT,sensor_colour_fmts, ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - SENSOR_TR("error: %s initial array colour fmts is not support!!",SENSOR_NAME_STRING()); - ret = -EINVAL; - goto sensor_INIT_ERR; - } - sensor->info_priv.fmt = *fmt; - - /* sensor sensor information for initialization */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - if (qctrl) - sensor->info_priv.whiteBalance = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_BRIGHTNESS); - if (qctrl) - sensor->info_priv.brightness = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - if (qctrl) - sensor->info_priv.effect = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EXPOSURE); - if (qctrl) - sensor->info_priv.exposure = qctrl->default_value; - - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SATURATION); - if (qctrl) - sensor->info_priv.saturation = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_CONTRAST); - if (qctrl) - sensor->info_priv.contrast = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_HFLIP); - if (qctrl) - sensor->info_priv.mirror = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_VFLIP); - if (qctrl) - sensor->info_priv.flip = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_SCENE); - if (qctrl) - sensor->info_priv.scene = qctrl->default_value; - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl) - sensor->info_priv.digitalzoom = qctrl->default_value; - - /* ddl@rock-chips.com : if sensor support auto focus and flash, programer must run focus and flash code */ - #if CONFIG_SENSOR_Focus - sensor_set_focus(); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FOCUS_ABSOLUTE); - if (qctrl) - sensor->info_priv.focus = qctrl->default_value; - #endif - - #if CONFIG_SENSOR_Flash - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_FLASH); - if (qctrl) - sensor->info_priv.flash = qctrl->default_value; - #endif - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),((val == 0)?__FUNCTION__:"sensor_reinit"),icd->user_width,icd->user_height); - sensor->info_priv.funmodule_state |= SENSOR_INIT_IS_OK; - return 0; -sensor_INIT_ERR: - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - sensor_task_lock(client,0); - sensor_deactivate(client); - return ret; -} - -static int sensor_deactivate(struct i2c_client *client) -{ - struct soc_camera_device *icd = client->dev.platform_data; - //u8 reg_val; - struct sensor *sensor = to_sensor(client); - SENSOR_DG("\n%s..%s.. Enter\n",SENSOR_NAME_STRING(),__FUNCTION__); - - /* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */ - sensor_ioctrl(icd, Sensor_PowerDown, 1); - msleep(100); - - /* ddl@rock-chips.com : sensor config init width , because next open sensor quickly(soc_camera_open -> Try to configure with default parameters) */ - icd->user_width = SENSOR_INIT_WIDTH; - icd->user_height = SENSOR_INIT_HEIGHT; - sensor->info_priv.funmodule_state &= ~SENSOR_INIT_IS_OK; - - return 0; -} -static struct reginfo sensor_power_down_sequence[]= -{ - {0xfd,0x00},{0xff,0xff} -}; -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - int ret; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if (pm_msg.event == PM_EVENT_SUSPEND) { - SENSOR_DG("\n %s Enter Suspend.. \n", SENSOR_NAME_STRING()); - ret = sensor_write_array(client, sensor_power_down_sequence) ; - if (ret != 0) { - SENSOR_TR("\n %s..%s WriteReg Fail.. \n", SENSOR_NAME_STRING(),__FUNCTION__); - return ret; - } else { - ret = sensor_ioctrl(icd, Sensor_PowerDown, 1); - if (ret < 0) { - SENSOR_TR("\n %s suspend fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - } - } else { - SENSOR_TR("\n %s cann't suppout Suspend..\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - int ret; - - ret = sensor_ioctrl(icd, Sensor_PowerDown, 0); - if (ret < 0) { - SENSOR_TR("\n %s resume fail for turn on power!\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - SENSOR_DG("\n %s Enter Resume.. \n", SENSOR_NAME_STRING()); - - return 0; - -} - -static int sensor_set_bus_param(struct soc_camera_device *icd, - unsigned long flags) -{ - - return 0; -} - -static unsigned long sensor_query_bus_param(struct soc_camera_device *icd) -{ - struct soc_camera_link *icl = to_soc_camera_link(icd); - unsigned long flags = SENSOR_BUS_PARAM; - - return soc_camera_apply_sensor_flags(icl, flags); -} - -static int sensor_g_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - - mf->width = icd->user_width; - mf->height = icd->user_height; - mf->code = sensor->info_priv.fmt.code; - mf->colorspace = sensor->info_priv.fmt.colorspace; - mf->field = V4L2_FIELD_NONE; - - return 0; -} -static bool sensor_fmt_capturechk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1024) && (mf->height == 768)) { - ret = true; - } else if ((mf->width == 1280) && (mf->height == 1024)) { - ret = true; - } else if ((mf->width == 1600) && (mf->height == 1200)) { - ret = true; - } else if ((mf->width == 2048) && (mf->height == 1536)) { - ret = true; - } else if ((mf->width == 2592) && (mf->height == 1944)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is capture format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} - -static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - bool ret = false; - - if ((mf->width == 1280) && (mf->height == 720)) { - ret = true; - } else if ((mf->width == 1920) && (mf->height == 1080)) { - ret = true; - } - - if (ret == true) - SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, mf->width, mf->height); - return ret; -} -static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - const struct sensor_datafmt *fmt; - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - struct soc_camera_device *icd = client->dev.platform_data; - struct reginfo *winseqe_set_addr=NULL; - int ret=0, set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (!fmt) { - ret = -EINVAL; - goto sensor_s_fmt_end; - } - - if (sensor->info_priv.fmt.code != mf->code) { - switch (mf->code) - { - case V4L2_MBUS_FMT_YUYV8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_YUYV; - break; - } - case V4L2_MBUS_FMT_UYVY8_2X8: - { - winseqe_set_addr = sensor_ClrFmt_UYVY; - break; - } - default: - break; - } - if (winseqe_set_addr != NULL) { - sensor_write_array(client, winseqe_set_addr); - sensor->info_priv.fmt.code = mf->code; - sensor->info_priv.fmt.colorspace= mf->colorspace; - SENSOR_DG("%s v4l2_mbus_code:%d set success!\n", SENSOR_NAME_STRING(),mf->code); - } else { - SENSOR_TR("%s v4l2_mbus_code:%d is invalidate!\n", SENSOR_NAME_STRING(),mf->code); - } - } - - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg!=0xff)) - { - winseqe_set_addr = sensor_qcif; - set_w = 176; - set_h = 144; - } - else if (((set_w <= 320) && (set_h <= 240)) && (sensor_qvga[0].reg!=0xff)) - { - winseqe_set_addr = sensor_qvga; - set_w = 320; - set_h = 240; - } - else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=0xff)) - { - winseqe_set_addr = sensor_cif; - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=0xff)) - { - winseqe_set_addr = sensor_vga; - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600))) - { - if (sensor_svga[0].reg!=0xff) { - winseqe_set_addr = sensor_svga; - set_w = 800-16; - set_h = 600-12; - } else if (sensor_vga[0].reg!=0xff) { - winseqe_set_addr = sensor_vga; - set_w = 640-16; - set_h = 480-12; - } else if (sensor_uxga[0].reg!=0xff) { - winseqe_set_addr = sensor_uxga; - set_w = 1600-16; - set_h = 1200-12; - } - } - else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=0xff)) - { - winseqe_set_addr = sensor_sxga; - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=0xff)) - { - winseqe_set_addr = sensor_uxga; - set_w = 1600; - set_h = 1200; - } - else - { - winseqe_set_addr = SENSOR_INIT_WINSEQADR; /* ddl@rock-chips.com : Sensor output smallest size if isn't support app */ - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - SENSOR_TR("\n %s..%s Format is Invalidate. pix->width = %d.. pix->height = %d\n",SENSOR_NAME_STRING(),__FUNCTION__,mf->width,mf->height); - } - printk("%s(%d): %dx%d -> %dx%d\n",__FUNCTION__,__LINE__, mf->width,mf->height,set_w,set_h); - - printk("win: %p %p %p %p %p %p\n",winseqe_set_addr,sensor->info_priv.winseqe_cur_addr, - sensor_uxga,sensor_svga,sensor_vga,sensor_sxga); - - - if ((int)winseqe_set_addr != sensor->info_priv.winseqe_cur_addr) { - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_On); - SENSOR_DG("%s flash on in capture!\n", SENSOR_NAME_STRING()); - } - } else { /* ddl@rock-chips.com : Video */ - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_DG("%s flash off in preivew!\n", SENSOR_NAME_STRING()); - } - } - #endif - ret |= sensor_write_array(client, winseqe_set_addr); - if (ret != 0) { - SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING()); - #if CONFIG_SENSOR_Flash - if (sensor_fmt_capturechk(sd,mf) == true) { - if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - SENSOR_TR("%s Capture format set fail, flash off !\n", SENSOR_NAME_STRING()); - } - } - #endif - goto sensor_s_fmt_end; - } - - sensor->info_priv.winseqe_cur_addr = (int)winseqe_set_addr; - - if (sensor_fmt_capturechk(sd,mf) == true) { /* ddl@rock-chips.com : Capture */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - if (sensor->info_priv.whiteBalance != 0) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - } - sensor->info_priv.snap2preview = true; - } else if (sensor_fmt_videochk(sd,mf) == true) { /* ddl@rock-chips.com : Video */ - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - sensor->info_priv.video2preview = true; - } else if ((sensor->info_priv.snap2preview == true) || (sensor->info_priv.video2preview == true)) { - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_EFFECT); - sensor_set_effect(icd, qctrl,sensor->info_priv.effect); - qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE); - sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance); - msleep(600); - sensor->info_priv.video2preview = false; - sensor->info_priv.snap2preview = false; - } - - SENSOR_DG("\n%s..%s.. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),__FUNCTION__,set_w,set_h); - } - else - { - SENSOR_DG("\n %s .. Current Format is validate. icd->width = %d.. icd->height %d\n",SENSOR_NAME_STRING(),set_w,set_h); - } - - mf->width = set_w; - mf->height = set_h; - -sensor_s_fmt_end: - return ret; -} - -static int sensor_try_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct sensor_datafmt *fmt; - int ret = 0,set_w,set_h; - - fmt = sensor_find_datafmt(mf->code, sensor_colour_fmts, - ARRAY_SIZE(sensor_colour_fmts)); - if (fmt == NULL) { - fmt = &sensor->info_priv.fmt; - mf->code = fmt->code; - } - - if (mf->height > SENSOR_MAX_HEIGHT) - mf->height = SENSOR_MAX_HEIGHT; - else if (mf->height < SENSOR_MIN_HEIGHT) - mf->height = SENSOR_MIN_HEIGHT; - - if (mf->width > SENSOR_MAX_WIDTH) - mf->width = SENSOR_MAX_WIDTH; - else if (mf->width < SENSOR_MIN_WIDTH) - mf->width = SENSOR_MIN_WIDTH; - - - if ((mf->width == 320) && (mf->height == 240)) { - printk("%s(%d): qvga ERROR\n",__FUNCTION__,__LINE__); - return -1; - } - set_w = mf->width; - set_h = mf->height; - - if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg!=0xff)) - { - set_w = 176; - set_h = 144; - } - else if (((set_w == 320) && (set_h == 240)))// && (sensor_qvga[0].reg!=0xff)) - { - set_w = 320; - set_h = 240; - ret = -1; - } - else if (((set_w <= 352) && (set_h<= 288)) && (sensor_cif[0].reg!=0xff)) - { - set_w = 352; - set_h = 288; - } - else if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=0xff)) - { - set_w = 640; - set_h = 480; - } - else if (((set_w <= 800) && (set_h <= 600))) - { - if (sensor_svga[0].reg!=0xff) { - set_w = 800-16; - set_h = 600-12; - } else if (sensor_vga[0].reg!=0xff) { - set_w = 640-16; - set_h = 480-12; - } else if (sensor_uxga[0].reg!=0xff) { - set_w = 1600-16; - set_h = 1200-12; - } - } - else if (((set_w <= 1280) && (set_h <= 1024)) && (sensor_sxga[0].reg!=0xff)) - { - set_w = 1280; - set_h = 1024; - } - else if (((set_w <= 1600) && (set_h <= 1200)) && (sensor_uxga[0].reg!=0xff)) - { - set_w = 1600; - set_h = 1200; - } - else - { - set_w = SENSOR_INIT_WIDTH; - set_h = SENSOR_INIT_HEIGHT; - } - - mf->width = set_w; - mf->height = set_h; - - mf->colorspace = fmt->colorspace; - - return ret; -} - - static int sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR) - return -EINVAL; - - if (id->match.addr != client->addr) - return -ENODEV; - - id->ident = SENSOR_V4L2_IDENT; /* ddl@rock-chips.com : Return OV9650 identifier */ - id->revision = 0; - - return 0; -} -#if CONFIG_SENSOR_Brightness -static int sensor_set_brightness(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_BrightnessSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_BrightnessSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Effect -static int sensor_set_effect(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_EffectSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_EffectSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Exposure -static int sensor_set_exposure(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ExposureSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ExposureSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Saturation -static int sensor_set_saturation(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SaturationSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SaturationSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Contrast -static int sensor_set_contrast(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_ContrastSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_ContrastSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Mirror -static int sensor_set_mirror(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_MirrorSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_MirrorSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flip -static int sensor_set_flip(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_FlipSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_FlipSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Scene -static int sensor_set_scene(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_SceneSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_SceneSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_WhiteBalance -static int sensor_set_whiteBalance(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) - { - if (sensor_WhiteBalanceSeqe[value - qctrl->minimum] != NULL) - { - if (sensor_write_array(client, sensor_WhiteBalanceSeqe[value - qctrl->minimum]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - } - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_DigitalZoom -static int sensor_set_digitalzoom(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int *value) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl_info; - int digitalzoom_cur, digitalzoom_total; - - qctrl_info = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_ZOOM_ABSOLUTE); - if (qctrl_info) - return -EINVAL; - - digitalzoom_cur = sensor->info_priv.digitalzoom; - digitalzoom_total = qctrl_info->maximum; - - if ((*value > 0) && (digitalzoom_cur >= digitalzoom_total)) - { - SENSOR_TR("%s digitalzoom is maximum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value < 0) && (digitalzoom_cur <= qctrl_info->minimum)) - { - SENSOR_TR("%s digitalzoom is minimum - %x\n", SENSOR_NAME_STRING(), digitalzoom_cur); - return -EINVAL; - } - - if ((*value > 0) && ((digitalzoom_cur + *value) > digitalzoom_total)) - { - *value = digitalzoom_total - digitalzoom_cur; - } - - if ((*value < 0) && ((digitalzoom_cur + *value) < 0)) - { - *value = 0 - digitalzoom_cur; - } - - digitalzoom_cur += *value; - - if (sensor_ZoomSeqe[digitalzoom_cur] != NULL) - { - if (sensor_write_array(client, sensor_ZoomSeqe[digitalzoom_cur]) != 0) - { - SENSOR_TR("%s..%s WriteReg Fail.. \n",SENSOR_NAME_STRING(), __FUNCTION__); - return -EINVAL; - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, *value); - return 0; - } - - return -EINVAL; -} -#endif -#if CONFIG_SENSOR_Flash -static int sensor_set_flash(struct soc_camera_device *icd, const struct v4l2_queryctrl *qctrl, int value) -{ - if ((value >= qctrl->minimum) && (value <= qctrl->maximum)) { - if (value == 3) { /* ddl@rock-chips.com: torch */ - sensor_ioctrl(icd, Sensor_Flash, Flash_Torch); /* Flash On */ - } else { - sensor_ioctrl(icd, Sensor_Flash, Flash_Off); - } - SENSOR_DG("%s..%s : %x\n",SENSOR_NAME_STRING(),__FUNCTION__, value); - return 0; - } - - SENSOR_TR("\n %s..%s valure = %d is invalidate.. \n",SENSOR_NAME_STRING(),__FUNCTION__,value); - return -EINVAL; -} -#endif - -static int sensor_g_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - const struct v4l2_queryctrl *qctrl; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { - case V4L2_CID_BRIGHTNESS: - { - ctrl->value = sensor->info_priv.brightness; - break; - } - case V4L2_CID_SATURATION: - { - ctrl->value = sensor->info_priv.saturation; - break; - } - case V4L2_CID_CONTRAST: - { - ctrl->value = sensor->info_priv.contrast; - break; - } - case V4L2_CID_DO_WHITE_BALANCE: - { - ctrl->value = sensor->info_priv.whiteBalance; - break; - } - case V4L2_CID_EXPOSURE: - { - ctrl->value = sensor->info_priv.exposure; - break; - } - case V4L2_CID_HFLIP: - { - ctrl->value = sensor->info_priv.mirror; - break; - } - case V4L2_CID_VFLIP: - { - ctrl->value = sensor->info_priv.flip; - break; - } - default : - break; - } - return 0; -} - - - -static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - const struct v4l2_queryctrl *qctrl; - - - qctrl = soc_camera_find_qctrl(&sensor_ops, ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ctrl->id); - return -EINVAL; - } - - switch (ctrl->id) - { -#if CONFIG_SENSOR_Brightness - case V4L2_CID_BRIGHTNESS: - { - if (ctrl->value != sensor->info_priv.brightness) - { - if (sensor_set_brightness(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.brightness = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Exposure - case V4L2_CID_EXPOSURE: - { - if (ctrl->value != sensor->info_priv.exposure) - { - if (sensor_set_exposure(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.exposure = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Saturation - case V4L2_CID_SATURATION: - { - if (ctrl->value != sensor->info_priv.saturation) - { - if (sensor_set_saturation(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.saturation = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Contrast - case V4L2_CID_CONTRAST: - { - if (ctrl->value != sensor->info_priv.contrast) - { - if (sensor_set_contrast(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.contrast = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_WhiteBalance - case V4L2_CID_DO_WHITE_BALANCE: - { - if (ctrl->value != sensor->info_priv.whiteBalance) - { - if (sensor_set_whiteBalance(icd, qctrl,ctrl->value) != 0) - { - return -EINVAL; - } - sensor->info_priv.whiteBalance = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Mirror - case V4L2_CID_HFLIP: - { - if (ctrl->value != sensor->info_priv.mirror) - { - if (sensor_set_mirror(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.mirror = ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Flip - case V4L2_CID_VFLIP: - { - if (ctrl->value != sensor->info_priv.flip) - { - if (sensor_set_flip(icd, qctrl,ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flip = ctrl->value; - } - break; - } -#endif - default: - break; - } - - return 0; -} -static int sensor_g_ext_control(struct soc_camera_device *icd , struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - switch (ext_ctrl->id) - { - case V4L2_CID_SCENE: - { - ext_ctrl->value = sensor->info_priv.scene; - break; - } - case V4L2_CID_EFFECT: - { - ext_ctrl->value = sensor->info_priv.effect; - break; - } - case V4L2_CID_ZOOM_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.digitalzoom; - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FOCUS_ABSOLUTE: - { - ext_ctrl->value = sensor->info_priv.focus; - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - return -EINVAL; - } - case V4L2_CID_FLASH: - { - ext_ctrl->value = sensor->info_priv.flash; - break; - } - default : - break; - } - return 0; -} -static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_control *ext_ctrl) -{ - const struct v4l2_queryctrl *qctrl; - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct sensor *sensor = to_sensor(client); - int val_offset; - - qctrl = soc_camera_find_qctrl(&sensor_ops, ext_ctrl->id); - - if (!qctrl) - { - SENSOR_TR("\n %s ioctrl id = %d is invalidate \n", SENSOR_NAME_STRING(), ext_ctrl->id); - return -EINVAL; - } - - val_offset = 0; - switch (ext_ctrl->id) - { -#if CONFIG_SENSOR_Scene - case V4L2_CID_SCENE: - { - if (ext_ctrl->value != sensor->info_priv.scene) - { - if (sensor_set_scene(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.scene = ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_Effect - case V4L2_CID_EFFECT: - { - if (ext_ctrl->value != sensor->info_priv.effect) - { - if (sensor_set_effect(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.effect= ext_ctrl->value; - } - break; - } -#endif -#if CONFIG_SENSOR_DigitalZoom - case V4L2_CID_ZOOM_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.digitalzoom) - { - val_offset = ext_ctrl->value -sensor->info_priv.digitalzoom; - - if (sensor_set_digitalzoom(icd, qctrl,&val_offset) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += val_offset; - - SENSOR_DG("%s digitalzoom is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - - break; - } - case V4L2_CID_ZOOM_RELATIVE: - { - if (ext_ctrl->value) - { - if (sensor_set_digitalzoom(icd, qctrl,&ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.digitalzoom += ext_ctrl->value; - - SENSOR_DG("%s digitalzoom is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.digitalzoom); - } - break; - } -#endif -#if CONFIG_SENSOR_Focus - case V4L2_CID_FOCUS_ABSOLUTE: - { - if ((ext_ctrl->value < qctrl->minimum) || (ext_ctrl->value > qctrl->maximum)) - return -EINVAL; - - if (ext_ctrl->value != sensor->info_priv.focus) - { - val_offset = ext_ctrl->value -sensor->info_priv.focus; - - sensor->info_priv.focus += val_offset; - } - - break; - } - case V4L2_CID_FOCUS_RELATIVE: - { - if (ext_ctrl->value) - { - sensor->info_priv.focus += ext_ctrl->value; - - SENSOR_DG("%s focus is %x\n", SENSOR_NAME_STRING(), sensor->info_priv.focus); - } - break; - } -#endif -#if CONFIG_SENSOR_Flash - case V4L2_CID_FLASH: - { - if (sensor_set_flash(icd, qctrl,ext_ctrl->value) != 0) - return -EINVAL; - sensor->info_priv.flash = ext_ctrl->value; - - SENSOR_DG("%s flash is %x\n",SENSOR_NAME_STRING(), sensor->info_priv.flash); - break; - } -#endif - default: - break; - } - - return 0; -} - -static int sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_g_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - int i, error_cnt=0, error_idx=-1; - - - for (i=0; icount; i++) { - if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) { - error_cnt++; - error_idx = i; - } - } - - if (error_cnt > 1) - error_idx = ext_ctrl->count; - - if (error_idx != -1) { - ext_ctrl->error_idx = error_idx; - return -EINVAL; - } else { - return 0; - } -} - -/* Interface active, can use i2c. If it fails, it can indeed mean, that - * this wasn't our capture interface, so, we wait for the right one */ -static int sensor_video_probe(struct soc_camera_device *icd, - struct i2c_client *client) -{ - char pid = 0; - int ret; - struct sensor *sensor = to_sensor(client); - - /* We must have a parent by now. And it cannot be a wrong one. - * So this entire test is completely redundant. */ - if (!icd->dev.parent || - to_soc_camera_host(icd->dev.parent)->nr != icd->iface) - return -ENODEV; - - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - msleep(10); - if (sensor_ioctrl(icd, Sensor_PowerDown, 1) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - msleep(10); - if (sensor_ioctrl(icd, Sensor_PowerDown, 0) < 0) { - ret = -ENODEV; - goto sensor_video_probe_err; - } - msleep(10); - - /* check if it is an sensor sensor */ - ////////ret = sensor_read(client, 0x00, &pid); - ret = sensor_read(client, SENSOR_ID_REG, &pid); - if (ret != 0) { - SENSOR_TR("%s read chip id high byte failed\n",SENSOR_NAME_STRING()); - ret = -ENODEV; - goto sensor_video_probe_err; - } - - SENSOR_DG("\n %s pid = 0x%x\n", SENSOR_NAME_STRING(), pid); -#if 1 - if (pid == SENSOR_ID) { - sensor->model = SENSOR_V4L2_IDENT; - } else { - SENSOR_TR("error: %s mismatched pid = 0x%x\n", SENSOR_NAME_STRING(), pid); - ret = -ENODEV; - goto sensor_video_probe_err; - } -#else - sensor->model = SENSOR_V4L2_IDENT; - -#endif - return 0; - -sensor_video_probe_err: - - return ret; -} - -static long sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - struct soc_camera_device *icd = client->dev.platform_data; - struct sensor *sensor = to_sensor(client); - int ret = 0; - - int i; - - - SENSOR_DG("\n%s..%s..cmd:%x \n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - switch (cmd) - { - case RK29_CAM_SUBDEV_DEACTIVATE: - { - sensor_deactivate(client); - break; - } - - case RK29_CAM_SUBDEV_IOREQUEST: - { - sensor->sensor_io_request = (struct rk29camera_platform_data*)arg; - if (sensor->sensor_io_request != NULL) { - sensor->sensor_gpio_res = NULL; - for (i=0; isensor_io_request->gpio_res[i].dev_name && - (strcmp(sensor->sensor_io_request->gpio_res[i].dev_name, dev_name(icd->pdev)) == 0)) { - sensor->sensor_gpio_res = (struct rk29camera_gpio_res*)&sensor->sensor_io_request->gpio_res[i]; - } - } - if (sensor->sensor_gpio_res == NULL) { - SENSOR_TR("%s %s obtain gpio resource failed when RK29_CAM_SUBDEV_IOREQUEST \n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - } else { - SENSOR_TR("%s %s RK29_CAM_SUBDEV_IOREQUEST fail\n",SENSOR_NAME_STRING(),__FUNCTION__); - ret = -EINVAL; - goto sensor_ioctl_end; - } - /* ddl@rock-chips.com : if gpio_flash havn't been set in board-xxx.c, sensor driver must notify is not support flash control - for this project */ - #if CONFIG_SENSOR_Flash - if (sensor->sensor_gpio_res) { - if (sensor->sensor_gpio_res->gpio_flash == INVALID_GPIO) { - for (i = 0; i < icd->ops->num_controls; i++) { - if (V4L2_CID_FLASH == icd->ops->controls[i].id) { - memset((char*)&icd->ops->controls[i],0x00,sizeof(struct v4l2_queryctrl)); - } - } - sensor->info_priv.flash = 0xff; - SENSOR_DG("%s flash gpio is invalidate!\n",SENSOR_NAME_STRING()); - } - } - #endif - break; - } - default: - { - SENSOR_TR("%s %s cmd(0x%x) is unknown !\n",SENSOR_NAME_STRING(),__FUNCTION__,cmd); - break; - } - } -sensor_ioctl_end: - return ret; - -} -static int sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) -{ - if (index >= ARRAY_SIZE(sensor_colour_fmts)) - return -EINVAL; - - *code = sensor_colour_fmts[index].code; - return 0; -} -static struct v4l2_subdev_core_ops sensor_subdev_core_ops = { - .init = sensor_init, - .g_ctrl = sensor_g_control, - .s_ctrl = sensor_s_control, - .g_ext_ctrls = sensor_g_ext_controls, - .s_ext_ctrls = sensor_s_ext_controls, - .g_chip_ident = sensor_g_chip_ident, - .ioctl = sensor_ioctl, -}; - -static struct v4l2_subdev_video_ops sensor_subdev_video_ops = { - .s_mbus_fmt = sensor_s_fmt, - .g_mbus_fmt = sensor_g_fmt, - .try_mbus_fmt = sensor_try_fmt, - .enum_mbus_fmt = sensor_enum_fmt, -}; - -static struct v4l2_subdev_ops sensor_subdev_ops = { - .core = &sensor_subdev_core_ops, - .video = &sensor_subdev_video_ops, -}; - -static int sensor_probe(struct i2c_client *client, - const struct i2c_device_id *did) -{ - struct sensor *sensor; - struct soc_camera_device *icd = client->dev.platform_data; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - struct soc_camera_link *icl; - int ret; - - SENSOR_DG("\n%s..%s..%d..\n",__FUNCTION__,__FILE__,__LINE__); - if (!icd) { - dev_err(&client->dev, "%s: missing soc-camera data!\n",SENSOR_NAME_STRING()); - return -EINVAL; - } - - icl = to_soc_camera_link(icd); - if (!icl) { - dev_err(&client->dev, "%s driver needs platform data\n", SENSOR_NAME_STRING()); - return -EINVAL; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { - dev_warn(&adapter->dev, - "I2C-Adapter doesn't support I2C_FUNC_I2C\n"); - return -EIO; - } - - sensor = kzalloc(sizeof(struct sensor), GFP_KERNEL); - if (!sensor) - return -ENOMEM; - - v4l2_i2c_subdev_init(&sensor->subdev, client, &sensor_subdev_ops); - - /* Second stage probe - when a capture adapter is there */ - icd->ops = &sensor_ops; - - sensor->info_priv.fmt = sensor_colour_fmts[0]; - - #if CONFIG_SENSOR_I2C_NOSCHED - atomic_set(&sensor->tasklock_cnt,0); - #endif - - ret = sensor_video_probe(icd, client); - if (ret < 0) { - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - kfree(sensor); - sensor = NULL; - } - SENSOR_DG("\n%s..%s..%d ret = %x \n",__FUNCTION__,__FILE__,__LINE__,ret); - return ret; -} - -static int sensor_remove(struct i2c_client *client) -{ - struct sensor *sensor = to_sensor(client); - struct soc_camera_device *icd = client->dev.platform_data; - - icd->ops = NULL; - i2c_set_clientdata(client, NULL); - client->driver = NULL; - kfree(sensor); - sensor = NULL; - return 0; -} - -static const struct i2c_device_id sensor_id[] = { - {SENSOR_NAME_STRING(), 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sensor_id); - -static struct i2c_driver sensor_i2c_driver = { - .driver = { - .name = SENSOR_NAME_STRING(), - }, - .probe = sensor_probe, - .remove = sensor_remove, - .id_table = sensor_id, -}; - -static int __init sensor_mod_init(void) -{ - printk("\n*****************%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING()); -#ifdef CONFIG_SOC_CAMERA_FCAM - return 0; -#else - return i2c_add_driver(&sensor_i2c_driver); -#endif -} - -static void __exit sensor_mod_exit(void) -{ - i2c_del_driver(&sensor_i2c_driver); -} - -device_initcall_sync(sensor_mod_init); -module_exit(sensor_mod_exit); - -MODULE_DESCRIPTION(SENSOR_NAME_STRING(Camera sensor driver)); -MODULE_AUTHOR("ddl "); -MODULE_LICENSE("GPL"); -/* -struct cam_sensor_info cam_sensor_info_SP2518={ - "SP2518", - 1, - 1, - 0x30>>1, - 0, - SENSOR_ID_REG, - SENSOR_ID, - 0xff, - 0xff, - - &sensor_ops, - &sensor_subdev_ops, - sensor_deactivate, - sensor_read, - sensor_write, - 0, - sensor_video_probe, -}; - -EXPORT_SYMBOL_GPL(cam_sensor_info_SP2518); -*/ - - - diff --git a/drivers/media/video/tp2825.c b/drivers/media/video/tp2825.c deleted file mode 100644 index fa351ce46d53..000000000000 --- a/drivers/media/video/tp2825.c +++ /dev/null @@ -1,1846 +0,0 @@ -/* - * drivers/media/video/tp2825.c - * - * Copyright (C) ROCKCHIP, Inc. - * Author:zhoupeng - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "generic_sensor.h" -#include -#include -#include -#include - -/* -* Driver Version Note -*v0.0.1: this driver is compatible with generic_sensor -*v0.0.2: support debug_fs for debug -* support irq interrupt for switch input source -* support support PAL mode -*/ -static int version = KERNEL_VERSION(0, 0, 2); -module_param(version, int, S_IRUGO); - -static int debug; -module_param(debug, int, S_IRUGO | S_IWUSR); - -#define dprintk(level, fmt, arg...) do { \ - if (debug >= level) \ - printk(KERN_WARNING fmt, ## arg); \ -} while (0) -#define debug_printk(format, ...) dprintk(1, format, ## __VA_ARGS__) -/* Sensor Driver Configuration Begin */ -#define SENSOR_NAME RK29_CAM_SENSOR_TP2825 -#define SENSOR_V4L2_IDENT V4L2_IDENT_TP2825 -#define SENSOR_ID 0x2825 -#define SENSOR_BUS_PARAM (V4L2_MBUS_MASTER | \ - V4L2_MBUS_PCLK_SAMPLE_RISING | V4L2_MBUS_HSYNC_ACTIVE_HIGH | V4L2_MBUS_VSYNC_ACTIVE_HIGH | \ - V4L2_MBUS_DATA_ACTIVE_HIGH | SOCAM_MCLK_24MHZ) - -static int SENSOR_PREVIEW_W = 1280; -static int SENSOR_PREVIEW_H = 720; - -static struct rk_camera_device_signal_config dev_info[] = { - { - .type = RK_CAMERA_DEVICE_BT601_PIONGPONG, - .dvp = { - .vsync = RK_CAMERA_DEVICE_SIGNAL_HIGH_LEVEL, - .hsync = RK_CAMERA_DEVICE_SIGNAL_HIGH_LEVEL - }, - .crop = { - .top = 20, - .left = 8, - .width = 1280, - .height = 720 - } - } -}; - -static struct rk_camera_device_defrect defrects[4]; - -#define SENSOR_PREVIEW_FPS 30000 /* 30fps */ -#define SENSOR_FULLRES_L_FPS 15000 /* 15fps */ -#define SENSOR_FULLRES_H_FPS 15000 /* 15fps */ -#define SENSOR_720P_FPS 0 -#define SENSOR_1080P_FPS 0 - -#define SENSOR_REGISTER_LEN 1 /* sensor register address bytes */ -#define SENSOR_VALUE_LEN 1 /* sensor register value bytes */ -static char input_mode[10] = "720P"; -#define SENSOR_CHANNEL_REG 0x41 -#define SENSOR_CLAMPING_CONTROL 0x26 - -static unsigned int SensorConfiguration = (CFG_Effect | CFG_Scene); -static unsigned int SensorChipID[] = {SENSOR_ID}; -/* Sensor Driver Configuration End */ - -#define SENSOR_NAME_STRING(a) STR(CONS(SENSOR_NAME, a)) -#define SENSOR_NAME_VARFUN(a) CONS(SENSOR_NAME, a) - -#define SensorRegVal(a, b) CONS4(SensorReg, SENSOR_REGISTER_LEN, Val, SENSOR_VALUE_LEN)(a, b) -#define sensor_write(client, reg, v) CONS4(sensor_write_reg, SENSOR_REGISTER_LEN, val, SENSOR_VALUE_LEN)(client, (reg), (v)) -#define sensor_read(client, reg, v) CONS4(sensor_read_reg, SENSOR_REGISTER_LEN, val, SENSOR_VALUE_LEN)(client, (reg), (v)) -#define sensor_write_array generic_sensor_write_array - -struct sensor_parameter { - unsigned int PreviewDummyPixels; - unsigned int CaptureDummyPixels; - unsigned int preview_exposure; - - unsigned short int preview_line_width; - unsigned short int preview_gain; - unsigned short int PreviewPclk; - unsigned short int CapturePclk; - char awb[6]; -}; - -struct specific_sensor { - struct generic_sensor common_sensor; - struct sensor_parameter parameter; -}; - -/* -* The follow setting need been filled. -* -* Must Filled: -* sensor_init_data : Sensor initial setting; -* sensor_fullres_lowfps_data : Sensor full resolution setting with best auality, recommand for video; -* sensor_preview_data : Sensor preview resolution setting, recommand it is vga or svga; -* sensor_softreset_data : Sensor software reset register; -* sensor_check_id_data : Sensir chip id register; -* -* Optional filled: -* sensor_fullres_highfps_data: Sensor full resolution setting with high framerate, recommand for video; -* sensor_720p: Sensor 720p setting, it is for video; -* sensor_1080p: Sensor 1080p setting, it is for video; -* -* :::::WARNING::::: -* The SensorEnd which is the setting end flag must be filled int the last of each setting; -*/ - -/* Sensor initial setting */ -static struct rk_sensor_reg sensor_preview_data[] = { - SensorEnd -}; - -/* Senor full resolution setting: recommand for capture */ -static struct rk_sensor_reg sensor_fullres_lowfps_data[] = { - SensorEnd -}; - -/* Senor full resolution setting: recommand for video */ -static struct rk_sensor_reg sensor_fullres_highfps_data[] = { - SensorEnd -}; - -/* Preview resolution setting*/ -static struct rk_sensor_reg sensor_preview_data_ntsc[] = { - {0x02, 0xCF}, - {0x06, 0x32}, - {0x07, 0xC0}, - {0x08, 0x00}, - {0x09, 0x24}, - {0x0A, 0x48}, - {0x0B, 0xC0}, - {0x0C, 0x53}, - {0x0D, 0x10}, - {0x0E, 0x00}, - {0x0F, 0x00}, - {0x10, 0x5e}, - {0x11, 0x40}, - {0x12, 0x44}, - {0x13, 0x00}, - {0x14, 0x00}, - {0x15, 0x13}, - {0x16, 0x4E}, - {0x17, 0xBC}, - {0x18, 0x15}, - {0x19, 0xF0}, - {0x1A, 0x07}, - {0x1B, 0x00}, - {0x1C, 0x09}, - {0x1D, 0x38}, - {0x1E, 0x80}, - {0x1F, 0x80}, - {0x20, 0xA0}, - {0x21, 0x86}, - {0x22, 0x38}, - {0x23, 0x3C}, - {0x24, 0x56}, - {0x25, 0xFF}, - {0x27, 0x2D}, - {0x28, 0x00}, - {0x29, 0x48}, - {0x2A, 0x30}, - {0x2B, 0x70}, - {0x2C, 0x0A},/*1a*/ - {0x2D, 0x68}, - {0x2E, 0x5E}, - {0x2F, 0x00}, - {0x30, 0x62}, - {0x31, 0xBB}, - {0x32, 0x96}, - {0x33, 0xC0}, - {0x34, 0x00}, - {0x35, 0x65}, - {0x36, 0xDC}, - {0x37, 0x00}, - {0x38, 0x40}, - {0x39, 0x84}, - {0x3A, 0x00}, - {0x3B, 0x03}, - {0x3C, 0x00}, - {0x3D, 0x60}, - {0x3E, 0x00}, - {0x3F, 0x00}, - {0x40, 0x00}, - {0x42, 0x00}, - {0x43, 0x12}, - {0x44, 0x07}, - {0x45, 0x49}, - {0x46, 0x00}, - {0x47, 0x00}, - {0x48, 0x00}, - {0x49, 0x00}, - {0x4A, 0x00}, - {0x4B, 0x00}, - {0x4C, 0x03}, - //{0x4D, 0x03}, - {0x4E, 0x37}, - {0x4F, 0x01}, - {0xB5, 0x01}, - {0xB8, 0x02}, - {0xBA, 0x10}, - {0xF3, 0x00}, - {0xF4, 0x00}, - {0xF5, 0x00}, - {0xF6, 0x00}, - {0xF7, 0x00}, - {0xF8, 0x00}, - {0xF9, 0x00}, - {0xFA, 0x00}, - {0xFB, 0x00}, - {0xFC, 0xC0}, - {0xFD, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_preview_data_pal[] = { - {0x02, 0xCE}, - {0x06, 0x32}, - {0x07, 0xC0}, - {0x08, 0x00}, - {0x09, 0x24}, - {0x0A, 0x48}, - {0x0B, 0xC0}, - {0x0C, 0x53}, - {0x0D, 0x11}, - {0x0E, 0x00}, - {0x0F, 0x00}, - {0x10, 0x70}, - {0x11, 0x4D}, - {0x12, 0x40}, - {0x13, 0x00}, - {0x14, 0x00}, - {0x15, 0x13}, - {0x16, 0x67}, - {0x17, 0xBC}, - {0x18, 0x16}, - {0x19, 0x20}, - {0x1A, 0x17}, - {0x1B, 0x00}, - {0x1C, 0x09}, - {0x1D, 0x48}, - {0x1E, 0x80}, - {0x1F, 0x80}, - {0x20, 0xB0}, - {0x21, 0x86}, - {0x22, 0x38}, - {0x23, 0x3C}, - {0x24, 0x56}, - {0x25, 0xFF}, - {0x27, 0x2D}, - {0x28, 0x00}, - {0x29, 0x48}, - {0x2A, 0x30}, - {0x2B, 0x70}, - {0x2C, 0x1A}, - {0x2D, 0x60}, - {0x2E, 0x5E}, - {0x2F, 0x00}, - {0x30, 0x7A}, - {0x31, 0x4A}, - {0x32, 0x4D}, - {0x33, 0xF0}, - {0x34, 0x00}, - {0x35, 0x65}, - {0x36, 0xDC}, - {0x37, 0x00}, - {0x38, 0x40}, - {0x39, 0x84}, - {0x3A, 0x00}, - {0x3B, 0x03}, - {0x3C, 0x00}, - {0x3D, 0x60}, - {0x3E, 0x00}, - {0x3F, 0x00}, - {0x40, 0x00}, - {0x42, 0x00}, - {0x43, 0x12}, - {0x44, 0x07}, - {0x45, 0x49}, - {0x46, 0x00}, - {0x47, 0x00}, - {0x48, 0x00}, - {0x49, 0x00}, - {0x4A, 0x00}, - {0x4B, 0x00}, - {0x4C, 0x03}, - //{0x4D, 0x03}, - {0x4E, 0x37}, - {0x4F, 0x01}, - {0xB5, 0x01}, - {0xB8, 0x02}, - {0xBA, 0x10}, - {0xF3, 0x00}, - {0xF4, 0x00}, - {0xF5, 0x00}, - {0xF6, 0x00}, - {0xF7, 0x00}, - {0xF8, 0x00}, - {0xF9, 0x00}, - {0xFA, 0x00}, - {0xFB, 0x00}, - {0xFC, 0xC0}, - {0xFD, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_preview_data_720p_50hz[] = { - {0x02, 0xCA}, - {0x06, 0x32}, - {0x07, 0xC0}, - {0x08, 0x00}, - {0x09, 0x24}, - {0x0A, 0x48}, - {0x0B, 0xC0}, - {0x0C, 0x43}, - {0x0D, 0x10}, - {0x0E, 0x00}, - {0x0F, 0x00}, - {0x10, 0xf0}, - {0x11, 0x50}, - {0x12, 0x60}, - {0x13, 0x00}, - {0x14, 0x08}, - {0x15, 0x13}, - {0x16, 0x16}, - {0x17, 0x00}, - {0x18, 0x18}, - {0x19, 0xD0}, - {0x1A, 0x25}, - {0x1B, 0x00}, - {0x1C, 0x07}, - {0x1D, 0xBC}, - {0x1E, 0x80}, - {0x1F, 0x80}, - {0x20, 0x60}, - {0x21, 0x86}, - {0x22, 0x38}, - {0x23, 0x3C}, - {0x24, 0x56}, - {0x25, 0xFF}, - {0x27, 0x2D}, - {0x28, 0x00}, - {0x29, 0x48}, - {0x2A, 0x30}, - {0x2B, 0x4A}, - {0x2C, 0x1A}, - {0x2D, 0x30}, - {0x2E, 0x70}, - {0x2F, 0x00}, - {0x30, 0x48}, - {0x31, 0xBB}, - {0x32, 0x2E}, - {0x33, 0x90}, - {0x34, 0x00}, - {0x35, 0x05}, - {0x36, 0xDC}, - {0x37, 0x00}, - {0x38, 0x40}, - {0x39, 0x8C}, - {0x3A, 0x00}, - {0x3B, 0x03}, - {0x3C, 0x00}, - {0x3D, 0x60}, - {0x3E, 0x00}, - {0x3F, 0x00}, - {0x40, 0x00}, - {0x42, 0x00}, - {0x43, 0x12}, - {0x44, 0x07}, - {0x45, 0x49}, - {0x46, 0x00}, - {0x47, 0x00}, - {0x48, 0x00}, - {0x49, 0x00}, - {0x4A, 0x00}, - {0x4B, 0x00}, - {0x4C, 0x03}, - //{0x4D, 0x03}, - {0x4E, 0x03}, - {0x4F, 0x01}, - {0xB5, 0x01}, - {0xB8, 0x02}, - {0xBA, 0x10}, - {0xF3, 0x00}, - {0xF4, 0x00}, - {0xF5, 0x00}, - {0xF6, 0x00}, - {0xF7, 0x00}, - {0xF8, 0x00}, - {0xF9, 0x00}, - {0xFA, 0x00}, - {0xFB, 0x00}, - {0xFC, 0xC0}, - {0xFD, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_preview_data_720p_30hz[] = { - {0x02, 0xDA}, - {0x06, 0x32}, - {0x07, 0xC0}, - {0x08, 0x00}, - {0x09, 0x24}, - {0x0A, 0x48}, - {0x0B, 0xC0}, - {0x0C, 0x53}, - {0x0D, 0x10}, - {0x0E, 0x00}, - {0x0F, 0x00}, - {0x10, 0xf0}, - {0x11, 0x50}, - {0x12, 0x60}, - {0x13, 0x00}, - {0x14, 0x08}, - {0x15, 0x13}, - {0x16, 0x16}, - {0x17, 0x00}, - {0x18, 0x19}, - {0x19, 0xD0}, - {0x1A, 0x25}, - {0x1B, 0x00}, - {0x1C, 0x06}, - {0x1D, 0x72}, - {0x1E, 0x80}, - {0x1F, 0x80}, - {0x20, 0x60}, - {0x21, 0x86}, - {0x22, 0x38}, - {0x23, 0x3C}, - {0x24, 0x56}, - {0x25, 0xFF}, - {0x27, 0x2D}, - {0x28, 0x00}, - {0x29, 0x48}, - {0x2A, 0x30}, - {0x2B, 0x4A}, - {0x2C, 0x1A}, - {0x2D, 0x30}, - {0x2E, 0x70}, - {0x2F, 0x00}, - {0x30, 0x48}, - {0x31, 0xBB}, - {0x32, 0x2E}, - {0x33, 0x90}, - {0x34, 0x00}, - {0x35, 0x25}, - {0x36, 0xDC}, - {0x37, 0x00}, - {0x38, 0x40}, - {0x39, 0x88}, - {0x3A, 0x00}, - {0x3B, 0x03}, - {0x3C, 0x00}, - {0x3D, 0x60}, - {0x3E, 0x00}, - {0x3F, 0x00}, - {0x40, 0x03}, - {0x42, 0x00}, - {0x43, 0x12}, - {0x44, 0x07}, - {0x45, 0x49}, - {0x46, 0x00}, - {0x47, 0x00}, - {0x48, 0x00}, - {0x49, 0x00}, - {0x4A, 0x00}, - {0x4B, 0x00}, - {0x4C, 0x03}, - //{0x4D, 0x03}, - {0x4E, 0x17}, - {0x4F, 0x01}, - {0x85, 0x00}, - {0x88, 0x00}, - {0x8A, 0x00}, - {0xF3, 0x00}, - {0xF4, 0x00}, - {0xF5, 0x00}, - {0xF6, 0x00}, - {0xF7, 0x00}, - {0xF8, 0x00}, - {0xF9, 0x00}, - {0xFA, 0x00}, - {0xFB, 0x00}, - {0xFC, 0xC0}, - {0xFD, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_preview_data_720p_25hz[] = { - {0x02, 0xCA}, - {0x06, 0x32}, - {0x07, 0xC0}, - {0x08, 0x00}, - {0x09, 0x24}, - {0x0A, 0x48}, - {0x0B, 0xC0}, - {0x0C, 0x53}, - {0x0D, 0x10}, - {0x0E, 0x00}, - {0x0F, 0x00}, - {0x10, 0xf0}, - {0x11, 0x50}, - {0x12, 0x60}, - {0x13, 0x00}, - {0x14, 0x08}, - {0x15, 0x13}, - {0x16, 0x16}, - {0x17, 0x00}, - {0x18, 0x19}, - {0x19, 0xD0}, - {0x1A, 0x25}, - {0x1B, 0x00}, - {0x1C, 0x07}, - {0x1D, 0xBC}, - {0x1E, 0x80}, - {0x1F, 0x80}, - {0x20, 0x60}, - {0x21, 0x86}, - {0x22, 0x38}, - {0x23, 0x3C}, - {0x24, 0x56}, - {0x25, 0xFF}, - {0x27, 0x2D}, - {0x28, 0x00}, - {0x29, 0x48}, - {0x2A, 0x30}, - {0x2B, 0x70}, - {0x2C, 0x1A}, - {0x2D, 0x30}, - {0x2E, 0x70}, - {0x2F, 0x00}, - {0x30, 0x48}, - {0x31, 0xBB}, - {0x32, 0x2E}, - {0x33, 0x90}, - {0x34, 0x00}, - {0x35, 0x25}, - {0x36, 0xDC}, - {0x37, 0x00}, - {0x38, 0x40}, - {0x39, 0x88}, - {0x3A, 0x00}, - {0x3B, 0x03}, - {0x3C, 0x00}, - {0x3D, 0x60}, - {0x3E, 0x00}, - {0x3F, 0x00}, - {0x40, 0x00}, - {0x42, 0x00}, - {0x43, 0x12}, - {0x44, 0x07}, - {0x45, 0x49}, - {0x46, 0x00}, - {0x47, 0x00}, - {0x48, 0x00}, - {0x49, 0x00}, - {0x4A, 0x00}, - {0x4B, 0x00}, - {0x4C, 0x03}, - //{0x4D, 0x03}, - {0x4E, 0x17}, - {0x4F, 0x01}, - {0xB5, 0x01}, - {0xB8, 0x02}, - {0xBA, 0x10}, - {0xF3, 0x00}, - {0xF4, 0x00}, - {0xF5, 0x00}, - {0xF6, 0x00}, - {0xF7, 0x00}, - {0xF8, 0x00}, - {0xF9, 0x00}, - {0xFA, 0x00}, - {0xFB, 0x00}, - {0xFC, 0xC0}, - {0xFD, 0x00}, - SensorEnd -}; - -static struct rk_sensor_reg sensor_init_data[] = { -/*default 720p 50hz*/ - {0x02, 0xCA}, - {0x06, 0x32}, - {0x07, 0xC0}, - {0x08, 0x00}, - {0x09, 0x24}, - {0x0A, 0x48}, - {0x0B, 0xC0}, - {0x0C, 0x43}, - {0x0D, 0x10}, - {0x0E, 0x00}, - {0x0F, 0x00}, - {0x10, 0xf0}, - {0x11, 0x50}, - {0x12, 0x60}, - {0x13, 0x00}, - {0x14, 0x08}, - {0x15, 0x13}, - {0x16, 0x16}, - {0x17, 0x00}, - {0x18, 0x18}, - {0x19, 0xD0}, - {0x1A, 0x25}, - {0x1B, 0x00}, - {0x1C, 0x07}, - {0x1D, 0xBC}, - {0x1E, 0x80}, - {0x1F, 0x80}, - {0x20, 0x60}, - {0x21, 0x86}, - {0x22, 0x38}, - {0x23, 0x3C}, - {0x24, 0x56}, - {0x25, 0xFF}, - {0x27, 0x2D}, - {0x28, 0x00}, - {0x29, 0x48}, - {0x2A, 0x30}, - {0x2B, 0x4A}, - {0x2C, 0x0A}, - {0x2D, 0x30}, - {0x2E, 0x70}, - {0x2F, 0x00}, - {0x30, 0x48}, - {0x31, 0xBB}, - {0x32, 0x2E}, - {0x33, 0x90}, - {0x34, 0x00}, - {0x35, 0x05}, - {0x36, 0xDC}, - {0x37, 0x00}, - {0x38, 0x40}, - {0x39, 0x8C}, - {0x3A, 0x00}, - {0x3B, 0x03}, - {0x3C, 0x00}, - {0x3D, 0x60}, - {0x3E, 0x00}, - {0x3F, 0x00}, - {0x40, 0x00}, - {0x42, 0x00}, - {0x43, 0x12}, - {0x44, 0x07}, - {0x45, 0x49}, - {0x46, 0x00}, - {0x47, 0x00}, - {0x48, 0x00}, - {0x49, 0x00}, - {0x4A, 0x00}, - {0x4B, 0x00}, - {0x4C, 0x03}, - //{0x4D, 0x03}, - {0x4E, 0x03}, - {0x4F, 0x01}, - {0xB5, 0x01}, - {0xB8, 0x02}, - {0xBA, 0x10}, - {0xF3, 0x00}, - {0xF4, 0x00}, - {0xF5, 0x00}, - {0xF6, 0x00}, - {0xF7, 0x00}, - {0xF8, 0x00}, - {0xF9, 0x00}, - {0xFA, 0x00}, - {0xFB, 0x00}, - {0xFC, 0xC0}, - {0xFD, 0x00}, - SensorEnd -}; - -/* 1280x720 */ -static struct rk_sensor_reg sensor_720p[] = { - SensorEnd -}; - -/* 1920x1080 */ -static struct rk_sensor_reg sensor_1080p[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_softreset_data[] = { - SensorRegVal(0x06, 0x32 | 0x80), - SensorEnd -}; - -static struct rk_sensor_reg sensor_check_id_data[] = { - SensorRegVal(0xfe, 0x0), - SensorRegVal(0xff, 0x0), - SensorEnd -}; - -/* -* The following setting must been filled, if the function is turn on by CONFIG_SENSOR_xxxx -*/ -static struct rk_sensor_reg sensor_WhiteB_Auto[] = { - SensorEnd -}; - -/* Cloudy Colour Temperature : 6500K - 8000K */ -static struct rk_sensor_reg sensor_WhiteB_Cloudy[] = { - SensorEnd -}; - -/* ClearDay Colour Temperature : 5000K - 6500K */ -static struct rk_sensor_reg sensor_WhiteB_ClearDay[] = { - SensorEnd -}; - -/* Office Colour Temperature : 3500K - 5000K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[] = { - SensorEnd -}; - -/* Home Colour Temperature : 2500K - 3500K */ -static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[] = { - SensorEnd -}; - -static struct rk_sensor_reg *sensor_WhiteBalanceSeqe[] = { - sensor_WhiteB_Auto, - sensor_WhiteB_TungstenLamp1, - sensor_WhiteB_TungstenLamp2, - sensor_WhiteB_ClearDay, - sensor_WhiteB_Cloudy, - NULL, -}; - -static struct rk_sensor_reg sensor_Brightness0[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness1[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness2[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness3[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness4[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Brightness5[] = { - SensorEnd -}; - -static struct rk_sensor_reg *sensor_BrightnessSeqe[] = { - sensor_Brightness0, - sensor_Brightness1, - sensor_Brightness2, - sensor_Brightness3, - sensor_Brightness4, - sensor_Brightness5, - NULL, -}; - -static struct rk_sensor_reg sensor_Effect_Normal[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_WandB[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Sepia[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Negative[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Bluish[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Effect_Green[] = { - SensorEnd -}; - -static struct rk_sensor_reg *sensor_EffectSeqe[] = { - sensor_Effect_Normal, - sensor_Effect_WandB, - sensor_Effect_Negative, - sensor_Effect_Sepia, - sensor_Effect_Bluish, - sensor_Effect_Green, - NULL, -}; - -static struct rk_sensor_reg sensor_Exposure0[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure1[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure2[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure3[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure4[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure5[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Exposure6[] = { - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ExposureSeqe[] = { - sensor_Exposure0, - sensor_Exposure1, - sensor_Exposure2, - sensor_Exposure3, - sensor_Exposure4, - sensor_Exposure5, - sensor_Exposure6, - NULL, -}; - -static struct rk_sensor_reg sensor_Saturation0[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation1[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Saturation2[] = { - SensorEnd -}; - -static struct rk_sensor_reg *sensor_SaturationSeqe[] = { - sensor_Saturation0, - sensor_Saturation1, - sensor_Saturation2, - NULL, -}; - -static struct rk_sensor_reg sensor_Contrast0[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast1[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast2[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast3[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast4[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast5[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Contrast6[] = { - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ContrastSeqe[] = { - sensor_Contrast0, - sensor_Contrast1, - sensor_Contrast2, - sensor_Contrast3, - sensor_Contrast4, - sensor_Contrast5, - sensor_Contrast6, - NULL, -}; - -static struct rk_sensor_reg sensor_SceneAuto[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_SceneNight[] = { - SensorEnd -}; - -static struct rk_sensor_reg *sensor_SceneSeqe[] = { - sensor_SceneAuto, - sensor_SceneNight, - NULL, -}; - -static struct rk_sensor_reg sensor_Zoom0[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom1[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom2[] = { - SensorEnd -}; - -static struct rk_sensor_reg sensor_Zoom3[] = { - SensorEnd -}; - -static struct rk_sensor_reg *sensor_ZoomSeqe[] = { - sensor_Zoom0, - sensor_Zoom1, - sensor_Zoom2, - sensor_Zoom3, - NULL, -}; - -/* -* User could be add v4l2_querymenu in sensor_controls by new_usr_v4l2menu -*/ -static struct v4l2_querymenu sensor_menus[] = { -}; - -/* -* User could be add v4l2_queryctrl in sensor_controls by new_user_v4l2ctrl -*/ - -static inline int sensor_v4l2ctrl_inside_cb(struct soc_camera_device *icd, - struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl, - bool is_set) -{ - struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd)); - struct generic_sensor *sensor = to_generic_sensor(client); - int ret = 0; - - switch (ctrl_info->qctrl->id) { - case V4L2_CID_DEINTERLACE: - { - if (is_set) { - SENSOR_TR("%s(%d): deinterlace is not support set!", __func__, __LINE__); - ret = -EINVAL; - } else { - if ((RK_CAMERA_DEVICE_BT601_8 == - sensor->info_priv.dev_sig_cnf.type) || - (RK_CAMERA_DEVICE_BT601_PIONGPONG == - sensor->info_priv.dev_sig_cnf.type)) { - /* don't need deinterlace process */ - ext_ctrl->value = 0; - ctrl_info->cur_value = 0; - } else { - ext_ctrl->value = 1; - ctrl_info->cur_value = 1; - } - } - break; - } - case V4L2_CID_CHANNEL: - { - if (is_set) { - if ((ext_ctrl->value < ctrl_info->qctrl->minimum) || - (ext_ctrl->value > ctrl_info->qctrl->maximum)) { - SENSOR_TR("%s(%d):channel(%d) is not support\n", - __func__, __LINE__, ext_ctrl->value); - ret = -EINVAL; - goto cb_end; - } - if (sensor->channel_id != ext_ctrl->value) { - SENSOR_TR("%s(%d):set channel(%d)!\n", - __func__, __LINE__, ext_ctrl->value); - sensor->channel_id = ext_ctrl->value; - sensor_write(client, SENSOR_CHANNEL_REG, - sensor->channel_id); - sensor_write(client, SENSOR_CLAMPING_CONTROL, - 0x01); - } - } else { - ext_ctrl->value = sensor->channel_id; - ctrl_info->cur_value = sensor->channel_id; - } - break; - } - case V4L2_CID_VIDEO_STATE: - { - if (is_set) { - SENSOR_TR("%s(%d): set isn't support!\n", - __func__, __LINE__); - } else { - ext_ctrl->value = sensor->info_priv.video_state; - ctrl_info->cur_value = sensor->info_priv.video_state; - } - break; - } - default: - { - SENSOR_TR("%s(%d): cmd(0x%x) is unknown !", - __func__, __LINE__, ctrl_info->qctrl->id); - ret = -EINVAL; - } - } - -cb_end: - return ret; -} - -static struct sensor_v4l2ctrl_usr_s sensor_controls[] = { - { - { - V4L2_CID_DEINTERLACE, - V4L2_CTRL_TYPE_BOOLEAN, - "deinterlace", - 0, - 1, - 1, - 0 - }, - sensor_v4l2ctrl_inside_cb, - NULL - }, - { - { - V4L2_CID_CHANNEL, - V4L2_CTRL_TYPE_INTEGER, - "channel", - 0, - 4, - 1, - 0 - }, - sensor_v4l2ctrl_inside_cb, - NULL - }, - { - { - V4L2_CID_VIDEO_STATE, - V4L2_CTRL_TYPE_BOOLEAN, - "video_state", - 0, - 1, - 1, - 0 - }, - sensor_v4l2ctrl_inside_cb, - NULL - } -}; - -/* -* MUST define the current used format as the first item -*/ -static struct rk_sensor_datafmt sensor_colour_fmts[] = { - {MEDIA_BUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_JPEG}, -}; - -/* -********************************************************** -* Following is local code: -* -* Please codeing your program here -********************************************************** -*/ -static int sensor_parameter_record(struct i2c_client *client) -{ - return 0; -} - -static int sensor_ae_transfer(struct i2c_client *client) -{ - return 0; -} - -/* -********************************************************** -* Following is callback -* If necessary, you could coding these callback -********************************************************** -*/ -enum { - CVSTD_720P60 = 0, - CVSTD_720P50, - CVSTD_1080P30, - CVSTD_1080P25, - CVSTD_720P30, - CVSTD_720P25, - CVSTD_SD, - CVSTD_NO_DET, - CVSTD_720P30V2, - CVSTD_720P25V2, - CVSTD_NTSC, - CVSTD_PAL -}; - -enum { - VIDEO_UNPLUG, - VIDEO_IN, - VIDEO_LOCKED, - VIDEO_UNLOCK -}; - -#define FLAG_LOSS 0x80 -#define FLAG_LOCKED 0x60 -static int cvstd_mode = CVSTD_720P50; -static int cvstd_old = CVSTD_720P50; -static int cvstd_sd = CVSTD_PAL; - -static void tp2825_reinit_parameter(unsigned char cvstd, struct generic_sensor *sensor) -{ - struct rk_sensor_sequence *series = sensor->info_priv.sensor_series; - int num_series = sensor->info_priv.num_series; - int i; - - if (CVSTD_PAL == cvstd) { - SENSOR_PREVIEW_W = 960; - SENSOR_PREVIEW_H = 576; - sensor->info_priv.dev_sig_cnf.type = RK_CAMERA_DEVICE_CVBS_PAL; - strcpy(input_mode, "PAL"); - } else if (CVSTD_NTSC == cvstd) { - SENSOR_PREVIEW_W = 960; - SENSOR_PREVIEW_H = 480; - sensor->info_priv.dev_sig_cnf.type = RK_CAMERA_DEVICE_CVBS_NTSC; - strcpy(input_mode, "NTSC"); - } else { - SENSOR_PREVIEW_W = 1280; - SENSOR_PREVIEW_H = 720; - sensor->info_priv.dev_sig_cnf.type = RK_CAMERA_DEVICE_BT601_8; - strcpy(input_mode, "720P"); - } - for (i = 0; i < 4; i++) { - if ((defrects[i].width == SENSOR_PREVIEW_W) && - (defrects[i].height == SENSOR_PREVIEW_H)) { - SENSOR_PREVIEW_W = defrects[i].defrect.width; - SENSOR_PREVIEW_H = defrects[i].defrect.height; - memcpy(&sensor->info_priv.dev_sig_cnf.crop, - &defrects[i].defrect, - sizeof(defrects[i].defrect)); - if (!defrects[i].interface) { - SENSOR_TR("%s(%d): interface is NULL\n", - __func__, __LINE__); - continue; - } - if (!strcmp(defrects[i].interface, "bt601_8")) - sensor->info_priv.dev_sig_cnf.type = - RK_CAMERA_DEVICE_BT601_8; - if (!strcmp(defrects[i].interface, "cvbs_ntsc")) - sensor->info_priv.dev_sig_cnf.type = - RK_CAMERA_DEVICE_CVBS_NTSC; - if (!strcmp(defrects[i].interface, "cvbs_pal")) - sensor->info_priv.dev_sig_cnf.type = - RK_CAMERA_DEVICE_CVBS_PAL; - if (!strcmp(defrects[i].interface, "bt601_8_pp")) - sensor->info_priv.dev_sig_cnf.type = - RK_CAMERA_DEVICE_BT601_PIONGPONG; - if (!strcmp(defrects[i].interface, "cvbs_deinterlace")) - sensor->info_priv.dev_sig_cnf.type = - RK_CAMERA_DEVICE_CVBS_DEINTERLACE; - SENSOR_TR("%s(%d): type 0x%x\n", __func__, __LINE__, - sensor->info_priv.dev_sig_cnf.type); - } - } - - /*update sensor info_priv*/ - for (i = 0; i < num_series; i++) { - series[i].gSeq_info.w = SENSOR_PREVIEW_W; - series[i].gSeq_info.h = SENSOR_PREVIEW_H; - } - generic_sensor_get_max_min_res(sensor->info_priv.sensor_series, - sensor->info_priv.num_series, - &(sensor->info_priv.max_real_res), - &(sensor->info_priv.max_res), - &(sensor->info_priv.min_res)); -} - -static int tp2825_uevent_video_state(struct generic_sensor *sensor, int state) -{ - char *event_msg = NULL; - char *envp[2]; - - return 0; - event_msg = kasprintf(GFP_KERNEL, "CVBS_NAME=TP2825, VIDEO_STATUS=%d", - state); - SENSOR_TR("%s(%d): event_msg: %s\n", __func__, __LINE__, event_msg); - envp[0] = event_msg; - envp[1] = NULL; - kobject_uevent_env(&(sensor->subdev.v4l2_dev->dev->kobj), KOBJ_CHANGE, - envp); - - return 0; -} - -static int tp2825_check_cvstd(struct i2c_client *client, bool activate_check) -{ - unsigned char cvstd; - int i; - int ret = -EINVAL; - unsigned char status; - static int state = VIDEO_UNPLUG; - static bool first_reinit = 1; - struct generic_sensor *sensor = to_generic_sensor(client); - struct rk_sensor_sequence *sensor_series = - sensor->info_priv.sensor_series; - int series_num = sensor->info_priv.num_series; - - for (i = 0; i < series_num; i++) - if ((sensor_series[i].property == SEQUENCE_INIT) && - (sensor_series[i].data[0].reg != SEQCMD_END)) - break; - - ret = sensor_read(client, 0x01, &status); - if (IS_ERR_VALUE(ret)) { - SENSOR_TR("sensor read failed\n"); - return -EBUSY; - } - SENSOR_DG("%s(%d): state %d, read 0x01:0x%x\n", __func__, __LINE__, state, status); - - if (status & FLAG_LOSS) { - state = VIDEO_UNPLUG; - tp2825_uevent_video_state(sensor, 0); - sensor_write(client, SENSOR_CLAMPING_CONTROL, 0x01); - sensor->info_priv.video_state = RK_CAM_INPUT_VIDEO_STATE_LOSS; - } else if (FLAG_LOCKED == (status & FLAG_LOCKED)) { - /* video locked */ - if ((state != VIDEO_LOCKED) && !activate_check) { - state = VIDEO_LOCKED; - tp2825_uevent_video_state(sensor, 1); - - sensor_write(client, SENSOR_CLAMPING_CONTROL, 0x02); - } - sensor->info_priv.video_state = RK_CAM_INPUT_VIDEO_STATE_LOCKED; - } else { - /* video in but unlocked */ - state = VIDEO_IN; - - sensor_write(client, SENSOR_CLAMPING_CONTROL, 0x02); - //sensor->info_priv.video_state = RK_CAM_INPUT_VIDEO_STATE_LOSS; - } - SENSOR_DG("%s(%d): state %s\n", __func__, __LINE__, - (VIDEO_UNPLUG == state) ? "UNPLUG" : (VIDEO_LOCKED == state) ? "LOCKED" : "VIDEO_IN"); - - if (state == VIDEO_IN) { - sensor_read(client, 0x03, &cvstd); - SENSOR_TR("%s(%d): cvstd_old %d, read 0x03 return 0x%x", - __func__, __LINE__, cvstd_old, cvstd); - - cvstd &= 0x07; - if (cvstd == cvstd_old) - goto check_end; - - if (cvstd == CVSTD_720P30) { - cvstd_mode = CVSTD_720P30; - SENSOR_TR("%s(%d): 720P30\n", __func__, __LINE__); - sensor_series[i].data = sensor_preview_data_720p_30hz; - } else if (cvstd == CVSTD_720P25) { - cvstd_mode = CVSTD_720P25; - SENSOR_TR("%s(%d): 720P25\n", __func__, __LINE__); - sensor_series[i].data = sensor_preview_data_720p_25hz; - } else if (cvstd == CVSTD_720P60) { - SENSOR_TR("%s(%d): 720P60", __func__, __LINE__); - } else if (cvstd == CVSTD_720P50) { - cvstd_mode = CVSTD_720P50; - SENSOR_TR("%s(%d): 720P50\n", __func__, __LINE__); - sensor_series[i].data = sensor_preview_data_720p_50hz; - } else if (cvstd == CVSTD_1080P30) { - SENSOR_TR("%s(%d): 1080P30", __func__, __LINE__); - } else if (cvstd == CVSTD_1080P25) { - SENSOR_TR("%s(%d): 1080P25", __func__, __LINE__); - } else if (cvstd == CVSTD_SD) { - msleep(80); - ret = sensor_read(client, 0x01, &status); - SENSOR_DG("%s(%d): read 0x01 return 0x%x\n", - __func__, __LINE__, status); - - /* - * 1: pal 0: ntsc - */ - if ((status >> 2) & 0x01) - cvstd_sd = CVSTD_PAL; - else - cvstd_sd = CVSTD_NTSC; - - SENSOR_TR("%s(%d): cvstd_sd is %s\n", - __func__, __LINE__, - (cvstd_sd == CVSTD_PAL) ? "PAL" : "NTSC"); - cvstd_mode = cvstd_sd; - - if (cvstd_mode == CVSTD_PAL) { - sensor_series[i].data = sensor_preview_data_pal; - } else { - sensor_series[i].data = sensor_preview_data_ntsc; - } - } - } else if (state == VIDEO_LOCKED) { - goto check_end; - } else { - SENSOR_TR("tp2825_check_cvstd: check sensor statue failed!\n"); - - goto check_failed; - } - - /* config irq interrupt */ - /*for (i = 0; i < ARRAY_SIZE(sensor_preview_data); i++) { - if (sensor_preview_data[i].reg == 0x4F) - sensor_preview_data[i].val = 0x01; - if (sensor_preview_data[i].reg == 0xB8) - sensor_preview_data[i].val = 0x03; - if (sensor_preview_data[i].reg == 0xBA) - sensor_preview_data[i].val = 0x10; - }*/ - - if (cvstd_mode != cvstd_old) { - tp2825_reinit_parameter(cvstd_mode, sensor); - generic_sensor_write_array(client, sensor_series[i].data); - sensor_write(client, SENSOR_CHANNEL_REG, sensor->channel_id); - } -check_end: - - if (first_reinit) { - first_reinit = false; - tp2825_reinit_parameter(cvstd_mode, sensor); - } - return 0; - -check_failed: - return -1; -} - -/* -* the function is called in open sensor -*/ -static int sensor_activate_cb(struct i2c_client *client) -{ - struct generic_sensor *sensor = to_generic_sensor(client); - - SENSOR_DG("Here I am: %s %d/n", __func__, __LINE__); - sensor_write(client, SENSOR_CHANNEL_REG, sensor->channel_id); - //msleep(200); - tp2825_check_cvstd(client, true); - cvstd_old = cvstd_mode; - sensor->info_priv.video_state = RK_CAM_INPUT_VIDEO_STATE_LOCKED; - - if (sensor->state_check_work.state_check_wq) { - SENSOR_DG("sensor_activate_cb: queue_delayed_work 1000ms"); - queue_delayed_work(sensor->state_check_work.state_check_wq, - &sensor->state_check_work.work, 100); - } - - return 0; -} - -/* -* the function is called in close sensor -*/ -static int sensor_deactivate_cb(struct i2c_client *client) -{ - int ret = 0; - struct generic_sensor *sensor = to_generic_sensor(client); - - ret = cancel_delayed_work_sync(&sensor->state_check_work.work); - return ret; -} - -static int sensor_s_stream(struct v4l2_subdev *sd, int enable) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - SENSOR_DG("stream %d\n", enable); - if (enable) - sensor_write(client, 0x4D, 0x03); - else - sensor_write(client, 0x4D, 0x00); - return 0; -} - -/* -* the function is called before sensor register setting in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_th(struct i2c_client *client, struct v4l2_mbus_framefmt *mf, bool capture) -{ - if (capture) - sensor_parameter_record(client); - - return 0; -} - -/* -* the function is called after sensor register setting finished in VIDIOC_S_FMT -*/ -static int sensor_s_fmt_cb_bh(struct i2c_client *client, struct v4l2_mbus_framefmt *mf, bool capture) -{ - if (capture) - sensor_ae_transfer(client); - - return 0; -} - -static int sensor_try_fmt_cb_th(struct i2c_client *client, struct v4l2_mbus_framefmt *mf) -{ - return 0; -} - -static int sensor_softrest_usr_cb(struct i2c_client *client, struct rk_sensor_reg *series) -{ - return 0; -} -static int sensor_check_id_usr_cb(struct i2c_client *client, struct rk_sensor_reg *series) -{ - return 0; -} - -static int sensor_suspend(struct soc_camera_device *icd, pm_message_t pm_msg) -{ - return 0; -} - -static int sensor_resume(struct soc_camera_device *icd) -{ - SENSOR_DG("Resume"); - - return 0; -} - -static int sensor_mirror_cb(struct i2c_client *client, int mirror) -{ - return 0; -} - -/* -* the function is v4l2 control V4L2_CID_HFLIP callback -*/ -static int sensor_v4l2ctrl_mirror_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - SENSOR_DG("sensor_mirror success, value:0x%x", ext_ctrl->value); - return 0; -} - -static int sensor_flip_cb(struct i2c_client *client, int flip) -{ - return 0; -} - -/* -* the function is v4l2 control V4L2_CID_VFLIP callback -*/ -static int sensor_v4l2ctrl_flip_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info, - struct v4l2_ext_control *ext_ctrl) -{ - SENSOR_DG("sensor_flip success, value:0x%x", ext_ctrl->value); - return 0; -} - -/* -* the functions are focus callbacks -*/ -static int sensor_focus_init_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_single_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_near_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_far_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_specialpos_usr_cb(struct i2c_client *client, int pos) -{ - return 0; -} - -static int sensor_focus_af_const_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_const_pause_usr_cb(struct i2c_client *client) -{ - return 0; -} -static int sensor_focus_af_close_usr_cb(struct i2c_client *client) -{ - return 0; -} - -static int sensor_focus_af_zoneupdate_usr_cb(struct i2c_client *client, int *zone_tm_pos) -{ - return 0; -} - -/* -face defect call back -*/ -static int sensor_face_detect_usr_cb(struct i2c_client *client, int on) -{ - return 0; -} - -static void tp2825_send_uevent(struct generic_sensor *sensor) -{ - char *event_msg = NULL; - char *envp[2]; - - event_msg = kasprintf(GFP_KERNEL, "CVBS_NAME=TP2825, NOW_INPUT_MODE=%s, RESOLUTION=%dx%d", - input_mode, SENSOR_PREVIEW_W, SENSOR_PREVIEW_H); - SENSOR_TR("%s(%d): event_msg: %s\n", __func__, __LINE__, event_msg); - envp[0] = event_msg; - envp[1] = NULL; - kobject_uevent_env(&(sensor->subdev.v4l2_dev->dev->kobj), KOBJ_CHANGE, envp); -} - -/* tp2825 irq interrupt process */ -static irqreturn_t tp2825_irq(int irq, void *dev_id) -{ - struct specific_sensor *spsensor = (struct specific_sensor *)dev_id; - struct generic_sensor *sensor = &spsensor->common_sensor; - -/* struct i2c_client *client = spsensor->common_sensor.client; - int ret; - unsigned char val; - - ret = sensor_read(client, 0xB5, &val); - if (IS_ERR_VALUE(ret)) { - SENSOR_DG("%s(%d): sensor_read failed", __func__, __LINE__); - return IRQ_HANDLED; - } - SENSOR_DG("%s(%d): read 0xB5 val 0x%x\n", __func__, __LINE__, val); - - ret = sensor_read(client, 0x01, &val); - spsensor->common_sensor.info_priv.video_state = - ((val & 0x80) >> 7) ? - RK_CAM_INPUT_VIDEO_STATE_LOSS : - RK_CAM_INPUT_VIDEO_STATE_LOCKED; - - SENSOR_TR("%s(%d): video status is %s\n", __func__, __LINE__, - spsensor->common_sensor.info_priv.video_state ? - "video present" : - "Video loss"); -*/ - /* - * irq interrupt active while video lossed. - */ - SENSOR_TR("%s(%d): video status is video loss\n", - __func__, __LINE__); - sensor->info_priv.video_state = RK_CAM_INPUT_VIDEO_STATE_LOSS; - tp2825_uevent_video_state(sensor, 0); -/* - ret = sensor_write(client, 0xB5, 0x01); - if (IS_ERR_VALUE(ret)) { - SENSOR_TR("%s(%d): sensor_write failed\n", __func__, __LINE__); - return IRQ_HANDLED; - } - SENSOR_DG("%s(%d): write 0xB5 val 0x01\n", __func__, __LINE__); -*/ - return IRQ_HANDLED; -} - -/* config debug fs ops */ -#define DEBUG_FS_NTSC_WIDTH 0x8000 -#define DEBUG_FS_NTSC_HEIGHT 0x8001 -#define DEBUG_FS_NTSC_LEFT 0x8002 -#define DEBUG_FS_NTSC_TOP 0x8003 - -#define DEBUG_FS_PAL_WIDTH 0x8004 -#define DEBUG_FS_PAL_HEIGHT 0x8005 -#define DEBUG_FS_PAL_LEFT 0x8006 -#define DEBUG_FS_PAL_TOP 0x8007 - -static ssize_t tp2825_debugfs_reg_write(struct file *file, - const char __user *buf, - size_t count, loff_t *ppos) -{ - struct specific_sensor *spsensor = - ((struct seq_file *)file->private_data)->private; - struct i2c_client *client = spsensor->common_sensor.client; - int reg, val, ret; - unsigned char read; - char kbuf[30]; - int nbytes = min(count, sizeof(kbuf) - 1); - int i = 0; - - if (copy_from_user(kbuf, buf, nbytes)) - return -EFAULT; - - kbuf[nbytes] = '\0'; - if (sscanf(kbuf, " %x %x", ®, &val) != 2) - return -EINVAL; - - SENSOR_TR("%s(%d): register write reg: 0x%x, val 0x%x\n", - __func__, __LINE__, reg, val); - - switch (reg) { - case DEBUG_FS_NTSC_WIDTH: - { - for (i = 0; i < 4; i++) - if (defrects[i].height == 480) - defrects[i].defrect.width = val; - break; - } - case DEBUG_FS_NTSC_HEIGHT: - { - for (i = 0; i < 4; i++) - if (defrects[i].height == 480) - defrects[i].defrect.height = val; - break; - } - case DEBUG_FS_NTSC_TOP: - { - for (i = 0; i < 4; i++) - if (defrects[i].height == 480) - defrects[i].defrect.top = val; - break; - } - case DEBUG_FS_NTSC_LEFT: - { - for (i = 0; i < 4; i++) - if (defrects[i].height == 480) - defrects[i].defrect.left = val; - break; - } - case DEBUG_FS_PAL_WIDTH: - { - for (i = 0; i < 4; i++) - if (defrects[i].height == 576) - defrects[i].defrect.width = val; - break; - } - case DEBUG_FS_PAL_HEIGHT: - { - for (i = 0; i < 4; i++) - if (defrects[i].height == 576) - defrects[i].defrect.height = val; - break; - } - case DEBUG_FS_PAL_LEFT: - { - for (i = 0; i < 4; i++) - if (defrects[i].height == 576) - defrects[i].defrect.left = val; - break; - } - case DEBUG_FS_PAL_TOP: - { - for (i = 0; i < 4; i++) - if (defrects[i].height == 576) - defrects[i].defrect.top = val; - break; - } - default: - { - ret = sensor_write(client, reg, val); - if (IS_ERR_VALUE(ret)) { - SENSOR_TR("d_fs: write fail: 0x%x, val 0x%x\n", - reg, val); - } - - ret = sensor_read(client, reg, &read); - if (IS_ERR_VALUE(ret)) { - SENSOR_TR("d_fs: write fail: 0x%x, val 0x%x\n", - reg, read); - } else - SENSOR_TR("d_fs: read 0x%x return 0x%x\n", - reg, val); - break; - } - } - - return count; -} - -static int tp2825_debugfs_reg_show(struct seq_file *s, void *v) -{ - int i, ret; - unsigned char val; - struct specific_sensor *spsensor = s->private; - struct i2c_client *client = spsensor->common_sensor.client; - - SENSOR_TR("%s(%d): test\n", __func__, __LINE__); - - for (i = 0; i < 0xff; i++) { - ret = sensor_read(client, i + 1, &val); - if (IS_ERR_VALUE(ret)) - SENSOR_TR("%s(%d): register read failed: 0x%x\n", - __func__, __LINE__, i + 1); - - seq_printf(s, "0x%02x : 0x%02x\n", i + 1, (u8)val); - } - - return 0; -} - -static int tp2825_debugfs_open(struct inode *inode, struct file *file) -{ - struct specific_sensor *spsensor = inode->i_private; - - return single_open(file, tp2825_debugfs_reg_show, spsensor); -} - -static const struct file_operations tp2825_debugfs_fops = { - .owner = THIS_MODULE, - .open = tp2825_debugfs_open, - .read = seq_read, - .write = tp2825_debugfs_reg_write, - .llseek = seq_lseek, - .release = single_release -}; - -static void tp2825_check_state_work(struct work_struct *work) -{ - struct rk_state_check_work *state_check_work = - container_of(work, struct rk_state_check_work, work.work); - struct generic_sensor *sensor = - container_of(state_check_work, struct generic_sensor, state_check_work); - struct i2c_client *client = sensor->client; - - tp2825_check_cvstd(client, false); - - if (cvstd_old != cvstd_mode) { - cvstd_old = cvstd_mode; - tp2825_send_uevent(sensor); - } - - queue_delayed_work(sensor->state_check_work.state_check_wq, - &sensor->state_check_work.work, 100); -} - -/* -* The function can been run in sensor_init_parametres which run in sensor_probe, so user can do some -* initialization in the function. -*/ -static void sensor_init_parameters_user(struct specific_sensor *spsensor, struct soc_camera_device *icd) -{ - struct soc_camera_desc *desc = to_soc_camera_desc(icd); - struct rk29camera_platform_data *pdata = desc->subdev_desc.drv_priv; - struct rkcamera_platform_data *sensor_device = NULL, *new_camera; - struct dentry *debugfs_dir = spsensor->common_sensor.info_priv.debugfs_dir; - int ret; - - new_camera = pdata->register_dev_new; - while (new_camera != NULL) { - SENSOR_TR("%s(%d): icd_name %s, new_camera_name %s.\n", - __func__, __LINE__, dev_name(icd->pdev), new_camera->dev_name); - if (strcmp(dev_name(icd->pdev), new_camera->dev_name) == 0) { - sensor_device = new_camera; - break; - } - new_camera = new_camera->next_camera; - } - if (!sensor_device) { - SENSOR_TR("%s(%d): Could not find %s\n", __func__, __LINE__, - dev_name(icd->pdev)); - return; - } - memcpy(&defrects, &sensor_device->defrects, - sizeof(sensor_device->defrects)); - SENSOR_TR("%s(%d): channel %d, default %d\n", __func__, __LINE__, - sensor_device->channel_info.channel_total, - sensor_device->channel_info.default_id); - spsensor->common_sensor.channel_id = - sensor_device->channel_info.default_id; - - if (new_camera->io.gpio_irq) { - spsensor->common_sensor.irq = gpiod_to_irq(new_camera->io.gpio_irq); - ret = request_irq(spsensor->common_sensor.irq, tp2825_irq, IRQF_TRIGGER_FALLING, - dev_name(icd->pdev), spsensor); - if (ret < 0) - SENSOR_TR("%s(%d): request irq failed\n", __func__, __LINE__); - } - - /* init debugfs */ - debugfs_dir = debugfs_create_dir("tp2825", NULL); - if (IS_ERR(debugfs_dir)) - SENSOR_TR("%s(%d): create debugfs dir failed\n", __func__, __LINE__); - else - debugfs_create_file("register", S_IRUSR, debugfs_dir, spsensor, &tp2825_debugfs_fops); - - /* init work_queue for state_check */ - INIT_DELAYED_WORK(&spsensor->common_sensor.state_check_work.work, tp2825_check_state_work); - spsensor->common_sensor.state_check_work.state_check_wq = - create_singlethread_workqueue(SENSOR_NAME_STRING(_state_check_workqueue)); - if (spsensor->common_sensor.state_check_work.state_check_wq == NULL) { - SENSOR_TR("%s(%d): %s create failed.\n", __func__, __LINE__, - SENSOR_NAME_STRING(_state_check_workqueue)); - BUG(); - } - - memcpy(&spsensor->common_sensor.info_priv.dev_sig_cnf, &dev_info[0], sizeof(dev_info)); - spsensor->common_sensor.crop_percent = 0; - spsensor->common_sensor.sensor_cb.sensor_s_stream_cb = sensor_s_stream; -} - -/* -* :::::WARNING::::: -* It is not allowed to modify the following code -*/ - -sensor_init_parameters_default_code(); - -sensor_v4l2_struct_initialization(); - -sensor_probe_default_code(); - -sensor_remove_default_code(); - -sensor_driver_default_module_code(); -