Commit ab918244 authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown

ASoC: SOF: Intel: lnl: add helper to detect SoundWire wakes

The global STATESTS register will provide information on all
links. Rather than iterate on all possible links, the helpers only
filters the range of possible bits for a quick lookup. The
process_wakeen() helper will walk through all the links and deal with
wakes.
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: default avatarRander Wang <rander.wang@intel.com>
Link: https://msgid.link/r/20240404190357.138073-3-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent bd5863f9
...@@ -189,6 +189,23 @@ static int lnl_dsp_disable_interrupts(struct snd_sof_dev *sdev) ...@@ -189,6 +189,23 @@ static int lnl_dsp_disable_interrupts(struct snd_sof_dev *sdev)
return mtl_enable_interrupts(sdev, false); return mtl_enable_interrupts(sdev, false);
} }
static bool lnl_sdw_check_wakeen_irq(struct snd_sof_dev *sdev)
{
struct hdac_bus *bus = sof_to_bus(sdev);
u16 wake_sts;
/*
* we need to use the global HDaudio WAKEEN/STS to be able to
* detect wakes in low-power modes. The link-specific information
* is handled in the process_wakeen() helper, this helper only
* detects a SoundWire wake without identifying the link.
*/
wake_sts = snd_hdac_chip_readw(bus, STATESTS);
/* filter out the range of SDIs that can be set for SoundWire */
return wake_sts & GENMASK(SDW_MAX_DEVICES, SDW_INTEL_DEV_NUM_IDA_MIN);
}
const struct sof_intel_dsp_desc lnl_chip_info = { const struct sof_intel_dsp_desc lnl_chip_info = {
.cores_num = 5, .cores_num = 5,
.init_core_mask = BIT(0), .init_core_mask = BIT(0),
...@@ -205,6 +222,7 @@ const struct sof_intel_dsp_desc lnl_chip_info = { ...@@ -205,6 +222,7 @@ const struct sof_intel_dsp_desc lnl_chip_info = {
.read_sdw_lcount = hda_sdw_check_lcount_ext, .read_sdw_lcount = hda_sdw_check_lcount_ext,
.enable_sdw_irq = lnl_enable_sdw_irq, .enable_sdw_irq = lnl_enable_sdw_irq,
.check_sdw_irq = lnl_dsp_check_sdw_irq, .check_sdw_irq = lnl_dsp_check_sdw_irq,
.check_sdw_wakeen_irq = lnl_sdw_check_wakeen_irq,
.check_ipc_irq = mtl_dsp_check_ipc_irq, .check_ipc_irq = mtl_dsp_check_ipc_irq,
.cl_init = mtl_dsp_cl_init, .cl_init = mtl_dsp_cl_init,
.power_down_dsp = mtl_power_down_dsp, .power_down_dsp = mtl_power_down_dsp,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment