From patchwork Mon Oct 14 11:11:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 176164 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp4362572ill; Mon, 14 Oct 2019 04:12:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqy7JvG0ngEF5QwWEVGiax8kxF1TdD4xfpxVPxXvGHAlvWQjydfBrF/9Cd9foXi7sAOXku1a X-Received: by 2002:a17:906:ce2e:: with SMTP id sd14mr28714021ejb.197.1571051527596; Mon, 14 Oct 2019 04:12:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571051527; cv=none; d=google.com; s=arc-20160816; b=oR1aKsggH9K+MzNcLncjPNGluLXWJiphYnCEtR8+YUk3UcB2wNPpGnPYoMrkp+gMpW oD7hEPepw2s3roQENbGfruXHasYz5Ykky7AfJSHmLYk8ofgoqrRwPf0TUs9E/cudS1Fa o749PMQ91xKoaSpjMACXL03tXP9rWSNSARegRZgI6uVGlv9rRxFVzpmjLaNF9Nq5Y0xt x0ZLJxmdEV0c6Q8NjzvTMF7efueLzpURQNo52abKWjjeQ7nVvREqX6RhWKDLVJiyDAvO SeKU/Kfve9V6YuQ6uIG7RIEnNFjhhWAQPAHjsQqEIQrDBrxOQ+3VXyi51v91cpl79fzX 2VEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=9jY9SO8cAVJjVc5s917aON7QONtf2+N68XWw8wtVhqI=; b=xTX1l3LActgCWdR9ofwgtlJ27JU5zznRdZWhT5jJtUy1069D4zzCcKTqPrlj7AWySn mYOR7viI8mNsmo5q9JwHeEISuPUDTP/gAZ+8SoSD/WV5SSWbFxIR5dhNhkrYDvxj9dGO nSc29b18rMXlcqba3d7dI0pJ/qG8gMIkqL36+yea9GPlTb/BG0N3+v24kCLpIlKnlmGG +5bRGTQhhe1KoAIs/eYoXdW/dYxOsoNzzo/BM9qZATYhNnw37HSgykVKP7sWJnJDJcBQ ybojrxUm/0CePENF9QSOSIwgTIbnd6aCK/R9+DKazP/Y6ILa0KKSsK+84gHuDtAeqFCZ pVfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vTAsqsyc; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b30si12670712eda.200.2019.10.14.04.12.07; Mon, 14 Oct 2019 04:12:07 -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; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vTAsqsyc; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731817AbfJNLME (ORCPT + 5 others); Mon, 14 Oct 2019 07:12:04 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:41834 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731261AbfJNLMD (ORCPT ); Mon, 14 Oct 2019 07:12:03 -0400 Received: by mail-lj1-f193.google.com with SMTP id f5so16205072ljg.8 for ; Mon, 14 Oct 2019 04:12:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9jY9SO8cAVJjVc5s917aON7QONtf2+N68XWw8wtVhqI=; b=vTAsqsycVsHQn6i7Z+HAWZL4+9eHQh6KvsnLi7sH1GCaosgYrLD1v+3beQPkOgj8EO 7WaUVhUzULIvVG7gSyNIve/N3wP10XbWzb1i2Oh5+AXD3le48d6wl+ekvCJVQROj00QH DSrYUoB+jyfW8+o9Q1iblqKF3dFSs9eMjwH6UmOwi4msUuS2yDi+sZskgtGHQSeY7hKW 9RcX7yV9Prc/FcwRId4ppjef9es8eIPcq11JPZPNWMpNOF9abGqAZS5H06RLaCiZB+gT Oen3gK8y7qd0Ax0YfxKWCVgiu6BRpBPFxU5pmx0f24+CNg8AzA1ZZx60KQKpueOOY1PD /Gkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9jY9SO8cAVJjVc5s917aON7QONtf2+N68XWw8wtVhqI=; b=NlJmtpwyniJBASKJYWK+EakTQEjBMSkdTPJmp5E2BYQe5cLMhwzO7AsPf1vvU3V8uj QvLcG3OkzsDZaki0VgntytnDQU54K5DZfdLHRFCO5oWwMOaFprGBh4IWE5AjrlOhPe9i X6UHTf8K6j/7NHn3Zlr/3A9dCsLgG2ooDBHSMeDgNbyj8H7GqXAyVI1x1AWkVoJA9xV4 BfUqOHvtC9K0dcmoDe6L1CZiGCFriCPFkEUGvIAHouDOplqASrt3yB+pK1oQijLtDyGA g669gIrGgCXN1kSkXzXQYs1DFmAeNQPuNfnAP1Y9zAqOqtsbJkrCZBTY84DhC9vEStKw GzxQ== X-Gm-Message-State: APjAAAXPTrsNKvf3fQWHnMXWPqpooVNZehPxXL0yc3QBTYqC6UXymlCS YjeALo9DGN6ynEqrWoLiK1sYnEVg8tc= X-Received: by 2002:a2e:2b91:: with SMTP id r17mr18564608ljr.1.1571051521113; Mon, 14 Oct 2019 04:12:01 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id v1sm4251873lfa.87.2019.10.14.04.11.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2019 04:11:59 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Ulf Hansson , Lina Iyer Subject: [PATCH 1/3] pinctrl: nomadik: Drop support for latent IRQ Date: Mon, 14 Oct 2019 13:11:52 +0200 Message-Id: <20191014111154.9731-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The latent IRQs are IRQs that have occurred when the system was down in deep sleep and the GPIO block was powered off. The PRCMU (power reset and control unit) knows which GPIO line offset fired an IRQ to wake the system up (if so desired) and this second IRQ was used to replay the action when the system came back online after suspend(). This is now known to be the wrong approach to solve this problem: in a patch series Lina Iyer has suggested to instead make it possible to model the IRQs as hierarchical with double parents. Also the current device trees do not contain the right information to make this code work, the latent IRQ is not specified nowadays giving noise like this in the console: [ 0.612168] gpio 8012e000.gpio: IRQ index 1 not found [ 0.622523] gpio 8012e080.gpio: IRQ index 1 not found Let's delete the latent IRQ code and reimplement it properly when we need it. Cc: Ulf Hansson Cc: Lina Iyer Signed-off-by: Linus Walleij --- drivers/pinctrl/nomadik/pinctrl-nomadik.c | 21 --------------------- 1 file changed, 21 deletions(-) -- 2.21.0 diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c index 2a8190b11d10..dc81de15b85e 100644 --- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c +++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c @@ -249,8 +249,6 @@ struct nmk_gpio_chip { struct clk *clk; unsigned int bank; unsigned int parent_irq; - int latent_parent_irq; - u32 (*get_latent_status)(unsigned int bank); void (*set_ioforce)(bool enable); spinlock_t lock; bool sleepmode; @@ -832,15 +830,6 @@ static void nmk_gpio_irq_handler(struct irq_desc *desc) __nmk_gpio_irq_handler(desc, status); } -static void nmk_gpio_latent_irq_handler(struct irq_desc *desc) -{ - struct gpio_chip *chip = irq_desc_get_handler_data(desc); - struct nmk_gpio_chip *nmk_chip = gpiochip_get_data(chip); - u32 status = nmk_chip->get_latent_status(nmk_chip->bank); - - __nmk_gpio_irq_handler(desc, status); -} - /* I/O Functions */ static int nmk_gpio_get_dir(struct gpio_chip *chip, unsigned offset) @@ -1104,7 +1093,6 @@ static int nmk_gpio_probe(struct platform_device *dev) struct nmk_gpio_chip *nmk_chip; struct gpio_chip *chip; struct irq_chip *irqchip; - int latent_irq; bool supports_sleepmode; int irq; int ret; @@ -1125,15 +1113,11 @@ static int nmk_gpio_probe(struct platform_device *dev) if (irq < 0) return irq; - /* It's OK for this IRQ not to be present */ - latent_irq = platform_get_irq(dev, 1); - /* * The virt address in nmk_chip->addr is in the nomadik register space, * so we can simply convert the resource address, without remapping */ nmk_chip->parent_irq = irq; - nmk_chip->latent_parent_irq = latent_irq; nmk_chip->sleepmode = supports_sleepmode; spin_lock_init(&nmk_chip->lock); @@ -1194,11 +1178,6 @@ static int nmk_gpio_probe(struct platform_device *dev) irqchip, nmk_chip->parent_irq, nmk_gpio_irq_handler); - if (nmk_chip->latent_parent_irq > 0) - gpiochip_set_chained_irqchip(chip, - irqchip, - nmk_chip->latent_parent_irq, - nmk_gpio_latent_irq_handler); dev_info(&dev->dev, "at address %p\n", nmk_chip->addr); From patchwork Mon Oct 14 11:11:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 176165 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp4362584ill; Mon, 14 Oct 2019 04:12:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6bTkmLaKXjSR6Dm/1bbQf43l5/vmDwJwXKd2VlOsEOBh9MUhPZgWRWzkciRryEn0VZl/q X-Received: by 2002:a17:906:1dd3:: with SMTP id v19mr28485205ejh.35.1571051528195; Mon, 14 Oct 2019 04:12:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571051528; cv=none; d=google.com; s=arc-20160816; b=hVOABfdOPEWWagFxlCv3qCWPlbAJKWaBGtzicLlZo00bu5WLsVXftxZqoKX+G5vwNg 5uWnTct4XFfK0uFJRo2eTACTMZBPsR08O1B/kCSIEddytDti9NSQ6b6D4sDybCeNOz6b vmn+2+Vc4cG30jbd1qzhOwefKgg2Ibe+ZII2poMvHIK9PxjendUH2u9gi40s9zGmrl5K f+wPjxXjjzaiIfNOvTUr5iToPhBbxKC+dxHMzBjXHfeRJR2lXO+KjthKaXLNq7+qC0qO 5J6YpBGJg3GgNsg4MYq3hB/JlY1TPOjmnIb6KI0uNio7hXK5jC/S6cOXyZtgiS/uxzmE rqlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tcZZ6ZPdok6Kk736n6qZ8YbGbyEzcHu0t7K2yZwv/ao=; b=Y1QBxeKSvO2lH66GnO1vj4cGRAArgmxkjLNQ7kTiXcPvBlCw9BMI+2VOqwiqU/WKAS kV1TPyY7+9MtTZlud3IRQG85QaIWAhTDBdXhs3eH1bEz2p415Q756vw14lg801W8rHZp fnEw5fVu8ua+zzKhgVWUVhAuihiIfOJoEVi6rEfOPd1j3zJ4mMfJlL6nOnQdZrMpRyFh w64B+JRz1gt1xYAoJyNI5CQUIOh67Iz/lBQjBAbERQ//690vMRKzOgHPzQnXVakD7jsh C7BTFpoLEa7aCZpYI9bu4/M9qpGvrVLOr/lxXknGdQLhRuEIore9Hf9f4XyKsvKEs0eU C7Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YQC4SXzx; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b30si12670712eda.200.2019.10.14.04.12.08; Mon, 14 Oct 2019 04:12:08 -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; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YQC4SXzx; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731822AbfJNLMH (ORCPT + 5 others); Mon, 14 Oct 2019 07:12:07 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:38527 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731261AbfJNLMH (ORCPT ); Mon, 14 Oct 2019 07:12:07 -0400 Received: by mail-lj1-f193.google.com with SMTP id b20so16226279ljj.5 for ; Mon, 14 Oct 2019 04:12:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tcZZ6ZPdok6Kk736n6qZ8YbGbyEzcHu0t7K2yZwv/ao=; b=YQC4SXzxMuSAUCRG0V/EV6fS49eCSFO2KCqd3VHvVBOqiYbmosh/z8dWEwKt1UAFoP ZROWm+S4XrJVzZyK3ibAW9AF6Y6ilEa2J8H2jdlw36++ti3x+6RrZXZlKJb6hcSysEgw f2au/kCF7jz3jW9zIiDMcdYF53ibgXhgCyiWdqEqFAZpMNFJStNBCPrNCGr3tPAKGZlI DHGxI1fWvIRSA4DDdfbWTritZ0zogwBS7mIz8HSA6QR6n1fTrkFq+uAoZnaUt7ImZLkq yB5U6RGfU+EzBvMYPDskq/RtxcZ6OrTKYqIGaFXly6lDiwx1wegO2Ezd066jY6xPYbNd Jm/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tcZZ6ZPdok6Kk736n6qZ8YbGbyEzcHu0t7K2yZwv/ao=; b=HqWBy+mRUqc5dqfyQP2kp66Z+YhW77LWBbJc9R3IUPwJU+AsJPIpo8Xelgh/tKseOp Ha12+gpSA601vx9cLxriZbtnhTpR6E684GgLCInhrMHeHE2YyGrOK1axKQ9MTO3z47uf JkEp/vAxjDFHIWryOz1S1C1EJTkcZehqRrm/x0T6qhiKqfoWCyoKXjTbYBm/JEPhBDMZ zCJHpxken6Bm0DR+XJwLz1nwptDAYYj/oxEEMBa1pRw+HKqHeUWo2+w6F1B9VvKn/JCb DOJJnsnpCzx6uQ9c/SqxGzbObRIXlv5jAu/8IYVSuJ/RkXiiMqaLwQ4PBR2bGEbN7syU 4vEg== X-Gm-Message-State: APjAAAUVNC1WtRr5NUol3zgFuIstoS4OeJ05ciBuhq4uHYrKXVuyKHSR AjqFXWfPvDqS5SO/CcHB77NxQw902w8= X-Received: by 2002:a2e:207:: with SMTP id 7mr18077686ljc.198.1571051523942; Mon, 14 Oct 2019 04:12:03 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id v1sm4251873lfa.87.2019.10.14.04.12.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2019 04:12:02 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Thierry Reding Subject: [PATCH 2/3] pinctrl: nomadik: Pass irqchip when adding gpiochip Date: Mon, 14 Oct 2019 13:11:53 +0200 Message-Id: <20191014111154.9731-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191014111154.9731-1-linus.walleij@linaro.org> References: <20191014111154.9731-1-linus.walleij@linaro.org> MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org We need to convert all old gpio irqchips to pass the irqchip setup along when adding the gpio_chip. For more info see drivers/gpio/TODO. For chained irqchips this is a pretty straight-forward conversion. Cc: Thierry Reding Signed-off-by: Linus Walleij --- drivers/pinctrl/nomadik/pinctrl-nomadik.c | 39 +++++++++-------------- 1 file changed, 15 insertions(+), 24 deletions(-) -- 2.21.0 diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c index dc81de15b85e..b7992da8b569 100644 --- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c +++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c @@ -248,7 +248,6 @@ struct nmk_gpio_chip { void __iomem *addr; struct clk *clk; unsigned int bank; - unsigned int parent_irq; void (*set_ioforce)(bool enable); spinlock_t lock; bool sleepmode; @@ -1092,6 +1091,7 @@ static int nmk_gpio_probe(struct platform_device *dev) struct device_node *np = dev->dev.of_node; struct nmk_gpio_chip *nmk_chip; struct gpio_chip *chip; + struct gpio_irq_chip *girq; struct irq_chip *irqchip; bool supports_sleepmode; int irq; @@ -1117,7 +1117,6 @@ static int nmk_gpio_probe(struct platform_device *dev) * The virt address in nmk_chip->addr is in the nomadik register space, * so we can simply convert the resource address, without remapping */ - nmk_chip->parent_irq = irq; nmk_chip->sleepmode = supports_sleepmode; spin_lock_init(&nmk_chip->lock); @@ -1147,6 +1146,19 @@ static int nmk_gpio_probe(struct platform_device *dev) chip->base, chip->base + chip->ngpio - 1); + girq = &chip->irq; + girq->chip = irqchip; + girq->parent_handler = nmk_gpio_irq_handler; + girq->num_parents = 1; + girq->parents = devm_kcalloc(&dev->dev, 1, + sizeof(*girq->parents), + GFP_KERNEL); + if (!girq->parents) + return -ENOMEM; + girq->parents[0] = irq; + girq->default_type = IRQ_TYPE_NONE; + girq->handler = handle_edge_irq; + clk_enable(nmk_chip->clk); nmk_chip->lowemi = readl_relaxed(nmk_chip->addr + NMK_GPIO_LOWEMI); clk_disable(nmk_chip->clk); @@ -1158,28 +1170,7 @@ static int nmk_gpio_probe(struct platform_device *dev) platform_set_drvdata(dev, nmk_chip); - /* - * Let the generic code handle this edge IRQ, the the chained - * handler will perform the actual work of handling the parent - * interrupt. - */ - ret = gpiochip_irqchip_add(chip, - irqchip, - 0, - handle_edge_irq, - IRQ_TYPE_NONE); - if (ret) { - dev_err(&dev->dev, "could not add irqchip\n"); - gpiochip_remove(&nmk_chip->chip); - return -ENODEV; - } - /* Then register the chain on the parent IRQ */ - gpiochip_set_chained_irqchip(chip, - irqchip, - nmk_chip->parent_irq, - nmk_gpio_irq_handler); - - dev_info(&dev->dev, "at address %p\n", nmk_chip->addr); + dev_info(&dev->dev, "chip registered\n"); return 0; } From patchwork Mon Oct 14 11:11:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 176166 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp4362598ill; Mon, 14 Oct 2019 04:12:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxc21t6g3/jEWUeEBShOJ5W6U10tRH3gei/nMkJDYpoEPAgsp7Agw/egbxn2H0xdarnkLUA X-Received: by 2002:a05:6402:3046:: with SMTP id bu6mr27624440edb.276.1571051528981; Mon, 14 Oct 2019 04:12:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571051528; cv=none; d=google.com; s=arc-20160816; b=uSSl/HuLcSvZ00mFD5uQhEDt9VJTpNVlnVKEGlFeT26EknSM9EsGeUPIYROWCyxAGB OJPcSQPfNztwGdfDZfUV61hEOEXcfDpACQIO/nR+T8tp5CZxLt+0ORvBozA50YjP0HpC rtSFtLgjz02KjdM0w27LMU2XLkKcjtV4quNRFhmJXWufPygO69D3yykbiR82sD5M3x/P jMvAz2/+e54/KDQHKnBPpXnuLK1lfJgjEnhKdFGsL5Y9T5YaZLVUiQSO+sqF7BXRAXgU Q/qRVmW3J0TNeywrA2kYveSO9NPeTfOZssw5tB4NOgKTC7TbsqcQhL0M//3XWWrd+O8y CGag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lLAwKxjizePuXeriEk6s9/kmuKqiEm1PHCLwIUVIM74=; b=dZznWRo/FVbFTr7S4gCR+gqMYwfoMA1jbYUN0U8cYmv4IkxD7dYc8k/1Auqtz54aXY Th7IDhe3x0YHlq9R84KIP7wykNsbzEcQDiqaKamm3zii8xvdtppwEGh0xW+OyLMb3Sss YT51B8Sx3x02p7bGWEDfOzZZLxVRc1FZLqyCZm703vJbdgE3PzRhgDVy6KISIhUT0xAb VM3Z+SU634iM9wznsg6qd8BXLgId/Y5qeqgtkqRtraGSQ+5oJ366emlm6uxs1/93T5U1 rLZ/zumcmU/172ao6CGUXLawalrWgyDUUHUupuJvArYk+0Qr5HqaeUGpPRsK7NIRNBao xzMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tr9zIIau; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b30si12670712eda.200.2019.10.14.04.12.08; Mon, 14 Oct 2019 04:12:08 -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; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tr9zIIau; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731261AbfJNLMI (ORCPT + 5 others); Mon, 14 Oct 2019 07:12:08 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:42135 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731821AbfJNLMI (ORCPT ); Mon, 14 Oct 2019 07:12:08 -0400 Received: by mail-lj1-f194.google.com with SMTP id y23so16172854lje.9 for ; Mon, 14 Oct 2019 04:12:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lLAwKxjizePuXeriEk6s9/kmuKqiEm1PHCLwIUVIM74=; b=Tr9zIIauf9j6fhMn/KOnEVIsQZhdZ37zsRPpjiSsxZNRf+QtlGRU/24omlNIz9ancV /f66nTB4d0aKCWhOOiit93ikxbtPbsLqGRgVsnkWrwwWlBFIOYEUhyoeQwUKnHujLmSi 0fbAgpQjryL/1mJAV97OHO2XtELragcu+6gwwa8kLDLPzx/VKyl423nTZBtPP+Rxv/nA DAm1uAAKQOAtKhiep6fF0wcHRPSh8gTXAgmwAnZGnq/NB96CqnGmcIcokf9utT6NuP/N QqaipDmIgh2ZFsROPZ5rrEZRLtP/nU8UAQu1LITZsjoylxEWodqt8jdnVmP4j7O55wUr DlNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lLAwKxjizePuXeriEk6s9/kmuKqiEm1PHCLwIUVIM74=; b=auCK9deSQC8hjjyNqo0GQ/uoFUjccJCrdWYpMd0bZOggQy48d3RQmRQqt2AluGJVOc KOrjNXG284Cs1beciskMy0qx470J54rkzDMwxZglWbzps1iniPa+VNzDAS8PyAyhSv0u swobhp24SLGDpjVvujBeaBV5ZuRm9ZCdNNCnBDBmJurvYHvJ1aWVvwURV0sBgNCYBR5P kJ7q6R5oMiyhsVVFfxLxfPA3FSIGfXVSymHLxlY/SPKZRwN2eJVgUCsn4jPB6LhhwH/s WlHQQxyxhXE2CjqwLOxxRksCAD8dRVEjw2IT4BNeDq3GCcQVeFMjJHa+uHClz5lEZ6yq 6+8Q== X-Gm-Message-State: APjAAAXgkjINZbkyis1yMWkp6W12Poq48V22DAG7qBrcZWj1lmzOSt2+ xl+WPsrFQC/ljYZdZKbW0xDjgLAuWJ8= X-Received: by 2002:a2e:9695:: with SMTP id q21mr18237842lji.105.1571051525713; Mon, 14 Oct 2019 04:12:05 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id v1sm4251873lfa.87.2019.10.14.04.12.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2019 04:12:04 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij Subject: [PATCH 3/3] pinctrl: nomadik: Simplify interrupt handler Date: Mon, 14 Oct 2019 13:11:54 +0200 Message-Id: <20191014111154.9731-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191014111154.9731-1-linus.walleij@linaro.org> References: <20191014111154.9731-1-linus.walleij@linaro.org> MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The inner interrupt handler was for the latent IRQ handling, and that will never be used, inline the unnecessary function. Signed-off-by: Linus Walleij --- drivers/pinctrl/nomadik/pinctrl-nomadik.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) -- 2.21.0 diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c index b7992da8b569..95f864dfdef4 100644 --- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c +++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c @@ -799,13 +799,19 @@ static void nmk_gpio_irq_shutdown(struct irq_data *d) clk_disable(nmk_chip->clk); } -static void __nmk_gpio_irq_handler(struct irq_desc *desc, u32 status) +static void nmk_gpio_irq_handler(struct irq_desc *desc) { struct irq_chip *host_chip = irq_desc_get_chip(desc); struct gpio_chip *chip = irq_desc_get_handler_data(desc); + struct nmk_gpio_chip *nmk_chip = gpiochip_get_data(chip); + u32 status; chained_irq_enter(host_chip, desc); + clk_enable(nmk_chip->clk); + status = readl(nmk_chip->addr + NMK_GPIO_IS); + clk_disable(nmk_chip->clk); + while (status) { int bit = __ffs(status); @@ -816,19 +822,6 @@ static void __nmk_gpio_irq_handler(struct irq_desc *desc, u32 status) chained_irq_exit(host_chip, desc); } -static void nmk_gpio_irq_handler(struct irq_desc *desc) -{ - struct gpio_chip *chip = irq_desc_get_handler_data(desc); - struct nmk_gpio_chip *nmk_chip = gpiochip_get_data(chip); - u32 status; - - clk_enable(nmk_chip->clk); - status = readl(nmk_chip->addr + NMK_GPIO_IS); - clk_disable(nmk_chip->clk); - - __nmk_gpio_irq_handler(desc, status); -} - /* I/O Functions */ static int nmk_gpio_get_dir(struct gpio_chip *chip, unsigned offset)