提交 385227fc 编写于 作者: D David Lin 提交者: Alex Elder

greybus: control: add interface hibernate abort operation

Add the AP implementation for the Greybus Control Hibernate Abort
Operation. AP may use this Operation to abort a previous Control
Interface Suspend or Control Interface Deactivate Prepare Operation.
Signed-off-by: NDavid Lin <dtwlin@google.com>
Reviewed-by: NJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: NAlex Elder <elder@linaro.org>
上级 30ea26bd
...@@ -406,6 +406,30 @@ int gb_control_interface_deactivate_prepare(struct gb_control *control) ...@@ -406,6 +406,30 @@ int gb_control_interface_deactivate_prepare(struct gb_control *control)
return 0; return 0;
} }
int gb_control_interface_hibernate_abort(struct gb_control *control)
{
struct gb_control_intf_pm_response response;
int ret;
ret = gb_operation_sync(control->connection,
GB_CONTROL_TYPE_INTF_HIBERNATE_ABORT, NULL, 0,
&response, sizeof(response));
if (ret) {
dev_err(&control->dev,
"failed to send interface aborting hibernate: %d\n",
ret);
return ret;
}
if (response.status != GB_CONTROL_INTF_PM_OK) {
dev_err(&control->dev, "interface error while aborting hibernate: %d\n",
response.status);
return gb_control_interface_pm_status_map(response.status);
}
return 0;
}
static ssize_t vendor_string_show(struct device *dev, static ssize_t vendor_string_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
......
...@@ -58,4 +58,5 @@ int gb_control_bundle_deactivate(struct gb_control *control, u8 bundle_id); ...@@ -58,4 +58,5 @@ int gb_control_bundle_deactivate(struct gb_control *control, u8 bundle_id);
int gb_control_bundle_activate(struct gb_control *control, u8 bundle_id); int gb_control_bundle_activate(struct gb_control *control, u8 bundle_id);
int gb_control_interface_suspend_prepare(struct gb_control *control); int gb_control_interface_suspend_prepare(struct gb_control *control);
int gb_control_interface_deactivate_prepare(struct gb_control *control); int gb_control_interface_deactivate_prepare(struct gb_control *control);
int gb_control_interface_hibernate_abort(struct gb_control *control);
#endif /* __CONTROL_H */ #endif /* __CONTROL_H */
...@@ -132,6 +132,7 @@ struct gb_protocol_version_response { ...@@ -132,6 +132,7 @@ struct gb_protocol_version_response {
#define GB_CONTROL_TYPE_BUNDLE_ACTIVATE 0x12 #define GB_CONTROL_TYPE_BUNDLE_ACTIVATE 0x12
#define GB_CONTROL_TYPE_INTF_SUSPEND_PREPARE 0x13 #define GB_CONTROL_TYPE_INTF_SUSPEND_PREPARE 0x13
#define GB_CONTROL_TYPE_INTF_DEACTIVATE_PREPARE 0x14 #define GB_CONTROL_TYPE_INTF_DEACTIVATE_PREPARE 0x14
#define GB_CONTROL_TYPE_INTF_HIBERNATE_ABORT 0x15
struct gb_control_version_request { struct gb_control_version_request {
__u8 major; __u8 major;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册