ASoC: SOF: Intel: hda: define check_ipc_irq op
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Thu, 14 Apr 2022 18:48:14 +0000 (13:48 -0500)
committerMark Brown <broonie@kernel.org>
Tue, 19 Apr 2022 11:03:43 +0000 (12:03 +0100)
Define the check_ipc_irq op for HDA platforms and use it
when checking if it is an IPC IRQ.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220414184817.362215-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/intel/apl.c
sound/soc/sof/intel/cnl.c
sound/soc/sof/intel/hda.c
sound/soc/sof/intel/icl.c
sound/soc/sof/intel/shim.h
sound/soc/sof/intel/tgl.c

index eb47160..b3e3f24 100644 (file)
@@ -75,5 +75,6 @@ const struct sof_intel_dsp_desc apl_chip_info = {
        .ssp_count = APL_SSP_COUNT,
        .ssp_base_offset = APL_SSP_BASE_OFFSET,
        .quirks = SOF_INTEL_PROCEN_FMT_QUIRK,
+       .check_ipc_irq  = hda_dsp_check_ipc_irq,
 };
 EXPORT_SYMBOL_NS(apl_chip_info, SND_SOC_SOF_INTEL_HDA_COMMON);
index 21168eb..ab1f45b 100644 (file)
@@ -295,6 +295,7 @@ const struct sof_intel_dsp_desc cnl_chip_info = {
        .sdw_shim_base = SDW_SHIM_BASE,
        .sdw_alh_base = SDW_ALH_BASE,
        .check_sdw_irq  = hda_common_check_sdw_irq,
+       .check_ipc_irq  = hda_dsp_check_ipc_irq,
 };
 EXPORT_SYMBOL_NS(cnl_chip_info, SND_SOC_SOF_INTEL_HDA_COMMON);
 
@@ -321,5 +322,6 @@ const struct sof_intel_dsp_desc jsl_chip_info = {
        .sdw_shim_base = SDW_SHIM_BASE,
        .sdw_alh_base = SDW_ALH_BASE,
        .check_sdw_irq  = hda_common_check_sdw_irq,
+       .check_ipc_irq  = hda_dsp_check_ipc_irq,
 };
 EXPORT_SYMBOL_NS(jsl_chip_info, SND_SOC_SOF_INTEL_HDA_COMMON);
index da665d1..af3693d 100644 (file)
@@ -493,6 +493,17 @@ void hda_dsp_dump(struct snd_sof_dev *sdev, u32 flags)
        }
 }
 
+static bool hda_check_ipc_irq(struct snd_sof_dev *sdev)
+{
+       const struct sof_intel_dsp_desc *chip;
+
+       chip = get_chip_info(sdev->pdata);
+       if (chip && chip->check_ipc_irq)
+               return chip->check_ipc_irq(sdev);
+
+       return false;
+}
+
 void hda_ipc_irq_dump(struct snd_sof_dev *sdev)
 {
        struct hdac_bus *bus = sof_to_bus(sdev);
@@ -816,7 +827,7 @@ static irqreturn_t hda_dsp_interrupt_thread(int irq, void *context)
        if (hda_dsp_check_stream_irq(sdev))
                hda_dsp_stream_threaded_handler(irq, sdev);
 
-       if (hda_dsp_check_ipc_irq(sdev))
+       if (hda_check_ipc_irq(sdev))
                sof_ops(sdev)->irq_thread(irq, sdev);
 
        if (hda_dsp_check_sdw_irq(sdev))
index 148d03f..9640142 100644 (file)
@@ -140,5 +140,6 @@ const struct sof_intel_dsp_desc icl_chip_info = {
        .sdw_shim_base = SDW_SHIM_BASE,
        .sdw_alh_base = SDW_ALH_BASE,
        .check_sdw_irq  = hda_common_check_sdw_irq,
+       .check_ipc_irq  = hda_dsp_check_ipc_irq,
 };
 EXPORT_SYMBOL_NS(icl_chip_info, SND_SOC_SOF_INTEL_HDA_COMMON);
index 80c61a7..fd64377 100644 (file)
@@ -171,6 +171,7 @@ struct sof_intel_dsp_desc {
        u32 sdw_alh_base;
        u32 quirks;
        bool (*check_sdw_irq)(struct snd_sof_dev *sdev);
+       bool (*check_ipc_irq)(struct snd_sof_dev *sdev);
 };
 
 extern struct snd_sof_dsp_ops sof_tng_ops;
index 18e01db..d0f805c 100644 (file)
@@ -111,6 +111,7 @@ const struct sof_intel_dsp_desc tgl_chip_info = {
        .sdw_shim_base = SDW_SHIM_BASE,
        .sdw_alh_base = SDW_ALH_BASE,
        .check_sdw_irq  = hda_common_check_sdw_irq,
+       .check_ipc_irq  = hda_dsp_check_ipc_irq,
 };
 EXPORT_SYMBOL_NS(tgl_chip_info, SND_SOC_SOF_INTEL_HDA_COMMON);
 
@@ -130,6 +131,7 @@ const struct sof_intel_dsp_desc tglh_chip_info = {
        .sdw_shim_base = SDW_SHIM_BASE,
        .sdw_alh_base = SDW_ALH_BASE,
        .check_sdw_irq  = hda_common_check_sdw_irq,
+       .check_ipc_irq  = hda_dsp_check_ipc_irq,
 };
 EXPORT_SYMBOL_NS(tglh_chip_info, SND_SOC_SOF_INTEL_HDA_COMMON);
 
@@ -149,6 +151,7 @@ const struct sof_intel_dsp_desc ehl_chip_info = {
        .sdw_shim_base = SDW_SHIM_BASE,
        .sdw_alh_base = SDW_ALH_BASE,
        .check_sdw_irq  = hda_common_check_sdw_irq,
+       .check_ipc_irq  = hda_dsp_check_ipc_irq,
 };
 EXPORT_SYMBOL_NS(ehl_chip_info, SND_SOC_SOF_INTEL_HDA_COMMON);
 
@@ -168,5 +171,6 @@ const struct sof_intel_dsp_desc adls_chip_info = {
        .sdw_shim_base = SDW_SHIM_BASE,
        .sdw_alh_base = SDW_ALH_BASE,
        .check_sdw_irq  = hda_common_check_sdw_irq,
+       .check_ipc_irq  = hda_dsp_check_ipc_irq,
 };
 EXPORT_SYMBOL_NS(adls_chip_info, SND_SOC_SOF_INTEL_HDA_COMMON);