Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/serio In directory usw-pr-cvs1:/tmp/cvs-serv10580/linux/drivers/input/serio Modified Files: Config.in i8042.c i8042.h serio.c Removed Files: Config.help ct82c710.c parkbd.c rpckbd.c serport.c Log Message: Syned to 2.5.25 Index: Config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/serio/Config.in,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Config.in 14 Mar 2002 17:51:56 -0000 1.4 +++ Config.in 10 Jul 2002 18:08:04 -0000 1.5 @@ -4,14 +4,14 @@ tristate 'Serial i/o support' CONFIG_SERIO -dep_tristate ' i8042 PC Keyboard controller' CONFIG_SERIO_I8042 $CONFIG_SERIO $CONFIG_ISA +dep_tristate ' i8042 PC Keyboard controller' CONFIG_SERIO_I8042 $CONFIG_SERIO if [ "$CONFIG_SERIO_I8042" != "n" ]; then hex ' Register Base Address' CONFIG_I8042_REG_BASE 60 int ' PS/2 Keyboard IRQ' CONFIG_I8042_KBD_IRQ 1 int ' PS/2 AUX IRQ' CONFIG_I8042_AUX_IRQ 12 fi dep_tristate ' Serial port line discipline' CONFIG_SERIO_SERPORT $CONFIG_SERIO -dep_tristate ' ct82c710 Aux port controller' CONFIG_SERIO_CT82C710 $CONFIG_SERIO $CONFIG_ISA +dep_tristate ' ct82c710 Aux port controller' CONFIG_SERIO_CT82C710 $CONFIG_SERIO dep_tristate ' Q40 keyboard controller' CONFIG_SERIO_Q40KBD $CONFIG_SERIO dep_tristate ' Parallel port keyboard adapter' CONFIG_SERIO_PARKBD $CONFIG_SERIO $CONFIG_PARPORT Index: i8042.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/serio/i8042.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- i8042.c 1 Mar 2002 22:09:27 -0000 1.21 +++ i8042.c 10 Jul 2002 18:08:04 -0000 1.22 @@ -37,6 +37,7 @@ #include <linux/reboot.h> #include <linux/init.h> #include <linux/serio.h> +#include <linux/sched.h> /* request/free_irq */ #include "i8042.h" @@ -198,6 +199,9 @@ /* * i8042_kbd_write() sends a byte out through the keyboard interface. + * It also automatically refreshes the CTR value, since some i8042's + * trash their CTR after attempting to send data to an nonexistent + * device. */ static int i8042_kbd_write(struct serio *port, unsigned char c) Index: i8042.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/serio/i8042.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- i8042.h 1 Mar 2002 21:52:48 -0000 1.10 +++ i8042.h 10 Jul 2002 18:08:04 -0000 1.11 @@ -66,9 +66,9 @@ * Register numbers. */ +#define I8042_COMMAND_REG CONFIG_I8042_REG_BASE + 4 +#define I8042_STATUS_REG CONFIG_I8042_REG_BASE + 4 #define I8042_DATA_REG CONFIG_I8042_REG_BASE -#define I8042_COMMAND_REG I8042_DATA_REG + 4 -#define I8042_STATUS_REG I8042_DATA_REG + 4 /* * Status register bits. @@ -125,4 +125,4 @@ #define I8042_BUFFER_SIZE 32 -#endif _I8042_H +#endif /* _I8042_H */ Index: serio.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/serio/serio.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- serio.c 22 Jan 2002 21:12:03 -0000 1.15 +++ serio.c 10 Jul 2002 18:08:04 -0000 1.16 @@ -32,6 +32,11 @@ #include <linux/module.h> #include <linux/serio.h> #include <linux/errno.h> +#include <linux/wait.h> +#include <linux/completion.h> +#include <linux/sched.h> +#include <linux/smp_lock.h> +#include <linux/suspend.h> MODULE_AUTHOR("Vojtech Pavlik <vo...@uc...>"); MODULE_DESCRIPTION("Serio abstraction core"); @@ -47,6 +52,7 @@ static struct serio *serio_list; static struct serio_dev *serio_dev; +static int serio_pid; static void serio_find_dev(struct serio *serio) { @@ -59,11 +65,50 @@ } } +#define SERIO_RESCAN 1 + +static DECLARE_WAIT_QUEUE_HEAD(serio_wait); +static DECLARE_COMPLETION(serio_exited); + +void serio_handle_events(void) +{ + struct serio *serio = serio_list; + + while (serio) { + if (serio->event & SERIO_RESCAN) { + if (serio->dev && serio->dev->disconnect) + serio->dev->disconnect(serio); + serio_find_dev(serio); + } + + serio->event = 0; + serio = serio->next; + } +} + +static int serio_thread(void *nothing) +{ + lock_kernel(); + daemonize(); + strcpy(current->comm, "kseriod"); + + do { + serio_handle_events(); + if (current->flags & PF_FREEZE) + refrigerator(PF_IOTHREAD); + interruptible_sleep_on(&serio_wait); + } while (!signal_pending(current)); + + printk(KERN_DEBUG "serio: kseriod exiting"); + + unlock_kernel(); + complete_and_exit(&serio_exited, 0); +} + void serio_rescan(struct serio *serio) { - if (serio->dev && serio->dev->disconnect) - serio->dev->disconnect(serio); - serio_find_dev(serio); + serio->event |= SERIO_RESCAN; + wake_up(&serio_wait); } void serio_register_port(struct serio *serio) @@ -127,3 +172,29 @@ serio->close(serio); serio->dev = NULL; } + +int serio_init(void) +{ + int pid; + + pid = kernel_thread(serio_thread, NULL, + CLONE_FS | CLONE_FILES | CLONE_SIGHAND); + + if (!pid) { + printk(KERN_WARNING "serio: Failed to start kseriod\n"); + return -1; + } + + serio_pid = pid; + + return 0; +} + +void serio_exit(void) +{ + kill_proc(serio_pid, SIGTERM, 1); + wait_for_completion(&serio_exited); +} + +module_init(serio_init); +module_exit(serio_exit); --- Config.help DELETED --- --- ct82c710.c DELETED --- --- parkbd.c DELETED --- --- rpckbd.c DELETED --- --- serport.c DELETED --- |