]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
cmd_i2c: Provide option for bulk 'i2c write' in one transaction
authorLubomir Popov <lpopov@mm-sol.com>
Fri, 30 Jan 2015 17:56:04 +0000 (19:56 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 1 Sep 2015 11:53:51 +0000 (13:53 +0200)
commit2c22ba09b034e75351b57256f1c61c2157e8ca5a
treedfb5858ad1382dcdea552eccca5d6d6638de2962
parent9cb66fe8136f4dac64f313fb83ab833d9fcbc628
cmd_i2c: Provide option for bulk 'i2c write' in one transaction

I2C chips do exist that require a write of some multi-byte data to occur in
a single bus transaction (aka atomic transfer), otherwise either the write
does not come into effect at all, or normal operation of internal circuitry
cannot be guaranteed. The current implementation of the 'i2c write' command
(transfer of multiple bytes from a memory buffer) in fact performs a separate
transaction for each byte to be written and thus cannot support such types of
I2C slave devices.

This patch provides an alternative by allowing 'i2c write' to execute the
write transfer of the given number of bytes in a single bus transaction if
the '-s' option is specified as a final command argument. Else the current
re-addressing method is used.

Signed-off-by: Lubomir Popov <l-popov@ti.com>
hs: adapt to CONFIG_DM_I2C
common/cmd_i2c.c