All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: balbi@ti.com (Felipe Balbi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3] i2c: omap: improve duty cycle on SCL
Date: Thu, 18 Jun 2015 12:25:58 -0500	[thread overview]
Message-ID: <20150618172558.GC27790@saruman.tx.rr.com> (raw)
In-Reply-To: <55827CD7.7030207@nokia.com>

On Thu, Jun 18, 2015 at 10:09:59AM +0200, Alexander Sverdlin wrote:
> Hello Felipe,
> 
> On 17/06/15 21:31, ext Felipe Balbi wrote:
> > With this patch we try to be as close to 50%
> > duty cycle as possible. The reason for this
> > is that some devices present an erratic behavior
> > with certain duty cycles.
> > 
> > One such example is TPS65218 PMIC which fails
> > to change voltages when running @ 400kHz and
> > duty cycle is lower than 34%.
> > 
> > The idea of the patch is simple:
> > 
> > calculate desired scl_period from requested scl
> > and use 50% for tLow and 50% for tHigh.
> > 
> > tLow is calculated with a DIV_ROUND_UP() to make
> > sure it's slightly higher than tHigh and to make
> > sure that we end up within I2C specifications.
> 
> if you refuse to change the calculations to achieve maximum possible
> bus rate (as I've shown you with SCLL=9 and SCLH=9), maybe you want to
> change the description? Because you are doing something else than is
> written here. You are only in spec because you are not doing 50% duty
> cycle. And you didn't mention here that you lower the bus speed below
> 400kHz to achieve this.

and there's a comment where the calculation goes which states "as close
to 50% as possible but we make sure tLow is higher than tHigh so we're
still within spec".

-- 
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150618/4fb0ce66/attachment.sig>

WARNING: multiple messages have this Message-ID (diff)
From: Felipe Balbi <balbi@ti.com>
To: Alexander Sverdlin <alexander.sverdlin@nokia.com>
Cc: ext Felipe Balbi <balbi@ti.com>,
	wsa@the-dreams.de, Tony Lindgren <tony@atomide.com>,
	Dave Gerlach <d-gerlach@ti.com>, Nishanth Menon <nm@ti.com>,
	linux-i2c@vger.kernel.org,
	Linux OMAP Mailing List <linux-omap@vger.kernel.org>,
	Linux ARM Kernel Mailing List
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v3] i2c: omap: improve duty cycle on SCL
Date: Thu, 18 Jun 2015 12:25:58 -0500	[thread overview]
Message-ID: <20150618172558.GC27790@saruman.tx.rr.com> (raw)
In-Reply-To: <55827CD7.7030207@nokia.com>

[-- Attachment #1: Type: text/plain, Size: 1353 bytes --]

On Thu, Jun 18, 2015 at 10:09:59AM +0200, Alexander Sverdlin wrote:
> Hello Felipe,
> 
> On 17/06/15 21:31, ext Felipe Balbi wrote:
> > With this patch we try to be as close to 50%
> > duty cycle as possible. The reason for this
> > is that some devices present an erratic behavior
> > with certain duty cycles.
> > 
> > One such example is TPS65218 PMIC which fails
> > to change voltages when running @ 400kHz and
> > duty cycle is lower than 34%.
> > 
> > The idea of the patch is simple:
> > 
> > calculate desired scl_period from requested scl
> > and use 50% for tLow and 50% for tHigh.
> > 
> > tLow is calculated with a DIV_ROUND_UP() to make
> > sure it's slightly higher than tHigh and to make
> > sure that we end up within I2C specifications.
> 
> if you refuse to change the calculations to achieve maximum possible
> bus rate (as I've shown you with SCLL=9 and SCLH=9), maybe you want to
> change the description? Because you are doing something else than is
> written here. You are only in spec because you are not doing 50% duty
> cycle. And you didn't mention here that you lower the bus speed below
> 400kHz to achieve this.

and there's a comment where the calculation goes which states "as close
to 50% as possible but we make sure tLow is higher than tHigh so we're
still within spec".

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-06-18 17:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-17 19:31 [PATCH v3] i2c: omap: improve duty cycle on SCL Felipe Balbi
2015-06-17 19:31 ` Felipe Balbi
2015-06-18  8:09 ` Alexander Sverdlin
2015-06-18  8:09   ` Alexander Sverdlin
2015-06-18 17:25   ` Felipe Balbi [this message]
2015-06-18 17:25     ` Felipe Balbi
2015-07-09 19:42     ` Wolfram Sang
2015-07-09 19:42       ` Wolfram Sang
2015-07-10 17:27       ` Felipe Balbi
2015-07-10 17:27         ` Felipe Balbi
2015-08-13 14:36         ` Felipe Balbi
2015-08-13 14:36           ` Felipe Balbi
     [not found]           ` <CAFqkuUbO1CZ8bu8g8O7SsLF-0nUV274GZ08=6J1sVS4Foy+_EA@mail.gmail.com>
2015-08-18 14:43             ` Felipe Balbi
2015-08-18 14:43               ` Felipe Balbi

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=20150618172558.GC27790@saruman.tx.rr.com \
    --to=balbi@ti.com \
    --cc=linux-arm-kernel@lists.infradead.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 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.