I2C: Add 'transfer' to the Generic I2C Interface

This introduces transfer, which is a more primitive operation than read and
write. It handles i2c transactions by segment. See i2c.h for details.

Existing read and write operations assume all slave devices behave in a certain
way, which is not the case. For example, MAX98090 expects a read request in one
i2c frame while SLB9660 expects two separate frames. Thus, transfer operation
should replace these and slave drivers should use transfer directly or
indirectly (as done for MAX98090 in this patch). This way, the knowledge about a
slave device behavior will reside in each slave driver.

TEST=Booted Nyan. Verified MAX98090's hardware revision is printed on console
and Max98090 can beep (with a fix coming up for chrome-os-partner:26609). Built
Rambi.
BUG=chrome-os-partner:27097
BRANCH=none
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Change-Id: I07fe5b903aa8bfc7afa7db58df79615b2225fe72
Reviewed-on: https://chromium-review.googlesource.com/191190
5 files changed