From: Vojtech P. <vo...@us...> - 2002-02-22 11:42:26
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input In directory usw-pr-cvs1:/tmp/cvs-serv18065 Modified Files: mousedev.c Config.in Log Message: Add support for /dev/psaux so that X doesn't break when you don't edit XF86Config and switch kernels. Index: mousedev.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/mousedev.c,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- mousedev.c 24 Jan 2002 19:54:08 -0000 1.40 +++ mousedev.c 22 Feb 2002 11:42:23 -0000 1.41 @@ -225,7 +225,14 @@ static int mousedev_open(struct inode * inode, struct file * file) { struct mousedev_list *list; - int i = minor(inode->i_rdev) - MOUSEDEV_MINOR_BASE; + int i; + +#ifdef CONFIG_INPUT_MOUSEDEV_PSAUX + if (major(inode->i_rdev) == MISC_MAJOR)) + i = MOUSEDEV_MIX; + else +#endif + i = minor(inode->i_rdev) - MOUSEDEV_MINOR_BASE; if (i >= MOUSEDEV_MINORS || !mousedev_table[i]) return -ENODEV; @@ -494,6 +501,12 @@ id_table: mousedev_ids, }; +#ifdef CONFIG_INPUT_MOUSEDEV_PSAUX +static struct miscdevice psaux_mouse = { + PSMOUSE_MINOR, "psaux", &mousedev_fops +}; +#endif + static int __init mousedev_init(void) { input_register_handler(&mousedev_handler); @@ -504,6 +517,9 @@ mousedev_mix.exist = 1; mousedev_mix.minor = MOUSEDEV_MIX; mousedev_mix.devfs = input_register_minor("mice", MOUSEDEV_MIX, MOUSEDEV_MINOR_BASE); +#ifdef CONFIG_INPUT_MOUSEDEV_PSAUX + misc_register(&psaux_mouse) +#endif printk(KERN_INFO "mice: PS/2 mouse device common for all mice\n"); @@ -512,6 +528,9 @@ static void __exit mousedev_exit(void) { +#ifdef CONFIG_INPUT_MOUSEDEV_PSAUX + misc_deregister(&psaux_mouse) +#endif input_unregister_minor(mousedev_mix.devfs); input_unregister_handler(&mousedev_handler); } Index: Config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/Config.in,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- Config.in 23 Jan 2002 05:49:24 -0000 1.61 +++ Config.in 22 Feb 2002 11:42:23 -0000 1.62 @@ -10,6 +10,7 @@ comment 'Userland interfaces' dep_tristate ' Keyboard interface' CONFIG_INPUT_KEYBDEV $CONFIG_INPUT dep_tristate ' Mouse interface' CONFIG_INPUT_MOUSEDEV $CONFIG_INPUT +dep_mbool ' Provide legacy /dev/psaux device' CONFIG_INPUT_MOUSEDEV_PSAUX if [ "$CONFIG_INPUT_MOUSEDEV" != "n" ]; then int ' Horizontal screen resolution' CONFIG_INPUT_MOUSEDEV_SCREEN_X 1024 int ' Vertical screen resolution' CONFIG_INPUT_MOUSEDEV_SCREEN_Y 768 |