[U-Boot] [PATCH v3] ARMV7: OMAP: I2C driver: Write more than 1 byte at a time in i2c_write

Heiko Schocher hs at denx.de
Mon Aug 1 11:12:43 CEST 2011


Hello Michael,

Michael Jones wrote:
> This allows the EEPROM layer to send a single i2c write command
> per page, and wait CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS between
> i2c write commands.
> 
> Signed-off-by: Michael Jones <michael.jones at matrix-vision.de>
> ---
> Changes for v3:
>   - Rewrote error messages to be more descriptive.
> 
> Changes for v2:
>   - None. Resubmitting to include custodian in cc:
> 
>  drivers/i2c/omap24xx_i2c.c |  135 ++++++++++++++++++-------------------------
>  1 files changed, 57 insertions(+), 78 deletions(-)

Doing a "MAKEALL" for the omap boards throws following
warning:

Configuring for cm_t35 board...
omap24xx_i2c.c: In function 'i2c_write':
omap24xx_i2c.c:314: warning: too few arguments for format
   text    data     bss     dec     hex filename
 287288    8156  221036  516480   7e180 ./u-boot
Configuring for omap3_overo board...
omap24xx_i2c.c: In function 'i2c_write':
omap24xx_i2c.c:314: warning: too few arguments for format
   text    data     bss     dec     hex filename
 256804    7556  212180  476540   7457c ./u-boot
Configuring for omap3_pandora board...
omap24xx_i2c.c: In function 'i2c_write':
omap24xx_i2c.c:314: warning: too few arguments for format
   text    data     bss     dec     hex filename
 366033    7956  206620  580609   8dc01 ./u-boot
[...]

Please fix!

> 
> diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c
> index 966ffc4..19e024d 100644
> --- a/drivers/i2c/omap24xx_i2c.c
> +++ b/drivers/i2c/omap24xx_i2c.c
[...]
> @@ -372,26 +301,76 @@ int i2c_read (uchar chip, uint addr, int alen, uchar * buffer, int len)
>  int i2c_write (uchar chip, uint addr, int alen, uchar * buffer, int len)
>  {
>  	int i;
> +	u16 status;
> +	int i2c_error = 0;
>  
>  	if (alen > 1) {
> -		printf ("I2C read: addr len %d not supported\n", alen);
> +		printf("I2C write: addr len %d not supported\n", alen);
>  		return 1;
>  	}
>  
>  	if (addr + len > 256) {
> -		printf ("I2C read: address out of range\n");
> +		printf("I2C write: address 0x%x + 0x%x out of range\n");
                                           ^^^^   ^^^^

missing Arguments here!

@Sandeep Paulraj, beside of that warning, could you Ack/Nack this patch,
so I can apply this patch to u-boot-i2c, or do you pick up this patch?

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