greybus: arche-platform: Fix boot, poweroff and fw_flashing seq with APBs
authorVaibhav Hiremath <vaibhav.hiremath@linaro.org>
Fri, 12 Feb 2016 20:34:17 +0000 (02:04 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Mon, 15 Feb 2016 21:18:40 +0000 (13:18 -0800)
commitfd60ac585607979e37b64ecec8afb898f9ad6a85
tree0296c0bfb643ad8f123d5fa5318a7c0526ece46d
parent65fd5a5018c8c5b7ddf14dffa75474b3a9040851
greybus: arche-platform: Fix boot, poweroff and fw_flashing seq with APBs

Now SVC driver has an access to APBs operational functions
(coldboot, standby_boot, fw_flashing and poweroff), SVC driver
can control APB's as per below rules,

 - If SVC goes down (poweroff state), it will also power off APBs
   and vice a versa for all operational states.
 - On boot, SVC will probe/populate APB device, but will not coldboot
   it. APBs will coldboot only after handshaking with SVC over
   wake/detect line.
   Note that, both APBs share same wake/detect line.

So from user/developer perspective, it is highly recommended that
they should use arche-platform interfaces, instead of individual
apb interface,

 # echo [off/active/standby/fw_flashing] > /sys/devices/arche_platform.*/state

Note: 'standby' mode is not supported as of now.

Testing Done: Testd on EVT1.2 and DB3.5 platform.

Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/arche-platform.c