xref: /linux/sound/soc/intel/avs/lnl.c (revision a9e6060bb2a6cae6d43a98ec0794844ad01273d3)
1*af1c968dSCezary Rojewski // SPDX-License-Identifier: GPL-2.0-only
2*af1c968dSCezary Rojewski /*
3*af1c968dSCezary Rojewski  * Copyright(c) 2021-2025 Intel Corporation
4*af1c968dSCezary Rojewski  *
5*af1c968dSCezary Rojewski  * Authors: Cezary Rojewski <cezary.rojewski@intel.com>
6*af1c968dSCezary Rojewski  *          Amadeusz Slawinski <amadeuszx.slawinski@linux.intel.com>
7*af1c968dSCezary Rojewski  */
8*af1c968dSCezary Rojewski 
9*af1c968dSCezary Rojewski #include <sound/hdaudio_ext.h>
10*af1c968dSCezary Rojewski #include "avs.h"
11*af1c968dSCezary Rojewski #include "registers.h"
12*af1c968dSCezary Rojewski 
avs_lnl_core_stall(struct avs_dev * adev,u32 core_mask,bool stall)13*af1c968dSCezary Rojewski int avs_lnl_core_stall(struct avs_dev *adev, u32 core_mask, bool stall)
14*af1c968dSCezary Rojewski {
15*af1c968dSCezary Rojewski 	struct hdac_bus *bus = &adev->base.core;
16*af1c968dSCezary Rojewski 	struct hdac_ext_link *hlink;
17*af1c968dSCezary Rojewski 	int ret;
18*af1c968dSCezary Rojewski 
19*af1c968dSCezary Rojewski 	ret = avs_mtl_core_stall(adev, core_mask, stall);
20*af1c968dSCezary Rojewski 
21*af1c968dSCezary Rojewski 	/* On unstall, route interrupts from the links to the DSP firmware. */
22*af1c968dSCezary Rojewski 	if (!ret && !stall)
23*af1c968dSCezary Rojewski 		list_for_each_entry(hlink, &bus->hlink_list, list)
24*af1c968dSCezary Rojewski 			snd_hdac_updatel(hlink->ml_addr, AZX_REG_ML_LCTL, AZX_ML_LCTL_OFLEN,
25*af1c968dSCezary Rojewski 					 AZX_ML_LCTL_OFLEN);
26*af1c968dSCezary Rojewski 	return ret;
27*af1c968dSCezary Rojewski }
28