Hi Pavel,
During the boot up ,we can see the I2C clock is 100kHz.But we want the clock more higher.
Do you tell me where to change the i2c clock?
Thank you .
"omap_i2c omap_i2c.3: bus 3 rev4.0 at 100 kHz"
BR
Bob
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi Pavel,
During the boot up ,we can see the I2C clock is 100kHz.But we want the clock more higher.
Do you tell me where to change the i2c clock?
Thank you .
"omap_i2c omap_i2c.3: bus 3 rev4.0 at 100 kHz"
BR
Bob
Hi Pavel,
Do like this?
static inline void ti814x_enable_i2c2(void)
{
struct clk *fclk;
unsigned long rate,rounded_rate;
struct clk *clk;
int ret;
fclk = clk_get(NULL, "i2c3_fck");
if (!IS_ERR(fclk))
clk_enable(fclk);
else
printk(KERN_WARNING "clk get on i2c3 fck failed\n");
rate = clk_get_rate(clk);
rounded_rate = clk_round_rate(clk, 400000);
ret = clk_set_rate(clk, rounded_rate);
}
BR
Bob
Bob,
bob lee said:"omap_i2c omap_i2c.3: bus 3 rev4.0 at 100 kHz"
This is the clock frequency at the i2c2_scl pin. While i2c3_fck is 48MHz and i2c3_ick is 100MHz. So you need to change the frequency at the i2c2_scl pin from 100KHz to 400KHz?
BR
Pavel
Pavel Botev said:bob lee"omap_i2c omap_i2c.3: bus 3 rev4.0 at 100 kHz"
In case this is what you want (400KHz on i2c-3 i2c2_scl pin), you can modify the linux kernel as below:
linux-kernel/arch/arm/mach-omap2/board-ti8148evm.c
static void __init ti814x_evm_i2c_init(void)
{
/* There are 4 instances of I2C in TI814X but currently only one
* instance is being used on the TI8148 EVM
*/
omap_register_i2c_bus(1, 100, ti814x_i2c_boardinfo,
ARRAY_SIZE(ti814x_i2c_boardinfo));
omap_register_i2c_bus(3, 400, ti814x_i2c_boardinfo1, -----> change second argument from 100 to 400
ARRAY_SIZE(ti814x_i2c_boardinfo1));
}
Thus during boot up I have:
omap_i2c omap_i2c.3: bus 3 rev4.0 at 400 kHz
For more information regarding how to calculate the frequency on the I2C SCL pin (100KHz for standard mode and 400KHz for fast mode) see the below resources:
DM814x TRM, sections 15.2.8 Prescaler (SCLK/ICLK) and 15.2.14.1 Module Configuration Before Enabling the Module
linux-kernel/arch/arm/plat-omap/i2c.c file, function omap_register_i2c_bus(int bus_id, u32 clkrate, struct i2c_board_info const *info, unsigned len)
Regards,
Pavel
bob lee said:I have set it sucCessfully according to your post.
Then why you click on the "Suggest Answer" button instead of the "Verify Answer" button???
Hi Pavel,
Can you please tell me i2c4 clock (i2c3 according to dm385 datasheet, i2c4 as per kernel).Thanks in advance.
Regards
Bhargav