summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2016-05-30 13:05:08 +0530
committerGreg Kroah-Hartman <gregkh@google.com>2016-06-02 11:15:49 -0700
commitc92c1d026b1e13f20fee3350975a4986608ff84a (patch)
treecb7a2b0df1b6019b324b165c296a502bf0c5e39a
parent64060fe95458f22bac7327b2ee8dc5ce9e488d44 (diff)
downloadlinux-c92c1d026b1e13f20fee3350975a4986608ff84a.tar.bz2
greybus: fw-mgmt: Add hooks to do mode-switch
This is the last step to required to finish the mode switch story. That is, call the hook provided by Interface layer to accomplish mode switch. Tested on EVT 1.5 with gpbridge-test module. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Tested-by: Karthik Ravi Shankar <karthikrs@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-rw-r--r--drivers/staging/greybus/fw-management.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/staging/greybus/fw-management.c b/drivers/staging/greybus/fw-management.c
index da36de313a2c..22dcad2ebc15 100644
--- a/drivers/staging/greybus/fw-management.c
+++ b/drivers/staging/greybus/fw-management.c
@@ -484,7 +484,14 @@ static int fw_mgmt_ioctl(struct fw_mgmt *fw_mgmt, unsigned int cmd,
fw_mgmt->mode_switch_started = true;
- /* FIXME: Initiate mode-switch from here */
+ ret = gb_interface_request_mode_switch(fw_mgmt->connection->intf);
+ if (ret) {
+ dev_err(fw_mgmt->parent, "Mode-switch failed: %d\n",
+ ret);
+ fw_mgmt->mode_switch_started = false;
+ return ret;
+ }
+
return 0;
default:
return -ENOTTY;