From patchwork Fri May 22 14:35:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: grygorii.strashko@linaro.org X-Patchwork-Id: 475623 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 84F4F140E46 for ; Sat, 23 May 2015 00:36:24 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757252AbbEVOgX (ORCPT ); Fri, 22 May 2015 10:36:23 -0400 Received: from mail-lb0-f182.google.com ([209.85.217.182]:34234 "EHLO mail-lb0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757251AbbEVOgK (ORCPT ); Fri, 22 May 2015 10:36:10 -0400 Received: by lbcmx3 with SMTP id mx3so14322187lbc.1 for ; Fri, 22 May 2015 07:36:08 -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:in-reply-to :references; bh=uOG0Am7guKUlwX8ASs/oHN+Ht8IkOfViqJnuzOZVDwM=; b=bjytUjeOSf6sVqR2eZn+9l9i9L4baHzhy2gLGoYaUvDYj8bhfbxjQ2BJaJ2CrZLAkD u+Pzzt7Q80o5FiPdCx6mrJS5w3NrVLbFmbvX6JYgd1uFwCxxxOMvwdqY8BRK/W+H11Qr CiUrj3o50dq87Fwm+67t1wmIUfenr3iivG3ajAJrL6S6z8POh3BNxvcuWmlacDxhK5O9 qr2xAsGlUCxmVn0sOWv8O5OMIxfbaAqoRghRv+sUuAfW+9MCMHqEyPM7lJheUjQE0Rhp MpruwK2jICgvv1wWcnEbba+YH/YWFmULQliL5nn7kRv3NwiyLCsxstTHznSTht6DqOT8 L7cw== X-Gm-Message-State: ALoCoQnXjNAhISxiQ+9JlO87i+g3978/HaPf4hWf/pxQwtmmpGbkmYuJSugicYZt5V+/NNkYDA8H X-Received: by 10.152.1.4 with SMTP id 4mr6723889lai.25.1432305368911; Fri, 22 May 2015 07:36:08 -0700 (PDT) Received: from localhost ([195.238.92.128]) by mx.google.com with ESMTPSA id o5sm533918lag.9.2015.05.22.07.36.08 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 22 May 2015 07:36:08 -0700 (PDT) From: Grygorii Strashko To: Linus Walleij , Alexandre Courbot , tony@atomide.com Cc: Javier Martinez Canillas , ssantosh@kernel.org, Kevin Hilman , linux-omap@vger.kernel.org, linux-gpio@vger.kernel.org, Grygorii Strashko Subject: [RFC/RFT PATCH 4/7] gpio: omap: rework omap_gpio_request to touch only gpio specific registers Date: Fri, 22 May 2015 17:35:51 +0300 Message-Id: <1432305354-5968-5-git-send-email-grygorii.strashko@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1432305354-5968-1-git-send-email-grygorii.strashko@linaro.org> References: <1432305354-5968-1-git-send-email-grygorii.strashko@linaro.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The GPIO Chip and GPIO IRQ Chip functionality are essentially orthogonal, so GPIO Chip implementation shouldn't touch GPIO IRQ specific registers and vise versa. Hence, rework omap_gpio_request: - don't reset GPIO IRQ triggering type to IRQ_TYPE_NONE, because GPIO irqchip should be responsible for that; - call directly omap_enable_gpio_module as all needed checks are already present inside it. Signed-off-by: Grygorii Strashko --- drivers/gpio/gpio-omap.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index d933b99..2fbd569 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -668,14 +668,7 @@ static int omap_gpio_request(struct gpio_chip *chip, unsigned offset) pm_runtime_get_sync(bank->dev); spin_lock_irqsave(&bank->lock, flags); - /* Set trigger to none. You need to enable the desired trigger with - * request_irq() or set_irq_type(). Only do this if the IRQ line has - * not already been requested. - */ - if (!LINE_USED(bank->irq_usage, offset)) { - omap_set_gpio_triggering(bank, offset, IRQ_TYPE_NONE); - omap_enable_gpio_module(bank, offset); - } + omap_enable_gpio_module(bank, offset); bank->mod_usage |= BIT(offset); spin_unlock_irqrestore(&bank->lock, flags);