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:
parent
cc28c2c228
commit
707a5c42ce
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue