From mboxrd@z Thu Jan 1 00:00:00 1970 From: Baruch Siach Subject: Re: [PATCH v3 2/2] i2c: designware: add two optional property tx/rx-fifo-size Date: Fri, 14 Jun 2013 06:37:11 +0300 Message-ID: <20130614033711.GA4312@tarshish> References: <1370918230-24793-1-git-send-email-zhangfei.gao@linaro.org> <1370918230-24793-3-git-send-email-zhangfei.gao@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1370918230-24793-3-git-send-email-zhangfei.gao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: "devicetree-discuss" To: Zhangfei Gao Cc: Dirk Brandewie , devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Wolfram Sang List-Id: devicetree@vger.kernel.org Hi Zhangfei, On Tue, Jun 11, 2013 at 10:37:10AM +0800, Zhangfei Gao wrote: > 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; -- http://baruch.siach.name/blog/ ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org - tel: +972.2.679.5364, http://www.tkos.co.il -