Lines Matching refs:sdev

31 static int hda_setup_bdle(struct snd_sof_dev *sdev,  in hda_setup_bdle()  argument
37 struct hdac_bus *bus = sof_to_bus(sdev); in hda_setup_bdle()
45 dev_err(sdev->dev, "error: stream frags exceeded\n"); in hda_setup_bdle()
70 dev_vdbg(sdev->dev, "bdl, frags:%d, chunk size:0x%x;\n", in hda_setup_bdle()
82 int hda_dsp_stream_setup_bdl(struct snd_sof_dev *sdev, in hda_dsp_stream_setup_bdl() argument
86 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_dsp_stream_setup_bdl()
92 dev_dbg(sdev->dev, "period_bytes:0x%x\n", period_bytes); in hda_dsp_stream_setup_bdl()
98 dev_dbg(sdev->dev, "periods:%d\n", periods); in hda_dsp_stream_setup_bdl()
119 offset = hda_setup_bdle(sdev, dmab, in hda_dsp_stream_setup_bdl()
123 offset = hda_setup_bdle(sdev, dmab, in hda_dsp_stream_setup_bdl()
131 int hda_dsp_stream_spib_config(struct snd_sof_dev *sdev, in hda_dsp_stream_spib_config() argument
138 if (!sdev->bar[HDA_DSP_SPIB_BAR]) { in hda_dsp_stream_spib_config()
139 dev_err(sdev->dev, "error: address of spib capability is NULL\n"); in hda_dsp_stream_spib_config()
146 snd_sof_dsp_update_bits(sdev, HDA_DSP_SPIB_BAR, in hda_dsp_stream_spib_config()
151 sof_io_write(sdev, stream->spib_addr, size); in hda_dsp_stream_spib_config()
158 hda_dsp_stream_get(struct snd_sof_dev *sdev, int direction, u32 flags) in hda_dsp_stream_get() argument
160 struct hdac_bus *bus = sof_to_bus(sdev); in hda_dsp_stream_get()
187 dev_err(sdev->dev, "error: no free %s streams\n", in hda_dsp_stream_get()
201 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_get()
209 int hda_dsp_stream_put(struct snd_sof_dev *sdev, int direction, int stream_tag) in hda_dsp_stream_put() argument
211 struct hdac_bus *bus = sof_to_bus(sdev); in hda_dsp_stream_put()
243 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, HDA_VS_INTEL_EM2, in hda_dsp_stream_put()
247 dev_dbg(sdev->dev, "stream_tag %d not opened!\n", stream_tag); in hda_dsp_stream_put()
254 int hda_dsp_stream_trigger(struct snd_sof_dev *sdev, in hda_dsp_stream_trigger() argument
268 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL, in hda_dsp_stream_trigger()
272 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_trigger()
279 ret = snd_sof_dsp_read_poll_timeout(sdev, in hda_dsp_stream_trigger()
287 dev_err(sdev->dev, in hda_dsp_stream_trigger()
298 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_trigger()
303 ret = snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_trigger()
310 dev_err(sdev->dev, in hda_dsp_stream_trigger()
316 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, sd_offset + in hda_dsp_stream_trigger()
321 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL, in hda_dsp_stream_trigger()
325 dev_err(sdev->dev, "error: unknown command: %d\n", cmd); in hda_dsp_stream_trigger()
333 int hda_dsp_iccmax_stream_hw_params(struct snd_sof_dev *sdev, struct hdac_ext_stream *stream, in hda_dsp_iccmax_stream_hw_params() argument
337 struct hdac_bus *bus = sof_to_bus(sdev); in hda_dsp_iccmax_stream_hw_params()
344 dev_err(sdev->dev, "error: no stream available\n"); in hda_dsp_iccmax_stream_hw_params()
352 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, in hda_dsp_iccmax_stream_hw_params()
355 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, in hda_dsp_iccmax_stream_hw_params()
361 ret = hda_dsp_stream_setup_bdl(sdev, dmab, hstream); in hda_dsp_iccmax_stream_hw_params()
363 dev_err(sdev->dev, "error: set up of BDL failed\n"); in hda_dsp_iccmax_stream_hw_params()
368 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, in hda_dsp_iccmax_stream_hw_params()
371 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, in hda_dsp_iccmax_stream_hw_params()
376 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, in hda_dsp_iccmax_stream_hw_params()
381 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_iccmax_stream_hw_params()
386 snd_sof_dsp_update_bits(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPCTL, in hda_dsp_iccmax_stream_hw_params()
393 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, sd_offset, in hda_dsp_iccmax_stream_hw_params()
403 int hda_dsp_stream_hw_params(struct snd_sof_dev *sdev, in hda_dsp_stream_hw_params() argument
408 struct hdac_bus *bus = sof_to_bus(sdev); in hda_dsp_stream_hw_params()
417 dev_err(sdev->dev, "error: no stream available\n"); in hda_dsp_stream_hw_params()
423 snd_sof_dsp_update_bits(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPCTL, in hda_dsp_stream_hw_params()
427 dev_err(sdev->dev, "error: no dma buffer allocated!\n"); in hda_dsp_stream_hw_params()
432 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, sd_offset, in hda_dsp_stream_hw_params()
436 ret = snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
443 dev_err(sdev->dev, in hda_dsp_stream_hw_params()
449 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
455 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, sd_offset, 0x1, in hda_dsp_stream_hw_params()
459 val = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
465 dev_err(sdev->dev, "error: stream reset failed\n"); in hda_dsp_stream_hw_params()
470 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, sd_offset, 0x1, in hda_dsp_stream_hw_params()
476 val = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
482 dev_err(sdev->dev, "error: timeout waiting for stream reset\n"); in hda_dsp_stream_hw_params()
490 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
493 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
498 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, sd_offset, in hda_dsp_stream_hw_params()
502 ret = snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
509 dev_err(sdev->dev, in hda_dsp_stream_hw_params()
515 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
522 ret = hda_dsp_stream_setup_bdl(sdev, dmab, hstream); in hda_dsp_stream_hw_params()
524 dev_err(sdev->dev, "error: set up of BDL failed\n"); in hda_dsp_stream_hw_params()
529 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, sd_offset, in hda_dsp_stream_hw_params()
535 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
551 snd_sof_dsp_update_bits(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPCTL, in hda_dsp_stream_hw_params()
555 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
561 snd_sof_dsp_update_bits(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPCTL, in hda_dsp_stream_hw_params()
565 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
570 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
573 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
578 if (!(snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_ADSP_DPLBASE) in hda_dsp_stream_hw_params()
580 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, SOF_HDA_ADSP_DPUBASE, in hda_dsp_stream_hw_params()
582 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, SOF_HDA_ADSP_DPLBASE, in hda_dsp_stream_hw_params()
588 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, sd_offset, in hda_dsp_stream_hw_params()
595 snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
607 int hda_dsp_stream_hw_free(struct snd_sof_dev *sdev, in hda_dsp_stream_hw_free() argument
614 struct hdac_bus *bus = sof_to_bus(sdev); in hda_dsp_stream_hw_free()
620 snd_sof_dsp_update_bits(sdev, HDA_DSP_PP_BAR, in hda_dsp_stream_hw_free()
629 bool hda_dsp_check_stream_irq(struct snd_sof_dev *sdev) in hda_dsp_check_stream_irq() argument
631 struct hdac_bus *bus = sof_to_bus(sdev); in hda_dsp_check_stream_irq()
704 struct snd_sof_dev *sdev = context; in hda_dsp_stream_threaded_handler() local
705 struct hdac_bus *bus = sof_to_bus(sdev); in hda_dsp_stream_threaded_handler()
749 int hda_dsp_stream_init(struct snd_sof_dev *sdev) in hda_dsp_stream_init() argument
751 struct hdac_bus *bus = sof_to_bus(sdev); in hda_dsp_stream_init()
754 struct pci_dev *pci = to_pci_dev(sdev->dev); in hda_dsp_stream_init()
760 gcap = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_GCAP); in hda_dsp_stream_init()
761 dev_dbg(sdev->dev, "hda global caps = 0x%x\n", gcap); in hda_dsp_stream_init()
768 dev_dbg(sdev->dev, "detected %d playback and %d capture streams\n", in hda_dsp_stream_init()
772 dev_err(sdev->dev, "error: too many playback streams %d\n", in hda_dsp_stream_init()
778 dev_err(sdev->dev, "error: too many capture streams %d\n", in hda_dsp_stream_init()
791 dev_err(sdev->dev, "error: posbuffer dma alloc failed\n"); in hda_dsp_stream_init()
800 dev_err(sdev->dev, "error: RB alloc failed\n"); in hda_dsp_stream_init()
809 hda_stream = devm_kzalloc(sdev->dev, sizeof(*hda_stream), in hda_dsp_stream_init()
814 hda_stream->sdev = sdev; in hda_dsp_stream_init()
818 stream->pphc_addr = sdev->bar[HDA_DSP_PP_BAR] + in hda_dsp_stream_init()
821 stream->pplc_addr = sdev->bar[HDA_DSP_PP_BAR] + in hda_dsp_stream_init()
826 if (sdev->bar[HDA_DSP_SPIB_BAR]) { in hda_dsp_stream_init()
827 stream->spib_addr = sdev->bar[HDA_DSP_SPIB_BAR] + in hda_dsp_stream_init()
831 stream->fifo_addr = sdev->bar[HDA_DSP_SPIB_BAR] + in hda_dsp_stream_init()
841 hstream->sd_addr = sdev->bar[HDA_DSP_HDA_BAR] + sd_offset; in hda_dsp_stream_init()
851 dev_err(sdev->dev, "error: stream bdl dma alloc failed\n"); in hda_dsp_stream_init()
864 hda_stream = devm_kzalloc(sdev->dev, sizeof(*hda_stream), in hda_dsp_stream_init()
869 hda_stream->sdev = sdev; in hda_dsp_stream_init()
874 stream->pphc_addr = sdev->bar[HDA_DSP_PP_BAR] + in hda_dsp_stream_init()
877 stream->pplc_addr = sdev->bar[HDA_DSP_PP_BAR] + in hda_dsp_stream_init()
882 if (sdev->bar[HDA_DSP_SPIB_BAR]) { in hda_dsp_stream_init()
883 stream->spib_addr = sdev->bar[HDA_DSP_SPIB_BAR] + in hda_dsp_stream_init()
887 stream->fifo_addr = sdev->bar[HDA_DSP_SPIB_BAR] + in hda_dsp_stream_init()
897 hstream->sd_addr = sdev->bar[HDA_DSP_HDA_BAR] + sd_offset; in hda_dsp_stream_init()
907 dev_err(sdev->dev, "error: stream bdl dma alloc failed\n"); in hda_dsp_stream_init()
923 void hda_dsp_stream_free(struct snd_sof_dev *sdev) in hda_dsp_stream_free() argument
925 struct hdac_bus *bus = sof_to_bus(sdev); in hda_dsp_stream_free()
950 devm_kfree(sdev->dev, hda_stream); in hda_dsp_stream_free()