summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/arche-platform.c
diff options
context:
space:
mode:
authorVaibhav Hiremath2016-02-25 12:15:44 +0100
committerGreg Kroah-Hartman2016-02-26 01:28:17 +0100
commitff788de0b41b960d7b4a650e167cfcc0d3f63644 (patch)
tree68c7bab1a068601b929906e2a2a85fe9f1d68781 /drivers/staging/greybus/arche-platform.c
parentgreybus: operation: add support for short responses (diff)
downloadkernel-qcow2-linux-ff788de0b41b960d7b4a650e167cfcc0d3f63644.tar.gz
kernel-qcow2-linux-ff788de0b41b960d7b4a650e167cfcc0d3f63644.tar.xz
kernel-qcow2-linux-ff788de0b41b960d7b4a650e167cfcc0d3f63644.zip
greybus: arche-platform: Make sure APB power cycles on coldboot
On first wake/detect pulse, everything works fine, as APB would be in poweroff state initially. But on subsequent wake/detect pulses, where APB is already in active state, internal function just returns doing nothing, as it finds that device is already in active state. So the solution would be to make sure that, whenever execution reaches to coldboot, make sure we power cycle it. Power off first, before powering on. Interrupt handler takes care of ignoring < 30msec pulses, so we should be safe here to power cycle APB. Testing Done: Testd on DB3.5 platform. Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/arche-platform.c')
-rw-r--r--drivers/staging/greybus/arche-platform.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c
index 21a84389bd3a..f44c34314127 100644
--- a/drivers/staging/greybus/arche-platform.c
+++ b/drivers/staging/greybus/arche-platform.c
@@ -140,6 +140,8 @@ static irqreturn_t arche_platform_wd_irq_thread(int irq, void *devid)
arche_pdata->wake_detect_state = WD_STATE_COLDBOOT_START;
spin_unlock_irqrestore(&arche_pdata->lock, flags);
+ /* It should complete power cycle, so first make sure it is poweroff */
+ device_for_each_child(arche_pdata->dev, NULL, apb_poweroff);
/* Bring APB out of reset: cold boot sequence */
device_for_each_child(arche_pdata->dev, NULL, apb_cold_boot);