From patchwork Sat Dec 9 11:20:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Kemnade X-Patchwork-Id: 176164 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5997114vqy; Sat, 9 Dec 2023 03:25:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IEBiVQiAyPSRg3Prs7siSV5/xKaPwCUJQrcidvBdClcTmmP+bxdDR+1ZtQzigMdgWHDdYZ4 X-Received: by 2002:a05:6808:384d:b0:3b9:e1f3:2c90 with SMTP id ej13-20020a056808384d00b003b9e1f32c90mr2589273oib.108.1702121124577; Sat, 09 Dec 2023 03:25:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702121124; cv=none; d=google.com; s=arc-20160816; b=Ayq2LtDe5ruvig73NgWI18atr6Gpx1VpAoUrMfUgJ0+kKkKyNiaLnH4WzRXuBAEZap M7Hn0PDffI5PPt8hsEqYua0I6RoxDqiMmUrWU/I96ToeGhfIDgXx3mKBweL/b3jk+U31 7m3qmqfOybYdeEfpKRt17V28lVlhzp2yVkPZqndiUm4HwW67Ziid4IfsVwwohQivy0Ur uAPTiLrmGK+5bkpixgOVOMK74uMdUer2M8JiZy4BeJgMOR4CO0d6nD5bioBO3MfdOyt+ 34Qtv25+BOaEJsGHTlcMiJeMV/C7di60q/FlfGkh0mAFIf5k8rIuSKHCM0zEC1UVj/6M MEow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=xucqkHPBJF36oXeOi/pc0yQ5CBxoZP6i5FtuLPSX75U=; fh=8F5ZttYxWvDEbUjE+XYv1Kd0TGnTJD5p9Yixm6bSQyM=; b=GdTDwMqUhnWuQ8g8sV2HKz+KAQ+4JezSU8xut46inLx5T1PpIHu1cdXp82I2Y5i/3Q 9lFDlntm3V57NfYZZAk8y6MWqerEH/ZEmAww09j45y7NxS8OPxlcjIalNHqJ20TS54f9 ssUPgfZSiQzG+qYfJaN7V7bJK0XHsAksMxm6oH9pmXenCzhDfqtWNRVKEJlhYu3N/D03 OUB2c0ABEWU3x3wZ+i+ssMKaAIAgTCOh9VE3aKldvOPLQ4Pa67U8E2i5df1Zhn5PYOs4 t/7M2TPdm/x8G7H6jLl/iF7nhTHmp81dVffCCZETF0gN0RDHZ5wd6vN4fBjgYEG/weTZ JAjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kemnade.info header.s=20220719 header.b=vxvzh2tC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id t15-20020a056a0021cf00b006cd90790ce7si2407681pfj.399.2023.12.09.03.25.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Dec 2023 03:25:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=fail header.i=@kemnade.info header.s=20220719 header.b=vxvzh2tC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 92C99803EB9F; Sat, 9 Dec 2023 03:25:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229873AbjLILVS (ORCPT + 99 others); Sat, 9 Dec 2023 06:21:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjLILVR (ORCPT ); Sat, 9 Dec 2023 06:21:17 -0500 Received: from mail.andi.de1.cc (mail.andi.de1.cc [IPv6:2a02:c205:3004:2154::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD18110E0; Sat, 9 Dec 2023 03:21:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kemnade.info; s=20220719; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xucqkHPBJF36oXeOi/pc0yQ5CBxoZP6i5FtuLPSX75U=; b=vxvzh2tC5vuR0OgFJ3PNto2G57 mBHkdc50jbPSKeXA99iXTls69eVMEgjrbaXDimki3efaQEV+gXPXgfC9GJicy5TYubkFRyqsqrui3 c34v6Y+u+ofYQoGE7Uwiu3y4enY5fJEAYiqn0sabQFGGaZq10wpMzSUvWKMaKBKTaP2a7SgYnrDGE VWiRvmEJwMENawn640CPapiicTueA+JRtW5AOnyNxi7kWJaP2e8DNt9yzw19/x4Wm8lO5H7R5zItF Nvt+7JPsuzBOFRthNeb6VUEgGaefordUyP0u6tsOOzLShhNCFkRlfPTkKWBLnWmpO9fQ1z2lWGFIq S6do7aPQ==; Received: from p200301077700c3001a3da2fffebfd33a.dip0.t-ipconnect.de ([2003:107:7700:c300:1a3d:a2ff:febf:d33a] helo=aktux) by mail.andi.de1.cc with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rBvOH-007CLA-3K; Sat, 09 Dec 2023 12:21:01 +0100 Received: from andi by aktux with local (Exim 4.96) (envelope-from ) id 1rBvOG-001tr9-0W; Sat, 09 Dec 2023 12:21:00 +0100 From: Andreas Kemnade To: dmitry.torokhov@gmail.com, tony@atomide.com, frank.li@vivo.com, u.kleine-koenig@pengutronix.de, Jonathan.Cameron@huawei.com, robh@kernel.org, andreas@kemnade.info, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND] Input: omap4-keypad: react on keypresses if device is runtime-suspended Date: Sat, 9 Dec 2023 12:20:58 +0100 Message-Id: <20231209112058.453030-1-andreas@kemnade.info> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Sat, 09 Dec 2023 03:25:21 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784803360093082177 X-GMAIL-MSGID: 1784803360093082177 According to SWPU235AB, table 26-6, fclk is required to generate events at least on OMAP4460, so keep fclk enabled all the time the device is opened. Suggested-by: Tony Lindgren Signed-off-by: Andreas Kemnade Reviewed-by: Tony Lindgren --- Changes since RFC: - add R-by: drivers/input/keyboard/omap4-keypad.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c index d3f8688fdd9c3..7d83aff95617f 100644 --- a/drivers/input/keyboard/omap4-keypad.c +++ b/drivers/input/keyboard/omap4-keypad.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -83,6 +84,7 @@ struct omap4_keypad { bool no_autorepeat; u64 keys; unsigned short *keymap; + struct clk *fck; }; static int kbd_readl(struct omap4_keypad *keypad_data, u32 offset) @@ -211,6 +213,8 @@ static int omap4_keypad_open(struct input_dev *input) disable_irq(keypad_data->irq); + clk_prepare_enable(keypad_data->fck); + kbd_writel(keypad_data, OMAP4_KBD_CTRL, OMAP4_DEF_CTRL_NOSOFTMODE | (OMAP4_KEYPAD_PTV_DIV_128 << OMAP4_DEF_CTRL_PTV_SHIFT)); @@ -258,6 +262,7 @@ static void omap4_keypad_close(struct input_dev *input) disable_irq(keypad_data->irq); omap4_keypad_stop(keypad_data); enable_irq(keypad_data->irq); + clk_disable_unprepare(keypad_data->fck); pm_runtime_mark_last_busy(dev); pm_runtime_put_autosuspend(dev); @@ -356,6 +361,11 @@ static int omap4_keypad_probe(struct platform_device *pdev) } keypad_data->irq = irq; + keypad_data->fck = devm_clk_get(&pdev->dev, "fck"); + if (IS_ERR(keypad_data->fck)) + return dev_err_probe(&pdev->dev, PTR_ERR(keypad_data->fck), + "unable to get fck"); + mutex_init(&keypad_data->lock); platform_set_drvdata(pdev, keypad_data);