Patchwork [PATCH/RFC,2/2] 5200: improve i2c bus error recovery

login
register
mail settings
Submitter Albrecht Dreß
Date Jan. 22, 2010, 8:18 p.m.
Message ID <1264191502.2224.2@antares>
Download mbox | patch
Permalink /patch/43507/
State Changes Requested
Delegated to: Grant Likely
Headers show

Comments

Albrecht Dreß - Jan. 22, 2010, 8:18 p.m.
Make the I2C adapter timeout configurable through a Device Tree property
which gives the timeout in microseconds.

Signed-off-by: Albrecht Dreß <albrecht.dress@arcor.de>

---
Wolfgang Grandegger - Jan. 25, 2010, 7:55 a.m.
Albrecht Dreß wrote:
> Make the I2C adapter timeout configurable through a Device Tree property
> which gives the timeout in microseconds.

My understanding is that software properties should not be defined via
the device tree. I think a sysfs entry is more appropriate.

Wolfgang.
Albrecht Dreß - Jan. 25, 2010, 8:26 p.m.
Am 25.01.10 08:55 schrieb(en) Wolfgang Grandegger:
> Albrecht Dreß wrote:
>> Make the I2C adapter timeout configurable through a Device Tree property which gives the timeout in microseconds.
> 
> My understanding is that software properties should not be defined via the device tree. I think a sysfs entry is more appropriate.

Is the timeout really a /software/ property?  My feeling is that the timeout basically depends upon the bus clock and the chips attached to the bus.  Therefore, it is linked closer to the composition of the board's hardware as described in the device tree, than to any userland software.  Or am I totally wrong here?

Thanks, Albrecht.
Wolfgang Grandegger - Jan. 26, 2010, 7:33 a.m.
Albrecht Dreß wrote:
> Am 25.01.10 08:55 schrieb(en) Wolfgang Grandegger:
>> Albrecht Dreß wrote:
>>> Make the I2C adapter timeout configurable through a Device Tree
>>> property which gives the timeout in microseconds.
>>
>> My understanding is that software properties should not be defined via
>> the device tree. I think a sysfs entry is more appropriate.
> 
> Is the timeout really a /software/ property?  My feeling is that the
> timeout basically depends upon the bus clock and the chips attached to
> the bus.  Therefore, it is linked closer to the composition of the
> board's hardware as described in the device tree, than to any userland
> software.  Or am I totally wrong here?

Well, yes, it seems to be a border case.

Wolfgang.
Grant Likely - Feb. 16, 2010, 7:33 p.m.
On Fri, Jan 22, 2010 at 1:18 PM, Albrecht Dreß <albrecht.dress@arcor.de> wrote:
> Make the I2C adapter timeout configurable through a Device Tree property
> which gives the timeout in microseconds.
>
> Signed-off-by: Albrecht Dreß <albrecht.dress@arcor.de>
>
> ---
>
> --- linux-2.6.32-orig/Documentation/powerpc/dts-bindings/fsl/i2c.txt    2009-12-03 04:51:21.000000000 +0100
> +++ linux-2.6.32/Documentation/powerpc/dts-bindings/fsl/i2c.txt 2010-01-22 16:04:56.000000000 +0100
> @@ -21,6 +21,7 @@
>  - fsl,preserve-clocking : boolean; if defined, the clock settings
>    from the bootloader are preserved (not touched).
>  - clock-frequency : desired I2C bus clock frequency in Hz.
> + - timeout : I2C timeout in microseconds.

fsl,timeout to avoid namespace collisions please (ie. if a common i2c
'timeout' property is ever defined for all i2c busses)

g.

Patch

--- linux-2.6.32-orig/Documentation/powerpc/dts-bindings/fsl/i2c.txt	2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32/Documentation/powerpc/dts-bindings/fsl/i2c.txt	2010-01-22 16:04:56.000000000 +0100
@@ -21,6 +21,7 @@ 
  - fsl,preserve-clocking : boolean; if defined, the clock settings
    from the bootloader are preserved (not touched).
  - clock-frequency : desired I2C bus clock frequency in Hz.
+ - timeout : I2C timeout in microseconds.
 
 Examples :