From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] Powerpc/i2c: Force i2c to become bus master out of reset
Date: Thu, 27 Oct 2011 08:36:34 +0200 [thread overview]
Message-ID: <4EA8FBF2.9000409@denx.de> (raw)
In-Reply-To: <1319678979-23491-2-git-send-email-Chang-Ming.Huang@freescale.com>
Hello Chang-Ming,
Chang-Ming.Huang at freescale.com wrote:
> From: Jerry Huang <Chang-Ming.Huang@freescale.com>
>
> It is sometimes necessary to force the I2C module to become the I2C bus master
> out of reset and drive SCL(even though SDA may already be driven,
> which indicates that the bus is busy). This can occur when a system reset
> does not cause all I2C devices to be reset. Thus, SDA can be driven low
> by another I2C device while this I2C module is coming out of reset
> and stays low indefinitely. The following procedure can be used to
> force this I2C module to generate SCL so that the device driving SDA
> can finish its transaction.
>
> Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
> ---
> drivers/i2c/fsl_i2c.c | 18 ++++++++++++++++++
> 1 files changed, 18 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c
> index 258be0a..007db70 100644
> --- a/drivers/i2c/fsl_i2c.c
> +++ b/drivers/i2c/fsl_i2c.c
> @@ -252,6 +252,24 @@ i2c_init(int speed, int slaveadd)
> writeb(slaveadd << 1, &dev->adr);/* write slave address */
> writeb(0x0, &dev->sr); /* clear status register */
> writeb(I2C_CR_MEN, &dev->cr); /* start I2C controller */
> +
> + /* Force I2C module to become bus master which can occure when
> + * a system reset does not cause all I2C devices to be reset */
Checkpatch doesn't warn, but wrong comment style here, please
change.
[...]
bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
next prev parent reply other threads:[~2011-10-27 6:36 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-27 1:29 [U-Boot] [PATCH 1/2] Powerpc/i2c: Use the same initialize codes Chang-Ming.Huang at freescale.com
2011-10-27 1:29 ` [U-Boot] [PATCH 2/2] Powerpc/i2c: Force i2c to become bus master out of reset Chang-Ming.Huang at freescale.com
2011-10-27 6:36 ` Heiko Schocher [this message]
2011-10-27 7:25 ` Joakim Tjernlund
2011-10-27 7:40 ` Huang Changming-R66093
2011-10-27 7:51 ` Huang Changming-R66093
2011-10-27 8:10 ` Joakim Tjernlund
2011-10-27 9:10 ` Huang Changming-R66093
2011-10-27 9:26 ` Huang Changming-R66093
2011-10-27 10:21 ` Joakim Tjernlund
2011-10-28 5:21 ` Huang Changming-R66093
2011-10-28 6:34 ` Heiko Schocher
2011-10-28 7:56 ` Huang Changming-R66093
2011-10-27 8:04 ` Joakim Tjernlund
2011-11-04 5:26 ` [U-Boot] [PATCH 1/2] Powerpc/i2c: Use the same initialize codes Heiko Schocher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EA8FBF2.9000409@denx.de \
--to=hs@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.