From patchwork Fri Sep 25 00:56:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 54154 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by patches.linaro.org (Postfix) with ESMTPS id A4E7122DC2 for ; Fri, 25 Sep 2015 00:56:39 +0000 (UTC) Received: by lacao8 with SMTP id ao8sf37501568lac.3 for ; Thu, 24 Sep 2015 17:56:38 -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=4kA2wxCihCaHEJb0Q04A7OA33pDtwSSn/KREAXB1xU0=; b=OTR1If1butQDRQ6Q3C+dEe4hCZV+B79h53ovcbIXJDMbfsa0TOmd/AaDo2HGiPmWCL DVuvnOt7jzuYRSaeEUiAWzhpeqsbbbklemwmV9EjizVU1Xz5km5X8BAxsBkBbz3FdnPv hmUskVnJ4rs0hendRyOKrzM4SAPYMSPyvTmF//qMGJK94EeOSWtXO2ZG+zEQRVRbfP8I TGsQnM2PvMJbXJlDPU5eo3o2uVEKSEPIYNDAiD2pnrKv11Aranhwv8ZxDZSe3mVwT27r 1oJqQPw0CuTPUFkPvVoAmbu3llp5rKfjuypK2PbbXlmWACdhWkgIhRHKgmxFSfps0Odd OAqA== X-Gm-Message-State: ALoCoQmoWcxDZ5LCsFcKvhZp+HVYJz6Z6pSJpf7xGrj4B0IjLBwWyyDvkolnaEP559fb72jupvdN X-Received: by 10.180.105.98 with SMTP id gl2mr1901633wib.0.1443142598493; Thu, 24 Sep 2015 17:56:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.23.155 with SMTP id 27ls220375lfx.49.gmail; Thu, 24 Sep 2015 17:56:38 -0700 (PDT) X-Received: by 10.152.45.41 with SMTP id j9mr758421lam.110.1443142598211; Thu, 24 Sep 2015 17:56:38 -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 i7si501097laf.17.2015.09.24.17.56.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Sep 2015 17:56:37 -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 lacao8 with SMTP id ao8so82071101lac.3 for ; Thu, 24 Sep 2015 17:56:37 -0700 (PDT) X-Received: by 10.25.40.130 with SMTP id o124mr484838lfo.41.1443142597305; Thu, 24 Sep 2015 17:56:37 -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 w3csp629176lbq; Thu, 24 Sep 2015 17:56:36 -0700 (PDT) X-Received: by 10.68.111.228 with SMTP id il4mr3390451pbb.44.1443142596280; Thu, 24 Sep 2015 17:56:36 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sg1si1406479pbc.199.2015.09.24.17.56.36; Thu, 24 Sep 2015 17:56:36 -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 S1752959AbbIYA4f (ORCPT + 3 others); Thu, 24 Sep 2015 20:56:35 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:34798 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752294AbbIYA4f (ORCPT ); Thu, 24 Sep 2015 20:56:35 -0400 Received: by padhy16 with SMTP id hy16so88357564pad.1 for ; Thu, 24 Sep 2015 17:56:34 -0700 (PDT) X-Received: by 10.66.254.101 with SMTP id ah5mr3411011pad.10.1443142594792; Thu, 24 Sep 2015 17:56:34 -0700 (PDT) Received: from localhost.localdomain.localdomain ([70.35.39.2]) by smtp.gmail.com with ESMTPSA id uc1sm672562pab.20.2015.09.24.17.56.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Sep 2015 17:56:33 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Alexandre Courbot , Linus Walleij , Jonas Gorski , Stefan Agner Subject: [PATCH] RFT: gpio: pl061: assign the apropriate handler for irqs Date: Thu, 24 Sep 2015 17:56:26 -0700 Message-Id: <1443142586-14416-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.42 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, after this handle_simple_irq() is only used as default and if the type is not specified. Cc: Jonas Gorski Cc: Stefan Agner Signed-off-by: Linus Walleij --- drivers/gpio/gpio-pl061.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c index 5b1461f6aeed..7dba5545b084 100644 --- a/drivers/gpio/gpio-pl061.c +++ b/drivers/gpio/gpio-pl061.c @@ -180,7 +180,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"); @@ -189,7 +189,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)) { @@ -204,7 +204,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"); @@ -213,6 +213,7 @@ static int pl061_irq_type(struct irq_data *d, unsigned trigger) gpiois &= ~bit; gpioibe &= ~bit; gpioiev &= ~bit; + irq_set_handler_locked(d, handle_simple_irq); dev_warn(gc->dev, "no trigger selected for line %d\n", offset); }