ASoC: Intel: avs: Switch to acpi-nhlt
authorMark Brown <broonie@kernel.org>
Mon, 22 Apr 2024 00:55:47 +0000 (09:55 +0900)
committerMark Brown <broonie@kernel.org>
Mon, 22 Apr 2024 00:55:47 +0000 (09:55 +0900)
Merge series from Cezary Rojewski <cezary.rojewski@intel.com>:

The change is based on rafael/acpi-nhlt [1] immutable branch which
Rafael kindly prepared for me. Without the topmost changes to ACPI/NHLT,
the patches present will fail to compile.

Recent changes for the ACPI tree [2] refactored interfaces of the NHLT
table. Currently we have two implementations - one found in acpi
subsystem (unused) and one in sound/hda/. As NHLT is part of ACPI, idea
is to make the former useful and then switch all users of existing
sound/hda/intel-nhlt.c to this new interface over time and remove the
duplicate afterward.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/?h=acpi-nhlt
[2]: https://lore.kernel.org/linux-acpi/20240319083018.3159716-1-cezary.rojewski@intel.com/

1  2 
sound/soc/intel/avs/avs.h
sound/soc/intel/avs/core.c
sound/soc/intel/avs/path.c

Simple merge
index a059bb6888d80ea82624d6b17392370fc9eb8568,a61ce42b426cbf428f254802cf3dfa275cf4c3bd..f56f9e19276ae06a74978f3fdb69dc3bb499bb3d
@@@ -215,9 -215,8 +216,7 @@@ static void avs_hda_probe_work(struct w
        if (ret < 0)
                return;
  
-       adev->nhlt = intel_nhlt_init(adev->dev);
-       if (!adev->nhlt)
-               dev_info(bus->dev, "platform has no NHLT\n");
+       acpi_nhlt_get_gbl_table();
 -      avs_debugfs_init(adev);
  
        avs_register_all_boards(adev);
  
@@@ -543,9 -547,8 +542,8 @@@ static void avs_pci_remove(struct pci_d
  
        avs_unregister_all_boards(adev);
  
-       if (adev->nhlt)
-               intel_nhlt_free(adev->nhlt);
 -      avs_debugfs_exit(adev);
+       acpi_nhlt_put_gbl_table();
 +      avs_debugfs_exit(adev);
  
        if (avs_platattr_test(adev, CLDMA))
                hda_cldma_free(&code_loader);
index fa3fec339548ca238dc46e652e77f3633a095302,531a086642be1f11098a74f79c889df9f7e224da..0a34d63e262ebba1267cf280e140a9524295156a
@@@ -143,12 -144,12 +144,12 @@@ static bool avs_dma_type_is_input(u32 d
  
  static int avs_copier_create(struct avs_dev *adev, struct avs_path_module *mod)
  {
-       struct nhlt_acpi_table *nhlt = adev->nhlt;
        struct avs_tplg_module *t = mod->template;
        struct avs_copier_cfg *cfg;
-       struct nhlt_specific_cfg *ep_blob;
+       struct acpi_nhlt_format_config *ep_blob;
+       struct acpi_nhlt_endpoint *ep;
        union avs_connector_node_id node_id = {0};
 -      size_t cfg_size, data_size = 0;
 +      size_t cfg_size, data_size;
        void *data = NULL;
        u32 dma_type;
        int ret;