From: Grant Likely <grant.likely@secretlab.ca>
To: Mika Westerberg <mika.westerberg@linux.intel.com>,
linux-kernel@vger.kernel.org
Cc: linus.walleij@stericsson.com,
Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: Re: [PATCH 3/3] gpio: langwell: clear IRQ edge detect registers at init
Date: Thu, 05 Apr 2012 21:39:49 -0700 [thread overview]
Message-ID: <20120406043949.BDE543E0E10@localhost> (raw)
In-Reply-To: <1333617317-28437-3-git-send-email-mika.westerberg@linux.intel.com>
On Thu, 5 Apr 2012 12:15:17 +0300, Mika Westerberg <mika.westerberg@linux.intel.com> wrote:
> The boot firmware might leave the registers configured causing interrupts
> to happen even when no handler for them is yet registered. Fix this by
> clearing the IRQ edge detect registers at init.
>
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Applied, thanks
g.
> ---
> drivers/gpio/gpio-langwell.c | 21 +++++++++++++++++++++
> 1 files changed, 21 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/gpio/gpio-langwell.c b/drivers/gpio/gpio-langwell.c
> index bc15ae3..52f00d3 100644
> --- a/drivers/gpio/gpio-langwell.c
> +++ b/drivers/gpio/gpio-langwell.c
> @@ -263,6 +263,24 @@ static void lnw_irq_handler(unsigned irq, struct irq_desc *desc)
> chip->irq_eoi(data);
> }
>
> +static void lnw_irq_init_hw(struct lnw_gpio *lnw)
> +{
> + void __iomem *reg;
> + unsigned base;
> +
> + for (base = 0; base < lnw->chip.ngpio; base += 32) {
> + /* Clear the rising-edge detect register */
> + reg = gpio_reg(&lnw->chip, base, GRER);
> + writel(0, reg);
> + /* Clear the falling-edge detect register */
> + reg = gpio_reg(&lnw->chip, base, GFER);
> + writel(0, reg);
> + /* Clear the edge detect status register */
> + reg = gpio_reg(&lnw->chip, base, GEDR);
> + writel(~0, reg);
> + }
> +}
> +
> #ifdef CONFIG_PM
> static int lnw_gpio_runtime_resume(struct device *dev)
> {
> @@ -371,6 +389,9 @@ static int __devinit lnw_gpio_probe(struct pci_dev *pdev,
> dev_err(&pdev->dev, "langwell gpiochip_add error %d\n", retval);
> goto err4;
> }
> +
> + lnw_irq_init_hw(lnw);
> +
> irq_set_handler_data(pdev->irq, lnw);
> irq_set_chained_handler(pdev->irq, lnw_irq_handler);
> for (i = 0; i < lnw->chip.ngpio; i++) {
> --
> 1.7.9.1
>
--
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies,Ltd.
next prev parent reply other threads:[~2012-04-06 14:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-05 9:15 [PATCH 1/3] gpio: langwell: use devm_* helpers to simplify probe Mika Westerberg
2012-04-05 9:15 ` [PATCH 2/3] gpio: langwell: allocate IRQ descriptors dynamically for SPARSE_IRQ Mika Westerberg
2012-04-06 4:34 ` Grant Likely
2012-04-10 7:18 ` Mika Westerberg
2012-04-24 10:13 ` Mika Westerberg
2012-04-05 9:15 ` [PATCH 3/3] gpio: langwell: clear IRQ edge detect registers at init Mika Westerberg
2012-04-06 4:39 ` Grant Likely [this message]
2012-04-06 4:26 ` [PATCH 1/3] gpio: langwell: use devm_* helpers to simplify probe Grant Likely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120406043949.BDE543E0E10@localhost \
--to=grant.likely@secretlab.ca \
--cc=linus.walleij@stericsson.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox