Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1362567ybn; Wed, 2 Oct 2019 15:04:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLtLGZiHGgryG/cDRRG3TdsaA5b7njzvAaBN6QeXPhmJGmGPFlfzS2kZqmRZmvbgq4rR70 X-Received: by 2002:a50:aa8e:: with SMTP id q14mr6337536edc.155.1570053878721; Wed, 02 Oct 2019 15:04:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570053878; cv=none; d=google.com; s=arc-20160816; b=J3lDp1nwI65KkPfZbaJF/2Cehc1aYme7yjjUoJty4BE/k1xAOlkj3iRPB8+v79VLao oM+DvDI0dhGTBZH8niOVH/V/HXCMqGU6bw8EQ8TR14qoJsi/kA1v6IaJZ5lhX29jgJab a8ZZtgwS4tV8StWVgoMVZAJjUdC5Y7hSLPXEJ/gW052W3Adycl808JCqMN5lk9b1uubO Vc3KbQLNAY2WfPJ+7xfj+YiOvX4Cy8kLG2J9kxCpcubY6FsTrIkK67pX56SJJaYayh/B ff/mBFd9zzPKG1gdd/Fv5QDfFO+RoopR07Ic+KMBls4fiHbnhK8dJxLOzbXOEoSJe2x8 /tHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=nW78YaON9ftxGXW1Xz94QjRHfMC0isgsL2LzRRL5B3I=; b=bNlOvlhwOrLm7/plwg5VIw2S4fk2MUKZ30gkS+Pk+IwCet3TtggoKfYicHbM6Zu0EM u5X1qXKEV4liAi5ilfDau8HEXr/dV16+chh9Mo1QZpga9jaHy0Rmo9CB2YAGXpEqzaFs LAf4ePUZ1lkCiPVkidq7A3VgOsvhV7feuCPnRN19LfkwU7hQrMzot/lr+10Vjc/+oYwc BO4Pd7jmVP55GnbQRZqCVzhp9PHdM35DzmwmoEug3T7BpDsw2ghticQ2q6zS/Dy/fv0C 1fHke8GkNepi55EPMgYlo/n+H4Vw4n9+7tA2pZKsOLU0Ofk2kw8i6TUfKVzJLL1MOQEy Ifeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="p/LKn8xy"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g5si268077edb.324.2019.10.02.15.04.14; Wed, 02 Oct 2019 15:04:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="p/LKn8xy"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728085AbfJBV6R (ORCPT + 99 others); Wed, 2 Oct 2019 17:58:17 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:42155 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726924AbfJBV6R (ORCPT ); Wed, 2 Oct 2019 17:58:17 -0400 Received: by mail-pf1-f194.google.com with SMTP id q12so337228pff.9; Wed, 02 Oct 2019 14:58:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=nW78YaON9ftxGXW1Xz94QjRHfMC0isgsL2LzRRL5B3I=; b=p/LKn8xyaCC9zZK0L02ezYYnpAnd+6biRqCJLy3WXmypv1FK4+o5B0Vh1tz5AEnujZ GH3XEDgoupBqH9rwnYrtcw0IziykawQnZy/Ggb8Am+KIv+vy9Tl5z9vPFUUXZYz1UUxu Epe4Nfl833nFYwwwgomYktYRZXGHK4mmFg9oHjDMuXgJ+yqkH/Qr3L+zPlrlRW0RSh9L EGD+nt+GaPbPaGvv+GjqFAsbbPbAkGZoBW5DH1rL3dNJQ5/iNbil3wHiApP3oK49FlAx YC1Ac2GAzaWlsRtyRygOlxEQppu38ddSuaVlAqNqDgi6JKXlesoxul73rVP3ewjgBY+H nYhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=nW78YaON9ftxGXW1Xz94QjRHfMC0isgsL2LzRRL5B3I=; b=fUHlfVGT8e0cfPSvZtGmIi1t9B61HUnF/kg5+EBlOmcQYsI2x4bmPkTwdPrE0fzmTJ 58oNXab2noI6VM2ZEG5avjvMS+Qn/1lI8PSMbYAFrAu2ONDLC6fxiTnuCBX5S9F9c2Es 0/wKnOCd0pVlDgZ1mda6a776irtaENfQOi0ANqSb7sVjV30XbMmNItdSxDCISrIGBdW6 UVm9OI41+NpEEGUTvNK1gj882/nISaDbMO37gSHUWkjCZpCtGdFkqR5WDVoorRXcsi6v 90L58Nkpb9NoOWfT0pQSwDOhlT/OAvrxmo6CIKPSQO6DyOxKNi0/0UwoBJpgtQtIyWyW qO2Q== X-Gm-Message-State: APjAAAXiwXovEMX8twfnlgL9D2i/5OxHq0RgQ9G5zT4yHfqqu6qx0E5o 8NBeyu07Ol/KMHYjbGA8aI1ykbgf X-Received: by 2002:a63:f113:: with SMTP id f19mr5878239pgi.75.1570053495683; Wed, 02 Oct 2019 14:58:15 -0700 (PDT) Received: from dtor-ws ([2620:15c:202:201:3adc:b08c:7acc:b325]) by smtp.gmail.com with ESMTPSA id a8sm402067pfo.118.2019.10.02.14.58.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2019 14:58:14 -0700 (PDT) Date: Wed, 2 Oct 2019 14:58:12 -0700 From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: Benjamin Tissoires , linux-kernel@vger.kernel.org Subject: [PATCH] Input: add input_get_poll_interval() Message-ID: <20191002215812.GA135681@dtor-ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some drivers need to be able to know the current polling interval for devices working in polling mode, let's allow them fetching it. Signed-off-by: Dmitry Torokhov --- drivers/input/input-poller.c | 9 +++++++++ include/linux/input.h | 1 + 2 files changed, 10 insertions(+) diff --git a/drivers/input/input-poller.c b/drivers/input/input-poller.c index 1b3d28964bb2..7d6b4e8879f1 100644 --- a/drivers/input/input-poller.c +++ b/drivers/input/input-poller.c @@ -123,6 +123,15 @@ void input_set_max_poll_interval(struct input_dev *dev, unsigned int interval) } EXPORT_SYMBOL(input_set_max_poll_interval); +int input_get_poll_interval(struct input_dev *dev) +{ + if (!dev->poller) + return -EINVAL; + + return dev->poller->poll_interval; +} +EXPORT_SYMBOL(input_get_poll_interval); + /* SYSFS interface */ static ssize_t input_dev_get_poll_interval(struct device *dev, diff --git a/include/linux/input.h b/include/linux/input.h index 31da4feaa1d8..a420324b7882 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -387,6 +387,7 @@ int input_setup_polling(struct input_dev *dev, void input_set_poll_interval(struct input_dev *dev, unsigned int interval); void input_set_min_poll_interval(struct input_dev *dev, unsigned int interval); void input_set_max_poll_interval(struct input_dev *dev, unsigned int interval); +int input_get_poll_interval(struct input_dev *dev); int __must_check input_register_handler(struct input_handler *); void input_unregister_handler(struct input_handler *); -- 2.23.0.444.g18eeb5a265-goog -- Dmitry