aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiam Girdwood <lrg@ti.com>2011-07-24 15:59:45 -0400
committerPaolo Pisati <paolo.pisati@canonical.com>2012-08-17 04:18:26 -0400
commit454d4af6d3bce2f44b7ac4261c9bee5d0ee52623 (patch)
tree24cd2a7edf6d0e506fa21c3eb95dfcd0bbe10d64
parent3132dd2e3ffe4fda05465793df57187fc47c5b16 (diff)
Subject: [PATCH 078/104] ASoC: dsp - add core support for bespoke trigger()
This allows the DSP core to call a beskope trigger() call on DAIs and platforms that require it. TODO: move into DSP patch series. Signed-off-by: Liam Girdwood <lrg@ti.com>
-rw-r--r--include/sound/soc-dai.h2
-rw-r--r--include/sound/soc.h2
-rw-r--r--sound/soc/soc-pcm.c28
3 files changed, 32 insertions, 0 deletions
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index f298f67b954..bda171e8d6d 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -172,6 +172,8 @@ struct snd_soc_dai_ops {
172 struct snd_soc_dai *); 172 struct snd_soc_dai *);
173 int (*trigger)(struct snd_pcm_substream *, int, 173 int (*trigger)(struct snd_pcm_substream *, int,
174 struct snd_soc_dai *); 174 struct snd_soc_dai *);
175 int (*bespoke_trigger)(struct snd_pcm_substream *, int,
176 struct snd_soc_dai *);
175 /* 177 /*
176 * For hardware based FIFO caused delay reporting. 178 * For hardware based FIFO caused delay reporting.
177 * Optional. 179 * Optional.
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 5f3a7e7dba5..f4aadfc7509 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -689,6 +689,8 @@ struct snd_soc_platform_driver {
689 /* platform IO - used for platform DAPM */ 689 /* platform IO - used for platform DAPM */
690 unsigned int (*read)(struct snd_soc_platform *, unsigned int); 690 unsigned int (*read)(struct snd_soc_platform *, unsigned int);
691 int (*write)(struct snd_soc_platform *, unsigned int, unsigned int); 691 int (*write)(struct snd_soc_platform *, unsigned int, unsigned int);
692
693 int (*bespoke_trigger)(struct snd_pcm_substream *, int);
692}; 694};
693 695
694struct snd_soc_platform { 696struct snd_soc_platform {
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index b42b607bf47..dcb2fbc159e 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -579,6 +579,34 @@ static int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
579 return 0; 579 return 0;
580} 580}
581 581
582int soc_pcm_bespoke_trigger(struct snd_pcm_substream *substream, int cmd)
583{
584 struct snd_soc_pcm_runtime *rtd = substream->private_data;
585 struct snd_soc_platform *platform = rtd->platform;
586 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
587 struct snd_soc_dai *codec_dai = rtd->codec_dai;
588 int ret;
589
590 if (codec_dai->driver->ops->bespoke_trigger) {
591 ret = codec_dai->driver->ops->bespoke_trigger(substream, cmd, codec_dai);
592 if (ret < 0)
593 return ret;
594 }
595
596 if (platform->driver->bespoke_trigger) {
597 ret = platform->driver->bespoke_trigger(substream, cmd);
598 if (ret < 0)
599 return ret;
600 }
601
602 if (cpu_dai->driver->ops->bespoke_trigger) {
603 ret = cpu_dai->driver->ops->bespoke_trigger(substream, cmd, cpu_dai);
604 if (ret < 0)
605 return ret;
606 }
607 return 0;
608}
609
582/* 610/*
583 * soc level wrapper for pointer callback 611 * soc level wrapper for pointer callback
584 * If cpu_dai, codec_dai, platform driver has the delay callback, than 612 * If cpu_dai, codec_dai, platform driver has the delay callback, than