From patchwork Thu Sep 13 13:38:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 1452261 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 13D2E3FE79 for ; Thu, 13 Sep 2012 13:40:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751510Ab2IMNk4 (ORCPT ); Thu, 13 Sep 2012 09:40:56 -0400 Received: from na3sys009aog123.obsmtp.com ([74.125.149.149]:40300 "EHLO na3sys009aog123.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755053Ab2IMNiQ (ORCPT ); Thu, 13 Sep 2012 09:38:16 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]) (using TLSv1) by na3sys009aob123.postini.com ([74.125.148.12]) with SMTP ID DSNKUFHhyOEPY9vtr0Xayq3eI2ZHmdAWJQ0o@postini.com; Thu, 13 Sep 2012 06:38:16 PDT Received: by obbuo13 with SMTP id uo13so4469515obb.19 for ; Thu, 13 Sep 2012 06:38: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=ib5It2W9Cr+PP5Trw5090ccPLa4irN63fNevm7JGQD9Y3qcfKEAhaOPvj248CrRQ0l e1Jf0QBlfdJJqR8qkj/+xyR7ElBN+yFTwCehsSxFZd9d7pSlD1jk8kd+7X3tKuDN7oZX GbXuHYYWwPFqZfvyLEN9obba1hKsVK8H2JMyKeH87AwNkasLOA+4vCtWH8E/uPuRtxvC yxjnyvcypNHZX91uDqHLlT8r5ikahrt/hvu9ABB8y5RMhheCx4m7Gkdn8qQ04+y/HnMa 4HOoNnPoZhdlc6HGa9fOVgeGI9KYmJWY4okzKJDsKhO0HhF9LHKMNRpegmRzHApm7Fgy 6lYA== Received: by 10.182.116.73 with SMTP id ju9mr2185103obb.95.1347543495708; Thu, 13 Sep 2012 06:38:15 -0700 (PDT) Received: from barack.emea.dhcp.ti.com (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id n8sm19403567oec.5.2012.09.13.06.38.12 (version=SSLv3 cipher=OTHER); Thu, 13 Sep 2012 06:38: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 v2 11/15] ASoC: omap-mcpdm: Use platform_get_resource_* to get resources Date: Thu, 13 Sep 2012 16:38:01 +0300 Message-Id: <1347543485-339-12-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1347543485-339-1-git-send-email-peter.ujfalusi@ti.com> References: <1347543485-339-1-git-send-email-peter.ujfalusi@ti.com> X-Gm-Message-State: ALoCoQkKyJtGlWZoBwHafNdXbKe2wZyF4OWzqUWdqP3nyX9VOlog/IrL9XCCCBFsYiw/SZItxa4c 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;