All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] FSL I2C driver programs the two I2C busses differently
@ 2007-07-03 18:46 Timur Tabi
  2007-07-03 18:51 ` Grant Likely
  0 siblings, 1 reply; 2+ messages in thread
From: Timur Tabi @ 2007-07-03 18:46 UTC (permalink / raw)
  To: u-boot

The i2c_init() function in fsl_i2c.c programs the two I2C busses differently.
The second I2C bus has its slave address programmed incorrectly and is
missing a 5-us delay.

Signed-off-by: Timur Tabi <timur@freescale.com>
---
 drivers/fsl_i2c.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/fsl_i2c.c b/drivers/fsl_i2c.c
index ebae5af..22485ea 100644
--- a/drivers/fsl_i2c.c
+++ b/drivers/fsl_i2c.c
@@ -69,9 +69,10 @@ i2c_init(int speed, int slaveadd)
 	dev = (struct fsl_i2c *) (CFG_IMMR + CFG_I2C2_OFFSET);
 
 	writeb(0, &dev->cr);			/* stop I2C controller */
+	udelay(5);				/* let it shutdown in peace */
 	writeb(0x3F, &dev->fdr);		/* set bus speed */
 	writeb(0x3F, &dev->dfsrr);		/* set default filter */
-	writeb(slaveadd, &dev->adr);		/* write slave address */
+	writeb(slaveadd << 1, &dev->adr);	/* write slave address */
 	writeb(0x0, &dev->sr);			/* clear status register */
 	writeb(I2C_CR_MEN, &dev->cr);		/* start I2C controller */
 #endif	/* CFG_I2C2_OFFSET */
-- 
1.5.0.2.260.g2eb065

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

* [U-Boot-Users] [PATCH] FSL I2C driver programs the two I2C busses differently
  2007-07-03 18:46 [U-Boot-Users] [PATCH] FSL I2C driver programs the two I2C busses differently Timur Tabi
@ 2007-07-03 18:51 ` Grant Likely
  0 siblings, 0 replies; 2+ messages in thread
From: Grant Likely @ 2007-07-03 18:51 UTC (permalink / raw)
  To: u-boot

On 7/3/07, Timur Tabi <timur@freescale.com> wrote:
> The i2c_init() function in fsl_i2c.c programs the two I2C busses differently.
> The second I2C bus has its slave address programmed incorrectly and is
> missing a 5-us delay.
>
> Signed-off-by: Timur Tabi <timur@freescale.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>

g.
> ---
>  drivers/fsl_i2c.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/fsl_i2c.c b/drivers/fsl_i2c.c
> index ebae5af..22485ea 100644
> --- a/drivers/fsl_i2c.c
> +++ b/drivers/fsl_i2c.c
> @@ -69,9 +69,10 @@ i2c_init(int speed, int slaveadd)
>         dev = (struct fsl_i2c *) (CFG_IMMR + CFG_I2C2_OFFSET);
>
>         writeb(0, &dev->cr);                    /* stop I2C controller */
> +       udelay(5);                              /* let it shutdown in peace */
>         writeb(0x3F, &dev->fdr);                /* set bus speed */
>         writeb(0x3F, &dev->dfsrr);              /* set default filter */
> -       writeb(slaveadd, &dev->adr);            /* write slave address */
> +       writeb(slaveadd << 1, &dev->adr);       /* write slave address */
>         writeb(0x0, &dev->sr);                  /* clear status register */
>         writeb(I2C_CR_MEN, &dev->cr);           /* start I2C controller */
>  #endif /* CFG_I2C2_OFFSET */
> --
> 1.5.0.2.260.g2eb065
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
>


-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195

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

end of thread, other threads:[~2007-07-03 18:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-03 18:46 [U-Boot-Users] [PATCH] FSL I2C driver programs the two I2C busses differently Timur Tabi
2007-07-03 18:51 ` Grant Likely

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.