summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/arche-platform.c
diff options
context:
space:
mode:
authorVaibhav Hiremath <vaibhav.hiremath@linaro.org>2016-02-22 17:27:25 +0530
committerGreg Kroah-Hartman <gregkh@google.com>2016-02-23 22:43:06 -0800
commit25847ee7c9517f91323f9139713ebdc94c865a2e (patch)
tree3338ee13ccb6cd032bb68d0fb5f775c81528d00e /drivers/staging/greybus/arche-platform.c
parent599159b6877e665b086d6e3092203c651b8a3952 (diff)
greybus: arche-platform: Avoid doing same thing again in poweroff fn
If user switches from fw_flashing => off mode, then we do not need to do same things again, for example, clk_disable and wake/detect event, as while switching to fw_flashing, driver makes sure that device goes to off state and then brings back in fw_flashing state. Testing Done: Tested 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.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c
index 2dc11fdc5b88..efeafb373cf1 100644
--- a/drivers/staging/greybus/arche-platform.c
+++ b/drivers/staging/greybus/arche-platform.c
@@ -185,11 +185,15 @@ static void arche_platform_poweroff_seq(struct arche_platform_drvdata *arche_pda
if (arche_pdata->state == ARCHE_PLATFORM_STATE_OFF)
return;
- /* Send disconnect/detach event to SVC */
- gpio_set_value(arche_pdata->wake_detect_gpio, 0);
- usleep_range(100, 200);
+ /* If in fw_flashing mode, then no need to repeate things again */
+ if (arche_pdata->state != ARCHE_PLATFORM_STATE_FW_FLASHING) {
+ /* Send disconnect/detach event to SVC */
+ gpio_set_value(arche_pdata->wake_detect_gpio, 0);
+ usleep_range(100, 200);
+
+ clk_disable_unprepare(arche_pdata->svc_ref_clk);
+ }
- clk_disable_unprepare(arche_pdata->svc_ref_clk);
/* As part of exit, put APB back in reset state */
svc_reset_onoff(arche_pdata->svc_reset_gpio,
arche_pdata->is_reset_act_hi);