Skip to contentSkip to conversation

i2c: lpc32xx: use api to get hclk instead of fix value

PATCH New slemieux.tyco at gmail.com 2 participants 2 messages Jul 27, 2015 – Aug 13, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/7 i2c: lpc32xx: use api to get hclk instead of fix value

From: Sylvain Lemieux <[email protected]>

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.

---
 drivers/i2c/lpc32xx_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/lpc32xx_i2c.c +1 -1
index 78d26e4..98106fa 100644
@@ -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;
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 4/7 i2c: lpc32xx: use api to get hclk instead of fix value

Quoted 5 lines · slemieux.tyco at gmail.com

From: Sylvain Lemieux <[email protected]>

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150813/ed328809/attachment.sig>