From: Vaibhav Hiremath Date: Fri, 12 Feb 2016 20:34:05 +0000 (+0530) Subject: greybus: arche-platform: Add state variable to driver data X-Git-Tag: v4.9-rc1~119^2~378^2~21^2~707 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e74d04a5810233a95cb7a556165817d378b89e44;p=karo-tx-linux.git 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 Signed-off-by: Greg Kroah-Hartman --- 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);