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: 2699711 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id 8328D3FD4E for ; Tue, 11 Jun 2013 02:40:10 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UmEUY-0001N4-9i; Tue, 11 Jun 2013 02:39:27 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UmEUJ-0000ag-Gb; Tue, 11 Jun 2013 02:39:11 +0000 Received: from mail-pb0-x234.google.com ([2607:f8b0:400e:c01::234]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UmEU4-0000Yv-6r for linux-arm-kernel@lists.infradead.org; Tue, 11 Jun 2013 02:38:57 +0000 Received: by mail-pb0-f52.google.com with SMTP id xa12so7885532pbc.25 for ; Mon, 10 Jun 2013 19:38:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=38Zz6lZQ7/2zDSu1+5aVi9XmmhwQBe+N++gIDTA9bLU=; b=gMQC2YG/sFn2oU128xpT5SG0MxUFPwln6/z7iJWNcAj/NwaUE+LjfVxepdCTQsPSxO 9HoLZQubqIfDnlp96ZTk/dIjGZsD06e8CwL9NPkPoRIHSazbPL3ha7OHFNKjIkA1NEZu wy238QlG2D4791jrDsb+8Sp73GsCKG9Zf0UHWAO902JSuNze2gsikh9hIIRJz6iRGK39 Se2gnB6jdIRA6tMXdIUTOJKtMV9+tU20cQ0wjtXp1rJT6JDhtBlmMVmUVuAvAg5ERM66 5ZQf6NWEDWIp8DFzsUC6lXteoIG1ZaaO1kWFE0KNBSiKibFgF9J1potVSATWHtghuEo4 xvYA== 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 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: ALoCoQmHcflv0ej6A2LpeRudIHHiFTlmY6IZX0whmS9DdP0ikj9N/PDYEFvw5KG0df8UApMdqoad X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130610_223856_391341_0A601154 X-CRM114-Status: GOOD ( 11.78 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Zhangfei Gao , devicetree-discuss@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org rx-fifo-size and tx-fifo-size will be updated if provided from dts Signed-off-by: Zhangfei Gao CC: Baruch Siach Acked-by: 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;