From patchwork Fri Aug 23 23:54:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2849168 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A0BAD9F271 for ; Fri, 23 Aug 2013 23:55:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B9275202AC for ; Fri, 23 Aug 2013 23:55:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CCE56202A7 for ; Fri, 23 Aug 2013 23:55:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754957Ab3HWXzA (ORCPT ); Fri, 23 Aug 2013 19:55:00 -0400 Received: from mail-ee0-f48.google.com ([74.125.83.48]:46594 "EHLO mail-ee0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754678Ab3HWXy7 (ORCPT ); Fri, 23 Aug 2013 19:54:59 -0400 Received: by mail-ee0-f48.google.com with SMTP id l10so550412eei.7 for ; Fri, 23 Aug 2013 16:54:57 -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:user-agent:in-reply-to :references:mime-version:content-transfer-encoding:content-type; bh=j0QtH5vPQJJ8HzumcAFZ1gtqlvVgHKHdc+RL2KZ1chM=; b=nNZ+gcvpXkeTrcoI8cvKUkeWBQjb9u/r9wQe3raKkUB79swLdTaM6egI9DaOL1/f/d p7TH0gLwC+6GbE7jGDrhH8G+ljl4H6IqMc4ltyhq0q+nFlj3hpbodVxdI9tc/0rsmjg9 cVe9O+cB/kss5vFJ7IvrM4ZaNo53l104qVOFkgicA/JxElr6HSkYqv0hg4U+CYBbzfeH u3H+5oaAvC9GI+xj/88XE6UuNgsaS82uIvz4eDCfrMeIM3IZ6m9DD9NN6Oo2K24kYQxd zUOTxh9X6gpNbiSenpNMzKxK/RJyE4IpvVbpzOPby519iHQoTrSpl4WKumAfI3r/41ZY olbg== X-Received: by 10.15.100.198 with SMTP id bn46mr2785428eeb.11.1377302097663; Fri, 23 Aug 2013 16:54:57 -0700 (PDT) Received: from flatron.localnet (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPSA id a6sm2985408eei.10.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 Aug 2013 16:54:56 -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 Subject: [PATCH v9 1/7] irqchip: vic: Parse interrupt and resume masks from device tree Date: Sat, 24 Aug 2013 01:54:51 +0200 Message-ID: <2280792.12A0UohYGl@flatron> User-Agent: KMail/4.11 (Linux/3.10.9-gentoo; KDE/4.11.0; x86_64; ; ) In-Reply-To: <1500724.07LRpFtgcx@flatron> References: <1377120111-25601-1-git-send-email-tomasz.figa@gmail.com> <1377120111-25601-2-git-send-email-tomasz.figa@gmail.com> <1500724.07LRpFtgcx@flatron> MIME-Version: 1.0 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 Acked-by: Stephen Warren --- Documentation/devicetree/bindings/arm/vic.txt | 12 ++++++++++++ drivers/irqchip/irq-vic.c | 7 ++++++- 2 files changed, 18 insertions(+), 1 deletion(-) Changes since v8: - Renamed wakeup-mask property to valid-wakeup-mask. - Extended description of valid-mask and valid-wakeup-mask properties. diff --git a/Documentation/devicetree/bindings/arm/vic.txt b/Documentation/devicetree/bindings/arm/vic.txt index 266716b..dd52721 100644 --- a/Documentation/devicetree/bindings/arm/vic.txt +++ b/Documentation/devicetree/bindings/arm/vic.txt @@ -18,6 +18,15 @@ Required properties: Optional properties: - interrupts : Interrupt source for parent controllers if the VIC is nested. +- valid-mask : A one cell big bit mask of valid interrupt sources. Each bit + represents single interrupt source, starting from source 0 at LSb and ending + at source 31 at MSb. A bit that is set means that the source is wired and + clear means otherwise. If unspecified, defaults to all valid. +- valid-wakeup-mask : A one cell big bit mask of interrupt sources that can be + configured as wake up source for the system. Order of bits is the same as for + valid-mask property. A set bit means that this interrupt source can be + configured as a wake up source for the system. If unspecied, defaults to all + interrupt sources configurable as wake up sources. Example: @@ -26,4 +35,7 @@ Example: interrupt-controller; #interrupt-cells = <1>; reg = <0x60000 0x1000>; + + valid-mask = <0xffffff7f>; + valid-wakeup-mask = <0x0000ff7f>; }; diff --git a/drivers/irqchip/irq-vic.c b/drivers/irqchip/irq-vic.c index 2bbb004..8e21ae0 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, "valid-mask", &interrupt_mask); + of_property_read_u32(node, "valid-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; }