* [RFC][PATCH 0/1] Closing indication for polled input device
@ 2009-10-12 8:09 Samu Onkalo
2009-10-12 8:09 ` [PATCH 1/1] Polled input device: Add closing indication Samu Onkalo
0 siblings, 1 reply; 5+ messages in thread
From: Samu Onkalo @ 2009-10-12 8:09 UTC (permalink / raw)
To: dmitry.torokhov; +Cc: linux-input, Samu Onkalo
Some small sensors uses polled input device interface. When the device is
closed, it would be nice to turn off the HW if the sensor supports that.
This patch adds optional closing indication support to the polled
input device driver.
Samu Onkalo (1):
Polled input device: Add closing indication
drivers/input/input-polldev.c | 3 +++
include/linux/input-polldev.h | 1 +
2 files changed, 4 insertions(+), 0 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/1] Polled input device: Add closing indication
2009-10-12 8:09 [RFC][PATCH 0/1] Closing indication for polled input device Samu Onkalo
@ 2009-10-12 8:09 ` Samu Onkalo
2009-10-12 8:54 ` Dmitry Torokhov
0 siblings, 1 reply; 5+ messages in thread
From: Samu Onkalo @ 2009-10-12 8:09 UTC (permalink / raw)
To: dmitry.torokhov; +Cc: linux-input, Samu Onkalo
When closing polled input device, call optional closing method
to make it possible to turn off the HW.
Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com>
---
drivers/input/input-polldev.c | 3 +++
include/linux/input-polldev.h | 1 +
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/input/input-polldev.c b/drivers/input/input-polldev.c
index 0d3ce7a..50e1cb4 100644
--- a/drivers/input/input-polldev.c
+++ b/drivers/input/input-polldev.c
@@ -95,6 +95,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..23a6fc6 100644
--- a/include/linux/input-polldev.h
+++ b/include/linux/input-polldev.h
@@ -32,6 +32,7 @@ struct input_polled_dev {
void (*flush)(struct input_polled_dev *dev);
void (*poll)(struct input_polled_dev *dev);
+ void (*close)(struct input_polled_dev *dev);
unsigned int poll_interval; /* msec */
struct input_dev *input;
--
1.5.6.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] Polled input device: Add closing indication
2009-10-12 8:09 ` [PATCH 1/1] Polled input device: Add closing indication Samu Onkalo
@ 2009-10-12 8:54 ` Dmitry Torokhov
2009-10-12 9:23 ` samu.p.onkalo
0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2009-10-12 8:54 UTC (permalink / raw)
To: Samu Onkalo; +Cc: linux-input
Hi Samu,
On Monday 12 October 2009 01:09:41 am Samu Onkalo wrote:
> When closing polled input device, call optional closing method
> to make it possible to turn off the HW.
What about open? How do you re-enable the device if it was closed and
then reopened?
--
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH 1/1] Polled input device: Add closing indication
2009-10-12 8:54 ` Dmitry Torokhov
@ 2009-10-12 9:23 ` samu.p.onkalo
2009-10-12 16:16 ` Dmitry Torokhov
0 siblings, 1 reply; 5+ messages in thread
From: samu.p.onkalo @ 2009-10-12 9:23 UTC (permalink / raw)
To: dmitry.torokhov; +Cc: linux-input
>
>Hi Samu,
>
>On Monday 12 October 2009 01:09:41 am Samu Onkalo wrote:
>> When closing polled input device, call optional closing
>method to make
>> it possible to turn off the HW.
>
>What about open? How do you re-enable the device if it was
>closed and then reopened?
>
flush is called when the device is reopened. Is it ok to use that?
-Samu
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] Polled input device: Add closing indication
2009-10-12 9:23 ` samu.p.onkalo
@ 2009-10-12 16:16 ` Dmitry Torokhov
0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Torokhov @ 2009-10-12 16:16 UTC (permalink / raw)
To: samu.p.onkalo; +Cc: linux-input
On Mon, Oct 12, 2009 at 11:23:57AM +0200, samu.p.onkalo@nokia.com wrote:
> >
> >Hi Samu,
> >
> >On Monday 12 October 2009 01:09:41 am Samu Onkalo wrote:
> >> When closing polled input device, call optional closing
> >method to make
> >> it possible to turn off the HW.
> >
> >What about open? How do you re-enable the device if it was
> >closed and then reopened?
> >
>
> flush is called when the device is reopened. Is it ok to use that?
>
No, please have open() method that is called when you open the device.
--
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-10-12 16:17 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-12 8:09 [RFC][PATCH 0/1] Closing indication for polled input device Samu Onkalo
2009-10-12 8:09 ` [PATCH 1/1] Polled input device: Add closing indication Samu Onkalo
2009-10-12 8:54 ` Dmitry Torokhov
2009-10-12 9:23 ` samu.p.onkalo
2009-10-12 16:16 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).