diff options
author | Peter Ujfalusi <peter.ujfalusi@nokia.com> | 2010-03-03 08:08:06 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-03-03 12:08:40 -0500 |
commit | 377b6f62effcb91c53cd7ff8709a94d72d23b6ae (patch) | |
tree | a94ff9e3bc7805aff6258f90414b87c24b511f2c /sound/soc | |
parent | 50831450503b828b3f8c031aa664340062afb3b0 (diff) |
ASoC: core: soc level wrapper for pcm_pointer callback
Create a soc level wrapper for pcm_pointer callback.
This will facilitate the soc level handling of different
HW buffers in the audio path.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/soc-core.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 7b4179eca893..feb572c616cd 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -800,6 +800,23 @@ static int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd) | |||
800 | return 0; | 800 | return 0; |
801 | } | 801 | } |
802 | 802 | ||
803 | /* | ||
804 | * soc level wrapper for pointer callback | ||
805 | */ | ||
806 | static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream) | ||
807 | { | ||
808 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
809 | struct snd_soc_device *socdev = rtd->socdev; | ||
810 | struct snd_soc_card *card = socdev->card; | ||
811 | struct snd_soc_platform *platform = card->platform; | ||
812 | snd_pcm_uframes_t offset = 0; | ||
813 | |||
814 | if (platform->pcm_ops->pointer) | ||
815 | offset = platform->pcm_ops->pointer(substream); | ||
816 | |||
817 | return offset; | ||
818 | } | ||
819 | |||
803 | /* ASoC PCM operations */ | 820 | /* ASoC PCM operations */ |
804 | static struct snd_pcm_ops soc_pcm_ops = { | 821 | static struct snd_pcm_ops soc_pcm_ops = { |
805 | .open = soc_pcm_open, | 822 | .open = soc_pcm_open, |
@@ -808,6 +825,7 @@ static struct snd_pcm_ops soc_pcm_ops = { | |||
808 | .hw_free = soc_pcm_hw_free, | 825 | .hw_free = soc_pcm_hw_free, |
809 | .prepare = soc_pcm_prepare, | 826 | .prepare = soc_pcm_prepare, |
810 | .trigger = soc_pcm_trigger, | 827 | .trigger = soc_pcm_trigger, |
828 | .pointer = soc_pcm_pointer, | ||
811 | }; | 829 | }; |
812 | 830 | ||
813 | #ifdef CONFIG_PM | 831 | #ifdef CONFIG_PM |
@@ -1328,7 +1346,6 @@ static int soc_new_pcm(struct snd_soc_device *socdev, | |||
1328 | dai_link->pcm = pcm; | 1346 | dai_link->pcm = pcm; |
1329 | pcm->private_data = rtd; | 1347 | pcm->private_data = rtd; |
1330 | soc_pcm_ops.mmap = platform->pcm_ops->mmap; | 1348 | soc_pcm_ops.mmap = platform->pcm_ops->mmap; |
1331 | soc_pcm_ops.pointer = platform->pcm_ops->pointer; | ||
1332 | soc_pcm_ops.ioctl = platform->pcm_ops->ioctl; | 1349 | soc_pcm_ops.ioctl = platform->pcm_ops->ioctl; |
1333 | soc_pcm_ops.copy = platform->pcm_ops->copy; | 1350 | soc_pcm_ops.copy = platform->pcm_ops->copy; |
1334 | soc_pcm_ops.silence = platform->pcm_ops->silence; | 1351 | soc_pcm_ops.silence = platform->pcm_ops->silence; |