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),
805 struct skl_dev *skl = container_of(work, struct skl_dev, probe_work);
806 struct hdac_bus *bus = skl_to_bus(skl);
816 skl_init_pci(skl);
839 err = skl_machine_device_register(skl);
857 skl->init_done = 1;
873 struct skl_dev *skl;
884 skl = devm_kzalloc(&pci->dev, sizeof(*skl), GFP_KERNEL);
885 if (!skl) {
890 hbus = skl_to_hbus(skl);
891 bus = skl_to_bus(skl);
893 INIT_LIST_HEAD(&skl->ppl_list);
894 INIT_LIST_HEAD(&skl->bind_list);
901 skl->pci = pci;
902 INIT_WORK(&skl->probe_work, skl_probe_work);
910 *rskl = skl;
917 struct skl_dev *skl = bus_to_skl(bus);
918 struct pci_dev *pci = skl->pci;
984 struct skl_dev *skl;
1007 err = skl_create(pci, &skl);
1011 bus = skl_to_bus(skl);
1019 skl->pci_id = pci->device;
1023 skl->nhlt = intel_nhlt_init(bus->dev);
1025 if (skl->nhlt == NULL) {
1035 err = skl_nhlt_create_sysfs(skl);
1041 skl_nhlt_update_topology_bin(skl);
1044 err = skl_clock_device_register(skl);
1051 pci_set_drvdata(skl->pci, bus);
1054 err = skl_find_machine(skl, (void *)pci_id->driver_data);
1060 err = skl_init_dsp(skl);
1065 skl->enable_miscbdcge = skl_enable_miscbdcge;
1066 skl->clock_power_gating = skl_clock_power_gating;
1072 err = skl_dmic_device_register(skl);
1078 schedule_work(&skl->probe_work);
1083 skl_free_dsp(skl);
1085 skl_clock_device_unregister(skl);
1087 if (skl->nhlt)
1088 intel_nhlt_free(skl->nhlt);
1100 struct skl_dev *skl;
1105 skl = bus_to_skl(bus);
1107 if (!skl->init_done)
1112 skl_dsp_sleep(skl->dsp);
1125 struct skl_dev *skl = bus_to_skl(bus);
1127 cancel_work_sync(&skl->probe_work);
1135 skl_free_dsp(skl);
1136 skl_machine_device_unregister(skl);
1137 skl_dmic_device_unregister(skl);
1138 skl_clock_device_unregister(skl);
1139 skl_nhlt_remove_sysfs(skl);
1140 if (skl->nhlt)
1141 intel_nhlt_free(skl->nhlt);