From patchwork Thu Oct 15 15:01:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 55032 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lf0-f72.google.com (mail-lf0-f72.google.com [209.85.215.72]) by patches.linaro.org (Postfix) with ESMTPS id 0B32F2301F for ; Thu, 15 Oct 2015 15:01:37 +0000 (UTC) Received: by lfbe131 with SMTP id e131sf3728017lfb.3 for ; Thu, 15 Oct 2015 08:01:36 -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=3tIx+Q0pjvjgG9swVxGQTjagiRsNklMNqX/jWVxqaBE=; b=geTdbDRvRWsB0izz8xROoqyJY/NIRF3AEiqXEe9+Ksc1wppZJXClSPH5aw1wOgLx0E bw9CowGANTZT8k6jWGpoB7PXgoyMjn4BDAjgMXvDUbtgvxYLM7xMineP/sowKW/E/Xy/ kdYIRo1TtdAaEIuDMkRKmfoMLSD5ytDXeL0JGcsSfW/1E/1k45eUWmA1cLYBuDBaiEdh 4/W7EVbKb1f21lBYyXUtTA0ArZEAlYwixC5heeBK3vpHR+avXFS5JD9xjhlYA+fmYSsX NSTMHfBSErOAenbsxmLJvI5EoAhOaLkQUJ9gdilR3HlnKq1AQ9gFlyKynQPaFmc0ji8E Pe7A== X-Gm-Message-State: ALoCoQm/EUVd/p/bRyNvQOxlznSg/jGfUJ8tC+hRfGOZ/EglQLXE1+ysJHqBRqAcVtHwOXJ5VlBM X-Received: by 10.112.130.41 with SMTP id ob9mr2263940lbb.17.1444921295920; Thu, 15 Oct 2015 08:01:35 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.155.70 with SMTP id d67ls157049lfe.25.gmail; Thu, 15 Oct 2015 08:01:35 -0700 (PDT) X-Received: by 10.25.24.27 with SMTP id o27mr3149652lfi.5.1444921295770; Thu, 15 Oct 2015 08:01:35 -0700 (PDT) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id b7si9393877lfb.164.2015.10.15.08.01.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2015 08:01:35 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by lffy185 with SMTP id y185so31113000lff.2 for ; Thu, 15 Oct 2015 08:01:35 -0700 (PDT) X-Received: by 10.25.28.81 with SMTP id c78mr3170379lfc.29.1444921294930; Thu, 15 Oct 2015 08:01:34 -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.59.35 with SMTP id w3csp686141lbq; Thu, 15 Oct 2015 08:01:33 -0700 (PDT) X-Received: by 10.68.65.13 with SMTP id t13mr10645836pbs.43.1444921293696; Thu, 15 Oct 2015 08:01:33 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id kh6si22201350pad.102.2015.10.15.08.01.33; Thu, 15 Oct 2015 08:01:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-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 S1752389AbbJOPBd (ORCPT + 3 others); Thu, 15 Oct 2015 11:01:33 -0400 Received: from mail-lf0-f45.google.com ([209.85.215.45]:36447 "EHLO mail-lf0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752031AbbJOPBc (ORCPT ); Thu, 15 Oct 2015 11:01:32 -0400 Received: by lfeh64 with SMTP id h64so30686914lfe.3 for ; Thu, 15 Oct 2015 08:01:31 -0700 (PDT) X-Received: by 10.25.82.10 with SMTP id g10mr3272424lfb.56.1444921287991; Thu, 15 Oct 2015 08:01:27 -0700 (PDT) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id oh8sm2110471lbb.29.2015.10.15.08.01.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2015 08:01:27 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Alexandre Courbot , Linus Walleij , Jonas Gorski , Stefan Agner Subject: [PATCH v2] gpio: pl061: assign the apropriate handler for irqs Date: Thu, 15 Oct 2015 17:01:24 +0200 Message-Id: <1444921284-18513-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 Sender: linux-gpio-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-gpio@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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) smtp.mailfrom=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: , The PL061 can handle level IRQs and edge IRQs, however it is just utilizing handle_simple_irq() for all IRQs. Inspired by Stefan Agners patch to vf610, this assigns the right handler depending on what type is set up, and after this handle_bad_irq() is only used as default and if the type is not specified, as is done in the OMAP driver: defining the IRQ type is really not optional for this driver. Cc: Jonas Gorski Cc: Stefan Agner Signed-off-by: Linus Walleij --- drivers/gpio/gpio-pl061.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c index 179339739d60..d3ce82ebe650 100644 --- a/drivers/gpio/gpio-pl061.c +++ b/drivers/gpio/gpio-pl061.c @@ -181,7 +181,7 @@ static int pl061_irq_type(struct irq_data *d, unsigned trigger) gpioiev |= bit; else gpioiev &= ~bit; - + irq_set_handler_locked(d, handle_level_irq); dev_dbg(gc->dev, "line %d: IRQ on %s level\n", offset, polarity ? "HIGH" : "LOW"); @@ -190,7 +190,7 @@ static int pl061_irq_type(struct irq_data *d, unsigned trigger) gpiois &= ~bit; /* Select both edges, setting this makes GPIOEV be ignored */ gpioibe |= bit; - + irq_set_handler_locked(d, handle_edge_irq); dev_dbg(gc->dev, "line %d: IRQ on both edges\n", offset); } else if ((trigger & IRQ_TYPE_EDGE_RISING) || (trigger & IRQ_TYPE_EDGE_FALLING)) { @@ -205,7 +205,7 @@ static int pl061_irq_type(struct irq_data *d, unsigned trigger) gpioiev |= bit; else gpioiev &= ~bit; - + irq_set_handler_locked(d, handle_edge_irq); dev_dbg(gc->dev, "line %d: IRQ on %s edge\n", offset, rising ? "RISING" : "FALLING"); @@ -214,6 +214,7 @@ static int pl061_irq_type(struct irq_data *d, unsigned trigger) gpiois &= ~bit; gpioibe &= ~bit; gpioiev &= ~bit; + irq_set_handler_locked(d, handle_bad_irq); dev_warn(gc->dev, "no trigger selected for line %d\n", offset); } @@ -338,7 +339,7 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id) } ret = gpiochip_irqchip_add(&chip->gc, &pl061_irqchip, - irq_base, handle_simple_irq, + irq_base, handle_bad_irq, IRQ_TYPE_NONE); if (ret) { dev_info(&adev->dev, "could not add irqchip\n");