From patchwork Tue May 26 13:26:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 6480531 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DAACE9F1C1 for ; Tue, 26 May 2015 13:28:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0CEE920620 for ; Tue, 26 May 2015 13:28:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 12D982038E for ; Tue, 26 May 2015 13:28:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932174AbbEZN13 (ORCPT ); Tue, 26 May 2015 09:27:29 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:45254 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754578AbbEZN1X (ORCPT ); Tue, 26 May 2015 09:27:23 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id t4QDR7k9001681; Tue, 26 May 2015 08:27:07 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t4QDR7nN023222; Tue, 26 May 2015 08:27:07 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.224.2; Tue, 26 May 2015 08:27:07 -0500 Received: from dflp33.itg.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t4QDQ9bX027427; Tue, 26 May 2015 08:27:03 -0500 From: Peter Ujfalusi To: , CC: , , , , , , , , , , , Mark Brown , Jarkko Nikula , Liam Girdwood Subject: [PATCH 13/13] ASoC: omap-pcm: Switch to use dma_request_slave_channel_compat_reason() Date: Tue, 26 May 2015 16:26:08 +0300 Message-ID: <1432646768-12532-14-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.3.5 In-Reply-To: <1432646768-12532-1-git-send-email-peter.ujfalusi@ti.com> References: <1432646768-12532-1-git-send-email-peter.ujfalusi@ti.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP dmaengine provides a wrapper function to handle DT and non DT boots when requesting DMA channel. Use that instead of checking for of_node in the platform driver. Signed-off-by: Peter Ujfalusi CC: Mark Brown CC: Jarkko Nikula CC: Liam Girdwood Acked-by: Mark Brown --- sound/soc/omap/omap-pcm.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c index 52fd7cbbd1f4..ae04834f4697 100644 --- a/sound/soc/omap/omap-pcm.c +++ b/sound/soc/omap/omap-pcm.c @@ -132,6 +132,7 @@ static int omap_pcm_open(struct snd_pcm_substream *substream) struct snd_dmaengine_dai_dma_data *dma_data; struct dma_slave_caps dma_caps; struct dma_chan *chan; + dma_cap_mask_t mask; u32 addr_widths = BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); @@ -139,12 +140,15 @@ static int omap_pcm_open(struct snd_pcm_substream *substream) dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); - if (rtd->cpu_dai->dev->of_node) - chan = dma_request_slave_channel(rtd->cpu_dai->dev, - dma_data->filter_data); - else - chan = snd_dmaengine_pcm_request_channel(omap_dma_filter_fn, - dma_data->filter_data); + dma_cap_zero(mask); + dma_cap_set(DMA_SLAVE, mask); + dma_cap_set(DMA_CYCLIC, mask); + chan = dma_request_slave_channel_compat_reason(mask, omap_dma_filter_fn, + dma_data->filter_data, rtd->cpu_dai->dev, + dma_data->filter_data); + + if (IS_ERR(chan)) + return PTR_ERR(chan); if (!dma_get_slave_caps(chan, &dma_caps)) { if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)