From patchwork Fri Sep 14 12:05:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 1457981 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 4ACA2DF280 for ; Fri, 14 Sep 2012 12:08:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759507Ab2INMH5 (ORCPT ); Fri, 14 Sep 2012 08:07:57 -0400 Received: from na3sys009aog104.obsmtp.com ([74.125.149.73]:59181 "EHLO na3sys009aog104.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759598Ab2INMGR (ORCPT ); Fri, 14 Sep 2012 08:06:17 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]) (using TLSv1) by na3sys009aob104.postini.com ([74.125.148.12]) with SMTP ID DSNKUFMduIclH9jkUONdLX8fsbhrGP+3w6uN@postini.com; Fri, 14 Sep 2012 05:06:17 PDT Received: by obbuo13 with SMTP id uo13so6097738obb.19 for ; Fri, 14 Sep 2012 05:06:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=nFfSK32PD9wjeBvQnBb5QL3aEVbKa3eCr3vmlF0GYCw=; b=JlBi22keHPC6aKMbzm1k/6vUwz/L7POui82fI6CKNOgxW6w6AftFA7VXguyOuX9bRE OHh/b82fKopaVOuAw6quja9dn+xp/6TCB10zmFfLUsyYvYGs3xzpojn2omhXXJM0pCpA QuuXFk0kQxXWh4Oleb5dfkDLyZwg82wk1M1dSbH4JvNHtkD924+E6OHE/3vZ2FHs8eyw nsbpf7cgYq07IpGjicXfzsHl2+NKfzH+RJBiK0M3d7fpvk6E8YysU9O6w/5b2Ycgs1o+ 1bDA41JH2ILh11CYiA8FhFj43CQRW0Cnuwr7G+pM91PIzUY4pZ5X0P9cv+5/8rPbcypI T/0A== Received: by 10.60.10.225 with SMTP id l1mr2778624oeb.28.1347624375730; Fri, 14 Sep 2012 05:06:15 -0700 (PDT) Received: from barack.emea.dhcp.ti.com (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id ac10sm1615600obc.7.2012.09.14.05.06.12 (version=SSLv3 cipher=OTHER); Fri, 14 Sep 2012 05:06:15 -0700 (PDT) From: Peter Ujfalusi To: Mark Brown , Liam Girdwood , Tony Lindgren , Russell King , Vinod Koul , Dan Williams , Jarkko Nikula Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Janusz Krzysztofik , Ricardo Neri , Lars-Peter Clausen Subject: [PATCH v3 11/15] ASoC: omap-mcpdm: Use platform_get_resource_* to get resources Date: Fri, 14 Sep 2012 15:05:54 +0300 Message-Id: <1347624358-25582-12-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1347624358-25582-1-git-send-email-peter.ujfalusi@ti.com> References: <1347624358-25582-1-git-send-email-peter.ujfalusi@ti.com> X-Gm-Message-State: ALoCoQksJSQfYRg/8qwLFmfsDrkcpEzPqj2YeD0TnxegS319WXP9zMNnJ0cbcVVxz9Njmm6ahbYC Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Get the needed resources in a correct way and avoid using defines for them. Signed-off-by: Peter Ujfalusi --- sound/soc/omap/omap-mcpdm.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c index baf92da..f90d5de 100644 --- a/sound/soc/omap/omap-mcpdm.c +++ b/sound/soc/omap/omap-mcpdm.c @@ -71,15 +71,11 @@ struct omap_mcpdm { static struct omap_pcm_dma_data omap_mcpdm_dai_dma_params[] = { { .name = "Audio playback", - .dma_req = OMAP44XX_DMA_MCPDM_DL, .data_type = OMAP_DMA_DATA_TYPE_S32, - .port_addr = OMAP44XX_MCPDM_L3_BASE + MCPDM_REG_DN_DATA, }, { .name = "Audio capture", - .dma_req = OMAP44XX_DMA_MCPDM_UP, .data_type = OMAP_DMA_DATA_TYPE_S32, - .port_addr = OMAP44XX_MCPDM_L3_BASE + MCPDM_REG_UP_DATA, }, }; @@ -452,10 +448,33 @@ static __devinit int asoc_mcpdm_probe(struct platform_device *pdev) mutex_init(&mcpdm->mutex); + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dma"); + if (res == NULL) + return -ENOMEM; + + omap_mcpdm_dai_dma_params[0].port_addr = res->start + MCPDM_REG_DN_DATA; + omap_mcpdm_dai_dma_params[1].port_addr = res->start + MCPDM_REG_UP_DATA; + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (res == NULL) return -ENOMEM; + res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "dn_link"); + if (!res) + return -ENODEV; + + omap_mcpdm_dai_dma_params[0].dma_req = res->start; + + res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "up_link"); + if (!res) + return -ENODEV; + + omap_mcpdm_dai_dma_params[1].dma_req = res->start; + + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu"); + if (res == NULL) + return -ENOMEM; + if (!devm_request_mem_region(&pdev->dev, res->start, resource_size(res), "McPDM")) return -EBUSY;