greybus: add i2c driver
authorAlex Elder <elder@linaro.org>
Thu, 16 Oct 2014 11:35:38 +0000 (06:35 -0500)
committerGreg Kroah-Hartman <greg@kroah.com>
Fri, 17 Oct 2014 16:14:11 +0000 (18:14 +0200)
commited8800dc376edd7aa10815fb9df83a66c7557031
tree77f6235d3a0bb340af1850c19635e7ea046ff480
parent98d35ba22e6328491559892e796f276de7ba3d00
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>
drivers/staging/greybus/connection.c
drivers/staging/greybus/i2c-gb.c
drivers/staging/greybus/operation.c