ASoC: mediatek: add power-domain get/put ctrl for mt2701
authorGarlic Tseng <garlic.tseng@mediatek.com>
Thu, 16 Feb 2017 05:27:15 +0000 (13:27 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 16 Feb 2017 18:27:17 +0000 (18:27 +0000)
add power-domain ctrl for audio driver

Signed-off-by: Garlic Tseng <garlic.tseng@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/mediatek/mt2701/mt2701-afe-pcm.c

index 34a6123480d3e708e7b934c967ea7b5f85131336..c7fa3e6634639f8498ced1f873e984b252a415e1 100644 (file)
@@ -1578,6 +1578,7 @@ static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev)
        pm_runtime_enable(&pdev->dev);
        if (!pm_runtime_enabled(&pdev->dev))
                goto err_pm_disable;
+       pm_runtime_get_sync(&pdev->dev);
 
        ret = snd_soc_register_platform(&pdev->dev, &mtk_afe_pcm_platform);
        if (ret) {
@@ -1617,6 +1618,7 @@ static int mt2701_afe_pcm_dev_remove(struct platform_device *pdev)
        pm_runtime_disable(&pdev->dev);
        if (!pm_runtime_status_suspended(&pdev->dev))
                mt2701_afe_runtime_suspend(&pdev->dev);
+       pm_runtime_put_sync(&pdev->dev);
 
        snd_soc_unregister_component(&pdev->dev);
        snd_soc_unregister_platform(&pdev->dev);