All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Mack <daniel@zonque.org>
To: broonie@kernel.org, ryan.lee.analog@gmail.com
Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
	robh+dt@kernel.org, Daniel Mack <daniel@zonque.org>
Subject: [PATCH 5/8] ASoC: max98396: Improve some error prints
Date: Fri, 24 Jun 2022 12:47:09 +0200	[thread overview]
Message-ID: <20220624104712.1934484-6-daniel@zonque.org> (raw)
In-Reply-To: <20220624104712.1934484-1-daniel@zonque.org>

Let's log what actually failed and log at some more places.

Signed-off-by: Daniel Mack <daniel@zonque.org>
---
 sound/soc/codecs/max98396.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/max98396.c b/sound/soc/codecs/max98396.c
index 06ac637f2696..faa81b4bb709 100644
--- a/sound/soc/codecs/max98396.c
+++ b/sound/soc/codecs/max98396.c
@@ -372,7 +372,8 @@ static int max98396_dai_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
 		break;
 
 	default:
-		dev_err(component->dev, "DAI invert mode unsupported\n");
+		dev_err(component->dev, "DAI invert mode %d unsupported\n",
+			fmt & SND_SOC_DAIFMT_INV_MASK);
 		return -EINVAL;
 	}
 
@@ -391,6 +392,8 @@ static int max98396_dai_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
 		format |= MAX98396_PCM_FORMAT_TDM_MODE0;
 		break;
 	default:
+		dev_err(component->dev, "DAI format %d unsupported\n",
+			fmt & SND_SOC_DAIFMT_FORMAT_MASK);
 		return -EINVAL;
 	}
 
@@ -461,8 +464,9 @@ static int max98396_set_clock(struct snd_soc_component *component,
 		/* BCLK configuration */
 		value = max98396_get_bclk_sel(blr_clk_ratio);
 		if (!value) {
-			dev_err(component->dev, "format unsupported %d\n",
-				params_format(params));
+			dev_err(component->dev,
+				"blr_clk_ratio %d unsupported, format %d\n",
+				blr_clk_ratio, params_format(params));
 			return -EINVAL;
 		}
 
@@ -647,7 +651,7 @@ static int max98396_dai_tdm_slot(struct snd_soc_dai *dai,
 		chan_sz = MAX98396_PCM_MODE_CFG_CHANSZ_32;
 		break;
 	default:
-		dev_err(component->dev, "format unsupported %d\n",
+		dev_err(component->dev, "slot width %d unsupported\n",
 			slot_width);
 		return -EINVAL;
 	}
-- 
2.36.1


WARNING: multiple messages have this Message-ID (diff)
From: Daniel Mack <daniel@zonque.org>
To: broonie@kernel.org, ryan.lee.analog@gmail.com
Cc: robh+dt@kernel.org, alsa-devel@alsa-project.org,
	devicetree@vger.kernel.org, Daniel Mack <daniel@zonque.org>
Subject: [PATCH 5/8] ASoC: max98396: Improve some error prints
Date: Fri, 24 Jun 2022 12:47:09 +0200	[thread overview]
Message-ID: <20220624104712.1934484-6-daniel@zonque.org> (raw)
In-Reply-To: <20220624104712.1934484-1-daniel@zonque.org>

Let's log what actually failed and log at some more places.

Signed-off-by: Daniel Mack <daniel@zonque.org>
---
 sound/soc/codecs/max98396.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/max98396.c b/sound/soc/codecs/max98396.c
index 06ac637f2696..faa81b4bb709 100644
--- a/sound/soc/codecs/max98396.c
+++ b/sound/soc/codecs/max98396.c
@@ -372,7 +372,8 @@ static int max98396_dai_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
 		break;
 
 	default:
-		dev_err(component->dev, "DAI invert mode unsupported\n");
+		dev_err(component->dev, "DAI invert mode %d unsupported\n",
+			fmt & SND_SOC_DAIFMT_INV_MASK);
 		return -EINVAL;
 	}
 
@@ -391,6 +392,8 @@ static int max98396_dai_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
 		format |= MAX98396_PCM_FORMAT_TDM_MODE0;
 		break;
 	default:
+		dev_err(component->dev, "DAI format %d unsupported\n",
+			fmt & SND_SOC_DAIFMT_FORMAT_MASK);
 		return -EINVAL;
 	}
 
@@ -461,8 +464,9 @@ static int max98396_set_clock(struct snd_soc_component *component,
 		/* BCLK configuration */
 		value = max98396_get_bclk_sel(blr_clk_ratio);
 		if (!value) {
-			dev_err(component->dev, "format unsupported %d\n",
-				params_format(params));
+			dev_err(component->dev,
+				"blr_clk_ratio %d unsupported, format %d\n",
+				blr_clk_ratio, params_format(params));
 			return -EINVAL;
 		}
 
@@ -647,7 +651,7 @@ static int max98396_dai_tdm_slot(struct snd_soc_dai *dai,
 		chan_sz = MAX98396_PCM_MODE_CFG_CHANSZ_32;
 		break;
 	default:
-		dev_err(component->dev, "format unsupported %d\n",
+		dev_err(component->dev, "slot width %d unsupported\n",
 			slot_width);
 		return -EINVAL;
 	}
-- 
2.36.1


  parent reply	other threads:[~2022-06-24 10:49 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-24 10:47 [PATCH 0/8] ASoC: max98396: Some assorted fixes and additions Daniel Mack
2022-06-24 10:47 ` Daniel Mack
2022-06-24 10:47 ` [PATCH 1/8] ASoC: dt-bindings: max98396: add voltage supplies Daniel Mack
2022-06-24 10:47   ` Daniel Mack
2022-06-24 10:47 ` [PATCH 2/8] ASoC: dt-bindings: max98396: Add #sound-dai-cells Daniel Mack
2022-06-24 10:47   ` Daniel Mack
2022-06-24 17:26   ` Rob Herring
2022-06-24 17:26     ` Rob Herring
2022-06-24 10:47 ` [PATCH 3/8] ASoC: dt-bindings: max98396: Document adi,bypass-slot-no Daniel Mack
2022-06-24 10:47   ` Daniel Mack
2022-06-24 12:42   ` Mark Brown
2022-06-24 12:42     ` Mark Brown
2022-06-24 10:47 ` [PATCH 4/8] ASoC: max98396: add voltage regulators Daniel Mack
2022-06-24 10:47   ` Daniel Mack
2022-06-24 10:47 ` Daniel Mack [this message]
2022-06-24 10:47   ` [PATCH 5/8] ASoC: max98396: Improve some error prints Daniel Mack
2022-06-24 10:47 ` [PATCH 6/8] ASoC: max98396: Fix register access for PCM format settings Daniel Mack
2022-06-24 10:47   ` Daniel Mack
2022-06-24 12:52   ` Mark Brown
2022-06-24 12:52     ` Mark Brown
2022-06-24 10:47 ` [PATCH 7/8] ASoC: max98396: Implement DSP speaker monitor Daniel Mack
2022-06-24 10:47   ` Daniel Mack
2022-06-24 10:47 ` [PATCH 8/8] ASoC: max98396: Fix TDM mode BSEL settings Daniel Mack
2022-06-24 10:47   ` Daniel Mack
2022-06-24 11:34   ` Daniel Mack
2022-06-24 11:34     ` Daniel Mack
2022-06-24 12:54   ` Mark Brown
2022-06-24 12:54     ` Mark Brown
2022-06-27 20:19 ` (subset) [PATCH 0/8] ASoC: max98396: Some assorted fixes and additions Mark Brown
2022-06-27 20:19   ` Mark Brown
2022-06-27 20:26   ` Daniel Mack
2022-06-27 20:26     ` Daniel Mack
2022-06-27 22:23     ` Mark Brown
2022-06-27 22:23       ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220624104712.1934484-6-daniel@zonque.org \
    --to=daniel@zonque.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=ryan.lee.analog@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.