From patchwork Thu Sep 6 19:42:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1417501 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id D8B753FC85 for ; Thu, 6 Sep 2012 19:46:34 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T9hyz-0001Ya-7q; Thu, 06 Sep 2012 19:43:21 +0000 Received: from mail-ob0-f177.google.com ([209.85.214.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T9hyd-0001Vs-Tl for linux-arm-kernel@lists.infradead.org; Thu, 06 Sep 2012 19:43:01 +0000 Received: by mail-ob0-f177.google.com with SMTP id ta17so3313757obb.36 for ; Thu, 06 Sep 2012 12:42:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=clSok7/ZRt/O8cpqcRUR59sUBbCw64uWl6lQ0zVxrus=; b=VyMB3xRgUBPnJdTmPQ1wqcX6aHuHzoieY8U32lhqKERL7twnX/Sz1szTxt5MXoT9Dw L53Ked8aEpWcMxKg7koxCJdQn7K7bbvPBvKWX5tKTa5834ic4C+HcmkXilNFlZThzN4K SW8VBxsjUkfRH/T3mV29+G031C96ol9qRfK3XGHMj8UPE97j4+7NVEvLpLtEAxVIp1T8 RFAeBypaP0WOvSEKiIN3vLqceqAMHorkGMpdyg3h4081cDLfXSKCg3by58VLe3Rs7u44 w5DFR3rFD04Q5il8dfitXRff+zt8FntMS3zAUpKmYZs0XQhnml4aR5aohrCWxyPk/zOq t/Ng== Received: by 10.182.89.66 with SMTP id bm2mr3571972obb.87.1346960579729; Thu, 06 Sep 2012 12:42:59 -0700 (PDT) Received: from rob-laptop.calxeda.com ([173.226.190.126]) by mx.google.com with ESMTPS id th3sm2754774obb.6.2012.09.06.12.42.56 (version=SSLv3 cipher=OTHER); Thu, 06 Sep 2012 12:42:58 -0700 (PDT) From: Rob Herring To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 2/6] net: pxaficp_ir: add irq resources Date: Thu, 6 Sep 2012 14:42:39 -0500 Message-Id: <1346960563-18689-3-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1346960563-18689-1-git-send-email-robherring2@gmail.com> References: <1346960563-18689-1-git-send-email-robherring2@gmail.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.214.177 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (robherring2[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (robherring2[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Samuel Ortiz , Russell King , Arnd Bergmann , netdev@vger.kernel.org, Linus Walleij , Rob Herring , Haojian Zhuang , Olof Johansson , Eric Miao X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Rob Herring In order to remove dependency on mach/irqs.h, add platform device resources for irqs. Signed-off-by: Rob Herring Cc: Samuel Ortiz Cc: Eric Miao Cc: Haojian Zhuang Cc: netdev@vger.kernel.org Acked-by: David S. Miller Acked-by: Eric Miao --- arch/arm/mach-pxa/devices.c | 15 +++++++++++++++ drivers/net/irda/pxaficp_ir.c | 28 +++++++++++++++++----------- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c index 166eee5..339eb2a 100644 --- a/arch/arm/mach-pxa/devices.c +++ b/arch/arm/mach-pxa/devices.c @@ -384,9 +384,24 @@ struct platform_device pxa_device_asoc_platform = { static u64 pxaficp_dmamask = ~(u32)0; +static struct resource pxa_ir_resources[] = { + [0] = { + .start = IRQ_STUART, + .end = IRQ_STUART, + .flags = IORESOURCE_IRQ, + }, + [1] = { + .start = IRQ_ICP, + .end = IRQ_ICP, + .flags = IORESOURCE_IRQ, + }, +}; + struct platform_device pxa_device_ficp = { .name = "pxa2xx-ir", .id = -1, + .num_resources = ARRAY_SIZE(pxa_ir_resources), + .resource = pxa_ir_resources, .dev = { .dma_mask = &pxaficp_dmamask, .coherent_dma_mask = 0xffffffff, diff --git a/drivers/net/irda/pxaficp_ir.c b/drivers/net/irda/pxaficp_ir.c index 8d54767..cb0a5d3 100644 --- a/drivers/net/irda/pxaficp_ir.c +++ b/drivers/net/irda/pxaficp_ir.c @@ -29,8 +29,8 @@ #include #include -#include #include +#include #define FICP __REG(0x40800000) /* Start of FICP area */ #define ICCR0 __REG(0x40800000) /* ICP Control Register 0 */ @@ -112,6 +112,9 @@ struct pxa_irda { int txdma; int rxdma; + int uart_irq; + int icp_irq; + struct irlap_cb *irlap; struct qos_info qos; @@ -672,19 +675,19 @@ static int pxa_irda_start(struct net_device *dev) si->speed = 9600; - err = request_irq(IRQ_STUART, pxa_irda_sir_irq, 0, dev->name, dev); + err = request_irq(si->uart_irq, pxa_irda_sir_irq, 0, dev->name, dev); if (err) goto err_irq1; - err = request_irq(IRQ_ICP, pxa_irda_fir_irq, 0, dev->name, dev); + err = request_irq(si->icp_irq, pxa_irda_fir_irq, 0, dev->name, dev); if (err) goto err_irq2; /* * The interrupt must remain disabled for now. */ - disable_irq(IRQ_STUART); - disable_irq(IRQ_ICP); + disable_irq(si->uart_irq); + disable_irq(si->icp_irq); err = -EBUSY; si->rxdma = pxa_request_dma("FICP_RX",DMA_PRIO_LOW, pxa_irda_fir_dma_rx_irq, dev); @@ -720,8 +723,8 @@ static int pxa_irda_start(struct net_device *dev) /* * Now enable the interrupt and start the queue */ - enable_irq(IRQ_STUART); - enable_irq(IRQ_ICP); + enable_irq(si->uart_irq); + enable_irq(si->icp_irq); netif_start_queue(dev); printk(KERN_DEBUG "pxa_ir: irda driver opened\n"); @@ -738,9 +741,9 @@ err_dma_rx_buff: err_tx_dma: pxa_free_dma(si->rxdma); err_rx_dma: - free_irq(IRQ_ICP, dev); + free_irq(si->icp_irq, dev); err_irq2: - free_irq(IRQ_STUART, dev); + free_irq(si->uart_irq, dev); err_irq1: return err; @@ -760,8 +763,8 @@ static int pxa_irda_stop(struct net_device *dev) si->irlap = NULL; } - free_irq(IRQ_STUART, dev); - free_irq(IRQ_ICP, dev); + free_irq(si->uart_irq, dev); + free_irq(si->icp_irq, dev); pxa_free_dma(si->rxdma); pxa_free_dma(si->txdma); @@ -851,6 +854,9 @@ static int pxa_irda_probe(struct platform_device *pdev) si->dev = &pdev->dev; si->pdata = pdev->dev.platform_data; + si->uart_irq = platform_get_irq(pdev, 0); + si->icp_irq = platform_get_irq(pdev, 1); + si->sir_clk = clk_get(&pdev->dev, "UARTCLK"); si->fir_clk = clk_get(&pdev->dev, "FICPCLK"); if (IS_ERR(si->sir_clk) || IS_ERR(si->fir_clk)) {