Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: SOF: intel: add snd_sof_dsp_check_sdw_irq ops

SoundWire IRQ status checks are platform-dependent, add new ops structure
to provide abstraction.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210723115451.7245-6-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Bard Liao and committed by
Mark Brown
198fa4bc 2f1315ae

+27 -1
+2
sound/soc/sof/intel/cnl.c
··· 349 349 .ssp_base_offset = CNL_SSP_BASE_OFFSET, 350 350 .sdw_shim_base = SDW_SHIM_BASE, 351 351 .sdw_alh_base = SDW_ALH_BASE, 352 + .check_sdw_irq = hda_common_check_sdw_irq, 352 353 }; 353 354 EXPORT_SYMBOL_NS(cnl_chip_info, SND_SOC_SOF_INTEL_HDA_COMMON); 354 355 ··· 368 367 .ssp_base_offset = CNL_SSP_BASE_OFFSET, 369 368 .sdw_shim_base = SDW_SHIM_BASE, 370 369 .sdw_alh_base = SDW_ALH_BASE, 370 + .check_sdw_irq = hda_common_check_sdw_irq, 371 371 }; 372 372 EXPORT_SYMBOL_NS(jsl_chip_info, SND_SOC_SOF_INTEL_HDA_COMMON);
+12 -1
sound/soc/sof/intel/hda.c
··· 222 222 return 0; 223 223 } 224 224 225 - static bool hda_dsp_check_sdw_irq(struct snd_sof_dev *sdev) 225 + bool hda_common_check_sdw_irq(struct snd_sof_dev *sdev) 226 226 { 227 227 struct sof_intel_hda_dev *hdev; 228 228 bool ret = false; ··· 246 246 247 247 out: 248 248 return ret; 249 + } 250 + 251 + static bool hda_dsp_check_sdw_irq(struct snd_sof_dev *sdev) 252 + { 253 + const struct sof_intel_dsp_desc *chip; 254 + 255 + chip = get_chip_info(sdev->pdata); 256 + if (chip && chip->check_sdw_irq) 257 + return chip->check_sdw_irq(sdev); 258 + 259 + return false; 249 260 } 250 261 251 262 static irqreturn_t hda_dsp_sdw_thread(int irq, void *context)
+7
sound/soc/sof/intel/hda.h
··· 691 691 int hda_sdw_startup(struct snd_sof_dev *sdev); 692 692 void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable); 693 693 void hda_sdw_process_wakeen(struct snd_sof_dev *sdev); 694 + bool hda_common_check_sdw_irq(struct snd_sof_dev *sdev); 694 695 695 696 #else 696 697 ··· 737 736 static inline void hda_sdw_process_wakeen(struct snd_sof_dev *sdev) 738 737 { 739 738 } 739 + 740 + static inline bool hda_common_check_sdw_irq(struct snd_sof_dev *sdev) 741 + { 742 + return false; 743 + } 744 + 740 745 #endif 741 746 742 747 /* common dai driver */
+1
sound/soc/sof/intel/icl.c
··· 144 144 .ssp_base_offset = CNL_SSP_BASE_OFFSET, 145 145 .sdw_shim_base = SDW_SHIM_BASE, 146 146 .sdw_alh_base = SDW_ALH_BASE, 147 + .check_sdw_irq = hda_common_check_sdw_irq, 147 148 }; 148 149 EXPORT_SYMBOL_NS(icl_chip_info, SND_SOC_SOF_INTEL_HDA_COMMON);
+1
sound/soc/sof/intel/shim.h
··· 166 166 int ssp_base_offset; /* base address of the SSPs */ 167 167 u32 sdw_shim_base; 168 168 u32 sdw_alh_base; 169 + bool (*check_sdw_irq)(struct snd_sof_dev *sdev); 169 170 }; 170 171 171 172 extern const struct snd_sof_dsp_ops sof_tng_ops;
+4
sound/soc/sof/intel/tgl.c
··· 139 139 .ssp_base_offset = CNL_SSP_BASE_OFFSET, 140 140 .sdw_shim_base = SDW_SHIM_BASE, 141 141 .sdw_alh_base = SDW_ALH_BASE, 142 + .check_sdw_irq = hda_common_check_sdw_irq, 142 143 }; 143 144 EXPORT_SYMBOL_NS(tgl_chip_info, SND_SOC_SOF_INTEL_HDA_COMMON); 144 145 ··· 158 157 .ssp_base_offset = CNL_SSP_BASE_OFFSET, 159 158 .sdw_shim_base = SDW_SHIM_BASE, 160 159 .sdw_alh_base = SDW_ALH_BASE, 160 + .check_sdw_irq = hda_common_check_sdw_irq, 161 161 }; 162 162 EXPORT_SYMBOL_NS(tglh_chip_info, SND_SOC_SOF_INTEL_HDA_COMMON); 163 163 ··· 177 175 .ssp_base_offset = CNL_SSP_BASE_OFFSET, 178 176 .sdw_shim_base = SDW_SHIM_BASE, 179 177 .sdw_alh_base = SDW_ALH_BASE, 178 + .check_sdw_irq = hda_common_check_sdw_irq, 180 179 }; 181 180 EXPORT_SYMBOL_NS(ehl_chip_info, SND_SOC_SOF_INTEL_HDA_COMMON); 182 181 ··· 196 193 .ssp_base_offset = CNL_SSP_BASE_OFFSET, 197 194 .sdw_shim_base = SDW_SHIM_BASE, 198 195 .sdw_alh_base = SDW_ALH_BASE, 196 + .check_sdw_irq = hda_common_check_sdw_irq, 199 197 }; 200 198 EXPORT_SYMBOL_NS(adls_chip_info, SND_SOC_SOF_INTEL_HDA_COMMON);