I have a mt9t001 cmos sensor connected to the 355evm,and I have set the right environment:
bootdelay=3
baudrate=115200
ethaddr=02:00:00:00:00:00
filesize=1e0d08
fileaddr=80700000
ipaddr=192.168.1.3
nfshost=192.168.1.5
rootpath=/home/brdsp/workdir/filesys
serverip=192.168.1.5
bootfile=uImage-dm355
bootcmd=tftp;bootm
bootargs=console=ttyS0,115200n8 noinitrd rw ip=192.168.1.3:192.168.1.1:192.168.1.1:255.255.255.0 root=/dev/nfs nfsroot=192.168.1.5:/home/brdsp/workdir/filesys,nolock mem=116M v4l2_video_capture=device:MT9T001
when I boot ,the following error displayed:
RAR detected
DaVinci I2C WARNING: i2c: NACK detected
DaVinci I2C WARNING: i2c: RAR detected
DaVinci I2C WARNING: i2c: NACK detected
DaVinci I2C WARNING: i2c: RAR detected
DaVinci I2C WARNING: i2c: NACK detected
DaVinci I2C WARNING: i2c: RAR detected
DaVinci I2C WARNING: i2c: NACK detected
DaVinci I2C WARNING: i2c: RAR detected
DaVinci I2C WARNING: i2c: NACK detected
DaVinci I2C WARNING: i2c: RAR detected
DaVinci I2C WARNING: i2c: NACK detected
DaVinci I2C WARNING: i2c: RAR detected..................
So I decided to look out what wrong, and I checked my cmos sensor board,didn't found anything wrong .Then,I traced into the driver mt9t001.c,and I found that in function i2c_write_reg(),at the following codes:
}else if (configdev == MT9T001_I2C_CONFIG) {
msg->addr = client->addr;
msg->flags = 0;
msg->len = I2C_THREE_BYTE_TRANSFER;
msg->buf = data;
data[0] = reg;
data[1] = (val & I2C_TXRX_DATA_MASK_UPPER) >>I2C_TXRX_DATA_SHIFT;
data[2] = (val & I2C_TXRX_DATA_MASK);
err = i2c_transfer(client->adapter, msg, 1);
the code:msg->addr=client->addr,I am a little confused:client is a parameter of i2c_write_reg,and in fact it's i2c_write_reg(&mt9t001_i2c_client, MT9T001_ROW_START, MT9T001_ROW_START_DEFAULT, MT9T001_I2C_CONFIG);
And mt9t001_i2c_client is :static struct i2c_client mt9t001_i2c_client;
I have serach the whole linux kernel ,didn't found anywhere that gived value to mt9t001_i2c_client.addr.
So my question is ,since i2c_write_reg() is writing value to mt9t001,why there's no address?