From patchwork Tue Jun 11 02:30:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 2699691 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 7C8143FD4E for ; Tue, 11 Jun 2013 02:32:03 +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 1UmENN-0000Ty-7c; Tue, 11 Jun 2013 02:32:01 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UmENK-0000Ux-C4; Tue, 11 Jun 2013 02:31:58 +0000 Received: from mail-pa0-x234.google.com ([2607:f8b0:400e:c03::234]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UmENH-0000Ud-Rh for linux-arm-kernel@lists.infradead.org; Tue, 11 Jun 2013 02:31:56 +0000 Received: by mail-pa0-f52.google.com with SMTP id kq13so1984220pab.39 for ; Mon, 10 Jun 2013 19:31:33 -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=Mxy8eSsRyk/yi+v9JDnlFLE9YImddng8Fl/QJJMR5+3yX7lqLhlPf1pTX1QBingBKO 7rJD9Uj7465jVK14fdoc/J2J/x7aJwVymY7/D4GUYmiOygdpdS2wEEQ9LaS5rneQgunm vHarIH/KEGIUVmK/b4rNOZQcpfXcAzcazOvNtrCkVvVbVlrERQkfDjWF3MNrsB/OeSWF UpZ95VarJFHaREvK+1w9xJgkk7vdg9CUro0kxw7E0PDget3XHDa2ciFT8qfQdTVlMtbu JpWL/vHlcDjs1+SNBx58jal61zQP1mKRNTjb9TvoVudXti504qY+I4R/8I5MU8DC3QYP /T/Q== X-Received: by 10.66.167.202 with SMTP id zq10mr16253878pab.61.1370917893603; Mon, 10 Jun 2013 19:31:33 -0700 (PDT) Received: from localhost.localdomain ([67.198.145.34]) by mx.google.com with ESMTPSA id pq5sm8541848pbc.7.2013.06.10.19.31.29 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Jun 2013 19:31:32 -0700 (PDT) From: Zhangfei Gao To: Wolfram Sang , Dirk Brandewie , baruch@tkos.co.il Subject: [PATCH 2/2] i2c: designware: add two optional property tx/rx-fifo-size Date: Tue, 11 Jun 2013 10:30:20 +0800 Message-Id: <1370917820-24176-1-git-send-email-zhangfei.gao@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <51B687E5.307@linaro.org> References: <51B687E5.307@linaro.org> X-Gm-Message-State: ALoCoQkuY1OJYgCVMhS7i+fEseeF9ILFgichSn00HAFEFgnXgzIgusPzCUTnZiFWCZIAA9dyiJ7h X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130610_223155_999451_9A467AFE X-CRM114-Status: GOOD ( 11.68 ) 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 --- .../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;