Devicetree
 help / color / mirror / Atom feed
* [PATCH v7 0/7] ASoC: qcom: add AudioReach TDM backend support
@ 2026-08-04  7:03 Prasad Kumpatla
  2026-08-04  7:03 ` [PATCH v7 1/7] ASoC: qcom: qdsp6: add topology-driven Audio IF support Prasad Kumpatla
                   ` (7 more replies)
  0 siblings, 8 replies; 25+ messages in thread
From: Prasad Kumpatla @ 2026-08-04  7:03 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai
  Cc: linux-arm-msm, linux-sound, devicetree, linux-kernel,
	Prasad Kumpatla

Add AudioReach support for LPASS Audio IF based TDM backends and wire it
up for the sc8280xp machine driver.

The series first adds topology-driven Audio IF source/sink handling so
the DSP interface parameters can be described by topology while runtime
media format and slot configuration still come from the machine driver.
It then adds TDM DAI operations for q6apm-lpass-dais, exposes the Audio
IF clock IDs through the q6dsp-lpass-ports binding and q6prm clock
tables, and introduces common QCOM helpers for parsing standard
dai-tdm-slot-* properties from backend CPU and codec endpoints.

Finally, sc8280xp uses the common helpers during hw_params to program
CPU and codec TDM slots, derive the backend bit clock from the active
PCM parameters, and request the CPU and codec clocks before the stream is
started.

changes in v7:
	- Rebased the series on the current ASoC for-7.3 branch.
	- Fixed build issue by renaming sc8280xp_snd_data pointer field
	  from snd_soc_common_priv to priv.
	- Link to v6: https://lore.kernel.org/linux-arm-msm/20260803195624.3606352-1-prasad.kumpatla@oss.qualcomm.com/

changes in v6:
	- Addressed comments from srini - Provided QAIF Supported types, Removed 
	  dead code, add kernel doc for ep_frame_duration struct, variable consistent
	  checks.
	- Addressed shasiko comments on patch#6, - Distinguish missing TDM configuration
	  from invalid configuration to avoid masking DT validation errors.
	- Restore accidentally dropped Reviewed-by tags.
	- Link to v5: https://lore.kernel.org/linux-arm-msm/20260801054610.4047089-1-prasad.kumpatla@oss.qualcomm.com/

changes in v5:
	- Addressed comments from Srini - Removed unwanted comments, Define Macros
	  for frame durations, Updated the logic solts, validate the tx/rx masks.
	- Link to v4: https://lore.kernel.org/linux-arm-msm/20260712134110.3306763-1-prasad.kumpatla@oss.qualcomm.com/

Changes in v4:
	- Addressed comments related to bindings from Rob.
	- Link to v3: https://lore.kernel.org/all/20260707190106.2876465-1-prasad.kumpatla@oss.qualcomm.com/

Changes in v3:
	- Reusing of tdm-slot.yaml and update the bindings.
	- Link to v2: https://lore.kernel.org/all/20260630091605.4043426-1-prasad.kumpatla@oss.qualcomm.com/

Changes in v2:
	- Update AR Module token definitions and validation prefixes.
	- Reorder module addresses.
	- Add kernel-doc for `struct param_id_audio_if_intf_cfg`.
	- Remove unused code and stale comments.
	- Clean up comments and naming in q6apm-lpass-ports.h.
	- Add bindings for TDM slots.
	- Link to v1: https://lore.kernel.org/all/20260610154517.134570-1-prasad.kumpatla@oss.qualcomm.com/

Prasad Kumpatla (7):
  ASoC: qcom: qdsp6: add topology-driven Audio IF support
  ASoC: qcom: q6apm-lpass-dais: add TDM DAI operations
  dt-bindings: sound: qcom,q6dsp-lpass-ports: add Audio IF clocks
  ASoC: qcom: q6prm: add Audio IF clock IDs
  dt-bindings: sound: qcom,sm8250: allow TDM slot properties
  ASoC: qcom: common: add DAI-node TDM slot helpers
  ASoC: qcom: sc8280xp: add TDM hw_params support

 .../bindings/sound/qcom,sm8250.yaml           |  26 +++
 .../sound/qcom,q6dsp-lpass-ports.h            |  29 ++++
 include/uapi/sound/snd_ar_tokens.h            |  93 +++++++++++
 sound/soc/qcom/common.c                       | 155 ++++++++++++++++++
 sound/soc/qcom/common.h                       |  14 ++
 sound/soc/qcom/qdsp6/audioreach.c             |  93 +++++++++++
 sound/soc/qcom/qdsp6/audioreach.h             |  90 ++++++++++
 sound/soc/qcom/qdsp6/q6apm-lpass-dais.c       |  60 +++++++
 sound/soc/qcom/qdsp6/q6prm-clocks.c           |  28 ++++
 sound/soc/qcom/qdsp6/q6prm.h                  |  29 ++++
 sound/soc/qcom/qdsp6/topology.c               | 103 ++++++++++++
 sound/soc/qcom/sc8280xp.c                     |  59 +++++++
 12 files changed, 779 insertions(+)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH v7 1/7] ASoC: qcom: qdsp6: add topology-driven Audio IF support
  2026-08-04  7:03 [PATCH v7 0/7] ASoC: qcom: add AudioReach TDM backend support Prasad Kumpatla
@ 2026-08-04  7:03 ` Prasad Kumpatla
  2026-08-04  7:16   ` sashiko-bot
  2026-08-04 17:46   ` Cezary Rojewski
  2026-08-04  7:03 ` [PATCH v7 2/7] ASoC: qcom: q6apm-lpass-dais: add TDM DAI operations Prasad Kumpatla
                   ` (6 subsequent siblings)
  7 siblings, 2 replies; 25+ messages in thread
From: Prasad Kumpatla @ 2026-08-04  7:03 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai
  Cc: linux-arm-msm, linux-sound, devicetree, linux-kernel,
	Prasad Kumpatla

Add topology parsing and media-format programming for Audio IF source and
sink modules.

Add the Audio IF module IDs, the required topology tokens, and a dedicated
topology loader that stores the parsed interface configuration in the
AudioReach module state. Also add the Audio IF media-format path that
sends the interface configuration, hardware endpoint media format, and
frame-duration parameters for Audio IF modules.

This keeps the serial-interface configuration topology-driven while still
allowing the machine driver to provide runtime slot and media format
settings. The same Audio IF path can then be reused for TDM, PCM, and I2S
style backends.

The new UAPI tokens (AR_TKN_U16_MODULE_SYNC_SRC=262 through
AR_TKN_U8_MODULE_INV_EXT_BIT_CLK=276) are added, together with the value
defines used by the sync source, sync mode, data delay, interface mode,
bit clock type, and polarity tokens.

MODULE_ID_AUDIO_IF_SINK (0x0700117C) and MODULE_ID_AUDIO_IF_SOURCE
(0x0700117D) are introduced in this patch.

This Module is validated on Hawi and Shikra platforms.

Signed-off-by: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
---
 include/uapi/sound/snd_ar_tokens.h |  93 ++++++++++++++++++++++++++
 sound/soc/qcom/qdsp6/audioreach.c  |  93 ++++++++++++++++++++++++++
 sound/soc/qcom/qdsp6/audioreach.h  |  90 +++++++++++++++++++++++++
 sound/soc/qcom/qdsp6/topology.c    | 103 +++++++++++++++++++++++++++++
 4 files changed, 379 insertions(+)

diff --git a/include/uapi/sound/snd_ar_tokens.h b/include/uapi/sound/snd_ar_tokens.h
index 6b8102eaa121..1700e3f5cb64 100644
--- a/include/uapi/sound/snd_ar_tokens.h
+++ b/include/uapi/sound/snd_ar_tokens.h
@@ -168,6 +168,60 @@ enum ar_event_types {
  *						LOG_WAIT = 0,
  *						LOG_IMMEDIATELY = 1
  *
+ * %AR_TKN_U16_MODULE_SYNC_SRC:			Frame sync source
+ *						AR_AUDIO_IF_SYNC_SRC_EXTERNAL = 0,
+ *						AR_AUDIO_IF_SYNC_SRC_INTERNAL = 1
+ *
+ * %AR_TKN_U16_MODULE_CTRL_DATA_OUT_ENABLE:	Enable data-out tri-state control
+ *						AR_AUDIO_IF_CTRL_DATA_OE_DISABLE = 0,
+ *						AR_AUDIO_IF_CTRL_DATA_OE_ENABLE = 1
+ *
+ * %AR_TKN_U32_MODULE_SLOT_MASK:			Active TDM slot bitmask
+ *
+ * %AR_TKN_U16_MODULE_NSLOTS_PER_FRAME:		Number of slots per TDM frame
+ *
+ * %AR_TKN_U16_MODULE_SLOT_WIDTH:		Slot width in bits (16 or 32)
+ *
+ * %AR_TKN_U16_MODULE_SYNC_MODE:			Frame sync mode
+ *						AR_AUDIO_IF_FRAME_SYNC_MODE_SHORT = 0,
+ *						AR_AUDIO_IF_FRAME_SYNC_MODE_ONE_SLOT = 1,
+ *						AR_AUDIO_IF_FRAME_SYNC_MODE_LONG = 2
+ *
+ * %AR_TKN_U16_MODULE_CTRL_INVERT_SYNC_PULSE:	Invert frame sync pulse polarity
+ *						AR_AUDIO_IF_SYNC_NORMAL = 0,
+ *						AR_AUDIO_IF_SYNC_INVERTED = 1
+ *
+ * %AR_TKN_U16_MODULE_CTRL_SYNC_DATA_DELAY:	Data delay relative to frame sync
+ *						AR_AUDIO_IF_DATA_DELAY_NONE = 0,
+ *						AR_AUDIO_IF_DATA_DELAY_1_CYCLE = 1,
+ *						AR_AUDIO_IF_DATA_DELAY_2_CYCLE = 2
+ *
+ * %AR_TKN_U16_MODULE_INTF_MODE:			Audio IF interface mode
+ *						AR_AUDIO_IF_INTF_MODE_TDM = 0,
+ *						AR_AUDIO_IF_INTF_MODE_PCM = 1,
+ *						AR_AUDIO_IF_INTF_MODE_I2S = 2
+ *
+ * %AR_TKN_U16_MODULE_QAIF_TYPE:			QAIF hardware port type index
+ *						AR_AUDIO_IF_QAIF = 0,
+ *						AR_AUDIO_IF_QAIF_VA = 1
+ *
+ * %AR_TKN_U32_MODULE_ACTIVE_LANE_MASK:		Active lane bitmask for multi-lane
+ *
+ * %AR_TKN_U32_MODULE_FRAME_SYNC_RATE:		Frame sync rate in Hz
+ *
+ * %AR_TKN_U16_MODULE_BIT_CLK_TYPE:		Bit clock type
+ *						AR_AUDIO_IF_BIT_CLK_INTERNAL = 0,
+ *						AR_AUDIO_IF_BIT_CLK_EXTERNAL = 1,
+ *						AR_AUDIO_IF_BIT_CLK_SKIP = 2
+ *
+ * %AR_TKN_U8_MODULE_INV_INT_BIT_CLK:		Invert internal bit clock
+ *						AR_AUDIO_IF_CLK_NORMAL = 0,
+ *						AR_AUDIO_IF_CLK_INVERTED = 1
+ *
+ * %AR_TKN_U8_MODULE_INV_EXT_BIT_CLK:		Invert external bit clock
+ *						AR_AUDIO_IF_CLK_NORMAL = 0,
+ *						AR_AUDIO_IF_CLK_INVERTED = 1
+ *
  * %AR_TKN_DAI_INDEX:				dai index
  *
  */
@@ -240,6 +294,45 @@ enum ar_event_types {
 #define AR_TKN_U32_MODULE_LOG_TAP_POINT_ID	260
 #define AR_TKN_U32_MODULE_LOG_MODE		261
 
+#define AR_TKN_U16_MODULE_SYNC_SRC		262
+#define AR_TKN_U16_MODULE_CTRL_DATA_OUT_ENABLE	263
+#define AR_TKN_U32_MODULE_SLOT_MASK		264
+#define AR_TKN_U16_MODULE_NSLOTS_PER_FRAME	265
+#define AR_TKN_U16_MODULE_SLOT_WIDTH		266
+#define AR_TKN_U16_MODULE_SYNC_MODE		267
+#define AR_TKN_U16_MODULE_CTRL_INVERT_SYNC_PULSE	268
+#define AR_TKN_U16_MODULE_CTRL_SYNC_DATA_DELAY	269
+#define AR_TKN_U16_MODULE_INTF_MODE		270
+#define AR_TKN_U16_MODULE_QAIF_TYPE		271
+#define AR_TKN_U32_MODULE_ACTIVE_LANE_MASK	272
+#define AR_TKN_U32_MODULE_FRAME_SYNC_RATE	273
+#define AR_TKN_U16_MODULE_BIT_CLK_TYPE		274
+#define AR_TKN_U8_MODULE_INV_INT_BIT_CLK	275
+#define AR_TKN_U8_MODULE_INV_EXT_BIT_CLK	276
+
+#define AR_AUDIO_IF_SYNC_SRC_EXTERNAL		0
+#define AR_AUDIO_IF_SYNC_SRC_INTERNAL		1
+#define AR_AUDIO_IF_CTRL_DATA_OE_DISABLE	0
+#define AR_AUDIO_IF_CTRL_DATA_OE_ENABLE		1
+#define AR_AUDIO_IF_INTF_MODE_TDM		0
+#define AR_AUDIO_IF_INTF_MODE_PCM		1
+#define AR_AUDIO_IF_INTF_MODE_I2S		2
+#define AR_AUDIO_IF_QAIF			0
+#define AR_AUDIO_IF_QAIF_VA			1
+#define AR_AUDIO_IF_FRAME_SYNC_MODE_SHORT	0
+#define AR_AUDIO_IF_FRAME_SYNC_MODE_ONE_SLOT	1
+#define AR_AUDIO_IF_FRAME_SYNC_MODE_LONG	2
+#define AR_AUDIO_IF_SYNC_NORMAL			0
+#define AR_AUDIO_IF_SYNC_INVERTED		1
+#define AR_AUDIO_IF_DATA_DELAY_NONE		0
+#define AR_AUDIO_IF_DATA_DELAY_1_CYCLE		1
+#define AR_AUDIO_IF_DATA_DELAY_2_CYCLE		2
+#define AR_AUDIO_IF_BIT_CLK_INTERNAL		0
+#define AR_AUDIO_IF_BIT_CLK_EXTERNAL		1
+#define AR_AUDIO_IF_BIT_CLK_SKIP		2
+#define AR_AUDIO_IF_CLK_NORMAL			0
+#define AR_AUDIO_IF_CLK_INVERTED		1
+
 #define SND_SOC_AR_TPLG_MODULE_CFG_TYPE 0x01001006
 struct audioreach_module_priv_data {
 	__le32 size;	/* size in bytes of the array, including all elements */
diff --git a/sound/soc/qcom/qdsp6/audioreach.c b/sound/soc/qcom/qdsp6/audioreach.c
index 0cc840aca69d..cce0ad31ff0c 100644
--- a/sound/soc/qcom/qdsp6/audioreach.c
+++ b/sound/soc/qcom/qdsp6/audioreach.c
@@ -152,6 +152,13 @@ struct apm_i2s_module_intf_cfg {
 
 #define APM_I2S_INTF_CFG_PSIZE ALIGN(sizeof(struct apm_i2s_module_intf_cfg), 8)
 
+struct apm_audio_if_module_intf_cfg {
+	struct apm_module_param_data param_data;
+	struct param_id_audio_if_intf_cfg cfg;
+} __packed;
+
+#define APM_AUDIO_IF_INTF_CFG_PSIZE ALIGN(sizeof(struct apm_audio_if_module_intf_cfg), 8)
+
 struct apm_module_hw_ep_mf_cfg {
 	struct apm_module_param_data param_data;
 	struct param_id_hw_ep_mf mf;
@@ -168,6 +175,13 @@ struct apm_module_frame_size_factor_cfg {
 
 #define APM_FS_CFG_PSIZE ALIGN(sizeof(struct apm_module_frame_size_factor_cfg), 8)
 
+struct apm_module_hw_ep_frame_duration_cfg {
+	struct apm_module_param_data param_data;
+	struct param_id_hw_ep_frame_duration frame_duration;
+} __packed;
+
+#define APM_HW_EP_FRAME_DURATION_PSIZE ALIGN(sizeof(struct apm_module_hw_ep_frame_duration_cfg), 8)
+
 struct apm_module_hw_ep_power_mode_cfg {
 	struct apm_module_param_data param_data;
 	struct param_id_hw_ep_power_mode_cfg power_mode;
@@ -1052,6 +1066,81 @@ static int audioreach_i2s_set_media_format(struct q6apm_graph *graph,
 	return q6apm_send_cmd_sync(graph->apm, pkt, 0);
 }
 
+static int audioreach_audio_if_set_media_format(struct q6apm_graph *graph,
+						const struct audioreach_module *module,
+						const struct audioreach_module_config *cfg)
+{
+	struct apm_module_hw_ep_frame_duration_cfg *fd_cfg;
+	struct apm_module_param_data *param_data;
+	struct apm_audio_if_module_intf_cfg *intf_cfg;
+	struct apm_module_hw_ep_mf_cfg *hw_cfg;
+	int ic_sz = APM_AUDIO_IF_INTF_CFG_PSIZE;
+	int ep_sz = APM_HW_EP_CFG_PSIZE;
+	int fd_sz = APM_HW_EP_FRAME_DURATION_PSIZE;
+	int size = ic_sz + ep_sz + fd_sz;
+	u32 slot_mask = cfg->slot_mask ? cfg->slot_mask : module->slot_mask;
+	u16 nslots_per_frame = cfg->nslots_per_frame ?
+				 (u16)cfg->nslots_per_frame : module->nslots_per_frame;
+	u16 slot_width = cfg->slot_width ? (u16)cfg->slot_width : module->slot_width;
+	void *p;
+
+	struct gpr_pkt *pkt __free(kfree) = audioreach_alloc_apm_cmd_pkt(size, APM_CMD_SET_CFG, 0);
+	if (IS_ERR(pkt))
+		return PTR_ERR(pkt);
+
+	p = (void *)pkt + GPR_HDR_SIZE + APM_CMD_HDR_SIZE;
+	intf_cfg = p;
+
+	param_data = &intf_cfg->param_data;
+	param_data->module_instance_id = module->instance_id;
+	param_data->error_code = 0;
+	param_data->param_id = PARAM_ID_AUDIO_IF_INTF_CFG;
+	param_data->param_size = ic_sz - APM_MODULE_PARAM_DATA_SIZE;
+	intf_cfg->cfg.qaif_type = module->qaif_type;
+	intf_cfg->cfg.intf_idx = (u16)module->hw_interface_idx;
+	intf_cfg->cfg.intf_mode = module->intf_mode;
+	intf_cfg->cfg.ctrl_data_out_enable = module->ctrl_data_out_enable;
+	intf_cfg->cfg.active_slot_mask = slot_mask;
+	intf_cfg->cfg.nslots_per_frame = nslots_per_frame;
+	intf_cfg->cfg.slot_width = slot_width;
+	intf_cfg->cfg.active_lane_mask = module->active_lane_mask;
+	intf_cfg->cfg.frame_sync_rate = module->frame_sync_rate;
+	intf_cfg->cfg.frame_sync_src = module->sync_src;
+	intf_cfg->cfg.frame_sync_mode = module->sync_mode;
+	intf_cfg->cfg.invert_frame_sync_pulse = module->ctrl_invert_sync_pulse;
+	intf_cfg->cfg.frame_sync_data_delay = module->ctrl_sync_data_delay;
+	intf_cfg->cfg.bit_clk_type = module->bit_clk_type;
+	intf_cfg->cfg.inv_int_bit_clk = module->inv_int_bit_clk;
+	intf_cfg->cfg.inv_ext_bit_clk = module->inv_ext_bit_clk;
+
+	p += ic_sz;
+	hw_cfg = p;
+	param_data = &hw_cfg->param_data;
+	param_data->module_instance_id = module->instance_id;
+	param_data->error_code = 0;
+	param_data->param_id = PARAM_ID_HW_EP_MF_CFG;
+	param_data->param_size = ep_sz - APM_MODULE_PARAM_DATA_SIZE;
+
+	hw_cfg->mf.sample_rate = cfg->sample_rate;
+	hw_cfg->mf.bit_width = cfg->bit_width;
+	hw_cfg->mf.num_channels = cfg->num_channels;
+	hw_cfg->mf.data_format = module->data_format;
+
+	p += ep_sz;
+	fd_cfg = p;
+	param_data = &fd_cfg->param_data;
+	param_data->module_instance_id = module->instance_id;
+	param_data->error_code = 0;
+	param_data->param_id = PARAM_ID_HW_EP_FRAME_DURATION;
+	param_data->param_size = fd_sz - APM_MODULE_PARAM_DATA_SIZE;
+	fd_cfg->frame_duration.frame_duration_in_us = AUDIO_IF_FRAME_DURATION_US;
+	fd_cfg->frame_duration.allow_frame_duration_normalization = AUDIO_IF_FRAME_DURATION_NORMALIZATION_ENABLE;
+	fd_cfg->frame_duration.min_normalized_frame_dur_us = AUDIO_IF_FRAME_DURATION_MIN_US;
+	fd_cfg->frame_duration.max_normalized_frame_dur_us = AUDIO_IF_FRAME_DURATION_MAX_US;
+
+	return q6apm_send_cmd_sync(graph->apm, pkt, 0);
+}
+
 static int audioreach_logging_set_media_format(struct q6apm_graph *graph,
 					       const struct audioreach_module *module)
 {
@@ -1438,6 +1527,10 @@ int audioreach_set_media_format(struct q6apm_graph *graph,
 		if (!rc)
 			rc = audioreach_module_enable(graph, module, true);
 		break;
+	case MODULE_ID_AUDIO_IF_SOURCE:
+	case MODULE_ID_AUDIO_IF_SINK:
+		rc = audioreach_audio_if_set_media_format(graph, module, cfg);
+		break;
 
 	default:
 		rc = 0;
diff --git a/sound/soc/qcom/qdsp6/audioreach.h b/sound/soc/qcom/qdsp6/audioreach.h
index 62a2fd79bbcb..35541b2d8c99 100644
--- a/sound/soc/qcom/qdsp6/audioreach.h
+++ b/sound/soc/qcom/qdsp6/audioreach.h
@@ -36,6 +36,8 @@ struct q6apm_graph;
 #define MODULE_ID_SPEAKER_PROTECTION	0x070010E2
 #define MODULE_ID_SPEAKER_PROTECTION_VI	0x070010E3
 #define MODULE_ID_OPUS_DEC		0x07001174
+#define MODULE_ID_AUDIO_IF_SINK		0x0700117C
+#define MODULE_ID_AUDIO_IF_SOURCE	0x0700117D
 
 #define APM_CMD_GET_SPF_STATE		0x01001021
 #define APM_CMD_RSP_GET_SPF_STATE	0x02001007
@@ -544,6 +546,74 @@ struct param_id_i2s_intf_cfg {
 #define PORT_ID_I2S_OUPUT		1
 #define I2S_STACK_SIZE			2048
 
+#define PARAM_ID_AUDIO_IF_INTF_CFG	0x08001B11
+
+/*
+ * struct param_id_audio_if_intf_cfg - Audio interface configuration
+ * @qaif_type: Audio interface type (e.g. QAIF, QAIF_VA)
+ * @intf_idx: Interface instance index
+ * @intf_mode: Interface operating mode (TDM/PCM/I2S)
+ * @ctrl_data_out_enable: Enable sharing of data-out signal with other masters
+ * @active_slot_mask: Bitmask indicating active slots
+ * @nslots_per_frame: Number of slots per audio frame
+ * @slot_width: Width of each slot in bits
+ * @active_lane_mask: Bitmask of active data lanes
+ * @frame_sync_rate: Frame sync rate in Hz
+ * @frame_sync_src: Frame sync source selection
+ * @frame_sync_mode: Frame sync mode configuration
+ * @invert_frame_sync_pulse: Invert frame sync polarity when set
+ * @frame_sync_data_delay: Data delay from frame sync in bit clocks
+ * @bit_clk_type: Bit clock type (internal / external)
+ * @inv_int_bit_clk: Invert internal bit clock when set
+ * @inv_ext_bit_clk: Invert external bit clock when set
+ *
+ * This structure defines configuration parameters for the Qualcomm
+ * Audio Interface (QAIF) block. It is used to program interface
+ * characteristics such as slot configuration, clocking and frame
+ * synchronization behaviour.
+ */
+struct param_id_audio_if_intf_cfg {
+	uint16_t qaif_type;
+	uint16_t intf_idx;
+	uint16_t intf_mode;
+	uint16_t ctrl_data_out_enable;
+	uint32_t active_slot_mask;
+	uint16_t nslots_per_frame;
+	uint16_t slot_width;
+	uint32_t active_lane_mask;
+	uint32_t frame_sync_rate;
+	uint16_t frame_sync_src;
+	uint16_t frame_sync_mode;
+	uint16_t invert_frame_sync_pulse;
+	uint16_t frame_sync_data_delay;
+	uint16_t bit_clk_type;
+	uint8_t inv_int_bit_clk;
+	uint8_t inv_ext_bit_clk;
+} __packed;
+
+#define PARAM_ID_HW_EP_FRAME_DURATION	0x08001B2F
+#define AUDIO_IF_FRAME_DURATION_US			1000
+#define AUDIO_IF_FRAME_DURATION_NORMALIZATION_ENABLE	1
+#define AUDIO_IF_FRAME_DURATION_MIN_US			1
+#define AUDIO_IF_FRAME_DURATION_MAX_US			100000
+
+/**
+ * struct param_id_hw_ep_frame_duration - Hardware endpoint frame duration
+ * @frame_duration_in_us: Frame duration in microseconds.
+ * @allow_frame_duration_normalization: Permit SPF to normalize frame duration.
+ * @min_normalized_frame_dur_us: Minimum normalized frame duration in microseconds.
+ * @max_normalized_frame_dur_us: Maximum normalized frame duration in microseconds.
+ *
+ * This structure configures the frame duration for the Audio IF hardware
+ * endpoint and, when enabled, the allowed normalization range.
+ */
+struct param_id_hw_ep_frame_duration {
+	uint32_t frame_duration_in_us;
+	uint32_t allow_frame_duration_normalization;
+	uint32_t min_normalized_frame_dur_us;
+	uint32_t max_normalized_frame_dur_us;
+} __packed;
+
 #define PARAM_ID_DISPLAY_PORT_INTF_CFG		0x08001154
 
 struct param_id_display_port_intf_cfg {
@@ -877,6 +947,23 @@ struct audioreach_module {
 	uint32_t data_format;
 	uint32_t hw_interface_type;
 
+	/* Audio IF module (TDM/PCM/I2S) */
+	u32 slot_mask;
+	u32 active_lane_mask;
+	u32 frame_sync_rate;
+	u16 qaif_type;
+	u16 sync_src;
+	u16 ctrl_data_out_enable;
+	u16 nslots_per_frame;
+	u16 slot_width;
+	u16 intf_mode;
+	u16 sync_mode;
+	u16 ctrl_invert_sync_pulse;
+	u16 ctrl_sync_data_delay;
+	u16 bit_clk_type;
+	u8 inv_int_bit_clk;
+	u8 inv_ext_bit_clk;
+
 	/* PCM module specific */
 	uint32_t interleave_type;
 
@@ -907,6 +994,9 @@ struct audioreach_module_config {
 	u32	channel_allocation;
 	u32	sd_line_mask;
 	int	fmt;
+	u32	slot_mask;
+	u16	nslots_per_frame;
+	u16	slot_width;
 	struct snd_codec codec;
 	u8 channel_map[AR_PCM_MAX_NUM_CHANNEL];
 };
diff --git a/sound/soc/qcom/qdsp6/topology.c b/sound/soc/qcom/qdsp6/topology.c
index 1f69fba6de26..54661bcb006c 100644
--- a/sound/soc/qcom/qdsp6/topology.c
+++ b/sound/soc/qcom/qdsp6/topology.c
@@ -753,6 +753,103 @@ static int audioreach_widget_i2s_module_load(struct audioreach_module *mod,
 	return 0;
 }
 
+static int audioreach_widget_audio_if_module_load(struct audioreach_module *mod,
+						  const struct snd_soc_tplg_vendor_array *mod_array)
+{
+	const struct snd_soc_tplg_vendor_value_elem *mod_elem;
+	int tkn_count = 0;
+	u32 val;
+
+	mod_elem = mod_array->value;
+
+	while (tkn_count < le32_to_cpu(mod_array->num_elems)) {
+		val = le32_to_cpu(mod_elem->value);
+		switch (le32_to_cpu(mod_elem->token)) {
+		case AR_TKN_U32_MODULE_HW_IF_IDX:
+			mod->hw_interface_idx = val;
+			break;
+		case AR_TKN_U32_MODULE_FMT_DATA:
+			mod->data_format = val;
+			break;
+		case AR_TKN_U16_MODULE_SYNC_SRC:
+			if (val > U16_MAX)
+				return -EINVAL;
+			mod->sync_src = (u16)val;
+			break;
+		case AR_TKN_U16_MODULE_CTRL_DATA_OUT_ENABLE:
+			if (val > U16_MAX)
+				return -EINVAL;
+			mod->ctrl_data_out_enable = (u16)val;
+			break;
+		case AR_TKN_U32_MODULE_SLOT_MASK:
+			mod->slot_mask = val;
+			break;
+		case AR_TKN_U16_MODULE_NSLOTS_PER_FRAME:
+			if (val > U16_MAX)
+				return -EINVAL;
+			mod->nslots_per_frame = (u16)val;
+			break;
+		case AR_TKN_U16_MODULE_SLOT_WIDTH:
+			if (val > U16_MAX)
+				return -EINVAL;
+			mod->slot_width = (u16)val;
+			break;
+		case AR_TKN_U16_MODULE_INTF_MODE:
+			if (val > U16_MAX)
+				return -EINVAL;
+			mod->intf_mode = (u16)val;
+			break;
+		case AR_TKN_U16_MODULE_SYNC_MODE:
+			if (val > U16_MAX)
+				return -EINVAL;
+			mod->sync_mode = (u16)val;
+			break;
+		case AR_TKN_U16_MODULE_CTRL_INVERT_SYNC_PULSE:
+			if (val > U16_MAX)
+				return -EINVAL;
+			mod->ctrl_invert_sync_pulse = (u16)val;
+			break;
+		case AR_TKN_U16_MODULE_CTRL_SYNC_DATA_DELAY:
+			if (val > U16_MAX)
+				return -EINVAL;
+			mod->ctrl_sync_data_delay = (u16)val;
+			break;
+		case AR_TKN_U16_MODULE_QAIF_TYPE:
+			if (val > U16_MAX)
+				return -EINVAL;
+			mod->qaif_type = (u16)val;
+			break;
+		case AR_TKN_U32_MODULE_ACTIVE_LANE_MASK:
+			mod->active_lane_mask = val;
+			break;
+		case AR_TKN_U32_MODULE_FRAME_SYNC_RATE:
+			mod->frame_sync_rate = val;
+			break;
+		case AR_TKN_U16_MODULE_BIT_CLK_TYPE:
+			if (val > U16_MAX)
+				return -EINVAL;
+			mod->bit_clk_type = (u16)val;
+			break;
+		case AR_TKN_U8_MODULE_INV_INT_BIT_CLK:
+			if (val > U8_MAX)
+				return -EINVAL;
+			mod->inv_int_bit_clk = (u8)val;
+			break;
+		case AR_TKN_U8_MODULE_INV_EXT_BIT_CLK:
+			if (val > U8_MAX)
+				return -EINVAL;
+			mod->inv_ext_bit_clk = (u8)val;
+			break;
+		default:
+			break;
+		}
+		tkn_count++;
+		mod_elem++;
+	}
+
+	return 0;
+}
+
 static int audioreach_widget_dp_module_load(struct audioreach_module *mod,
 					    const struct snd_soc_tplg_vendor_array *mod_array)
 {
@@ -806,6 +903,12 @@ static int audioreach_widget_load_buffer(struct snd_soc_component *component,
 	case MODULE_ID_I2S_SOURCE:
 		audioreach_widget_i2s_module_load(mod, mod_array);
 		break;
+	case MODULE_ID_AUDIO_IF_SINK:
+	case MODULE_ID_AUDIO_IF_SOURCE:
+		ret = audioreach_widget_audio_if_module_load(mod, mod_array);
+		if (ret)
+			return ret;
+		break;
 	case MODULE_ID_DISPLAY_PORT_SINK:
 		audioreach_widget_dp_module_load(mod, mod_array);
 		break;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v7 2/7] ASoC: qcom: q6apm-lpass-dais: add TDM DAI operations
  2026-08-04  7:03 [PATCH v7 0/7] ASoC: qcom: add AudioReach TDM backend support Prasad Kumpatla
  2026-08-04  7:03 ` [PATCH v7 1/7] ASoC: qcom: qdsp6: add topology-driven Audio IF support Prasad Kumpatla
@ 2026-08-04  7:03 ` Prasad Kumpatla
  2026-08-04  7:03 ` [PATCH v7 3/7] dt-bindings: sound: qcom,q6dsp-lpass-ports: add Audio IF clocks Prasad Kumpatla
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 25+ messages in thread
From: Prasad Kumpatla @ 2026-08-04  7:03 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai
  Cc: linux-arm-msm, linux-sound, devicetree, linux-kernel,
	Prasad Kumpatla, Srinivas Kandagatla

Add TDM DAI operations to q6apm-lpass-dais so AudioReach TDM
backends can be configured through the normal ASoC hw_params and DAI
setup flow.

The TDM set_tdm_slot() callback validates the supported slot width and
slot count, stores the active slot mask in the AudioReach module
configuration, and leaves existing DMA, I2S and HDMI paths unchanged.

Reuse the existing LPASS child-clock handling for TDM nodes as well as
MI2S nodes, since TDM backends also request optional backend clocks
through the machine driver set_sysclk() path.

Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Signed-off-by: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
---
 sound/soc/qcom/qdsp6/q6apm-lpass-dais.c | 60 +++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c b/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c
index e68e8b000e07..e204fd59e512 100644
--- a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c
+++ b/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c
@@ -358,6 +358,53 @@ static int q6i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 	return 0;
 }
 
+static int q6tdm_set_tdm_slot(struct snd_soc_dai *dai,
+			      unsigned int tx_mask,
+			      unsigned int rx_mask,
+			      int slots, int slot_width)
+{
+	struct q6apm_lpass_dai_data *dai_data = dev_get_drvdata(dai->dev);
+	struct audioreach_module_config *cfg = &dai_data->module_config[dai->id];
+	unsigned int cap_mask, slot_mask;
+
+	if (slot_width != 16 && slot_width != 32) {
+		dev_err(dai->dev, "%s: invalid slot_width %d\n", __func__, slot_width);
+		return -EINVAL;
+	}
+
+	switch (slots) {
+	case 2:
+	case 4:
+	case 8:
+	case 16:
+		cap_mask = GENMASK(slots - 1, 0);
+		break;
+	default:
+		dev_err(dai->dev, "%s: invalid slots %d\n", __func__, slots);
+		return -EINVAL;
+	}
+
+	switch (dai->id) {
+	case PRIMARY_TDM_RX_0 ... QUINARY_TDM_TX_7:
+		slot_mask = (dai->id & 0x1) ? tx_mask : rx_mask;
+		if (slot_mask & ~cap_mask) {
+			dev_err(dai->dev, "%s: invalid slot mask 0x%x for %d slots\n",
+				__func__, slot_mask, slots);
+			return -EINVAL;
+		}
+
+		cfg->nslots_per_frame = slots;
+		cfg->slot_width = slot_width;
+		cfg->slot_mask = slot_mask;
+		break;
+	default:
+		dev_err(dai->dev, "%s: invalid dai id 0x%x\n", __func__, dai->id);
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
 static const struct snd_soc_dai_ops q6dma_ops = {
 	.prepare	= q6apm_lpass_dai_prepare,
 	.startup	= q6apm_lpass_dai_startup,
@@ -387,6 +434,17 @@ static const struct snd_soc_dai_ops q6hdmi_ops = {
 	.trigger	= q6apm_lpass_dai_trigger,
 };
 
+static const struct snd_soc_dai_ops q6tdm_ops = {
+	.prepare	= q6apm_lpass_dai_prepare,
+	.startup	= q6apm_lpass_dai_startup,
+	.shutdown	= q6i2s_lpass_dai_shutdown,
+	.set_tdm_slot	= q6tdm_set_tdm_slot,
+	.hw_params	= q6dma_hw_params,
+	.set_fmt	= q6i2s_set_fmt,
+	.set_sysclk	= q6i2s_set_sysclk,
+	.trigger	= q6apm_lpass_dai_trigger,
+};
+
 static const struct snd_soc_component_driver q6apm_lpass_dai_component = {
 	.name = "q6apm-be-dai-component",
 	.of_xlate_dai_name = q6dsp_audio_ports_of_xlate_dai_name,
@@ -415,6 +473,7 @@ static int of_q6apm_parse_dai_data(struct device *dev,
 		case PRIMARY_MI2S_RX ... QUATERNARY_MI2S_TX:
 		case QUINARY_MI2S_RX ... QUINARY_MI2S_TX:
 		case SENARY_MI2S_RX ... SENARY_MI2S_TX:
+		case PRIMARY_TDM_RX_0 ... QUINARY_TDM_TX_7:
 			priv = &data->priv[id];
 			priv->mclk = of_clk_get_by_name(node, "mclk");
 			if (IS_ERR(priv->mclk)) {
@@ -479,6 +538,7 @@ static int q6apm_lpass_dai_dev_probe(struct platform_device *pdev)
 	cfg.q6i2s_ops = &q6i2s_ops;
 	cfg.q6dma_ops = &q6dma_ops;
 	cfg.q6hdmi_ops = &q6hdmi_ops;
+	cfg.q6tdm_ops = &q6tdm_ops;
 	dais = q6dsp_audio_ports_set_config(dev, &cfg, &num_dais);
 
 	return devm_snd_soc_register_component(dev, &q6apm_lpass_dai_component, dais, num_dais);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v7 3/7] dt-bindings: sound: qcom,q6dsp-lpass-ports: add Audio IF clocks
  2026-08-04  7:03 [PATCH v7 0/7] ASoC: qcom: add AudioReach TDM backend support Prasad Kumpatla
  2026-08-04  7:03 ` [PATCH v7 1/7] ASoC: qcom: qdsp6: add topology-driven Audio IF support Prasad Kumpatla
  2026-08-04  7:03 ` [PATCH v7 2/7] ASoC: qcom: q6apm-lpass-dais: add TDM DAI operations Prasad Kumpatla
@ 2026-08-04  7:03 ` Prasad Kumpatla
  2026-08-04  7:08   ` sashiko-bot
  2026-08-04 20:16   ` Rob Herring
  2026-08-04  7:03 ` [PATCH v7 4/7] ASoC: qcom: q6prm: add Audio IF clock IDs Prasad Kumpatla
                   ` (4 subsequent siblings)
  7 siblings, 2 replies; 25+ messages in thread
From: Prasad Kumpatla @ 2026-08-04  7:03 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai
  Cc: linux-arm-msm, linux-sound, devicetree, linux-kernel,
	Prasad Kumpatla, Krzysztof Kozlowski, Srinivas Kandagatla

Add the LPASS Audio IF clock IDs used by newer backend interfaces.

Platforms using Audio IF module backends request the interface bit
clocks through q6prm. Add the Audio IF IBIT and EBIT IDs to the binding
header so these clocks can be referenced from device trees.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Signed-off-by: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
---
 .../sound/qcom,q6dsp-lpass-ports.h            | 29 +++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h b/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h
index ca84952c3884..2e879a3c09ae 100644
--- a/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h
+++ b/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h
@@ -237,6 +237,35 @@
 /* Clock ID for RX CORE MCLK2 2X  MCLK */
 #define LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK	70
 
+#define LAPSS_CLK_ID_QAIF_IF0_IBIT		71
+#define LAPSS_CLK_ID_QAIF_IF0_EBIT		72
+#define LAPSS_CLK_ID_QAIF_IF1_IBIT		73
+#define LAPSS_CLK_ID_QAIF_IF1_EBIT		74
+#define LAPSS_CLK_ID_QAIF_IF2_IBIT		75
+#define LAPSS_CLK_ID_QAIF_IF2_EBIT		76
+#define LAPSS_CLK_ID_QAIF_IF3_IBIT		77
+#define LAPSS_CLK_ID_QAIF_IF3_EBIT		78
+#define LAPSS_CLK_ID_QAIF_IF4_IBIT		79
+#define LAPSS_CLK_ID_QAIF_IF4_EBIT		80
+#define LAPSS_CLK_ID_QAIF_IF5_IBIT		81
+#define LAPSS_CLK_ID_QAIF_IF5_EBIT		82
+#define LAPSS_CLK_ID_QAIF_IF6_IBIT		83
+#define LAPSS_CLK_ID_QAIF_IF6_EBIT		84
+#define LAPSS_CLK_ID_QAIF_IF7_IBIT		85
+#define LAPSS_CLK_ID_QAIF_IF7_EBIT		86
+#define LAPSS_CLK_ID_QAIF_IF8_IBIT		87
+#define LAPSS_CLK_ID_QAIF_IF8_EBIT		88
+#define LAPSS_CLK_ID_QAIF_IF9_IBIT		89
+#define LAPSS_CLK_ID_QAIF_IF9_EBIT		90
+#define LAPSS_CLK_ID_QAIF_IF10_IBIT	91
+#define LAPSS_CLK_ID_QAIF_IF10_EBIT	92
+#define LAPSS_CLK_ID_QAIF_IF11_IBIT	93
+#define LAPSS_CLK_ID_QAIF_IF11_EBIT	94
+#define LAPSS_CLK_ID_QAIF_IF12_IBIT	95
+#define LAPSS_CLK_ID_QAIF_IF12_EBIT	96
+#define LAPSS_CLK_ID_VA_QAIF_IF0_IBIT	97
+#define LAPSS_CLK_ID_VA_QAIF_IF0_EBIT	98
+
 #define LPASS_HW_AVTIMER_VOTE		101
 #define LPASS_HW_MACRO_VOTE		102
 #define LPASS_HW_DCODEC_VOTE		103
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v7 4/7] ASoC: qcom: q6prm: add Audio IF clock IDs
  2026-08-04  7:03 [PATCH v7 0/7] ASoC: qcom: add AudioReach TDM backend support Prasad Kumpatla
                   ` (2 preceding siblings ...)
  2026-08-04  7:03 ` [PATCH v7 3/7] dt-bindings: sound: qcom,q6dsp-lpass-ports: add Audio IF clocks Prasad Kumpatla
@ 2026-08-04  7:03 ` Prasad Kumpatla
  2026-08-04  7:11   ` sashiko-bot
  2026-08-04  7:03 ` [PATCH v7 5/7] dt-bindings: sound: qcom,sm8250: allow TDM slot properties Prasad Kumpatla
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 25+ messages in thread
From: Prasad Kumpatla @ 2026-08-04  7:03 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai
  Cc: linux-arm-msm, linux-sound, devicetree, linux-kernel,
	Prasad Kumpatla, Srinivas Kandagatla

Add the q6prm clock table entries and internal DSP clock IDs for LPASS
Audio IF backend clocks.

The public binding IDs map to q6prm DSP clock IDs starting at 0x500 for
Audio IF0 IBIT/EBIT. Add the internal definitions and register all Audio
IF IBIT and EBIT clocks so machine drivers can request them through the
APM clock controller.

Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Signed-off-by: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
---
 sound/soc/qcom/qdsp6/q6prm-clocks.c | 28 ++++++++++++++++++++++++++++
 sound/soc/qcom/qdsp6/q6prm.h        | 29 +++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+)

diff --git a/sound/soc/qcom/qdsp6/q6prm-clocks.c b/sound/soc/qcom/qdsp6/q6prm-clocks.c
index 02dad9ee9804..f613e2aee75e 100644
--- a/sound/soc/qcom/qdsp6/q6prm-clocks.c
+++ b/sound/soc/qcom/qdsp6/q6prm-clocks.c
@@ -64,6 +64,34 @@ static const struct q6dsp_clk_init q6prm_clks[] = {
 	Q6PRM_CLK(LPASS_CLK_ID_WSA2_CORE_TX_MCLK),
 	Q6PRM_CLK(LPASS_CLK_ID_WSA2_CORE_TX_2X_MCLK),
 	Q6PRM_CLK(LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF0_IBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF0_EBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF1_IBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF1_EBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF2_IBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF2_EBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF3_IBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF3_EBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF4_IBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF4_EBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF5_IBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF5_EBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF6_IBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF6_EBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF7_IBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF7_EBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF8_IBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF8_EBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF9_IBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF9_EBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF10_IBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF10_EBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF11_IBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF11_EBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF12_IBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF12_EBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_VA_QAIF_IF0_IBIT),
+	Q6PRM_CLK(LAPSS_CLK_ID_VA_QAIF_IF0_EBIT),
 	Q6DSP_VOTE_CLK(LPASS_HW_MACRO_VOTE, Q6PRM_HW_CORE_ID_LPASS,
 		       "LPASS_HW_MACRO"),
 	Q6DSP_VOTE_CLK(LPASS_HW_DCODEC_VOTE, Q6PRM_HW_CORE_ID_DCODEC,
diff --git a/sound/soc/qcom/qdsp6/q6prm.h b/sound/soc/qcom/qdsp6/q6prm.h
index 938b1bfce287..cca77cd92bc1 100644
--- a/sound/soc/qcom/qdsp6/q6prm.h
+++ b/sound/soc/qcom/qdsp6/q6prm.h
@@ -97,6 +97,35 @@
 /* Clock ID for RX CORE MCLK2 2X  MCLK */
 #define Q6PRM_LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK 0x318
 
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF0_IBIT		0x500
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF0_EBIT		0x501
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF1_IBIT		0x502
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF1_EBIT		0x503
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF2_IBIT		0x504
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF2_EBIT		0x505
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF3_IBIT		0x506
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF3_EBIT		0x507
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF4_IBIT		0x508
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF4_EBIT		0x509
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF5_IBIT		0x50A
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF5_EBIT		0x50B
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF6_IBIT		0x50C
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF6_EBIT		0x50D
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF7_IBIT		0x50E
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF7_EBIT		0x50F
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF8_IBIT		0x510
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF8_EBIT		0x511
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF9_IBIT		0x512
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF9_EBIT		0x513
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF10_IBIT		0x514
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF10_EBIT		0x515
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF11_IBIT		0x516
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF11_EBIT		0x517
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF12_IBIT		0x518
+#define Q6PRM_LAPSS_CLK_ID_QAIF_IF12_EBIT		0x519
+#define Q6PRM_LAPSS_CLK_ID_VA_QAIF_IF0_IBIT		0x550
+#define Q6PRM_LAPSS_CLK_ID_VA_QAIF_IF0_EBIT		0x551
+
 #define Q6PRM_LPASS_CLK_SRC_INTERNAL	1
 #define Q6PRM_LPASS_CLK_ROOT_DEFAULT	0
 #define Q6PRM_HW_CORE_ID_LPASS		1
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v7 5/7] dt-bindings: sound: qcom,sm8250: allow TDM slot properties
  2026-08-04  7:03 [PATCH v7 0/7] ASoC: qcom: add AudioReach TDM backend support Prasad Kumpatla
                   ` (3 preceding siblings ...)
  2026-08-04  7:03 ` [PATCH v7 4/7] ASoC: qcom: q6prm: add Audio IF clock IDs Prasad Kumpatla
@ 2026-08-04  7:03 ` Prasad Kumpatla
  2026-08-04  7:17   ` sashiko-bot
  2026-08-04  7:03 ` [PATCH v7 6/7] ASoC: qcom: common: add DAI-node TDM slot helpers Prasad Kumpatla
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 25+ messages in thread
From: Prasad Kumpatla @ 2026-08-04  7:03 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai
  Cc: linux-arm-msm, linux-sound, devicetree, linux-kernel,
	Prasad Kumpatla, Krzysztof Kozlowski

Allow standard dai-tdm-slot-* properties in the CPU and codec child
nodes of a DAI link.

The QCOM machine driver parses these child nodes to configure TDM slots
on the active CPU and codec DAIs.  The properties are already defined by
the common tdm-slot binding, but qcom,sm8250.yaml currently rejects them
because the CPU and codec child nodes set additionalProperties: false.

Permit dai-tdm-slot-num, dai-tdm-slot-width and dai-tdm-slot-[rt]x-mask
there so boards using TDM backends can describe the slot layout without
schema warnings.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
---
 .../bindings/sound/qcom,sm8250.yaml           | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml b/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml
index c1bd19299763..3e7216d61a5e 100644
--- a/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml
+++ b/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml
@@ -95,6 +95,19 @@ patternProperties:
           sound-dai:
             maxItems: 1
 
+          dai-tdm-slot-num:
+            $ref: /schemas/types.yaml#/definitions/uint32
+            description: Number of slots in use
+
+          dai-tdm-slot-width:
+            $ref: /schemas/types.yaml#/definitions/uint32
+            description: Width, in bits, of each slot
+
+        patternProperties:
+          '^dai-tdm-slot-[rt]x-mask$':
+            $ref: /schemas/types.yaml#/definitions/uint32-array
+            description: Slot mask for active TDM slots
+
       platform:
         description: Holds subnode which indicates platform dai.
         type: object
@@ -114,6 +127,19 @@ patternProperties:
             minItems: 1
             maxItems: 8
 
+          dai-tdm-slot-num:
+            $ref: /schemas/types.yaml#/definitions/uint32
+            description: Number of slots in use
+
+          dai-tdm-slot-width:
+            $ref: /schemas/types.yaml#/definitions/uint32
+            description: Width, in bits, of each slot
+
+        patternProperties:
+          '^dai-tdm-slot-[rt]x-mask$':
+            $ref: /schemas/types.yaml#/definitions/uint32-array
+            description: Slot mask for active TDM slots
+
     required:
       - link-name
       - cpu
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v7 6/7] ASoC: qcom: common: add DAI-node TDM slot helpers
  2026-08-04  7:03 [PATCH v7 0/7] ASoC: qcom: add AudioReach TDM backend support Prasad Kumpatla
                   ` (4 preceding siblings ...)
  2026-08-04  7:03 ` [PATCH v7 5/7] dt-bindings: sound: qcom,sm8250: allow TDM slot properties Prasad Kumpatla
@ 2026-08-04  7:03 ` Prasad Kumpatla
  2026-08-04  7:18   ` sashiko-bot
  2026-08-04  7:03 ` [PATCH v7 7/7] ASoC: qcom: sc8280xp: add TDM hw_params support Prasad Kumpatla
  2026-08-04 16:32 ` [PATCH v7 0/7] ASoC: qcom: add AudioReach TDM backend support Mark Brown
  7 siblings, 1 reply; 25+ messages in thread
From: Prasad Kumpatla @ 2026-08-04  7:03 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai
  Cc: linux-arm-msm, linux-sound, devicetree, linux-kernel,
	Prasad Kumpatla

Add common helpers to parse standard dai-tdm-slot-* properties from the
CPU and codec child nodes of a backend DAI link and apply the result to
the active DAIs.

QCOM machine drivers already use qcom_snd_parse_of() to build links from
DT, but they lacked a shared helper to translate endpoint TDM properties
into snd_soc_dai_set_tdm_slot() calls. Boards therefore had to carry ad
hoc parsing or rely on non-standard DT properties.

The helpers parse endpoint masks, validate the shared slot count and
slot width, and program CPU and codec DAIs with the resulting slot
configuration. A cfg-based apply helper is provided for callers that
already parsed the DT data and want to avoid a second DT traversal.

Signed-off-by: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
---
 sound/soc/qcom/common.c | 155 ++++++++++++++++++++++++++++++++++++++++
 sound/soc/qcom/common.h |  14 ++++
 2 files changed, 169 insertions(+)

diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c
index f8782e5cfaae..d231024206db 100644
--- a/sound/soc/qcom/common.c
+++ b/sound/soc/qcom/common.c
@@ -23,6 +23,161 @@ static const struct snd_soc_dapm_widget qcom_jack_snd_widgets[] = {
 	SND_SOC_DAPM_SPK("DP7 Jack", NULL),
 };
 
+static struct device_node *qcom_snd_get_link_node(struct snd_soc_pcm_runtime *rtd)
+{
+	struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
+	struct snd_soc_card *card = rtd->card;
+	struct of_phandle_args args;
+	int ret;
+
+	if (!card->dev || !card->dev->of_node)
+		return NULL;
+
+	for_each_available_child_of_node_scoped(card->dev->of_node, np) {
+		struct device_node *cpu_np __free(device_node) =
+			of_get_child_by_name(np, "cpu");
+
+		if (!cpu_np)
+			continue;
+
+		ret = of_parse_phandle_with_args(cpu_np, "sound-dai", "#sound-dai-cells", 0,
+						 &args);
+		if (ret)
+			continue;
+
+		if (args.np == rtd->dai_link->cpus[0].of_node &&
+		    args.args_count == 1 && args.args[0] == cpu_dai->id) {
+			of_node_put(args.np);
+			return of_node_get(np);
+		}
+
+		of_node_put(args.np);
+	}
+
+	return NULL;
+}
+
+static int qcom_snd_parse_tdm_slot(struct device_node *np,
+				   struct qcom_snd_tdm_slot_cfg *cfg)
+{
+	memset(cfg, 0, sizeof(*cfg));
+
+	return snd_soc_of_parse_tdm_slot(np, &cfg->tx_mask, &cfg->rx_mask,
+					 &cfg->slots, &cfg->slot_width);
+}
+
+static int qcom_snd_normalize_tdm_slots(struct qcom_snd_tdm_slot_cfg *cpu_cfg,
+					struct qcom_snd_tdm_slot_cfg *codec_cfg)
+{
+	unsigned int slots;
+	unsigned int slot_width;
+
+	if (cpu_cfg->slots && codec_cfg->slots && cpu_cfg->slots != codec_cfg->slots)
+		return -EINVAL;
+
+	if (cpu_cfg->slot_width && codec_cfg->slot_width &&
+	    cpu_cfg->slot_width != codec_cfg->slot_width)
+		return -EINVAL;
+
+	slots = cpu_cfg->slots ?: codec_cfg->slots;
+	if (!slots)
+		return 0;
+
+	slot_width = cpu_cfg->slot_width ?: codec_cfg->slot_width;
+	if (!slot_width)
+		return -EINVAL;
+
+	cpu_cfg->slots = slots;
+	codec_cfg->slots = slots;
+	cpu_cfg->slot_width = slot_width;
+	codec_cfg->slot_width = slot_width;
+
+	return 0;
+}
+
+static int qcom_snd_parse_dai_tdm_slots(struct snd_soc_pcm_runtime *rtd,
+					struct qcom_snd_tdm_slot_cfg *cpu_cfg,
+					struct qcom_snd_tdm_slot_cfg *codec_cfg)
+{
+	struct device_node *link_np __free(device_node) = qcom_snd_get_link_node(rtd);
+	int ret;
+
+	if (!link_np)
+		return -EINVAL;
+
+	struct device_node *cpu_np __free(device_node) =
+		of_get_child_by_name(link_np, "cpu");
+	struct device_node *codec_np __free(device_node) =
+		of_get_child_by_name(link_np, "codec");
+	if (!cpu_np || !codec_np)
+		return -EINVAL;
+
+	ret = qcom_snd_parse_tdm_slot(cpu_np, cpu_cfg);
+	if (ret)
+		return ret;
+
+	return qcom_snd_parse_tdm_slot(codec_np, codec_cfg);
+}
+
+int qcom_snd_get_dai_tdm_slots(struct snd_soc_pcm_runtime *rtd,
+			       struct qcom_snd_tdm_slot_cfg *cpu_cfg,
+			       struct qcom_snd_tdm_slot_cfg *codec_cfg)
+{
+	int ret;
+
+	ret = qcom_snd_parse_dai_tdm_slots(rtd, cpu_cfg, codec_cfg);
+	if (ret)
+		return ret;
+
+	return qcom_snd_normalize_tdm_slots(cpu_cfg, codec_cfg);
+}
+EXPORT_SYMBOL_GPL(qcom_snd_get_dai_tdm_slots);
+
+int qcom_snd_apply_dai_tdm_slots_cfg(struct snd_soc_pcm_runtime *rtd,
+				     const struct qcom_snd_tdm_slot_cfg *cpu_cfg,
+				     const struct qcom_snd_tdm_slot_cfg *codec_cfg)
+{
+	struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
+	struct snd_soc_dai *codec_dai;
+	int i;
+	int ret;
+
+	if (!cpu_cfg->slots)
+		return 0;
+
+	ret = snd_soc_dai_set_tdm_slot(cpu_dai, cpu_cfg->tx_mask, cpu_cfg->rx_mask,
+				       cpu_cfg->slots, cpu_cfg->slot_width);
+	if (ret)
+		return ret;
+
+	for_each_rtd_codec_dais(rtd, i, codec_dai) {
+		ret = snd_soc_dai_set_tdm_slot(codec_dai,
+					       codec_cfg->tx_mask,
+					       codec_cfg->rx_mask,
+					       codec_cfg->slots,
+					       codec_cfg->slot_width);
+		if (ret)
+			return ret;
+	}
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(qcom_snd_apply_dai_tdm_slots_cfg);
+
+int qcom_snd_apply_dai_tdm_slots(struct snd_soc_pcm_runtime *rtd)
+{
+	struct qcom_snd_tdm_slot_cfg cpu_cfg;
+	struct qcom_snd_tdm_slot_cfg codec_cfg;
+	int ret;
+
+	ret = qcom_snd_get_dai_tdm_slots(rtd, &cpu_cfg, &codec_cfg);
+	if (ret)
+		return ret == -EINVAL ? 0 : ret;
+
+	return qcom_snd_apply_dai_tdm_slots_cfg(rtd, &cpu_cfg, &codec_cfg);
+}
+EXPORT_SYMBOL_GPL(qcom_snd_apply_dai_tdm_slots);
+
 int qcom_snd_parse_of(struct snd_soc_card *card)
 {
 	struct device *dev = card->dev;
diff --git a/sound/soc/qcom/common.h b/sound/soc/qcom/common.h
index 48b114eb46a5..c1deac109f24 100644
--- a/sound/soc/qcom/common.h
+++ b/sound/soc/qcom/common.h
@@ -9,7 +9,21 @@
 
 #define LPASS_MAX_PORT			(LPI_MI2S_TX_6 + 1)
 
+struct qcom_snd_tdm_slot_cfg {
+	unsigned int tx_mask;
+	unsigned int rx_mask;
+	unsigned int slots;
+	unsigned int slot_width;
+};
+
 int qcom_snd_parse_of(struct snd_soc_card *card);
+int qcom_snd_get_dai_tdm_slots(struct snd_soc_pcm_runtime *rtd,
+			       struct qcom_snd_tdm_slot_cfg *cpu_cfg,
+			       struct qcom_snd_tdm_slot_cfg *codec_cfg);
+int qcom_snd_apply_dai_tdm_slots_cfg(struct snd_soc_pcm_runtime *rtd,
+				     const struct qcom_snd_tdm_slot_cfg *cpu_cfg,
+				     const struct qcom_snd_tdm_slot_cfg *codec_cfg);
+int qcom_snd_apply_dai_tdm_slots(struct snd_soc_pcm_runtime *rtd);
 int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd,
 			    struct snd_soc_jack *jack, bool *jack_setup);
 int qcom_snd_dp_jack_setup(struct snd_soc_pcm_runtime *rtd,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH v7 7/7] ASoC: qcom: sc8280xp: add TDM hw_params support
  2026-08-04  7:03 [PATCH v7 0/7] ASoC: qcom: add AudioReach TDM backend support Prasad Kumpatla
                   ` (5 preceding siblings ...)
  2026-08-04  7:03 ` [PATCH v7 6/7] ASoC: qcom: common: add DAI-node TDM slot helpers Prasad Kumpatla
@ 2026-08-04  7:03 ` Prasad Kumpatla
  2026-08-04  7:23   ` sashiko-bot
  2026-08-04 16:32 ` [PATCH v7 0/7] ASoC: qcom: add AudioReach TDM backend support Mark Brown
  7 siblings, 1 reply; 25+ messages in thread
From: Prasad Kumpatla @ 2026-08-04  7:03 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai
  Cc: linux-arm-msm, linux-sound, devicetree, linux-kernel,
	Prasad Kumpatla

Add TDM backend handling to the sc8280xp machine driver.

Use the common QCOM DAI-node TDM helper to parse the standard
DAI TDM slot properties from backend CPU and codec endpoints. Reuse the
parsed configuration when programming DAIs so hw_params does not need a
second DT traversal.

Derive the LPASS backend bit clock from the runtime TDM parameters and
request it through the backend child-clock path using LPAIF_MI2S_BCLK.

Program codec sysclk in hw_params so codec PLL setup happens before the
stream is triggered.

Signed-off-by: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
---
 sound/soc/qcom/sc8280xp.c | 59 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c
index c3ce3e05b260..597c0d887d2f 100644
--- a/sound/soc/qcom/sc8280xp.c
+++ b/sound/soc/qcom/sc8280xp.c
@@ -106,6 +106,63 @@ static inline int sc8280xp_get_bclk_freq(struct snd_pcm_hw_params *params)
 			    snd_pcm_format_width(params_format(params)));
 }
 
+static int sc8280xp_tdm_hw_params(struct snd_pcm_substream *substream,
+				  struct snd_pcm_hw_params *params)
+{
+	struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
+	struct sc8280xp_snd_data *data = snd_soc_card_get_drvdata(rtd->card);
+	struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
+	struct snd_soc_dai *codec_dai;
+	struct qcom_snd_tdm_slot_cfg cpu_cfg;
+	struct qcom_snd_tdm_slot_cfg codec_cfg;
+	unsigned int bclk_freq;
+	int ret;
+	int i;
+
+	ret = qcom_snd_get_dai_tdm_slots(rtd, &cpu_cfg, &codec_cfg);
+	if (ret)
+		return ret == -EINVAL ? 0 : ret;
+
+	if (!cpu_cfg.slots)
+		return 0;
+
+	ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_BP_FP);
+	if (ret)
+		return ret;
+
+	ret = qcom_snd_apply_dai_tdm_slots_cfg(rtd, &cpu_cfg, &codec_cfg);
+	if (ret)
+		return ret;
+
+	bclk_freq = snd_soc_tdm_params_to_bclk(params, cpu_cfg.slot_width, cpu_cfg.slots, 1);
+	if (!bclk_freq)
+		return -EINVAL;
+
+	if (data->priv->mi2s_bclk_enable) {
+		ret = snd_soc_dai_set_sysclk(cpu_dai, LPAIF_MI2S_BCLK, bclk_freq,
+					     SND_SOC_CLOCK_IN);
+		if (ret) {
+			dev_err(rtd->dev, "%s: failed to set cpu sysclk: %d\n",
+				__func__, ret);
+			return ret;
+		}
+	}
+
+	if (data->priv->codec_sysclk_set) {
+		for_each_rtd_codec_dais(rtd, i, codec_dai) {
+			ret = snd_soc_dai_set_sysclk(codec_dai, 0, bclk_freq,
+						     SND_SOC_CLOCK_IN);
+			if (ret) {
+				dev_err(rtd->dev, "%s: failed to set codec sysclk on %s: %d\n",
+					__func__, codec_dai->name, ret);
+				return ret;
+			}
+		}
+	}
+
+	return 0;
+}
+
 static int sc8280xp_snd_init(struct snd_soc_pcm_runtime *rtd)
 {
 	struct sc8280xp_snd_data *data = snd_soc_card_get_drvdata(rtd->card);
@@ -229,6 +286,8 @@ static int sc8280xp_snd_hw_params(struct snd_pcm_substream *substream,
 				return ret;
 		}
 		break;
+	case PRIMARY_TDM_RX_0 ... QUINARY_TDM_TX_7:
+		return sc8280xp_tdm_hw_params(substream, params);
 	default:
 		break;
 	}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [PATCH v7 3/7] dt-bindings: sound: qcom,q6dsp-lpass-ports: add Audio IF clocks
  2026-08-04  7:03 ` [PATCH v7 3/7] dt-bindings: sound: qcom,q6dsp-lpass-ports: add Audio IF clocks Prasad Kumpatla
@ 2026-08-04  7:08   ` sashiko-bot
  2026-08-04 20:16   ` Rob Herring
  1 sibling, 0 replies; 25+ messages in thread
From: sashiko-bot @ 2026-08-04  7:08 UTC (permalink / raw)
  To: Prasad Kumpatla; +Cc: conor+dt, robh, devicetree

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The newly added dt-binding macros use the misspelled prefix `LAPSS_` instead of `LPASS_`.
--

--- Patch [3]: [PATCH v7 3/7] dt-bindings: sound: qcom,q6dsp-lpass-ports: add Audio IF clocks ---
commit fc46e0e8ad5b4e05db5d3982d7d3f2cb53429499
Author: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>

dt-bindings: sound: qcom,q6dsp-lpass-ports: add Audio IF clocks

This commit adds the LPASS Audio IF clock IDs used by newer backend
interfaces. The bit clocks are requested through q6prm by platforms
using Audio IF module backends.

> diff --git a/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h b/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h
> index ca84952c38841..2e879a3c09aef 100644
> --- a/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h
> +++ b/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h
[ ... ]
> @@ -237,6 +237,35 @@
>  /* Clock ID for RX CORE MCLK2 2X  MCLK */
>  #define LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK	70
>  
> +#define LAPSS_CLK_ID_QAIF_IF0_IBIT		71

[Severity: Low]
This isn't a bug, but there appears to be a typo in the prefix. Should these
new macros be named LPASS_CLK_ID_ instead of LAPSS_CLK_ID_ to match the
subsystem name and the existing entries? 

Since device tree bindings form a stable ABI, correcting this spelling before
it is merged might prevent needing backward compatibility aliases later.

> +#define LAPSS_CLK_ID_QAIF_IF0_EBIT		72
> +#define LAPSS_CLK_ID_QAIF_IF1_IBIT		73
[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260804070307.117119-1-prasad.kumpatla@oss.qualcomm.com?part=3

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v7 4/7] ASoC: qcom: q6prm: add Audio IF clock IDs
  2026-08-04  7:03 ` [PATCH v7 4/7] ASoC: qcom: q6prm: add Audio IF clock IDs Prasad Kumpatla
@ 2026-08-04  7:11   ` sashiko-bot
  0 siblings, 0 replies; 25+ messages in thread
From: sashiko-bot @ 2026-08-04  7:11 UTC (permalink / raw)
  To: Prasad Kumpatla; +Cc: devicetree, conor+dt, robh

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The newly added clock macros use the misspelled prefix `LAPSS_` instead of the correct subsystem acronym `LPASS_` (Low Power Audio SubSystem), baking a typo into the Device Tree ABI and userspace sysfs.
--

--- Patch [4]: [PATCH v7 4/7] ASoC: qcom: q6prm: add Audio IF clock IDs ---
commit 92df360c5a0420b85998ac3f1d9ff28298be694a
Author: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>

ASoC: qcom: q6prm: add Audio IF clock IDs

This commit adds the q6prm clock table entries and internal DSP clock IDs
for LPASS Audio IF backend clocks so machine drivers can request them
through the APM clock controller.

> diff --git a/sound/soc/qcom/qdsp6/q6prm-clocks.c b/sound/soc/qcom/qdsp6/q6prm-clocks.c
> index 02dad9ee98049..f613e2aee75e6 100644
> --- a/sound/soc/qcom/qdsp6/q6prm-clocks.c
> +++ b/sound/soc/qcom/qdsp6/q6prm-clocks.c
[ ... ]
> @@ -64,6 +64,34 @@ static const struct q6dsp_clk_init q6prm_clks[] = {
>  	Q6PRM_CLK(LPASS_CLK_ID_WSA2_CORE_TX_MCLK),
>  	Q6PRM_CLK(LPASS_CLK_ID_WSA2_CORE_TX_2X_MCLK),
>  	Q6PRM_CLK(LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK),
> +	Q6PRM_CLK(LAPSS_CLK_ID_QAIF_IF0_IBIT),

[Severity: Low]
This isn't a bug, but the prefix here is spelled LAPSS instead of LPASS
(Low Power Audio SubSystem). Since Q6PRM_CLK stringifies the ID to set
the clock's name, this typo will be exposed to userspace in sysfs and
debugfs, and it will become baked into the Device Tree ABI.

[ ... ]

> diff --git a/sound/soc/qcom/qdsp6/q6prm.h b/sound/soc/qcom/qdsp6/q6prm.h
> index 938b1bfce2873..cca77cd92bc17 100644
> --- a/sound/soc/qcom/qdsp6/q6prm.h
> +++ b/sound/soc/qcom/qdsp6/q6prm.h
[ ... ]
> @@ -97,6 +97,35 @@
>  /* Clock ID for RX CORE MCLK2 2X  MCLK */
>  #define Q6PRM_LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK 0x318
>  
> +#define Q6PRM_LAPSS_CLK_ID_QAIF_IF0_IBIT		0x500

[Severity: Low]
This isn't a bug, but similar to the above, these macros use the misspelled
LAPSS prefix instead of the established LPASS prefix.

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260804070307.117119-1-prasad.kumpatla@oss.qualcomm.com?part=4

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v7 1/7] ASoC: qcom: qdsp6: add topology-driven Audio IF support
  2026-08-04  7:03 ` [PATCH v7 1/7] ASoC: qcom: qdsp6: add topology-driven Audio IF support Prasad Kumpatla
@ 2026-08-04  7:16   ` sashiko-bot
  2026-08-04 17:46   ` Cezary Rojewski
  1 sibling, 0 replies; 25+ messages in thread
From: sashiko-bot @ 2026-08-04  7:16 UTC (permalink / raw)
  To: Prasad Kumpatla; +Cc: robh, devicetree, conor+dt

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Uninitialized stack memory is used to configure the DSP, which can lead to unpredictable behavior or DSP crashes.
--

--- Patch [1]: [PATCH v7 1/7] ASoC: qcom: qdsp6: add topology-driven Audio IF support ---
commit 0fae44a436543afc97061ba27a78d9bfd55821bf
Author: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>

ASoC: qcom: qdsp6: add topology-driven Audio IF support

Add topology parsing and media-format programming for Audio IF source and
sink modules. This introduces new Audio IF module IDs, required topology
tokens, and the media-format path to send interface configuration to the DSP.

> diff --git a/sound/soc/qcom/qdsp6/audioreach.c b/sound/soc/qcom/qdsp6/audioreach.c
> index 0cc840aca69dd..cce0ad31ff0c0 100644
> --- a/sound/soc/qcom/qdsp6/audioreach.c
> +++ b/sound/soc/qcom/qdsp6/audioreach.c
[ ... ]
> @@ -1052,6 +1066,81 @@ static int audioreach_i2s_set_media_format(struct q6apm_graph *graph,
>  	return q6apm_send_cmd_sync(graph->apm, pkt, 0);
>  }
>  
> +static int audioreach_audio_if_set_media_format(struct q6apm_graph *graph,
> +						const struct audioreach_module *module,
> +						const struct audioreach_module_config *cfg)
> +{
> +	struct apm_module_hw_ep_frame_duration_cfg *fd_cfg;
> +	struct apm_module_param_data *param_data;
> +	struct apm_audio_if_module_intf_cfg *intf_cfg;
> +	struct apm_module_hw_ep_mf_cfg *hw_cfg;
> +	int ic_sz = APM_AUDIO_IF_INTF_CFG_PSIZE;
> +	int ep_sz = APM_HW_EP_CFG_PSIZE;
> +	int fd_sz = APM_HW_EP_FRAME_DURATION_PSIZE;
> +	int size = ic_sz + ep_sz + fd_sz;
> +	u32 slot_mask = cfg->slot_mask ? cfg->slot_mask : module->slot_mask;
> +	u16 nslots_per_frame = cfg->nslots_per_frame ?
> +				 (u16)cfg->nslots_per_frame : module->nslots_per_frame;
> +	u16 slot_width = cfg->slot_width ? (u16)cfg->slot_width : module->slot_width;

[Severity: High]
Could this lead to sending garbage configuration parameters to the DSP?

Callers of audioreach_set_media_format() (like q6apm_dai_prepare() in 
q6apm-dai.c) allocate `struct audioreach_module_config cfg` on the stack 
without zero-initializing it.

Since callers generally only populate specific fields for their own needs,
the newly added fields (slot_mask, nslots_per_frame, and slot_width) will
often contain uninitialized stack memory. 

Because the ternary operators here fall back to the module defaults only if 
the config fields are exactly zero, this stack garbage will frequently evaluate
as true. This overrides the valid topology configuration and sends malformed 
interface parameters to the DSP, which might cause audio path failures or
DSP crashes.

> +	void *p;
> +
> +	struct gpr_pkt *pkt __free(kfree) = audioreach_alloc_apm_cmd_pkt(size, APM_CMD_SET_CFG, 0);
> +	if (IS_ERR(pkt))
> +		return PTR_ERR(pkt);
[ ... ]
> diff --git a/sound/soc/qcom/qdsp6/audioreach.h b/sound/soc/qcom/qdsp6/audioreach.h
> index 62a2fd79bbcb9..35541b2d8c998 100644
> --- a/sound/soc/qcom/qdsp6/audioreach.h
> +++ b/sound/soc/qcom/qdsp6/audioreach.h
[ ... ]
> @@ -907,6 +994,9 @@ struct audioreach_module_config {
>  	u32	channel_allocation;
>  	u32	sd_line_mask;
>  	int	fmt;
> +	u32	slot_mask;
> +	u16	nslots_per_frame;
> +	u16	slot_width;
>  	struct snd_codec codec;
>  	u8 channel_map[AR_PCM_MAX_NUM_CHANNEL];
>  };

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260804070307.117119-1-prasad.kumpatla@oss.qualcomm.com?part=1

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v7 5/7] dt-bindings: sound: qcom,sm8250: allow TDM slot properties
  2026-08-04  7:03 ` [PATCH v7 5/7] dt-bindings: sound: qcom,sm8250: allow TDM slot properties Prasad Kumpatla
@ 2026-08-04  7:17   ` sashiko-bot
  0 siblings, 0 replies; 25+ messages in thread
From: sashiko-bot @ 2026-08-04  7:17 UTC (permalink / raw)
  To: Prasad Kumpatla; +Cc: devicetree, conor+dt, robh

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Meaningful code and commit message mismatch: missing TDM slot parsing implementation in QCOM machine drivers.
--

--- Patch [5]: [PATCH v7 5/7] dt-bindings: sound: qcom,sm8250: allow TDM slot properties ---
commit 068c68db6ac28d3b45bf5901b4f8efe15a3d6ae6
Author: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>

dt-bindings: sound: qcom,sm8250: allow TDM slot properties

This commit updates the qcom,sm8250 device tree binding to permit standard
TDM slot properties in the CPU and codec child nodes.

> The QCOM machine driver parses these child nodes to configure TDM slots
> on the active CPU and codec DAIs.

[Severity: Medium]
Is this description accurate regarding the machine driver's current behavior?

Looking at sm8250_platform_probe() in sound/soc/qcom/sm8250.c, it calls
qcom_snd_parse_of() which parses the DAI links, but neither function appears
to utilize snd_soc_of_parse_tdm_slot() or any manual logic to extract the
TDM slot properties.

If the machine driver currently lacks the implementation to parse these
properties, will the TDM slot configuration specified in the device tree be
silently ignored? Is there perhaps a missing patch in this series that adds
the required parsing logic to the machine driver?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260804070307.117119-1-prasad.kumpatla@oss.qualcomm.com?part=5

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v7 6/7] ASoC: qcom: common: add DAI-node TDM slot helpers
  2026-08-04  7:03 ` [PATCH v7 6/7] ASoC: qcom: common: add DAI-node TDM slot helpers Prasad Kumpatla
@ 2026-08-04  7:18   ` sashiko-bot
  0 siblings, 0 replies; 25+ messages in thread
From: sashiko-bot @ 2026-08-04  7:18 UTC (permalink / raw)
  To: Prasad Kumpatla; +Cc: devicetree, robh, conor+dt

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Silent masking of device tree configuration errors due to conflated error codes.
--

--- Patch [6]: [PATCH v7 6/7] ASoC: qcom: common: add DAI-node TDM slot helpers ---
commit 59f92682a3e73f6ecf0f09ddbbaa5f3be6fc0e76
Author: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>

ASoC: qcom: common: add DAI-node TDM slot helpers

Add common helpers to parse standard dai-tdm-slot-* properties from the
CPU and codec child nodes of a backend DAI link and apply the result to
the active DAIs.

> diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c
> index f8782e5cfaaea..d231024206dbf 100644
> --- a/sound/soc/qcom/common.c
> +++ b/sound/soc/qcom/common.c

[ ... ]

> +static int qcom_snd_normalize_tdm_slots(struct qcom_snd_tdm_slot_cfg *cpu_cfg,
> +					struct qcom_snd_tdm_slot_cfg *codec_cfg)
> +{
> +	unsigned int slots;
> +	unsigned int slot_width;
> +
> +	if (cpu_cfg->slots && codec_cfg->slots && cpu_cfg->slots != codec_cfg->slots)
> +		return -EINVAL;
> +
> +	if (cpu_cfg->slot_width && codec_cfg->slot_width &&
> +	    cpu_cfg->slot_width != codec_cfg->slot_width)
> +		return -EINVAL;

[ ... ]

> +int qcom_snd_apply_dai_tdm_slots(struct snd_soc_pcm_runtime *rtd)
> +{
> +	struct qcom_snd_tdm_slot_cfg cpu_cfg;
> +	struct qcom_snd_tdm_slot_cfg codec_cfg;
> +	int ret;
> +
> +	ret = qcom_snd_get_dai_tdm_slots(rtd, &cpu_cfg, &codec_cfg);
> +	if (ret)
> +		return ret == -EINVAL ? 0 : ret;

[Severity: Medium]
Will this silently ignore invalid TDM configurations in the device tree?

When qcom_snd_normalize_tdm_slots() detects an invalid configuration, like
mismatched slot counts or missing slot widths, it returns -EINVAL.

However, it looks like qcom_snd_apply_dai_tdm_slots() conflates this -EINVAL
return with the "not a TDM link" condition (which qcom_snd_parse_dai_tdm_slots()
also reports as -EINVAL when a link node is missing) and unconditionally
converts it to 0 (success).

Does this need to differentiate between a missing link node and an invalid
configuration to avoid masking configuration errors?

> +
> +	return qcom_snd_apply_dai_tdm_slots_cfg(rtd, &cpu_cfg, &codec_cfg);
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260804070307.117119-1-prasad.kumpatla@oss.qualcomm.com?part=6

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v7 7/7] ASoC: qcom: sc8280xp: add TDM hw_params support
  2026-08-04  7:03 ` [PATCH v7 7/7] ASoC: qcom: sc8280xp: add TDM hw_params support Prasad Kumpatla
@ 2026-08-04  7:23   ` sashiko-bot
  0 siblings, 0 replies; 25+ messages in thread
From: sashiko-bot @ 2026-08-04  7:23 UTC (permalink / raw)
  To: Prasad Kumpatla; +Cc: devicetree, robh, conor+dt

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] sc8280xp_tdm_hw_params() fails to ignore -ENOTSUPP errors from snd_soc_dai_set_fmt() and snd_soc_dai_set_sysclk(), causing unconditional stream failures for TDM DAIs.
- [Medium] The return value of snd_soc_tdm_params_to_bclk() is incorrectly stored in an unsigned integer, causing potential negative error codes to bypass the error check and be used as huge clock frequencies.
- [Medium] sc8280xp_tdm_hw_params() sets the audio format for the CPU DAI but fails to configure the format for the codec DAIs.
--

--- Patch [7]: [PATCH v7 7/7] ASoC: qcom: sc8280xp: add TDM hw_params support ---
commit f81d8adf5e4da9f01c411fd511ee11515191c223
Author: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>

ASoC: qcom: sc8280xp: add TDM hw_params support

This commit adds TDM backend handling to the sc8280xp machine driver.
It parses standard DAI TDM slot properties and derives the LPASS backend
bit clock from the runtime parameters.

> diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c
> index c3ce3e05b2608..597c0d887d2f4 100644
> --- a/sound/soc/qcom/sc8280xp.c
> +++ b/sound/soc/qcom/sc8280xp.c
[ ... ]
> @@ -106,6 +106,63 @@ static inline int sc8280xp_get_bclk_freq(struct snd_pcm_hw_params *params)
> +static int sc8280xp_tdm_hw_params(struct snd_pcm_substream *substream,
> +				  struct snd_pcm_hw_params *params)
> +{
[ ... ]
> +	if (!cpu_cfg.slots)
> +		return 0;
> +
> +	ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_BP_FP);
> +	if (ret)
> +		return ret;

[Severity: High]
Does this strictly require the CPU DAI to support set_fmt? Since the QCOM DSP
TDM DAIs (q6tdm_ops) do not implement the set_fmt callback, 
snd_soc_dai_set_fmt() will return -ENOTSUPP. Should this explicitly ignore
-ENOTSUPP, similar to how it is handled in the MI2S path, to avoid failing
stream initialization unconditionally?

[Severity: Medium]
Additionally, this sets the audio format for the CPU DAI, but does it omit
configuring the format for the codec DAIs? Without setting the format for
the codec DAIs (like data->priv->codec_dai_fmt used in the MI2S path), will
the codec remain in its default format and cause a mismatch with the CPU DAI?

> +
> +	ret = qcom_snd_apply_dai_tdm_slots_cfg(rtd, &cpu_cfg, &codec_cfg);
> +	if (ret)
> +		return ret;
> +
> +	bclk_freq = snd_soc_tdm_params_to_bclk(params, cpu_cfg.slot_width, cpu_cfg.slots, 1);
> +	if (!bclk_freq)
> +		return -EINVAL;

[Severity: Medium]
Can snd_soc_tdm_params_to_bclk() return a negative error code like -EINVAL
here? Since bclk_freq is an unsigned int, a negative return value would
underflow into a large positive integer. This would bypass the !bclk_freq
check and potentially pass an invalid massive frequency to the system clock
provider.

[ ... ]
> +	if (data->priv->codec_sysclk_set) {
> +		for_each_rtd_codec_dais(rtd, i, codec_dai) {
> +			ret = snd_soc_dai_set_sysclk(codec_dai, 0, bclk_freq,
> +						     SND_SOC_CLOCK_IN);
> +			if (ret) {
> +				dev_err(rtd->dev, "%s: failed to set codec sysclk on %s: %d\n",
> +					__func__, codec_dai->name, ret);
> +				return ret;
> +			}
> +		}
> +	}

[Severity: High]
Will this codec sysclk setup loop fail stream initialization if any codec in
the link does not support setting sysclk? Similar to the set_fmt call above,
if snd_soc_dai_set_sysclk() returns -ENOTSUPP, should that error be explicitly
ignored rather than treated as a fatal error?

> +
> +	return 0;
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260804070307.117119-1-prasad.kumpatla@oss.qualcomm.com?part=7

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v7 0/7] ASoC: qcom: add AudioReach TDM backend support
  2026-08-04  7:03 [PATCH v7 0/7] ASoC: qcom: add AudioReach TDM backend support Prasad Kumpatla
                   ` (6 preceding siblings ...)
  2026-08-04  7:03 ` [PATCH v7 7/7] ASoC: qcom: sc8280xp: add TDM hw_params support Prasad Kumpatla
@ 2026-08-04 16:32 ` Mark Brown
  7 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2026-08-04 16:32 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	Prasad Kumpatla
  Cc: linux-arm-msm, linux-sound, devicetree, linux-kernel

On Tue, 04 Aug 2026 12:33:00 +0530, Prasad Kumpatla wrote:
> ASoC: qcom: add AudioReach TDM backend support
> 
> Add AudioReach support for LPASS Audio IF based TDM backends and wire it
> up for the sc8280xp machine driver.
> 
> The series first adds topology-driven Audio IF source/sink handling so
> the DSP interface parameters can be described by topology while runtime
> media format and slot configuration still come from the machine driver.
> It then adds TDM DAI operations for q6apm-lpass-dais, exposes the Audio
> IF clock IDs through the q6dsp-lpass-ports binding and q6prm clock
> tables, and introduces common QCOM helpers for parsing standard
> dai-tdm-slot-* properties from backend CPU and codec endpoints.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.3

Thanks!

[1/7] ASoC: qcom: qdsp6: add topology-driven Audio IF support
      https://git.kernel.org/broonie/sound/c/67605cbf8dfe
[2/7] ASoC: qcom: q6apm-lpass-dais: add TDM DAI operations
      https://git.kernel.org/broonie/sound/c/4d0840175893
[3/7] dt-bindings: sound: qcom,q6dsp-lpass-ports: add Audio IF clocks
      https://git.kernel.org/broonie/sound/c/ff09adc61210
[4/7] ASoC: qcom: q6prm: add Audio IF clock IDs
      https://git.kernel.org/broonie/sound/c/d6a4a2e190fa
[5/7] dt-bindings: sound: qcom,sm8250: allow TDM slot properties
      https://git.kernel.org/broonie/sound/c/269b23d5135a
[6/7] ASoC: qcom: common: add DAI-node TDM slot helpers
      https://git.kernel.org/broonie/sound/c/1e844ecbc9cb
[7/7] ASoC: qcom: sc8280xp: add TDM hw_params support
      https://git.kernel.org/broonie/sound/c/a689ee3b2fcd

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] 25+ messages in thread

* Re: [PATCH v7 1/7] ASoC: qcom: qdsp6: add topology-driven Audio IF support
  2026-08-04  7:03 ` [PATCH v7 1/7] ASoC: qcom: qdsp6: add topology-driven Audio IF support Prasad Kumpatla
  2026-08-04  7:16   ` sashiko-bot
@ 2026-08-04 17:46   ` Cezary Rojewski
  2026-08-04 17:50     ` Mark Brown
  1 sibling, 1 reply; 25+ messages in thread
From: Cezary Rojewski @ 2026-08-04 17:46 UTC (permalink / raw)
  To: Prasad Kumpatla
  Cc: linux-arm-msm, linux-sound, devicetree, linux-kernel,
	Srinivas Kandagatla, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai

On 8/4/2026 9:03 AM, Prasad Kumpatla wrote:
> Add topology parsing and media-format programming for Audio IF source and
> sink modules.

...

>   include/uapi/sound/snd_ar_tokens.h |  93 ++++++++++++++++++++++++++

Meh, looks like QCOM took a "bad" example from Intel's past drivers and 
put the header directly within uapi/sound/ without any meaningful 
prefix. Even moving the header into vendor-specific subfolder e.g.: 
uapi/sound/qcom/ would be a good start. For "better" examples take a 
look at headers exposed for newer drivers: sound/intel and sound/sof.

I'd suggest to move away from snd_ar_tokens.h (the name is as ambiguous 
is at can be) and start new header family within 'qcom' subfolder.

At the same time I'll prepare a patch and remove the remaining "bad" 
examples so people don't propagate them.


Kind regards,
Czarek

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v7 1/7] ASoC: qcom: qdsp6: add topology-driven Audio IF support
  2026-08-04 17:46   ` Cezary Rojewski
@ 2026-08-04 17:50     ` Mark Brown
  2026-08-04 17:58       ` Cezary Rojewski
  0 siblings, 1 reply; 25+ messages in thread
From: Mark Brown @ 2026-08-04 17:50 UTC (permalink / raw)
  To: Cezary Rojewski
  Cc: Prasad Kumpatla, linux-arm-msm, linux-sound, devicetree,
	linux-kernel, Srinivas Kandagatla, Liam Girdwood, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai

[-- Attachment #1: Type: text/plain, Size: 247 bytes --]

On Tue, Aug 04, 2026 at 07:46:58PM +0200, Cezary Rojewski wrote:

> I'd suggest to move away from snd_ar_tokens.h (the name is as ambiguous is
> at can be) and start new header family within 'qcom' subfolder.

FWIW the "ar" is I think AudioReach.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v7 1/7] ASoC: qcom: qdsp6: add topology-driven Audio IF support
  2026-08-04 17:50     ` Mark Brown
@ 2026-08-04 17:58       ` Cezary Rojewski
  0 siblings, 0 replies; 25+ messages in thread
From: Cezary Rojewski @ 2026-08-04 17:58 UTC (permalink / raw)
  To: Mark Brown
  Cc: Prasad Kumpatla, linux-arm-msm, linux-sound, devicetree,
	linux-kernel, Srinivas Kandagatla, Liam Girdwood, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai

On 8/4/2026 7:50 PM, Mark Brown wrote:
> On Tue, Aug 04, 2026 at 07:46:58PM +0200, Cezary Rojewski wrote:
> 
>> I'd suggest to move away from snd_ar_tokens.h (the name is as ambiguous is
>> at can be) and start new header family within 'qcom' subfolder.
> 
> FWIW the "ar" is I think AudioReach.

Indeed but uapi is exposed to "users". As a "user" which would like to 
take advantage of their dev kit and collaterals, I'd expect something 
more descriptive than snd_ar_tokens.h.

For the readers, I've not mentioned the full context - let me correct 
that now. The "bad" example is snd_sst_tokens.h which targets Intel's 
skylake-driver (the driver has been removed few years ago). SST stands 
for Smart Sound Technology.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v7 3/7] dt-bindings: sound: qcom,q6dsp-lpass-ports: add Audio IF clocks
  2026-08-04  7:03 ` [PATCH v7 3/7] dt-bindings: sound: qcom,q6dsp-lpass-ports: add Audio IF clocks Prasad Kumpatla
  2026-08-04  7:08   ` sashiko-bot
@ 2026-08-04 20:16   ` Rob Herring
  2026-08-05  4:40     ` Prasad Kumpatla
  1 sibling, 1 reply; 25+ messages in thread
From: Rob Herring @ 2026-08-04 20:16 UTC (permalink / raw)
  To: Prasad Kumpatla
  Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	linux-arm-msm, linux-sound, devicetree, linux-kernel,
	Krzysztof Kozlowski, Srinivas Kandagatla

On Tue, Aug 04, 2026 at 12:33:03PM +0530, Prasad Kumpatla wrote:
> Add the LPASS Audio IF clock IDs used by newer backend interfaces.
> 
> Platforms using Audio IF module backends request the interface bit
> clocks through q6prm. Add the Audio IF IBIT and EBIT IDs to the binding
> header so these clocks can be referenced from device trees.
> 
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
> Signed-off-by: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
> ---
>  .../sound/qcom,q6dsp-lpass-ports.h            | 29 +++++++++++++++++++
>  1 file changed, 29 insertions(+)
> 
> diff --git a/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h b/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h
> index ca84952c3884..2e879a3c09ae 100644
> --- a/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h
> +++ b/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h
> @@ -237,6 +237,35 @@
>  /* Clock ID for RX CORE MCLK2 2X  MCLK */
>  #define LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK	70
>  
> +#define LAPSS_CLK_ID_QAIF_IF0_IBIT		71

LPASS_ as saskiho points out.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v7 3/7] dt-bindings: sound: qcom,q6dsp-lpass-ports: add Audio IF clocks
  2026-08-04 20:16   ` Rob Herring
@ 2026-08-05  4:40     ` Prasad Kumpatla
  2026-08-05  6:10       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 25+ messages in thread
From: Prasad Kumpatla @ 2026-08-05  4:40 UTC (permalink / raw)
  To: Rob Herring
  Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	linux-arm-msm, linux-sound, devicetree, linux-kernel,
	Krzysztof Kozlowski, Srinivas Kandagatla


On 8/5/2026 1:46 AM, Rob Herring wrote:
>>   #define LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK	70
>>   
>> +#define LAPSS_CLK_ID_QAIF_IF0_IBIT		71
> LPASS_ as saskiho points out.

Hi Rob,

Thanks for catching this. The change has already picked, so I'll send a 
follow-up patch to correct the typo.

Thanks,
Prasad


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v7 3/7] dt-bindings: sound: qcom,q6dsp-lpass-ports: add Audio IF clocks
  2026-08-05  4:40     ` Prasad Kumpatla
@ 2026-08-05  6:10       ` Krzysztof Kozlowski
  2026-08-05  6:29         ` Prasad Kumpatla
  0 siblings, 1 reply; 25+ messages in thread
From: Krzysztof Kozlowski @ 2026-08-05  6:10 UTC (permalink / raw)
  To: Prasad Kumpatla, Rob Herring
  Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	linux-arm-msm, linux-sound, devicetree, linux-kernel,
	Krzysztof Kozlowski, Srinivas Kandagatla

On 05/08/2026 06:40, Prasad Kumpatla wrote:
> 
> On 8/5/2026 1:46 AM, Rob Herring wrote:
>>>   #define LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK	70
>>>   
>>> +#define LAPSS_CLK_ID_QAIF_IF0_IBIT		71
>> LPASS_ as saskiho points out.
> 
> Hi Rob,
> 
> Thanks for catching this. The change has already picked, so I'll send a 
> follow-up patch to correct the typo.

You received several sashiko (6!) replies immediately after sending yet
you did not respond to them leading to Mark picking up this patchset.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v7 3/7] dt-bindings: sound: qcom,q6dsp-lpass-ports: add Audio IF clocks
  2026-08-05  6:10       ` Krzysztof Kozlowski
@ 2026-08-05  6:29         ` Prasad Kumpatla
  2026-08-05  6:33           ` Krzysztof Kozlowski
  0 siblings, 1 reply; 25+ messages in thread
From: Prasad Kumpatla @ 2026-08-05  6:29 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring
  Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	linux-arm-msm, linux-sound, devicetree, linux-kernel,
	Krzysztof Kozlowski, Srinivas Kandagatla


On 8/5/2026 11:40 AM, Krzysztof Kozlowski wrote:
> On 05/08/2026 06:40, Prasad Kumpatla wrote:
>> On 8/5/2026 1:46 AM, Rob Herring wrote:
>>>>    #define LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK	70
>>>>    
>>>> +#define LAPSS_CLK_ID_QAIF_IF0_IBIT		71
>>> LPASS_ as saskiho points out.
>> Hi Rob,
>>
>> Thanks for catching this. The change has already picked, so I'll send a
>> follow-up patch to correct the typo.
> You received several sashiko (6!) replies immediately after sending yet
> you did not respond to them leading to Mark picking up this patchset.

Hi Krzysztof,

Thanks for pointing that out, and apologies for not following up on the
reported typo sooner. I had noted the issue, but unfortunately did not send
the fix before the series was applied. I'll send a follow-up patch to correct the typo.

Thanks to you and Sasikho for catching it.

Thanks,
Prasad

>
> Best regards,
> Krzysztof

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v7 3/7] dt-bindings: sound: qcom,q6dsp-lpass-ports: add Audio IF clocks
  2026-08-05  6:29         ` Prasad Kumpatla
@ 2026-08-05  6:33           ` Krzysztof Kozlowski
  2026-08-05  6:36             ` Krzysztof Kozlowski
  2026-08-05  6:50             ` Prasad Kumpatla
  0 siblings, 2 replies; 25+ messages in thread
From: Krzysztof Kozlowski @ 2026-08-05  6:33 UTC (permalink / raw)
  To: Prasad Kumpatla, Rob Herring
  Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	linux-arm-msm, linux-sound, devicetree, linux-kernel,
	Krzysztof Kozlowski, Srinivas Kandagatla

On 05/08/2026 08:29, Prasad Kumpatla wrote:
> 
> On 8/5/2026 11:40 AM, Krzysztof Kozlowski wrote:
>> On 05/08/2026 06:40, Prasad Kumpatla wrote:
>>> On 8/5/2026 1:46 AM, Rob Herring wrote:
>>>>>    #define LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK	70
>>>>>    
>>>>> +#define LAPSS_CLK_ID_QAIF_IF0_IBIT		71
>>>> LPASS_ as saskiho points out.
>>> Hi Rob,
>>>
>>> Thanks for catching this. The change has already picked, so I'll send a
>>> follow-up patch to correct the typo.
>> You received several sashiko (6!) replies immediately after sending yet
>> you did not respond to them leading to Mark picking up this patchset.
> 
> Hi Krzysztof,
> 
> Thanks for pointing that out, and apologies for not following up on the
> reported typo sooner. I had noted the issue, but unfortunately did not send
> the fix before the series was applied. I'll send a follow-up patch to correct the typo.
> 
> Thanks to you and Sasikho for catching it.

It is not about a fix. It is about replying that you have Sashiko
reports with valid statements!

And what about give (!!!) other comments beside that typo? Are you going
to ignore just all of them?

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v7 3/7] dt-bindings: sound: qcom,q6dsp-lpass-ports: add Audio IF clocks
  2026-08-05  6:33           ` Krzysztof Kozlowski
@ 2026-08-05  6:36             ` Krzysztof Kozlowski
  2026-08-05  6:50             ` Prasad Kumpatla
  1 sibling, 0 replies; 25+ messages in thread
From: Krzysztof Kozlowski @ 2026-08-05  6:36 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Prasad Kumpatla, Rob Herring
  Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	linux-arm-msm, linux-sound, devicetree, linux-kernel,
	Srinivas Kandagatla

On 05/08/2026 08:33, Krzysztof Kozlowski wrote:
> On 05/08/2026 08:29, Prasad Kumpatla wrote:
>>
>> On 8/5/2026 11:40 AM, Krzysztof Kozlowski wrote:
>>> On 05/08/2026 06:40, Prasad Kumpatla wrote:
>>>> On 8/5/2026 1:46 AM, Rob Herring wrote:
>>>>>>    #define LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK	70
>>>>>>    
>>>>>> +#define LAPSS_CLK_ID_QAIF_IF0_IBIT		71
>>>>> LPASS_ as saskiho points out.
>>>> Hi Rob,
>>>>
>>>> Thanks for catching this. The change has already picked, so I'll send a
>>>> follow-up patch to correct the typo.
>>> You received several sashiko (6!) replies immediately after sending yet
>>> you did not respond to them leading to Mark picking up this patchset.
>>
>> Hi Krzysztof,
>>
>> Thanks for pointing that out, and apologies for not following up on the
>> reported typo sooner. I had noted the issue, but unfortunately did not send
>> the fix before the series was applied. I'll send a follow-up patch to correct the typo.
>>
>> Thanks to you and Sasikho for catching it.
> 
> It is not about a fix. It is about replying that you have Sashiko
> reports with valid statements!
> 
> And what about give (!!!) other comments beside that typo? Are you going

Typo... what about "five" other comments?

> to ignore just all of them?
> 



Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH v7 3/7] dt-bindings: sound: qcom,q6dsp-lpass-ports: add Audio IF clocks
  2026-08-05  6:33           ` Krzysztof Kozlowski
  2026-08-05  6:36             ` Krzysztof Kozlowski
@ 2026-08-05  6:50             ` Prasad Kumpatla
  1 sibling, 0 replies; 25+ messages in thread
From: Prasad Kumpatla @ 2026-08-05  6:50 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring
  Cc: Srinivas Kandagatla, Liam Girdwood, Mark Brown,
	Krzysztof Kozlowski, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
	linux-arm-msm, linux-sound, devicetree, linux-kernel,
	Krzysztof Kozlowski, Srinivas Kandagatla


On 8/5/2026 12:03 PM, Krzysztof Kozlowski wrote:
> On 05/08/2026 08:29, Prasad Kumpatla wrote:
>> On 8/5/2026 11:40 AM, Krzysztof Kozlowski wrote:
>>> On 05/08/2026 06:40, Prasad Kumpatla wrote:
>>>> On 8/5/2026 1:46 AM, Rob Herring wrote:
>>>>>>     #define LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK	70
>>>>>>     
>>>>>> +#define LAPSS_CLK_ID_QAIF_IF0_IBIT		71
>>>>> LPASS_ as saskiho points out.
>>>> Hi Rob,
>>>>
>>>> Thanks for catching this. The change has already picked, so I'll send a
>>>> follow-up patch to correct the typo.
>>> You received several sashiko (6!) replies immediately after sending yet
>>> you did not respond to them leading to Mark picking up this patchset.
>> Hi Krzysztof,
>>
>> Thanks for pointing that out, and apologies for not following up on the
>> reported typo sooner. I had noted the issue, but unfortunately did not send
>> the fix before the series was applied. I'll send a follow-up patch to correct the typo.
>>
>> Thanks to you and Sasikho for catching it.
> It is not about a fix. It is about replying that you have Sashiko
> reports with valid statements!
>
> And what about give (!!!) other comments beside that typo? Are you going
> to ignore just all of them?

Hi Krzysztof,

No, I do not intend to ignore the other comments, I'll review the remaining comments
as well, reply to each of them, and address any outstanding issues as needed.​‌

I've been working through Sasikho's review comments and addressing them in
subsequent patch revisions where applicable.

Thanks,
Prasad

>
> Best regards,
> Krzysztof

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2026-08-05  6:50 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-04  7:03 [PATCH v7 0/7] ASoC: qcom: add AudioReach TDM backend support Prasad Kumpatla
2026-08-04  7:03 ` [PATCH v7 1/7] ASoC: qcom: qdsp6: add topology-driven Audio IF support Prasad Kumpatla
2026-08-04  7:16   ` sashiko-bot
2026-08-04 17:46   ` Cezary Rojewski
2026-08-04 17:50     ` Mark Brown
2026-08-04 17:58       ` Cezary Rojewski
2026-08-04  7:03 ` [PATCH v7 2/7] ASoC: qcom: q6apm-lpass-dais: add TDM DAI operations Prasad Kumpatla
2026-08-04  7:03 ` [PATCH v7 3/7] dt-bindings: sound: qcom,q6dsp-lpass-ports: add Audio IF clocks Prasad Kumpatla
2026-08-04  7:08   ` sashiko-bot
2026-08-04 20:16   ` Rob Herring
2026-08-05  4:40     ` Prasad Kumpatla
2026-08-05  6:10       ` Krzysztof Kozlowski
2026-08-05  6:29         ` Prasad Kumpatla
2026-08-05  6:33           ` Krzysztof Kozlowski
2026-08-05  6:36             ` Krzysztof Kozlowski
2026-08-05  6:50             ` Prasad Kumpatla
2026-08-04  7:03 ` [PATCH v7 4/7] ASoC: qcom: q6prm: add Audio IF clock IDs Prasad Kumpatla
2026-08-04  7:11   ` sashiko-bot
2026-08-04  7:03 ` [PATCH v7 5/7] dt-bindings: sound: qcom,sm8250: allow TDM slot properties Prasad Kumpatla
2026-08-04  7:17   ` sashiko-bot
2026-08-04  7:03 ` [PATCH v7 6/7] ASoC: qcom: common: add DAI-node TDM slot helpers Prasad Kumpatla
2026-08-04  7:18   ` sashiko-bot
2026-08-04  7:03 ` [PATCH v7 7/7] ASoC: qcom: sc8280xp: add TDM hw_params support Prasad Kumpatla
2026-08-04  7:23   ` sashiko-bot
2026-08-04 16:32 ` [PATCH v7 0/7] ASoC: qcom: add AudioReach TDM backend support Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox