//Address: 2Byte, Data: 1Byte
static int iWriteCAM_CAL(u16 a_u2Addr  , u32 a_u4Bytes, u8 puDataInBytes)
{   
    #if 0
    int  i4RetValue = 0;
	int retry = 3;
    char puSendCmd[3] = {(char)(a_u2Addr >> 8) , (char)(a_u2Addr & 0xFF) ,puDataInBytes};
	g_pstI2Cclient->addr = (IMX214OTP_DEVICE_ID>> 1);

	do {
        CAM_CALDB("[CAM_CAL][iWriteCAM_CAL] Write 0x%x=0x%x \n",a_u2Addr, puDataInBytes);
		i4RetValue = i2c_master_send(g_pstI2Cclient, puSendCmd, 3);
        if (i4RetValue != 3) {
            CAM_CALDB("[CAM_CAL] I2C send failed!!\n");
        }
        else {
            break;
    	}
        mdelay(10);
    } while ((retry--) > 0);    
   //CAM_CALDB("[CAM_CAL] iWriteCAM_CAL done!! \n");
   #else
   CAM_CALDB("[CAM_CAL][iWriteCAM_CAL] Write 0x%x=0x%x \n",a_u2Addr, puDataInBytes);
   iWriteReg(a_u2Addr,puDataInBytes,1,IMX214OTP_DEVICE_ID);
   #endif
   return 0;
}
Exemple #2
0
static void MT9P015_write_cmos_sensor_16Bit(kal_uint16 addr, kal_uint16 para)
{
  kal_int32 rt;
  rt = iWriteReg(addr, para, sizeof(para), MT9P015_sensor.write_id);
#ifdef __MT9P015_DEBUG_TRACE__
  if (rt < 0) printk("[MT9P015] I2C 16 bit write %x, %x error\n", addr, para);
#endif
}
Exemple #3
0
int s4OV8850AF_write_byte( u8 addr, u8 data)
{
#if 1
	u8 buf[] = {addr, data};
	int ret = 0;

	ret = i2c_master_send(g_pstOV8850AF_I2Cclient, (const char*)buf, sizeof(buf));
	if (ret < 0) {
	    OV8850AFDB("s4OV8850AF_write_byte send data error!!   ret=%d\n",ret);
	    return -EFAULT;
	}

	return 0;
#else
	int  i4RetValue = 0;
	i4RetValue = iWriteReg(addr,(u32)data,1,OV8850AF_VCM_WRITE_ID);
	if (i4RetValue < 0) {
	    OV8850AFDB("s4OV8850AF_write_byte  send data error!!   i4RetValue=%d\n",i4RetValue);
	    return -EFAULT;
	}
	return 0;
#endif
}