diff --unified --recursive --new-file linux-2.6.4/drivers/char/Kconfig linux-2.6.4a/drivers/char/Kconfig --- linux-2.6.4/drivers/char/Kconfig 2004-03-10 20:55:21.000000000 -0600 +++ linux-2.6.4a/drivers/char/Kconfig 2004-03-23 08:35:08.000000000 -0600 @@ -35,6 +35,16 @@ If unsure, say Y, or else you won't be able to do much with your new shiny Linux system :-) +config IPAC + bool "Support for IPAC Arcade controller" + depends on VT && INPUT + default n + ---help--- + If you say Y here, you will get support for the IPAC arcade + controller (http://www.ultimarc.com) through IOCTL functions. + + If you are not using this as an arcade box, say N + config VT_CONSOLE bool "Support for console on virtual terminal" if EMBEDDED depends on VT diff --unified --recursive --new-file linux-2.6.4/drivers/char/Makefile linux-2.6.4a/drivers/char/Makefile --- linux-2.6.4/drivers/char/Makefile 2004-03-10 20:55:45.000000000 -0600 +++ linux-2.6.4a/drivers/char/Makefile 2004-03-23 04:09:06.000000000 -0600 @@ -11,6 +11,7 @@ obj-$(CONFIG_VT) += vt_ioctl.o vc_screen.o consolemap.o \ consolemap_deftbl.o selection.o keyboard.o +obj-$(CONFIG_IPAC) += vt.o obj-$(CONFIG_HW_CONSOLE) += vt.o defkeymap.o obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o obj-$(CONFIG_ESPSERIAL) += esp.o diff --unified --recursive --new-file linux-2.6.4/drivers/char/keyboard.c linux-2.6.4a/drivers/char/keyboard.c --- linux-2.6.4/drivers/char/keyboard.c 2004-03-10 20:56:03.000000000 -0600 +++ linux-2.6.4a/drivers/char/keyboard.c 2004-03-23 03:54:11.000000000 -0600 @@ -848,6 +848,9 @@ { if (!(led & ~7)) { ledioctl = led; +#if defined(CONFIG_IPAC) + ledstate = 0xff; +#endif kbd->ledmode = LED_SHOW_IOCTL; } else kbd->ledmode = LED_SHOW_FLAGS; @@ -907,14 +910,24 @@ { struct list_head * node; unsigned char leds = getleds(); - +#if defined(CONFIG_IPAC) + struct kbd_struct *kbd = kbd_table + fg_console; +#endif if (leds != ledstate) { list_for_each(node,&kbd_handler.h_list) { struct input_handle * handle = to_handle_h(node); - input_event(handle->dev, EV_LED, LED_SCROLLL, !!(leds & 0x01)); - input_event(handle->dev, EV_LED, LED_NUML, !!(leds & 0x02)); - input_event(handle->dev, EV_LED, LED_CAPSL, !!(leds & 0x04)); - input_sync(handle->dev); +#if defined(CONFIG_IPAC) + if (kbd->ledmode == LED_SHOW_IOCTL) + input_event(handle->dev, EV_LED, LED_IPAC , leds); + else { +#endif + input_event(handle->dev, EV_LED, LED_SCROLLL, !!(leds & 0x01)); + input_event(handle->dev, EV_LED, LED_NUML, !!(leds & 0x02)); + input_event(handle->dev, EV_LED, LED_CAPSL, !!(leds & 0x04)); + input_sync(handle->dev); +#if defined(CONFIG_IPAC) + } +#endif } } diff --unified --recursive --new-file linux-2.6.4/drivers/input/input.c linux-2.6.4a/drivers/input/input.c --- linux-2.6.4/drivers/input/input.c 2004-03-10 20:55:28.000000000 -0600 +++ linux-2.6.4a/drivers/input/input.c 2004-03-23 06:58:17.000000000 -0600 @@ -149,11 +149,30 @@ break; case EV_LED: - - if (code > LED_MAX || !test_bit(code, dev->ledbit) || !!test_bit(code, dev->led) == value) - return; - change_bit(code, dev->led); +#if defined(CONFIG_IPAC) + if (code == LED_IPAC) { + + if (!!test_bit(2,dev->led) != !!(value & 0x1)) + change_bit(2, dev->led); + + if (!!test_bit(0, dev->led) != !!(value & 0x2)) + change_bit(0, dev->led); + + if (!!test_bit(1, dev->led) != !!(value & 0x4)) + change_bit(1, dev->led); + + if (dev->event) dev->event(dev, type, code, value); + + break; + } +#endif + + if (code > LED_MAX || !test_bit(code, dev->ledbit) || !!test_bit(code, dev->led) == value) + return; + + change_bit(code,dev->led); + if (dev->event) dev->event(dev, type, code, value); break; diff --unified --recursive --new-file linux-2.6.4/include/linux/input.h linux-2.6.4a/include/linux/input.h --- linux-2.6.4/include/linux/input.h 2004-03-10 20:55:26.000000000 -0600 +++ linux-2.6.4a/include/linux/input.h 2004-03-23 03:48:46.000000000 -0600 @@ -542,6 +542,7 @@ #define LED_SUSPEND 0x06 #define LED_MUTE 0x07 #define LED_MISC 0x08 +#define LED_IPAC 0x09 #define LED_MAX 0x0f /*