From patchwork Tue Oct 13 06:24:48 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: samu.p.onkalo@nokia.com X-Patchwork-Id: 53323 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9D6X2A4028673 for ; Tue, 13 Oct 2009 06:33:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758917AbZJMG0d (ORCPT ); Tue, 13 Oct 2009 02:26:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758946AbZJMG0d (ORCPT ); Tue, 13 Oct 2009 02:26:33 -0400 Received: from smtp.nokia.com ([192.100.105.134]:30674 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758917AbZJMG0c (ORCPT ); Tue, 13 Oct 2009 02:26:32 -0400 Received: from esebh106.NOE.Nokia.com (esebh106.ntc.nokia.com [172.21.138.213]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n9D6OxvG015648; Tue, 13 Oct 2009 01:25:03 -0500 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 13 Oct 2009 09:24:55 +0300 Received: from mgw-da02.ext.nokia.com ([147.243.128.26]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Tue, 13 Oct 2009 09:24:53 +0300 Received: from localhost.localdomain (4fid08082.ntc.nokia.com [172.22.144.188]) by mgw-da02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n9D6OmuZ001295; Tue, 13 Oct 2009 09:24:50 +0300 From: Samu Onkalo To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, Samu Onkalo Subject: [PATCH 1/1] Polled input device: add device open and close methods Date: Tue, 13 Oct 2009 09:24:48 +0300 Message-Id: <1255415088-31845-2-git-send-email-samu.p.onkalo@nokia.com> X-Mailer: git-send-email 1.5.6.3 In-Reply-To: <1255415088-31845-1-git-send-email-samu.p.onkalo@nokia.com> References: <1255415088-31845-1-git-send-email-samu.p.onkalo@nokia.com> X-OriginalArrivalTime: 13 Oct 2009 06:24:53.0756 (UTC) FILETIME=[E05583C0:01CA4BCD] X-Nokia-AV: Clean Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org diff --git a/drivers/input/input-polldev.c b/drivers/input/input-polldev.c index 0d3ce7a..0ad788b 100644 --- a/drivers/input/input-polldev.c +++ b/drivers/input/input-polldev.c @@ -80,6 +80,9 @@ static int input_open_polled_device(struct input_dev *input) if (error) return error; + if (dev->open) + dev->open(dev); + if (dev->flush) dev->flush(dev); @@ -95,6 +98,9 @@ static void input_close_polled_device(struct input_dev *input) cancel_delayed_work_sync(&dev->work); input_polldev_stop_workqueue(); + + if (dev->close) + dev->close(dev); } /** diff --git a/include/linux/input-polldev.h b/include/linux/input-polldev.h index 597a007..ba266c1 100644 --- a/include/linux/input-polldev.h +++ b/include/linux/input-polldev.h @@ -30,6 +30,8 @@ struct input_polled_dev { void *private; + void (*open)(struct input_polled_dev *dev); + void (*close)(struct input_polled_dev *dev); void (*flush)(struct input_polled_dev *dev); void (*poll)(struct input_polled_dev *dev); unsigned int poll_interval; /* msec */