mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: Natikar Basavaraj <Basavaraj.Natikar@amd.com>,
	S-k Shyam-sundar <Shyam-sundar.S-k@amd.com>,
	<linus.walleij@linaro.org>
Cc: <andriy.shevchenko@linux.intel.com>, <npliashechnikov@gmail.com>,
	<nmschulte@gmail.com>, <friedrich.vock@gmx.de>,
	<dridri85@gmail.com>, "Hans de Goede" <hdegoede@redhat.com>,
	open list <linux-kernel@vger.kernel.org>,
	"open list" <linux-gpio@vger.kernel.org>,
	Mario Limonciello <mario.limonciello@amd.com>,
	<stable@vger.kernel.org>
Subject: [PATCH v2 1/4] pinctrl: amd: Only use special debounce behavior for GPIO 0
Date: Wed, 5 Jul 2023 08:30:02 -0500	[thread overview]
Message-ID: <20230705133005.577-2-mario.limonciello@amd.com> (raw)
In-Reply-To: <20230705133005.577-1-mario.limonciello@amd.com>

It's uncommon to use debounce on any other pin, but technically
we should only set debounce to 0 when working off GPIO0.

Cc: stable@vger.kernel.org
Fixes: 968ab9261627 ("pinctrl: amd: Detect internal GPIO0 debounce handling")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/pinctrl/pinctrl-amd.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c
index 7a4dd0c861abc..02d9f9f245707 100644
--- a/drivers/pinctrl/pinctrl-amd.c
+++ b/drivers/pinctrl/pinctrl-amd.c
@@ -127,9 +127,11 @@ static int amd_gpio_set_debounce(struct gpio_chip *gc, unsigned offset,
 	raw_spin_lock_irqsave(&gpio_dev->lock, flags);
 
 	/* Use special handling for Pin0 debounce */
-	pin_reg = readl(gpio_dev->base + WAKE_INT_MASTER_REG);
-	if (pin_reg & INTERNAL_GPIO0_DEBOUNCE)
-		debounce = 0;
+	if (offset == 0) {
+		pin_reg = readl(gpio_dev->base + WAKE_INT_MASTER_REG);
+		if (pin_reg & INTERNAL_GPIO0_DEBOUNCE)
+			debounce = 0;
+	}
 
 	pin_reg = readl(gpio_dev->base + offset * 4);
 
-- 
2.34.1


  reply	other threads:[~2023-07-05 13:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-05 13:30 [PATCH v2 0/4] Fix for interrupt storm on ASUS TUF A16 Mario Limonciello
2023-07-05 13:30 ` Mario Limonciello [this message]
2023-07-05 13:30 ` [PATCH v2 2/4] pinctrl: amd: Use amd_pinconf_set() for all config options Mario Limonciello
2023-07-06  9:16   ` Andy Shevchenko
2023-07-06 14:30     ` Limonciello, Mario
2023-07-05 13:30 ` [PATCH v2 3/4] pinctrl: amd: Drop pull up select configuration Mario Limonciello
2023-07-05 13:30 ` [PATCH v2 4/4] pinctrl: amd: Unify debounce handling into amd_pinconf_set() Mario Limonciello
2023-07-07 13:50 ` [PATCH v2 0/4] Fix for interrupt storm on ASUS TUF A16 Linus Walleij
2023-07-07 14:09   ` Limonciello, Mario
2023-07-10 17:49     ` Jan Visser

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=20230705133005.577-2-mario.limonciello@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=Basavaraj.Natikar@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=dridri85@gmail.com \
    --cc=friedrich.vock@gmx.de \
    --cc=hdegoede@redhat.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nmschulte@gmail.com \
    --cc=npliashechnikov@gmail.com \
    --cc=stable@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®