Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp4191096rdh; Fri, 29 Sep 2023 14:12:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGHnakb8NSpXIZkNaHXWKpsx5BaD0V5fkxDWr2yMklzs97f6jlsIhiWMCT9FtJ/7S266eqa X-Received: by 2002:a05:6a20:5483:b0:160:a980:1222 with SMTP id i3-20020a056a20548300b00160a9801222mr6315803pzk.53.1696021973680; Fri, 29 Sep 2023 14:12:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696021973; cv=none; d=google.com; s=arc-20160816; b=cPmCKsd2280r69H3QX9wUs0vF+UAfxGaR5CWx1q/sX8kwJExrO8ByM/fz7QTI6+kif akR2VYbZ9sUTpkFyQsuONQAdQkKmDvnCjuLh7MzIvVYZl/r/VJHQxO+MRMWWFZGhDI+g ADZqfE7BHf87Ae9AWQJF4yDcIY3b1tIdts0a0se0W9kKdeOnSvys0dTq/g5FCpTnk9P0 7ERtVu4/oZmHIlqU/zPmJw4hxJSqId1muRxaE9R6jPJb/H9ZUg/ie/ekYhbKguk3oJ7k +h1bPmy41gX1XmOH8VFxs/opnP3HXEA1/RaHV1CX/wF990BZFUpCBcFcsKnVjnUzaplZ 08Ig== 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=7oeNcjFPUFplMQnlemo4yTotnZILhUpzhg7DL6wxols=; fh=o6/abzgn/gQx64Av4nJEe+117hpXJKwBykH/ibDH9+k=; b=AQ5i3YuQVxEfpwknXcS+dMh0PykDLvp/j+cpSqtcYo1bZ5AA8t6n7dwUJEhyYyAoUF lJ+XpoITjVdMMuMj2hTOxXo286lrhQdy7rMn5Gy7VYibvuLuDGhQQXwcat2h4tCnbW8C qUKoBPHcVAyE8llxn5J4QOXhB/rFCuCsIITzGxzDbgZxt6kBy/89/q9FtsBh5mjP+dUX gYn479stkEfM2VGnSnHndf9AkL5WaYU4aZd7RzLEYlFRuCG2hJMyjW5NV+rGz4180zC7 OKr68Uqw3i73wIad8PGmV+4fVv8qd7SeF1AxP47E+9kzLpu+dz+koF+3iDvsKeBtLUif NXaA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id b26-20020a6567da000000b00585a5433e5dsi2047973pgs.88.2023.09.29.14.12.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 14:12:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id BA2CD8047DAC; Fri, 29 Sep 2023 13:01:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232985AbjI2UBW (ORCPT + 99 others); Fri, 29 Sep 2023 16:01:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232748AbjI2UBV (ORCPT ); Fri, 29 Sep 2023 16:01:21 -0400 Received: from mail.andi.de1.cc (mail.andi.de1.cc [IPv6:2a02:c205:3004:2154::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBCF4113; Fri, 29 Sep 2023 13:01:17 -0700 (PDT) Received: from p200300ccff0afb001a3da2fffebfd33a.dip0.t-ipconnect.de ([2003:cc:ff0a:fb00: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 1qmJfX-004LE9-9J; Fri, 29 Sep 2023 22:00:58 +0200 Received: from andi by aktux with local (Exim 4.96) (envelope-from ) id 1qmJfW-009eQM-1O; Fri, 29 Sep 2023 22:00:58 +0200 From: Andreas Kemnade To: dmitry.torokhov@gmail.com, Jonathan.Cameron@huawei.com, andreas@kemnade.info, robh@kernel.org, frank.li@vivo.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, tony@atomide.com Subject: [RFC PATCH] Input: omap4-keypad: react on keypresses if device is runtime-suspended Date: Fri, 29 Sep 2023 22:00:46 +0200 Message-Id: <20230929200046.2300333-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=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 29 Sep 2023 13:01:35 -0700 (PDT) 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 --- Open questions: - Should we rather (or also use) padconf irqs? - It seems not to be required everywhere. Does it harm somewhere? 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 773e55eed88b1..a7585a09c48b4 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