All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: ml.lawnick@gmx.de (Michael Lawnick)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] i2c: omap: improve duty cycle on SCL
Date: Fri, 19 Jun 2015 07:41:49 +0200	[thread overview]
Message-ID: <5583AB9D.6090805@gmx.de> (raw)
In-Reply-To: <20150618172428.GB27790@saruman.tx.rr.com>

Am 18.06.2015 um 19:24 schrieb Felipe Balbi:
> On Thu, Jun 18, 2015 at 08:39:11AM +0200, Michael Lawnick wrote:
>> Am 17.06.2015 um 17:38 schrieb Felipe Balbi:
>>> Hi,
>>>
>>> On Wed, Jun 17, 2015 at 01:09:53PM +0200, Michael Lawnick wrote:
>>>> Am 16.06.2015 um 21:17 schrieb Felipe Balbi:
>>>>> 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.
>>>> ...
>>>> Hmm, and what's about  Philips I2C specification 2.1, Jan 2000, Table 5?
>>>>
>>>>> PARAMETER                       SYMBOL  STANDARD-MODE   FAST-MODE     UNIT
>>>>>                                           MIN. MAX.     MIN. MAX.
>>>>> LOW period of the SCL clock     tLOW      4.7   ?       1.3   ?       ?s
>>>>> HIGH period of the SCL clock    tHIGH     4.0   ?       0.6   ?       ?s
>>>>
>>>> Your signal is in spec (0.85 ?s high, 1,65 low).
>>>> Maybe your TPS65218 is just buggy or signals are bad?
>>>
>>> yes, tps is buggy, it's written in the commit log itself.
>>>
>>
>> So I think it is unacceptable to change the adapters code violating
>> specification because some buggy device doesn't work properly.
>
> read the other thread and you'll see that it's not violating jack
>
>> This change for your device has chance to blow up many correctly
>> working ones.
>
> How ?
>
The answer is so obvious that I'm a bit irritated.
Your patch description tells: 'and use 50% for tLow and 50% for tHigh'
For 400kHz this means 1.25 us for high and low. This clearly violates 
the specification for minimum low period and will not work with any 
device that relies on it.
In the other thread it is discussed that your patch does effectively not 
do what you describe but this is something completely independent.

-- 
KR
Michael

WARNING: multiple messages have this Message-ID (diff)
From: Michael Lawnick <ml.lawnick-Mmb7MZpHnFY@public.gmane.org>
To: balbi-l0cyMroinI0@public.gmane.org
Cc: wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org,
	Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>,
	Nishanth Menon <nm-l0cyMroinI0@public.gmane.org>,
	Dave Gerlach <d-gerlach-l0cyMroinI0@public.gmane.org>,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Linux OMAP Mailing List
	<linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Linux ARM Kernel Mailing List
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH] i2c: omap: improve duty cycle on SCL
Date: Fri, 19 Jun 2015 07:41:49 +0200	[thread overview]
Message-ID: <5583AB9D.6090805@gmx.de> (raw)
In-Reply-To: <20150618172428.GB27790-HgARHv6XitJaoMGHk7MhZQC/G2K4zDHf@public.gmane.org>

Am 18.06.2015 um 19:24 schrieb Felipe Balbi:
> On Thu, Jun 18, 2015 at 08:39:11AM +0200, Michael Lawnick wrote:
>> Am 17.06.2015 um 17:38 schrieb Felipe Balbi:
>>> Hi,
>>>
>>> On Wed, Jun 17, 2015 at 01:09:53PM +0200, Michael Lawnick wrote:
>>>> Am 16.06.2015 um 21:17 schrieb Felipe Balbi:
>>>>> 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.
>>>> ...
>>>> Hmm, and what's about  Philips I2C specification 2.1, Jan 2000, Table 5?
>>>>
>>>>> PARAMETER                       SYMBOL  STANDARD-MODE   FAST-MODE     UNIT
>>>>>                                           MIN. MAX.     MIN. MAX.
>>>>> LOW period of the SCL clock     tLOW      4.7   –       1.3   –       µs
>>>>> HIGH period of the SCL clock    tHIGH     4.0   –       0.6   –       µs
>>>>
>>>> Your signal is in spec (0.85 µs high, 1,65 low).
>>>> Maybe your TPS65218 is just buggy or signals are bad?
>>>
>>> yes, tps is buggy, it's written in the commit log itself.
>>>
>>
>> So I think it is unacceptable to change the adapters code violating
>> specification because some buggy device doesn't work properly.
>
> read the other thread and you'll see that it's not violating jack
>
>> This change for your device has chance to blow up many correctly
>> working ones.
>
> How ?
>
The answer is so obvious that I'm a bit irritated.
Your patch description tells: 'and use 50% for tLow and 50% for tHigh'
For 400kHz this means 1.25 us for high and low. This clearly violates 
the specification for minimum low period and will not work with any 
device that relies on it.
In the other thread it is discussed that your patch does effectively not 
do what you describe but this is something completely independent.

-- 
KR
Michael

  reply	other threads:[~2015-06-19  5:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-16 19:17 [PATCH] i2c: omap: improve duty cycle on SCL Felipe Balbi
2015-06-16 19:17 ` Felipe Balbi
2015-06-16 19:19 ` Felipe Balbi
2015-06-16 19:19   ` Felipe Balbi
2015-06-17 11:09 ` Michael Lawnick
2015-06-17 11:09   ` Michael Lawnick
2015-06-17 15:38   ` Felipe Balbi
2015-06-17 15:38     ` Felipe Balbi
2015-06-18  6:39     ` Michael Lawnick
2015-06-18  6:39       ` Michael Lawnick
2015-06-18 17:24       ` Felipe Balbi
2015-06-18 17:24         ` Felipe Balbi
2015-06-19  5:41         ` Michael Lawnick [this message]
2015-06-19  5:41           ` Michael Lawnick
2015-06-19 15:30           ` Felipe Balbi
2015-06-19 15:30             ` 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=5583AB9D.6090805@gmx.de \
    --to=ml.lawnick@gmx.de \
    --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.