Skip to content

Commit 7af4071

Browse files
committed
ASoC/SoundWire: Simply interrupt enabling for Intel
Merge series from Bard Liao <yung-chuan.liao@linux.intel.com>: It is more logical to couple interrupt enabling/disabling with power-up/down sequences.
2 parents f5a0ea8 + e094177 commit 7af4071

6 files changed

Lines changed: 29 additions & 17 deletions

File tree

drivers/soundwire/intel_ace2x.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ static int intel_link_power_up(struct sdw_intel *sdw)
175175
__func__, ret);
176176
goto out;
177177
}
178+
179+
hdac_bus_eml_enable_interrupt_unlocked(sdw->link_res->hbus, true,
180+
AZX_REG_ML_LEPTR_ID_SDW, true);
178181
}
179182

180183
*shim_mask |= BIT(link_id);
@@ -201,6 +204,10 @@ static int intel_link_power_down(struct sdw_intel *sdw)
201204

202205
*shim_mask &= ~BIT(link_id);
203206

207+
if (!*shim_mask)
208+
hdac_bus_eml_enable_interrupt_unlocked(sdw->link_res->hbus, true,
209+
AZX_REG_ML_LEPTR_ID_SDW, false);
210+
204211
ret = hdac_bus_eml_sdw_power_down_unlocked(sdw->link_res->hbus, link_id);
205212
if (ret < 0) {
206213
dev_err(sdw->cdns.dev, "%s: hdac_bus_eml_sdw_power_down failed: %d\n",

include/sound/hda-mlink.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ int hda_bus_ml_init(struct hdac_bus *bus);
1515
void hda_bus_ml_free(struct hdac_bus *bus);
1616

1717
int hdac_bus_eml_get_count(struct hdac_bus *bus, bool alt, int elid);
18+
void hdac_bus_eml_enable_interrupt_unlocked(struct hdac_bus *bus, bool alt, int elid, bool enable);
1819
void hdac_bus_eml_enable_interrupt(struct hdac_bus *bus, bool alt, int elid, bool enable);
1920
bool hdac_bus_eml_check_interrupt(struct hdac_bus *bus, bool alt, int elid);
2021

@@ -71,6 +72,9 @@ static inline void hda_bus_ml_free(struct hdac_bus *bus) { }
7172
static inline int
7273
hdac_bus_eml_get_count(struct hdac_bus *bus, bool alt, int elid) { return 0; }
7374

75+
static inline void
76+
hdac_bus_eml_enable_interrupt_unlocked(struct hdac_bus *bus, bool alt, int elid, bool enable) { }
77+
7478
static inline void
7579
hdac_bus_eml_enable_interrupt(struct hdac_bus *bus, bool alt, int elid, bool enable) { }
7680

sound/soc/sof/intel/hda-dsp.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,6 @@ static int hda_suspend(struct snd_sof_dev *sdev, bool runtime_suspend)
858858

859859
static int hda_resume(struct snd_sof_dev *sdev, bool runtime_resume)
860860
{
861-
const struct sof_intel_dsp_desc *chip;
862861
int ret;
863862

864863
/* display codec must be powered before link reset */
@@ -891,10 +890,6 @@ static int hda_resume(struct snd_sof_dev *sdev, bool runtime_resume)
891890
hda_dsp_ctrl_ppcap_int_enable(sdev, true);
892891
}
893892

894-
chip = get_chip_info(sdev->pdata);
895-
if (chip && chip->hw_ip_version >= SOF_INTEL_ACE_2_0)
896-
hda_sdw_int_enable(sdev, true);
897-
898893
cleanup:
899894
/* display codec can powered off after controller init */
900895
hda_codec_i915_display_power(sdev, false);

sound/soc/sof/intel/hda-mlink.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,24 @@ int hdac_bus_eml_get_count(struct hdac_bus *bus, bool alt, int elid)
481481
}
482482
EXPORT_SYMBOL_NS(hdac_bus_eml_get_count, SND_SOC_SOF_HDA_MLINK);
483483

484+
void hdac_bus_eml_enable_interrupt_unlocked(struct hdac_bus *bus, bool alt, int elid, bool enable)
485+
{
486+
struct hdac_ext2_link *h2link;
487+
struct hdac_ext_link *hlink;
488+
489+
h2link = find_ext2_link(bus, alt, elid);
490+
if (!h2link)
491+
return;
492+
493+
if (!h2link->intc)
494+
return;
495+
496+
hlink = &h2link->hext_link;
497+
498+
hdaml_link_enable_interrupt(hlink->ml_addr + AZX_REG_ML_LCTL, enable);
499+
}
500+
EXPORT_SYMBOL_NS(hdac_bus_eml_enable_interrupt_unlocked, SND_SOC_SOF_HDA_MLINK);
501+
484502
void hdac_bus_eml_enable_interrupt(struct hdac_bus *bus, bool alt, int elid, bool enable)
485503
{
486504
struct hdac_ext2_link *h2link;

sound/soc/sof/intel/hda.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -866,8 +866,6 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
866866
dev_err(sdev->dev, "could not startup SoundWire links\n");
867867
goto disable_pp_cap;
868868
}
869-
870-
hda_sdw_int_enable(sdev, true);
871869
}
872870

873871
init_waitqueue_head(&hdev->waitq);

sound/soc/sof/intel/lnl.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,8 @@ static bool lnl_dsp_check_sdw_irq(struct snd_sof_dev *sdev)
192192
return hdac_bus_eml_check_interrupt(bus, true, AZX_REG_ML_LEPTR_ID_SDW);
193193
}
194194

195-
static void lnl_enable_sdw_irq(struct snd_sof_dev *sdev, bool enable)
196-
{
197-
struct hdac_bus *bus = sof_to_bus(sdev);
198-
199-
hdac_bus_eml_enable_interrupt(bus, true, AZX_REG_ML_LEPTR_ID_SDW, enable);
200-
}
201-
202195
static int lnl_dsp_disable_interrupts(struct snd_sof_dev *sdev)
203196
{
204-
lnl_enable_sdw_irq(sdev, false);
205197
mtl_disable_ipc_interrupts(sdev);
206198
return mtl_enable_interrupts(sdev, false);
207199
}
@@ -237,7 +229,6 @@ const struct sof_intel_dsp_desc lnl_chip_info = {
237229
.ssp_count = MTL_SSP_COUNT,
238230
.d0i3_offset = MTL_HDA_VS_D0I3C,
239231
.read_sdw_lcount = hda_sdw_check_lcount_ext,
240-
.enable_sdw_irq = lnl_enable_sdw_irq,
241232
.check_sdw_irq = lnl_dsp_check_sdw_irq,
242233
.check_sdw_wakeen_irq = lnl_sdw_check_wakeen_irq,
243234
.sdw_process_wakeen = hda_sdw_process_wakeen_common,
@@ -262,7 +253,6 @@ const struct sof_intel_dsp_desc ptl_chip_info = {
262253
.ssp_count = MTL_SSP_COUNT,
263254
.d0i3_offset = MTL_HDA_VS_D0I3C,
264255
.read_sdw_lcount = hda_sdw_check_lcount_ext,
265-
.enable_sdw_irq = lnl_enable_sdw_irq,
266256
.check_sdw_irq = lnl_dsp_check_sdw_irq,
267257
.check_sdw_wakeen_irq = lnl_sdw_check_wakeen_irq,
268258
.check_ipc_irq = mtl_dsp_check_ipc_irq,

0 commit comments

Comments
 (0)