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: 2695741 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 D3E163FD4E for ; Mon, 10 Jun 2013 05:04:50 +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 1UluGx-0000jj-7E; Mon, 10 Jun 2013 05:04:04 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UluGj-0000qX-Ei; Mon, 10 Jun 2013 05:03:49 +0000 Received: from mail-pa0-x22c.google.com ([2607:f8b0:400e:c03::22c]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UluGc-0000or-8A for linux-arm-kernel@lists.infradead.org; Mon, 10 Jun 2013 05:03:43 +0000 Received: by mail-pa0-f44.google.com with SMTP id lj1so952100pab.31 for ; Sun, 09 Jun 2013 22:03:19 -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=ccbJuy8uCerHbIdjna2rBAxOYpRv9YQzheyhzHeX4oA=; b=KUB2CCeVYPpMR/h+dBHoKFVAHs8R3moQ5nIdnW4R88+t63ZjW/6d9b2PTKSmGmHVcj Q7baFUxWjHMwdV1cuOOVjyI9Om3x0UD0RD4vSmk+aBM7+DFB6BdNaieIrI52X5EqtmpN 2x6lsbZRnBDnL0NW+P5WD4jBA9oTjcKWLyhi6D8nfg49GjyynPNJ7vU7xRqwfxazJbJp O8N3uPJiGZZt3vR4BJsX+vp7FMuwq8W7sPJcvLN2bk8uRUPFt6Rv3uAaYB1uMxqqvndR psIDm5V7wNq0hkwIZQmWAtlA4Imx2ZRVd/b5DZrkEI6M4PvQPoMiF5pEcQLTovfen1bf cVpg== 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 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: ALoCoQnZCbc1+8LtDDpDkjyzSS2eruQD/AGqtdzQSmWIi2be/vZ2zmAdYVk4bmnW2cFVhTmcon/S X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130610_010342_437682_21444DA2 X-CRM114-Status: GOOD ( 12.18 ) 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..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;