Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8098610rwb; Wed, 23 Nov 2022 15:37:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf57OXl+bcs/f+Eyf7HAdNaJIh9WYqQ8m5cnWEFDBSAQ8mmpR0SdBtSQezKFUYDooJMb9dR+ X-Received: by 2002:a17:907:d68b:b0:7b9:dff1:b26e with SMTP id wf11-20020a170907d68b00b007b9dff1b26emr4429077ejc.289.1669246623132; Wed, 23 Nov 2022 15:37:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669246623; cv=none; d=google.com; s=arc-20160816; b=XUuUnMp4pyZ7MbmyBjUOsiagI16xyWIKN+KAMwGtdipMS3C5vB4ieDWxx55TPbf5yC 9FDghT7sVXaxH06x3AkY6FhMWYAd7YI/Ka0Q+PWN0Ltb3iXYb2N79R1P0NJ3zWbcP5En S/k3WdiUh7LXgDl4nEEzMCNWz8wffDp4JiOgvYY34sUWd7Lv6CzuJGAqfwi8DHDrXgdZ QuYZzbIz42S4Ea/f6Re5rdOnuprDOus6m8C/wTm7/AcINKG1CB4PkSKsYUX4Lzydk8nc aJI3ZuRRfr59i9iYL/YVH0umGRPc3XYHlGnlgiw0SltbfOui5pXtsiB6wXoB9TxkdtrZ fnDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=X8Qm5jm0AtEblzCeF9itCHAowb9iYc8polGhradUFPU=; b=gAEZ3ka1jrc5kAzi6pIvOfH+KLqcdTrPtHytxGJhIlJ5pRoRei+/thJwEq9Rp13/gU a4It+9SGwziqhTaTiZnvn0RtfCDrJNn9vTgX3IhSSRCrkQSNmMg7mFRTNUkF7UEjQTmc ByaKY19VAWFE4GpRc+HcMj950vyiSZ5kh4DM/Jy0GPpW9VYh+pOhcw3sqm5K6kQFt3pC GRr6Ra2lRqFu0rs0gm2JbSXKrZy8+9k9lLbPHSHCDmxiD/d3/BkWTN9qlAC6NhEavr55 5TBrHUW9mWN5JWaKByBzup1QQy6WFP1MlCaXDf/jqCIVH6UNvv2qj1WiaOtrhOwmuwgU nGTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@peacevolution.org header.s=dkim header.b=aX6eqJCu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=peacevolution.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m8-20020a056402430800b0045d27c0ba90si1081595edc.577.2022.11.23.15.36.42; Wed, 23 Nov 2022 15:37:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@peacevolution.org header.s=dkim header.b=aX6eqJCu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=peacevolution.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229899AbiKWXUe (ORCPT + 88 others); Wed, 23 Nov 2022 18:20:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229848AbiKWXUa (ORCPT ); Wed, 23 Nov 2022 18:20:30 -0500 X-Greylist: delayed 537 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 23 Nov 2022 15:20:29 PST Received: from a.peacevolution.org (a.peacevolution.org [206.189.193.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35F0511604E for ; Wed, 23 Nov 2022 15:20:28 -0800 (PST) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by a.peacevolution.org (Postfix) with ESMTPA id 43C0C7E00E; Wed, 23 Nov 2022 23:11:30 +0000 (UTC) From: Aren Moynihan To: Lee Jones , Chen-Yu Tsai , linux-kernel@vger.kernel.org Cc: Ondrej Jirman , Aren Moynihan Subject: [PATCH] mfd: axp20x: fix order of pek rise and fall events Date: Wed, 23 Nov 2022 18:07:41 -0500 Message-Id: <20221123230741.2430813-1-aren@peacevolution.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Authentication-Results: auth=pass smtp.auth=aren@peacevolution.org smtp.mailfrom=aren@peacevolution.org X-Spamd-Bar: ++++ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=peacevolution.org; s=dkim; t=1669245090; h=from:subject:date:message-id:to:cc:mime-version:content-transfer-encoding; bh=X8Qm5jm0AtEblzCeF9itCHAowb9iYc8polGhradUFPU=; b=aX6eqJCu411zJGL0YO09SckcfgDVgQ55UbzLBVY2LnjHHxKwGPXJ0fRcl/nFsPDp4/Xkwq w0o4zhX0xS25J2GMBf+ElBLjDbxVasKa26BAY5QxM0EOlPGWi9/MQ7MrAsWAQ70vfz7+RX tgUzSkmRk1K0CVxd0W8xr5qDY34qn+E= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The power button can get "stuck" if the rising edge and falling edge irq are read in the same pass. This can often be triggered when resuming from suspend if the power button is released before the kernel handles the interrupt. Swapping the order of the rise and fall events makes sure that the press event is handled first, which prevents this situation. Signed-off-by: Aren Moynihan --- include/linux/mfd/axp20x.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h index 9ab0e2fca7ea..a13ba2bdd01f 100644 --- a/include/linux/mfd/axp20x.h +++ b/include/linux/mfd/axp20x.h @@ -432,8 +432,8 @@ enum { AXP152_IRQ_PEK_SHORT, AXP152_IRQ_PEK_LONG, AXP152_IRQ_TIMER, - AXP152_IRQ_PEK_RIS_EDGE, AXP152_IRQ_PEK_FAL_EDGE, + AXP152_IRQ_PEK_RIS_EDGE, AXP152_IRQ_GPIO3_INPUT, AXP152_IRQ_GPIO2_INPUT, AXP152_IRQ_GPIO1_INPUT, @@ -472,8 +472,8 @@ enum { AXP20X_IRQ_LOW_PWR_LVL1, AXP20X_IRQ_LOW_PWR_LVL2, AXP20X_IRQ_TIMER, - AXP20X_IRQ_PEK_RIS_EDGE, AXP20X_IRQ_PEK_FAL_EDGE, + AXP20X_IRQ_PEK_RIS_EDGE, AXP20X_IRQ_GPIO3_INPUT, AXP20X_IRQ_GPIO2_INPUT, AXP20X_IRQ_GPIO1_INPUT, @@ -502,8 +502,8 @@ enum axp22x_irqs { AXP22X_IRQ_LOW_PWR_LVL1, AXP22X_IRQ_LOW_PWR_LVL2, AXP22X_IRQ_TIMER, - AXP22X_IRQ_PEK_RIS_EDGE, AXP22X_IRQ_PEK_FAL_EDGE, + AXP22X_IRQ_PEK_RIS_EDGE, AXP22X_IRQ_GPIO1_INPUT, AXP22X_IRQ_GPIO0_INPUT, }; @@ -571,8 +571,8 @@ enum axp803_irqs { AXP803_IRQ_LOW_PWR_LVL1, AXP803_IRQ_LOW_PWR_LVL2, AXP803_IRQ_TIMER, - AXP803_IRQ_PEK_RIS_EDGE, AXP803_IRQ_PEK_FAL_EDGE, + AXP803_IRQ_PEK_RIS_EDGE, AXP803_IRQ_PEK_SHORT, AXP803_IRQ_PEK_LONG, AXP803_IRQ_PEK_OVER_OFF, @@ -623,8 +623,8 @@ enum axp809_irqs { AXP809_IRQ_LOW_PWR_LVL1, AXP809_IRQ_LOW_PWR_LVL2, AXP809_IRQ_TIMER, - AXP809_IRQ_PEK_RIS_EDGE, AXP809_IRQ_PEK_FAL_EDGE, + AXP809_IRQ_PEK_RIS_EDGE, AXP809_IRQ_PEK_SHORT, AXP809_IRQ_PEK_LONG, AXP809_IRQ_PEK_OVER_OFF, -- 2.38.1