greybus: control: implement mode-switch operation
authorJohan Hovold <johan@hovoldconsulting.com>
Fri, 29 Apr 2016 15:08:34 +0000 (17:08 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 29 Apr 2016 21:27:05 +0000 (14:27 -0700)
Implement the unidirectional mode-switch operation.

This operation will be used in the implementation of the new generic
mode-switch functionality.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/control.c
drivers/staging/greybus/control.h
drivers/staging/greybus/greybus_protocols.h

index 20aa366c3883ac34dd46b080fee12cd701aaa8ad..1b28899cd3366f9e8eda469a2eb4b943d418f17c 100644 (file)
@@ -149,6 +149,13 @@ int gb_control_disconnected_operation(struct gb_control *control, u16 cport_id)
                                 sizeof(request), NULL, 0);
 }
 
+int gb_control_mode_switch_operation(struct gb_control *control)
+{
+       return gb_operation_unidirectional(control->connection,
+                                               GB_CONTROL_TYPE_MODE_SWITCH,
+                                               NULL, 0);
+}
+
 int gb_control_get_interface_version_operation(struct gb_interface *intf)
 {
        struct gb_control_interface_version_response response;
index 56fa2592762bbc8962195ff49dbfdb56eab2b728..f108bcc2e0590dc1306a67e94d051e830bad497d 100644 (file)
@@ -36,6 +36,7 @@ void gb_control_put(struct gb_control *control);
 int gb_control_get_bundle_versions(struct gb_control *control);
 int gb_control_connected_operation(struct gb_control *control, u16 cport_id);
 int gb_control_disconnected_operation(struct gb_control *control, u16 cport_id);
+int gb_control_mode_switch_operation(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);
index 713b56989735441413ec46b0a7665d6d93ffb1da..c074402633c66ebbdd22b9b41d77015fcc14c0bc 100644 (file)
@@ -123,6 +123,7 @@ struct gb_protocol_version_response {
 #define GB_CONTROL_TYPE_TIMESYNC_AUTHORITATIVE 0x09
 #define GB_CONTROL_TYPE_INTERFACE_VERSION      0x0a
 #define GB_CONTROL_TYPE_BUNDLE_VERSION         0x0b
+#define GB_CONTROL_TYPE_MODE_SWITCH            0x0e
 
 struct gb_control_version_request {
        __u8    major;