]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: SOF: imx8m: Implement reset callback
authorDaniel Baluta <daniel.baluta@nxp.com>
Fri, 19 Nov 2021 09:43:19 +0000 (11:43 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 22 Nov 2021 15:40:12 +0000 (15:40 +0000)
commita132343633b0dd24db28639d63a56901d7253e8b
tree00ef2642c67456323f015ac2a28b69c97a147ea8
parent6f4507384986c8d6d83902d6c885b901abce03ec
ASoC: SOF: imx8m: Implement reset callback

Resume common flow (System PM / Runtime PM) is like this:

    sof_resume
      -> specific device resume
      -> snd_sof_load_firmware
         -> snd_sof_dsp_reset (1)
         -> load_modules()
      -> snd_sof_run_firmware (2)

    We need to implement dsp_reset callback (1) that will actually reset
    the DSP but keep it stalled.

    In order to implement this we do the following:
            -> put DSP into reset (assert CoreReset bit from PWRCTL)
            -> stall the DSP using RunStall bit from AudioDSP_REG2 mix
            -> take DSP out of reset (de-assert CoreReset bit from PWRCTL)

    At this moment the DSP is taken out of reset and Stalled! This means
    that we can load the firmware and then start the DSP (2).

    Until now we resetted the DSP by turning down the Audiomix PD. This
    doesn't work for Runtime PM if another IP is keeping Audiomix PD up.

    By introducing dsp_reset() we no longer rely on turning off the
    audiomix to reset the DSP.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211119094319.81674-6-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/imx/imx8m.c