diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c index 2dc11fdc5b88edfcc1ffe78435f41a94d4ec16f4..efeafb373cf1600f61e6c79414312cce2866492e 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);