[U-Boot] [PATCH] i2c: Fix i2c speed command

Jagan Teki jagannadh.teki at gmail.com
Sat Dec 14 05:52:44 CET 2013


On Sat, Dec 14, 2013 at 2:27 AM, Darwin Rambo <drambo at broadcom.com> wrote:
> This corrects i2c core to interpret the value returned by
> i2c_set_bus_speed as a success indicator rather than the
> actual speed that was set. When i2c_set_bus_speed returns
> a failure code, the speed is unknown so the adapter speed
> is set to zero.
>
> Signed-off-by: Darwin Rambo <drambo at broadcom.com>
> Reviewed-by: Tim Kryger <tim.kryger at linaro.org>
> Reviewed-by: Steve Rae <srae at broadcom.com>
> ---
>  drivers/i2c/i2c_core.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/i2c_core.c b/drivers/i2c/i2c_core.c
> index e1767f4..18d6736 100644
> --- a/drivers/i2c/i2c_core.c
> +++ b/drivers/i2c/i2c_core.c
> @@ -349,7 +349,7 @@ unsigned int i2c_set_bus_speed(unsigned int speed)
>                 return 0;
>         ret = I2C_ADAP->set_bus_speed(I2C_ADAP, speed);
>         if (gd->flags & GD_FLG_RELOC)
> -               I2C_ADAP->speed = ret;
> +               I2C_ADAP->speed = (ret == 0) ? speed : 0;
>
>         return ret;
>  }

Acked-by: Jagannadha Sutradharudu Teki <jagannadh.teki at gmail.com>

-- 
Thanks,
Jagan.
--------
Jagannadha Sutradharudu Teki,
E: jagannadh.teki at gmail.com, P: +91-9676773388
Engineer - System Software Hacker
U-boot - SPI Custodian and Zynq APSOC
Ln: http://www.linkedin.com/in/jaganteki


More information about the U-Boot mailing list