From b246f7607844ab9a195d1b1003beb5ee1e8b3895 Mon Sep 17 00:00:00 2001 From: Shinya Kuribayashi Date: Wed, 24 Oct 2012 19:58:10 +0900 Subject: [PATCH] --- yaml --- r: 347061 b: refs/heads/master c: ebd5ac165f2aaefb767c53112c2010b0ff3df688 h: refs/heads/master i: 347059: 87a3955428445a743a3b937c938631671f8722ac v: v3 --- [refs] | 2 +- trunk/drivers/i2c/busses/i2c-sh_mobile.c | 5 +++++ trunk/include/linux/i2c/i2c-sh_mobile.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index a3d7d61dee44..195ed107b4f5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 23a612916a51cc3772ff46c9dc34a86c9c50840e +refs/heads/master: ebd5ac165f2aaefb767c53112c2010b0ff3df688 diff --git a/trunk/drivers/i2c/busses/i2c-sh_mobile.c b/trunk/drivers/i2c/busses/i2c-sh_mobile.c index 4dc0cc3611c2..4c283583bea0 100644 --- a/trunk/drivers/i2c/busses/i2c-sh_mobile.c +++ b/trunk/drivers/i2c/busses/i2c-sh_mobile.c @@ -120,6 +120,7 @@ struct sh_mobile_i2c_data { void __iomem *reg; struct i2c_adapter adap; unsigned long bus_speed; + unsigned int clks_per_count; struct clk *clk; u_int8_t icic; u_int8_t flags; @@ -231,6 +232,7 @@ static void sh_mobile_i2c_init(struct sh_mobile_i2c_data *pd) /* Get clock rate after clock is enabled */ clk_enable(pd->clk); i2c_clk_khz = clk_get_rate(pd->clk) / 1000; + i2c_clk_khz /= pd->clks_per_count; if (pd->bus_speed == STANDARD_MODE) { tLOW = 47; /* tLOW = 4.7 us */ @@ -658,6 +660,9 @@ static int sh_mobile_i2c_probe(struct platform_device *dev) pd->bus_speed = STANDARD_MODE; if (pdata && pdata->bus_speed) pd->bus_speed = pdata->bus_speed; + pd->clks_per_count = 1; + if (pdata && pdata->clks_per_count) + pd->clks_per_count = pdata->clks_per_count; /* The IIC blocks on SH-Mobile ARM processors * come with two new bits in ICIC. diff --git a/trunk/include/linux/i2c/i2c-sh_mobile.h b/trunk/include/linux/i2c/i2c-sh_mobile.h index beda7081aead..06e3089795fb 100644 --- a/trunk/include/linux/i2c/i2c-sh_mobile.h +++ b/trunk/include/linux/i2c/i2c-sh_mobile.h @@ -5,6 +5,7 @@ struct i2c_sh_mobile_platform_data { unsigned long bus_speed; + unsigned int clks_per_count; }; #endif /* __I2C_SH_MOBILE_H__ */