{
struct snd_soc_dai *dai = rsnd_substream_to_dai(substream);
struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
+ struct rsnd_priv *priv = rsnd_dai_to_priv(dai);
struct rsnd_dai_stream *io = rsnd_rdai_to_io(rdai, substream);
+ unsigned long flags;
int ret;
+ rsnd_lock(priv, flags);
ret = rsnd_dai_call(hw_params, io, substream, hw_params);
+ rsnd_unlock(priv, flags);
+
if (ret)
return ret;
static int rsnd_pcm_new(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_dai *dai = rtd->cpu_dai;
+ struct rsnd_priv *priv = rsnd_dai_to_priv(dai);
struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
- int ret;
+ unsigned long flags;
+ int ret = 0;
- ret = rsnd_dai_call(pcm_new, &rdai->playback, rtd);
- if (ret)
- return ret;
+ rsnd_lock(priv, flags);
+ ret |= rsnd_dai_call(pcm_new, &rdai->playback, rtd);
+ ret |= rsnd_dai_call(pcm_new, &rdai->capture, rtd);
+ rsnd_unlock(priv, flags);
- ret = rsnd_dai_call(pcm_new, &rdai->capture, rtd);
if (ret)
return ret;
static int rsnd_rdai_continuance_probe(struct rsnd_priv *priv,
struct rsnd_dai_stream *io)
{
+ unsigned long flags;
int ret;
+ rsnd_lock(priv, flags);
+
ret = rsnd_dai_call(probe, io, priv);
if (ret == -EAGAIN) {
/*
*/
ret = rsnd_dai_call(probe, io, priv);
}
+ rsnd_unlock(priv, flags);
return ret;
}
struct rsnd_dai *rdai;
const struct of_device_id *of_id = of_match_device(rsnd_of_match, dev);
const struct rsnd_of_data *of_data;
+ unsigned long flags;
int (*probe_func[])(struct platform_device *pdev,
const struct rsnd_of_data *of_data,
struct rsnd_priv *priv) = {
exit_snd_soc:
snd_soc_unregister_platform(dev);
exit_snd_probe:
+ rsnd_lock(priv, flags);
for_each_rsnd_dai(rdai, priv, i) {
rsnd_dai_call(remove, &rdai->playback, priv);
rsnd_dai_call(remove, &rdai->capture, priv);
}
+ rsnd_unlock(priv, flags);
return ret;
}
{
struct rsnd_priv *priv = dev_get_drvdata(&pdev->dev);
struct rsnd_dai *rdai;
+ unsigned long flags;
void (*remove_func[])(struct platform_device *pdev,
struct rsnd_priv *priv) = {
rsnd_ssi_remove,
pm_runtime_disable(&pdev->dev);
+ rsnd_lock(priv, flags);
for_each_rsnd_dai(rdai, priv, i) {
ret |= rsnd_dai_call(remove, &rdai->playback, priv);
ret |= rsnd_dai_call(remove, &rdai->capture, priv);
}
+ rsnd_unlock(priv, flags);
for (i = 0; i < ARRAY_SIZE(remove_func); i++)
remove_func[i](pdev, priv);