Skip to contentSkip to conversation

ASoC: Intel: avs: Renames and debug prints

PATCH In review Cezary Rojewski 3 participants 14 messages Nov 13 – Nov 20

Subsystems (3)
lore
Share & tools
lore

Cezary Rojewski

author maintainer
#0 lore raw

cover ASoC: Intel: avs: Renames and debug prints

The patches consists almost solely of renames and addition/enrichment of debug prints. Plus few removals to redunce duplication among these debug prints.

The 2/11 patch is the exception - as its follow up updates the messages around, the mentioned patch is here to fix the problem of skipped results coming from avs_path_pause() in trigger() operations. With that done, the dev-prints are touched.

Apart from 2/11, from functional perspective everything is left at status quo.
Sidenote for 6/11: touches on catpt- and avs- boards both. Decided to merge these two changes rather than generate a separate patch just for adding 2 missing commas. Feel free to comment if you believe my decision is incorrect.

Note: this is a orthogonal subject to my soundwire-related series [1]. Paused while I'm testing soundwire-aggregation scenarios. Neither is blocked by the other.

[1]: https://lore.kernel.org/linux-sound/[email protected]/

Cezary Rojewski (11):
ASoC: Intel: avs: Do not skip error reporting when an IPC timeouts
ASoC: Intel: avs: Do not skip errors from avs_path_pause()
ASoC: Intel: avs: Have one location for dumping path-errors
ASoC: Intel: avs: Small registers cleanup
ASoC: Intel: avs: Enrich missing-format and token-parsing messages
ASoC: Intel: avs: Unify code style for platform_device_id arrays
ASoC: Intel: avs: Streamline topology parser names
ASoC: Intel: avs: Streamline wording used for board configs
ASoC: Intel: avs: Streamline naming of hw_params variables
ASoC: Intel: avs: Streamline spacing used in the avs_ids table
ASoC: Intel: avs: Remove soc-acpi-intel-match include

 sound/soc/intel/avs/boards/Kconfig   |   6 +-
 sound/soc/intel/avs/boards/probe.c   |   4 +-
 sound/soc/intel/avs/boards/rt274.c   |   4 +-
 sound/soc/intel/avs/boards/rt286.c   |   4 +-
 sound/soc/intel/avs/boards/rt298.c   |   4 +-
 sound/soc/intel/avs/boards/rt5514.c  |   4 +-
 sound/soc/intel/avs/boards/rt5640.c  |   4 +-
 sound/soc/intel/avs/boards/rt5663.c  |   4 +-
 sound/soc/intel/avs/boards/rt5682.c  |   4 +-
 sound/soc/intel/avs/boards/ssm4567.c |   4 +-
 sound/soc/intel/avs/core.c           |  16 ++--
 sound/soc/intel/avs/ipc.c            |   8 +-
 sound/soc/intel/avs/messages.h       |   4 +-
 sound/soc/intel/avs/path.c           |  35 +++++----
 sound/soc/intel/avs/pcm.c            | 109 ++++++++++-----------------
 sound/soc/intel/avs/registers.h      |   2 +-
 sound/soc/intel/avs/topology.c       |  27 ++++---
 sound/soc/intel/boards/bdw-rt5677.c  |   2 +-
 sound/soc/intel/boards/bdw_rt286.c   |   2 +-
 19 files changed, 105 insertions(+), 142 deletions(-)
Signature · 1 line
2.34.1
author maintainer
#1 lore raw

PATCH 1/11 ASoC: Intel: avs: Do not skip error reporting when an IPC timeouts

If an IPC timeouts nothing is printed as avs_dsp_do_send_msg() exits early. This makes it harder to assess and debug IPC failures. Have a variable to separate "should copy reply?" subject from debug printing one.

---
 sound/soc/intel/avs/ipc.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
sound/soc/intel/avs/ipc.c +5 -3
index 5010b0f5be47..0747899c81a7 100644
@@ -393,6 +393,7 @@ static int avs_dsp_do_send_msg(struct avs_dev *adev, struct avs_ipc_msg *request
 			       struct avs_ipc_msg *reply, int timeout, const char *name)
 {
 	struct avs_ipc *ipc = adev->ipc;
+	bool copy_reply = true;
 	int ret;
 
 	guard(mutex)(&ipc->msg_mutex);
@@ -413,10 +414,11 @@ static int avs_dsp_do_send_msg(struct avs_dev *adev, struct avs_ipc_msg *request
 			/* Same treatment as on exception, just stack_dump=0. */
 			avs_dsp_exception_caught(adev, &msg);
 		}
-		return ret;
+		copy_reply = false;
+	} else {
+		ret = ipc->rx.rsp.status;
 	}
 
-	ret = ipc->rx.rsp.status;
 	/*
 	 * If IPC channel is blocked e.g.: due to ongoing recovery,
 	 * -EPERM error code is expected and thus it's not an actual error.
@@ -430,7 +432,7 @@ static int avs_dsp_do_send_msg(struct avs_dev *adev, struct avs_ipc_msg *request
 		dev_err(adev->dev, "%s (0x%08x 0x%08x) failed: %d\n",
 			name, request->glb.primary, request->glb.ext.val, ret);
 
-	if (reply) {
+	if (copy_reply && reply) {
 		reply->header = ipc->rx.header;
 		reply->size = ipc->rx.size;
 		if (reply->data && ipc->rx.size)
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH 01/11] ASoC: Intel: avs: Do not skip error reporting when an IPC timeouts

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] ASoC: Intel: avs: missing Fixes: trailer for IPC timeout error logging fix --

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Low] ASoC: Intel: avs: missing Fixes: trailer for IPC timeout error logging fix
--

commit 7616ba37e434bf822d649f2b888e0cc7892fe0f3
Author: Cezary Rojewski <[email protected]>

Quoted 8 lines

ASoC: Intel: avs: Do not skip error reporting when an IPC timeouts

If an IPC timeouts nothing is printed as avs_dsp_do_send_msg() exits early. This makes it harder to assess and debug IPC failures. Have a variable to separate "should copy reply?" subject from debug printing one.

[Severity: Low]
Commit 26033ae6bd89 ("ASoC: Intel: avs: Move IPC error messages one level down") moved IPC error logging from the callers into avs_dsp_do_send_msg() after the early return on avs_ipc_wait_busy_completion() failure. Should this include a
Fixes: tag for that commit?

Fixes 26033ae6bd89 ("ASoC: Intel: avs: Move IPC error messages one level down")
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
author maintainer
#3 lore raw

PATCH 2/11 ASoC: Intel: avs: Do not skip errors from avs_path_pause()

In reply to Cezary Rojewski

During downward trigger() operation avs_path_pause() occurs before avs_path_reset(). Only the result of the latter is taken into consideration whilst the result of pause operation is ignored. Fix that and make the first error take priority when returning the final result.

---
 sound/soc/intel/avs/pcm.c | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)
sound/soc/intel/avs/pcm.c +18 -12
index fd4ab14bfe04..b0796d18c1c4 100644
@@ -271,7 +271,7 @@ static int avs_dai_nonhda_be_trigger(struct snd_pcm_substream *substream, int cm
 {
 	struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
 	struct avs_dma_data *data;
-	int ret = 0;
+	int ret2, ret = 0;
 
 	data = snd_soc_dai_get_dma_data(dai, substream);
 
@@ -303,9 +303,11 @@ static int avs_dai_nonhda_be_trigger(struct snd_pcm_substream *substream, int cm
 		if (ret < 0)
 			dev_err(dai->dev, "pause BE path failed: %d\n", ret);
 
-		ret = avs_path_reset(data->path);
-		if (ret < 0)
-			dev_err(dai->dev, "reset BE path failed: %d\n", ret);
+		ret2 = avs_path_reset(data->path);
+		if (ret2)
+			dev_err(dai->dev, "reset BE path failed: %d\n", ret2);
+		if (ret2 && !ret)
+			ret = ret2;
 		break;
 
 	default:
@@ -492,7 +494,7 @@ static int avs_dai_hda_be_trigger(struct snd_pcm_substream *substream, int cmd,
 {
 	struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
 	struct avs_dma_data *data;
-	int ret = 0;
+	int ret2, ret = 0;
 
 	dev_dbg(dai->dev, "entry %s cmd=%d\n", __func__, cmd);
 
@@ -530,9 +532,11 @@ static int avs_dai_hda_be_trigger(struct snd_pcm_substream *substream, int cmd,
 
 		snd_hdac_ext_stream_clear(data->link_stream);
 
-		ret = avs_path_reset(data->path);
-		if (ret < 0)
-			dev_err(dai->dev, "reset BE path failed: %d\n", ret);
+		ret2 = avs_path_reset(data->path);
+		if (ret2)
+			dev_err(dai->dev, "reset BE path failed: %d\n", ret2);
+		if (ret2 && !ret)
+			ret = ret2;
 		break;
 
 	default:
@@ -868,7 +872,7 @@ static int avs_dai_fe_trigger(struct snd_pcm_substream *substream, int cmd, stru
 	struct hdac_ext_stream *host_stream;
 	struct hdac_bus *bus;
 	unsigned long flags;
-	int ret = 0;
+	int ret2, ret = 0;
 
 	data = snd_soc_dai_get_dma_data(dai, substream);
 	host_stream = data->host_stream;
@@ -915,9 +919,11 @@ static int avs_dai_fe_trigger(struct snd_pcm_substream *substream, int cmd, stru
 		avs_hda_stream_stop(bus, host_stream);
 		spin_unlock_irqrestore(&bus->reg_lock, flags);
 
-		ret = avs_path_reset(data->path);
-		if (ret < 0)
-			dev_err(dai->dev, "reset FE path failed: %d\n", ret);
+		ret2 = avs_path_reset(data->path);
+		if (ret2)
+			dev_err(dai->dev, "reset FE path failed: %d\n", ret2);
+		if (ret2 && !ret)
+			ret = ret2;
 		break;
 
 	default:
Signature · 1 line
2.34.1
author maintainer
#4 lore raw

PATCH 3/11 ASoC: Intel: avs: Have one location for dumping path-errors

In reply to Cezary Rojewski

Both path.c and pcm.c print the exact same error messages, one after the other. Let the avs_path_xxx() handle the messaging so that its caller need not to do themselves. At the same time enrich them with path's name so there is no ambiguity which path is being manipulated.

---
 sound/soc/intel/avs/path.c | 31 +++++++++++++-----------
 sound/soc/intel/avs/pcm.c  | 48 ++++++--------------------------------
 2 files changed, 24 insertions(+), 55 deletions(-)
sound/soc/intel/avs/path.c +17 -14
index 936be206eece..e8bbc9058fc7 100644
@@ -11,6 +11,7 @@
 #include <acpi/nhlt.h>
 #include <sound/pcm_params.h>
 #include <sound/soc.h>
+#include <sound/soc-dapm.h>
 #include "avs.h"
 #include "control.h"
 #include "path.h"
@@ -1187,18 +1188,11 @@ static struct avs_path *avs_path_create_unlocked(struct avs_dev *adev, u32 dma_i
 
 static void avs_condpath_free(struct avs_dev *adev, struct avs_path *path)
 {
-	int ret;
-
 	list_del(&path->source_node);
 	list_del(&path->sink_node);
 
-	ret = avs_path_reset(path);
-	if (ret < 0)
-		dev_err(adev->dev, "reset condpath failed: %d\n", ret);
-
-	ret = avs_path_unbind(path);
-	if (ret < 0)
-		dev_err(adev->dev, "unbind condpath failed: %d\n", ret);
+	avs_path_reset(path);
+	avs_path_unbind(path);
 
 	avs_path_free_unlocked(path);
 }
@@ -1373,6 +1367,13 @@ static int avs_path_bind_prepare(struct avs_dev *adev,
 	return 0;
 }
 
+static const char *avs_path_name(struct avs_path *path)
+{
+	struct snd_soc_dapm_widget *w = path->template->owner->w;
+
+	return w ? w->name : "(condpath)";
+}
+
 int avs_path_bind(struct avs_path *path)
 {
 	struct avs_path_pipeline *ppl;
@@ -1397,7 +1398,8 @@ int avs_path_bind(struct avs_path *path)
 					   sink->instance_id, binding->sink_pin,
 					   binding->source_pin);
 			if (ret) {
-				dev_err(adev->dev, "bind path failed: %d\n", ret);
+				dev_err(adev->dev, "bind path %s failed: %d\n",
+					avs_path_name(path), ret);
 				return AVS_IPC_RET(ret);
 			}
 		}
@@ -1426,7 +1428,8 @@ int avs_path_unbind(struct avs_path *path)
 					     sink->instance_id, binding->sink_pin,
 					     binding->source_pin);
 			if (ret) {
-				dev_err(adev->dev, "unbind path failed: %d\n", ret);
+				dev_err(adev->dev, "unbind path %s failed: %d\n",
+					avs_path_name(path), ret);
 				return AVS_IPC_RET(ret);
 			}
 		}
@@ -1448,7 +1451,7 @@ int avs_path_reset(struct avs_path *path)
 		ret = avs_ipc_set_pipeline_state(adev, ppl->instance_id,
 						 AVS_PPL_STATE_RESET);
 		if (ret) {
-			dev_err(adev->dev, "reset path failed: %d\n", ret);
+			dev_err(adev->dev, "reset path %s failed: %d\n", avs_path_name(path), ret);
 			path->state = AVS_PPL_STATE_INVALID;
 			return AVS_IPC_RET(ret);
 		}
@@ -1507,7 +1510,7 @@ int avs_path_pause(struct avs_path *path)
 		ret = avs_ipc_set_pipeline_state(adev, ppl->instance_id,
 						 AVS_PPL_STATE_PAUSED);
 		if (ret) {
-			dev_err(adev->dev, "pause path failed: %d\n", ret);
+			dev_err(adev->dev, "pause path %s failed: %d\n", avs_path_name(path), ret);
 			path->state = AVS_PPL_STATE_INVALID;
 			return AVS_IPC_RET(ret);
 		}
@@ -1575,7 +1578,7 @@ int avs_path_run(struct avs_path *path, int trigger)
 		ret = avs_ipc_set_pipeline_state(adev, ppl->instance_id,
 						 AVS_PPL_STATE_RUNNING);
 		if (ret) {
-			dev_err(adev->dev, "run path failed: %d\n", ret);
+			dev_err(adev->dev, "run path %s failed: %d\n", avs_path_name(path), ret);
 			path->state = AVS_PPL_STATE_INVALID;
 			return AVS_IPC_RET(ret);
 		}
sound/soc/intel/avs/pcm.c +7 -41

128 lines not on this page · raw message

Signature · 1 line
2.34.1
author maintainer
#5 lore raw

PATCH 4/11 ASoC: Intel: avs: Small registers cleanup

In reply to Cezary Rojewski

Sort the HIPC registers - HIPCT comes before HIPCI. Also for readability reasons, reword the ADSP interface version constants.

---
 sound/soc/intel/avs/messages.h  | 4 ++--
 sound/soc/intel/avs/registers.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
sound/soc/intel/avs/messages.h +2 -2
index 55c04b0142ae..f8407b917c00 100644
@@ -502,8 +502,8 @@ enum avs_hw_cfg_params {
 };
 
 enum avs_iface_version {
-	AVS_AVS_VER_1_5 = 0x10005,
-	AVS_AVS_VER_1_8 = 0x10008,
+	AVS_IFACE_VER_1_5 = 0x10005,
+	AVS_IFACE_VER_1_8 = 0x10008,
 };
 
 enum avs_i2s_version {
sound/soc/intel/avs/registers.h +1 -1
index 97767882ffa1..c80207652fab 100644
@@ -50,9 +50,9 @@
 #define SKL_ADSP_REG_HIPCIE		(SKL_ADSP_IPC_BASE + 0x0C)
 #define SKL_ADSP_REG_HIPCCTL		(SKL_ADSP_IPC_BASE + 0x10)
 
+#define SKL_ADSP_HIPCT_BUSY		BIT(31)
 #define SKL_ADSP_HIPCI_BUSY		BIT(31)
 #define SKL_ADSP_HIPCIE_DONE		BIT(30)
-#define SKL_ADSP_HIPCT_BUSY		BIT(31)
 
 /* CNL Intel HD Audio Inter-Processor Communication Registers */
 #define CNL_ADSP_IPC_BASE               0xC0
Signature · 1 line
2.34.1
author maintainer
#6 lore raw

PATCH 5/11 ASoC: Intel: avs: Enrich missing-format and token-parsing messages

In reply to Cezary Rojewski

The existing log does not mention which format is actually missing. Update it and lower its level as missing format when scanning for available configurations is not a warning.

For similar reason dump the token for which the topology parsing failed.

---
 sound/soc/intel/avs/path.c     | 4 +++-
 sound/soc/intel/avs/topology.c | 5 ++++-
 2 files changed, 7 insertions(+), 2 deletions(-)
sound/soc/intel/avs/path.c +3 -1
index e8bbc9058fc7..e9595eefc416 100644
@@ -321,7 +321,9 @@ avs_nhlt_config_or_default(struct avs_dev *adev, struct avs_tplg_module *t)
 				       fmt->num_channels, fmt->sampling_freq, fmt->valid_bit_depth,
 				       fmt->bit_depth);
 	if (!fmtcfg) {
-		dev_warn(adev->dev, "Endpoint format configuration not found.\n");
+		dev_dbg(adev->dev, "%s endpoint format configuration %d/%d/%d/%d not found\n",
+			snd_pcm_direction_name(dir), fmt->num_channels,
+			fmt->valid_bit_depth, fmt->bit_depth, fmt->sampling_freq);
 		return ERR_PTR(-ENOENT);
 	}
 
sound/soc/intel/avs/topology.c +4 -1
index 71aaa25f083e..dc0efa1b16ea 100644
@@ -268,8 +268,11 @@ static int avs_parse_word_tokens(struct snd_soc_component *comp, void *object,
 				continue;
 
 			ret = parsers[j].parse(comp, tuple, object, parsers[j].offset);
-			if (ret)
+			if (ret) {
+				dev_err(comp->dev, "parsing token %d failed: %d\n",
+					parsers[j].token, ret);
 				return ret;
+			}
 		}
 	}
 
Signature · 1 line
2.34.1
author maintainer
#7 lore raw

PATCH 6/11 ASoC: Intel: avs: Unify code style for platform_device_id arrays

In reply to Cezary Rojewski

Align all the simple entries to the compact one-line style. While cleaning up avs-boards, add missing comma to BDW-boards platform driver declarations.

---
 sound/soc/intel/avs/boards/probe.c   | 4 +---
 sound/soc/intel/avs/boards/rt274.c   | 4 +---
 sound/soc/intel/avs/boards/rt286.c   | 4 +---
 sound/soc/intel/avs/boards/rt298.c   | 4 +---
 sound/soc/intel/avs/boards/rt5514.c  | 4 +---
 sound/soc/intel/avs/boards/rt5640.c  | 4 +---
 sound/soc/intel/avs/boards/rt5663.c  | 4 +---
 sound/soc/intel/avs/boards/rt5682.c  | 4 +---
 sound/soc/intel/avs/boards/ssm4567.c | 4 +---
 sound/soc/intel/boards/bdw-rt5677.c  | 2 +-
 sound/soc/intel/boards/bdw_rt286.c   | 2 +-
 11 files changed, 11 insertions(+), 29 deletions(-)
sound/soc/intel/avs/boards/probe.c +1 -3
index b3ed44bc228c..ffd6ff76f9a5 100644
@@ -61,9 +61,7 @@ static int avs_probe_mb_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id avs_probe_mb_driver_ids[] = {
-	{
-		.name = "avs_probe_mb",
-	},
+	{ .name = "avs_probe_mb" },
 	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_probe_mb_driver_ids);
sound/soc/intel/avs/boards/rt274.c +1 -3
index 376b0859a88f..a28f107a5521 100644
@@ -258,9 +258,7 @@ static int avs_rt274_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id avs_rt274_driver_ids[] = {
-	{
-		.name = "avs_rt274",
-	},
+	{ .name = "avs_rt274" },
 	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_rt274_driver_ids);
sound/soc/intel/avs/boards/rt286.c +1 -3
index 2931c36df7db..ef1721bab2ca 100644
@@ -228,9 +228,7 @@ static int avs_rt286_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id avs_rt286_driver_ids[] = {
-	{
-		.name = "avs_rt286",
-	},
+	{ .name = "avs_rt286" },
 	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_rt286_driver_ids);
sound/soc/intel/avs/boards/rt298.c +1 -3
index ef6da3f3420f..3b5ee7021ee3 100644
@@ -247,9 +247,7 @@ static int avs_rt298_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id avs_rt298_driver_ids[] = {
-	{
-		.name = "avs_rt298",
-	},
+	{ .name = "avs_rt298" },
 	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_rt298_driver_ids);
sound/soc/intel/avs/boards/rt5514.c +1 -3
index c81c47e08991..189f27708fe3 100644
@@ -175,9 +175,7 @@ static int avs_rt5514_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id avs_rt5514_driver_ids[] = {
-	{
-		.name = "avs_rt5514",
-	},
+	{ .name = "avs_rt5514" },
 	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_rt5514_driver_ids);
sound/soc/intel/avs/boards/rt5640.c +1 -3
index 267006a1e09c..a425a597c9ca 100644
@@ -249,9 +249,7 @@ static int avs_rt5640_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id avs_rt5640_driver_ids[] = {
-	{
-		.name = "avs_rt5640",
-	},
+	{ .name = "avs_rt5640" },
 	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_rt5640_driver_ids);
sound/soc/intel/avs/boards/rt5663.c +1 -3
index de10d09616c6..afa560d942d1 100644
@@ -246,9 +246,7 @@ static int avs_rt5663_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id avs_rt5663_driver_ids[] = {
-	{
-		.name = "avs_rt5663",
-	},
+	{ .name = "avs_rt5663" },
 	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_rt5663_driver_ids);
sound/soc/intel/avs/boards/rt5682.c +1 -3
index 9f47dc14ac64..bd2507855d96 100644
@@ -322,9 +322,7 @@ static int avs_rt5682_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id avs_rt5682_driver_ids[] = {
-	{
-		.name = "avs_rt5682",
-	},
+	{ .name = "avs_rt5682" },
 	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_rt5682_driver_ids);
sound/soc/intel/avs/boards/ssm4567.c +1 -3
index 53f8b6e2c513..900a965c9746 100644
@@ -177,9 +177,7 @@ static int avs_ssm4567_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id avs_ssm4567_driver_ids[] = {
-	{
-		.name = "avs_ssm4567",
-	},
+	{ .name = "avs_ssm4567" },
 	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_ssm4567_driver_ids);
sound/soc/intel/boards/bdw-rt5677.c +1 -1
index 98f0ca64be27..7bffc579edb2 100644
@@ -446,7 +446,7 @@ static struct platform_driver bdw_rt5677_audio = {
 	.probe = bdw_rt5677_probe,
 	.driver = {
 		.name = "bdw-rt5677",
-		.pm = &snd_soc_pm_ops
+		.pm = &snd_soc_pm_ops,
 	},
 };
 
sound/soc/intel/boards/bdw_rt286.c +1 -1
index 523ade9f31ab..f890e02bf9cc 100644
@@ -247,7 +247,7 @@ static struct platform_driver bdw_rt286_driver = {
 	.probe = bdw_rt286_probe,
 	.driver = {
 		.name = "bdw_rt286",
-		.pm = &snd_soc_pm_ops
+		.pm = &snd_soc_pm_ops,
 	},
 };
 
Signature · 1 line
2.34.1
author maintainer
#8 lore raw

PATCH 7/11 ASoC: Intel: avs: Streamline topology parser names

In reply to Cezary Rojewski

All other parsers are named with avs_ prefix, there is no reason for exceptions.

---
 sound/soc/intel/avs/topology.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
sound/soc/intel/avs/topology.c +11 -11
index dc0efa1b16ea..273b104c19b7 100644
@@ -356,8 +356,8 @@ AVS_DEFINE_PTR_PARSER(binding, struct avs_tplg_binding, bindings);
 AVS_DEFINE_PTR_PARSER(init_config, struct avs_tplg_init_config, init_configs);
 AVS_DEFINE_PTR_PARSER(nhlt_config, struct avs_tplg_nhlt_config, nhlt_configs);
 
-static int
-parse_audio_format_bitfield(struct snd_soc_component *comp, void *elem, void *object, u32 offset)
+static int avs_parse_audio_format_bitfield(struct snd_soc_component *comp,
+					   void *elem, void *object, u32 offset)
 {
 	struct snd_soc_tplg_vendor_value_elem *velem = elem;
 	struct avs_audio_format *audio_format = object;
@@ -399,8 +399,8 @@ static int avs_ssp_sprint(char *buf, size_t size, const char *fmt, int port, int
 	return snprintf(buf, size, "%s", fmt);
 }
 
-static int parse_link_formatted_string(struct snd_soc_component *comp, void *elem,
-				       void *object, u32 offset)
+static int avs_parse_link_formatted_string(struct snd_soc_component *comp,
+					   void *elem, void *object, u32 offset)
 {
 	struct snd_soc_tplg_vendor_string_elem *tuple = elem;
 	struct snd_soc_acpi_mach *mach = dev_get_platdata(comp->card->dev);
@@ -578,19 +578,19 @@ static const struct avs_tplg_token_parser audio_format_parsers[] = {
 		.token = AVS_TKN_AFMT_NUM_CHANNELS_U32,
 		.type = SND_SOC_TPLG_TUPLE_TYPE_WORD,
 		.offset = AVS_TKN_AFMT_NUM_CHANNELS_U32,
-		.parse = parse_audio_format_bitfield,
+		.parse = avs_parse_audio_format_bitfield,
 	},
 	{
 		.token = AVS_TKN_AFMT_VALID_BIT_DEPTH_U32,
 		.type = SND_SOC_TPLG_TUPLE_TYPE_WORD,
 		.offset = AVS_TKN_AFMT_VALID_BIT_DEPTH_U32,
-		.parse = parse_audio_format_bitfield,
+		.parse = avs_parse_audio_format_bitfield,
 	},
 	{
 		.token = AVS_TKN_AFMT_SAMPLE_TYPE_U32,
 		.type = SND_SOC_TPLG_TUPLE_TYPE_WORD,
 		.offset = AVS_TKN_AFMT_SAMPLE_TYPE_U32,
-		.parse = parse_audio_format_bitfield,
+		.parse = avs_parse_audio_format_bitfield,
 	},
 };
 
@@ -1096,7 +1096,7 @@ static const struct avs_tplg_token_parser binding_parsers[] = {
 		.token = AVS_TKN_BINDING_TARGET_TPLG_NAME_STRING,
 		.type = SND_SOC_TPLG_TUPLE_TYPE_STRING,
 		.offset = offsetof(struct avs_tplg_binding, target_tplg_name),
-		.parse = parse_link_formatted_string,
+		.parse = avs_parse_link_formatted_string,
 	},
 	{
 		.token = AVS_TKN_BINDING_TARGET_PATH_TMPL_ID_U32,
@@ -1822,7 +1822,7 @@ static int avs_route_load(struct snd_soc_component *comp, int index,
 	int ssp_port, tdm_slot;
 	char *buf;
 
-	/* See parse_link_formatted_string() for dynamic naming when(s). */
+	/* See avs_parse_link_formatted_string() for dynamic naming when(s). */
 	if (!avs_mach_singular_ssp(mach))
 		return 0;
 	ssp_port = avs_mach_ssp_port(mach);
@@ -1880,7 +1880,7 @@ static int avs_widget_load(struct snd_soc_component *comp, int index,
 		goto static_name;
 	ssp_port = avs_mach_ssp_port(mach);
 
-	/* See parse_link_formatted_string() for dynamic naming when(s). */
+	/* See avs_parse_link_formatted_string() for dynamic naming when(s). */
 	if (avs_mach_singular_tdm(mach, ssp_port)) {
 		/* size is based on possible %d -> SSP:TDM, where SSP and TDM < 16 + '\0' */
 		size_t size = strlen(dw->name) + 3;
@@ -1966,7 +1966,7 @@ static const struct avs_tplg_token_parser manifest_parsers[] = {
 		.token = AVS_TKN_MANIFEST_NAME_STRING,
 		.type = SND_SOC_TPLG_TUPLE_TYPE_STRING,
 		.offset = offsetof(struct avs_tplg, name),
-		.parse = parse_link_formatted_string,
+		.parse = avs_parse_link_formatted_string,
 	},
 	{
 		.token = AVS_TKN_MANIFEST_VERSION_U32,
Signature · 1 line
2.34.1
author maintainer
#9 lore raw

PATCH 8/11 ASoC: Intel: avs: Streamline wording used for board configs

In reply to Cezary Rojewski

Have all the boards follow the same naming pattern in Kconfig.

---
 sound/soc/intel/avs/boards/Kconfig | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
sound/soc/intel/avs/boards/Kconfig +3 -3
index 82f50207bb2f..770267bf9c1e 100644
@@ -23,7 +23,7 @@ config SND_SOC_INTEL_AVS_MACH_DA7219
 	  If unsure select "N".
 
 config SND_SOC_INTEL_AVS_MACH_DMIC
-	tristate "DMIC generic board"
+	tristate "generic DMIC board"
 	select SND_SOC_DMIC
 	help
 	  This adds support for AVS with Digital Mic array configuration.
@@ -41,7 +41,7 @@ config SND_SOC_INTEL_AVS_MACH_ES8336
 	  If unsure select "N".
 
 config SND_SOC_INTEL_AVS_MACH_HDAUDIO
-	tristate "HD-Audio generic board"
+	tristate "generic HD-Audio board"
 	select SND_SOC_HDA
 	help
 	  This adds support for AVS with HDAudio codec configuration.
@@ -49,7 +49,7 @@ config SND_SOC_INTEL_AVS_MACH_HDAUDIO
 	  If unsure select "N".
 
 config SND_SOC_INTEL_AVS_MACH_I2S_TEST
-	tristate "I2S test board"
+	tristate "test I2S board"
 	help
 	   This adds support for I2S test-board which can be used to verify
 	   transfer over I2S interface with SSP loopback scenarios.
Signature · 1 line
2.34.1
author maintainer
#10 lore raw

PATCH 9/11 ASoC: Intel: avs: Streamline naming of hw_params variables

In reply to Cezary Rojewski

A number of different naming variations are used throughout the file. The selected pattern is: fe_params for FE DAIs, be_params for BE ones. Leave 'params' if a function is tied to no particular end.

---
 sound/soc/intel/avs/pcm.c | 42 +++++++++++++++++++--------------------
 1 file changed, 21 insertions(+), 21 deletions(-)
sound/soc/intel/avs/pcm.c +21 -21
index 360cb8125bcc..b1a8e8b20cc8 100644
@@ -166,9 +166,9 @@ static void avs_dai_shutdown(struct snd_pcm_substream *substream, struct snd_soc
 }
 
 static int avs_dai_hw_params(struct snd_pcm_substream *substream,
-			     struct snd_pcm_hw_params *fe_hw_params,
-			     struct snd_pcm_hw_params *be_hw_params, struct snd_soc_dai *dai,
-			     int dma_id)
+			     struct snd_pcm_hw_params *fe_params,
+			     struct snd_pcm_hw_params *be_params,
+			     struct snd_soc_dai *dai, int dma_id)
 {
 	struct avs_dma_data *data;
 	struct avs_path *path;
@@ -179,16 +179,16 @@ static int avs_dai_hw_params(struct snd_pcm_substream *substream,
 	dev_dbg(dai->dev, "%s FE hw_params str %p rtd %p",
 		__func__, substream, substream->runtime);
 	dev_dbg(dai->dev, "rate %d chn %d vbd %d bd %d\n",
-		params_rate(fe_hw_params), params_channels(fe_hw_params),
-		params_width(fe_hw_params), params_physical_width(fe_hw_params));
+		params_rate(fe_params), params_channels(fe_params),
+		params_width(fe_params), params_physical_width(fe_params));
 
 	dev_dbg(dai->dev, "%s BE hw_params str %p rtd %p",
 		__func__, substream, substream->runtime);
 	dev_dbg(dai->dev, "rate %d chn %d vbd %d bd %d\n",
-		params_rate(be_hw_params), params_channels(be_hw_params),
-		params_width(be_hw_params), params_physical_width(be_hw_params));
+		params_rate(be_params), params_channels(be_params),
+		params_width(be_params), params_physical_width(be_params));
 
-	path = avs_path_create(data->adev, dma_id, data->template, fe_hw_params, be_hw_params);
+	path = avs_path_create(data->adev, dma_id, data->template, fe_params, be_params);
 	if (IS_ERR(path)) {
 		ret = PTR_ERR(path);
 		dev_err(dai->dev, "create path failed: %d\n", ret);
@@ -200,10 +200,10 @@ static int avs_dai_hw_params(struct snd_pcm_substream *substream,
 }
 
 static int avs_dai_be_hw_params(struct snd_pcm_substream *substream,
-				struct snd_pcm_hw_params *be_hw_params, struct snd_soc_dai *dai,
-				int dma_id)
+				struct snd_pcm_hw_params *be_params,
+				struct snd_soc_dai *dai, int dma_id)
 {
-	struct snd_pcm_hw_params *fe_hw_params = NULL;
+	struct snd_pcm_hw_params *fe_params = NULL;
 	struct snd_soc_pcm_runtime *fe, *be;
 	struct snd_soc_dpcm *dpcm;
 
@@ -211,10 +211,10 @@ static int avs_dai_be_hw_params(struct snd_pcm_substream *substream,
 	/* dpcm_fe_dai_open() guarantees the list is not empty at this point. */
 	for_each_dpcm_fe(be, substream->stream, dpcm) {
 		fe = dpcm->fe;
-		fe_hw_params = &fe->dpcm[substream->stream].hw_params;
+		fe_params = &fe->dpcm[substream->stream].hw_params;
 	}
 
-	return avs_dai_hw_params(substream, fe_hw_params, be_hw_params, dai, dma_id);
+	return avs_dai_hw_params(substream, fe_params, be_params, dai, dma_id);
 }
 
 static int avs_dai_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
@@ -234,7 +234,7 @@ static int avs_dai_prepare(struct snd_pcm_substream *substream, struct snd_soc_d
 }
 
 static int avs_dai_nonhda_be_hw_params(struct snd_pcm_substream *substream,
-				       struct snd_pcm_hw_params *hw_params, struct snd_soc_dai *dai)
+				       struct snd_pcm_hw_params *be_params, struct snd_soc_dai *dai)
 {
 	struct avs_dma_data *data;
 
@@ -243,7 +243,7 @@ static int avs_dai_nonhda_be_hw_params(struct snd_pcm_substream *substream,
 		return 0;
 
 	/* Actual port-id comes from topology. */
-	return avs_dai_be_hw_params(substream, hw_params, dai, 0);
+	return avs_dai_be_hw_params(substream, be_params, dai, 0);
 }
 
 static int avs_dai_nonhda_be_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
@@ -401,7 +401,7 @@ static void avs_dai_althda_be_shutdown(struct snd_pcm_substream *substream, stru
 }
 
 static int avs_dai_hda_be_hw_params(struct snd_pcm_substream *substream,
-				    struct snd_pcm_hw_params *hw_params, struct snd_soc_dai *dai)
+				    struct snd_pcm_hw_params *be_params, struct snd_soc_dai *dai)
 {
 	struct avs_dma_data *data;
 
@@ -409,7 +409,7 @@ static int avs_dai_hda_be_hw_params(struct snd_pcm_substream *substream,
 	if (data->path)
 		return 0;
 
-	return avs_dai_be_hw_params(substream, hw_params, dai,
+	return avs_dai_be_hw_params(substream, be_params, dai,
 				    hdac_stream(data->link_stream)->stream_tag - 1);
 }
 
@@ -643,9 +643,9 @@ static void avs_dai_fe_shutdown(struct snd_pcm_substream *substream, struct snd_
 }
 
 static int avs_dai_fe_hw_params(struct snd_pcm_substream *substream,
-				struct snd_pcm_hw_params *hw_params, struct snd_soc_dai *dai)
+				struct snd_pcm_hw_params *fe_params, struct snd_soc_dai *dai)
 {
-	struct snd_pcm_hw_params *be_hw_params = NULL;
+	struct snd_pcm_hw_params *be_params = NULL;
 	struct snd_soc_pcm_runtime *fe, *be;
 	struct snd_soc_dpcm *dpcm;
 	struct avs_dma_data *data;
@@ -666,10 +666,10 @@ static int avs_dai_fe_hw_params(struct snd_pcm_substream *substream,
 	/* dpcm_fe_dai_open() guarantees the list is not empty at this point. */
 	for_each_dpcm_be(fe, substream->stream, dpcm) {
 		be = dpcm->be;
-		be_hw_params = &be->dpcm[substream->stream].hw_params;
+		be_params = &be->dpcm[substream->stream].hw_params;
 	}
 
-	ret = avs_dai_hw_params(substream, hw_params, be_hw_params, dai,
+	ret = avs_dai_hw_params(substream, fe_params, be_params, dai,
 				hdac_stream(host_stream)->stream_tag - 1);
 	if (ret)
 		goto create_err;
Signature · 1 line
2.34.1
author maintainer
#11 lore raw

PATCH 10/11 ASoC: Intel: avs: Streamline spacing used in the avs_ids table

In reply to Cezary Rojewski

Makes the declarations consistent across the table.

---
 sound/soc/intel/avs/core.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
sound/soc/intel/avs/core.c +8 -8
index 8cb2deb2b5d9..8ff7c616a9d1 100644
@@ -913,14 +913,14 @@ static const struct avs_spec fcl_desc = {
 };
 
 static const struct pci_device_id avs_ids[] = {
-	{ PCI_DEVICE_DATA(INTEL, HDA_SKL_LP, &skl_desc) },
-	{ PCI_DEVICE_DATA(INTEL, HDA_SKL, &skl_desc) },
-	{ PCI_DEVICE_DATA(INTEL, HDA_KBL_LP, &skl_desc) },
-	{ PCI_DEVICE_DATA(INTEL, HDA_KBL, &skl_desc) },
-	{ PCI_DEVICE_DATA(INTEL, HDA_KBL_H, &skl_desc) },
-	{ PCI_DEVICE_DATA(INTEL, HDA_CML_S, &skl_desc) },
-	{ PCI_DEVICE_DATA(INTEL, HDA_APL, &apl_desc) },
-	{ PCI_DEVICE_DATA(INTEL, HDA_GLK, &apl_desc) },
+	{ PCI_DEVICE_DATA(INTEL, HDA_SKL_LP,	&skl_desc) },
+	{ PCI_DEVICE_DATA(INTEL, HDA_SKL,	&skl_desc) },
+	{ PCI_DEVICE_DATA(INTEL, HDA_KBL_LP,	&skl_desc) },
+	{ PCI_DEVICE_DATA(INTEL, HDA_KBL,	&skl_desc) },
+	{ PCI_DEVICE_DATA(INTEL, HDA_KBL_H,	&skl_desc) },
+	{ PCI_DEVICE_DATA(INTEL, HDA_CML_S,	&skl_desc) },
+	{ PCI_DEVICE_DATA(INTEL, HDA_APL,	&apl_desc) },
+	{ PCI_DEVICE_DATA(INTEL, HDA_GLK,	&apl_desc) },
 	{ PCI_DEVICE_DATA(INTEL, HDA_CNL_LP,	&cnl_desc) },
 	{ PCI_DEVICE_DATA(INTEL, HDA_CNL_H,	&cnl_desc) },
 	{ PCI_DEVICE_DATA(INTEL, HDA_CML_LP,	&cnl_desc) },
Signature · 1 line
2.34.1
author maintainer
#12 lore raw

PATCH 11/11 ASoC: Intel: avs: Remove soc-acpi-intel-match include

In reply to Cezary Rojewski

The avs-driver does not use any of the tables declared in the header.

---
 sound/soc/intel/avs/pcm.c | 1 -
 1 file changed, 1 deletion(-)
sound/soc/intel/avs/pcm.c +0 -1
index b1a8e8b20cc8..1e6f27679811 100644
@@ -13,7 +13,6 @@
 #include <sound/hdaudio_ext.h>
 #include <sound/pcm_params.h>
 #include <sound/soc-acpi.h>
-#include <sound/soc-acpi-intel-match.h>
 #include <sound/soc-component.h>
 #include "avs.h"
 #include "path.h"
Signature · 1 line
2.34.1
maintainer
#13 lore raw
In reply to Cezary Rojewski
Quoted 6 lines · Cezary Rojewski

ASoC: Intel: avs: Renames and debug prints

The patches consists almost solely of renames and addition/enrichment of debug prints. Plus few removals to redunce duplication among these debug prints.

Quoted 6 lines

The 2/11 patch is the exception - as its follow up updates the messages around, the mentioned patch is here to fix the problem of skipped results coming from avs_path_pause() in trigger() operations. With that done, the dev-prints are touched.

[...]

Applied to

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

Thanks!

[01/11] ASoC: Intel: avs: Do not skip error reporting when an IPC timeouts

        https://git.kernel.org/broonie/sound/c/29b76b28adb3
[02/11] ASoC: Intel: avs: Do not skip errors from avs_path_pause()
        https://git.kernel.org/broonie/sound/c/e3f298602f10
[03/11] ASoC: Intel: avs: Have one location for dumping path-errors
        https://git.kernel.org/broonie/sound/c/1bd4d27d1fac
[04/11] ASoC: Intel: avs: Small registers cleanup
        https://git.kernel.org/broonie/sound/c/1bdeb816a818
[05/11] ASoC: Intel: avs: Enrich missing-format and token-parsing messages
        https://git.kernel.org/broonie/sound/c/2a8f64f96e45
[06/11] ASoC: Intel: avs: Unify code style for platform_device_id arrays
        https://git.kernel.org/broonie/sound/c/357b3ab122cc
[07/11] ASoC: Intel: avs: Streamline topology parser names
        https://git.kernel.org/broonie/sound/c/516742b4e979
[08/11] ASoC: Intel: avs: Streamline wording used for board configs
        https://git.kernel.org/broonie/sound/c/4c59d3302e76
[09/11] ASoC: Intel: avs: Streamline naming of hw_params variables
        https://git.kernel.org/broonie/sound/c/13a4b93fd23b
[10/11] ASoC: Intel: avs: Streamline spacing used in the avs_ids table
        https://git.kernel.org/broonie/sound/c/2596a16ad41b
[11/11] ASoC: Intel: avs: Remove soc-acpi-intel-match include
        https://git.kernel.org/broonie/sound/c/a8b8834d2a1d

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