greybus: arche-platform: Enable interrupt support on wake/detect line
commitf760bbfb5c10952739fd0d39869cdd6a43844037
authorVaibhav Hiremath <vaibhav.hiremath@linaro.org>
Wed, 24 Feb 2016 23:07:36 +0000 (25 04:37 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 26 Feb 2016 00:24:23 +0000 (25 16:24 -0800)
tree3094e164073086b4dc23a9c5445c1962499c8118
parent685353c12ea33e99d1daba5b3721b9033cdbdb87
greybus: arche-platform: Enable interrupt support on wake/detect line

This patch enabled interrupt support on events received over wake/detect
line. The driver follows below state machine,

Default: wake/detect line is high (WD_STATE_IDLE)
On Falling edge:
  SVC initiates boot (either cold/standby).
  On ES3, > 30msec = coldboot, else standby boot.
  Driver moves to WD_STATE_BOOT_INIT
On rising edge (> 30msec):
  SVC expects APB to coldboot
  Driver wakes irq thread which kicks off APB  coldboot
  (WD_STATE_COLDBOOT_TRIG)
On rising edge (< 30msec):
  Driver ignores it, do nothing.

After coldboot of APB, HUB configuration work is scheduled after 2 sec,
allowing enough time for APB<->SVC/Switch to linkup (in multiple
iterations)

Testing Done: Tested on DB3.5 platform.

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