diff options
author | Mark Brown <broonie@kernel.org> | 2018-01-12 07:28:43 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-01-12 07:28:43 -0500 |
commit | a993056975d1d5696f5e065f4a2b9ac84229de65 (patch) | |
tree | f2df91da603687d8f6d9e23040adb6a046ad1442 | |
parent | 15fc3a22511bd1fa13be95c2c6020c3b372a2a65 (diff) | |
parent | dd6bb9b16f23f9b95b77713c45bd6182336c5b2e (diff) |
Merge remote-tracking branch 'asoc/fix/mtk' into asoc-linus
-rw-r--r-- | sound/soc/mediatek/mt2701/mt2701-afe-pcm.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c b/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c index 8fda182f849b..a7362d1cda1b 100644 --- a/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c +++ b/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c | |||
@@ -1590,12 +1590,16 @@ static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev) | |||
1590 | } | 1590 | } |
1591 | 1591 | ||
1592 | platform_set_drvdata(pdev, afe); | 1592 | platform_set_drvdata(pdev, afe); |
1593 | pm_runtime_enable(&pdev->dev); | ||
1594 | if (!pm_runtime_enabled(&pdev->dev)) | ||
1595 | goto err_pm_disable; | ||
1596 | pm_runtime_get_sync(&pdev->dev); | ||
1597 | 1593 | ||
1598 | ret = snd_soc_register_platform(&pdev->dev, &mtk_afe_pcm_platform); | 1594 | pm_runtime_enable(dev); |
1595 | if (!pm_runtime_enabled(dev)) { | ||
1596 | ret = mt2701_afe_runtime_resume(dev); | ||
1597 | if (ret) | ||
1598 | goto err_pm_disable; | ||
1599 | } | ||
1600 | pm_runtime_get_sync(dev); | ||
1601 | |||
1602 | ret = snd_soc_register_platform(dev, &mtk_afe_pcm_platform); | ||
1599 | if (ret) { | 1603 | if (ret) { |
1600 | dev_warn(dev, "err_platform\n"); | 1604 | dev_warn(dev, "err_platform\n"); |
1601 | goto err_platform; | 1605 | goto err_platform; |
@@ -1610,35 +1614,28 @@ static int mt2701_afe_pcm_dev_probe(struct platform_device *pdev) | |||
1610 | goto err_dai_component; | 1614 | goto err_dai_component; |
1611 | } | 1615 | } |
1612 | 1616 | ||
1613 | mt2701_afe_runtime_resume(&pdev->dev); | ||
1614 | |||
1615 | return 0; | 1617 | return 0; |
1616 | 1618 | ||
1617 | err_dai_component: | 1619 | err_dai_component: |
1618 | snd_soc_unregister_component(&pdev->dev); | 1620 | snd_soc_unregister_platform(dev); |
1619 | |||
1620 | err_platform: | 1621 | err_platform: |
1621 | snd_soc_unregister_platform(&pdev->dev); | 1622 | pm_runtime_put_sync(dev); |
1622 | |||
1623 | err_pm_disable: | 1623 | err_pm_disable: |
1624 | pm_runtime_disable(&pdev->dev); | 1624 | pm_runtime_disable(dev); |
1625 | 1625 | ||
1626 | return ret; | 1626 | return ret; |
1627 | } | 1627 | } |
1628 | 1628 | ||
1629 | static int mt2701_afe_pcm_dev_remove(struct platform_device *pdev) | 1629 | static int mt2701_afe_pcm_dev_remove(struct platform_device *pdev) |
1630 | { | 1630 | { |
1631 | struct mtk_base_afe *afe = platform_get_drvdata(pdev); | 1631 | pm_runtime_put_sync(&pdev->dev); |
1632 | |||
1633 | pm_runtime_disable(&pdev->dev); | 1632 | pm_runtime_disable(&pdev->dev); |
1634 | if (!pm_runtime_status_suspended(&pdev->dev)) | 1633 | if (!pm_runtime_status_suspended(&pdev->dev)) |
1635 | mt2701_afe_runtime_suspend(&pdev->dev); | 1634 | mt2701_afe_runtime_suspend(&pdev->dev); |
1636 | pm_runtime_put_sync(&pdev->dev); | ||
1637 | 1635 | ||
1638 | snd_soc_unregister_component(&pdev->dev); | 1636 | snd_soc_unregister_component(&pdev->dev); |
1639 | snd_soc_unregister_platform(&pdev->dev); | 1637 | snd_soc_unregister_platform(&pdev->dev); |
1640 | /* disable afe clock */ | 1638 | |
1641 | mt2701_afe_disable_clock(afe); | ||
1642 | return 0; | 1639 | return 0; |
1643 | } | 1640 | } |
1644 | 1641 | ||