LKML Archive on
help / color / mirror / Atom feed
From: Doug Anderson <>
To: Wolfram Sang <>
Cc: "Addy Ke" <>,
	"Max Schwarz" <>,
	"Heiko Stübner" <>,
	"Olof Johansson" <>,
	"Rob Herring" <>,
	"Pawel Moll" <>,
	"Ian Campbell" <>,
	"Kumar Gala" <>,
	"" <>,
	"" <>,
	"open list:ARM/Rockchip SoC..."
	"Eddie Cai" <>,
	"Jianqun Xu" <>,
	"Tao Huang" <>, Chris <>,
	姚智情 <>, "han jiang" <>,
	"Kever Yang" <>,
	"Lin Huang" <>,
	caesar <>,
	"Shunqian Zheng" <>
Subject: Re: [PATCH v2] i2c: rk3x: fix bug that cause measured high_ns doesn't meet I2C spec
Date: Wed, 3 Dec 2014 09:53:40 -0800	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <20141203111518.GB1039@katana>


On Wed, Dec 3, 2014 at 3:15 AM, Wolfram Sang <> wrote:
>> + - rise-ns : Number of nanoseconds the signal takes to rise (t(r) in i2c spec).
>> +          If not specified this is assumed to be the max the spec allows
>> +          (1000 ns for standard mode, 300 ns for fast mode) which might
>> +          cause slightly slower communication.
>> + - fall-ns : Number of nanoseconds the signal takes to fall (t(f) in the i2c0
>> +          spec).  If not specified this is assumed to be the max the spec
>> +          allows (300 ns) which might cause slightly slower communication.
> We already have those bindings from the designware driver:
>  - i2c-sda-hold-time-ns : should contain the SDA hold time in nanoseconds.
>  - i2c-scl-falling-time : should contain the SCL falling time in nanoseconds.
>  - i2c-sda-falling-time : should contain the SDA falling time in nanoseconds.
> Can you reuse them? Or do you really need a specific rise-time property?
> If so, please matche the style of the bindings above.

Ah, doh!  I should have thought to look for existing bindings.  Sorry
about that.  :(

If you don't read all the below, my belief is that we should simply
rename the strings in Addy's patch.  We should change "rise-ns" to
"i2c-scl-rising-time" and "fall-ns" to "i2c-scl-falling-time".
Wolfram: can you confirm this is OK?  I'm voting to leave the "-ns"
off the end of both to avoid asymmetry.



Hrm, we seem to need different parameters than designware i2c.  The
designware bus is specifying "i2c-sda-hold-time-ns".  On Rockchip i2c
we specify just the number of cycles that the clk line should be high
and the number of cycles that it should be low.  The adapter does the
rest of the work.  As I understand it, the data hold time on Rockchip
i2c is equal to half the low time, for instance.  That was indicated
by Addy who talked to the IC engineer.

Because of the above, I _think_ that means that specifying
"i2c-sda-hold-time-ns" is not appropriate for us, or at least not easy
to convert in a sane way.

We could add a "i2c-scl-hold-time-ns", but if I understand correctly I
think that the "rise-time" describes the hardware in a cleaner way.
If you specify the hold time then (I think) that it requires the user
to tweak it whenever he/she adjusts the bus speed.  In other words if
you have a bus and you decide to move it from running at 400kHz to
running at 300kHz (signal integrity issues?) or 100kHz, you need to
manually modify the hold time.  ...on the other hand the rise time is
a property of the hardware I think (size of resistor, etc).

For the falling times I guess we should use the "i2c-scl-falling-time"
and not list the "i2c-sda-falling-time" for now?  As per above the
controller takes in the high/low period of the clocks and figures out
the rest itself.  Possibly we will need to account for
i2c-sda-falling-time eventually, but maybe that can come later?


  reply	other threads:[~2014-12-03 17:53 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06  8:11 [PATCH] " Addy Ke
2014-12-02 23:02 ` Doug Anderson
2014-12-03  2:37 ` [PATCH v2] " Addy Ke
2014-12-03  5:13   ` Doug Anderson
2014-12-03 11:15   ` Wolfram Sang
2014-12-03 17:53     ` Doug Anderson [this message]
2014-12-04 18:40       ` Wolfram Sang
2014-12-04 18:43         ` Doug Anderson
2014-12-04 19:03           ` Wolfram Sang
2014-12-05 19:31             ` Doug Anderson
2014-12-08  2:59 ` [PATCH v3] " Addy Ke
2014-12-08  3:06   ` addy ke
2014-12-08  8:52   ` Uwe Kleine-König
2014-12-08 17:13     ` Doug Anderson
2014-12-08 17:34       ` Wolfram Sang
2014-12-08 18:53         ` Doug Anderson
2014-12-08 20:04           ` Uwe Kleine-König
2014-12-11  6:00   ` [PATCH v4] i2c: rk3x: fix bug that cause measured high_ns doesn't meet I2C specification Addy Ke
2014-12-11  7:47     ` Uwe Kleine-König
2014-12-11 11:02     ` [PATCH v5] " Addy Ke
2014-12-11 19:22       ` Doug Anderson
2015-01-13 11:42       ` 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='' \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH v2] i2c: rk3x: fix bug that cause measured high_ns doesn'\''t meet I2C spec' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).