diff options
author | Vaibhav Hiremath <vaibhav.hiremath@linaro.org> | 2016-02-13 02:04:05 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-02-15 13:18:40 -0800 |
commit | e74d04a5810233a95cb7a556165817d378b89e44 (patch) | |
tree | 363d647629475dcf1706844267a1bee39ddddd06 /drivers | |
parent | 5993e2bfd848538b1f3e8e3de6412f76e600c69f (diff) |
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: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/greybus/arche-platform.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c index 48ab1eb24d63..1336fc4194c7 100644 --- a/drivers/staging/greybus/arche-platform.c +++ b/drivers/staging/greybus/arche-platform.c @@ -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); |