From patchwork Wed Sep 12 11:47:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 1443021 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 31D3EE00A6 for ; Wed, 12 Sep 2012 11:48:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757360Ab2ILLsD (ORCPT ); Wed, 12 Sep 2012 07:48:03 -0400 Received: from na3sys009aob106.obsmtp.com ([74.125.149.76]:42663 "EHLO na3sys009aog106.obsmtp.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756101Ab2ILLrE (ORCPT ); Wed, 12 Sep 2012 07:47:04 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]) (using TLSv1) by na3sys009aob106.postini.com ([74.125.148.12]) with SMTP ID DSNKUFB2N/9DGOb1NPwxO7JpU+stdgDxFP0b@postini.com; Wed, 12 Sep 2012 04:47:04 PDT Received: by obbuo13 with SMTP id uo13so2442477obb.19 for ; Wed, 12 Sep 2012 04:47:02 -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=LntkK4K16EhuW9sBHIC3bIrIQWrvwe0374E4seO9u/c=; b=VSeCOOpntTDyATWdbAsNRHb1CTHCfulbEQvhIndVLVEFPgGOnhlJL9i+n781156i/n WaHGFfbufqJUI8+upKZVM7khgqE8otAU3DG4W+X4ytJK2j/6S2Yef9bsPHbJU2A7C3LK 9KAKuv3LfgoWYo5hUMu5RaWjxG4N7BEpbeFS22Qkt8i/BbFVBVIEnmzeAPxKbYQ5ZEnt U3/gZ65V6uzX32wt5CIYfefIAFZllaPC3+OXWdnbN3+fFbdYDjlLDH4Wt//boR0sutp8 uat67+wE/majkTjCHYXONIa+yapH/+JcVxuDhBOg73E6aV5qJjZzGJI4NRFP1YuJZ64T 5Ilg== Received: by 10.182.174.68 with SMTP id bq4mr21876924obc.53.1347450422759; Wed, 12 Sep 2012 04:47:02 -0700 (PDT) Received: from barack.emea.dhcp.ti.com (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id c6sm19835570obd.22.2012.09.12.04.46.59 (version=SSLv3 cipher=OTHER); Wed, 12 Sep 2012 04:47:02 -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 Subject: [PATCH 07/11] ASoC: omap-mcpdm: Use platform_get_resource_* to get resources Date: Wed, 12 Sep 2012 14:47:03 +0300 Message-Id: <1347450427-27627-8-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1347450427-27627-1-git-send-email-peter.ujfalusi@ti.com> References: <1347450427-27627-1-git-send-email-peter.ujfalusi@ti.com> X-Gm-Message-State: ALoCoQmjqavO1xYPqGlMKIphvt/DV1eGsHdhBNNI0KQIaBoY4whvZ5J4B0vfv6L6noSM2MZdS5p1 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 | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c index baf92da..36648e0 100644 --- a/sound/soc/omap/omap-mcpdm.c +++ b/sound/soc/omap/omap-mcpdm.c @@ -41,7 +41,6 @@ #include #include -#include #include "omap-mcpdm.h" #include "omap-pcm.h" @@ -71,15 +70,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 +447,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;