From patchwork Wed Aug 21 21:21:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2847911 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 B9A8BBF546 for ; Wed, 21 Aug 2013 21:22:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C598520421 for ; Wed, 21 Aug 2013 21:22:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9918A2049B for ; Wed, 21 Aug 2013 21:22:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752159Ab3HUVWV (ORCPT ); Wed, 21 Aug 2013 17:22:21 -0400 Received: from mail-bk0-f44.google.com ([209.85.214.44]:33229 "EHLO mail-bk0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752477Ab3HUVWU (ORCPT ); Wed, 21 Aug 2013 17:22:20 -0400 Received: by mail-bk0-f44.google.com with SMTP id mz10so390415bkb.3 for ; Wed, 21 Aug 2013 14:22:18 -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:in-reply-to:references; bh=26mElZ5rDPqzCwpPCdrO8fB6ICQ7uQVwM0T/d5HjMwQ=; b=S9/nDlb5MyCZUKkm8c3O8aGzcTRiYI38I23Kwa2TZR0ZMyAyugSy1fhjrrXpvVHZrj lA3+HPEZPTqzfOEuXQcQLjri9ze30MwaaA2pEV8gPEbEcfkWEZF+jCR5nKMW/kHib1cN pB0BXn0T258EdqtSvHMrLTO6Gn73smBUH0WMa2RE5K+PVR13b0oPksNBy0GLPzoxpQNT W7bkkuTvkCqvZiTG1K/OFPSEaGfICqMtkFfEGT7hZmm4hBBS3eMgPfZwHWul6I9jNrGv KRnjmVYObYQRZ3q2V26TGb3w+ce5tTI8xba4mhWvjIgysi3QVeR5+YrQFbrheu+nOlYz xRfg== X-Received: by 10.205.10.200 with SMTP id pb8mr7178882bkb.16.1377120138461; Wed, 21 Aug 2013 14:22:18 -0700 (PDT) Received: from flatron.tomeq (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPSA id h7sm2336803bki.9.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 Aug 2013 14:22:17 -0700 (PDT) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Kukjin Kim , linux-gpio@vger.kernel.org, Ian Campbell , Linus Walleij , Mark Rutland , Pawel Moll , Rob Herring , Russell King , Stephen Warren , Thomas Gleixner , Olof Johansson , Arnd Bergmann , Marc Zyngier , Mark Brown , Tomasz Figa Subject: [PATCH v7 1/7] ARM: common: vic: Parse interrupt and resume masks from device tree Date: Wed, 21 Aug 2013 23:21:45 +0200 Message-Id: <1377120111-25601-2-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1377120111-25601-1-git-send-email-tomasz.figa@gmail.com> References: <1377120111-25601-1-git-send-email-tomasz.figa@gmail.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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 This patch extends vic_of_init to parse valid interrupt sources and resume sources masks from device tree. If mask values are not specified in device tree, all sources are assumed to be valid, as before this patch. Signed-off-by: Tomasz Figa --- Documentation/devicetree/bindings/arm/vic.txt | 6 ++++++ drivers/irqchip/irq-vic.c | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/arm/vic.txt b/Documentation/devicetree/bindings/arm/vic.txt index 266716b..bb7137c 100644 --- a/Documentation/devicetree/bindings/arm/vic.txt +++ b/Documentation/devicetree/bindings/arm/vic.txt @@ -18,6 +18,9 @@ Required properties: Optional properties: - interrupts : Interrupt source for parent controllers if the VIC is nested. +- interrupt-mask : Bit mask of valid interrupt sources (defaults to all valid) +- wakeup-mask : Bit mask of interrupt sources that can wake up the system + (defaults to all allowed) Example: @@ -26,4 +29,7 @@ Example: interrupt-controller; #interrupt-cells = <1>; reg = <0x60000 0x1000>; + + interrupt-mask = <0xffffff7f>; + wakeup-mask = <0x0000ff7f>; }; diff --git a/drivers/irqchip/irq-vic.c b/drivers/irqchip/irq-vic.c index 2bbb004..d56750eb 100644 --- a/drivers/irqchip/irq-vic.c +++ b/drivers/irqchip/irq-vic.c @@ -469,6 +469,8 @@ void __init vic_init(void __iomem *base, unsigned int irq_start, int __init vic_of_init(struct device_node *node, struct device_node *parent) { void __iomem *regs; + u32 interrupt_mask = ~0; + u32 wakeup_mask = ~0; if (WARN(parent, "non-root VICs are not supported")) return -EINVAL; @@ -477,10 +479,13 @@ int __init vic_of_init(struct device_node *node, struct device_node *parent) if (WARN_ON(!regs)) return -EIO; + of_property_read_u32(node, "interrupt-mask", &interrupt_mask); + of_property_read_u32(node, "wakeup-mask", &wakeup_mask); + /* * Passing 0 as first IRQ makes the simple domain allocate descriptors */ - __vic_init(regs, 0, ~0, ~0, node); + __vic_init(regs, 0, interrupt_mask, wakeup_mask, node); return 0; }