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: 48791 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C92452121F for ; Wed, 20 May 2015 10:30:58 +0000 (UTC) Received: by wivs14 with SMTP id s14sf18414136wiv.1 for ; Wed, 20 May 2015 03:30:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=ZZR9Bp9MYnOQIDlr/2HWNdD1VHtomEXtTyTlnRrK3pE=; b=iRyQq8PxpkK8AM5yfp4mT60LLutnteSu0KVbIJiWxDa5JMtFBYGIjJ1QDP75vtk2hg dKK8TpZXb0Dlhyb+8zz6XgTsN51a0rA9KiSvwWXcB4PMOWauli8FNQkfQs8hH9Ig+BLI qg3qwXQw/4Wt9nVUELzI3Ck1wUPci0nBXkVh20vHJ+hDx1b/3+QFn02PlpPWU11EqjI0 VtnR8bufUNJRpBBE9G0dAUsT5TJcbp0oRe0GeZrNrVavKqGG2IhyiVZt7R3tuqUckLMC MG/UQFmnbfW06kCvV9S+N6iMgdhTxku1R1MtsY5IvuYBGSZRNEopK6xf6AkpVQAxzYEe XaGw== X-Gm-Message-State: ALoCoQlUUMbELbBzXfszT+4JCtzovwhG8R0OGu+I/+96XeqjEpxUabKQiGK7rkKqVEzWEWY2fr5J X-Received: by 10.112.189.131 with SMTP id gi3mr25812524lbc.6.1432117857838; Wed, 20 May 2015 03:30:57 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.130 with SMTP id ay2ls193655lab.89.gmail; Wed, 20 May 2015 03:30:57 -0700 (PDT) X-Received: by 10.152.7.97 with SMTP id i1mr24574403laa.49.1432117857591; Wed, 20 May 2015 03:30:57 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id zn4si10908606lbb.103.2015.05.20.03.30.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 May 2015 03:30:57 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by lagv1 with SMTP id v1so67157018lag.3 for ; Wed, 20 May 2015 03:30:57 -0700 (PDT) X-Received: by 10.112.219.70 with SMTP id pm6mr24850554lbc.41.1432117857451; Wed, 20 May 2015 03:30:57 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1427394lbb; Wed, 20 May 2015 03:30:55 -0700 (PDT) X-Received: by 10.68.167.162 with SMTP id zp2mr13972121pbb.105.1432117854266; Wed, 20 May 2015 03:30:54 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3si25872930pap.184.2015.05.20.03.30.52; Wed, 20 May 2015 03:30:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753176AbbETKak (ORCPT + 28 others); Wed, 20 May 2015 06:30:40 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:35193 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751928AbbETKaf (ORCPT ); Wed, 20 May 2015 06:30:35 -0400 Received: by wicmx19 with SMTP id mx19so149485748wic.0 for ; Wed, 20 May 2015 03:30:34 -0700 (PDT) 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-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: grygorii.strashko@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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"); } }