Lines Matching refs:bus
62 static void skl_stream_update(struct hdac_bus *bus, struct hdac_stream *hstr) in skl_stream_update() argument
70 struct hdac_bus *bus = ebus_to_hbus(ebus); in skl_interrupt() local
73 if (!pm_runtime_active(bus->dev)) in skl_interrupt()
76 spin_lock(&bus->reg_lock); in skl_interrupt()
78 status = snd_hdac_chip_readl(bus, INTSTS); in skl_interrupt()
80 spin_unlock(&bus->reg_lock); in skl_interrupt()
85 status = snd_hdac_chip_readb(bus, RIRBSTS); in skl_interrupt()
88 snd_hdac_bus_update_rirb(bus); in skl_interrupt()
89 snd_hdac_chip_writeb(bus, RIRBSTS, RIRB_INT_MASK); in skl_interrupt()
92 spin_unlock(&bus->reg_lock); in skl_interrupt()
94 return snd_hdac_chip_readl(bus, INTSTS) ? IRQ_WAKE_THREAD : IRQ_HANDLED; in skl_interrupt()
100 struct hdac_bus *bus = ebus_to_hbus(ebus); in skl_threaded_handler() local
103 status = snd_hdac_chip_readl(bus, INTSTS); in skl_threaded_handler()
105 snd_hdac_bus_handle_stream_irq(bus, status, skl_stream_update); in skl_threaded_handler()
113 struct hdac_bus *bus = ebus_to_hbus(ebus); in skl_acquire_irq() local
121 dev_err(bus->dev, in skl_acquire_irq()
127 bus->irq = skl->pci->irq; in skl_acquire_irq()
141 struct hdac_bus *bus = ebus_to_hbus(ebus); in skl_suspend() local
143 snd_hdac_bus_stop_chip(bus); in skl_suspend()
144 snd_hdac_bus_enter_link_reset(bus); in skl_suspend()
153 struct hdac_bus *bus = ebus_to_hbus(ebus); in skl_resume() local
158 snd_hdac_bus_init_chip(bus, 1); in skl_resume()
169 struct hdac_bus *bus = ebus_to_hbus(ebus); in skl_runtime_suspend() local
173 dev_dbg(bus->dev, "in %s\n", __func__); in skl_runtime_suspend()
176 snd_hdac_chip_updatew(bus, WAKEEN, 0, STATESTS_INT_MASK); in skl_runtime_suspend()
184 snd_hdac_bus_stop_chip(bus); in skl_runtime_suspend()
185 snd_hdac_bus_enter_link_reset(bus); in skl_runtime_suspend()
194 struct hdac_bus *bus = ebus_to_hbus(ebus); in skl_runtime_resume() local
198 dev_dbg(bus->dev, "in %s\n", __func__); in skl_runtime_resume()
201 status = snd_hdac_chip_readw(bus, STATESTS); in skl_runtime_resume()
204 snd_hdac_bus_init_chip(bus, true); in skl_runtime_resume()
206 snd_hdac_chip_updatew(bus, WAKEEN, STATESTS_INT_MASK, 0); in skl_runtime_resume()
223 struct hdac_bus *bus = ebus_to_hbus(ebus); in skl_free() local
229 if (bus->irq >= 0) in skl_free()
230 free_irq(bus->irq, (void *)bus); in skl_free()
231 if (bus->remap_addr) in skl_free()
232 iounmap(bus->remap_addr); in skl_free()
234 snd_hdac_bus_free_stream_pages(bus); in skl_free()
247 struct hdac_bus *bus = ebus_to_hbus(&skl->ebus); in skl_dmic_device_register() local
254 dev_err(bus->dev, "failed to allocate dmic device\n"); in skl_dmic_device_register()
260 dev_err(bus->dev, "failed to add dmic device: %d\n", ret); in skl_dmic_device_register()
280 struct hdac_bus *bus = ebus_to_hbus(ebus); in probe_codec() local
285 mutex_lock(&bus->cmd_mutex); in probe_codec()
286 snd_hdac_bus_send_cmd(bus, cmd); in probe_codec()
287 snd_hdac_bus_get_response(bus, addr, &res); in probe_codec()
288 mutex_unlock(&bus->cmd_mutex); in probe_codec()
291 dev_dbg(bus->dev, "codec #%d probed OK\n", addr); in probe_codec()
299 struct hdac_bus *bus = ebus_to_hbus(ebus); in skl_codec_create() local
306 if ((bus->codec_mask & (1 << c))) { in skl_codec_create()
312 dev_warn(bus->dev, in skl_codec_create()
314 bus->codec_mask &= ~(1 << c); in skl_codec_create()
323 snd_hdac_bus_stop_chip(bus); in skl_codec_create()
324 snd_hdac_bus_init_chip(bus, true); in skl_codec_create()
362 ebus->bus.use_posbuf = 1; in skl_create()
365 ebus->bus.bdl_pos_adj = 0; in skl_create()
375 struct hdac_bus *bus = ebus_to_hbus(ebus); in skl_first_init() local
385 bus->addr = pci_resource_start(pci, 0); in skl_first_init()
386 bus->remap_addr = pci_ioremap_bar(pci, 0); in skl_first_init()
387 if (bus->remap_addr == NULL) { in skl_first_init()
388 dev_err(bus->dev, "ioremap error\n"); in skl_first_init()
398 synchronize_irq(bus->irq); in skl_first_init()
400 gcap = snd_hdac_chip_readw(bus, GCAP); in skl_first_init()
401 dev_dbg(bus->dev, "chipset global capabilities = 0x%x\n", gcap); in skl_first_init()
404 if (!dma_set_mask(bus->dev, DMA_BIT_MASK(64))) { in skl_first_init()
405 dma_set_coherent_mask(bus->dev, DMA_BIT_MASK(64)); in skl_first_init()
407 dma_set_mask(bus->dev, DMA_BIT_MASK(32)); in skl_first_init()
408 dma_set_coherent_mask(bus->dev, DMA_BIT_MASK(32)); in skl_first_init()
427 err = snd_hdac_bus_alloc_stream_pages(bus); in skl_first_init()
434 snd_hdac_bus_init_chip(bus, true); in skl_first_init()
437 if (!bus->codec_mask) { in skl_first_init()
438 dev_err(bus->dev, "no codecs found!\n"); in skl_first_init()
450 struct hdac_bus *bus = NULL; in skl_probe() local
459 bus = ebus_to_hbus(ebus); in skl_probe()
465 skl->nhlt = skl_nhlt_init(bus->dev); in skl_probe()
476 dev_dbg(bus->dev, "error failed to register dsp\n"); in skl_probe()
489 err = skl_platform_register(bus->dev); in skl_probe()
499 pm_runtime_set_autosuspend_delay(bus->dev, SKL_SUSPEND_DELAY); in skl_probe()
500 pm_runtime_use_autosuspend(bus->dev); in skl_probe()
501 pm_runtime_put_noidle(bus->dev); in skl_probe()
502 pm_runtime_allow(bus->dev); in skl_probe()
507 skl_platform_unregister(bus->dev); in skl_probe()