Lines Matching refs:bus
25 void snd_hdac_stream_init(struct hdac_bus *bus, struct hdac_stream *azx_dev, in snd_hdac_stream_init() argument
28 azx_dev->bus = bus; in snd_hdac_stream_init()
30 azx_dev->sd_addr = bus->remap_addr + (0x20 * idx + 0x80); in snd_hdac_stream_init()
37 list_add_tail(&azx_dev->list, &bus->stream_list); in snd_hdac_stream_init()
50 struct hdac_bus *bus = azx_dev->bus; in snd_hdac_stream_start() local
52 trace_snd_hdac_stream_start(bus, azx_dev); in snd_hdac_stream_start()
54 azx_dev->start_wallclk = snd_hdac_chip_readl(bus, WALLCLK); in snd_hdac_stream_start()
59 snd_hdac_chip_updatel(bus, INTCTL, 0, 1 << azx_dev->index); in snd_hdac_stream_start()
88 trace_snd_hdac_stream_stop(azx_dev->bus, azx_dev); in snd_hdac_stream_stop()
92 snd_hdac_chip_updatel(azx_dev->bus, INTCTL, 1 << azx_dev->index, 0); in snd_hdac_stream_stop()
141 struct hdac_bus *bus = azx_dev->bus; in snd_hdac_stream_setup() local
155 if (!bus->snoop) in snd_hdac_stream_setup()
177 if (bus->use_posbuf && bus->posbuf.addr) { in snd_hdac_stream_setup()
178 if (!(snd_hdac_chip_readl(bus, DPLBASE) & AZX_DPLBASE_ENABLE)) in snd_hdac_stream_setup()
179 snd_hdac_chip_writel(bus, DPLBASE, in snd_hdac_stream_setup()
180 (u32)bus->posbuf.addr | AZX_DPLBASE_ENABLE); in snd_hdac_stream_setup()
237 struct hdac_stream *snd_hdac_stream_assign(struct hdac_bus *bus, in snd_hdac_stream_assign() argument
247 list_for_each_entry(azx_dev, &bus->stream_list, list) { in snd_hdac_stream_assign()
256 if (!res || bus->reverse_assign) in snd_hdac_stream_assign()
260 spin_lock_irq(&bus->reg_lock); in snd_hdac_stream_assign()
265 spin_unlock_irq(&bus->reg_lock); in snd_hdac_stream_assign()
279 struct hdac_bus *bus = azx_dev->bus; in snd_hdac_stream_release() local
281 spin_lock_irq(&bus->reg_lock); in snd_hdac_stream_release()
285 spin_unlock_irq(&bus->reg_lock); in snd_hdac_stream_release()
297 struct hdac_stream *snd_hdac_get_stream(struct hdac_bus *bus, in snd_hdac_get_stream() argument
302 list_for_each_entry(s, &bus->stream_list, list) { in snd_hdac_get_stream()
314 static int setup_bdle(struct hdac_bus *bus, in setup_bdle() argument
335 if (bus->align_bdle_4k) { in setup_bdle()
364 struct hdac_bus *bus = azx_dev->bus; in snd_hdac_stream_setup_periods() local
383 pos_adj = bus->bdl_pos_adj; in snd_hdac_stream_setup_periods()
394 dev_warn(bus->dev, "Too big adjustment %d\n", in snd_hdac_stream_setup_periods()
398 ofs = setup_bdle(bus, snd_pcm_get_dma_buf(substream), in snd_hdac_stream_setup_periods()
409 ofs = setup_bdle(bus, snd_pcm_get_dma_buf(substream), in snd_hdac_stream_setup_periods()
413 ofs = setup_bdle(bus, snd_pcm_get_dma_buf(substream), in snd_hdac_stream_setup_periods()
423 dev_err(bus->dev, "Too many BDL entries: buffer=%d, period=%d\n", in snd_hdac_stream_setup_periods()
472 return snd_hdac_chip_readl(azx_dev->bus, WALLCLK); in azx_cc_read()
522 struct hdac_bus *bus = azx_dev->bus; in snd_hdac_stream_timecounter_init() local
529 list_for_each_entry(s, &bus->stream_list, list) { in snd_hdac_stream_timecounter_init()
553 struct hdac_bus *bus = azx_dev->bus; in snd_hdac_stream_sync_trigger() local
558 val = _snd_hdac_chip_readl(bus, reg); in snd_hdac_stream_sync_trigger()
563 _snd_hdac_chip_writel(bus, reg, val); in snd_hdac_stream_sync_trigger()
579 struct hdac_bus *bus = azx_dev->bus; in snd_hdac_stream_sync() local
586 list_for_each_entry(s, &bus->stream_list, list) { in snd_hdac_stream_sync()
623 struct hdac_bus *bus = azx_dev->bus; in snd_hdac_dsp_prepare() local
628 spin_lock_irq(&bus->reg_lock); in snd_hdac_dsp_prepare()
630 spin_unlock_irq(&bus->reg_lock); in snd_hdac_dsp_prepare()
635 spin_unlock_irq(&bus->reg_lock); in snd_hdac_dsp_prepare()
637 err = bus->io_ops->dma_alloc_pages(bus, SNDRV_DMA_TYPE_DEV_SG, in snd_hdac_dsp_prepare()
655 err = setup_bdle(bus, bufp, azx_dev, &bdl, 0, byte_size, 0); in snd_hdac_dsp_prepare()
664 bus->io_ops->dma_free_pages(bus, bufp); in snd_hdac_dsp_prepare()
666 spin_lock_irq(&bus->reg_lock); in snd_hdac_dsp_prepare()
668 spin_unlock_irq(&bus->reg_lock); in snd_hdac_dsp_prepare()
697 struct hdac_bus *bus = azx_dev->bus; in snd_hdac_dsp_cleanup() local
711 bus->io_ops->dma_free_pages(bus, dmab); in snd_hdac_dsp_cleanup()
714 spin_lock_irq(&bus->reg_lock); in snd_hdac_dsp_cleanup()
716 spin_unlock_irq(&bus->reg_lock); in snd_hdac_dsp_cleanup()