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: 17773 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 40B142397B for ; Tue, 11 Jun 2013 02:31:36 +0000 (UTC) Received: by mail-qe0-f72.google.com with SMTP id 1sf2690513qec.7 for ; Mon, 10 Jun 2013 19:31:36 -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=eeGwS6dujx4bKFxH9MT1YF4vN1LrM5eC+7rvTTKhWXuVNNnanSsawyjAmBpYEqLXPQ xxsc9AhP3yPlInzJCbo6q08ya/tCporeuxFXb+5zK8l87JQ7ZlXhGYK/0FyRaBN0w5qn +Ir/wICFhyAPuDn2s7+9CzF+BqT8ppOKFDyci6fxvT3iBwycnGF7jUG+/uh1KhvC1Nbd mp90VGZXJeSD3mYvKm8V7xLef01o9Cza3yJMUX1g2yt+Jq5fQZnKncqk1/W0TeR6Vm+/ xN6LAfKW2q1bucRswgALl62kX5nzcGhvfd8HZPkBPedoj78xukIsnlcImh/zu6GlrySx j1LA== X-Received: by 10.224.174.145 with SMTP id t17mr9824917qaz.4.1370917895850; Mon, 10 Jun 2013 19:31:35 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.118.198 with SMTP id ko6ls2895179qeb.61.gmail; Mon, 10 Jun 2013 19:31:35 -0700 (PDT) X-Received: by 10.220.10.193 with SMTP id q1mr7275433vcq.2.1370917895483; Mon, 10 Jun 2013 19:31:35 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id dw4si171496vcb.44.2013.06.10.19.31.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Jun 2013 19:31:35 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id ib11so5077310vcb.3 for ; Mon, 10 Jun 2013 19:31:35 -0700 (PDT) X-Received: by 10.52.157.138 with SMTP id wm10mr6172677vdb.57.1370917895296; Mon, 10 Jun 2013 19:31:35 -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 pb14csp91310vcb; Mon, 10 Jun 2013 19:31:34 -0700 (PDT) X-Received: by 10.66.83.7 with SMTP id m7mr3035066pay.150.1370917893984; Mon, 10 Jun 2013 19:31:33 -0700 (PDT) Received: from mail-pb0-x22a.google.com (mail-pb0-x22a.google.com [2607:f8b0:400e:c01::22a]) by mx.google.com with ESMTPS id yu7si8084502pac.131.2013.06.10.19.31.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Jun 2013 19:31:33 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::22a is neither permitted nor denied by best guess record for domain of zhangfei.gao@linaro.org) client-ip=2607:f8b0:400e:c01::22a; Received: by mail-pb0-f42.google.com with SMTP id un1so3772295pbc.1 for ; Mon, 10 Jun 2013 19:31:33 -0700 (PDT) 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 Cc: linux-arm-kernel@lists.infradead.org, devicetree-discuss@lists.ozlabs.org, Zhangfei Gao 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: ALoCoQmFELBK/8GZOJ+x0vc73wQHcxz/7H7ZlPZzEFOmgFTxQ+RhVPTCuQDxyange1kcFo9oUYlY X-Original-Sender: zhangfei.gao@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.172 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;