From patchwork Fri May 16 15:32:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime COQUELIN X-Patchwork-Id: 30340 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f198.google.com (mail-ig0-f198.google.com [209.85.213.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DA4C620A25 for ; Fri, 16 May 2014 15:32:28 +0000 (UTC) Received: by mail-ig0-f198.google.com with SMTP id uq10sf2712763igb.9 for ; Fri, 16 May 2014 08:32:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=bk0DfCjLzFAgYrTtrN7N0rlZq2i658OCEF6fOAHD9j4=; b=k65/A2MI84s6nUunDB5zOUAo7Br0q68RaHv4gpUagMgVA6ZiLax30wVbG8xKO6NhoQ HMAfxu2RTqj0x98HX5BrplEAyL6+SxU4Qy4SF4h8n4EM6C5LbLjhabO5m9ZqHVoKvinT I/s4wR9R4dgi+qAcqjdWfG38hFEoZUqlzV9blxYXtTIca2xKfk8fmH8YPX6YbfUzbdhv yRcTExL5ePwuhE5MjRk2LFv5dv3duhrlRmQeWctWbZdqKJV75r7xzzUt/qNKIntNSO87 bEFj4cu8HQHbCm5i/cxJxaBwS3A90NCaKEotkFAj4Qq7v234fvi6WTE+8mC5DeLMkc3e Bf5w== X-Gm-Message-State: ALoCoQnM52e9LaAP4HQUcqST/ICDFgkWCsu1rZcSAIr8StnQlhowFBQpTfAKCBiDah0MJO9Qie2q X-Received: by 10.183.11.102 with SMTP id eh6mr8650897obd.37.1400254348377; Fri, 16 May 2014 08:32:28 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.25.171 with SMTP id 40ls781873qgt.85.gmail; Fri, 16 May 2014 08:32:28 -0700 (PDT) X-Received: by 10.52.94.47 with SMTP id cz15mr364971vdb.0.1400254348287; Fri, 16 May 2014 08:32:28 -0700 (PDT) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id fx7si1670813vcb.45.2014.05.16.08.32.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 May 2014 08:32:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.181 as permitted sender) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id pa12so3304693veb.12 for ; Fri, 16 May 2014 08:32:28 -0700 (PDT) X-Received: by 10.58.179.115 with SMTP id df19mr1363469vec.41.1400254348188; Fri, 16 May 2014 08:32:28 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp62235vcb; Fri, 16 May 2014 08:32:27 -0700 (PDT) X-Received: by 10.68.197.8 with SMTP id iq8mr22171513pbc.124.1400254347308; Fri, 16 May 2014 08:32:27 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wh4si4725952pbc.305.2014.05.16.08.32.27; Fri, 16 May 2014 08:32:27 -0700 (PDT) Received-SPF: none (google.com: linux-i2c-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756442AbaEPPcZ (ORCPT + 2 others); Fri, 16 May 2014 11:32:25 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:35810 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755624AbaEPPcY (ORCPT ); Fri, 16 May 2014 11:32:24 -0400 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.14.5/8.14.5) with SMTP id s4GFT58V032126; Fri, 16 May 2014 17:32:19 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 1kw121dbeq-1 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Fri, 16 May 2014 17:32:19 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id B73D059; Fri, 16 May 2014 15:32:11 +0000 (GMT) Received: from mail7.sgp.st.com (unknown [164.129.223.81]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 938FC2D16B; Fri, 16 May 2014 15:32:11 +0000 (GMT) Received: from lmenx29l.st.com ([10.201.23.80]) by mail7.sgp.st.com (MOS 4.3.3-GA) with ESMTP id BZH78575 (AUTH lme00137); Fri, 16 May 2014 17:32:10 +0200 From: Maxime COQUELIN To: Wolfram Sang , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla , Patrice Chotard Cc: kernel@stlinux.com, maxime.coquelin@st.com Subject: [PATCH] drivers: i2c: i2c-st: Update i2c timings Date: Fri, 16 May 2014 17:32:10 +0200 Message-Id: <1400254330-2547-1-git-send-email-maxime.coquelin@st.com> X-Mailer: git-send-email 1.9.1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.96, 1.0.14, 0.0.0000 definitions=2014-05-16_05:2014-05-16, 2014-05-16, 1970-01-01 signatures=0 Sender: linux-i2c-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-i2c@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: maxime.coquelin@st.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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. This patch adds a 10% margin on all the timings. Signed-off-by: Maxime Coquelin --- 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[] = { [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, }, };