]> git.baikalelectronics.ru Git - kernel.git/commit
i2c-bfin-twi: fix CLKDIV calculation
authorSonic Zhang <sonic.zhang@analog.com>
Mon, 21 Dec 2009 14:28:30 +0000 (09:28 -0500)
committerBen Dooks <ben-linux@fluff.org>
Thu, 24 Dec 2009 01:24:48 +0000 (01:24 +0000)
commitd157c398779f286aee2634945501abbd78623bf2
tree9a3e6149726b63a74d141bb4fe86b7fb3399435f
parentb93421e0607ce3731ad4f0af9d8573118978591e
i2c-bfin-twi: fix CLKDIV calculation

Calculation of the CLKDIV speed setting should be done using base 10 math
rather than base 2.  We also avoid exceeding the spec due to integer
truncation and a 50% duty cycle.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
drivers/i2c/busses/i2c-bfin-twi.c