Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2587632rdh; Sun, 26 Nov 2023 11:43:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IELxhVZvlMacDoh+MQ0huJdqQAb4UxFTPSLK3sMjYn0pRYfkQDy08bhuqzb+omAO1z6+U9W X-Received: by 2002:a05:6e02:1c4d:b0:35a:f55e:c47d with SMTP id d13-20020a056e021c4d00b0035af55ec47dmr15071298ilg.8.1701027832210; Sun, 26 Nov 2023 11:43:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701027832; cv=none; d=google.com; s=arc-20160816; b=zKsFYZJO3FHlw5eiZYhEkwku4Q3B8MwdA2ubQz0MFdxgget+aoLn5kRXAT8L6KZrpW FfWn5Bc55QBcnNB3WyaDe3CHRcMg4nSZ8Q+33SbOlcO3ov10sejNvBUF43Tv/pZQhte3 Zs3EG15Mr3yCCWeZYUvyDXY1zUwLR4vwVXcV8Uxg2JEGqlcHFJiBQHff2K4Silu3L0is Rh2/cdfhsWjO15+jycv9lACR7TsH0InHS/99i0Oh5Nu6zGalfDV/ACbljKkw4/QWd6+J 41yzrM9DecyqhzNlwg7NiZuD9IO5iwc80E13E228jBmNmYh4rEyjJbaYOs3zdzxlV+B7 qy8g== 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; bh=xucqkHPBJF36oXeOi/pc0yQ5CBxoZP6i5FtuLPSX75U=; fh=Ydn+ZeA+P9OoKn6tdSHYjSYcRilk4xC3bG9l9MrbrL8=; b=EOjofHZUTtrGywZa2smGdZFERYxt2xajq76fkkbabLUh4sCgyPFgpp3b5crejPDWuh sqYggfI/50iU8Zd/yfY3LtDhrIY0HtDuUHZyY9VmpqNpllyvOie4HRfUEONfWm/PpHDl /zf1bVENwFR8z99UsWyqMgCBF4giwaEeBdW9IAwHCy6wro+GnlySRzgyjlVuts7B9XPK /f22qu4p40Pan9cu3beGEOR4rgiRGQMsvovmR/Dxbm1EdAMyEpb/fPPLe7n1L/w6YipN nYf58FwlUzy5KkVBuMggyjsaPN3IObY6LiU63pxDglzBa1VcY4T+OZXBagpHoFUPJ5Xu kj7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id m8-20020a62f208000000b006cd8a7a8fbesi1133311pfh.392.2023.11.26.11.43.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 11:43:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id A69A9804B868; Sun, 26 Nov 2023 11:43:49 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229593AbjKZTnf (ORCPT + 99 others); Sun, 26 Nov 2023 14:43:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjKZTne (ORCPT ); Sun, 26 Nov 2023 14:43:34 -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 6BA97102 for ; Sun, 26 Nov 2023 11:43:41 -0800 (PST) Received: from p200301077700a9001a3da2fffebfd33a.dip0.t-ipconnect.de ([2003:107:7700:a900: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 1r7L2K-006kkS-KP; Sun, 26 Nov 2023 20:43:24 +0100 Received: from andi by aktux with local (Exim 4.96) (envelope-from ) id 1r7L2K-000T0f-09; Sun, 26 Nov 2023 20:43:24 +0100 From: Andreas Kemnade To: dmitry.torokhov@gmail.com, tony@atomide.com, u.kleine-koenig@pengutronix.de, robh@kernel.org, Jonathan.Cameron@huawei.com, andreas@kemnade.info, frank.li@vivo.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] Input: omap4-keypad: react on keypresses if device is runtime-suspended Date: Sun, 26 Nov 2023 20:43:19 +0100 Message-Id: <20231126194319.111504-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.8 required=5.0 tests=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 pete.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 (pete.vger.email [0.0.0.0]); Sun, 26 Nov 2023 11:43:49 -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