aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/hda/hda_intel.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 1da8a5c9b9e1..0f3d3db0df71 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2691,10 +2691,6 @@ static int azx_runtime_suspend(struct device *dev)
2691 struct snd_card *card = dev_get_drvdata(dev); 2691 struct snd_card *card = dev_get_drvdata(dev);
2692 struct azx *chip = card->private_data; 2692 struct azx *chip = card->private_data;
2693 2693
2694 if (!power_save_controller ||
2695 !(chip->driver_caps & AZX_DCAPS_PM_RUNTIME))
2696 return -EAGAIN;
2697
2698 azx_stop_chip(chip); 2694 azx_stop_chip(chip);
2699 azx_clear_irq_pending(chip); 2695 azx_clear_irq_pending(chip);
2700 return 0; 2696 return 0;
@@ -2709,12 +2705,25 @@ static int azx_runtime_resume(struct device *dev)
2709 azx_init_chip(chip, 1); 2705 azx_init_chip(chip, 1);
2710 return 0; 2706 return 0;
2711} 2707}
2708
2709static int azx_runtime_idle(struct device *dev)
2710{
2711 struct snd_card *card = dev_get_drvdata(dev);
2712 struct azx *chip = card->private_data;
2713
2714 if (!power_save_controller ||
2715 !(chip->driver_caps & AZX_DCAPS_PM_RUNTIME))
2716 return -EBUSY;
2717
2718 return 0;
2719}
2720
2712#endif /* CONFIG_PM_RUNTIME */ 2721#endif /* CONFIG_PM_RUNTIME */
2713 2722
2714#ifdef CONFIG_PM 2723#ifdef CONFIG_PM
2715static const struct dev_pm_ops azx_pm = { 2724static const struct dev_pm_ops azx_pm = {
2716 SET_SYSTEM_SLEEP_PM_OPS(azx_suspend, azx_resume) 2725 SET_SYSTEM_SLEEP_PM_OPS(azx_suspend, azx_resume)
2717 SET_RUNTIME_PM_OPS(azx_runtime_suspend, azx_runtime_resume, NULL) 2726 SET_RUNTIME_PM_OPS(azx_runtime_suspend, azx_runtime_resume, azx_runtime_idle)
2718}; 2727};
2719 2728
2720#define AZX_PM_OPS &azx_pm 2729#define AZX_PM_OPS &azx_pm