[PATCH v3 08/11] ASoC: fsl: make fsl_ssi driver compilable on ARM/IMX

Tabi Timur-B04825 B04825 at freescale.com
Thu Mar 8 21:09:57 EST 2012


Shawn Guo wrote:

> Something like this:
>
> @@ -496,6 +494,10 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
>          struct snd_soc_pcm_runtime *rtd = substream->private_data;
>          struct fsl_ssi_private *ssi_private = snd_soc_dai_get_drvdata(rtd->cpu_dai);
>          struct ccsr_ssi __iomem *ssi = ssi_private->ssi;
> +       unsigned long flags;
> +       int ret = 0;
> +
> +       spin_lock_irqsave(&ssi_lock, flags);
>
>          switch (cmd) {
>          case SNDRV_PCM_TRIGGER_START:
> @@ -517,10 +519,12 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
>                  break;
>
>          default:
> -               return -EINVAL;
> +               ret = -EINVAL;
>          }
>
> -       return 0;
> +       spin_unlock_irqrestore(&ssi_lock, flags);
> +
> +       return ret;
>   }

That's the general idea, but I think it needs more study.  I don't 
consider this to be a bug that needs to be fixed ASAP, since it's never 
been an actual problem so far.  For instance, do we need to protect 
between hw_params and _trigger?

-- 
Timur Tabi
Linux kernel developer at Freescale



More information about the linux-arm-kernel mailing list