public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: HU TAO-TGHK48 <taohu@motorola.com>
Cc: Aaro Koskinen <aaro.koskinen@nokia.com>,
	linux-omap@vger.kernel.org, Rajendra Nayak <rnayak@ti.com>,
	"Hogander Jouni (Nokia-D/Tampere)" <jouni.hogander@nokia.com>,
	Jagadeesh Bhaskar Pakaravoor <j-pakaravoor@ti.com>
Subject: Re: [PATCH 4/4] I2C: OMAP3: PM: (re)init for every transfer to support off-mode
Date: Mon, 29 Jun 2009 10:04:44 -0700	[thread overview]
Message-ID: <87y6rb7yz7.fsf@deeprootsystems.com> (raw)
In-Reply-To: <F12CE1A68F023D498A2691C7B5393115035F09BD@ZMY16EXM66.ds.mot.com> (HU TAO-TGHK's message of "Mon\, 29 Jun 2009 16\:51\:51 +0800")

"HU TAO-TGHK48" <taohu@motorola.com> writes:

> I think we also need extra patch for fixing stability issue.
>
> Sometimes after back from retention/off mode, OMAP3430 I2C controller
> stops working even all register settings are restored.
>
> OMAP3430 TRM says: "During active mode (I2Ci.I2C_CON[15] I2C_EN bit is
> set to 1), make no changes to the I2Ci.I2C_SCLL and I2Ci.I2C_SCLH
> registers. 
> Changes may result in unpredictable behavior."
>
> diff --git a/drivers/i2c/busses/i2c-omap.c
> b/drivers/i2c/busses/i2c-omap.c index 5ce055c..b084209 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -238,12 +238,14 @@ static void omap_i2c_unidle(struct omap_i2c_dev
> *dev)
>  		clk_enable(dev->iclk);
>  	clk_enable(dev->fclk);
>  	if (cpu_is_omap34xx()) {
> +		omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0);
>  		omap_i2c_write_reg(dev, OMAP_I2C_PSC_REG,
> dev->pscstate);
>  		omap_i2c_write_reg(dev, OMAP_I2C_SCLL_REG,
> dev->scllstate);
>  		omap_i2c_write_reg(dev, OMAP_I2C_SCLH_REG,
> dev->sclhstate);
>  		omap_i2c_write_reg(dev, OMAP_I2C_BUF_REG,
> dev->bufstate);
>  		omap_i2c_write_reg(dev, OMAP_I2C_SYSC_REG,
> dev->syscstate);
>  		omap_i2c_write_reg(dev, OMAP_I2C_WE_REG, dev->westate);
> +		omap_i2c_write_reg(dev, OMAP_I2C_CON_REG,
> OMAP_I2C_CON_EN);
>  	}
>  	dev->idle = 0;
>  	omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, dev->iestate);

Shouldn't you do a read-modify-write of I2C_CON_REG here?  Otherwise,
you're loosing any of the other settings in I2C_CON_REG.

Not being an expert in the I2C hardware, I'm not sure if it matters,
but this doesn't seem quite right due to possible side effects.

Kevin


  reply	other threads:[~2009-06-29 17:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-25 21:34 [PATCH 0/4] driver updates from PM branch for upstream Kevin Hilman
2009-06-25 21:34 ` [PATCH 1/4] OMAP: McSPI: enable wake-ups and smart-idle Kevin Hilman
2009-06-25 21:34   ` [PATCH 2/4] OMAP: McSPI: Convert bit shifted values into BIT format Kevin Hilman
2009-06-25 21:34     ` [PATCH 3/4] OMAP3 McSPI: Adds context save/restore Kevin Hilman
2009-06-25 21:34       ` [PATCH 4/4] I2C: OMAP3: PM: (re)init for every transfer to support off-mode Kevin Hilman
2009-06-26 11:13         ` Aaro Koskinen
2009-06-26 14:19           ` Kevin Hilman
2009-06-29  8:51             ` HU TAO-TGHK48
2009-06-29 17:04               ` Kevin Hilman [this message]
2009-06-29 19:28                 ` Hunter, Jon
2009-06-29 21:15                   ` Kevin Hilman
2009-06-30 16:49                     ` Hunter, Jon
2009-07-01  9:43                       ` HU TAO-TGHK48
2009-06-26 12:02       ` [PATCH 3/4] OMAP3 McSPI: Adds context save/restore Aaro Koskinen
2009-06-29 14:25         ` Aaro Koskinen

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=87y6rb7yz7.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=aaro.koskinen@nokia.com \
    --cc=j-pakaravoor@ti.com \
    --cc=jouni.hogander@nokia.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=rnayak@ti.com \
    --cc=taohu@motorola.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox