remarkable-linux/drivers/i2c
Cyrille Pitchen 0ef6f3213d i2c: at91: add support for new alternative command mode
The alternative command mode was introduced to simplify the transmission
of STOP conditions and to solve timing and latency issues around them.

This mode relies on a new register, the Alternative Command Register,
which must be set at the same time as the Master Mode Register. This new
register was designed to allow simple setup of basic combined transactions
built from up to two unitary transactions.

Indeed, the ACR is split into two areas, which describe one unitary
transaction each. Each area is filled with Data Length 8bit counter, a
Direction and a PEC Request bit. The PEC bit is only used in SMBus mode
and is not supported by this driver yet. Also when using alternative
command mode, the MREAD bit from the Master Mode Register is ignored.
Instead the Direction bits from ACR are used to setup the direction, read
or write, of each unitary transaction. Finally the 8bit counters must
filled with the data length of their respective transaction. Then if only
one transaction is to be used, the data length of the second one must be
set to zero. At the moment, this driver uses only the first transaction.

In addition to MMR and ACR, the Control Register also need to be written
to enable the alternative command mode. That's the purpose of its ACMEN
bit, which stands for Alternative Command Mode Enable.

Note that the alternative command mode is compatible with the use of the
Internal Address Register. So combined transactions for eeprom read are
actually implemented with the Internal Address Register. This register is
written with up to 3 bytes, which are the internal address sent to the
slave through the first write transaction. Then the first area of the ACR
describe the write transaction to follow, which carries the data to be
read from the eeprom. The second area of the ACR is not used so its Data
Length 8bit counter is cleared.

For each byte sent or received by the device, the Data Length 8bit counter
is decremented. When it reaches 0, a STOP condition is automatically sent.

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2015-06-10 21:52:42 +09:00
..
algos i2c: algo-pca: fix typo in comment 2015-06-01 08:41:19 +09:00
busses i2c: at91: add support for new alternative command mode 2015-06-10 21:52:42 +09:00
muxes i2c: Allow compile test of GPIO consumers if !GPIOLIB 2015-05-12 15:22:52 +02:00
i2c-boardinfo.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-core.c i2c: core: Reduce stack size of acpi_i2c_space_handler() 2015-06-03 00:28:40 +09:00
i2c-core.h i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-dev.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
i2c-mux.c i2c: mux: use proper dev when removing "channel-X" symlinks 2015-04-23 19:35:33 +02:00
i2c-slave-eeprom.c i2c: slave-eeprom: add more info when to increase the pointer 2015-03-27 16:53:40 +01:00
i2c-smbus.c i2c: smbus: fix typo in commet 2015-06-01 08:41:26 +09:00
i2c-stub.c i2c: remove FSF address 2014-11-07 18:35:33 +01:00
Kconfig kconfig: use bool instead of boolean for type definition attributes 2015-01-07 13:08:04 +01:00
Makefile i2c: slave-eeprom: add eeprom simulator driver 2014-12-11 22:25:54 +01:00