linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] Input: axp20x-pek - Remove unique wakeup event handling
@ 2020-01-13  3:20 Samuel Holland
  2020-01-13  3:20 ` [PATCH 2/3] Input: axp20x-pek - Respect userspace wakeup configuration Samuel Holland
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Samuel Holland @ 2020-01-13  3:20 UTC (permalink / raw)
  To: Dmitry Torokhov, Chen-Yu Tsai, Hans de Goede
  Cc: linux-input, linux-kernel, linux-sunxi, Samuel Holland

This driver attempts to avoid reporting wakeup events to userspace by
clearing a possible pending IRQ before IRQs are enabled during resume.
The assumption seems to be that userspace cannot cope with a KEY_POWER
press during resume. However, no other input driver does this, so it
would be a bug that such events are missing with this driver.

Furthermore, for PMICs connected via I2C or RSB, it is not possible to
update the regmap during the noirq resume phase, because the bus
controller drivers require IRQs to perform bus transactions. And the
resume hook cannot move to a later phase, because then it would race
with the power key IRQ handler.

So the best solution seems to be simply removing the hook.

Signed-off-by: Samuel Holland <samuel@sholland.org>
---
 drivers/input/misc/axp20x-pek.c | 25 -------------------------
 1 file changed, 25 deletions(-)

diff --git a/drivers/input/misc/axp20x-pek.c b/drivers/input/misc/axp20x-pek.c
index 17c1cca74498..7d0ee5bececb 100644
--- a/drivers/input/misc/axp20x-pek.c
+++ b/drivers/input/misc/axp20x-pek.c
@@ -352,30 +352,6 @@ static int axp20x_pek_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused axp20x_pek_resume_noirq(struct device *dev)
-{
-	struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev);
-
-	if (axp20x_pek->axp20x->variant != AXP288_ID)
-		return 0;
-
-	/*
-	 * Clear interrupts from button presses during suspend, to avoid
-	 * a wakeup power-button press getting reported to userspace.
-	 */
-	regmap_write(axp20x_pek->axp20x->regmap,
-		     AXP20X_IRQ1_STATE + AXP288_IRQ_POKN / 8,
-		     BIT(AXP288_IRQ_POKN % 8));
-
-	return 0;
-}
-
-static const struct dev_pm_ops axp20x_pek_pm_ops = {
-#ifdef CONFIG_PM_SLEEP
-	.resume_noirq = axp20x_pek_resume_noirq,
-#endif
-};
-
 static const struct platform_device_id axp_pek_id_match[] = {
 	{
 		.name = "axp20x-pek",
@@ -394,7 +370,6 @@ static struct platform_driver axp20x_pek_driver = {
 	.id_table	= axp_pek_id_match,
 	.driver		= {
 		.name		= "axp20x-pek",
-		.pm		= &axp20x_pek_pm_ops,
 		.dev_groups	= axp20x_groups,
 	},
 };
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-01-15  4:45 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-13  3:20 [PATCH 1/3] Input: axp20x-pek - Remove unique wakeup event handling Samuel Holland
2020-01-13  3:20 ` [PATCH 2/3] Input: axp20x-pek - Respect userspace wakeup configuration Samuel Holland
2020-01-13  4:47   ` kbuild test robot
2020-01-13 10:48   ` Hans de Goede
2020-01-13 21:38     ` Dmitry Torokhov
2020-01-14  4:50   ` kbuild test robot
2020-01-13  3:20 ` [PATCH 3/3] Input: axp20x-pek - Enable wakeup for all AXP variants Samuel Holland
2020-01-13 10:48   ` Hans de Goede
2020-01-13 21:26   ` Dmitry Torokhov
2020-01-14  9:07     ` Hans de Goede
2020-01-15  4:45       ` Samuel Holland
2020-01-13 10:41 ` [PATCH 1/3] Input: axp20x-pek - Remove unique wakeup event handling Hans de Goede
2020-01-13 10:58   ` Hans de Goede
2020-01-15  4:29     ` [linux-sunxi] " Samuel Holland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).