Commit 0b1283e3 authored by Vaibhav Hiremath's avatar Vaibhav Hiremath Committed by Greg Kroah-Hartman
Browse files

greybus: arche-platform: Enter ACTIVE state only from OFF state



Make sure that, transition to active state happens only from OFF state.
Instead of imposing the restriction to user-space, driver internally
switches to OFF state and then to ACTIVE state.

Testing Done: Tested on EVT1.5 platform.

Signed-off-by: default avatarVaibhav Hiremath <vaibhav.hiremath@linaro.org>
Tested-by: default avatarMichael Scott <michael.scott@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent c61a8b49
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -407,8 +407,15 @@ static ssize_t state_store(struct device *dev,
		if (arche_pdata->state == ARCHE_PLATFORM_STATE_ACTIVE)
			goto exit;

		/* First we want to make sure we power off everything
		 * and then activate back again */
		device_for_each_child(arche_pdata->dev, NULL, apb_poweroff);
		arche_platform_poweroff_seq(arche_pdata);

		arche_platform_wd_irq_en(arche_pdata);
		ret = arche_platform_coldboot_seq(arche_pdata);
		if (ret)
			goto exit;

	} else if (sysfs_streq(buf, "standby")) {
		if (arche_pdata->state == ARCHE_PLATFORM_STATE_STANDBY)