Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: SOF: ipc4-topology: Use set_get_data() to send LARGE_CONFIG message

Instead of open coding the sending of sink format of the copier with
LARGE_CONFIG_SET message, use the proper function to do so.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com
Link: https://lore.kernel.org/r/20230512105642.23437-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org

authored by

Peter Ujfalusi and committed by
Mark Brown
7a975e9b 1946dda4

+7 -14
+7 -14
sound/soc/sof/ipc4-topology.c
··· 2271 2271 int sink_id) 2272 2272 { 2273 2273 struct sof_ipc4_copier_config_set_sink_format format; 2274 + const struct sof_ipc_ops *iops = sdev->ipc->ops; 2274 2275 struct sof_ipc4_base_module_cfg *src_config; 2275 2276 const struct sof_ipc4_audio_format *pin_fmt; 2276 2277 struct sof_ipc4_fw_module *fw_module; 2277 2278 struct sof_ipc4_msg msg = {{ 0 }}; 2278 - u32 header, extension; 2279 2279 2280 2280 dev_dbg(sdev->dev, "%s set copier sink %d format\n", 2281 2281 src_widget->widget->name, sink_id); ··· 2305 2305 msg.data_size = sizeof(format); 2306 2306 msg.data_ptr = &format; 2307 2307 2308 - header = fw_module->man4_module_entry.id; 2309 - header |= SOF_IPC4_MOD_INSTANCE(src_widget->instance_id); 2310 - header |= SOF_IPC4_MSG_TYPE_SET(SOF_IPC4_MOD_LARGE_CONFIG_SET); 2311 - header |= SOF_IPC4_MSG_DIR(SOF_IPC4_MSG_REQUEST); 2312 - header |= SOF_IPC4_MSG_TARGET(SOF_IPC4_MODULE_MSG); 2308 + msg.primary = fw_module->man4_module_entry.id; 2309 + msg.primary |= SOF_IPC4_MOD_INSTANCE(src_widget->instance_id); 2310 + msg.primary |= SOF_IPC4_MSG_DIR(SOF_IPC4_MSG_REQUEST); 2311 + msg.primary |= SOF_IPC4_MSG_TARGET(SOF_IPC4_MODULE_MSG); 2313 2312 2314 - extension = SOF_IPC4_MOD_EXT_MSG_SIZE(msg.data_size); 2315 - extension |= 2313 + msg.extension = 2316 2314 SOF_IPC4_MOD_EXT_MSG_PARAM_ID(SOF_IPC4_COPIER_MODULE_CFG_PARAM_SET_SINK_FORMAT); 2317 - extension |= SOF_IPC4_MOD_EXT_MSG_LAST_BLOCK(1); 2318 - extension |= SOF_IPC4_MOD_EXT_MSG_FIRST_BLOCK(1); 2319 2315 2320 - msg.primary = header; 2321 - msg.extension = extension; 2322 - 2323 - return sof_ipc_tx_message_no_reply(sdev->ipc, &msg, msg.data_size); 2316 + return iops->set_get_data(sdev, &msg, msg.data_size, true); 2324 2317 } 2325 2318 2326 2319 static int sof_ipc4_route_setup(struct snd_sof_dev *sdev, struct snd_sof_route *sroute)