mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-27 17:41:34 +00:00
i2c: rcar_i2c: Setup SCL/SDA delay at rcar_i2c_set_speed
Setting up the delay only needs to be done once; move it to rcar_i2c_set_speed so it's done at initialization time. Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com> Reviewed-by: Marek Vasut <marek.vasut+renesas@gmail.com> Reviewed-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
parent
bc00512438
commit
4fcff08c4b
1 changed files with 6 additions and 3 deletions
|
@ -116,9 +116,7 @@ static int rcar_i2c_set_addr(struct udevice *dev, u8 chip, u8 read)
|
||||||
writel(0, priv->base + RCAR_I2C_ICMSR);
|
writel(0, priv->base + RCAR_I2C_ICMSR);
|
||||||
writel(priv->icccr, priv->base + RCAR_I2C_ICCCR);
|
writel(priv->icccr, priv->base + RCAR_I2C_ICCCR);
|
||||||
|
|
||||||
if (priv->type == RCAR_I2C_TYPE_GEN3)
|
/* Wait for the bus */
|
||||||
writel(RCAR_I2C_ICFBSCR_TCYC17, priv->base + RCAR_I2C_ICFBSCR);
|
|
||||||
|
|
||||||
ret = wait_for_bit_le32(priv->base + RCAR_I2C_ICMCR,
|
ret = wait_for_bit_le32(priv->base + RCAR_I2C_ICMCR,
|
||||||
RCAR_I2C_ICMCR_FSDA, false, 2, true);
|
RCAR_I2C_ICMCR_FSDA, false, 2, true);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
@ -304,6 +302,11 @@ scgd_find:
|
||||||
priv->icccr = (scgd << RCAR_I2C_ICCCR_SCGD_OFF) | cdf;
|
priv->icccr = (scgd << RCAR_I2C_ICCCR_SCGD_OFF) | cdf;
|
||||||
writel(priv->icccr, priv->base + RCAR_I2C_ICCCR);
|
writel(priv->icccr, priv->base + RCAR_I2C_ICCCR);
|
||||||
|
|
||||||
|
if (priv->type == RCAR_I2C_TYPE_GEN3) {
|
||||||
|
/* Set SCL/SDA delay */
|
||||||
|
writel(RCAR_I2C_ICFBSCR_TCYC17, priv->base + RCAR_I2C_ICFBSCR);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue