mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 22:14:04 +02:00
drivers/media/video: remove unused icatch7002
Change-Id: Iba11051d729b3546b279eccb14d981c85332d38d Signed-off-by: Tao Huang <huangtao@rock-chips.com>
This commit is contained in:
parent
62bf938f08
commit
9be9564661
|
|
@ -1,30 +0,0 @@
|
|||
#
|
||||
# Fujitsu camera isp chip: m6moj.
|
||||
#
|
||||
config ICATCH7002_OV5693
|
||||
depends on SOC_CAMERA_ICATCH7002
|
||||
tristate "icatch7002 attached ov5693"
|
||||
default n
|
||||
help
|
||||
Choose Y here if you have this this sensor and it is attach to icatch7002
|
||||
|
||||
config ICATCH7002_OV8825
|
||||
depends on SOC_CAMERA_ICATCH7002
|
||||
tristate "icatch7002 attached ov8825"
|
||||
default n
|
||||
help
|
||||
Choose Y here if you have this this sensor and it is attach to icatch7002
|
||||
|
||||
config ICATCH7002_OV2720
|
||||
depends on SOC_CAMERA_ICATCH7002
|
||||
tristate "icatch7002 attached ov2720"
|
||||
default n
|
||||
help
|
||||
Choose Y here if you have this this sensor and it is attach to icatch7002
|
||||
|
||||
config ICATCH7002_MI1040
|
||||
depends on SOC_CAMERA_ICATCH7002
|
||||
tristate "icatch7002 attached mi1040"
|
||||
default n
|
||||
help
|
||||
Choose Y here if you have this this sensor and it is attach to icatch7002
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
#
|
||||
# Makefile for icatch isp driver
|
||||
#
|
||||
obj-$(CONFIG_SOC_CAMERA_ICATCH7002) += icatch7002_common.o
|
||||
#obj-$(CONFIG_SOC_CAMERA_ICATCH7002) += icatch_spi_host.o
|
||||
obj-$(CONFIG_ICATCH7002_MI1040) += icatch7002_mi1040.o
|
||||
obj-$(CONFIG_ICATCH7002_OV5693) += icatch7002_ov5693.o
|
||||
obj-$(CONFIG_ICATCH7002_OV8825) += icatch7002_ov8825.o
|
||||
obj-$(CONFIG_ICATCH7002_OV2720) += icatch7002_ov2720.o
|
||||
obj-$(CONFIG_SOC_CAMERA_ICATCH7002) += burn_spi_sample_code_0910.o
|
||||
obj-$(CONFIG_SOC_CAMERA_ICATCH7002) += app_i2c_lib_icatch.o
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,451 +0,0 @@
|
|||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2006-2008 by Sunplus mMedia Inc., Ltd.
|
||||
*
|
||||
* This software is copyrighted by and is the property of Sunplus
|
||||
* mMedia Inc., Ltd. All rights are reserved by Sunplus mMedia
|
||||
* Inc., Ltd. This software may only be used in accordance with the
|
||||
* corresponding license agreement. Any unauthorized use, duplication,
|
||||
* distribution, or disclosure of this software is expressly forbidden.
|
||||
*
|
||||
* This Copyright notice MUST not be removed or modified without prior
|
||||
* written consent of Sunplus mMedia Inc., Ltd.
|
||||
*
|
||||
* Sunplus mMedia Inc., Ltd. reserves the right to modify this
|
||||
* software without notice.
|
||||
*
|
||||
* Sunplus mMedia Inc., Ltd.
|
||||
* 19-1, Innovation First Road, Science-Based Industrial Park,
|
||||
* Hsin-Chu, Taiwan, R.O.C.
|
||||
*
|
||||
****************************************************************************/
|
||||
#ifndef APP_I2C_LIB_ICATCH_H
|
||||
#define APP_I2C_LIB_ICATCH_H
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* C O N S T A N T S *
|
||||
****************************************************************************/
|
||||
#ifndef NULL
|
||||
#define NULL ((void *)0)
|
||||
#endif
|
||||
#ifndef SUCCESS
|
||||
#define SUCCESS 0
|
||||
#endif
|
||||
#ifndef FAIL
|
||||
#define FAIL 1
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#define UINT64 unsigned long long
|
||||
#define UINT32 unsigned int
|
||||
#define UINT16 unsigned short
|
||||
#define UINT8 unsigned char
|
||||
#define SINT64 signed long long
|
||||
#define SINT32 signed int
|
||||
#define SINT16 signed short
|
||||
#define SINT8 signed char
|
||||
#define BOOL unsigned char
|
||||
|
||||
#define SP7K_MSG_BASE 0x7100
|
||||
#define SP7K_REG_BASE 0x7280
|
||||
|
||||
/****************************************************************************
|
||||
* D A T A T Y P E S *
|
||||
****************************************************************************/
|
||||
typedef enum {
|
||||
SP7K_MSG_BANDING_SELECTION = (SP7K_MSG_BASE | 0x01),
|
||||
SP7K_MSG_COLOR_EFFECT = (SP7K_MSG_BASE | 0x02),
|
||||
SP7K_MSG_EV_COMPENSATION = (SP7K_MSG_BASE | 0x03),
|
||||
SP7K_MSG_FLASH_MODE = (SP7K_MSG_BASE | 0x04),
|
||||
SP7K_MSG_FOCUS_MODE = (SP7K_MSG_BASE | 0x05),
|
||||
SP7K_MSG_PV_SIZE = (SP7K_MSG_BASE | 0x06),
|
||||
SP7K_MSG_SCENE_MODE = (SP7K_MSG_BASE | 0x09),
|
||||
SP7K_MSG_WHITE_BALANCE = (SP7K_MSG_BASE | 0x0A),
|
||||
SP7K_MSG_AE_MODE = (SP7K_MSG_BASE | 0x0E),
|
||||
SP7K_MSG_CAP_MODE = (SP7K_MSG_BASE | 0x0F),
|
||||
SP7K_MSG_CAP_ISO = (SP7K_MSG_BASE | 0x10),
|
||||
SP7K_MSG_AURA_COLOR_INDEX = (SP7K_MSG_BASE | 0x19),
|
||||
SP7K_MSG_OPTICAL_ZOOM = (SP7K_MSG_BASE | 0x1A),
|
||||
SP7K_MSG_ISP_FUNCTION = (SP7K_MSG_BASE | 0x1B),
|
||||
SP7K_MSG_PV_CAP_MODE = (SP7K_MSG_BASE | 0x20),
|
||||
SP7K_MSG_PV_STREAM = (SP7K_MSG_BASE | 0x21),
|
||||
SP7K_MSG_BURST_ABORT = (SP7K_MSG_BASE | 0x22),
|
||||
SP7K_MSG_CAP_EDGE_QUANTITY = (SP7K_MSG_BASE | 0x23),
|
||||
SP7K_MSG_PV_FIX_FRAME_RATE = (SP7K_MSG_BASE | 0x24),
|
||||
SP7K_MSG_PV_MAX_EXPTIME = (SP7K_MSG_BASE | 0x25),
|
||||
SP7K_MSG_HDR_POSITIVE_EV = (SP7K_MSG_BASE | 0x27),
|
||||
SP7K_MSG_HDR_NEGATIVE_EV = (SP7K_MSG_BASE | 0x28),
|
||||
SP7K_MSG_PV_MIN_ISO = (SP7K_MSG_BASE | 0x29),
|
||||
SP7K_MSG_G_SENSOR_INFO_X = (SP7K_MSG_BASE | 0x2A),
|
||||
SP7K_MSG_G_SENSOR_INFO_Y = (SP7K_MSG_BASE | 0x2B),
|
||||
SP7K_MSG_G_SENSOR_INFO_Z = (SP7K_MSG_BASE | 0x2C),
|
||||
SP7K_MSG_GYRO_INFO_X = (SP7K_MSG_BASE | 0x2D),
|
||||
SP7K_MSG_GYRO_INFO_Y = (SP7K_MSG_BASE | 0x2E),
|
||||
SP7K_MSG_GYRO_INFO_Z = (SP7K_MSG_BASE | 0x2F),
|
||||
SP7K_MSG_AF_ROI_SIZE_H = (SP7K_MSG_BASE | 0x40),
|
||||
SP7K_MSG_AF_ROI_SIZE_L = (SP7K_MSG_BASE | 0x41),
|
||||
SP7K_MSG_AF_ROI_X_H = (SP7K_MSG_BASE | 0x42),
|
||||
SP7K_MSG_AF_ROI_X_L = (SP7K_MSG_BASE | 0x43),
|
||||
SP7K_MSG_AF_ROI_Y_H = (SP7K_MSG_BASE | 0x44),
|
||||
SP7K_MSG_AF_ROI_Y_L = (SP7K_MSG_BASE | 0x45),
|
||||
SP7K_MSG_AF_ROI_TRIGGER = (SP7K_MSG_BASE | 0x46),
|
||||
SP7K_MSG_AE_ROI_SIZE_H = (SP7K_MSG_BASE | 0x48),
|
||||
SP7K_MSG_AE_ROI_SIZE_L = (SP7K_MSG_BASE | 0x49),
|
||||
SP7K_MSG_AE_ROI_X_H = (SP7K_MSG_BASE | 0x4A),
|
||||
SP7K_MSG_AE_ROI_X_L = (SP7K_MSG_BASE | 0x4B),
|
||||
SP7K_MSG_AE_ROI_Y_H = (SP7K_MSG_BASE | 0x4C),
|
||||
SP7K_MSG_AE_ROI_Y_L = (SP7K_MSG_BASE | 0x4D),
|
||||
SP7K_MSG_AE_ROI_TRIGGER = (SP7K_MSG_BASE | 0x4E),
|
||||
SP7K_MSG_AF_ABORT = (SP7K_MSG_BASE | 0x4F),
|
||||
SP7K_MSG_VCM_STEP_L = (SP7K_MSG_BASE | 0x5C),
|
||||
SP7K_MSG_VCM_STEP_H = (SP7K_MSG_BASE | 0x5D),
|
||||
SP7K_MSG_CAP_EDGE_INFO = (SP7K_MSG_BASE | 0x5F),
|
||||
SP7K_MSG_RAW_PATH = (SP7K_MSG_BASE | 0x60),
|
||||
SP7K_MSG_RAW_FORMAT = (SP7K_MSG_BASE | 0x61),
|
||||
SP7K_MSG_CALIBRATION_RAW_LINEAR = (SP7K_MSG_BASE | 0x62),
|
||||
SP7K_MSG_CALIBRATION_RAW_OB = (SP7K_MSG_BASE | 0x63),
|
||||
SP7K_MSG_CALIBRATION_RAW_BP = (SP7K_MSG_BASE | 0x64),
|
||||
SP7K_MSG_CALIBRATION_RAW_LSC = (SP7K_MSG_BASE | 0x65),
|
||||
SP7K_MSG_CALIBRATION_RAW_CA = (SP7K_MSG_BASE | 0x66),
|
||||
SP7K_MSG_CALIBRATION_RAW_ARD = (SP7K_MSG_BASE | 0x67),
|
||||
SP7K_MSG_CALIBRATION_RAW_DEPEAK = (SP7K_MSG_BASE | 0x68),
|
||||
SP7K_MSG_CALIBRATION_RAW_WB = (SP7K_MSG_BASE | 0x69),
|
||||
SP7K_MSG_CALIBRATION_AWB_CRITERIA = (SP7K_MSG_BASE | 0x6D),
|
||||
SP7K_MSG_AEAWBTHREAD_MODE = (SP7K_MSG_BASE | 0x70),
|
||||
SP7K_MSG_DQ_MODE = (SP7K_MSG_BASE | 0x71),
|
||||
SP7K_MSG_CDSP_MODE = (SP7K_MSG_BASE | 0x72),
|
||||
SP7K_MSG_CALIBRATION_CMD1 = (SP7K_MSG_BASE | 0x74),
|
||||
SP7K_MSG_CALIBRATION_CMD2 = (SP7K_MSG_BASE | 0x75),
|
||||
SP7K_MSG_CALIBRATION_INIT_CMD = (SP7K_MSG_BASE | 0x76),
|
||||
SP7K_MSG_CALIBRATION_LENS_MAX_LUM_DECAY = (SP7K_MSG_BASE | 0x77),
|
||||
SP7K_MSG_CALIBRATION_DQ_INDEX_FIX = (SP7K_MSG_BASE | 0x78),
|
||||
SP7K_MSG_CALIBRATION_UTILIZATION_OPTION = (SP7K_MSG_BASE | 0x7F),
|
||||
SP7K_MSG_ROI_SWITCH = (SP7K_MSG_BASE | 0x88),
|
||||
|
||||
SP7K_MSG_VENDREQ_ID = (SP7K_MSG_BASE | 0xE4),
|
||||
SP7K_MSG_VENDREQ_PARAM = (SP7K_MSG_BASE | 0xE5),
|
||||
SP7K_MSG_VENDREQ_VALUES_L = (SP7K_MSG_BASE | 0xE6),
|
||||
SP7K_MSG_VENDREQ_PROCESS = (SP7K_MSG_BASE | 0xE8),
|
||||
SP7K_MSG_VENDREQ_VALUES_H = (SP7K_MSG_BASE | 0xEA),
|
||||
SP7K_MSG_VENDREQ_CMD = (SP7K_MSG_BASE | 0xEB),
|
||||
} sp7kHostMsgList_e;
|
||||
|
||||
typedef enum {
|
||||
SP7K_RDREG_AF_STATUS = (SP7K_REG_BASE | 0xA0),
|
||||
SP7K_RDREG_AF_RESULT = (SP7K_REG_BASE | 0xA1),
|
||||
SP7K_RDREG_AF_CONSUME_TIME_L = (SP7K_REG_BASE | 0xA2),
|
||||
SP7K_RDREG_AF_CONSUME_TIME_H = (SP7K_REG_BASE | 0xA3),
|
||||
SP7K_RDREG_VCM_CURRENT_POS_L = (SP7K_REG_BASE | 0xA4),
|
||||
SP7K_RDREG_VCM_CURRENT_POS_H = (SP7K_REG_BASE | 0xA5),
|
||||
SP7K_RDREG_EXPTIME_NUMERATOR = (SP7K_REG_BASE | 0xB0),
|
||||
SP7K_RDREG_EXPTIME_DENOMINATOR_L = (SP7K_REG_BASE | 0xB1),
|
||||
SP7K_RDREG_EXPTIME_DENOMINATOR_M = (SP7K_REG_BASE | 0xB2),
|
||||
SP7K_RDREG_EXPTIME_DENOMINATOR_H = (SP7K_REG_BASE | 0xB3),
|
||||
SP7K_RDREG_EXPTIME_COMPENSATION = (SP7K_REG_BASE | 0xB4),
|
||||
SP7K_RDREG_LENS_FOCAL_LENGTH_L = (SP7K_REG_BASE | 0xB5),
|
||||
SP7K_RDREG_LENS_FOCAL_LENGTH_H = (SP7K_REG_BASE | 0xB6),
|
||||
SP7K_RDREG_ISO_L = (SP7K_REG_BASE | 0xB7),
|
||||
SP7K_RDREG_ISO_H = (SP7K_REG_BASE | 0xB8),
|
||||
SP7K_RDREG_FLASH_MODE = (SP7K_REG_BASE | 0xB9),
|
||||
SP7K_RDREG_CAP_EDGE_INFO_B0 = (SP7K_REG_BASE | 0xBA),
|
||||
SP7K_RDREG_CAP_EDGE_INFO_B1 = (SP7K_REG_BASE | 0xBB),
|
||||
SP7K_RDREG_CAP_EDGE_INFO_B2 = (SP7K_REG_BASE | 0xBC),
|
||||
SP7K_RDREG_CAP_EDGE_INFO_B3 = (SP7K_REG_BASE | 0xBD),
|
||||
SP7K_RDREG_3A_STATUS = (SP7K_REG_BASE | 0xC3),
|
||||
SP7K_RDREG_EDGE_INFO_COUNT = (SP7K_REG_BASE | 0xC4),
|
||||
SP7K_RDREG_REAR_SENSORID_L = (SP7K_REG_BASE | 0xC6),
|
||||
SP7K_RDREG_REAR_SENSORID_H = (SP7K_REG_BASE | 0xC7),
|
||||
SP7K_RDREG_FRONT_SENSORID_L = (SP7K_REG_BASE | 0xC8),
|
||||
SP7K_RDREG_FRONT_SENSORID_H = (SP7K_REG_BASE | 0xC9),
|
||||
SP7K_RDREG_FW_VER_L = (SP7K_REG_BASE | 0xCA),
|
||||
SP7K_RDREG_FW_VER_M = (SP7K_REG_BASE | 0xCB),
|
||||
SP7K_RDREG_FW_VER_H = (SP7K_REG_BASE | 0xCC),
|
||||
SP7K_RDREG_VENDOR_ID_L = (SP7K_REG_BASE | 0xCE),
|
||||
SP7K_RDREG_VENDOR_ID_H = (SP7K_REG_BASE | 0xCF),
|
||||
SP7K_RDREG_CALIBRATION_LSC_MAX_RGAIN_L = (SP7K_REG_BASE | 0xD8),
|
||||
SP7K_RDREG_CALIBRATION_LSC_MAX_RGAIN_H = (SP7K_REG_BASE | 0xD9),
|
||||
SP7K_RDREG_CALIBRATION_LSC_MAX_GGAIN_L = (SP7K_REG_BASE | 0xDA),
|
||||
SP7K_RDREG_CALIBRATION_LSC_MAX_GGAIN_H = (SP7K_REG_BASE | 0xDB),
|
||||
SP7K_RDREG_CALIBRATION_LSC_MAX_BGAIN_L = (SP7K_REG_BASE | 0xDC),
|
||||
SP7K_RDREG_CALIBRATION_LSC_MAX_BGAIN_H = (SP7K_REG_BASE | 0xDD),
|
||||
SP7K_RDREG_CALIBRATION_AWB_RGain_L = (SP7K_REG_BASE | 0xE1),
|
||||
SP7K_RDREG_CALIBRATION_AWB_RGain_H = (SP7K_REG_BASE | 0xE2),
|
||||
SP7K_RDREG_CALIBRATION_AWB_GGain_L = (SP7K_REG_BASE | 0xE3),
|
||||
SP7K_RDREG_CALIBRATION_AWB_GGain_H = (SP7K_REG_BASE | 0xE4),
|
||||
SP7K_RDREG_CALIBRATION_AWB_BGain_L = (SP7K_REG_BASE | 0xE5),
|
||||
SP7K_RDREG_CALIBRATION_AWB_BGain_H = (SP7K_REG_BASE | 0xE6),
|
||||
SP7K_RDREG_CALIBRATION_EXEC_STATUS1 = (SP7K_REG_BASE | 0xF0),
|
||||
SP7K_RDREG_CALIBRATION_EXEC_STATUS2 = (SP7K_REG_BASE | 0xF1),
|
||||
SP7K_RDREG_CALIBRATION_ERROR_STATUS1 = (SP7K_REG_BASE | 0xF2),
|
||||
SP7K_RDREG_CALIBRATION_ERROR_STATUS2 = (SP7K_REG_BASE | 0xF3),
|
||||
SP7K_RDREG_CALIBRATION_ERROR_CODE = (SP7K_REG_BASE | 0xF4),
|
||||
SP7K_RDREG_CALIBRATION_LOAD_TABLE_STATUS= (SP7K_REG_BASE | 0xF5),
|
||||
SP7K_RDREG_INT_STS_REG_0 = (SP7K_REG_BASE | 0xF8),
|
||||
SP7K_RDREG_INT_MASK_REG_0 = (SP7K_REG_BASE | 0xFC),
|
||||
} sp7kReadRegList_e;
|
||||
|
||||
typedef enum {
|
||||
GPIO_CTL_LOW,
|
||||
GPIO_CTL_HIGH,
|
||||
GPIO_CTL_MAX,
|
||||
} sp7kGpioCtlList_e;
|
||||
|
||||
typedef enum {
|
||||
BOOT_FROM_SPI,
|
||||
BOOT_FROM_HOST,
|
||||
BOOT_FROM_MAX,
|
||||
} sp7kPowerOnList_e;
|
||||
|
||||
typedef enum {
|
||||
SENSOR_ID_REAR,
|
||||
SENSOR_ID_FRONT,
|
||||
SENSOR_ID_REAR_CALIBRATION,
|
||||
SENSOR_ID_MAX,
|
||||
} sp7kSensorIdList_e;
|
||||
|
||||
typedef enum {
|
||||
IMAGE_CAP_SINGLE,
|
||||
IMAGE_CAP_HDR,
|
||||
IMAGE_CAP_ZSL_SINGLE_FLASH,
|
||||
IMAGE_CAP_ZSL_BURST_FLASH,
|
||||
IMAGE_CAP_NONZSL_SINGLE,
|
||||
IMAGE_CAP_NONZSL_BURST,
|
||||
IMAGE_CAP_MAX,
|
||||
} sp7kImageCapList_e;
|
||||
|
||||
typedef enum {
|
||||
CAP_MODE_SINGLE,
|
||||
CAP_MODE_HDR,
|
||||
CAP_MODE_RSV,
|
||||
CAP_MODE_BURST,
|
||||
CAP_MODE_MAX,
|
||||
} sp7kCapModeList_e;
|
||||
|
||||
typedef enum {
|
||||
PVCAP_MODE_PV,
|
||||
PVCAP_MODE_CAP,
|
||||
PVCAP_MODE_CAP_ZSL,
|
||||
PVCAP_MODE_CAP_NONZSL,
|
||||
PVCAP_MODE_MAX,
|
||||
} sp7kPvCapModeList_e;
|
||||
|
||||
typedef enum {
|
||||
TAFTAE_TAF_ONLY,
|
||||
TAFTAE_TAE_OFF,
|
||||
TAFTAE_TAE_USE_TAE_ROI,
|
||||
TAFTAE_TAE_USE_TAF_ROI,
|
||||
TAFTAE_TAE_ONLY,
|
||||
TAFTAE_MAX,
|
||||
} sp7kTAFTAEList_e;
|
||||
|
||||
typedef enum {
|
||||
NONE,
|
||||
LOADCODE_BOOT_FILE_ERR,
|
||||
|
||||
LOADCODE_CALIB_OPT_FILE_ERR,
|
||||
LOADCODE_CALIB_OPT_MAX_ERR,
|
||||
|
||||
LOADCODE_3ACALI_FILE_ERR,
|
||||
LOADCODE_3ACALI_HEADER_ERR,
|
||||
LOADCODE_3ACALI_CHKSUM_ERR,
|
||||
|
||||
LOADCODE_LSC_FILE_ERR,
|
||||
LOADCODE_LSC_HEADER_ERR,
|
||||
LOADCODE_LSC_CHKSUM_ERR,
|
||||
|
||||
LOADCODE_LSC_DQ_FILE_ERR,
|
||||
LOADCODE_LSC_DQ_HEADER_ERR,
|
||||
LOADCODE_LSC_DQ_CHKSUN_ERR,
|
||||
|
||||
LOADCODE_GET_RES_NUM_ERR,
|
||||
} LoadCodeErrList_e;
|
||||
|
||||
typedef struct {
|
||||
UINT32 DmemFicdmemSize; /*DMEM+FICDMEM size*/
|
||||
UINT32 ImemSize; /*IMEM size*/
|
||||
UINT16 FmClk; /*FM clock*/
|
||||
UINT16 Checksum; /*checksum*/
|
||||
UINT32 DmemSize; /*DMEM size*/
|
||||
} ispFwHeaderInfo_t;
|
||||
|
||||
typedef struct {
|
||||
UINT32 retCalibOpt;
|
||||
UINT32 ret3acli;
|
||||
UINT32 retLsc;
|
||||
UINT32 retLscdq;
|
||||
} ispLoadCodeRet_t;
|
||||
|
||||
/****************************************************************************
|
||||
* M A C R O S *
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* E X T E R N V A R I A B L E S D E C L A R A T I O N S *
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S *
|
||||
****************************************************************************/
|
||||
void EXISP_I2C_BandSelectionSet(UINT8 ucParam);
|
||||
void EXISP_I2C_ColorEffectSet(UINT8 ucParam);
|
||||
void EXISP_I2C_EvSet(UINT8 ucParam);
|
||||
void EXISP_I2C_FlashModeSet(UINT8 ucParam);
|
||||
void EXISP_I2C_FocusModeSet(UINT8 ucParam);
|
||||
void EXISP_I2C_PvSizeSet(UINT8 ucParam);
|
||||
void EXISP_I2C_SceneModeSet(UINT8 ucParam);
|
||||
void EXISP_I2C_WhiteBalanceSet(UINT8 ucParam);
|
||||
void EXISP_I2C_AEModeSet(UINT8 ucParam);
|
||||
void EXISP_I2C_CapModeSet(UINT8 ucParam);
|
||||
void EXISP_I2C_ISOSet(UINT8 ucParam);
|
||||
void EXISP_I2C_AuraColorIndexSet(UINT8 ucParam);
|
||||
void EXISP_I2C_OpticalZoomSet(UINT8 ucParam);
|
||||
void EXISP_I2C_IspFuncSet(UINT8 ucParam);
|
||||
void EXISP_I2C_PvCapModeSet(UINT8 ucParam);
|
||||
void EXISP_I2C_PvStreamSet(UINT8 ucParam);
|
||||
void EXISP_I2C_BurstAbortSet(UINT8 ucParam);
|
||||
void EXISP_I2C_CapEdgeQuantitySet(UINT8 ucValue);
|
||||
void EXISP_I2C_PvFixFrameRateSet(UINT8 ucValue);
|
||||
void EXISP_I2C_PvMaxExposureTimeSet(UINT8 ucValue);
|
||||
void EXISP_I2C_HdrPositiveEvSet(UINT8 ucValue);
|
||||
void EXISP_I2C_HdrNegativeEvSet(UINT8 ucValue);
|
||||
void EXISP_I2C_PvMinISOSet(UINT8 ucParam);
|
||||
void EXISP_I2C_GSensorInfoSet(SINT8 ucX, SINT8 ucY, SINT8 ucZ);
|
||||
void EXISP_I2C_GyroInfoSet(UINT8 ucX, UINT8 ucY, UINT8 ucZ);
|
||||
void EXISP_I2C_AFROISet(UINT16 usSize, UINT16 usX, UINT16 usY);
|
||||
void EXISP_I2C_AFROITriggerSet(void);
|
||||
void EXISP_I2C_AEROISet(UINT16 usSize, UINT16 usX, UINT16 usY);
|
||||
void EXISP_I2C_AEROITriggerSet(UINT8 ucParam);
|
||||
void EXISP_I2C_AFAbortSet(UINT8 ucParam);
|
||||
void EXISP_I2C_VcmStepSet(UINT16 usValue);
|
||||
void EXISP_I2C_CapEdgeInfoSet(UINT8 ucParam);
|
||||
void EXISP_I2C_RawPathSet(UINT8 ucParam);
|
||||
void EXISP_I2C_RawFormatSet(UINT8 ucParam);
|
||||
void EXISP_I2C_CalibrationRawLinearSet(UINT8 ucParam);
|
||||
void EXISP_I2C_CalibrationRawObSet(UINT8 ucParam);
|
||||
void EXISP_I2C_CalibrationRawBpSet(UINT8 ucParam);
|
||||
void EXISP_I2C_CalibrationRawLscSet(UINT8 ucParam);
|
||||
void EXISP_I2C_CalibrationRawCaSet(UINT8 ucParam);
|
||||
void EXISP_I2C_CalibrationRawArdSet(UINT8 ucParam);
|
||||
void EXISP_I2C_CalibrationRawDepeakSet(UINT8 ucParam);
|
||||
void EXISP_I2C_CalibrationRawWbSet(UINT8 ucParam);
|
||||
void EXISP_I2C_CalibrationAwbCriteriaSet(UINT8 ucVaule);
|
||||
void EXISP_I2C_AEAWBThreadModeSet(UINT8 ucParam);
|
||||
void EXISP_I2C_DqModeSet(UINT8 ucParam);
|
||||
void EXISP_I2C_CdspOnOffModeSet(UINT8 ucParam);
|
||||
void EXISP_I2C_CalibrationCmd1Set(UINT8 ucParam);
|
||||
void EXISP_I2C_CalibrationCmd2Set(UINT8 ucParam);
|
||||
void EXISP_I2C_CalibrationInitCmdSet(UINT8 ucParam);
|
||||
void EXISP_I2C_CalibrationLscMaxGainSet(UINT8 ucVaule);
|
||||
void EXISP_I2C_CalibrationDqIndexFixSet(UINT8 ucParam);
|
||||
void EXISP_I2C_CaliUtilizationOptionSet(UINT8 ucParam);
|
||||
void EXISP_I2C_ROISwitchSet(UINT8 ucParam);
|
||||
void EXISP_I2C_VendreqIdSet(UINT8 ucValue);
|
||||
void EXISP_I2C_VendreqParamSet(UINT8 ucValue);
|
||||
void EXISP_I2C_VendreqValuesSet_L(UINT8 ucVaule);
|
||||
void EXISP_I2C_VendreqProcessSet(void);
|
||||
void EXISP_I2C_VendreqValuesSet_H(UINT8 ucVaule);
|
||||
void EXISP_I2C_VendreqCmdSet(UINT8 ucParam);
|
||||
|
||||
|
||||
UINT8 EXISP_I2C_AFStatusGet(void);
|
||||
UINT8 EXISP_I2C_AFResultGet(void);
|
||||
UINT16 EXISP_I2C_AFConsumeTimeGet(void);
|
||||
UINT16 EXISP_I2C_VcmCurrentPosGet(void);
|
||||
UINT8 EXISP_I2C_ExposureTimeNumeratorGet(void);
|
||||
UINT32 EXISP_I2C_ExposureTimeDenominatorGet(void);
|
||||
UINT8 EXISP_I2C_ExposureTimeCompensationGet(void);
|
||||
UINT16 EXISP_I2C_LensFocalLengthGet(void);
|
||||
UINT16 EXISP_I2C_ISOValueGet(void);
|
||||
UINT8 EXISP_I2C_FlashModeGet(void);
|
||||
UINT32 EXISP_I2C_CapEdgeInfoGet(void);
|
||||
UINT8 EXISP_I2C_3AStatusGet(void);
|
||||
UINT8 EXISP_I2C_EdgeInfoCountGet(void);
|
||||
UINT16 EXISP_I2C_RearSensorIdGet(void);
|
||||
UINT16 EXISP_I2C_FrontSensorIdGet(void);
|
||||
UINT32 EXISP_I2C_FWVersionGet(void);
|
||||
UINT16 EXISP_I2C_VendorIdGet(void);
|
||||
UINT16 EXISP_I2C_CalibrationLscMaxRGainGet(void);
|
||||
UINT16 EXISP_I2C_CalibrationLscMaxGGainGet(void);
|
||||
UINT16 EXISP_I2C_CalibrationLscMaxBGainGet(void);
|
||||
UINT16 EXISP_I2C_CalibrationAWBRGainGet(void);
|
||||
UINT16 EXISP_I2C_CalibrationAWBGGainGet(void);
|
||||
UINT16 EXISP_I2C_CalibrationAWBBGainGet(void);
|
||||
UINT8 EXISP_I2C_CalibrationExecStatus1Get(void);
|
||||
UINT8 EXISP_I2C_CalibrationExecStatus2Get(void);
|
||||
UINT8 EXISP_I2C_CalibrationErrorStatus1Get(void);
|
||||
UINT8 EXISP_I2C_CalibrationErrorStatus2Get(void);
|
||||
UINT8 EXISP_I2C_CalibrationErrorCodeGet(void);
|
||||
UINT8 EXISP_I2C_CalibrationLoadTableStatusGet(void);
|
||||
|
||||
|
||||
UINT8 EXISP_SuspendGpioCfgSet(UINT8 ucCtl);
|
||||
UINT8 EXISP_DigitalPowerCfgSet(UINT8 On);
|
||||
UINT8 EXISP_AnalogPowerCfgSet(UINT8 On);
|
||||
UINT8 EXISP_ClockCfgSet(UINT8 ucEnable);
|
||||
UINT8 EXISP_ResetGpioCfgSet(UINT8 ucCtl);
|
||||
UINT8 EXISP_PowerOn(UINT8 ucBoot);
|
||||
UINT8 EXISP_PowerOff(void);
|
||||
UINT8 EXISP_LoadCodeStart(
|
||||
UINT8 ucBoot,
|
||||
UINT8 ucFwIdx,
|
||||
UINT8 is_calibration,
|
||||
UINT8 *pIspFw,
|
||||
UINT8 *pCalibOpt,
|
||||
UINT8 *p3acali,
|
||||
UINT8 *pLsc,
|
||||
UINT8 *pLscdq);
|
||||
UINT8 EXISP_LoadCode(
|
||||
UINT8 ucFwIdx,
|
||||
UINT8 is_calibration,
|
||||
UINT8 *pIspFw,
|
||||
UINT8 *pCalibOpt,
|
||||
UINT8 *p3acali,
|
||||
UINT8 *pLsc,
|
||||
UINT8 *pLscdq);
|
||||
void EXISP_UpdateCalibResStart(
|
||||
UINT8 ucFwIdx,
|
||||
UINT8 *pIspFw,
|
||||
ispFwHeaderInfo_t *pFwInfo,
|
||||
ispLoadCodeRet_t *pLoadCodeRet,
|
||||
UINT8 ucCaliOpt,
|
||||
UINT8 *p3acali,
|
||||
UINT8 *pLsc,
|
||||
UINT8 *pLscdq);
|
||||
UINT8 EXISP_UpdateCalibRes(
|
||||
UINT8 idx,
|
||||
UINT8 *pIspFw,
|
||||
ispFwHeaderInfo_t *pFwInfo,
|
||||
UINT8 *p3acali,
|
||||
UINT8 *pLsc,
|
||||
UINT8 *pLscdq);
|
||||
UINT8 EXISP_ResCheck(UINT8 idx, UINT8 *p3acali, UINT8 *pLsc, UINT8 *Lscdq);
|
||||
UINT8 EXISP_ResNumGet(UINT32 *resNum, UINT8 *pIspFw);
|
||||
UINT8 EXISP_SPIDataWrite(UINT8 ucSPIMode, UINT8 *ucStartAddr, UINT32 ulTransByteCnt, UINT32 ulDmaAddr);
|
||||
UINT8 EXISP_7002SPICfg(UINT8 ucSPIMode, UINT32 ulDmaAddr, UINT32 ulTransByteCnt);
|
||||
UINT8 EXISP_PvSizeSet(UINT8 ucResolutionIdx);
|
||||
UINT8 EXISP_ImageCapSet(UINT8 ucImageCapIdx);
|
||||
UINT8 EXISP_TAFTAEROISet(
|
||||
UINT8 ucTrg,
|
||||
UINT16 usTAFSize,
|
||||
UINT16 usTAFX,
|
||||
UINT16 usTAFY,
|
||||
UINT16 usTAESize,
|
||||
UINT16 usTAEX,
|
||||
UINT16 usTAEY);
|
||||
UINT8 EXISP_SwitchRAWFormatSet(void);
|
||||
UINT8 EXISP_ExifInfoGet(
|
||||
UINT8 *ucExpTimeNumerator,
|
||||
UINT32 *ulExpTimeDenominator,
|
||||
UINT8 *ucExpTimeCompensation,
|
||||
UINT16 *usLensFocalLength,
|
||||
UINT16 *usIsoInfo,
|
||||
UINT8 *ucFlashInfo);
|
||||
|
||||
#endif /* APP_I2C_LIB_ICATCH_H */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,212 +0,0 @@
|
|||
#ifndef ICATCH7002_COMMON_H
|
||||
#include "../generic_sensor.h"
|
||||
#include "app_i2c_lib_icatch.h"
|
||||
#include <linux/firmware.h>
|
||||
|
||||
/* CAMERA_REAR_SENSOR_SETTING:V17.00.18 */
|
||||
/* CAMERA_FRONT_SENSOR_SETTING:V17.00.18 */
|
||||
#if defined(CONFIG_TRACE_LOG_PRINTK)
|
||||
#define DEBUG_TRACE(format, ...) printk(KERN_WARNING format, ## __VA_ARGS__)
|
||||
#else
|
||||
#define DEBUG_TRACE(format, ...)
|
||||
#endif
|
||||
#define LOG_TRACE(format, ...) printk(KERN_WARNING format, ## __VA_ARGS__)
|
||||
|
||||
|
||||
#define CALIBRATION_MODE_FUN 1
|
||||
|
||||
#define SENSOR_REGISTER_LEN 2 // sensor register address bytes
|
||||
#define SENSOR_VALUE_LEN 1 // sensor register value bytes
|
||||
|
||||
extern struct i2c_client *g_icatch_i2c_client;
|
||||
#define icatch_sensor_write(reg,v) CONS4(sensor_write_reg,SENSOR_REGISTER_LEN,val,SENSOR_VALUE_LEN)((g_icatch_i2c_client),(reg),(v))
|
||||
#define icatch_sensor_write_array(regarry) generic_sensor_write_array(g_icatch_i2c_client,regarry)
|
||||
|
||||
|
||||
static inline u8 icatch_sensor_read(u16 reg)
|
||||
{
|
||||
u8 val;
|
||||
sensor_read_reg2val1(g_icatch_i2c_client,reg,&val);
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
enum sensor_work_state {
|
||||
sensor_work_ready = 0,
|
||||
sensor_working,
|
||||
};
|
||||
|
||||
#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 0
|
||||
#define CONFIG_SENSOR_FACE_DETECT 0
|
||||
#define CONFIG_SENSOR_ISO 1
|
||||
#define CONFIG_SENSOR_AntiBanding 1
|
||||
#define CONFIG_SENSOR_WhiteBalanceLock 1
|
||||
#define CONFIG_SENSOR_ExposureLock 1
|
||||
#define CONFIG_SENSOR_MeteringAreas 1
|
||||
#define CONFIG_SENSOR_Wdr 1
|
||||
#define CONFIG_SENSOR_EDGE 1
|
||||
#define CONFIG_SENSOR_JPEG_EXIF 1
|
||||
#define CONFIG_SENSOR_DUMPREGS 0
|
||||
|
||||
#if CONFIG_SENSOR_Focus
|
||||
extern int icatch_sensor_set_auto_focus(struct i2c_client *client, int value,int *tmp_zone);
|
||||
#endif
|
||||
|
||||
#if CALIBRATION_MODE_FUN
|
||||
void icatch_create_proc_entry(void);
|
||||
void icatch_remove_proc_entry(void);
|
||||
#endif
|
||||
extern void BB_WrSPIFlash(u32 size);
|
||||
extern int icatch_request_firmware(const struct firmware ** fw);
|
||||
extern void icatch_release_firmware(const struct firmware * fw);
|
||||
extern void icatch_sensor_power_ctr(struct soc_camera_device *icd ,int on,int power_mode);
|
||||
extern int icatch_load_fw(struct soc_camera_device *icd,u8 sensorid);
|
||||
int icatch_get_rearid_by_lowlevelmode(struct soc_camera_device *icd,UINT16 *rear_id);
|
||||
int icatch_get_frontid_by_lowlevelmode(struct soc_camera_device *icd,UINT16 *front_id);
|
||||
extern int icatch_sensor_init(struct i2c_client *client);
|
||||
extern int icatch_s_fmt(struct i2c_client *client, struct v4l2_mbus_framefmt *mf,bool is_capture);
|
||||
extern int icatch_s_stream(struct v4l2_subdev *sd, int enable);
|
||||
extern int sensor_set_get_control_cb(struct soc_camera_device *icd, struct sensor_v4l2ctrl_info_s *ctrl_info,
|
||||
struct v4l2_ext_control *ext_ctrl,bool is_set);
|
||||
extern int icatch_enum_framesizes(struct v4l2_subdev *sd, struct v4l2_frmsizeenum *fsize);
|
||||
|
||||
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_QUADVGA =0x0100, // 1280*960
|
||||
OUTPUT_SXGA =0x0200, // 1280*1024
|
||||
OUTPUT_UXGA =0x0400, // 1600*1200
|
||||
OUTPUT_1080P =0x0800, //1920*1080
|
||||
OUTPUT_QXGA =0x1000, // 2048*1536
|
||||
OUTPUT_QSXGA =0x2000, // 2592*1944
|
||||
OUTPUT_QUXGA =0x4000, //3264*2448
|
||||
};
|
||||
|
||||
|
||||
|
||||
enum sensor_preview_cap_mode{
|
||||
PREVIEW_MODE,
|
||||
CAPTURE_MODE,
|
||||
CAPTURE_ZSL_MODE,
|
||||
CAPTURE_NONE_ZSL_MODE,
|
||||
IDLE_MODE,
|
||||
};
|
||||
|
||||
|
||||
typedef struct rk_sensor_focus_zone rk_sensor_tae_zone;
|
||||
typedef struct{
|
||||
uint32_t num;
|
||||
uint32_t denom;
|
||||
}rat_t;
|
||||
|
||||
|
||||
typedef struct{
|
||||
/*IFD0*/
|
||||
char *maker;//manufacturer of digicam, just to adjust to make inPhybusAddr to align to 64
|
||||
int makerchars;//length of maker, contain the end '\0', so equal strlen(maker)+1
|
||||
char *modelstr;//model number of digicam
|
||||
int modelchars;//length of modelstr, contain the end '\0'
|
||||
int Orientation;//usually 1
|
||||
//XResolution, YResolution; if need be not 72, TODO...
|
||||
char DateTime[20];//must be 20 chars-> yyyy:MM:dd0x20hh:mm:ss'\0'
|
||||
/*Exif SubIFD*/
|
||||
rat_t ExposureTime;//such as 1/400=0.0025s
|
||||
rat_t ApertureFNumber;//actual f-number
|
||||
int ISOSpeedRatings;//CCD sensitivity equivalent to Ag-Hr film speedrate
|
||||
rat_t CompressedBitsPerPixel;
|
||||
rat_t ShutterSpeedValue;
|
||||
rat_t ApertureValue;
|
||||
rat_t ExposureBiasValue;
|
||||
rat_t MaxApertureValue;
|
||||
int MeteringMode;
|
||||
int Flash;
|
||||
rat_t FocalLength;
|
||||
rat_t FocalPlaneXResolution;
|
||||
rat_t FocalPlaneYResolution;
|
||||
int SensingMethod;//2 means 1 chip color area sensor
|
||||
int FileSource;//3 means the image source is digital still camera
|
||||
int CustomRendered;//0
|
||||
int ExposureMode;//0
|
||||
int WhiteBalance;//0
|
||||
rat_t DigitalZoomRatio;// inputw/inputw
|
||||
//int FocalLengthIn35mmFilm;
|
||||
int SceneCaptureType;//0
|
||||
|
||||
}RkExifInfo;
|
||||
|
||||
//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{
|
||||
int focus;
|
||||
int auto_focus;
|
||||
int flash;
|
||||
int whiteBalance;
|
||||
int brightness;
|
||||
int contrast;
|
||||
int saturation;
|
||||
int effect;
|
||||
int scene;
|
||||
int digitalzoom;
|
||||
int exposure;
|
||||
int iso;
|
||||
int face;
|
||||
int antibanding;
|
||||
int WhiteBalanceLock;
|
||||
int ExposureLock;
|
||||
int MeteringAreas;
|
||||
int Wdr;
|
||||
int hdr;
|
||||
//mirror or flip
|
||||
unsigned char mirror; /* HFLIP */
|
||||
unsigned char flip; /* VFLIP */
|
||||
//preview or capture
|
||||
int outputSize; // supported resolution
|
||||
int curRes;
|
||||
int curPreviewCapMode;
|
||||
int supportedSize[10];
|
||||
int supportedSizeNum;
|
||||
int had_setprvsize;
|
||||
RkExifInfo exifInfo;
|
||||
#if CALIBRATION_MODE_FUN
|
||||
int rk_query_PreviewCapMode;
|
||||
int sensor_id;
|
||||
#endif
|
||||
struct rk_sensor_focus_zone focus_zone;
|
||||
rk_sensor_tae_zone tae_zone;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
struct specific_sensor{
|
||||
struct generic_sensor common_sensor;
|
||||
//define user data below
|
||||
struct isp_data isp_priv_info;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
@ -1,629 +0,0 @@
|
|||
|
||||
#include "icatch7002_common.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_ISP_ICATCH7002_MI1040
|
||||
#define SENSOR_V4L2_IDENT V4L2_IDENT_ICATCH7002_MI1040
|
||||
#define SENSOR_ID 0x2481
|
||||
#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 1280
|
||||
#define SENSOR_PREVIEW_H 960
|
||||
#define SENSOR_PREVIEW_FPS 30000 // 15fps
|
||||
#define SENSOR_FULLRES_L_FPS 15000 // 7.5fps
|
||||
#define SENSOR_FULLRES_H_FPS 15000 // 7.5fps
|
||||
#define SENSOR_720P_FPS 0
|
||||
#define SENSOR_1080P_FPS 0
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 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[] ={
|
||||
SensorStreamChk,
|
||||
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[] =
|
||||
{
|
||||
SensorStreamChk,
|
||||
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[]=
|
||||
{
|
||||
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[]=
|
||||
{
|
||||
//Sunny
|
||||
SensorEnd
|
||||
};
|
||||
/* Office Colour Temperature : 3500K - 5000K */
|
||||
static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]=
|
||||
{
|
||||
//Office
|
||||
SensorEnd
|
||||
|
||||
};
|
||||
/* Home Colour Temperature : 2500K - 3500K */
|
||||
static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]=
|
||||
{
|
||||
//Home
|
||||
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[] =
|
||||
{
|
||||
//Negative
|
||||
SensorEnd
|
||||
};
|
||||
static struct rk_sensor_reg sensor_Effect_Bluish[] =
|
||||
{
|
||||
// Bluish
|
||||
SensorEnd
|
||||
};
|
||||
|
||||
static struct rk_sensor_reg sensor_Effect_Green[] =
|
||||
{
|
||||
// Greenish
|
||||
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[] =
|
||||
{
|
||||
//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),
|
||||
|
||||
//speical effect
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,0,"normal",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,1,"aqua",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,"mono",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,5,"none",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,6,"aura",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,7,"vintage",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,8,"vintage2",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,9,"lomo",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,10,"red",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,11,"blue",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,12,"green",0),
|
||||
|
||||
//scence
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,0,"normal",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,1,"auto",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,2,"landscape",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,3,"night",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,4,"night_portrait",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,5,"snow",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,6,"sports",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,7,"candlelight",0),
|
||||
|
||||
//antibanding
|
||||
new_usr_v4l2menu(V4L2_CID_ANTIBANDING,0,"50hz",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ANTIBANDING,1,"60hz",0),
|
||||
|
||||
//ISO
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,0,"auto",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,1,"50",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,2,"100",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,3,"200",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,4,"400",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,5,"800",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,6,"1600",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, 4, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
// new_user_v4l2ctrl(V4L2_CID_BRIGHTNESS,V4L2_CTRL_TYPE_INTEGER,"Brightness Control", -3, 2, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_EXPOSURE,V4L2_CTRL_TYPE_INTEGER,"Exposure Control", -3, 3, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_EFFECT,V4L2_CTRL_TYPE_MENU,"Effect Control", 0, 12, 1, 5,sensor_set_get_control_cb, NULL),
|
||||
// new_user_v4l2ctrl(V4L2_CID_CONTRAST,V4L2_CTRL_TYPE_INTEGER,"Contrast Control", -4, 4, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_SCENE,V4L2_CTRL_TYPE_MENU,"Scene Control", 0, 7, 1, 1,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_ANTIBANDING,V4L2_CTRL_TYPE_MENU,"Antibanding Control", 0, 1, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_WHITEBALANCE_LOCK,V4L2_CTRL_TYPE_BOOLEAN,"WhiteBalanceLock Control", 0, 1, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_EXPOSURE_LOCK,V4L2_CTRL_TYPE_BOOLEAN,"ExposureLock Control", 0, 1, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_METERING_AREAS,V4L2_CTRL_TYPE_INTEGER,"MeteringAreas Control", 0, 1, 1, 1,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_WDR,V4L2_CTRL_TYPE_BOOLEAN,"WDR Control", 0, 1, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_EDGE,V4L2_CTRL_TYPE_BOOLEAN,"EDGE Control", 0, 1, 1, 1,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_JPEG_EXIF,V4L2_CTRL_TYPE_BOOLEAN,"Exif Control", 0, 1, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_ISO,V4L2_CTRL_TYPE_MENU,"Exif Control", 0, 6, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
};
|
||||
|
||||
//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}
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
**********************************************************
|
||||
* 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 icatch_sensor_init(client);
|
||||
}
|
||||
/*
|
||||
* 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 icatch_s_fmt(client, mf,capture);
|
||||
}
|
||||
/*
|
||||
* 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)
|
||||
{
|
||||
struct generic_sensor *sensor = to_generic_sensor(client);
|
||||
return sensor->info_priv.chip_id[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;
|
||||
|
||||
}
|
||||
/*
|
||||
* 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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
* the function is v4l2 control V4L2_CID_HFLIP callback
|
||||
*/
|
||||
|
||||
static int sensor_flip_cb(struct i2c_client *client, int flip)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
return err;
|
||||
}
|
||||
static int sensor_mirror_cb(struct i2c_client *client, int flip)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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)
|
||||
{
|
||||
spsensor->common_sensor.sensor_cb.sensor_s_stream_cb = icatch_s_stream;
|
||||
spsensor->common_sensor.sensor_cb.sensor_enum_framesizes = icatch_enum_framesizes;
|
||||
|
||||
spsensor->isp_priv_info.outputSize =OUTPUT_QUADVGA;
|
||||
spsensor->isp_priv_info.supportedSizeNum = 1;
|
||||
spsensor->isp_priv_info.supportedSize[0] = OUTPUT_QUADVGA;
|
||||
|
||||
|
||||
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();
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,629 +0,0 @@
|
|||
|
||||
#include "icatch7002_common.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_ISP_ICATCH7002_OV2720
|
||||
#define SENSOR_V4L2_IDENT V4L2_IDENT_ICATCH7002_OV2720
|
||||
#define SENSOR_ID 0x2720
|
||||
#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 1280
|
||||
#define SENSOR_PREVIEW_H 960
|
||||
#define SENSOR_PREVIEW_FPS 30000 // 15fps
|
||||
#define SENSOR_FULLRES_L_FPS 15000 // 7.5fps
|
||||
#define SENSOR_FULLRES_H_FPS 15000 // 7.5fps
|
||||
#define SENSOR_720P_FPS 30000
|
||||
#define SENSOR_1080P_FPS 0
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 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[] ={
|
||||
SensorStreamChk,
|
||||
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[] =
|
||||
{
|
||||
SensorStreamChk,
|
||||
SensorEnd
|
||||
};
|
||||
/* 1280x720 */
|
||||
static struct rk_sensor_reg sensor_720p[]={
|
||||
SensorStreamChk,
|
||||
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[]=
|
||||
{
|
||||
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[]=
|
||||
{
|
||||
//Sunny
|
||||
SensorEnd
|
||||
};
|
||||
/* Office Colour Temperature : 3500K - 5000K */
|
||||
static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]=
|
||||
{
|
||||
//Office
|
||||
SensorEnd
|
||||
|
||||
};
|
||||
/* Home Colour Temperature : 2500K - 3500K */
|
||||
static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]=
|
||||
{
|
||||
//Home
|
||||
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[] =
|
||||
{
|
||||
//Negative
|
||||
SensorEnd
|
||||
};
|
||||
static struct rk_sensor_reg sensor_Effect_Bluish[] =
|
||||
{
|
||||
// Bluish
|
||||
SensorEnd
|
||||
};
|
||||
|
||||
static struct rk_sensor_reg sensor_Effect_Green[] =
|
||||
{
|
||||
// Greenish
|
||||
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[] =
|
||||
{
|
||||
//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),
|
||||
|
||||
//speical effect
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,0,"normal",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,1,"aqua",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,"mono",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,5,"none",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,6,"aura",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,7,"vintage",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,8,"vintage2",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,9,"lomo",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,10,"red",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,11,"blue",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,12,"green",0),
|
||||
|
||||
//scence
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,0,"normal",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,1,"auto",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,2,"landscape",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,3,"night",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,4,"night_portrait",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,5,"snow",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,6,"sports",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,7,"candlelight",0),
|
||||
|
||||
//antibanding
|
||||
new_usr_v4l2menu(V4L2_CID_ANTIBANDING,0,"50hz",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ANTIBANDING,1,"60hz",0),
|
||||
|
||||
//ISO
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,0,"auto",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,1,"50",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,2,"100",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,3,"200",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,4,"400",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,5,"800",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,6,"1600",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, 4, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
// new_user_v4l2ctrl(V4L2_CID_BRIGHTNESS,V4L2_CTRL_TYPE_INTEGER,"Brightness Control", -3, 2, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_EXPOSURE,V4L2_CTRL_TYPE_INTEGER,"Exposure Control", -3, 3, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_EFFECT,V4L2_CTRL_TYPE_MENU,"Effect Control", 0, 12, 1, 5,sensor_set_get_control_cb, NULL),
|
||||
// new_user_v4l2ctrl(V4L2_CID_CONTRAST,V4L2_CTRL_TYPE_INTEGER,"Contrast Control", -4, 4, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_SCENE,V4L2_CTRL_TYPE_MENU,"Scene Control", 0, 7, 1, 1,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_ANTIBANDING,V4L2_CTRL_TYPE_MENU,"Antibanding Control", 0, 1, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_WHITEBALANCE_LOCK,V4L2_CTRL_TYPE_BOOLEAN,"WhiteBalanceLock Control", 0, 1, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_EXPOSURE_LOCK,V4L2_CTRL_TYPE_BOOLEAN,"ExposureLock Control", 0, 1, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_METERING_AREAS,V4L2_CTRL_TYPE_INTEGER,"MeteringAreas Control", 0, 1, 1, 1,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_WDR,V4L2_CTRL_TYPE_BOOLEAN,"WDR Control", 0, 1, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_EDGE,V4L2_CTRL_TYPE_BOOLEAN,"EDGE Control", 0, 1, 1, 1,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_JPEG_EXIF,V4L2_CTRL_TYPE_BOOLEAN,"Exif Control", 0, 1, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_ISO,V4L2_CTRL_TYPE_MENU,"Exif Control", 0, 6, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
};
|
||||
|
||||
//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}
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
**********************************************************
|
||||
* 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 icatch_sensor_init(client);
|
||||
}
|
||||
/*
|
||||
* 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 icatch_s_fmt(client, mf,capture);
|
||||
}
|
||||
/*
|
||||
* 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)
|
||||
{
|
||||
struct generic_sensor *sensor = to_generic_sensor(client);
|
||||
return sensor->info_priv.chip_id[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;
|
||||
|
||||
}
|
||||
/*
|
||||
* 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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
* the function is v4l2 control V4L2_CID_HFLIP callback
|
||||
*/
|
||||
|
||||
static int sensor_flip_cb(struct i2c_client *client, int flip)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
return err;
|
||||
}
|
||||
static int sensor_mirror_cb(struct i2c_client *client, int flip)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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)
|
||||
{
|
||||
spsensor->common_sensor.sensor_cb.sensor_s_stream_cb = icatch_s_stream;
|
||||
spsensor->common_sensor.sensor_cb.sensor_enum_framesizes = icatch_enum_framesizes;
|
||||
|
||||
spsensor->isp_priv_info.outputSize =OUTPUT_1080P|OUTPUT_QUADVGA;
|
||||
spsensor->isp_priv_info.supportedSizeNum = 2;
|
||||
spsensor->isp_priv_info.supportedSize[0] = OUTPUT_QUADVGA;
|
||||
spsensor->isp_priv_info.supportedSize[1] = OUTPUT_1080P;
|
||||
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();
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,638 +0,0 @@
|
|||
|
||||
#include "icatch7002_common.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_ISP_ICATCH7002_OV5693
|
||||
#define SENSOR_V4L2_IDENT V4L2_IDENT_ICATCH7002_OV5693
|
||||
#define SENSOR_ID 0x5690
|
||||
#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 1280
|
||||
#define SENSOR_PREVIEW_H 960
|
||||
#define SENSOR_PREVIEW_FPS 30000 // 15fps
|
||||
#define SENSOR_FULLRES_L_FPS 15000 // 7.5fps
|
||||
#define SENSOR_FULLRES_H_FPS 15000 // 7.5fps
|
||||
#define SENSOR_720P_FPS 0
|
||||
#define SENSOR_1080P_FPS 0
|
||||
|
||||
|
||||
static unsigned int SensorConfiguration = CFG_Focus |CFG_FocusContinues|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
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 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[] ={
|
||||
SensorStreamChk,
|
||||
SensorEnd
|
||||
};
|
||||
/* Senor full resolution setting: recommand for capture */
|
||||
static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={
|
||||
SensorStreamChk,
|
||||
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[] =
|
||||
{
|
||||
SensorStreamChk,
|
||||
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[]=
|
||||
{
|
||||
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[]=
|
||||
{
|
||||
//Sunny
|
||||
SensorEnd
|
||||
};
|
||||
/* Office Colour Temperature : 3500K - 5000K */
|
||||
static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]=
|
||||
{
|
||||
//Office
|
||||
SensorEnd
|
||||
|
||||
};
|
||||
/* Home Colour Temperature : 2500K - 3500K */
|
||||
static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]=
|
||||
{
|
||||
//Home
|
||||
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[] =
|
||||
{
|
||||
//Negative
|
||||
SensorEnd
|
||||
};
|
||||
static struct rk_sensor_reg sensor_Effect_Bluish[] =
|
||||
{
|
||||
// Bluish
|
||||
SensorEnd
|
||||
};
|
||||
|
||||
static struct rk_sensor_reg sensor_Effect_Green[] =
|
||||
{
|
||||
// Greenish
|
||||
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[] =
|
||||
{
|
||||
//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),
|
||||
|
||||
//speical effect
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,0,"normal",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,1,"aqua",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,"mono",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,5,"none",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,6,"aura",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,7,"vintage",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,8,"vintage2",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,9,"lomo",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,10,"red",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,11,"blue",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,12,"green",0),
|
||||
|
||||
//scence
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,0,"normal",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,1,"auto",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,2,"landscape",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,3,"night",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,4,"night_portrait",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,5,"snow",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,6,"sports",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,7,"candlelight",0),
|
||||
|
||||
//antibanding
|
||||
new_usr_v4l2menu(V4L2_CID_ANTIBANDING,0,"50hz",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ANTIBANDING,1,"60hz",0),
|
||||
|
||||
//ISO
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,0,"auto",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,1,"50",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,2,"100",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,3,"200",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,4,"400",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,5,"800",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,6,"1600",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, 4, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
// new_user_v4l2ctrl(V4L2_CID_BRIGHTNESS,V4L2_CTRL_TYPE_INTEGER,"Brightness Control", -3, 2, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_EXPOSURE,V4L2_CTRL_TYPE_INTEGER,"Exposure Control", -3, 3, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_EFFECT,V4L2_CTRL_TYPE_MENU,"Effect Control", 0, 12, 1, 5,sensor_set_get_control_cb, NULL),
|
||||
// new_user_v4l2ctrl(V4L2_CID_CONTRAST,V4L2_CTRL_TYPE_INTEGER,"Contrast Control", -4, 4, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_SCENE,V4L2_CTRL_TYPE_MENU,"Scene Control", 0, 7, 1, 1,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_ANTIBANDING,V4L2_CTRL_TYPE_MENU,"Antibanding Control", 0, 1, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_WHITEBALANCE_LOCK,V4L2_CTRL_TYPE_BOOLEAN,"WhiteBalanceLock Control", 0, 1, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_EXPOSURE_LOCK,V4L2_CTRL_TYPE_BOOLEAN,"ExposureLock Control", 0, 1, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_METERING_AREAS,V4L2_CTRL_TYPE_INTEGER,"MeteringAreas Control", 0, 1, 1, 1,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_WDR,V4L2_CTRL_TYPE_BOOLEAN,"WDR Control", 0, 1, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_EDGE,V4L2_CTRL_TYPE_BOOLEAN,"EDGE Control", 0, 1, 1, 1,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_JPEG_EXIF,V4L2_CTRL_TYPE_BOOLEAN,"Exif Control", 0, 1, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_ISO,V4L2_CTRL_TYPE_MENU,"Exif Control", 0, 6, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
|
||||
// new_user_v4l2ctrl(V4L2_CID_FOCUSZONE,V4L2_CTRL_TYPE_BOOLEAN,"FocusZone Control", 0, 1, 1, 1,sensor_focus_default_cb, NULL),
|
||||
// new_user_v4l2ctrl(V4L2_CID_FOCUS_ABSOLUTE,V4L2_CTRL_TYPE_INTEGER,"Focus Control", 0, 0xff, 1, 0,sensor_focus_default_cb, NULL),
|
||||
// new_user_v4l2ctrl(V4L2_CID_FOCUS_AUTO,V4L2_CTRL_TYPE_BOOLEAN,"Focus Control", 0, 1, 1, 0,sensor_focus_default_cb, NULL),
|
||||
// new_user_v4l2ctrl(V4L2_CID_FOCUS_CONTINUOUS,V4L2_CTRL_TYPE_BOOLEAN,"Focus Control", 0, 1, 1, 0,sensor_focus_default_cb, NULL),
|
||||
};
|
||||
|
||||
//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}
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
**********************************************************
|
||||
* 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 icatch_sensor_init(client);
|
||||
}
|
||||
/*
|
||||
* 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 icatch_s_fmt(client, mf,capture);
|
||||
}
|
||||
/*
|
||||
* 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)
|
||||
{
|
||||
struct generic_sensor *sensor = to_generic_sensor(client);
|
||||
return sensor->info_priv.chip_id[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;
|
||||
|
||||
}
|
||||
/*
|
||||
* 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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
* the function is v4l2 control V4L2_CID_HFLIP callback
|
||||
*/
|
||||
|
||||
static int sensor_flip_cb(struct i2c_client *client, int flip)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
return err;
|
||||
}
|
||||
static int sensor_mirror_cb(struct i2c_client *client, int flip)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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 icatch_sensor_set_auto_focus(client, WqCmd_af_single,NULL);
|
||||
}
|
||||
|
||||
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 icatch_sensor_set_auto_focus(client, WqCmd_af_continues,NULL);
|
||||
}
|
||||
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 icatch_sensor_set_auto_focus(client, WqCmd_af_update_zone,zone_tm_pos);
|
||||
}
|
||||
|
||||
/*
|
||||
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)
|
||||
{
|
||||
spsensor->common_sensor.sensor_cb.sensor_s_stream_cb = icatch_s_stream;
|
||||
spsensor->isp_priv_info.focus_zone.lx = 256;
|
||||
spsensor->isp_priv_info.focus_zone.rx = 768;
|
||||
spsensor->isp_priv_info.focus_zone.ty = 256;
|
||||
spsensor->isp_priv_info.focus_zone.dy = 768;
|
||||
spsensor->common_sensor.sensor_cb.sensor_enum_framesizes = icatch_enum_framesizes;
|
||||
|
||||
spsensor->isp_priv_info.outputSize = OUTPUT_QSXGA|OUTPUT_QUADVGA;
|
||||
spsensor->isp_priv_info.supportedSizeNum = 2;
|
||||
spsensor->isp_priv_info.supportedSize[0] = OUTPUT_QUADVGA;
|
||||
spsensor->isp_priv_info.supportedSize[1] = OUTPUT_QSXGA;
|
||||
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();
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,639 +0,0 @@
|
|||
|
||||
#include "icatch7002_common.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_ISP_ICATCH7002_OV8825
|
||||
#define SENSOR_V4L2_IDENT V4L2_IDENT_ICATCH7002_OV8825
|
||||
#define SENSOR_ID 0x8825
|
||||
#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 1280
|
||||
#define SENSOR_PREVIEW_H 960
|
||||
#define SENSOR_PREVIEW_FPS 30000 // 15fps
|
||||
#define SENSOR_FULLRES_L_FPS 15000 // 7.5fps
|
||||
#define SENSOR_FULLRES_H_FPS 15000 // 7.5fps
|
||||
#define SENSOR_720P_FPS 30000
|
||||
#define SENSOR_1080P_FPS 0
|
||||
|
||||
|
||||
static unsigned int SensorConfiguration = CFG_Focus |CFG_FocusContinues|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
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 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[] ={
|
||||
SensorStreamChk,
|
||||
SensorEnd
|
||||
};
|
||||
/* Senor full resolution setting: recommand for capture */
|
||||
static struct rk_sensor_reg sensor_fullres_lowfps_data[] ={
|
||||
SensorStreamChk,
|
||||
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[] =
|
||||
{
|
||||
SensorStreamChk,
|
||||
SensorEnd
|
||||
};
|
||||
/* 1280x720 */
|
||||
static struct rk_sensor_reg sensor_720p[]={
|
||||
SensorStreamChk,
|
||||
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[]=
|
||||
{
|
||||
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[]=
|
||||
{
|
||||
//Sunny
|
||||
SensorEnd
|
||||
};
|
||||
/* Office Colour Temperature : 3500K - 5000K */
|
||||
static struct rk_sensor_reg sensor_WhiteB_TungstenLamp1[]=
|
||||
{
|
||||
//Office
|
||||
SensorEnd
|
||||
|
||||
};
|
||||
/* Home Colour Temperature : 2500K - 3500K */
|
||||
static struct rk_sensor_reg sensor_WhiteB_TungstenLamp2[]=
|
||||
{
|
||||
//Home
|
||||
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[] =
|
||||
{
|
||||
//Negative
|
||||
SensorEnd
|
||||
};
|
||||
static struct rk_sensor_reg sensor_Effect_Bluish[] =
|
||||
{
|
||||
// Bluish
|
||||
SensorEnd
|
||||
};
|
||||
|
||||
static struct rk_sensor_reg sensor_Effect_Green[] =
|
||||
{
|
||||
// Greenish
|
||||
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[] =
|
||||
{
|
||||
//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),
|
||||
|
||||
//speical effect
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,0,"normal",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,1,"aqua",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,"mono",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,5,"none",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,6,"aura",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,7,"vintage",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,8,"vintage2",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,9,"lomo",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,10,"red",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,11,"blue",0),
|
||||
new_usr_v4l2menu(V4L2_CID_EFFECT,12,"green",0),
|
||||
|
||||
//scence
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,0,"normal",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,1,"auto",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,2,"landscape",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,3,"night",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,4,"night_portrait",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,5,"snow",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,6,"sports",0),
|
||||
new_usr_v4l2menu(V4L2_CID_SCENE,7,"candlelight",0),
|
||||
|
||||
//antibanding
|
||||
new_usr_v4l2menu(V4L2_CID_ANTIBANDING,0,"50hz",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ANTIBANDING,1,"60hz",0),
|
||||
|
||||
//ISO
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,0,"auto",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,1,"50",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,2,"100",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,3,"200",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,4,"400",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,5,"800",0),
|
||||
new_usr_v4l2menu(V4L2_CID_ISO,6,"1600",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, 4, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
// new_user_v4l2ctrl(V4L2_CID_BRIGHTNESS,V4L2_CTRL_TYPE_INTEGER,"Brightness Control", -3, 2, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_EXPOSURE,V4L2_CTRL_TYPE_INTEGER,"Exposure Control", -3, 3, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_EFFECT,V4L2_CTRL_TYPE_MENU,"Effect Control", 0, 12, 1, 5,sensor_set_get_control_cb, NULL),
|
||||
// new_user_v4l2ctrl(V4L2_CID_CONTRAST,V4L2_CTRL_TYPE_INTEGER,"Contrast Control", -4, 4, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_SCENE,V4L2_CTRL_TYPE_MENU,"Scene Control", 0, 7, 1, 1,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_ANTIBANDING,V4L2_CTRL_TYPE_MENU,"Antibanding Control", 0, 1, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_WHITEBALANCE_LOCK,V4L2_CTRL_TYPE_BOOLEAN,"WhiteBalanceLock Control", 0, 1, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_EXPOSURE_LOCK,V4L2_CTRL_TYPE_BOOLEAN,"ExposureLock Control", 0, 1, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_METERING_AREAS,V4L2_CTRL_TYPE_INTEGER,"MeteringAreas Control", 0, 1, 1, 1,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_WDR,V4L2_CTRL_TYPE_BOOLEAN,"WDR Control", 0, 1, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_EDGE,V4L2_CTRL_TYPE_BOOLEAN,"EDGE Control", 0, 1, 1, 1,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_JPEG_EXIF,V4L2_CTRL_TYPE_BOOLEAN,"Exif Control", 0, 1, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
new_user_v4l2ctrl(V4L2_CID_ISO,V4L2_CTRL_TYPE_MENU,"Exif Control", 0, 6, 1, 0,sensor_set_get_control_cb, NULL),
|
||||
|
||||
// new_user_v4l2ctrl(V4L2_CID_FOCUSZONE,V4L2_CTRL_TYPE_BOOLEAN,"FocusZone Control", 0, 1, 1, 1,sensor_focus_default_cb, NULL),
|
||||
// new_user_v4l2ctrl(V4L2_CID_FOCUS_ABSOLUTE,V4L2_CTRL_TYPE_INTEGER,"Focus Control", 0, 0xff, 1, 0,sensor_focus_default_cb, NULL),
|
||||
// new_user_v4l2ctrl(V4L2_CID_FOCUS_AUTO,V4L2_CTRL_TYPE_BOOLEAN,"Focus Control", 0, 1, 1, 0,sensor_focus_default_cb, NULL),
|
||||
// new_user_v4l2ctrl(V4L2_CID_FOCUS_CONTINUOUS,V4L2_CTRL_TYPE_BOOLEAN,"Focus Control", 0, 1, 1, 0,sensor_focus_default_cb, NULL),
|
||||
};
|
||||
|
||||
//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}
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
**********************************************************
|
||||
* 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 icatch_sensor_init(client);
|
||||
}
|
||||
/*
|
||||
* 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 icatch_s_fmt(client, mf,capture);
|
||||
}
|
||||
/*
|
||||
* 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)
|
||||
{
|
||||
struct generic_sensor *sensor = to_generic_sensor(client);
|
||||
return sensor->info_priv.chip_id[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;
|
||||
|
||||
}
|
||||
/*
|
||||
* 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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
* the function is v4l2 control V4L2_CID_HFLIP callback
|
||||
*/
|
||||
|
||||
static int sensor_flip_cb(struct i2c_client *client, int flip)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
return err;
|
||||
}
|
||||
static int sensor_mirror_cb(struct i2c_client *client, int flip)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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 icatch_sensor_set_auto_focus(client, WqCmd_af_single,NULL);
|
||||
}
|
||||
|
||||
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 icatch_sensor_set_auto_focus(client, WqCmd_af_continues,NULL);
|
||||
}
|
||||
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 icatch_sensor_set_auto_focus(client, WqCmd_af_update_zone,zone_tm_pos);
|
||||
}
|
||||
|
||||
/*
|
||||
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)
|
||||
{
|
||||
spsensor->common_sensor.sensor_cb.sensor_s_stream_cb = icatch_s_stream;
|
||||
spsensor->isp_priv_info.focus_zone.lx = 256;
|
||||
spsensor->isp_priv_info.focus_zone.rx = 768;
|
||||
spsensor->isp_priv_info.focus_zone.ty = 256;
|
||||
spsensor->isp_priv_info.focus_zone.dy = 768;
|
||||
spsensor->common_sensor.sensor_cb.sensor_enum_framesizes = icatch_enum_framesizes;
|
||||
|
||||
spsensor->isp_priv_info.outputSize = OUTPUT_QUXGA|OUTPUT_QUADVGA;
|
||||
spsensor->isp_priv_info.supportedSizeNum = 2;
|
||||
spsensor->isp_priv_info.supportedSize[0] = OUTPUT_QUADVGA;
|
||||
spsensor->isp_priv_info.supportedSize[1] = OUTPUT_QUXGA;
|
||||
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();
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
/*icatch host mode ,spi device
|
||||
*
|
||||
*
|
||||
* 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 <linux/dma-mapping.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/highmem.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/cpufreq.h>
|
||||
#include <mach/gpio.h>
|
||||
#include <mach/irqs.h>
|
||||
#include <linux/miscdevice.h>
|
||||
#include <asm/dma.h>
|
||||
#include <linux/preempt.h>
|
||||
#include <mach/board.h>
|
||||
#include "icatch_spi_host.h"
|
||||
#include <linux/miscdevice.h>
|
||||
struct spi_device* g_icatch_spi_dev = NULL;
|
||||
|
||||
static int __devinit spi_icatch_probe(struct spi_device *spi)
|
||||
{
|
||||
struct spi_test_data *spi_test_data;
|
||||
int ret = 0;
|
||||
|
||||
spi->bits_per_word = 8;
|
||||
spi->mode = SPI_MODE_0;
|
||||
ret = spi_setup(spi);
|
||||
if (ret < 0){
|
||||
dev_err(spi, "ERR: fail to setup spi\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
g_icatch_spi_dev = spi;
|
||||
|
||||
printk("%s:bus_num=%d,ok\n",__func__,spi->master->bus_num);
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
|
||||
static struct spi_driver spi_icatch_driver = {
|
||||
.driver = {
|
||||
.name = "spi_icatch",
|
||||
.bus = &spi_bus_type,
|
||||
.owner = THIS_MODULE,
|
||||
},
|
||||
|
||||
.probe = spi_icatch_probe,
|
||||
};
|
||||
|
||||
static struct miscdevice spi_test_icatch = {
|
||||
.minor = MISC_DYNAMIC_MINOR,
|
||||
.name = "spi_misc_icatch",
|
||||
};
|
||||
|
||||
static int __init spi_icatch_init(void)
|
||||
{
|
||||
spi_register_board_info(board_spi_icatch_devices, ARRAY_SIZE(board_spi_icatch_devices));
|
||||
|
||||
misc_register(&spi_test_icatch);
|
||||
return spi_register_driver(&spi_icatch_driver);
|
||||
}
|
||||
|
||||
static void __exit spi_icatch_exit(void)
|
||||
{
|
||||
|
||||
misc_deregister(&spi_test_icatch);
|
||||
return spi_unregister_driver(&spi_icatch_driver);
|
||||
}
|
||||
module_init(spi_icatch_init);
|
||||
module_exit(spi_icatch_exit);
|
||||
|
||||
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
#ifndef ICATCH_SPI_HOST_H
|
||||
#define ICATCH_SPI_HOST_H
|
||||
#include "../../../spi/rk29_spim.h"
|
||||
#include <linux/spi/spi.h>
|
||||
|
||||
static struct rk29xx_spi_chip spi_icatch = {
|
||||
//.poll_mode = 1,
|
||||
.enable_dma = 0,
|
||||
};
|
||||
//user must define this struct according to hardware config
|
||||
static struct spi_board_info board_spi_icatch_devices[] = {
|
||||
{
|
||||
.modalias = "spi_icatch",
|
||||
.bus_num = 0, //0 or 1
|
||||
.max_speed_hz = 24*1000*1000,
|
||||
.chip_select = 0,
|
||||
.mode = SPI_MODE_0,
|
||||
.controller_data = &spi_icatch,
|
||||
},
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user