Re: [PATCH] i2c: fix bus recovery stop mode timing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Russell,

On Sun, Dec 15, 2019 at 04:39:05PM +0000, Russell King wrote:
> The I2C specification states that tsu:sto for standard mode timing must
> be at minimum 4us. Pictographically, this is:
> 
> SCL: ____/~~~~~~~~~
> SDA: _________/~~~~
>        ->|    |<- 4us minimum
> 
> We are currently waiting 2.5us between asserting SCL and SDA, which is
> in violation of the standard. Adjust the timings to ensure that we meet
> what is stipulated as the minimum timings to ensure that all devices
> correctly interpret the STOP bus transition.
> 
> This is more important than trying to generate a square wave with even
> duty cycle.

Ack.

> Signed-off-by: Russell King <rmk+kernel@xxxxxxxxxxxxxxx>

> -		/* Creating STOP again, see above */

Can we keep this comment, though? I think it still has value together
with the other comment above it.

> -		ndelay(RECOVERY_NDELAY / 2);
> +		if (scl)  {
> +			/* Honour minimum tsu:sto */
> +			ndelay(RECOVERY_NDELAY);
> +		} else {
> +			/* Honour minimum tf and thd:dat */
> +			ndelay(RECOVERY_NDELAY / 2);
> +		}

Thanks,

   Wolfram

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux