Commit 44b2d32a authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://linux-input.bkbits.net/linux-input

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 9d8fc1ab 09261189
Force feedback for Linux.
By Johann Deneux <deneux@ifrance.com> on 2001/04/22.
You can redistribute this file, provided you include shape.fig and
interactive.fig.
You may redistribute this file. Please remember to include shape.fig and
interactive.fig as well.
----------------------------------------------------------------------------
0. Introduction
......@@ -90,12 +90,14 @@ following bits:
- FF_Y has an Y axis (usually joysticks)
- FF_WHEEL has a wheel (usually sterring wheels)
- FF_CONSTANT can render constant force effects
- FF_PERIODIC can render periodic effects (sine, ramp, square...)
- FF_PERIODIC can render periodic effects (sine, triangle, square...)
- FF_RAMP can render ramp effects
- FF_SPRING can simulate the presence of a spring
- FF_FRICTION can simulate friction
- FF_DAMPER can simulate damper effects
- FF_RUMBLE rumble effects (normally the only effect supported by rumble
pads)
- FF_INERTIA can simulate inertia
int ioctl(int fd, EVIOCGEFFECTS, int *n);
......
......@@ -13,7 +13,7 @@ obj-y += mem.o tty_io.o n_tty.o tty_ioctl.o pty.o misc.o random.o
# This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'.
export-objs := busmouse.o console.o generic_serial.o ip2main.o \
ite_gpio.o misc.o nvram.o random.o rtc.o \
ite_gpio.o keyboard.o misc.o nvram.o random.o rtc.o \
selection.o sonypi.o sysrq.o tty_io.o tty_ioctl.o
obj-$(CONFIG_VT) += vt.o vc_screen.o consolemap.o consolemap_deftbl.o selection.o keyboard.o
......
......@@ -66,6 +66,7 @@ extern void ctrl_alt_del(void);
#endif
struct pt_regs *kbd_pt_regs;
EXPORT_SYMBOL(kbd_pt_regs);
void compute_shiftstate(void);
/*
......
......@@ -204,6 +204,8 @@ char *tty_name(struct tty_struct *tty, char *buf)
return _tty_make_name(tty, (tty)?tty->driver.name:NULL, buf);
}
EXPORT_SYMBOL(tty_name);
inline int tty_paranoia_check(struct tty_struct *tty, kdev_t device,
const char *routine)
{
......
......@@ -605,7 +605,7 @@ static int input_devices_read(char *buf, char **start, off_t pos, int count, int
len += sprintf(buf + len, "N: Name=\"%s\"\n", dev->name ? dev->name : "");
len += sprintf(buf + len, "P: Phys=%s\n", dev->phys ? dev->phys : "");
len += sprintf(buf + len, "D: Drivers=");
len += sprintf(buf + len, "H: Handlers=");
list_for_each(hnode,&dev->h_list) {
struct input_handle * handle = to_handle(hnode);
......
......@@ -22,8 +22,8 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("PC Speaker beeper driver");
MODULE_LICENSE("GPL");
static char *pcspkr_name = "PC Speaker";
static char *pcspkr_phys = "isa0061/input0";
static char pcspkr_name[] = "PC Speaker";
static char pcspkr_phys[] = "isa0061/input0";
static struct input_dev pcspkr_dev;
spinlock_t i8253_beep_lock = SPIN_LOCK_UNLOCKED;
......
......@@ -62,7 +62,7 @@ static inline int i8042_platform_init(void)
* On ix86 platforms touching the i8042 data register region can do really
* bad things. Because of this the region is always reserved on ix86 boxes.
*/
#if !defined(__i386__) && !defined(__sh__) && !defined(__alpha__)
#if !defined(__i386__) && !defined(__sh__) && !defined(__alpha__) && !defined(__x86_64__)
if (!request_region(I8042_DATA_REG, 16, "i8042"))
return 0;
#endif
......@@ -71,7 +71,7 @@ static inline int i8042_platform_init(void)
static inline void i8042_platform_exit(void)
{
#if !defined(__i386__) && !defined(__sh__) && !defined(__alpha__)
#if !defined(__i386__) && !defined(__sh__) && !defined(__alpha__) && !defined(__x86_64__)
release_region(I8042_DATA_REG, 16);
#endif
}
......
......@@ -47,12 +47,24 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Q40 PS/2 keyboard controller driver");
MODULE_LICENSE("GPL");
static int q40kbd_open(struct serio *port)
{
return 0;
}
static void q40kbd_close(struct serio *port)
{
return 0;
}
static struct serio q40kbd_port =
{
.type = SERIO_8042,
.name = "Q40 kbd port",
.phys = "Q40",
.write = NULL,
.name = "Q40 PS/2 kbd port",
.phys = "isa0060/serio0",
.open = q40kbd_open,
.close = q40kbd_close,
};
static void q40kbd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
......@@ -70,13 +82,10 @@ void __init q40kbd_init(void)
{
int maxread = 100;
/* Get the keyboard controller registers (incomplete decode) */
request_region(0x60, 16, "q40kbd");
/* allocate the IRQ */
request_irq(Q40_IRQ_KEYBOARD, q40kbd_interrupt, 0, "q40kbd", NULL);
/* flush any pending input. */
/* flush any pending input */
while (maxread-- && (IRQ_KEYB_MASK & master_inb(INTERRUPT_REG)))
master_inb(KEYCODE_REG);
......@@ -84,15 +93,17 @@ void __init q40kbd_init(void)
master_outb(-1,KEYBOARD_UNLOCK_REG);
master_outb(1,KEY_IRQ_ENABLE_REG);
register_serio_port(&q40kbd_port);
printk(KERN_INFO "serio: Q40 PS/2 kbd port irq %d\n", Q40_IRQ_KEYBOARD);
serio_register_port(&q40kbd_port);
printk(KERN_INFO "serio: Q40 kbd registered\n");
}
void __exit q40kbd_exit(void)
{
unregister_serio_port(&q40kbd_port);
master_outb(0,KEY_IRQ_ENABLE_REG);
master_outb(-1,KEYBOARD_UNLOCK_REG);
serio_unregister_port(&q40kbd_port);
free_irq(Q40_IRQ_KEYBOARD, NULL);
release_region(0x60, 16);
}
module_init(q40kbd_init);
......
/*
* $Id: serport_old.c,v 1.10 2002/01/24 19:52:57 vojtech Exp $
* Input device TTY line discipline
*
* Copyright (c) 1999-2002 Vojtech Pavlik
*
* Copyright (c) 1999-2001 Vojtech Pavlik
*/
/*
* This is a module that converts a tty line into a much simpler
* 'serial io port' abstraction that the input device drivers use.
*/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Should you need to contact me, the author, you can do so either by
* e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*/
#include <asm/uaccess.h>
......@@ -41,10 +25,13 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("Input device TTY line discipline");
MODULE_LICENSE("GPL");
#define SERPORT_BUSY 1
struct serport {
struct tty_struct *tty;
wait_queue_head_t wait;
struct serio serio;
unsigned long flags;
char phys[32];
};
......@@ -68,20 +55,20 @@ static int serport_serio_open(struct serio *serio)
static void serport_serio_close(struct serio *serio)
{
struct serport *serport = serio->driver;
serport->serio.type = 0;
wake_up_interruptible(&serport->wait);
}
/*
* serport_ldisc_open() is the routine that is called upon setting our line
* discipline on a tty. It looks for the Mag, and if found, registers
* it as a joystick device.
* discipline on a tty. It prepares the serio struct.
*/
static int serport_ldisc_open(struct tty_struct *tty)
{
struct serport *serport;
char ttyname[64];
int i;
char name[64];
MOD_INC_USE_COUNT;
......@@ -96,11 +83,7 @@ static int serport_ldisc_open(struct tty_struct *tty)
serport->tty = tty;
tty->disc_data = serport;
strcpy(ttyname, tty->driver.name);
for (i = 0; ttyname[i] != 0 && ttyname[i] != '/'; i++);
ttyname[i] = 0;
sprintf(serport->phys, "%s%d/serio0", ttyname, minor(tty->device) - tty->driver.minor_start);
snprintf(serport->phys, sizeof(serport->phys), "%s/serio0", tty_name(tty, name));
serport->serio.name = serport_name;
serport->serio.phys = serport->phys;
......@@ -161,29 +144,18 @@ static int serport_ldisc_room(struct tty_struct *tty)
static ssize_t serport_ldisc_read(struct tty_struct * tty, struct file * file, unsigned char * buf, size_t nr)
{
struct serport *serport = (struct serport*) tty->disc_data;
DECLARE_WAITQUEUE(wait, current);
char name[32];
char name[64];
#ifdef CONFIG_DEVFS_FS
sprintf(name, tty->driver.name, minor(tty->device) - tty->driver.minor_start);
#else
sprintf(name, "%s%d", tty->driver.name, minor(tty->device) - tty->driver.minor_start);
#endif
if (test_and_set_bit(SERPORT_BUSY, &serport->flags))
return -EBUSY;
serio_register_port(&serport->serio);
printk(KERN_INFO "serio: Serial port %s\n", name);
add_wait_queue(&serport->wait, &wait);
set_current_state(TASK_INTERRUPTIBLE);
while(serport->serio.type && !signal_pending(current)) schedule();
set_current_state(TASK_RUNNING);
remove_wait_queue(&serport->wait, &wait);
printk(KERN_INFO "serio: Serial port %s\n", tty_name(tty, name));
wait_event_interruptible(serport->wait, !serport->serio.type);
serio_unregister_port(&serport->serio);
clear_bit(SERPORT_BUSY, &serport->flags);
return 0;
}
......@@ -195,10 +167,8 @@ static int serport_ldisc_ioctl(struct tty_struct * tty, struct file * file, unsi
{
struct serport *serport = (struct serport*) tty->disc_data;
switch (cmd) {
case SPIOCSTYPE:
return get_user(serport->serio.type, (unsigned long *) arg);
}
if (cmd == SPIOCSTYPE)
return get_user(serport->serio.type, (unsigned long *) arg);
return -EINVAL;
}
......@@ -208,7 +178,6 @@ static void serport_ldisc_write_wakeup(struct tty_struct * tty)
struct serport *sp = (struct serport *) tty->disc_data;
serio_dev_write_wakeup(&sp->serio);
}
/*
......
......@@ -45,9 +45,6 @@
#define RUN_AT(t) (jiffies + (t))
/* Transmition state */
#define XMIT_RUNNING 0
/* Effect status */
#define EFFECT_STARTED 0 /* Effect is going to play after some time
(ff_replay.delay) */
......
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