|
29 | 29 | #include <sound/sof.h> |
30 | 30 | #include <sound/pcm_params.h> |
31 | 31 | #include <linux/pm_runtime.h> |
| 32 | +#include <sound/hda_register.h> |
32 | 33 |
|
33 | 34 | #include "../sof-priv.h" |
34 | 35 | #include "../ops.h" |
@@ -148,6 +149,24 @@ void hda_dsp_ctrl_misc_clock_gating(struct snd_sof_dev *sdev, bool enable) |
148 | 149 | snd_sof_pci_update_bits(sdev, PCI_CGCTL, PCI_CGCTL_MISCBDCGE_MASK, val); |
149 | 150 | } |
150 | 151 |
|
| 152 | +void hda_dsp_ctrl_clock_power_gating(struct snd_sof_dev *sdev, bool enable) |
| 153 | +{ |
| 154 | + struct hdac_bus *bus = sof_to_bus(sdev); |
| 155 | + u32 val; |
| 156 | + |
| 157 | + /* Update PDCGE bit of CGCTL register */ |
| 158 | + val = enable ? PCI_CGCTL_ADSPDCGE : 0; |
| 159 | + snd_sof_pci_update_bits(sdev, PCI_CGCTL, PCI_CGCTL_ADSPDCGE, val); |
| 160 | + |
| 161 | + /* Update L1SEN bit of EM2 register */ |
| 162 | + val = enable ? SOF_HDA_VS_EM2_L1SEN : 0; |
| 163 | + snd_hdac_chip_updatel(bus, VS_EM2, SOF_HDA_VS_EM2_L1SEN, val); |
| 164 | + |
| 165 | + /* Update ADSPPGD bit of PGCTL register */ |
| 166 | + val = enable ? 0 : PCI_TCSEL_ADSPPGD; |
| 167 | + snd_sof_pci_update_bits(sdev, PCI_TCSEL, PCI_TCSEL_ADSPPGD, val); |
| 168 | +} |
| 169 | + |
151 | 170 | #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) |
152 | 171 | /* |
153 | 172 | * While performing reset, controller may not come back properly and causing |
|
0 commit comments