From: Mika Westerberg <mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org,
Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
Andy Shevchenko
<andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
Christian Ruppert
<christian.ruppert-ux6zf3SgZrrQT0dZR+AlfA@public.gmane.org>
Subject: Re: [5/7] i2c-designware: enable/disable the controller properly
Date: Tue, 9 Apr 2013 12:39:03 +0300 [thread overview]
Message-ID: <20130409093903.GI21818@intel.com> (raw)
In-Reply-To: <20130409092857.GE3624-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
On Tue, Apr 09, 2013 at 11:28:57AM +0200, Wolfram Sang wrote:
> 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?
I'll add it in the next revision.
> Other than that, the series looks fine to me.
Thanks!
next prev parent reply other threads:[~2013-04-09 9:39 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
[not found] ` <20130409092857.GE3624-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2013-04-09 9:39 ` Mika Westerberg [this message]
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=20130409093903.GI21818@intel.com \
--to=mika.westerberg-vuqaysv1563yd54fqh9/ca@public.gmane.org \
--cc=andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
--cc=christian.ruppert-ux6zf3SgZrrQT0dZR+AlfA@public.gmane.org \
--cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org \
/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).