From patchwork Mon Jun 10 05:02:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 17713 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ea0-f197.google.com (mail-ea0-f197.google.com [209.85.215.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2C35125DFB for ; Mon, 10 Jun 2013 05:03:23 +0000 (UTC) Received: by mail-ea0-f197.google.com with SMTP id a15sf2893009eae.4 for ; Sun, 09 Jun 2013 22:03:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=ccbJuy8uCerHbIdjna2rBAxOYpRv9YQzheyhzHeX4oA=; b=ptbxBmUWp32jEkmx4dNpsVCX1Q3eG7qirg6O5ntMySIG1UVTaTgQdav6C+iAc6GSpg pRcwjvjW0oAhzSeOXq94OQLXhHztbzHGUAFcuGV7zwcUQapvrpRqPEBxkkYi/YhpvxRc 8pN/3uU/IcR54f1CkwytwDQbw4O6isRkn29b5wu9V0ml3Lv7GEAJq4MdNlTFKbXiqGX0 RFrAkC/vsXtf1Xi6lb/U5wdQsiV1PlgRWfyLUo/8sSuZaWlcnXMub7dftA+keSU+5GJa P070fyn7ugF/WXu/1EJvf1Z8mrguR87n1TgqwRNT8WV6JKCfS7mIcAfD9+8yXkG2+O0t zMNw== X-Received: by 10.180.11.232 with SMTP id t8mr2985164wib.3.1370840601890; Sun, 09 Jun 2013 22:03:21 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.87.106 with SMTP id w10ls625720wiz.44.canary; Sun, 09 Jun 2013 22:03:21 -0700 (PDT) X-Received: by 10.180.212.74 with SMTP id ni10mr3798891wic.41.1370840601768; Sun, 09 Jun 2013 22:03:21 -0700 (PDT) Received: from mail-ve0-x234.google.com (mail-ve0-x234.google.com [2607:f8b0:400c:c01::234]) by mx.google.com with ESMTPS id r12si2707975wik.18.2013.06.09.22.03.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 09 Jun 2013 22:03:21 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::234 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::234; Received: by mail-ve0-f180.google.com with SMTP id pa12so4401111veb.39 for ; Sun, 09 Jun 2013 22:03:20 -0700 (PDT) X-Received: by 10.220.91.9 with SMTP id k9mr4692104vcm.41.1370840600675; Sun, 09 Jun 2013 22:03:20 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.10.206 with SMTP id pb14csp55408vcb; Sun, 9 Jun 2013 22:03:20 -0700 (PDT) X-Received: by 10.68.190.196 with SMTP id gs4mr8345306pbc.189.1370840599728; Sun, 09 Jun 2013 22:03:19 -0700 (PDT) Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com [209.85.192.170]) by mx.google.com with ESMTPS id xx2si6242847pac.190.2013.06.09.22.03.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 09 Jun 2013 22:03:19 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.170 is neither permitted nor denied by best guess record for domain of zhangfei.gao@linaro.org) client-ip=209.85.192.170; Received: by mail-pd0-f170.google.com with SMTP id x11so1221505pdj.1 for ; Sun, 09 Jun 2013 22:03:19 -0700 (PDT) X-Received: by 10.66.67.5 with SMTP id j5mr12390805pat.176.1370840598591; Sun, 09 Jun 2013 22:03:18 -0700 (PDT) Received: from localhost.localdomain ([124.73.11.242]) by mx.google.com with ESMTPSA id eq4sm13955065pad.16.2013.06.09.22.03.13 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 09 Jun 2013 22:03:18 -0700 (PDT) From: Zhangfei Gao To: Wolfram Sang , Dirk Brandewie , baruch@tkos.co.il Cc: linux-arm-kernel@lists.infradead.org, devicetree-discuss@lists.ozlabs.org, Zhangfei Gao Subject: [PATCH v2 2/2] i2c: designware: add two optional property tx/rx-fifo-size Date: Mon, 10 Jun 2013 13:02:55 +0800 Message-Id: <1370840576-15651-3-git-send-email-zhangfei.gao@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1370840576-15651-1-git-send-email-zhangfei.gao@linaro.org> References: <1370840576-15651-1-git-send-email-zhangfei.gao@linaro.org> X-Gm-Message-State: ALoCoQmmtLlRFPwc+AvRApX+7B46iZLDi1wt9amWIz3G7WYO/5whVQJgPYmwV3lvl0jpTYO+r/bf X-Original-Sender: zhangfei.gao@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::234 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , rx-fifo-size and tx-fifo-size will be updated if provided from dts Signed-off-by: Zhangfei Gao CC: Baruch Siach --- .../devicetree/bindings/i2c/i2c-designware.txt | 7 +++++++ drivers/i2c/busses/i2c-designware-platdrv.c | 3 +++ 2 files changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/i2c/i2c-designware.txt b/Documentation/devicetree/bindings/i2c/i2c-designware.txt index e42a2ee..61fdb44 100644 --- a/Documentation/devicetree/bindings/i2c/i2c-designware.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-designware.txt @@ -6,6 +6,11 @@ Required properties : - reg : Offset and length of the register set for the device - interrupts : where IRQ is the interrupt number. +Optional properties: + + - rx-fifo-size : 1 cell, Rx fifo threshold + - tx-fifo-size : 1 cell, Tx fifo threshold + Recommended properties : - clock-frequency : desired I2C bus clock frequency in Hz. @@ -18,5 +23,7 @@ Example : compatible = "snps,designware-i2c"; reg = <0xf0000 0x1000>; interrupts = <11>; + rx-fifo-size = <16>; + tx-fifo-size = <16>; clock-frequency = <400000>; }; diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index 41659c0..6760cea 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -85,6 +85,7 @@ static int dw_i2c_probe(struct platform_device *pdev) struct dw_i2c_dev *dev; struct i2c_adapter *adap; struct resource *mem; + struct device_node *np = pdev->dev.of_node; int irq, r; /* NOTE: driver uses the static register mapping */ @@ -140,6 +141,8 @@ static int dw_i2c_probe(struct platform_device *pdev) dev->rx_fifo_depth = ((param1 >> 8) & 0xff) + 1; dev->adapter.nr = pdev->id; } + of_property_read_u32(np, "rx-fifo-size", &dev->rx_fifo_depth); + of_property_read_u32(np, "tx-fifo-size", &dev->tx_fifo_depth); r = i2c_dw_init(dev); if (r) return r;