[U-Boot] [PATCH v2 1/6] i2c: rcar_i2c: Setup SCL/SDA delay at rcar_i2c_set_speed

Marek Vasut marek.vasut at gmail.com
Tue Mar 5 18:25:41 UTC 2019


On 3/5/19 12:16 PM, Ismael Luceno Cortes wrote:
> It only needs to be done once.

As much as I hate to do it, I need to ask you to reword the commit
message again.

When I look at just the commit message and I read "It only needs to be
done once.", I literally have no clue what the change does. I need to
look into the patch.

> Signed-off-by: Ismael Luceno <ismael.luceno at silicon-gears.com>
> ---
>  drivers/i2c/rcar_i2c.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/i2c/rcar_i2c.c b/drivers/i2c/rcar_i2c.c
> index 10b0f8bad4..74643b085e 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,10 @@ 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);

Please add brackets around the multi-line code, so it's obvious what is
in the if conditional and what is not.

>  	return 0;
>  }
>  
> 
> base-commit: f08023c07d826fbc8e62fdd3367961b2f0b06844
> prerequisite-patch-id: 9e5b0458bc15640eb483ccad91dbe85150f9f7be
> 


-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list