Skip to content

Commit

Permalink
ASoC/SoundWire: Intel: lnl: enable interrupts after first power-up/be…
Browse files Browse the repository at this point in the history
…fore last power-down

The HDaudio mlink support makes it more logical to couple interrupt
enabling/disabling with power-up/down sequences.

Reviewed-by: Liam Girdwood <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
  • Loading branch information
plbossart authored and bardliao committed Sep 10, 2024
1 parent bbea75c commit 2335384
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
7 changes: 7 additions & 0 deletions drivers/soundwire/intel_ace2x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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",
Expand Down
5 changes: 0 additions & 5 deletions sound/soc/sof/intel/hda-dsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,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 */
Expand Down Expand Up @@ -902,10 +901,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);
Expand Down
2 changes: 0 additions & 2 deletions sound/soc/sof/intel/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 0 additions & 10 deletions sound/soc/sof/intel/lnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 2335384

Please sign in to comment.