From patchwork Fri Nov 23 06:14:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bo Shen X-Patchwork-Id: 1793831 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 24FE03FCAE for ; Fri, 23 Nov 2012 06:22:09 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tbmbh-0007Ht-Im; Fri, 23 Nov 2012 06:19:21 +0000 Received: from newsmtp5.atmel.com ([204.2.163.5] helo=sjogate2.atmel.com) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TbmbR-0007GL-Ek for linux-arm-kernel@lists.infradead.org; Fri, 23 Nov 2012 06:19:09 +0000 Received: from shaarm01.corp.atmel.com ([10.217.6.34]) by sjogate2.atmel.com (8.13.6/8.13.6) with ESMTP id qAN6CYUM012858; Thu, 22 Nov 2012 22:13:15 -0800 (PST) From: Bo Shen To: broonie@opensource.wolfsonmicro.com, plagnioj@jcrosoft.com, nicolas.ferre@atmel.com Subject: [PATCH 1/3] ASoC: snd_dmaengine_pcm: add inline empty function Date: Fri, 23 Nov 2012 14:14:15 +0800 Message-Id: <1353651257-2476-2-git-send-email-voice.shen@atmel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1353651257-2476-1-git-send-email-voice.shen@atmel.com> References: <1353651257-2476-1-git-send-email-voice.shen@atmel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121123_011905_835580_9071F5AC X-CRM114-Status: UNSURE ( 9.70 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Bo Shen , devicetree-discuss@lists.ozlabs.org, alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org As to atmel pcm driver support pdc and dma for audio transfer, which will be used for audio transfer depends on the ssc capability. If without these inline empty functions, when compile the driver, it will give out following information. So, add these inline empty functions. ---<8--- sound/built-in.o: In function `atmel_pcm_hw_free': last.c:(.text+0x20a84): undefined reference to `snd_dmaengine_pcm_get_data' sound/built-in.o: In function `atmel_pcm_dma_prepare': last.c:(.text+0x20adc): undefined reference to `snd_dmaengine_pcm_get_data' sound/built-in.o: In function `atmel_pcm_hw_params': last.c:(.text+0x20c1c): undefined reference to `snd_dmaengine_pcm_open' last.c:(.text+0x20c40): undefined reference to `snd_dmaengine_pcm_set_data' last.c:(.text+0x20c50): undefined reference to `snd_hwparams_to_dma_slave_config' last.c:(.text+0x20ca0): undefined reference to `snd_dmaengine_pcm_get_chan' last.c:(.text+0x20cd0): undefined reference to `snd_dmaengine_pcm_close' last.c:(.text+0x20d00): undefined reference to `snd_dmaengine_pcm_get_chan' sound/built-in.o: In function `atmel_pcm_dma_irq': last.c:(.text+0x20ec0): undefined reference to `snd_dmaengine_pcm_get_data' sound/built-in.o: In function `atmel_pcm_close': last.c:(.text+0x20f90): undefined reference to `snd_dmaengine_pcm_get_data' last.c:(.text+0x20f9c): undefined reference to `snd_dmaengine_pcm_close' sound/built-in.o: In function `atmel_pcm_platform_register': last.c:(.text+0x21078): undefined reference to `snd_dmaengine_pcm_trigger' last.c:(.text+0x2107c): undefined reference to `snd_dmaengine_pcm_pointer_no_residue' make: *** [vmlinux] Error 1 --->8--- Signed-off-by: Bo Shen --- include/sound/dmaengine_pcm.h | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h index b877334..58241e9 100644 --- a/include/sound/dmaengine_pcm.h +++ b/include/sound/dmaengine_pcm.h @@ -32,6 +32,7 @@ snd_pcm_substream_to_dma_direction(const struct snd_pcm_substream *substream) return DMA_DEV_TO_MEM; } +#ifdef CONFIG_SND_SOC_DMAENGINE_PCM void snd_dmaengine_pcm_set_data(struct snd_pcm_substream *substream, void *data); void *snd_dmaengine_pcm_get_data(struct snd_pcm_substream *substream); @@ -46,5 +47,57 @@ int snd_dmaengine_pcm_open(struct snd_pcm_substream *substream, int snd_dmaengine_pcm_close(struct snd_pcm_substream *substream); struct dma_chan *snd_dmaengine_pcm_get_chan(struct snd_pcm_substream *substream); +#else +static inline void +snd_dmaengine_pcm_set_data(struct snd_pcm_substream *substream, void *data) +{ +} +static inline void +*snd_dmaengine_pcm_get_data(struct snd_pcm_substream *substream) +{ + return NULL; +} + +static inline int +snd_hwparams_to_dma_slave_config(const struct snd_pcm_substream *substream, + const struct snd_pcm_hw_params *params, + struct dma_slave_config *slave_config) +{ + return 0; +} +static inline int +snd_dmaengine_pcm_trigger(struct snd_pcm_substream *substream, int cmd) +{ + return 0; +} +static inline snd_pcm_uframes_t +snd_dmaengine_pcm_pointer(struct snd_pcm_substream *substream) +{ + return 0; +} +static inline snd_pcm_uframes_t +snd_dmaengine_pcm_pointer_no_residue(struct snd_pcm_substream *substream) +{ + return 0; +} + +static inline int +snd_dmaengine_pcm_open(struct snd_pcm_substream *substream, + dma_filter_fn filter_fn, void *filter_data) +{ + return 0; +} +static inline int +snd_dmaengine_pcm_close(struct snd_pcm_substream *substream) +{ + return 0; +} + +static inline struct dma_chan +*snd_dmaengine_pcm_get_chan(struct snd_pcm_substream *substream) +{ + return NULL; +} +#endif #endif