From patchwork Wed Mar 3 13:08:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 83328 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o23D8XUP018314 for ; Wed, 3 Mar 2010 13:08:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754057Ab0CCNIh (ORCPT ); Wed, 3 Mar 2010 08:08:37 -0500 Received: from smtp.nokia.com ([192.100.105.134]:32541 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753912Ab0CCNIf (ORCPT ); Wed, 3 Mar 2010 08:08:35 -0500 Received: from vaebh106.NOE.Nokia.com (vaebh106.europe.nokia.com [10.160.244.32]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o23D7i1c032366; Wed, 3 Mar 2010 07:08:25 -0600 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by vaebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 3 Mar 2010 15:08:14 +0200 Received: from mgw-sa01.ext.nokia.com ([147.243.1.47]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Wed, 3 Mar 2010 15:08:13 +0200 Received: from localhost.localdomain (cseresznye.nmp.nokia.com [172.22.211.20]) by mgw-sa01.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o23D87si031611; Wed, 3 Mar 2010 15:08:12 +0200 From: Peter Ujfalusi To: broonie@opensource.wolfsonmicro.com, tony@atomide.com Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org, lrg@slimlogic.co.uk, jhnikula@gmail.com, ext-eero.nurkkala@nokia.com Subject: [PATCHv2 2/5] ASoC: core: soc level wrapper for pcm_pointer callback Date: Wed, 3 Mar 2010 15:08:06 +0200 Message-Id: <1267621689-30337-4-git-send-email-peter.ujfalusi@nokia.com> X-Mailer: git-send-email 1.7.0 In-Reply-To: <1267621689-30337-1-git-send-email-peter.ujfalusi@nokia.com> References: <1267621689-30337-1-git-send-email-peter.ujfalusi@nokia.com> X-OriginalArrivalTime: 03 Mar 2010 13:08:14.0031 (UTC) FILETIME=[95112DF0:01CABAD2] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 03 Mar 2010 13:08:39 +0000 (UTC) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 37c872e..de5223d 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -797,6 +797,23 @@ static int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd) return 0; } +/* + * soc level wrapper for pointer callback + */ +static snd_pcm_uframes_t soc_pcm_pointer(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_device *socdev = rtd->socdev; + struct snd_soc_card *card = socdev->card; + struct snd_soc_platform *platform = card->platform; + snd_pcm_uframes_t offset = 0; + + if (platform->pcm_ops->pointer) + offset = platform->pcm_ops->pointer(substream); + + return offset; +} + /* ASoC PCM operations */ static struct snd_pcm_ops soc_pcm_ops = { .open = soc_pcm_open, @@ -805,6 +822,7 @@ static struct snd_pcm_ops soc_pcm_ops = { .hw_free = soc_pcm_hw_free, .prepare = soc_pcm_prepare, .trigger = soc_pcm_trigger, + .pointer = soc_pcm_pointer, }; #ifdef CONFIG_PM @@ -1331,7 +1349,6 @@ static int soc_new_pcm(struct snd_soc_device *socdev, dai_link->pcm = pcm; pcm->private_data = rtd; soc_pcm_ops.mmap = platform->pcm_ops->mmap; - soc_pcm_ops.pointer = platform->pcm_ops->pointer; soc_pcm_ops.ioctl = platform->pcm_ops->ioctl; soc_pcm_ops.copy = platform->pcm_ops->copy; soc_pcm_ops.silence = platform->pcm_ops->silence;