From patchwork Wed Apr 23 14:50:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 28897 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f197.google.com (mail-ig0-f197.google.com [209.85.213.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8A508203AC for ; Wed, 23 Apr 2014 14:50:42 +0000 (UTC) Received: by mail-ig0-f197.google.com with SMTP id hn18sf3655198igb.8 for ; Wed, 23 Apr 2014 07:50:42 -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:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=rszibAakJccMQNPqt6PmkMYZmvaUDGNnxbFx3EJ41qA=; b=P3JSa9VS/drVzce3yjcnc2BmRAj7RZRowEJTYU6rsWIWOYqECgvcfCd2qNWFO46thX ixsSnq9sLTHTyAObsm0IwleXI0k2x5w23Y49qy8Eo6eegKpDi21FFhHKMxxjSaZazslY md6rSYnG62I75DXVVn+3YVuDkAnEvR9vC0s5Sfin6Ih2fklZZnDI87XNM+0+bg5XVIEa 8w+xoXUqg9guelEDopH54CwoCWyj2FWa1Dixscmz9COi5L4zHKJ55h4fFkOPgP2jr0gd hwI7U/dGgeDFnfPiwnP1Db1wpKGjssD54HoYiAHkaPb6/ApwCoCRqQwRqQ/n2YT2seJH 6Nzg== X-Gm-Message-State: ALoCoQncbGWwbgJl0Srb6mzLRHpFMses/lUjB8TTZj+D6NnZCxlIIkbiZPiGmqSUDiX2QyffkTN+ X-Received: by 10.182.241.97 with SMTP id wh1mr26409958obc.36.1398264641957; Wed, 23 Apr 2014 07:50:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.19.115 with SMTP id 106ls615736qgg.75.gmail; Wed, 23 Apr 2014 07:50:41 -0700 (PDT) X-Received: by 10.58.248.5 with SMTP id yi5mr395151vec.42.1398264641731; Wed, 23 Apr 2014 07:50:41 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id iy9si204702vec.141.2014.04.23.07.50.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Apr 2014 07:50:41 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id jy13so1295574veb.30 for ; Wed, 23 Apr 2014 07:50:41 -0700 (PDT) X-Received: by 10.220.89.4 with SMTP id c4mr388629vcm.53.1398264641639; Wed, 23 Apr 2014 07:50:41 -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.220.221.72 with SMTP id ib8csp109879vcb; Wed, 23 Apr 2014 07:50:23 -0700 (PDT) X-Received: by 10.68.218.3 with SMTP id pc3mr21175494pbc.71.1398264623564; Wed, 23 Apr 2014 07:50:23 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qa3si764110pbb.278.2014.04.23.07.50.22; Wed, 23 Apr 2014 07:50:23 -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 S1752964AbaDWOuV (ORCPT + 6 others); Wed, 23 Apr 2014 10:50:21 -0400 Received: from mail-we0-f177.google.com ([74.125.82.177]:41208 "EHLO mail-we0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752314AbaDWOuQ (ORCPT ); Wed, 23 Apr 2014 10:50:16 -0400 Received: by mail-we0-f177.google.com with SMTP id u57so954388wes.22 for ; Wed, 23 Apr 2014 07:50:15 -0700 (PDT) X-Received: by 10.180.8.40 with SMTP id o8mr2147041wia.25.1398264614930; Wed, 23 Apr 2014 07:50:14 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id c7sm1828495wjf.19.2014.04.23.07.50.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Apr 2014 07:50:14 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Alexandre Courbot , Linus Walleij , Nishanth Menon , Peter Ujfalusi , Ezequiel Garcia , Javier Martinez Canillas , Tony Lindgren , Santosh Shilimkar , linux-omap Subject: [PATCH] gpio: do not set up hardware for IRQ_TYPE_NONE Date: Wed, 23 Apr 2014 16:50:10 +0200 Message-Id: <1398264610-12663-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.9.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: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) 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: , Some GPIO irqchip drivers exploit the irqdomain mapping function to set up the IRQ default type in the hardware, make sure that if we pass IRQ_TYPE_NONE, no hardware setup whatsoever takes place (this should be the norm) until later when the IRQ gets utilized. Cc: Nishanth Menon Cc: Peter Ujfalusi Cc: Ezequiel Garcia Cc: Javier Martinez Canillas Cc: Tony Lindgren Cc: Santosh Shilimkar Cc: linux-omap Signed-off-by: Linus Walleij Tested-by: Javier Martinez Canillas Tested-by: Nishanth Menon Acked-by: Nishanth Menon Tested-by: Peter Ujfalusi --- TI folks: can you provide a Tested-by tag if this makes your OMAPs work? I am pretty sure the other platforms will be unaffected, if they aren't I will switch them over to react to IRQ_TYPE_DEFAULT. --- drivers/gpio/gpiolib.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index ee1819fdcf35..97d173e9aa2d 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1409,7 +1409,12 @@ static int gpiochip_irq_map(struct irq_domain *d, unsigned int irq, #else irq_set_noprobe(irq); #endif - irq_set_irq_type(irq, chip->irq_default_type); + /* + * No set-up of the hardware will happen if IRQ_TYPE_NONE + * is passed as default type. + */ + if (chip->irq_default_type != IRQ_TYPE_NONE) + irq_set_irq_type(irq, chip->irq_default_type); return 0; } @@ -1490,7 +1495,8 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip) * @first_irq: if not dynamically assigned, the base (first) IRQ to * allocate gpiochip irqs from * @handler: the irq handler to use (often a predefined irq core function) - * @type: the default type for IRQs on this irqchip + * @type: the default type for IRQs on this irqchip, pass IRQ_TYPE_NONE + * to have the core avoid setting up any default type in the hardware. * * This function closely associates a certain irqchip with a certain * gpiochip, providing an irq domain to translate the local IRQs to