[PATCH RFC 14/23] ASoC: qcom: lpass: support LPM memory type for I2S LPAIFs
From: Neil Armstrong
Date: Fri Nov 13 2026 - 14:45:49 EST
When using MI2S on non-core LPAIFs, the hardware can only
fetch data from the LPM buffers and not from DDR memory,
like the RXTX/VA/WSA codec handlers, so add a way to describe
which LPM memory is used for each LPAIF in the MI2S
descriptor.
Signed-off-by: Neil Armstrong <neil.armstrong@xxxxxxxxxx>
---
sound/soc/qcom/lpass-cpu.c | 1 +
sound/soc/qcom/lpass.h | 21 +++++++++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index 411eecd9cbb9..9ebbc422c63c 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -1338,6 +1338,7 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
&drvdata->lpaif[lpaif_idx];
drvdata->mi2s_intf[port_id] =
desc->port_desc[lpaif_port].intf;
+ drvdata->mi2s_lpm[port_id] = desc->lpm_type;
}
}
} else {
diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h
index 70d64bf3f073..71f1274dfa89 100644
--- a/sound/soc/qcom/lpass.h
+++ b/sound/soc/qcom/lpass.h
@@ -153,10 +153,17 @@ struct mi2s_port_desc {
unsigned int id; /* DAI ID */
};
+enum lpass_lpm {
+ LPASS_LPM_NONE = 0, /* DMA buffer in DDR */
+ LPASS_RXTX_CDC_LPM, /* CODEC LPM */
+ LPASS_VA_CDC_LPM, /* VA LPM */
+};
+
/* Extended LPAIF MI2S layout */
struct lpaif_mi2s_desc {
const char *reg_name;
const char *irq_name;
+ enum lpass_lpm lpm_type;
struct mi2s_port_desc *port_desc;
unsigned int port_desc_count;
};
@@ -197,6 +204,7 @@ struct lpass_data {
/* LPAIF instance and interface index of each MI2S port */
struct lpass_lpaif *mi2s_lpaif[LPASS_MAX_MI2S_PORTS];
unsigned int mi2s_intf[LPASS_MAX_MI2S_PORTS];
+ enum lpass_lpm mi2s_lpm[LPASS_MAX_MI2S_PORTS];
unsigned long lpaif_port_enable;
/* low-power audio interface (LPAIF) registers */
@@ -261,6 +269,19 @@ struct lpass_data {
struct lpass_sstream_ctl *sstream_ctl;
};
+static inline bool is_lpm_mi2s_port(struct lpass_data *drvdata, unsigned int dai_id)
+{
+ unsigned int port_id;
+
+ switch (dai_id) {
+ case MI2S_PRIMARY ... MI2S_QUINARY:
+ case MI2S_SENARY ... MI2S_SEPTENARY:
+ port_id = mi2s_port_id(dai_id);
+ return drvdata->mi2s_lpm[port_id] != LPASS_LPM_NONE;
+ }
+ return false;
+}
+
/* Vairant data per each SOC */
struct lpass_variant {
u32 irq_reg_base;
--
2.34.1