From patchwork Wed May 20 10:30:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: grygorii.strashko@linaro.org X-Patchwork-Id: 474343 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 5468A14027C for ; Wed, 20 May 2015 20:31:34 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753119AbbETKbd (ORCPT ); Wed, 20 May 2015 06:31:33 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:36846 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752459AbbETKad (ORCPT ); Wed, 20 May 2015 06:30:33 -0400 Received: by wizk4 with SMTP id k4so149761048wiz.1 for ; Wed, 20 May 2015 03:30:32 -0700 (PDT) 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=no8+YQ/N9jPPiah/TGWl8Hu5H1y4cO41EmBq+oy3jVk=; b=I89jAgFZjXkAecGPUfp6a14mbm5Hhv8LlL1CCsAm9ohtIxoIOcna3QPb5nO0Ia5LBg lr6hTOxSLpS8he0uw5XRfdDBm5bCNTBD+3r3csxtXvWj63BSJ3N5KGvl6FHUfpovyWpr 2fCNeIin48vQ8WGWUm0uZbRYRscImqrtZmtjgYv4fAqmugJYWYL4zrxp252/hTY6M9Ok NwMDKKI6BozdmEZkteVPWBpwOKegeGTVLH9t/9DO4jzPe3mP+hljNF0EX4jUx6VMdvr0 BAXM/XgmVnxLBuUoaMHn2hxgHGrxHdV3dc9e3sYiYLqaG5Mzjuz/uF7IkBQPNAwAVSUu szqQ== X-Gm-Message-State: ALoCoQntb6LXDcY6dpZCiGEIQ4jn+bRUXBYLJxej0gtMR7TQ397TfLbhKVs0VPV9/UVEBJS70Kwp X-Received: by 10.194.172.130 with SMTP id bc2mr52575060wjc.85.1432117832705; Wed, 20 May 2015 03:30:32 -0700 (PDT) Received: from localhost ([195.238.92.128]) by mx.google.com with ESMTPSA id m2sm2729471wiy.7.2015.05.20.03.30.31 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 20 May 2015 03:30:31 -0700 (PDT) From: Grygorii Strashko To: Linus Walleij , Alexandre Courbot Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Grygorii Strashko , Johan Hovold Subject: [PATCH v2 1/3] gpiolib: debugfs: display gpios requested as irq only Date: Wed, 20 May 2015 13:30:21 +0300 Message-Id: <1432117823-1834-2-git-send-email-grygorii.strashko@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1432117823-1834-1-git-send-email-grygorii.strashko@linaro.org> References: <1432117823-1834-1-git-send-email-grygorii.strashko@linaro.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Now GPIOs, wich are requested as IRQ only, will not be displayed through GPIO debugfs. For example: # cat /proc/interrupts CPU0 CPU1 ... 209: 0 0 4805d000.gpio 11 Edge 0-0021 # cat /debug/gpio ... GPIOs 160-191, platform/4805d000.gpio, gpio: <--- no info about gpio used as IRQ only here GPIOs 192-223, platform/48051000.gpio, gpio: gpio-203 (vtt_fixed ) out hi ... Hence, improve GPIO debugfs code to show such kind of GPIOs After this patch sys/kernel/debug/gpio will produce following output: # cat /debug/gpio ... GPIOs 160-191, platform/4805d000.gpio, gpio: gpio-171 ((null) ) in hi IRQ GPIOs 192-223, platform/48051000.gpio, gpio: gpio-203 (vtt_fixed ) out hi Cc: Johan Hovold Signed-off-by: Grygorii Strashko --- drivers/gpio/gpiolib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 59eaa23..399ce2f 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -2259,7 +2259,8 @@ static void gpiolib_dbg_show(struct seq_file *s, struct gpio_chip *chip) int is_irq; for (i = 0; i < chip->ngpio; i++, gpio++, gdesc++) { - if (!test_bit(FLAG_REQUESTED, &gdesc->flags)) + if (!test_bit(FLAG_REQUESTED, &gdesc->flags) && + !test_bit(FLAG_USED_AS_IRQ, &gdesc->flags)) continue; gpiod_get_direction(gdesc);