* [PATCH 1/2] ASoC: SOF: Intel: hda-mlink: expose unlocked interrupt enable routine
2024-10-07 12:12 [PATCH 0/2] ASoC/SoundWire: Simply interrupt enabling for Intel Bard Liao
@ 2024-10-07 12:12 ` Bard Liao
2024-10-07 12:12 ` [PATCH 2/2] ASoC/SoundWire: Intel: lnl: enable interrupts after first power-up/before last power-down Bard Liao
2024-10-12 12:50 ` [PATCH 0/2] ASoC/SoundWire: Simply interrupt enabling for Intel Mark Brown
2 siblings, 0 replies; 5+ messages in thread
From: Bard Liao @ 2024-10-07 12:12 UTC (permalink / raw)
To: broonie, tiwai, vkoul
Cc: vinod.koul, linux-kernel, linux-sound, pierre-louis.bossart,
bard.liao, peter.ujfalusi
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
When the eml_lock is already taken, we need an unlocked version.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
---
include/sound/hda-mlink.h | 4 ++++
sound/soc/sof/intel/hda-mlink.c | 18 ++++++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/include/sound/hda-mlink.h b/include/sound/hda-mlink.h
index 9ced94686ce3..6774f4b9e5fc 100644
--- a/include/sound/hda-mlink.h
+++ b/include/sound/hda-mlink.h
@@ -15,6 +15,7 @@ int hda_bus_ml_init(struct hdac_bus *bus);
void hda_bus_ml_free(struct hdac_bus *bus);
int hdac_bus_eml_get_count(struct hdac_bus *bus, bool alt, int elid);
+void hdac_bus_eml_enable_interrupt_unlocked(struct hdac_bus *bus, bool alt, int elid, bool enable);
void hdac_bus_eml_enable_interrupt(struct hdac_bus *bus, bool alt, int elid, bool enable);
bool hdac_bus_eml_check_interrupt(struct hdac_bus *bus, bool alt, int elid);
@@ -71,6 +72,9 @@ static inline void hda_bus_ml_free(struct hdac_bus *bus) { }
static inline int
hdac_bus_eml_get_count(struct hdac_bus *bus, bool alt, int elid) { return 0; }
+static inline void
+hdac_bus_eml_enable_interrupt_unlocked(struct hdac_bus *bus, bool alt, int elid, bool enable) { }
+
static inline void
hdac_bus_eml_enable_interrupt(struct hdac_bus *bus, bool alt, int elid, bool enable) { }
diff --git a/sound/soc/sof/intel/hda-mlink.c b/sound/soc/sof/intel/hda-mlink.c
index 9a3559c78b62..46f89d6d06f8 100644
--- a/sound/soc/sof/intel/hda-mlink.c
+++ b/sound/soc/sof/intel/hda-mlink.c
@@ -481,6 +481,24 @@ int hdac_bus_eml_get_count(struct hdac_bus *bus, bool alt, int elid)
}
EXPORT_SYMBOL_NS(hdac_bus_eml_get_count, SND_SOC_SOF_HDA_MLINK);
+void hdac_bus_eml_enable_interrupt_unlocked(struct hdac_bus *bus, bool alt, int elid, bool enable)
+{
+ struct hdac_ext2_link *h2link;
+ struct hdac_ext_link *hlink;
+
+ h2link = find_ext2_link(bus, alt, elid);
+ if (!h2link)
+ return;
+
+ if (!h2link->intc)
+ return;
+
+ hlink = &h2link->hext_link;
+
+ hdaml_link_enable_interrupt(hlink->ml_addr + AZX_REG_ML_LCTL, enable);
+}
+EXPORT_SYMBOL_NS(hdac_bus_eml_enable_interrupt_unlocked, SND_SOC_SOF_HDA_MLINK);
+
void hdac_bus_eml_enable_interrupt(struct hdac_bus *bus, bool alt, int elid, bool enable)
{
struct hdac_ext2_link *h2link;
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 2/2] ASoC/SoundWire: Intel: lnl: enable interrupts after first power-up/before last power-down
2024-10-07 12:12 [PATCH 0/2] ASoC/SoundWire: Simply interrupt enabling for Intel Bard Liao
2024-10-07 12:12 ` [PATCH 1/2] ASoC: SOF: Intel: hda-mlink: expose unlocked interrupt enable routine Bard Liao
@ 2024-10-07 12:12 ` Bard Liao
2024-10-11 5:02 ` Vinod Koul
2024-10-12 12:50 ` [PATCH 0/2] ASoC/SoundWire: Simply interrupt enabling for Intel Mark Brown
2 siblings, 1 reply; 5+ messages in thread
From: Bard Liao @ 2024-10-07 12:12 UTC (permalink / raw)
To: broonie, tiwai, vkoul
Cc: vinod.koul, linux-kernel, linux-sound, pierre-louis.bossart,
bard.liao, peter.ujfalusi
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
The HDaudio mlink support makes it more logical to couple interrupt
enabling/disabling with power-up/down sequences.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
---
drivers/soundwire/intel_ace2x.c | 7 +++++++
sound/soc/sof/intel/hda-dsp.c | 5 -----
sound/soc/sof/intel/hda.c | 2 --
sound/soc/sof/intel/lnl.c | 10 ----------
4 files changed, 7 insertions(+), 17 deletions(-)
diff --git a/drivers/soundwire/intel_ace2x.c b/drivers/soundwire/intel_ace2x.c
index fff312c6968d..3084f0ac7159 100644
--- a/drivers/soundwire/intel_ace2x.c
+++ b/drivers/soundwire/intel_ace2x.c
@@ -175,6 +175,9 @@ static int intel_link_power_up(struct sdw_intel *sdw)
__func__, ret);
goto out;
}
+
+ hdac_bus_eml_enable_interrupt_unlocked(sdw->link_res->hbus, true,
+ AZX_REG_ML_LEPTR_ID_SDW, true);
}
*shim_mask |= BIT(link_id);
@@ -201,6 +204,10 @@ static int intel_link_power_down(struct sdw_intel *sdw)
*shim_mask &= ~BIT(link_id);
+ if (!*shim_mask)
+ hdac_bus_eml_enable_interrupt_unlocked(sdw->link_res->hbus, true,
+ AZX_REG_ML_LEPTR_ID_SDW, false);
+
ret = hdac_bus_eml_sdw_power_down_unlocked(sdw->link_res->hbus, link_id);
if (ret < 0) {
dev_err(sdw->cdns.dev, "%s: hdac_bus_eml_sdw_power_down failed: %d\n",
diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c
index 4c88522d4048..6028a80418bb 100644
--- a/sound/soc/sof/intel/hda-dsp.c
+++ b/sound/soc/sof/intel/hda-dsp.c
@@ -858,7 +858,6 @@ static int hda_suspend(struct snd_sof_dev *sdev, bool runtime_suspend)
static int hda_resume(struct snd_sof_dev *sdev, bool runtime_resume)
{
- const struct sof_intel_dsp_desc *chip;
int ret;
/* display codec must be powered before link reset */
@@ -891,10 +890,6 @@ static int hda_resume(struct snd_sof_dev *sdev, bool runtime_resume)
hda_dsp_ctrl_ppcap_int_enable(sdev, true);
}
- chip = get_chip_info(sdev->pdata);
- if (chip && chip->hw_ip_version >= SOF_INTEL_ACE_2_0)
- hda_sdw_int_enable(sdev, true);
-
cleanup:
/* display codec can powered off after controller init */
hda_codec_i915_display_power(sdev, false);
diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index 70fc08c8fc99..e4cb4ffc7270 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -866,8 +866,6 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
dev_err(sdev->dev, "could not startup SoundWire links\n");
goto disable_pp_cap;
}
-
- hda_sdw_int_enable(sdev, true);
}
init_waitqueue_head(&hdev->waitq);
diff --git a/sound/soc/sof/intel/lnl.c b/sound/soc/sof/intel/lnl.c
index 3d5a1f8b17e5..e3c4b4a0d705 100644
--- a/sound/soc/sof/intel/lnl.c
+++ b/sound/soc/sof/intel/lnl.c
@@ -192,16 +192,8 @@ static bool lnl_dsp_check_sdw_irq(struct snd_sof_dev *sdev)
return hdac_bus_eml_check_interrupt(bus, true, AZX_REG_ML_LEPTR_ID_SDW);
}
-static void lnl_enable_sdw_irq(struct snd_sof_dev *sdev, bool enable)
-{
- struct hdac_bus *bus = sof_to_bus(sdev);
-
- hdac_bus_eml_enable_interrupt(bus, true, AZX_REG_ML_LEPTR_ID_SDW, enable);
-}
-
static int lnl_dsp_disable_interrupts(struct snd_sof_dev *sdev)
{
- lnl_enable_sdw_irq(sdev, false);
mtl_disable_ipc_interrupts(sdev);
return mtl_enable_interrupts(sdev, false);
}
@@ -237,7 +229,6 @@ const struct sof_intel_dsp_desc lnl_chip_info = {
.ssp_count = MTL_SSP_COUNT,
.d0i3_offset = MTL_HDA_VS_D0I3C,
.read_sdw_lcount = hda_sdw_check_lcount_ext,
- .enable_sdw_irq = lnl_enable_sdw_irq,
.check_sdw_irq = lnl_dsp_check_sdw_irq,
.check_sdw_wakeen_irq = lnl_sdw_check_wakeen_irq,
.sdw_process_wakeen = hda_sdw_process_wakeen_common,
@@ -262,7 +253,6 @@ const struct sof_intel_dsp_desc ptl_chip_info = {
.ssp_count = MTL_SSP_COUNT,
.d0i3_offset = MTL_HDA_VS_D0I3C,
.read_sdw_lcount = hda_sdw_check_lcount_ext,
- .enable_sdw_irq = lnl_enable_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,
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 0/2] ASoC/SoundWire: Simply interrupt enabling for Intel
2024-10-07 12:12 [PATCH 0/2] ASoC/SoundWire: Simply interrupt enabling for Intel Bard Liao
2024-10-07 12:12 ` [PATCH 1/2] ASoC: SOF: Intel: hda-mlink: expose unlocked interrupt enable routine Bard Liao
2024-10-07 12:12 ` [PATCH 2/2] ASoC/SoundWire: Intel: lnl: enable interrupts after first power-up/before last power-down Bard Liao
@ 2024-10-12 12:50 ` Mark Brown
2 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2024-10-12 12:50 UTC (permalink / raw)
To: tiwai, vkoul, Bard Liao
Cc: vinod.koul, linux-kernel, linux-sound, pierre-louis.bossart,
bard.liao, peter.ujfalusi
On Mon, 07 Oct 2024 20:12:39 +0800, Bard Liao wrote:
> It is more logical to couple interrupt enabling/disabling with
> power-up/down sequences.
>
> The change is mainly on ASoC tree. Can we go via ASoC tree with Vinod's
> Acked-by tag?
>
> Pierre-Louis Bossart (2):
> ASoC: SOF: Intel: hda-mlink: expose unlocked interrupt enable routine
> ASoC/SoundWire: Intel: lnl: enable interrupts after first
> power-up/before last power-down
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/2] ASoC: SOF: Intel: hda-mlink: expose unlocked interrupt enable routine
commit: eac79786c7397925149a1bfc4bb704777cd42a99
[2/2] ASoC/SoundWire: Intel: lnl: enable interrupts after first power-up/before last power-down
commit: e0941775e6bdcf45e6e20b7ff3bb87dbb7d92fbb
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 5+ messages in thread