greybus: introduce protocol abstraction
authorAlex Elder <elder@linaro.org>
Wed, 29 Oct 2014 00:36:00 +0000 (19:36 -0500)
committerGreg Kroah-Hartman <greg@kroah.com>
Wed, 29 Oct 2014 00:42:44 +0000 (08:42 +0800)
commit4ccb6b7abb8ee4ff6fc28468ffe893caa730ea13
tree11269593d94714a0af62d37aa067644a21db6963
parent7fba0079ad9a5b1b851947ad3c5b90093b2fc415
greybus: introduce protocol abstraction

Define a protocol structure that will allow protocols to be
registered dynamically.  For now we just introduce a bookkeeping
data structure.  Upcoming patches will move protocol-related methods
into the protocol structure, and will start registering protocol
handlers dynamically.

A list of connections using a given protocol is maintained so we can
tell when a protocol is no longer in use.  This may not be necessary
(we could use a kref instead) but it may turn out to be a good way
to clean things up.

The interface is gb_protocol_get() and gb_protocol_put() for a
connection, allowing the protocol to be looked up and the connection
structure to be inserted into its list.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/Makefile
drivers/staging/greybus/connection.c
drivers/staging/greybus/connection.h
drivers/staging/greybus/greybus.h
drivers/staging/greybus/operation.c
drivers/staging/greybus/protocol.c [new file with mode: 0644]
drivers/staging/greybus/protocol.h [new file with mode: 0644]