aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/connection.c
diff options
context:
space:
mode:
authorFabien Parent <fparent@baylibre.com>2016-02-23 18:46:11 +0100
committerGreg Kroah-Hartman <gregkh@google.com>2016-02-24 17:21:58 -0800
commit71f6c3231c1dce6980f97b7bc7ed7ac32faac550 (patch)
tree5c832657303d88f797adbb98d27b4c6165643283 /drivers/staging/greybus/connection.c
parentgreybus: es2: implement the fct flow control requests (diff)
downloadlinux-dev-71f6c3231c1dce6980f97b7bc7ed7ac32faac550.tar.xz
linux-dev-71f6c3231c1dce6980f97b7bc7ed7ac32faac550.zip
greybus: connection: {en,dis}able fct flow in connection management
The AP must enable the FCT flow of APBA once it has received the response from the AP that the connection between APBA and a module has been setted up. Disable the flow of FCT tokens when destroying connections. Signed-off-by: Fabien Parent <fparent@baylibre.com> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/connection.c')
-rw-r--r--drivers/staging/greybus/connection.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c
index 4ae7153ff863..34e26dc6e249 100644
--- a/drivers/staging/greybus/connection.c
+++ b/drivers/staging/greybus/connection.c
@@ -314,7 +314,7 @@ gb_connection_svc_connection_create(struct gb_connection *connection)
int ret;
if (gb_connection_is_static(connection))
- return 0;
+ return gb_connection_hd_fct_flow_enable(connection);
intf = connection->intf;
ret = gb_svc_connection_create(hd->svc,
@@ -330,12 +330,23 @@ gb_connection_svc_connection_create(struct gb_connection *connection)
return ret;
}
+ ret = gb_connection_hd_fct_flow_enable(connection);
+ if (ret) {
+ gb_svc_connection_destroy(hd->svc, hd->svc->ap_intf_id,
+ connection->hd_cport_id,
+ intf->interface_id,
+ connection->intf_cport_id);
+ return ret;
+ }
+
return 0;
}
static void
gb_connection_svc_connection_destroy(struct gb_connection *connection)
{
+ gb_connection_hd_fct_flow_disable(connection);
+
if (gb_connection_is_static(connection))
return;