linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] Input - Beeping and sysrq on m68k [1/23]
@ 2002-10-08 13:38 Vojtech Pavlik
       [not found] ` <20021008153926.A18546@ucw.cz>
  0 siblings, 1 reply; 26+ messages in thread
From: Vojtech Pavlik @ 2002-10-08 13:38 UTC (permalink / raw)
  To: torvalds, linux-kernel


You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

===================================================================

ChangeSet@1.573.13.4, 2002-09-23 09:05:56+02:00, rz@linux-m68k.org
  Move beeping and sysrq to input layer on m68k.
  Add an m68k beeper input module.


 arch/m68k/amiga/config.c      |   38 ++-----------------
 arch/m68k/atari/config.c      |   37 +-----------------
 arch/m68k/bvme6000/config.c   |   22 -----------
 arch/m68k/config.in           |    1 
 arch/m68k/hp300/config.c      |   13 ------
 arch/m68k/kernel/setup.c      |   19 ++-------
 arch/m68k/mac/config.c        |   53 +-------------------------
 arch/m68k/mvme147/config.c    |   11 -----
 arch/m68k/mvme16x/config.c    |   24 ------------
 arch/m68k/q40/config.c        |   31 +--------------
 drivers/input/misc/Config.in  |    3 +
 drivers/input/misc/Makefile   |    1 
 drivers/input/misc/m68kspkr.c |   84 ++++++++++++++++++++++++++++++++++++++++++
 include/asm-m68k/machdep.h    |   14 ++-----
 14 files changed, 107 insertions(+), 244 deletions(-)

===================================================================

diff -Nru a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c
--- a/arch/m68k/amiga/config.c	Tue Oct  8 15:27:40 2002
+++ b/arch/m68k/amiga/config.c	Tue Oct  8 15:27:40 2002
@@ -33,7 +33,6 @@
 #include <asm/amigaints.h>
 #include <asm/irq.h>
 #include <asm/rtc.h>
-#include <asm/keyboard.h>
 #include <asm/machdep.h>
 #include <asm/io.h>
 
@@ -71,11 +70,6 @@
 extern char m68k_debug_device[];
 
 static void amiga_sched_init(void (*handler)(int, void *, struct pt_regs *));
-/* amiga specific keyboard functions */
-extern int amiga_keyb_init(void);
-extern int amiga_kbdrate (struct kbd_repeat *);
-extern int amiga_kbd_translate(unsigned char keycode, unsigned char *keycodep,
-			       char raw_mode);
 /* amiga specific irq functions */
 extern void amiga_init_IRQ (void);
 extern void (*amiga_default_handler[]) (int, void *, struct pt_regs *);
@@ -94,7 +88,6 @@
 static int a3000_hwclk (int, struct rtc_time *);
 static int a2000_hwclk (int, struct rtc_time *);
 static int amiga_set_clock_mmss (unsigned long);
-extern void amiga_mksound( unsigned int count, unsigned int ticks );
 #ifdef CONFIG_AMIGA_FLOPPY
 extern void amiga_floppy_setup(char *, int *);
 #endif
@@ -116,18 +109,6 @@
 	.index =	-1,
 };
 
-#ifdef CONFIG_MAGIC_SYSRQ
-static char amiga_sysrq_xlate[128] =
-	"\0001234567890-=\\\000\000"					/* 0x00 - 0x0f */
-	"qwertyuiop[]\000123"							/* 0x10 - 0x1f */
-	"asdfghjkl;'\000\000456"						/* 0x20 - 0x2f */
-	"\000zxcvbnm,./\000+789"						/* 0x30 - 0x3f */
-	" \177\t\r\r\000\177\000\000\000-\000\000\000\000\000"	/* 0x40 - 0x4f */
-	"\000\201\202\203\204\205\206\207\210\211()/*+\000"	/* 0x50 - 0x5f */
-	"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"	/* 0x60 - 0x6f */
-	"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000";	/* 0x70 - 0x7f */
-#endif
-
 
     /*
      *  Motherboard Resources present in all Amiga models
@@ -388,11 +369,6 @@
     request_resource(&iomem_resource, &((struct resource *)&mb_resources)[i]);
 
   mach_sched_init      = amiga_sched_init;
-#ifdef CONFIG_VT
-  mach_keyb_init       = amiga_keyb_init;
-  mach_kbdrate         = amiga_kbdrate;
-  mach_kbd_translate   = amiga_kbd_translate;
-#endif
   mach_init_IRQ        = amiga_init_IRQ;
   mach_default_handler = &amiga_default_handler;
   mach_request_irq     = amiga_request_irq;
@@ -432,16 +408,10 @@
 #ifdef CONFIG_DUMMY_CONSOLE
   conswitchp           = &dummy_con;
 #endif
-#ifdef CONFIG_VT
-  kd_mksound           = amiga_mksound;
-#endif
-#ifdef CONFIG_MAGIC_SYSRQ
-  SYSRQ_KEY            = 0xff;
-  mach_sysrq_key = 0x5f;	     /* HELP */
-  mach_sysrq_shift_state = 0x03; /* SHIFT+ALTGR */
-  mach_sysrq_shift_mask = 0xff;  /* all modifiers except CapsLock */
-  mach_sysrq_xlate = amiga_sysrq_xlate;
+#ifdef CONFIG_INPUT_M68K_BEEP
+  mach_beep            = amiga_mksound;
 #endif
+
 #ifdef CONFIG_HEARTBEAT
   mach_heartbeat = amiga_heartbeat;
 #endif
@@ -709,7 +679,7 @@
   unsigned long jmp_addr040 = virt_to_phys(&&jmp_addr_label040);
   unsigned long jmp_addr = virt_to_phys(&&jmp_addr_label);
 
-  cli();
+  local_irq_disable();
   if (CPU_IS_040_OR_060)
     /* Setup transparent translation registers for mapping
      * of 16 MB kernel segment before disabling translation
diff -Nru a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c
--- a/arch/m68k/atari/config.c	Tue Oct  8 15:27:40 2002
+++ b/arch/m68k/atari/config.c	Tue Oct  8 15:27:40 2002
@@ -39,7 +39,6 @@
 #include <asm/atariints.h>
 #include <asm/atari_stram.h>
 #include <asm/system.h>
-#include <asm/keyboard.h>
 #include <asm/machdep.h>
 #include <asm/hwtest.h>
 #include <asm/io.h>
@@ -59,12 +58,6 @@
 static void atari_get_model(char *model);
 static int atari_get_hardware_list(char *buffer);
 
-/* atari specific keyboard functions */
-extern int atari_keyb_init(void);
-extern int atari_kbdrate (struct kbd_repeat *);
-extern int atari_kbd_translate(unsigned char keycode, unsigned char *keycodep,
-			       char raw_mode);
-extern void atari_kbd_leds (unsigned int);
 /* atari specific irq functions */
 extern void atari_init_IRQ (void);
 extern int atari_request_irq (unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
@@ -73,7 +66,6 @@
 extern void atari_enable_irq (unsigned int);
 extern void atari_disable_irq (unsigned int);
 extern int show_atari_interrupts (struct seq_file *, void *);
-extern void atari_mksound( unsigned int count, unsigned int ticks );
 #ifdef CONFIG_HEARTBEAT
 static void atari_heartbeat( int on );
 #endif
@@ -89,18 +81,6 @@
 /* atari specific debug functions (in debug.c) */
 extern void atari_debug_init(void);
 
-#ifdef CONFIG_MAGIC_SYSRQ
-static char atari_sysrq_xlate[128] =
-	"\000\0331234567890-=\177\t"					/* 0x00 - 0x0f */
-	"qwertyuiop[]\r\000as"							/* 0x10 - 0x1f */
-	"dfghjkl;'`\000\\zxcv"							/* 0x20 - 0x2f */
-	"bnm,./\000\000\000 \000\201\202\203\204\205"	/* 0x30 - 0x3f */
-	"\206\207\210\211\212\000\000\000\000\000-\000\000\000+\000"/* 0x40 - 0x4f */
-	"\000\000\000\177\000\000\000\000\000\000\000\000\000\000\000\000" /* 0x50 - 0x5f */
-	"\000\000\000()/*789456123"						/* 0x60 - 0x6f */
-	"0.\r\000\000\000\000\000\000\000\000\000\000\000\000\000";	/* 0x70 - 0x7f */
-#endif
-
 
 /* I've moved hwreg_present() and hwreg_present_bywrite() out into
  * mm/hwtest.c, to avoid having multiple copies of the same routine
@@ -254,12 +234,6 @@
                                            to 4GB. */
 
     mach_sched_init      = atari_sched_init;
-#ifdef CONFIG_VT
-    mach_keyb_init       = atari_keyb_init;
-    mach_kbdrate         = atari_kbdrate;
-    mach_kbd_translate   = atari_kbd_translate;
-    mach_kbd_leds        = atari_kbd_leds;
-#endif
     mach_init_IRQ        = atari_init_IRQ;
     mach_request_irq     = atari_request_irq;
     mach_free_irq        = atari_free_irq;
@@ -277,15 +251,8 @@
     conswitchp	         = &dummy_con;
 #endif
     mach_max_dma_address = 0xffffff;
-#ifdef CONFIG_VT
-    kd_mksound		 = atari_mksound;
-#endif
-#ifdef CONFIG_MAGIC_SYSRQ
-    SYSRQ_KEY            = 0xff;
-    mach_sysrq_key = 98;          /* HELP */
-    mach_sysrq_shift_state = 8;   /* Alt */
-    mach_sysrq_shift_mask = 0xff; /* all modifiers except CapsLock */
-    mach_sysrq_xlate = atari_sysrq_xlate;
+#ifdef CONFIG_INPUT_M68K_BEEP
+    mach_beep          = atari_mksound;
 #endif
 #ifdef CONFIG_HEARTBEAT
     mach_heartbeat = atari_heartbeat;
diff -Nru a/arch/m68k/bvme6000/config.c b/arch/m68k/bvme6000/config.c
--- a/arch/m68k/bvme6000/config.c	Tue Oct  8 15:27:40 2002
+++ b/arch/m68k/bvme6000/config.c	Tue Oct  8 15:27:40 2002
@@ -45,12 +45,9 @@
 static int  bvme6000_get_hardware_list(char *buffer);
 extern int  bvme6000_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id);
 extern void bvme6000_sched_init(void (*handler)(int, void *, struct pt_regs *));
-extern int  bvme6000_keyb_init(void);
-extern int  bvme6000_kbdrate (struct kbd_repeat *);
 extern unsigned long bvme6000_gettimeoffset (void);
 extern int bvme6000_hwclk (int, struct rtc_time *);
 extern int bvme6000_set_clock_mmss (unsigned long);
-extern void bvme6000_mksound( unsigned int count, unsigned int ticks );
 extern void bvme6000_reset (void);
 extern void bvme6000_waitbut(void);
 void bvme6000_set_vectors (void);
@@ -72,15 +69,6 @@
 		return 1;
 }
 
-int bvme6000_kbdrate (struct kbd_repeat *k)
-{
-	return 0;
-}
-
-void bvme6000_mksound( unsigned int count, unsigned int ticks )
-{
-}
-
 void bvme6000_reset()
 {
 	volatile PitRegsPtr pit = (PitRegsPtr)BVME_PIT_BASE;
@@ -133,15 +121,10 @@
 
     mach_max_dma_address = 0xffffffff;
     mach_sched_init      = bvme6000_sched_init;
-#ifdef CONFIG_VT
-    mach_keyb_init       = bvme6000_keyb_init;
-    mach_kbdrate         = bvme6000_kbdrate;
-#endif
     mach_init_IRQ        = bvme6000_init_IRQ;
     mach_gettimeoffset   = bvme6000_gettimeoffset;
     mach_hwclk           = bvme6000_hwclk;
     mach_set_clock_mmss	 = bvme6000_set_clock_mmss;
-/*  mach_mksound         = bvme6000_mksound; */
     mach_reset		 = bvme6000_reset;
     mach_free_irq	 = bvme6000_free_irq;
     mach_process_int	 = bvme6000_process_int;
@@ -394,8 +377,3 @@
 	return retval;
 }
 
-
-int bvme6000_keyb_init (void)
-{
-	return 0;
-}
diff -Nru a/arch/m68k/config.in b/arch/m68k/config.in
--- a/arch/m68k/config.in	Tue Oct  8 15:27:40 2002
+++ b/arch/m68k/config.in	Tue Oct  8 15:27:40 2002
@@ -3,6 +3,7 @@
 # see Documentation/kbuild/config-language.txt.
 #
 
+define_bool CONFIG_M68K y
 define_bool CONFIG_UID16 y
 define_bool CONFIG_RWSEM_GENERIC_SPINLOCK y
 define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM n
diff -Nru a/arch/m68k/hp300/config.c b/arch/m68k/hp300/config.c
--- a/arch/m68k/hp300/config.c	Tue Oct  8 15:27:40 2002
+++ b/arch/m68k/hp300/config.c	Tue Oct  8 15:27:40 2002
@@ -17,7 +17,6 @@
 #include <linux/init.h>
 #include <asm/machdep.h>
 #include <asm/blinken.h>
-#include <asm/io.h>                               /* readb() and writeb() */
 #include <asm/hwtest.h>                           /* hwreg_present() */
 
 #include "ints.h"
@@ -27,14 +26,6 @@
 extern void (*hp300_default_handler[])(int, void *, struct pt_regs *);
 extern int show_hp300_interrupts(struct seq_file *, void *);
 
-#ifdef CONFIG_VT
-extern int hp300_keyb_init(void);
-static int hp300_kbdrate(struct kbd_repeat *k)
-{
-  return 0;
-}
-#endif
-
 #ifdef CONFIG_HEARTBEAT
 static void hp300_pulse(int x)
 {
@@ -53,10 +44,6 @@
 void __init config_hp300(void)
 {
   mach_sched_init      = hp300_sched_init;
-#ifdef CONFIG_VT
-  mach_keyb_init       = hp300_keyb_init;
-  mach_kbdrate         = hp300_kbdrate;
-#endif
   mach_init_IRQ        = hp300_init_IRQ;
   mach_request_irq     = hp300_request_irq;
   mach_free_irq        = hp300_free_irq;
diff -Nru a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c
--- a/arch/m68k/kernel/setup.c	Tue Oct  8 15:27:40 2002
+++ b/arch/m68k/kernel/setup.c	Tue Oct  8 15:27:40 2002
@@ -71,13 +71,6 @@
 char m68k_debug_device[6] = "";
 
 void (*mach_sched_init) (void (*handler)(int, void *, struct pt_regs *)) __initdata = NULL;
-/* machine dependent keyboard functions */
-#ifdef CONFIG_VT
-int (*mach_keyb_init) (void) __initdata = NULL;
-int (*mach_kbdrate) (struct kbd_repeat *) = NULL;
-void (*mach_kbd_leds) (unsigned int) = NULL;
-int (*mach_kbd_translate)(unsigned char scancode, unsigned char *keycode, char raw_mode) = NULL;
-#endif
 /* machine dependent irq functions */
 void (*mach_init_IRQ) (void) __initdata = NULL;
 void (*(*mach_default_handler)[]) (int, void *, struct pt_regs *) = NULL;
@@ -89,6 +82,8 @@
 unsigned long (*mach_gettimeoffset) (void);
 int (*mach_hwclk) (int, struct rtc_time*) = NULL;
 int (*mach_set_clock_mmss) (unsigned long) = NULL;
+int (*mach_get_rtc_pll)(struct rtc_pll_info *) = NULL;
+int (*mach_set_rtc_pll)(struct rtc_pll_info *) = NULL;
 void (*mach_reset)( void );
 void (*mach_halt)( void ) = NULL;
 void (*mach_power_off)( void ) = NULL;
@@ -103,15 +98,9 @@
 #ifdef CONFIG_M68K_L2_CACHE
 void (*mach_l2_flush) (int) = NULL;
 #endif
-
-#ifdef CONFIG_MAGIC_SYSRQ
-unsigned int SYSRQ_KEY;
-int mach_sysrq_key = -1;
-int mach_sysrq_shift_state = 0;
-int mach_sysrq_shift_mask = 0;
-char *mach_sysrq_xlate = NULL;
+#ifdef CONFIG_INPUT_M68K_BEEP
+void (*mach_beep)(unsigned int, unsigned int) = NULL;
 #endif
-
 #if defined(CONFIG_ISA) && defined(MULTI_ISA)
 int isa_type;
 int isa_sex;
diff -Nru a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
--- a/arch/m68k/mac/config.c	Tue Oct  8 15:27:40 2002
+++ b/arch/m68k/mac/config.c	Tue Oct  8 15:27:40 2002
@@ -78,27 +78,12 @@
 extern void psc_init(void);
 extern void baboon_init(void);
 
-extern void mac_mksound(unsigned int, unsigned int);
-
 extern void nubus_sweep_video(void);
 
 /* Mac specific debug functions (in debug.c) */
 extern void mac_debug_init(void);
 extern void mac_debugging_long(int, long);
 
-extern int mackbd_init_hw(void);
-extern void mackbd_leds(unsigned int leds);
-extern int mackbd_translate(unsigned char keycode, unsigned char *keycodep, char raw_mode);
-
-extern void mac_hid_init_hw(void);
-extern int mac_hid_kbd_translate(unsigned char scancode, unsigned char *keycode, char raw_mode);
-
-#ifdef CONFIG_MAGIC_SYSRQ
-extern unsigned char mac_hid_kbd_sysrq_xlate[128];
-extern unsigned char pckbd_sysrq_xlate[128];
-extern unsigned char mackbd_sysrq_xlate[128];
-#endif /* CONFIG_MAGIC_SYSRQ */
-
 static void mac_get_model(char *str);
 
 void mac_bang(int irq, void *vector, struct pt_regs *p)
@@ -207,33 +192,6 @@
 	  printk("ERROR: no Mac, but config_mac() called!! \n");
 	}
 
-#ifdef CONFIG_VT
-#ifdef CONFIG_INPUT_ADBHID
-	mach_keyb_init       = mac_hid_init_hw;
-	mach_kbd_translate   = mac_hid_kbd_translate;
-#ifdef CONFIG_MAGIC_SYSRQ
-#ifdef CONFIG_MAC_ADBKEYCODES
-	if (!keyboard_sends_linux_keycodes) {
-		mach_sysrq_xlate = mac_hid_kbd_sysrq_xlate;
-		SYSRQ_KEY = 0x69;
-	} else
-#endif /* CONFIG_MAC_ADBKEYCODES */
-	{
-		mach_sysrq_xlate = pckbd_sysrq_xlate;
-		SYSRQ_KEY = 0x54;
-	}
-#endif /* CONFIG_MAGIC_SYSRQ */
-#elif defined(CONFIG_ADB_KEYBOARD)
-	mach_keyb_init       = mackbd_init_hw;
-	mach_kbd_leds        = mackbd_leds;
-	mach_kbd_translate   = mackbd_translate;
-#ifdef CONFIG_MAGIC_SYSRQ
-	mach_sysrq_xlate     = mackbd_sysrq_xlate;
-	SYSRQ_KEY = 0x69;
-#endif /* CONFIG_MAGIC_SYSRQ */
-#endif /* CONFIG_INPUT_ADBHID */
-#endif /* CONFIG_VT */
-
 	mach_sched_init      = mac_sched_init;
 	mach_init_IRQ        = mac_init_IRQ;
 	mach_request_irq     = mac_request_irq;
@@ -249,9 +207,6 @@
 	mach_hwclk           = mac_hwclk;
 #endif
 	mach_set_clock_mmss	 = mac_set_clock_mmss;
-#if 0
-	mach_mksound         = mac_mksound;
-#endif
 	mach_reset           = mac_reset;
 	mach_halt            = mac_poweroff;
 	mach_power_off       = mac_poweroff;
@@ -262,8 +217,8 @@
 #if 0
 	mach_debug_init	 = mac_debug_init;
 #endif
-#ifdef CONFIG_VT
-	kd_mksound		 = mac_mksound;
+#ifdef CONFIG_INPUT_M68K_BEEP
+        mach_beep            = mac_mksound;
 #endif
 #ifdef CONFIG_HEARTBEAT
 #if 0
@@ -287,10 +242,6 @@
 	    || macintosh_config->ident == MAC_MODEL_IIFX) {
 		mach_l2_flush = mac_cache_card_flush;
 	}
-#ifdef MAC_DEBUG_SOUND
-	/* goes on forever if timers broken */
-	mac_mksound(1000,10);
-#endif
 
 	/*
 	 * Check for machine specific fixups.
diff -Nru a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c
--- a/arch/m68k/mvme147/config.c	Tue Oct  8 15:27:40 2002
+++ b/arch/m68k/mvme147/config.c	Tue Oct  8 15:27:40 2002
@@ -45,8 +45,6 @@
 static int  mvme147_get_hardware_list(char *buffer);
 extern int mvme147_request_irq (unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id);
 extern void mvme147_sched_init(void (*handler)(int, void *, struct pt_regs *));
-extern int mvme147_keyb_init(void);
-extern int mvme147_kbdrate (struct kbd_repeat *);
 extern unsigned long mvme147_gettimeoffset (void);
 extern int mvme147_hwclk (int, struct rtc_time *);
 extern int mvme147_set_clock_mmss (unsigned long);
@@ -70,11 +68,6 @@
 		return 1;
 }
 
-int mvme147_kbdrate (struct kbd_repeat *k)
-{
-	return 0;
-}
-
 void mvme147_reset()
 {
 	printk ("\r\n\nCalled mvme147_reset\r\n");
@@ -102,10 +95,6 @@
 {
 	mach_max_dma_address	= 0x01000000;
 	mach_sched_init		= mvme147_sched_init;
-#ifdef CONFIG_VT
-	mach_keyb_init		= mvme147_keyb_init;
-	mach_kbdrate		= mvme147_kbdrate;
-#endif
 	mach_init_IRQ		= mvme147_init_IRQ;
 	mach_gettimeoffset	= mvme147_gettimeoffset;
 	mach_hwclk		= mvme147_hwclk;
diff -Nru a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c
--- a/arch/m68k/mvme16x/config.c	Tue Oct  8 15:27:40 2002
+++ b/arch/m68k/mvme16x/config.c	Tue Oct  8 15:27:40 2002
@@ -49,12 +49,9 @@
 static int  mvme16x_get_hardware_list(char *buffer);
 extern int  mvme16x_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id);
 extern void mvme16x_sched_init(void (*handler)(int, void *, struct pt_regs *));
-extern int  mvme16x_keyb_init(void);
-extern int  mvme16x_kbdrate (struct kbd_repeat *);
 extern unsigned long mvme16x_gettimeoffset (void);
 extern int mvme16x_hwclk (int, struct rtc_time *);
 extern int mvme16x_set_clock_mmss (unsigned long);
-extern void mvme16x_mksound( unsigned int count, unsigned int ticks );
 extern void mvme16x_reset (void);
 extern void mvme16x_waitbut(void);
 
@@ -77,15 +74,6 @@
 		return 1;
 }
 
-int mvme16x_kbdrate (struct kbd_repeat *k)
-{
-	return 0;
-}
-
-void mvme16x_mksound( unsigned int count, unsigned int ticks )
-{
-}
-
 void mvme16x_reset()
 {
 	printk ("\r\n\nCalled mvme16x_reset\r\n"
@@ -144,17 +132,10 @@
 
     mach_max_dma_address = 0xffffffff;
     mach_sched_init      = mvme16x_sched_init;
-#ifdef CONFIG_VT
-    mach_keyb_init       = mvme16x_keyb_init;
-    mach_kbdrate         = mvme16x_kbdrate;
-#endif
     mach_init_IRQ        = mvme16x_init_IRQ;
     mach_gettimeoffset   = mvme16x_gettimeoffset;
     mach_hwclk           = mvme16x_hwclk;
     mach_set_clock_mmss	 = mvme16x_set_clock_mmss;
-#ifdef CONFIG_VT
-/*  kd_mksound           = mvme16x_mksound; */
-#endif
     mach_reset		 = mvme16x_reset;
     mach_free_irq	 = mvme16x_free_irq;
     mach_process_int	 = mvme16x_process_int;
@@ -297,11 +278,6 @@
 }
 
 int mvme16x_set_clock_mmss (unsigned long nowtime)
-{
-	return 0;
-}
-
-int mvme16x_keyb_init (void)
 {
 	return 0;
 }
diff -Nru a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c
--- a/arch/m68k/q40/config.c	Tue Oct  8 15:27:40 2002
+++ b/arch/m68k/q40/config.c	Tue Oct  8 15:27:40 2002
@@ -36,12 +36,9 @@
 #include <asm/rtc.h>
 #include <asm/machdep.h>
 #include <asm/q40_master.h>
-#include <asm/keyboard.h>
 
 extern void floppy_setup(char *str, int *ints);
 
-extern int q40kbd_translate(unsigned char scancode, unsigned char *keycode,
-			    char raw_mode);
 extern void q40_process_int (int level, struct pt_regs *regs);
 extern void (*q40_sys_default_handler[]) (int, void *, struct pt_regs *);  /* added just for debugging */
 extern void q40_init_IRQ (void);
@@ -62,8 +59,6 @@
 extern void q40_waitbut(void);
 void q40_set_vectors (void);
 
-void q40_mksound(unsigned int /*freq*/, unsigned int /*ticks*/ );
-
 extern char *saved_command_line;
 extern char m68k_debug_device[];
 static void q40_mem_console_write(struct console *co, const char *b,
@@ -82,14 +77,6 @@
 extern char *q40_mem_cptr; /*=(char *)0xff020000;*/
 static int _cpleft;
 
-#if 0
-int q40_kbd_translate(unsigned char keycode, unsigned char *keycodep, char raw_mode)
-{
-        *keycodep = keycode;
-        return 1;
-}
-#endif
-
 static void q40_mem_console_write(struct console *co, const char *s,
 				  unsigned int count)
 {
@@ -117,13 +104,6 @@
 }
 #endif
 
-#if 0
-int q40_kbdrate (struct kbd_repeat *k)
-{
-	return 0;
-}
-#endif
-
 static int halted=0;
 
 #ifdef CONFIG_HEARTBEAT
@@ -185,10 +165,6 @@
 {
     mach_sched_init      = q40_sched_init;
 
-#ifdef CONFIG_VT
-    mach_keyb_init       = q40kbd_init_hw;
-    mach_kbd_translate   = q40kbd_translate;
-#endif
     mach_init_IRQ        = q40_init_IRQ;   
     mach_gettimeoffset   = q40_gettimeoffset; 
     mach_hwclk           = q40_hwclk; 
@@ -204,12 +180,9 @@
     mach_default_handler = &q40_sys_default_handler;
     mach_get_model       = q40_get_model;
     mach_get_hardware_list = q40_get_hardware_list;
-#ifdef CONFIG_VT
-    kd_mksound             = q40_mksound;
-#endif
 
-#ifdef CONFIG_MAGIC_SYSRQ
-    mach_sysrq_key       = 0x54;
+#ifdef CONFIG_INPUT_M68K_BEEP
+    mach_beep            = q40_mksound;
 #endif
 #ifdef CONFIG_HEARTBEAT
     mach_heartbeat = q40_heartbeat;
diff -Nru a/drivers/input/misc/Config.in b/drivers/input/misc/Config.in
--- a/drivers/input/misc/Config.in	Tue Oct  8 15:27:40 2002
+++ b/drivers/input/misc/Config.in	Tue Oct  8 15:27:40 2002
@@ -8,4 +8,7 @@
 if [ "$CONFIG_SPARC32" = "y" -o "$CONFIG_SPARC64" = "y" ]; then
    dep_tristate '  SPARC Speaker support' CONFIG_INPUT_SPARCSPKR $CONFIG_INPUT $CONFIG_INPUT_MISC
 fi
+if [ "$CONFIG_M68K" = "y" ]; then
+dep_tristate '  M68K Beeper support' CONFIG_INPUT_M68K_BEEP $CONFIG_INPUT $CONFIG_INPUT_MISC
+fi
 dep_tristate '  User level driver support' CONFIG_INPUT_UINPUT $CONFIG_INPUT $CONFIG_INPUT_MISC
diff -Nru a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
--- a/drivers/input/misc/Makefile	Tue Oct  8 15:27:40 2002
+++ b/drivers/input/misc/Makefile	Tue Oct  8 15:27:40 2002
@@ -6,6 +6,7 @@
 
 obj-$(CONFIG_INPUT_SPARCSPKR)		+= sparcspkr.o
 obj-$(CONFIG_INPUT_PCSPKR)		+= pcspkr.o
+obj-$(CONFIG_INPUT_M68K_BEEP)		+= m68kspkr.o
 obj-$(CONFIG_INPUT_UINPUT)		+= uinput.o
 
 # The global Rules.make.
diff -Nru a/drivers/input/misc/m68kspkr.c b/drivers/input/misc/m68kspkr.c
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/drivers/input/misc/m68kspkr.c	Tue Oct  8 15:27:40 2002
@@ -0,0 +1,84 @@
+/*
+ *  m68k beeper driver for Linux
+ *
+ *  Copyright (c) 2002 Richard Zidlicky
+ *  Copyright (c) 2002 Vojtech Pavlik
+ *  Copyright (c) 1992 Orest Zborowski
+ *
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/input.h>
+#include <asm/machdep.h>
+#include <asm/io.h>
+
+MODULE_AUTHOR("Richard Zidlicky <rz@linux-m68k.org>");
+MODULE_DESCRIPTION("m68k beeper driver");
+MODULE_LICENSE("GPL");
+
+static char m68kspkr_name[] = "m68k beeper";
+static char m68kspkr_phys[] = "m68k/generic";
+static struct input_dev m68kspkr_dev;
+
+static int m68kspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
+{
+	unsigned int count = 0;
+	unsigned long flags;
+
+	if (type != EV_SND)
+		return -1;
+
+	switch (code) {
+		case SND_BELL: if (value) value = 1000;
+		case SND_TONE: break;
+		default: return -1;
+	} 
+
+	if (value > 20 && value < 32767)
+		count = 1193182 / value;
+	
+	mach_beep(count, -1);
+
+	return 0;
+}
+
+static int __init m68kspkr_init(void)
+{
+        if (!mach_beep){
+		printk("%s: no lowlevel beep support\n", m68kspkr_name);
+		return -1;
+        }
+
+	m68kspkr_dev.evbit[0] = BIT(EV_SND);
+	m68kspkr_dev.sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE);
+	m68kspkr_dev.event = m68kspkr_event;
+
+	m68kspkr_dev.name = m68kspkr_name;
+	m68kspkr_dev.phys = m68kspkr_phys;
+	m68kspkr_dev.id.bustype = BUS_HOST;
+	m68kspkr_dev.id.vendor = 0x001f;
+	m68kspkr_dev.id.product = 0x0001;
+	m68kspkr_dev.id.version = 0x0100;
+
+	input_register_device(&m68kspkr_dev);
+
+        printk(KERN_INFO "input: %s\n", m68kspkr_name);
+
+	return 0;
+}
+
+static void __exit m68kspkr_exit(void)
+{
+        input_unregister_device(&m68kspkr_dev);
+}
+
+module_init(m68kspkr_init);
+module_exit(m68kspkr_exit);
diff -Nru a/include/asm-m68k/machdep.h b/include/asm-m68k/machdep.h
--- a/include/asm-m68k/machdep.h	Tue Oct  8 15:27:40 2002
+++ b/include/asm-m68k/machdep.h	Tue Oct  8 15:27:40 2002
@@ -4,17 +4,12 @@
 #include <linux/seq_file.h>
 
 struct pt_regs;
-struct kbd_repeat;
 struct mktime;
 struct rtc_time;
+struct rtc_pll_info;
 struct buffer_head;
 
 extern void (*mach_sched_init) (void (*handler)(int, void *, struct pt_regs *));
-/* machine dependent keyboard functions */
-extern int (*mach_keyb_init) (void);
-extern int (*mach_kbdrate) (struct kbd_repeat *);
-extern void (*mach_kbd_leds) (unsigned int);
-extern int (*mach_kbd_translate)(unsigned char scancode, unsigned char *keycode, char raw_mode);
 /* machine dependent irq functions */
 extern void (*mach_init_IRQ) (void);
 extern void (*(*mach_default_handler)[]) (int, void *, struct pt_regs *);
@@ -28,6 +23,8 @@
 /* machine dependent timer functions */
 extern unsigned long (*mach_gettimeoffset)(void);
 extern int (*mach_hwclk)(int, struct rtc_time*);
+extern int (*mach_get_rtc_pll)(struct rtc_pll_info *);
+extern int (*mach_set_rtc_pll)(struct rtc_pll_info *);
 extern int (*mach_set_clock_mmss)(unsigned long);
 extern void (*mach_reset)( void );
 extern void (*mach_halt)( void );
@@ -38,9 +35,6 @@
 extern void (*mach_floppy_setup)(char *, int *);
 extern void (*mach_heartbeat) (int);
 extern void (*mach_l2_flush) (int);
-extern int mach_sysrq_key;
-extern int mach_sysrq_shift_state;
-extern int mach_sysrq_shift_mask;
-extern char *mach_sysrq_xlate;
+extern void (*mach_beep) (unsigned int, unsigned int);
 
 #endif /* _M68K_MACHDEP_H */

===================================================================

This BitKeeper patch contains the following changesets:
1.573.13.4
## Wrapped with gzip_uu ##


begin 664 bkpatch18473
M'XL(`$S=HCT``\U;:W/;MA+]+/X*U'W):2WAP:=49Y)83J*)8WO\Z-QIT]%0
M)"BQDDB5I.PXE_WO=P%*%B61DJDVX^MT$I-<+!;8@\79!?HMNHUYU*K=A7\F
MW!DJWZ+W89RT:O$LY@WG"SQ?A2$\-X?AA#?G4LW^J.D'TUFBP/=+.W&&Z(Y'
M<:M&&NSQ3?(PY:W:U>F[V[/75XIR?(Q.AG8PX-<\0<?'2A)&=_;8C5_9R7`<
M!HTDLH-XPA.[X823]%$TI1A3^*,1@V%-3XF.52-UB$N(K1+N8JJ:NKK4)LS<
MKLNBH(@11E*5ZD17.H@T-(,U"&NH"-,FMIJ4(6RUL-;2])\P;6&,HB^OQGXP
M^WPTT<U1(XP&Z">BHB.LO$'_[D!.%`=]#.\XZG,^]8,!L@,7Q0]Q]!=TA.2D
MH[']P",4!D@:`PU>NR[(R4?9#KYFDI/0G8UY0_F`5--DIG*Y](%R5/%'4;"-
ME9<[QFM'``]A2+-_-^$ZQKCIA('G#QI.;@943,U499@0F`?/9@Y634(-W;+5
MS:G>K5.XU,":AE/"+$PK&&DG=N276`@^,@V5I)K.';#5U4W2]YCN;;6P2&'.
M/(J9!>;-U]&K^2I+W<@7"RA;5,V)'SO-DTR%'V0Z3*H11@DQ4XWJV$Q-DW@V
M-DU#]YA#S:)IVZUT:9A*5:.*<R?@"*)_+O6M3BVLI@:S/<JIZIJ,J(P6+*.=
M*G,F8LO2*ICHK(YUZ55L:@Q\R[E&&2&>#B\U3+?:YI3-&^C"5@6C_E++UX,P
M0T\]!C#CAH.YW8>PM-6L36TYRP"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DL@7)V(<_8B0+/)DIB[.2G\LB8'HN_S[U:?>Q^[UB>+Y
M93!:7(%[(HJJW<)[,HC6U>J4$9.9*:6,90D9^[^H"3YBJ/^(H>RNX&X,+8:X
M#X1,B!YA_\^C[^K%`#BLU7Y:'BXWPN7_#N(,N3.*9Y-C`UN&APE7_@?9'/X(
$:3(`````
`
end

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [patch] Input - Better naming of HID devices [3/23]
       [not found] ` <20021008153926.A18546@ucw.cz>
@ 2002-10-08 13:40   ` Vojtech Pavlik
  2002-10-08 13:41     ` [patch] Input - Support for PS/2 Multiplexing spec [4/23] Vojtech Pavlik
  0 siblings, 1 reply; 26+ messages in thread
From: Vojtech Pavlik @ 2002-10-08 13:40 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: torvalds, linux-kernel


You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

===================================================================

ChangeSet@1.573.1.32, 2002-09-24 13:56:28+02:00, bhards@bigpond.net.au
  Better naming for USB input devices that omit the manufacturer name.


 hid-core.c |    2 ++
 1 files changed, 2 insertions(+)

===================================================================

diff -Nru a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
--- a/drivers/usb/input/hid-core.c	Tue Oct  8 15:27:25 2002
+++ b/drivers/usb/input/hid-core.c	Tue Oct  8 15:27:25 2002
@@ -1469,6 +1469,8 @@
 		strcat(hid->name, buf);
 		if (usb_string(dev, dev->descriptor.iProduct, buf, 64) > 0)
 			snprintf(hid->name, 64, "%s %s", hid->name, buf);
+	} else if (usb_string(dev, dev->descriptor.iProduct, buf, 128) > 0) {
+			snprintf(hid->name, 128, "%s", buf);
 	} else
 		snprintf(hid->name, 128, "%04x:%04x", dev->descriptor.idVendor, dev->descriptor.idProduct);
 

===================================================================

This BitKeeper patch contains the following changesets:
1.573.1.32
## Wrapped with gzip_uu ##


begin 664 bkpatch18415
M'XL(`#W=HCT``[6476_3,!2&K^-?<;0)T6EM8CM?;5"KL8$`@435:M?(<9PF
MM(DKVRDJA/^.DXX-&'1B@B07MN/S^CW'CWT*UUJHQ-G)CT;P`IW":ZE-XNA&
M"Y=_MOV%E+;O%;(2WLTL+UU[9;UM#++_Y\SP`G9"Z<0AKG\[8O9;D3B+EZ^N
MWSU?(#2=PE7!ZI58"@/3*3)2[=@FTQ?,%!M9NT:Q6E?",)?+JKV=VE*,J7U#
M$OLXC%H2X2!N.<D(80$1&:;!.`K0C;&+&]N_QD^H;T4F8=!B,IY$Z`40-XQ]
MU_JE@*F')QX-@/A)&"5T?(YI@C&D!5/67UJNMK+.W%H8ES5P3F"$T27\6_]7
MB,.E,$8HJ%E5UBO(I8+KY27T=89,[$HN-)B"&9!5:6Q+0,7J)F?<-.H0)UST
M%F@8$32_*S8:_>6#$&88S1[(,%-EM^=>HU.O*#.7_Y!I@$G<!H$=:+.8D#C/
MXS3.)HQ%X>^K^I-:GW&G.>)2B>_"$QH0$D;4;S$.*>Z!.A;U,&./S`"ME%A=
MK)5DQ3V9/U@G$25^9]TR%Y.>/G]\CSO_.'?T?W&WM"<;UF*?RFY=R&3]U$#!
M=@+8?<*&H$V3YQVAPJ:]-X5M6I&R-A*V2F8--P<4NXNEYW4(90YLQ\H-2S<]
MHMW^O8>1^M1_EKCYT:U\!,%O2!`3H,CY"F)C?5@'`RO]01ME_0[L<1IV9VHT
MRX3FJMS:JKKE_&!_"&F3#X'0\1G,`)_!%^0XCJZW-M3D@\[7[%`*.V4()T_T
>21]R]NSN.N2%X&O=5-.0<7OCX`!]`];JN_II!0``
`
end

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [patch] Input - Support for PS/2 Multiplexing spec [4/23]
  2002-10-08 13:40   ` [patch] Input - Better naming of HID devices [3/23] Vojtech Pavlik
@ 2002-10-08 13:41     ` Vojtech Pavlik
  2002-10-08 13:42       ` [patch] Input - Fix Logitech Desktop Pro wheel [5/23] Vojtech Pavlik
  2002-10-08 21:59       ` [patch] Input - Support for PS/2 Multiplexing spec [4/23] Pavel Machek
  0 siblings, 2 replies; 26+ messages in thread
From: Vojtech Pavlik @ 2002-10-08 13:41 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: torvalds, linux-kernel


You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

===================================================================

ChangeSet@1.573.1.33, 2002-09-24 18:48:50+02:00, vojtech@suse.cz
  Add support for PS/2 Active Multiplexing Spec, updates for PS/2 mouse
  and keyboard handling - proper cleanup on reboot, allow USB-emulated
  AT keyboards, option to restrict PS/2 mouse to generic mode.


 drivers/input/keyboard/atkbd.c      |   86 ++++++---
 drivers/input/mouse/psmouse.c       |   42 ++++
 drivers/input/serio/i8042-io.h      |    9 -
 drivers/input/serio/i8042-ppcio.h   |   12 -
 drivers/input/serio/i8042-sparcio.h |   13 -
 drivers/input/serio/i8042.c         |  321 ++++++++++++++++++++++++------------
 drivers/input/serio/i8042.h         |   25 ++
 include/linux/serio.h               |   12 +
 8 files changed, 361 insertions(+), 159 deletions(-)

===================================================================

diff -Nru a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
--- a/drivers/input/keyboard/atkbd.c	Tue Oct  8 15:27:18 2002
+++ b/drivers/input/keyboard/atkbd.c	Tue Oct  8 15:27:18 2002
@@ -22,9 +22,15 @@
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
 MODULE_DESCRIPTION("AT and PS/2 keyboard driver");
 MODULE_PARM(atkbd_set, "1i");
+MODULE_PARM(atkbd_reset, "1i");
 MODULE_LICENSE("GPL");
 
 static int atkbd_set = 2;
+#if defined(__i386__) || defined (__x86_64__)
+static int atkbd_reset;
+#else
+static int atkbd_reset = 1;
+#endif
 
 /*
  * Scancode to keycode tables. These are just the default setting, and
@@ -89,6 +95,7 @@
 #define ATKBD_CMD_RESEND	0x00fe
 #define ATKBD_CMD_EX_ENABLE	0x10ea
 #define ATKBD_CMD_EX_SETLEDS	0x20eb
+#define ATKBD_CMD_OK_GETID	0x02e8
 
 #define ATKBD_RET_ACK		0xfa
 #define ATKBD_RET_NAK		0xfe
@@ -113,6 +120,7 @@
 	unsigned char cmdbuf[4];
 	unsigned char cmdcnt;
 	unsigned char set;
+	unsigned char oldset;
 	unsigned char release;
 	signed char ack;
 	unsigned char emul;
@@ -134,7 +142,6 @@
 	printk(KERN_DEBUG "atkbd.c: Received %02x flags %02x\n", data, flags);
 #endif
 
-	/* Interface error.  Request that the keyboard resend. */
 	if ((flags & (SERIO_FRAME | SERIO_PARITY)) && (~flags & SERIO_TIMEOUT) && atkbd->write) {
 		printk("atkbd.c: frame/parity error: %02x\n", flags);
 		serio_write(serio, ATKBD_CMD_RESEND);
@@ -205,7 +212,9 @@
 #ifdef ATKBD_DEBUG
 	printk(KERN_DEBUG "atkbd.c: Sent: %02x\n", byte);
 #endif
-	serio_write(atkbd->serio, byte);
+	if (serio_write(atkbd->serio, byte))
+		return -1;
+
 	while (!atkbd->ack && timeout--) udelay(10);
 
 	return -(atkbd->ack <= 0);
@@ -289,34 +298,41 @@
 
 static int atkbd_set_3(struct atkbd *atkbd)
 {
-	unsigned char param;
+	unsigned char param[2];
+
+/*
+ * Remember original scancode set value, so that we can restore it on exit.
+ */
+
+	if (atkbd_command(atkbd, &atkbd->oldset, ATKBD_CMD_GSCANSET))
+		atkbd->oldset = 2;
 
 /*
  * For known special keyboards we can go ahead and set the correct set.
+ * We check for NCD PS/2 Sun, NorthGate OmniKey 101 and IBM RapidAccess
+ * keyboards.
  */
 
 	if (atkbd->id == 0xaca1) {
-		param = 3;
-		atkbd_command(atkbd, &param, ATKBD_CMD_SSCANSET);
+		param[0] = 3;
+		atkbd_command(atkbd, param, ATKBD_CMD_SSCANSET);
 		return 3;
 	}
 
-/*
- * We check for the extra keys on an some keyboards that need extra
- * command to get enabled. This shouldn't harm any keyboards not
- * knowing the command.
- */
+	if (!atkbd_command(atkbd, param, ATKBD_CMD_OK_GETID)) {
+		atkbd->id = param[0] << 8 | param[1];
+		return 2;
+	}
 
-	param = 0x71;
-	if (!atkbd_command(atkbd, &param, ATKBD_CMD_EX_ENABLE))
+	param[0] = 0x71;
+	if (!atkbd_command(atkbd, param, ATKBD_CMD_EX_ENABLE))
 		return 4;
 
 /*
  * Try to set the set we want.
  */
 
-	param = atkbd_set;
-	if (atkbd_command(atkbd, &param, ATKBD_CMD_SSCANSET))
+	if (atkbd_command(atkbd, &atkbd_set, ATKBD_CMD_SSCANSET))
 		return 2;
 
 /*
@@ -327,8 +343,8 @@
  * In that case we time out, and return 2.
  */
 
-	param = 0;
-	if (atkbd_command(atkbd, &param, ATKBD_CMD_GSCANSET))
+	param[0] = 0;
+	if (atkbd_command(atkbd, param, ATKBD_CMD_GSCANSET))
 		return 2;
 
 /*
@@ -336,7 +352,7 @@
  * itself.
  */
 
-	return (param == 3) ? 3 : 2;
+	return (param[0] == 3) ? 3 : 2;
 }
 
 /*
@@ -353,10 +369,9 @@
  * these systems the BIOS also usually doesn't do it for us.
  */
 
-#ifdef CONFIG_KEYBOARD_ATKBD_RESET
-	if (atkbd_command(atkbd, NULL, ATKBD_CMD_RESET_BAT))
-		printk(KERN_WARNING "atkbd.c: keyboard reset failed\n");
-#endif
+	if (atkbd_reset)
+		if (atkbd_command(atkbd, NULL, ATKBD_CMD_RESET_BAT))
+			printk(KERN_WARNING "atkbd.c: keyboard reset failed\n");
 
 /*
  * Next we check we can set LEDs on the keyboard. This should work on every
@@ -405,7 +420,18 @@
 }
 
 /*
- * atkbd_disconnect() cleans up behind us ...
+ * atkbd_cleanup() restores the keyboard state so that BIOS is happy after a
+ * reboot.
+ */
+
+static void atkbd_cleanup(struct serio *serio)
+{
+	struct atkbd *atkbd = serio->private;
+	atkbd_command(atkbd, &atkbd->oldset, ATKBD_CMD_SSCANSET);
+}
+
+/*
+ * atkbd_disconnect() closes and frees.
  */
 
 static void atkbd_disconnect(struct serio *serio)
@@ -508,18 +534,28 @@
 static struct serio_dev atkbd_dev = {
 	.interrupt =	atkbd_interrupt,
 	.connect =	atkbd_connect,
-	.disconnect =	atkbd_disconnect
+	.disconnect =	atkbd_disconnect,
+	.cleanup =	atkbd_cleanup,
 };
 
 #ifndef MODULE
-static int __init atkbd_setup(char *str)
+static int __init atkbd_setup_set(char *str)
 {
         int ints[4];
         str = get_options(str, ARRAY_SIZE(ints), ints);
         if (ints[0] > 0) atkbd_set = ints[1];
         return 1;
 }
-__setup("atkbd_set=", atkbd_setup);
+static int __init atkbd_setup_reset(char *str)
+{
+        int ints[4];
+        str = get_options(str, ARRAY_SIZE(ints), ints);
+        if (ints[0] > 0) atkbd_reset = ints[1];
+        return 1;
+}
+
+__setup("atkbd_set=", atkbd_setup_set);
+__setup("atkbd_reset", atkbd_setup_reset);
 #endif
 
 int __init atkbd_init(void)
diff -Nru a/drivers/input/mouse/psmouse.c b/drivers/input/mouse/psmouse.c
--- a/drivers/input/mouse/psmouse.c	Tue Oct  8 15:27:18 2002
+++ b/drivers/input/mouse/psmouse.c	Tue Oct  8 15:27:18 2002
@@ -21,8 +21,11 @@
 
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
 MODULE_DESCRIPTION("PS/2 mouse driver");
+MODULE_PARM(psmouse_noext, "1i");
 MODULE_LICENSE("GPL");
 
+static int psmouse_noext;
+
 #define PSMOUSE_CMD_SETSCALE11	0x00e6
 #define PSMOUSE_CMD_SETRES	0x10e8
 #define PSMOUSE_CMD_GETINFO	0x03e9
@@ -33,6 +36,7 @@
 #define PSMOUSE_CMD_SETRATE	0x10f3
 #define PSMOUSE_CMD_ENABLE	0x00f4
 #define PSMOUSE_CMD_RESET_DIS	0x00f6
+#define PSMOUSE_CMD_RESET_BAT	0x02ff
 
 #define PSMOUSE_RET_BAT		0xaa
 #define PSMOUSE_RET_ACK		0xfa
@@ -222,7 +226,11 @@
 	psmouse->ack = 0;
 	psmouse->acking = 1;
 
-	serio_write(psmouse->serio, byte);
+	if (serio_write(psmouse->serio, byte)) {
+		psmouse->acking = 0;
+		return -1;
+	}
+
 	while (!psmouse->ack && timeout--) udelay(10);
 
 	return -(psmouse->ack <= 0);
@@ -302,6 +310,9 @@
 	psmouse->name = "Mouse";
 	psmouse->model = 0;
 
+	if (psmouse_noext)
+		return PSMOUSE_PS2;
+
 /*
  * Try Genius NetMouse magic init.
  */
@@ -529,15 +540,24 @@
  * Last, we enable the mouse so that we get reports from it.
  */
 
-	if (psmouse_command(psmouse, NULL, PSMOUSE_CMD_ENABLE)) {
+	if (psmouse_command(psmouse, NULL, PSMOUSE_CMD_ENABLE))
 		printk(KERN_WARNING "psmouse.c: Failed to enable mouse on %s\n", psmouse->serio->phys);
-	}
 
 }
 
 /*
- * psmouse_disconnect() cleans up after we don't want talk
- * to the mouse anymore.
+ * psmouse_cleanup() resets the mouse into power-on state.
+ */
+
+static void psmouse_cleanup(struct serio *serio)
+{
+	struct psmouse *psmouse = serio->private;
+	unsigned char param[2];
+	psmouse_command(psmouse, param, PSMOUSE_CMD_RESET_BAT);
+}
+
+/*
+ * psmouse_disconnect() closes and frees.
  */
 
 static void psmouse_disconnect(struct serio *serio)
@@ -607,8 +627,18 @@
 static struct serio_dev psmouse_dev = {
 	.interrupt =	psmouse_interrupt,
 	.connect =	psmouse_connect,
-	.disconnect =	psmouse_disconnect
+	.disconnect =	psmouse_disconnect,
+	.cleanup =	psmouse_cleanup,
 };
+
+#ifndef MODULE
+static int __init psmouse_setup(char *str)
+{
+	psmouse_noext = 1;
+	return 1;
+}
+__setup("psmouse_noext", psmouse_setup);
+#endif
 
 int __init psmouse_init(void)
 {
diff -Nru a/drivers/input/serio/i8042-io.h b/drivers/input/serio/i8042-io.h
--- a/drivers/input/serio/i8042-io.h	Tue Oct  8 15:27:18 2002
+++ b/drivers/input/serio/i8042-io.h	Tue Oct  8 15:27:18 2002
@@ -13,6 +13,7 @@
 
 #define I8042_KBD_PHYS_DESC "isa0060/serio0"
 #define I8042_AUX_PHYS_DESC "isa0060/serio1"
+#define I8042_MUX_PHYS_DESC "isa0060/serio%d"
 
 /*
  * IRQs.
@@ -64,9 +65,13 @@
  */
 #if !defined(__i386__) && !defined(__sh__) && !defined(__alpha__) && !defined(__x86_64__)
 	if (!request_region(I8042_DATA_REG, 16, "i8042"))
-		return 0;
+		return -1;
 #endif
-	return 1;
+
+#if !defined(__i386__) && !defined(__x86_64__)
+        i8042_reset = 1;
+#endif
+	return 0;
 }
 
 static inline void i8042_platform_exit(void)
diff -Nru a/drivers/input/serio/i8042-ppcio.h b/drivers/input/serio/i8042-ppcio.h
--- a/drivers/input/serio/i8042-ppcio.h	Tue Oct  8 15:27:18 2002
+++ b/drivers/input/serio/i8042-ppcio.h	Tue Oct  8 15:27:18 2002
@@ -14,6 +14,7 @@
 
 #define I8042_KBD_PHYS_DESC "walnutps2/serio0"
 #define I8042_AUX_PHYS_DESC "walnutps2/serio1"
+#define I8042_MUX_PHYS_DESC "walnutps2/serio%d"
 
 extern void *kb_cs;
 extern void *kb_data;
@@ -34,18 +35,17 @@
 static inline void i8042_write_data(int val)
 {
 	writeb(val, kb_data);
-	return;
 }
 
 static inline void i8042_write_command(int val)
 {
 	writeb(val, kb_cs);
-	return;
 }
 
 static inline int i8042_platform_init(void)
 {
-	return 1;
+	i8042_reset = 1;
+	return 0;
 }
 
 static inline void i8042_platform_exit(void)
@@ -59,6 +59,7 @@
 
 #define I8042_KBD_PHYS_DESC "spruceps2/serio0"
 #define I8042_AUX_PHYS_DESC "spruceps2/serio1"
+#define I8042_MUX_PHYS_DESC "spruceps2/serio%d"
 
 #define I8042_COMMAND_REG 0xff810000
 #define I8042_DATA_REG 0xff810001
@@ -109,18 +110,17 @@
 static inline void i8042_write_data(int val)
 {
 	*((unsigned char *)0xff810000) = (char)val;
-	return;
 }
 
 static inline void i8042_write_command(int val)
 {
 	*((unsigned char *)0xff810001) = (char)val;
-	return;
 }
 
 static inline int i8042_platform_init(void)
 {
-	return 1;
+	i8042_reset = 1;
+	return 0;
 }
 
 static inline void i8042_platform_exit(void)
diff -Nru a/drivers/input/serio/i8042-sparcio.h b/drivers/input/serio/i8042-sparcio.h
--- a/drivers/input/serio/i8042-sparcio.h	Tue Oct  8 15:27:18 2002
+++ b/drivers/input/serio/i8042-sparcio.h	Tue Oct  8 15:27:18 2002
@@ -11,6 +11,7 @@
 
 #define I8042_KBD_PHYS_DESC "sparcps2/serio0"
 #define I8042_AUX_PHYS_DESC "sparcps2/serio1"
+#define I8042_MUX_PHYS_DESC "sparcps2/serio%d"
 
 static unsigned long kbd_iobase;
 
@@ -50,14 +51,14 @@
 	len = prom_getproperty(prom_root_node, "name", prop, sizeof(prop));
 	if (len < 0) {
 		printk("i8042: Cannot get name property of root OBP node.\n");
-		return 0;
+		return -1;
 	}
 	if (strncmp(prop, "SUNW,JavaStation-1", len) == 0) {
 		/* Hardcoded values for MrCoffee.  */
 		i8042_kbd_irq = i8042_aux_irq = 13 | 0x20;
 		kbd_iobase = (unsigned long) ioremap(0x71300060, 8);
 		if (!kbd_iobase)
-			return 0;
+			return -1;
 	} else {
 		struct linux_ebus *ebus;
 		struct linux_ebus_device *edev;
@@ -69,7 +70,7 @@
 					goto edev_found;
 			}
 		}
-		return 0;
+		return -1;
 
 	edev_found:
 		for_each_edevchild(edev, child) {
@@ -87,11 +88,13 @@
 		    i8042_aux_irq == -1) {
 			printk("i8042: Error, 8042 device lacks both kbd and "
 			       "mouse nodes.\n");
-			return 0;
+			return -1;
 		}
 	}
 
-	return 1;
+	i8042_reset = 1;
+
+	return 0;
 }
 
 static inline void i8042_platform_exit(void)
diff -Nru a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
--- a/drivers/input/serio/i8042.c	Tue Oct  8 15:27:18 2002
+++ b/drivers/input/serio/i8042.c	Tue Oct  8 15:27:18 2002
@@ -19,7 +19,9 @@
 #include <linux/reboot.h>
 #include <linux/init.h>
 #include <linux/serio.h>
-#include <linux/sched.h>	/* request/free_irq */
+#include <linux/sched.h>
+
+#undef DEBUG
 
 #include "i8042.h"
 
@@ -31,13 +33,13 @@
 MODULE_PARM(i8042_unlock, "1i");
 MODULE_PARM(i8042_reset, "1i");
 MODULE_PARM(i8042_direct, "1i");
-MODULE_PARM(i8042_restore_ctr, "1i");
+MODULE_PARM(i8042_dumbkbd, "1i");
 
 static int i8042_noaux;
 static int i8042_unlock;
 static int i8042_reset;
 static int i8042_direct;
-static int i8042_restore_ctr;
+static int i8042_dumbkbd;
 
 spinlock_t i8042_lock = SPIN_LOCK_UNLOCKED;
 
@@ -46,6 +48,7 @@
 	unsigned char disable;
 	unsigned char irqen;
 	unsigned char exists;
+	signed char mux;
 	unsigned char *name;
 	unsigned char *phys;
 };
@@ -55,12 +58,9 @@
 static unsigned char i8042_initial_ctr;
 static unsigned char i8042_ctr;
 static unsigned char i8042_last_e0;
+static unsigned char i8042_mux_open;
 struct timer_list i8042_timer;
 
-#ifdef I8042_DEBUG_IO
-static unsigned long i8042_start;
-#endif
-
 extern struct pt_regs *kbd_pt_regs;
 
 static unsigned long i8042_unxlate_seen[128 / BITS_PER_LONG];
@@ -110,18 +110,16 @@
 static int i8042_flush(void)
 {
 	unsigned long flags;
+	unsigned char data;
 	int i = 0;
 
 	spin_lock_irqsave(&i8042_lock, flags);
 
-	while ((i8042_read_status() & I8042_STR_OBF) && (i++ < I8042_BUFFER_SIZE))
-#ifdef I8042_DEBUG_IO
-		printk(KERN_DEBUG "i8042.c: %02x <- i8042 (flush, %s) [%d]\n",
-			i8042_read_data(), i8042_read_status() & I8042_STR_AUXDATA ? "aux" : "kbd",
-			(int) (jiffies - i8042_start));
-#else
-		i8042_read_data();
-#endif
+	while ((i8042_read_status() & I8042_STR_OBF) && (i++ < I8042_BUFFER_SIZE)) {
+		data = i8042_read_data();
+		dbg("%02x <- i8042 (flush, %s)", data,
+			i8042_read_status() & I8042_STR_AUXDATA ? "aux" : "kbd");
+	}
 
 	spin_unlock_irqrestore(&i8042_lock, flags);
 
@@ -145,20 +143,14 @@
 
 	retval = i8042_wait_write();
 	if (!retval) {
-#ifdef I8042_DEBUG_IO
-		printk(KERN_DEBUG "i8042.c: %02x -> i8042 (command) [%d]\n",
-			command & 0xff, (int) (jiffies - i8042_start));
-#endif
+		dbg("%02x -> i8042 (command)", command & 0xff);
 		i8042_write_command(command & 0xff);
 	}
 	
 	if (!retval)
 		for (i = 0; i < ((command >> 12) & 0xf); i++) {
 			if ((retval = i8042_wait_write())) break;
-#ifdef I8042_DEBUG_IO
-			printk(KERN_DEBUG "i8042.c: %02x -> i8042 (parameter) [%d]\n",
-				param[i], (int) (jiffies - i8042_start));
-#endif
+			dbg("%02x -> i8042 (parameter)", param[i]);
 			i8042_write_data(param[i]);
 		}
 
@@ -169,19 +161,13 @@
 				param[i] = ~i8042_read_data();
 			else
 				param[i] = i8042_read_data();
-#ifdef I8042_DEBUG_IO
-			printk(KERN_DEBUG "i8042.c: %02x <- i8042 (return) [%d]\n",
-				param[i], (int) (jiffies - i8042_start));
-#endif
+			dbg("%02x <- i8042 (return)\n", param[i]);
 		}
 
 	spin_unlock_irqrestore(&i8042_lock, flags);
 
-#ifdef I8042_DEBUG_IO
 	if (retval)
-		printk(KERN_DEBUG "i8042.c:      -- i8042 (timeout) [%d]\n",
-			(int) (jiffies - i8042_start));
-#endif
+		dbg("     -- i8042 (timeout)");
 
 	return retval;
 }
@@ -198,10 +184,7 @@
 	spin_lock_irqsave(&i8042_lock, flags);
 
 	if(!(retval = i8042_wait_write())) {
-#ifdef I8042_DEBUG_IO
-		printk(KERN_DEBUG "i8042.c: %02x -> i8042 (kbd-data) [%d]\n",
-			c, (int) (jiffies - i8042_start));
-#endif
+		dbg("%02x -> i8042 (kbd-data)", c);
 		i8042_write_data(c);
 	}
 
@@ -216,21 +199,17 @@
 
 static int i8042_aux_write(struct serio *port, unsigned char c)
 {
+	struct i8042_values *values = port->driver;
 	int retval;
 
 /*
  * Send the byte out.
  */
 
-	retval  = i8042_command(&c, I8042_CMD_AUX_SEND);
-
-/*
- * Here we restore the CTR value if requested. I don't know why, but i8042's in
- * half-AT mode tend to trash their CTR when doing the AUX_SEND command. 
- */
-
-	if (i8042_restore_ctr)
-		retval |= i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR);
+	if (values->mux == -1)
+		retval = i8042_command(&c, I8042_CMD_AUX_SEND);
+	else
+		retval = i8042_command(&c, I8042_CMD_MUX_SEND + values->mux);
 
 /*
  * Make sure the interrupt happens and the character is received even
@@ -242,6 +221,7 @@
 	return retval;
 }
 
+
 /*
  * i8042_open() is called when a port is open by the higher layer.
  * It allocates the interrupt and enables in in the chip.
@@ -253,6 +233,10 @@
 
 	i8042_flush();
 
+	if (values->mux != -1)
+		if (i8042_mux_open++)
+			return 0;
+
 	if (request_irq(values->irq, i8042_interrupt, 0, "i8042", NULL)) {
 		printk(KERN_ERR "i8042.c: Can't get irq %d for %s, unregistering the port.\n", values->irq, values->name);
 		values->exists = 0;
@@ -282,6 +266,10 @@
 {
 	struct i8042_values *values = port->driver;
 
+	if (values->mux != -1)
+		if (--i8042_mux_open)
+			return;
+
 	i8042_ctr &= ~values->irqen;
 
 	if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) {
@@ -299,11 +287,11 @@
  */
 
 static struct i8042_values i8042_kbd_values = {
-	.irq =		0,
+	.irq =		I8042_KBD_IRQ,
 	.irqen =	I8042_CTR_KBDINT,
 	.disable =	I8042_CTR_KBDDIS,
 	.name =		"KBD",
-	.exists =	0,
+	.mux =		-1,
 };
 
 static struct serio i8042_kbd_port =
@@ -318,11 +306,11 @@
 };
 
 static struct i8042_values i8042_aux_values = {
-	.irq =		0,
+	.irq =		I8042_AUX_IRQ,
 	.irqen =	I8042_CTR_AUXINT,
 	.disable =	I8042_CTR_AUXDIS,
 	.name =		"AUX",
-	.exists =	0,
+	.mux =		-1,
 };
 
 static struct serio i8042_aux_port =
@@ -336,6 +324,12 @@
 	.phys =		I8042_AUX_PHYS_DESC,
 };
 
+static struct i8042_values i8042_mux_values[4];
+static struct serio i8042_mux_port[4];
+static char i8042_mux_names[4][16];
+static char i8042_mux_short[4][8];
+static char i8042_mux_phys[4][32];
+
 /*
  * i8042_interrupt() is the most important function in this driver -
  * it handles the interrupts from the i8042, and sends incoming bytes
@@ -373,34 +367,60 @@
 		dfl = ((str & I8042_STR_PARITY) ? SERIO_PARITY : 0) |
 		      ((str & I8042_STR_TIMEOUT) ? SERIO_TIMEOUT : 0);
 
-#ifdef I8042_DEBUG_IO
-		printk(KERN_DEBUG "i8042.c: %02x <- i8042 (interrupt, %s, %d%s%s) [%d]\n",
+		if (i8042_mux_values[0].exists && (buffer[i].str & I8042_STR_AUXDATA)) {
+
+			if (buffer[i].str & I8042_STR_MUXERR) {
+				switch (buffer[i].data) {
+					case 0xfd:
+					case 0xfe: dfl = SERIO_TIMEOUT; break;
+					case 0xff: dfl = SERIO_PARITY; break;
+				}
+				buffer[i].data = 0xfe;
+			} else dfl = 0;
+
+			dbg("%02x <- i8042 (interrupt, aux%d, %d%s%s)",
+				data, (str >> 6), irq, 
+				dfl & SERIO_PARITY ? ", bad parity" : "",
+				dfl & SERIO_TIMEOUT ? ", timeout" : "");
+
+			if (i8042_mux_values[(str >> 6)].exists)
+				serio_interrupt(i8042_mux_port + (str >> 6), buffer[i].data, dfl);
+			continue;
+		}
+
+		dbg("%02x <- i8042 (interrupt, %s, %d%s%s)",
 			data, (str & I8042_STR_AUXDATA) ? "aux" : "kbd", irq, 
 			dfl & SERIO_PARITY ? ", bad parity" : "",
-			dfl & SERIO_TIMEOUT ? ", timeout" : "",
-			(int) (jiffies - i8042_start));
-#endif
+			dfl & SERIO_TIMEOUT ? ", timeout" : "");
 
 		if (i8042_aux_values.exists && (buffer[i].str & I8042_STR_AUXDATA)) {
 			serio_interrupt(&i8042_aux_port, buffer[i].data, dfl);
-		} else 
-			if (i8042_kbd_values.exists) {
-				if (!i8042_direct) {
-					if (data > 0x7f) {
-						if (test_and_clear_bit(data & 0x7f, i8042_unxlate_seen)) {
-							serio_interrupt(&i8042_kbd_port, 0xf0, dfl);
-							if (i8042_last_e0 && (data == 0xaa || data == 0xb6))
-								set_bit(data & 0x7f, i8042_unxlate_seen);
-							data = i8042_unxlate_table[data & 0x7f];
-						}
-					} else {
-						set_bit(data, i8042_unxlate_seen);
-						data = i8042_unxlate_table[data];
-					}
-					i8042_last_e0 = (data == 0xe0);
-				}
-				serio_interrupt(&i8042_kbd_port, data, dfl);
+			continue;
+		}
+
+		if (!i8042_kbd_values.exists)
+			continue;
+
+		if (i8042_direct) {
+			serio_interrupt(&i8042_kbd_port, data, dfl);
+			continue;
+		}
+
+		if (data > 0x7f) {
+			if (test_and_clear_bit(data & 0x7f, i8042_unxlate_seen)) {
+				serio_interrupt(&i8042_kbd_port, 0xf0, dfl);
+				if (i8042_last_e0 && (data == 0xaa || data == 0xb6))
+					set_bit(data & 0x7f, i8042_unxlate_seen);
+				data = i8042_unxlate_table[data & 0x7f];
 			}
+		} else {
+			set_bit(data, i8042_unxlate_seen);
+			data = i8042_unxlate_table[data];
+		}
+
+		i8042_last_e0 = (data == 0xe0);
+
+		serio_interrupt(&i8042_kbd_port, data, dfl);
 	}
 
 }
@@ -460,17 +480,15 @@
  */
 
 	if (~i8042_read_status() & I8042_STR_KEYLOCK) {
-
-		if (i8042_unlock) {
+		if (i8042_unlock)
 			i8042_ctr |= I8042_CTR_IGNKEYLOCK;
-		} else {
+		 else
 			printk(KERN_WARNING "i8042.c: Warning: Keylock active.\n");
-		}
 	}
 
 /*
  * If the chip is configured into nontranslated mode by the BIOS, don't
- * bother enabling translating and just use that happily.
+ * bother enabling translating and be happy.
  */
 
 	if (~i8042_ctr & I8042_CTR_XLATE)
@@ -478,10 +496,9 @@
 
 /*
  * Set nontranslated mode for the kbd interface if requested by an option.
- * This is vital for a working scancode set 3 support. After this the kbd
- * interface becomes a simple serial in/out, like the aux interface is. If
- * the user doesn't wish this, the driver tries to untranslate the values
- * after the i8042 translates them.
+ * After this the kbd interface becomes a simple serial in/out, like the aux
+ * interface is. We don't do this by default, since it can confuse notebook
+ * BIOSes.
  */
 
 	if (i8042_direct)
@@ -506,10 +523,25 @@
 
 void i8042_controller_cleanup(void)
 {
+	int i;
 
 	i8042_flush();
 
 /*
+ * Reset anything that is connected to the ports.
+ */
+
+	if (i8042_kbd_values.exists)
+		serio_cleanup(&i8042_kbd_port);
+
+	if (i8042_aux_values.exists)
+		serio_cleanup(&i8042_aux_port);
+
+	for (i = 0; i < 4; i++)
+		if (i8042_mux_values[i].exists)
+			serio_cleanup(i8042_mux_port + i);
+
+/*
  * Reset the controller.
  */
 
@@ -529,16 +561,72 @@
 	if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR))
 		printk(KERN_WARNING "i8042.c: Can't restore CTR.\n");
 
+}
+
 /*
- * Reset anything that is connected to the ports if the ports
- * are enabled in the original config.
+ * i8042_check_mux() checks whether the controller supports the PS/2 Active
+ * Multiplexing specification by Synaptics, Phoenix, Insyde and
+ * LCS/Telegraphics.
  */
 
-	if (i8042_kbd_values.exists)
-		i8042_kbd_write(&i8042_kbd_port, 0xff);
+static int __init i8042_check_mux(struct i8042_values *values)
+{
+	unsigned char param;
+	int i;
 
-	if (i8042_aux_values.exists)
-		i8042_aux_write(&i8042_aux_port, 0xff);
+/*
+ * Check if AUX irq is available.
+ */
+
+	if (request_irq(values->irq, i8042_interrupt, 0, "i8042", NULL))
+                return -1;
+	free_irq(values->irq, NULL);
+
+/*
+ * Get rid of bytes in the queue.
+ */
+
+	i8042_flush();
+
+/*
+ * Internal loopback test - send three bytes, they should come back from the
+ * mouse interface, the last should be version. Note that we negate mouseport
+ * command responses for the i8042_check_aux() routine.
+ */
+
+	param = 0xf0;
+	if (i8042_command(&param, I8042_CMD_AUX_LOOP) || param != 0x0f)
+		return -1;
+	param = 0x56;
+	if (i8042_command(&param, I8042_CMD_AUX_LOOP) || param != 0xa9)
+		return -1;
+	param = 0xa4;
+	if (i8042_command(&param, I8042_CMD_AUX_LOOP) || param == 0x5b)
+		return -1;
+
+	printk(KERN_INFO "i8042.c: Detected active multiplexing controller, rev%d.%d.\n",
+		~param >> 4, ~param & 0xf);
+
+/*
+ * Disable all muxed ports by disabling AUX.
+ */
+
+	i8042_ctr &= I8042_CTR_AUXDIS;
+	i8042_ctr &= ~I8042_CTR_AUXINT;
+
+	if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR))
+		return -1;
+
+/*
+ * Enable all muxed ports.
+ */
+
+	for (i = 0; i < 4; i++) {
+		i8042_command(&param, I8042_CMD_MUX_PFX + i);
+		i8042_command(&param, I8042_CMD_AUX_ENABLE);
+	}
+
+	return 0;
 }
 
 /*
@@ -546,7 +634,7 @@
  * the presence of an AUX interface.
  */
 
-static int __init i8042_check_aux(struct i8042_values *values, struct serio *port)
+static int __init i8042_check_aux(struct i8042_values *values)
 {
 	unsigned char param;
 
@@ -570,7 +658,6 @@
  */
 
 	param = 0x5a;
-
 	if (i8042_command(&param, I8042_CMD_AUX_LOOP) || param != 0xa5)
 		return -1;
 
@@ -665,9 +752,9 @@
 	i8042_direct = 1;
 	return 1;
 }
-static int __init i8042_setup_restore_ctr(char *str)
+static int __init i8042_setup_dumbkbd(char *str)
 {
-	i8042_restore_ctr = 1;
+	i8042_dumbkbd = 1;
 	return 1;
 }
 
@@ -675,7 +762,7 @@
 __setup("i8042_noaux", i8042_setup_noaux);
 __setup("i8042_unlock", i8042_setup_unlock);
 __setup("i8042_direct", i8042_setup_direct);
-__setup("i8042_restore_ctr", i8042_setup_restore_ctr);
+__setup("i8042_dumbkbd", i8042_setup_dumbkbd);
 #endif
 
 /*
@@ -698,27 +785,43 @@
         0
 };
 
+static void __init i8042_init_mux_values(struct i8042_values *values, struct serio *port, int index)
+{
+	memcpy(port, &i8042_aux_port, sizeof(struct serio));
+	memcpy(values, &i8042_aux_values, sizeof(struct i8042_values));
+	sprintf(i8042_mux_names[index], "i8042 Aux-%d Port", index);
+	sprintf(i8042_mux_phys[index], I8042_MUX_PHYS_DESC, index + 1);
+	sprintf(i8042_mux_short[index], "AUX%d", index);
+	port->name = i8042_mux_names[index];
+	port->phys = i8042_mux_phys[index];
+	values->name = i8042_mux_short[index];
+	values->mux = index;
+}
+
 int __init i8042_init(void)
 {
-#ifdef I8042_DEBUG_IO
-	i8042_start = jiffies;
-#endif
+	int i;
 
-#if !defined(__i386__) && !defined(__x86_64__)
-	i8042_reset = 1;
-#endif
+	dbg_init();
 
-	if (!i8042_platform_init())
+	if (i8042_platform_init())
 		return -EBUSY;
 
-	i8042_kbd_values.irq = I8042_KBD_IRQ;
-	i8042_aux_values.irq = I8042_AUX_IRQ;
-
 	if (i8042_controller_init())
 		return -ENODEV;
-		
-	if (!i8042_noaux && !i8042_check_aux(&i8042_aux_values, &i8042_aux_port))
-		i8042_port_register(&i8042_aux_values, &i8042_aux_port);
+
+	if (i8042_dumbkbd)
+		i8042_kbd_port.write = NULL;
+
+	for (i = 0; i < 4; i++)
+		i8042_init_mux_values(i8042_mux_values + i, i8042_mux_port + i, i);
+
+	if (!i8042_noaux && !i8042_check_mux(&i8042_aux_values))
+		for (i = 0; i < 4; i++)
+			i8042_port_register(i8042_mux_values + i, i8042_mux_port + i);
+	else 
+		if (!i8042_noaux && !i8042_check_aux(&i8042_aux_values))
+			i8042_port_register(&i8042_aux_values, &i8042_aux_port);
 
 	i8042_port_register(&i8042_kbd_values, &i8042_kbd_port);
 
@@ -732,22 +835,26 @@
 
 void __exit i8042_exit(void)
 {
+	int i;
+
 	unregister_reboot_notifier(&i8042_notifier);
 
 	del_timer(&i8042_timer);
+
+	i8042_controller_cleanup();
 	
 	if (i8042_kbd_values.exists)
 		serio_unregister_port(&i8042_kbd_port);
 
 	if (i8042_aux_values.exists)
 		serio_unregister_port(&i8042_aux_port);
-
-	i8042_controller_cleanup();
+	
+	for (i = 0; i < 4; i++)
+		if (i8042_mux_values[i].exists)
+			serio_unregister_port(i8042_mux_port + i);
 
 	i8042_platform_exit();
 }
 
 module_init(i8042_init);
 module_exit(i8042_exit);
-
-
diff -Nru a/drivers/input/serio/i8042.h b/drivers/input/serio/i8042.h
--- a/drivers/input/serio/i8042.h	Tue Oct  8 15:27:18 2002
+++ b/drivers/input/serio/i8042.h	Tue Oct  8 15:27:18 2002
@@ -22,13 +22,6 @@
 #endif
 
 /*
- * If you want to trace all the i/o the i8042 module does for
- * debugging purposes, define this.
- */
-
-#undef I8042_DEBUG_IO
-
-/*
  * This is in 50us units, the time we wait for the i8042 to react. This
  * has to be long enough for the i8042 itself to timeout on sending a byte
  * to a non-existent mouse.
@@ -54,6 +47,7 @@
 #define I8042_STR_AUXDATA	0x20
 #define I8042_STR_KEYLOCK	0x10
 #define I8042_STR_CMDDAT	0x08
+#define I8042_STR_MUXERR	0x04
 #define I8042_STR_IBF		0x02
 #define	I8042_STR_OBF		0x01
 
@@ -87,6 +81,9 @@
 #define I8042_CMD_AUX_SEND	0x10d4
 #define I8042_CMD_AUX_LOOP	0x11d3
 
+#define I8042_CMD_MUX_PFX	0x0090
+#define I8042_CMD_MUX_SEND	0x1090
+
 /*
  * Return codes.
  */
@@ -99,5 +96,19 @@
  */
 
 #define I8042_BUFFER_SIZE	32
+
+/*
+ * Debug.
+ */
+
+#ifdef DEBUG
+static unsigned long i8042_start;
+#define dbg_init() do { i8042_start = jiffies; } while (0);
+#define dbg(format, arg...) printk(KERN_DEBUG __FILE__ ": " format "[%d]\n" ,\
+	 ## arg, (int) (jiffies - i8042_start))
+#else
+#define dbg_init() do { } while (0);
+#define dbg(format, arg...) do {} while (0)
+#endif
 
 #endif /* _I8042_H */
diff -Nru a/include/linux/serio.h b/include/linux/serio.h
--- a/include/linux/serio.h	Tue Oct  8 15:27:18 2002
+++ b/include/linux/serio.h	Tue Oct  8 15:27:18 2002
@@ -69,6 +69,7 @@
 	void (*interrupt)(struct serio *, unsigned char, unsigned int);
 	void (*connect)(struct serio *, struct serio_dev *dev);
 	void (*disconnect)(struct serio *);
+	void (*cleanup)(struct serio *);
 
 	struct serio_dev *next;
 };
@@ -85,13 +86,22 @@
 
 static __inline__ int serio_write(struct serio *serio, unsigned char data)
 {
-	return serio->write(serio, data);
+	if (serio->write)
+		return serio->write(serio, data);
+	else
+		return -1;
 }
 
 static __inline__ void serio_dev_write_wakeup(struct serio *serio)
 {
 	if (serio->dev && serio->dev->write_wakeup)
 		serio->dev->write_wakeup(serio);
+}
+
+static __inline__ void serio_cleanup(struct serio *serio)
+{
+	if (serio->dev && serio->dev->cleanup)
+		serio->dev->cleanup(serio);
 }
 
 /*

===================================================================

This BitKeeper patch contains the following changesets:
1.573.1.33
## Wrapped with gzip_uu ##


begin 664 bkpatch18386
M'XL(`#;=HCT``[U<>U?;2++_V_X4/>3`M8EM])8,`SL$DZQ/$N!BN#-SDQP?
M66IC+4;R2#*/'6<_^ZVJUML&`S.YLS,6EJJKJ[OK\:LJ>=^PRXB'N[7;X%\Q
M=R;U-^R?013OUJ)YQ#O.O^'[>1#`]YU)<,-W$JJ=T?6.Y\_F<1V>G]FQ,V&W
M/(QV:W)'S>[$#S.^6SL__G#YZ?"\7M_?9T<3V[_B`QZS_?UZ'(2W]M2-?K'C
MR33P.W%H^]$-C^V.$]PL,M*%(DD*_$^73572C85L2)JY<&17EFU-YJZD:):A
MU4<3.P1>(^]J%OANQ^=QQYY7N705399U0[$6DJ(;<KW'Y(YNJAV06F62LB-U
M=Q2-R=:N9NWJTEM)V94DEBSYEV1#V%N+M:7Z._;WRG]4=]BAZ[)H/IL%8<S&
M0<C.!CL*.W1B[Y:SS_-I[,VF_-[SK]A@QIT6F\]<.^913GH3@(C`Q_9==LT?
M1@%L"0,YW"D.:K-9&,QXR)PIM_WYC`4^"_D(#K?%[.DTN&.7@W=M?C.?`E<7
MQ;G(N$0M%LQB#T;$`0R*XM!SXL*D>/N*^QQNPPV7=^H?F2DI];/\R.OM%_Y3
MKTNV5#_(]C^^\Z;>U23NS)T[.(>%&WJH<T(/=T"'O6#'LR1-:7M!9R*VW915
MV5)E25K(LJP8"\6P'3ZR)6Y;BJZ:6O5PG\44M<C0+,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71OKI.%5I]-ILB*,
M)5D@[+_O?SH>#MG&+MM@@IYM?-ETOP%*92TP:/;F#8YO41VQR1K)K*Q=E`;\
IB?AQQ&.2/UM$I"X09^\<I?^O!B+9GM_L*UV7&_)(JO\?O))1_D)!````
`
end

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [patch] Input - Fix Logitech Desktop Pro wheel [5/23]
  2002-10-08 13:41     ` [patch] Input - Support for PS/2 Multiplexing spec [4/23] Vojtech Pavlik
@ 2002-10-08 13:42       ` Vojtech Pavlik
  2002-10-08 13:44         ` [patch] Input - Update of wacom.c from 2.4 and Wacom Inc. [6/23] Vojtech Pavlik
  2002-10-08 21:59       ` [patch] Input - Support for PS/2 Multiplexing spec [4/23] Pavel Machek
  1 sibling, 1 reply; 26+ messages in thread
From: Vojtech Pavlik @ 2002-10-08 13:42 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: torvalds, linux-kernel


You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

===================================================================

ChangeSet@1.573.1.34, 2002-09-24 19:33:58+02:00, khaho@koti.soon.fi
  Make Logitech Desktop Pro (wireless keyboard & mouse) work with all buttons and wheel.


 psmouse.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

===================================================================

diff -Nru a/drivers/input/mouse/psmouse.c b/drivers/input/mouse/psmouse.c
--- a/drivers/input/mouse/psmouse.c	Tue Oct  8 15:27:11 2002
+++ b/drivers/input/mouse/psmouse.c	Tue Oct  8 15:27:11 2002
@@ -349,8 +349,8 @@
 	if (param[1]) {
 
 		int i;
-		static int logitech_4btn[] = { 12, 40, 41, 42, 43, 73, 80, -1 };
-		static int logitech_wheel[] = { 75, 76, 80, 81, 83, 88, -1 };
+		static int logitech_4btn[] = { 12, 40, 41, 42, 43, 52, 73, 80, -1 };
+		static int logitech_wheel[] = { 52, 75, 76, 80, 81, 83, 88, -1 };
 		static int logitech_ps2pp[] = { 12, 13, 40, 41, 42, 43, 50, 51, 52, 53, 73, 75,
 							76, 80, 81, 83, 88, 96, 97, -1 };
 		psmouse->vendor = "Logitech";

===================================================================

This BitKeeper patch contains the following changesets:
1.573.1.34
## Wrapped with gzip_uu ##


begin 664 bkpatch18357
M'XL(`"_=HCT``\U4[VO40!#]?/M7#!1$:2_9G\E>Y*3:%A4K'I5^$I%-LFUB
M<MDCNW>A&O]W-[EK!6M+%063#)/=[#S>FWED#\ZM;I/)QGQV.BO0'KPRUB43
MN[8ZR+[X]9DQ?AT69JG#W:DPK<*R6:T=\M\7RF4%;'1KDPD)V,V.NUKI9')V
M\O+\]/D90O,Y'!6JN=3OM8/Y'#G3;E2=VT/EBMHT@6M58Y?:J2`SR_[F:$\Q
MIOX6)&981#V),(_[C.2$*$YTCBF7$4<[8H<[VC_7SR@G$9<"]QC'F*)C((&(
M6>#Y<L`TQ+.0<B"SA+%$R'U,$XRA*E1A#BOCRL`:S_"BA'T"4XQ>P-\E?X0R
M>*LJ#:?FLAQDP+&VE3,K6+0&'G=EJVMM+53Z*C6JS>$1+(T7^@0ZTU;0E:X`
M5=>0KITSC075Y-`56M<!>@,S3M#B1^O1]#<OA+#"Z!E<=]AU95U>%BY89]W0
MZ;PMA]EO_1".O,*5'7.0;1L08T88EISV6$8XZM,X387,F;S07%"M?]'IA\`.
M0XT9$[QG,9-BM-B]98/M_J&,6R9\H`9O3!YY#9C&HS$)NV5)?H\E*4SI_VA)
MCW"G*;<#>P?3MAL?;[/%_;/[`]\>,T&!HM=,,)\F$^N4*S,H&P?U3M4GGKKF
MPT>8PU<@]``X]D%\#._L`(3/L<_2[T\)?'MZ!\PH;(<SU@@?T;9.>CPY8,AK
:C)M?9%;HK++KY9Q?<.EM%*'OA^YG:H\%````
`
end

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [patch] Input - Update of wacom.c from 2.4 and Wacom Inc. [6/23]
  2002-10-08 13:42       ` [patch] Input - Fix Logitech Desktop Pro wheel [5/23] Vojtech Pavlik
@ 2002-10-08 13:44         ` Vojtech Pavlik
  2002-10-08 13:45           ` [patch] Input - Use lists.h in gameport core [7/23] Vojtech Pavlik
  0 siblings, 1 reply; 26+ messages in thread
From: Vojtech Pavlik @ 2002-10-08 13:44 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: torvalds, linux-kernel


You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

===================================================================

ChangeSet@1.573.1.35, 2002-09-24 21:24:25+02:00, vojtech@suse.cz
  Update Wacom driver to 2.4 changes and changes from Ping Cheng of Wacom.


 hid-core.c |   26 +++++++
 wacom.c    |  208 +++++++++++++++++++++++++++++++++++++++++--------------------
 2 files changed, 166 insertions(+), 68 deletions(-)

===================================================================

diff -Nru a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
--- a/drivers/usb/input/hid-core.c	Tue Oct  8 15:27:04 2002
+++ b/drivers/usb/input/hid-core.c	Tue Oct  8 15:27:04 2002
@@ -1284,8 +1284,14 @@
 }
 
 #define USB_VENDOR_ID_WACOM		0x056a
+#define USB_DEVICE_ID_WACOM_PENPARTNER	0x0000
 #define USB_DEVICE_ID_WACOM_GRAPHIRE	0x0010
 #define USB_DEVICE_ID_WACOM_INTUOS	0x0020
+#define USB_DEVICE_ID_WACOM_PL		0x0030
+#define USB_DEVICE_ID_WACOM_INTUOS2	0x0040
+
+#define USB_VENDOR_ID_AIPTEK		0x08ca
+#define USB_VENDOR_ID_AIPTEK_6000	0x0020
 
 #define USB_VENDOR_ID_GRIFFIN		0x077d
 #define USB_DEVICE_ID_POWERMATE		0x0410
@@ -1306,14 +1312,30 @@
 	__u16 idProduct;
 	unsigned quirks;
 } hid_blacklist[] = {
+	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PENPARTNER, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE + 1, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE + 2, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS + 1, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS + 2, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS + 3, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS + 4, HID_QUIRK_IGNORE },
-	{ USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_POWERMATE, HID_QUIRK_IGNORE  },
-	{ USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_SOUNDKNOB, HID_QUIRK_IGNORE  },
+	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL + 1, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL + 2, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL + 3, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL + 4, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL + 5, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 1, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 2, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 3, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 4, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 5, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_6000, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_POWERMATE, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_SOUNDKNOB, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_UC100KM, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_CS124U, HID_QUIRK_NOGET },
 	{ USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_2PORTKVM, HID_QUIRK_NOGET },
diff -Nru a/drivers/usb/input/wacom.c b/drivers/usb/input/wacom.c
--- a/drivers/usb/input/wacom.c	Tue Oct  8 15:27:04 2002
+++ b/drivers/usb/input/wacom.c	Tue Oct  8 15:27:04 2002
@@ -1,15 +1,14 @@
 /*
- * $Id: wacom.c,v 1.28 2001/09/25 10:12:07 vojtech Exp $
+ *  USB Wacom Graphire and Wacom Intuos tablet support
  *
- *  Copyright (c) 2000-2001 Vojtech Pavlik	<vojtech@ucw.cz>
+ *  Copyright (c) 2000-2002 Vojtech Pavlik	<vojtech@ucw.cz>
  *  Copyright (c) 2000 Andreas Bach Aaen	<abach@stofanet.dk>
  *  Copyright (c) 2000 Clifford Wolf		<clifford@clifford.at>
  *  Copyright (c) 2000 Sam Mosel		<sam.mosel@computer.org>
  *  Copyright (c) 2000 James E. Blair		<corvus@gnu.org>
  *  Copyright (c) 2000 Daniel Egger		<egger@suse.de>
  *  Copyright (c) 2001 Frederic Lepied		<flepied@mandrakesoft.com>
- *
- *  USB Wacom Graphire and Wacom Intuos tablet support
+ *  Copyright (c) 2002 Ping Cheng		<pingc@wacom.com>
  *
  *  ChangeLog:
  *      v0.1 (vp)  - Initial release
@@ -37,6 +36,18 @@
  *	v1.21 (vp) - Removed protocol descriptions
  *		   - Added MISC_SERIAL for tool serial numbers
  *	      (gb) - Identify version on module load.
+ *    v1.21.1 (fl) - added Graphire2 support
+ *    v1.21.2 (fl) - added Intuos2 support
+ *                 - added all the PL ids
+ *    v1.21.3 (fl) - added another eraser id from Neil Okamoto
+ *                 - added smooth filter for Graphire from Peri Hankey
+ *                 - added PenPartner support from Olaf van Es
+ *                 - new tool ids from Ole Martin Bjoerndalen
+ *	v1.29 (pc) - Add support for more tablets
+ *		   - Fix pressure reporting
+ *	v1.30 (vp) - Merge 2.4 and 2.5 drivers
+ *		   - Since 2.5 now has input_sync(), remove MSC_SERIAL abuse
+ *		   - Cleanups here and there
  */
 
 /*
@@ -44,19 +55,6 @@
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
- * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
  */
 
 #include <linux/kernel.h>
@@ -69,7 +67,7 @@
 /*
  * Version Information
  */
-#define DRIVER_VERSION "v1.21"
+#define DRIVER_VERSION "v1.30"
 #define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>"
 #define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver"
 #define DRIVER_LICENSE "GPL"
@@ -104,7 +102,6 @@
 	struct wacom_features *features;
 	int tool[2];
 	int open;
-	int x, y;
 	__u32 serial[2];
 	char phys[32];
 };
@@ -114,29 +111,50 @@
 	struct wacom *wacom = urb->context;
 	unsigned char *data = wacom->data;
 	struct input_dev *dev = &wacom->dev;
-	int prox;
+	int prox, pressure;
 
 	if (urb->status) return;
 
 	if (data[0] != 2)
 		dbg("received unknown report #%d", data[0]);
 
-	prox = data[1] & 0x20;
+	prox = data[1] & 0x40;
 	
 	input_report_key(dev, BTN_TOOL_PEN, prox);
 	
 	if (prox) {
-		int pressure = (data[4] & 0x04) >> 2 | ((__u32)(data[7] & 0x7f) << 1);
 
-		input_report_abs(dev, ABS_X, data[3] | ((__u32)data[2] << 8) | ((__u32)(data[1] & 0x03) << 16));
-		input_report_abs(dev, ABS_Y, data[6] | ((__u32)data[5] << 8) | ((__u32)(data[4] & 0x03) << 8));
-		input_report_abs(dev, ABS_PRESSURE, (data[7] & 0x80) ? (255 - pressure) : (pressure + 255));
+		pressure = (signed char)((data[7] << 1) | ((data[4] >> 2) & 1));
+		if (wacom->features->pressure_max > 255)
+			pressure = (pressure << 1) | ((data[4] >> 6) & 1);
+		pressure += (wacom->features->pressure_max + 1) / 2;
+
+		input_report_abs(dev, ABS_X, data[3] | ((__u32)data[2] << 7) | ((__u32)(data[1] & 0x03) << 14));
+		input_report_abs(dev, ABS_Y, data[6] | ((__u32)data[5] << 7) | ((__u32)(data[4] & 0x03) << 14));
+		input_report_abs(dev, ABS_PRESSURE, pressure);
+
 		input_report_key(dev, BTN_TOUCH, data[4] & 0x08);
 		input_report_key(dev, BTN_STYLUS, data[4] & 0x10);
 		input_report_key(dev, BTN_STYLUS2, data[4] & 0x20);
 	}
 	
-	input_event(dev, EV_MSC, MSC_SERIAL, 0);
+	input_sync(dev);
+}
+
+static void wacom_penpartner_irq(struct urb *urb)
+{
+	struct wacom *wacom = urb->context;
+	unsigned char *data = wacom->data;
+	struct input_dev *dev = &wacom->dev;
+
+	if (urb->status) return;
+
+	input_report_key(dev, BTN_TOOL_PEN, 1);
+	input_report_abs(dev, ABS_X, data[2] << 8 | data[1]);
+	input_report_abs(dev, ABS_Y, data[4] << 8 | data[3]);
+	input_report_abs(dev, ABS_PRESSURE, (signed char)data[6] + 127);
+	input_report_key(dev, BTN_TOUCH, ((signed char)data[6] > -80) && !(data[5] & 0x20));
+	input_report_key(dev, BTN_STYLUS, (data[5] & 0x40));
 	input_sync(dev);
 }
 
@@ -176,13 +194,13 @@
 			input_report_abs(dev, ABS_X, x);
 			input_report_abs(dev, ABS_Y, y);
 
-			input_event(dev, EV_MSC, MSC_SERIAL, data[1] & 0x01);
+			input_sync(dev);
 			return;
 	}
 
 	if (data[1] & 0x80) {
-		input_report_abs(dev, ABS_X, wacom->x = x);
-		input_report_abs(dev, ABS_Y, wacom->y = y);
+		input_report_abs(dev, ABS_X, x);
+		input_report_abs(dev, ABS_Y, y);
 	}
 
 	input_report_abs(dev, ABS_PRESSURE, data[6] | ((__u32)data[7] << 8));
@@ -190,8 +208,6 @@
 	input_report_key(dev, BTN_STYLUS, data[1] & 0x02);
 	input_report_key(dev, BTN_STYLUS2, data[1] & 0x04);
 
-	input_event(dev, EV_MSC, MSC_SERIAL, data[1] & 0x01);
-
 	input_sync(dev);
 }
 
@@ -221,27 +237,32 @@
 			case 0x832:
 			case 0x012: wacom->tool[idx] = BTN_TOOL_PENCIL;		break;	/* Inking pen */
 			case 0x822:
+			case 0x842:
+			case 0x852:
 			case 0x022: wacom->tool[idx] = BTN_TOOL_PEN;		break;	/* Pen */
 			case 0x812:
 			case 0x032: wacom->tool[idx] = BTN_TOOL_BRUSH;		break;	/* Stroke pen */
+			case 0x007:
 		        case 0x09c:
-			case 0x094: wacom->tool[idx] = BTN_TOOL_MOUSE;		break;	/* Mouse 4D */
+			case 0x094: wacom->tool[idx] = BTN_TOOL_MOUSE;		break;	/* Mouse 4D and 2D */
 			case 0x096: wacom->tool[idx] = BTN_TOOL_LENS;		break;	/* Lens cursor */
 			case 0x82a:
+			case 0x85a:
 		        case 0x91a:
 			case 0x0fa: wacom->tool[idx] = BTN_TOOL_RUBBER;		break;	/* Eraser */
 			case 0x112: wacom->tool[idx] = BTN_TOOL_AIRBRUSH;	break;	/* Airbrush */
 			default:    wacom->tool[idx] = BTN_TOOL_PEN;		break;	/* Unknown tool */
-		}	
+		}
 
 		input_report_key(dev, wacom->tool[idx], 1);
-		input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
+		input_report_abs(dev, ABS_SERIAL, wacom->serial[idx]);
+		input_sync(dev);
 		return;
 	}
 
 	if ((data[1] & 0xfe) == 0x80) {						/* Exit report */
 		input_report_key(dev, wacom->tool[idx], 0);
-		input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
+		input_sync(dev);
 		return;
 	}
 
@@ -274,61 +295,109 @@
 
 		} else {
 
-			input_report_key(dev, BTN_LEFT,   data[8] & 0x01);
-			input_report_key(dev, BTN_MIDDLE, data[8] & 0x02);
-			input_report_key(dev, BTN_RIGHT,  data[8] & 0x04);
-
 	 		if ((data[1] & 0x10) == 0) {				/* 4D mouse packets */
 
+				input_report_key(dev, BTN_LEFT,   data[8] & 0x01);
+				input_report_key(dev, BTN_MIDDLE, data[8] & 0x02);
+				input_report_key(dev, BTN_RIGHT,  data[8] & 0x04);
+
 				input_report_key(dev, BTN_SIDE,   data[8] & 0x20);
 				input_report_key(dev, BTN_EXTRA,  data[8] & 0x10);
 				input_report_abs(dev, ABS_THROTTLE,  (data[8] & 0x08) ?
 						 ((__u32)data[6] << 2) | ((data[7] >> 6) & 3) :
 						 -((__u32)data[6] << 2) | ((data[7] >> 6) & 3));
 
-			} else {						/* Lens cursor packets */
-
-				input_report_key(dev, BTN_SIDE,   data[8] & 0x10);
-				input_report_key(dev, BTN_EXTRA,  data[8] & 0x08);
+			} else {
+				if (wacom->tool[idx] == BTN_TOOL_MOUSE) {	/* 2D mouse packets */	
+					input_report_key(dev, BTN_LEFT,   data[8] & 0x04);
+					input_report_key(dev, BTN_MIDDLE, data[8] & 0x08);
+					input_report_key(dev, BTN_RIGHT,  data[8] & 0x10);
+					input_report_abs(dev, REL_WHEEL, 
+					    ((__u32)(data[8] & 0x01) - (__u32)((data[8] & 0x02) >> 1)));
+				}
+				else {     /* Lens cursor packets */
+					input_report_key(dev, BTN_LEFT,   data[8] & 0x01);
+					input_report_key(dev, BTN_MIDDLE, data[8] & 0x02);
+					input_report_key(dev, BTN_RIGHT,  data[8] & 0x04);
+					input_report_key(dev, BTN_SIDE,   data[8] & 0x10);
+					input_report_key(dev, BTN_EXTRA,  data[8] & 0x08);
+				}
 			}
 		}
 	}
 	
-	input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
-
 	input_sync(dev);
 }
 
 #define WACOM_INTUOS_TOOLS	(BIT(BTN_TOOL_BRUSH) | BIT(BTN_TOOL_PENCIL) | BIT(BTN_TOOL_AIRBRUSH) | BIT(BTN_TOOL_LENS))
 #define WACOM_INTUOS_BUTTONS	(BIT(BTN_SIDE) | BIT(BTN_EXTRA))
-#define WACOM_INTUOS_ABS	(BIT(ABS_TILT_X) | BIT(ABS_TILT_Y) | BIT(ABS_RZ) | BIT(ABS_THROTTLE))
+#define WACOM_INTUOS_ABS	(BIT(ABS_TILT_X) | BIT(ABS_TILT_Y) | BIT(ABS_RZ) | BIT(ABS_THROTTLE) | BIT(ABS_SERIAL))
 
 struct wacom_features wacom_features[] = {
-	{ "Wacom Graphire",      8, 10206,  7422,  511, 32, wacom_graphire_irq,
-		BIT(EV_REL), 0, BIT(REL_WHEEL), 0 },
-	{ "Wacom Intuos 4x5",   10, 12700, 10360, 1023, 15, wacom_intuos_irq,
+	{ "Wacom Penpartner",    7,   5040,  3780,  255, 32, wacom_penpartner_irq,
+		0, 0, 0, 0 },
+        { "Wacom Graphire",      8,  10206,  7422,  511, 32, wacom_graphire_irq,
+                BIT(EV_REL), 0, BIT(REL_WHEEL), 0 },
+	{ "Wacom Graphire2 4x5", 8,  10206,  7422,  511, 32, wacom_graphire_irq,
+ 		BIT(EV_REL), 0, BIT(REL_WHEEL), 0 },
+ 	{ "Wacom Graphire2 5x7", 8,  13918, 10206,  511, 32, wacom_graphire_irq,
+ 		BIT(EV_REL), 0, BIT(REL_WHEEL), 0 },
+  	{ "Wacom Intuos 4x5",   10,  12700, 10360, 1023, 15, wacom_intuos_irq,
+ 		0, WACOM_INTUOS_ABS, 0, WACOM_INTUOS_BUTTONS, WACOM_INTUOS_TOOLS },
+ 	{ "Wacom Intuos 6x8",   10,  20600, 16450, 1023, 15, wacom_intuos_irq,
+ 		0, WACOM_INTUOS_ABS, 0, WACOM_INTUOS_BUTTONS, WACOM_INTUOS_TOOLS },
+ 	{ "Wacom Intuos 9x12",  10,  30670, 24130, 1023, 15, wacom_intuos_irq,
+ 		0, WACOM_INTUOS_ABS, 0, WACOM_INTUOS_BUTTONS, WACOM_INTUOS_TOOLS },
+ 	{ "Wacom Intuos 12x12", 10,  30670, 31040, 1023, 15, wacom_intuos_irq,
+ 		0, WACOM_INTUOS_ABS, 0, WACOM_INTUOS_BUTTONS, WACOM_INTUOS_TOOLS },
+ 	{ "Wacom Intuos 12x18", 10,  45860, 31040, 1023, 15, wacom_intuos_irq,
+ 		0, WACOM_INTUOS_ABS, 0, WACOM_INTUOS_BUTTONS, WACOM_INTUOS_TOOLS },
+ 	{ "Wacom PL400",         8,   5408,  4056,  255, 32, wacom_pl_irq,
+ 		0,  0, 0, 0 },
+ 	{ "Wacom PL500",         8,   6144,  4608,  255, 32, wacom_pl_irq,
+ 		0,  0, 0, 0 },
+ 	{ "Wacom PL600",         8,   6126,  4604,  255, 32, wacom_pl_irq,
+ 		0,  0, 0, 0 },
+ 	{ "Wacom PL600SX",       8,   6260,  5016,  255, 32, wacom_pl_irq,
+ 		0,  0, 0, 0 },
+ 	{ "Wacom PL550",         8,   6144,  4608,  511, 32, wacom_pl_irq,
+ 		0,  0, 0, 0 },
+ 	{ "Wacom PL800",         8,   7220,  5780,  511, 32, wacom_pl_irq,
+ 		0,  0, 0, 0 },
+	{ "Wacom Intuos2 4x5",   10, 12700, 10360, 1023, 15, wacom_intuos_irq,
 		0, WACOM_INTUOS_ABS, 0, WACOM_INTUOS_BUTTONS, WACOM_INTUOS_TOOLS },
-	{ "Wacom Intuos 6x8",   10, 20320, 15040, 1023, 15, wacom_intuos_irq,
+	{ "Wacom Intuos2 6x8",   10, 20600, 16450, 1023, 15, wacom_intuos_irq,
 		0, WACOM_INTUOS_ABS, 0, WACOM_INTUOS_BUTTONS, WACOM_INTUOS_TOOLS },
-	{ "Wacom Intuos 9x12",  10, 30480, 23060, 1023, 15, wacom_intuos_irq,
+	{ "Wacom Intuos2 9x12",  10, 30670, 24130, 1023, 15, wacom_intuos_irq,
 		0, WACOM_INTUOS_ABS, 0, WACOM_INTUOS_BUTTONS, WACOM_INTUOS_TOOLS },
-	{ "Wacom Intuos 12x12", 10, 30480, 30480, 1023, 15, wacom_intuos_irq,
+	{ "Wacom Intuos2 12x12", 10, 30670, 31040, 1023, 15, wacom_intuos_irq,
 		0, WACOM_INTUOS_ABS, 0, WACOM_INTUOS_BUTTONS, WACOM_INTUOS_TOOLS },
-	{ "Wacom Intuos 12x18", 10, 47720, 30480, 1023, 15, wacom_intuos_irq,
+	{ "Wacom Intuos2 12x18", 10, 45860, 31040, 1023, 15, wacom_intuos_irq,
 		0, WACOM_INTUOS_ABS, 0, WACOM_INTUOS_BUTTONS, WACOM_INTUOS_TOOLS },
-	{ "Wacom PL500",        8,  12328, 9256,   511, 32, wacom_pl_irq,
-		0,  0, 0, 0 },
-	{ NULL , 0 }
+ 	{ }
 };
 
 struct usb_device_id wacom_ids[] = {
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x10), .driver_info = 0 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x20), .driver_info = 1 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x21), .driver_info = 2 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x22), .driver_info = 3 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x23), .driver_info = 4 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x24), .driver_info = 5 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x31), .driver_info = 6 },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x00), driver_info: 0 },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x10), driver_info: 1 },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x11), driver_info: 2 },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x12), driver_info: 3 },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x20), driver_info: 4 },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x21), driver_info: 5 },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x22), driver_info: 6 },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x23), driver_info: 7 },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x24), driver_info: 8 },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x30), driver_info: 9 },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x31), driver_info: 10 },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x32), driver_info: 11 },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x33), driver_info: 12 },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x34), driver_info: 13 },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x35), driver_info: 14 },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x41), driver_info: 15 },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x42), driver_info: 16 },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x43), driver_info: 17 },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x44), driver_info: 18 },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x45), driver_info: 19 },
 	{ }
 };
 
@@ -358,9 +427,10 @@
 
 static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id)
 {
-	struct usb_device *dev = interface_to_usbdev (intf);
+	struct usb_device *dev = interface_to_usbdev(intf);
 	struct usb_endpoint_descriptor *endpoint;
 	struct wacom *wacom;
+	char rep_data[2] = {0x02, 0x02};
 	char path[64];
 
 	if (!(wacom = kmalloc(sizeof(struct wacom), GFP_KERNEL)))
@@ -382,13 +452,12 @@
 
 	wacom->features = wacom_features + id->driver_info;
 
-	wacom->dev.evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_MSC) | wacom->features->evbit;
+	wacom->dev.evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS) | wacom->features->evbit;
 	wacom->dev.absbit[0] |= BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_PRESSURE) | BIT(ABS_DISTANCE) | BIT(ABS_WHEEL) | wacom->features->absbit;
 	wacom->dev.relbit[0] |= wacom->features->relbit;
 	wacom->dev.keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE) | wacom->features->btnbit;
 	wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOOL_RUBBER) | BIT(BTN_TOOL_MOUSE) |
 		BIT(BTN_TOUCH) | BIT(BTN_STYLUS) | BIT(BTN_STYLUS2) | wacom->features->digibit;
-	wacom->dev.mscbit[0] |= BIT(MSC_SERIAL);
 
 	wacom->dev.absmax[ABS_X] = wacom->features->x_max;
 	wacom->dev.absmax[ABS_Y] = wacom->features->y_max;
@@ -435,9 +504,16 @@
 
 	input_register_device(&wacom->dev);
 
+#if 0	/* Missing usb_set_report() */
+	usb_set_report(intf, 3, 2, rep_data, 2);
+	usb_set_report(intf, 3, 5, rep_data, 0);
+	usb_set_report(intf, 3, 6, rep_data, 0);
+#endif
+
 	printk(KERN_INFO "input: %s on %s\n", wacom->features->name, path);
 
 	dev_set_drvdata(&intf->dev, wacom);
+
 	return 0;
 }
 

===================================================================

This BitKeeper patch contains the following changesets:
1.573.1.35
## Wrapped with gzip_uu ##


begin 664 bkpatch18328
M'XL(`"C=HCT``\5:>W/:.A;_V_X4VG;F#K2$6++\(&DR38+;,"6!!=+'WMMA
MC!'!-\1F;9/2;?K=]TBVP6`"3IH[35-4R^?\SE-'1Z(OT57(@@/ISO\[8LY8
M?HG._3`ZD,)9R*K._^"YX_OPO#_V;]E^0K4_N-EWO>DLDN%]VXZ<,;IC07@@
MX:JZF(F^3]F!U+'>7S5/.K)\=(3.QK9WS;HL0D='<N0'=_9D&+ZUH_'$]ZI1
M8'OA+8OLJN/?WB]([XFB$/BC84-5-/T>ZPHU[AT\Q-BFF`T50DV=RC=C>^R_
MO?$CMQKZ@#9RUR%JA`*$JIGWBE*C6*XC7-4,M0HJ:T@A^TIMGU!$\`&A!T1[
MK9`#14&)O6\3;Z#7!.TI\BEZ7N7/9`==38=VQ-`G&P#0,'#!GR`%D2I%CH`+
MD>T-%_\>!4#6=KUK<"J#3W\4LU;E#T@S5;F]=+:\]\@?659L13[>862L8[@_
M"P?[WX1H)V,N5;!QKQ",Z?W`'&ED9-LUA8R8:FCK3EU!$EFUBL<#!W\)OM>Q
MH3].L;$[S*M%*4S<#PV,C='(&!C#FFWK1=0"M#W'#UA>,U73=5/D^#:NW6G_
M1-WEP=@.`'/@7D]];UCU6%2U9P4MP)I.5%@4&E'$HE!KN>6`'UP.%.V1?V0]
M6/.(0;X/)K9S,W'#"(W\(%D=?!V<N-.(W?!LCUW?0GO!-_$+^=O>&H4GK(<&
M)J:.L/QRR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F3=T
E1_)?H#+EUVE_+?];I3-FSDTXNSW2B&+7=&K(_P>K9$7GL2D`````
`
end

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [patch] Input - Use lists.h in gameport core [7/23]
  2002-10-08 13:44         ` [patch] Input - Update of wacom.c from 2.4 and Wacom Inc. [6/23] Vojtech Pavlik
@ 2002-10-08 13:45           ` Vojtech Pavlik
  2002-10-08 13:46             ` [patch] Input - Use lists.h in serio core [8/23] Vojtech Pavlik
  0 siblings, 1 reply; 26+ messages in thread
From: Vojtech Pavlik @ 2002-10-08 13:45 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: torvalds, linux-kernel


You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

===================================================================

ChangeSet@1.573.1.36, 2002-09-25 12:02:30+02:00, vojtech@suse.cz
  Convert gameport.[ch] to use lists.h for its linked lists.


 drivers/input/gameport/gameport.c |   74 ++++++++++----------------------------
 include/linux/gameport.h          |   32 ++++------------
 2 files changed, 29 insertions(+), 77 deletions(-)

===================================================================

diff -Nru a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
--- a/drivers/input/gameport/gameport.c	Tue Oct  8 15:26:57 2002
+++ b/drivers/input/gameport/gameport.c	Tue Oct  8 15:26:57 2002
@@ -1,31 +1,13 @@
 /*
- * $Id: gameport.c,v 1.18 2002/01/22 20:41:14 vojtech Exp $
- *
- *  Copyright (c) 1999-2001 Vojtech Pavlik
- */
-
-/*
  * Generic gameport layer
+ *
+ * Copyright (c) 1999-2002 Vojtech Pavlik
  */
 
 /*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or 
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
- * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
  */
 
 #include <asm/io.h>
@@ -51,9 +33,8 @@
 EXPORT_SYMBOL(gameport_rescan);
 EXPORT_SYMBOL(gameport_cooked_read);
 
-static struct gameport *gameport_list;
-static struct gameport_dev *gameport_dev;
-
+static LIST_HEAD(gameport_list);
+static LIST_HEAD(gameport_dev_list);
 
 #ifdef __i386__
 
@@ -122,12 +103,13 @@
 
 static void gameport_find_dev(struct gameport *gameport)
 {
-        struct gameport_dev *dev = gameport_dev;
+        struct gameport_dev *dev;
 
-        while (dev && !gameport->dev) {
+        list_for_each_entry(dev, &gameport_dev_list, node) {
+		if (gameport->dev)
+			break;
 		if (dev->connect)
                 	dev->connect(gameport, dev);
-                dev = dev->next;
         }
 }
 
@@ -139,52 +121,37 @@
 
 void gameport_register_port(struct gameport *gameport)
 {
-	gameport->next = gameport_list;	
-	gameport_list = gameport;
-
+	list_add_tail(&gameport->node, &gameport_list);
 	gameport->speed = gameport_measure_speed(gameport);
-
 	gameport_find_dev(gameport);
 }
 
 void gameport_unregister_port(struct gameport *gameport)
 {
-        struct gameport **gameportptr = &gameport_list;
-
-        while (*gameportptr && (*gameportptr != gameport)) gameportptr = &((*gameportptr)->next);
-        *gameportptr = (*gameportptr)->next;
-
+	list_del_init(&gameport->node);
 	if (gameport->dev && gameport->dev->disconnect)
 		gameport->dev->disconnect(gameport);
 }
 
 void gameport_register_device(struct gameport_dev *dev)
 {
-	struct gameport *gameport = gameport_list;
+	struct gameport *gameport;
 
-	dev->next = gameport_dev;	
-	gameport_dev = dev;
-
-	while (gameport) {
+	list_add_tail(&dev->node, &gameport_dev_list);
+	list_for_each_entry(gameport, &gameport_list, node)
 		if (!gameport->dev && dev->connect)
 			dev->connect(gameport, dev);
-		gameport = gameport->next;
-	}
 }
 
 void gameport_unregister_device(struct gameport_dev *dev)
 {
-        struct gameport_dev **devptr = &gameport_dev;
-	struct gameport *gameport = gameport_list;
-
-        while (*devptr && (*devptr != dev)) devptr = &((*devptr)->next);
-        *devptr = (*devptr)->next;
+	struct gameport *gameport;
 
-	while (gameport) {
+	list_del_init(&dev->node);
+	list_for_each_entry(gameport, &gameport_list, node) {
 		if (gameport->dev == dev && dev->disconnect)
 			dev->disconnect(gameport);
 		gameport_find_dev(gameport);
-		gameport = gameport->next;
 	}
 }
 
@@ -209,5 +176,6 @@
 void gameport_close(struct gameport *gameport)
 {
 	gameport->dev = NULL;
-	if (gameport->close) gameport->close(gameport);
+	if (gameport->close)
+		gameport->close(gameport);
 }
diff -Nru a/include/linux/gameport.h b/include/linux/gameport.h
--- a/include/linux/gameport.h	Tue Oct  8 15:26:57 2002
+++ b/include/linux/gameport.h	Tue Oct  8 15:26:57 2002
@@ -2,33 +2,16 @@
 #define _GAMEPORT_H
 
 /*
- * $Id: gameport.h,v 1.20 2002/01/03 08:55:05 vojtech Exp $
+ *  Copyright (c) 1999-2002 Vojtech Pavlik
  *
- *  Copyright (c) 1999-2001 Vojtech Pavlik
- */
-
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
- * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
  */
 
 #include <asm/io.h>
 #include <linux/input.h>
+#include <linux/list.h>
 
 struct gameport;
 
@@ -53,7 +36,8 @@
 	void (*close)(struct gameport *);
 
 	struct gameport_dev *dev;
-	struct gameport *next;
+
+	struct list_head node;
 };
 
 struct gameport_dev {
@@ -64,7 +48,7 @@
 	void (*connect)(struct gameport *, struct gameport_dev *dev);
 	void (*disconnect)(struct gameport *);
 
-	struct gameport_dev *next;
+	struct list_head node;
 };
 
 int gameport_open(struct gameport *gameport, struct gameport_dev *dev, int mode);

===================================================================

This BitKeeper patch contains the following changesets:
1.573.1.36
## Wrapped with gzip_uu ##


begin 664 bkpatch18299
M'XL(`"'=HCT``]56;6_;-A#^;/Z*`P(425I+)/7N+D&[N$V-%5N0-/NR#09-
MT9%J630D*IDW__@=94=)G:5NLV[`9%LTZ>/=/0_O'GD/+FM5#7K7^J-1,B-[
M\$[79M"KFUHY\@^<GVN-<S?3<^5NK-S)S,W+16,(_GXFC,S@6E7UH,<<KULQ
MRX4:],[?G%Z^?WU.R-$1G&2BO%(7RL#1$3&ZNA9%6K\2)BMTZ9A*E/5<&>%(
M/5]UIBM.*<=7P"*/!N&*A=2/5I*EC`F?J91R/PY]LDGLU2;M[?T)]QE^>+"B
M-(@],@3F!)'G8+XA4.[2Q.4!,#Z@?.#1YWBG%+9\PG,.?4J^AV^;^0F1<*)+
MY,_`E9BKA:Z,\XO,?L,X@)&AR&M3.QE,=06YJ7%>SE2Z628_0.@'-")G=^R2
M_E=>A%!!R?$.8'DIBR95+L9O?G>[5+/[.!/?7U'$B6@GDRD/DB16,?,5G6ZS
MN<-=P@.&([>TL23:F5Q:Y;8"79F)ROVHE[7)Y>S.J[R7I(\EL&(TC(-5($(E
MI&1"1AZ+DP<YWGIM:[WS]L#M7;)AP/%(;:WOW+J[![X)IJXSS$U>Y%>9<1IY
M\Q78(NP:SX\872'(F+>=DVRW#`\?;1D&_<#[5YOFTS:Q#=$>PD_0KV[:-Q;X
MV>[S>$+7##F$9!0#)W"(;\QHL:PLQ[`O#X`E2=*W<.#G-2NHB]=%/B-#QH%%
M9,1C\.RV#UE>PZ+25Y68`WZ=5DI!K:?F1E3J)2QU`U*44*D4(5;YI#$*A0!$
MF;HH"7.=YM,E+EA739FJ"DRFP*AJ7H.>MI/3'R_A5)6J$@6<-9,BE_`^EZI$
MVBPIN2Z!@\`D[&]UANHR65IW=N];F\W%)AMXJS&$,+C#(</`1P"C($0":H.+
MZ'5T\6'\[LWKX?XML6-[+@<O/V.0JNM;(V0&2XJ,U@-L+@3=R#MQM!O@$&^M
M?;2VCRR5F\LZ&Z-:CK$/LK$J3;7<1_,7\.Q!S!=0ZE0=P)^DU\NGT"75/T:+
M`USL32HE9C:21S'2D/G<8F:^C[->&TFDZ=B(O-A_=K?;>KT?K\/GAZV7@$.`
M7H*P\Y*J8IR7N=GVTNX*O19E._2VZ(##VV^M90"^M;1%N9T>0GJ8V3WV>W]'
MW*WA-IH-<Q@R8A@+AZB%%+.=.<9K-#CP!^"[')^8#YXD!K!%,>2VS;#+<,`X
MGYZN+'2M[/EN+74F&-ZJ^&,/J=WB_<^>EH^J]N?=1JC1OA=2OF)>1,-6K!G]
M<K6.H<_]_U:LUX_W+;%^#.53-+H5E%9.#N&+%3H";DLG^G\+],BSS;BW81.^
M6]-IN7>R8V0F;*FQ\OUKU[)MSV5*I&T_8;N&K<*V]\=LNK_\,E-R5C?S(TY3
..@G3@/P%39=J55\,````
`
end

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [patch] Input - Use lists.h in serio core [8/23]
  2002-10-08 13:45           ` [patch] Input - Use lists.h in gameport core [7/23] Vojtech Pavlik
@ 2002-10-08 13:46             ` Vojtech Pavlik
  2002-10-08 13:47               ` [patch] Input - wacom.c cleanups and fixes [9/23] Vojtech Pavlik
  0 siblings, 1 reply; 26+ messages in thread
From: Vojtech Pavlik @ 2002-10-08 13:46 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: torvalds, linux-kernel


You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

===================================================================

ChangeSet@1.573.1.37, 2002-09-25 12:03:31+02:00, vojtech@suse.cz
  Convert serio.[ch] to use list.h lists.


 drivers/input/serio/serio.c |   88 ++++++++++++++++++++++++--------------------
 include/linux/serio.h       |   39 +++++--------------
 2 files changed, 59 insertions(+), 68 deletions(-)

===================================================================

diff -Nru a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
--- a/drivers/input/serio/serio.c	Tue Oct  8 15:26:50 2002
+++ b/drivers/input/serio/serio.c	Tue Oct  8 15:26:50 2002
@@ -37,6 +37,7 @@
 #include <linux/sched.h>
 #include <linux/smp_lock.h>
 #include <linux/suspend.h>
+#include <linux/slab.h>
 
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
 MODULE_DESCRIPTION("Serio abstraction core");
@@ -51,19 +52,27 @@
 EXPORT_SYMBOL(serio_close);
 EXPORT_SYMBOL(serio_rescan);
 
-static struct serio *serio_list;
-static struct serio_dev *serio_dev;
+struct serio_event {
+	int type;
+	struct serio *serio;
+	struct list_head node;
+};
+
+static LIST_HEAD(serio_list);
+static LIST_HEAD(serio_dev_list);
+static LIST_HEAD(serio_event_list);
 static int serio_pid;
 
 static void serio_find_dev(struct serio *serio)
 {
-        struct serio_dev *dev = serio_dev;
+	struct serio_dev *dev;
 
-        while (dev && !serio->dev) {
+	list_for_each_entry(dev, &serio_dev_list, node) {
+		if (serio->dev)
+			break;
 		if (dev->connect)
-                	dev->connect(serio, dev);
-                dev = dev->next;
-        }
+			dev->connect(serio, dev);
+	}
 }
 
 #define SERIO_RESCAN	1
@@ -73,17 +82,23 @@
 
 void serio_handle_events(void)
 {
-	struct serio *serio = serio_list;
+	struct list_head *node, *next;
+	struct serio_event *event;
 
-	while (serio) {
-		if (serio->event & SERIO_RESCAN) {
-			if (serio->dev && serio->dev->disconnect)
-				serio->dev->disconnect(serio);
-			serio_find_dev(serio);
-		}
+	list_for_each_safe(node, next, &serio_event_list) {
+		event = container_of(node, struct serio_event, node);	
 
-		serio->event = 0;
-		serio = serio->next;
+		switch (event->type) {
+			case SERIO_RESCAN :
+				if (event->serio->dev && event->serio->dev->disconnect)
+					event->serio->dev->disconnect(event->serio);
+				serio_find_dev(event->serio);
+				break;
+			default:
+				break;
+		}
+		list_del_init(node);
+		kfree(event);
 	}
 }
 
@@ -95,7 +110,7 @@
 
 	do {
 		serio_handle_events();
-		interruptible_sleep_on(&serio_wait); 
+		wait_event_interruptible(serio_wait, !list_empty(&serio_event_list)); 
 		if (current->flags & PF_FREEZE)
 			refrigerator(PF_IOTHREAD);
 	} while (!signal_pending(current));
@@ -108,7 +123,15 @@
 
 void serio_rescan(struct serio *serio)
 {
-	serio->event |= SERIO_RESCAN;
+	struct serio_event *event;
+
+	if (!(event = kmalloc(sizeof(struct serio_event), GFP_ATOMIC)))
+		return;
+
+	event->type = SERIO_RESCAN;
+	event->serio = serio;
+
+	list_add_tail(&event->node, &serio_event_list);
 	wake_up(&serio_wait);
 }
 
@@ -122,49 +145,36 @@
 
 void serio_register_port(struct serio *serio)
 {
-	serio->next = serio_list;	
-	serio_list = serio;
+	list_add_tail(&serio->node, &serio_list);
 	serio_find_dev(serio);
 }
 
 void serio_unregister_port(struct serio *serio)
 {
-        struct serio **serioptr = &serio_list;
-
-        while (*serioptr && (*serioptr != serio)) serioptr = &((*serioptr)->next);
-        *serioptr = (*serioptr)->next;
-
+	list_del_init(&serio->node);
 	if (serio->dev && serio->dev->disconnect)
 		serio->dev->disconnect(serio);
 }
 
 void serio_register_device(struct serio_dev *dev)
 {
-	struct serio *serio = serio_list;
-
-	dev->next = serio_dev;	
-	serio_dev = dev;
-
-	while (serio) {
+	struct serio *serio;
+	list_add_tail(&dev->node, &serio_dev_list);
+	list_for_each_entry(serio, &serio_list, node)
 		if (!serio->dev && dev->connect)
 			dev->connect(serio, dev);
-		serio = serio->next;
-	}
 }
 
 void serio_unregister_device(struct serio_dev *dev)
 {
-        struct serio_dev **devptr = &serio_dev;
-	struct serio *serio = serio_list;
+	struct serio *serio;
 
-        while (*devptr && (*devptr != dev)) devptr = &((*devptr)->next);
-        *devptr = (*devptr)->next;
+	list_del_init(&dev->node);
 
-	while (serio) {
+	list_for_each_entry(serio, &serio_list, node) {
 		if (serio->dev == dev && dev->disconnect)
 			dev->disconnect(serio);
 		serio_find_dev(serio);
-		serio = serio->next;
 	}
 }
 
diff -Nru a/include/linux/serio.h b/include/linux/serio.h
--- a/include/linux/serio.h	Tue Oct  8 15:26:50 2002
+++ b/include/linux/serio.h	Tue Oct  8 15:26:50 2002
@@ -2,36 +2,16 @@
 #define _SERIO_H
 
 /*
- * $Id: serio.h,v 1.21 2001/12/19 05:15:21 skids Exp $
- *
- * Copyright (C) 1999-2001 Vojtech Pavlik
- */
-
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
- * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
- */
-
-/*
- * The serial port set type ioctl.
+ * Copyright (C) 1999-2002 Vojtech Pavlik
+*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
  */
 
 #include <linux/ioctl.h>
+#include <linux/list.h>
+
 #define SPIOCSTYPE	_IOW('q', 0x01, unsigned long)
 
 struct serio;
@@ -57,7 +37,8 @@
 	void (*close)(struct serio *);
 
 	struct serio_dev *dev;
-	struct serio *next;
+
+	struct list_head node;
 };
 
 struct serio_dev {
@@ -71,7 +52,7 @@
 	void (*disconnect)(struct serio *);
 	void (*cleanup)(struct serio *);
 
-	struct serio_dev *next;
+	struct list_head node;
 };
 
 int serio_open(struct serio *serio, struct serio_dev *dev);

===================================================================

This BitKeeper patch contains the following changesets:
1.573.1.37
## Wrapped with gzip_uu ##


begin 664 bkpatch18270
M'XL(`!K=HCT``[U7;7/:.!#^;/V*[70F`VD`R^^&2Z9I2%/F>FTF:>_+]881
MMER[&)NQ95)Z]+_?2G8)+WFYMG='@@72[J/=9U>[XBF\+WG1UQ;Y)\&#F#R%
M5WDI^EI9E;P;?,'O5WF.WWMQ/N.]1JHWF?:2;%X)@NN73`0Q+'A1]C7:-=<S
M8CGG?>WJ_.+]Z],K0HZ/X2QFV4=^S04<'Q.1%PN6AN5S)N(TS[JB8%DYXX)U
M@WRV6HNN#%TW\,^FKJG;SHHZNN6N`AI2RBS*0]VP/,<BC6'/&[-W]7W#ICB:
M^LJQ;-TE0Z!=VS6[:*\+NM'3_9YA`S7ZNMDWZ3,=/^BP@PG/#.CHY`7\NY:?
MD0#.\@SY$X"12/+N'T'\)VX"N"VD22FZL1K*+OD5',LU77)Y2R7I?.>+$)WI
MY.01+\(BD1'M!3$K>I_R92F28-JK[0LV/+-TW5[IEN,[*QXP>^+S*/1<RCG;
MI6\-J1*GAMH&K(-D&M[*I+[O/VICD@5I%?)>FF35YP8JWF3=MZR5[KC47;'(
M#%S7X=3FW&-AN&?<`UBW9EF6YSDJDQ_PY?'<_GENR9PM>/K/F<4$I+Z-'U>(
M:SLJ_:F^F_B&=U_B6SYT3/\_37W,]]U<K[/@+72*&_6/N7OY$/,_<!1&I@^4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]TX"GF$WD)>:),_``(9&R+4R
MYB%,EA).ZKZ4UEPWUL#+'+?`]H^Q0F?E-67W$E.S?H*%Y_8.8,@R=,^59.A:
BJOU:&^=O5V;]VRZ(>3`MJ]FQY?FN%4TL\C</_Z:%2`X`````
`
end

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [patch] Input - wacom.c cleanups and fixes [9/23]
  2002-10-08 13:46             ` [patch] Input - Use lists.h in serio core [8/23] Vojtech Pavlik
@ 2002-10-08 13:47               ` Vojtech Pavlik
  2002-10-08 13:48                 ` [patch] Input - add #include <lists.h> to input.h [10/23] Vojtech Pavlik
  0 siblings, 1 reply; 26+ messages in thread
From: Vojtech Pavlik @ 2002-10-08 13:47 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: torvalds, linux-kernel


You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

===================================================================

ChangeSet@1.573.1.38, 2002-09-25 12:04:25+02:00, vojtech@suse.cz
  Cleanups and fixes for the Wacom USB driver.


 hid-core.c |    3 -
 wacom.c    |  146 ++++++++++++++++++++++++++++---------------------------------
 2 files changed, 70 insertions(+), 79 deletions(-)

===================================================================

diff -Nru a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
--- a/drivers/usb/input/hid-core.c	Tue Oct  8 15:26:43 2002
+++ b/drivers/usb/input/hid-core.c	Tue Oct  8 15:26:43 2002
@@ -1291,7 +1291,7 @@
 #define USB_DEVICE_ID_WACOM_INTUOS2	0x0040
 
 #define USB_VENDOR_ID_AIPTEK		0x08ca
-#define USB_VENDOR_ID_AIPTEK_6000	0x0020
+#define USB_DEVICE_ID_AIPTEK_6000	0x0020
 
 #define USB_VENDOR_ID_GRIFFIN		0x077d
 #define USB_DEVICE_ID_POWERMATE		0x0410
@@ -1327,7 +1327,6 @@
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL + 3, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL + 4, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL + 5, HID_QUIRK_IGNORE },
-	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 1, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 2, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 3, HID_QUIRK_IGNORE },
diff -Nru a/drivers/usb/input/wacom.c b/drivers/usb/input/wacom.c
--- a/drivers/usb/input/wacom.c	Tue Oct  8 15:26:43 2002
+++ b/drivers/usb/input/wacom.c	Tue Oct  8 15:26:43 2002
@@ -85,12 +85,8 @@
 	int y_max;
 	int pressure_max;
 	int distance_max;
+	int type;
 	void (*irq)(struct urb *urb);
-	unsigned long evbit;
-	unsigned long absbit;
-	unsigned long relbit;
-	unsigned long btnbit;
-	unsigned long digibit;
 };
 
 struct wacom {
@@ -255,7 +251,7 @@
 		}
 
 		input_report_key(dev, wacom->tool[idx], 1);
-		input_report_abs(dev, ABS_SERIAL, wacom->serial[idx]);
+		input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
 		input_sync(dev);
 		return;
 	}
@@ -329,75 +325,51 @@
 	input_sync(dev);
 }
 
-#define WACOM_INTUOS_TOOLS	(BIT(BTN_TOOL_BRUSH) | BIT(BTN_TOOL_PENCIL) | BIT(BTN_TOOL_AIRBRUSH) | BIT(BTN_TOOL_LENS))
-#define WACOM_INTUOS_BUTTONS	(BIT(BTN_SIDE) | BIT(BTN_EXTRA))
-#define WACOM_INTUOS_ABS	(BIT(ABS_TILT_X) | BIT(ABS_TILT_Y) | BIT(ABS_RZ) | BIT(ABS_THROTTLE) | BIT(ABS_SERIAL))
-
 struct wacom_features wacom_features[] = {
-	{ "Wacom Penpartner",    7,   5040,  3780,  255, 32, wacom_penpartner_irq,
-		0, 0, 0, 0 },
-        { "Wacom Graphire",      8,  10206,  7422,  511, 32, wacom_graphire_irq,
-                BIT(EV_REL), 0, BIT(REL_WHEEL), 0 },
-	{ "Wacom Graphire2 4x5", 8,  10206,  7422,  511, 32, wacom_graphire_irq,
- 		BIT(EV_REL), 0, BIT(REL_WHEEL), 0 },
- 	{ "Wacom Graphire2 5x7", 8,  13918, 10206,  511, 32, wacom_graphire_irq,
- 		BIT(EV_REL), 0, BIT(REL_WHEEL), 0 },
-  	{ "Wacom Intuos 4x5",   10,  12700, 10360, 1023, 15, wacom_intuos_irq,
- 		0, WACOM_INTUOS_ABS, 0, WACOM_INTUOS_BUTTONS, WACOM_INTUOS_TOOLS },
- 	{ "Wacom Intuos 6x8",   10,  20600, 16450, 1023, 15, wacom_intuos_irq,
- 		0, WACOM_INTUOS_ABS, 0, WACOM_INTUOS_BUTTONS, WACOM_INTUOS_TOOLS },
- 	{ "Wacom Intuos 9x12",  10,  30670, 24130, 1023, 15, wacom_intuos_irq,
- 		0, WACOM_INTUOS_ABS, 0, WACOM_INTUOS_BUTTONS, WACOM_INTUOS_TOOLS },
- 	{ "Wacom Intuos 12x12", 10,  30670, 31040, 1023, 15, wacom_intuos_irq,
- 		0, WACOM_INTUOS_ABS, 0, WACOM_INTUOS_BUTTONS, WACOM_INTUOS_TOOLS },
- 	{ "Wacom Intuos 12x18", 10,  45860, 31040, 1023, 15, wacom_intuos_irq,
- 		0, WACOM_INTUOS_ABS, 0, WACOM_INTUOS_BUTTONS, WACOM_INTUOS_TOOLS },
- 	{ "Wacom PL400",         8,   5408,  4056,  255, 32, wacom_pl_irq,
- 		0,  0, 0, 0 },
- 	{ "Wacom PL500",         8,   6144,  4608,  255, 32, wacom_pl_irq,
- 		0,  0, 0, 0 },
- 	{ "Wacom PL600",         8,   6126,  4604,  255, 32, wacom_pl_irq,
- 		0,  0, 0, 0 },
- 	{ "Wacom PL600SX",       8,   6260,  5016,  255, 32, wacom_pl_irq,
- 		0,  0, 0, 0 },
- 	{ "Wacom PL550",         8,   6144,  4608,  511, 32, wacom_pl_irq,
- 		0,  0, 0, 0 },
- 	{ "Wacom PL800",         8,   7220,  5780,  511, 32, wacom_pl_irq,
- 		0,  0, 0, 0 },
-	{ "Wacom Intuos2 4x5",   10, 12700, 10360, 1023, 15, wacom_intuos_irq,
-		0, WACOM_INTUOS_ABS, 0, WACOM_INTUOS_BUTTONS, WACOM_INTUOS_TOOLS },
-	{ "Wacom Intuos2 6x8",   10, 20600, 16450, 1023, 15, wacom_intuos_irq,
-		0, WACOM_INTUOS_ABS, 0, WACOM_INTUOS_BUTTONS, WACOM_INTUOS_TOOLS },
-	{ "Wacom Intuos2 9x12",  10, 30670, 24130, 1023, 15, wacom_intuos_irq,
-		0, WACOM_INTUOS_ABS, 0, WACOM_INTUOS_BUTTONS, WACOM_INTUOS_TOOLS },
-	{ "Wacom Intuos2 12x12", 10, 30670, 31040, 1023, 15, wacom_intuos_irq,
-		0, WACOM_INTUOS_ABS, 0, WACOM_INTUOS_BUTTONS, WACOM_INTUOS_TOOLS },
-	{ "Wacom Intuos2 12x18", 10, 45860, 31040, 1023, 15, wacom_intuos_irq,
-		0, WACOM_INTUOS_ABS, 0, WACOM_INTUOS_BUTTONS, WACOM_INTUOS_TOOLS },
+	{ "Wacom Penpartner",    7,   5040,  3780,  255, 32, 0, wacom_penpartner_irq },
+        { "Wacom Graphire",      8,  10206,  7422,  511, 32, 1, wacom_graphire_irq },
+	{ "Wacom Graphire2 4x5", 8,  10206,  7422,  511, 32, 1, wacom_graphire_irq },
+ 	{ "Wacom Graphire2 5x7", 8,  13918, 10206,  511, 32, 1, wacom_graphire_irq },
+  	{ "Wacom Intuos 4x5",   10,  12700, 10360, 1023, 15, 2, wacom_intuos_irq },
+ 	{ "Wacom Intuos 6x8",   10,  20600, 16450, 1023, 15, 2, wacom_intuos_irq },
+ 	{ "Wacom Intuos 9x12",  10,  30670, 24130, 1023, 15, 2, wacom_intuos_irq },
+ 	{ "Wacom Intuos 12x12", 10,  30670, 31040, 1023, 15, 2, wacom_intuos_irq },
+ 	{ "Wacom Intuos 12x18", 10,  45860, 31040, 1023, 15, 2, wacom_intuos_irq },
+ 	{ "Wacom PL400",         8,   5408,  4056,  255, 32, 3, wacom_pl_irq },
+ 	{ "Wacom PL500",         8,   6144,  4608,  255, 32, 3, wacom_pl_irq },
+ 	{ "Wacom PL600",         8,   6126,  4604,  255, 32, 3, wacom_pl_irq },
+ 	{ "Wacom PL600SX",       8,   6260,  5016,  255, 32, 3, wacom_pl_irq },
+ 	{ "Wacom PL550",         8,   6144,  4608,  511, 32, 3, wacom_pl_irq },
+ 	{ "Wacom PL800",         8,   7220,  5780,  511, 32, 3, wacom_pl_irq },
+	{ "Wacom Intuos2 4x5",   10, 12700, 10360, 1023, 15, 2, wacom_intuos_irq },
+	{ "Wacom Intuos2 6x8",   10, 20600, 16450, 1023, 15, 2, wacom_intuos_irq },
+	{ "Wacom Intuos2 9x12",  10, 30670, 24130, 1023, 15, 2, wacom_intuos_irq },
+	{ "Wacom Intuos2 12x12", 10, 30670, 31040, 1023, 15, 2, wacom_intuos_irq },
+	{ "Wacom Intuos2 12x18", 10, 45860, 31040, 1023, 15, 2, wacom_intuos_irq },
  	{ }
 };
 
 struct usb_device_id wacom_ids[] = {
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x00), driver_info: 0 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x10), driver_info: 1 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x11), driver_info: 2 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x12), driver_info: 3 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x20), driver_info: 4 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x21), driver_info: 5 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x22), driver_info: 6 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x23), driver_info: 7 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x24), driver_info: 8 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x30), driver_info: 9 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x31), driver_info: 10 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x32), driver_info: 11 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x33), driver_info: 12 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x34), driver_info: 13 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x35), driver_info: 14 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x41), driver_info: 15 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x42), driver_info: 16 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x43), driver_info: 17 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x44), driver_info: 18 },
-	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x45), driver_info: 19 },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x00) },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x10) },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x11) },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x12) },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x20) },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x21) },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x22) },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x23) },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x24) },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x30) },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x31) },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x32) },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x33) },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x34) },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x35) },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x41) },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x42) },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x43) },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x44) },
+	{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x45) },
 	{ }
 };
 
@@ -450,14 +422,34 @@
 		return -ENOMEM;
 	}
 
-	wacom->features = wacom_features + id->driver_info;
+	wacom->features = wacom_features + (id - wacom_ids);
+
+	wacom->dev.evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS);
+	wacom->dev.absbit[0] |= BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_PRESSURE);
+	wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOUCH) | BIT(BTN_STYLUS);
+
+	switch (wacom->features->type) {
+		case 1:
+			wacom->dev.evbit[0] |= BIT(EV_REL);
+			wacom->dev.relbit[0] |= BIT(REL_WHEEL);
+			wacom->dev.absbit[0] |= BIT(ABS_DISTANCE);
+			wacom->dev.keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE);
+ 			wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_RUBBER) | BIT(BTN_TOOL_MOUSE) | BIT(BTN_STYLUS2);
+			break;
 
-	wacom->dev.evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS) | wacom->features->evbit;
-	wacom->dev.absbit[0] |= BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_PRESSURE) | BIT(ABS_DISTANCE) | BIT(ABS_WHEEL) | wacom->features->absbit;
-	wacom->dev.relbit[0] |= wacom->features->relbit;
-	wacom->dev.keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE) | wacom->features->btnbit;
-	wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOOL_RUBBER) | BIT(BTN_TOOL_MOUSE) |
-		BIT(BTN_TOUCH) | BIT(BTN_STYLUS) | BIT(BTN_STYLUS2) | wacom->features->digibit;
+		case 2:
+			wacom->dev.evbit[0] |= BIT(EV_MSC);
+			wacom->dev.mscbit[0] |= BIT(MSC_SERIAL);
+			wacom->dev.keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE) | BIT(BTN_SIDE) | BIT(BTN_EXTRA);
+ 			wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_RUBBER) | BIT(BTN_TOOL_MOUSE)	| BIT(BTN_TOOL_BRUSH)
+							  | BIT(BTN_TOOL_PENCIL) | BIT(BTN_TOOL_AIRBRUSH) | BIT(BTN_TOOL_LENS) | BIT(BTN_STYLUS2);
+			wacom->dev.absbit[0] |= BIT(ABS_DISTANCE) | BIT(ABS_WHEEL) | BIT(ABS_TILT_X) | BIT(ABS_TILT_Y) | BIT(ABS_RZ) | BIT(ABS_THROTTLE);
+			break;
+
+		case 3:
+ 			wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_STYLUS2);
+			break;
+	}
 
 	wacom->dev.absmax[ABS_X] = wacom->features->x_max;
 	wacom->dev.absmax[ABS_Y] = wacom->features->y_max;

===================================================================

This BitKeeper patch contains the following changesets:
1.573.1.38
## Wrapped with gzip_uu ##


begin 664 bkpatch18241
M'XL(`!/=HCT``[68VW+:2!"&K]%33"4W=IG#'"4@12J`%%L5;"@)<M@D10DQ
M!*TQ>"7AD`UY]QV=L`38(&HM&P8-W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KA%\58QJ!LB)&T:OD-!K"$2Y-(R@4SHFT:D*CK"J?1NMU*(2)
MY&+5`49A,%)Q<4BKF6S4/-M+8KLD&5$:D.00>#1)WD?"<D2B.4GFYPTK(N&@
M5J)E4;[LV('L-O(_1*KN9J=@',8473^>(VT+`6<Z*&<#[<+2#92S?W9AZ?[)
MV3Z[L'3[Y.R>_;"D>W(VCTJJ*+@CZ*)QXCO#XX[D+'CY4;M1NT:P.?G4;'>O
MQ6U`[$O.XT`.VZ(\MBB'+3[>%N>(`>>(`>>)@>2PI<?;DARYD1RYD1RYD1RY
MD3RYL>-M:8[<:([<:([<:([<:)2;2AD)MGKA0*5"O(N;<,M?NF)KVHB[=C-Q
M`<Z<,2@ES3SVQ"[OV\9/[`[+_&'D^%_A=[!N@);>/Q.;Q0_:EW.P3LZ:+5,X
MI5VLD9?U$2;#SXE+</(E?=(S--,<&-H6Y9;_"BB=[LWE6:M_,U3U2_U\@PQF
M^MUN9]C3;A)8-#=H7Z4GS/Z7SL",TO)^.L$O.F=;92F]#;;+Y^"WV!S;EL<!
MJHM7!XI@:)T@X(R9RV=9.V$T_'2E[3'=6R-5-_O-F[:V8[U=BX[VOI^M13B3
M2MO0+Z\R$]>ZJG8",G@>_429C4&KI1G92HOIZ^[`U';+C:,,1BZW;M\$JF1`
M%JJ4Q3=/DA09'U%D\8UDIQ9WGIVU>_S:\H)U2Z>HJYES[7/?:+Y,80M;LRUC
M8%Z=!TD&!]AV$KW0UCL[K*9N1([;;W2T&_/)Q3M:K*E6CK2>FNCKG7ZV]<.9
M3/\;?V7>OS*Z_7Y'RRCH6R(:4L]?YGV2+/QY_,G7GG+[UEO>-9B%%:34:M)_
(`!3DF$T6````
`
end

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [patch] Input - add #include <lists.h> to input.h [10/23]
  2002-10-08 13:47               ` [patch] Input - wacom.c cleanups and fixes [9/23] Vojtech Pavlik
@ 2002-10-08 13:48                 ` Vojtech Pavlik
  2002-10-08 13:49                   ` [patch] Input - Use list_for_each_entry() in input.c [11/23] Vojtech Pavlik
  0 siblings, 1 reply; 26+ messages in thread
From: Vojtech Pavlik @ 2002-10-08 13:48 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: torvalds, linux-kernel


You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

===================================================================

ChangeSet@1.573.1.39, 2002-09-25 12:05:25+02:00, vojtech@suse.cz
  Add #include <list.h> to input.h


 input.h |   27 +++++----------------------
 1 files changed, 5 insertions(+), 22 deletions(-)

===================================================================

diff -Nru a/include/linux/input.h b/include/linux/input.h
--- a/include/linux/input.h	Tue Oct  8 15:26:35 2002
+++ b/include/linux/input.h	Tue Oct  8 15:26:35 2002
@@ -2,33 +2,16 @@
 #define _INPUT_H
 
 /*
- * $Id: input.h,v 1.68 2002/05/31 10:35:49 fsirl Exp $
+ * Copyright (c) 1999-2002 Vojtech Pavlik
  *
- *  Copyright (c) 1999-2001 Vojtech Pavlik
- */
-
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
- * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
  */
 
 #ifdef __KERNEL__
 #include <linux/time.h>
+#include <linux/list.h>
 #else
 #include <sys/time.h>
 #include <sys/ioctl.h>

===================================================================

This BitKeeper patch contains the following changesets:
1.573.1.39
## Wrapped with gzip_uu ##


begin 664 bkpatch18212
M'XL(``O=HCT``[U46T_;,!1^KG_%D7C9AIK8SKU;$0P&0T-;!6/OKG/:9"1Q
M93MEG?+CYX2.(<9`NVA)%/G8Y_*=SY_.#EP:U)/16GVV*`NR`V^5L9.1:0UZ
M\JNSSY5RME^H&OVMES^_\LMFU5KBSF?"R@+6J,UDQ+S@=L=N5C@9G;\YN3P[
M."=D.H7#0C1+O$`+TRFQ2J]%E9M]88M*-9[5HC$U6N%)57>WKAVGE+LW8DE`
MH[AC,0V33K*<,1$RS"D/TS@D6V#[6]CWXS,>,4I#'G5QF+",'`'SHB3P'-X,
M*/=IYO,(&)_0:,*C7>H6%.[EA%T&8TI>P[]%?D@D'.0Y[)2-K-H<X555&NL5
M>ZX.#"1[!7D'#C=G9/:#0S+^S8<0*BC9>P+^%H5?E4W[Q=_6O]M*%C)'8LC2
M;A'P><J#.%X@14'3^X0]ENOF0B+N<O&`AH,\'G1_6BI_@9C42A98[2N35Y[2
MR\=RI3RA-,AXUD5I%@2#A#C_23SL5^*)8,SY_U-/+YF!V0\PUM?#YR0P>YCD
M/]#2D>N8G/8_>`&':K71Y;*P\$P^!Y9EV;B'#Y]N2'`#85V55^0H`:?A4YY`
MT$=]+$H#*ZV66M3@E@N-"$8M[+70^!(VJ@4I&M"8NY9T.6\M0FE!-+FO--0J
M+Q<;M]&G:IL<-=@"P:*N#:C%8)R\OX03;%"+"F;MO"HEG)42&X/#O"I5`QR$
M`]&?F0)SF&_Z='WL<8_F8HL&CI4K(:R+\,AIP%S;=QGOJ?S.^^W\<\J25Z:M
1IU*F61KE,?D&FM2+E6P%````
`
end

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [patch] Input - Use list_for_each_entry() in input.c [11/23]
  2002-10-08 13:48                 ` [patch] Input - add #include <lists.h> to input.h [10/23] Vojtech Pavlik
@ 2002-10-08 13:49                   ` Vojtech Pavlik
  2002-10-08 13:50                     ` [patch] Input - Use lists.h in event handlers [12/23] Vojtech Pavlik
  0 siblings, 1 reply; 26+ messages in thread
From: Vojtech Pavlik @ 2002-10-08 13:49 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: torvalds, linux-kernel


You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

===================================================================

ChangeSet@1.573.1.40, 2002-09-25 12:23:16+02:00, vojtech@suse.cz
  Use list_for_each_entry() in input.c.


 input.c |   46 ++++++++++++++++++----------------------------
 1 files changed, 18 insertions(+), 28 deletions(-)

===================================================================

diff -Nru a/drivers/input/input.c b/drivers/input/input.c
--- a/drivers/input/input.c	Tue Oct  8 15:26:28 2002
+++ b/drivers/input/input.c	Tue Oct  8 15:26:28 2002
@@ -58,7 +58,7 @@
 
 void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
 {
-	struct list_head * node;
+	struct input_handle *handle;
 
 	if (dev->pm_dev)
 		pm_access(dev->pm_dev);
@@ -177,11 +177,9 @@
 	if (type != EV_SYN) 
 		dev->sync = 0;
 
-	list_for_each(node,&dev->h_list) {
-		struct input_handle *handle = to_handle(node);
+	list_for_each_entry(handle, &dev->h_list, d_node)
 		if (handle->open)
 			handle->handler->event(handle, type, code, value);
-	}
 }
 
 static void input_repeat_key(unsigned long data)
@@ -234,8 +232,8 @@
 
 static void input_link_handle(struct input_handle *handle)
 {
-	list_add_tail(&handle->d_node,&handle->dev->h_list);
-	list_add_tail(&handle->h_node,&handle->handler->h_list);
+	list_add_tail(&handle->d_node, &handle->dev->h_list);
+	list_add_tail(&handle->h_node, &handle->handler->h_list);
 }
 
 #define MATCH_BIT(bit, max) \
@@ -400,8 +398,8 @@
 
 void input_register_device(struct input_dev *dev)
 {
-	struct list_head * node;
 	struct input_handle *handle;
+	struct input_handler *handler;
 	struct input_device_id *id;
 
 	set_bit(EV_SYN, dev->evbit);
@@ -415,12 +413,10 @@
 	INIT_LIST_HEAD(&dev->h_list);
 	list_add_tail(&dev->node,&input_dev_list);
 
-	list_for_each(node,&input_handler_list) {
-		struct input_handler *handler = to_handler(node);
+	list_for_each_entry(handler, &input_handler_list, node)
 		if ((id = input_match_device(handler->id_table, dev)))
 			if ((handle = handler->connect(handler, dev, id)))
 				input_link_handle(handle);
-	}
 
 #ifdef CONFIG_HOTPLUG
 	input_call_hotplug("add", dev);
@@ -443,7 +439,7 @@
 
 	del_timer_sync(&dev->timer);
 
-	list_for_each_safe(node,next,&dev->h_list) {
+	list_for_each_safe(node, next, &dev->h_list) {
 		struct input_handle * handle = to_handle(node);
 		list_del_init(&handle->d_node);
 		list_del_init(&handle->h_node);
@@ -464,7 +460,7 @@
 
 void input_register_handler(struct input_handler *handler)
 {
-	struct list_head * node;
+	struct input_dev *dev;
 	struct input_handle *handle;
 	struct input_device_id *id;
 
@@ -477,12 +473,10 @@
 
 	list_add_tail(&handler->node,&input_handler_list);
 	
-	list_for_each(node,&input_dev_list) {
-		struct input_dev *dev = to_dev(node);
+	list_for_each_entry(dev, &input_dev_list, node)
 		if ((id = input_match_device(handler->id_table, dev)))
 			if ((handle = handler->connect(handler, dev, id)))
 				input_link_handle(handle);
-	}
 
 #ifdef CONFIG_PROC_FS
 	input_devices_state++;
@@ -494,7 +488,7 @@
 {
 	struct list_head * node, * next;
 
-	list_for_each_safe(node,next,&handler->h_list) {
+	list_for_each_safe(node, next, &handler->h_list) {
 		struct input_handle * handle = to_handle_h(node);
 		list_del_init(&handle->h_node);
 		list_del_init(&handle->d_node);
@@ -591,14 +585,13 @@
 
 static int input_devices_read(char *buf, char **start, off_t pos, int count, int *eof, void *data)
 {
-	struct list_head * node;
+	struct input_dev *dev;
+	struct input_handle *handle;
 
 	off_t at = 0;
 	int i, len, cnt = 0;
 
-	list_for_each(node,&input_dev_list) {
-		struct input_dev * dev = to_dev(node);
-		struct list_head * hnode;
+	list_for_each_entry(dev, &input_dev_list, node) {
 
 		len = sprintf(buf, "I: Bus=%04x Vendor=%04x Product=%04x Version=%04x\n",
 			dev->id.bustype, dev->id.vendor, dev->id.product, dev->id.version);
@@ -607,10 +600,8 @@
 		len += sprintf(buf + len, "P: Phys=%s\n", dev->phys ? dev->phys : "");
 		len += sprintf(buf + len, "H: Handlers=");
 
-		list_for_each(hnode,&dev->h_list) {
-			struct input_handle * handle = to_handle(hnode);
+		list_for_each_entry(handle, &dev->h_list, d_node)
 			len += sprintf(buf + len, "%s ", handle->name);
-		}
 
 		len += sprintf(buf + len, "\n");
 
@@ -638,7 +629,7 @@
 		}
 	}
 
-	if (node == &input_dev_list)
+	if (&dev->node == &input_dev_list)
 		*eof = 1;
 
 	return (count > cnt) ? cnt : count;
@@ -646,14 +637,13 @@
 
 static int input_handlers_read(char *buf, char **start, off_t pos, int count, int *eof, void *data)
 {
-	struct list_head * node;
+	struct input_handler *handler;
 
 	off_t at = 0;
 	int len = 0, cnt = 0;
 	int i = 0;
 
-	list_for_each(node,&input_handler_list) {
-		struct input_handler *handler = to_handler(node);
+	list_for_each_entry(handler, &input_handler_list, node) {
 
 		if (handler->fops)
 			len = sprintf(buf, "N: Number=%d Name=%s Minor=%d\n",
@@ -674,7 +664,7 @@
 				break;
 		}
 	}
-	if (node == &input_handler_list)
+	if (&handler->node == &input_handler_list)
 		*eof = 1;
 
 	return (count > cnt) ? cnt : count;

===================================================================

This BitKeeper patch contains the following changesets:
1.573.1.40
## Wrapped with gzip_uu ##


begin 664 bkpatch18183
M'XL(``3=HCT``[U676_:,!1]QK_"4J4*VA)LQ\X'%56W,FUHDU9UZC,RL6FR
MT@0YAJY;?OQLA]&20>FZ:8!R27SO\3GW'D@.X'4I5;^U++YJF:3@`'XH2MUO
ME8M2>LEW<WY5%.:\EQ9WLK?*ZDUN>UD^7VA@UB^Y3E*XE*KLM[#GKZ_HA[GL
MMZ[>O;_^].8*@,$`7J0\OY%?I(:#`="%6O*9*,^Y3F=%[FG%\_).:NXEQ5VU
M3JT(0L2\&0Y]Q((*!XB&58(%QIQB*1"A44#!BMCYBG:S/B8,(\0(JP(:$@R&
M$'LL]#WL4001Z:&X1QC$I$_\/@Z.$>DC!!N8\!C#+@)OX;]E?@$2.P(XRTH]
MGA9J+'F2CF6NU4.[`[,<ND9[B0<^PH#B$('+QT:"[A^^`$`<@;,]&H3*[#SK
M&?=6!)[HH2:83@8QJXB(?"+$-!01PG**FUU[#LM-A?B85(A$F#B/;$W?[Y>_
M8`PF*5<&=Y+=S(M<>+G4'E\\RQL3%%+*:(5#'`7.383\YB.RTT<1[)+HOSNI
MU)(+6$PW$\S2?2J5A'P^GV4)G\RDP3&KL$P+I:6"22&D=9^;T6?85??N8\QT
MN7U<KW#E,,`0@Y$[MDJM%HFNC3\V31`S"8_J>`J&.$*0@!&.7.XVL77J"3P4
M<MD]2\<VYP2*<6Z$="P`-95#XH<6A_B1"34.%V*L>39K']80W;.ZR$"M+SQ"
M=DYWEJ7-LCJJ)Z5#BGPKF2*Z0[/Z)5K9;&QICBB.GU>MS*8;("OU*^V4V$V'
ME`9N;Q<::"6?RG9-/Y??]&8;._"'J0Y"5^W")G.3"H_,P3*NYT1WS\GDK=F:
M[PVF$7-,XWHO%_8R;;;9LF6Q;?#(!K*3[1[/L3B&OK$G>HT62R+`KAD!=@"O
M<6V`W>3,+<#]4%QH95/8KO-MEOF;;%*PA32N*^*7^"Q@S!%E6YSQ8I\YQ:$;
F7!UJHNOI-,@^1>@\/E(DJ4QNR\7=@,632329<O`3$@/Z@:T(````
`
end

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [patch] Input - Use lists.h in event handlers [12/23]
  2002-10-08 13:49                   ` [patch] Input - Use list_for_each_entry() in input.c [11/23] Vojtech Pavlik
@ 2002-10-08 13:50                     ` Vojtech Pavlik
  2002-10-08 13:50                       ` [patch] Fixes/cleanups after lists.h conversion [13/23] Vojtech Pavlik
  0 siblings, 1 reply; 26+ messages in thread
From: Vojtech Pavlik @ 2002-10-08 13:50 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: torvalds, linux-kernel


You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

===================================================================

ChangeSet@1.573.1.42, 2002-09-25 17:05:02+02:00, vojtech@suse.cz
  Convert more of input to list.h usage.


 evdev.c               |  104 ++++++++++++--------------------------------------
 gameport/emu10k1-gp.c |    1 
 gameport/ns558.c      |   52 ++++++++++---------------
 joydev.c              |   91 +++++++++++--------------------------------
 mousedev.c            |   97 ++++++++++++----------------------------------
 tsdev.c               |  103 ++++++++++++++-----------------------------------
 6 files changed, 130 insertions(+), 318 deletions(-)

===================================================================

diff -Nru a/drivers/input/evdev.c b/drivers/input/evdev.c
--- a/drivers/input/evdev.c	Tue Oct  8 15:26:21 2002
+++ b/drivers/input/evdev.c	Tue Oct  8 15:26:21 2002
@@ -1,29 +1,11 @@
 /*
- * $Id: evdev.c,v 1.48 2002/05/26 14:28:26 jdeneux Exp $
+ * Event char devices, giving access to raw input device events.
  *
- *  Copyright (c) 1999-2001 Vojtech Pavlik
+ * Copyright (c) 1999-2002 Vojtech Pavlik
  *
- *  Event char devices, giving access to raw input device events.
- */
-
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
- * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
  */
 
 #define EVDEV_MINOR_BASE	64
@@ -38,7 +20,7 @@
 #include <linux/smp_lock.h>
 #include <linux/device.h>
 
-struct evdev {
+struct evdev{
 	int exist;
 	int open;
 	int minor;
@@ -46,7 +28,7 @@
 	struct input_handle handle;
 	wait_queue_head_t wait;
 	devfs_handle_t devfs;
-	struct evdev_list *list;
+	struct list_head list;
 };
 
 struct evdev_list {
@@ -55,17 +37,17 @@
 	int tail;
 	struct fasync_struct *fasync;
 	struct evdev *evdev;
-	struct evdev_list *next;
+	struct list_head node;
 };
 
-static struct evdev *evdev_table[EVDEV_MINORS] = { NULL, /* ... */ };
+static struct evdev *evdev_table[EVDEV_MINORS];
 
 static void evdev_event(struct input_handle *handle, unsigned int type, unsigned int code, int value)
 {
 	struct evdev *evdev = handle->private;
-	struct evdev_list *list = evdev->list;
+	struct evdev_list *list;
 
-	while (list) {
+	list_for_each_entry(list, &evdev->list, node) {
 
 		do_gettimeofday(&list->buffer[list->head].time);
 		list->buffer[list->head].type = type;
@@ -74,8 +56,6 @@
 		list->head = (list->head + 1) & (EVDEV_BUFFER_SIZE - 1);
 
 		kill_fasync(&list->fasync, SIGIO, POLL_IN);
-
-		list = list->next;
 	}
 
 	wake_up_interruptible(&evdev->wait);
@@ -91,7 +71,7 @@
 
 static int evdev_flush(struct file * file)
 {
-	struct evdev_list *list = (struct evdev_list*)file->private_data;
+	struct evdev_list *list = file->private_data;
 	if (!list->evdev->exist) return -ENODEV;
 	return input_flush_device(&list->evdev->handle, file);
 }
@@ -99,14 +79,9 @@
 static int evdev_release(struct inode * inode, struct file * file)
 {
 	struct evdev_list *list = file->private_data;
-	struct evdev_list **listptr;
 
-	listptr = &list->evdev->list;
 	evdev_fasync(-1, file, 0);
-
-	while (*listptr && (*listptr != list))
-		listptr = &((*listptr)->next);
-	*listptr = (*listptr)->next;
+	list_del(&list->node);
 
 	if (!--list->evdev->open) {
 		if (list->evdev->exist) {
@@ -132,19 +107,15 @@
 	if (i >= EVDEV_MINORS || !evdev_table[i])
 		return -ENODEV;
 
-	/* Ask the driver if he wishes to accept the open() */
-	if ((accept_err = input_accept_process(&(evdev_table[i]->handle), file))) {
+	if ((accept_err = input_accept_process(&(evdev_table[i]->handle), file)))
 		return accept_err;
-	}
 
 	if (!(list = kmalloc(sizeof(struct evdev_list), GFP_KERNEL)))
 		return -ENOMEM;
 	memset(list, 0, sizeof(struct evdev_list));
 
 	list->evdev = evdev_table[i];
-	list->next = evdev_table[i]->list;
-	evdev_table[i]->list = list;
-
+	list_add_tail(&list->node, &evdev_table[i]->list);
 	file->private_data = list;
 
 	if (!list->evdev->open++)
@@ -175,40 +146,21 @@
 
 static ssize_t evdev_read(struct file * file, char * buffer, size_t count, loff_t *ppos)
 {
-	DECLARE_WAITQUEUE(wait, current);
 	struct evdev_list *list = file->private_data;
-	int retval = 0;
-
-	if (list->head == list->tail) {
-
-		add_wait_queue(&list->evdev->wait, &wait);
-		set_current_state(TASK_INTERRUPTIBLE);
-
-		while (list->head == list->tail) {
-
-			if (!list->evdev->exist) {
-				retval = -ENODEV;
-				break;
-			}
-			if (file->f_flags & O_NONBLOCK) {
-				retval = -EAGAIN;
-				break;
-			}
-			if (signal_pending(current)) {
-				retval = -ERESTARTSYS;
-				break;
-			}
+	int retval;
 
-			schedule();
-		}
+	if (list->head == list->tail && list->evdev->exist && (file->f_flags & O_NONBLOCK))
+		return -EAGAIN;
 
-		set_current_state(TASK_RUNNING);
-		remove_wait_queue(&list->evdev->wait, &wait);
-	}
+	retval = wait_event_interruptible(list->evdev->wait,
+		list->head != list->tail && list->evdev->exist);
 
 	if (retval)
 		return retval;
 
+	if (!list->evdev->exist)
+		return -ENODEV;
+
 	while (list->head != list->tail && retval + sizeof(struct input_event) <= count) {
 		if (copy_to_user(buffer + retval, list->buffer + list->tail,
 			 sizeof(struct input_event))) return -EFAULT;
@@ -433,21 +385,19 @@
 		return NULL;
 	memset(evdev, 0, sizeof(struct evdev));
 
+	INIT_LIST_HEAD(&evdev->list);
 	init_waitqueue_head(&evdev->wait);
 
+	evdev->exist = 1;
 	evdev->minor = minor;
-	evdev_table[minor] = evdev;
-	
-	sprintf(evdev->name, "event%d", minor);
-
 	evdev->handle.dev = dev;
 	evdev->handle.name = evdev->name;
 	evdev->handle.handler = handler;
 	evdev->handle.private = evdev;
+	sprintf(evdev->name, "event%d", minor);
 
+	evdev_table[minor] = evdev;
 	evdev->devfs = input_register_minor("event%d", minor, EVDEV_MINOR_BASE);
-
-	evdev->exist = 1;
 
 	return &evdev->handle;
 }
diff -Nru a/drivers/input/gameport/emu10k1-gp.c b/drivers/input/gameport/emu10k1-gp.c
--- a/drivers/input/gameport/emu10k1-gp.c	Tue Oct  8 15:26:21 2002
+++ b/drivers/input/gameport/emu10k1-gp.c	Tue Oct  8 15:26:21 2002
@@ -44,7 +44,6 @@
 
 struct emu {
 	struct pci_dev *dev;
-	struct emu *next;
 	struct gameport gameport;
 	int size;
 	char phys[32];
diff -Nru a/drivers/input/gameport/ns558.c b/drivers/input/gameport/ns558.c
--- a/drivers/input/gameport/ns558.c	Tue Oct  8 15:26:21 2002
+++ b/drivers/input/gameport/ns558.c	Tue Oct  8 15:26:21 2002
@@ -53,13 +53,13 @@
 	int type;
 	int size;
 	struct pci_dev *dev;
-	struct ns558 *next;
+	struct list_head node;
 	struct gameport gameport;
 	char phys[32];
 	char name[32];
 };
 	
-static struct ns558 *ns558;
+static LIST_HEAD(ns558_list);
 
 /*
  * ns558_isa_probe() tries to find an isa gameport at the
@@ -67,7 +67,7 @@
  * A joystick must be attached for this to work.
  */
 
-static struct ns558* ns558_isa_probe(int io, struct ns558 *next)
+static void ns558_isa_probe(int io)
 {
 	int i, j, b;
 	unsigned char c, u, v;
@@ -78,7 +78,7 @@
  */
 
 	if (check_region(io, 1))
-		return next;
+		return;
 
 /*
  * We must not be able to write arbitrary values to the port.
@@ -89,7 +89,7 @@
 	outb(~c & ~3, io);
 	if (~(u = v = inb(io)) & 3) {
 		outb(c, io);
-		return next;
+		return;
 	}
 /*
  * After a trigger, there must be at least some bits changing.
@@ -99,7 +99,7 @@
 
 	if (u == v) {
 		outb(c, io);
-		return next;
+		return;
 	}
 	wait_ms(3);
 /*
@@ -110,7 +110,7 @@
 	for (i = 0; i < 1000; i++)
 		if ((u ^ inb(io)) & 0xf) {
 			outb(c, io);
-			return next;
+			return;
 		}
 /* 
  * And now find the number of mirrors of the port.
@@ -134,11 +134,10 @@
 
 	if (!(port = kmalloc(sizeof(struct ns558), GFP_KERNEL))) {
 		printk(KERN_ERR "ns558: Memory allocation failed.\n");
-		return next;
+		return;
 	}
        	memset(port, 0, sizeof(struct ns558));
 	
-	port->next = next;
 	port->type = NS558_ISA;
 	port->size = (1 << i);
 	port->gameport.io = io & (-1 << i);
@@ -157,7 +156,7 @@
 	if (port->size > 1) printk(" size %d", port->size);
 	printk(" speed %d kHz\n", port->gameport.speed);
 
-	return port;
+	list_add(&port->node, &ns558_list);
 }
 
 #ifdef __ISAPNP__
@@ -194,22 +193,22 @@
 
 MODULE_DEVICE_TABLE(isapnp, pnp_devids);
 
-static struct ns558* ns558_pnp_probe(struct pci_dev *dev, struct ns558 *next)
+static void ns558_pnp_probe(struct pci_dev *dev)
 {
 	int ioport, iolen;
 	struct ns558 *port;
 
 	if (dev->prepare && dev->prepare(dev) < 0)
-		return next;
+		return;
 
 	if (!(dev->resource[0].flags & IORESOURCE_IO)) {
 		printk(KERN_WARNING "ns558: No i/o ports on a gameport? Weird\n");
-		return next;
+		return;
 	}
 
 	if (dev->activate && dev->activate(dev) < 0) {
 		printk(KERN_ERR "ns558: PnP resource allocation failed\n");
-		return next;
+		return;
 	}
 	
 	ioport = pci_resource_start(dev, 0);
@@ -224,7 +223,6 @@
 	}
 	memset(port, 0, sizeof(struct ns558));
 
-	port->next = next;
 	port->type = NS558_PNP;
 	port->size = iolen;
 	port->dev = dev;
@@ -247,12 +245,12 @@
 	if (iolen > 1) printk(" size %d", iolen);
 	printk(" speed %d kHz\n", port->gameport.speed);
 
-	return port;
+	list_add_tail(&port->node, &ns558_list);
+	return;
 
 deactivate:
 	if (dev->deactivate)
 		dev->deactivate(dev);
-	return next;
 }
 #endif
 
@@ -269,28 +267,26 @@
  */
 
 	while (ns558_isa_portlist[i]) 
-		ns558 = ns558_isa_probe(ns558_isa_portlist[i++], ns558);
+		ns558_isa_probe(ns558_isa_portlist[i++]);
 
 /*
  * Probe for PnP ports.
  */
 
 #ifdef __ISAPNP__
-	for (devid = pnp_devids; devid->vendor; devid++) {
-		while ((dev = isapnp_find_dev(NULL, devid->vendor, devid->function, dev))) {
-			ns558 = ns558_pnp_probe(dev, ns558);
-		}
-	}
+	for (devid = pnp_devids; devid->vendor; devid++)
+		while ((dev = isapnp_find_dev(NULL, devid->vendor, devid->function, dev)))
+			ns558_pnp_probe(dev);
 #endif
 
-	return ns558 ? 0 : -ENODEV;
+	return list_empty(&ns558_list) ? -ENODEV : 0;
 }
 
 void __exit ns558_exit(void)
 {
-	struct ns558 *next, *port = ns558;
+	struct ns558 *port;
 
-	while (port) {
+	list_for_each_entry(port, &ns558_list, node) {
 		gameport_unregister_port(&port->gameport);
 		switch (port->type) {
 
@@ -308,10 +304,6 @@
 			default:
 				break;
 		}
-		
-		next = port->next;
-		kfree(port);
-		port = next;
 	}
 }
 
diff -Nru a/drivers/input/joydev.c b/drivers/input/joydev.c
--- a/drivers/input/joydev.c	Tue Oct  8 15:26:21 2002
+++ b/drivers/input/joydev.c	Tue Oct  8 15:26:21 2002
@@ -1,30 +1,13 @@
 /*
- * $Id: joydev.c,v 1.43 2002/04/09 23:59:01 jsimmons Exp $
+ * Joystick device driver for the input driver suite.
  *
- *  Copyright (c) 1999-2001 Vojtech Pavlik 
- *  Copyright (c) 1999 Colin Van Dyke 
+ * Copyright (c) 1999-2002 Vojtech Pavlik 
+ * Copyright (c) 1999 Colin Van Dyke 
  *
- *  Joystick device driver for the input driver suite.
- */
-
-/*
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or 
  * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
- * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
  */
 
 #include <asm/io.h>
@@ -63,8 +46,7 @@
 	struct input_handle handle;
 	wait_queue_head_t wait;
 	devfs_handle_t devfs;
-	struct joydev *next;
-	struct joydev_list *list;
+	struct list_head list;
 	struct js_corr corr[ABS_MAX];
 	struct JS_DATA_SAVE_TYPE glue;
 	int nabs;
@@ -83,7 +65,7 @@
 	int startup;
 	struct fasync_struct *fasync;
 	struct joydev *joydev;
-	struct joydev_list *next;
+	struct list_head node;
 };
 
 static struct joydev *joydev_table[JOYDEV_MINORS];
@@ -111,7 +93,7 @@
 static void joydev_event(struct input_handle *handle, unsigned int type, unsigned int code, int value)
 {
 	struct joydev *joydev = handle->private;
-	struct joydev_list *list = joydev->list;
+	struct joydev_list *list;
 	struct js_event event;
 
 	switch (type) {
@@ -137,7 +119,7 @@
 
 	event.time = MSECS(jiffies);
 
-	while (list) {
+	list_for_each_entry(list, &joydev->list, node) {
 
 		memcpy(list->buffer + list->head, &event, sizeof(struct js_event));
 
@@ -146,8 +128,6 @@
 				list->startup = 0;
 
 		kill_fasync(&list->fasync, SIGIO, POLL_IN);
-
-		list = list->next;
 	}
 
 	wake_up_interruptible(&joydev->wait);
@@ -164,14 +144,10 @@
 static int joydev_release(struct inode * inode, struct file * file)
 {
 	struct joydev_list *list = file->private_data;
-	struct joydev_list **listptr;
 
-	listptr = &list->joydev->list;
 	joydev_fasync(-1, file, 0);
 
-	while (*listptr && (*listptr != list))
-		listptr = &((*listptr)->next);
-	*listptr = (*listptr)->next;
+	list_del(&list->node);
 
 	if (!--list->joydev->open) {
 		if (list->joydev->exist) {
@@ -201,9 +177,7 @@
 	memset(list, 0, sizeof(struct joydev_list));
 
 	list->joydev = joydev_table[i];
-	list->next = joydev_table[i]->list;
-	joydev_table[i]->list = list;	
-
+	list_add_tail(&list->node, &joydev_table[i]->list);
 	file->private_data = list;
 
 	if (!list->joydev->open++)
@@ -220,12 +194,14 @@
 
 static ssize_t joydev_read(struct file *file, char *buf, size_t count, loff_t *ppos)
 {
-	DECLARE_WAITQUEUE(wait, current);
 	struct joydev_list *list = file->private_data;
 	struct joydev *joydev = list->joydev;
 	struct input_dev *input = joydev->handle.dev;
 	int retval = 0;
 
+	if (!list->joydev->exist)
+		return -ENODEV;
+
 	if (count < sizeof(struct js_event))
 		return -EINVAL;
 
@@ -248,36 +224,19 @@
 		return sizeof(struct JS_DATA_TYPE);
 	}
 
-	if (list->head == list->tail && list->startup == joydev->nabs + joydev->nkey) {
-
-		add_wait_queue(&list->joydev->wait, &wait);
-		set_current_state(TASK_INTERRUPTIBLE);
-
-		while (list->head == list->tail) {
-
-			if (!joydev->exist) {
-				retval = -ENODEV;
-				break;
-			}
-			if (file->f_flags & O_NONBLOCK) {
-				retval = -EAGAIN;
-				break;
-			}
-			if (signal_pending(current)) {
-				retval = -ERESTARTSYS;
-				break;
-			}
-
-			schedule();
-		}
+	if (list->startup == joydev->nabs + joydev->nkey
+		&& list->head == list->tail && (file->f_flags & O_NONBLOCK))
+			return -EAGAIN;
 
-		set_current_state(TASK_RUNNING);
-		remove_wait_queue(&list->joydev->wait, &wait);
-	}
+	retval = wait_event_interruptible(list->joydev->wait, list->joydev->exist
+		&& (list->startup < joydev->nabs + joydev->nkey || list->head != list->tail));
 
 	if (retval)
 		return retval;
 
+	if (!list->joydev->exist)
+		return -ENODEV;
+
 	while (list->startup < joydev->nabs + joydev->nkey && retval + sizeof(struct js_event) <= count) {
 
 		struct js_event event;
@@ -431,17 +390,16 @@
 		return NULL;
 	memset(joydev, 0, sizeof(struct joydev));
 
+	INIT_LIST_HEAD(&joydev->list);
 	init_waitqueue_head(&joydev->wait);
 
 	joydev->minor = minor;
-	joydev_table[minor] = joydev;
-
-	sprintf(joydev->name, "js%d", minor);
-
+	joydev->exist = 1;
 	joydev->handle.dev = dev;
 	joydev->handle.name = joydev->name;
 	joydev->handle.handler = handler;
 	joydev->handle.private = joydev;
+	sprintf(joydev->name, "js%d", minor);
 
 	for (i = 0; i < ABS_MAX; i++)
 		if (test_bit(i, dev->absbit)) {
@@ -482,9 +440,8 @@
 		joydev->abs[i] = joydev_correct(dev->abs[j], joydev->corr + i);
 	}
 
+	joydev_table[minor] = joydev;
 	joydev->devfs = input_register_minor("js%d", minor, JOYDEV_MINOR_BASE);
-
-	joydev->exist = 1;
 
 	return &joydev->handle;
 }
diff -Nru a/drivers/input/mousedev.c b/drivers/input/mousedev.c
--- a/drivers/input/mousedev.c	Tue Oct  8 15:26:21 2002
+++ b/drivers/input/mousedev.c	Tue Oct  8 15:26:21 2002
@@ -1,29 +1,11 @@
 /*
- * $Id: mousedev.c,v 1.42 2002/04/09 20:51:26 jdeneux Exp $
+ * Input driver to ExplorerPS/2 device driver module.
  *
- *  Copyright (c) 1999-2001 Vojtech Pavlik
+ * Copyright (c) 1999-2002 Vojtech Pavlik
  *
- *  Input driver to ExplorerPS/2 device driver module.
- */
-
-/*
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or 
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
- * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
+ * it under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
  */
 
 #define MOUSEDEV_MINOR_BASE 	32
@@ -61,7 +43,7 @@
 	int minor;
 	char name[16];
 	wait_queue_head_t wait;
-	struct mousedev_list *list;
+	struct list_head list;
 	struct input_handle handle;
 	devfs_handle_t devfs;
 };
@@ -69,7 +51,7 @@
 struct mousedev_list {
 	struct fasync_struct *fasync;
 	struct mousedev *mousedev;
-	struct mousedev_list *next;
+	struct list_head node;
 	int dx, dy, dz, oldx, oldy;
 	signed char ps2[6];
 	unsigned long buttons;
@@ -98,9 +80,10 @@
 	int index, size, wake;
 
 	while (*mousedev) {
+
 		wake = 0;
-		list = (*mousedev)->list;
-		while (list) {
+
+		list_for_each_entry(list, &(*mousedev)->list, node)
 			switch (type) {
 				case EV_ABS:
 					if (test_bit(BTN_TRIGGER, handle->dev->keybit))
@@ -116,6 +99,7 @@
 								list->oldx += list->dx;
 							}
 							break;
+
 						case ABS_Y:
 							size = handle->dev->absmax[ABS_Y] - handle->dev->absmin[ABS_Y];
 							if (size != 0) {
@@ -170,10 +154,10 @@
 							break;
 					}
 			}
-			list = list->next;
-		}
+
 		if (wake)
 			wake_up_interruptible(&((*mousedev)->wait));
+
 		mousedev++;
 	}
 }
@@ -189,21 +173,17 @@
 static int mousedev_release(struct inode * inode, struct file * file)
 {
 	struct mousedev_list *list = file->private_data;
-	struct mousedev_list **listptr;
+	struct input_handle *handle;
+	struct mousedev *mousedev;
 
-	listptr = &list->mousedev->list;
 	mousedev_fasync(-1, file, 0);
 
-	while (*listptr && (*listptr != list))
-		listptr = &((*listptr)->next);
-	*listptr = (*listptr)->next;
+	list_del(&list->node);
 
 	if (!--list->mousedev->open) {
 		if (list->mousedev->minor == MOUSEDEV_MIX) {
-			struct list_head * node;
-			list_for_each(node,&mousedev_handler.h_list) {
-				struct input_handle *handle = to_handle_h(node);
-				struct mousedev *mousedev = handle->private;
+			list_for_each_entry(handle, &mousedev_handler.h_list, h_node) {
+				mousedev = handle->private;
 				if (!mousedev->open) {
 					if (mousedev->exist) {
 						input_close_device(&mousedev->handle);
@@ -252,8 +232,7 @@
 	memset(list, 0, sizeof(struct mousedev_list));
 
 	list->mousedev = mousedev_table[i];
-	list->next = mousedev_table[i]->list;
-	mousedev_table[i]->list = list;
+	list_add_tail(&list->node, &mousedev_table[i]->list);
 	file->private_data = list;
 
 	if (!list->mousedev->open++) {
@@ -373,35 +352,13 @@
 
 static ssize_t mousedev_read(struct file * file, char * buffer, size_t count, loff_t *ppos)
 {
-	DECLARE_WAITQUEUE(wait, current);
 	struct mousedev_list *list = file->private_data;
 	int retval = 0;
 
-	if (!list->ready && !list->buffer) {
-
-		add_wait_queue(&list->mousedev->wait, &wait);
-
-		for (;;) {
-			set_current_state(TASK_INTERRUPTIBLE);
-
-			retval = 0;
-			if (list->ready || list->buffer)
-				break;
-
-			retval = -EAGAIN;
-			if (file->f_flags & O_NONBLOCK)
-				break;
+	if (!list->ready && !list->buffer && (file->f_flags & O_NONBLOCK))
+		return -EAGAIN;
 
-			retval = -ERESTARTSYS;
-			if (signal_pending(current))
-				break;
-
-			schedule();
-		}
-
-		set_current_state(TASK_RUNNING);
-		remove_wait_queue(&list->mousedev->wait, &wait);
-	}
+	retval = wait_event_interruptible(list->mousedev->wait, list->ready || list->buffer);
 
 	if (retval)
 		return retval;
@@ -454,23 +411,23 @@
 	if (!(mousedev = kmalloc(sizeof(struct mousedev), GFP_KERNEL)))
 		return NULL;
 	memset(mousedev, 0, sizeof(struct mousedev));
+
+	INIT_LIST_HEAD(&mousedev->list);
 	init_waitqueue_head(&mousedev->wait);
 
 	mousedev->minor = minor;
-	mousedev_table[minor] = mousedev;
-	sprintf(mousedev->name, "mouse%d", minor);
-
+	mousedev->exist = 1;
 	mousedev->handle.dev = dev;
 	mousedev->handle.name = mousedev->name;
 	mousedev->handle.handler = handler;
 	mousedev->handle.private = mousedev;
-
-	mousedev->devfs = input_register_minor("mouse%d", minor, MOUSEDEV_MINOR_BASE);
+	sprintf(mousedev->name, "mouse%d", minor);
 
 	if (mousedev_mix.open)
 		input_open_device(&mousedev->handle);
 
-	mousedev->exist = 1;
+	mousedev_table[minor] = mousedev;
+	mousedev->devfs = input_register_minor("mouse%d", minor, MOUSEDEV_MINOR_BASE);
 
 	return &mousedev->handle;
 }
diff -Nru a/drivers/input/tsdev.c b/drivers/input/tsdev.c
--- a/drivers/input/tsdev.c	Tue Oct  8 15:26:21 2002
+++ b/drivers/input/tsdev.c	Tue Oct  8 15:26:21 2002
@@ -55,7 +55,7 @@
 	int minor;
 	char name[16];
 	wait_queue_head_t wait;
-	struct tsdev_list *list;
+	struct list_head list;
 	struct input_handle handle;
 	devfs_handle_t devfs;
 };
@@ -70,7 +70,7 @@
 
 struct tsdev_list {
 	struct fasync_struct *fasync;
-	struct tsdev_list *next;
+	struct list_head node;
 	struct tsdev *tsdev;
 	int head, tail;
 	int oldx, oldy, pendown;
@@ -106,8 +106,7 @@
 	memset(list, 0, sizeof(struct tsdev_list));
 
 	list->tsdev = tsdev_table[i];
-	list->next = tsdev_table[i]->list;
-	tsdev_table[i]->list = list;
+	list_add_tail(&list->node, &tsdev_table[i]->list);
 	file->private_data = list;
 
 	if (!list->tsdev->open++)
@@ -119,14 +118,9 @@
 static int tsdev_release(struct inode *inode, struct file *file)
 {
 	struct tsdev_list *list = file->private_data;
-	struct tsdev_list **listptr;
 
-	listptr = &list->tsdev->list;
 	tsdev_fasync(-1, file, 0);
-
-	while (*listptr && (*listptr != list))
-		listptr = &((*listptr)->next);
-	*listptr = (*listptr)->next;
+	list_del(&list->node);
 
 	if (!--list->tsdev->open) {
 		if (list->tsdev->exist) {
@@ -144,45 +138,28 @@
 static ssize_t tsdev_read(struct file *file, char *buffer, size_t count,
 			  loff_t * ppos)
 {
-	DECLARE_WAITQUEUE(wait, current);
 	struct tsdev_list *list = file->private_data;
 	int retval = 0;
 
-	if (list->head == list->tail) {
-		add_wait_queue(&list->tsdev->wait, &wait);
-		set_current_state(TASK_INTERRUPTIBLE);
-
-		while (list->head == list->tail) {
-			if (!list->tsdev->exist) {
-				retval = -ENODEV;
-				break;
-			}
-			if (file->f_flags & O_NONBLOCK) {
-				retval = -EAGAIN;
-				break;
-			}
-			if (signal_pending(current)) {
-				retval = -ERESTARTSYS;
-				break;
-			}
-			schedule();
-		}
-		set_current_state(TASK_RUNNING);
-		remove_wait_queue(&list->tsdev->wait, &wait);
-	}
+	if (list->head == list->tail && list->tsdev->exist && (file->f_flags & O_NONBLOCK))
+		return -EAGAIN;
+
+	retval = wait_event_interruptible(list->tsdev->wait,
+		(list->head != list->tail) && list->tsdev->exist);
 
 	if (retval)
 		return retval;
 
-	while (list->head != list->tail
-	       && retval + sizeof(TS_EVENT) <= count) {
-		if (copy_to_user
-		    (buffer + retval, list->event + list->tail,
-		     sizeof(TS_EVENT)))
+	if (!list->tsdev->exist)
+		return -ENODEV;
+
+	while (list->head != list->tail && retval + sizeof(TS_EVENT) <= count) {
+		if (copy_to_user (buffer + retval, list->event + list->tail, sizeof(TS_EVENT)))
 			return -EFAULT;
 		list->tail = (list->tail + 1) & (TSDEV_BUFFER_SIZE - 1);
 		retval += sizeof(TS_EVENT);
 	}
+
 	return retval;
 }
 
@@ -232,54 +209,35 @@
 			unsigned int code, int value)
 {
 	struct tsdev *tsdev = handle->private;
-	struct tsdev_list *list = tsdev->list;
+	struct tsdev_list *list;
 	struct timeval time;
 	int size;
 
-	while (list) {
+	list_for_each_entry(list, &tsdev->list, node) {
 		switch (type) {
 		case EV_ABS:
 			switch (code) {
 			case ABS_X:
 				if (!list->pendown)
 					return;
-
-				size =
-				    handle->dev->absmax[ABS_X] -
-				    handle->dev->absmin[ABS_X];
+				size = handle->dev->absmax[ABS_X] - handle->dev->absmin[ABS_X];
 				if (size > 0)
-					list->oldx =
-					    ((value -
-					      handle->dev->absmin[ABS_X]) *
-					     xres / size);
+					list->oldx = ((value - handle->dev->absmin[ABS_X]) * xres / size);
 				else
-					list->oldx =
-					    ((value -
-					      handle->dev->absmin[ABS_X]));
+					list->oldx = ((value - handle->dev->absmin[ABS_X]));
 				break;
 			case ABS_Y:
 				if (!list->pendown)
 					return;
-
-				size =
-				    handle->dev->absmax[ABS_Y] -
-				    handle->dev->absmin[ABS_Y];
+				size = handle->dev->absmax[ABS_Y] - handle->dev->absmin[ABS_Y];
 				if (size > 0)
-					list->oldy =
-					    ((value -
-					      handle->dev->absmin[ABS_Y]) *
-					     yres / size);
+					list->oldy = ((value - handle->dev->absmin[ABS_Y]) * yres / size);
 				else
-					list->oldy =
-					    ((value -
-					      handle->dev->absmin[ABS_Y]));
+					list->oldy = ((value - handle->dev->absmin[ABS_Y]));
 				break;
 			case ABS_PRESSURE:
-				list->pendown =
-				    ((value >
-				      handle->dev->
-				      absmin[ABS_PRESSURE])) ? value -
-				    handle->dev->absmin[ABS_PRESSURE] : 0;
+				list->pendown = ((value > handle->dev-> absmin[ABS_PRESSURE])) ?
+				    value - handle->dev->absmin[ABS_PRESSURE] : 0;
 				break;
 			}
 			break;
@@ -289,7 +247,6 @@
 			case REL_X:
 				if (!list->pendown)
 					return;
-
 				list->oldx += value;
 				if (list->oldx < 0)
 					list->oldx = 0;
@@ -299,7 +256,6 @@
 			case REL_Y:
 				if (!list->pendown)
 					return;
-
 				list->oldy += value;
 				if (list->oldy < 0)
 					list->oldy = 0;
@@ -333,7 +289,6 @@
 		list->event[list->head].y = list->oldy;
 		list->head = (list->head + 1) & (TSDEV_BUFFER_SIZE - 1);
 		kill_fasync(&list->fasync, SIGIO, POLL_IN);
-		list = list->next;
 	}
 	wake_up_interruptible(&tsdev->wait);
 }
@@ -356,21 +311,23 @@
 	if (!(tsdev = kmalloc(sizeof(struct tsdev), GFP_KERNEL)))
 		return NULL;
 	memset(tsdev, 0, sizeof(struct tsdev));
+
+	INIT_LIST_HEAD(&tsdev->list);
 	init_waitqueue_head(&tsdev->wait);
 
-	tsdev->minor = minor;
-	tsdev_table[minor] = tsdev;
 	sprintf(tsdev->name, "ts%d", minor);
 
+	tsdev->exist = 1;
+	tsdev->minor = minor;
 	tsdev->handle.dev = dev;
 	tsdev->handle.name = tsdev->name;
 	tsdev->handle.handler = handler;
 	tsdev->handle.private = tsdev;
 
+	tsdev_table[minor] = tsdev;
 	tsdev->devfs =
 	    input_register_minor("ts%d", minor, TSDEV_MINOR_BASE);
 
-	tsdev->exist = 1;
 
 	return &tsdev->handle;
 }

===================================================================

This BitKeeper patch contains the following changesets:
1.573.1.42
## Wrapped with gzip_uu ##


begin 664 bkpatch18154
M'XL(`/W<HCT``[U:_7/:1A/^&?Z*2SNO!VR#=:?3EUV[30)-_3:U,W&2>3M-
MAA'2852#Q$C"#BU__+N[)T!@PH?3QNGHD'2WM[NW]SR[IW[/WF<J/:W<)W_F
M*NA7OV>_)%E^6LG&F6H&?\']VR2!^Y-^,E0G1:^3[MU)%(_&>17>O_'SH,_N
M59J=5GC3G#_))R-U6GG;?O7^]?.WU>KY.7O9]^-;=:-R=GY>S9/TWA^$V4]^
MWA\D<3-/_3@;JMQO!LEP.N\Z%88AX)_%'=.P["FW#>E,`QYR[DNN0D-(UY;5
M0K&?"K57QWO"XH;)N9@**2U1;3'>M!RSR9M2,$.<&-Z)L!AW3@WKU!!'AC@U
M#+8BDQW9K&%47[!_5O.7U8"]3&+P7\Z&2:I8TF/D6YB'#:(L;_;9./-O5;/Z
M*Q/<Y4;US<*3U<:>?]6JX1O5B[EQ^4,TB&[[>7,</*#CPC3"I=3+>Y)GH;IO
M!MH4!SQH&JX44^X9AC&U@]!U7:]KN]T@M'OVJL,VR<(%L0QIN5-3>C8J-,*@
M6>_2F9R@[Z<G?R:3+(^"NQ,U''/CCC=N1S.AX&MA<-?DL,J.-*="22%Y8+FV
M'P9AN$W!6W^H1DF:KY&\4)>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AO[G/YZ_N.G\[Q-K/'X9Q<7+,UV,H41+%A*+(Z=D$'X&P;4:
M>&6L-DJI0U;T.549.R$?$:];-M53>F<^32K)L75^H,]5M]O[^R9[?R=[@9-0
MHL,?:3;92;/?R=[)BKV.J>M'Z^E2M1Q7?RD3.A\JQ(SPH]9#7))TL2R)E42]
M>=N^N7G_M@T2V8\DA,'?-@7FH^8?M`C/3'UD;-+Q[Z4)Z[DV32A%*R5(-D<X
M-6T\O:DL014E"+-'1,7(Y]B>X0"*ZS+&SCF?'E+RA4@^_]_W@#V#NVP\/.\Y
/7:$\1U7_#RDC9GTK*```
`
end

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [patch] Fixes/cleanups after lists.h conversion [13/23]
  2002-10-08 13:50                     ` [patch] Input - Use lists.h in event handlers [12/23] Vojtech Pavlik
@ 2002-10-08 13:50                       ` Vojtech Pavlik
  2002-10-08 13:51                         ` [patch] Fix aux detection on some notebooks [14/23] Vojtech Pavlik
  0 siblings, 1 reply; 26+ messages in thread
From: Vojtech Pavlik @ 2002-10-08 13:50 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: torvalds, linux-kernel


You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

===================================================================

ChangeSet@1.573.1.45, 2002-09-26 22:41:27+02:00, vojtech@suse.cz
  Fixes/cleanups after converting drivers to list.h lists.


 input.c          |    4 ++--
 keyboard/atkbd.c |    3 ++-
 mousedev.c       |   22 ++++++++++------------
 3 files changed, 14 insertions(+), 15 deletions(-)

===================================================================

diff -Nru a/drivers/input/input.c b/drivers/input/input.c
--- a/drivers/input/input.c	Tue Oct  8 15:26:14 2002
+++ b/drivers/input/input.c	Tue Oct  8 15:26:14 2002
@@ -411,7 +411,7 @@
 	dev->rep[REP_PERIOD] = HZ/33;
 
 	INIT_LIST_HEAD(&dev->h_list);
-	list_add_tail(&dev->node,&input_dev_list);
+	list_add_tail(&dev->node, &input_dev_list);
 
 	list_for_each_entry(handler, &input_handler_list, node)
 		if ((id = input_match_device(handler->id_table, dev)))
@@ -471,7 +471,7 @@
 	if (handler->fops != NULL)
 		input_table[handler->minor >> 5] = handler;
 
-	list_add_tail(&handler->node,&input_handler_list);
+	list_add_tail(&handler->node, &input_handler_list);
 	
 	list_for_each_entry(dev, &input_dev_list, node)
 		if ((id = input_match_device(handler->id_table, dev)))
diff -Nru a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
--- a/drivers/input/keyboard/atkbd.c	Tue Oct  8 15:26:14 2002
+++ b/drivers/input/keyboard/atkbd.c	Tue Oct  8 15:26:14 2002
@@ -332,7 +332,8 @@
  * Try to set the set we want.
  */
 
-	if (atkbd_command(atkbd, &atkbd_set, ATKBD_CMD_SSCANSET))
+	param[0] = atkbd_set;
+	if (atkbd_command(atkbd, param, ATKBD_CMD_SSCANSET))
 		return 2;
 
 /*
diff -Nru a/drivers/input/mousedev.c b/drivers/input/mousedev.c
--- a/drivers/input/mousedev.c	Tue Oct  8 15:26:14 2002
+++ b/drivers/input/mousedev.c	Tue Oct  8 15:26:14 2002
@@ -215,6 +215,8 @@
 static int mousedev_open(struct inode * inode, struct file * file)
 {
 	struct mousedev_list *list;
+	struct input_handle *handle;
+	struct mousedev *mousedev;
 	int i;
 
 #ifdef CONFIG_INPUT_MOUSEDEV_PSAUX
@@ -237,19 +239,14 @@
 
 	if (!list->mousedev->open++) {
 		if (list->mousedev->minor == MOUSEDEV_MIX) {
-			struct list_head * node;
-			list_for_each(node,&mousedev_handler.h_list) {
-				struct input_handle *handle = to_handle_h(node);
-				struct mousedev *mousedev = handle->private;
-				if (!mousedev->open)
-					if (mousedev->exist)	
-						input_open_device(handle);
+			list_for_each_entry(handle, &mousedev_handler.h_list, h_node) {
+				mousedev = handle->private;
+				if (!mousedev->open && mousedev->exist)	
+					input_open_device(handle);
 			}
-		} else {
-			if (!mousedev_mix.open)
-				if (list->mousedev->exist)	
-					input_open_device(&list->mousedev->handle);
-		}
+		} else 
+			if (!mousedev_mix.open && list->mousedev->exist)	
+				input_open_device(&list->mousedev->handle);
 	}
 
 	return 0;
@@ -496,6 +493,7 @@
 	input_register_handler(&mousedev_handler);
 
 	memset(&mousedev_mix, 0, sizeof(struct mousedev));
+	INIT_LIST_HEAD(&mousedev_mix.list);
 	init_waitqueue_head(&mousedev_mix.wait);
 	mousedev_table[MOUSEDEV_MIX] = &mousedev_mix;
 	mousedev_mix.exist = 1;

===================================================================

This BitKeeper patch contains the following changesets:
1.573.1.45
## Wrapped with gzip_uu ##


begin 664 bkpatch18125
M'XL(`/;<HCT``[56:7/;-A#]3/Z*[61&E1*+PL5+&7GB2$ZCR5&/[7SJ=#@0
M`9FL)5)#0CY2]K\'!'74\A6[-:41!&"Q^[!X;\%7\*V41=^ZR/]2,D[L5_`Q
M+U7?*I>E=.+ONG^<Y[K?2_*Y[*VL>I/S7IHMELK6\T=<Q0E<R*+L6]BAFQ%U
MO9!]Z_CPMV^?#XYM>S"`8<*S,WDB%0P&MLJ+"SX3Y3NNDEF>.:K@63F7BCMQ
M/J\VIA5!B.B/BWV*7*_"'F)^%6.!,6=8"D18X#%[!>S="O;N^I!XV,<N=2OD
MN6%@CP`[KD\=[#`7$.FAL$<\(*3/<)_X;Q#I(P0[/N$-A2ZRW\/_BWQHQ_`A
MO9)E+YY)GBT7)?"ID@7$>::3JM+L#$21UOG5D6&6ELI)3%,Z]B?P7"^PC[:I
MM;M/?&P;<63O;W:K+M-9>I8H9QE?UIE<Q6[.NW<NKR<Y+T2/J_.)<.)FDSZB
MF**`H0J'`<;59")"29`4F'JA3W<S^5,^]9$1Q#"A%='Y8QKAPWF_Z7.>ZU!"
M7JR]F6-@NJD\&C)2Q9Q..7$91]@EDPE_!.*NNRTXBG3GB>#,[QW(F!>Z%1$!
M)4),?1$@+*?X$60W?&UA(1+XGA'=G>:/"_`_(+XEQ@<1NQ@1BDF-&!,C3$)O
M29+>)TD"7?(BDCP0`LH%C^56CO,Y-Y(SJ?T=NL6E^6H)'=V=Y6=H<<0P`VR/
MF\:J91YQ(2+%TUF[I1G8W<]R(?>@96)$>B2JC3IO]5*_6>K?M52G0,QDL;-\
M-;IV<9LO6^(_E3)/5>`CK+FM0!>[B+E!14**?$,<'/P\<3""+GX9Z@R;.FYJ
M-*2:.URE>;8'^C!@GI9E7='3+%5\EGXW4Y!/MP6]*2@/TFN;BV<P;$RP#\2V
M2E4L8XWO7SR`UTW[=C.[C@2OU_\TSPA#X&L_S`-F6U;#M&E>1)+'220S55RW
M&T>:9^MU:ZHYB2';'B11S<0._%V[L#:!!M`8=O<7>L]<U6#TDTZA_<O:J+N?
M+V0&K19L1^1536'+&%O-IFJC6B!I+%=X.@9]`*Y&[Q*@VOH?D+-2@KT;(YJG
M5\XZ3(VXNW]WL-NQ6KOFF^!C%@:U-L=?QZ?1Y_'):?3Q\&#4;MT(>J\6=^_)
M6I$O>&L_(LC[;FV&/18PKR)NP,)&EMZ3ZCE^$5&.\NQ7!0M>ZGJ>:=8K:!O@
M42E5![@>A3CA!;07O.`ZDJ[X6I6-B2G]F6AW.J;\F]>1!P6ZFYOG7`24NG4U
MKQNM5H/J#_2GUL<&ME9&3=F;&$UO#XS]'AR<?GH_BH9?1M')R?#@Z\GA::>S
:?6>/$QF?E\OY8!(*%$X\8?\`D1_PQPX,````
`
end

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [patch] Fix aux detection on some notebooks [14/23]
  2002-10-08 13:50                       ` [patch] Fixes/cleanups after lists.h conversion [13/23] Vojtech Pavlik
@ 2002-10-08 13:51                         ` Vojtech Pavlik
  2002-10-08 13:52                           ` [patch] Input - Add Set 3 japanese scancodes [15/23] Vojtech Pavlik
  0 siblings, 1 reply; 26+ messages in thread
From: Vojtech Pavlik @ 2002-10-08 13:51 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: torvalds, linux-kernel


You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

===================================================================

ChangeSet@1.573.1.47, 2002-10-01 20:41:21+02:00, vojtech@suse.cz
  Accept 0xfa as an "OK" result code for AUX TEST cmd in i8042.c.
  This makes mouse work on certain notebooks.


 i8042.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

===================================================================

diff -Nru a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
--- a/drivers/input/serio/i8042.c	Tue Oct  8 15:26:07 2002
+++ b/drivers/input/serio/i8042.c	Tue Oct  8 15:26:07 2002
@@ -664,11 +664,13 @@
 /*
  * External connection test - filters out AT-soldered PS/2 i8042's
  * 0x00 - no error, 0x01-0x03 - clock/data stuck, 0xff - general error
+ * 0xfa - no error on some notebooks which ignore the spec
  * We ignore general error, since some chips report it even under normal
  * operation.
  */
 
-	if (i8042_command(&param, I8042_CMD_AUX_TEST) || (param && param != 0xff))
+	if (i8042_command(&param, I8042_CMD_AUX_TEST)
+	    || (param && param != 0xfa && param != 0xff))
 		return -1;
 
 /*

===================================================================

This BitKeeper patch contains the following changesets:
1.573.1.47
## Wrapped with gzip_uu ##


begin 664 bkpatch18096
M'XL(`._<HCT``\V4;VO;,!#&7T>?XM9":=?%ULF*E1@RVK5E*]UHZ1_8NZ+*
M2NTEMH*D--OPAY_LA!8RUK*QP61C6^?3\>B>']J&&Z=MUGLP7[Q6!=F&#\;Y
MK.<63D?J>YA?&A/F<6$J':^SXKMI7-;SA2?A_X7TJH`';5W6PRAYC/AO<YWU
M+D_>WWP\O"1D/(:C0M;W^DI[&(^)-_9!SG)W('TQ,W7DK:Q=I;V,E*F:Q]2&
M4<K"-4"1T$':8$JY:!3FB)*CSBGCPY23M;"#M>R-]4@I8JB1C!HZ$B-!C@&C
M@4@BC+@`RF*D,45@-..8,=RG+*,4-FK"/D*?DG?P=Y4?$06'2NFY!_IU(D$Z
MD#5LG9]M@=5N,?.@3*YA8BP<WGR&ZY.K:U!5#F4-Y9!R%JDH5+@N2@>5G.KP
M-$$O+(V=@JE!:>MER*V-UW?&3%U$SF`DAI1<//E!^K\Y"*&2DK>/+?++<E;>
M%SY:J&7;_MR6+1`K2.(`6&GBM=I56P1-D`U23)LDN,,:0=N.2%2:<IS0?+/Y
M+U;L+!YR1-$P/DIX!]PSBUH$_YGZGW!\L>*(<4SYD`=,AIRS#E#DFVBB^!6:
M"?3Q?T&S)6SEP3GT[;*[`S(7S]GQ!P2>IFD*2.#U2EP_(`[:VB`F8._":?7$
M/"R+,IQ(Y7UMK`9?:'!SK<AQ*C!4.&U?C/3*">QV<FY#LRI9Y[L[<VEE]09.
MN^C1I^/;L,_;=I][I`=A-`WL=CFPLP.KCU?CE9Z-P&1O[^FP5(564[>HQDF*
-(IB>DQ]F52$6AP4`````
`
end

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [patch] Input - Add Set 3 japanese scancodes [15/23]
  2002-10-08 13:51                         ` [patch] Fix aux detection on some notebooks [14/23] Vojtech Pavlik
@ 2002-10-08 13:52                           ` Vojtech Pavlik
  2002-10-08 13:56                             ` [patch] Input - BK Merge patch [16/23] Vojtech Pavlik
  0 siblings, 1 reply; 26+ messages in thread
From: Vojtech Pavlik @ 2002-10-08 13:52 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: torvalds, linux-kernel


You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

===================================================================

ChangeSet@1.573.1.49, 2002-10-03 15:38:06+02:00, vojtech@suse.cz
  Add japanese Set 3 scancodes to atkbd.c


 atkbd.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

===================================================================

diff -Nru a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
--- a/drivers/input/keyboard/atkbd.c	Tue Oct  8 15:26:00 2002
+++ b/drivers/input/keyboard/atkbd.c	Tue Oct  8 15:26:00 2002
@@ -73,7 +73,7 @@
 	113,114, 40, 84, 26, 13, 87, 99,100, 54, 28, 27, 43, 84, 88, 70,
 	108,105,119,103,111,107, 14,110,  0, 79,106, 75, 71,109,102,104,
 	 82, 83, 80, 76, 77, 72, 69, 98,  0, 96, 81,  0, 78, 73, 55, 85,
-	 89, 90, 91, 92, 74,  0,  0,  0,  0,  0,  0,125,126,127,112,  0,
+	 89, 90, 91, 92, 74,185,184,182,  0,  0,  0,125,126,127,112,  0,
 	  0,139,150,163,165,115,152,150,166,140,160,154,113,114,167,168,
 	148,149,147,140,  0,  0,  0,  0,  0,  0,251,  0,  0,  0,  0,  0,
 	  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,

===================================================================

This BitKeeper patch contains the following changesets:
1.573.1.49
## Wrapped with gzip_uu ##


begin 664 bkpatch18067
M'XL(`.C<HCT``[U4?VO;,!#]._H4!_VSB7TGR3\AHUT[MK'!0DH_@"*).DUB
M!TM)Z/"'GYR$%%+HVK'-]K,Y2SK?>_?D"[AWMBT'V^;16UVQ"_C2.%\.W,;9
M2/\,\;1I0AQ7S<K&QUGQ;!'/Z_7&LS`^45Y7L+6M*P<4B=,;_[2VY6#ZZ?/]
M]^LI8^,QW%2J?K!WUL-XS'S3;M72N"OEJV531[Y5M5M9KR+=K+K3U(XC\G`F
ME`E,THY2E%FGR1`I2=8@EWDJV;&PJV/99^L)D2A/B"<=II@6[!8H2C(1420+
M0!X3QBB`DE+D)::7R$M$.,L)EP0C9!_A[U9^PS1<&P./:JUJZRST^@AP6M6Z
M,=:%SX'RBYF)-/L&^^HGSTJRT3L/QE`A^W`BYW?SY?RA\M%&[WKA3#OO6WEH
M;[RP3[-&M28^5G#@E*$@@;G$CHJ<J)O-3&$Y6D,B+3)Q+MQ;<H8.A9PB1][Q
M3(I\[Y?7U_4F^H<L7ECJ+3D+GG*4Q$5@(5#N?4;9"X?Q5QQ&_]UA4?#50?0?
M,&IW^RL89?(;_?_`>K=9"L2^[N\#R(LA%!A``7P(F1R&31K0/T,,>$+8N0%I
>0#8D.HP]_WMT9?7";59C9864)A#Y!45J%Q76!```
`
end

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [patch] Input - BK Merge patch [16/23]
  2002-10-08 13:52                           ` [patch] Input - Add Set 3 japanese scancodes [15/23] Vojtech Pavlik
@ 2002-10-08 13:56                             ` Vojtech Pavlik
  2002-10-08 13:58                               ` [patch] Input - Minor m68k cleanups [17/23] Vojtech Pavlik
  0 siblings, 1 reply; 26+ messages in thread
From: Vojtech Pavlik @ 2002-10-08 13:56 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: torvalds, linux-kernel


You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

===================================================================

ChangeSet@1.573.1.50, 2002-10-07 10:34:15+02:00, vojtech@suse.cz
  Merge suse.cz:/home/vojtech/bk/linus into suse.cz:/home/vojtech/bk/input


 keyboard/atkbd.c |    2 +-
 mouse/psmouse.c  |   46 ++++++++++++++++++++++++++++++++++++++--------
 2 files changed, 39 insertions(+), 9 deletions(-)

===================================================================

diff -Nru a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
--- a/drivers/input/keyboard/atkbd.c	Tue Oct  8 15:25:53 2002
+++ b/drivers/input/keyboard/atkbd.c	Tue Oct  8 15:25:53 2002
@@ -17,7 +17,7 @@
 #include <linux/init.h>
 #include <linux/input.h>
 #include <linux/serio.h>
-#include <linux/tqueue.h>
+#include <linux/workqueue.h>
 
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
 MODULE_DESCRIPTION("AT and PS/2 keyboard driver");
diff -Nru a/drivers/input/mouse/psmouse.c b/drivers/input/mouse/psmouse.c
--- a/drivers/input/mouse/psmouse.c	Tue Oct  8 15:25:53 2002
+++ b/drivers/input/mouse/psmouse.c	Tue Oct  8 15:25:53 2002
@@ -20,8 +20,11 @@
 
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
 MODULE_DESCRIPTION("PS/2 mouse driver");
+MODULE_PARM(psmouse_noext, "1i");
 MODULE_LICENSE("GPL");
 
+static int psmouse_noext;
+
 #define PSMOUSE_CMD_SETSCALE11	0x00e6
 #define PSMOUSE_CMD_SETRES	0x10e8
 #define PSMOUSE_CMD_GETINFO	0x03e9
@@ -32,6 +35,7 @@
 #define PSMOUSE_CMD_SETRATE	0x10f3
 #define PSMOUSE_CMD_ENABLE	0x00f4
 #define PSMOUSE_CMD_RESET_DIS	0x00f6
+#define PSMOUSE_CMD_RESET_BAT	0x02ff
 
 #define PSMOUSE_RET_BAT		0xaa
 #define PSMOUSE_RET_ACK		0xfa
@@ -220,7 +224,11 @@
 	psmouse->ack = 0;
 	psmouse->acking = 1;
 
-	serio_write(psmouse->serio, byte);
+	if (serio_write(psmouse->serio, byte)) {
+		psmouse->acking = 0;
+		return -1;
+	}
+
 	while (!psmouse->ack && timeout--) udelay(10);
 
 	return -(psmouse->ack <= 0);
@@ -300,6 +308,9 @@
 	psmouse->name = "Mouse";
 	psmouse->model = 0;
 
+	if (psmouse_noext)
+		return PSMOUSE_PS2;
+
 /*
  * Try Genius NetMouse magic init.
  */
@@ -336,8 +347,8 @@
 	if (param[1]) {
 
 		int i;
-		static int logitech_4btn[] = { 12, 40, 41, 42, 43, 73, 80, -1 };
-		static int logitech_wheel[] = { 75, 76, 80, 81, 83, 88, -1 };
+		static int logitech_4btn[] = { 12, 40, 41, 42, 43, 52, 73, 80, -1 };
+		static int logitech_wheel[] = { 52, 75, 76, 80, 81, 83, 88, -1 };
 		static int logitech_ps2pp[] = { 12, 13, 40, 41, 42, 43, 50, 51, 52, 53, 73, 75,
 							76, 80, 81, 83, 88, 96, 97, -1 };
 		psmouse->vendor = "Logitech";
@@ -527,15 +538,24 @@
  * Last, we enable the mouse so that we get reports from it.
  */
 
-	if (psmouse_command(psmouse, NULL, PSMOUSE_CMD_ENABLE)) {
+	if (psmouse_command(psmouse, NULL, PSMOUSE_CMD_ENABLE))
 		printk(KERN_WARNING "psmouse.c: Failed to enable mouse on %s\n", psmouse->serio->phys);
-	}
 
 }
 
 /*
- * psmouse_disconnect() cleans up after we don't want talk
- * to the mouse anymore.
+ * psmouse_cleanup() resets the mouse into power-on state.
+ */
+
+static void psmouse_cleanup(struct serio *serio)
+{
+	struct psmouse *psmouse = serio->private;
+	unsigned char param[2];
+	psmouse_command(psmouse, param, PSMOUSE_CMD_RESET_BAT);
+}
+
+/*
+ * psmouse_disconnect() closes and frees.
  */
 
 static void psmouse_disconnect(struct serio *serio)
@@ -605,8 +625,18 @@
 static struct serio_dev psmouse_dev = {
 	.interrupt =	psmouse_interrupt,
 	.connect =	psmouse_connect,
-	.disconnect =	psmouse_disconnect
+	.disconnect =	psmouse_disconnect,
+	.cleanup =	psmouse_cleanup,
 };
+
+#ifndef MODULE
+static int __init psmouse_setup(char *str)
+{
+	psmouse_noext = 1;
+	return 1;
+}
+__setup("psmouse_noext", psmouse_setup);
+#endif
 
 int __init psmouse_init(void)
 {

===================================================================

This BitKeeper patch contains the following changesets:
1.573.1.50
## Wrapped with gzip_uu ##


begin 664 bkpatch18038
M'XL(`.'<HCT``]69V6[CR!6&KUM/06!N$@Q,U;X8<,#))$B`22.-#N8!2+$L
MT9)(@8O=;O#A\Q_*[0ELV<TB9BYB&Y9DU\>J.ONI^B'YM0OM]8?[YJX/F]WJ
MA^2?3==??^B&+J2;K_C\N6GP>;UKCF']-&I=[-=5?1KZ%?[_*>\WN^0^M-WU
M!Y[*Y[_TCZ=P_>'SW__QZ[]^^KQ:W=PD/^_R>AO^$_KDYF;5-^U]?BB[+.]W
MAZ9.^S:ONV/H\W33',?GH:-@3.!;<RN9-B,W3-EQPTO.<\5#R81R1JV>%I8]
M+?L%SQF37$K'S,@,,W[UMX2GVLH4OUG"Q)JS-;,)9]=277/](Q/7C"4OGIG\
M*)(KMOIK\ONN_.?5)OD8VFU(GN:Y?B7J0U4/75+5??/VF+,ZJN1NF[=?JWUV
MS.NRS?>A:V[["^N"1#B3PD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at|nested] 26+ messages in thread

* [patch] Input - Minor m68k cleanups [17/23]
  2002-10-08 13:56                             ` [patch] Input - BK Merge patch [16/23] Vojtech Pavlik
@ 2002-10-08 13:58                               ` Vojtech Pavlik
  2002-10-08 13:59                                 ` [patch] Input - Fix serial mouse wheel, increase timeout [18/23] Vojtech Pavlik
  0 siblings, 1 reply; 26+ messages in thread
From: Vojtech Pavlik @ 2002-10-08 13:58 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: torvalds, linux-kernel


You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

===================================================================

ChangeSet@1.573.1.51, 2002-10-07 10:39:47+02:00, geert@linux-m68k.org
  Please apply this small clean up, too:
  
    - Kill unused variable and end-of-line whitespace.
    - s/M68K/M68k/


 Config.in  |    2 +-
 m68kspkr.c |    5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

===================================================================

diff -Nru a/drivers/input/misc/Config.in b/drivers/input/misc/Config.in
--- a/drivers/input/misc/Config.in	Tue Oct  8 15:25:46 2002
+++ b/drivers/input/misc/Config.in	Tue Oct  8 15:25:46 2002
@@ -9,6 +9,6 @@
    dep_tristate '  SPARC Speaker support' CONFIG_INPUT_SPARCSPKR $CONFIG_INPUT $CONFIG_INPUT_MISC
 fi
 if [ "$CONFIG_M68K" = "y" ]; then
-dep_tristate '  M68K Beeper support' CONFIG_INPUT_M68K_BEEP $CONFIG_INPUT $CONFIG_INPUT_MISC
+dep_tristate '  M68k Beeper support' CONFIG_INPUT_M68K_BEEP $CONFIG_INPUT $CONFIG_INPUT_MISC
 fi
 dep_tristate '  User level driver support' CONFIG_INPUT_UINPUT $CONFIG_INPUT $CONFIG_INPUT_MISC
diff -Nru a/drivers/input/misc/m68kspkr.c b/drivers/input/misc/m68kspkr.c
--- a/drivers/input/misc/m68kspkr.c	Tue Oct  8 15:25:46 2002
+++ b/drivers/input/misc/m68kspkr.c	Tue Oct  8 15:25:46 2002
@@ -31,7 +31,6 @@
 static int m68kspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
 {
 	unsigned int count = 0;
-	unsigned long flags;
 
 	if (type != EV_SND)
 		return -1;
@@ -40,11 +39,11 @@
 		case SND_BELL: if (value) value = 1000;
 		case SND_TONE: break;
 		default: return -1;
-	} 
+	}
 
 	if (value > 20 && value < 32767)
 		count = 1193182 / value;
-	
+
 	mach_beep(count, -1);
 
 	return 0;

===================================================================

This BitKeeper patch contains the following changesets:
1.573.1.51
## Wrapped with gzip_uu ##


begin 664 bkpatch18009
M'XL(`-K<HCT``[5574_;,!1];G[%E9C$`TMB.\ZGU(E1&*L84,%XFU2YCMMD
M39,H=LI`V7^?TU8M=,"`06)=Z?KC^OB>>^P=N)*BBCKSXJ<2/#%VX&LA5=21
MM106O]7^15%HWTZ*F;!7L^S1U$[SLE:&'A\PQ1.8BTI&'6PYZQYU4XJH<W%T
M?/7M\X5A=+O02U@^$9="0;=KJ**:LRR6^TPE69%;JF*YG`G%+%[,FO74AB!$
M].]BWT&NUV`/4;_A.,:842QB1&C@46,%;'\%>VL]1LA'@4.QVQ#JA=@X!&RY
MOF-IBP$1&R,;^8!1Y(01]?<0B1""B1"5VL_2O/YESKQ@:A75!/8(F,@X@+>%
MWS,X##+!I`!6EMD-J"25(&<LRX#K_ASJ\J/>LXCT1-T`3#A)]6"=ZP/',&=5
MRD:97IW'(/+8+,:F!B[@.DF5D"7CPEHMD_:I%YRT9FH;)T!<HO,QV'!CF"_\
M#`,Q9'R"ZG8K5TU<I6U9+$O%GJ62V^V8+*>5Q9>9"8FCJ7%=U'@T<)R&^80[
MXW#LA"%#B/('27A&X!7C(:4-(;[?XMLND0>"](I\G$ZL-%^""XB+'8)QT+C$
M0T$3!'C,4!#XWMCA)*#/!G<_[AULE+B(++3QY)%:O;Q+>O\O*M9J\OVEFLA?
M,J+_DI'S+C(Z3?.B6HJF+JVVPA?\GX-972^:KMC!T^E^A00.'0HZ$=31MK^P
MG=_:]1=N:W\\QO*Z-EJ2W[Y&G\?P5M!-V5#-,%I>ER\D&(.)WX=@O04<"%&*
M2M^*,5.B97FII`W+UX^PO#[I:TC&I.5S86-1#E652J7WAUVXATK695E4:A=Z
MYV=?^L?#_MG@ZONPO7:'!T='`_APM_^^-SSM7_8VKRI/!)_*>M;E(R)(.!X9
*?P"E9[?1L`<`````
`
end

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [patch] Input - Fix serial mouse wheel, increase timeout [18/23]
  2002-10-08 13:58                               ` [patch] Input - Minor m68k cleanups [17/23] Vojtech Pavlik
@ 2002-10-08 13:59                                 ` Vojtech Pavlik
  2002-10-08 14:00                                   ` [patch] Input - Fix LAlt-RAlt and similar combinations in atkbd.c [19/23] Vojtech Pavlik
  0 siblings, 1 reply; 26+ messages in thread
From: Vojtech Pavlik @ 2002-10-08 13:59 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: torvalds, linux-kernel


You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

===================================================================

ChangeSet@1.573.1.52, 2002-10-07 11:13:20+02:00, aderesch@fs.tum.de
  Increase the resync timeout for serial mice, and fix MZ wheel direction.


 sermouse.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

===================================================================

diff -Nru a/drivers/input/mouse/sermouse.c b/drivers/input/mouse/sermouse.c
--- a/drivers/input/mouse/sermouse.c	Tue Oct  8 15:25:38 2002
+++ b/drivers/input/mouse/sermouse.c	Tue Oct  8 15:25:38 2002
@@ -155,7 +155,7 @@
 
 				case SERIO_MZ:
 					input_report_key(dev, BTN_MIDDLE, (data >> 4) & 1);
-					input_report_rel(dev, REL_WHEEL, (data & 7) - (data & 8));
+					input_report_rel(dev, REL_WHEEL,  (data & 8) - (data & 7));
 					break;
 			}
 					
@@ -204,7 +204,7 @@
 {
 	struct sermouse *sermouse = serio->private;
 
-	if (time_after(jiffies, sermouse->last + HZ/20)) sermouse->count = 0;
+	if (time_after(jiffies, sermouse->last + HZ/10)) sermouse->count = 0;
 	sermouse->last = jiffies;
 
 	if (sermouse->type > SERIO_SUN)

===================================================================

This BitKeeper patch contains the following changesets:
1.573.1.52
## Wrapped with gzip_uu ##


begin 664 bkpatch17980
M'XL(`-+<HCT``[V4;6O;,!#'7T>?XJ`P$AK;DOR<DI*M#4M9QTI&&?1-4>5S
M[-8/19:3=OC#3TZZ=I31/4\V/I\EG>_N_T-[<-Z@F@S6];5&F9$]6-2-G@R:
MMD%;?C;^LJZ-[V1UB<[#*N?JQLFKVU83,W\FM,Q@C:J9#)CM/G[1][<X&2SG
M;\]/7R\)F4[A*!/5"C^BANF4Z%JM19$T,Z&SHJYLK435E*B%+>NR>US:<4JY
MN7P6NM0/.A90+^PD2Q@3'L.$<B\*/+)"5'I6Y%5[9Y5!=&/7:O4L"*,TI)$;
MF^W<YS$CQ\!L/W1M\^1`N<.H0T-@;,+<":?[E$\H!9&@PD9FL[2Q=5O:"<(^
M`XN2-_!W*S@B$DXJJ5`T"#I#,+^]KR3HO,2ZU9#6"HQ2N2B@S"6.050)I/D=
MO+^`38980)(KE#HWF9!WP+T@\LG94\^)]8N#$"HH.80'S6=ZDQ?Y*M-V*S>&
MC"Y1>2_Z#@2GK`TPCDEP^V++7=4A=9E+(X]W//2CJ&-7TA71E>_3%#WFQ=]I
M[\_$W4H9,Y<%7<!X3+=TO;RO1^Y?5O)GP;G/F!]PKR_'C[=DAL^19,$+2'*P
M^/]&<OP"?CM9/H"E-MO;X'3V`X5^`]!CYD?`R,G.#/JQC7VI\+96O2F&":['
ML)R?7GY:S.>G8X!A(K2`5Q"-P'ITPM'H@!SSOMGD9&<&>0K#OM1+D6I4P^L\
M37-LQO`U9>NP$(V&?5A<&*%&HV\F9-U6YI0#>O!T0LH,Y4W3EE,91V$DF2!?
)`-.UEW1\!0``
`
end

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [patch] Input - Fix LAlt-RAlt and similar combinations in atkbd.c [19/23]
  2002-10-08 13:59                                 ` [patch] Input - Fix serial mouse wheel, increase timeout [18/23] Vojtech Pavlik
@ 2002-10-08 14:00                                   ` Vojtech Pavlik
  2002-10-08 14:01                                     ` [patch] Input - Make NR_KEYS be KEY_MAX+1 [20/23] Vojtech Pavlik
  0 siblings, 1 reply; 26+ messages in thread
From: Vojtech Pavlik @ 2002-10-08 14:00 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: torvalds, linux-kernel


You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

===================================================================

ChangeSet@1.573.1.53, 2002-10-07 14:29:57+02:00, vojtech@suse.cz
  Fix LAlt-RAlt combination on AT keyboards (generated "unknown scancode" message).


 i8042.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

===================================================================

diff -Nru a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
--- a/drivers/input/serio/i8042.c	Tue Oct  8 15:25:31 2002
+++ b/drivers/input/serio/i8042.c	Tue Oct  8 15:25:31 2002
@@ -63,7 +63,7 @@
 
 extern struct pt_regs *kbd_pt_regs;
 
-static unsigned long i8042_unxlate_seen[128 / BITS_PER_LONG];
+static unsigned long i8042_unxlate_seen[256 / BITS_PER_LONG];
 static unsigned char i8042_unxlate_table[128] = {
 	  0,118, 22, 30, 38, 37, 46, 54, 61, 62, 70, 69, 78, 85,102, 13,
 	 21, 29, 36, 45, 44, 53, 60, 67, 68, 77, 84, 91, 90, 20, 28, 27,
@@ -407,14 +407,14 @@
 		}
 
 		if (data > 0x7f) {
-			if (test_and_clear_bit(data & 0x7f, i8042_unxlate_seen)) {
+			if (test_and_clear_bit((data & 0x7f) | (i8042_last_e0 << 7), i8042_unxlate_seen)) {
 				serio_interrupt(&i8042_kbd_port, 0xf0, dfl);
 				if (i8042_last_e0 && (data == 0xaa || data == 0xb6))
-					set_bit(data & 0x7f, i8042_unxlate_seen);
+					set_bit((data & 0x7f) | (i8042_last_e0 << 7), i8042_unxlate_seen);
 				data = i8042_unxlate_table[data & 0x7f];
 			}
 		} else {
-			set_bit(data, i8042_unxlate_seen);
+			set_bit(data | (i8042_last_e0 << 7), i8042_unxlate_seen);
 			data = i8042_unxlate_table[data];
 		}
 

===================================================================

This BitKeeper patch contains the following changesets:
1.573.1.53
## Wrapped with gzip_uu ##


begin 664 bkpatch17951
M'XL(`,O<HCT``[64;6_3,!#'7\>?XK1)J-5H8CM/;5G1'AD3$YNZ[15"E>M<
MF]#6F6)G[2`?'C<911HPM,$2RXD3YW__N_LIVW"ML>@[M_D7@S(EV_`^UZ;O
MZ%*C*[_:]3#/[=I+\P5Z][N\\<S+U$UIB'U_(8Q,X18+W7>8ZV^>F+L;[#O#
MXY/KL_TA(8,!'*9"3?$2#0P&Q.3%K9@G>D^8=)XKUQ1"Z04:X<I\46VV5IQ2
M;L^0Q3X-HXI%-(@KR1+&1,`PH3SH1@$1"1:H9;HWT:XI%VZ"#R08I3'M,9_3
MB@=1-R1'P-PP]ET[^T"YQZA'8V!!G_?Z8;Q#>9]2N,]W[[X:L,.@0\D!_%_S
MAT3"NVP%9_MSTQG:":S*.%/"9+D"._:O8(9WXUP4B8;6%!46PF`"6Z6:J7RI
M0$NA9)[@%BQ0:S'%MDL^@$VT%Y*+GW4GG2<>A%!!R=M-'<PRFV?3U+BE7-IZ
M5$F1K1O?P.!9D++<R[HTX*YL<H^ISW@8L:CR;0MX%=-UVH))I`&;T.1AA?^J
MN.XCX[P7\HKWNEU:@_7(1VO47LP]>89[QKH!8[&EL.<'-84L_(4__B?^`N@$
M+\+?E9@AF!0!*=P4.+$X9LKD(*3,2V5@F:(">[,.-+=@JBG@RJ!*+(:635WS
M5C?D'#K%LAZ6GXO'>O,,'(^B"!@YK6=MK`]I3>ELJJP-6X@IU-*C4JVL21QI
M1/7)=A`\.#B]NAQ='`]'9^<?3SZ_(4<!HVNIYN(X3C:!ED%M1D(E(SE'48S&
MF6FU$F$$O`*ZBB=MJ*#51)@+N]/6:G<7XO;KWX1MM^';.HC?!/&;((ZCT?R;
G;FT];E3C1O6'9BWY)*G-WUJF*&>Z7`SB\3@<,Z3D.TE1K!X:!@``
`
end

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [patch] Input - Make NR_KEYS be KEY_MAX+1 [20/23]
  2002-10-08 14:00                                   ` [patch] Input - Fix LAlt-RAlt and similar combinations in atkbd.c [19/23] Vojtech Pavlik
@ 2002-10-08 14:01                                     ` Vojtech Pavlik
  2002-10-08 14:01                                       ` [patch] Input - Ignore mouse sync bit [21/23] Vojtech Pavlik
  0 siblings, 1 reply; 26+ messages in thread
From: Vojtech Pavlik @ 2002-10-08 14:01 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: torvalds, linux-kernel


You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

===================================================================

ChangeSet@1.573.1.54, 2002-10-07 15:38:11+02:00, vojtech@suse.cz
  Make NR_KEYS be (KEY_MAX+1) so that keybindings
  can be set for keys over 128.


 keyboard.h |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

===================================================================

diff -Nru a/include/linux/keyboard.h b/include/linux/keyboard.h
--- a/include/linux/keyboard.h	Tue Oct  8 15:25:24 2002
+++ b/include/linux/keyboard.h	Tue Oct  8 15:25:24 2002
@@ -2,6 +2,7 @@
 #define __LINUX_KEYBOARD_H
 
 #include <linux/wait.h>
+#include <linux/input.h>
 
 #define KG_SHIFT	0
 #define KG_CTRL		2
@@ -15,9 +16,9 @@
 
 #define NR_SHIFT	9
 
-#define NR_KEYS		128
+#define NR_KEYS		(KEY_MAX+1)
 #define MAX_NR_KEYMAPS	256
-/* This means 64Kb if all keymaps are allocated. Only the superuser
+/* This means 128Kb if all keymaps are allocated. Only the superuser
 	may increase the number of keymaps beyond MAX_NR_OF_USER_KEYMAPS. */
 #define MAX_NR_OF_USER_KEYMAPS 256 	/* should be at least 7 */
 

===================================================================

This BitKeeper patch contains the following changesets:
1.573.1.54
## Wrapped with gzip_uu ##


begin 664 bkpatch17922
M'XL(`,3<HCT``]54VV[30!!]SG[%2'D!HMA[\?HF4K4T%52A-$JI!$_5QM[4
M)HXW\JX#0?YXUFZ45I%"1>$%VQIY/!?/.7.T?;C5LHI[&_7-R"1#??B@M(E[
MNM;227Y:?Z:4]=U,K:2[RW+G2S<OU[5!-CX5)LE@(RL=]XC#]E_,=BWCWNSB
M_>W'LQE"HQ&<9Z*\ES?2P&B$C*HVHDCUJ3!9H4K'5*+4*VF$DZA5LT]M*,;4
MWIP$#'._(3[V@B8A*2'"(S+%U`M]#^T&.]V-?5!/,`X(I1$/&NKY$4=C(`X/
MF&.M!YBZ!+LX`,)C%L:$##"-,8:#GC`@,,3H'?S;R<]1`E=B*>'3[&YR\?4&
MYA)>V9>[J[,O`_(:M`*3"0-+N9WG99J7]]I6)*)L$[7E<J&J-JA!V1T`H:&#
M)D"93SB:/E*.AG]X(80%1B?/H,W+I*A3Z19Y6?]PVQF5J%(G>PH^\K!U(TX;
MEDC"HY3Y\X!)/@\/*?Y]NVZ+C(4X:#AC4=!IZEC%\Q+[N]'1NA7Y"SM3QB-*
M&V[_X7=:9(<BQ,$Q$3(8TO]$A`];NH9A];U[K*BF1Q?V`H%>>D!0?]<0WCYT
M[,XE)SM!8Q+:\&5G^ZE<Y.4>7J_W!!P:4]PF=M9]`Y^S7,-*6CI;'),YY`L0
M1='"6XFU!E')UE>),#)UX+HLMI8<2T.]EI7=4O5X*":93):Z7HUX*EC(Y`+]
)`HI:2/9O!0``
`
end

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [patch] Input - Ignore mouse sync bit [21/23]
  2002-10-08 14:01                                     ` [patch] Input - Make NR_KEYS be KEY_MAX+1 [20/23] Vojtech Pavlik
@ 2002-10-08 14:01                                       ` Vojtech Pavlik
  2002-10-08 14:02                                         ` [patch] Input - Change extra key mappings for MS Keyboards [22/23] Vojtech Pavlik
  0 siblings, 1 reply; 26+ messages in thread
From: Vojtech Pavlik @ 2002-10-08 14:01 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: torvalds, linux-kernel


You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

===================================================================

ChangeSet@1.573.1.55, 2002-10-07 16:22:25+02:00, vojtech@suse.cz
  psmouse.c: ignore the sync bit to make slightly non-conforming devices
  work.


 psmouse.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

===================================================================

diff -Nru a/drivers/input/mouse/psmouse.c b/drivers/input/mouse/psmouse.c
--- a/drivers/input/mouse/psmouse.c	Tue Oct  8 15:25:17 2002
+++ b/drivers/input/mouse/psmouse.c	Tue Oct  8 15:25:17 2002
@@ -201,7 +201,7 @@
 	psmouse->packet[psmouse->pktcnt++] = data;
 
 	if (psmouse->pktcnt == 3 + (psmouse->type >= PSMOUSE_GENPS)) {
-		if ((psmouse->packet[0] & 0x08) == 0x08) psmouse_process_packet(psmouse);
+		psmouse_process_packet(psmouse);
 		psmouse->pktcnt = 0;
 		return;
 	}

===================================================================

This BitKeeper patch contains the following changesets:
1.573.1.55
## Wrapped with gzip_uu ##


begin 664 bkpatch17893
M'XL(`+W<HCT``[64;6O;,!"`/T>_XJ`?ME%BG^37>&1T:T=7-EC(Z.<BRVKL
MQ9:"I21D^,=/<4P*Z0C=6&UCH]/I7I_S!=P;V6:CC?YII2C)!7S1QF8CLS;2
M$[_<>JZU6_NE;J0_:/GYTJ_4:FV)VY]Q*TK8R-9D(^H%1XG=K60VFG^^O?_V
M<4[(=`K7)5<+^4-:F$Z)U>V&UX6YXK:LM?)LRY5II.6>T$UW5.T8(G-W1),`
MH[BC,89))VA!*0^I+)"%:1R2(;"K(>R3\Q0QH4&04MJQ(*81N0'J14G@N7<$
MR'R*/B9`XXRQC$67R#)$.+$)EQ3&2#[!_XW\F@A8F4;W3C*H%DJW$FPIP>R4
M@+RRSB$T?.D$=;4H;;T#I=58:/6HVZ92"RCDIA+2.$-;W2X]\A7V64[([*GB
M9/R7%R'(D7PX%L%NJ]Z[MQ;;?8&+MMJW_("!WX?O'],XI)Y@0`-,0]9A&F/<
MY4F>1VD1I(\RC)B4IP5^@<V^D2%CS#5R,HDF/59GC^U1>\4<GH'WLAPP#4**
M7<`FR0%&^AQ#>@9#^BH8WOV!O3$8-_C@C(MESNO:0*'5&PO&3;';YJK8ZZM!
M>N2O;\YW&+?;_G$\S<[WZ1\`O6$8`B5WA\]H--AZ6+7:38-Y6+F0I7T[B-^]
9?_I9B5**I5DW4YXCQ@7GY#>S4$[]!P4`````
`
end

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [patch] Input - Change extra key mappings for MS Keyboards [22/23]
  2002-10-08 14:01                                       ` [patch] Input - Ignore mouse sync bit [21/23] Vojtech Pavlik
@ 2002-10-08 14:02                                         ` Vojtech Pavlik
  2002-10-08 14:03                                           ` [patch] Input - Make sure input_dev is initialized where needed [23/23] Vojtech Pavlik
  0 siblings, 1 reply; 26+ messages in thread
From: Vojtech Pavlik @ 2002-10-08 14:02 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: torvalds, linux-kernel


You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

===================================================================

ChangeSet@1.573.1.57, 2002-10-08 10:08:34+02:00, vojtech@suse.cz
  Change PC-keyboard mappings to follow MS Keyboards - a de facto
  standard for extended keys.


 drivers/char/keyboard.c        |   14 +++++++-------
 drivers/input/keyboard/atkbd.c |   10 +++++-----
 include/linux/input.h          |    1 +
 3 files changed, 13 insertions(+), 12 deletions(-)

===================================================================

diff -Nru a/drivers/char/keyboard.c b/drivers/char/keyboard.c
--- a/drivers/char/keyboard.c	Tue Oct  8 15:25:10 2002
+++ b/drivers/char/keyboard.c	Tue Oct  8 15:25:10 2002
@@ -917,14 +917,14 @@
 	 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
 	 80, 81, 82, 83, 43, 85, 86, 87, 88,115,119,120,121,375,123, 90,
 	284,285,309,298,312, 91,327,328,329,331,333,335,336,337,338,339,
-	367,294,293,286,350, 92,334,512,116,377,109,111,373,347,348,349,
-	360, 93, 94, 95, 98,376,100,101,357,316,354,304,289,102,351,355,
-	103,104,105,275,281,272,306,106,274,107,288,364,358,363,362,361,
-	291,108,381,290,287,292,279,305,280, 99,112,257,258,113,270,114,
+	367,288,302,304,350, 92,334,512,116,377,109,111,373,347,348,349,
+	360, 93, 94, 95, 98,376,100,101,321,316,354,286,289,102,351,355,
+	103,104,105,275,287,279,306,106,274,107,294,364,358,363,362,361,
+	291,108,381,281,290,272,292,305,280, 99,112,257,258,359,270,114,
 	118,117,125,374,379,115,112,125,121,123,264,265,266,267,268,269,
-	271,273,276,277,278,282,283,295,296,297,299,300,301,302,303,307,
-	308,310,313,314,315,317,318,319,320,321,322,323,324,325,326,330,
-	332,340,341,342,343,344,345,346,356,359,365,368,369,370,371,372 };
+	271,273,276,277,278,282,283,295,296,297,299,300,301,293,303,307,
+	308,310,313,314,315,317,318,319,320,357,322,323,324,325,326,330,
+	332,340,365,342,343,344,345,346,356,113,341,368,369,370,371,372 };
 
 #ifdef CONFIG_MAC_EMUMOUSEBTN
 extern int mac_hid_mouse_emulate_buttons(int, int, int);
diff -Nru a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
--- a/drivers/input/keyboard/atkbd.c	Tue Oct  8 15:25:10 2002
+++ b/drivers/input/keyboard/atkbd.c	Tue Oct  8 15:25:10 2002
@@ -55,11 +55,11 @@
 	252,253,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 	254,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,255,
 	  0,  0, 92, 90, 85,  0,137,  0,  0,  0,  0, 91, 89,144,115,  0,
-	136,100,255,  0, 97,149,164,  0,156,  0,  0,140,115,  0,  0,125,
-	  0,150,  0,154,152,163,151,126,112,166,  0,140,  0,147,  0,127,
-	159,167,139,160,163,  0,  0,116,158,  0,150,165,  0,  0,  0,142,
-	157,  0,114,166,168,  0,  0,  0,155,  0, 98,113,  0,148,  0,138,
-	  0,  0,  0,  0,  0,  0,153,140,  0,255, 96,  0,  0,  0,143,  0,
+	217,100,255,  0, 97,165,164,  0,156,  0,  0,140,115,  0,  0,125,
+	173,114,  0,113,152,163,151,126,128,166,  0,140,  0,147,  0,127,
+	159,167,115,160,164,  0,  0,116,158,  0,150,166,  0,  0,  0,142,
+	157,  0,114,166,168,  0,  0,  0,155,  0, 98,113,  0,163,  0,138,
+	226,  0,  0,  0,  0,  0,153,140,  0,255, 96,  0,  0,  0,143,  0,
 	133,  0,116,  0,143,  0,174,133,  0,107,  0,105,102,  0,  0,112,
 	110,111,108,112,106,103,  0,119,  0,118,109,  0, 99,104,119
 };
diff -Nru a/include/linux/input.h b/include/linux/input.h
--- a/include/linux/input.h	Tue Oct  8 15:25:10 2002
+++ b/include/linux/input.h	Tue Oct  8 15:25:10 2002
@@ -332,6 +332,7 @@
 #define KEY_CANCEL		223
 #define KEY_BRIGHTNESSDOWN	224
 #define KEY_BRIGHTNESSUP	225
+#define KEY_MEDIA		226
 
 #define KEY_UNKNOWN		240
 

===================================================================

This BitKeeper patch contains the following changesets:
1.573.1.57
## Wrapped with gzip_uu ##


begin 664 bkpatch17864
M'XL(`+;<HCT``[5775/C-A1]CG^%9GAI9YU$5Y]V.G2@L-LR=*<,S#[TJ>/8
M"DD),6,[L+N3_O>>ZX2$KRR4+<"-K2O=HZ,KG:NP(S[5H1ITKLN_FY"/HQWQ
M6UDW@TX]KT,O_XKV:5FBW1^7EZ&_&M4?7O0GLZMY$Z'_)&ORL;@.53WH4$^O
M/<V7JS#HG+[_]=/O^Z=1M+LK#L;9[#R<A4;L[D9-65UGTZ+>RYKQM)SUFBJ;
MU9>A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8`>EXPA
MO@$],-KJG+Y\9ZWHVC?;V7I^=5563?MEZ>ZW*BZ_RPM[2_U]>L6O*<,V$38Z
M<@J?'46^+9<*Y5`(+E5H0_:$8L=M@M1;/[\;+EEVTU9M"46QXD+6>E`4R*)T
M.WZB,**DD$K0=FN$Y=.O$+A@$<HAX3)@;&1O/?<2$0@HF4LN<HVTX:1:A!4>
M>/`(<LG]4>O5)2W'UN=63YUP&5?W<3>1>LVZS5'Z</XERN:_D7P<\HMZ?KFK
0\F+DAH:B?P&/,F5EZ`P`````
`
end

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [patch] Input - Make sure input_dev is initialized where needed [23/23]
  2002-10-08 14:02                                         ` [patch] Input - Change extra key mappings for MS Keyboards [22/23] Vojtech Pavlik
@ 2002-10-08 14:03                                           ` Vojtech Pavlik
  2002-10-08 23:48                                             ` Brad Hards
  2002-10-09  0:08                                             ` Paul Mackerras
  0 siblings, 2 replies; 26+ messages in thread
From: Vojtech Pavlik @ 2002-10-08 14:03 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: torvalds, linux-kernel


You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

===================================================================

ChangeSet@1.573.1.58, 2002-10-08 12:51:35+02:00, vojtech@suse.cz
  Initialize struct input_dev in input drivers before it's passed to input_event().
  input_register_device() usually does that, but some drivers will call
  input_event() before registering to pre-load the absolute values in
  struct input_dev in an easy way.


 drivers/input/joystick/a3d.c               |    4 ++++
 drivers/input/joystick/adi.c               |    2 ++
 drivers/input/joystick/analog.c            |    3 ++-
 drivers/input/joystick/gf2k.c              |    2 ++
 drivers/input/joystick/magellan.c          |    2 ++
 drivers/input/joystick/spaceball.c         |    1 +
 drivers/input/joystick/spaceorb.c          |    1 +
 drivers/input/joystick/stinger.c           |    3 ++-
 drivers/input/joystick/twidjoy.c           |    2 +-
 drivers/input/joystick/warrior.c           |    3 ++-
 drivers/input/keyboard/amikbd.c            |    2 ++
 drivers/input/keyboard/atkbd.c             |    2 ++
 drivers/input/keyboard/newtonkbd.c         |    2 +-
 drivers/input/keyboard/sunkbd.c            |    2 ++
 drivers/input/keyboard/xtkbd.c             |    1 +
 drivers/input/mouse/inport.c               |   25 ++++++++++++++-----------
 drivers/input/mouse/logibm.c               |   12 +++++++-----
 drivers/input/mouse/psmouse.c              |    1 +
 drivers/input/mouse/rpcmouse.c             |   12 ++++++++----
 drivers/input/mouse/sermouse.c             |    1 +
 drivers/input/touchscreen/gunze.c          |    1 +
 drivers/input/touchscreen/h3600_ts_input.c |    2 ++
 drivers/macintosh/adbhid.c                 |    2 ++
 drivers/macintosh/mac_hid.c                |    2 ++
 drivers/usb/input/powermate.c              |    1 +
 include/linux/input.h                      |    2 ++
 26 files changed, 68 insertions(+), 25 deletions(-)

===================================================================

diff -Nru a/drivers/input/joystick/a3d.c b/drivers/input/joystick/a3d.c
--- a/drivers/input/joystick/a3d.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/input/joystick/a3d.c	Tue Oct  8 15:25:03 2002
@@ -300,6 +300,8 @@
 
 		a3d->length = 33;
 
+		init_input_dev(&a3d->dev);
+
 		a3d->dev.evbit[0] |= BIT(EV_ABS) | BIT(EV_KEY) | BIT(EV_REL);
 		a3d->dev.relbit[0] |= BIT(REL_X) | BIT(REL_Y);
 		a3d->dev.absbit[0] |= BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_THROTTLE) | BIT(ABS_RUDDER)
@@ -327,6 +329,8 @@
 
 	} else {
 		a3d->length = 29;
+
+		init_input_dev(&a3d->dev);
 
 		a3d->dev.evbit[0] |= BIT(EV_KEY) | BIT(EV_REL);
 		a3d->dev.relbit[0] |= BIT(REL_X) | BIT(REL_Y);
diff -Nru a/drivers/input/joystick/adi.c b/drivers/input/joystick/adi.c
--- a/drivers/input/joystick/adi.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/input/joystick/adi.c	Tue Oct  8 15:25:03 2002
@@ -404,6 +404,8 @@
 
 	if (!adi->length) return;
 
+	init_input_dev(&adi->dev);
+
 	t = adi->id < ADI_ID_MAX ? adi->id : ADI_ID_MAX;
 
 	sprintf(buf, adi_names[t], adi->id);
diff -Nru a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c
--- a/drivers/input/joystick/analog.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/input/joystick/analog.c	Tue Oct  8 15:25:03 2002
@@ -431,8 +431,9 @@
 
 	analog_name(analog);
 	sprintf(analog->phys, "%s/input%d", port->gameport->phys, index);
-
 	analog->buttons = (analog->mask & ANALOG_GAMEPAD) ? analog_pad_btn : analog_joy_btn;
+
+	init_input_dev(&analog->dev);
 
 	analog->dev.name = analog->name;
 	analog->dev.phys = analog->phys;
diff -Nru a/drivers/input/joystick/gf2k.c b/drivers/input/joystick/gf2k.c
--- a/drivers/input/joystick/gf2k.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/input/joystick/gf2k.c	Tue Oct  8 15:25:03 2002
@@ -290,6 +290,8 @@
 
 	gf2k->length = gf2k_lens[gf2k->id];
 
+	init_input_dev(&gf2k->dev);
+
 	gf2k->dev.private = gf2k;
 	gf2k->dev.open = gf2k_open;
 	gf2k->dev.close = gf2k_close;
diff -Nru a/drivers/input/joystick/magellan.c b/drivers/input/joystick/magellan.c
--- a/drivers/input/joystick/magellan.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/input/joystick/magellan.c	Tue Oct  8 15:25:03 2002
@@ -169,6 +169,7 @@
 
 	sprintf(magellan->phys, "%s/input0", serio->phys);
 
+	init_input_dev(&magellan->dev);
 	magellan->dev.private = magellan;
 	magellan->dev.name = magellan_name;
 	magellan->dev.phys = magellan->phys;
@@ -187,6 +188,7 @@
 	input_register_device(&magellan->dev);
 
 	printk(KERN_INFO "input: %s on %s\n", magellan_name, serio->phys);
+
 }
 
 /*
diff -Nru a/drivers/input/joystick/spaceball.c b/drivers/input/joystick/spaceball.c
--- a/drivers/input/joystick/spaceball.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/input/joystick/spaceball.c	Tue Oct  8 15:25:03 2002
@@ -240,6 +240,7 @@
 
 	sprintf(spaceball->phys, "%s/input0", serio->phys);
 
+	init_input_dev(&spaceball->dev);
 	spaceball->dev.name = spaceball_names[id];
 	spaceball->dev.phys = spaceball->phys;
 	spaceball->dev.id.bustype = BUS_RS232;
diff -Nru a/drivers/input/joystick/spaceorb.c b/drivers/input/joystick/spaceorb.c
--- a/drivers/input/joystick/spaceorb.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/input/joystick/spaceorb.c	Tue Oct  8 15:25:03 2002
@@ -187,6 +187,7 @@
 
 	sprintf(spaceorb->phys, "%s/input0", serio->phys);
 
+	init_input_dev(&spaceorb->dev);
 	spaceorb->dev.name = spaceorb_name;
 	spaceorb->dev.phys = spaceorb->phys;
 	spaceorb->dev.id.bustype = BUS_RS232;
diff -Nru a/drivers/input/joystick/stinger.c b/drivers/input/joystick/stinger.c
--- a/drivers/input/joystick/stinger.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/input/joystick/stinger.c	Tue Oct  8 15:25:03 2002
@@ -152,6 +152,7 @@
 
 	sprintf(stinger->phys, "%s/serio0", serio->phys);
 
+	init_input_dev(&stinger->dev);
 	stinger->dev.name = stinger_name;
 	stinger->dev.phys = stinger->phys;
 	stinger->dev.id.bustype = BUS_RS232;
@@ -166,7 +167,6 @@
 	}
 
 	stinger->dev.private = stinger;
-	
 	serio->private = stinger;
 
 	if (serio_open(serio, dev)) {
@@ -177,6 +177,7 @@
 	input_register_device(&stinger->dev);
 
 	printk(KERN_INFO "input: %s on %s\n",  stinger_name, serio->phys);
+
 }
 
 /*
diff -Nru a/drivers/input/joystick/twidjoy.c b/drivers/input/joystick/twidjoy.c
--- a/drivers/input/joystick/twidjoy.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/input/joystick/twidjoy.c	Tue Oct  8 15:25:03 2002
@@ -198,6 +198,7 @@
 
 	sprintf(twidjoy->phys, "%s/input0", serio->phys);
 
+	init_input_dev(&twidjoy->dev);
 	twidjoy->dev.name = twidjoy_name;
 	twidjoy->dev.phys = twidjoy->phys;
 	twidjoy->dev.id.bustype = BUS_RS232;
@@ -224,7 +225,6 @@
 	}
 
 	twidjoy->dev.private = twidjoy;
-	
 	serio->private = twidjoy;
 
 	if (serio_open(serio, dev)) {
diff -Nru a/drivers/input/joystick/warrior.c b/drivers/input/joystick/warrior.c
--- a/drivers/input/joystick/warrior.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/input/joystick/warrior.c	Tue Oct  8 15:25:03 2002
@@ -155,6 +155,7 @@
 
 	sprintf(warrior->phys, "%s/input0", serio->phys);
 
+	init_input_dev(&warrior->dev);
 	warrior->dev.name = warrior_name;
 	warrior->dev.phys = warrior->phys;
 	warrior->dev.id.bustype = BUS_RS232;
@@ -180,7 +181,7 @@
 	
 	serio->private = warrior;
 
-	if (serio_open(serio, dev)) {
+	if (serio_open(serio, dev)) { 
 		kfree(warrior);
 		return;
 	}
diff -Nru a/drivers/input/keyboard/amikbd.c b/drivers/input/keyboard/amikbd.c
--- a/drivers/input/keyboard/amikbd.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/input/keyboard/amikbd.c	Tue Oct  8 15:25:03 2002
@@ -112,6 +112,8 @@
 	if (!request_mem_region(CIAA_PHYSADDR-1+0xb00, 0x100, "amikeyb"))
 		return -EBUSY;
 
+	init_input_dev(&amibkd_dev);
+
 	amikbd_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
 	amikbd_dev.keycode = amikbd_keycode;
 	amikbd_dev.keycodesize = sizeof(unsigned char);
diff -Nru a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
--- a/drivers/input/keyboard/atkbd.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/input/keyboard/atkbd.c	Tue Oct  8 15:25:03 2002
@@ -474,6 +474,8 @@
 
 	atkbd->serio = serio;
 
+	init_input_dev(&atkbd->dev);
+
 	atkbd->dev.keycode = atkbd->keycode;
 	atkbd->dev.keycodesize = sizeof(unsigned char);
 	atkbd->dev.keycodemax = ARRAY_SIZE(atkbd_set2_keycode);
diff -Nru a/drivers/input/keyboard/newtonkbd.c b/drivers/input/keyboard/newtonkbd.c
--- a/drivers/input/keyboard/newtonkbd.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/input/keyboard/newtonkbd.c	Tue Oct  8 15:25:03 2002
@@ -93,11 +93,11 @@
 
 	nkbd->serio = serio;
 
+	init_input_dev(&nkbd->dev);
 	nkbd->dev.keycode = nkbd->keycode;
 	nkbd->dev.keycodesize = sizeof(unsigned char);
 	nkbd->dev.keycodemax = ARRAY_SIZE(nkbd_keycode);
 	nkbd->dev.private = nkbd;
-
 	serio->private = nkbd;
 
 	if (serio_open(serio, dev)) {
diff -Nru a/drivers/input/keyboard/sunkbd.c b/drivers/input/keyboard/sunkbd.c
--- a/drivers/input/keyboard/sunkbd.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/input/keyboard/sunkbd.c	Tue Oct  8 15:25:03 2002
@@ -234,6 +234,8 @@
 
 	memset(sunkbd, 0, sizeof(struct sunkbd));
 
+	init_input_dev(&sunkbd->dev);
+
 	sunkbd->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_SND) | BIT(EV_REP);
 	sunkbd->dev.ledbit[0] = BIT(LED_CAPSL) | BIT(LED_COMPOSE) | BIT(LED_SCROLLL) | BIT(LED_NUML);
 	sunkbd->dev.sndbit[0] = BIT(SND_CLICK) | BIT(SND_BELL);
diff -Nru a/drivers/input/keyboard/xtkbd.c b/drivers/input/keyboard/xtkbd.c
--- a/drivers/input/keyboard/xtkbd.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/input/keyboard/xtkbd.c	Tue Oct  8 15:25:03 2002
@@ -100,6 +100,7 @@
 
 	xtkbd->serio = serio;
 
+	init_input_dev(&xtkbd->dev);
 	xtkbd->dev.keycode = xtkbd->keycode;
 	xtkbd->dev.keycodesize = sizeof(unsigned char);
 	xtkbd->dev.keycodemax = ARRAY_SIZE(xtkbd_keycode);
diff -Nru a/drivers/input/mouse/inport.c b/drivers/input/mouse/inport.c
--- a/drivers/input/mouse/inport.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/input/mouse/inport.c	Tue Oct  8 15:25:03 2002
@@ -115,6 +115,12 @@
 	.close	= inport_close,
 	.name	= INPORT_NAME,
 	.phys	= "isa023c/input0",
+	.id = { 
+ 		.bustype = BUS_ISA,
+        	.vendor  = INPORT_VENDOR,
+        	.product = 0x0001,
+        	.version = 0x0100,
+	},
 };
 
 static void inport_interrupt(int irq, void *dev_id, struct pt_regs *regs)
@@ -158,30 +164,27 @@
 {
 	unsigned char a,b,c;
 
-	if (check_region(INPORT_BASE, INPORT_EXTENT))
+	if (!request_region(INPORT_BASE, INPORT_EXTENT, "inport")) {
+		printk(KERN_ERR "inport.c: Can't allocate ports at %#x\n", INPORT_BASE);
 		return -EBUSY;
+	}
 
 	a = inb(INPORT_SIGNATURE_PORT);
 	b = inb(INPORT_SIGNATURE_PORT);
 	c = inb(INPORT_SIGNATURE_PORT);
-	if (( a == b ) || ( a != c ))
+	if (( a == b ) || ( a != c )) {
+		release_region(INPORT_BASE, INPORT_EXTENT);
+		printk(KERN_ERR "inport.c: Didn't find InPort mouse at %#x\n", INPORT_BASE);
 		return -ENODEV;
+	}
 
 	outb(INPORT_RESET, INPORT_CONTROL_PORT);
 	outb(INPORT_REG_MODE, INPORT_CONTROL_PORT);
 	outb(INPORT_MODE_BASE, INPORT_DATA_PORT);
 
-	request_region(INPORT_BASE, INPORT_EXTENT, "inport");
-
 	input_register_device(&inport_dev);
-	inport_dev.id.bustype	=BUS_ISA;
-	inport_dev.id.vendor	=INPORT_VENDOR;
-	inport_dev.id.product	=0x0001;
-	inport_dev.id.version	=0x0100;
-
 
-	printk(KERN_INFO "input: " INPORT_NAME " at %#x irq %d\n",
-		INPORT_BASE, inport_irq);
+	printk(KERN_INFO "input: " INPORT_NAME " at %#x irq %d\n", INPORT_BASE, inport_irq);
 
 	return 0;
 }
diff -Nru a/drivers/input/mouse/logibm.c b/drivers/input/mouse/logibm.c
--- a/drivers/input/mouse/logibm.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/input/mouse/logibm.c	Tue Oct  8 15:25:03 2002
@@ -105,6 +105,12 @@
 	.close	= logibm_close,
 	.name	= "Logitech bus mouse",
 	.phys	= "isa023c/input0",
+	.id	= {
+		.bustype = BUS_ISA,
+		.vendor  = 0x0003,
+		.product = 0x0001,
+		.version = 0x0100,
+	},
 };
 
 static void logibm_interrupt(int irq, void *dev_id, struct pt_regs *regs)
@@ -165,11 +171,7 @@
 	outb(LOGIBM_DISABLE_IRQ, LOGIBM_CONTROL_PORT);
 
 	input_register_device(&logibm_dev);
-	logibm_dev.id.bustype	= BUS_ISA;
-	logibm_dev.id.vendor	= 0x0003;
-	logibm_dev.id.product	= 0x0001;
-	logibm_dev.id.version	= 0x0100;
-
+	
 	printk(KERN_INFO "input: Logitech bus mouse at %#x irq %d\n", LOGIBM_BASE, logibm_irq);
 
 	return 0;
diff -Nru a/drivers/input/mouse/psmouse.c b/drivers/input/mouse/psmouse.c
--- a/drivers/input/mouse/psmouse.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/input/mouse/psmouse.c	Tue Oct  8 15:25:03 2002
@@ -583,6 +583,7 @@
 
 	memset(psmouse, 0, sizeof(struct psmouse));
 
+	init_input_dev(&psmouse->dev);
 	psmouse->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
 	psmouse->dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT);
 	psmouse->dev.relbit[0] = BIT(REL_X) | BIT(REL_Y);
diff -Nru a/drivers/input/mouse/rpcmouse.c b/drivers/input/mouse/rpcmouse.c
--- a/drivers/input/mouse/rpcmouse.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/input/mouse/rpcmouse.c	Tue Oct  8 15:25:03 2002
@@ -41,6 +41,12 @@
 	.relbit	= { BIT(REL_X) | BIT(REL_Y) },
 	.name	= "Acorn RiscPC Mouse",
 	.phys	= "rpcmouse/input0",
+	.id	= {
+		.bustype = BUS_HOST,
+		.vendor  = 0x0005,
+		.product = 0x0001,
+		.version = 0x0100,
+	},
 };
 
 static void rpcmouse_irq(int irq, void *dev_id, struct pt_regs *regs)
@@ -69,6 +75,8 @@
 
 static int __init rpcmouse_init(void)
 {
+	init_input_dev(&rpcmouse_dev);
+
 	rpcmouse_lastx = (short) iomd_readl(IOMD_MOUSEX);
 	rpcmouse_lasty = (short) iomd_readl(IOMD_MOUSEY);
 
@@ -78,10 +86,6 @@
 	}
 
 	input_register_device(&rpcmouse_dev);
-	rpcmouse.id.bustype	=BUS_HOST,
-	rpcmouse.id.vendor	=0x0005,
-	rpcmouse.id.product	=0x0001,
-	rpcmouse.id.version	=0x0100,
 
 	printk(KERN_INFO "input: Acorn RiscPC mouse irq %d", IRQ_VSYNCPULSE);
 
diff -Nru a/drivers/input/mouse/sermouse.c b/drivers/input/mouse/sermouse.c
--- a/drivers/input/mouse/sermouse.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/input/mouse/sermouse.c	Tue Oct  8 15:25:03 2002
@@ -247,6 +247,7 @@
 
 	memset(sermouse, 0, sizeof(struct sermouse));
 
+	init_input_dev(&sermouse->dev);
 	sermouse->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
 	sermouse->dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT);
 	sermouse->dev.relbit[0] = BIT(REL_X) | BIT(REL_Y);
diff -Nru a/drivers/input/touchscreen/gunze.c b/drivers/input/touchscreen/gunze.c
--- a/drivers/input/touchscreen/gunze.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/input/touchscreen/gunze.c	Tue Oct  8 15:25:03 2002
@@ -120,6 +120,7 @@
 
 	memset(gunze, 0, sizeof(struct gunze));
 
+	init_input_dev(&gunze->dev);
 	gunze->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);	
 	gunze->dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y);
 	gunze->dev.keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
diff -Nru a/drivers/input/touchscreen/h3600_ts_input.c b/drivers/input/touchscreen/h3600_ts_input.c
--- a/drivers/input/touchscreen/h3600_ts_input.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/input/touchscreen/h3600_ts_input.c	Tue Oct  8 15:25:03 2002
@@ -371,6 +371,8 @@
 
 	memset(ts, 0, sizeof(struct h3600_dev));
 
+	init_input_dev(&ts->dev);
+
 	/* Device specific stuff */
         set_GPIO_IRQ_edge( GPIO_BITSY_ACTION_BUTTON, GPIO_BOTH_EDGES );
         set_GPIO_IRQ_edge( GPIO_BITSY_NPOWER_BUTTON, GPIO_RISING_EDGE );
diff -Nru a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c
--- a/drivers/macintosh/adbhid.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/macintosh/adbhid.c	Tue Oct  8 15:25:03 2002
@@ -479,6 +479,8 @@
 	memset(adbhid[id], 0, sizeof(struct adbhid));
 	sprintf(adbhid[id]->phys, "adb%d:%d.%02x/input", id, default_id, original_handler_id);
 
+	init_input_dev(&adbhid[id]);
+
 	adbhid[id]->id = default_id;
 	adbhid[id]->original_handler_id = original_handler_id;
 	adbhid[id]->current_handler_id = current_handler_id;
diff -Nru a/drivers/macintosh/mac_hid.c b/drivers/macintosh/mac_hid.c
--- a/drivers/macintosh/mac_hid.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/macintosh/mac_hid.c	Tue Oct  8 15:25:03 2002
@@ -91,6 +91,8 @@
 {
 	emumousebtn.name = "Macintosh mouse button emulation";
 
+	init_input_dev(&emumousebtn);
+
 	emumousebtn.evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
 	emumousebtn.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT);
 	emumousebtn.relbit[0] = BIT(REL_X) | BIT(REL_Y);
diff -Nru a/drivers/usb/input/powermate.c b/drivers/usb/input/powermate.c
--- a/drivers/usb/input/powermate.c	Tue Oct  8 15:25:03 2002
+++ b/drivers/usb/input/powermate.c	Tue Oct  8 15:25:03 2002
@@ -317,6 +317,7 @@
 	}
 
 	init_MUTEX(&pm->lock);
+	init_input_dev(&pm->input);
 
 	/* get a handle to the interrupt data pipe */
 	pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress);
diff -Nru a/include/linux/input.h b/include/linux/input.h
--- a/include/linux/input.h	Tue Oct  8 15:25:03 2002
+++ b/include/linux/input.h	Tue Oct  8 15:25:03 2002
@@ -744,6 +744,8 @@
 #define INPUT_KEYCODE(dev, scancode) ((dev->keycodesize == 1) ? ((u8*)dev->keycode)[scancode] : \
 	((dev->keycodesize == 1) ? ((u16*)dev->keycode)[scancode] : (((u32*)dev->keycode)[scancode])))
 
+#define init_input_dev(dev)	do { INIT_LIST_HEAD(&((dev)->h_list)); INIT_LIST_HEAD(&((dev)->node)); } while (0)
+
 struct input_dev {
 
 	void *private;

===================================================================

This BitKeeper patch contains the following changesets:
1.573.1.58
## Wrapped with gzip_uu ##


begin 664 bkpatch17835
M'XL(`*_<HCT``]V<?6_;1A*'_Q8_Q39!6QNUI7U?TH6#)+5[-=IS`CL]''`Y
M&$MR9;&629>DXB3'?O<;DGJA)$HBZ?:@7%+4ED3_.)E]=F9VN.OGZ-?$Q">]
M#]%OJ?%&UG/T4Y2D)[UDDIB^]QE>7T41O!Z,HGLSF%XU<.\&0?@P22WX_*U.
MO1'Z8.+DI$?Z;/Y.^NG!G/2NSO_VZR^OKBSK]!3],-+AK;DV*3H]M=(H_J#'
M?O)2IZ-Q%/;36(?)O4EUWXONL_FE&<68PE]!%,-"9D1BKC*/^(1H3HR/*;<E
MMZ:&O9R:O?+S!&,[_\MX)CA5U#I#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+XF4>7&:_7<X;&>\NF=R?$AMCF[G*
*^B\SRB*[RDX`````
`
end

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [patch] Input - Support for PS/2 Multiplexing spec [4/23]
  2002-10-08 13:41     ` [patch] Input - Support for PS/2 Multiplexing spec [4/23] Vojtech Pavlik
  2002-10-08 13:42       ` [patch] Input - Fix Logitech Desktop Pro wheel [5/23] Vojtech Pavlik
@ 2002-10-08 21:59       ` Pavel Machek
  2002-10-09  9:45         ` Vojtech Pavlik
  1 sibling, 1 reply; 26+ messages in thread
From: Pavel Machek @ 2002-10-08 21:59 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: kernel list

Hi!

PS/2 multiplexing spec? What is that beast? Something allowing
notebook to work with external and internal mouse?
								Pavel

-- 
I'm pavel@ucw.cz. "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents at discuss@linmodems.org

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [patch] Input - Make sure input_dev is initialized where needed [23/23]
  2002-10-08 14:03                                           ` [patch] Input - Make sure input_dev is initialized where needed [23/23] Vojtech Pavlik
@ 2002-10-08 23:48                                             ` Brad Hards
  2002-10-09  0:08                                             ` Paul Mackerras
  1 sibling, 0 replies; 26+ messages in thread
From: Brad Hards @ 2002-10-08 23:48 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: linux-kernel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 9 Oct 2002 00:03, Vojtech Pavlik wrote:
> You can import this changeset into BK by piping this whole message to:
> '| bk receive [path to repository]' or apply the patch as usual.
> 'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.
>
> ===================================================================
>
> ChangeSet@1.573.1.58, 2002-10-08 12:51:35+02:00, vojtech@suse.cz
>   Initialize struct input_dev in input drivers before it's passed to
> input_event(). input_register_device() usually does that, but some drivers
> will call input_event() before registering to pre-load the absolute values
> in struct input_dev in an easy way.
Is this the change we discussed? Every input driver should now
init_input_dev(), irrespective of whether it does input_event() before
registering?

Brad

- --
http://linux.conf.au. 22-25Jan2003. Perth, Aust. I'm registered. Are you?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9o27qW6pHgIdAuOMRAkbUAJ0QRHYO+wEERp1wGVdZOE/0QAzLYQCfVYzF
Kirm1iSdUtdempJu1Kh+fVw=
=cmnq
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [patch] Input - Make sure input_dev is initialized where needed [23/23]
  2002-10-08 14:03                                           ` [patch] Input - Make sure input_dev is initialized where needed [23/23] Vojtech Pavlik
  2002-10-08 23:48                                             ` Brad Hards
@ 2002-10-09  0:08                                             ` Paul Mackerras
  1 sibling, 0 replies; 26+ messages in thread
From: Paul Mackerras @ 2002-10-09  0:08 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: torvalds, linux-kernel

Vojtech,

> You can import this changeset into BK by piping this whole message to:
> '| bk receive [path to repository]' or apply the patch as usual.
> 'bk pull bk://linux-input.bkbits.net/linux-input' should work as well.

It's nice that we get to see the patch, but what would be really nice
is to see the changeset comments that go along with it, which
hopefully explain in a few lines what is being changed and why.  No
doubt the changeset comments are in the gzip_uu part, but that is a
bit opaque.

Thanks,
Paul.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [patch] Input - Support for PS/2 Multiplexing spec [4/23]
  2002-10-08 21:59       ` [patch] Input - Support for PS/2 Multiplexing spec [4/23] Pavel Machek
@ 2002-10-09  9:45         ` Vojtech Pavlik
  0 siblings, 0 replies; 26+ messages in thread
From: Vojtech Pavlik @ 2002-10-09  9:45 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Vojtech Pavlik, kernel list

On Tue, Oct 08, 2002 at 11:59:37PM +0200, Pavel Machek wrote:

> PS/2 multiplexing spec? What is that beast? Something allowing
> notebook to work with external and internal mouse?

Exactly. It's a spec that if supported by your notebook allows the
driver to recognize which attached mouse/touchpad/touchpoint/whatever
the data is coming from and thus can talk different protocols to each of
the devices.

-- 
Vojtech Pavlik
SuSE Labs

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2002-10-09  9:40 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-08 13:38 [patch] Input - Beeping and sysrq on m68k [1/23] Vojtech Pavlik
     [not found] ` <20021008153926.A18546@ucw.cz>
2002-10-08 13:40   ` [patch] Input - Better naming of HID devices [3/23] Vojtech Pavlik
2002-10-08 13:41     ` [patch] Input - Support for PS/2 Multiplexing spec [4/23] Vojtech Pavlik
2002-10-08 13:42       ` [patch] Input - Fix Logitech Desktop Pro wheel [5/23] Vojtech Pavlik
2002-10-08 13:44         ` [patch] Input - Update of wacom.c from 2.4 and Wacom Inc. [6/23] Vojtech Pavlik
2002-10-08 13:45           ` [patch] Input - Use lists.h in gameport core [7/23] Vojtech Pavlik
2002-10-08 13:46             ` [patch] Input - Use lists.h in serio core [8/23] Vojtech Pavlik
2002-10-08 13:47               ` [patch] Input - wacom.c cleanups and fixes [9/23] Vojtech Pavlik
2002-10-08 13:48                 ` [patch] Input - add #include <lists.h> to input.h [10/23] Vojtech Pavlik
2002-10-08 13:49                   ` [patch] Input - Use list_for_each_entry() in input.c [11/23] Vojtech Pavlik
2002-10-08 13:50                     ` [patch] Input - Use lists.h in event handlers [12/23] Vojtech Pavlik
2002-10-08 13:50                       ` [patch] Fixes/cleanups after lists.h conversion [13/23] Vojtech Pavlik
2002-10-08 13:51                         ` [patch] Fix aux detection on some notebooks [14/23] Vojtech Pavlik
2002-10-08 13:52                           ` [patch] Input - Add Set 3 japanese scancodes [15/23] Vojtech Pavlik
2002-10-08 13:56                             ` [patch] Input - BK Merge patch [16/23] Vojtech Pavlik
2002-10-08 13:58                               ` [patch] Input - Minor m68k cleanups [17/23] Vojtech Pavlik
2002-10-08 13:59                                 ` [patch] Input - Fix serial mouse wheel, increase timeout [18/23] Vojtech Pavlik
2002-10-08 14:00                                   ` [patch] Input - Fix LAlt-RAlt and similar combinations in atkbd.c [19/23] Vojtech Pavlik
2002-10-08 14:01                                     ` [patch] Input - Make NR_KEYS be KEY_MAX+1 [20/23] Vojtech Pavlik
2002-10-08 14:01                                       ` [patch] Input - Ignore mouse sync bit [21/23] Vojtech Pavlik
2002-10-08 14:02                                         ` [patch] Input - Change extra key mappings for MS Keyboards [22/23] Vojtech Pavlik
2002-10-08 14:03                                           ` [patch] Input - Make sure input_dev is initialized where needed [23/23] Vojtech Pavlik
2002-10-08 23:48                                             ` Brad Hards
2002-10-09  0:08                                             ` Paul Mackerras
2002-10-08 21:59       ` [patch] Input - Support for PS/2 Multiplexing spec [4/23] Pavel Machek
2002-10-09  9:45         ` Vojtech Pavlik

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).