Commit e74d04a5 authored by Vaibhav Hiremath's avatar Vaibhav Hiremath Committed by Greg Kroah-Hartman

greybus: arche-platform: Add state variable to driver data

This is preparation for operational state support.
So in order to provide operational state transitions, driver needs to
maintain state. So add 'enum arche_platform_state' variable to
'struct arche_platform_drvdata'

Testing Done: Tested on EVT1.2 and DB3.5 platform.
Signed-off-by: default avatarVaibhav Hiremath <vaibhav.hiremath@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 5993e2bf
......@@ -26,6 +26,8 @@ struct arche_platform_drvdata {
int svc_sysboot_gpio;
int wake_detect_gpio; /* bi-dir,maps to WAKE_MOD & WAKE_FRAME signals */
enum arche_platform_state state;
unsigned int svc_refclk_req;
struct clk *svc_ref_clk;
......@@ -127,6 +129,8 @@ static int arche_platform_coldboot_seq(struct arche_platform_drvdata *arche_pdat
svc_reset_onoff(arche_pdata->svc_reset_gpio,
!arche_pdata->is_reset_act_hi);
arche_pdata->state = ARCHE_PLATFORM_STATE_ACTIVE;
return 0;
}
......@@ -136,6 +140,8 @@ static void arche_platform_poweroff_seq(struct arche_platform_drvdata *arche_pda
/* As part of exit, put APB back in reset state */
svc_reset_onoff(arche_pdata->svc_reset_gpio,
arche_pdata->is_reset_act_hi);
arche_pdata->state = ARCHE_PLATFORM_STATE_OFF;
}
static int arche_platform_probe(struct platform_device *pdev)
......@@ -168,6 +174,7 @@ static int arche_platform_probe(struct platform_device *pdev)
dev_err(dev, "failed to set svc-reset gpio dir:%d\n", ret);
return ret;
}
arche_pdata->state = ARCHE_PLATFORM_STATE_OFF;
arche_pdata->svc_sysboot_gpio = of_get_named_gpio(np,
"svc,sysboot-gpio", 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment