• Home
  • Raw
  • Download

Lines Matching full:bus

56 	struct hdac_bus *bus = skl_to_bus(skl);  in skl_init_pci()  local
65 dev_dbg(bus->dev, "Clearing TCSEL\n"); in skl_init_pci()
105 struct hdac_bus *bus = pci_get_drvdata(pci); in skl_clock_power_gating() local
114 snd_hdac_chip_updatel(bus, VS_EM2, AZX_REG_VS_EM2_L1SEN, val); in skl_clock_power_gating()
126 static int skl_init_chip(struct hdac_bus *bus, bool full_reset) in skl_init_chip() argument
131 skl_enable_miscbdcge(bus->dev, false); in skl_init_chip()
132 ret = snd_hdac_bus_init_chip(bus, full_reset); in skl_init_chip()
135 list_for_each_entry(hlink, &bus->hlink_list, list) in skl_init_chip()
136 bus->io_ops->reg_writel(0, hlink->ml_addr + AZX_REG_ML_LOSIDV); in skl_init_chip()
138 skl_enable_miscbdcge(bus->dev, true); in skl_init_chip()
146 struct hdac_bus *bus = pci_get_drvdata(pci); in skl_update_d0i3c() local
150 reg = snd_hdac_chip_readb(bus, VS_D0I3C); in skl_update_d0i3c()
154 reg = snd_hdac_chip_readb(bus, VS_D0I3C); in skl_update_d0i3c()
159 dev_err(bus->dev, "Before D0I3C update: D0I3C CIP timeout\n"); in skl_update_d0i3c()
168 snd_hdac_chip_writeb(bus, VS_D0I3C, reg); in skl_update_d0i3c()
172 reg = snd_hdac_chip_readb(bus, VS_D0I3C); in skl_update_d0i3c()
175 reg = snd_hdac_chip_readb(bus, VS_D0I3C); in skl_update_d0i3c()
180 dev_err(bus->dev, "After D0I3C update: D0I3C CIP timeout\n"); in skl_update_d0i3c()
184 dev_dbg(bus->dev, "D0I3C register = 0x%x\n", in skl_update_d0i3c()
185 snd_hdac_chip_readb(bus, VS_D0I3C)); in skl_update_d0i3c()
189 static void skl_stream_update(struct hdac_bus *bus, struct hdac_stream *hstr) in skl_stream_update() argument
196 struct hdac_bus *bus = dev_id; in skl_interrupt() local
199 if (!pm_runtime_active(bus->dev)) in skl_interrupt()
202 spin_lock(&bus->reg_lock); in skl_interrupt()
204 status = snd_hdac_chip_readl(bus, INTSTS); in skl_interrupt()
206 spin_unlock(&bus->reg_lock); in skl_interrupt()
211 status = snd_hdac_chip_readb(bus, RIRBSTS); in skl_interrupt()
214 snd_hdac_bus_update_rirb(bus); in skl_interrupt()
215 snd_hdac_chip_writeb(bus, RIRBSTS, RIRB_INT_MASK); in skl_interrupt()
218 spin_unlock(&bus->reg_lock); in skl_interrupt()
220 return snd_hdac_chip_readl(bus, INTSTS) ? IRQ_WAKE_THREAD : IRQ_HANDLED; in skl_interrupt()
225 struct hdac_bus *bus = dev_id; in skl_threaded_handler() local
228 status = snd_hdac_chip_readl(bus, INTSTS); in skl_threaded_handler()
230 snd_hdac_bus_handle_stream_irq(bus, status, skl_stream_update); in skl_threaded_handler()
235 static int skl_acquire_irq(struct hdac_bus *bus, int do_disconnect) in skl_acquire_irq() argument
237 struct skl *skl = bus_to_skl(bus); in skl_acquire_irq()
243 KBUILD_MODNAME, bus); in skl_acquire_irq()
245 dev_err(bus->dev, in skl_acquire_irq()
251 bus->irq = skl->pci->irq; in skl_acquire_irq()
260 struct hdac_bus *bus = pci_get_drvdata(pci); in skl_suspend_late() local
261 struct skl *skl = bus_to_skl(bus); in skl_suspend_late()
267 static int _skl_suspend(struct hdac_bus *bus) in _skl_suspend() argument
269 struct skl *skl = bus_to_skl(bus); in _skl_suspend()
270 struct pci_dev *pci = to_pci_dev(bus->dev); in _skl_suspend()
273 snd_hdac_ext_bus_link_power_down_all(bus); in _skl_suspend()
279 snd_hdac_bus_stop_chip(bus); in _skl_suspend()
282 skl_enable_miscbdcge(bus->dev, false); in _skl_suspend()
283 snd_hdac_bus_enter_link_reset(bus); in _skl_suspend()
284 skl_enable_miscbdcge(bus->dev, true); in _skl_suspend()
290 static int _skl_resume(struct hdac_bus *bus) in _skl_resume() argument
292 struct skl *skl = bus_to_skl(bus); in _skl_resume()
295 skl_init_chip(bus, true); in _skl_resume()
308 struct hdac_bus *bus = pci_get_drvdata(pci); in skl_suspend() local
309 struct skl *skl = bus_to_skl(bus); in skl_suspend()
318 snd_hdac_ext_bus_link_power_down_all(bus); in skl_suspend()
320 if (bus->cmd_dma_state) in skl_suspend()
321 snd_hdac_bus_stop_cmd_io(bus); in skl_suspend()
323 enable_irq_wake(bus->irq); in skl_suspend()
326 ret = _skl_suspend(bus); in skl_suspend()
333 ret = snd_hdac_display_power(bus, false); in skl_suspend()
335 dev_err(bus->dev, in skl_suspend()
345 struct hdac_bus *bus = pci_get_drvdata(pci); in skl_resume() local
346 struct skl *skl = bus_to_skl(bus); in skl_resume()
352 ret = snd_hdac_display_power(bus, true); in skl_resume()
354 dev_err(bus->dev, in skl_resume()
366 snd_hdac_ext_bus_link_power_up_all(bus); in skl_resume()
367 disable_irq_wake(bus->irq); in skl_resume()
373 list_for_each_entry(hlink, &bus->hlink_list, list) { in skl_resume()
379 if (bus->cmd_dma_state) in skl_resume()
380 snd_hdac_bus_init_cmd_io(bus); in skl_resume()
382 ret = _skl_resume(bus); in skl_resume()
385 list_for_each_entry(hlink, &bus->hlink_list, list) { in skl_resume()
390 if (!bus->cmd_dma_state) in skl_resume()
391 snd_hdac_bus_stop_cmd_io(bus); in skl_resume()
402 struct hdac_bus *bus = pci_get_drvdata(pci); in skl_runtime_suspend() local
404 dev_dbg(bus->dev, "in %s\n", __func__); in skl_runtime_suspend()
406 return _skl_suspend(bus); in skl_runtime_suspend()
412 struct hdac_bus *bus = pci_get_drvdata(pci); in skl_runtime_resume() local
414 dev_dbg(bus->dev, "in %s\n", __func__); in skl_runtime_resume()
416 return _skl_resume(bus); in skl_runtime_resume()
429 static int skl_free(struct hdac_bus *bus) in skl_free() argument
431 struct skl *skl = bus_to_skl(bus); in skl_free()
435 snd_hdac_ext_stop_streams(bus); in skl_free()
437 if (bus->irq >= 0) in skl_free()
438 free_irq(bus->irq, (void *)bus); in skl_free()
439 snd_hdac_bus_free_stream_pages(bus); in skl_free()
440 snd_hdac_stream_free_all(bus); in skl_free()
441 snd_hdac_link_free_all(bus); in skl_free()
443 if (bus->remap_addr) in skl_free()
444 iounmap(bus->remap_addr); in skl_free()
449 snd_hdac_ext_bus_exit(bus); in skl_free()
453 snd_hdac_i915_exit(bus); in skl_free()
477 struct hdac_bus *bus = skl_to_bus(skl); in skl_find_machine() local
483 dev_err(bus->dev, "No matching machine driver found\n"); in skl_find_machine()
501 struct hdac_bus *bus = skl_to_bus(skl); in skl_machine_device_register() local
508 dev_err(bus->dev, "platform device alloc failed\n"); in skl_machine_device_register()
514 dev_err(bus->dev, "failed to add machine device\n"); in skl_machine_device_register()
535 struct hdac_bus *bus = skl_to_bus(skl); in skl_dmic_device_register() local
542 dev_err(bus->dev, "failed to allocate dmic device\n"); in skl_dmic_device_register()
548 dev_err(bus->dev, "failed to add dmic device: %d\n", ret); in skl_dmic_device_register()
634 static int probe_codec(struct hdac_bus *bus, int addr) in probe_codec() argument
639 struct skl *skl = bus_to_skl(bus); in probe_codec()
642 mutex_lock(&bus->cmd_mutex); in probe_codec()
643 snd_hdac_bus_send_cmd(bus, cmd); in probe_codec()
644 snd_hdac_bus_get_response(bus, addr, &res); in probe_codec()
645 mutex_unlock(&bus->cmd_mutex); in probe_codec()
648 dev_dbg(bus->dev, "codec #%d probed OK\n", addr); in probe_codec()
654 return snd_hdac_ext_bus_device_init(bus, addr, hdev); in probe_codec()
658 static void skl_codec_create(struct hdac_bus *bus) in skl_codec_create() argument
666 if ((bus->codec_mask & (1 << c))) { in skl_codec_create()
667 if (probe_codec(bus, c) < 0) { in skl_codec_create()
672 dev_warn(bus->dev, in skl_codec_create()
674 bus->codec_mask &= ~(1 << c); in skl_codec_create()
677 * codec often screws up the controller bus, in skl_codec_create()
680 * better to reset the controller bus to get in skl_codec_create()
683 snd_hdac_bus_stop_chip(bus); in skl_codec_create()
684 skl_init_chip(bus, true); in skl_codec_create()
695 static int skl_i915_init(struct hdac_bus *bus) in skl_i915_init() argument
703 err = snd_hdac_i915_init(bus); in skl_i915_init()
707 err = snd_hdac_display_power(bus, true); in skl_i915_init()
709 dev_err(bus->dev, "Cannot turn on display power on i915\n"); in skl_i915_init()
717 struct hdac_bus *bus = skl_to_bus(skl); in skl_probe_work() local
722 err = skl_i915_init(bus); in skl_probe_work()
727 err = skl_init_chip(bus, true); in skl_probe_work()
729 dev_err(bus->dev, "Init chip failed with err: %d\n", err); in skl_probe_work()
734 if (!bus->codec_mask) in skl_probe_work()
735 dev_info(bus->dev, "no hda codecs found!\n"); in skl_probe_work()
738 skl_codec_create(bus); in skl_probe_work()
741 err = skl_platform_register(bus->dev); in skl_probe_work()
743 dev_err(bus->dev, "platform register failed: %d\n", err); in skl_probe_work()
747 if (bus->ppcap) { in skl_probe_work()
750 dev_err(bus->dev, "machine register failed: %d\n", err); in skl_probe_work()
758 list_for_each_entry(hlink, &bus->hlink_list, list) in skl_probe_work()
759 snd_hdac_ext_bus_link_put(bus, hlink); in skl_probe_work()
762 err = snd_hdac_display_power(bus, false); in skl_probe_work()
764 dev_err(bus->dev, "Cannot turn off display power on i915\n"); in skl_probe_work()
771 pm_runtime_put_noidle(bus->dev); in skl_probe_work()
772 pm_runtime_allow(bus->dev); in skl_probe_work()
779 err = snd_hdac_display_power(bus, false); in skl_probe_work()
790 struct hdac_bus *bus; in skl_create() local
806 bus = skl_to_bus(skl); in skl_create()
807 snd_hdac_ext_bus_init(bus, &pci->dev, &bus_core_ops, io_ops, NULL); in skl_create()
808 bus->use_posbuf = 1; in skl_create()
811 bus->bdl_pos_adj = 0; in skl_create()
818 static int skl_first_init(struct hdac_bus *bus) in skl_first_init() argument
820 struct skl *skl = bus_to_skl(bus); in skl_first_init()
830 bus->addr = pci_resource_start(pci, 0); in skl_first_init()
831 bus->remap_addr = pci_ioremap_bar(pci, 0); in skl_first_init()
832 if (bus->remap_addr == NULL) { in skl_first_init()
833 dev_err(bus->dev, "ioremap error\n"); in skl_first_init()
837 snd_hdac_bus_reset_link(bus, true); in skl_first_init()
839 snd_hdac_bus_parse_capabilities(bus); in skl_first_init()
841 if (skl_acquire_irq(bus, 0) < 0) in skl_first_init()
845 synchronize_irq(bus->irq); in skl_first_init()
847 gcap = snd_hdac_chip_readw(bus, GCAP); in skl_first_init()
848 dev_dbg(bus->dev, "chipset global capabilities = 0x%x\n", gcap); in skl_first_init()
851 if (!dma_set_mask(bus->dev, DMA_BIT_MASK(64))) { in skl_first_init()
852 dma_set_coherent_mask(bus->dev, DMA_BIT_MASK(64)); in skl_first_init()
854 dma_set_mask(bus->dev, DMA_BIT_MASK(32)); in skl_first_init()
855 dma_set_coherent_mask(bus->dev, DMA_BIT_MASK(32)); in skl_first_init()
865 bus->num_streams = cp_streams + pb_streams; in skl_first_init()
869 (bus, 0, cp_streams, SNDRV_PCM_STREAM_CAPTURE); in skl_first_init()
872 (bus, start_idx, pb_streams, SNDRV_PCM_STREAM_PLAYBACK); in skl_first_init()
874 err = snd_hdac_bus_alloc_stream_pages(bus); in skl_first_init()
881 return skl_init_chip(bus, true); in skl_first_init()
888 struct hdac_bus *bus = NULL; in skl_probe() local
896 bus = skl_to_bus(skl); in skl_probe()
898 err = skl_first_init(bus); in skl_probe()
904 device_disable_async_suspend(bus->dev); in skl_probe()
906 skl->nhlt = skl_nhlt_init(bus->dev); in skl_probe()
919 pci_set_drvdata(skl->pci, bus); in skl_probe()
922 if (bus->ppcap) { in skl_probe()
934 dev_dbg(bus->dev, "error failed to register dsp\n"); in skl_probe()
940 if (bus->mlcap) in skl_probe()
941 snd_hdac_ext_bus_get_ml_capabilities(bus); in skl_probe()
943 snd_hdac_bus_stop_chip(bus); in skl_probe()
961 skl_free(bus); in skl_probe()
968 struct hdac_bus *bus = pci_get_drvdata(pci); in skl_shutdown() local
973 if (!bus) in skl_shutdown()
976 skl = bus_to_skl(bus); in skl_shutdown()
981 snd_hdac_ext_stop_streams(bus); in skl_shutdown()
982 list_for_each_entry(s, &bus->stream_list, list) { in skl_shutdown()
984 snd_hdac_ext_stream_decouple(bus, stream, false); in skl_shutdown()
987 snd_hdac_bus_stop_chip(bus); in skl_shutdown()
992 struct hdac_bus *bus = pci_get_drvdata(pci); in skl_remove() local
993 struct skl *skl = bus_to_skl(bus); in skl_remove()
1000 snd_hdac_ext_bus_device_remove(bus); in skl_remove()
1010 skl_free(bus); in skl_remove()