summaryrefslogtreecommitdiff
path: root/drivers/i2c/lpc32xx_i2c.c
diff options
context:
space:
mode:
authorSylvain Lemieux <slemieux@tycoint.com>2015-07-27 13:37:37 -0400
committerTom Rini <trini@konsulko.com>2015-08-17 08:11:49 -0400
commitb395a996a65572a5e64d648ac4dc4d43a53ea38b (patch)
tree3a9991050f74b264317c3773fc2d490eb1d067fd /drivers/i2c/lpc32xx_i2c.c
parent2783fe6903f58e4d18ba72f044fa9ebffc6df810 (diff)
downloadu-boot-imx-b395a996a65572a5e64d648ac4dc4d43a53ea38b.zip
u-boot-imx-b395a996a65572a5e64d648ac4dc4d43a53ea38b.tar.gz
u-boot-imx-b395a996a65572a5e64d648ac4dc4d43a53ea38b.tar.bz2
i2c: lpc32xx: use api to get hclk instead of fix value
The HCLK is not constant and can take different value; use the api function to get the value of the HCLK for the I2C clock high and low computation. Signed-off-by: Sylvain Lemieux <slemieux@tycoint.com>
Diffstat (limited to 'drivers/i2c/lpc32xx_i2c.c')
-rw-r--r--drivers/i2c/lpc32xx_i2c.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/lpc32xx_i2c.c b/drivers/i2c/lpc32xx_i2c.c
index 78d26e4..98106fa 100644
--- a/drivers/i2c/lpc32xx_i2c.c
+++ b/drivers/i2c/lpc32xx_i2c.c
@@ -72,7 +72,7 @@ static unsigned int lpc32xx_i2c_set_bus_speed(struct i2c_adapter *adap,
if (speed == 0)
return -EINVAL;
- half_period = (105000000 / speed) / 2;
+ half_period = (get_hclk_clk_rate() / speed) / 2;
if ((half_period > 255) || (half_period < 0))
return -EINVAL;