From patchwork Wed May 20 10:30:23 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: 48792 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3A44521411 for ; Wed, 20 May 2015 10:31:07 +0000 (UTC) Received: by lagv1 with SMTP id v1sf15733015lag.1 for ; Wed, 20 May 2015 03:31:05 -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=fjVzgU6OlH/x6IZZZNuQ68cm4FZPhf+K6venfJnq8rM=; b=XTbV+fHBBe5E8OwC0enW34QZ5I7hWcmDkBvfhWhRhAZ21Q2I3k8Oq2zTw1+y57OUyf GN2XXxlvlQc5MjwkqDDhewqtx2A+DrMiUgLxN0qanG5Rfl5HDfKpj1dldA9MgvUF5Uqi lMiXKpQOWrzUbC8/zjF7SUTgs58cagJYeiLazxLr1fsBtePPCPHW24R9WghopajZQk23 br/I1NpyGwfgmz1XBmvejUWsm4ZXfLb+91XYKAop7QHiiaiwFpkLSPSSMPrO3j61q1kM 2L23n96EL7PBMib1/7JA/jj6Wp/me7QqgHVGqZcSTn9ZqssYF4ibJ+hBLURfTsdX0aU/ gQ3A== X-Gm-Message-State: ALoCoQm/+5tQQxKvN4bbBrtbUy6X+QWlYnOji17tH7ahlU3SB0DgoDm5iVGuxOl01h8etV0Df5BL X-Received: by 10.194.5.229 with SMTP id v5mr25943501wjv.0.1432117865679; Wed, 20 May 2015 03:31:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.116.7 with SMTP id js7ls165252lab.34.gmail; Wed, 20 May 2015 03:31:05 -0700 (PDT) X-Received: by 10.152.184.101 with SMTP id et5mr19810826lac.43.1432117865349; Wed, 20 May 2015 03:31:05 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id qv7si10896274lbb.162.2015.05.20.03.31.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 May 2015 03:31:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by lagv1 with SMTP id v1so67161771lag.3 for ; Wed, 20 May 2015 03:31:05 -0700 (PDT) X-Received: by 10.152.6.69 with SMTP id y5mr17964687lay.72.1432117865205; Wed, 20 May 2015 03:31:05 -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 hn6csp1427454lbb; Wed, 20 May 2015 03:31:03 -0700 (PDT) X-Received: by 10.70.46.161 with SMTP id w1mr63579403pdm.16.1432117861936; Wed, 20 May 2015 03:31:01 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6si1569586pdj.17.2015.05.20.03.31.00; Wed, 20 May 2015 03:31:01 -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 S1753368AbbETKaz (ORCPT + 28 others); Wed, 20 May 2015 06:30:55 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:33884 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753152AbbETKai (ORCPT ); Wed, 20 May 2015 06:30:38 -0400 Received: by wicmc15 with SMTP id mc15so145060156wic.1 for ; Wed, 20 May 2015 03:30:37 -0700 (PDT) X-Received: by 10.180.75.72 with SMTP id a8mr6915694wiw.5.1432117837170; Wed, 20 May 2015 03:30:37 -0700 (PDT) Received: from localhost ([195.238.92.128]) by mx.google.com with ESMTPSA id pd7sm17288459wjb.27.2015.05.20.03.30.36 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 20 May 2015 03:30:36 -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 3/3] gpiolib: debugfs: identify gpios requested as irq only Date: Wed, 20 May 2015 13:30:23 +0300 Message-Id: <1432117823-1834-4-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.49 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: , Now many of GPIO drivers implement two interfaces gpiolib and irqchip which are essentially orthogonal. So, now GPIO line can be requested in three ways: 1) As pure GPIO (gpioX_request()) 2) As pure GPIO IRQ, especially in DT boot case. DT: interrupt-parent = <&gpio6>; interrupts = <11 IRQ_TYPE_EDGE_FALLING>; Code: platform_get_irq() or of_irq_get() request_irq() 3) combination of (1) and (2). And from GPIO debugfs it could be identified when GPIO is requested/used or used as IRQ, but there is no way to determine when GPIO is requested/used as IRQ only. Such information is useful for debugging, so update GPIO debugfs code to show marker '' for GPIO lines which are requested/used as GPIO IRQ only. 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 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index f1dcb5b..d69fc58 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -2272,8 +2272,11 @@ static void gpiolib_dbg_show(struct seq_file *s, struct gpio_chip *chip) chip->get ? (chip->get(chip, i) ? "hi" : "lo") : "? "); - if (is_irq) + if (is_irq) { seq_printf(s, " IRQ-%d", gpiod_to_irq(gdesc)); + if (!test_bit(FLAG_REQUESTED, &gdesc->flags)) + seq_puts(s, " "); + } seq_printf(s, "\n"); } }