summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/intel/hda.c
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2019-05-30 06:50:15 -0500
committerMark Brown <broonie@kernel.org>2019-05-30 16:35:26 +0100
commite13ef82a9ab83dd21d8dd43ef9f5e8bf5b101106 (patch)
tree2f7732bdbd21e1c9785d1a6e2912a8c4c53a6d0b /sound/soc/sof/intel/hda.c
parent8fe751d8fd5cbf19e9d7852c5b7d8ed818be1934 (diff)
ASoC: SOF: add COMPILE_TEST for PCI options
Add COMPILE_TEST and use IS_ENABLED(CONFIG_PCI) to sort out cross-compilation issues. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/intel/hda.c')
-rw-r--r--sound/soc/sof/intel/hda.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index 7e3980a2f7ba..5378d47a55fd 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -506,7 +506,9 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
* TODO: support interrupt mode selection with kernel parameter
* support msi multiple vectors
*/
+#if IS_ENABLED(CONFIG_PCI)
ret = pci_alloc_irq_vectors(pci, 1, 1, PCI_IRQ_MSI);
+#endif
if (ret < 0) {
dev_info(sdev->dev, "use legacy interrupt mode\n");
/*
@@ -518,7 +520,9 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
sdev->msi_enabled = 0;
} else {
dev_info(sdev->dev, "use msi interrupt mode\n");
+#if IS_ENABLED(CONFIG_PCI)
hdev->irq = pci_irq_vector(pci, 0);
+#endif
/* ipc irq number is the same of hda irq */
sdev->ipc_irq = hdev->irq;
sdev->msi_enabled = 1;
@@ -622,8 +626,10 @@ free_ipc_irq:
free_hda_irq:
free_irq(hdev->irq, bus);
free_irq_vector:
+#if IS_ENABLED(CONFIG_PCI)
if (sdev->msi_enabled)
pci_free_irq_vectors(pci);
+#endif
free_streams:
hda_dsp_stream_free(sdev);
/* dsp_unmap: not currently used */
@@ -638,7 +644,6 @@ int hda_dsp_remove(struct snd_sof_dev *sdev)
{
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
struct hdac_bus *bus = sof_to_bus(sdev);
- struct pci_dev *pci = to_pci_dev(sdev->dev);
const struct sof_intel_dsp_desc *chip = hda->desc;
#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
@@ -667,8 +672,12 @@ int hda_dsp_remove(struct snd_sof_dev *sdev)
free_irq(sdev->ipc_irq, sdev);
free_irq(hda->irq, bus);
- if (sdev->msi_enabled)
+#if IS_ENABLED(CONFIG_PCI)
+ if (sdev->msi_enabled) {
+ struct pci_dev *pci = to_pci_dev(sdev->dev);
pci_free_irq_vectors(pci);
+ }
+#endif
hda_dsp_stream_free(sdev);
#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)