diff options
author | Johan Hovold | 2016-05-27 17:26:40 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2016-05-27 21:24:17 +0200 |
commit | 55742d2a071a569bf20f90d37b1b5b8a25a3f882 (patch) | |
tree | 7438d9c12c2ec57706973a7eb9a80bc44b897edb /drivers/staging/greybus/connection.h | |
parent | greybus: control: add error message to mode-switch helper (diff) | |
download | kernel-qcow2-linux-55742d2a071a569bf20f90d37b1b5b8a25a3f882.tar.gz kernel-qcow2-linux-55742d2a071a569bf20f90d37b1b5b8a25a3f882.tar.xz kernel-qcow2-linux-55742d2a071a569bf20f90d37b1b5b8a25a3f882.zip |
greybus: interface: implement generic mode-switch functionality
Add a generic interface for bundle drivers to use to request that a
mode switch is carried out on its behalf.
Mode switching involves tearing down all connections to an interface,
sending a unidirectional mode-switch request, and waiting for a mailbox
event that triggers deferred control connection reset and re-enumeration
of the interface. In case of a timeout waiting for the interface mailbox
event, or on other errors, the interface is powered off.
All of this needs to be done by core from work-queue context in order
not to block incoming SVC requests and bundle-device tear down. Care
must also be taken to serialise against concurrent module removal events
and eject requests.
Special handling of legacy mode-switching is also added in order to
continue to support the ES3 bootrom.
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 | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/greybus/connection.h b/drivers/staging/greybus/connection.h index af171f5f0635..9cd0bac9ceb9 100644 --- a/drivers/staging/greybus/connection.h +++ b/drivers/staging/greybus/connection.h @@ -58,6 +58,8 @@ struct gb_connection { atomic_t op_cycle; void *private; + + bool mode_switch; }; struct gb_connection *gb_connection_create_static(struct gb_host_device *hd, @@ -83,6 +85,9 @@ void gb_connection_disable_rx(struct gb_connection *connection); void gb_connection_disable(struct gb_connection *connection); void gb_connection_disable_forced(struct gb_connection *connection); +void gb_connection_mode_switch_prepare(struct gb_connection *connection); +void gb_connection_mode_switch_complete(struct gb_connection *connection); + void greybus_data_rcvd(struct gb_host_device *hd, u16 cport_id, u8 *data, size_t length); |