greybus: fw-management: Add ioctl to initiate mode-switch
authorViresh Kumar <viresh.kumar@linaro.org>
Sat, 14 May 2016 18:12:22 +0000 (23:42 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Sat, 14 May 2016 22:23:52 +0000 (00:23 +0200)
commit04f0e6ebd1a2ca3a1f1a356e9a07ef1797ef1b7c
tree18dbcd5ac2ca664710aa1c32ee9237914b4c183b
parent013e665372733fafd08599f0fc58ff5f450e4694
greybus: fw-management: Add ioctl to initiate mode-switch

Once the interface firmware is loaded successfully to a module,
userspace can ask it to mode switch to the newly loaded firmware.

This patch provides a new ioctl to initiate mode switch.

Userspace can initiate a mode switch if it has previously loaded the
interface firmware successfully, otherwise the firmware core rejects it.

Also, once the mode-switch is initiated, disallow any more interactions
from the userspace.

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>
drivers/staging/greybus/fw-management.c
drivers/staging/greybus/greybus_firmware.h