hi ,experts:
I am using DM355 with kernel 2.6.10(MVL4.0).
I have connected a tsc2007 to the I2C.
these are my driver code:
static int tsc2007_read (struct tsc2007 *data, u8 cmd)
{
u8 command_byte;
u16 value = 0;
u32 stat = 0;
struct i2c_client *new_client = data->client;
// Command byte to be sent based on the structure data values
command_byte = cmd;
stat = i2c_master_send (new_client, &command_byte, BYTES_TO_TX);
if (stat != BYTES_TO_TX)
printk ("unable to send %#x command: %s\n",
command_byte, __FUNCTION__);
// Receive 2 bytes of data for 12 bit mode and 1 byte for 8 bit mode
stat = i2c_master_recv (new_client, (u8 *) & value, BYTES_TO_RX);
if (stat != BYTES_TO_RX)
printk ("unable to receive data: %s\n", __FUNCTION__);
return value;
}
static int tsc2007_write (struct tsc2007 *data, u8 cmd)
{
u8 command_byte;
u32 stat = 0;
struct i2c_client *new_client = data->client;
// Command byte to be sent based on the structure data values
command_byte = cmd;
stat = i2c_master_send (new_client, &command_byte, BYTES_TO_TX);
if (stat != BYTES_TO_TX)
{
printk ("unable to send %#x command: %s\n",
command_byte, __FUNCTION__);
return -1;
}
return stat;
}
actually it is from TI's driver.
However, when I write to tsc2007,it responses correctly .
But when I read it, there is a error:
DAVINCI I2C Warning: timeout waiting for bus ready
I have googled it, but found none is for kernel2.6.10. How can i fix this bug? or can someone show me where the patch is?
thanks.