Lines Matching refs:skl
56 static void skl_init_pci(struct skl_dev *skl) in skl_init_pci() argument
58 struct hdac_bus *bus = skl_to_bus(skl); in skl_init_pci()
68 skl_update_pci_byte(skl->pci, AZX_PCIREG_TCSEL, 0x07, 0); in skl_init_pci()
260 struct skl_dev *skl = bus_to_skl(bus); in skl_acquire_irq() local
263 ret = request_threaded_irq(skl->pci->irq, skl_interrupt, in skl_acquire_irq()
270 skl->pci->irq); in skl_acquire_irq()
274 bus->irq = skl->pci->irq; in skl_acquire_irq()
275 pci_intx(skl->pci, 1); in skl_acquire_irq()
284 struct skl_dev *skl = bus_to_skl(bus); in skl_suspend_late() local
286 return skl_suspend_late_dsp(skl); in skl_suspend_late()
292 struct skl_dev *skl = bus_to_skl(bus); in _skl_suspend() local
298 ret = skl_suspend_dsp(skl); in _skl_suspend()
308 skl_cleanup_resources(skl); in _skl_suspend()
315 struct skl_dev *skl = bus_to_skl(bus); in _skl_resume() local
317 skl_init_pci(skl); in _skl_resume()
321 return skl_resume_dsp(skl); in _skl_resume()
333 struct skl_dev *skl = bus_to_skl(bus); in skl_suspend() local
340 if (skl->supend_active) { in skl_suspend()
353 skl->fw_loaded = false; in skl_suspend()
363 struct skl_dev *skl = bus_to_skl(bus); in skl_resume() local
371 if (skl->supend_active) { in skl_resume()
438 struct skl_dev *skl = bus_to_skl(bus); in skl_free() local
440 skl->init_done = 0; /* to be sure */ in skl_free()
453 pci_release_regions(skl->pci); in skl_free()
454 pci_disable_device(skl->pci); in skl_free()
483 static struct snd_soc_acpi_mach *skl_find_hda_machine(struct skl_dev *skl, in skl_find_hda_machine() argument
497 static int skl_find_machine(struct skl_dev *skl, void *driver_data) in skl_find_machine() argument
499 struct hdac_bus *bus = skl_to_bus(skl); in skl_find_machine()
506 mach = skl_find_hda_machine(skl, driver_data); in skl_find_machine()
513 skl->mach = mach; in skl_find_machine()
514 skl->fw_name = mach->fw_filename; in skl_find_machine()
518 skl->use_tplg_pcm = pdata->use_tplg_pcm; in skl_find_machine()
520 intel_nhlt_get_dmic_geo(&skl->pci->dev, in skl_find_machine()
521 skl->nhlt); in skl_find_machine()
527 static int skl_machine_device_register(struct skl_dev *skl) in skl_machine_device_register() argument
529 struct snd_soc_acpi_mach *mach = skl->mach; in skl_machine_device_register()
530 struct hdac_bus *bus = skl_to_bus(skl); in skl_machine_device_register()
558 skl->i2s_dev = pdev; in skl_machine_device_register()
563 static void skl_machine_device_unregister(struct skl_dev *skl) in skl_machine_device_unregister() argument
565 if (skl->i2s_dev) in skl_machine_device_unregister()
566 platform_device_unregister(skl->i2s_dev); in skl_machine_device_unregister()
569 static int skl_dmic_device_register(struct skl_dev *skl) in skl_dmic_device_register() argument
571 struct hdac_bus *bus = skl_to_bus(skl); in skl_dmic_device_register()
588 skl->dmic_dev = pdev; in skl_dmic_device_register()
593 static void skl_dmic_device_unregister(struct skl_dev *skl) in skl_dmic_device_unregister() argument
595 if (skl->dmic_dev) in skl_dmic_device_unregister()
596 platform_device_unregister(skl->dmic_dev); in skl_dmic_device_unregister()
631 static int skl_clock_device_register(struct skl_dev *skl) in skl_clock_device_register() argument
636 if (!skl->nhlt) in skl_clock_device_register()
639 clk_pdata = devm_kzalloc(&skl->pci->dev, sizeof(*clk_pdata), in skl_clock_device_register()
644 init_skl_xtal_rate(skl->pci->device); in skl_clock_device_register()
651 skl_get_clks(skl, clk_pdata->ssp_clks); in skl_clock_device_register()
652 clk_pdata->pvt_data = skl; in skl_clock_device_register()
655 pdevinfo.parent = &skl->pci->dev; in skl_clock_device_register()
660 skl->clk_dev = platform_device_register_full(&pdevinfo); in skl_clock_device_register()
661 return PTR_ERR_OR_ZERO(skl->clk_dev); in skl_clock_device_register()
664 static void skl_clock_device_unregister(struct skl_dev *skl) in skl_clock_device_unregister() argument
666 if (skl->clk_dev) in skl_clock_device_unregister()
667 platform_device_unregister(skl->clk_dev); in skl_clock_device_unregister()
724 struct skl_dev *skl = bus_to_skl(bus); in probe_codec() local
738 hda_codec = devm_kzalloc(&skl->pci->dev, sizeof(*hda_codec), in probe_codec()
814 struct skl_dev *skl = container_of(work, struct skl_dev, probe_work); in skl_probe_work() local
815 struct hdac_bus *bus = skl_to_bus(skl); in skl_probe_work()
825 skl_init_pci(skl); in skl_probe_work()
848 err = skl_machine_device_register(skl); in skl_probe_work()
866 skl->init_done = 1; in skl_probe_work()
882 struct skl_dev *skl; in skl_create() local
893 skl = devm_kzalloc(&pci->dev, sizeof(*skl), GFP_KERNEL); in skl_create()
894 if (!skl) { in skl_create()
899 hbus = skl_to_hbus(skl); in skl_create()
900 bus = skl_to_bus(skl); in skl_create()
902 INIT_LIST_HEAD(&skl->ppl_list); in skl_create()
903 INIT_LIST_HEAD(&skl->bind_list); in skl_create()
910 skl->pci = pci; in skl_create()
911 INIT_WORK(&skl->probe_work, skl_probe_work); in skl_create()
919 *rskl = skl; in skl_create()
926 struct skl_dev *skl = bus_to_skl(bus); in skl_first_init() local
927 struct pci_dev *pci = skl->pci; in skl_first_init()
993 struct skl_dev *skl; in skl_probe() local
1016 err = skl_create(pci, &skl); in skl_probe()
1020 bus = skl_to_bus(skl); in skl_probe()
1028 skl->pci_id = pci->device; in skl_probe()
1032 skl->nhlt = intel_nhlt_init(bus->dev); in skl_probe()
1034 if (skl->nhlt == NULL) { in skl_probe()
1044 err = skl_nhlt_create_sysfs(skl); in skl_probe()
1050 skl_nhlt_update_topology_bin(skl); in skl_probe()
1053 err = skl_clock_device_register(skl); in skl_probe()
1060 pci_set_drvdata(skl->pci, bus); in skl_probe()
1063 err = skl_find_machine(skl, (void *)pci_id->driver_data); in skl_probe()
1069 err = skl_init_dsp(skl); in skl_probe()
1074 skl->enable_miscbdcge = skl_enable_miscbdcge; in skl_probe()
1075 skl->clock_power_gating = skl_clock_power_gating; in skl_probe()
1081 err = skl_dmic_device_register(skl); in skl_probe()
1087 schedule_work(&skl->probe_work); in skl_probe()
1092 skl_free_dsp(skl); in skl_probe()
1094 skl_clock_device_unregister(skl); in skl_probe()
1096 if (skl->nhlt) in skl_probe()
1097 intel_nhlt_free(skl->nhlt); in skl_probe()
1109 struct skl_dev *skl; in skl_shutdown() local
1114 skl = bus_to_skl(bus); in skl_shutdown()
1116 if (!skl->init_done) in skl_shutdown()
1121 skl_dsp_sleep(skl->dsp); in skl_shutdown()
1134 struct skl_dev *skl = bus_to_skl(bus); in skl_remove() local
1136 cancel_work_sync(&skl->probe_work); in skl_remove()
1144 skl_free_dsp(skl); in skl_remove()
1145 skl_machine_device_unregister(skl); in skl_remove()
1146 skl_dmic_device_unregister(skl); in skl_remove()
1147 skl_clock_device_unregister(skl); in skl_remove()
1148 skl_nhlt_remove_sysfs(skl); in skl_remove()
1149 if (skl->nhlt) in skl_remove()
1150 intel_nhlt_free(skl->nhlt); in skl_remove()