diff mbox

[1/1] Polled input device: add device open and close methods

Message ID 1255415088-31845-2-git-send-email-samu.p.onkalo@nokia.com
State New, archived
Headers show

Commit Message

samu.p.onkalo@nokia.com Oct. 13, 2009, 6:24 a.m. UTC
None
diff mbox

Patch

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 */