greybus: arche-platform: Export fn to allow timesync driver to change the state
authorVaibhav Hiremath <vaibhav.hiremath@linaro.org>
Thu, 5 May 2016 14:34:58 +0000 (15:34 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 5 May 2016 20:49:02 +0000 (13:49 -0700)
commit886aba558b9e63c7025cabfaff8ca17f9fc02985
tree50cf7df9e3492f5ab0543fc3d5718bc29a51d840
parent6c1ca56d85377498bec760064c02e33f4678a2dd
greybus: arche-platform: Export fn to allow timesync driver to change the state

With the addition of the timesync driver and looking at the hardware
interfaces we have, its clear we need to add a new arche-platform state.

This patch adds ARCHE_PLATFORM_STATE_TIME_SYNC to the arche-platform driver
to facilitate transition to the TIME_SYNC state if-and-only-if the
arche-platform driver is in the ACTIVE state.

This is mainly needed as wake/detect lines are shared between TIMESYNC
operation and basic control functionality of APBs. So during TIMESYNC
we want to make sure that the events on wake/detect lines are
ignored by the arche-platform APB reset logic.

This patch adds one exported function, which can be invoked from
timesync driver code, allowing, switching between
ARCHE_PLATFORM_STATE_TIME_SYNC <=> ARCHE_PLATFORM_STATE_ACTIVE states.

[ bryan.odonoghue@linaro.org: Added mutex, massaged commit text ]

Reviewed-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Suggested-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/arche-platform.c
drivers/staging/greybus/arche_platform.h