I2C Problem (Two devices)

Hi All,

I am using Ep9302 and Linux2.6.8. There are two devices on my I2C Bus: cs8416(Address:0x17) & cs8406 (Address : 0x10). I can access(read and write) cs8416 very well . But I can not read or write the cs8406. Can you give me some help ?

Thanks

FengYi

There are some code when I access the cs8416. It works.

i2c_dev = open("/dev/i2c", O_RDWR);
if (i2c_dev < 0) {
printf("Can't open /dev/i2c . \n");
return -1;
}
printf("/dev/i2c device has been open . \n");

........
if (ioctl(i2c_dev,I2C_SLAVE,cs8416_address) < 0)
{
printf("Cant specify the cs8416_address 0x%02x .\n",0x17);
return -1;
}

if(i2c_smbus_write_byte_data(i2c_dev, cs8416_control0, 0x08)<0)
{printf("set cs8416_control0 error! \n");return -1;}
if(i2c_smbus_write_byte_data(i2c_dev, cs8416_control1, 0x88)<0)
{printf("set cs8416_control1 error! \n");return -1;}