From patchwork Tue Nov 17 09:40:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 7634921 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EE733BF90C for ; Tue, 17 Nov 2015 10:02:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E8EC620499 for ; Tue, 17 Nov 2015 10:02:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6D46E204D6 for ; Tue, 17 Nov 2015 10:02:48 +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 1Zyd3t-0000un-82; Tue, 17 Nov 2015 10:00:29 +0000 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zycpp-00012A-4E for linux-arm-kernel@lists.infradead.org; Tue, 17 Nov 2015 09:46:02 +0000 Received: by wmec201 with SMTP id c201so17248340wme.1 for ; Tue, 17 Nov 2015 01:45:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lZZdjZyRC7dBc7mgAtzb+e9TA8l+N5soqL0zMbJNxUE=; b=VPvmNn4LkCSoh7wLR9Gal/BE+u07Huj/sXRXeccmDUixmr16ss0WD7l3uSIDfuD/HU tzbHySNJCCXMET7zZXynHUqjGYEumkARg1xN37PIgiEwnMEVwT12RNaYLBfOZVlLv0CZ mCTBnCY9sZIpPSvARp1KVBLDpQUDjuvNlcVrn005De6MIUmFA5JS7cjvDtqHP04NUzWQ xSxjEF8KyCk536uUaIJTqpUFPNgJgzIs/GxiTUdgU6ljRIB5mgLRPsOIptVowPoFClWg +B8IjTtGT24YaVU2yxwkVSmr8FOgVUzeG/T3qRfelo7wKEFupTKfSwFswc5agMVMJlb3 83Mg== 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; bh=lZZdjZyRC7dBc7mgAtzb+e9TA8l+N5soqL0zMbJNxUE=; b=XE2KQEsAhKh15wsxakaDTdoUqVbnp9+xXjp4L7PNNV6ik6QcpCCC979aGKI/p2A0ci P3EwNzA26tokKYX9kabIybrbmBCDf2aSHo/K49ub4diz/+ehJtsYYXK+ZIzqHV2Q/9C3 2J0dbJmnIVfCGTxJusJn44qBgilgWBfDBaYooaNt30omC5LMfkKYEe7yGMPNdbKuZLB5 5vzGb1iyjiOyuvA8QsSoY06jlEPDuTaL2yDZTDGHk0UYKC7hzFZBiTWjW0tcswvHhutU PXJbZQD3NweU9JLfHtjRpyxCcAQzQwxB06bJlcmehoaK4TQusMRDvpUTUciLY3jYM1jx wtIQ== X-Gm-Message-State: ALoCoQk32gAyDO/9vWtT8gBQmRpMCt4FiQQ5x7chkDQP49LCcml59KtKcnRjoD6I/kuOq7xgEmQH X-Received: by 10.28.226.86 with SMTP id z83mr1543244wmg.77.1447753535582; Tue, 17 Nov 2015 01:45:35 -0800 (PST) Received: from localhost ([78.129.251.54]) by smtp.gmail.com with ESMTPSA id h4sm39012696wjx.41.2015.11.17.01.45.33 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 17 Nov 2015 01:45:34 -0800 (PST) From: shannon.zhao@linaro.org To: ian.campbell@citrix.com, stefano.stabellini@citrix.com, keir@xen.org, jbeulich@suse.com, andrew.cooper3@citrix.com, julien.grall@citrix.com, xen-devel@lists.xen.org Subject: [PATCH v3 30/62] arm/irq: Add helper function for setting interrupt type Date: Tue, 17 Nov 2015 17:40:29 +0800 Message-Id: <1447753261-7552-31-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1447753261-7552-1-git-send-email-shannon.zhao@linaro.org> References: <1447753261-7552-1-git-send-email-shannon.zhao@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151117_014558_112523_C16F9F24 X-CRM114-Status: GOOD ( 12.55 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, hangaohuai@huawei.com, ard.biesheuvel@linaro.org, shannon.zhao@linaro.org, christoffer.dall@linaro.org, peter.huangpeng@huawei.com, david.vrabel@citrix.com, zhaoshenglong@huawei.com, linux-arm-kernel@lists.infradead.org, roger.pau@citrix.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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: Parth Dixit Add a helper function to set edge/level type information for an interrupt. Signed-off-by: Parth Dixit Signed-off-by: Shannon Zhao Acked-by: Stefano Stabellini --- xen/arch/arm/irq.c | 22 +++++++++++++++------- xen/include/asm-arm/irq.h | 2 ++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c index 1f38605..90b6e58 100644 --- a/xen/arch/arm/irq.c +++ b/xen/arch/arm/irq.c @@ -655,6 +655,19 @@ unlock: return ret; } +int irq_set_type(unsigned int irq, unsigned int type) +{ + int res; + + /* Setup the IRQ type */ + if ( irq < NR_LOCAL_IRQS ) + res = irq_local_set_type(irq, type); + else + res = irq_set_spi_type(irq, type); + + return res; +} + int platform_get_irq(const struct dt_device_node *device, int index) { struct dt_irq dt_irq; @@ -668,14 +681,9 @@ int platform_get_irq(const struct dt_device_node *device, int index) irq = dt_irq.irq; type = dt_irq.type; - /* Setup the IRQ type */ - if ( irq < NR_LOCAL_IRQS ) - res = irq_local_set_type(irq, type); - else - res = irq_set_spi_type(irq, type); - + res = irq_set_type(irq, type); if ( res ) - return -1; + return -1; return irq; } diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h index f33c331..493773c 100644 --- a/xen/include/asm-arm/irq.h +++ b/xen/include/asm-arm/irq.h @@ -52,6 +52,8 @@ void arch_move_irqs(struct vcpu *v); /* Set IRQ type for an SPI */ int irq_set_spi_type(unsigned int spi, unsigned int type); +int irq_set_type(unsigned int irq, unsigned int type); + int platform_get_irq(const struct dt_device_node *device, int index); void irq_set_affinity(struct irq_desc *desc, const cpumask_t *cpu_mask);