Commit b99ec337 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/vojtech/input

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents f61bc5fb a21165ce
...@@ -335,6 +335,7 @@ controller (compatible with DirectPadPro): ...@@ -335,6 +335,7 @@ controller (compatible with DirectPadPro):
* Analog PSX Pad (red mode) * Analog PSX Pad (red mode)
* Analog PSX Pad (green mode) * Analog PSX Pad (green mode)
* PSX Rumble Pad * PSX Rumble Pad
* PSX DDR Pad
2.4 Sega 2.4 Sega
~~~~~~~~ ~~~~~~~~
...@@ -452,14 +453,22 @@ uses the following kernel/module command line: ...@@ -452,14 +453,22 @@ uses the following kernel/module command line:
5 | Multisystem 2-button joystick 5 | Multisystem 2-button joystick
6 | N64 pad 6 | N64 pad
7 | Sony PSX controller 7 | Sony PSX controller
8 | Sony PSX DDR controller
The exact type of the PSX controller type is autoprobed, so you must have The exact type of the PSX controller type is autoprobed when used so
your controller plugged in before initializing. hot swapping should work (but is not recomended).
Should you want to use more than one of parallel ports at once, you can use Should you want to use more than one of parallel ports at once, you can use
gamecon.map2 and gamecon.map3 as additional command line parameters for two gamecon.map2 and gamecon.map3 as additional command line parameters for two
more parallel ports. more parallel ports.
There are two options specific to PSX driver portion. gamecon.psx_delay sets
the command delay when talking to the controllers. The default of 25 should
work but you can try lowering it for better performace. If your pads don't
respond try raising it untill they work. Setting the type to 8 allows the
driver to be used with Dance Dance Revolution or similar games. Arrow keys are
registered as key presses instead of X and Y axes.
3.2 db9.c 3.2 db9.c
~~~~~~~~~ ~~~~~~~~~
Apart from making an interface, there is nothing difficult on using the Apart from making an interface, there is nothing difficult on using the
......
...@@ -669,6 +669,12 @@ running once the system is up. ...@@ -669,6 +669,12 @@ running once the system is up.
mga= [HW,DRM] mga= [HW,DRM]
mousedev.tap_time=
[MOUSE] Maximum time between finger touching and
leaving touchpad surface for touch to be considered
a tap and be reported as a left button click (for
touchpads working in absolute mode only).
Format: <msecs>
mousedev.xres= [MOUSE] Horizontal screen resolution, used for devices mousedev.xres= [MOUSE] Horizontal screen resolution, used for devices
reporting absolute coordinates, such as tablets reporting absolute coordinates, such as tablets
mousedev.yres= [MOUSE] Vertical screen resolution, used for devices mousedev.yres= [MOUSE] Vertical screen resolution, used for devices
......
...@@ -1078,6 +1078,13 @@ M: lethal@chaoticdreams.org ...@@ -1078,6 +1078,13 @@ M: lethal@chaoticdreams.org
L: linux-fbdev-devel@lists.sourceforge.net L: linux-fbdev-devel@lists.sourceforge.net
S: Maintained S: Maintained
INPUT (KEYBOARD, MOUSE, JOYSTICK) DRIVERS
P: Vojtech Pavlik
M: vojtech@suse.cz
L: linux-input@atrey.karlin.mff.cuni.cz
L: linux-joystick@atrey.karlin.mff.cuni.cz
S: Maintained
INTEL 810/815 FRAMEBUFFER DRIVER INTEL 810/815 FRAMEBUFFER DRIVER
P: Antonino Daplas P: Antonino Daplas
M: adaplas@pol.net M: adaplas@pol.net
...@@ -1202,13 +1209,6 @@ L: jfs-discussion@oss.software.ibm.com ...@@ -1202,13 +1209,6 @@ L: jfs-discussion@oss.software.ibm.com
W: http://oss.software.ibm.com/jfs/ W: http://oss.software.ibm.com/jfs/
S: Supported S: Supported
JOYSTICK DRIVER
P: Vojtech Pavlik
M: vojtech@suse.cz
L: linux-joystick@atrey.karlin.mff.cuni.cz
W: http://www.suse.cz/development/joystick/
S: Maintained
KCONFIG KCONFIG
P: Roman Zippel P: Roman Zippel
M: zippel@linux-m68k.org M: zippel@linux-m68k.org
...@@ -2220,12 +2220,11 @@ M: dbrownell@users.sourceforge.net ...@@ -2220,12 +2220,11 @@ M: dbrownell@users.sourceforge.net
L: linux-usb-devel@lists.sourceforge.net L: linux-usb-devel@lists.sourceforge.net
S: Maintained S: Maintained
USB HID/HIDBP/INPUT DRIVERS USB HID/HIDBP DRIVERS
P: Vojtech Pavlik P: Vojtech Pavlik
M: vojtech@suse.cz M: vojtech@suse.cz
L: linux-usb-users@lists.sourceforge.net L: linux-usb-users@lists.sourceforge.net
L: linux-usb-devel@lists.sourceforge.net L: linux-usb-devel@lists.sourceforge.net
W: http://www.suse.cz/development/input/
S: Maintained S: Maintained
USB HUB DRIVER USB HUB DRIVER
......
...@@ -16,6 +16,9 @@ obj-$(CONFIG_PNP) += pnp/ ...@@ -16,6 +16,9 @@ obj-$(CONFIG_PNP) += pnp/
# char/ comes before serial/ etc so that the VT console is the boot-time # char/ comes before serial/ etc so that the VT console is the boot-time
# default. # default.
obj-y += char/ obj-y += char/
# we also need input/serio early so serio bus is initialized by the time
# serial drivers start registering their serio ports
obj-$(CONFIG_SERIO) += input/serio/
obj-y += serial/ obj-y += serial/
obj-$(CONFIG_PARPORT) += parport/ obj-$(CONFIG_PARPORT) += parport/
obj-y += base/ block/ misc/ net/ media/ obj-y += base/ block/ misc/ net/ media/
...@@ -40,7 +43,6 @@ obj-$(CONFIG_USB) += usb/ ...@@ -40,7 +43,6 @@ obj-$(CONFIG_USB) += usb/
obj-$(CONFIG_USB_GADGET) += usb/gadget/ obj-$(CONFIG_USB_GADGET) += usb/gadget/
obj-$(CONFIG_INPUT) += input/ obj-$(CONFIG_INPUT) += input/
obj-$(CONFIG_GAMEPORT) += input/gameport/ obj-$(CONFIG_GAMEPORT) += input/gameport/
obj-$(CONFIG_SERIO) += input/serio/
obj-$(CONFIG_I2O) += message/ obj-$(CONFIG_I2O) += message/
obj-$(CONFIG_I2C) += i2c/ obj-$(CONFIG_I2C) += i2c/
obj-$(CONFIG_W1) += w1/ obj-$(CONFIG_W1) += w1/
......
...@@ -123,7 +123,7 @@ int shift_state = 0; ...@@ -123,7 +123,7 @@ int shift_state = 0;
*/ */
static struct input_handler kbd_handler; static struct input_handler kbd_handler;
static unsigned long key_down[256/BITS_PER_LONG]; /* keyboard key bitmap */ static unsigned long key_down[NBITS(KEY_MAX)]; /* keyboard key bitmap */
static unsigned char shift_down[NR_SHIFT]; /* shift state counters.. */ static unsigned char shift_down[NR_SHIFT]; /* shift state counters.. */
static int dead_key_next; static int dead_key_next;
static int npadch = -1; /* -1 or number assembled on pad */ static int npadch = -1; /* -1 or number assembled on pad */
...@@ -142,7 +142,7 @@ static struct ledptr { ...@@ -142,7 +142,7 @@ static struct ledptr {
/* Simple translation table for the SysRq keys */ /* Simple translation table for the SysRq keys */
#ifdef CONFIG_MAGIC_SYSRQ #ifdef CONFIG_MAGIC_SYSRQ
unsigned char kbd_sysrq_xlate[128] = unsigned char kbd_sysrq_xlate[KEY_MAX] =
"\000\0331234567890-=\177\t" /* 0x00 - 0x0f */ "\000\0331234567890-=\177\t" /* 0x00 - 0x0f */
"qwertyuiop[]\r\000as" /* 0x10 - 0x1f */ "qwertyuiop[]\r\000as" /* 0x10 - 0x1f */
"dfghjkl;'`\000\\zxcv" /* 0x20 - 0x2f */ "dfghjkl;'`\000\\zxcv" /* 0x20 - 0x2f */
...@@ -941,6 +941,9 @@ void kbd_refresh_leds(struct input_handle *handle) ...@@ -941,6 +941,9 @@ void kbd_refresh_leds(struct input_handle *handle)
#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) || defined(CONFIG_PARISC) || defined(CONFIG_SUPERH) #if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) || defined(CONFIG_PARISC) || defined(CONFIG_SUPERH)
#define HW_RAW(dev) (test_bit(EV_MSC, dev->evbit) && test_bit(MSC_RAW, dev->mscbit) &&\
((dev)->id.bustype == BUS_I8042) && ((dev)->id.vendor == 0x0001) && ((dev)->id.product == 0x0001))
static unsigned short x86_keycodes[256] = static unsigned short x86_keycodes[256] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
...@@ -1007,6 +1010,8 @@ static int emulate_raw(struct vc_data *vc, unsigned int keycode, ...@@ -1007,6 +1010,8 @@ static int emulate_raw(struct vc_data *vc, unsigned int keycode,
#else #else
#define HW_RAW(dev) 0
#warning "Cannot generate rawmode keyboard for your architecture yet." #warning "Cannot generate rawmode keyboard for your architecture yet."
static int emulate_raw(struct vc_data *vc, unsigned int keycode, unsigned char up_flag) static int emulate_raw(struct vc_data *vc, unsigned int keycode, unsigned char up_flag)
...@@ -1019,7 +1024,15 @@ static int emulate_raw(struct vc_data *vc, unsigned int keycode, unsigned char u ...@@ -1019,7 +1024,15 @@ static int emulate_raw(struct vc_data *vc, unsigned int keycode, unsigned char u
} }
#endif #endif
void kbd_keycode(unsigned int keycode, int down, struct pt_regs *regs) void kbd_rawcode(unsigned char data)
{
struct vc_data *vc = vc_cons[fg_console].d;
kbd = kbd_table + fg_console;
if (kbd->kbdmode == VC_RAW)
put_queue(vc, data);
}
void kbd_keycode(unsigned int keycode, int down, int hw_raw, struct pt_regs *regs)
{ {
struct vc_data *vc = vc_cons[fg_console].d; struct vc_data *vc = vc_cons[fg_console].d;
unsigned short keysym, *key_map; unsigned short keysym, *key_map;
...@@ -1053,7 +1066,7 @@ void kbd_keycode(unsigned int keycode, int down, struct pt_regs *regs) ...@@ -1053,7 +1066,7 @@ void kbd_keycode(unsigned int keycode, int down, struct pt_regs *regs)
return; return;
#endif /* CONFIG_MAC_EMUMOUSEBTN */ #endif /* CONFIG_MAC_EMUMOUSEBTN */
if ((raw_mode = (kbd->kbdmode == VC_RAW))) if ((raw_mode = (kbd->kbdmode == VC_RAW)) && !hw_raw)
if (emulate_raw(vc, keycode, !down << 7)) if (emulate_raw(vc, keycode, !down << 7))
if (keycode < BTN_MISC) if (keycode < BTN_MISC)
printk(KERN_WARNING "keyboard.c: can't emulate rawmode for keycode %d\n", keycode); printk(KERN_WARNING "keyboard.c: can't emulate rawmode for keycode %d\n", keycode);
...@@ -1119,6 +1132,9 @@ void kbd_keycode(unsigned int keycode, int down, struct pt_regs *regs) ...@@ -1119,6 +1132,9 @@ void kbd_keycode(unsigned int keycode, int down, struct pt_regs *regs)
return; return;
} }
if (keycode > NR_KEYS)
return;
keysym = key_map[keycode]; keysym = key_map[keycode];
type = KTYP(keysym); type = KTYP(keysym);
...@@ -1148,11 +1164,12 @@ void kbd_keycode(unsigned int keycode, int down, struct pt_regs *regs) ...@@ -1148,11 +1164,12 @@ void kbd_keycode(unsigned int keycode, int down, struct pt_regs *regs)
} }
static void kbd_event(struct input_handle *handle, unsigned int event_type, static void kbd_event(struct input_handle *handle, unsigned int event_type,
unsigned int keycode, int down) unsigned int event_code, int value)
{ {
if (event_type != EV_KEY) if (event_type == EV_MSC && event_code == MSC_RAW && HW_RAW(handle->dev))
return; kbd_rawcode(value);
kbd_keycode(keycode, down, handle->dev->regs); if (event_type == EV_KEY)
kbd_keycode(event_code, value, HW_RAW(handle->dev), handle->dev->regs);
tasklet_schedule(&keyboard_tasklet); tasklet_schedule(&keyboard_tasklet);
do_poke_blanked_console = 1; do_poke_blanked_console = 1;
schedule_console_callback(); schedule_console_callback();
......
...@@ -50,8 +50,11 @@ struct emu { ...@@ -50,8 +50,11 @@ struct emu {
}; };
static struct pci_device_id emu_tbl[] = { static struct pci_device_id emu_tbl[] = {
{ 0x1102, 0x7002, PCI_ANY_ID, PCI_ANY_ID }, /* SB Live gameport */ { 0x1102, 0x7002, PCI_ANY_ID, PCI_ANY_ID }, /* SB Live gameport */
{ 0x1102, 0x7003, PCI_ANY_ID, PCI_ANY_ID }, /* Audigy gameport */ { 0x1102, 0x7003, PCI_ANY_ID, PCI_ANY_ID }, /* Audigy gameport */
{ 0x1102, 0x7004, PCI_ANY_ID, PCI_ANY_ID }, /* Dell SB Live */
{ 0x1102, 0x7005, PCI_ANY_ID, PCI_ANY_ID }, /* Audigy LS gameport */
{ 0, } { 0, }
}; };
......
...@@ -232,8 +232,10 @@ static ssize_t joydev_read(struct file *file, char __user *buf, size_t count, lo ...@@ -232,8 +232,10 @@ static ssize_t joydev_read(struct file *file, char __user *buf, size_t count, lo
&& list->head == list->tail && (file->f_flags & O_NONBLOCK)) && list->head == list->tail && (file->f_flags & O_NONBLOCK))
return -EAGAIN; return -EAGAIN;
retval = wait_event_interruptible(list->joydev->wait, list->joydev->exist retval = wait_event_interruptible(list->joydev->wait,
&& (list->startup < joydev->nabs + joydev->nkey || list->head != list->tail)); !list->joydev->exist ||
list->startup < joydev->nabs + joydev->nkey ||
list->head != list->tail);
if (retval) if (retval)
return retval; return retval;
......
...@@ -247,7 +247,7 @@ config JOYSTICK_AMIGA ...@@ -247,7 +247,7 @@ config JOYSTICK_AMIGA
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called amijoy. module will be called amijoy.
config INPUT_JOYDUMP config JOYSTICK_JOYDUMP
tristate "Gameport data dumper" tristate "Gameport data dumper"
depends on INPUT && INPUT_JOYSTICK depends on INPUT && INPUT_JOYSTICK
help help
......
This diff is collapsed.
...@@ -524,7 +524,7 @@ static int __init iforce_init(void) ...@@ -524,7 +524,7 @@ static int __init iforce_init(void)
usb_register(&iforce_usb_driver); usb_register(&iforce_usb_driver);
#endif #endif
#ifdef CONFIG_JOYSTICK_IFORCE_232 #ifdef CONFIG_JOYSTICK_IFORCE_232
serio_register_device(&iforce_serio_dev); serio_register_driver(&iforce_serio_drv);
#endif #endif
return 0; return 0;
} }
...@@ -535,7 +535,7 @@ static void __exit iforce_exit(void) ...@@ -535,7 +535,7 @@ static void __exit iforce_exit(void)
usb_deregister(&iforce_usb_driver); usb_deregister(&iforce_usb_driver);
#endif #endif
#ifdef CONFIG_JOYSTICK_IFORCE_232 #ifdef CONFIG_JOYSTICK_IFORCE_232
serio_unregister_device(&iforce_serio_dev); serio_unregister_driver(&iforce_serio_drv);
#endif #endif
} }
......
...@@ -124,7 +124,7 @@ static irqreturn_t iforce_serio_irq(struct serio *serio, ...@@ -124,7 +124,7 @@ static irqreturn_t iforce_serio_irq(struct serio *serio,
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static void iforce_serio_connect(struct serio *serio, struct serio_dev *dev) static void iforce_serio_connect(struct serio *serio, struct serio_driver *drv)
{ {
struct iforce *iforce; struct iforce *iforce;
if (serio->type != (SERIO_RS232 | SERIO_IFORCE)) if (serio->type != (SERIO_RS232 | SERIO_IFORCE))
...@@ -137,7 +137,7 @@ static void iforce_serio_connect(struct serio *serio, struct serio_dev *dev) ...@@ -137,7 +137,7 @@ static void iforce_serio_connect(struct serio *serio, struct serio_dev *dev)
iforce->serio = serio; iforce->serio = serio;
serio->private = iforce; serio->private = iforce;
if (serio_open(serio, dev)) { if (serio_open(serio, drv)) {
kfree(iforce); kfree(iforce);
return; return;
} }
...@@ -158,9 +158,13 @@ static void iforce_serio_disconnect(struct serio *serio) ...@@ -158,9 +158,13 @@ static void iforce_serio_disconnect(struct serio *serio)
kfree(iforce); kfree(iforce);
} }
struct serio_dev iforce_serio_dev = { struct serio_driver iforce_serio_drv = {
.write_wakeup = iforce_serio_write_wakeup, .driver = {
.interrupt = iforce_serio_irq, .name = "iforce",
.connect = iforce_serio_connect, },
.disconnect = iforce_serio_disconnect, .description = "RS232 I-Force joysticks and wheels driver",
.write_wakeup = iforce_serio_write_wakeup,
.interrupt = iforce_serio_irq,
.connect = iforce_serio_connect,
.disconnect = iforce_serio_disconnect,
}; };
...@@ -187,5 +187,5 @@ int iforce_upload_constant(struct iforce*, struct ff_effect*, int is_update); ...@@ -187,5 +187,5 @@ int iforce_upload_constant(struct iforce*, struct ff_effect*, int is_update);
int iforce_upload_condition(struct iforce*, struct ff_effect*, int is_update); int iforce_upload_condition(struct iforce*, struct ff_effect*, int is_update);
/* Public variables */ /* Public variables */
extern struct serio_dev iforce_serio_dev; extern struct serio_driver iforce_serio_drv;
extern struct usb_driver iforce_usb_driver; extern struct usb_driver iforce_usb_driver;
...@@ -35,8 +35,10 @@ ...@@ -35,8 +35,10 @@
#include <linux/serio.h> #include <linux/serio.h>
#include <linux/init.h> #include <linux/init.h>
#define DRIVER_DESC "Magellan and SpaceMouse 6dof controller driver"
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Magellan and SpaceMouse 6dof controller driver"); MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
/* /*
...@@ -146,7 +148,7 @@ static void magellan_disconnect(struct serio *serio) ...@@ -146,7 +148,7 @@ static void magellan_disconnect(struct serio *serio)
* it as an input device. * it as an input device.
*/ */
static void magellan_connect(struct serio *serio, struct serio_dev *dev) static void magellan_connect(struct serio *serio, struct serio_driver *drv)
{ {
struct magellan *magellan; struct magellan *magellan;
int i, t; int i, t;
...@@ -184,7 +186,7 @@ static void magellan_connect(struct serio *serio, struct serio_dev *dev) ...@@ -184,7 +186,7 @@ static void magellan_connect(struct serio *serio, struct serio_dev *dev)
serio->private = magellan; serio->private = magellan;
if (serio_open(serio, dev)) { if (serio_open(serio, drv)) {
kfree(magellan); kfree(magellan);
return; return;
} }
...@@ -199,10 +201,14 @@ static void magellan_connect(struct serio *serio, struct serio_dev *dev) ...@@ -199,10 +201,14 @@ static void magellan_connect(struct serio *serio, struct serio_dev *dev)
* The serio device structure. * The serio device structure.
*/ */
static struct serio_dev magellan_dev = { static struct serio_driver magellan_drv = {
.interrupt = magellan_interrupt, .driver = {
.connect = magellan_connect, .name = "magellan",
.disconnect = magellan_disconnect, },
.description = DRIVER_DESC,
.interrupt = magellan_interrupt,
.connect = magellan_connect,
.disconnect = magellan_disconnect,
}; };
/* /*
...@@ -211,13 +217,13 @@ static struct serio_dev magellan_dev = { ...@@ -211,13 +217,13 @@ static struct serio_dev magellan_dev = {
int __init magellan_init(void) int __init magellan_init(void)
{ {
serio_register_device(&magellan_dev); serio_register_driver(&magellan_drv);
return 0; return 0;
} }
void __exit magellan_exit(void) void __exit magellan_exit(void)
{ {
serio_unregister_device(&magellan_dev); serio_unregister_driver(&magellan_drv);
} }
module_init(magellan_init); module_init(magellan_init);
......
...@@ -39,8 +39,10 @@ ...@@ -39,8 +39,10 @@
#include <linux/input.h> #include <linux/input.h>
#include <linux/serio.h> #include <linux/serio.h>
#define DRIVER_DESC "SpaceTec SpaceBall 2003/3003/4000 FLX driver"
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("SpaceTec SpaceBall 2003/3003/4000 FLX driver"); MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
/* /*
...@@ -201,7 +203,7 @@ static void spaceball_disconnect(struct serio *serio) ...@@ -201,7 +203,7 @@ static void spaceball_disconnect(struct serio *serio)
* it as an input device. * it as an input device.
*/ */
static void spaceball_connect(struct serio *serio, struct serio_dev *dev) static void spaceball_connect(struct serio *serio, struct serio_driver *drv)
{ {
struct spaceball *spaceball; struct spaceball *spaceball;
int i, t, id; int i, t, id;
...@@ -254,7 +256,7 @@ static void spaceball_connect(struct serio *serio, struct serio_dev *dev) ...@@ -254,7 +256,7 @@ static void spaceball_connect(struct serio *serio, struct serio_dev *dev)
serio->private = spaceball; serio->private = spaceball;
if (serio_open(serio, dev)) { if (serio_open(serio, drv)) {
kfree(spaceball); kfree(spaceball);
return; return;
} }
...@@ -269,10 +271,14 @@ static void spaceball_connect(struct serio *serio, struct serio_dev *dev) ...@@ -269,10 +271,14 @@ static void spaceball_connect(struct serio *serio, struct serio_dev *dev)
* The serio device structure. * The serio device structure.
*/ */
static struct serio_dev spaceball_dev = { static struct serio_driver spaceball_drv = {
.interrupt = spaceball_interrupt, .driver = {
.connect = spaceball_connect, .name = "spaceball",
.disconnect = spaceball_disconnect, },
.description = DRIVER_DESC,
.interrupt = spaceball_interrupt,
.connect = spaceball_connect,
.disconnect = spaceball_disconnect,
}; };
/* /*
...@@ -281,13 +287,13 @@ static struct serio_dev spaceball_dev = { ...@@ -281,13 +287,13 @@ static struct serio_dev spaceball_dev = {
int __init spaceball_init(void) int __init spaceball_init(void)
{ {
serio_register_device(&spaceball_dev); serio_register_driver(&spaceball_drv);
return 0; return 0;
} }
void __exit spaceball_exit(void) void __exit spaceball_exit(void)
{ {
serio_unregister_device(&spaceball_dev); serio_unregister_driver(&spaceball_drv);
} }
module_init(spaceball_init); module_init(spaceball_init);
......
...@@ -38,8 +38,10 @@ ...@@ -38,8 +38,10 @@
#include <linux/input.h> #include <linux/input.h>
#include <linux/serio.h> #include <linux/serio.h>
#define DRIVER_DESC "SpaceTec SpaceOrb 360 and Avenger 6dof controller driver"
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("SpaceTec SpaceOrb 360 and Avenger 6dof controller driver"); MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
/* /*
...@@ -162,7 +164,7 @@ static void spaceorb_disconnect(struct serio *serio) ...@@ -162,7 +164,7 @@ static void spaceorb_disconnect(struct serio *serio)
* it as an input device. * it as an input device.
*/ */
static void spaceorb_connect(struct serio *serio, struct serio_dev *dev) static void spaceorb_connect(struct serio *serio, struct serio_driver *drv)
{ {
struct spaceorb *spaceorb; struct spaceorb *spaceorb;
int i, t; int i, t;
...@@ -201,7 +203,7 @@ static void spaceorb_connect(struct serio *serio, struct serio_dev *dev) ...@@ -201,7 +203,7 @@ static void spaceorb_connect(struct serio *serio, struct serio_dev *dev)
serio->private = spaceorb; serio->private = spaceorb;
if (serio_open(serio, dev)) { if (serio_open(serio, drv)) {
kfree(spaceorb); kfree(spaceorb);
return; return;
} }
...@@ -213,10 +215,14 @@ static void spaceorb_connect(struct serio *serio, struct serio_dev *dev) ...@@ -213,10 +215,14 @@ static void spaceorb_connect(struct serio *serio, struct serio_dev *dev)
* The serio device structure. * The serio device structure.
*/ */
static struct serio_dev spaceorb_dev = { static struct serio_driver spaceorb_drv = {
.interrupt = spaceorb_interrupt, .driver = {
.connect = spaceorb_connect, .name = "spaceorb",
.disconnect = spaceorb_disconnect, },
.description = DRIVER_DESC,
.interrupt = spaceorb_interrupt,
.connect = spaceorb_connect,
.disconnect = spaceorb_disconnect,
}; };
/* /*
...@@ -225,13 +231,13 @@ static struct serio_dev spaceorb_dev = { ...@@ -225,13 +231,13 @@ static struct serio_dev spaceorb_dev = {
int __init spaceorb_init(void) int __init spaceorb_init(void)
{ {
serio_register_device(&spaceorb_dev); serio_register_driver(&spaceorb_drv);
return 0; return 0;
} }
void __exit spaceorb_exit(void) void __exit spaceorb_exit(void)
{ {
serio_unregister_device(&spaceorb_dev); serio_unregister_driver(&spaceorb_drv);
} }
module_init(spaceorb_init); module_init(spaceorb_init);
......
...@@ -36,8 +36,10 @@ ...@@ -36,8 +36,10 @@
#include <linux/serio.h> #include <linux/serio.h>
#include <linux/init.h> #include <linux/init.h>
#define DRIVER_DESC "Gravis Stinger gamepad driver"
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Gravis Stinger gamepad driver"); MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
/* /*
...@@ -134,7 +136,7 @@ static void stinger_disconnect(struct serio *serio) ...@@ -134,7 +136,7 @@ static void stinger_disconnect(struct serio *serio)
* it as an input device. * it as an input device.
*/ */
static void stinger_connect(struct serio *serio, struct serio_dev *dev) static void stinger_connect(struct serio *serio, struct serio_driver *drv)
{ {
struct stinger *stinger; struct stinger *stinger;
int i; int i;
...@@ -172,7 +174,7 @@ static void stinger_connect(struct serio *serio, struct serio_dev *dev) ...@@ -172,7 +174,7 @@ static void stinger_connect(struct serio *serio, struct serio_dev *dev)
stinger->dev.private = stinger; stinger->dev.private = stinger;
serio->private = stinger; serio->private = stinger;
if (serio_open(serio, dev)) { if (serio_open(serio, drv)) {
kfree(stinger); kfree(stinger);
return; return;
} }
...@@ -187,10 +189,14 @@ static void stinger_connect(struct serio *serio, struct serio_dev *dev) ...@@ -187,10 +189,14 @@ static void stinger_connect(struct serio *serio, struct serio_dev *dev)
* The serio device structure. * The serio device structure.
*/ */
static struct serio_dev stinger_dev = { static struct serio_driver stinger_drv = {
.interrupt = stinger_interrupt, .driver = {
.connect = stinger_connect, .name = "stinger",
.disconnect = stinger_disconnect, },
.description = DRIVER_DESC,
.interrupt = stinger_interrupt,
.connect = stinger_connect,
.disconnect = stinger_disconnect,
}; };
/* /*
...@@ -199,13 +205,13 @@ static struct serio_dev stinger_dev = { ...@@ -199,13 +205,13 @@ static struct serio_dev stinger_dev = {
int __init stinger_init(void) int __init stinger_init(void)
{ {
serio_register_device(&stinger_dev); serio_register_driver(&stinger_drv);
return 0; return 0;
} }
void __exit stinger_exit(void) void __exit stinger_exit(void)
{ {
serio_unregister_device(&stinger_dev); serio_unregister_driver(&stinger_drv);
} }
module_init(stinger_init); module_init(stinger_init);
......
...@@ -322,7 +322,7 @@ static void tmdc_connect(struct gameport *gameport, struct gameport_dev *dev) ...@@ -322,7 +322,7 @@ static void tmdc_connect(struct gameport *gameport, struct gameport_dev *dev)
tmdc->dev[j].evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); tmdc->dev[j].evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
for (i = 0; i < models[m].abs && i < TMDC_ABS; i++) { for (i = 0; i < models[m].abs && i < TMDC_ABS; i++) {
if (tmdc->abs[i] < 0) continue; if (tmdc->abs[j][i] < 0) continue;
set_bit(tmdc->abs[j][i], tmdc->dev[j].absbit); set_bit(tmdc->abs[j][i], tmdc->dev[j].absbit);
tmdc->dev[j].absmin[tmdc->abs[j][i]] = 8; tmdc->dev[j].absmin[tmdc->abs[j][i]] = 8;
tmdc->dev[j].absmax[tmdc->abs[j][i]] = 248; tmdc->dev[j].absmax[tmdc->abs[j][i]] = 248;
......
...@@ -187,7 +187,7 @@ static void twidjoy_disconnect(struct serio *serio) ...@@ -187,7 +187,7 @@ static void twidjoy_disconnect(struct serio *serio)
* it as an input device. * it as an input device.
*/ */
static void twidjoy_connect(struct serio *serio, struct serio_dev *dev) static void twidjoy_connect(struct serio *serio, struct serio_driver *drv)
{ {
struct twidjoy_button_spec *bp; struct twidjoy_button_spec *bp;
struct twidjoy *twidjoy; struct twidjoy *twidjoy;
...@@ -232,7 +232,7 @@ static void twidjoy_connect(struct serio *serio, struct serio_dev *dev) ...@@ -232,7 +232,7 @@ static void twidjoy_connect(struct serio *serio, struct serio_dev *dev)
twidjoy->dev.private = twidjoy; twidjoy->dev.private = twidjoy;
serio->private = twidjoy; serio->private = twidjoy;
if (serio_open(serio, dev)) { if (serio_open(serio, drv)) {
kfree(twidjoy); kfree(twidjoy);
return; return;
} }
...@@ -246,10 +246,14 @@ static void twidjoy_connect(struct serio *serio, struct serio_dev *dev) ...@@ -246,10 +246,14 @@ static void twidjoy_connect(struct serio *serio, struct serio_dev *dev)
* The serio device structure. * The serio device structure.
*/ */
static struct serio_dev twidjoy_dev = { static struct serio_driver twidjoy_drv = {
.interrupt = twidjoy_interrupt, .driver = {
.connect = twidjoy_connect, .name = "twidjoy",
.disconnect = twidjoy_disconnect, },
.description = DRIVER_DESC,
.interrupt = twidjoy_interrupt,
.connect = twidjoy_connect,
.disconnect = twidjoy_disconnect,
}; };
/* /*
...@@ -258,13 +262,13 @@ static struct serio_dev twidjoy_dev = { ...@@ -258,13 +262,13 @@ static struct serio_dev twidjoy_dev = {
int __init twidjoy_init(void) int __init twidjoy_init(void)
{ {
serio_register_device(&twidjoy_dev); serio_register_driver(&twidjoy_drv);
return 0; return 0;
} }
void __exit twidjoy_exit(void) void __exit twidjoy_exit(void)
{ {
serio_unregister_device(&twidjoy_dev); serio_unregister_driver(&twidjoy_drv);
} }
module_init(twidjoy_init); module_init(twidjoy_init);
......
...@@ -35,8 +35,10 @@ ...@@ -35,8 +35,10 @@
#include <linux/serio.h> #include <linux/serio.h>
#include <linux/init.h> #include <linux/init.h>
#define DRIVER_DESC "Logitech WingMan Warrior joystick driver"
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Logitech WingMan Warrior joystick driver"); MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
/* /*
...@@ -139,7 +141,7 @@ static void warrior_disconnect(struct serio *serio) ...@@ -139,7 +141,7 @@ static void warrior_disconnect(struct serio *serio)
* it as an input device. * it as an input device.
*/ */
static void warrior_connect(struct serio *serio, struct serio_dev *dev) static void warrior_connect(struct serio *serio, struct serio_driver *drv)
{ {
struct warrior *warrior; struct warrior *warrior;
int i; int i;
...@@ -185,7 +187,7 @@ static void warrior_connect(struct serio *serio, struct serio_dev *dev) ...@@ -185,7 +187,7 @@ static void warrior_connect(struct serio *serio, struct serio_dev *dev)
serio->private = warrior; serio->private = warrior;
if (serio_open(serio, dev)) { if (serio_open(serio, drv)) {
kfree(warrior); kfree(warrior);
return; return;
} }
...@@ -199,10 +201,14 @@ static void warrior_connect(struct serio *serio, struct serio_dev *dev) ...@@ -199,10 +201,14 @@ static void warrior_connect(struct serio *serio, struct serio_dev *dev)
* The serio device structure. * The serio device structure.
*/ */
static struct serio_dev warrior_dev = { static struct serio_driver warrior_drv = {
.interrupt = warrior_interrupt, .driver = {
.connect = warrior_connect, .name = "warrior",
.disconnect = warrior_disconnect, },
.description = DRIVER_DESC,
.interrupt = warrior_interrupt,
.connect = warrior_connect,
.disconnect = warrior_disconnect,
}; };
/* /*
...@@ -211,13 +217,13 @@ static struct serio_dev warrior_dev = { ...@@ -211,13 +217,13 @@ static struct serio_dev warrior_dev = {
int __init warrior_init(void) int __init warrior_init(void)
{ {
serio_register_device(&warrior_dev); serio_register_driver(&warrior_drv);
return 0; return 0;
} }
void __exit warrior_exit(void) void __exit warrior_exit(void)
{ {
serio_unregister_device(&warrior_dev); serio_unregister_driver(&warrior_drv);
} }
module_init(warrior_init); module_init(warrior_init);
......
This diff is collapsed.
...@@ -76,8 +76,10 @@ ...@@ -76,8 +76,10 @@
#include <linux/serio.h> #include <linux/serio.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
#define DRIVER_DESC "LK keyboard driver"
MODULE_AUTHOR ("Jan-Benedict Glaw <jbglaw@lug-owl.de>"); MODULE_AUTHOR ("Jan-Benedict Glaw <jbglaw@lug-owl.de>");
MODULE_DESCRIPTION ("LK keyboard driver"); MODULE_DESCRIPTION (DRIVER_DESC);
MODULE_LICENSE ("GPL"); MODULE_LICENSE ("GPL");
/* /*
...@@ -622,7 +624,7 @@ lkkbd_reinit (void *data) ...@@ -622,7 +624,7 @@ lkkbd_reinit (void *data)
* lkkbd_connect() probes for a LK keyboard and fills the necessary structures. * lkkbd_connect() probes for a LK keyboard and fills the necessary structures.
*/ */
static void static void
lkkbd_connect (struct serio *serio, struct serio_dev *dev) lkkbd_connect (struct serio *serio, struct serio_driver *drv)
{ {
struct lkkbd *lk; struct lkkbd *lk;
int i; int i;
...@@ -665,7 +667,7 @@ lkkbd_connect (struct serio *serio, struct serio_dev *dev) ...@@ -665,7 +667,7 @@ lkkbd_connect (struct serio *serio, struct serio_dev *dev)
serio->private = lk; serio->private = lk;
if (serio_open (serio, dev)) { if (serio_open (serio, drv)) {
kfree (lk); kfree (lk);
return; return;
} }
...@@ -703,10 +705,14 @@ lkkbd_disconnect (struct serio *serio) ...@@ -703,10 +705,14 @@ lkkbd_disconnect (struct serio *serio)
kfree (lk); kfree (lk);
} }
static struct serio_dev lkkbd_dev = { static struct serio_driver lkkbd_drv = {
.connect = lkkbd_connect, .driver = {
.disconnect = lkkbd_disconnect, .name = "lkkbd",
.interrupt = lkkbd_interrupt, },
.description = DRIVER_DESC,
.connect = lkkbd_connect,
.disconnect = lkkbd_disconnect,
.interrupt = lkkbd_interrupt,
}; };
/* /*
...@@ -715,14 +721,14 @@ static struct serio_dev lkkbd_dev = { ...@@ -715,14 +721,14 @@ static struct serio_dev lkkbd_dev = {
int __init int __init
lkkbd_init (void) lkkbd_init (void)
{ {
serio_register_device (&lkkbd_dev); serio_register_driver(&lkkbd_drv);
return 0; return 0;
} }
void __exit void __exit
lkkbd_exit (void) lkkbd_exit (void)
{ {
serio_unregister_device (&lkkbd_dev); serio_unregister_driver(&lkkbd_drv);
} }
module_init (lkkbd_init); module_init (lkkbd_init);
......
...@@ -32,8 +32,10 @@ ...@@ -32,8 +32,10 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/serio.h> #include <linux/serio.h>
#define DRIVER_DESC "Newton keyboard driver"
MODULE_AUTHOR("Justin Cormack <j.cormack@doc.ic.ac.uk>"); MODULE_AUTHOR("Justin Cormack <j.cormack@doc.ic.ac.uk>");
MODULE_DESCRIPTION("Newton keyboard driver"); MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
#define NKBD_KEY 0x7f #define NKBD_KEY 0x7f
...@@ -82,7 +84,7 @@ irqreturn_t nkbd_interrupt(struct serio *serio, ...@@ -82,7 +84,7 @@ irqreturn_t nkbd_interrupt(struct serio *serio,
} }
void nkbd_connect(struct serio *serio, struct serio_dev *dev) void nkbd_connect(struct serio *serio, struct serio_driver *drv)
{ {
struct nkbd *nkbd; struct nkbd *nkbd;
int i; int i;
...@@ -106,7 +108,7 @@ void nkbd_connect(struct serio *serio, struct serio_dev *dev) ...@@ -106,7 +108,7 @@ void nkbd_connect(struct serio *serio, struct serio_dev *dev)
nkbd->dev.private = nkbd; nkbd->dev.private = nkbd;
serio->private = nkbd; serio->private = nkbd;
if (serio_open(serio, dev)) { if (serio_open(serio, drv)) {
kfree(nkbd); kfree(nkbd);
return; return;
} }
...@@ -138,21 +140,25 @@ void nkbd_disconnect(struct serio *serio) ...@@ -138,21 +140,25 @@ void nkbd_disconnect(struct serio *serio)
kfree(nkbd); kfree(nkbd);
} }
struct serio_dev nkbd_dev = { struct serio_driver nkbd_drv = {
.interrupt = nkbd_interrupt, .driver = {
.connect = nkbd_connect, .name = "newtonkbd",
.disconnect = nkbd_disconnect },
.description = DRIVER_DESC,
.interrupt = nkbd_interrupt,
.connect = nkbd_connect,
.disconnect = nkbd_disconnect,
}; };
int __init nkbd_init(void) int __init nkbd_init(void)
{ {
serio_register_device(&nkbd_dev); serio_register_driver(&nkbd_drv);
return 0; return 0;
} }
void __exit nkbd_exit(void) void __exit nkbd_exit(void)
{ {
serio_unregister_device(&nkbd_dev); serio_unregister_driver(&nkbd_drv);
} }
module_init(nkbd_init); module_init(nkbd_init);
......
...@@ -37,8 +37,10 @@ ...@@ -37,8 +37,10 @@
#include <linux/serio.h> #include <linux/serio.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
#define DRIVER_DESC "Sun keyboard driver"
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Sun keyboard driver"); MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
static unsigned char sunkbd_keycode[128] = { static unsigned char sunkbd_keycode[128] = {
...@@ -221,7 +223,7 @@ static void sunkbd_reinit(void *data) ...@@ -221,7 +223,7 @@ static void sunkbd_reinit(void *data)
* sunkbd_connect() probes for a Sun keyboard and fills the necessary structures. * sunkbd_connect() probes for a Sun keyboard and fills the necessary structures.
*/ */
static void sunkbd_connect(struct serio *serio, struct serio_dev *dev) static void sunkbd_connect(struct serio *serio, struct serio_driver *drv)
{ {
struct sunkbd *sunkbd; struct sunkbd *sunkbd;
int i; int i;
...@@ -257,7 +259,7 @@ static void sunkbd_connect(struct serio *serio, struct serio_dev *dev) ...@@ -257,7 +259,7 @@ static void sunkbd_connect(struct serio *serio, struct serio_dev *dev)
serio->private = sunkbd; serio->private = sunkbd;
if (serio_open(serio, dev)) { if (serio_open(serio, drv)) {
kfree(sunkbd); kfree(sunkbd);
return; return;
} }
...@@ -301,10 +303,14 @@ static void sunkbd_disconnect(struct serio *serio) ...@@ -301,10 +303,14 @@ static void sunkbd_disconnect(struct serio *serio)
kfree(sunkbd); kfree(sunkbd);
} }
static struct serio_dev sunkbd_dev = { static struct serio_driver sunkbd_drv = {
.interrupt = sunkbd_interrupt, .driver = {
.connect = sunkbd_connect, .name = "sunkbd",
.disconnect = sunkbd_disconnect },
.description = DRIVER_DESC,
.interrupt = sunkbd_interrupt,
.connect = sunkbd_connect,
.disconnect = sunkbd_disconnect,
}; };
/* /*
...@@ -313,13 +319,13 @@ static struct serio_dev sunkbd_dev = { ...@@ -313,13 +319,13 @@ static struct serio_dev sunkbd_dev = {
int __init sunkbd_init(void) int __init sunkbd_init(void)
{ {
serio_register_device(&sunkbd_dev); serio_register_driver(&sunkbd_drv);
return 0; return 0;
} }
void __exit sunkbd_exit(void) void __exit sunkbd_exit(void)
{ {
serio_unregister_device(&sunkbd_dev); serio_unregister_driver(&sunkbd_drv);
} }
module_init(sunkbd_init); module_init(sunkbd_init);
......
...@@ -34,8 +34,10 @@ ...@@ -34,8 +34,10 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/serio.h> #include <linux/serio.h>
#define DRIVER_DESC "XT keyboard driver"
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("XT keyboard driver"); MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
#define XTKBD_EMUL0 0xe0 #define XTKBD_EMUL0 0xe0
...@@ -86,7 +88,7 @@ irqreturn_t xtkbd_interrupt(struct serio *serio, ...@@ -86,7 +88,7 @@ irqreturn_t xtkbd_interrupt(struct serio *serio,
return IRQ_HANDLED; return IRQ_HANDLED;
} }
void xtkbd_connect(struct serio *serio, struct serio_dev *dev) void xtkbd_connect(struct serio *serio, struct serio_driver *drv)
{ {
struct xtkbd *xtkbd; struct xtkbd *xtkbd;
int i; int i;
...@@ -111,7 +113,7 @@ void xtkbd_connect(struct serio *serio, struct serio_dev *dev) ...@@ -111,7 +113,7 @@ void xtkbd_connect(struct serio *serio, struct serio_dev *dev)
serio->private = xtkbd; serio->private = xtkbd;
if (serio_open(serio, dev)) { if (serio_open(serio, drv)) {
kfree(xtkbd); kfree(xtkbd);
return; return;
} }
...@@ -143,21 +145,25 @@ void xtkbd_disconnect(struct serio *serio) ...@@ -143,21 +145,25 @@ void xtkbd_disconnect(struct serio *serio)
kfree(xtkbd); kfree(xtkbd);
} }
struct serio_dev xtkbd_dev = { struct serio_driver xtkbd_drv = {
.interrupt = xtkbd_interrupt, .driver = {
.connect = xtkbd_connect, .name = "xtkbd",
.disconnect = xtkbd_disconnect },
.description = DRIVER_DESC,
.interrupt = xtkbd_interrupt,
.connect = xtkbd_connect,
.disconnect = xtkbd_disconnect,
}; };
int __init xtkbd_init(void) int __init xtkbd_init(void)
{ {
serio_register_device(&xtkbd_dev); serio_register_driver(&xtkbd_drv);
return 0; return 0;
} }
void __exit xtkbd_exit(void) void __exit xtkbd_exit(void)
{ {
serio_unregister_device(&xtkbd_dev); serio_unregister_driver(&xtkbd_drv);
} }
module_init(xtkbd_init); module_init(xtkbd_init);
......
...@@ -14,7 +14,7 @@ config INPUT_MISC ...@@ -14,7 +14,7 @@ config INPUT_MISC
config INPUT_PCSPKR config INPUT_PCSPKR
tristate "PC Speaker support" tristate "PC Speaker support"
depends on (ALPHA || X86 || X86_64 || MIPS) && INPUT && INPUT_MISC depends on (ALPHA || X86 || X86_64 || MIPS || PPC_PREP || PPC_CHRP || PPC_PSERIES) && INPUT && INPUT_MISC
help help
Say Y here if you want the standard PC Speaker to be used for Say Y here if you want the standard PC Speaker to be used for
bells and whistles. bells and whistles.
......
...@@ -279,6 +279,9 @@ static unsigned int uinput_poll(struct file *file, poll_table *wait) ...@@ -279,6 +279,9 @@ static unsigned int uinput_poll(struct file *file, poll_table *wait)
{ {
struct uinput_device *udev = file->private_data; struct uinput_device *udev = file->private_data;
if (!test_bit(UIST_CREATED, &(udev->state)))
return 0;
poll_wait(file, &udev->waitq, wait); poll_wait(file, &udev->waitq, wait);
if (udev->head != udev->tail) if (udev->head != udev->tail)
......
...@@ -30,8 +30,6 @@ config MOUSE_PS2 ...@@ -30,8 +30,6 @@ config MOUSE_PS2
and a new verion of GPM at: and a new verion of GPM at:
http://www.geocities.com/dt_or/gpm/gpm.html http://www.geocities.com/dt_or/gpm/gpm.html
to take advantage of the advanced features of the touchpad. to take advantage of the advanced features of the touchpad.
If you do not want install specialized drivers but want tapping
working please use option psmouse.proto=imps.
If unsure, say Y. If unsure, say Y.
......
...@@ -277,7 +277,7 @@ int ps2pp_init(struct psmouse *psmouse, int set_properties) ...@@ -277,7 +277,7 @@ int ps2pp_init(struct psmouse *psmouse, int set_properties)
protocol = PSMOUSE_PS2TPP; protocol = PSMOUSE_PS2TPP;
} }
} else if (get_model_info(model) != NULL) { } else if (model_info != NULL) {
param[0] = param[1] = param[2] = 0; param[0] = param[1] = param[2] = 0;
ps2pp_cmd(psmouse, param, 0x39); /* Magic knock */ ps2pp_cmd(psmouse, param, 0x39); /* Magic knock */
......
This diff is collapsed.
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#define PSMOUSE_CMD_GETID 0x02f2 #define PSMOUSE_CMD_GETID 0x02f2
#define PSMOUSE_CMD_SETRATE 0x10f3 #define PSMOUSE_CMD_SETRATE 0x10f3
#define PSMOUSE_CMD_ENABLE 0x00f4 #define PSMOUSE_CMD_ENABLE 0x00f4
#define PSMOUSE_CMD_DISABLE 0x00f5
#define PSMOUSE_CMD_RESET_DIS 0x00f6 #define PSMOUSE_CMD_RESET_DIS 0x00f6
#define PSMOUSE_CMD_RESET_BAT 0x02ff #define PSMOUSE_CMD_RESET_BAT 0x02ff
...@@ -17,10 +18,17 @@ ...@@ -17,10 +18,17 @@
#define PSMOUSE_RET_ACK 0xfa #define PSMOUSE_RET_ACK 0xfa
#define PSMOUSE_RET_NAK 0xfe #define PSMOUSE_RET_NAK 0xfe
/* psmouse states */ #define PSMOUSE_FLAG_ACK 0 /* Waiting for ACK/NAK */
#define PSMOUSE_CMD_MODE 0 #define PSMOUSE_FLAG_CMD 1 /* Waiting for command to finish */
#define PSMOUSE_ACTIVATED 1 #define PSMOUSE_FLAG_CMD1 2 /* Waiting for the first byte of command response */
#define PSMOUSE_IGNORE 2 #define PSMOUSE_FLAG_WAITID 3 /* Command execiting is GET ID */
enum psmouse_state {
PSMOUSE_IGNORE,
PSMOUSE_INITIALIZING,
PSMOUSE_CMD_MODE,
PSMOUSE_ACTIVATED,
};
/* psmouse protocol handler return codes */ /* psmouse protocol handler return codes */
typedef enum { typedef enum {
...@@ -29,20 +37,10 @@ typedef enum { ...@@ -29,20 +37,10 @@ typedef enum {
PSMOUSE_FULL_PACKET PSMOUSE_FULL_PACKET
} psmouse_ret_t; } psmouse_ret_t;
struct psmouse;
struct psmouse_ptport {
struct serio serio;
void (*activate)(struct psmouse *parent);
void (*deactivate)(struct psmouse *parent);
};
struct psmouse { struct psmouse {
void *private; void *private;
struct input_dev dev; struct input_dev dev;
struct serio *serio; struct serio *serio;
struct psmouse_ptport *ptport;
char *vendor; char *vendor;
char *name; char *name;
unsigned char cmdbuf[8]; unsigned char cmdbuf[8];
...@@ -53,16 +51,22 @@ struct psmouse { ...@@ -53,16 +51,22 @@ struct psmouse {
unsigned char model; unsigned char model;
unsigned long last; unsigned long last;
unsigned long out_of_sync; unsigned long out_of_sync;
unsigned char state; enum psmouse_state state;
char acking; unsigned char nak;
volatile char ack;
char error; char error;
char devname[64]; char devname[64];
char phys[32]; char phys[32];
unsigned long flags;
psmouse_ret_t (*protocol_handler)(struct psmouse *psmouse, struct pt_regs *regs); /* Used to signal completion from interrupt handler */
wait_queue_head_t wait;
psmouse_ret_t (*protocol_handler)(struct psmouse *psmouse, struct pt_regs *regs);
int (*reconnect)(struct psmouse *psmouse); int (*reconnect)(struct psmouse *psmouse);
void (*disconnect)(struct psmouse *psmouse); void (*disconnect)(struct psmouse *psmouse);
void (*pt_activate)(struct psmouse *psmouse);
void (*pt_deactivate)(struct psmouse *psmouse);
}; };
#define PSMOUSE_PS2 1 #define PSMOUSE_PS2 1
......
...@@ -37,8 +37,10 @@ ...@@ -37,8 +37,10 @@
#include <linux/serio.h> #include <linux/serio.h>
#include <linux/init.h> #include <linux/init.h>
#define DRIVER_DESC "Serial mouse driver"
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Serial mouse driver"); MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
static char *sermouse_protocols[] = { "None", "Mouse Systems Mouse", "Sun Mouse", "Microsoft Mouse", static char *sermouse_protocols[] = { "None", "Mouse Systems Mouse", "Sun Mouse", "Microsoft Mouse",
...@@ -237,7 +239,7 @@ static void sermouse_disconnect(struct serio *serio) ...@@ -237,7 +239,7 @@ static void sermouse_disconnect(struct serio *serio)
* an unhandled serio port is found. * an unhandled serio port is found.
*/ */
static void sermouse_connect(struct serio *serio, struct serio_dev *dev) static void sermouse_connect(struct serio *serio, struct serio_driver *drv)
{ {
struct sermouse *sermouse; struct sermouse *sermouse;
unsigned char c; unsigned char c;
...@@ -279,7 +281,7 @@ static void sermouse_connect(struct serio *serio, struct serio_dev *dev) ...@@ -279,7 +281,7 @@ static void sermouse_connect(struct serio *serio, struct serio_dev *dev)
sermouse->dev.id.product = c; sermouse->dev.id.product = c;
sermouse->dev.id.version = 0x0100; sermouse->dev.id.version = 0x0100;
if (serio_open(serio, dev)) { if (serio_open(serio, drv)) {
kfree(sermouse); kfree(sermouse);
return; return;
} }
...@@ -289,21 +291,25 @@ static void sermouse_connect(struct serio *serio, struct serio_dev *dev) ...@@ -289,21 +291,25 @@ static void sermouse_connect(struct serio *serio, struct serio_dev *dev)
printk(KERN_INFO "input: %s on %s\n", sermouse_protocols[sermouse->type], serio->phys); printk(KERN_INFO "input: %s on %s\n", sermouse_protocols[sermouse->type], serio->phys);
} }
static struct serio_dev sermouse_dev = { static struct serio_driver sermouse_drv = {
.interrupt = sermouse_interrupt, .driver = {
.connect = sermouse_connect, .name = "sermouse",
.disconnect = sermouse_disconnect },
.description = DRIVER_DESC,
.interrupt = sermouse_interrupt,
.connect = sermouse_connect,
.disconnect = sermouse_disconnect,
}; };
int __init sermouse_init(void) int __init sermouse_init(void)
{ {
serio_register_device(&sermouse_dev); serio_register_driver(&sermouse_drv);
return 0; return 0;
} }
void __exit sermouse_exit(void) void __exit sermouse_exit(void)
{ {
serio_unregister_device(&sermouse_dev); serio_unregister_driver(&sermouse_drv);
} }
module_init(sermouse_init); module_init(sermouse_init);
......
...@@ -212,9 +212,9 @@ static int synaptics_set_mode(struct psmouse *psmouse, int mode) ...@@ -212,9 +212,9 @@ static int synaptics_set_mode(struct psmouse *psmouse, int mode)
/***************************************************************************** /*****************************************************************************
* Synaptics pass-through PS/2 port support * Synaptics pass-through PS/2 port support
****************************************************************************/ ****************************************************************************/
static int synaptics_pt_write(struct serio *port, unsigned char c) static int synaptics_pt_write(struct serio *serio, unsigned char c)
{ {
struct psmouse *parent = port->driver; struct psmouse *parent = serio->parent->private;
char rate_param = SYN_PS_CLIENT_CMD; /* indicates that we want pass-through port */ char rate_param = SYN_PS_CLIENT_CMD; /* indicates that we want pass-through port */
if (psmouse_sliced_command(parent, c)) if (psmouse_sliced_command(parent, c))
...@@ -233,22 +233,19 @@ static void synaptics_pass_pt_packet(struct serio *ptport, unsigned char *packet ...@@ -233,22 +233,19 @@ static void synaptics_pass_pt_packet(struct serio *ptport, unsigned char *packet
{ {
struct psmouse *child = ptport->private; struct psmouse *child = ptport->private;
if (child) { if (child && child->state == PSMOUSE_ACTIVATED) {
if (child->state == PSMOUSE_ACTIVATED) { serio_interrupt(ptport, packet[1], 0, NULL);
serio_interrupt(ptport, packet[1], 0, NULL); serio_interrupt(ptport, packet[4], 0, NULL);
serio_interrupt(ptport, packet[4], 0, NULL); serio_interrupt(ptport, packet[5], 0, NULL);
serio_interrupt(ptport, packet[5], 0, NULL); if (child->type >= PSMOUSE_GENPS)
if (child->type >= PSMOUSE_GENPS) serio_interrupt(ptport, packet[2], 0, NULL);
serio_interrupt(ptport, packet[2], 0, NULL); } else
} else if (child->state != PSMOUSE_IGNORE) { serio_interrupt(ptport, packet[1], 0, NULL);
serio_interrupt(ptport, packet[1], 0, NULL);
}
}
} }
static void synaptics_pt_activate(struct psmouse *psmouse) static void synaptics_pt_activate(struct psmouse *psmouse)
{ {
struct psmouse *child = psmouse->ptport->serio.private; struct psmouse *child = psmouse->serio->child->private;
/* adjust the touchpad to child's choice of protocol */ /* adjust the touchpad to child's choice of protocol */
if (child && child->type >= PSMOUSE_GENPS) { if (child && child->type >= PSMOUSE_GENPS) {
...@@ -259,23 +256,25 @@ static void synaptics_pt_activate(struct psmouse *psmouse) ...@@ -259,23 +256,25 @@ static void synaptics_pt_activate(struct psmouse *psmouse)
static void synaptics_pt_create(struct psmouse *psmouse) static void synaptics_pt_create(struct psmouse *psmouse)
{ {
struct psmouse_ptport *port; struct serio *serio;
psmouse->ptport = port = kmalloc(sizeof(struct psmouse_ptport), GFP_KERNEL); serio = kmalloc(sizeof(struct serio), GFP_KERNEL);
if (!port) { if (!serio) {
printk(KERN_ERR "synaptics: not enough memory to allocate pass-through port\n"); printk(KERN_ERR "synaptics: not enough memory to allocate pass-through port\n");
return; return;
} }
memset(port, 0, sizeof(struct psmouse_ptport)); memset(serio, 0, sizeof(struct serio));
serio->type = SERIO_PS_PSTHRU;
strlcpy(serio->name, "Synaptics pass-through", sizeof(serio->name));
strlcpy(serio->phys, "synaptics-pt/serio0", sizeof(serio->name));
serio->write = synaptics_pt_write;
serio->parent = psmouse->serio;
port->serio.type = SERIO_PS_PSTHRU; psmouse->pt_activate = synaptics_pt_activate;
port->serio.name = "Synaptics pass-through";
port->serio.phys = "synaptics-pt/serio0";
port->serio.write = synaptics_pt_write;
port->serio.driver = psmouse;
port->activate = synaptics_pt_activate; psmouse->serio->child = serio;
} }
/***************************************************************************** /*****************************************************************************
...@@ -470,9 +469,10 @@ static psmouse_ret_t synaptics_process_byte(struct psmouse *psmouse, struct pt_r ...@@ -470,9 +469,10 @@ static psmouse_ret_t synaptics_process_byte(struct psmouse *psmouse, struct pt_r
if (unlikely(priv->pkt_type == SYN_NEWABS)) if (unlikely(priv->pkt_type == SYN_NEWABS))
priv->pkt_type = synaptics_detect_pkt_type(psmouse); priv->pkt_type = synaptics_detect_pkt_type(psmouse);
if (psmouse->ptport && psmouse->ptport->serio.dev && synaptics_is_pt_packet(psmouse->packet)) if (SYN_CAP_PASS_THROUGH(priv->capabilities) && synaptics_is_pt_packet(psmouse->packet)) {
synaptics_pass_pt_packet(&psmouse->ptport->serio, psmouse->packet); if (psmouse->serio->child)
else synaptics_pass_pt_packet(psmouse->serio->child, psmouse->packet);
} else
synaptics_process_packet(psmouse); synaptics_process_packet(psmouse);
return PSMOUSE_FULL_PACKET; return PSMOUSE_FULL_PACKET;
......
...@@ -82,8 +82,10 @@ ...@@ -82,8 +82,10 @@
#include <linux/serio.h> #include <linux/serio.h>
#include <linux/init.h> #include <linux/init.h>
#define DRIVER_DESC "Serial DEC VSXXX-AA/GA mouse / DEC tablet driver"
MODULE_AUTHOR ("Jan-Benedict Glaw <jbglaw@lug-owl.de>"); MODULE_AUTHOR ("Jan-Benedict Glaw <jbglaw@lug-owl.de>");
MODULE_DESCRIPTION ("Serial DEC VSXXX-AA/GA mouse / DEC tablet driver"); MODULE_DESCRIPTION (DRIVER_DESC);
MODULE_LICENSE ("GPL"); MODULE_LICENSE ("GPL");
#undef VSXXXAA_DEBUG #undef VSXXXAA_DEBUG
...@@ -482,7 +484,7 @@ vsxxxaa_disconnect (struct serio *serio) ...@@ -482,7 +484,7 @@ vsxxxaa_disconnect (struct serio *serio)
} }
static void static void
vsxxxaa_connect (struct serio *serio, struct serio_dev *dev) vsxxxaa_connect (struct serio *serio, struct serio_driver *drv)
{ {
struct vsxxxaa *mouse; struct vsxxxaa *mouse;
...@@ -524,7 +526,7 @@ vsxxxaa_connect (struct serio *serio, struct serio_dev *dev) ...@@ -524,7 +526,7 @@ vsxxxaa_connect (struct serio *serio, struct serio_dev *dev)
mouse->dev.id.bustype = BUS_RS232; mouse->dev.id.bustype = BUS_RS232;
mouse->serio = serio; mouse->serio = serio;
if (serio_open (serio, dev)) { if (serio_open (serio, drv)) {
kfree (mouse); kfree (mouse);
return; return;
} }
...@@ -540,23 +542,27 @@ vsxxxaa_connect (struct serio *serio, struct serio_dev *dev) ...@@ -540,23 +542,27 @@ vsxxxaa_connect (struct serio *serio, struct serio_dev *dev)
printk (KERN_INFO "input: %s on %s\n", mouse->name, mouse->phys); printk (KERN_INFO "input: %s on %s\n", mouse->name, mouse->phys);
} }
static struct serio_dev vsxxxaa_dev = { static struct serio_driver vsxxxaa_drv = {
.connect = vsxxxaa_connect, .driver = {
.interrupt = vsxxxaa_interrupt, .name = "vsxxxaa",
.disconnect = vsxxxaa_disconnect, },
.description = DRIVER_DESC,
.connect = vsxxxaa_connect,
.interrupt = vsxxxaa_interrupt,
.disconnect = vsxxxaa_disconnect,
}; };
int __init int __init
vsxxxaa_init (void) vsxxxaa_init (void)
{ {
serio_register_device (&vsxxxaa_dev); serio_register_driver(&vsxxxaa_drv);
return 0; return 0;
} }
void __exit void __exit
vsxxxaa_exit (void) vsxxxaa_exit (void)
{ {
serio_unregister_device (&vsxxxaa_dev); serio_unregister_driver(&vsxxxaa_drv);
} }
module_init (vsxxxaa_init); module_init (vsxxxaa_init);
......
This diff is collapsed.
...@@ -130,3 +130,19 @@ config SERIO_MACEPS2 ...@@ -130,3 +130,19 @@ config SERIO_MACEPS2
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called maceps2. module will be called maceps2.
config SERIO_RAW
tristate "Raw access to serio ports"
depends on SERIO
help
Say Y here if you want to have raw access to serio ports, such as
AUX ports on i8042 keyboard controller. Each serio port that is
bound to this driver will be accessible via a char device with
major 10 and dynamically allocated minor. The driver will try
allocating minor 1 (that historically corresponds to /dev/psaux)
first. To bind this driver to a serio port use sysfs interface:
echo -n "serio_raw" > /sys/bus/serio/devices/serioX/driver
To compile this driver as a module, choose M here: the
module will be called serio_raw.
...@@ -17,3 +17,4 @@ obj-$(CONFIG_SERIO_98KBD) += 98kbd-io.o ...@@ -17,3 +17,4 @@ obj-$(CONFIG_SERIO_98KBD) += 98kbd-io.o
obj-$(CONFIG_SERIO_GSCPS2) += gscps2.o obj-$(CONFIG_SERIO_GSCPS2) += gscps2.o
obj-$(CONFIG_SERIO_PCIPS2) += pcips2.o obj-$(CONFIG_SERIO_PCIPS2) += pcips2.o
obj-$(CONFIG_SERIO_MACEPS2) += maceps2.o obj-$(CONFIG_SERIO_MACEPS2) += maceps2.o
obj-$(CONFIG_SERIO_RAW) += serio_raw.o
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#define KMI_BASE (kmi->base) #define KMI_BASE (kmi->base)
struct amba_kmi_port { struct amba_kmi_port {
struct serio io; struct serio *io;
struct clk *clk; struct clk *clk;
unsigned char *base; unsigned char *base;
unsigned int irq; unsigned int irq;
...@@ -44,7 +44,7 @@ static irqreturn_t amba_kmi_int(int irq, void *dev_id, struct pt_regs *regs) ...@@ -44,7 +44,7 @@ static irqreturn_t amba_kmi_int(int irq, void *dev_id, struct pt_regs *regs)
int handled = IRQ_NONE; int handled = IRQ_NONE;
while (status & KMIIR_RXINTR) { while (status & KMIIR_RXINTR) {
serio_interrupt(&kmi->io, readb(KMIDATA), 0, regs); serio_interrupt(kmi->io, readb(KMIDATA), 0, regs);
status = readb(KMIIR); status = readb(KMIIR);
handled = IRQ_HANDLED; handled = IRQ_HANDLED;
} }
...@@ -54,7 +54,7 @@ static irqreturn_t amba_kmi_int(int irq, void *dev_id, struct pt_regs *regs) ...@@ -54,7 +54,7 @@ static irqreturn_t amba_kmi_int(int irq, void *dev_id, struct pt_regs *regs)
static int amba_kmi_write(struct serio *io, unsigned char val) static int amba_kmi_write(struct serio *io, unsigned char val)
{ {
struct amba_kmi_port *kmi = io->driver; struct amba_kmi_port *kmi = io->port_data;
unsigned int timeleft = 10000; /* timeout in 100ms */ unsigned int timeleft = 10000; /* timeout in 100ms */
while ((readb(KMISTAT) & KMISTAT_TXEMPTY) == 0 && timeleft--) while ((readb(KMISTAT) & KMISTAT_TXEMPTY) == 0 && timeleft--)
...@@ -68,7 +68,7 @@ static int amba_kmi_write(struct serio *io, unsigned char val) ...@@ -68,7 +68,7 @@ static int amba_kmi_write(struct serio *io, unsigned char val)
static int amba_kmi_open(struct serio *io) static int amba_kmi_open(struct serio *io)
{ {
struct amba_kmi_port *kmi = io->driver; struct amba_kmi_port *kmi = io->port_data;
unsigned int divisor; unsigned int divisor;
int ret; int ret;
...@@ -105,7 +105,7 @@ static int amba_kmi_open(struct serio *io) ...@@ -105,7 +105,7 @@ static int amba_kmi_open(struct serio *io)
static void amba_kmi_close(struct serio *io) static void amba_kmi_close(struct serio *io)
{ {
struct amba_kmi_port *kmi = io->driver; struct amba_kmi_port *kmi = io->port_data;
writeb(0, KMICR); writeb(0, KMICR);
...@@ -117,6 +117,7 @@ static void amba_kmi_close(struct serio *io) ...@@ -117,6 +117,7 @@ static void amba_kmi_close(struct serio *io)
static int amba_kmi_probe(struct amba_device *dev, void *id) static int amba_kmi_probe(struct amba_device *dev, void *id)
{ {
struct amba_kmi_port *kmi; struct amba_kmi_port *kmi;
struct serio *io;
int ret; int ret;
ret = amba_request_regions(dev, NULL); ret = amba_request_regions(dev, NULL);
...@@ -124,21 +125,25 @@ static int amba_kmi_probe(struct amba_device *dev, void *id) ...@@ -124,21 +125,25 @@ static int amba_kmi_probe(struct amba_device *dev, void *id)
return ret; return ret;
kmi = kmalloc(sizeof(struct amba_kmi_port), GFP_KERNEL); kmi = kmalloc(sizeof(struct amba_kmi_port), GFP_KERNEL);
if (!kmi) { io = kmalloc(sizeof(struct serio), GFP_KERNEL);
if (!kmi || !io) {
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
} }
memset(kmi, 0, sizeof(struct amba_kmi_port)); memset(kmi, 0, sizeof(struct amba_kmi_port));
memset(io, 0, sizeof(struct serio));
kmi->io.type = SERIO_8042;
kmi->io.write = amba_kmi_write; io->type = SERIO_8042;
kmi->io.open = amba_kmi_open; io->write = amba_kmi_write;
kmi->io.close = amba_kmi_close; io->open = amba_kmi_open;
kmi->io.name = dev->dev.bus_id; io->close = amba_kmi_close;
kmi->io.phys = dev->dev.bus_id; strlcpy(io->name, dev->dev.bus_id, sizeof(io->name));
kmi->io.driver = kmi; strlcpy(io->phys, dev->dev.bus_id, sizeof(io->phys));
io->port_data = kmi;
io->dev.parent = &dev->dev;
kmi->io = io;
kmi->base = ioremap(dev->res.start, KMI_SIZE); kmi->base = ioremap(dev->res.start, KMI_SIZE);
if (!kmi->base) { if (!kmi->base) {
ret = -ENOMEM; ret = -ENOMEM;
...@@ -154,13 +159,14 @@ static int amba_kmi_probe(struct amba_device *dev, void *id) ...@@ -154,13 +159,14 @@ static int amba_kmi_probe(struct amba_device *dev, void *id)
kmi->irq = dev->irq[0]; kmi->irq = dev->irq[0];
amba_set_drvdata(dev, kmi); amba_set_drvdata(dev, kmi);
serio_register_port(&kmi->io); serio_register_port(kmi->io);
return 0; return 0;
unmap: unmap:
iounmap(kmi->base); iounmap(kmi->base);
out: out:
kfree(kmi); kfree(kmi);
kfree(io);
amba_release_regions(dev); amba_release_regions(dev);
return ret; return ret;
} }
...@@ -171,7 +177,7 @@ static int amba_kmi_remove(struct amba_device *dev) ...@@ -171,7 +177,7 @@ static int amba_kmi_remove(struct amba_device *dev)
amba_set_drvdata(dev, NULL); amba_set_drvdata(dev, NULL);
serio_unregister_port(&kmi->io); serio_unregister_port(kmi->io);
clk_put(kmi->clk); clk_put(kmi->clk);
iounmap(kmi->base); iounmap(kmi->base);
kfree(kmi); kfree(kmi);
...@@ -184,7 +190,7 @@ static int amba_kmi_resume(struct amba_device *dev) ...@@ -184,7 +190,7 @@ static int amba_kmi_resume(struct amba_device *dev)
struct amba_kmi_port *kmi = amba_get_drvdata(dev); struct amba_kmi_port *kmi = amba_get_drvdata(dev);
/* kick the serio layer to rescan this port */ /* kick the serio layer to rescan this port */
serio_rescan(&kmi->io); serio_reconnect(kmi->io);
return 0; return 0;
} }
...@@ -214,7 +220,7 @@ static int __init amba_kmi_init(void) ...@@ -214,7 +220,7 @@ static int __init amba_kmi_init(void)
static void __exit amba_kmi_exit(void) static void __exit amba_kmi_exit(void)
{ {
return amba_driver_unregister(&ambakmi_driver); amba_driver_unregister(&ambakmi_driver);
} }
module_init(amba_kmi_init); module_init(amba_kmi_init);
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/serio.h> #include <linux/serio.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/err.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -43,9 +44,6 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); ...@@ -43,9 +44,6 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("82C710 C&T mouse port chip driver"); MODULE_DESCRIPTION("82C710 C&T mouse port chip driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
static char ct82c710_name[] = "C&T 82c710 mouse port";
static char ct82c710_phys[16];
/* /*
* ct82c710 interface * ct82c710 interface
*/ */
...@@ -61,10 +59,22 @@ static char ct82c710_phys[16]; ...@@ -61,10 +59,22 @@ static char ct82c710_phys[16];
#define CT82C710_IRQ 12 #define CT82C710_IRQ 12
static int ct82c710_data; #define CT82C710_DATA ct82c710_iores.start
static int ct82c710_status; #define CT82C710_STATUS (ct82c710_iores.start + 1)
static struct serio *ct82c710_port;
static struct platform_device *ct82c710_device;
static struct resource ct82c710_iores;
/*
* Interrupt handler for the 82C710 mouse port. A character
* is waiting in the 82C710.
*/
static irqreturn_t ct82c710_interrupt(int cpl, void *dev_id, struct pt_regs * regs); static irqreturn_t ct82c710_interrupt(int cpl, void *dev_id, struct pt_regs * regs)
{
return serio_interrupt(ct82c710_port, inb(CT82C710_DATA), 0, regs);
}
/* /*
* Wait for device to send output char and flush any input char. * Wait for device to send output char and flush any input char.
...@@ -74,10 +84,10 @@ static int ct82c170_wait(void) ...@@ -74,10 +84,10 @@ static int ct82c170_wait(void)
{ {
int timeout = 60000; int timeout = 60000;
while ((inb(ct82c710_status) & (CT82C710_RX_FULL | CT82C710_TX_IDLE | CT82C710_DEV_IDLE)) while ((inb(CT82C710_STATUS) & (CT82C710_RX_FULL | CT82C710_TX_IDLE | CT82C710_DEV_IDLE))
!= (CT82C710_DEV_IDLE | CT82C710_TX_IDLE) && timeout) { != (CT82C710_DEV_IDLE | CT82C710_TX_IDLE) && timeout) {
if (inb_p(ct82c710_status) & CT82C710_RX_FULL) inb_p(ct82c710_data); if (inb_p(CT82C710_STATUS) & CT82C710_RX_FULL) inb_p(CT82C710_DATA);
udelay(1); udelay(1);
timeout--; timeout--;
...@@ -91,7 +101,7 @@ static void ct82c710_close(struct serio *serio) ...@@ -91,7 +101,7 @@ static void ct82c710_close(struct serio *serio)
if (ct82c170_wait()) if (ct82c170_wait())
printk(KERN_WARNING "ct82c710.c: Device busy in close()\n"); printk(KERN_WARNING "ct82c710.c: Device busy in close()\n");
outb_p(inb_p(ct82c710_status) & ~(CT82C710_ENABLE | CT82C710_INTS_ON), ct82c710_status); outb_p(inb_p(CT82C710_STATUS) & ~(CT82C710_ENABLE | CT82C710_INTS_ON), CT82C710_STATUS);
if (ct82c170_wait()) if (ct82c170_wait())
printk(KERN_WARNING "ct82c710.c: Device busy in close()\n"); printk(KERN_WARNING "ct82c710.c: Device busy in close()\n");
...@@ -106,21 +116,21 @@ static int ct82c710_open(struct serio *serio) ...@@ -106,21 +116,21 @@ static int ct82c710_open(struct serio *serio)
if (request_irq(CT82C710_IRQ, ct82c710_interrupt, 0, "ct82c710", NULL)) if (request_irq(CT82C710_IRQ, ct82c710_interrupt, 0, "ct82c710", NULL))
return -1; return -1;
status = inb_p(ct82c710_status); status = inb_p(CT82C710_STATUS);
status |= (CT82C710_ENABLE | CT82C710_RESET); status |= (CT82C710_ENABLE | CT82C710_RESET);
outb_p(status, ct82c710_status); outb_p(status, CT82C710_STATUS);
status &= ~(CT82C710_RESET); status &= ~(CT82C710_RESET);
outb_p(status, ct82c710_status); outb_p(status, CT82C710_STATUS);
status |= CT82C710_INTS_ON; status |= CT82C710_INTS_ON;
outb_p(status, ct82c710_status); /* Enable interrupts */ outb_p(status, CT82C710_STATUS); /* Enable interrupts */
while (ct82c170_wait()) { while (ct82c170_wait()) {
printk(KERN_ERR "ct82c710: Device busy in open()\n"); printk(KERN_ERR "ct82c710: Device busy in open()\n");
status &= ~(CT82C710_ENABLE | CT82C710_INTS_ON); status &= ~(CT82C710_ENABLE | CT82C710_INTS_ON);
outb_p(status, ct82c710_status); outb_p(status, CT82C710_STATUS);
free_irq(CT82C710_IRQ, NULL); free_irq(CT82C710_IRQ, NULL);
return -1; return -1;
} }
...@@ -135,30 +145,10 @@ static int ct82c710_open(struct serio *serio) ...@@ -135,30 +145,10 @@ static int ct82c710_open(struct serio *serio)
static int ct82c710_write(struct serio *port, unsigned char c) static int ct82c710_write(struct serio *port, unsigned char c)
{ {
if (ct82c170_wait()) return -1; if (ct82c170_wait()) return -1;
outb_p(c, ct82c710_data); outb_p(c, CT82C710_DATA);
return 0; return 0;
} }
static struct serio ct82c710_port =
{
.type = SERIO_8042,
.name = ct82c710_name,
.phys = ct82c710_phys,
.write = ct82c710_write,
.open = ct82c710_open,
.close = ct82c710_close,
};
/*
* Interrupt handler for the 82C710 mouse port. A character
* is waiting in the 82C710.
*/
static irqreturn_t ct82c710_interrupt(int cpl, void *dev_id, struct pt_regs * regs)
{
return serio_interrupt(&ct82c710_port, inb(ct82c710_data), 0, regs);
}
/* /*
* See if we can find a 82C710 device. Read mouse address. * See if we can find a 82C710 device. Read mouse address.
*/ */
...@@ -175,36 +165,60 @@ static int __init ct82c710_probe(void) ...@@ -175,36 +165,60 @@ static int __init ct82c710_probe(void)
return -1; /* No: no 82C710 here */ return -1; /* No: no 82C710 here */
outb_p(0x0d, 0x390); /* Write index */ outb_p(0x0d, 0x390); /* Write index */
ct82c710_data = inb_p(0x391) << 2; /* Get mouse I/O address */ ct82c710_iores.start = inb_p(0x391) << 2; /* Get mouse I/O address */
ct82c710_status = ct82c710_data + 1; ct82c710_iores.end = ct82c710_iores.start + 1;
ct82c710_iores.flags = IORESOURCE_IO;
outb_p(0x0f, 0x390); outb_p(0x0f, 0x390);
outb_p(0x0f, 0x391); /* Close config mode */ outb_p(0x0f, 0x391); /* Close config mode */
return 0; return 0;
} }
static struct serio * __init ct82c710_allocate_port(void)
{
struct serio *serio;
serio = kmalloc(sizeof(struct serio), GFP_KERNEL);
if (serio) {
memset(serio, 0, sizeof(struct serio));
serio->type = SERIO_8042;
serio->open = ct82c710_open;
serio->close = ct82c710_close;
serio->write = ct82c710_write;
serio->dev.parent = &ct82c710_device->dev;
strlcpy(serio->name, "C&T 82c710 mouse port", sizeof(serio->name));
snprintf(serio->phys, sizeof(serio->phys), "isa%04lx/serio0", CT82C710_DATA);
}
return serio;
}
int __init ct82c710_init(void) int __init ct82c710_init(void)
{ {
if (ct82c710_probe()) if (ct82c710_probe())
return -ENODEV; return -ENODEV;
if (request_region(ct82c710_data, 2, "ct82c710")) ct82c710_device = platform_device_register_simple("ct82c710", -1, &ct82c710_iores, 1);
return -EBUSY; if (IS_ERR(ct82c710_device))
return PTR_ERR(ct82c710_device);
sprintf(ct82c710_phys, "isa%04x/serio0", ct82c710_data); if (!(ct82c710_port = ct82c710_allocate_port())) {
platform_device_unregister(ct82c710_device);
return -ENOMEM;
}
serio_register_port(&ct82c710_port); serio_register_port(ct82c710_port);
printk(KERN_INFO "serio: C&T 82c710 mouse port at %#x irq %d\n", printk(KERN_INFO "serio: C&T 82c710 mouse port at %#lx irq %d\n",
ct82c710_data, CT82C710_IRQ); CT82C710_DATA, CT82C710_IRQ);
return 0; return 0;
} }
void __exit ct82c710_exit(void) void __exit ct82c710_exit(void)
{ {
serio_unregister_port(&ct82c710_port); serio_unregister_port(ct82c710_port);
release_region(ct82c710_data, 2); platform_device_unregister(ct82c710_device);
} }
module_init(ct82c710_init); module_init(ct82c710_init);
......
...@@ -91,7 +91,7 @@ static irqreturn_t gscps2_interrupt(int irq, void *dev, struct pt_regs *regs); ...@@ -91,7 +91,7 @@ static irqreturn_t gscps2_interrupt(int irq, void *dev, struct pt_regs *regs);
struct gscps2port { struct gscps2port {
struct list_head node; struct list_head node;
struct parisc_device *padev; struct parisc_device *padev;
struct serio port; struct serio *port;
spinlock_t lock; spinlock_t lock;
char *addr; char *addr;
u8 act, append; /* position in buffer[] */ u8 act, append; /* position in buffer[] */
...@@ -100,7 +100,6 @@ struct gscps2port { ...@@ -100,7 +100,6 @@ struct gscps2port {
u8 str; u8 str;
} buffer[BUFFER_SIZE+1]; } buffer[BUFFER_SIZE+1];
int id; int id;
char name[32];
}; };
/* /*
...@@ -272,7 +271,7 @@ static irqreturn_t gscps2_interrupt(int irq, void *dev, struct pt_regs *regs) ...@@ -272,7 +271,7 @@ static irqreturn_t gscps2_interrupt(int irq, void *dev, struct pt_regs *regs)
rxflags = ((status & GSC_STAT_TERR) ? SERIO_TIMEOUT : 0 ) | rxflags = ((status & GSC_STAT_TERR) ? SERIO_TIMEOUT : 0 ) |
((status & GSC_STAT_PERR) ? SERIO_PARITY : 0 ); ((status & GSC_STAT_PERR) ? SERIO_PARITY : 0 );
serio_interrupt(&ps2port->port, data, rxflags, regs); serio_interrupt(ps2port->port, data, rxflags, regs);
} /* while() */ } /* while() */
...@@ -288,7 +287,7 @@ static irqreturn_t gscps2_interrupt(int irq, void *dev, struct pt_regs *regs) ...@@ -288,7 +287,7 @@ static irqreturn_t gscps2_interrupt(int irq, void *dev, struct pt_regs *regs)
static int gscps2_write(struct serio *port, unsigned char data) static int gscps2_write(struct serio *port, unsigned char data)
{ {
struct gscps2port *ps2port = port->driver; struct gscps2port *ps2port = port->port_data;
if (!gscps2_writeb_output(ps2port, data)) { if (!gscps2_writeb_output(ps2port, data)) {
printk(KERN_DEBUG PFX "sending byte %#x failed.\n", data); printk(KERN_DEBUG PFX "sending byte %#x failed.\n", data);
...@@ -304,7 +303,7 @@ static int gscps2_write(struct serio *port, unsigned char data) ...@@ -304,7 +303,7 @@ static int gscps2_write(struct serio *port, unsigned char data)
static int gscps2_open(struct serio *port) static int gscps2_open(struct serio *port)
{ {
struct gscps2port *ps2port = port->driver; struct gscps2port *ps2port = port->port_data;
gscps2_reset(ps2port); gscps2_reset(ps2port);
...@@ -319,7 +318,7 @@ static int gscps2_open(struct serio *port) ...@@ -319,7 +318,7 @@ static int gscps2_open(struct serio *port)
static void gscps2_close(struct serio *port) static void gscps2_close(struct serio *port)
{ {
struct gscps2port *ps2port = port->driver; struct gscps2port *ps2port = port->port_data;
gscps2_enable(ps2port, DISABLE); gscps2_enable(ps2port, DISABLE);
} }
...@@ -343,7 +342,8 @@ static struct serio gscps2_serio_port = ...@@ -343,7 +342,8 @@ static struct serio gscps2_serio_port =
static int __init gscps2_probe(struct parisc_device *dev) static int __init gscps2_probe(struct parisc_device *dev)
{ {
struct gscps2port *ps2port; struct gscps2port *ps2port;
struct serio *serio;
unsigned long hpa = dev->hpa; unsigned long hpa = dev->hpa;
int ret; int ret;
...@@ -355,34 +355,45 @@ static int __init gscps2_probe(struct parisc_device *dev) ...@@ -355,34 +355,45 @@ static int __init gscps2_probe(struct parisc_device *dev)
hpa += GSC_DINO_OFFSET; hpa += GSC_DINO_OFFSET;
ps2port = kmalloc(sizeof(struct gscps2port), GFP_KERNEL); ps2port = kmalloc(sizeof(struct gscps2port), GFP_KERNEL);
if (!ps2port) serio = kmalloc(sizeof(struct serio), GFP_KERNEL);
return -ENOMEM; if (!ps2port || !serio) {
ret = -ENOMEM;
goto fail_nomem;
}
dev_set_drvdata(&dev->dev, ps2port); dev_set_drvdata(&dev->dev, ps2port);
memset(ps2port, 0, sizeof(struct gscps2port)); memset(ps2port, 0, sizeof(struct gscps2port));
memset(serio, 0, sizeof(struct serio));
ps2port->port = serio;
ps2port->padev = dev; ps2port->padev = dev;
ps2port->addr = ioremap(hpa, GSC_STATUS + 4); ps2port->addr = ioremap(hpa, GSC_STATUS + 4);
spin_lock_init(&ps2port->lock); spin_lock_init(&ps2port->lock);
gscps2_reset(ps2port); gscps2_reset(ps2port);
ps2port->id = readb(ps2port->addr+GSC_ID) & 0x0f; ps2port->id = readb(ps2port->addr + GSC_ID) & 0x0f;
snprintf(ps2port->name, sizeof(ps2port->name)-1, "%s %s",
gscps2_serio_port.name, snprintf(serio->name, sizeof(serio->name), "GSC PS/2 %s",
(ps2port->id == GSC_ID_KEYBOARD) ? "keyboard" : "mouse" ); (ps2port->id == GSC_ID_KEYBOARD) ? "keyboard" : "mouse");
strlcpy(serio->phys, dev->dev.bus_id, sizeof(serio->phys));
memcpy(&ps2port->port, &gscps2_serio_port, sizeof(gscps2_serio_port)); serio->idbus = BUS_GSC;
ps2port->port.driver = ps2port; serio->idvendor = PCI_VENDOR_ID_HP;
ps2port->port.name = ps2port->name; serio->idproduct = 0x0001;
ps2port->port.phys = dev->dev.bus_id; serio->idversion = 0x0010;
serio->type = SERIO_8042;
serio->write = gscps2_write;
serio->open = gscps2_open;
serio->close = gscps2_close;
serio->port_data = ps2port;
serio->dev.parent = &dev->dev;
list_add_tail(&ps2port->node, &ps2port_list); list_add_tail(&ps2port->node, &ps2port_list);
ret = -EBUSY; ret = -EBUSY;
if (request_irq(dev->irq, gscps2_interrupt, SA_SHIRQ, ps2port->name, ps2port)) if (request_irq(dev->irq, gscps2_interrupt, SA_SHIRQ, ps2port->port->name, ps2port))
goto fail_miserably; goto fail_miserably;
if ( (ps2port->id != GSC_ID_KEYBOARD) && (ps2port->id != GSC_ID_MOUSE) ) { if (ps2port->id != GSC_ID_KEYBOARD && ps2port->id != GSC_ID_MOUSE) {
printk(KERN_WARNING PFX "Unsupported PS/2 port at 0x%08lx (id=%d) ignored\n", printk(KERN_WARNING PFX "Unsupported PS/2 port at 0x%08lx (id=%d) ignored\n",
hpa, ps2port->id); hpa, ps2port->id);
ret = -ENODEV; ret = -ENODEV;
...@@ -395,12 +406,12 @@ static int __init gscps2_probe(struct parisc_device *dev) ...@@ -395,12 +406,12 @@ static int __init gscps2_probe(struct parisc_device *dev)
#endif #endif
printk(KERN_INFO "serio: %s port at 0x%p irq %d @ %s\n", printk(KERN_INFO "serio: %s port at 0x%p irq %d @ %s\n",
ps2port->name, ps2port->port->name,
ps2port->addr, ps2port->addr,
ps2port->padev->irq, ps2port->padev->irq,
ps2port->port.phys); ps2port->port->phys);
serio_register_port(&ps2port->port); serio_register_port(ps2port->port);
return 0; return 0;
...@@ -411,7 +422,10 @@ static int __init gscps2_probe(struct parisc_device *dev) ...@@ -411,7 +422,10 @@ static int __init gscps2_probe(struct parisc_device *dev)
list_del(&ps2port->node); list_del(&ps2port->node);
iounmap(ps2port->addr); iounmap(ps2port->addr);
release_mem_region(dev->hpa, GSC_STATUS + 4); release_mem_region(dev->hpa, GSC_STATUS + 4);
fail_nomem:
kfree(ps2port); kfree(ps2port);
kfree(serio);
return ret; return ret;
} }
...@@ -424,7 +438,7 @@ static int __devexit gscps2_remove(struct parisc_device *dev) ...@@ -424,7 +438,7 @@ static int __devexit gscps2_remove(struct parisc_device *dev)
{ {
struct gscps2port *ps2port = dev_get_drvdata(&dev->dev); struct gscps2port *ps2port = dev_get_drvdata(&dev->dev);
serio_unregister_port(&ps2port->port); serio_unregister_port(ps2port->port);
free_irq(dev->irq, ps2port); free_irq(dev->irq, ps2port);
gscps2_flush(ps2port); gscps2_flush(ps2port);
list_del(&ps2port->node); list_del(&ps2port->node);
......
...@@ -65,6 +65,31 @@ static inline void i8042_write_command(int val) ...@@ -65,6 +65,31 @@ static inline void i8042_write_command(int val)
return; return;
} }
#if defined(__i386__)
#include <linux/dmi.h>
static struct dmi_system_id __initdata i8042_dmi_table[] = {
{
.ident = "Compaq Proliant 8500",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
DMI_MATCH(DMI_PRODUCT_VERSION, "8500"),
},
},
{
.ident = "Compaq Proliant DL760",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
DMI_MATCH(DMI_PRODUCT_VERSION, "DL760"),
},
},
{ }
};
#endif
static inline int i8042_platform_init(void) static inline int i8042_platform_init(void)
{ {
/* /*
...@@ -79,6 +104,12 @@ static inline int i8042_platform_init(void) ...@@ -79,6 +104,12 @@ static inline int i8042_platform_init(void)
#if !defined(__i386__) && !defined(__x86_64__) #if !defined(__i386__) && !defined(__x86_64__)
i8042_reset = 1; i8042_reset = 1;
#endif #endif
#if defined(__i386__)
if (dmi_check_system(i8042_dmi_table))
i8042_noloop = 1;
#endif
return 0; return 0;
} }
......
This diff is collapsed.
...@@ -103,6 +103,13 @@ ...@@ -103,6 +103,13 @@
#define I8042_BUFFER_SIZE 32 #define I8042_BUFFER_SIZE 32
/*
* Number of AUX ports on controllers supporting active multiplexing
* specification
*/
#define I8042_NUM_MUX_PORTS 4
/* /*
* Debug. * Debug.
*/ */
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/device.h> #include <linux/device.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/err.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
...@@ -46,15 +47,18 @@ MODULE_LICENSE("GPL"); ...@@ -46,15 +47,18 @@ MODULE_LICENSE("GPL");
#define PS2_CONTROL_RX_CLOCK_ENABLE BIT(4) /* pause reception if set to 0 */ #define PS2_CONTROL_RX_CLOCK_ENABLE BIT(4) /* pause reception if set to 0 */
#define PS2_CONTROL_RESET BIT(5) /* reset */ #define PS2_CONTROL_RESET BIT(5) /* reset */
struct maceps2_data { struct maceps2_data {
struct mace_ps2port *port; struct mace_ps2port *port;
int irq; int irq;
}; };
static struct maceps2_data port_data[2];
static struct serio *maceps2_port[2];
static struct platform_device *maceps2_device;
static int maceps2_write(struct serio *dev, unsigned char val) static int maceps2_write(struct serio *dev, unsigned char val)
{ {
struct mace_ps2port *port = ((struct maceps2_data *)dev->driver)->port; struct mace_ps2port *port = ((struct maceps2_data *)dev->port_data)->port;
unsigned int timeout = MACE_PS2_TIMEOUT; unsigned int timeout = MACE_PS2_TIMEOUT;
do { do {
...@@ -68,11 +72,10 @@ static int maceps2_write(struct serio *dev, unsigned char val) ...@@ -68,11 +72,10 @@ static int maceps2_write(struct serio *dev, unsigned char val)
return -1; return -1;
} }
static irqreturn_t maceps2_interrupt(int irq, void *dev_id, static irqreturn_t maceps2_interrupt(int irq, void *dev_id, struct pt_regs *regs)
struct pt_regs *regs)
{ {
struct serio *dev = dev_id; struct serio *dev = dev_id;
struct mace_ps2port *port = ((struct maceps2_data *)dev->driver)->port; struct mace_ps2port *port = ((struct maceps2_data *)dev->port_data)->port;
unsigned int byte; unsigned int byte;
if (mace_read(port->status) & PS2_STATUS_RX_FULL) { if (mace_read(port->status) & PS2_STATUS_RX_FULL) {
...@@ -85,7 +88,7 @@ static irqreturn_t maceps2_interrupt(int irq, void *dev_id, ...@@ -85,7 +88,7 @@ static irqreturn_t maceps2_interrupt(int irq, void *dev_id,
static int maceps2_open(struct serio *dev) static int maceps2_open(struct serio *dev)
{ {
struct maceps2_data *data = (struct maceps2_data *)dev->driver; struct maceps2_data *data = (struct maceps2_data *)dev->port_data;
if (request_irq(data->irq, maceps2_interrupt, 0, "PS/2 port", dev)) { if (request_irq(data->irq, maceps2_interrupt, 0, "PS/2 port", dev)) {
printk(KERN_ERR "Could not allocate PS/2 IRQ\n"); printk(KERN_ERR "Could not allocate PS/2 IRQ\n");
...@@ -106,7 +109,7 @@ static int maceps2_open(struct serio *dev) ...@@ -106,7 +109,7 @@ static int maceps2_open(struct serio *dev)
static void maceps2_close(struct serio *dev) static void maceps2_close(struct serio *dev)
{ {
struct maceps2_data *data = (struct maceps2_data *)dev->driver; struct maceps2_data *data = (struct maceps2_data *)dev->port_data;
mace_write(PS2_CONTROL_TX_CLOCK_DISABLE | PS2_CONTROL_RESET, mace_write(PS2_CONTROL_TX_CLOCK_DISABLE | PS2_CONTROL_RESET,
data->port->control); data->port->control);
...@@ -114,46 +117,59 @@ static void maceps2_close(struct serio *dev) ...@@ -114,46 +117,59 @@ static void maceps2_close(struct serio *dev)
free_irq(data->irq, dev); free_irq(data->irq, dev);
} }
static struct maceps2_data port0_data, port1_data;
static struct serio maceps2_port0 = static struct serio * __init maceps2_allocate_port(int idx)
{ {
.type = SERIO_8042, struct serio *serio;
.open = maceps2_open,
.close = maceps2_close, serio = kmalloc(sizeof(struct serio), GFP_KERNEL);
.write = maceps2_write, if (serio) {
.name = "MACE PS/2 port0", memset(serio, 0, sizeof(struct serio));
.phys = "mace/serio0", serio->type = SERIO_8042;
.driver = &port0_data, serio->write = maceps2_write;
}; serio->open = maceps2_open;
serio->close = maceps2_close;
snprintf(serio->name, sizeof(serio->name), "MACE PS/2 port%d", idx);
snprintf(serio->phys, sizeof(serio->phys), "mace/serio%d", idx);
serio->port_data = &port_data[idx];
serio->dev.parent = &maceps2_device->dev;
}
return serio;
}
static struct serio maceps2_port1 =
{
.type = SERIO_8042,
.open = maceps2_open,
.close = maceps2_close,
.write = maceps2_write,
.name = "MACE PS/2 port1",
.phys = "mace/serio1",
.driver = &port1_data,
};
static int __init maceps2_init(void) static int __init maceps2_init(void)
{ {
port0_data.port = &mace->perif.ps2.keyb; maceps2_device = platform_device_register_simple("maceps2", -1, NULL, 0);
port0_data.irq = MACEISA_KEYB_IRQ; if (IS_ERR(maceps2_device))
port1_data.port = &mace->perif.ps2.mouse; return PTR_ERR(maceps2_device);
port1_data.irq = MACEISA_MOUSE_IRQ;
serio_register_port(&maceps2_port0); port_data[0].port = &mace->perif.ps2.keyb;
serio_register_port(&maceps2_port1); port_data[0].irq = MACEISA_KEYB_IRQ;
port_data[1].port = &mace->perif.ps2.mouse;
port_data[1].irq = MACEISA_MOUSE_IRQ;
maceps2_port[0] = maceps2_allocate_port(0);
maceps2_port[1] = maceps2_allocate_port(1);
if (!maceps2_port[0] || !maceps2_port[1]) {
kfree(maceps2_port[0]);
kfree(maceps2_port[1]);
platform_device_unregister(maceps2_device);
return -ENOMEM;
}
serio_register_port(maceps2_port[0]);
serio_register_port(maceps2_port[1]);
return 0; return 0;
} }
static void __exit maceps2_exit(void) static void __exit maceps2_exit(void)
{ {
serio_unregister_port(&maceps2_port0); serio_unregister_port(maceps2_port[0]);
serio_unregister_port(&maceps2_port1); serio_unregister_port(maceps2_port[1]);
platform_device_unregister(maceps2_device);
} }
module_init(maceps2_init); module_init(maceps2_init);
......
...@@ -53,9 +53,7 @@ static int parkbd_writing; ...@@ -53,9 +53,7 @@ static int parkbd_writing;
static unsigned long parkbd_start; static unsigned long parkbd_start;
static struct pardevice *parkbd_dev; static struct pardevice *parkbd_dev;
static struct serio *parkbd_port;
static char parkbd_name[] = "PARKBD AT/XT keyboard adapter";
static char parkbd_phys[32];
static int parkbd_readlines(void) static int parkbd_readlines(void)
{ {
...@@ -86,13 +84,6 @@ static int parkbd_write(struct serio *port, unsigned char c) ...@@ -86,13 +84,6 @@ static int parkbd_write(struct serio *port, unsigned char c)
return 0; return 0;
} }
static struct serio parkbd_port =
{
.write = parkbd_write,
.name = parkbd_name,
.phys = parkbd_phys,
};
static void parkbd_interrupt(int irq, void *dev_id, struct pt_regs *regs) static void parkbd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
...@@ -125,7 +116,7 @@ static void parkbd_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -125,7 +116,7 @@ static void parkbd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
parkbd_buffer |= (parkbd_readlines() >> 1) << parkbd_counter++; parkbd_buffer |= (parkbd_readlines() >> 1) << parkbd_counter++;
if (parkbd_counter == parkbd_mode + 10) if (parkbd_counter == parkbd_mode + 10)
serio_interrupt(&parkbd_port, (parkbd_buffer >> (2 - parkbd_mode)) & 0xff, 0, regs); serio_interrupt(parkbd_port, (parkbd_buffer >> (2 - parkbd_mode)) & 0xff, 0, regs);
} }
parkbd_last = jiffies; parkbd_last = jiffies;
...@@ -163,16 +154,38 @@ static int parkbd_getport(void) ...@@ -163,16 +154,38 @@ static int parkbd_getport(void)
return 0; return 0;
} }
static struct serio * __init parkbd_allocate_serio(void)
{
struct serio *serio;
serio = kmalloc(sizeof(struct serio), GFP_KERNEL);
if (serio) {
serio->type = parkbd_mode;
serio->write = parkbd_write,
strlcpy(serio->name, "PARKBD AT/XT keyboard adapter", sizeof(serio->name));
snprintf(serio->phys, sizeof(serio->phys), "%s/serio0", parkbd_dev->port->name);
}
return serio;
}
int __init parkbd_init(void) int __init parkbd_init(void)
{ {
if (parkbd_getport()) return -1; int err;
parkbd_writelines(3);
parkbd_port.type = parkbd_mode; err = parkbd_getport();
if (err)
return err;
sprintf(parkbd_phys, "%s/serio0", parkbd_dev->port->name); parkbd_port = parkbd_allocate_serio();
if (!parkbd_port) {
parport_release(parkbd_dev);
return -ENOMEM;
}
parkbd_writelines(3);
serio_register_port(&parkbd_port); serio_register_port(parkbd_port);
printk(KERN_INFO "serio: PARKBD %s adapter on %s\n", printk(KERN_INFO "serio: PARKBD %s adapter on %s\n",
parkbd_mode ? "AT" : "XT", parkbd_dev->port->name); parkbd_mode ? "AT" : "XT", parkbd_dev->port->name);
...@@ -183,7 +196,7 @@ int __init parkbd_init(void) ...@@ -183,7 +196,7 @@ int __init parkbd_init(void)
void __exit parkbd_exit(void) void __exit parkbd_exit(void)
{ {
parport_release(parkbd_dev); parport_release(parkbd_dev);
serio_unregister_port(&parkbd_port); serio_unregister_port(parkbd_port);
parport_unregister_device(parkbd_dev); parport_unregister_device(parkbd_dev);
} }
......
...@@ -38,14 +38,14 @@ ...@@ -38,14 +38,14 @@
#define PS2_STAT_TXEMPTY (1<<7) #define PS2_STAT_TXEMPTY (1<<7)
struct pcips2_data { struct pcips2_data {
struct serio io; struct serio *io;
unsigned int base; unsigned int base;
struct pci_dev *dev; struct pci_dev *dev;
}; };
static int pcips2_write(struct serio *io, unsigned char val) static int pcips2_write(struct serio *io, unsigned char val)
{ {
struct pcips2_data *ps2if = io->driver; struct pcips2_data *ps2if = io->port_data;
unsigned int stat; unsigned int stat;
do { do {
...@@ -80,7 +80,7 @@ static irqreturn_t pcips2_interrupt(int irq, void *devid, struct pt_regs *regs) ...@@ -80,7 +80,7 @@ static irqreturn_t pcips2_interrupt(int irq, void *devid, struct pt_regs *regs)
if (hweight8(scancode) & 1) if (hweight8(scancode) & 1)
flag ^= SERIO_PARITY; flag ^= SERIO_PARITY;
serio_interrupt(&ps2if->io, scancode, flag, regs); serio_interrupt(ps2if->io, scancode, flag, regs);
} while (1); } while (1);
return IRQ_RETVAL(handled); return IRQ_RETVAL(handled);
} }
...@@ -101,7 +101,7 @@ static void pcips2_flush_input(struct pcips2_data *ps2if) ...@@ -101,7 +101,7 @@ static void pcips2_flush_input(struct pcips2_data *ps2if)
static int pcips2_open(struct serio *io) static int pcips2_open(struct serio *io)
{ {
struct pcips2_data *ps2if = io->driver; struct pcips2_data *ps2if = io->port_data;
int ret, val = 0; int ret, val = 0;
outb(PS2_CTRL_ENABLE, ps2if->base); outb(PS2_CTRL_ENABLE, ps2if->base);
...@@ -119,7 +119,7 @@ static int pcips2_open(struct serio *io) ...@@ -119,7 +119,7 @@ static int pcips2_open(struct serio *io)
static void pcips2_close(struct serio *io) static void pcips2_close(struct serio *io)
{ {
struct pcips2_data *ps2if = io->driver; struct pcips2_data *ps2if = io->port_data;
outb(0, ps2if->base); outb(0, ps2if->base);
...@@ -129,46 +129,51 @@ static void pcips2_close(struct serio *io) ...@@ -129,46 +129,51 @@ static void pcips2_close(struct serio *io)
static int __devinit pcips2_probe(struct pci_dev *dev, const struct pci_device_id *id) static int __devinit pcips2_probe(struct pci_dev *dev, const struct pci_device_id *id)
{ {
struct pcips2_data *ps2if; struct pcips2_data *ps2if;
struct serio *serio;
int ret; int ret;
ret = pci_enable_device(dev); ret = pci_enable_device(dev);
if (ret) if (ret)
return ret; goto out;
if (!request_region(pci_resource_start(dev, 0), ret = pci_request_regions(dev, "pcips2");
pci_resource_len(dev, 0), "pcips2")) { if (ret)
ret = -EBUSY;
goto disable; goto disable;
}
ps2if = kmalloc(sizeof(struct pcips2_data), GFP_KERNEL); ps2if = kmalloc(sizeof(struct pcips2_data), GFP_KERNEL);
if (!ps2if) { serio = kmalloc(sizeof(struct serio), GFP_KERNEL);
if (!ps2if || !serio) {
ret = -ENOMEM; ret = -ENOMEM;
goto release; goto release;
} }
memset(ps2if, 0, sizeof(struct pcips2_data)); memset(ps2if, 0, sizeof(struct pcips2_data));
memset(serio, 0, sizeof(struct serio));
ps2if->io.type = SERIO_8042;
ps2if->io.write = pcips2_write; serio->type = SERIO_8042;
ps2if->io.open = pcips2_open; serio->write = pcips2_write;
ps2if->io.close = pcips2_close; serio->open = pcips2_open;
ps2if->io.name = pci_name(dev); serio->close = pcips2_close;
ps2if->io.phys = dev->dev.bus_id; strlcpy(serio->name, pci_name(dev), sizeof(serio->name));
ps2if->io.driver = ps2if; strlcpy(serio->phys, dev->dev.bus_id, sizeof(serio->phys));
serio->port_data = ps2if;
serio->dev.parent = &dev->dev;
ps2if->io = serio;
ps2if->dev = dev; ps2if->dev = dev;
ps2if->base = pci_resource_start(dev, 0); ps2if->base = pci_resource_start(dev, 0);
pci_set_drvdata(dev, ps2if); pci_set_drvdata(dev, ps2if);
serio_register_port(&ps2if->io); serio_register_port(ps2if->io);
return 0; return 0;
release: release:
release_region(pci_resource_start(dev, 0), kfree(ps2if);
pci_resource_len(dev, 0)); kfree(serio);
pci_release_regions(dev);
disable: disable:
pci_disable_device(dev); pci_disable_device(dev);
out:
return ret; return ret;
} }
...@@ -176,11 +181,10 @@ static void __devexit pcips2_remove(struct pci_dev *dev) ...@@ -176,11 +181,10 @@ static void __devexit pcips2_remove(struct pci_dev *dev)
{ {
struct pcips2_data *ps2if = pci_get_drvdata(dev); struct pcips2_data *ps2if = pci_get_drvdata(dev);
serio_unregister_port(&ps2if->io); serio_unregister_port(ps2if->io);
release_region(pci_resource_start(dev, 0),
pci_resource_len(dev, 0));
pci_set_drvdata(dev, NULL); pci_set_drvdata(dev, NULL);
kfree(ps2if); kfree(ps2if);
pci_release_regions(dev);
pci_disable_device(dev); pci_disable_device(dev);
} }
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/serio.h> #include <linux/serio.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/err.h>
#include <asm/bitops.h> #include <asm/bitops.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -47,43 +48,106 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); ...@@ -47,43 +48,106 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Q40 PS/2 keyboard controller driver"); MODULE_DESCRIPTION("Q40 PS/2 keyboard controller driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
static struct serio q40kbd_port = spinlock_t q40kbd_lock = SPIN_LOCK_UNLOCKED;
{ static struct serio *q40kbd_port;
.type = SERIO_8042, static struct platform_device *q40kbd_device;
.name = "Q40 kbd port",
.phys = "Q40", static irqreturn_t q40kbd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
.write = NULL,
};
static irqreturn_t q40kbd_interrupt(int irq, void *dev_id,
struct pt_regs *regs)
{ {
unsigned long flags;
spin_lock_irqsave(&q40kbd_lock, flags);
if (Q40_IRQ_KEYB_MASK & master_inb(INTERRUPT_REG)) if (Q40_IRQ_KEYB_MASK & master_inb(INTERRUPT_REG))
serio_interrupt(&q40kbd_port, master_inb(KEYCODE_REG), 0, regs); serio_interrupt(q40kbd_port, master_inb(KEYCODE_REG), 0, regs);
master_outb(-1, KEYBOARD_UNLOCK_REG); master_outb(-1, KEYBOARD_UNLOCK_REG);
spin_unlock_irqrestore(&q40kbd_lock, flags);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static int __init q40kbd_init(void) /*
* q40kbd_flush() flushes all data that may be in the keyboard buffers
*/
static void q40kbd_flush(void)
{
int maxread = 100;
unsigned long flags;
spin_lock_irqsave(&q40kbd_lock, flags);
while (maxread-- && (Q40_IRQ_KEYB_MASK & master_inb(INTERRUPT_REG)))
master_inb(KEYCODE_REG);
spin_unlock_irqrestore(&q40kbd_lock, flags);
}
/*
* q40kbd_open() is called when a port is open by the higher layer.
* It allocates the interrupt and enables in in the chip.
*/
static int q40kbd_open(struct serio *port)
{ {
int maxread = 100; q40kbd_flush();
if (request_irq(Q40_IRQ_KEYBOARD, q40kbd_interrupt, 0, "q40kbd", NULL)) {
printk(KERN_ERR "q40kbd.c: Can't get irq %d.\n", Q40_IRQ_KEYBOARD);
return -1;
}
/* off we go */
master_outb(-1, KEYBOARD_UNLOCK_REG);
master_outb(1, KEY_IRQ_ENABLE_REG);
return 0;
}
static void q40kbd_close(struct serio *port)
{
master_outb(0, KEY_IRQ_ENABLE_REG);
master_outb(-1, KEYBOARD_UNLOCK_REG);
free_irq(Q40_IRQ_KEYBOARD, NULL);
q40kbd_flush();
}
static struct serio * __init q40kbd_allocate_port(void)
{
struct serio *serio;
serio = kmalloc(sizeof(struct serio), GFP_KERNEL);
if (serio) {
memset(serio, 0, sizeof(struct serio));
serio->type = SERIO_8042;
serio->open = q40kbd_open;
serio->close = q40kbd_close;
serio->dev.parent = &q40kbd_device->dev;
strlcpy(serio->name, "Q40 Kbd Port", sizeof(serio->name));
strlcpy(serio->phys, "Q40", sizeof(serio->phys));
}
return serio;
}
static int __init q40kbd_init(void)
{
if (!MACH_IS_Q40) if (!MACH_IS_Q40)
return -EIO; return -EIO;
/* allocate the IRQ */ q40kbd_device = platform_device_register_simple("q40kbd", -1, NULL, 0);
request_irq(Q40_IRQ_KEYBOARD, q40kbd_interrupt, 0, "q40kbd", NULL); if (IS_ERR(q40kbd_device))
return PTR_ERR(q40kbd_device);
/* flush any pending input */
while (maxread-- && (Q40_IRQ_KEYB_MASK & master_inb(INTERRUPT_REG)))
master_inb(KEYCODE_REG);
/* off we go */ if (!(q40kbd_port = q40kbd_allocate_port())) {
master_outb(-1,KEYBOARD_UNLOCK_REG); platform_device_unregister(q40kbd_device);
master_outb(1,KEY_IRQ_ENABLE_REG); return -ENOMEM;
}
serio_register_port(&q40kbd_port); serio_register_port(q40kbd_port);
printk(KERN_INFO "serio: Q40 kbd registered\n"); printk(KERN_INFO "serio: Q40 kbd registered\n");
return 0; return 0;
...@@ -91,11 +155,8 @@ static int __init q40kbd_init(void) ...@@ -91,11 +155,8 @@ static int __init q40kbd_init(void)
static void __exit q40kbd_exit(void) static void __exit q40kbd_exit(void)
{ {
master_outb(0,KEY_IRQ_ENABLE_REG); serio_unregister_port(q40kbd_port);
master_outb(-1,KEYBOARD_UNLOCK_REG); platform_device_unregister(q40kbd_device);
serio_unregister_port(&q40kbd_port);
free_irq(Q40_IRQ_KEYBOARD, NULL);
} }
module_init(q40kbd_init); module_init(q40kbd_init);
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/serio.h> #include <linux/serio.h>
#include <linux/err.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/hardware.h> #include <asm/hardware.h>
...@@ -44,6 +45,9 @@ MODULE_AUTHOR("Vojtech Pavlik, Russell King"); ...@@ -44,6 +45,9 @@ MODULE_AUTHOR("Vojtech Pavlik, Russell King");
MODULE_DESCRIPTION("Acorn RiscPC PS/2 keyboard controller driver"); MODULE_DESCRIPTION("Acorn RiscPC PS/2 keyboard controller driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
static struct serio *rpckbd_port;
static struct platform_device *rpckbd_device;
static int rpckbd_write(struct serio *port, unsigned char val) static int rpckbd_write(struct serio *port, unsigned char val)
{ {
while (!(iomd_readb(IOMD_KCTRL) & (1 << 7))) while (!(iomd_readb(IOMD_KCTRL) & (1 << 7)))
...@@ -101,25 +105,49 @@ static void rpckbd_close(struct serio *port) ...@@ -101,25 +105,49 @@ static void rpckbd_close(struct serio *port)
free_irq(IRQ_KEYBOARDTX, port); free_irq(IRQ_KEYBOARDTX, port);
} }
static struct serio rpckbd_port = /*
* Allocate and initialize serio structure for subsequent registration
* with serio core.
*/
static struct serio * __init rpckbd_allocate_port(void)
{ {
.type = SERIO_8042, struct serio *serio;
.open = rpckbd_open,
.close = rpckbd_close, serio = kmalloc(sizeof(struct serio), GFP_KERNEL);
.write = rpckbd_write, if (serio) {
.name = "RiscPC PS/2 kbd port", memset(serio, 0, sizeof(struct serio));
.phys = "rpckbd/serio0", serio->type = SERIO_8042;
}; serio->write = rpckbd_write;
serio->open = rpckbd_open;
serio->close = rpckbd_close;
serio->dev.parent = &rpckbd_device->dev;
strlcpy(serio->name, "RiscPC PS/2 kbd port", sizeof(serio->name));
strlcpy(serio->phys, "rpckbd/serio0", sizeof(serio->phys));
}
return serio;
}
static int __init rpckbd_init(void) static int __init rpckbd_init(void)
{ {
serio_register_port(&rpckbd_port); rpckbd_device = platform_device_register_simple("rpckbd", -1, NULL, 0);
if (IS_ERR(rpckbd_device))
return PTR_ERR(rpckbd_device);
if (!(rpckbd_port = rpckbd_allocate_port())) {
platform_device_unregister(rpckbd_device);
return -ENOMEM;
}
serio_register_port(rpckbd_port);
return 0; return 0;
} }
static void __exit rpckbd_exit(void) static void __exit rpckbd_exit(void)
{ {
serio_unregister_port(&rpckbd_port); serio_unregister_port(rpckbd_port);
platform_device_unregister(rpckbd_device);
} }
module_init(rpckbd_init); module_init(rpckbd_init);
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include <asm/hardware/sa1111.h> #include <asm/hardware/sa1111.h>
struct ps2if { struct ps2if {
struct serio io; struct serio *io;
struct sa1111_dev *dev; struct sa1111_dev *dev;
unsigned long base; unsigned long base;
unsigned int open; unsigned int open;
...@@ -59,7 +59,7 @@ static irqreturn_t ps2_rxint(int irq, void *dev_id, struct pt_regs *regs) ...@@ -59,7 +59,7 @@ static irqreturn_t ps2_rxint(int irq, void *dev_id, struct pt_regs *regs)
if (hweight8(scancode) & 1) if (hweight8(scancode) & 1)
flag ^= SERIO_PARITY; flag ^= SERIO_PARITY;
serio_interrupt(&ps2if->io, scancode, flag, regs); serio_interrupt(ps2if->io, scancode, flag, regs);
status = sa1111_readl(ps2if->base + SA1111_PS2STAT); status = sa1111_readl(ps2if->base + SA1111_PS2STAT);
} }
...@@ -95,7 +95,7 @@ static irqreturn_t ps2_txint(int irq, void *dev_id, struct pt_regs *regs) ...@@ -95,7 +95,7 @@ static irqreturn_t ps2_txint(int irq, void *dev_id, struct pt_regs *regs)
*/ */
static int ps2_write(struct serio *io, unsigned char val) static int ps2_write(struct serio *io, unsigned char val)
{ {
struct ps2if *ps2if = io->driver; struct ps2if *ps2if = io->port_data;
unsigned long flags; unsigned long flags;
unsigned int head; unsigned int head;
...@@ -122,7 +122,7 @@ static int ps2_write(struct serio *io, unsigned char val) ...@@ -122,7 +122,7 @@ static int ps2_write(struct serio *io, unsigned char val)
static int ps2_open(struct serio *io) static int ps2_open(struct serio *io)
{ {
struct ps2if *ps2if = io->driver; struct ps2if *ps2if = io->port_data;
int ret; int ret;
sa1111_enable_device(ps2if->dev); sa1111_enable_device(ps2if->dev);
...@@ -154,7 +154,7 @@ static int ps2_open(struct serio *io) ...@@ -154,7 +154,7 @@ static int ps2_open(struct serio *io)
static void ps2_close(struct serio *io) static void ps2_close(struct serio *io)
{ {
struct ps2if *ps2if = io->driver; struct ps2if *ps2if = io->port_data;
sa1111_writel(0, ps2if->base + SA1111_PS2CR); sa1111_writel(0, ps2if->base + SA1111_PS2CR);
...@@ -232,22 +232,28 @@ static int __init ps2_test(struct ps2if *ps2if) ...@@ -232,22 +232,28 @@ static int __init ps2_test(struct ps2if *ps2if)
static int ps2_probe(struct sa1111_dev *dev) static int ps2_probe(struct sa1111_dev *dev)
{ {
struct ps2if *ps2if; struct ps2if *ps2if;
struct serio *serio;
int ret; int ret;
ps2if = kmalloc(sizeof(struct ps2if), GFP_KERNEL); ps2if = kmalloc(sizeof(struct ps2if), GFP_KERNEL);
if (!ps2if) { serio = kmalloc(sizeof(struct serio), GFP_KERNEL);
return -ENOMEM; if (!ps2if || !serio) {
ret = -ENOMEM;
goto free;
} }
memset(ps2if, 0, sizeof(struct ps2if)); memset(ps2if, 0, sizeof(struct ps2if));
memset(serio, 0, sizeof(struct serio));
ps2if->io.type = SERIO_8042;
ps2if->io.write = ps2_write; serio->type = SERIO_8042;
ps2if->io.open = ps2_open; serio->write = ps2_write;
ps2if->io.close = ps2_close; serio->open = ps2_open;
ps2if->io.name = dev->dev.bus_id; serio->close = ps2_close;
ps2if->io.phys = dev->dev.bus_id; strlcpy(serio->name, dev->dev.bus_id, sizeof(serio->name));
ps2if->io.driver = ps2if; strlcpy(serio->phys, dev->dev.bus_id, sizeof(serio->phys));
serio->port_data = ps2if;
serio->dev.parent = &dev->dev;
ps2if->io = serio;
ps2if->dev = dev; ps2if->dev = dev;
sa1111_set_drvdata(dev, ps2if); sa1111_set_drvdata(dev, ps2if);
...@@ -292,7 +298,7 @@ static int ps2_probe(struct sa1111_dev *dev) ...@@ -292,7 +298,7 @@ static int ps2_probe(struct sa1111_dev *dev)
ps2_clear_input(ps2if); ps2_clear_input(ps2if);
sa1111_disable_device(ps2if->dev); sa1111_disable_device(ps2if->dev);
serio_register_port(&ps2if->io); serio_register_port(ps2if->io);
return 0; return 0;
out: out:
...@@ -302,6 +308,7 @@ static int ps2_probe(struct sa1111_dev *dev) ...@@ -302,6 +308,7 @@ static int ps2_probe(struct sa1111_dev *dev)
free: free:
sa1111_set_drvdata(dev, NULL); sa1111_set_drvdata(dev, NULL);
kfree(ps2if); kfree(ps2if);
kfree(serio);
return ret; return ret;
} }
...@@ -312,7 +319,7 @@ static int ps2_remove(struct sa1111_dev *dev) ...@@ -312,7 +319,7 @@ static int ps2_remove(struct sa1111_dev *dev)
{ {
struct ps2if *ps2if = sa1111_get_drvdata(dev); struct ps2if *ps2if = sa1111_get_drvdata(dev);
serio_unregister_port(&ps2if->io); serio_unregister_port(ps2if->io);
release_mem_region(dev->res.start, release_mem_region(dev->res.start,
dev->res.end - dev->res.start + 1); dev->res.end - dev->res.start + 1);
sa1111_set_drvdata(dev, NULL); sa1111_set_drvdata(dev, NULL);
......
This diff is collapsed.
This diff is collapsed.
...@@ -31,28 +31,25 @@ MODULE_ALIAS_LDISC(N_MOUSE); ...@@ -31,28 +31,25 @@ MODULE_ALIAS_LDISC(N_MOUSE);
struct serport { struct serport {
struct tty_struct *tty; struct tty_struct *tty;
wait_queue_head_t wait; wait_queue_head_t wait;
struct serio serio; struct serio *serio;
unsigned long flags; unsigned long flags;
char phys[32];
}; };
char serport_name[] = "Serial port";
/* /*
* Callback functions from the serio code. * Callback functions from the serio code.
*/ */
static int serport_serio_write(struct serio *serio, unsigned char data) static int serport_serio_write(struct serio *serio, unsigned char data)
{ {
struct serport *serport = serio->driver; struct serport *serport = serio->port_data;
return -(serport->tty->driver->write(serport->tty, 0, &data, 1) != 1); return -(serport->tty->driver->write(serport->tty, 0, &data, 1) != 1);
} }
static void serport_serio_close(struct serio *serio) static void serport_serio_close(struct serio *serio)
{ {
struct serport *serport = serio->driver; struct serport *serport = serio->port_data;
serport->serio.type = 0; serport->serio->type = 0;
wake_up_interruptible(&serport->wait); wake_up_interruptible(&serport->wait);
} }
...@@ -64,26 +61,30 @@ static void serport_serio_close(struct serio *serio) ...@@ -64,26 +61,30 @@ static void serport_serio_close(struct serio *serio)
static int serport_ldisc_open(struct tty_struct *tty) static int serport_ldisc_open(struct tty_struct *tty)
{ {
struct serport *serport; struct serport *serport;
struct serio *serio;
char name[64]; char name[64];
serport = kmalloc(sizeof(struct serport), GFP_KERNEL); serport = kmalloc(sizeof(struct serport), GFP_KERNEL);
if (unlikely(!serport)) serio = kmalloc(sizeof(struct serio), GFP_KERNEL);
if (unlikely(!serport || !serio)) {
kfree(serport);
kfree(serio);
return -ENOMEM; return -ENOMEM;
memset(serport, 0, sizeof(struct serport)); }
memset(serport, 0, sizeof(struct serport));
serport->serio = serio;
set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
serport->tty = tty; serport->tty = tty;
tty->disc_data = serport; tty->disc_data = serport;
snprintf(serport->phys, sizeof(serport->phys), "%s/serio0", tty_name(tty, name)); memset(serio, 0, sizeof(struct serio));
strlcpy(serio->name, "Serial port", sizeof(serio->name));
serport->serio.name = serport_name; snprintf(serio->phys, sizeof(serio->phys), "%s/serio0", tty_name(tty, name));
serport->serio.phys = serport->phys; serio->type = SERIO_RS232;
serio->write = serport_serio_write;
serport->serio.type = SERIO_RS232; serio->close = serport_serio_close;
serport->serio.write = serport_serio_write; serio->port_data = serport;
serport->serio.close = serport_serio_close;
serport->serio.driver = serport;
init_waitqueue_head(&serport->wait); init_waitqueue_head(&serport->wait);
...@@ -114,7 +115,7 @@ static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *c ...@@ -114,7 +115,7 @@ static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *c
struct serport *serport = (struct serport*) tty->disc_data; struct serport *serport = (struct serport*) tty->disc_data;
int i; int i;
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
serio_interrupt(&serport->serio, cp[i], 0, NULL); serio_interrupt(serport->serio, cp[i], 0, NULL);
} }
/* /*
...@@ -142,10 +143,10 @@ static ssize_t serport_ldisc_read(struct tty_struct * tty, struct file * file, u ...@@ -142,10 +143,10 @@ static ssize_t serport_ldisc_read(struct tty_struct * tty, struct file * file, u
if (test_and_set_bit(SERPORT_BUSY, &serport->flags)) if (test_and_set_bit(SERPORT_BUSY, &serport->flags))
return -EBUSY; return -EBUSY;
serio_register_port(&serport->serio); serio_register_port(serport->serio);
printk(KERN_INFO "serio: Serial port %s\n", tty_name(tty, name)); printk(KERN_INFO "serio: Serial port %s\n", tty_name(tty, name));
wait_event_interruptible(serport->wait, !serport->serio.type); wait_event_interruptible(serport->wait, !serport->serio->type);
serio_unregister_port(&serport->serio); serio_unregister_port(serport->serio);
clear_bit(SERPORT_BUSY, &serport->flags); clear_bit(SERPORT_BUSY, &serport->flags);
...@@ -161,7 +162,7 @@ static int serport_ldisc_ioctl(struct tty_struct * tty, struct file * file, unsi ...@@ -161,7 +162,7 @@ static int serport_ldisc_ioctl(struct tty_struct * tty, struct file * file, unsi
struct serport *serport = (struct serport*) tty->disc_data; struct serport *serport = (struct serport*) tty->disc_data;
if (cmd == SPIOCSTYPE) if (cmd == SPIOCSTYPE)
return get_user(serport->serio.type, (unsigned long __user *) arg); return get_user(serport->serio->type, (unsigned long __user *) arg);
return -EINVAL; return -EINVAL;
} }
...@@ -170,7 +171,7 @@ static void serport_ldisc_write_wakeup(struct tty_struct * tty) ...@@ -170,7 +171,7 @@ static void serport_ldisc_write_wakeup(struct tty_struct * tty)
{ {
struct serport *sp = (struct serport *) tty->disc_data; struct serport *sp = (struct serport *) tty->disc_data;
serio_dev_write_wakeup(&sp->serio); serio_drv_write_wakeup(sp->serio);
} }
/* /*
......
...@@ -36,8 +36,10 @@ ...@@ -36,8 +36,10 @@
#include <linux/serio.h> #include <linux/serio.h>
#include <linux/init.h> #include <linux/init.h>
#define DRIVER_DESC "Gunze AHL-51S touchscreen driver"
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Gunze AHL-51S touchscreen driver"); MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
/* /*
...@@ -111,7 +113,7 @@ static void gunze_disconnect(struct serio *serio) ...@@ -111,7 +113,7 @@ static void gunze_disconnect(struct serio *serio)
* and if yes, registers it as an input device. * and if yes, registers it as an input device.
*/ */
static void gunze_connect(struct serio *serio, struct serio_dev *dev) static void gunze_connect(struct serio *serio, struct serio_driver *drv)
{ {
struct gunze *gunze; struct gunze *gunze;
...@@ -142,7 +144,7 @@ static void gunze_connect(struct serio *serio, struct serio_dev *dev) ...@@ -142,7 +144,7 @@ static void gunze_connect(struct serio *serio, struct serio_dev *dev)
gunze->dev.id.product = 0x0051; gunze->dev.id.product = 0x0051;
gunze->dev.id.version = 0x0100; gunze->dev.id.version = 0x0100;
if (serio_open(serio, dev)) { if (serio_open(serio, drv)) {
kfree(gunze); kfree(gunze);
return; return;
} }
...@@ -156,10 +158,14 @@ static void gunze_connect(struct serio *serio, struct serio_dev *dev) ...@@ -156,10 +158,14 @@ static void gunze_connect(struct serio *serio, struct serio_dev *dev)
* The serio device structure. * The serio device structure.
*/ */
static struct serio_dev gunze_dev = { static struct serio_driver gunze_drv = {
.interrupt = gunze_interrupt, .driver = {
.connect = gunze_connect, .name = "gunze",
.disconnect = gunze_disconnect, },
.description = DRIVER_DESC,
.interrupt = gunze_interrupt,
.connect = gunze_connect,
.disconnect = gunze_disconnect,
}; };
/* /*
...@@ -168,13 +174,13 @@ static struct serio_dev gunze_dev = { ...@@ -168,13 +174,13 @@ static struct serio_dev gunze_dev = {
int __init gunze_init(void) int __init gunze_init(void)
{ {
serio_register_device(&gunze_dev); serio_register_driver(&gunze_drv);
return 0; return 0;
} }
void __exit gunze_exit(void) void __exit gunze_exit(void)
{ {
serio_unregister_device(&gunze_dev); serio_unregister_driver(&gunze_drv);
} }
module_init(gunze_init); module_init(gunze_init);
......
...@@ -45,8 +45,10 @@ ...@@ -45,8 +45,10 @@
#include <asm/arch/hardware.h> #include <asm/arch/hardware.h>
#include <asm/arch/irqs.h> #include <asm/arch/irqs.h>
#define DRIVER_DESC "H3600 touchscreen driver"
MODULE_AUTHOR("James Simmons <jsimmons@transvirtual.com>"); MODULE_AUTHOR("James Simmons <jsimmons@transvirtual.com>");
MODULE_DESCRIPTION("H3600 touchscreen driver"); MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
/* /*
...@@ -373,7 +375,7 @@ static irqreturn_t h3600ts_interrupt(struct serio *serio, unsigned char data, ...@@ -373,7 +375,7 @@ static irqreturn_t h3600ts_interrupt(struct serio *serio, unsigned char data,
* new serio device. It looks whether it was registered as a H3600 touchscreen * new serio device. It looks whether it was registered as a H3600 touchscreen
* and if yes, registers it as an input device. * and if yes, registers it as an input device.
*/ */
static void h3600ts_connect(struct serio *serio, struct serio_dev *dev) static void h3600ts_connect(struct serio *serio, struct serio_driver *drv)
{ {
struct h3600_dev *ts; struct h3600_dev *ts;
...@@ -441,7 +443,7 @@ static void h3600ts_connect(struct serio *serio, struct serio_dev *dev) ...@@ -441,7 +443,7 @@ static void h3600ts_connect(struct serio *serio, struct serio_dev *dev)
ts->dev.id.product = 0x0666; /* FIXME !!! We can ask the hardware */ ts->dev.id.product = 0x0666; /* FIXME !!! We can ask the hardware */
ts->dev.id.version = 0x0100; ts->dev.id.version = 0x0100;
if (serio_open(serio, dev)) { if (serio_open(serio, drv)) {
free_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, ts); free_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, ts);
free_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, ts); free_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, ts);
kfree(ts); kfree(ts);
...@@ -478,10 +480,14 @@ static void h3600ts_disconnect(struct serio *serio) ...@@ -478,10 +480,14 @@ static void h3600ts_disconnect(struct serio *serio)
* The serio device structure. * The serio device structure.
*/ */
static struct serio_dev h3600ts_dev = { static struct serio_driver h3600ts_drv = {
.interrupt = h3600ts_interrupt, .driver = {
.connect = h3600ts_connect, .name = "h3600ts",
.disconnect = h3600ts_disconnect, },
.description = DRIVER_DESC,
.interrupt = h3600ts_interrupt,
.connect = h3600ts_connect,
.disconnect = h3600ts_disconnect,
}; };
/* /*
...@@ -490,13 +496,13 @@ static struct serio_dev h3600ts_dev = { ...@@ -490,13 +496,13 @@ static struct serio_dev h3600ts_dev = {
static int __init h3600ts_init(void) static int __init h3600ts_init(void)
{ {
serio_register_device(&h3600ts_dev); serio_register_driver(&h3600ts_drv);
return 0; return 0;
} }
static void __exit h3600ts_exit(void) static void __exit h3600ts_exit(void)
{ {
serio_unregister_device(&h3600ts_dev); serio_unregister_driver(&h3600ts_drv);
} }
module_init(h3600ts_init); module_init(h3600ts_init);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -626,16 +626,19 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd ...@@ -626,16 +626,19 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
goto inval; goto inval;
field = report->field[uref->field_index]; field = report->field[uref->field_index];
if (uref->usage_index >= field->maxusage)
goto inval;
if (cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) { if (cmd == HIDIOCGCOLLECTIONINDEX) {
if (uref_multi->num_values >= HID_MAX_USAGES || if (uref->usage_index >= field->maxusage)
uref->usage_index >= field->maxusage ||
(uref->usage_index + uref_multi->num_values) >= field->maxusage)
goto inval; goto inval;
} else if (uref->usage_index >= field->report_count)
goto inval;
else if ((cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) &&
(uref_multi->num_values >= HID_MAX_MULTI_USAGES ||
uref->usage_index + uref_multi->num_values >= field->report_count ||
uref->usage_index + uref_multi->num_values < uref->usage_index))
goto inval;
} }
}
switch (cmd) { switch (cmd) {
case HIDIOCGUSAGE: case HIDIOCGUSAGE:
......
...@@ -116,6 +116,8 @@ ...@@ -116,6 +116,8 @@
#include <linux/filter.h> #include <linux/filter.h>
#include <linux/msdos_fs.h> #include <linux/msdos_fs.h>
#include <linux/hiddev.h>
#undef INCLUDES #undef INCLUDES
#endif #endif
......
/*
* 8253/8254 Programmable Interval Timer
*/
#ifndef _8253PIT_H
#define _8253PIT_H
#define PIT_TICK_RATE 1193182UL
#endif
/*
* 8253/8254 Programmable Interval Timer
*/
#ifndef _8253PIT_H
#define _8253PIT_H
#define PIT_TICK_RATE 1193182UL
#endif
...@@ -735,3 +735,20 @@ COMPATIBLE_IOCTL(SIOCSIWRETRY) ...@@ -735,3 +735,20 @@ COMPATIBLE_IOCTL(SIOCSIWRETRY)
COMPATIBLE_IOCTL(SIOCGIWRETRY) COMPATIBLE_IOCTL(SIOCGIWRETRY)
COMPATIBLE_IOCTL(SIOCSIWPOWER) COMPATIBLE_IOCTL(SIOCSIWPOWER)
COMPATIBLE_IOCTL(SIOCGIWPOWER) COMPATIBLE_IOCTL(SIOCGIWPOWER)
/* hiddev */
COMPATIBLE_IOCTL(HIDIOCGVERSION)
COMPATIBLE_IOCTL(HIDIOCAPPLICATION)
COMPATIBLE_IOCTL(HIDIOCGDEVINFO)
COMPATIBLE_IOCTL(HIDIOCGSTRING)
COMPATIBLE_IOCTL(HIDIOCINITREPORT)
COMPATIBLE_IOCTL(HIDIOCGREPORT)
COMPATIBLE_IOCTL(HIDIOCSREPORT)
COMPATIBLE_IOCTL(HIDIOCGREPORTINFO)
COMPATIBLE_IOCTL(HIDIOCGFIELDINFO)
COMPATIBLE_IOCTL(HIDIOCGUSAGE)
COMPATIBLE_IOCTL(HIDIOCSUSAGE)
COMPATIBLE_IOCTL(HIDIOCGUCODE)
COMPATIBLE_IOCTL(HIDIOCGFLAG)
COMPATIBLE_IOCTL(HIDIOCSFLAG)
COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINDEX)
COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINFO)
...@@ -527,6 +527,8 @@ struct input_absinfo { ...@@ -527,6 +527,8 @@ struct input_absinfo {
#define MSC_SERIAL 0x00 #define MSC_SERIAL 0x00
#define MSC_PULSELED 0x01 #define MSC_PULSELED 0x01
#define MSC_GESTURE 0x02 #define MSC_GESTURE 0x02
#define MSC_RAW 0x03
#define MSC_SCAN 0x04
#define MSC_MAX 0x07 #define MSC_MAX 0x07
/* /*
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment