[alsa-devel] [PATCH 3/3] ALSA: hda: register selectively for SPT-LP

Vinod Koul vinod.koul at intel.com
Thu Apr 30 16:52:36 CEST 2015


Sunrisepoint-LP HDA controller supports aDSP, so register selectively for
this controller

Signed-off-by: Vinod Koul <vinod.koul at intel.com>
---
 sound/pci/hda/hda_intel.c | 31 ++++++++++++++++++++++++++++---
 1 file changed, 28 insertions(+), 3 deletions(-)

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 488dab208ddc..314a7beb2b29 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2023,9 +2023,6 @@ static const struct pci_device_id azx_ids[] = {
 	/* Sunrise Point */
 	{ PCI_DEVICE(0x8086, 0xa170),
 	  .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_SKYLAKE },
-	/* Sunrise Point-LP */
-	{ PCI_DEVICE(0x8086, 0x9d70),
-	  .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_SKYLAKE },
 	/* Haswell */
 	{ PCI_DEVICE(0x8086, 0x0a0c),
 	  .driver_data = AZX_DRIVER_HDMI | AZX_DCAPS_INTEL_HASWELL },
@@ -2205,6 +2202,14 @@ static const struct pci_device_id azx_ids[] = {
 };
 MODULE_DEVICE_TABLE(pci, azx_ids);
 
+static const struct pci_device_id azx_intel_adsp_ids[] = {
+	/* Sunrise Point-LP */
+	{ PCI_DEVICE(0x8086, 0x9d70),
+	  .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_SKYLAKE },
+	{ 0, }
+};
+MODULE_DEVICE_TABLE(pci, azx_intel_adsp_ids);
+
 /* pci_driver definition */
 static struct pci_driver azx_driver = {
 	.name = KBUILD_MODNAME,
@@ -2217,12 +2222,25 @@ static struct pci_driver azx_driver = {
 	},
 };
 
+static struct pci_driver azx_intel_adsp_driver = {
+	.name = KBUILD_MODNAME,
+	.id_table = azx_intel_adsp_ids,
+	.probe = azx_probe,
+	.remove = azx_remove,
+	.shutdown = azx_shutdown,
+	.driver = {
+		.pm = AZX_PM_OPS,
+	},
+};
+
 static int __init azx_module_init(void)
 {
 	int ret;
 
 	ret = pci_register_driver(&azx_driver);
 
+	if (!hdac_adsp_enable)
+		ret = pci_register_driver(&azx_intel_adsp_driver);
 	return ret;
 }
 module_init(azx_module_init);
@@ -2231,5 +2249,12 @@ static void __exit azx_module_exit(void)
 {
 	pci_unregister_driver(&azx_driver);
 
+	/* Some Intel HDA controllers support aDSP this is enabled thru the
+	 * ASoC HDA aDSP driver So we register for these devices only when
+	 * aDSP is disabled by the hdac_adsp_enable flag
+	 */
+	if (!hdac_adsp_enable)
+		pci_unregister_driver(&azx_intel_adsp_driver);
+
 }
 module_exit(azx_module_exit);
-- 
1.9.1



More information about the Alsa-devel mailing list