ASoC: SOF: Move DSP power state transitions to platform-specific ops
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Wed, 29 Jan 2020 22:07:22 +0000 (16:07 -0600)
committerMark Brown <broonie@kernel.org>
Tue, 11 Feb 2020 11:48:05 +0000 (11:48 +0000)
commit61e285caf40fef18e8bd7cea5237ee6723609a1c
treece943de3d6321f55e73e42b91184d2c971becd4f
parent700d167739a099cdf12ed15c25fec7f4cb563d42
ASoC: SOF: Move DSP power state transitions to platform-specific ops

The DSP device substates such as D0I0/D0I3
are platform-specific. Therefore, the d0_substate
field of struct snd_sof_dev is replaced
with the dsp_power_state field which represents the current
state of the DSP. This field holds both the device state
and the platform-specific substate values.

With the DSP device substates being platform-specific,
the DSP power state transitions need to be performed in
the platform-specific suspend/resume ops as well.

In order to achieve this, the ops signature has to be
modified to pass the target device state as an
argument. The target substate will be determined by
the platform-specific ops before performing the transition.
For example, in the case of the system suspending to S0IX,
the top-level SOF device suspend callback needs to
only determine if the DSP will be entering
D3 or remain in D0. The target substate in case the device
needs to remain in D0 (D0I0 or D0I3) will be determined
by the platform-specific suspend op.

With the addition of the extended set of power states for the DSP,
the set_power_state op for HDA platforms has to be extended
to handle only the appropriate state transitions. So, the
implementation for the Intel HDA platforms is also modified.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200129220726.31792-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/core.c
sound/soc/sof/intel/hda-dsp.c
sound/soc/sof/intel/hda.h
sound/soc/sof/ops.h
sound/soc/sof/pm.c
sound/soc/sof/sof-priv.h