summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/connection.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2015-08-12 09:19:34 +0530
committerGreg Kroah-Hartman <gregkh@google.com>2015-08-11 22:13:12 -0700
commit58dab0f2a872be5dc2bdb15f3dc487b4a1b41aaf (patch)
tree47c8c4007cc8d1b9e10bd83bbcf905ef8ad06a6c /drivers/staging/greybus/connection.c
parent90f1b617d88f145506e9061436069583cb82d101 (diff)
downloadlinux-stable-58dab0f2a872be5dc2bdb15f3dc487b4a1b41aaf.tar.gz
linux-stable-58dab0f2a872be5dc2bdb15f3dc487b4a1b41aaf.tar.bz2
linux-stable-58dab0f2a872be5dc2bdb15f3dc487b4a1b41aaf.zip
greybus: connection: Send protocol version for firmware protocol
As per greybus specs, we need to send the protocol version for firmware protocol and so this special case Hack. Probably we should always send the protocol version AP supports and kill this hack completely. But then it requires updates to specs as well, and that should be done after some discussion. For now, add a FIXME for that and a special case for firmware protocol. Signed-off-by: Viresh Kumar <viresh.kumar@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.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c
index 2b2be3fd1638..6078443a7dca 100644
--- a/drivers/staging/greybus/connection.c
+++ b/drivers/staging/greybus/connection.c
@@ -421,7 +421,19 @@ int gb_connection_init(struct gb_connection *connection)
* this for SVC as that is initiated by the SVC.
*/
if (connection->hd_cport_id != GB_SVC_CPORT_ID) {
- ret = gb_protocol_get_version(connection, false);
+ bool send_request = false;
+
+ /*
+ * We need to send the protocol version of the firmware protocol
+ * supported by AP and so this special case.
+ */
+ if (connection->protocol->id == GREYBUS_PROTOCOL_FIRMWARE)
+ send_request = true;
+
+ // FIXME: Should we always send the protocol version AP can
+ // support ?
+
+ ret = gb_protocol_get_version(connection, send_request);
if (ret) {
dev_err(&connection->dev,
"Failed to get version CPort-%d (%d)\n",