[alsa-devel] [PATCH 2/4] ASoC: pxa-ssp: PXA2xx/3xx SSP ports start from 1, not 0

pHilipp Zabel philipp.zabel at gmail.com
Tue Feb 3 19:49:43 CET 2009


On Tue, Feb 3, 2009 at 6:35 PM, Mark Brown <broonie at sirena.org.uk> wrote:
> On Tue, Feb 03, 2009 at 06:13:22PM +0100, pHilipp Zabel wrote:
>
>> -       priv->dev.ssp = ssp_request(dai->id, "SoC audio");
>> +       priv->dev.ssp = ssp_request(dai->id + 1, "SoC audio");
>>         if (priv->dev.ssp == NULL) {
>>                 ret = -ENODEV;
>>                 goto err_priv;
>
>> But this isn't right either. Because if we request the correct SSP
>> port here, the subsequent request of the same SSP port in ssp_init
>> (called from ops->startup) fails.
>> How to fix?
>
> Hrm.  ssp_init() does a ssp_request() already.  The request on probe is
> just redundant.  Eric was muttering about refactoring the API some more
> but never got round to it.

Hm, hm.. Ripping ssp_init/exit's innards out of them (minus the
ssp/irq_request parts), like this, seems to work:

--------------------------- sound/soc/pxa/pxa-ssp.c ---------------------------
index 1687e18..c56a07c 100644
@@ -21,6 +21,8 @@
 #include <linux/clk.h>
 #include <linux/io.h>

+#include <asm/irq.h>
+
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/initval.h>
@@ -221,9 +223,9 @@ static int pxa_ssp_startup(struct
snd_pcm_substream *substream,
 	int ret = 0;

 	if (!cpu_dai->active) {
-		ret = ssp_init(&priv->dev, cpu_dai->id + 1, SSP_NO_IRQ);
-		if (ret < 0)
-			return ret;
+		priv->dev.port = cpu_dai->id + 1;
+		priv->dev.irq = NO_IRQ;
+		clk_enable(priv->dev.ssp->clk);
 		ssp_disable(&priv->dev);
 	}
 	return ret;
@@ -238,7 +240,7 @@ static void pxa_ssp_shutdown(struct
snd_pcm_substream *substream,

 	if (!cpu_dai->active) {
 		ssp_disable(&priv->dev);
-		ssp_exit(&priv->dev);
+		clk_disable(priv->dev.ssp->clk);
 	}
 }


More information about the Alsa-devel mailing list