Skip to content

Commit

Permalink
ASoC: SOF: Intel: hda-mlink: expose unlocked interrupt enable routine
Browse files Browse the repository at this point in the history
When the eml_lock is already taken, we need an unlocked version.

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 30, 2024
1 parent c7d1216 commit 0c6ac3b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/sound/hda-mlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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) { }

Expand Down
18 changes: 18 additions & 0 deletions sound/soc/sof/intel/hda-mlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0c6ac3b

Please sign in to comment.