From patchwork Tue Jun 11 02:37:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 17775 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f72.google.com (mail-qe0-f72.google.com [209.85.128.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9E5832397B for ; Tue, 11 Jun 2013 02:38:37 +0000 (UTC) Received: by mail-qe0-f72.google.com with SMTP id 1sf2695401qec.3 for ; Mon, 10 Jun 2013 19:38:37 -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=38Zz6lZQ7/2zDSu1+5aVi9XmmhwQBe+N++gIDTA9bLU=; b=meBhpseGHX6EdRLXVJj0/W0UL2+FBlwq1N8azlb2HdtfhSeUsWVNgRnj0v2C17MKll mrlsHwQQSYRTGZC8THUrV816hfQyBJZ4zEVk6z2+45JVWRZ9xfF+haw1MZv0sxpqDFVV LuQXDrGtmNA5BQ468mF4DeKrgUOrTsl8MgVyKEUFEsrQrwWNlcs0Lg+Z4QzYxUzXloTh qV49aWKvFuRtSMmyLt9D0WHd0W9BgQ2rQCADtD08fjxTAQjhqst7Nz/UOPYk3EiTV3fO Aw5ewwQf3BKiIulrKbvppDt65yX+hZnazaRdotSX3LDbZrRTIxLKUPgblYreri4fyLSv cdcw== X-Received: by 10.224.53.198 with SMTP id n6mr9900148qag.2.1370918317362; Mon, 10 Jun 2013 19:38:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.99.72 with SMTP id eo8ls3065210qeb.89.gmail; Mon, 10 Jun 2013 19:38:37 -0700 (PDT) X-Received: by 10.52.165.237 with SMTP id zb13mr3606057vdb.110.1370918317032; Mon, 10 Jun 2013 19:38:37 -0700 (PDT) Received: from mail-vb0-x234.google.com (mail-vb0-x234.google.com [2607:f8b0:400c:c02::234]) by mx.google.com with ESMTPS id nw6si6234346vcb.57.2013.06.10.19.38.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Jun 2013 19:38:37 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::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:c02::234; Received: by mail-vb0-f52.google.com with SMTP id f12so4119699vbg.11 for ; Mon, 10 Jun 2013 19:38:36 -0700 (PDT) X-Received: by 10.58.116.211 with SMTP id jy19mr7214145veb.7.1370918316107; Mon, 10 Jun 2013 19:38:36 -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 pb14csp91479vcb; Mon, 10 Jun 2013 19:38:35 -0700 (PDT) X-Received: by 10.68.178.33 with SMTP id cv1mr12218932pbc.209.1370918315139; Mon, 10 Jun 2013 19:38:35 -0700 (PDT) Received: from mail-pa0-x233.google.com (mail-pa0-x233.google.com [2607:f8b0:400e:c03::233]) by mx.google.com with ESMTPS id wu4si5949873pbc.198.2013.06.10.19.38.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Jun 2013 19:38:35 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::233 is neither permitted nor denied by best guess record for domain of zhangfei.gao@linaro.org) client-ip=2607:f8b0:400e:c03::233; Received: by mail-pa0-f51.google.com with SMTP id lf11so2336461pab.24 for ; Mon, 10 Jun 2013 19:38:34 -0700 (PDT) X-Received: by 10.66.148.201 with SMTP id tu9mr16342176pab.56.1370918314738; Mon, 10 Jun 2013 19:38:34 -0700 (PDT) Received: from localhost.localdomain ([67.198.145.34]) by mx.google.com with ESMTPSA id dg3sm10461723pbc.24.2013.06.10.19.38.30 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Jun 2013 19:38:34 -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 v3 2/2] i2c: designware: add two optional property tx/rx-fifo-size Date: Tue, 11 Jun 2013 10:37:10 +0800 Message-Id: <1370918230-24793-3-git-send-email-zhangfei.gao@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1370918230-24793-1-git-send-email-zhangfei.gao@linaro.org> References: <1370918230-24793-1-git-send-email-zhangfei.gao@linaro.org> X-Gm-Message-State: ALoCoQnP0eelHK7R7sze9TOjCAlgy3vsfqkcYlDpP1vPk8Yun18c+I9K9ncpUgJBrVMA6Vwfpapf X-Original-Sender: zhangfei.gao@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::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..84717fe 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 size + - tx-fifo-size : 1 cell, Tx fifo size + 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;