summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/core.c
diff options
context:
space:
mode:
authorDavid Lin <dtwlin@google.com>2016-07-14 15:13:00 -0500
committerAlex Elder <elder@linaro.org>2016-07-14 16:53:55 -0500
commit2d48b5b4a8ca12aeff6551796357add7c05ce8cf (patch)
tree17f7d49edad181e9f52ea92eb45112152ed3a2c1 /drivers/staging/greybus/core.c
parent165a74ab1401ac3e2b6eb5b7084607b588734e09 (diff)
greybus: bundle: add activate and deactivate
AP shall send the Bundle Activate Operation to power on a bundle, and send the Bundle Deactivate Request after closing all the associated connections for power down. Testing Done: - Check for the return code of the bundle activate and deactivate operation sent Signed-off-by: David Lin <dtwlin@google.com> Signed-off-by: Axel Haslam <ahaslam@baylibre.com> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Alex Elder <elder@linaro.org>
Diffstat (limited to 'drivers/staging/greybus/core.c')
-rw-r--r--drivers/staging/greybus/core.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c
index dacc49c55253..ca3bad910aae 100644
--- a/drivers/staging/greybus/core.c
+++ b/drivers/staging/greybus/core.c
@@ -162,6 +162,13 @@ static int greybus_probe(struct device *dev)
if (!id)
return -ENODEV;
+ /*
+ * FIXME: We need to perform error handling on bundle activate call
+ * below when firmware is ready. We just allow the activate operation to
+ * fail for now since bundle may be in active already.
+ */
+ gb_control_bundle_activate(bundle->intf->control, bundle->id);
+
retval = driver->probe(bundle, id);
if (retval) {
/*
@@ -169,6 +176,8 @@ static int greybus_probe(struct device *dev)
*/
WARN_ON(!list_empty(&bundle->connections));
+ gb_control_bundle_deactivate(bundle->intf->control, bundle->id);
+
return retval;
}
@@ -203,6 +212,9 @@ static int greybus_remove(struct device *dev)
/* Catch buggy drivers that fail to destroy their connections. */
WARN_ON(!list_empty(&bundle->connections));
+ if (!bundle->intf->disconnected)
+ gb_control_bundle_deactivate(bundle->intf->control, bundle->id);
+
return 0;
}