greybus: control: add connection suspend and resume calls

Adds function calls for handling control connection suspend and resume,
for now all they do is disable and enable control connection.

Signed-off-by: David Lin <dtwlin@google.com>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Alex Elder <elder@linaro.org>
This commit is contained in:
David Lin 2016-07-07 22:07:00 -05:00 committed by Alex Elder
parent cc28c2c228
commit 707a5c42ce
2 changed files with 23 additions and 0 deletions

View File

@ -546,6 +546,27 @@ void gb_control_disable(struct gb_control *control)
gb_connection_disable(control->connection);
}
int gb_control_suspend(struct gb_control *control)
{
gb_connection_disable(control->connection);
return 0;
}
int gb_control_resume(struct gb_control *control)
{
int ret;
ret = gb_connection_enable_tx(control->connection);
if (ret) {
dev_err(&control->connection->intf->dev,
"failed to enable control connection: %d\n", ret);
return ret;
}
return 0;
}
int gb_control_add(struct gb_control *control)
{
int ret;

View File

@ -29,6 +29,8 @@ struct gb_control {
struct gb_control *gb_control_create(struct gb_interface *intf);
int gb_control_enable(struct gb_control *control);
void gb_control_disable(struct gb_control *control);
int gb_control_suspend(struct gb_control *control);
int gb_control_resume(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);