diff options
author | Johan Hovold <johan@hovoldconsulting.com> | 2016-05-27 17:26:40 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-05-27 12:24:17 -0700 |
commit | 55742d2a071a569bf20f90d37b1b5b8a25a3f882 (patch) | |
tree | 7438d9c12c2ec57706973a7eb9a80bc44b897edb /drivers/staging/greybus/control.h | |
parent | 08f94352e8d09f7db07b4e894b3c223ee92df5ad (diff) | |
download | linux-55742d2a071a569bf20f90d37b1b5b8a25a3f882.tar.bz2 |
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/control.h')
-rw-r--r-- | drivers/staging/greybus/control.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/staging/greybus/control.h b/drivers/staging/greybus/control.h index 9891fbdd1ff7..b1e5af25352a 100644 --- a/drivers/staging/greybus/control.h +++ b/drivers/staging/greybus/control.h @@ -31,6 +31,7 @@ int gb_control_enable(struct gb_control *control); void gb_control_disable(struct gb_control *control); int gb_control_add(struct gb_control *control); void gb_control_del(struct gb_control *control); +struct gb_control *gb_control_get(struct gb_control *control); void gb_control_put(struct gb_control *control); int gb_control_get_bundle_versions(struct gb_control *control); @@ -39,6 +40,8 @@ int gb_control_disconnected_operation(struct gb_control *control, u16 cport_id); int gb_control_disconnecting_operation(struct gb_control *control, u16 cport_id); int gb_control_mode_switch_operation(struct gb_control *control); +void gb_control_mode_switch_prepare(struct gb_control *control); +void gb_control_mode_switch_complete(struct gb_control *control); int gb_control_get_manifest_size_operation(struct gb_interface *intf); int gb_control_get_manifest_operation(struct gb_interface *intf, void *manifest, size_t size); |