]> asedeno.scripts.mit.edu Git - linux.git/commit
i2c: bcm2835: Add support for Repeated Start Condition
authorNoralf Trønnes <noralf@tronnes.org>
Mon, 3 Oct 2016 20:06:12 +0000 (22:06 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Mon, 7 Nov 2016 00:48:32 +0000 (01:48 +0100)
commitee05fea21b017b81a9477569b6a0c2d8e2946ac9
tree7ee3e3e7e2d9c8110bf2f28c7a4ff5699e314732
parent8d2cc5cc6ee5c0fc48a96bb29af55fc700f66fdf
i2c: bcm2835: Add support for Repeated Start Condition

Documentation/i2c/i2c-protocol states that Combined transactions should
separate messages with a Start bit and end the whole transaction with a
Stop bit. This patch adds support for issuing only a Start between
messages instead of a Stop followed by a Start.

This implementation differs from downstream i2c-bcm2708 in 2 respects:
- it uses an interrupt to detect that the transfer is active instead
  of using polling. There is no interrupt for Transfer Active, but by
  not prefilling the FIFO it's possible to use the TXW interrupt.
- when resetting/disabling the controller between transfers it writes
  CLEAR to the control register instead of just zero.
  Using just zero gave many errors. This might be the reason why
  downstream had to disable this feature and make it available with a
  module parameter.

I have run thousands of transfers to a DS1307 (rtc), MMA8451 (accel)
and AT24C32 (eeprom) in parallel without problems.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-bcm2835.c