diff options
author | Johan Hovold <johan@hovoldconsulting.com> | 2016-01-19 12:51:07 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-01-19 12:12:40 -0800 |
commit | 570dfa7c55a76258b03a2d93f9db12dacc2ad3c6 (patch) | |
tree | b4b4f11f9c7b0e86577909d615baa8256959eb28 /drivers/staging/greybus/connection.h | |
parent | 23268785b288c25ab5ee2ec523982546b5353880 (diff) | |
download | linux-570dfa7c55a76258b03a2d93f9db12dacc2ad3c6.tar.bz2 |
greybus: connection: add unidirectional enabled state
Add a new connection state ENABLED_TX in which only outgoing operations
are allowed.
This allows drivers to query the device during probe before allocating
their state containers without having to worry about racing incoming
requests.
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/connection.h')
-rw-r--r-- | drivers/staging/greybus/connection.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/staging/greybus/connection.h b/drivers/staging/greybus/connection.h index e7c6feb76e80..ab2556d81273 100644 --- a/drivers/staging/greybus/connection.h +++ b/drivers/staging/greybus/connection.h @@ -16,7 +16,8 @@ enum gb_connection_state { GB_CONNECTION_STATE_INVALID = 0, GB_CONNECTION_STATE_DISABLED = 1, - GB_CONNECTION_STATE_ENABLED = 2, + GB_CONNECTION_STATE_ENABLED_TX = 2, + GB_CONNECTION_STATE_ENABLED = 3, }; struct gb_operation; @@ -70,6 +71,10 @@ static inline bool gb_connection_is_static(struct gb_connection *connection) int gb_connection_enable(struct gb_connection *connection, gb_request_handler_t handler); +static inline int gb_connection_enable_tx(struct gb_connection *connection) +{ + return gb_connection_enable(connection, NULL); +} void gb_connection_disable(struct gb_connection *connection); int gb_connection_legacy_init(struct gb_connection *connection); |