Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756013AbbHFSSf (ORCPT ); Thu, 6 Aug 2015 14:18:35 -0400 Received: from mail-lb0-f178.google.com ([209.85.217.178]:34172 "EHLO mail-lb0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755403AbbHFSSd (ORCPT ); Thu, 6 Aug 2015 14:18:33 -0400 MIME-Version: 1.0 In-Reply-To: <20150806171312.GI13421@lunn.ch> References: <20150804153439.GA28673@lunn.ch> <20150805162155.GE32760@lunn.ch> <20150806132926.GB19896@lunn.ch> <20150806171312.GI13421@lunn.ch> Date: Thu, 6 Aug 2015 23:48:24 +0530 Message-ID: Subject: Re: Armadaxp GPIO interrupts From: raghu MG To: Andrew Lunn Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Thomas Petazzoni , Sebastian Hesselbarth Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3167 Lines: 79 Ok... my bad never realised DT entries are necessary. will try this & post the results. Regards Raghu On Thu, Aug 6, 2015 at 10:43 PM, Andrew Lunn wrote: > 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/