diff mbox series

[1/2] ALSA: hda: intel-dsp-config: Switch to ACPI NHLT

Message ID 20240419084307.2718881-2-cezary.rojewski@intel.com (mailing list archive)
State New, archived
Headers show
Series ASoC: Intel: avs: Switch to acpi-nhlt | expand

Commit Message

Cezary Rojewski April 19, 2024, 8:43 a.m. UTC
From: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>

Now that NHLT support in ACPI framework was introduced, migrate
intel-dsp-config driver to new API.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
---
 sound/hda/Kconfig            |  1 +
 sound/hda/intel-dsp-config.c | 16 +++++++++-------
 2 files changed, 10 insertions(+), 7 deletions(-)

Comments

Cezary Rojewski May 9, 2024, 11:15 a.m. UTC | #1
On 2024-04-19 10:43 AM, Cezary Rojewski wrote:
> From: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
> 
> Now that NHLT support in ACPI framework was introduced, migrate
> intel-dsp-config driver to new API.

Hello,

I see that this patch has not landed in Mark's for-next. Takashi, what's 
the verdict here? Should this go entirely (entire patchset) through Mark 
or should the NHLT changes [1] plus this patch alone be incorporated 
into for-next of yours separately?


[1]: 
https://lore.kernel.org/linux-acpi/20240319083018.3159716-1-cezary.rojewski@intel.com/


Kind regards,
Czarek
Takashi Iwai May 9, 2024, 12:35 p.m. UTC | #2
On Thu, 09 May 2024 13:15:15 +0200,
Cezary Rojewski wrote:
> 
> On 2024-04-19 10:43 AM, Cezary Rojewski wrote:
> > From: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
> > 
> > Now that NHLT support in ACPI framework was introduced, migrate
> > intel-dsp-config driver to new API.
> 
> Hello,
> 
> I see that this patch has not landed in Mark's for-next. Takashi,
> what's the verdict here? Should this go entirely (entire patchset)
> through Mark or should the NHLT changes [1] plus this patch alone be
> incorporated into for-next of yours separately?

OK, I took the patch now to my tree.


thanks,

Takashi


> 
> 
> [1]:
> https://lore.kernel.org/linux-acpi/20240319083018.3159716-1-cezary.rojewski@intel.com/
> 
> 
> Kind regards,
> Czarek
Takashi Iwai May 9, 2024, 1:08 p.m. UTC | #3
On Thu, 09 May 2024 14:35:46 +0200,
Takashi Iwai wrote:
> 
> On Thu, 09 May 2024 13:15:15 +0200,
> Cezary Rojewski wrote:
> > 
> > On 2024-04-19 10:43 AM, Cezary Rojewski wrote:
> > > From: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
> > > 
> > > Now that NHLT support in ACPI framework was introduced, migrate
> > > intel-dsp-config driver to new API.
> > 
> > Hello,
> > 
> > I see that this patch has not landed in Mark's for-next. Takashi,
> > what's the verdict here? Should this go entirely (entire patchset)
> > through Mark or should the NHLT changes [1] plus this patch alone be
> > incorporated into for-next of yours separately?
> 
> OK, I took the patch now to my tree.

... and it turned out that this doesn't work easily because
include/linux/acpi/nhlt.h isn't a part of Linus tree yet.  I'd need to
pull the change via an immutable branch or such at first.

I don't know how Mark applied the ASoC patch, but if that actually
worked, it's better to take from his tree.  Or, in such a case, at
best to be merged through the tree where the new API got introduced
(i.e. ACPI tree).

In anyway, feel free to take my ack for the patch

Acked-by: Takashi Iwai <tiwai@suse.de>


thanks,

Takashi

> 
> 
> thanks,
> 
> Takashi
> 
> 
> > 
> > 
> > [1]:
> > https://lore.kernel.org/linux-acpi/20240319083018.3159716-1-cezary.rojewski@intel.com/
> > 
> > 
> > Kind regards,
> > Czarek
Mark Brown May 9, 2024, 3:41 p.m. UTC | #4
On Thu, May 09, 2024 at 03:08:28PM +0200, Takashi Iwai wrote:

> I don't know how Mark applied the ASoC patch, but if that actually
> worked, it's better to take from his tree.  Or, in such a case, at
> best to be merged through the tree where the new API got introduced
> (i.e. ACPI tree).

The cover letter mentioned a branch that's a dependency - TBH I'd been
expecting you to apply the core ALSA patch to your tree, but I can apply
to mine if you prefer?
Takashi Iwai May 9, 2024, 6:25 p.m. UTC | #5
On Thu, 09 May 2024 17:41:56 +0200,
Mark Brown wrote:
> 
> On Thu, May 09, 2024 at 03:08:28PM +0200, Takashi Iwai wrote:
> 
> > I don't know how Mark applied the ASoC patch, but if that actually
> > worked, it's better to take from his tree.  Or, in such a case, at
> > best to be merged through the tree where the new API got introduced
> > (i.e. ACPI tree).
> 
> The cover letter mentioned a branch that's a dependency - TBH I'd been
> expecting you to apply the core ALSA patch to your tree, but I can apply
> to mine if you prefer?

Ah thanks, I overlooked that.  Now applied to my tree.


Takashi
diff mbox series

Patch

diff --git a/sound/hda/Kconfig b/sound/hda/Kconfig
index 741179ccbd4e..e2ac247fc1d4 100644
--- a/sound/hda/Kconfig
+++ b/sound/hda/Kconfig
@@ -42,6 +42,7 @@  config SND_INTEL_NHLT
 
 config SND_INTEL_DSP_CONFIG
 	tristate
+	select ACPI_NHLT if ACPI
 	select SND_INTEL_NHLT if ACPI
 	select SND_INTEL_SOUNDWIRE_ACPI if ACPI
 	# this config should be selected only for Intel DSP platforms.
diff --git a/sound/hda/intel-dsp-config.c b/sound/hda/intel-dsp-config.c
index 6a384b922e4f..ea050805c20f 100644
--- a/sound/hda/intel-dsp-config.c
+++ b/sound/hda/intel-dsp-config.c
@@ -13,6 +13,8 @@ 
 #include <sound/intel-nhlt.h>
 #include <sound/soc-acpi.h>
 
+#include <acpi/nhlt.h>
+
 static int dsp_driver;
 
 module_param(dsp_driver, int, 0444);
@@ -570,15 +572,15 @@  static const struct config_entry *snd_intel_dsp_find_config
 
 static int snd_intel_dsp_check_dmic(struct pci_dev *pci)
 {
-	struct nhlt_acpi_table *nhlt;
 	int ret = 0;
 
-	nhlt = intel_nhlt_init(&pci->dev);
-	if (nhlt) {
-		if (intel_nhlt_has_endpoint_type(nhlt, NHLT_LINK_DMIC))
-			ret = 1;
-		intel_nhlt_free(nhlt);
-	}
+	acpi_nhlt_get_gbl_table();
+
+	if (acpi_nhlt_find_endpoint(ACPI_NHLT_LINKTYPE_PDM, -1, -1, -1))
+		ret = 1;
+
+	acpi_nhlt_put_gbl_table();
+
 	return ret;
 }