Skip to content
Commit 0317e6c0 authored by Lucas De Marchi's avatar Lucas De Marchi Committed by Wolfram Sang
Browse files

i2c: designware: do not disable adapter after transfer



Disabling the adapter after each transfer adds additional delays
for each I2C transfer. Even if we don't wait for it to be disabled
anymore, on next transfer we will need to if we have several transfers
in a row.

Now during the transfer init we check if IC_TAR can be changed
dynamically, the status register for no activity and TX buffer being
empty. In this case we don't need to disable it

When a transfer fails the adapter will still be disabled - this is a
conservative approach. When transfers succeed, the adapter is left
enabled and it's configured so to disable interrupts.

Alternating register reads on 2 slaves:
perf stat -r4 chrt -f 10 ./i2c-test /dev/i2c-1 25000 0x40 0x6 0x1e 0x00

Before:
	8.638705161 seconds time elapsed                  ( +-  5.90% )
After:
	7.516821591 seconds time elapsed                  ( +-  0.11% )

Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
Acked-by: default avatarJarkko Nikula <jarkko.nikula@linux.intel.com>
Tested-by: default avatarChristian Ruppert <christian.ruppert@alitech.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 63d0f0a6
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment