public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stas Sergeev <stsp@aknet.ru>
To: Andrew Morton <akpm@osdl.org>
Cc: dtor_core@ameritech.net, vojtech@suse.cz, linux-kernel@vger.kernel.org
Subject: Re: [patch] add input_enable_device()
Date: Tue, 16 May 2006 20:29:36 +0400	[thread overview]
Message-ID: <4469FDF0.3020403@aknet.ru> (raw)
In-Reply-To: <20060516090324.66ea0ea6.akpm@osdl.org>

[-- Attachment #1: Type: text/plain, Size: 588 bytes --]

Hello.

Andrew Morton wrote:
> iirc it had to do with the pc-speaker driver, but I don't seem to be able
> to locate the original email.
OK, sorry, I haven't realized its important.

---
The patch below adds input_enable_device() and input_disable_device()
to the input subsystem, that allows to enable and disable the input
devices. The reason to have it, is the snd-pcsp PC-Speaker driver in
an ALSA tree that needs an ability to disable the pcspkr driver.

Signed-off-by: Stas Sergeev <stsp@aknet.ru>
CC: Dmitry Torokhov <dtor_core@ameritech.net>
CC: Vojtech Pavlik <vojtech@suse.cz>


[-- Attachment #2: input_en2.diff --]
[-- Type: text/x-patch, Size: 1651 bytes --]

--- a/include/linux/input.h	2006-04-05 17:10:01.000000000 +0400
+++ b/include/linux/input.h	2006-04-05 17:36:49.000000000 +0400
@@ -878,7 +878,7 @@
 
 	struct pt_regs *regs;
 	int state;
-
+	int disabled;
 	int sync;
 
 	int abs[ABS_MAX + 1];
@@ -1038,6 +1038,9 @@
 int input_open_device(struct input_handle *);
 void input_close_device(struct input_handle *);
 
+void input_enable_device(struct input_handle *handle);
+void input_disable_device(struct input_handle *handle);
+
 int input_accept_process(struct input_handle *handle, struct file *file);
 int input_flush_device(struct input_handle* handle, struct file* file);
 
--- a/drivers/input/input.c	2006-01-12 11:23:09.000000000 +0300
+++ b/drivers/input/input.c	2006-04-05 17:51:27.000000000 +0400
@@ -37,6 +37,8 @@
 EXPORT_SYMBOL(input_release_device);
 EXPORT_SYMBOL(input_open_device);
 EXPORT_SYMBOL(input_close_device);
+EXPORT_SYMBOL(input_enable_device);
+EXPORT_SYMBOL(input_disable_device);
 EXPORT_SYMBOL(input_accept_process);
 EXPORT_SYMBOL(input_flush_device);
 EXPORT_SYMBOL(input_event);
@@ -53,7 +55,7 @@
 {
 	struct input_handle *handle;
 
-	if (type > EV_MAX || !test_bit(type, dev->evbit))
+	if (type > EV_MAX || !test_bit(type, dev->evbit) || dev->disabled)
 		return;
 
 	add_input_randomness(type, code, value);
@@ -269,6 +271,16 @@
 	mutex_unlock(&dev->mutex);
 }
 
+void input_enable_device(struct input_handle *handle)
+{
+	handle->dev->disabled = 0;
+}
+
+void input_disable_device(struct input_handle *handle)
+{
+	handle->dev->disabled = 1;
+}
+
 static void input_link_handle(struct input_handle *handle)
 {
 	list_add_tail(&handle->d_node, &handle->dev->h_list);

  reply	other threads:[~2006-05-16 16:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <44670446.7080409@aknet.ru>
     [not found] ` <20060515143119.54b5aff8.akpm@osdl.org>
2006-05-16 16:00   ` [patch] add input_enable_device() Stas Sergeev
2006-05-16 16:03     ` Andrew Morton
2006-05-16 16:29       ` Stas Sergeev [this message]
2006-05-16 16:44         ` Chase Venters
     [not found] <20060517124450.84547.qmail@web81111.mail.mud.yahoo.com>
2006-05-17 17:10 ` Stas Sergeev
2006-05-17 19:47   ` Dmitry Torokhov
2006-05-18  4:10     ` Stas Sergeev
2006-05-18  4:31       ` Dmitry Torokhov
2006-05-18  4:54         ` Stas Sergeev
2006-05-18 12:29           ` Dmitry Torokhov
2006-05-18 17:57             ` Stas Sergeev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4469FDF0.3020403@aknet.ru \
    --to=stsp@aknet.ru \
    --cc=akpm@osdl.org \
    --cc=dtor_core@ameritech.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vojtech@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox