Lines Matching defs:skl

3  *  skl.c - Implementation of ASoC Intel SKL HD Audio driver
31 #include "skl.h"
32 #include "skl-sst-dsp.h"
33 #include "skl-sst-ipc.h"
56 static void skl_init_pci(struct skl_dev *skl)
58 struct hdac_bus *bus = skl_to_bus(skl);
68 skl_update_pci_byte(skl->pci, AZX_PCIREG_TCSEL, 0x07, 0);
260 struct skl_dev *skl = bus_to_skl(bus);
263 ret = request_threaded_irq(skl->pci->irq, skl_interrupt,
270 skl->pci->irq);
274 bus->irq = skl->pci->irq;
275 pci_intx(skl->pci, 1);
284 struct skl_dev *skl = bus_to_skl(bus);
286 return skl_suspend_late_dsp(skl);
292 struct skl_dev *skl = bus_to_skl(bus);
298 ret = skl_suspend_dsp(skl);
308 skl_cleanup_resources(skl);
315 struct skl_dev *skl = bus_to_skl(bus);
317 skl_init_pci(skl);
321 return skl_resume_dsp(skl);
333 struct skl_dev *skl = bus_to_skl(bus);
340 if (skl->supend_active) {
353 skl->fw_loaded = false;
363 struct skl_dev *skl = bus_to_skl(bus);
371 if (skl->supend_active) {
429 struct skl_dev *skl = bus_to_skl(bus);
431 skl->init_done = 0; /* to be sure */
444 pci_release_regions(skl->pci);
445 pci_disable_device(skl->pci);
461 * So for skl+, there are 6 ssps, so 18 clocks will be created.
474 static struct snd_soc_acpi_mach *skl_find_hda_machine(struct skl_dev *skl,
488 static int skl_find_machine(struct skl_dev *skl, void *driver_data)
490 struct hdac_bus *bus = skl_to_bus(skl);
497 mach = skl_find_hda_machine(skl, driver_data);
504 skl->mach = mach;
505 skl->fw_name = mach->fw_filename;
509 skl->use_tplg_pcm = pdata->use_tplg_pcm;
511 intel_nhlt_get_dmic_geo(&skl->pci->dev,
512 skl->nhlt);
518 static int skl_machine_device_register(struct skl_dev *skl)
520 struct snd_soc_acpi_mach *mach = skl->mach;
521 struct hdac_bus *bus = skl_to_bus(skl);
549 skl->i2s_dev = pdev;
554 static void skl_machine_device_unregister(struct skl_dev *skl)
556 if (skl->i2s_dev)
557 platform_device_unregister(skl->i2s_dev);
560 static int skl_dmic_device_register(struct skl_dev *skl)
562 struct hdac_bus *bus = skl_to_bus(skl);
579 skl->dmic_dev = pdev;
584 static void skl_dmic_device_unregister(struct skl_dev *skl)
586 if (skl->dmic_dev)
587 platform_device_unregister(skl->dmic_dev);
622 static int skl_clock_device_register(struct skl_dev *skl)
627 if (!skl->nhlt)
630 clk_pdata = devm_kzalloc(&skl->pci->dev, sizeof(*clk_pdata),
635 init_skl_xtal_rate(skl->pci->device);
642 skl_get_clks(skl, clk_pdata->ssp_clks);
643 clk_pdata->pvt_data = skl;
646 pdevinfo.parent = &skl->pci->dev;
648 pdevinfo.name = "skl-ssp-clk";
651 skl->clk_dev = platform_device_register_full(&pdevinfo);
652 return PTR_ERR_OR_ZERO(skl->clk_dev);
655 static void skl_clock_device_unregister(struct skl_dev *skl)
657 if (skl->clk_dev)
658 platform_device_unregister(skl->clk_dev);
715 struct skl_dev *skl = bus_to_skl(bus);
729 hda_codec = devm_kzalloc(&skl->pci->dev, sizeof(*hda_codec),
789 struct skl_dev *skl = container_of(work, struct skl_dev, probe_work);
790 struct hdac_bus *bus = skl_to_bus(skl);
797 skl_init_pci(skl);
820 err = skl_machine_device_register(skl);
838 skl->init_done = 1;
854 struct skl_dev *skl;
865 skl = devm_kzalloc(&pci->dev, sizeof(*skl), GFP_KERNEL);
866 if (!skl) {
871 hbus = skl_to_hbus(skl);
872 bus = skl_to_bus(skl);
874 INIT_LIST_HEAD(&skl->ppl_list);
875 INIT_LIST_HEAD(&skl->bind_list);
882 skl->pci = pci;
883 INIT_WORK(&skl->probe_work, skl_probe_work);
891 *rskl = skl;
898 struct skl_dev *skl = bus_to_skl(bus);
899 struct pci_dev *pci = skl->pci;
965 struct skl_dev *skl;
988 err = skl_create(pci, &skl);
992 bus = skl_to_bus(skl);
1000 skl->pci_id = pci->device;
1004 skl->nhlt = intel_nhlt_init(bus->dev);
1006 if (skl->nhlt == NULL) {
1016 err = skl_nhlt_create_sysfs(skl);
1022 skl_nhlt_update_topology_bin(skl);
1025 err = skl_clock_device_register(skl);
1032 pci_set_drvdata(skl->pci, bus);
1035 err = skl_find_machine(skl, (void *)pci_id->driver_data);
1041 err = skl_init_dsp(skl);
1046 skl->enable_miscbdcge = skl_enable_miscbdcge;
1047 skl->clock_power_gating = skl_clock_power_gating;
1053 err = skl_dmic_device_register(skl);
1064 schedule_work(&skl->probe_work);
1069 skl_dmic_device_unregister(skl);
1071 skl_free_dsp(skl);
1073 skl_clock_device_unregister(skl);
1075 if (skl->nhlt)
1076 intel_nhlt_free(skl->nhlt);
1088 struct skl_dev *skl;
1093 skl = bus_to_skl(bus);
1095 if (!skl->init_done)
1100 skl_dsp_sleep(skl->dsp);
1113 struct skl_dev *skl = bus_to_skl(bus);
1115 cancel_work_sync(&skl->probe_work);
1123 skl_free_dsp(skl);
1124 skl_machine_device_unregister(skl);
1125 skl_dmic_device_unregister(skl);
1126 skl_clock_device_unregister(skl);
1127 skl_nhlt_remove_sysfs(skl);
1128 if (skl->nhlt)
1129 intel_nhlt_free(skl->nhlt);