How to setup I2C to high speed on modules
时间:10-02
整理:3721RD
点击:
Dear All:
Thx you to watch this.
I want to setup I2C speed to high speed, but always no work,
I had write a modules, and I have a function like this:
int setup_i2c(void)
{
int result = 0;
adapter = i2c_get_adapter(I2C_BUS_NUM);
if (!adapter) {
printk(KERN_ERR "i2c_get_adapter() has failed\n");
return -1;
}
i2c_CLIent = i2c_new_device(adapter, &my_dev_info[0]);
if (!i2c_client) {
printk(KERN_ERR "i2c_new_device() has failed\n");
return -1;
}
if ((result = i2c_add_driver(&blocks_i2c_driver)) < 0) {
printk(KERN_ERR "i2c_add_driver() has failed with error '%d'\n", result);
return result;
}
i2c_client->addr |= I2C_DMA_FLAG;
i2c_client->addr |= I2C_ENEXT_FLAG;
return result;
}
Right now, my I2C speed about 100K,
I had try add
i2c_client->addr |= I2C_HS_FLAG;
but still 100K
I had try
i2c_client->flags |= I2C_HS_FLAG;
and
i2c_client->ext_flag |= I2C_HS_FLAG;
but still 100k no change anything....
have any one have some experence about this?
Thx you to watch this.
I want to setup I2C speed to high speed, but always no work,
I had write a modules, and I have a function like this:
int setup_i2c(void)
{
int result = 0;
adapter = i2c_get_adapter(I2C_BUS_NUM);
if (!adapter) {
printk(KERN_ERR "i2c_get_adapter() has failed\n");
return -1;
}
i2c_CLIent = i2c_new_device(adapter, &my_dev_info[0]);
if (!i2c_client) {
printk(KERN_ERR "i2c_new_device() has failed\n");
return -1;
}
if ((result = i2c_add_driver(&blocks_i2c_driver)) < 0) {
printk(KERN_ERR "i2c_add_driver() has failed with error '%d'\n", result);
return result;
}
i2c_client->addr |= I2C_DMA_FLAG;
i2c_client->addr |= I2C_ENEXT_FLAG;
return result;
}
Right now, my I2C speed about 100K,
I had try add
i2c_client->addr |= I2C_HS_FLAG;
but still 100K
I had try
i2c_client->flags |= I2C_HS_FLAG;
and
i2c_client->ext_flag |= I2C_HS_FLAG;
but still 100k no change anything....
have any one have some experence about this?
路过看看
