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) 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()
198 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_get()
206 int hda_dsp_stream_put(struct snd_sof_dev *sdev, int direction, int stream_tag) in hda_dsp_stream_put() argument
208 struct hdac_bus *bus = sof_to_bus(sdev); in hda_dsp_stream_put()
236 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_put()
242 dev_dbg(sdev->dev, "stream_tag %d not opened!\n", stream_tag); in hda_dsp_stream_put()
249 int hda_dsp_stream_trigger(struct snd_sof_dev *sdev, in hda_dsp_stream_trigger() argument
263 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL, in hda_dsp_stream_trigger()
267 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_trigger()
274 ret = snd_sof_dsp_read_poll_timeout(sdev, in hda_dsp_stream_trigger()
282 dev_err(sdev->dev, in hda_dsp_stream_trigger()
293 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_trigger()
298 ret = snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_trigger()
305 dev_err(sdev->dev, in hda_dsp_stream_trigger()
311 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, sd_offset + in hda_dsp_stream_trigger()
316 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL, in hda_dsp_stream_trigger()
320 dev_err(sdev->dev, "error: unknown command: %d\n", cmd); in hda_dsp_stream_trigger()
328 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
332 struct hdac_bus *bus = sof_to_bus(sdev); in hda_dsp_iccmax_stream_hw_params()
339 dev_err(sdev->dev, "error: no stream available\n"); in hda_dsp_iccmax_stream_hw_params()
347 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, in hda_dsp_iccmax_stream_hw_params()
350 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, in hda_dsp_iccmax_stream_hw_params()
356 ret = hda_dsp_stream_setup_bdl(sdev, dmab, hstream); in hda_dsp_iccmax_stream_hw_params()
358 dev_err(sdev->dev, "error: set up of BDL failed\n"); in hda_dsp_iccmax_stream_hw_params()
363 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, in hda_dsp_iccmax_stream_hw_params()
366 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_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_iccmax_stream_hw_params()
381 snd_sof_dsp_update_bits(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPCTL, in hda_dsp_iccmax_stream_hw_params()
388 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, sd_offset, in hda_dsp_iccmax_stream_hw_params()
398 int hda_dsp_stream_hw_params(struct snd_sof_dev *sdev, in hda_dsp_stream_hw_params() argument
403 struct hdac_bus *bus = sof_to_bus(sdev); in hda_dsp_stream_hw_params()
412 dev_err(sdev->dev, "error: no stream available\n"); in hda_dsp_stream_hw_params()
418 snd_sof_dsp_update_bits(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPCTL, in hda_dsp_stream_hw_params()
422 dev_err(sdev->dev, "error: no dma buffer allocated!\n"); in hda_dsp_stream_hw_params()
427 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, sd_offset, in hda_dsp_stream_hw_params()
431 ret = snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
438 dev_err(sdev->dev, in hda_dsp_stream_hw_params()
444 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
450 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, sd_offset, 0x1, in hda_dsp_stream_hw_params()
454 val = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
460 dev_err(sdev->dev, "error: stream reset failed\n"); in hda_dsp_stream_hw_params()
465 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, sd_offset, 0x1, in hda_dsp_stream_hw_params()
471 val = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
477 dev_err(sdev->dev, "error: timeout waiting for stream reset\n"); in hda_dsp_stream_hw_params()
485 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
488 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
493 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, sd_offset, in hda_dsp_stream_hw_params()
497 ret = snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
504 dev_err(sdev->dev, in hda_dsp_stream_hw_params()
510 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
517 ret = hda_dsp_stream_setup_bdl(sdev, dmab, hstream); in hda_dsp_stream_hw_params()
519 dev_err(sdev->dev, "error: set up of BDL failed\n"); in hda_dsp_stream_hw_params()
524 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, sd_offset, in hda_dsp_stream_hw_params()
530 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
546 snd_sof_dsp_update_bits(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPCTL, in hda_dsp_stream_hw_params()
550 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
556 snd_sof_dsp_update_bits(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPCTL, in hda_dsp_stream_hw_params()
560 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
565 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
568 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
573 if (!(snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_ADSP_DPLBASE) in hda_dsp_stream_hw_params()
575 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, SOF_HDA_ADSP_DPUBASE, in hda_dsp_stream_hw_params()
577 snd_sof_dsp_write(sdev, HDA_DSP_HDA_BAR, SOF_HDA_ADSP_DPLBASE, in hda_dsp_stream_hw_params()
583 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, sd_offset, in hda_dsp_stream_hw_params()
590 snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, in hda_dsp_stream_hw_params()
602 int hda_dsp_stream_hw_free(struct snd_sof_dev *sdev, in hda_dsp_stream_hw_free() argument
609 struct hdac_bus *bus = sof_to_bus(sdev); in hda_dsp_stream_hw_free()
615 snd_sof_dsp_update_bits(sdev, HDA_DSP_PP_BAR, in hda_dsp_stream_hw_free()
624 bool hda_dsp_check_stream_irq(struct snd_sof_dev *sdev) in hda_dsp_check_stream_irq() argument
626 struct hdac_bus *bus = sof_to_bus(sdev); in hda_dsp_check_stream_irq()
699 struct snd_sof_dev *sdev = context; in hda_dsp_stream_threaded_handler() local
700 struct hdac_bus *bus = sof_to_bus(sdev); in hda_dsp_stream_threaded_handler()
744 int hda_dsp_stream_init(struct snd_sof_dev *sdev) in hda_dsp_stream_init() argument
746 struct hdac_bus *bus = sof_to_bus(sdev); in hda_dsp_stream_init()
749 struct pci_dev *pci = to_pci_dev(sdev->dev); in hda_dsp_stream_init()
755 gcap = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_GCAP); in hda_dsp_stream_init()
756 dev_dbg(sdev->dev, "hda global caps = 0x%x\n", gcap); in hda_dsp_stream_init()
763 dev_dbg(sdev->dev, "detected %d playback and %d capture streams\n", in hda_dsp_stream_init()
767 dev_err(sdev->dev, "error: too many playback streams %d\n", in hda_dsp_stream_init()
773 dev_err(sdev->dev, "error: too many capture streams %d\n", in hda_dsp_stream_init()
786 dev_err(sdev->dev, "error: posbuffer dma alloc failed\n"); in hda_dsp_stream_init()
795 dev_err(sdev->dev, "error: RB alloc failed\n"); in hda_dsp_stream_init()
804 hda_stream = devm_kzalloc(sdev->dev, sizeof(*hda_stream), in hda_dsp_stream_init()
809 hda_stream->sdev = sdev; in hda_dsp_stream_init()
813 stream->pphc_addr = sdev->bar[HDA_DSP_PP_BAR] + in hda_dsp_stream_init()
816 stream->pplc_addr = sdev->bar[HDA_DSP_PP_BAR] + in hda_dsp_stream_init()
821 if (sdev->bar[HDA_DSP_SPIB_BAR]) { in hda_dsp_stream_init()
822 stream->spib_addr = sdev->bar[HDA_DSP_SPIB_BAR] + in hda_dsp_stream_init()
826 stream->fifo_addr = sdev->bar[HDA_DSP_SPIB_BAR] + in hda_dsp_stream_init()
836 hstream->sd_addr = sdev->bar[HDA_DSP_HDA_BAR] + sd_offset; in hda_dsp_stream_init()
846 dev_err(sdev->dev, "error: stream bdl dma alloc failed\n"); in hda_dsp_stream_init()
859 hda_stream = devm_kzalloc(sdev->dev, sizeof(*hda_stream), in hda_dsp_stream_init()
864 hda_stream->sdev = sdev; in hda_dsp_stream_init()
869 stream->pphc_addr = sdev->bar[HDA_DSP_PP_BAR] + in hda_dsp_stream_init()
872 stream->pplc_addr = sdev->bar[HDA_DSP_PP_BAR] + in hda_dsp_stream_init()
877 if (sdev->bar[HDA_DSP_SPIB_BAR]) { in hda_dsp_stream_init()
878 stream->spib_addr = sdev->bar[HDA_DSP_SPIB_BAR] + in hda_dsp_stream_init()
882 stream->fifo_addr = sdev->bar[HDA_DSP_SPIB_BAR] + in hda_dsp_stream_init()
892 hstream->sd_addr = sdev->bar[HDA_DSP_HDA_BAR] + sd_offset; in hda_dsp_stream_init()
902 dev_err(sdev->dev, "error: stream bdl dma alloc failed\n"); in hda_dsp_stream_init()
918 void hda_dsp_stream_free(struct snd_sof_dev *sdev) in hda_dsp_stream_free() argument
920 struct hdac_bus *bus = sof_to_bus(sdev); in hda_dsp_stream_free()
945 devm_kfree(sdev->dev, hda_stream); in hda_dsp_stream_free()