本文整理汇总了C++中CAM_CALDB函数的典型用法代码示例。如果您正苦于以下问题:C++ CAM_CALDB函数的具体用法?C++ CAM_CALDB怎么用?C++ CAM_CALDB使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CAM_CALDB函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CAM_CAL_Open
//#define
//Main jobs:
// 1.check for device-specified errors, device not ready.
// 2.Initialize the device if it is opened for the first time.
static int CAM_CAL_Open(struct inode * a_pstInode, struct file * a_pstFile)
{
CAM_CALDB("[S24CAM_CAL] CAM_CAL_Open\n");
spin_lock(&g_CAM_CALLock);
if(g_u4Opened)
{
spin_unlock(&g_CAM_CALLock);
return -EBUSY;
}
else
{
g_u4Opened = 1;
atomic_set(&g_CAM_CALatomic,0);
}
spin_unlock(&g_CAM_CALLock);
#if defined(MT6572)
// do nothing
#else
if(TRUE != hwPowerOn(MT65XX_POWER_LDO_VCAMA, VOL_2800, "S24CS64A"))
{
CAM_CALDB("[CAM_CAL] Fail to enable analog gain\n");
return -EIO;
}
#endif
return 0;
}
示例2: CAM_CAL_i2c_probe
static int CAM_CAL_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) {
int i4RetValue = 0;
CAM_CALDB("[S24CAM_CAL] Attach I2C \n");
// spin_lock_init(&g_CAM_CALLock);
//get sensor i2c client
spin_lock(&g_CAM_CALLock); //for SMP
g_pstI2Cclient = client;
g_pstI2Cclient->timing = 200;//200k
g_pstI2Cclient->addr = ov16825OTP_AWBAF_DEVICE_ID>>1;
spin_unlock(&g_CAM_CALLock); // for SMP
CAM_CALDB("[CAM_CAL] g_pstI2Cclient->addr = 0x%8x \n",g_pstI2Cclient->addr);
//Register char driver
i4RetValue = RegisterCAM_CALCharDrv();
if(i4RetValue){
CAM_CALDB("[S24CAM_CAL] register char device failed!\n");
return i4RetValue;
}
CAM_CALDB("[S24CAM_CAL] Attached!! \n");
return 0;
}
示例3: CAM_CAL_i2c_probe
static int CAM_CAL_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) {
int i4RetValue = 0;
CAM_CALDB("[imx219otp_CAL] Attach I2C \n");
// spin_lock_init(&g_CAM_CALLock);
//get sensor i2c client
spin_lock(&g_CAM_CALLock); //for SMP
g_pstI2Cclient = client;
g_pstI2Cclient->addr = HI551QTECHV2_EEPROM_DEVICE_ID>>1;
spin_unlock(&g_CAM_CALLock); // for SMP
CAM_CALDB("[CAM_CAL] g_pstI2Cclient->addr = 0x%8x \n",g_pstI2Cclient->addr);
//Register char driver
i4RetValue = RegisterCAM_CALCharDrv();
if(i4RetValue){
CAM_CALDB("[imx219otp_CAL] register char device failed!\n");
return i4RetValue;
}
CAM_CALDB("[imx219otp_CAL] Attached!! \n");
return 0;
}
示例4: iReadData
//Burst Read Data
static int iReadData(unsigned int ui4_offset, unsigned int ui4_length, unsigned char * pinputdata)
{
int i4RetValue = 0;
int i4ResidueDataLength;
u32 u4IncOffset = 0;
u32 u4CurrentOffset;
u8 * pBuff;
u8 * pOneByteBuff = NULL;
pOneByteBuff = (u8 *)kmalloc(I2C_UNIT_SIZE, GFP_KERNEL);
CAM_CALDB("ui4_offset=%0x,ui4_length=%d\n",ui4_offset,ui4_length);
i4ResidueDataLength = (int)ui4_length;
u4CurrentOffset = ui4_offset;
pBuff = pinputdata;
do
{
i4RetValue = iReadCAM_CAL(u4CurrentOffset, 1, pBuff);
//* pBuff = HI704_read_cmos_sensor(u4CurrentOffset);
CAM_CALDB("[CAM_CAL][iReadData] Read 0x%x=0x%x \n", u4CurrentOffset, pBuff[0]);
if (i4RetValue != 0)
{
CAM_CALDB("[CAM_CAL] I2C iReadData failed!! \n");
return -1;
}
u4IncOffset++;
i4ResidueDataLength --;
u4CurrentOffset = ui4_offset + u4IncOffset;
pBuff = pinputdata + u4IncOffset;
}while (i4ResidueDataLength > 0);
// CAM_CALDB("[S24EEPORM] iReadData finial address is %d length is %d buffer address is 0x%x\n",u4CurrentOffset, i4ResidueDataLength, pBuff);
// CAM_CALDB("[S24EEPORM] iReadData done\n" );
return 0;
}
示例5: iReadCAM_CAL_8
int iReadCAM_CAL_8(u8 a_u2Addr, u8 * a_puBuff, u16 i2c_id)
{
int i4RetValue = 0;
char puReadCmd[1] = {(char)(a_u2Addr)};
spin_lock(&g_CAM_CALLock); //for SMP
g_pstI2Cclient->addr = i2c_id>>1;
g_pstI2Cclient->timing=400;
g_pstI2Cclient->addr = g_pstI2Cclient->addr & (I2C_MASK_FLAG | I2C_WR_FLAG);
spin_unlock(&g_CAM_CALLock); // for SMP
i4RetValue = i2c_master_send(g_pstI2Cclient, puReadCmd, 1);
if (i4RetValue != 1)
{
CAM_CALDB("[CAM_CAL] I2C send read address failed!! \n");
CAM_CALDB("[CAMERA SENSOR] I2C send failed, addr = 0x%x, data = 0x%x !! \n", a_u2Addr, *a_puBuff );
return -1;
}
i4RetValue = i2c_master_recv(g_pstI2Cclient, (char *)a_puBuff, 1);
CAM_CALDB("[CAM_CAL][iReadCAM_CAL] Read 0x%x=0x%x \n", a_u2Addr, a_puBuff[0]);
if (i4RetValue != 1)
{
CAM_CALDB("[CAM_CAL] I2C read data failed!! \n");
return -1;
}
return 0;
}
示例6: CAM_CAL_i2c_probe
static int CAM_CAL_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
int i4RetValue = 0;
CAM_CALDB("[CAM_CAL] Attach I2C\n");
/* spin_lock_init(&g_CAM_CALLock); */
/* get sensor i2c client */
spin_lock(&g_CAM_CALLock); /* for SMP */
g_pstI2Cclient = client;
g_pstI2Cclient->addr = S24CS64A_DEVICE_ID >> 1;
spin_unlock(&g_CAM_CALLock); /* for SMP */
CAM_CALDB("[CAM_CAL] g_pstI2Cclient->addr = 0x%8x\n", g_pstI2Cclient->addr);
/* Register char driver */
i4RetValue = RegisterCAM_CALCharDrv();
if (i4RetValue) {
CAM_CALDB("[CAM_CAL] register char device failed!\n");
return i4RetValue;
}
CAM_CALDB("[CAM_CAL] Attached!!\n");
return 0;
}
示例7: OV5670_ReadOtp
static kal_uint8 OV5670_ReadOtp(u8 address,unsigned char *iBuffer,unsigned int buffersize)
{
kal_uint16 i = 0;
u8 readbuff = 0;
int ret ;
u16 i2c_id = 0;
CAM_CALDB("[CAM_CAL_SUB]ENTER address:0x%x buffersize:%d\n ", address, buffersize);
if (get_module_type() == SUNNY_MODULE) {
*(iBuffer) =(unsigned char)sunny_otp_data->module_id;
*(iBuffer+1) =(unsigned char)sunny_otp_data->awb_rg_msb;
*(iBuffer+2) =(unsigned char)sunny_otp_data->awb_bg_msb;
*(iBuffer+3) =(unsigned char)sunny_otp_data->awb_lsb;
} else if (get_module_type() == OFILM_MODULE) {
*(iBuffer) =(unsigned char)ofilm_otp_data->module_id;
*(iBuffer+1) =(unsigned char)ofilm_otp_data->awb_rg_msb;
*(iBuffer+2) =(unsigned char)ofilm_otp_data->awb_bg_msb;
*(iBuffer+3) =(unsigned char)ofilm_otp_data->awb_lsb;
} else if (get_module_type() == QTECH_MODULE) {
*(iBuffer) =(unsigned char)qtech_otp_data->module_id;
*(iBuffer+1) =(unsigned char)qtech_otp_data->awb_rg_msb;
*(iBuffer+2) =(unsigned char)qtech_otp_data->awb_bg_msb;
*(iBuffer+3) =(unsigned char)qtech_otp_data->awb_lsb;
}else
return 0;
for(i = 0; i<4; i++)
CAM_CALDB("[CAM_CAL_SUB]ov5670 otp readbuff[%d] = 0x%x\n",i,*(iBuffer+i));
}
示例8: check_IMX135_otp_valid_AWBPage
static kal_uint8 check_IMX135_otp_valid_AWBPage(void)
{
kal_uint8 Pagemax = 12;
kal_uint8 Pagemin = 9;
kal_uint8 page = 0;
kal_uint8 AWB_OK = 0x00;
u8 readbuff;
int ret;
for(page = Pagemax ; page>=Pagemin;page--)
{
if (IMX135_GotoPage(page))
{
ret = iReadCAM_CAL(0x3b04,1,&readbuff);
AWB_OK = readbuff;
if (AWB_OK != 0)
{
CAM_CALDB("AWB otp is exist\n");
break;
}
}
}
if ( page<Pagemin)
{
CAM_CALDB("No AWB OTP data!");
return 0;
}
return page;
}
示例9: CAM_CAL_init
static int __init CAM_CAL_init(void)
{
int i4RetValue = 0;
CAM_CALDB("CAM_CAL_i2C_init\n");
//Register char driver
i4RetValue = RegisterCAM_CALCharDrv();
if(i4RetValue){
CAM_CALDB(" register char device failed!\n");
return i4RetValue;
}
CAM_CALDB(" Attached!! \n");
// i2c_register_board_info(CAM_CAL_I2C_BUSNUM, &kd_cam_cal_dev, 1);
if(platform_driver_register(&g_stCAM_CAL_Driver)){
CAM_CALERR("failed to register 135otp driver\n");
return -ENODEV;
}
if (platform_device_register(&g_stCAM_CAL_Device))
{
CAM_CALERR("failed to register 135otp driver, 2nd time\n");
return -ENODEV;
}
return 0;
}
示例10: CAM_CAL_Open
//#define
//Main jobs:
// 1.check for device-specified errors, device not ready.
// 2.Initialize the device if it is opened for the first time.
static int CAM_CAL_Open(struct inode * a_pstInode, struct file * a_pstFile)
{
CAM_CALDB("[S24CAM_CAL] CAM_CAL_Open\n");
spin_lock(&g_CAM_CALLock);
if(g_u4Opened)
{
spin_unlock(&g_CAM_CALLock);
CAM_CALDB("[S24CAM_CAL] Opened, return -EBUSY\n");
return -EBUSY;
}
else
{
g_u4Opened = 1;
atomic_set(&g_CAM_CALatomic,0);
}
spin_unlock(&g_CAM_CALLock);
if(TRUE != hwPowerOn(MT65XX_POWER_LDO_VCAMA, VOL_2800, CAM_CAL_DRVNAME))
{
CAM_CALDB("[S24CAM_CAL] Fail to enable analog gain\n");
return -EIO;
}
return 0;
}
示例11: iWriteData
//Burst Write Data
static int iWriteData(unsigned int ui4_offset, unsigned int ui4_length, unsigned char * pinputdata)
{
int i4RetValue = 0;
int i4ResidueDataLength;
u32 u4IncOffset = 0;
u32 u4CurrentOffset;
u8 * pBuff;
CAM_CALDB("[S24CAM_CAL] iWriteData\n" );
i4ResidueDataLength = (int)ui4_length;
u4CurrentOffset = ui4_offset;
pBuff = pinputdata;
CAM_CALDB("[CAM_CAL] iWriteData u4CurrentOffset is %d \n",u4CurrentOffset);
do
{
CAM_CALDB("[CAM_CAL][iWriteData] Write 0x%x=0x%x \n",u4CurrentOffset, pBuff[0]);
i4RetValue = iWriteCAM_CAL((u16)u4CurrentOffset, 1, pBuff[0]);
if (i4RetValue != 0)
{
CAM_CALDB("[CAM_CAL] I2C iWriteData failed!! \n");
return -1;
}
u4IncOffset ++;
i4ResidueDataLength --;
u4CurrentOffset = ui4_offset + u4IncOffset;
pBuff = pinputdata + u4IncOffset;
}while (i4ResidueDataLength > 0);
CAM_CALDB("[S24CAM_CAL] iWriteData done\n" );
return 0;
}
示例12: iReadCAM_CAL
//Address: 1Byte, Data: 1Byte
int iReadCAM_CAL(u8 a_u2Addr, u32 ui4_length, u8 * a_puBuff, u8 i2c_id)
{
int i4RetValue = 0;
char puReadCmd[1] = {a_u2Addr};
spin_lock(&g_CAM_CALLock); //for SMP
g_pstI2Cclient->addr = i2c_id >> 1;
spin_unlock(&g_CAM_CALLock); // for SMP
//CAM_CALDB("[CAM_CAL] iReadCAM_CAL!! \n");
//CAM_CALDB("[CAM_CAL] i2c_master_send \n");
i4RetValue = i2c_master_send(g_pstI2Cclient, puReadCmd, 1);
if (i4RetValue != 1)
{
CAM_CALDB("[CAM_CAL] I2C send read address failed!! \n");
return -1;
}
//CAM_CALDB("[CAM_CAL] i2c_master_recv \n");
i4RetValue = i2c_master_recv(g_pstI2Cclient, (char *)a_puBuff, ui4_length);
// CAM_CALDB("[CAM_CAL][iReadCAM_CAL] Read 0x%x=0x%x \n", a_u2Addr, a_puBuff[0]);
if (i4RetValue != ui4_length)
{
CAM_CALDB("[CAM_CAL] I2C read data failed!! \n");
return -1;
}
//CAM_CALDB("[CAM_CAL] iReadCAM_CAL done!! \n");
return 0;
}
示例13: iReadCAM_CAL
/* maximun read length is limited at "I2C_FIFO_SIZE" in I2c-mt65xx.c which is 8 bytes */
int iReadCAM_CAL(u16 a_u2Addr, u32 ui4_length, u8 *a_puBuff)
{
int i4RetValue = 0;
char puReadCmd[2] = {(char)(a_u2Addr >> 8) , (char)(a_u2Addr & 0xFF)};
/* CAM_CALDB("[CAM_CAL] iReadCAM_CAL!!\n"); */
if (ui4_length > 8) {
CAM_CALDB("[CAM_CAL] exceed I2c-mt65xx.c 8 bytes limitation\n");
return -1;
}
spin_lock(&g_CAM_CALLock); /* for SMP */
g_pstI2Cclient->addr = g_pstI2Cclient->addr & (I2C_MASK_FLAG | I2C_WR_FLAG);
spin_unlock(&g_CAM_CALLock); /* for SMP */
/* CAM_CALDB("[EERPOM] i2c_master_send\n"); */
i4RetValue = i2c_master_send(g_pstI2Cclient, puReadCmd, 2);
if (i4RetValue != 2) {
CAM_CALDB("[CAM_CAL] I2C send read address failed!!\n");
return -1;
}
/* CAM_CALDB("[EERPOM] i2c_master_recv\n"); */
i4RetValue = i2c_master_recv(g_pstI2Cclient, (char *)a_puBuff, ui4_length);
if (i4RetValue != ui4_length) {
CAM_CALDB("[CAM_CAL] I2C read data failed!!\n");
return -1;
}
spin_lock(&g_CAM_CALLock); /* for SMP */
g_pstI2Cclient->addr = g_pstI2Cclient->addr & I2C_MASK_FLAG;
spin_unlock(&g_CAM_CALLock); /* for SMP */
/* CAM_CALDB("[CAM_CAL] iReadCAM_CAL done!!\n"); */
return 0;
}
示例14: iReadCAM_CAL
//Address: 2Byte, Data: 1Byte
int iReadCAM_CAL(u16 a_u2Addr, u32 ui4_length, u8 * a_puBuff)
{
int i4RetValue = 0;
char puReadCmd[2] = {(char)(a_u2Addr >> 8) , (char)(a_u2Addr & 0xFF)};
//CAM_CALDB("[CAM_CAL] iReadCAM_CAL!! \n");
//CAM_CALDB("[CAM_CAL] i2c_master_send \n");
i4RetValue = i2c_master_send(g_pstI2Cclient, puReadCmd, 2);
if (i4RetValue != 2)
{
CAM_CALDB("[CAM_CAL] I2C send read address failed!! \n");
return -1;
}
//CAM_CALDB("[CAM_CAL] i2c_master_recv \n");
i4RetValue = i2c_master_recv(g_pstI2Cclient, (char *)a_puBuff, ui4_length);
CAM_CALDB("[CAM_CAL][iReadCAM_CAL] Read 0x%x=0x%x \n", a_u2Addr, a_puBuff[0]);
if (i4RetValue != ui4_length)
{
CAM_CALDB("[CAM_CAL] I2C read data failed!! \n");
return -1;
}
//CAM_CALDB("[CAM_CAL] iReadCAM_CAL done!! \n");
return 0;
}
示例15: get_module_type
static int get_module_type()
{
int ret = 0;
u8 module_id = 0;
u8 program_id = 0;
u16 puSendCmd = 0x09; /* module id reg addr = 0x09 for s5k3l2xx liteon module */
ret = iReadCAM_CAL(0x02 , 1, &program_id, S5K3L2XXOTP_LITEON_DEVICE_ID); //read 0x02,if equal to 0x4d,primax module,otherwise,liteon module
ret = iReadCAM_CAL(puSendCmd , 1, &module_id, S5K3L2XXOTP_LITEON_DEVICE_ID);
if (!((ret < 0) || (module_id != 0x01) || (program_id == 0x4D))){
CAM_CALDB("[CAM_CAL]Get s5k3l2xx module type: liteon\n");
return LITEON_MODULE;
}
/* module id reg addr = 0x01 for s5k3l2xx primax module */
puSendCmd = 0x01;
ret = iReadCAM_CAL(puSendCmd ,1, &module_id, S5K3L2XXOTP_PRIMAX_DEVICE_ID);
if (!((ret < 0) || (module_id != 0x03) || (program_id != 0x4D))){
CAM_CALDB("[CAM_CAL]Get s5k3l2xx module type: primax\n");
return PRIMAX_MODULE;
}
CAM_CALDB("[CAM_CAL] get module type: no support main camera module! \n");
return -ENODEV;
}