Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1384271
| From | Jan Glauber <jan.glauber@caviumnetworks.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v6 08/19] i2c: octeon: Enable High-Level Controller |
| Date | 2016-04-21 16:20 +0200 |
| Message-ID | <rqnCx-1Zd-1@gated-at.bofh.it> (permalink) |
| References | <rmLWN-81T-3@gated-at.bofh.it> <rmM6w-87k-65@gated-at.bofh.it> <rq8au-6mN-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Apr 20, 2016 at 11:43:54PM +0200, Wolfram Sang wrote:
> On Mon, Apr 11, 2016 at 05:28:39PM +0200, Jan Glauber wrote:
> > From: David Daney <ddaney@caviumnetworks.com>
> >
> > Use High-Level Controller (HLC) when possible. The HLC can read/write
> > up to 8 bytes and is completely optional. The most important difference
> > of the HLC is that it only requires one interrupt for a transfer
> > (up to 8 bytes) where the low-level read/write requires 2 interrupts
> > plus one interrupt per transferred byte. Since the interrupts are costly
> > using the HLC improves the performance. Also, the HLC provides improved error
> > handling.
>
> Much better description, thanks!
>
> > + while (1) {
> > + val = octeon_i2c_ctl_read(i2c);
> > + if (!(val & (TWSI_CTL_STA | TWSI_CTL_STP)));
> > + break;
> > +
> > + /* clear IFLG event */
> > + if (val & TWSI_CTL_IFLG)
> > + octeon_i2c_ctl_write(i2c, TWSI_CTL_ENAB);
> > +
> > + if (try++ > 100) {
> > + pr_err("%s: giving up\n", __func__);
> > + break;
> > + }
> > +
> > + /* spin until any start/stop has finished */
> > + udelay(10);
> > + }
>
> Maybe you can use one of the readx_poll_timeout() functions?
Nice, but I don't think we can use readx_poll_timeout() here because
of the octeon_i2c_ctl_write inside the loop...
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH v6 08/19] i2c: octeon: Enable High-Level Controller Wolfram Sang <wsa@the-dreams.de> - 2016-04-20 23:50 +0200
Re: [PATCH v6 08/19] i2c: octeon: Enable High-Level Controller David Daney <ddaney@caviumnetworks.com> - 2016-04-21 00:00 +0200
Re: [PATCH v6 08/19] i2c: octeon: Enable High-Level Controller Wolfram Sang <wsa@the-dreams.de> - 2016-04-21 16:00 +0200
Re: [PATCH v6 08/19] i2c: octeon: Enable High-Level Controller Jan Glauber <jan.glauber@caviumnetworks.com> - 2016-04-21 16:20 +0200
csiph-web