servod: Serialize all I2C bus object wr_rd() method calls.

This is done by introducing a common base class which provides a wr_rd()
method that simply wraps a _raw_wr_rd() method while holding a mutex.
Subclasses implement _raw_wr_rd().

The common base class also provides a multi_wr_rd() method for performing
multiple I2C write/read/write+read transactions while holding the mutex.
It does NOT combine the transactions into one transaction on the bus
however!

BRANCH=none
BUG=b:79684405
CQ-DEPEND=CL:1279145
TEST=dut-control dut_i2c_mux uses I2C and continues to work.  Tested with a
servo_micro connected to an octopus_ite.

Change-Id: I572cfb4f184b73447fa0cfd0334fdd5f8e84e075
Signed-off-by: Matthew Blecker <matthewb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1274778
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
5 files changed