From patchwork Fri Sep 5 19:52:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 36891 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f71.google.com (mail-pa0-f71.google.com [209.85.220.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 91E29202E4 for ; Fri, 5 Sep 2014 19:53:20 +0000 (UTC) Received: by mail-pa0-f71.google.com with SMTP id et14sf106327657pad.6 for ; Fri, 05 Sep 2014 12:53:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :mime-version:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe:content-type; bh=xpBse4X+tA3KpjM+4wX/7kyq6X8hwHunGIzOC6659kU=; b=WfQ8h11ZYhXQp7D/WgcZgYLQunfMPmr0nZgVcNK+n08lRW7K/R20QZB+m79TFmVXrv 6sxEKlFRwmFKJy4MZifOi4XcQnGYdl1xWXyw9eq77CjF4WDp/EJ0LN+QYvrzRS2KqS/B 91vIrOVjIZRZRuXifHvyr/LzOopR/sksRzog7ybuUihCE1bshUfcCNgcGrM+ss7kPKOW JnzJF18enELwVTwiKp1TeNwZAPleuOTPOmJQIC0TNb90ImMsxKla25taKjSxGjyDFWMk 1MLT9kbnTABsQLx5ed79wmyT2/W0AWUz8iIQirX6AQBMbgNVWQh9JAlu84DnMH/LU48Z e4WA== X-Gm-Message-State: ALoCoQlvlVrytg5KrFPvsGOCZGkh2jB8mc6LR8XMQHXDnZp5DJ1Myl0MivLXaGmKziavCFF2UisH X-Received: by 10.70.40.172 with SMTP id y12mr8098999pdk.8.1409946799863; Fri, 05 Sep 2014 12:53:19 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.27.242 with SMTP id 105ls906599qgx.17.gmail; Fri, 05 Sep 2014 12:53:19 -0700 (PDT) X-Received: by 10.220.96.137 with SMTP id h9mr2684373vcn.46.1409946799685; Fri, 05 Sep 2014 12:53:19 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id wx4si1949869vdb.77.2014.09.05.12.53.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 05 Sep 2014 12:53:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id lf12so12754382vcb.20 for ; Fri, 05 Sep 2014 12:53:19 -0700 (PDT) X-Received: by 10.52.61.136 with SMTP id p8mr10243684vdr.15.1409946799556; Fri, 05 Sep 2014 12:53:19 -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.221.45.67 with SMTP id uj3csp131198vcb; Fri, 5 Sep 2014 12:53:19 -0700 (PDT) X-Received: by 10.70.134.72 with SMTP id pi8mr25158020pdb.167.1409946798481; Fri, 05 Sep 2014 12:53:18 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id th6si5868177pab.87.2014.09.05.12.53.17 for ; Fri, 05 Sep 2014 12:53:18 -0700 (PDT) Received-SPF: none (google.com: linux-omap-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752027AbaIETxN (ORCPT + 5 others); Fri, 5 Sep 2014 15:53:13 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:50061 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750906AbaIETxJ (ORCPT ); Fri, 5 Sep 2014 15:53:09 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s85Jr5n2028946; Fri, 5 Sep 2014 14:53:05 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s85Jr4XB020733; Fri, 5 Sep 2014 14:53:04 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Fri, 5 Sep 2014 14:53:04 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s85Jr4ir021339; Fri, 5 Sep 2014 14:53:04 -0500 From: Nishanth Menon To: Alexandre Courbot , Linus Walleij , Kevin Hilman , Santosh Shilimkar , Javier Martinez Canillas CC: , , , Nishanth Menon Subject: [RESEND PATCH] gpio: omap: Fix interrupt names Date: Fri, 5 Sep 2014 14:52:55 -0500 Message-ID: <1409946775-24076-1-git-send-email-nm@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: nm@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 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: , When viewing the /proc/interrupts, there is no information about which GPIO bank a specific gpio interrupt is hooked on to. This is more than a bit irritating as such information can esily be provided back to the user and at times, can be crucial for debug. So, instead of displaying something like: 31: 0 0 GPIO 0 palmas 32: 0 0 GPIO 27 mmc0 Display the following with appropriate device name: 31: 0 0 4ae10000.gpio 0 palmas 32: 0 0 4805d000.gpio 27 mmc0 This requires that we create irq_chip instance specific for each GPIO bank which is trivial to achieve. Signed-off-by: Nishanth Menon Acked-by: Santosh Shilimkar Acked-by: Javier Martinez Canillas Acked-by: Kevin Hilman Acked-by: Alexandre Courbot --- Requested to be resend by Javier with linux-gpio maintainers in CC. Original V1 of the patch: https://patchwork.kernel.org/patch/4757891/ Probably belongs to 3.18 kernel series at this point in time. Changes since v1: just picked up Acks. V1: https://patchwork.kernel.org/patch/4757891/ based on v3.17-rc1 drivers/gpio/gpio-omap.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 1749321..aee25fa 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -857,16 +857,6 @@ static void omap_gpio_unmask_irq(struct irq_data *d) spin_unlock_irqrestore(&bank->lock, flags); } -static struct irq_chip gpio_irq_chip = { - .name = "GPIO", - .irq_shutdown = omap_gpio_irq_shutdown, - .irq_ack = omap_gpio_ack_irq, - .irq_mask = omap_gpio_mask_irq, - .irq_unmask = omap_gpio_unmask_irq, - .irq_set_type = omap_gpio_irq_type, - .irq_set_wake = omap_gpio_wake_enable, -}; - /*---------------------------------------------------------------------*/ static int omap_mpuio_suspend_noirq(struct device *dev) @@ -1088,7 +1078,7 @@ omap_mpuio_alloc_gc(struct gpio_bank *bank, unsigned int irq_start, IRQ_NOREQUEST | IRQ_NOPROBE, 0); } -static int omap_gpio_chip_init(struct gpio_bank *bank) +static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc) { int j; static int gpio; @@ -1137,7 +1127,7 @@ static int omap_gpio_chip_init(struct gpio_bank *bank) } #endif - ret = gpiochip_irqchip_add(&bank->chip, &gpio_irq_chip, + ret = gpiochip_irqchip_add(&bank->chip, irqc, irq_base, omap_gpio_irq_handler, IRQ_TYPE_NONE); @@ -1147,7 +1137,7 @@ static int omap_gpio_chip_init(struct gpio_bank *bank) return -ENODEV; } - gpiochip_set_chained_irqchip(&bank->chip, &gpio_irq_chip, + gpiochip_set_chained_irqchip(&bank->chip, irqc, bank->irq, omap_gpio_irq_handler); for (j = 0; j < bank->width; j++) { @@ -1172,6 +1162,7 @@ static int omap_gpio_probe(struct platform_device *pdev) const struct omap_gpio_platform_data *pdata; struct resource *res; struct gpio_bank *bank; + struct irq_chip *irqc; int ret; match = of_match_device(of_match_ptr(omap_gpio_match), dev); @@ -1186,6 +1177,18 @@ static int omap_gpio_probe(struct platform_device *pdev) return -ENOMEM; } + irqc = devm_kzalloc(dev, sizeof(*irqc), GFP_KERNEL); + if (!irqc) + return -ENOMEM; + + irqc->irq_shutdown = omap_gpio_irq_shutdown, + irqc->irq_ack = omap_gpio_ack_irq, + irqc->irq_mask = omap_gpio_mask_irq, + irqc->irq_unmask = omap_gpio_unmask_irq, + irqc->irq_set_type = omap_gpio_irq_type, + irqc->irq_set_wake = omap_gpio_wake_enable, + irqc->name = dev_name(&pdev->dev); + res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (unlikely(!res)) { dev_err(dev, "Invalid IRQ resource\n"); @@ -1241,7 +1244,7 @@ static int omap_gpio_probe(struct platform_device *pdev) omap_gpio_mod_init(bank); - ret = omap_gpio_chip_init(bank); + ret = omap_gpio_chip_init(bank, irqc); if (ret) return ret;