From patchwork Wed May 14 15:58:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 4176161 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4AF21BFF02 for ; Wed, 14 May 2014 16:03:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 81631201C7 for ; Wed, 14 May 2014 16:03:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CADD320204 for ; Wed, 14 May 2014 16:03:39 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wkbc9-00027x-EN; Wed, 14 May 2014 16:01:05 +0000 Received: from mail-wg0-f41.google.com ([74.125.82.41]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wkbb5-00006T-PE for linux-arm-kernel@lists.infradead.org; Wed, 14 May 2014 16:00:00 +0000 Received: by mail-wg0-f41.google.com with SMTP id z12so2158606wgg.12 for ; Wed, 14 May 2014 08:59:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=Iq6NE3IE0pToAQ3s/Flh/ueNSSIN/QSIVS8Eq4moqEo=; b=I40QLO1UIW3ILWskJgGhF3EbLkTY4JkJT8vHDthLtI+IcJ5hIZL7ZIIUIjwHpcREOJ v0PNxwbmczl6Khn36MAJFrvjWDst8bKasb6xs+jNwK1F5kh+KtSGeD/DDQfEApoqblxw Uqzvwri8FC/G9tTGzVgoNgk8YJhWZrX9VcyJRzNcL8GnrlWt0aeJZb/AuLh6aHYthE+Y u0gj6R0syhfJDoxWMO0gMQamIycN5j++hWepagNlVmVsNueV45/Q1TyA8XIRGXiQrVE0 bBXWDX0z18dTdZ3LhFBrAFUCTMqgAMuMxS/vnJHq/N+jkoFns9fu9qOsEsHiNMUj8qUi jOsg== X-Gm-Message-State: ALoCoQn0Ib15V4lh0c4z4AnOCpqSpi7T9y4vrMA1wWuzdb0EYsMvFJbNERjht8wb5TSyNKbfpyn/ X-Received: by 10.180.9.202 with SMTP id c10mr4195727wib.7.1400083181067; Wed, 14 May 2014 08:59:41 -0700 (PDT) Received: from sundance.lan (cpc4-aztw19-0-0-cust157.18-1.cable.virginm.net. [82.33.25.158]) by mx.google.com with ESMTPSA id dn4sm4687808wib.18.2014.05.14.08.59.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 May 2014 08:59:39 -0700 (PDT) From: Daniel Thompson To: Jason Wessel , kgdb-bugreport@lists.sourceforge.net Subject: [RFC 7/8] ARM: VIC: Add vic_set_fiq function to select if an interrupt should generate an IRQ or FIQ Date: Wed, 14 May 2014 16:58:44 +0100 Message-Id: <1400083125-1464-8-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1400083125-1464-1-git-send-email-daniel.thompson@linaro.org> References: <1400083125-1464-1-git-send-email-daniel.thompson@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140514_090000_008380_C526AFF6 X-CRM114-Status: GOOD ( 12.73 ) X-Spam-Score: -0.7 (/) Cc: Mark Rutland , kernel@stlinux.com, Frederic Weisbecker , Linus Walleij , Jiri Slaby , Daniel Thompson , Dirk Behme , Russell King , Nicolas Pitre , Ian Campbell , Anton Vorontsov , "David A. Long" , linux-serial@vger.kernel.org, Catalin Marinas , kernel-team@android.com, devicetree@vger.kernel.org, linaro-kernel@lists.linaro.org, Pawel Moll , patches@linaro.org, Kumar Gala , Rob Herring , John Stultz , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Colin Cross , Christoffer Dall X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Arve Hjønnevåg Signed-off-by: Arve Hjønnevåg Signed-off-by: Daniel Thompson --- drivers/irqchip/irq-vic.c | 23 +++++++++++++++++++++++ include/linux/irqchip/arm-vic.h | 1 + 2 files changed, 24 insertions(+) diff --git a/drivers/irqchip/irq-vic.c b/drivers/irqchip/irq-vic.c index 7d35287..3eaa2e4 100644 --- a/drivers/irqchip/irq-vic.c +++ b/drivers/irqchip/irq-vic.c @@ -337,6 +337,29 @@ static void vic_unmask_irq(struct irq_data *d) writel(1 << irq, base + VIC_INT_ENABLE); } +static DEFINE_SPINLOCK(vic_intselect_lock); +int vic_set_fiq(unsigned int irq, bool enable) +{ + u32 int_select; + u32 mask; + unsigned long irq_flags; + void __iomem *base = irq_get_chip_data(irq); + irq &= 31; + mask = 1 << irq; + + spin_lock_irqsave(&vic_intselect_lock, irq_flags); + int_select = readl(base + VIC_INT_SELECT); + if (enable) + int_select |= mask; + else + int_select &= ~mask; + writel(int_select, base + VIC_INT_SELECT); + spin_unlock_irqrestore(&vic_intselect_lock, irq_flags); + + return 0; +} +EXPORT_SYMBOL(vic_set_fiq); + #if defined(CONFIG_PM) static struct vic_device *vic_from_irq(unsigned int irq) { diff --git a/include/linux/irqchip/arm-vic.h b/include/linux/irqchip/arm-vic.h index ba46c79..61ee4c9 100644 --- a/include/linux/irqchip/arm-vic.h +++ b/include/linux/irqchip/arm-vic.h @@ -34,5 +34,6 @@ void __vic_init(void __iomem *base, int parent_irq, int irq_start, void vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources, u32 resume_sources); int vic_init_cascaded(void __iomem *base, unsigned int parent_irq, u32 vic_sources, u32 resume_sources); +int vic_set_fiq(unsigned int irq, bool enable); #endif