linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: Maxime COQUELIN <maxime.coquelin@st.com>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	Srinivas Kandagatla <srinivas.kandagatla@gmail.com>,
	Patrice Chotard <patrice.chotard@st.com>,
	kernel@stlinux.com
Subject: Re: [PATCH] drivers: i2c: i2c-st: Update i2c timings
Date: Mon, 2 Jun 2014 18:31:03 +0200	[thread overview]
Message-ID: <20140602163103.GJ2654@katana> (raw)
In-Reply-To: <1400254330-2547-1-git-send-email-maxime.coquelin@st.com>

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

On Fri, May 16, 2014 at 05:32:10PM +0200, Maxime COQUELIN wrote:
> The i2c timing values specified in the driver are the minimun
> values defined in the I2C specifications.
> The I2C specification does not specify any default or maximum values.
> 
> Some I2C devices are out of spec, and might not work properly with minimum
> values.

Can you give names here? Would be interesting to know since a few
drivers implement the minimum timings.

> This patch adds a 10% margin on all the timings.

Is there a safety margin or do the devices start to work exactly at 10%?

> 
> Signed-off-by: Maxime Coquelin <maxime.coquelin@st.com>
> ---
>  drivers/i2c/busses/i2c-st.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-st.c b/drivers/i2c/busses/i2c-st.c
> index 8720161..09142f1 100644
> --- a/drivers/i2c/busses/i2c-st.c
> +++ b/drivers/i2c/busses/i2c-st.c
> @@ -210,21 +210,21 @@ static inline void st_i2c_clr_bits(void __iomem *reg, u32 mask)
>  static struct st_i2c_timings i2c_timings[] = {

That needs a comment about the margin, otherwise people will wonder
where these values come from.

>  	[I2C_MODE_STANDARD] = {
>  		.rate			= 100000,
> -		.rep_start_hold		= 4000,
> -		.rep_start_setup	= 4700,
> -		.start_hold		= 4000,
> -		.data_setup_time	= 250,
> -		.stop_setup_time	= 4000,
> -		.bus_free_time		= 4700,
> +		.rep_start_hold		= 4400,
> +		.rep_start_setup	= 5170,
> +		.start_hold		= 4400,
> +		.data_setup_time	= 275,
> +		.stop_setup_time	= 4400,
> +		.bus_free_time		= 5170,
>  	},
>  	[I2C_MODE_FAST] = {
>  		.rate			= 400000,
> -		.rep_start_hold		= 600,
> -		.rep_start_setup	= 600,
> -		.start_hold		= 600,
> -		.data_setup_time	= 100,
> -		.stop_setup_time	= 600,
> -		.bus_free_time		= 1300,
> +		.rep_start_hold		= 660,
> +		.rep_start_setup	= 660,
> +		.start_hold		= 660,
> +		.data_setup_time	= 110,
> +		.stop_setup_time	= 660,
> +		.bus_free_time		= 1430,
>  	},
>  };
>  
> -- 
> 1.9.1
> 

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

  reply	other threads:[~2014-06-02 16:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-16 15:32 [PATCH] drivers: i2c: i2c-st: Update i2c timings Maxime COQUELIN
2014-06-02 16:31 ` Wolfram Sang [this message]
2014-06-03  7:32   ` Maxime Coquelin
     [not found]     ` <538D7A1C.5040409-qxv4g6HH51o@public.gmane.org>
2014-06-03  7:59       ` Wolfram Sang
2014-07-21 11:05         ` Maxime Coquelin
     [not found]           ` <53CCF3EC.6030904-qxv4g6HH51o@public.gmane.org>
2014-07-21 14:03             ` 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=20140602163103.GJ2654@katana \
    --to=wsa@the-dreams.de \
    --cc=kernel@stlinux.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.coquelin@st.com \
    --cc=patrice.chotard@st.com \
    --cc=srinivas.kandagatla@gmail.com \
    /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).