Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 25847ee7 authored by Vaibhav Hiremath's avatar Vaibhav Hiremath Committed by Greg Kroah-Hartman
Browse files

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: default avatarVaibhav Hiremath <vaibhav.hiremath@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 599159b6
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -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;

	/* 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);
	}

	/* As part of exit, put APB back in reset state */
	svc_reset_onoff(arche_pdata->svc_reset_gpio,
			arche_pdata->is_reset_act_hi);