All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v3 1/6] i2c: rcar_i2c: Setup SCL/SDA delay at rcar_i2c_set_speed
@ 2019-03-06 10:46 Ismael Luceno Cortes
  2019-03-06 10:46 ` [U-Boot] [PATCH v3 2/6] i2c: rcar_i2c: Add comments about registers & values Ismael Luceno Cortes
                   ` (7 more replies)
  0 siblings, 8 replies; 24+ messages in thread
From: Ismael Luceno Cortes @ 2019-03-06 10:46 UTC (permalink / raw)
  To: u-boot

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>
---
 drivers/i2c/rcar_i2c.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/rcar_i2c.c b/drivers/i2c/rcar_i2c.c
index 10b0f8bad4..a57f72a228 100644
--- a/drivers/i2c/rcar_i2c.c
+++ b/drivers/i2c/rcar_i2c.c
@@ -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(priv->icccr, priv->base + RCAR_I2C_ICCCR);
 
-	if (priv->type == RCAR_I2C_TYPE_GEN3)
-		writel(RCAR_I2C_ICFBSCR_TCYC17, priv->base + RCAR_I2C_ICFBSCR);
-
+	/* Wait for the bus */
 	ret = wait_for_bit_le32(priv->base + RCAR_I2C_ICMCR,
 				RCAR_I2C_ICMCR_FSDA, false, 2, true);
 	if (ret) {
@@ -304,6 +302,11 @@ scgd_find:
 	priv->icccr = (scgd << RCAR_I2C_ICCCR_SCGD_OFF) | cdf;
 	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;
 }
 

base-commit: f08023c07d826fbc8e62fdd3367961b2f0b06844
prerequisite-patch-id: 9e5b0458bc15640eb483ccad91dbe85150f9f7be
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2019-03-07 12:15 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-06 10:46 [U-Boot] [PATCH v3 1/6] i2c: rcar_i2c: Setup SCL/SDA delay at rcar_i2c_set_speed Ismael Luceno Cortes
2019-03-06 10:46 ` [U-Boot] [PATCH v3 2/6] i2c: rcar_i2c: Add comments about registers & values Ismael Luceno Cortes
2019-03-06 12:40   ` Marek Vasut
2019-03-07  4:54   ` Heiko Schocher
2019-03-06 10:46 ` [U-Boot] [PATCH v3 3/6] i2c: rcar_i2c: Fix sending of slave addresses Ismael Luceno Cortes
2019-03-06 12:40   ` Marek Vasut
2019-03-07  4:55   ` Heiko Schocher
2019-03-06 10:46 ` [U-Boot] [PATCH v3 4/6] i2c: rcar_i2c: Don't mask errors with EREMOTEIO at rcar_i2c_xfer Ismael Luceno Cortes
2019-03-06 12:40   ` Marek Vasut
2019-03-07  4:55   ` Heiko Schocher
2019-03-06 10:46 ` [U-Boot] [PATCH v3 5/6] i2c: rcar_i2c: Set the slave address from rcar_i2c_xfer Ismael Luceno Cortes
2019-03-06 12:41   ` Marek Vasut
2019-03-07  4:56   ` Heiko Schocher
2019-03-06 10:46 ` [U-Boot] [PATCH v3 6/6] i2c: rcar_i2c: Move FSDA check to rcar_i2c_recover Ismael Luceno Cortes
2019-03-06 12:41   ` Marek Vasut
2019-03-07  4:57   ` Heiko Schocher
2019-03-07 11:59   ` Heiko Schocher
2019-03-07 12:15     ` Ismael Luceno Cortes
2019-03-06 12:39 ` [U-Boot] [PATCH v3 1/6] i2c: rcar_i2c: Setup SCL/SDA delay at rcar_i2c_set_speed Marek Vasut
2019-03-07  4:53 ` Heiko Schocher
2019-03-07  5:14 ` Heiko Schocher
2019-03-07  8:04   ` Marek Vasut
2019-03-07  8:17     ` Heiko Schocher
2019-03-07  8:29       ` Marek Vasut

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.