Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: SOF: Intel: hda: set L1SEN on S0ix suspend

Set L1SEN to make sure the system can enter S0ix, and restore it on
resume.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191101170916.26517-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Keyon Jie and committed by
Mark Brown
16299326 8cd73ce7

+18
+15
sound/soc/sof/intel/hda-dsp.c
··· 478 478 479 479 int hda_dsp_resume(struct snd_sof_dev *sdev) 480 480 { 481 + struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; 481 482 struct pci_dev *pci = to_pci_dev(sdev->dev); 482 483 483 484 if (sdev->s0_suspend) { 485 + /* restore L1SEN bit */ 486 + if (hda->l1_support_changed) 487 + snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, 488 + HDA_VS_INTEL_EM2, 489 + HDA_VS_INTEL_EM2_L1SEN, 0); 490 + 484 491 /* restore and disable the system wakeup */ 485 492 pci_restore_state(pci); 486 493 disable_irq_wake(pci->irq); ··· 525 518 526 519 int hda_dsp_suspend(struct snd_sof_dev *sdev) 527 520 { 521 + struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; 528 522 struct hdac_bus *bus = sof_to_bus(sdev); 529 523 struct pci_dev *pci = to_pci_dev(sdev->dev); 530 524 int ret; 531 525 532 526 if (sdev->s0_suspend) { 527 + /* enable L1SEN to make sure the system can enter S0Ix */ 528 + hda->l1_support_changed = 529 + snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, 530 + HDA_VS_INTEL_EM2, 531 + HDA_VS_INTEL_EM2_L1SEN, 532 + HDA_VS_INTEL_EM2_L1SEN); 533 + 533 534 /* enable the system waking up via IPC IRQ */ 534 535 enable_irq_wake(pci->irq); 535 536 pci_save_state(pci);
+3
sound/soc/sof/intel/hda.h
··· 408 408 409 409 int irq; 410 410 411 + /* PM related */ 412 + bool l1_support_changed;/* during suspend, is L1SEN changed or not */ 413 + 411 414 /* DMIC device */ 412 415 struct platform_device *dmic_dev; 413 416 };