]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commit
ASoC: tegra-alt: Fix system suspend handling
authorJon Hunter <jonathanh@nvidia.com>
Tue, 23 May 2017 15:44:28 +0000 (16:44 +0100)
committermobile promotions <svcmobile_promotions@nvidia.com>
Tue, 6 Jun 2017 09:50:56 +0000 (02:50 -0700)
commit610f30df70a790733ed25a1be250e08cce19f368
treed57fe738eca421a7729114e30c44e182b4b5480d
parent43c18642a71ffd193523b7ad6e4191988f092c9f
ASoC: tegra-alt: Fix system suspend handling

There are a couple issues with system suspend handling in the Tegra
ASoC codec drivers which are:

1. Most drivers the system suspend callback does nothing and this
   means that if the codec device is active when suspend occurs then
   the codec will not be suspended correctly. This has been seen to
   cause system crashes in the I2S driver when the system is suspended
   and resuming while audio playback is active.

2. The codec suspend handlers may be called twice when entering
   suspend. Suspend handlers should only be called once, but currently
   they are called twice; once by the PM core and once when the APE
   power-domain is turned off (if it is on when suspend occurs).

Fix the above two problems by:

a). Adding proper system suspend and resume handlers for all codec
    drivers, to suspend and resume the device if not runtime PM
    suspended on entering suspend.
b). Remove the code to call the PM callbacks from the APE power-domain
    code.

Finally, make the system suspend callbacks for these codec drivers
late suspend callbacks to ensure that the sound core has suspended
any on-going activity, before we attempt to suspend these codec
devices.

Bug 200275736

Change-Id: I09d7e570be4e1866683873591ff76be63fdaf3fb
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: http://git-master/r/1488953
GVS: Gerrit_Virtual_Submit
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Bibek Basu <bbasu@nvidia.com>
14 files changed:
drivers/platform/tegra/pm_domains.c
sound/soc/tegra-alt/tegra210_admaif_alt.c
sound/soc/tegra-alt/tegra210_adx_alt.c
sound/soc/tegra-alt/tegra210_afc_alt.c
sound/soc/tegra-alt/tegra210_amx_alt.c
sound/soc/tegra-alt/tegra210_dmic_alt.c
sound/soc/tegra-alt/tegra210_i2s_alt.c
sound/soc/tegra-alt/tegra210_iqc_alt.c
sound/soc/tegra-alt/tegra210_mixer_alt.c
sound/soc/tegra-alt/tegra210_mvc_alt.c
sound/soc/tegra-alt/tegra210_ope_alt.c
sound/soc/tegra-alt/tegra210_sfc_alt.c
sound/soc/tegra-alt/tegra210_spdif_alt.c
sound/soc/tegra-alt/tegra210_xbar_alt.c