diff options
| author | Rodrigo Vivi <[email protected]> | 2018-07-23 09:13:12 -0700 | 
|---|---|---|
| committer | Rodrigo Vivi <[email protected]> | 2018-07-23 09:13:12 -0700 | 
| commit | c74a7469f97c0f40b46e82ee979f9fb1bb6e847c (patch) | |
| tree | f2690a1a916b73ef94657fbf0e0141ae57701825 /arch/arm/mach-omap2/prm33xx.c | |
| parent | 6f15a7de86c8cf2dc09fc9e6d07047efa40ef809 (diff) | |
| parent | 500775074f88d9cf5416bed2ca19592812d62c41 (diff) | |
Merge drm/drm-next into drm-intel-next-queued
We need a backmerge to get DP_DPCD_REV_14 before we push other
i915 changes to dinq that could break compilation.
Signed-off-by: Rodrigo Vivi <[email protected]>
Diffstat (limited to 'arch/arm/mach-omap2/prm33xx.c')
| -rw-r--r-- | arch/arm/mach-omap2/prm33xx.c | 31 | 
1 files changed, 31 insertions, 0 deletions
| diff --git a/arch/arm/mach-omap2/prm33xx.c b/arch/arm/mach-omap2/prm33xx.c index ebaf80d72a10..d5141669c28d 100644 --- a/arch/arm/mach-omap2/prm33xx.c +++ b/arch/arm/mach-omap2/prm33xx.c @@ -342,6 +342,35 @@ static void am33xx_prm_global_warm_sw_reset(void)  				  AM33XX_PRM_RSTCTRL_OFFSET);  } +static void am33xx_pwrdm_save_context(struct powerdomain *pwrdm) +{ +	pwrdm->context = am33xx_prm_read_reg(pwrdm->prcm_offs, +						pwrdm->pwrstctrl_offs); +	/* +	 * Do not save LOWPOWERSTATECHANGE, writing a 1 indicates a request, +	 * reading back a 1 indicates a request in progress. +	 */ +	pwrdm->context &= ~AM33XX_LOWPOWERSTATECHANGE_MASK; +} + +static void am33xx_pwrdm_restore_context(struct powerdomain *pwrdm) +{ +	int st, ctrl; + +	st = am33xx_prm_read_reg(pwrdm->prcm_offs, +				 pwrdm->pwrstst_offs); + +	am33xx_prm_write_reg(pwrdm->context, pwrdm->prcm_offs, +			     pwrdm->pwrstctrl_offs); + +	/* Make sure we only wait for a transition if there is one */ +	st &= OMAP_POWERSTATEST_MASK; +	ctrl = OMAP_POWERSTATEST_MASK & pwrdm->context; + +	if (st != ctrl) +		am33xx_pwrdm_wait_transition(pwrdm); +} +  struct pwrdm_ops am33xx_pwrdm_operations = {  	.pwrdm_set_next_pwrst		= am33xx_pwrdm_set_next_pwrst,  	.pwrdm_read_next_pwrst		= am33xx_pwrdm_read_next_pwrst, @@ -357,6 +386,8 @@ struct pwrdm_ops am33xx_pwrdm_operations = {  	.pwrdm_set_mem_retst		= am33xx_pwrdm_set_mem_retst,  	.pwrdm_wait_transition		= am33xx_pwrdm_wait_transition,  	.pwrdm_has_voltdm		= am33xx_check_vcvp, +	.pwrdm_save_context		= am33xx_pwrdm_save_context, +	.pwrdm_restore_context		= am33xx_pwrdm_restore_context,  };  static struct prm_ll_data am33xx_prm_ll_data = { |