All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: broonie@kernel.org
Cc: nicoleotsuka@gmail.com, jean-michel.hautbois@vodalys.com,
	alsa-devel@alsa-project.org,
	Fabio Estevam <fabio.estevam@freescale.com>,
	shawn.guo@freescale.com
Subject: [PATCH] ASoC: sgtl5000: Allow the codec to work in slave mode
Date: Thu, 18 Sep 2014 20:17:25 -0300	[thread overview]
Message-ID: <1411082245-25679-1-git-send-email-festevam@gmail.com> (raw)

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

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

root@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@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

             reply	other threads:[~2014-09-18 23:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-18 23:17 Fabio Estevam [this message]
2014-09-23  1:54 ` [PATCH] ASoC: sgtl5000: Allow the codec to work in slave mode Mark Brown
2014-09-29 13:17   ` Fabio Estevam
2014-09-30 19:29     ` Mark Brown
2014-09-30 19:38       ` Michael Trimarchi
2014-10-01 18:27         ` Mark Brown
2014-10-01 18:44           ` Fabio Estevam
2014-10-02 17:58             ` Mark Brown
2014-10-02 18:54               ` Fabio Estevam

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=1411082245-25679-1-git-send-email-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=fabio.estevam@freescale.com \
    --cc=jean-michel.hautbois@vodalys.com \
    --cc=nicoleotsuka@gmail.com \
    --cc=shawn.guo@freescale.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.