From patchwork Fri Jul 26 13:22:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 18605 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gg0-f198.google.com (mail-gg0-f198.google.com [209.85.161.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F0BB825E59 for ; Fri, 26 Jul 2013 13:25:09 +0000 (UTC) Received: by mail-gg0-f198.google.com with SMTP id p4sf2387312ggn.5 for ; Fri, 26 Jul 2013 06:25:09 -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=PpMsAiTy/a0FUNYNOwew0UuCpnF8u0PmfA5DGL3gw78=; b=m+6hBiHYNljerS/lopJaBALP2V2YyEHsbY9h5OxoM0qvelFarImx1zKrb9cJxxmJhp wDoWlD/dAFm/I5VlmDqRzE+CC2P2PQLhYgnICRgDtZQWVvecgglS5JkmflqQtFmGeseH m5zFMvhaLGsS0W/2kWrOsiAQdJ158yc/MIg3ldo7bMIcXs+09rYX6Fy+neEy9sgOLNdm hikjyeO7Dmoov7od98ZG3nCPRMo3A5ke6valp+LoNGdt1GELJImu0qNtGY/jMZNVunAY uFx+QoGklN28S62K77iCNrd5rw/X3g/CFf6mScLhxjd1KOV/s3DpAxRwuDjpucbSDJrM AYQg== X-Received: by 10.236.113.77 with SMTP id z53mr19590687yhg.47.1374845109537; Fri, 26 Jul 2013 06:25:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.118.227 with SMTP id kp3ls999762qeb.19.gmail; Fri, 26 Jul 2013 06:25:09 -0700 (PDT) X-Received: by 10.52.186.129 with SMTP id fk1mr16966174vdc.66.1374845109397; Fri, 26 Jul 2013 06:25:09 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id zj7si180807vdb.90.2013.07.26.06.25.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Jul 2013 06:25:09 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.171 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.171; Received: by mail-vc0-f171.google.com with SMTP id ij15so486822vcb.2 for ; Fri, 26 Jul 2013 06:25:09 -0700 (PDT) X-Received: by 10.58.45.70 with SMTP id k6mr20900382vem.9.1374845109292; Fri, 26 Jul 2013 06:25:09 -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.58.165.8 with SMTP id yu8csp23044veb; Fri, 26 Jul 2013 06:25:08 -0700 (PDT) X-Received: by 10.66.227.39 with SMTP id rx7mr14119319pac.44.1374845108274; Fri, 26 Jul 2013 06:25:08 -0700 (PDT) Received: from mail-pd0-f177.google.com (mail-pd0-f177.google.com [209.85.192.177]) by mx.google.com with ESMTPS id gy1si2549498pac.7.2013.07.26.06.25.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Jul 2013 06:25:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.177 is neither permitted nor denied by best guess record for domain of zhangfei.gao@linaro.org) client-ip=209.85.192.177; Received: by mail-pd0-f177.google.com with SMTP id u11so2919037pdi.22 for ; Fri, 26 Jul 2013 06:25:07 -0700 (PDT) X-Received: by 10.66.161.195 with SMTP id xu3mr55314080pab.56.1374845107163; Fri, 26 Jul 2013 06:25:07 -0700 (PDT) Received: from localhost.localdomain ([114.97.97.190]) by mx.google.com with ESMTPSA id x8sm60092056pbb.39.2013.07.26.06.24.45 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Jul 2013 06:25:06 -0700 (PDT) From: Zhangfei Gao To: Wolfram Sang , Baruch Siach Cc: linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, Zhangfei Gao Subject: [PATCH v4 2/2] i2c: designware: add two optional property tx/rx-fifo-size Date: Fri, 26 Jul 2013 21:22:18 +0800 Message-Id: <1374844938-25505-3-git-send-email-zhangfei.gao@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1374844938-25505-1-git-send-email-zhangfei.gao@linaro.org> References: <1374844938-25505-1-git-send-email-zhangfei.gao@linaro.org> X-Gm-Message-State: ALoCoQkfoJkM6nbAZ4yf9K0SaqqCWFGd3ZGG2rJQBQtMaPvoCaE6Q/TjRl5wQG5o6ZsdeJBLEqJq X-Original-Sender: zhangfei.gao@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.171 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: , Some platform can not get fifo-size info form register DW_IC_COMP_PARAM_1. Give chance to update rx-fifo-size and tx-fifo-size if provided in dts. Signed-off-by: Zhangfei Gao 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 7fd7fa2..af0bf8f 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. @@ -22,6 +27,8 @@ 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 36ceebc..f657e65 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -86,6 +86,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; irq = platform_get_irq(pdev, 0); @@ -145,6 +146,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;