Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2891389rdb; Sat, 9 Dec 2023 03:25:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IF5gTjP1fJgM4/3ZV9XAhHi63a+2tfeUa6InKOoaHlmxBgvTowwEIDaTk3pKkYofULz1ril X-Received: by 2002:a05:6808:1a23:b0:3b9:d9d6:16bf with SMTP id bk35-20020a0568081a2300b003b9d9d616bfmr2126812oib.36.1702121128640; Sat, 09 Dec 2023 03:25:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702121128; cv=none; d=google.com; s=arc-20160816; b=BtA/ZsAl4KmUHzAC/p02VqiPKuBOIddStkfMiWc0Jv4hw2ltbIMAxtuq3RkI8DdQHG XJVRgxUgyiK4fp5vzNgNb8gvnLCk4WLUZHfyQH3jd3Zuvi5Z/jkQqp2Tlf2qnYfLS2bq lU7jprTkn8uvsLPPVdh6xdnWZ0/056O/YryaXEqv06YGUDMYB6sdQJ04/Amc2uuzDSUf VQXUdNSW66gnnYz+pIjVogpnkuqtR/49RLlm78K+LZwOMxFHBdglCnWI8YBsUj+lF8cf 1GPxCisu+j8WrPjuxB3n1OjKca7qKrO2fdR74cTQgN88z+OcPO8zILXjR/vhHKfv1T48 33Ng== 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 Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id fi2-20020a056a00398200b006ce42ae90edsi2957776pfb.291.2023.12.09.03.25.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Dec 2023 03:25:28 -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 994D8803E9F0; Sat, 9 Dec 2023 03:25:25 -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 Content-Transfer-Encoding: 8bit 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:25 -0800 (PST) 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); -- 2.39.2