Lines Matching refs:sdev

27 int hda_dsp_core_reset_enter(struct snd_sof_dev *sdev, unsigned int core_mask)  in hda_dsp_core_reset_enter()  argument
35 snd_sof_dsp_update_bits_unlocked(sdev, HDA_DSP_BAR, in hda_dsp_core_reset_enter()
40 ret = snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_BAR, in hda_dsp_core_reset_enter()
47 adspcs = snd_sof_dsp_read(sdev, HDA_DSP_BAR, in hda_dsp_core_reset_enter()
51 dev_err(sdev->dev, in hda_dsp_core_reset_enter()
60 int hda_dsp_core_reset_leave(struct snd_sof_dev *sdev, unsigned int core_mask) in hda_dsp_core_reset_leave() argument
67 snd_sof_dsp_update_bits_unlocked(sdev, HDA_DSP_BAR, in hda_dsp_core_reset_leave()
74 ret = snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_BAR, in hda_dsp_core_reset_leave()
81 adspcs = snd_sof_dsp_read(sdev, HDA_DSP_BAR, in hda_dsp_core_reset_leave()
84 dev_err(sdev->dev, in hda_dsp_core_reset_leave()
93 int hda_dsp_core_stall_reset(struct snd_sof_dev *sdev, unsigned int core_mask) in hda_dsp_core_stall_reset() argument
96 snd_sof_dsp_update_bits_unlocked(sdev, HDA_DSP_BAR, in hda_dsp_core_stall_reset()
102 return hda_dsp_core_reset_enter(sdev, core_mask); in hda_dsp_core_stall_reset()
105 int hda_dsp_core_run(struct snd_sof_dev *sdev, unsigned int core_mask) in hda_dsp_core_run() argument
110 ret = hda_dsp_core_reset_leave(sdev, core_mask); in hda_dsp_core_run()
115 dev_dbg(sdev->dev, "unstall/run core: core_mask = %x\n", core_mask); in hda_dsp_core_run()
116 snd_sof_dsp_update_bits_unlocked(sdev, HDA_DSP_BAR, in hda_dsp_core_run()
122 if (!hda_dsp_core_is_enabled(sdev, core_mask)) { in hda_dsp_core_run()
123 hda_dsp_core_stall_reset(sdev, core_mask); in hda_dsp_core_run()
124 dev_err(sdev->dev, "error: DSP start core failed: core_mask %x\n", in hda_dsp_core_run()
136 int hda_dsp_core_power_up(struct snd_sof_dev *sdev, unsigned int core_mask) in hda_dsp_core_power_up() argument
143 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPCS, in hda_dsp_core_power_up()
149 ret = snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_BAR, in hda_dsp_core_power_up()
155 dev_err(sdev->dev, "error: timeout on core powerup\n"); in hda_dsp_core_power_up()
158 adspcs = snd_sof_dsp_read(sdev, HDA_DSP_BAR, in hda_dsp_core_power_up()
162 dev_err(sdev->dev, in hda_dsp_core_power_up()
171 int hda_dsp_core_power_down(struct snd_sof_dev *sdev, unsigned int core_mask) in hda_dsp_core_power_down() argument
176 snd_sof_dsp_update_bits_unlocked(sdev, HDA_DSP_BAR, in hda_dsp_core_power_down()
180 return snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_BAR, in hda_dsp_core_power_down()
187 bool hda_dsp_core_is_enabled(struct snd_sof_dev *sdev, in hda_dsp_core_is_enabled() argument
193 val = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPCS); in hda_dsp_core_is_enabled()
200 dev_dbg(sdev->dev, "DSP core(s) enabled? %d : core_mask %x\n", in hda_dsp_core_is_enabled()
206 int hda_dsp_enable_core(struct snd_sof_dev *sdev, unsigned int core_mask) in hda_dsp_enable_core() argument
211 if (hda_dsp_core_is_enabled(sdev, core_mask)) in hda_dsp_enable_core()
215 ret = hda_dsp_core_power_up(sdev, core_mask); in hda_dsp_enable_core()
217 dev_err(sdev->dev, "error: dsp core power up failed: core_mask %x\n", in hda_dsp_enable_core()
222 return hda_dsp_core_run(sdev, core_mask); in hda_dsp_enable_core()
225 int hda_dsp_core_reset_power_down(struct snd_sof_dev *sdev, in hda_dsp_core_reset_power_down() argument
231 ret = hda_dsp_core_stall_reset(sdev, core_mask); in hda_dsp_core_reset_power_down()
233 dev_err(sdev->dev, "error: dsp core reset failed: core_mask %x\n", in hda_dsp_core_reset_power_down()
239 ret = hda_dsp_core_power_down(sdev, core_mask); in hda_dsp_core_reset_power_down()
241 dev_err(sdev->dev, "error: dsp core power down fail mask %x: %d\n", in hda_dsp_core_reset_power_down()
247 if (hda_dsp_core_is_enabled(sdev, core_mask)) { in hda_dsp_core_reset_power_down()
248 dev_err(sdev->dev, "error: dsp core disable fail mask %x: %d\n", in hda_dsp_core_reset_power_down()
256 void hda_dsp_ipc_int_enable(struct snd_sof_dev *sdev) in hda_dsp_ipc_int_enable() argument
258 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_dsp_ipc_int_enable()
262 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, chip->ipc_ctl, in hda_dsp_ipc_int_enable()
267 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPIC, in hda_dsp_ipc_int_enable()
271 void hda_dsp_ipc_int_disable(struct snd_sof_dev *sdev) in hda_dsp_ipc_int_disable() argument
273 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_dsp_ipc_int_disable()
277 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPIC, in hda_dsp_ipc_int_disable()
281 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, chip->ipc_ctl, in hda_dsp_ipc_int_disable()
285 static int hda_suspend(struct snd_sof_dev *sdev, bool runtime_suspend) in hda_suspend() argument
287 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_suspend()
290 struct hdac_bus *bus = sof_to_bus(sdev); in hda_suspend()
295 hda_dsp_ipc_int_disable(sdev); in hda_suspend()
299 hda_codec_jack_wake_enable(sdev); in hda_suspend()
306 ret = hda_dsp_core_reset_power_down(sdev, chip->cores_mask); in hda_suspend()
308 dev_err(sdev->dev, in hda_suspend()
314 hda_dsp_ctrl_ppcap_enable(sdev, false); in hda_suspend()
315 hda_dsp_ctrl_ppcap_int_enable(sdev, false); in hda_suspend()
318 hda_dsp_ctrl_stop_chip(sdev); in hda_suspend()
321 snd_sof_pci_update_bits(sdev, PCI_PGCTL, in hda_suspend()
325 ret = hda_dsp_ctrl_link_reset(sdev, true); in hda_suspend()
327 dev_err(sdev->dev, in hda_suspend()
335 static int hda_resume(struct snd_sof_dev *sdev, bool runtime_resume) in hda_resume() argument
338 struct hdac_bus *bus = sof_to_bus(sdev); in hda_resume()
347 snd_sof_pci_update_bits(sdev, PCI_TCSEL, 0x07, 0); in hda_resume()
350 ret = hda_dsp_ctrl_init_chip(sdev, true); in hda_resume()
352 dev_err(sdev->dev, in hda_resume()
360 hda_codec_jack_check(sdev); in hda_resume()
374 hda_dsp_ctrl_ppcap_enable(sdev, true); in hda_resume()
375 hda_dsp_ctrl_ppcap_int_enable(sdev, true); in hda_resume()
380 int hda_dsp_resume(struct snd_sof_dev *sdev) in hda_dsp_resume() argument
383 return hda_resume(sdev, false); in hda_dsp_resume()
386 int hda_dsp_runtime_resume(struct snd_sof_dev *sdev) in hda_dsp_runtime_resume() argument
389 return hda_resume(sdev, true); in hda_dsp_runtime_resume()
392 int hda_dsp_runtime_idle(struct snd_sof_dev *sdev) in hda_dsp_runtime_idle() argument
394 struct hdac_bus *hbus = sof_to_bus(sdev); in hda_dsp_runtime_idle()
397 dev_dbg(sdev->dev, "some codecs still powered (%08X), not idle\n", in hda_dsp_runtime_idle()
405 int hda_dsp_runtime_suspend(struct snd_sof_dev *sdev) in hda_dsp_runtime_suspend() argument
408 return hda_suspend(sdev, true); in hda_dsp_runtime_suspend()
411 int hda_dsp_suspend(struct snd_sof_dev *sdev) in hda_dsp_suspend() argument
413 struct hdac_bus *bus = sof_to_bus(sdev); in hda_dsp_suspend()
417 ret = hda_suspend(sdev, false); in hda_dsp_suspend()
426 int hda_dsp_set_hw_params_upon_resume(struct snd_sof_dev *sdev) in hda_dsp_set_hw_params_upon_resume() argument
429 struct hdac_bus *bus = sof_to_bus(sdev); in hda_dsp_set_hw_params_upon_resume()