static u32 __inline__ show_ov9650_product_id(void) { u32 pid; pid = sccb_read(OV9650_SCCB_ADDR, 0x0a)<<8; pid |= sccb_read(OV9650_SCCB_ADDR, 0x0b); printk("SCCB address 0x%02X, product ID 0x%04X, expect 0x%04X\n", OV9650_SCCB_ADDR, pid, OV9650_PRODUCT_ID); return pid; }
static int __inline__ ov9650_check(void) { u32 mid; mid = sccb_read(OV9650_SCCB_ADDR, 0x1c)<<8; mid |= sccb_read(OV9650_SCCB_ADDR, 0x1d); printk("SCCB address 0x%02X, manufacture ID 0x%04X, expect 0x%04X\n", OV9650_SCCB_ADDR, mid, OV9650_MANUFACT_ID); return (mid==OV9650_MANUFACT_ID)?1:0; }
static gint32 ov7725_get_reg(gint daddr) { struct sccb_data dat; gboolean ret; dat.daddr[0] = daddr; dat.daddr[1] = CAMCTRL_PARAM_DADDR_TERM; ret = sccb_read(&dat); if (ret == FALSE) return -1; return dat.val; }
//------------------------------------------------------------------- uint8_t I2C_ReadByte ( uint8_t SlaveAddr, uint8_t RegAddr ) { #if 0 return sccb_read(SlaveAddr, RegAddr); #else uint8_t Data = 0; I2CSendAddr(SlaveAddr,WRITE); I2CSendByte(RegAddr); I2CSendAddr (SlaveAddr,READ); I2CGetByte(LAST_BYTE, &Data); I2CSendStop(); return Data; #endif }