[U-Boot] [PATCH v3 06/11] SPEAr : i2c driver support addded

Heiko Schocher hs at denx.de
Mon Jan 11 10:44:09 CET 2010


Hello Vipin,

Vipin KUMAR wrote:
> Signed-off-by: Vipin <vipin.kumar at st.com>
> ---
>  drivers/i2c/Makefile                 |    1 +
>  drivers/i2c/spr_i2c.c                |  340 ++++++++++++++++++++++++++++++++++
>  include/asm-arm/arch-spear/spr_i2c.h |  146 +++++++++++++++
>  include/configs/spear.h              |   11 +
>  4 files changed, 498 insertions(+), 0 deletions(-)
>  mode change 100644 => 100755 drivers/i2c/Makefile
>  create mode 100755 drivers/i2c/spr_i2c.c
>  create mode 100755 include/asm-arm/arch-spear/spr_i2c.h
> 
[...]
> diff --git a/drivers/i2c/spr_i2c.c b/drivers/i2c/spr_i2c.c
> new file mode 100755
> index 0000000..497ca47
> --- /dev/null
> +++ b/drivers/i2c/spr_i2c.c
[...]
> +/*
> + * i2c_set_bus_speed - Set the i2c speed
> + * @speed:	required i2c speed
> + *
> + * Set the i2c speed.
> + */
> +void i2c_set_bus_speed(int speed)
> +{
> +	if (speed >= I2C_MAX_SPEED) {
> +		set_speed(IC_SPEED_MODE_MAX);

No brackets for single statement, please,

> +

blank line not needed here.

> +	} else if (speed >= I2C_FAST_SPEED) {
> +		set_speed(IC_SPEED_MODE_FAST);
> +

same as above.

> +	} else {
> +		set_speed(IC_SPEED_MODE_STANDARD);
> +	}
> +}
> +
> +/*
> + * i2c_get_bus_speed - Gets the i2c speed
> + *
> + * Gets the i2c speed.
> + */
> +int i2c_get_bus_speed(void)
> +{
> +	u32 cntl;
> +
> +	cntl = (readl(&i2c_regs_p->ic_con) & IC_CON_SPD_MSK);
> +
> +	if (cntl == IC_CON_SPD_HS) {
> +		return I2C_MAX_SPEED;
> +

here too, please fix globally.

[...]

If you fix this small Coding Style issues, you get my:

Acked-by: Heiko Schocher<hs at denx.de>

thanks!

bye
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


More information about the U-Boot mailing list