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: 6465001 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AA58DC0020 for ; Fri, 22 May 2015 14:36:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C7C3520499 for ; Fri, 22 May 2015 14:36:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DE3CF20495 for ; Fri, 22 May 2015 14:36:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757254AbbEVOgW (ORCPT ); Fri, 22 May 2015 10:36:22 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:32826 "EHLO mail-lb0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757252AbbEVOgK (ORCPT ); Fri, 22 May 2015 10:36:10 -0400 Received: by lbbzk7 with SMTP id zk7so14373753lbb.0 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=HFZ33/FegvfljnkoxmMJuofqIz+m/NCY+ARfdREl4GBSJuKklvcytYfzFFNm8OZSF5 G9eve5d3p7rdWRCoQHZAUUV2PJFLlGgGqPSaHBA8ZACzDDnQH9CNNbg4RGeDSz78F3Vm yHmm6BDZS2M93OqkA0uWxzWBnonkIIKxDHbO+IEL3bdzX6Lm3FnEZM/HaaPlTlBZIDbq JTgiAijfzMdlvEgxtkPl0p3VdpGwyfeZ3rrp2RBLFE4JfDLjixY/SyfCGwq4WsgQdLqs 5xbgSYduGWIJ4XNlZaKg7n8/EHtLYKBPZ4QtR59Y6UwrjVy5wCbBQoTtTm4QmkO/PiMw JAvg== X-Gm-Message-State: ALoCoQnguWqsTZleoJZUyxtY0n6OKnSd1ZAFUW9arDQEmlK4HNZO+YcHkwu3BhqDBhSVbH8yZSGY 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-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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);