From: Wolfram Sang <wsa@the-dreams.de>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org,
ben-linux@fluff.org, Jean Delvare <khali@linux-fr.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Christian Ruppert <christian.ruppert@abilis.com>
Subject: Re: [5/7] i2c-designware: enable/disable the controller properly
Date: Tue, 9 Apr 2013 11:28:57 +0200 [thread overview]
Message-ID: <20130409092857.GE3624@the-dreams.de> (raw)
In-Reply-To: <20130409092836.GG21818@intel.com>
On Tue, Apr 09, 2013 at 12:28:36PM +0300, Mika Westerberg wrote:
> On Tue, Apr 09, 2013 at 11:09:14AM +0200, Wolfram Sang wrote:
> >
> > > +static void __i2c_dw_enable(struct dw_i2c_dev *dev, bool enable)
> > > +{
> > > + int timeout = 100;
> > > +
> > > + do {
> > > + dw_writel(dev, enable, DW_IC_ENABLE);
> > > + if ((dw_readl(dev, DW_IC_ENABLE_STATUS) & 1) == enable)
> > > + return;
> > > +
> > > + usleep_range(25, 250);
> >
> > This would wait 25ms max. Is there a timeout value specified in the docs?
>
> The datasheet says something like:
>
> 1. Define a timer interval (t_i2c_poll) equal 10 times the highest
> signaling period. For 400kHz this is 25us.
>
> 2. Define max timeout parameter, MAX_T_POLL_COUNT, such that if any
> repeated operation exeeds this maximum, an error is reported.
>
> In this case I have:
>
> t_i2c_poll = 25 (to 250 us)
> MAX_T_POLL_COUNT = 100
Maybe worth a comment?
Other than that, the series looks fine to me.
next prev parent reply other threads:[~2013-04-09 9:28 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-21 12:09 [PATCH 1/7] i2c-designware: move to managed functions (devm_*) Mika Westerberg
2013-03-21 12:09 ` [PATCH 3/7] i2c-designware-pci: use managed functions pcim_* and devm_* Mika Westerberg
[not found] ` <1363867800-23861-3-git-send-email-mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2013-04-09 9:03 ` [3/7] " Wolfram Sang
2013-03-21 12:09 ` [PATCH 4/7] i2c-designware: use dynamic adapter numbering on Lynxpoint Mika Westerberg
[not found] ` <1363867800-23861-4-git-send-email-mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2013-04-09 9:06 ` [4/7] " Wolfram Sang
2013-04-09 9:23 ` Mika Westerberg
2013-04-09 9:29 ` Wolfram Sang
[not found] ` <20130409092923.GF3624-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2013-04-09 9:37 ` Mika Westerberg
2013-03-21 12:09 ` [PATCH 5/7] i2c-designware: enable/disable the controller properly Mika Westerberg
2013-04-09 9:09 ` [5/7] " Wolfram Sang
2013-04-09 9:28 ` Mika Westerberg
2013-04-09 9:28 ` Wolfram Sang [this message]
[not found] ` <20130409092857.GE3624-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2013-04-09 9:39 ` Mika Westerberg
2013-03-21 12:09 ` [PATCH 6/7] i2c-designware: use usleep_range() in the busy-loop Mika Westerberg
2013-03-21 12:10 ` [PATCH 7/7] i2c-designware: switch to use runtime PM autosuspend Mika Westerberg
[not found] ` <1363867800-23861-1-git-send-email-mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2013-03-21 12:09 ` [PATCH 2/7] i2c-designware-pci: use dev_err() instead of printk() Mika Westerberg
2013-04-08 11:04 ` [PATCH 1/7] i2c-designware: move to managed functions (devm_*) Mika Westerberg
2013-04-09 9:00 ` [1/7] " Wolfram Sang
2013-04-09 9:22 ` Mika Westerberg
2013-04-09 9:20 ` Wolfram Sang
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=20130409092857.GE3624@the-dreams.de \
--to=wsa@the-dreams.de \
--cc=andriy.shevchenko@linux.intel.com \
--cc=ben-linux@fluff.org \
--cc=christian.ruppert@abilis.com \
--cc=khali@linux-fr.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.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;
as well as URLs for NNTP newsgroup(s).