regmap-i2c: add 16-bit width registers support
authorAceLan Kao <acelan.kao@canonical.com>
Fri, 24 Apr 2020 12:33:58 +0000 (20:33 +0800)
committerMark Brown <broonie@kernel.org>
Fri, 24 Apr 2020 13:32:07 +0000 (14:32 +0100)
commit82f25bd73c0bee4d29df47007a4f7290695b7db7
treed28348ca2fba0a759bcbbae0562ae54f63731f31
parent148c01d176237115d9c2805f6d29c0b6a72fbd10
regmap-i2c: add 16-bit width registers support

This allows to access data with 16-bit width of registers
via i2c SMBus block functions.

The multi-command sequence of the reading function is not safe
and may read the wrong data from other address if other commands
are sent in-between the SMBus commands in the read function.

Read performance:
   32768 bytes (33 kB, 32 KiB) copied, 11.4869 s, 2.9 kB/s
Write performance(with 1-byte page):
   32768 bytes (33 kB, 32 KiB) copied, 129.591 s, 0.3 kB/s

The implementation is inspired by below commit
https://patchwork.ozlabs.org/patch/545292/

v2: add more descriptions about the issue that maybe introduced
    by this commit

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Link: https://lore.kernel.org/r/20200424123358.144850-1-acelan.kao@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regmap-i2c.c