Skip to contentSkip to conversation

ASoC: sgtl5000: Improve the error message on slave mode setting

PATCH Applied Fabio Estevam 2 participants 2 messages Oct 2, 2014 – Oct 3, 2014

Subsystems (3)
lore
Share & tools
lore

Fabio Estevam

author maintainer
#0 lore raw

PATCH 1/1 ASoC: sgtl5000: Improve the error message on slave mode setting

From: Fabio Estevam <[email protected]>

For sgtl5000 to operate in slave mode it can only work in "Synchronous SYS_MCLK input" mode.

In this mode only the following rates can be supported: 256*Fs, 384*Fs, 512*Fs.

Improve the error message to give a better indication as to why the clocking failed for slave mode:

[   12.515399] sgtl5000 1-000a: PLL not supported in slave mode
[   12.524124] sgtl5000 1-000a: 233 ratio is not supported. SYS_MCLK needs to be 256, 384 or 512 * fs
[   12.535938] sgtl5000 1-000a: ASoC: can't set sgtl5000 hw params: -22
---
 sound/soc/codecs/sgtl5000.c | 3 +++
 1 file changed, 3 insertions(+)
sound/soc/codecs/sgtl5000.c +3 -0
index a604a22..c1936bc 100644
@@ -626,6 +626,9 @@ static int sgtl5000_set_clock(struct snd_soc_codec *codec, int frame_rate)
 		} else {
 			dev_err(codec->dev,
 				"PLL not supported in slave mode\n");
+			dev_err(codec->dev, "%d ratio is not supported. "
+				"SYS_MCLK needs to be 256, 384 or 512 * fs\n",
+				sgtl5000->sysclk / sys_fs);
 			return -EINVAL;
 		}
 	}
Signature · 1 line
1.9.1
maintainer Applied
#1 lore raw
Quoted 4 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

For sgtl5000 to operate in slave mode it can only work in "Synchronous SYS_MCLK input" mode.

Applied, thanks.