Received: by 10.223.164.221 with SMTP id h29csp801618wrb; Thu, 26 Oct 2017 07:21:13 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TV5PDF9w4cgGyD3EkOZwrq/h6xM+z9No+6HOgeJYLqBJOlgXoerrFMIzI2fD3yBcE51Nbe X-Received: by 10.99.8.194 with SMTP id 185mr5147240pgi.202.1509027673169; Thu, 26 Oct 2017 07:21:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509027673; cv=none; d=google.com; s=arc-20160816; b=HZ7RC5QR92gDiPL+A30SfY3UCgjeRvVeFCmJK55tY96E2ARviROI7IBTbzD3VsPa7W vJ/e7hzx0ceibfAl/SJi8FKzCvmhuKUo2THabTI5N/ecgKMwsl+w0zfY/tpHsGckM7Im XrQs/Wl5zWcm+3WszXzjkkVCZUovidApT9BB1SCNvYpkJaKNzuzHwLBZhfOEJQEFF1+T vKQYXdVWhZaBipyZHG+DEPWEMvQ8op49liVlkt+/mdT8iawsSVUgYoOqwo0GCVx9Nmky MhBV39lK10E+LzWYDiFhujcPTEdl120XvTbK6AxxNZTJx6YJINbewEiJRSo/9DZXZ7Wf 2iIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=MO7fz0imd6B3zxG87Zo3pUlDlWbKJohG0pn7+rIerSo=; b=n5W1gpKb+9rgVarJxbg1HuO+8Gm/zRl4soYOiOjvcBe95pBtUc6/Kh0T+qDNdjQy2N pwcjHLocpkJVZXZVexcSSTrczYAayZ9jPfPGVVuUZjqJPf/aYjN5n8oiHzIR0itFGvlp q+nwsPkYTO/MiiffraLdwnm9lPqsnxeXSpDhUr/3QukjNwLxCMhNqD3lwJf08NjPpH0g JZsbLK/P6SkDbqNrNDgMLfetbCdZoTgTYXT2xBnd25YWW4YGH2bJJhbc5x9hyuG2FOvM 00rtSUhyKqeDwciyvkFMm+2ppeAw55IZyw6VSd17KwF78cIwvAXXSEbJ4tIMt3Fc2ECA bNXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 17si3423885pgh.311.2017.10.26.07.20.59; Thu, 26 Oct 2017 07:21:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932413AbdJZOUe (ORCPT + 99 others); Thu, 26 Oct 2017 10:20:34 -0400 Received: from mga06.intel.com ([134.134.136.31]:34119 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932246AbdJZOUd (ORCPT ); Thu, 26 Oct 2017 10:20:33 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP; 26 Oct 2017 07:20:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,434,1503385200"; d="scan'208";a="1210413489" Received: from mylly.fi.intel.com (HELO [10.237.72.50]) ([10.237.72.50]) by fmsmga001.fm.intel.com with ESMTP; 26 Oct 2017 07:20:28 -0700 Subject: Re: [PATCH] i2c: designware: make *CNT values configurable To: Shikhar Dogra , andriy.shevchenko@linux.intel.com, mika.westerberg@linux.intel.com, wsa@the-dreams.de Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, xe-linux-external@cisco.com References: <20171025185022.GA25920@sjc-ads-4188.cisco.com> From: Jarkko Nikula Message-ID: <4ddeadd3-aa31-87f4-cd8d-ddf2132edb49@linux.intel.com> Date: Thu, 26 Oct 2017 17:16:07 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171025185022.GA25920@sjc-ads-4188.cisco.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi On 10/25/2017 09:50 PM, Shikhar Dogra wrote: > The values are already configurable from ACPI. > > This patch makes the high count (HCNT) and low count (LCNT) > register values configurable through device tree. > > Cc: xe-linux-external@cisco.com > Signed-off-by: Shikhar Dogra > --- > Documentation/devicetree/bindings/i2c/i2c-designware.txt | 16 ++++++++++++++++ > drivers/i2c/busses/i2c-designware-platdrv.c | 12 ++++++++++++ > 2 files changed, 28 insertions(+) > > diff --git a/Documentation/devicetree/bindings/i2c/i2c-designware.txt b/Documentation/devicetree/bindings/i2c/i2c-designware.txt > index fee26dc..2b9ddca 100644 > --- a/Documentation/devicetree/bindings/i2c/i2c-designware.txt > +++ b/Documentation/devicetree/bindings/i2c/i2c-designware.txt > @@ -20,6 +20,18 @@ Optional properties : > - i2c-sda-falling-time-ns : should contain the SDA falling time in nanoseconds. > This value which is by default 300ns is used to compute the tHIGH period. > > + - i2c-ss-hcnt : should contain the I2C controller standard speed HCNT value. > + If this is not set we use the calculated and more conservative values. > + > + - i2c-ss-lcnt : should contain the I2C controller standard speed LCNT value. > + If this is not set we use the calculated and more conservative values. > + > + - i2c-fs-hcnt : should contain the I2C controller fast speed HCNT value. > + If this is not set we use the calculated and more conservative values. > + > + - i2c-fs-lcnt : should contain the I2C controller fast speed LCNT value. > + If this is not set we use the calculated and more conservative values. > + Worth to add also properties for high-speed while at it. Out of curiosity, are calculated values by using "i2c-sda-falling-time-ns" and "i2c-scl-falling-time-ns" properties non-optimal on your platform and controller clock? > diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c > index 6b00061c..25c3b0c 100644 > --- a/drivers/i2c/busses/i2c-designware-platdrv.c > +++ b/drivers/i2c/busses/i2c-designware-platdrv.c > @@ -177,6 +177,18 @@ static int dw_i2c_plat_probe(struct platform_device *pdev) > of_property_read_u32(pdev->dev.of_node, "clock-frequency", > &clk_freq); > > + of_property_read_u16(pdev->dev.of_node, > + "i2c-ss-hcnt", &dev->ss_hcnt); > + This patch is against old kernel. These were converted near 2 years ago by the commit 4c5301abbf81 ("i2c: designware: Convert to use unified device property API") -- Jarkko From 1582257255952113727@xxx Wed Oct 25 19:01:46 +0000 2017 X-GM-THRID: 1582257255952113727 X-Gmail-Labels: Inbox,Category Forums