[alsa-devel] [PATCH] ASoC: sgtl5000: Allow the codec to work in slave mode

Fabio Estevam festevam at gmail.com
Fri Sep 19 01:17:25 CEST 2014


From: Fabio Estevam <fabio.estevam at freescale.com>

When configuring sgtl5000 to work in slave mode the following error is seen:

root at freescale /$ aplay dtmf_mono_16b_48000.wav 
[   11.406460] random: nonblocking pool is initialized
[   11.600461] sgtl5000 1-000a: PLL not supported in slave mode
[   11.609052] sgtl5000 1-000a: ASoC: can't set sgtl5000 hw params: -22
ALSA lib pcm_direct.c:980:(snd1_pcm_direct_initialize_slave) unable to install hw params
ALSA lib pcm_dmix.c:1030:(snd_pcm_dmix_open) unable to initialize slave
aplay: main:660: audio open error: Invalid argument

Do not error out when sgtl5000_set_clock() reaches the default path for slave 
mode.

While at it, fix a typo in the comment.

Tested on a imx53-qsb configured as ssi in master and sgtl5000 as slave.

Signed-off-by: Fabio Estevam <fabio.estevam at freescale.com>
---
 sound/soc/codecs/sgtl5000.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index a604a22..b641ed1 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -619,14 +619,10 @@ static int sgtl5000_set_clock(struct snd_soc_codec *codec, int frame_rate)
 			SGTL5000_MCLK_FREQ_SHIFT;
 		break;
 	default:
-		/* if mclk not satisify the divider, use pll */
+		/* if mclk not satisfy the divider, use pll */
 		if (sgtl5000->master) {
 			clk_ctl |= SGTL5000_MCLK_FREQ_PLL <<
 				SGTL5000_MCLK_FREQ_SHIFT;
-		} else {
-			dev_err(codec->dev,
-				"PLL not supported in slave mode\n");
-			return -EINVAL;
 		}
 	}
 
-- 
1.9.1



More information about the Alsa-devel mailing list