From patchwork Thu Oct 2 05:55:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 38264 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 81815202E7 for ; Thu, 2 Oct 2014 05:55:43 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id b6sf718741lbj.7 for ; Wed, 01 Oct 2014 22:55: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=D5JeeIZqrWVBdSWSicDWZVFDdrIXboUtYmLZnYUIkWw=; b=HMCwg5gmwK54P/t14bIfAzg84hBvEW5c7RQIshRT2kfH4BvEuxd0hf8bOLbWbYLRh4 RD7OYRiV6W0JsEj+9MTvLFFAlFZYJtz6m5vyIN95SeBwjx6yHRle/5p4rl7Nu8zvpGpi aEVQJkRwj9P6ax1MOu57CXezMW54ouHF/0bNIkmJPG0tN9f+Hud0RFgyMNDaNQwQVo2/ WwEmTkYmam2gCTvqVuDTh4JaQLEDUzH6jbR0kVXJ1QLrFfgJfYNq8dYPvp3rfoeQ9T78 MFiOWl/YywZGbJTE3NpWrcX9YiJQY3AqOOiiQO/AATUfmju2g3nhjllg2AP+QJmHHA5+ 5GHA== X-Gm-Message-State: ALoCoQkXm+Gq8tX0Mhr+9KyUO5OD2EqjRTP5W8t1ih8QJ1xzvgq9EzX6E7Q/8ojPQj63eN72sKxR X-Received: by 10.180.89.243 with SMTP id br19mr203470wib.7.1412229342236; Wed, 01 Oct 2014 22:55:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.103 with SMTP id ln7ls220987lac.36.gmail; Wed, 01 Oct 2014 22:55:41 -0700 (PDT) X-Received: by 10.112.145.100 with SMTP id st4mr47265142lbb.17.1412229341928; Wed, 01 Oct 2014 22:55:41 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) by mx.google.com with ESMTPS id kr4si4869106lac.72.2014.10.01.22.55.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 Oct 2014 22:55:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by mail-lb0-f179.google.com with SMTP id l4so1571270lbv.24 for ; Wed, 01 Oct 2014 22:55:41 -0700 (PDT) X-Received: by 10.112.130.226 with SMTP id oh2mr22681590lbb.100.1412229341539; Wed, 01 Oct 2014 22:55: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.112.130.169 with SMTP id of9csp1036lbb; Wed, 1 Oct 2014 22:55:40 -0700 (PDT) X-Received: by 10.68.76.65 with SMTP id i1mr27963084pbw.92.1412229340093; Wed, 01 Oct 2014 22:55:40 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id um1si2884714pac.143.2014.10.01.22.55.39 for ; Wed, 01 Oct 2014 22:55:40 -0700 (PDT) Received-SPF: none (google.com: linux-gpio-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 S1752128AbaJBFzi (ORCPT ); Thu, 2 Oct 2014 01:55:38 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]:60391 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751337AbaJBFzi (ORCPT ); Thu, 2 Oct 2014 01:55:38 -0400 Received: by mail-lb0-f174.google.com with SMTP id p9so1622928lbv.33 for ; Wed, 01 Oct 2014 22:55:37 -0700 (PDT) X-Received: by 10.152.36.134 with SMTP id q6mr61256796laj.35.1412229336795; Wed, 01 Oct 2014 22:55:36 -0700 (PDT) Received: from localhost.localdomain (c83-254-157-117.bredband.comhem.se. [83.254.157.117]) by mx.google.com with ESMTPSA id q10sm1201143lah.5.2014.10.01.22.55.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Oct 2014 22:55:35 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Alexandre Courbot , Linus Walleij Subject: [PATCH 1/2] gpio: stmpe: fix up interrupt enable logic Date: Thu, 2 Oct 2014 07:55:27 +0200 Message-Id: <1412229327-2122-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.9.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.217.179 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: , The STMPE driver assumes that the passed in IRQ type is for rising or falling IRQs, not both, even though the hardware actually supports this perfectly well. Likewise the check for level IRQs is done against just high or low level types, not for the case where it is combined with other IRQs. Signed-off-by: Linus Walleij --- drivers/gpio/gpio-stmpe.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c index 845025a57240..a888e6ec5c6e 100644 --- a/drivers/gpio/gpio-stmpe.c +++ b/drivers/gpio/gpio-stmpe.c @@ -127,19 +127,19 @@ static int stmpe_gpio_irq_set_type(struct irq_data *d, unsigned int type) int regoffset = offset / 8; int mask = 1 << (offset % 8); - if (type == IRQ_TYPE_LEVEL_LOW || type == IRQ_TYPE_LEVEL_HIGH) + if (type & IRQ_TYPE_LEVEL_LOW || type & IRQ_TYPE_LEVEL_HIGH) return -EINVAL; /* STMPE801 doesn't have RE and FE registers */ if (stmpe_gpio->stmpe->partnum == STMPE801) return 0; - if (type == IRQ_TYPE_EDGE_RISING) + if (type & IRQ_TYPE_EDGE_RISING) stmpe_gpio->regs[REG_RE][regoffset] |= mask; else stmpe_gpio->regs[REG_RE][regoffset] &= ~mask; - if (type == IRQ_TYPE_EDGE_FALLING) + if (type & IRQ_TYPE_EDGE_FALLING) stmpe_gpio->regs[REG_FE][regoffset] |= mask; else stmpe_gpio->regs[REG_FE][regoffset] &= ~mask;