Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-24 Thread christian . ruppert
Dear Lucas, "De Marchi, Lucas" wrote on 24.06.2015 14:56:19: > On Wed, 2015-06-24 at 14:27 +0300, Mika Westerberg wrote: > > On Wed, Jun 24, 2015 at 09:36:43AM +0200, christian.rupp...@alitech.com wrot > > e: > > > Dear Lucas, > > > > > > Lucas De Marchi wrote on 23.06.2015 19:02:03: > > >

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-24 Thread mika.westerb...@linux.intel.com
On Wed, Jun 24, 2015 at 12:56:19PM +, De Marchi, Lucas wrote: > Yeah, but it would be bad to ignore the problem as well. The way it is now > kills any possibility of using DW controller for reading sensors like > gyroscope, accelerometer, barometer that have higher sampling rate etc. I'll >

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-24 Thread De Marchi, Lucas
On Wed, 2015-06-24 at 14:27 +0300, Mika Westerberg wrote: > On Wed, Jun 24, 2015 at 09:36:43AM +0200, christian.rupp...@alitech.com wrot > e: > > Dear Lucas, > > > > Lucas De Marchi wrote on 23.06.2015 19:02:03: > > > On Tue, Jun 23, 2015 at 1:45 PM, wrote: > > > > Hello, > > > > > > > >

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-24 Thread Mika Westerberg
On Wed, Jun 24, 2015 at 09:36:43AM +0200, christian.rupp...@alitech.com wrote: > Dear Lucas, > > Lucas De Marchi wrote on 23.06.2015 19:02:03: > > On Tue, Jun 23, 2015 at 1:45 PM, wrote: > > > Hello, > > > > > > Christian Ruppert/ALi_GVA/ALi wrote on 10.06.2015 17:05:16: > > [...] > > > The

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-24 Thread christian . ruppert
Dear Lucas, Lucas De Marchi wrote on 23.06.2015 19:02:03: > On Tue, Jun 23, 2015 at 1:45 PM, wrote: > > Hello, > > > > Christian Ruppert/ALi_GVA/ALi wrote on 10.06.2015 17:05:16: > [...] > > The result is not very encouraging: Out of five (identical) designware i2c > > controllers we have on

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-24 Thread christian . ruppert
Dear Lucas, Lucas De Marchi lucas.de.mar...@gmail.com wrote on 23.06.2015 19:02:03: On Tue, Jun 23, 2015 at 1:45 PM, christian.rupp...@alitech.com wrote: Hello, Christian Ruppert/ALi_GVA/ALi wrote on 10.06.2015 17:05:16: [...] The result is not very encouraging: Out of five (identical)

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-24 Thread Mika Westerberg
On Wed, Jun 24, 2015 at 09:36:43AM +0200, christian.rupp...@alitech.com wrote: Dear Lucas, Lucas De Marchi lucas.de.mar...@gmail.com wrote on 23.06.2015 19:02:03: On Tue, Jun 23, 2015 at 1:45 PM, christian.rupp...@alitech.com wrote: Hello, Christian Ruppert/ALi_GVA/ALi wrote on

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-24 Thread De Marchi, Lucas
On Wed, 2015-06-24 at 14:27 +0300, Mika Westerberg wrote: On Wed, Jun 24, 2015 at 09:36:43AM +0200, christian.rupp...@alitech.com wrot e: Dear Lucas, Lucas De Marchi lucas.de.mar...@gmail.com wrote on 23.06.2015 19:02:03: On Tue, Jun 23, 2015 at 1:45 PM, christian.rupp...@alitech.com

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-24 Thread mika.westerb...@linux.intel.com
On Wed, Jun 24, 2015 at 12:56:19PM +, De Marchi, Lucas wrote: Yeah, but it would be bad to ignore the problem as well. The way it is now kills any possibility of using DW controller for reading sensors like gyroscope, accelerometer, barometer that have higher sampling rate etc. I'll try

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-24 Thread christian . ruppert
Dear Lucas, De Marchi, Lucas lucas.demar...@intel.com wrote on 24.06.2015 14:56:19: On Wed, 2015-06-24 at 14:27 +0300, Mika Westerberg wrote: On Wed, Jun 24, 2015 at 09:36:43AM +0200, christian.rupp...@alitech.com wrot e: Dear Lucas, Lucas De Marchi lucas.de.mar...@gmail.com

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-23 Thread Lucas De Marchi
On Tue, Jun 23, 2015 at 1:45 PM, wrote: > Hello, > > Christian Ruppert/ALi_GVA/ALi wrote on 10.06.2015 17:05:16: >> Mika Westerberg wrote on 10.06. >> 2015 09:07:22: >> > On Tue, Jun 09, 2015 at 03:29:01PM -0300, Lucas De Marchi wrote: >> > > Hi Mika, >> > > >> > > On Tue, Jun 9, 2015 at 5:51

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-23 Thread christian . ruppert
Hello, Christian Ruppert/ALi_GVA/ALi wrote on 10.06.2015 17:05:16: > Mika Westerberg wrote on 10.06. > 2015 09:07:22: > > On Tue, Jun 09, 2015 at 03:29:01PM -0300, Lucas De Marchi wrote: > > > Hi Mika, > > > > > > On Tue, Jun 9, 2015 at 5:51 AM, Mika Westerberg > > > wrote: > > > > On Mon, Jun

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-23 Thread christian . ruppert
Hello, Christian Ruppert/ALi_GVA/ALi wrote on 10.06.2015 17:05:16: Mika Westerberg mika.westerb...@linux.intel.com wrote on 10.06. 2015 09:07:22: On Tue, Jun 09, 2015 at 03:29:01PM -0300, Lucas De Marchi wrote: Hi Mika, On Tue, Jun 9, 2015 at 5:51 AM, Mika Westerberg

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-23 Thread Lucas De Marchi
On Tue, Jun 23, 2015 at 1:45 PM, christian.rupp...@alitech.com wrote: Hello, Christian Ruppert/ALi_GVA/ALi wrote on 10.06.2015 17:05:16: Mika Westerberg mika.westerb...@linux.intel.com wrote on 10.06. 2015 09:07:22: On Tue, Jun 09, 2015 at 03:29:01PM -0300, Lucas De Marchi wrote: Hi

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-15 Thread Mika Westerberg
On Fri, Jun 12, 2015 at 07:45:00PM -0300, Lucas De Marchi wrote: > Hi Mika, > > On Wed, Jun 10, 2015 at 4:55 AM, Mika Westerberg > wrote: > > On Mon, Jun 08, 2015 at 02:50:28PM -0300, lucas.de.mar...@gmail.com wrote: > >> @@ -320,7 +320,7 @@ static int dw_i2c_resume(struct device *dev) > >>

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-15 Thread Mika Westerberg
On Fri, Jun 12, 2015 at 07:45:00PM -0300, Lucas De Marchi wrote: Hi Mika, On Wed, Jun 10, 2015 at 4:55 AM, Mika Westerberg mika.westerb...@linux.intel.com wrote: On Mon, Jun 08, 2015 at 02:50:28PM -0300, lucas.de.mar...@gmail.com wrote: @@ -320,7 +320,7 @@ static int dw_i2c_resume(struct

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-12 Thread Lucas De Marchi
Hi Mika, On Wed, Jun 10, 2015 at 4:55 AM, Mika Westerberg wrote: > On Mon, Jun 08, 2015 at 02:50:28PM -0300, lucas.de.mar...@gmail.com wrote: >> @@ -320,7 +320,7 @@ static int dw_i2c_resume(struct device *dev) >> clk_prepare_enable(i_dev->clk); >> >> if (!i_dev->pm_runtime_disabled)

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-12 Thread Lucas De Marchi
Hi Mika, On Wed, Jun 10, 2015 at 4:55 AM, Mika Westerberg mika.westerb...@linux.intel.com wrote: On Mon, Jun 08, 2015 at 02:50:28PM -0300, lucas.de.mar...@gmail.com wrote: @@ -320,7 +320,7 @@ static int dw_i2c_resume(struct device *dev) clk_prepare_enable(i_dev-clk); if

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-11 Thread Lucas De Marchi
Hi, On 06/10, christian.rupp...@alitech.com wrote: > Mika Westerberg wrote on 10.06.2015 > 09:07:22: > > My concern is that this patch might break some non-Intel platform. It > > would be nice if someone (Christian?) could try this out. > > Ouch, this one brings back painful memories. Take a

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-11 Thread Mika Westerberg
On Wed, Jun 10, 2015 at 05:05:16PM +0200, christian.rupp...@alitech.com wrote: >We should understand why the controller was disabled after successful >transfers in the first place, however. Maybe some quirk with older >versions of the hardware? Mika, do you have any memories about

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-11 Thread Mika Westerberg
On Wed, Jun 10, 2015 at 05:05:16PM +0200, christian.rupp...@alitech.com wrote: We should understand why the controller was disabled after successful transfers in the first place, however. Maybe some quirk with older versions of the hardware? Mika, do you have any memories about this?

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-11 Thread Lucas De Marchi
Hi, On 06/10, christian.rupp...@alitech.com wrote: Mika Westerberg mika.westerb...@linux.intel.com wrote on 10.06.2015 09:07:22: My concern is that this patch might break some non-Intel platform. It would be nice if someone (Christian?) could try this out. Ouch, this one brings back

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-10 Thread Mika Westerberg
On Mon, Jun 08, 2015 at 02:50:28PM -0300, lucas.de.mar...@gmail.com wrote: > @@ -320,7 +320,7 @@ static int dw_i2c_resume(struct device *dev) > clk_prepare_enable(i_dev->clk); > > if (!i_dev->pm_runtime_disabled) > - i2c_dw_init(i_dev); > +

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-10 Thread Mika Westerberg
On Tue, Jun 09, 2015 at 03:29:01PM -0300, Lucas De Marchi wrote: > Hi Mika, > > On Tue, Jun 9, 2015 at 5:51 AM, Mika Westerberg > wrote: > > On Mon, Jun 08, 2015 at 02:50:28PM -0300, lucas.de.mar...@gmail.com wrote: > >> From: Fabio Mello > >> > >> According to documentation and tests,

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-10 Thread Mika Westerberg
On Mon, Jun 08, 2015 at 02:50:28PM -0300, lucas.de.mar...@gmail.com wrote: @@ -320,7 +320,7 @@ static int dw_i2c_resume(struct device *dev) clk_prepare_enable(i_dev-clk); if (!i_dev-pm_runtime_disabled) - i2c_dw_init(i_dev); + i2c_dw_enable(i_dev); This

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-10 Thread Mika Westerberg
On Tue, Jun 09, 2015 at 03:29:01PM -0300, Lucas De Marchi wrote: Hi Mika, On Tue, Jun 9, 2015 at 5:51 AM, Mika Westerberg mika.westerb...@linux.intel.com wrote: On Mon, Jun 08, 2015 at 02:50:28PM -0300, lucas.de.mar...@gmail.com wrote: From: Fabio Mello fabio.me...@intel.com According

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-09 Thread Lucas De Marchi
Hi Mika, On Tue, Jun 9, 2015 at 5:51 AM, Mika Westerberg wrote: > On Mon, Jun 08, 2015 at 02:50:28PM -0300, lucas.de.mar...@gmail.com wrote: >> From: Fabio Mello >> >> According to documentation and tests, initialization is not >> necessary on module resume, since the controller keeps its state

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-09 Thread Mika Westerberg
On Mon, Jun 08, 2015 at 02:50:28PM -0300, lucas.de.mar...@gmail.com wrote: > From: Fabio Mello > > According to documentation and tests, initialization is not > necessary on module resume, since the controller keeps its state > between disable/enable. Change the target address is also allowed. >

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-09 Thread Mika Westerberg
On Mon, Jun 08, 2015 at 02:50:28PM -0300, lucas.de.mar...@gmail.com wrote: From: Fabio Mello fabio.me...@intel.com According to documentation and tests, initialization is not necessary on module resume, since the controller keeps its state between disable/enable. Change the target address is

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-09 Thread Lucas De Marchi
Hi Mika, On Tue, Jun 9, 2015 at 5:51 AM, Mika Westerberg mika.westerb...@linux.intel.com wrote: On Mon, Jun 08, 2015 at 02:50:28PM -0300, lucas.de.mar...@gmail.com wrote: From: Fabio Mello fabio.me...@intel.com According to documentation and tests, initialization is not necessary on module

[PATCH] i2c: designware: use enable on resume instead initialization

2015-06-08 Thread lucas . de . marchi
From: Fabio Mello According to documentation and tests, initialization is not necessary on module resume, since the controller keeps its state between disable/enable. Change the target address is also allowed. So, this patch replaces the initialization on module resume with a simple enable, and

[PATCH] i2c: designware: use enable on resume instead initialization

2015-06-08 Thread lucas . de . marchi
From: Fabio Mello fabio.me...@intel.com According to documentation and tests, initialization is not necessary on module resume, since the controller keeps its state between disable/enable. Change the target address is also allowed. So, this patch replaces the initialization on module resume with