greybus: lights: Control runtime pm suspend/resume on AP side
authorKris Huang <huang_kris@projectara.com>
Thu, 25 Aug 2016 08:57:14 +0000 (16:57 +0800)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 26 Aug 2016 11:16:11 +0000 (13:16 +0200)
commitcc43368a3cde151739ad20cbf71139530bd53f1a
tree3d585a5fcdcea9148211bb1b40cfd27a21c43705
parent0e352343c2e371ad618d8850f542e9ca230e3aa6
greybus: lights: Control runtime pm suspend/resume on AP side

According to runtime pm architecture, the kernel side driver should be
as smart as needed to know when the module is idle or active, so that it can
issue the suspend/resume operations to the firmware side at the right time.
To add logics prevents AP from issuing the suspend request to the firmware
when a channel turning to active state, and put it to suspend if the state
is going to inactive with still holding a reference.

Testing Done: Compiled and verified on EVT2 and gpbridge-test module
              with device class daughter board.

Signed-off-by: Kris Huang <huang_kris@projectara.com>
Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/light.c