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: 522620 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4826F140783 for ; Fri, 25 Sep 2015 10:56:36 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752959AbbIYA4f (ORCPT ); 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-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=xPBs6GyNiCrTG1xQuoxl/WoHbvWtVJMCm07G11JsUTw=; b=lqx1V2+3Scbr1JqkeC+Mfydd7Zyq/FBGKdGhiQYAKVEUfpdTG0gP8eT4Vp/uYjRMzB 9vpQWrwdZXIUGnrcIIfikou5WTv88DWK7HuYYCpZjvUwFv6UN6X0CcxivjGDyNjrP5r8 ZiJPSItBjU6kKU4LniTigoY21vaOJ7XdMCc2aU+0m0gbVo6zSQkH8xZjfD0opME+Uv6V sdP3aIC5BwKFE1CHAQfn3DL4dXvTfdy6p+BKSE5qPg+GsSVLk9f+MR4ntVWKCjR3kMk4 aZ8pvcYYgjnVa7C0Nculdxu3P9R9cgyE7BQwbSNnbe12MgYQpXjh1lIdBYrywxNt6Pf+ k3BQ== X-Gm-Message-State: ALoCoQke00w3fY237CsSSj8uBl/i14pQxXNjA7H1+mpK9qRRZflBIKdDlTB4pDr4hyFF1P1wlaE1 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: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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); }