Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932210AbbHFRUW (ORCPT ); Thu, 6 Aug 2015 13:20:22 -0400 Received: from vps0.lunn.ch ([178.209.37.122]:43558 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755302AbbHFRUN (ORCPT ); Thu, 6 Aug 2015 13:20:13 -0400 Date: Thu, 6 Aug 2015 19:13:12 +0200 From: Andrew Lunn To: raghu MG Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Thomas Petazzoni , Sebastian Hesselbarth Subject: Re: Armadaxp GPIO interrupts Message-ID: <20150806171312.GI13421@lunn.ch> References: <20150804153439.GA28673@lunn.ch> <20150805162155.GE32760@lunn.ch> <20150806132926.GB19896@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2886 Lines: 71 On Thu, Aug 06, 2015 at 10:28:12PM +0530, raghu MG wrote: > Ok,I think I need to understand more about this gpio driver. > > As you said its registering chained handler,but why are they(IRQs) not > visible in cat /proc/interrupts. chained interrupts are never visible there. All you see are leaf interrupts, i.e. the device interrupts. Here is my Armada XP based WRT1900AC: $ cat /proc/interrupts CPU0 CPU1 16: 8959833 12783597 armada_370_xp_irq 5 Level armada_370_xp_per_cpu_tick 19: 0 0 armada_370_xp_irq 31 Level mv64xxx_i2c 20: 1453 0 armada_370_xp_irq 41 Level serial 26: 0 0 armada_370_xp_irq 45 Level ehci_hcd:usb3 27: 9682 0 armada_370_xp_irq 8 Level mvneta 28: 4 0 armada_370_xp_irq 10 Level mvneta 29: 35078 0 armada_370_xp_irq 55 Level f10a0000.sata 30: 3839 0 armada_370_xp_irq 113 Level f10d0000.nand 70: 0 0 f1018140.gpio 0 Edge WPS 71: 20 0 f1018140.gpio 1 Edge Factory Reset Button 90: 2 0 armada_370_xp_irq 51 Level f1060900.xor 91: 2 0 armada_370_xp_irq 52 Level f1060900.xor 92: 2 0 armada_370_xp_irq 94 Level f10f0900.xor 93: 2 0 armada_370_xp_irq 95 Level f10f0900.xor 94: 0 0 armada_370_xp_msi_irq 0 Edge xhci_hcd Notice the two f1018140.gpio, which are the buttons. > Do I need to further initialize marvell GPIO registers to trigger > these events. Nope, just the normal gpio API and all will work, as demonstrated by the two buttons on my board. > Do I need to change the polarity in polarity register to suit the > board requirements in probe function. Nope, you put that in the DT file: gpio_keys { compatible = "gpio-keys"; #address-cells = <1>; #size-cells = <0>; pinctrl-0 = <&keys_pin>; pinctrl-names = "default"; button@1 { label = "WPS"; linux,code = ; gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>; }; button@2 { label = "Factory Reset Button"; linux,code = ; gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>; }; }; You can change GPIO_ACTIVE_HIGH to GPIO_ACTIVE_LOW if that is what you need. Andrew -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/