From patchwork Wed May 20 10:30:22 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: 474341 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 D0BEB14027C for ; Wed, 20 May 2015 20:31:07 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753329AbbETKay (ORCPT ); Wed, 20 May 2015 06:30:54 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:35865 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753126AbbETKaf (ORCPT ); Wed, 20 May 2015 06:30:35 -0400 Received: by wizk4 with SMTP id k4so149762026wiz.1 for ; Wed, 20 May 2015 03:30:34 -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=JRmivFoE6eEj2c5wzR3qX+5F8nFT9zPhsIrz3zZnui0=; b=jEv5aCnb9qp/ctP/1/lPkZehqSlShcdb794EyJXJUtjLfdxr4ja27Y73mLdlBW8fWz moqvgO0So5uTAZQEP93Pqqpvu42AgiqcGWOCTMIUEpdp3Z1DnC5aJEWw9X2iTV5KDVIb HXNt7qbQUu93puXg5ZPb/DQQizi3ClytdSKua05nO6nkMm+kmQ1t7ejj0l1WHrt5PKMq En7SwNUv/Z7yCcp7MNm59fCxwe87yP2B3ujUskwx+AbTm40pEaG/xSAIBqZeUxe7/Wlw Ukukm9N/cZBmhfbZsHNH1/2Xn/m7CuBH9zw3OXZy/8FoC87GbMLZ+7NzQaovjlUippkP 4O+Q== X-Gm-Message-State: ALoCoQnsil6rFZ4mdh2sCgP4URXRuUphMIahUOpOaz9a48W4SdHeUm73529ihVmUxp3wwJMgvDeg X-Received: by 10.194.84.179 with SMTP id a19mr53166335wjz.29.1432117834498; Wed, 20 May 2015 03:30:34 -0700 (PDT) Received: from localhost ([195.238.92.128]) by mx.google.com with ESMTPSA id k2sm2733332wif.3.2015.05.20.03.30.33 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 20 May 2015 03:30:33 -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 2/3] gpiolib: debugfs: show linux irq number for gpios requested as irq Date: Wed, 20 May 2015 13:30:22 +0300 Message-Id: <1432117823-1834-3-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 This patch updates GPIO debugfs code to show Linux IRQ number for GPIOs requested as irq. After this patch sys/kernel/debug/gpio will produce following output: ... GPIOs 160-191, platform/4805d000.gpio, gpio: gpio-171 ((null) ) in hi IRQ-209 Cc: Johan Hovold Signed-off-by: Grygorii Strashko --- drivers/gpio/gpiolib.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 399ce2f..f1dcb5b 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -2266,13 +2266,14 @@ static void gpiolib_dbg_show(struct seq_file *s, struct gpio_chip *chip) gpiod_get_direction(gdesc); is_out = test_bit(FLAG_IS_OUT, &gdesc->flags); is_irq = test_bit(FLAG_USED_AS_IRQ, &gdesc->flags); - seq_printf(s, " gpio-%-3d (%-20.20s) %s %s %s", + seq_printf(s, " gpio-%-3d (%-20.20s) %s %s", gpio, gdesc->label, is_out ? "out" : "in ", chip->get ? (chip->get(chip, i) ? "hi" : "lo") - : "? ", - is_irq ? "IRQ" : " "); + : "? "); + if (is_irq) + seq_printf(s, " IRQ-%d", gpiod_to_irq(gdesc)); seq_printf(s, "\n"); } }