From patchwork Tue Dec 18 01:30:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Neri X-Patchwork-Id: 1889811 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 9EE553FCD5 for ; Tue, 18 Dec 2012 01:42:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753794Ab2LRBmv (ORCPT ); Mon, 17 Dec 2012 20:42:51 -0500 Received: from spamfilter.dextratech.com ([187.141.251.67]:42946 "EHLO mail.dextratech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753627Ab2LRBmu (ORCPT ); Mon, 17 Dec 2012 20:42:50 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.dextratech.com (Postfix) with ESMTP id 9788C85A00D; Mon, 17 Dec 2012 19:33:54 -0600 (CST) X-Virus-Scanned: amavisd-new at dextratech.com Received: from mail.dextratech.com ([127.0.0.1]) by localhost (mail.dextratech.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yzMAJj0fJptY; Mon, 17 Dec 2012 19:33:53 -0600 (CST) Received: from localhost (unknown [187.141.252.126]) by mail.dextratech.com (Postfix) with ESMTPSA id 6591F85A01A; Mon, 17 Dec 2012 19:33:52 -0600 (CST) From: Ricardo Neri To: tomi.valkeinen@ti.com, broonie@opensource.wolfsonmicro.com, lrg@ti.com, tony@atomide.com Cc: peter.ujfalusi@ti.com, dzuniga@dextratech.com, linux-omap@vger.kernel.org, alsa-devel@alsa-project.org, Ricardo Neri Subject: [PATCH v3 5/5] ARM: OMAP4+: HDMI: Refine the DMA port resource for audio Date: Mon, 17 Dec 2012 19:30:43 -0600 Message-Id: <1355794243-32345-6-git-send-email-rneri@dextratech.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1355794243-32345-1-git-send-email-rneri@dextratech.com> References: <1355794243-32345-1-git-send-email-rneri@dextratech.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Instead of passing the complete address space to the platform device for audio, just pass the address offset of the DMA port for audio samples. Thus, we prevent that two drivers try to ioremap the same resources. This is to be safe, as the ASoC HDMI CPU-DAI driver will not need to ioremap such resource. Signed-off-by: Ricardo Neri --- drivers/video/omap2/dss/hdmi.c | 9 ++++++--- sound/soc/omap/omap-hdmi.c | 3 +-- sound/soc/omap/omap-hdmi.h | 2 -- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index 0dde2b5..b758f83 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -829,6 +829,7 @@ static int hdmi_probe_audio(struct platform_device *pdev) { struct resource *res; struct platform_device *aud_pdev; + u32 port_offset, port_size; struct resource aud_res[2] = { DEFINE_RES_MEM(-1, -1), DEFINE_RES_DMA(-1), @@ -841,11 +842,13 @@ static int hdmi_probe_audio(struct platform_device *pdev) } /* - * Pass this resource to audio drivers to find the DMA port address. + * Pass DMA audio port to audio drivers. * Audio drivers should not ioremap it. */ - aud_res[0].start = res->start; - aud_res[0].end = res->end; + hdmi.ip_data.ops->audio_get_dma_port(&port_offset, &port_size); + + aud_res[0].start = res->start + port_offset; + aud_res[0].end = aud_res[0].start + port_size - 1; res = platform_get_resource(hdmi.pdev, IORESOURCE_DMA, 0); if (!res) { diff --git a/sound/soc/omap/omap-hdmi.c b/sound/soc/omap/omap-hdmi.c index db08501..33418fc 100644 --- a/sound/soc/omap/omap-hdmi.c +++ b/sound/soc/omap/omap-hdmi.c @@ -281,8 +281,7 @@ static __devinit int omap_hdmi_probe(struct platform_device *pdev) return -ENODEV; } - hdmi_data->dma_params.port_addr = hdmi_rsrc->start - + OMAP_HDMI_AUDIO_DMA_PORT; + hdmi_data->dma_params.port_addr = hdmi_rsrc->start; hdmi_rsrc = platform_get_resource(pdev, IORESOURCE_DMA, 0); if (!hdmi_rsrc) { diff --git a/sound/soc/omap/omap-hdmi.h b/sound/soc/omap/omap-hdmi.h index 6ad2bf4..33d7a93 100644 --- a/sound/soc/omap/omap-hdmi.h +++ b/sound/soc/omap/omap-hdmi.h @@ -25,8 +25,6 @@ #ifndef __OMAP_HDMI_H__ #define __OMAP_HDMI_H__ -#define OMAP_HDMI_AUDIO_DMA_PORT 0x8c - #define OMAP_HDMI_RATES (SNDRV_PCM_RATE_32000 | \ SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | \ SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | \