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: 30176 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5666F20446 for ; Wed, 14 May 2014 15:59:43 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lj1sf9851433pab.1 for ; Wed, 14 May 2014 08:59:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=Iq6NE3IE0pToAQ3s/Flh/ueNSSIN/QSIVS8Eq4moqEo=; b=UFOebvDV1S1MblWbCtF35Sg02FHp47I1Z34zn29Nsmxay34gHHO5ZF1cKuU2W/zkVG DN0rEjXYAt/2g793roLP/AglVjtasbBeSmcvDvX5fDJxxtVJms2KiL9xS9jCyax12HHe NwpqN/J8r/sayo/26pOIjuVFOul5lWLsWdqrqmdfXYshOTJi4uH1tqiUBXiZwGob0gGg 4E63JbrMvu32dtSobDxCfZPs9xm2/LNha1u7bAA4ep/17I4Y9f/+I6aBuvGuEObr5AHn IxJ0xpeGBzyibI8mi1+v2wQDjCmlhdk030Fn4Kh5XMT4DyG5NbRnVnSvZcVR6C//qba7 cICg== X-Gm-Message-State: ALoCoQn9Y8UJ/k/g5PiwdO7BeEfXTwS2FDtFmFxBPaCy0UarNSo9+f3WKYUAuWjCwxOcTUpD6NWw X-Received: by 10.68.133.75 with SMTP id pa11mr2064623pbb.2.1400083182652; Wed, 14 May 2014 08:59:42 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.234 with SMTP id a97ls2464796qgf.51.gmail; Wed, 14 May 2014 08:59:42 -0700 (PDT) X-Received: by 10.58.133.38 with SMTP id oz6mr872474veb.46.1400083182488; Wed, 14 May 2014 08:59:42 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id uv3si396209vdc.95.2014.05.14.08.59.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 May 2014 08:59:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.171 as permitted sender) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id oz11so2669063veb.30 for ; Wed, 14 May 2014 08:59:42 -0700 (PDT) X-Received: by 10.52.2.229 with SMTP id 5mr3163483vdx.24.1400083182421; Wed, 14 May 2014 08:59:42 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp251773vcb; Wed, 14 May 2014 08:59:41 -0700 (PDT) X-Received: by 10.180.85.134 with SMTP id h6mr26714769wiz.44.1400083181553; Wed, 14 May 2014 08:59:41 -0700 (PDT) Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by mx.google.com with ESMTPS id vj2si840423wjc.184.2014.05.14.08.59.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 May 2014 08:59:41 -0700 (PDT) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 74.125.82.43 as permitted sender) client-ip=74.125.82.43; Received: by mail-wg0-f43.google.com with SMTP id l18so2085187wgh.26 for ; Wed, 14 May 2014 08:59:41 -0700 (PDT) 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 Cc: patches@linaro.org, linaro-kernel@lists.linaro.org, =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , linux-kernel@vger.kernel.org, John Stultz , Anton Vorontsov , Colin Cross , Dirk Behme , kernel-team@android.com, Russell King , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Thomas Gleixner , Greg Kroah-Hartman , Jiri Slaby , "David A. Long" , Nicolas Pitre , Catalin Marinas , Frederic Weisbecker , Linus Walleij , Christoffer Dall , linux-arm-kernel@lists.infradead.org, kernel@stlinux.com, devicetree@vger.kernel.org, linux-serial@vger.kernel.org, Daniel Thompson 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.thompson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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