From patchwork Tue Mar 5 17:42:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 2220661 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 202803FCF2 for ; Tue, 5 Mar 2013 17:42:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753298Ab3CERmq (ORCPT ); Tue, 5 Mar 2013 12:42:46 -0500 Received: from moutng.kundenserver.de ([212.227.17.8]:59432 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757602Ab3CERmp (ORCPT ); Tue, 5 Mar 2013 12:42:45 -0500 Received: from wuerfel.lan (HSI-KBW-46-223-90-92.hsi.kabel-badenwuerttemberg.de [46.223.90.92]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0MfIF8-1URrCn0zQQ-00P8Dc; Tue, 05 Mar 2013 18:42:39 +0100 From: Arnd Bergmann To: Thomas Abraham Cc: Kukjin Kim , Tushar Behera , Deepak Saxena , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Olof Johansson , Arnd Bergmann Subject: [PATCH 19/23] ASoC: samsung: use irq resource for idma Date: Tue, 5 Mar 2013 18:42:29 +0100 Message-Id: <1362505353-8873-20-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1362505353-8873-1-git-send-email-arnd@arndb.de> References: <1362505353-8873-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:gYoumyV7pO3Uhd1KYXtyjE8j/JkpMZfJhs5A/EQ+DrH xhR1jqRyCVfK/UtMsDsaaR60l9LIcKRjUjmRDeUsnwHBhtU7dE G65JGBqYWkrN+FVgyFQfzF6hHRjO1BR3veYHUGmyRa5grnU9A9 3lUWgaQpgbPKldguaJbDLhdl1cCKgLudVYcgjyzWNKMqRQtz39 ifEVExFRDS0mXqs8PXlkypBHMW0+Pn9mJtaHXhEc48b7BcDDtX fmdTNDJWiIIHEZpe/jT33GmZY0ZcmWmhAhZchFr606NZ0aY/9/ YdgjL/aIB5E8h4F5Sb/s80F5BdwifhsVL9NJWE7DS3Bzv0X2oH VBknmzhPFDuYyFzM8kG7y2lSXmYT4X5eC1YhfPkl5 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org With multiplatform kernels, we cannot use hardwired IRQ numbers in device drivers. This changes the idma driver to use a proper resource, like all other drivers do. Signed-off-by: Arnd Bergmann --- arch/arm/plat-samsung/devs.c | 6 ++++++ sound/soc/samsung/idma.c | 10 ++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c index 58fb02a..ec912e4 100644 --- a/arch/arm/plat-samsung/devs.c +++ b/arch/arm/plat-samsung/devs.c @@ -146,14 +146,20 @@ struct platform_device s3c_device_camif = { /* ASOC DMA */ +#ifdef CONFIG_PLAT_S5P +static struct resource samsung_asoc_idma_resource = DEFINE_RES_IRQ(IRQ_I2S0); + struct platform_device samsung_asoc_idma = { .name = "samsung-idma", .id = -1, + .num_resources = 1, + .resource = &samsung_asoc_idma_resource, .dev = { .dma_mask = &samsung_device_dma_mask, .coherent_dma_mask = DMA_BIT_MASK(32), } }; +#endif /* FB */ diff --git a/sound/soc/samsung/idma.c b/sound/soc/samsung/idma.c index a07950b..f36a541 100644 --- a/sound/soc/samsung/idma.c +++ b/sound/soc/samsung/idma.c @@ -68,6 +68,8 @@ static struct idma_info { dma_addr_t lp_tx_addr; } idma; +static int idma_irq; + static void idma_getpos(dma_addr_t *src) { *src = idma.lp_tx_addr + @@ -305,7 +307,7 @@ static int idma_open(struct snd_pcm_substream *substream) if (prtd == NULL) return -ENOMEM; - ret = request_irq(IRQ_I2S0, iis_irq, 0, "i2s", prtd); + ret = request_irq(idma_irq, iis_irq, 0, "i2s", prtd); if (ret < 0) { pr_err("fail to claim i2s irq , ret = %d\n", ret); kfree(prtd); @@ -324,7 +326,7 @@ static int idma_close(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; struct idma_ctrl *prtd = runtime->private_data; - free_irq(IRQ_I2S0, prtd); + free_irq(idma_irq, prtd); if (!prtd) pr_err("idma_close called with prtd == NULL\n"); @@ -418,6 +420,10 @@ static struct snd_soc_platform_driver asoc_idma_platform = { static int asoc_idma_platform_probe(struct platform_device *pdev) { + idma_irq = platform_get_irq(pdev, 0); + if (idma_irq < 0) + return idma_irq; + return snd_soc_register_platform(&pdev->dev, &asoc_idma_platform); }