[PATCH v2 5/7] i2c-designware: enable/disable the controller properly

2013-04-10 Thread Mika Westerberg
The correct way to disable or enable the controller is to wait until the DW_IC_ENABLE_STATUS register bit matches the bit we program into DW_IC_ENABLE register. This procedure is described in the DesignWare I2C databook. By doing this we can be sure that the controller is in correct state once

[PATCH v2 5/7] i2c-designware: enable/disable the controller properly

2013-04-10 Thread Mika Westerberg
The correct way to disable or enable the controller is to wait until the DW_IC_ENABLE_STATUS register bit matches the bit we program into DW_IC_ENABLE register. This procedure is described in the DesignWare I2C databook. By doing this we can be sure that the controller is in correct state once

Re: [5/7] i2c-designware: enable/disable the controller properly

2013-04-09 Thread Mika Westerberg
On Tue, Apr 09, 2013 at 11:28:57AM +0200, Wolfram Sang wrote: > On Tue, Apr 09, 2013 at 12:28:36PM +0300, Mika Westerberg wrote: > > On Tue, Apr 09, 2013 at 11:09:14AM +0200, Wolfram Sang wrote: > > > > > > > +static void __i2c_dw_enable(struct dw_i2c_dev *dev, bool enable) > > > > +{ > > > > +

Re: [5/7] i2c-designware: enable/disable the controller properly

2013-04-09 Thread Wolfram Sang
On Tue, Apr 09, 2013 at 12:28:36PM +0300, Mika Westerberg wrote: > On Tue, Apr 09, 2013 at 11:09:14AM +0200, Wolfram Sang wrote: > > > > > +static void __i2c_dw_enable(struct dw_i2c_dev *dev, bool enable) > > > +{ > > > + int timeout = 100; > > > + > > > + do { > > > + dw_writel(dev,

Re: [5/7] i2c-designware: enable/disable the controller properly

2013-04-09 Thread Mika Westerberg
On Tue, Apr 09, 2013 at 11:09:14AM +0200, Wolfram Sang wrote: > > > +static void __i2c_dw_enable(struct dw_i2c_dev *dev, bool enable) > > +{ > > + int timeout = 100; > > + > > + do { > > + dw_writel(dev, enable, DW_IC_ENABLE); > > + if ((dw_readl(dev, DW_IC_ENABLE_STATUS)

Re: [5/7] i2c-designware: enable/disable the controller properly

2013-04-09 Thread Wolfram Sang
> +static void __i2c_dw_enable(struct dw_i2c_dev *dev, bool enable) > +{ > + int timeout = 100; > + > + do { > + dw_writel(dev, enable, DW_IC_ENABLE); > + if ((dw_readl(dev, DW_IC_ENABLE_STATUS) & 1) == enable) > + return; > + > +

Re: [5/7] i2c-designware: enable/disable the controller properly

2013-04-09 Thread Wolfram Sang
+static void __i2c_dw_enable(struct dw_i2c_dev *dev, bool enable) +{ + int timeout = 100; + + do { + dw_writel(dev, enable, DW_IC_ENABLE); + if ((dw_readl(dev, DW_IC_ENABLE_STATUS) 1) == enable) + return; + +

Re: [5/7] i2c-designware: enable/disable the controller properly

2013-04-09 Thread Mika Westerberg
On Tue, Apr 09, 2013 at 11:09:14AM +0200, Wolfram Sang wrote: +static void __i2c_dw_enable(struct dw_i2c_dev *dev, bool enable) +{ + int timeout = 100; + + do { + dw_writel(dev, enable, DW_IC_ENABLE); + if ((dw_readl(dev, DW_IC_ENABLE_STATUS) 1) == enable)

Re: [5/7] i2c-designware: enable/disable the controller properly

2013-04-09 Thread Wolfram Sang
On Tue, Apr 09, 2013 at 12:28:36PM +0300, Mika Westerberg wrote: On Tue, Apr 09, 2013 at 11:09:14AM +0200, Wolfram Sang wrote: +static void __i2c_dw_enable(struct dw_i2c_dev *dev, bool enable) +{ + int timeout = 100; + + do { + dw_writel(dev, enable, DW_IC_ENABLE);

Re: [5/7] i2c-designware: enable/disable the controller properly

2013-04-09 Thread Mika Westerberg
On Tue, Apr 09, 2013 at 11:28:57AM +0200, Wolfram Sang wrote: On Tue, Apr 09, 2013 at 12:28:36PM +0300, Mika Westerberg wrote: On Tue, Apr 09, 2013 at 11:09:14AM +0200, Wolfram Sang wrote: +static void __i2c_dw_enable(struct dw_i2c_dev *dev, bool enable) +{ + int timeout =

[PATCH 5/7] i2c-designware: enable/disable the controller properly

2013-03-21 Thread Mika Westerberg
The correct way to disable or enable the controller is to wait until DW_IC_ENABLE_STATUS register bit matches the bit we program to the DW_IC_ENABLE register. This procedure is described in the DesignWare I2C handbook. By doing this we can be sure that the controller is in correct state once the

[PATCH 5/7] i2c-designware: enable/disable the controller properly

2013-03-21 Thread Mika Westerberg
The correct way to disable or enable the controller is to wait until DW_IC_ENABLE_STATUS register bit matches the bit we program to the DW_IC_ENABLE register. This procedure is described in the DesignWare I2C handbook. By doing this we can be sure that the controller is in correct state once the