Re: [PATCH] i2c: designware: deduce speed mode from device tree setting

2014-08-20 Thread atull
rnel.org, > skuri...@pobox.com, "rafael j wysocki" , > a...@linux.intel.com, linux-...@vger.kernel.org, > linux-kernel@vger.kernel.org, devicet...@vger.kernel.org, "delicious quinoa" > , dingu...@opensource.altera.com, > yvand...@opensource.altera.com > Sent:

Re: [PATCH] i2c: designware: deduce speed mode from device tree setting

2014-08-20 Thread Romain Baeriswyl
g, linux-kernel@vger.kernel.org, devicet...@vger.kernel.org, "delicious quinoa" , dingu...@opensource.altera.com, yvand...@opensource.altera.com Sent: Wednesday, August 20, 2014 4:24:45 PM Subject: Re: [PATCH] i2c: designware: deduce speed mode from device tree setting On Wed, 20 Aug 2014,

Re: [PATCH] i2c: designware: deduce speed mode from device tree setting

2014-08-20 Thread atull
ot; , > robh...@kernel.org, skuri...@pobox.com, "Romain Baeriswyl" > , "rafael j wysocki" > , a...@linux.intel.com, > linux-...@vger.kernel.org, linux-kernel@vger.kernel.org, > devicet...@vger.kernel.org, "delicious quinoa" , > dingu...@opensource.a

Re: [PATCH] i2c: designware: deduce speed mode from device tree setting

2014-08-20 Thread Wolfram Sang
> > + > > + ret = of_property_read_u32(pdev->dev.of_node, > > + "clock-frequency", _rate); > > + if (!ret && (bus_rate <= 10)) > > + speed = DW_IC_CON_SPEED_STD; > > This looks a bit odd. > > If the device only

Re: [PATCH] i2c: designware: deduce speed mode from device tree setting

2014-08-20 Thread Mark Rutland
On Wed, Aug 20, 2014 at 01:36:18PM +0100, Wolfram Sang wrote: > > > + > > > + ret = of_property_read_u32(pdev->dev.of_node, > > > +"clock-frequency", _rate); > > > + if (!ret && (bus_rate <= 10)) > > > + speed =

Re: [PATCH] i2c: designware: deduce speed mode from device tree setting

2014-08-20 Thread Wolfram Sang
> With the patch "i2c designware add support of I2C standard mode" I already > proposed: > - I2C standard mode is selected with 100kHz clock frequency. > - I2C fast mode is selected with 400kHy clock frequency. > - EINVAL error is returned if clock frequency is not 10 and not 40. You

Re: [PATCH] i2c: designware: deduce speed mode from device tree setting

2014-08-20 Thread Romain Baeriswyl
ael j wysocki" , a...@linux.intel.com, linux-...@vger.kernel.org, linux-kernel@vger.kernel.org, devicet...@vger.kernel.org, "delicious quinoa" , dingu...@opensource.altera.com, yvand...@opensource.altera.com Sent: Wednesday, August 20, 2014 11:49:37 AM Subject: Re: [PATCH] i2c: designware: ded

Re: [PATCH] i2c: designware: deduce speed mode from device tree setting

2014-08-20 Thread Romain Baeriswyl
...@linux.intel.com, linux-...@vger.kernel.org, linux-kernel@vger.kernel.org, devicet...@vger.kernel.org, "delicious quinoa" , dingu...@opensource.altera.com, yvand...@opensource.altera.com Sent: Wednesday, August 20, 2014 11:22:57 AM Subject: Re: [PATCH] i2c: designware

Re: [PATCH] i2c: designware: deduce speed mode from device tree setting

2014-08-20 Thread Mark Rutland
On Tue, Aug 19, 2014 at 09:18:49PM +0100, at...@opensource.altera.com wrote: > From: Alan Tull > > Use the documented, but unimplemented "clock-frequency" > Device Tree setting as a guide on whether to set the speed > mode bits in DW_IC_CON to standard or fast i2c mode. > > Previously, the

Re: [PATCH] i2c: designware: deduce speed mode from device tree setting

2014-08-20 Thread Mika Westerberg
On Tue, Aug 19, 2014 at 03:18:49PM -0500, at...@opensource.altera.com wrote: > From: Alan Tull > > Use the documented, but unimplemented "clock-frequency" > Device Tree setting as a guide on whether to set the speed > mode bits in DW_IC_CON to standard or fast i2c mode. > > Previously, the

Re: [PATCH] i2c: designware: deduce speed mode from device tree setting

2014-08-20 Thread Mika Westerberg
On Tue, Aug 19, 2014 at 03:18:49PM -0500, at...@opensource.altera.com wrote: From: Alan Tull at...@opensource.altera.com Use the documented, but unimplemented clock-frequency Device Tree setting as a guide on whether to set the speed mode bits in DW_IC_CON to standard or fast i2c mode.

Re: [PATCH] i2c: designware: deduce speed mode from device tree setting

2014-08-20 Thread Mark Rutland
On Tue, Aug 19, 2014 at 09:18:49PM +0100, at...@opensource.altera.com wrote: From: Alan Tull at...@opensource.altera.com Use the documented, but unimplemented clock-frequency Device Tree setting as a guide on whether to set the speed mode bits in DW_IC_CON to standard or fast i2c mode.

Re: [PATCH] i2c: designware: deduce speed mode from device tree setting

2014-08-20 Thread Romain Baeriswyl
Subject: Re: [PATCH] i2c: designware: deduce speed mode from device tree setting On Tue, Aug 19, 2014 at 09:18:49PM +0100, at...@opensource.altera.com wrote: From: Alan Tull at...@opensource.altera.com Use the documented, but unimplemented clock-frequency Device Tree setting as a guide on whether

Re: [PATCH] i2c: designware: deduce speed mode from device tree setting

2014-08-20 Thread Romain Baeriswyl
: Wednesday, August 20, 2014 11:49:37 AM Subject: Re: [PATCH] i2c: designware: deduce speed mode from device tree setting Hi, With the patch i2c designware add support of I2C standard mode I already proposed: - I2C standard mode is selected with 100kHz clock frequency. - I2C fast mode is selected

Re: [PATCH] i2c: designware: deduce speed mode from device tree setting

2014-08-20 Thread Wolfram Sang
With the patch i2c designware add support of I2C standard mode I already proposed: - I2C standard mode is selected with 100kHz clock frequency. - I2C fast mode is selected with 400kHy clock frequency. - EINVAL error is returned if clock frequency is not 10 and not 40. You forgot to

Re: [PATCH] i2c: designware: deduce speed mode from device tree setting

2014-08-20 Thread Mark Rutland
On Wed, Aug 20, 2014 at 01:36:18PM +0100, Wolfram Sang wrote: + + ret = of_property_read_u32(pdev-dev.of_node, +clock-frequency, bus_rate); + if (!ret (bus_rate = 10)) + speed = DW_IC_CON_SPEED_STD; This

Re: [PATCH] i2c: designware: deduce speed mode from device tree setting

2014-08-20 Thread Wolfram Sang
+ + ret = of_property_read_u32(pdev-dev.of_node, + clock-frequency, bus_rate); + if (!ret (bus_rate = 10)) + speed = DW_IC_CON_SPEED_STD; This looks a bit odd. If the device only supports two particular

Re: [PATCH] i2c: designware: deduce speed mode from device tree setting

2014-08-20 Thread atull
: designware: deduce speed mode from device tree setting On Tue, Aug 19, 2014 at 09:18:49PM +0100, at...@opensource.altera.com wrote: From: Alan Tull at...@opensource.altera.com Use the documented, but unimplemented clock-frequency Device Tree setting as a guide on whether to set the speed

Re: [PATCH] i2c: designware: deduce speed mode from device tree setting

2014-08-20 Thread Romain Baeriswyl
: Re: [PATCH] i2c: designware: deduce speed mode from device tree setting On Wed, 20 Aug 2014, Romain Baeriswyl wrote: Hi, With the patch i2c designware add support of I2C standard mode I already proposed: - I2C standard mode is selected with 100kHz clock frequency. - I2C fast mode

Re: [PATCH] i2c: designware: deduce speed mode from device tree setting

2014-08-20 Thread atull
: Wednesday, August 20, 2014 4:24:45 PM Subject: Re: [PATCH] i2c: designware: deduce speed mode from device tree setting On Wed, 20 Aug 2014, Romain Baeriswyl wrote: Hi, With the patch i2c designware add support of I2C standard mode I already proposed: - I2C standard mode

[PATCH] i2c: designware: deduce speed mode from device tree setting

2014-08-19 Thread atull
From: Alan Tull Use the documented, but unimplemented "clock-frequency" Device Tree setting as a guide on whether to set the speed mode bits in DW_IC_CON to standard or fast i2c mode. Previously, the driver was hardwired to fast mode. Default to fast mode if the "clock-frequency" property is

[PATCH] i2c: designware: deduce speed mode from device tree setting

2014-08-19 Thread atull
From: Alan Tull at...@opensource.altera.com Use the documented, but unimplemented clock-frequency Device Tree setting as a guide on whether to set the speed mode bits in DW_IC_CON to standard or fast i2c mode. Previously, the driver was hardwired to fast mode. Default to fast mode if the