From patchwork Tue Aug 8 03:31:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenhua Lin X-Patchwork-Id: 711871 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F5C6C001B0 for ; Tue, 8 Aug 2023 18:51:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230476AbjHHSvJ (ORCPT ); Tue, 8 Aug 2023 14:51:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231366AbjHHSut (ORCPT ); Tue, 8 Aug 2023 14:50:49 -0400 Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C7B85833D for ; Tue, 8 Aug 2023 10:01:51 -0700 (PDT) Received: from SHSQR01.spreadtrum.com (localhost [127.0.0.2] (may be forged)) by SHSQR01.spreadtrum.com with ESMTP id 3783WAsD072500 for ; Tue, 8 Aug 2023 11:32:10 +0800 (+08) (envelope-from Wenhua.Lin@unisoc.com) Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 3783VYwB071147; Tue, 8 Aug 2023 11:31:34 +0800 (+08) (envelope-from Wenhua.Lin@unisoc.com) Received: from SHDLP.spreadtrum.com (shmbx06.spreadtrum.com [10.0.1.11]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4RKdwN2gpJz2NsJlw; Tue, 8 Aug 2023 11:29:40 +0800 (CST) Received: from xm9614pcu.spreadtrum.com (10.13.2.29) by shmbx06.spreadtrum.com (10.0.1.11) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Tue, 8 Aug 2023 11:31:32 +0800 From: Wenhua Lin To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Orson Zhai , Baolin Wang , Chunyan Zhang CC: , , wenhua lin , Wenhua Lin , Xiongpeng Wu Subject: [PATCH 2/3] gpio: sprd: In the sleep state, the eic dbnc clk must be forced open Date: Tue, 8 Aug 2023 11:31:30 +0800 Message-ID: <20230808033130.2226-1-Wenhua.Lin@unisoc.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.13.2.29] X-ClientProxiedBy: SHCAS01.spreadtrum.com (10.0.1.201) To shmbx06.spreadtrum.com (10.0.1.11) X-MAIL: SHSQR01.spreadtrum.com 3783VYwB071147 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org In the sleep state, Eic dbnc has no clock and the clk enable of dbnc needs to be forced open, so that eic can wake up normally. Signed-off-by: Wenhua Lin --- drivers/gpio/gpio-eic-sprd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c index 0d85d9e80848..c506cfd6df8e 100644 --- a/drivers/gpio/gpio-eic-sprd.c +++ b/drivers/gpio/gpio-eic-sprd.c @@ -23,6 +23,7 @@ #define SPRD_EIC_DBNC_IC 0x24 #define SPRD_EIC_DBNC_TRIG 0x28 #define SPRD_EIC_DBNC_CTRL0 0x40 +#define SPRD_EIC_DBNC_FORCE_CLK 0x8000 #define SPRD_EIC_LATCH_INTEN 0x0 #define SPRD_EIC_LATCH_INTRAW 0x4 @@ -213,6 +214,7 @@ static int sprd_eic_set_debounce(struct gpio_chip *chip, unsigned int offset, u32 value = readl_relaxed(base + reg) & ~SPRD_EIC_DBNC_MASK; value |= (debounce / 1000) & SPRD_EIC_DBNC_MASK; + value |= SPRD_EIC_DBNC_FORCE_CLK; writel_relaxed(value, base + reg); return 0;