From: Johan Hovold Date: Fri, 29 Apr 2016 15:08:34 +0000 (+0200) Subject: greybus: control: implement mode-switch operation X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1c3aead12ea4df73b7ae552aa4f4e83bc1f0baa6;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git greybus: control: implement mode-switch operation 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/control.c b/drivers/staging/greybus/control.c index 20aa366c3883..1b28899cd336 100644 --- a/drivers/staging/greybus/control.c +++ b/drivers/staging/greybus/control.c @@ -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; diff --git a/drivers/staging/greybus/control.h b/drivers/staging/greybus/control.h index 56fa2592762b..f108bcc2e059 100644 --- a/drivers/staging/greybus/control.h +++ b/drivers/staging/greybus/control.h @@ -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); diff --git a/drivers/staging/greybus/greybus_protocols.h b/drivers/staging/greybus/greybus_protocols.h index 713b56989735..c074402633c6 100644 --- a/drivers/staging/greybus/greybus_protocols.h +++ b/drivers/staging/greybus/greybus_protocols.h @@ -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;