Skip to contentSkip to conversation

input-ps2: Put serio and serport in drivers/input

PATCH In review Chip Salzenberg 2 participants 2 messages Oct 18, 2001

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 input-ps2: Put serio and serport in drivers/input

The recently posted input-ps2 patch breaks if the serio and serport object files in drivers/char/joystick are required only for PS/2 (i.e. they weren't enabled already for joysticks). And that brings up the question: What the heck are those files doing in the joystick driver dir in the first place?!

It seems to me that serio.c and serport.c belong in drivers/input more than anywhere else. I'm enclosing a patch that handles just such a relocation. The patch doesn't actually move the files ... that would just inflate the patch, and it's a lot easier to just "mv" them.

Share & Enjoy!

Signature · 2 lines
Chip Salzenberg               - a.k.a. -              <[email protected]>
 "We have no fuel on board, plus or minus 8 kilograms."  -- NEAR tech

Index: drivers/char/Config.in

char/Config.in renamed from char/Config.in.old +6 -7
@@ -103,13 +103,12 @@
 fi
 
-if [ "$CONFIG_INPUT" != "n" -a "CONFIG_INPUT_KEYBDEV" != "n" ]; then
+if [ "$CONFIG_INPUT" != "n" -a "CONFIG_INPUT_KEYBDEV" != "n" -a "$CONFIG_INPUT_SERIO" != "n" ]; then
    bool 'PS/2 port support' CONFIG_INPUT_PS2
    if [ "$CONFIG_INPUT_PS2" != "n" ]; then
-      tristate '  i8042 aux+kbd controller' CONFIG_INPUT_I8042
-      comment 'PS/2 port input devices'
-      tristate '  XT keyboard' CONFIG_INPUT_XTKBD
-      tristate '  AT and PS/2 keyboards' CONFIG_INPUT_ATKBD
-      tristate '  PS/2 mouse' CONFIG_INPUT_PSMOUSE
-   fi	
+      dep_tristate '  i8042 aux+kbd controller' CONFIG_INPUT_I8042 $CONFIG_INPUT_SERIO
+      dep_tristate '  XT keyboard' CONFIG_INPUT_XTKBD $CONFIG_INPUT_SERIO
+      dep_tristate '  AT and PS/2 keyboards' CONFIG_INPUT_ATKBD $CONFIG_INPUT_SERIO
+      dep_tristate '  PS/2 mouse' CONFIG_INPUT_PSMOUSE $CONFIG_INPUT_SERIO
+   fi
 else
    comment 'Input core support is needed for new PS/2 drivers' 

Index: drivers/char/Makefile

char/Makefile renamed from char/Makefile.old +4 -4
@@ -143,8 +143,8 @@
 endif
 
-obj-$(CONFIG_INPUT_I8042)       += i8042.o joystick/serio.o
-obj-$(CONFIG_INPUT_ATKBD)       += atkbd.o joystick/serio.o
-obj-$(CONFIG_INPUT_XTKBD)       += xtkbd.o joystick/serio.o
-obj-$(CONFIG_INPUT_PSMOUSE)     += psmouse.o joystick/serio.o
+obj-$(CONFIG_INPUT_I8042)       += i8042.o
+obj-$(CONFIG_INPUT_ATKBD)       += atkbd.o
+obj-$(CONFIG_INPUT_XTKBD)       += xtkbd.o
+obj-$(CONFIG_INPUT_PSMOUSE)     += psmouse.o
 
 obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o

Index: drivers/char/joystick/Config.in

char/joystick/Config.in renamed from char/joystick/Config.in.old +0 -2
@@ -13,6 +13,4 @@
       dep_tristate '  Crystal SoundFusion gameports' CONFIG_INPUT_CS461X  $CONFIG_INPUT_GAMEPORT
       dep_tristate '  SoundBlaster Live! gameports' CONFIG_INPUT_EMU10K1 $CONFIG_INPUT_GAMEPORT
-   tristate 'Serial port device support' CONFIG_INPUT_SERIO
-      dep_tristate '  Serial port input line discipline' CONFIG_INPUT_SERPORT $CONFIG_INPUT_SERIO
 else
    # Must explicitly set to n for drivers/sound/Config.in

Index: drivers/char/joystick/Makefile

char/joystick/Makefile renamed from char/joystick/Makefile.old +1 -4
@@ -7,5 +7,5 @@
 # Objects that export symbols.
 
-export-objs	:= serio.o gameport.o
+export-objs	:= gameport.o
 
 # I-Force may need both USB and RS-232
@@ -32,7 +32,4 @@
 
 obj-$(CONFIG_INPUT_GAMEPORT)	+= gameport.o
-obj-$(CONFIG_INPUT_SERIO)	+= serio.o
-
-obj-$(CONFIG_INPUT_SERPORT)	+= serport.o
 
 obj-$(CONFIG_INPUT_NS558)	+= ns558.o

Index: drivers/input/Config.in

input/Config.in renamed from input/Config.in.old +2 -0
@@ -14,4 +14,6 @@
 fi
 dep_tristate '  Joystick support' CONFIG_INPUT_JOYDEV $CONFIG_INPUT
+dep_tristate '  Serial support' CONFIG_INPUT_SERIO $CONFIG_INPUT
+dep_tristate '    Serial line discipline' CONFIG_INPUT_SERPORT $CONFIG_INPUT_SERIO
 dep_tristate '  Event interface support' CONFIG_INPUT_EVDEV $CONFIG_INPUT
 

Index: drivers/input/Makefile

input/Makefile renamed from input/Makefile.old +3 -1
@@ -9,5 +9,5 @@
 # Objects that export symbols.
 
-export-objs	:= input.o
+export-objs	:= input.o serio.o
 
 # Object file lists.
@@ -25,4 +25,6 @@
 obj-$(CONFIG_INPUT_JOYDEV)	+= joydev.o
 obj-$(CONFIG_INPUT_EVDEV)	+= evdev.o
+obj-$(CONFIG_INPUT_SERIO)	+= serio.o
+obj-$(CONFIG_INPUT_SERPORT)	+= serport.o
 
 # The global Rules.make.
#1 lore raw
Quoted 6 lines

The recently posted input-ps2 patch breaks if the serio and serport object files in drivers/char/joystick are required only for PS/2 (i.e. they weren't enabled already for joysticks). And that brings up the question: What the heck are those files doing in the joystick driver dir in the first place?!

Well originally the only serial input devices where joysticks. As time goes on this is not true any longer. We have several non joystick serio based devices in CVS. Plus we use the serio setup for non serial but PIO type input devices. PS/2 is a good example of such hardware. So yes I agree serio.c and serport.c should be moved into drivers/input. I had this problem when developing the h3600 touchscreen driver for the iPAQ using the input api.

Quoted 4 lines

It seems to me that serio.c and serport.c belong in drivers/input more than anywhere else. I'm enclosing a patch that handles just such a relocation. The patch doesn't actually move the files ... that would just inflate the patch, and it's a lot easier to just "mv" them.

Actually I like to see all input devices in drivers/input but last time I suggested that it was shot down. In time they will be moved there. Either that or drivers/char will be 95% input drivers.