greybus: add i2c driver
This patch adds the i2c driver, based on the use of Greybus operations
over Greybus connections. It basically replaces almost all of what
was previously found in "i2c-gb.c".
When gb_connection_device_init(connection) is called, any connection
that talks the GREYBUS_PROTOCOL_I2C is passed to gb_i2c_device_init()
to be initialized.
Initialization involves verifying the code is able to support the
version of the protocol. For I2C, we then query the functionality
mask, and set the retry count and timeout to default values.
After that, we set up the i2c device and associate it with the
connection. The i2c_algorithm methods are then implemented
by translating them into Greybus operations.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>