{
int ret;
+ if (arche_pdata->state == ARCHE_PLATFORM_STATE_ACTIVE)
+ return 0;
+
dev_info(arche_pdata->dev, "Booting from cold boot state\n");
svc_reset_onoff(arche_pdata->svc_reset_gpio,
static void arche_platform_fw_flashing_seq(struct arche_platform_drvdata *arche_pdata)
{
+ if (arche_pdata->state == ARCHE_PLATFORM_STATE_FW_FLASHING)
+ return;
+
dev_info(arche_pdata->dev, "Switching to FW flashing state\n");
svc_reset_onoff(arche_pdata->svc_reset_gpio,
static void arche_platform_poweroff_seq(struct arche_platform_drvdata *arche_pdata)
{
+ 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);