summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/connection.c
diff options
context:
space:
mode:
authorBryan O'Donoghue2015-10-15 17:10:42 +0200
committerGreg Kroah-Hartman2015-10-15 20:31:08 +0200
commite7e2efc438ba721000ed4b747f159e41571570a7 (patch)
treeb45cfc454e67599876e3b777b2e34716543cfe5a /drivers/staging/greybus/connection.c
parentgreybus: es1,es2: add USB vendor command to timestamp (diff)
downloadkernel-qcow2-linux-e7e2efc438ba721000ed4b747f159e41571570a7.tar.gz
kernel-qcow2-linux-e7e2efc438ba721000ed4b747f159e41571570a7.tar.xz
kernel-qcow2-linux-e7e2efc438ba721000ed4b747f159e41571570a7.zip
greybus: connection: add latency tag enable/disable callbacks
This patch adds a layered wrapper around optional latency tag enable/disable commands to APBridge. When set APBridge and GPBridge will insert timing information into reserved fields in the loopback response header. Correspondingly when unset no timing information will be included in the response payload. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/connection.c')
-rw-r--r--drivers/staging/greybus/connection.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c
index 743ea67d022f..3b731dab81f0 100644
--- a/drivers/staging/greybus/connection.c
+++ b/drivers/staging/greybus/connection.c
@@ -527,6 +527,38 @@ void gb_connection_destroy(struct gb_connection *connection)
device_unregister(&connection->dev);
}
+void gb_connection_latency_tag_enable(struct gb_connection *connection)
+{
+ struct greybus_host_device *hd = connection->hd;
+ int ret;
+
+ if (!hd->driver->latency_tag_enable)
+ return;
+
+ ret = hd->driver->latency_tag_enable(hd, connection->hd_cport_id);
+ if (ret) {
+ dev_err(&connection->dev,
+ "failed to enable latency tag: %d\n", ret);
+ }
+}
+EXPORT_SYMBOL_GPL(gb_connection_latency_tag_enable);
+
+void gb_connection_latency_tag_disable(struct gb_connection *connection)
+{
+ struct greybus_host_device *hd = connection->hd;
+ int ret;
+
+ if (!hd->driver->latency_tag_disable)
+ return;
+
+ ret = hd->driver->latency_tag_disable(hd, connection->hd_cport_id);
+ if (ret) {
+ dev_err(&connection->dev,
+ "failed to disable latency tag: %d\n", ret);
+ }
+}
+EXPORT_SYMBOL_GPL(gb_connection_latency_tag_disable);
+
void gb_hd_connections_exit(struct greybus_host_device *hd)
{
struct gb_connection *connection;