linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 2/2] ASoC: kirkwood: fix loss of external clock at probe time
@ 2013-10-18 18:35 Jean-Francois Moine
  2013-10-18 19:12 ` Uwe Kleine-König
  2013-10-20 16:38 ` Mark Brown
  0 siblings, 2 replies; 7+ messages in thread
From: Jean-Francois Moine @ 2013-10-18 18:35 UTC (permalink / raw)
  To: linux-arm-kernel

At probe time, when the clock driver is not yet initialized, the
external clock of the kirkwood sound device will not be usable.

This patch fixes this problem defering the device probe.

It also removes the test about same internal and external clocks which
can never occur.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
---
v3: remove the test of same internal and external clocks

The associated patch:
[PATCH v3 1/2] ASoC: kirkwood: clk: probe defer when clock not yet ready
is unchanged and not resent
---
 sound/soc/kirkwood/kirkwood-i2s.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c
index 8ac89f5..2bbbab5 100644
--- a/sound/soc/kirkwood/kirkwood-i2s.c
+++ b/sound/soc/kirkwood/kirkwood-i2s.c
@@ -496,15 +496,13 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
 		return err;
 
 	priv->extclk = devm_clk_get(&pdev->dev, "extclk");
-	if (!IS_ERR(priv->extclk)) {
-		if (priv->extclk == priv->clk) {
-			devm_clk_put(&pdev->dev, priv->extclk);
-			priv->extclk = ERR_PTR(-EINVAL);
-		} else {
-			dev_info(&pdev->dev, "found external clock\n");
-			clk_prepare_enable(priv->extclk);
-			soc_dai = &kirkwood_i2s_dai_extclk;
-		}
+	if (IS_ERR(priv->extclk)) {
+		if (PTR_ERR(priv->extclk) == -EPROBE_DEFER)
+			return -EPROBE_DEFER;
+	} else {
+		dev_info(&pdev->dev, "found external clock\n");
+		clk_prepare_enable(priv->extclk);
+		soc_dai = kirkwood_i2s_dai_extclk;
 	}
 
 	/* Some sensible defaults - this reflects the powerup values */


-- 
Ken ar c'henta?	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-10-21  7:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-18 18:35 [PATCH v3 2/2] ASoC: kirkwood: fix loss of external clock at probe time Jean-Francois Moine
2013-10-18 19:12 ` Uwe Kleine-König
2013-10-19  8:28   ` Jean-Francois Moine
2013-10-20  8:03     ` Uwe Kleine-König
2013-10-20 16:33       ` Mark Brown
2013-10-20 16:38 ` Mark Brown
2013-10-21  7:24   ` Jean-Francois Moine

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).