Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-13 Thread M'boumba Cedric Madianga
Ok so I am going to send the v9 asap. Thanks 2017-01-13 9:45 GMT+01:00 Uwe Kleine-König : > On Fri, Jan 13, 2017 at 09:29:03AM +0100, Wolfram Sang wrote: >> >> > (But note that this is irrelevant for the patch as the driver doesn't >> > claim to support this kind

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-13 Thread M'boumba Cedric Madianga
Ok so I am going to send the v9 asap. Thanks 2017-01-13 9:45 GMT+01:00 Uwe Kleine-König : > On Fri, Jan 13, 2017 at 09:29:03AM +0100, Wolfram Sang wrote: >> >> > (But note that this is irrelevant for the patch as the driver doesn't >> > claim to support this kind of transfer.) >> >> Yes, I wanted

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-13 Thread Uwe Kleine-König
On Fri, Jan 13, 2017 at 09:29:03AM +0100, Wolfram Sang wrote: > > > (But note that this is irrelevant for the patch as the driver doesn't > > claim to support this kind of transfer.) > > Yes, I wanted to mention that, too. > > I'd think the series is good to go in? AFAICT there are some

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-13 Thread Uwe Kleine-König
On Fri, Jan 13, 2017 at 09:29:03AM +0100, Wolfram Sang wrote: > > > (But note that this is irrelevant for the patch as the driver doesn't > > claim to support this kind of transfer.) > > Yes, I wanted to mention that, too. > > I'd think the series is good to go in? AFAICT there are some

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-13 Thread Wolfram Sang
> (But note that this is irrelevant for the patch as the driver doesn't > claim to support this kind of transfer.) Yes, I wanted to mention that, too. I'd think the series is good to go in? signature.asc Description: PGP signature

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-13 Thread Wolfram Sang
> (But note that this is irrelevant for the patch as the driver doesn't > claim to support this kind of transfer.) Yes, I wanted to mention that, too. I'd think the series is good to go in? signature.asc Description: PGP signature

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-12 Thread Uwe Kleine-König
Hello, On Thu, Jan 12, 2017 at 10:28:20PM +0100, M'boumba Cedric Madianga wrote: > Please see below a quote from datasheet that clearly described how to handle > For 2-byte reception: > ● Wait until ADDR = 1 (SCL stretched low until the ADDR flag is cleared) > ● Set ACK low, set POS high > ●

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-12 Thread Uwe Kleine-König
Hello, On Thu, Jan 12, 2017 at 10:28:20PM +0100, M'boumba Cedric Madianga wrote: > Please see below a quote from datasheet that clearly described how to handle > For 2-byte reception: > ● Wait until ADDR = 1 (SCL stretched low until the ADDR flag is cleared) > ● Set ACK low, set POS high > ●

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-12 Thread M'boumba Cedric Madianga
2017-01-12 22:10 GMT+01:00 Uwe Kleine-König : > On Thu, Jan 12, 2017 at 09:58:23PM +0100, M'boumba Cedric Madianga wrote: >> 2017-01-12 18:49 GMT+01:00 Uwe Kleine-König : >> > On Thu, Jan 12, 2017 at 02:47:42PM +0100, M'boumba Cedric

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-12 Thread M'boumba Cedric Madianga
2017-01-12 22:10 GMT+01:00 Uwe Kleine-König : > On Thu, Jan 12, 2017 at 09:58:23PM +0100, M'boumba Cedric Madianga wrote: >> 2017-01-12 18:49 GMT+01:00 Uwe Kleine-König : >> > On Thu, Jan 12, 2017 at 02:47:42PM +0100, M'boumba Cedric Madianga wrote: >> >> 2017-01-12 13:03 GMT+01:00 Uwe

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-12 Thread Uwe Kleine-König
On Thu, Jan 12, 2017 at 09:58:23PM +0100, M'boumba Cedric Madianga wrote: > 2017-01-12 18:49 GMT+01:00 Uwe Kleine-König : > > On Thu, Jan 12, 2017 at 02:47:42PM +0100, M'boumba Cedric Madianga wrote: > >> 2017-01-12 13:03 GMT+01:00 Uwe Kleine-König > >>

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-12 Thread Uwe Kleine-König
On Thu, Jan 12, 2017 at 09:58:23PM +0100, M'boumba Cedric Madianga wrote: > 2017-01-12 18:49 GMT+01:00 Uwe Kleine-König : > > On Thu, Jan 12, 2017 at 02:47:42PM +0100, M'boumba Cedric Madianga wrote: > >> 2017-01-12 13:03 GMT+01:00 Uwe Kleine-König > >> : > >> > Hello Cedric, > >> > > >> > On

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-12 Thread M'boumba Cedric Madianga
2017-01-12 18:49 GMT+01:00 Uwe Kleine-König : > On Thu, Jan 12, 2017 at 02:47:42PM +0100, M'boumba Cedric Madianga wrote: >> 2017-01-12 13:03 GMT+01:00 Uwe Kleine-König : >> > Hello Cedric, >> > >> > On Thu, Jan 12, 2017 at 12:23:12PM

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-12 Thread M'boumba Cedric Madianga
2017-01-12 18:49 GMT+01:00 Uwe Kleine-König : > On Thu, Jan 12, 2017 at 02:47:42PM +0100, M'boumba Cedric Madianga wrote: >> 2017-01-12 13:03 GMT+01:00 Uwe Kleine-König : >> > Hello Cedric, >> > >> > On Thu, Jan 12, 2017 at 12:23:12PM +0100, M'boumba Cedric Madianga wrote: >> >> 2017-01-11 16:39

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-12 Thread Uwe Kleine-König
On Thu, Jan 12, 2017 at 02:47:42PM +0100, M'boumba Cedric Madianga wrote: > 2017-01-12 13:03 GMT+01:00 Uwe Kleine-König : > > Hello Cedric, > > > > On Thu, Jan 12, 2017 at 12:23:12PM +0100, M'boumba Cedric Madianga wrote: > >> 2017-01-11 16:39 GMT+01:00 Uwe

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-12 Thread Uwe Kleine-König
On Thu, Jan 12, 2017 at 02:47:42PM +0100, M'boumba Cedric Madianga wrote: > 2017-01-12 13:03 GMT+01:00 Uwe Kleine-König : > > Hello Cedric, > > > > On Thu, Jan 12, 2017 at 12:23:12PM +0100, M'boumba Cedric Madianga wrote: > >> 2017-01-11 16:39 GMT+01:00 Uwe Kleine-König > >> : > >> > On Wed, Jan

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-12 Thread M'boumba Cedric Madianga
>>> > I don't understand scl_period = 1 µs for Fast Mode. For a bus freqency >>> > of 400 kHz we need low + high = 2.5 µs. Is there a factor 10 missing >>> > somewhere? >>> >>> As CCR = SCL_period * I2C parent clk frequency with minimal freq = >>> 2Mhz and SCL_period = 1 we have: >>> CCR = 1 *

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-12 Thread M'boumba Cedric Madianga
>>> > I don't understand scl_period = 1 µs for Fast Mode. For a bus freqency >>> > of 400 kHz we need low + high = 2.5 µs. Is there a factor 10 missing >>> > somewhere? >>> >>> As CCR = SCL_period * I2C parent clk frequency with minimal freq = >>> 2Mhz and SCL_period = 1 we have: >>> CCR = 1 *

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-12 Thread M'boumba Cedric Madianga
2017-01-12 13:03 GMT+01:00 Uwe Kleine-König : > Hello Cedric, > > On Thu, Jan 12, 2017 at 12:23:12PM +0100, M'boumba Cedric Madianga wrote: >> 2017-01-11 16:39 GMT+01:00 Uwe Kleine-König : >> > On Wed, Jan 11, 2017 at 02:58:44PM

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-12 Thread M'boumba Cedric Madianga
2017-01-12 13:03 GMT+01:00 Uwe Kleine-König : > Hello Cedric, > > On Thu, Jan 12, 2017 at 12:23:12PM +0100, M'boumba Cedric Madianga wrote: >> 2017-01-11 16:39 GMT+01:00 Uwe Kleine-König : >> > On Wed, Jan 11, 2017 at 02:58:44PM +0100, M'boumba Cedric Madianga wrote: >> >> 2017-01-11 9:22

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-12 Thread Uwe Kleine-König
Hello Cedric, On Thu, Jan 12, 2017 at 12:23:12PM +0100, M'boumba Cedric Madianga wrote: > 2017-01-11 16:39 GMT+01:00 Uwe Kleine-König : > > On Wed, Jan 11, 2017 at 02:58:44PM +0100, M'boumba Cedric Madianga wrote: > >> 2017-01-11 9:22 GMT+01:00 Uwe Kleine-König >

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-12 Thread Uwe Kleine-König
Hello Cedric, On Thu, Jan 12, 2017 at 12:23:12PM +0100, M'boumba Cedric Madianga wrote: > 2017-01-11 16:39 GMT+01:00 Uwe Kleine-König : > > On Wed, Jan 11, 2017 at 02:58:44PM +0100, M'boumba Cedric Madianga wrote: > >> 2017-01-11 9:22 GMT+01:00 Uwe Kleine-König > >> : > >> > This is surprising.

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-12 Thread M'boumba Cedric Madianga
Hi Uwe, 2017-01-11 16:42 GMT+01:00 Uwe Kleine-König : > Hello Cedric, > > On Wed, Jan 11, 2017 at 03:20:41PM +0100, M'boumba Cedric Madianga wrote: >> > >> >> + */ >> >> + reg = i2c_dev->base + STM32F4_I2C_CR1; >> >> +

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-12 Thread M'boumba Cedric Madianga
Hi Uwe, 2017-01-11 16:42 GMT+01:00 Uwe Kleine-König : > Hello Cedric, > > On Wed, Jan 11, 2017 at 03:20:41PM +0100, M'boumba Cedric Madianga wrote: >> > >> >> + */ >> >> + reg = i2c_dev->base + STM32F4_I2C_CR1; >> >> + stm32f4_i2c_clr_bits(reg,

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-12 Thread M'boumba Cedric Madianga
2017-01-11 16:39 GMT+01:00 Uwe Kleine-König : > On Wed, Jan 11, 2017 at 02:58:44PM +0100, M'boumba Cedric Madianga wrote: >> Hi Uwe, >> >> 2017-01-11 9:22 GMT+01:00 Uwe Kleine-König : >> > Hello Cedric, >> > >> > On Thu, Jan 05, 2017

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-12 Thread M'boumba Cedric Madianga
2017-01-11 16:39 GMT+01:00 Uwe Kleine-König : > On Wed, Jan 11, 2017 at 02:58:44PM +0100, M'boumba Cedric Madianga wrote: >> Hi Uwe, >> >> 2017-01-11 9:22 GMT+01:00 Uwe Kleine-König : >> > Hello Cedric, >> > >> > On Thu, Jan 05, 2017 at 10:07:23AM +0100, M'boumba Cedric Madianga wrote: >> >> +/*

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-11 Thread Uwe Kleine-König
On Wed, Jan 11, 2017 at 02:58:44PM +0100, M'boumba Cedric Madianga wrote: > Hi Uwe, > > 2017-01-11 9:22 GMT+01:00 Uwe Kleine-König : > > Hello Cedric, > > > > On Thu, Jan 05, 2017 at 10:07:23AM +0100, M'boumba Cedric Madianga wrote: > >> +/* > >> + * In standard

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-11 Thread Uwe Kleine-König
On Wed, Jan 11, 2017 at 02:58:44PM +0100, M'boumba Cedric Madianga wrote: > Hi Uwe, > > 2017-01-11 9:22 GMT+01:00 Uwe Kleine-König : > > Hello Cedric, > > > > On Thu, Jan 05, 2017 at 10:07:23AM +0100, M'boumba Cedric Madianga wrote: > >> +/* > >> + * In standard mode: > >> + * SCL period = SCL

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-11 Thread Uwe Kleine-König
Hello Cedric, On Wed, Jan 11, 2017 at 03:20:41PM +0100, M'boumba Cedric Madianga wrote: > > > >> + */ > >> + reg = i2c_dev->base + STM32F4_I2C_CR1; > >> + stm32f4_i2c_clr_bits(reg, STM32F4_I2C_CR1_ACK); > >> + stm32f4_i2c_set_bits(reg,

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-11 Thread Uwe Kleine-König
Hello Cedric, On Wed, Jan 11, 2017 at 03:20:41PM +0100, M'boumba Cedric Madianga wrote: > > > >> + */ > >> + reg = i2c_dev->base + STM32F4_I2C_CR1; > >> + stm32f4_i2c_clr_bits(reg, STM32F4_I2C_CR1_ACK); > >> + stm32f4_i2c_set_bits(reg,

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-11 Thread M'boumba Cedric Madianga
> >> + */ >> + reg = i2c_dev->base + STM32F4_I2C_CR1; >> + stm32f4_i2c_clr_bits(reg, STM32F4_I2C_CR1_ACK); >> + stm32f4_i2c_set_bits(reg, STM32F4_I2C_CR1_POS); > > You could get rid of this, when caching the value of CR1. Would save two > register

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-11 Thread M'boumba Cedric Madianga
> >> + */ >> + reg = i2c_dev->base + STM32F4_I2C_CR1; >> + stm32f4_i2c_clr_bits(reg, STM32F4_I2C_CR1_ACK); >> + stm32f4_i2c_set_bits(reg, STM32F4_I2C_CR1_POS); > > You could get rid of this, when caching the value of CR1. Would save two > register

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-11 Thread M'boumba Cedric Madianga
Hi Uwe, 2017-01-11 9:22 GMT+01:00 Uwe Kleine-König : > Hello Cedric, > > On Thu, Jan 05, 2017 at 10:07:23AM +0100, M'boumba Cedric Madianga wrote: >> +/* >> + * In standard mode: >> + * SCL period = SCL high period = SCL low period = CCR * I2C parent clk >> period

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-11 Thread M'boumba Cedric Madianga
Hi Uwe, 2017-01-11 9:22 GMT+01:00 Uwe Kleine-König : > Hello Cedric, > > On Thu, Jan 05, 2017 at 10:07:23AM +0100, M'boumba Cedric Madianga wrote: >> +/* >> + * In standard mode: >> + * SCL period = SCL high period = SCL low period = CCR * I2C parent clk >> period >> + * >> + * In fast mode: >>

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-11 Thread Uwe Kleine-König
Hello Cedric, On Thu, Jan 05, 2017 at 10:07:23AM +0100, M'boumba Cedric Madianga wrote: > +/* > + * In standard mode: > + * SCL period = SCL high period = SCL low period = CCR * I2C parent clk > period > + * > + * In fast mode: > + * If Duty = 0; SCL high period = 1 * CCR * I2C parent clk

Re: [PATCH v8 2/5] i2c: Add STM32F4 I2C driver

2017-01-11 Thread Uwe Kleine-König
Hello Cedric, On Thu, Jan 05, 2017 at 10:07:23AM +0100, M'boumba Cedric Madianga wrote: > +/* > + * In standard mode: > + * SCL period = SCL high period = SCL low period = CCR * I2C parent clk > period > + * > + * In fast mode: > + * If Duty = 0; SCL high period = 1 * CCR * I2C parent clk