diff options
author | Aaro Koskinen <aaro.koskinen@nokia.com> | 2009-05-27 10:54:46 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2009-06-13 05:39:26 -0400 |
commit | 84bf2c868f3ca996e5bbd3beb2ef502f457140f3 (patch) | |
tree | cd35bf618469195161f2711b465dd63a50647054 | |
parent | baf46b4e378d7950dff7ba30cfd50ff585987cb4 (diff) |
i2c: OMAP3: Better noise suppression for fast/standard modes
Use longer noise filter period for fast and standard mode. Based on an
earlier patch by Eero Nurkkala.
Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
-rw-r--r-- | drivers/i2c/busses/i2c-omap.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index a879e4bf5122..c73475dd0fba 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c | |||
@@ -333,8 +333,18 @@ static int omap_i2c_init(struct omap_i2c_dev *dev) | |||
333 | 333 | ||
334 | if (cpu_is_omap2430() || cpu_is_omap34xx()) { | 334 | if (cpu_is_omap2430() || cpu_is_omap34xx()) { |
335 | 335 | ||
336 | /* HSI2C controller internal clk rate should be 19.2 Mhz */ | 336 | /* |
337 | internal_clk = 19200; | 337 | * HSI2C controller internal clk rate should be 19.2 Mhz for |
338 | * HS and for all modes on 2430. On 34xx we can use lower rate | ||
339 | * to get longer filter period for better noise suppression. | ||
340 | * The filter is iclk (fclk for HS) period. | ||
341 | */ | ||
342 | if (dev->speed > 400 || cpu_is_omap_2430()) | ||
343 | internal_clk = 19200; | ||
344 | else if (dev->speed > 100) | ||
345 | internal_clk = 9600; | ||
346 | else | ||
347 | internal_clk = 4000; | ||
338 | fclk_rate = clk_get_rate(dev->fclk) / 1000; | 348 | fclk_rate = clk_get_rate(dev->fclk) / 1000; |
339 | 349 | ||
340 | /* Compute prescaler divisor */ | 350 | /* Compute prescaler divisor */ |