Commit 7a017c2b authored by Vojtech Pavlik's avatar Vojtech Pavlik

Merge suse.cz:/home/vojtech/bk/linus into suse.cz:/home/vojtech/bk/input

parents 0bf36f29 368b9617
......@@ -33,7 +33,6 @@
#include <asm/amigaints.h>
#include <asm/irq.h>
#include <asm/rtc.h>
#include <asm/keyboard.h>
#include <asm/machdep.h>
#include <asm/io.h>
......@@ -71,11 +70,6 @@ static char amiga_model_name[13] = "Amiga ";
extern char m68k_debug_device[];
static void amiga_sched_init(void (*handler)(int, void *, struct pt_regs *));
/* amiga specific keyboard functions */
extern int amiga_keyb_init(void);
extern int amiga_kbdrate (struct kbd_repeat *);
extern int amiga_kbd_translate(unsigned char keycode, unsigned char *keycodep,
char raw_mode);
/* amiga specific irq functions */
extern void amiga_init_IRQ (void);
extern void (*amiga_default_handler[]) (int, void *, struct pt_regs *);
......@@ -94,7 +88,6 @@ static unsigned long amiga_gettimeoffset (void);
static int a3000_hwclk (int, struct rtc_time *);
static int a2000_hwclk (int, struct rtc_time *);
static int amiga_set_clock_mmss (unsigned long);
extern void amiga_mksound( unsigned int count, unsigned int ticks );
#ifdef CONFIG_AMIGA_FLOPPY
extern void amiga_floppy_setup(char *, int *);
#endif
......@@ -116,18 +109,6 @@ static struct console amiga_console_driver = {
.index = -1,
};
#ifdef CONFIG_MAGIC_SYSRQ
static char amiga_sysrq_xlate[128] =
"\0001234567890-=\\\000\000" /* 0x00 - 0x0f */
"qwertyuiop[]\000123" /* 0x10 - 0x1f */
"asdfghjkl;'\000\000456" /* 0x20 - 0x2f */
"\000zxcvbnm,./\000+789" /* 0x30 - 0x3f */
" \177\t\r\r\000\177\000\000\000-\000\000\000\000\000" /* 0x40 - 0x4f */
"\000\201\202\203\204\205\206\207\210\211()/*+\000" /* 0x50 - 0x5f */
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" /* 0x60 - 0x6f */
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"; /* 0x70 - 0x7f */
#endif
/*
* Motherboard Resources present in all Amiga models
......@@ -388,11 +369,6 @@ void __init config_amiga(void)
request_resource(&iomem_resource, &((struct resource *)&mb_resources)[i]);
mach_sched_init = amiga_sched_init;
#ifdef CONFIG_VT
mach_keyb_init = amiga_keyb_init;
mach_kbdrate = amiga_kbdrate;
mach_kbd_translate = amiga_kbd_translate;
#endif
mach_init_IRQ = amiga_init_IRQ;
mach_default_handler = &amiga_default_handler;
mach_request_irq = amiga_request_irq;
......@@ -432,16 +408,10 @@ void __init config_amiga(void)
#ifdef CONFIG_DUMMY_CONSOLE
conswitchp = &dummy_con;
#endif
#ifdef CONFIG_VT
kd_mksound = amiga_mksound;
#endif
#ifdef CONFIG_MAGIC_SYSRQ
SYSRQ_KEY = 0xff;
mach_sysrq_key = 0x5f; /* HELP */
mach_sysrq_shift_state = 0x03; /* SHIFT+ALTGR */
mach_sysrq_shift_mask = 0xff; /* all modifiers except CapsLock */
mach_sysrq_xlate = amiga_sysrq_xlate;
#ifdef CONFIG_INPUT_M68K_BEEP
mach_beep = amiga_mksound;
#endif
#ifdef CONFIG_HEARTBEAT
mach_heartbeat = amiga_heartbeat;
#endif
......@@ -709,7 +679,7 @@ static void amiga_reset (void)
unsigned long jmp_addr040 = virt_to_phys(&&jmp_addr_label040);
unsigned long jmp_addr = virt_to_phys(&&jmp_addr_label);
cli();
local_irq_disable();
if (CPU_IS_040_OR_060)
/* Setup transparent translation registers for mapping
* of 16 MB kernel segment before disabling translation
......
This diff is collapsed.
......@@ -39,7 +39,6 @@
#include <asm/atariints.h>
#include <asm/atari_stram.h>
#include <asm/system.h>
#include <asm/keyboard.h>
#include <asm/machdep.h>
#include <asm/hwtest.h>
#include <asm/io.h>
......@@ -59,12 +58,6 @@ extern void atari_floppy_setup(char *, int *);
static void atari_get_model(char *model);
static int atari_get_hardware_list(char *buffer);
/* atari specific keyboard functions */
extern int atari_keyb_init(void);
extern int atari_kbdrate (struct kbd_repeat *);
extern int atari_kbd_translate(unsigned char keycode, unsigned char *keycodep,
char raw_mode);
extern void atari_kbd_leds (unsigned int);
/* atari specific irq functions */
extern void atari_init_IRQ (void);
extern int atari_request_irq (unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
......@@ -73,7 +66,6 @@ extern void atari_free_irq (unsigned int irq, void *dev_id);
extern void atari_enable_irq (unsigned int);
extern void atari_disable_irq (unsigned int);
extern int show_atari_interrupts (struct seq_file *, void *);
extern void atari_mksound( unsigned int count, unsigned int ticks );
#ifdef CONFIG_HEARTBEAT
static void atari_heartbeat( int on );
#endif
......@@ -89,18 +81,6 @@ extern int atari_tt_set_clock_mmss (unsigned long);
/* atari specific debug functions (in debug.c) */
extern void atari_debug_init(void);
#ifdef CONFIG_MAGIC_SYSRQ
static char atari_sysrq_xlate[128] =
"\000\0331234567890-=\177\t" /* 0x00 - 0x0f */
"qwertyuiop[]\r\000as" /* 0x10 - 0x1f */
"dfghjkl;'`\000\\zxcv" /* 0x20 - 0x2f */
"bnm,./\000\000\000 \000\201\202\203\204\205" /* 0x30 - 0x3f */
"\206\207\210\211\212\000\000\000\000\000-\000\000\000+\000"/* 0x40 - 0x4f */
"\000\000\000\177\000\000\000\000\000\000\000\000\000\000\000\000" /* 0x50 - 0x5f */
"\000\000\000()/*789456123" /* 0x60 - 0x6f */
"0.\r\000\000\000\000\000\000\000\000\000\000\000\000\000"; /* 0x70 - 0x7f */
#endif
/* I've moved hwreg_present() and hwreg_present_bywrite() out into
* mm/hwtest.c, to avoid having multiple copies of the same routine
......@@ -254,12 +234,6 @@ void __init config_atari(void)
to 4GB. */
mach_sched_init = atari_sched_init;
#ifdef CONFIG_VT
mach_keyb_init = atari_keyb_init;
mach_kbdrate = atari_kbdrate;
mach_kbd_translate = atari_kbd_translate;
mach_kbd_leds = atari_kbd_leds;
#endif
mach_init_IRQ = atari_init_IRQ;
mach_request_irq = atari_request_irq;
mach_free_irq = atari_free_irq;
......@@ -277,15 +251,8 @@ void __init config_atari(void)
conswitchp = &dummy_con;
#endif
mach_max_dma_address = 0xffffff;
#ifdef CONFIG_VT
kd_mksound = atari_mksound;
#endif
#ifdef CONFIG_MAGIC_SYSRQ
SYSRQ_KEY = 0xff;
mach_sysrq_key = 98; /* HELP */
mach_sysrq_shift_state = 8; /* Alt */
mach_sysrq_shift_mask = 0xff; /* all modifiers except CapsLock */
mach_sysrq_xlate = atari_sysrq_xlate;
#ifdef CONFIG_INPUT_M68K_BEEP
mach_beep = atari_mksound;
#endif
#ifdef CONFIG_HEARTBEAT
mach_heartbeat = atari_heartbeat;
......
/*
* Atari Joystick Driver for Linux
* by Robert de Vries (robert@and.nl) 19Jul93
*
* 16 Nov 1994 Andreas Schwab
* Support for three button mouse (shamelessly stolen from MiNT)
* third button wired to one of the joystick directions on joystick 1
*/
#include <linux/sched.h>
#include <linux/errno.h>
#include <linux/major.h>
#include <linux/poll.h>
#include <linux/init.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/smp_lock.h>
#include <asm/atarikb.h>
#include <asm/atari_joystick.h>
#include <asm/uaccess.h>
#define MAJOR_NR JOYSTICK_MAJOR
#define ANALOG_JOY(n) (!(n & 0x80))
#define DIGITAL_JOY(n) (minor(n) & 0x80)
#define DEVICE_NR(n) (minor(n) & 0x7f)
static struct joystick_status joystick[2];
int atari_mouse_buttons; /* for three-button mouse */
void atari_joystick_interrupt(char *buf)
{
int j;
/* ikbd_joystick_disable(); */
j = buf[0] & 0x1;
joystick[j].dir = buf[1] & 0xF;
joystick[j].fire = (buf[1] & 0x80) >> 7;
joystick[j].ready = 1;
wake_up_interruptible(&joystick[j].wait);
/* For three-button mouse emulation fake a mouse packet */
if (atari_mouse_interrupt_hook &&
j == 1 && (buf[1] & 1) != ((atari_mouse_buttons & 2) >> 1))
{
char faked_packet[3];
atari_mouse_buttons = (atari_mouse_buttons & 5) | ((buf[1] & 1) << 1);
faked_packet[0] = (atari_mouse_buttons & 1) |
(atari_mouse_buttons & 4 ? 2 : 0);
faked_packet[1] = 0;
faked_packet[2] = 0;
atari_mouse_interrupt_hook (faked_packet);
}
/* ikbd_joystick_event_on(); */
}
static int release_joystick(struct inode *inode, struct file *file)
{
int minor = DEVICE_NR(inode->i_rdev);
joystick[minor].active = 0;
joystick[minor].ready = 0;
if ((joystick[0].active == 0) && (joystick[1].active == 0))
ikbd_joystick_disable();
return 0;
}
static int open_joystick(struct inode *inode, struct file *file)
{
int minor = DEVICE_NR(inode->i_rdev);
if (!DIGITAL_JOY(inode->i_rdev) || minor > 1)
return -ENODEV;
if (joystick[minor].active)
return -EBUSY;
joystick[minor].active = 1;
joystick[minor].ready = 0;
ikbd_joystick_event_on();
return 0;
}
static ssize_t write_joystick(struct file *file, const char *buffer,
size_t count, loff_t *ppos)
{
return -EINVAL;
}
static ssize_t read_joystick(struct file *file, char *buffer, size_t count,
loff_t *ppos)
{
struct inode *inode = file->f_dentry->d_inode;
int minor = DEVICE_NR(inode->i_rdev);
if (count < 2)
return -EINVAL;
if (!joystick[minor].ready)
return -EAGAIN;
joystick[minor].ready = 0;
if (put_user(joystick[minor].fire, buffer++) ||
put_user(joystick[minor].dir, buffer++))
return -EFAULT;
if (count > 2)
if (clear_user(buffer, count - 2))
return -EFAULT;
return count;
}
static unsigned int joystick_poll(struct file *file, poll_table *wait)
{
int minor = DEVICE_NR(file->f_dentry->d_inode->i_rdev);
poll_wait(file, &joystick[minor].wait, wait);
if (joystick[minor].ready)
return POLLIN | POLLRDNORM;
return 0;
}
struct file_operations atari_joystick_fops = {
.read = read_joystick,
.write = write_joystick,
.poll = joystick_poll,
.open = open_joystick,
.release = release_joystick,
};
int __init atari_joystick_init(void)
{
joystick[0].active = joystick[1].active = 0;
joystick[0].ready = joystick[1].ready = 0;
init_waitqueue_head(&joystick[0].wait);
init_waitqueue_head(&joystick[1].wait);
if (register_chrdev(MAJOR_NR, "Joystick", &atari_joystick_fops))
printk("unable to get major %d for joystick devices\n", MAJOR_NR);
devfs_register_series (NULL, "joysticks/digital%u", 2, DEVFS_FL_DEFAULT,
MAJOR_NR, 128, S_IFCHR | S_IRUSR | S_IWUSR,
&atari_joystick_fops, NULL);
return 0;
}
......@@ -45,12 +45,9 @@ static void bvme6000_get_model(char *model);
static int bvme6000_get_hardware_list(char *buffer);
extern int bvme6000_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id);
extern void bvme6000_sched_init(void (*handler)(int, void *, struct pt_regs *));
extern int bvme6000_keyb_init(void);
extern int bvme6000_kbdrate (struct kbd_repeat *);
extern unsigned long bvme6000_gettimeoffset (void);
extern int bvme6000_hwclk (int, struct rtc_time *);
extern int bvme6000_set_clock_mmss (unsigned long);
extern void bvme6000_mksound( unsigned int count, unsigned int ticks );
extern void bvme6000_reset (void);
extern void bvme6000_waitbut(void);
void bvme6000_set_vectors (void);
......@@ -72,15 +69,6 @@ int bvme6000_parse_bootinfo(const struct bi_record *bi)
return 1;
}
int bvme6000_kbdrate (struct kbd_repeat *k)
{
return 0;
}
void bvme6000_mksound( unsigned int count, unsigned int ticks )
{
}
void bvme6000_reset()
{
volatile PitRegsPtr pit = (PitRegsPtr)BVME_PIT_BASE;
......@@ -133,15 +121,10 @@ void __init config_bvme6000(void)
mach_max_dma_address = 0xffffffff;
mach_sched_init = bvme6000_sched_init;
#ifdef CONFIG_VT
mach_keyb_init = bvme6000_keyb_init;
mach_kbdrate = bvme6000_kbdrate;
#endif
mach_init_IRQ = bvme6000_init_IRQ;
mach_gettimeoffset = bvme6000_gettimeoffset;
mach_hwclk = bvme6000_hwclk;
mach_set_clock_mmss = bvme6000_set_clock_mmss;
/* mach_mksound = bvme6000_mksound; */
mach_reset = bvme6000_reset;
mach_free_irq = bvme6000_free_irq;
mach_process_int = bvme6000_process_int;
......@@ -394,8 +377,3 @@ int bvme6000_set_clock_mmss (unsigned long nowtime)
return retval;
}
int bvme6000_keyb_init (void)
{
return 0;
}
......@@ -3,6 +3,7 @@
# see Documentation/kbuild/config-language.txt.
#
define_bool CONFIG_M68K y
define_bool CONFIG_UID16 y
define_bool CONFIG_RWSEM_GENERIC_SPINLOCK y
define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM n
......
......@@ -17,7 +17,6 @@
#include <linux/init.h>
#include <asm/machdep.h>
#include <asm/blinken.h>
#include <asm/io.h> /* readb() and writeb() */
#include <asm/hwtest.h> /* hwreg_present() */
#include "ints.h"
......@@ -27,14 +26,6 @@ extern void hp300_reset(void);
extern void (*hp300_default_handler[])(int, void *, struct pt_regs *);
extern int show_hp300_interrupts(struct seq_file *, void *);
#ifdef CONFIG_VT
extern int hp300_keyb_init(void);
static int hp300_kbdrate(struct kbd_repeat *k)
{
return 0;
}
#endif
#ifdef CONFIG_HEARTBEAT
static void hp300_pulse(int x)
{
......@@ -53,10 +44,6 @@ static void hp300_get_model(char *model)
void __init config_hp300(void)
{
mach_sched_init = hp300_sched_init;
#ifdef CONFIG_VT
mach_keyb_init = hp300_keyb_init;
mach_kbdrate = hp300_kbdrate;
#endif
mach_init_IRQ = hp300_init_IRQ;
mach_request_irq = hp300_request_irq;
mach_free_irq = hp300_free_irq;
......
This diff is collapsed.
......@@ -71,13 +71,6 @@ char saved_command_line[CL_SIZE];
char m68k_debug_device[6] = "";
void (*mach_sched_init) (void (*handler)(int, void *, struct pt_regs *)) __initdata = NULL;
/* machine dependent keyboard functions */
#ifdef CONFIG_VT
int (*mach_keyb_init) (void) __initdata = NULL;
int (*mach_kbdrate) (struct kbd_repeat *) = NULL;
void (*mach_kbd_leds) (unsigned int) = NULL;
int (*mach_kbd_translate)(unsigned char scancode, unsigned char *keycode, char raw_mode) = NULL;
#endif
/* machine dependent irq functions */
void (*mach_init_IRQ) (void) __initdata = NULL;
void (*(*mach_default_handler)[]) (int, void *, struct pt_regs *) = NULL;
......@@ -89,6 +82,8 @@ void (*mach_process_int) (int, struct pt_regs *) = NULL;
unsigned long (*mach_gettimeoffset) (void);
int (*mach_hwclk) (int, struct rtc_time*) = NULL;
int (*mach_set_clock_mmss) (unsigned long) = NULL;
int (*mach_get_rtc_pll)(struct rtc_pll_info *) = NULL;
int (*mach_set_rtc_pll)(struct rtc_pll_info *) = NULL;
void (*mach_reset)( void );
void (*mach_halt)( void ) = NULL;
void (*mach_power_off)( void ) = NULL;
......@@ -103,15 +98,9 @@ EXPORT_SYMBOL(mach_heartbeat);
#ifdef CONFIG_M68K_L2_CACHE
void (*mach_l2_flush) (int) = NULL;
#endif
#ifdef CONFIG_MAGIC_SYSRQ
unsigned int SYSRQ_KEY;
int mach_sysrq_key = -1;
int mach_sysrq_shift_state = 0;
int mach_sysrq_shift_mask = 0;
char *mach_sysrq_xlate = NULL;
#ifdef CONFIG_INPUT_M68K_BEEP
void (*mach_beep)(unsigned int, unsigned int) = NULL;
#endif
#if defined(CONFIG_ISA) && defined(MULTI_ISA)
int isa_type;
int isa_sex;
......
......@@ -78,27 +78,12 @@ extern void oss_init(void);
extern void psc_init(void);
extern void baboon_init(void);
extern void mac_mksound(unsigned int, unsigned int);
extern void nubus_sweep_video(void);
/* Mac specific debug functions (in debug.c) */
extern void mac_debug_init(void);
extern void mac_debugging_long(int, long);
extern int mackbd_init_hw(void);
extern void mackbd_leds(unsigned int leds);
extern int mackbd_translate(unsigned char keycode, unsigned char *keycodep, char raw_mode);
extern void mac_hid_init_hw(void);
extern int mac_hid_kbd_translate(unsigned char scancode, unsigned char *keycode, char raw_mode);
#ifdef CONFIG_MAGIC_SYSRQ
extern unsigned char mac_hid_kbd_sysrq_xlate[128];
extern unsigned char pckbd_sysrq_xlate[128];
extern unsigned char mackbd_sysrq_xlate[128];
#endif /* CONFIG_MAGIC_SYSRQ */
static void mac_get_model(char *str);
void mac_bang(int irq, void *vector, struct pt_regs *p)
......@@ -207,33 +192,6 @@ void __init config_mac(void)
printk("ERROR: no Mac, but config_mac() called!! \n");
}
#ifdef CONFIG_VT
#ifdef CONFIG_INPUT_ADBHID
mach_keyb_init = mac_hid_init_hw;
mach_kbd_translate = mac_hid_kbd_translate;
#ifdef CONFIG_MAGIC_SYSRQ
#ifdef CONFIG_MAC_ADBKEYCODES
if (!keyboard_sends_linux_keycodes) {
mach_sysrq_xlate = mac_hid_kbd_sysrq_xlate;
SYSRQ_KEY = 0x69;
} else
#endif /* CONFIG_MAC_ADBKEYCODES */
{
mach_sysrq_xlate = pckbd_sysrq_xlate;
SYSRQ_KEY = 0x54;
}
#endif /* CONFIG_MAGIC_SYSRQ */
#elif defined(CONFIG_ADB_KEYBOARD)
mach_keyb_init = mackbd_init_hw;
mach_kbd_leds = mackbd_leds;
mach_kbd_translate = mackbd_translate;
#ifdef CONFIG_MAGIC_SYSRQ
mach_sysrq_xlate = mackbd_sysrq_xlate;
SYSRQ_KEY = 0x69;
#endif /* CONFIG_MAGIC_SYSRQ */
#endif /* CONFIG_INPUT_ADBHID */
#endif /* CONFIG_VT */
mach_sched_init = mac_sched_init;
mach_init_IRQ = mac_init_IRQ;
mach_request_irq = mac_request_irq;
......@@ -249,9 +207,6 @@ void __init config_mac(void)
mach_hwclk = mac_hwclk;
#endif
mach_set_clock_mmss = mac_set_clock_mmss;
#if 0
mach_mksound = mac_mksound;
#endif
mach_reset = mac_reset;
mach_halt = mac_poweroff;
mach_power_off = mac_poweroff;
......@@ -262,8 +217,8 @@ void __init config_mac(void)
#if 0
mach_debug_init = mac_debug_init;
#endif
#ifdef CONFIG_VT
kd_mksound = mac_mksound;
#ifdef CONFIG_INPUT_M68K_BEEP
mach_beep = mac_mksound;
#endif
#ifdef CONFIG_HEARTBEAT
#if 0
......@@ -287,10 +242,6 @@ void __init config_mac(void)
|| macintosh_config->ident == MAC_MODEL_IIFX) {
mach_l2_flush = mac_cache_card_flush;
}
#ifdef MAC_DEBUG_SOUND
/* goes on forever if timers broken */
mac_mksound(1000,10);
#endif
/*
* Check for machine specific fixups.
......
......@@ -45,8 +45,6 @@ static void mvme147_get_model(char *model);
static int mvme147_get_hardware_list(char *buffer);
extern int mvme147_request_irq (unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id);
extern void mvme147_sched_init(void (*handler)(int, void *, struct pt_regs *));
extern int mvme147_keyb_init(void);
extern int mvme147_kbdrate (struct kbd_repeat *);
extern unsigned long mvme147_gettimeoffset (void);
extern int mvme147_hwclk (int, struct rtc_time *);
extern int mvme147_set_clock_mmss (unsigned long);
......@@ -70,11 +68,6 @@ int mvme147_parse_bootinfo(const struct bi_record *bi)
return 1;
}
int mvme147_kbdrate (struct kbd_repeat *k)
{
return 0;
}
void mvme147_reset()
{
printk ("\r\n\nCalled mvme147_reset\r\n");
......@@ -102,10 +95,6 @@ void __init config_mvme147(void)
{
mach_max_dma_address = 0x01000000;
mach_sched_init = mvme147_sched_init;
#ifdef CONFIG_VT
mach_keyb_init = mvme147_keyb_init;
mach_kbdrate = mvme147_kbdrate;
#endif
mach_init_IRQ = mvme147_init_IRQ;
mach_gettimeoffset = mvme147_gettimeoffset;
mach_hwclk = mvme147_hwclk;
......
......@@ -49,12 +49,9 @@ static void mvme16x_get_model(char *model);
static int mvme16x_get_hardware_list(char *buffer);
extern int mvme16x_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id);
extern void mvme16x_sched_init(void (*handler)(int, void *, struct pt_regs *));
extern int mvme16x_keyb_init(void);
extern int mvme16x_kbdrate (struct kbd_repeat *);
extern unsigned long mvme16x_gettimeoffset (void);
extern int mvme16x_hwclk (int, struct rtc_time *);
extern int mvme16x_set_clock_mmss (unsigned long);
extern void mvme16x_mksound( unsigned int count, unsigned int ticks );
extern void mvme16x_reset (void);
extern void mvme16x_waitbut(void);
......@@ -77,15 +74,6 @@ int mvme16x_parse_bootinfo(const struct bi_record *bi)
return 1;
}
int mvme16x_kbdrate (struct kbd_repeat *k)
{
return 0;
}
void mvme16x_mksound( unsigned int count, unsigned int ticks )
{
}
void mvme16x_reset()
{
printk ("\r\n\nCalled mvme16x_reset\r\n"
......@@ -144,17 +132,10 @@ void __init config_mvme16x(void)
mach_max_dma_address = 0xffffffff;
mach_sched_init = mvme16x_sched_init;
#ifdef CONFIG_VT
mach_keyb_init = mvme16x_keyb_init;
mach_kbdrate = mvme16x_kbdrate;
#endif
mach_init_IRQ = mvme16x_init_IRQ;
mach_gettimeoffset = mvme16x_gettimeoffset;
mach_hwclk = mvme16x_hwclk;
mach_set_clock_mmss = mvme16x_set_clock_mmss;
#ifdef CONFIG_VT
/* kd_mksound = mvme16x_mksound; */
#endif
mach_reset = mvme16x_reset;
mach_free_irq = mvme16x_free_irq;
mach_process_int = mvme16x_process_int;
......@@ -301,8 +282,3 @@ int mvme16x_set_clock_mmss (unsigned long nowtime)
return 0;
}
int mvme16x_keyb_init (void)
{
return 0;
}
......@@ -36,12 +36,9 @@
#include <asm/rtc.h>
#include <asm/machdep.h>
#include <asm/q40_master.h>
#include <asm/keyboard.h>
extern void floppy_setup(char *str, int *ints);
extern int q40kbd_translate(unsigned char scancode, unsigned char *keycode,
char raw_mode);
extern void q40_process_int (int level, struct pt_regs *regs);
extern void (*q40_sys_default_handler[]) (int, void *, struct pt_regs *); /* added just for debugging */
extern void q40_init_IRQ (void);
......@@ -62,8 +59,6 @@ void q40_halt(void);
extern void q40_waitbut(void);
void q40_set_vectors (void);
void q40_mksound(unsigned int /*freq*/, unsigned int /*ticks*/ );
extern char *saved_command_line;
extern char m68k_debug_device[];
static void q40_mem_console_write(struct console *co, const char *b,
......@@ -82,14 +77,6 @@ static struct console q40_console_driver = {
extern char *q40_mem_cptr; /*=(char *)0xff020000;*/
static int _cpleft;
#if 0
int q40_kbd_translate(unsigned char keycode, unsigned char *keycodep, char raw_mode)
{
*keycodep = keycode;
return 1;
}
#endif
static void q40_mem_console_write(struct console *co, const char *s,
unsigned int count)
{
......@@ -117,13 +104,6 @@ void printq40(char *str)
}
#endif
#if 0
int q40_kbdrate (struct kbd_repeat *k)
{
return 0;
}
#endif
static int halted=0;
#ifdef CONFIG_HEARTBEAT
......@@ -185,10 +165,6 @@ void __init config_q40(void)
{
mach_sched_init = q40_sched_init;
#ifdef CONFIG_VT
mach_keyb_init = q40kbd_init_hw;
mach_kbd_translate = q40kbd_translate;
#endif
mach_init_IRQ = q40_init_IRQ;
mach_gettimeoffset = q40_gettimeoffset;
mach_hwclk = q40_hwclk;
......@@ -204,12 +180,9 @@ void __init config_q40(void)
mach_default_handler = &q40_sys_default_handler;
mach_get_model = q40_get_model;
mach_get_hardware_list = q40_get_hardware_list;
#ifdef CONFIG_VT
kd_mksound = q40_mksound;
#endif
#ifdef CONFIG_MAGIC_SYSRQ
mach_sysrq_key = 0x54;
#ifdef CONFIG_INPUT_M68K_BEEP
mach_beep = q40_mksound;
#endif
#ifdef CONFIG_HEARTBEAT
mach_heartbeat = q40_heartbeat;
......
This diff is collapsed.
/*
* Atari Mouse Driver for Linux
* by Robert de Vries (robert@and.nl) 19Jul93
*
* 16 Nov 1994 Andreas Schwab
* Compatibility with busmouse
* Support for three button mouse (shamelessly stolen from MiNT)
* third button wired to one of the joystick directions on joystick 1
*
* 1996/02/11 Andreas Schwab
* Module support
* Allow multiple open's
*
* Converted to use new generic busmouse code. 5 Apr 1998
* Russell King <rmk@arm.uk.linux.org>
*/
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/errno.h>
#include <linux/miscdevice.h>
#include <linux/mm.h>
#include <linux/random.h>
#include <linux/poll.h>
#include <linux/init.h>
#include <linux/logibusmouse.h>
#include <asm/setup.h>
#include <asm/atarikb.h>
#include <asm/uaccess.h>
#include "busmouse.h"
static int msedev;
static int mouse_threshold[2] = {2,2};
MODULE_PARM(mouse_threshold, "2i");
extern int atari_mouse_buttons;
static void atari_mouse_interrupt(char *buf)
{
int buttons;
/* ikbd_mouse_disable(); */
buttons = ((buf[0] & 1)
| ((buf[0] & 2) << 1)
| (atari_mouse_buttons & 2));
atari_mouse_buttons = buttons;
busmouse_add_movementbuttons(msedev, buf[1], -buf[2], buttons ^ 7);
/* ikbd_mouse_rel_pos(); */
}
static int release_mouse(struct inode *inode, struct file *file)
{
ikbd_mouse_disable();
atari_mouse_interrupt_hook = NULL;
return 0;
}
static int open_mouse(struct inode *inode, struct file *file)
{
atari_mouse_buttons = 0;
ikbd_mouse_y0_top ();
ikbd_mouse_thresh (mouse_threshold[0], mouse_threshold[1]);
ikbd_mouse_rel_pos();
atari_mouse_interrupt_hook = atari_mouse_interrupt;
return 0;
}
static struct busmouse atarimouse = {
ATARIMOUSE_MINOR, "atarimouse", THIS_MODULE, open_mouse, release_mouse, 0
};
static int __init atari_mouse_init(void)
{
if (!MACH_IS_ATARI)
return -ENODEV;
msedev = register_busmouse(&atarimouse);
if (msedev < 0)
printk(KERN_WARNING "Unable to register Atari mouse driver.\n");
else
printk(KERN_INFO "Atari mouse installed.\n");
return msedev < 0 ? msedev : 0;
}
#ifndef MODULE
#define MIN_THRESHOLD 1
#define MAX_THRESHOLD 20 /* more seems not reasonable... */
static int __init atari_mouse_setup( char *str )
{
int ints[8];
str = get_options(str, ARRAY_SIZE(ints), ints);
if (ints[0] < 1) {
printk(KERN_ERR "atari_mouse_setup: no arguments!\n" );
return 0;
}
else if (ints[0] > 2) {
printk(KERN_WARNING "atari_mouse_setup: too many arguments\n" );
}
if (ints[1] < MIN_THRESHOLD || ints[1] > MAX_THRESHOLD)
printk(KERN_WARNING "atari_mouse_setup: bad threshold value (ignored)\n" );
else {
mouse_threshold[0] = ints[1];
mouse_threshold[1] = ints[1];
if (ints[0] > 1) {
if (ints[2] < MIN_THRESHOLD || ints[2] > MAX_THRESHOLD)
printk(KERN_WARNING "atari_mouse_setup: bad threshold value (ignored)\n" );
else
mouse_threshold[1] = ints[2];
}
}
return 1;
}
__setup("atarimouse=",atari_mouse_setup);
#endif /* !MODULE */
static void __exit atari_mouse_cleanup (void)
{
unregister_busmouse(msedev);
}
module_init(atari_mouse_init);
module_exit(atari_mouse_cleanup);
MODULE_LICENSE("GPL");
\ No newline at end of file
This diff is collapsed.
......@@ -917,14 +917,14 @@ static unsigned short x86_keycodes[256] =
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 43, 85, 86, 87, 88,115,119,120,121,375,123, 90,
284,285,309,298,312, 91,327,328,329,331,333,335,336,337,338,339,
367,294,293,286,350, 92,334,512,116,377,109,111,373,347,348,349,
360, 93, 94, 95, 98,376,100,101,357,316,354,304,289,102,351,355,
103,104,105,275,281,272,306,106,274,107,288,364,358,363,362,361,
291,108,381,290,287,292,279,305,280, 99,112,257,258,113,270,114,
367,288,302,304,350, 92,334,512,116,377,109,111,373,347,348,349,
360, 93, 94, 95, 98,376,100,101,321,316,354,286,289,102,351,355,
103,104,105,275,287,279,306,106,274,107,294,364,358,363,362,361,
291,108,381,281,290,272,292,305,280, 99,112,257,258,359,270,114,
118,117,125,374,379,115,112,125,121,123,264,265,266,267,268,269,
271,273,276,277,278,282,283,295,296,297,299,300,301,302,303,307,
308,310,313,314,315,317,318,319,320,321,322,323,324,325,326,330,
332,340,341,342,343,344,345,346,356,359,365,368,369,370,371,372 };
271,273,276,277,278,282,283,295,296,297,299,300,301,293,303,307,
308,310,313,314,315,317,318,319,320,357,322,323,324,325,326,330,
332,340,365,342,343,344,345,346,356,113,341,368,369,370,371,372 };
#ifdef CONFIG_MAC_EMUMOUSEBTN
extern int mac_hid_mouse_emulate_buttons(int, int, int);
......
This diff is collapsed.
/*
* $Id: evdev.c,v 1.48 2002/05/26 14:28:26 jdeneux Exp $
*
* Copyright (c) 1999-2001 Vojtech Pavlik
*
* Event char devices, giving access to raw input device events.
*/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* Copyright (c) 1999-2002 Vojtech Pavlik
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Should you need to contact me, the author, you can do so either by
* e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*/
#define EVDEV_MINOR_BASE 64
......@@ -38,7 +20,7 @@
#include <linux/smp_lock.h>
#include <linux/device.h>
struct evdev {
struct evdev{
int exist;
int open;
int minor;
......@@ -46,7 +28,7 @@ struct evdev {
struct input_handle handle;
wait_queue_head_t wait;
devfs_handle_t devfs;
struct evdev_list *list;
struct list_head list;
};
struct evdev_list {
......@@ -55,17 +37,17 @@ struct evdev_list {
int tail;
struct fasync_struct *fasync;
struct evdev *evdev;
struct evdev_list *next;
struct list_head node;
};
static struct evdev *evdev_table[EVDEV_MINORS] = { NULL, /* ... */ };
static struct evdev *evdev_table[EVDEV_MINORS];
static void evdev_event(struct input_handle *handle, unsigned int type, unsigned int code, int value)
{
struct evdev *evdev = handle->private;
struct evdev_list *list = evdev->list;
struct evdev_list *list;
while (list) {
list_for_each_entry(list, &evdev->list, node) {
do_gettimeofday(&list->buffer[list->head].time);
list->buffer[list->head].type = type;
......@@ -74,8 +56,6 @@ static void evdev_event(struct input_handle *handle, unsigned int type, unsigned
list->head = (list->head + 1) & (EVDEV_BUFFER_SIZE - 1);
kill_fasync(&list->fasync, SIGIO, POLL_IN);
list = list->next;
}
wake_up_interruptible(&evdev->wait);
......@@ -91,7 +71,7 @@ static int evdev_fasync(int fd, struct file *file, int on)
static int evdev_flush(struct file * file)
{
struct evdev_list *list = (struct evdev_list*)file->private_data;
struct evdev_list *list = file->private_data;
if (!list->evdev->exist) return -ENODEV;
return input_flush_device(&list->evdev->handle, file);
}
......@@ -99,14 +79,9 @@ static int evdev_flush(struct file * file)
static int evdev_release(struct inode * inode, struct file * file)
{
struct evdev_list *list = file->private_data;
struct evdev_list **listptr;
listptr = &list->evdev->list;
evdev_fasync(-1, file, 0);
while (*listptr && (*listptr != list))
listptr = &((*listptr)->next);
*listptr = (*listptr)->next;
list_del(&list->node);
if (!--list->evdev->open) {
if (list->evdev->exist) {
......@@ -132,19 +107,15 @@ static int evdev_open(struct inode * inode, struct file * file)
if (i >= EVDEV_MINORS || !evdev_table[i])
return -ENODEV;
/* Ask the driver if he wishes to accept the open() */
if ((accept_err = input_accept_process(&(evdev_table[i]->handle), file))) {
if ((accept_err = input_accept_process(&(evdev_table[i]->handle), file)))
return accept_err;
}
if (!(list = kmalloc(sizeof(struct evdev_list), GFP_KERNEL)))
return -ENOMEM;
memset(list, 0, sizeof(struct evdev_list));
list->evdev = evdev_table[i];
list->next = evdev_table[i]->list;
evdev_table[i]->list = list;
list_add_tail(&list->node, &evdev_table[i]->list);
file->private_data = list;
if (!list->evdev->open++)
......@@ -175,40 +146,21 @@ static ssize_t evdev_write(struct file * file, const char * buffer, size_t count
static ssize_t evdev_read(struct file * file, char * buffer, size_t count, loff_t *ppos)
{
DECLARE_WAITQUEUE(wait, current);
struct evdev_list *list = file->private_data;
int retval = 0;
if (list->head == list->tail) {
add_wait_queue(&list->evdev->wait, &wait);
set_current_state(TASK_INTERRUPTIBLE);
while (list->head == list->tail) {
if (!list->evdev->exist) {
retval = -ENODEV;
break;
}
if (file->f_flags & O_NONBLOCK) {
retval = -EAGAIN;
break;
}
if (signal_pending(current)) {
retval = -ERESTARTSYS;
break;
}
int retval;
schedule();
}
if (list->head == list->tail && list->evdev->exist && (file->f_flags & O_NONBLOCK))
return -EAGAIN;
set_current_state(TASK_RUNNING);
remove_wait_queue(&list->evdev->wait, &wait);
}
retval = wait_event_interruptible(list->evdev->wait,
list->head != list->tail && list->evdev->exist);
if (retval)
return retval;
if (!list->evdev->exist)
return -ENODEV;
while (list->head != list->tail && retval + sizeof(struct input_event) <= count) {
if (copy_to_user(buffer + retval, list->buffer + list->tail,
sizeof(struct input_event))) return -EFAULT;
......@@ -433,22 +385,20 @@ static struct input_handle *evdev_connect(struct input_handler *handler, struct
return NULL;
memset(evdev, 0, sizeof(struct evdev));
INIT_LIST_HEAD(&evdev->list);
init_waitqueue_head(&evdev->wait);
evdev->exist = 1;
evdev->minor = minor;
evdev_table[minor] = evdev;
sprintf(evdev->name, "event%d", minor);
evdev->handle.dev = dev;
evdev->handle.name = evdev->name;
evdev->handle.handler = handler;
evdev->handle.private = evdev;
sprintf(evdev->name, "event%d", minor);
evdev_table[minor] = evdev;
evdev->devfs = input_register_minor("event%d", minor, EVDEV_MINOR_BASE);
evdev->exist = 1;
return &evdev->handle;
}
......
......@@ -44,7 +44,6 @@ MODULE_LICENSE("GPL");
struct emu {
struct pci_dev *dev;
struct emu *next;
struct gameport gameport;
int size;
char phys[32];
......
/*
* $Id: gameport.c,v 1.18 2002/01/22 20:41:14 vojtech Exp $
* Generic gameport layer
*
* Copyright (c) 1999-2001 Vojtech Pavlik
* Copyright (c) 1999-2002 Vojtech Pavlik
*/
/*
* Generic gameport layer
*/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Should you need to contact me, the author, you can do so either by
* e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*/
#include <asm/io.h>
......@@ -51,9 +33,8 @@ EXPORT_SYMBOL(gameport_close);
EXPORT_SYMBOL(gameport_rescan);
EXPORT_SYMBOL(gameport_cooked_read);
static struct gameport *gameport_list;
static struct gameport_dev *gameport_dev;
static LIST_HEAD(gameport_list);
static LIST_HEAD(gameport_dev_list);
#ifdef __i386__
......@@ -122,12 +103,13 @@ static int gameport_measure_speed(struct gameport *gameport)
static void gameport_find_dev(struct gameport *gameport)
{
struct gameport_dev *dev = gameport_dev;
struct gameport_dev *dev;
while (dev && !gameport->dev) {
list_for_each_entry(dev, &gameport_dev_list, node) {
if (gameport->dev)
break;
if (dev->connect)
dev->connect(gameport, dev);
dev = dev->next;
}
}
......@@ -139,52 +121,37 @@ void gameport_rescan(struct gameport *gameport)
void gameport_register_port(struct gameport *gameport)
{
gameport->next = gameport_list;
gameport_list = gameport;
list_add_tail(&gameport->node, &gameport_list);
gameport->speed = gameport_measure_speed(gameport);
gameport_find_dev(gameport);
}
void gameport_unregister_port(struct gameport *gameport)
{
struct gameport **gameportptr = &gameport_list;
while (*gameportptr && (*gameportptr != gameport)) gameportptr = &((*gameportptr)->next);
*gameportptr = (*gameportptr)->next;
list_del_init(&gameport->node);
if (gameport->dev && gameport->dev->disconnect)
gameport->dev->disconnect(gameport);
}
void gameport_register_device(struct gameport_dev *dev)
{
struct gameport *gameport = gameport_list;
dev->next = gameport_dev;
gameport_dev = dev;
struct gameport *gameport;
while (gameport) {
list_add_tail(&dev->node, &gameport_dev_list);
list_for_each_entry(gameport, &gameport_list, node)
if (!gameport->dev && dev->connect)
dev->connect(gameport, dev);
gameport = gameport->next;
}
}
void gameport_unregister_device(struct gameport_dev *dev)
{
struct gameport_dev **devptr = &gameport_dev;
struct gameport *gameport = gameport_list;
while (*devptr && (*devptr != dev)) devptr = &((*devptr)->next);
*devptr = (*devptr)->next;
struct gameport *gameport;
while (gameport) {
list_del_init(&dev->node);
list_for_each_entry(gameport, &gameport_list, node) {
if (gameport->dev == dev && dev->disconnect)
dev->disconnect(gameport);
gameport_find_dev(gameport);
gameport = gameport->next;
}
}
......@@ -209,5 +176,6 @@ int gameport_open(struct gameport *gameport, struct gameport_dev *dev, int mode)
void gameport_close(struct gameport *gameport)
{
gameport->dev = NULL;
if (gameport->close) gameport->close(gameport);
if (gameport->close)
gameport->close(gameport);
}
......@@ -53,13 +53,13 @@ struct ns558 {
int type;
int size;
struct pci_dev *dev;
struct ns558 *next;
struct list_head node;
struct gameport gameport;
char phys[32];
char name[32];
};
static struct ns558 *ns558;
static LIST_HEAD(ns558_list);
/*
* ns558_isa_probe() tries to find an isa gameport at the
......@@ -67,7 +67,7 @@ static struct ns558 *ns558;
* A joystick must be attached for this to work.
*/
static struct ns558* ns558_isa_probe(int io, struct ns558 *next)
static void ns558_isa_probe(int io)
{
int i, j, b;
unsigned char c, u, v;
......@@ -78,7 +78,7 @@ static struct ns558* ns558_isa_probe(int io, struct ns558 *next)
*/
if (check_region(io, 1))
return next;
return;
/*
* We must not be able to write arbitrary values to the port.
......@@ -89,7 +89,7 @@ static struct ns558* ns558_isa_probe(int io, struct ns558 *next)
outb(~c & ~3, io);
if (~(u = v = inb(io)) & 3) {
outb(c, io);
return next;
return;
}
/*
* After a trigger, there must be at least some bits changing.
......@@ -99,7 +99,7 @@ static struct ns558* ns558_isa_probe(int io, struct ns558 *next)
if (u == v) {
outb(c, io);
return next;
return;
}
wait_ms(3);
/*
......@@ -110,7 +110,7 @@ static struct ns558* ns558_isa_probe(int io, struct ns558 *next)
for (i = 0; i < 1000; i++)
if ((u ^ inb(io)) & 0xf) {
outb(c, io);
return next;
return;
}
/*
* And now find the number of mirrors of the port.
......@@ -134,11 +134,10 @@ static struct ns558* ns558_isa_probe(int io, struct ns558 *next)
if (!(port = kmalloc(sizeof(struct ns558), GFP_KERNEL))) {
printk(KERN_ERR "ns558: Memory allocation failed.\n");
return next;
return;
}
memset(port, 0, sizeof(struct ns558));
port->next = next;
port->type = NS558_ISA;
port->size = (1 << i);
port->gameport.io = io & (-1 << i);
......@@ -157,7 +156,7 @@ static struct ns558* ns558_isa_probe(int io, struct ns558 *next)
if (port->size > 1) printk(" size %d", port->size);
printk(" speed %d kHz\n", port->gameport.speed);
return port;
list_add(&port->node, &ns558_list);
}
#ifdef __ISAPNP__
......@@ -194,22 +193,22 @@ static struct isapnp_device_id pnp_devids[] = {
MODULE_DEVICE_TABLE(isapnp, pnp_devids);
static struct ns558* ns558_pnp_probe(struct pci_dev *dev, struct ns558 *next)
static void ns558_pnp_probe(struct pci_dev *dev)
{
int ioport, iolen;
struct ns558 *port;
if (dev->prepare && dev->prepare(dev) < 0)
return next;
return;
if (!(dev->resource[0].flags & IORESOURCE_IO)) {
printk(KERN_WARNING "ns558: No i/o ports on a gameport? Weird\n");
return next;
return;
}
if (dev->activate && dev->activate(dev) < 0) {
printk(KERN_ERR "ns558: PnP resource allocation failed\n");
return next;
return;
}
ioport = pci_resource_start(dev, 0);
......@@ -224,7 +223,6 @@ static struct ns558* ns558_pnp_probe(struct pci_dev *dev, struct ns558 *next)
}
memset(port, 0, sizeof(struct ns558));
port->next = next;
port->type = NS558_PNP;
port->size = iolen;
port->dev = dev;
......@@ -247,12 +245,12 @@ static struct ns558* ns558_pnp_probe(struct pci_dev *dev, struct ns558 *next)
if (iolen > 1) printk(" size %d", iolen);
printk(" speed %d kHz\n", port->gameport.speed);
return port;
list_add_tail(&port->node, &ns558_list);
return;
deactivate:
if (dev->deactivate)
dev->deactivate(dev);
return next;
}
#endif
......@@ -269,28 +267,26 @@ int __init ns558_init(void)
*/
while (ns558_isa_portlist[i])
ns558 = ns558_isa_probe(ns558_isa_portlist[i++], ns558);
ns558_isa_probe(ns558_isa_portlist[i++]);
/*
* Probe for PnP ports.
*/
#ifdef __ISAPNP__
for (devid = pnp_devids; devid->vendor; devid++) {
while ((dev = isapnp_find_dev(NULL, devid->vendor, devid->function, dev))) {
ns558 = ns558_pnp_probe(dev, ns558);
}
}
for (devid = pnp_devids; devid->vendor; devid++)
while ((dev = isapnp_find_dev(NULL, devid->vendor, devid->function, dev)))
ns558_pnp_probe(dev);
#endif
return ns558 ? 0 : -ENODEV;
return list_empty(&ns558_list) ? -ENODEV : 0;
}
void __exit ns558_exit(void)
{
struct ns558 *next, *port = ns558;
struct ns558 *port;
while (port) {
list_for_each_entry(port, &ns558_list, node) {
gameport_unregister_port(&port->gameport);
switch (port->type) {
......@@ -308,10 +304,6 @@ void __exit ns558_exit(void)
default:
break;
}
next = port->next;
kfree(port);
port = next;
}
}
......
......@@ -58,7 +58,7 @@ static int input_devices_state;
void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
{
struct list_head * node;
struct input_handle *handle;
if (dev->pm_dev)
pm_access(dev->pm_dev);
......@@ -177,11 +177,9 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
if (type != EV_SYN)
dev->sync = 0;
list_for_each(node,&dev->h_list) {
struct input_handle *handle = to_handle(node);
list_for_each_entry(handle, &dev->h_list, d_node)
if (handle->open)
handle->handler->event(handle, type, code, value);
}
}
static void input_repeat_key(unsigned long data)
......@@ -234,8 +232,8 @@ void input_close_device(struct input_handle *handle)
static void input_link_handle(struct input_handle *handle)
{
list_add_tail(&handle->d_node,&handle->dev->h_list);
list_add_tail(&handle->h_node,&handle->handler->h_list);
list_add_tail(&handle->d_node, &handle->dev->h_list);
list_add_tail(&handle->h_node, &handle->handler->h_list);
}
#define MATCH_BIT(bit, max) \
......@@ -400,8 +398,8 @@ static void input_call_hotplug(char *verb, struct input_dev *dev)
void input_register_device(struct input_dev *dev)
{
struct list_head * node;
struct input_handle *handle;
struct input_handler *handler;
struct input_device_id *id;
set_bit(EV_SYN, dev->evbit);
......@@ -413,14 +411,12 @@ void input_register_device(struct input_dev *dev)
dev->rep[REP_PERIOD] = HZ/33;
INIT_LIST_HEAD(&dev->h_list);
list_add_tail(&dev->node,&input_dev_list);
list_add_tail(&dev->node, &input_dev_list);
list_for_each(node,&input_handler_list) {
struct input_handler *handler = to_handler(node);
list_for_each_entry(handler, &input_handler_list, node)
if ((id = input_match_device(handler->id_table, dev)))
if ((handle = handler->connect(handler, dev, id)))
input_link_handle(handle);
}
#ifdef CONFIG_HOTPLUG
input_call_hotplug("add", dev);
......@@ -443,7 +439,7 @@ void input_unregister_device(struct input_dev *dev)
del_timer_sync(&dev->timer);
list_for_each_safe(node,next,&dev->h_list) {
list_for_each_safe(node, next, &dev->h_list) {
struct input_handle * handle = to_handle(node);
list_del_init(&handle->d_node);
list_del_init(&handle->h_node);
......@@ -464,7 +460,7 @@ void input_unregister_device(struct input_dev *dev)
void input_register_handler(struct input_handler *handler)
{
struct list_head * node;
struct input_dev *dev;
struct input_handle *handle;
struct input_device_id *id;
......@@ -475,14 +471,12 @@ void input_register_handler(struct input_handler *handler)
if (handler->fops != NULL)
input_table[handler->minor >> 5] = handler;
list_add_tail(&handler->node,&input_handler_list);
list_add_tail(&handler->node, &input_handler_list);
list_for_each(node,&input_dev_list) {
struct input_dev *dev = to_dev(node);
list_for_each_entry(dev, &input_dev_list, node)
if ((id = input_match_device(handler->id_table, dev)))
if ((handle = handler->connect(handler, dev, id)))
input_link_handle(handle);
}
#ifdef CONFIG_PROC_FS
input_devices_state++;
......@@ -494,7 +488,7 @@ void input_unregister_handler(struct input_handler *handler)
{
struct list_head * node, * next;
list_for_each_safe(node,next,&handler->h_list) {
list_for_each_safe(node, next, &handler->h_list) {
struct input_handle * handle = to_handle_h(node);
list_del_init(&handle->h_node);
list_del_init(&handle->d_node);
......@@ -591,14 +585,13 @@ static unsigned int input_devices_poll(struct file *file, poll_table *wait)
static int input_devices_read(char *buf, char **start, off_t pos, int count, int *eof, void *data)
{
struct list_head * node;
struct input_dev *dev;
struct input_handle *handle;
off_t at = 0;
int i, len, cnt = 0;
list_for_each(node,&input_dev_list) {
struct input_dev * dev = to_dev(node);
struct list_head * hnode;
list_for_each_entry(dev, &input_dev_list, node) {
len = sprintf(buf, "I: Bus=%04x Vendor=%04x Product=%04x Version=%04x\n",
dev->id.bustype, dev->id.vendor, dev->id.product, dev->id.version);
......@@ -607,10 +600,8 @@ static int input_devices_read(char *buf, char **start, off_t pos, int count, int
len += sprintf(buf + len, "P: Phys=%s\n", dev->phys ? dev->phys : "");
len += sprintf(buf + len, "H: Handlers=");
list_for_each(hnode,&dev->h_list) {
struct input_handle * handle = to_handle(hnode);
list_for_each_entry(handle, &dev->h_list, d_node)
len += sprintf(buf + len, "%s ", handle->name);
}
len += sprintf(buf + len, "\n");
......@@ -638,7 +629,7 @@ static int input_devices_read(char *buf, char **start, off_t pos, int count, int
}
}
if (node == &input_dev_list)
if (&dev->node == &input_dev_list)
*eof = 1;
return (count > cnt) ? cnt : count;
......@@ -646,14 +637,13 @@ static int input_devices_read(char *buf, char **start, off_t pos, int count, int
static int input_handlers_read(char *buf, char **start, off_t pos, int count, int *eof, void *data)
{
struct list_head * node;
struct input_handler *handler;
off_t at = 0;
int len = 0, cnt = 0;
int i = 0;
list_for_each(node,&input_handler_list) {
struct input_handler *handler = to_handler(node);
list_for_each_entry(handler, &input_handler_list, node) {
if (handler->fops)
len = sprintf(buf, "N: Number=%d Name=%s Minor=%d\n",
......@@ -674,7 +664,7 @@ static int input_handlers_read(char *buf, char **start, off_t pos, int count, in
break;
}
}
if (node == &input_handler_list)
if (&handler->node == &input_handler_list)
*eof = 1;
return (count > cnt) ? cnt : count;
......
/*
* $Id: joydev.c,v 1.43 2002/04/09 23:59:01 jsimmons Exp $
* Joystick device driver for the input driver suite.
*
* Copyright (c) 1999-2001 Vojtech Pavlik
* Copyright (c) 1999-2002 Vojtech Pavlik
* Copyright (c) 1999 Colin Van Dyke
*
* Joystick device driver for the input driver suite.
*/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Should you need to contact me, the author, you can do so either by
* e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
*/
#include <asm/io.h>
......@@ -63,8 +46,7 @@ struct joydev {
struct input_handle handle;
wait_queue_head_t wait;
devfs_handle_t devfs;
struct joydev *next;
struct joydev_list *list;
struct list_head list;
struct js_corr corr[ABS_MAX];
struct JS_DATA_SAVE_TYPE glue;
int nabs;
......@@ -83,7 +65,7 @@ struct joydev_list {
int startup;
struct fasync_struct *fasync;
struct joydev *joydev;
struct joydev_list *next;
struct list_head node;
};
static struct joydev *joydev_table[JOYDEV_MINORS];
......@@ -111,7 +93,7 @@ static int joydev_correct(int value, struct js_corr *corr)
static void joydev_event(struct input_handle *handle, unsigned int type, unsigned int code, int value)
{
struct joydev *joydev = handle->private;
struct joydev_list *list = joydev->list;
struct joydev_list *list;
struct js_event event;
switch (type) {
......@@ -137,7 +119,7 @@ static void joydev_event(struct input_handle *handle, unsigned int type, unsigne
event.time = MSECS(jiffies);
while (list) {
list_for_each_entry(list, &joydev->list, node) {
memcpy(list->buffer + list->head, &event, sizeof(struct js_event));
......@@ -146,8 +128,6 @@ static void joydev_event(struct input_handle *handle, unsigned int type, unsigne
list->startup = 0;
kill_fasync(&list->fasync, SIGIO, POLL_IN);
list = list->next;
}
wake_up_interruptible(&joydev->wait);
......@@ -164,14 +144,10 @@ static int joydev_fasync(int fd, struct file *file, int on)
static int joydev_release(struct inode * inode, struct file * file)
{
struct joydev_list *list = file->private_data;
struct joydev_list **listptr;
listptr = &list->joydev->list;
joydev_fasync(-1, file, 0);
while (*listptr && (*listptr != list))
listptr = &((*listptr)->next);
*listptr = (*listptr)->next;
list_del(&list->node);
if (!--list->joydev->open) {
if (list->joydev->exist) {
......@@ -201,9 +177,7 @@ static int joydev_open(struct inode *inode, struct file *file)
memset(list, 0, sizeof(struct joydev_list));
list->joydev = joydev_table[i];
list->next = joydev_table[i]->list;
joydev_table[i]->list = list;
list_add_tail(&list->node, &joydev_table[i]->list);
file->private_data = list;
if (!list->joydev->open++)
......@@ -220,12 +194,14 @@ static ssize_t joydev_write(struct file * file, const char * buffer, size_t coun
static ssize_t joydev_read(struct file *file, char *buf, size_t count, loff_t *ppos)
{
DECLARE_WAITQUEUE(wait, current);
struct joydev_list *list = file->private_data;
struct joydev *joydev = list->joydev;
struct input_dev *input = joydev->handle.dev;
int retval = 0;
if (!list->joydev->exist)
return -ENODEV;
if (count < sizeof(struct js_event))
return -EINVAL;
......@@ -248,36 +224,19 @@ static ssize_t joydev_read(struct file *file, char *buf, size_t count, loff_t *p
return sizeof(struct JS_DATA_TYPE);
}
if (list->head == list->tail && list->startup == joydev->nabs + joydev->nkey) {
add_wait_queue(&list->joydev->wait, &wait);
set_current_state(TASK_INTERRUPTIBLE);
if (list->startup == joydev->nabs + joydev->nkey
&& list->head == list->tail && (file->f_flags & O_NONBLOCK))
return -EAGAIN;
while (list->head == list->tail) {
if (!joydev->exist) {
retval = -ENODEV;
break;
}
if (file->f_flags & O_NONBLOCK) {
retval = -EAGAIN;
break;
}
if (signal_pending(current)) {
retval = -ERESTARTSYS;
break;
}
schedule();
}
set_current_state(TASK_RUNNING);
remove_wait_queue(&list->joydev->wait, &wait);
}
retval = wait_event_interruptible(list->joydev->wait, list->joydev->exist
&& (list->startup < joydev->nabs + joydev->nkey || list->head != list->tail));
if (retval)
return retval;
if (!list->joydev->exist)
return -ENODEV;
while (list->startup < joydev->nabs + joydev->nkey && retval + sizeof(struct js_event) <= count) {
struct js_event event;
......@@ -431,17 +390,16 @@ static struct input_handle *joydev_connect(struct input_handler *handler, struct
return NULL;
memset(joydev, 0, sizeof(struct joydev));
INIT_LIST_HEAD(&joydev->list);
init_waitqueue_head(&joydev->wait);
joydev->minor = minor;
joydev_table[minor] = joydev;
sprintf(joydev->name, "js%d", minor);
joydev->exist = 1;
joydev->handle.dev = dev;
joydev->handle.name = joydev->name;
joydev->handle.handler = handler;
joydev->handle.private = joydev;
sprintf(joydev->name, "js%d", minor);
for (i = 0; i < ABS_MAX; i++)
if (test_bit(i, dev->absbit)) {
......@@ -482,10 +440,9 @@ static struct input_handle *joydev_connect(struct input_handler *handler, struct
joydev->abs[i] = joydev_correct(dev->abs[j], joydev->corr + i);
}
joydev_table[minor] = joydev;
joydev->devfs = input_register_minor("js%d", minor, JOYDEV_MINOR_BASE);
joydev->exist = 1;
return &joydev->handle;
}
......
......@@ -300,6 +300,8 @@ static void a3d_connect(struct gameport *gameport, struct gameport_dev *dev)
a3d->length = 33;
init_input_dev(&a3d->dev);
a3d->dev.evbit[0] |= BIT(EV_ABS) | BIT(EV_KEY) | BIT(EV_REL);
a3d->dev.relbit[0] |= BIT(REL_X) | BIT(REL_Y);
a3d->dev.absbit[0] |= BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_THROTTLE) | BIT(ABS_RUDDER)
......@@ -328,6 +330,8 @@ static void a3d_connect(struct gameport *gameport, struct gameport_dev *dev)
} else {
a3d->length = 29;
init_input_dev(&a3d->dev);
a3d->dev.evbit[0] |= BIT(EV_KEY) | BIT(EV_REL);
a3d->dev.relbit[0] |= BIT(REL_X) | BIT(REL_Y);
a3d->dev.keybit[LONG(BTN_MOUSE)] |= BIT(BTN_RIGHT) | BIT(BTN_LEFT) | BIT(BTN_MIDDLE);
......
......@@ -404,6 +404,8 @@ static void adi_init_input(struct adi *adi, struct adi_port *port, int half)
if (!adi->length) return;
init_input_dev(&adi->dev);
t = adi->id < ADI_ID_MAX ? adi->id : ADI_ID_MAX;
sprintf(buf, adi_names[t], adi->id);
......
......@@ -431,9 +431,10 @@ static void analog_init_device(struct analog_port *port, struct analog *analog,
analog_name(analog);
sprintf(analog->phys, "%s/input%d", port->gameport->phys, index);
analog->buttons = (analog->mask & ANALOG_GAMEPAD) ? analog_pad_btn : analog_joy_btn;
init_input_dev(&analog->dev);
analog->dev.name = analog->name;
analog->dev.phys = analog->phys;
analog->dev.id.bustype = BUS_GAMEPORT;
......
......@@ -290,6 +290,8 @@ static void gf2k_connect(struct gameport *gameport, struct gameport_dev *dev)
gf2k->length = gf2k_lens[gf2k->id];
init_input_dev(&gf2k->dev);
gf2k->dev.private = gf2k;
gf2k->dev.open = gf2k_open;
gf2k->dev.close = gf2k_close;
......
......@@ -169,6 +169,7 @@ static void magellan_connect(struct serio *serio, struct serio_dev *dev)
sprintf(magellan->phys, "%s/input0", serio->phys);
init_input_dev(&magellan->dev);
magellan->dev.private = magellan;
magellan->dev.name = magellan_name;
magellan->dev.phys = magellan->phys;
......@@ -187,6 +188,7 @@ static void magellan_connect(struct serio *serio, struct serio_dev *dev)
input_register_device(&magellan->dev);
printk(KERN_INFO "input: %s on %s\n", magellan_name, serio->phys);
}
/*
......
......@@ -240,6 +240,7 @@ static void spaceball_connect(struct serio *serio, struct serio_dev *dev)
sprintf(spaceball->phys, "%s/input0", serio->phys);
init_input_dev(&spaceball->dev);
spaceball->dev.name = spaceball_names[id];
spaceball->dev.phys = spaceball->phys;
spaceball->dev.id.bustype = BUS_RS232;
......
......@@ -187,6 +187,7 @@ static void spaceorb_connect(struct serio *serio, struct serio_dev *dev)
sprintf(spaceorb->phys, "%s/input0", serio->phys);
init_input_dev(&spaceorb->dev);
spaceorb->dev.name = spaceorb_name;
spaceorb->dev.phys = spaceorb->phys;
spaceorb->dev.id.bustype = BUS_RS232;
......
......@@ -152,6 +152,7 @@ static void stinger_connect(struct serio *serio, struct serio_dev *dev)
sprintf(stinger->phys, "%s/serio0", serio->phys);
init_input_dev(&stinger->dev);
stinger->dev.name = stinger_name;
stinger->dev.phys = stinger->phys;
stinger->dev.id.bustype = BUS_RS232;
......@@ -166,7 +167,6 @@ static void stinger_connect(struct serio *serio, struct serio_dev *dev)
}
stinger->dev.private = stinger;
serio->private = stinger;
if (serio_open(serio, dev)) {
......@@ -177,6 +177,7 @@ static void stinger_connect(struct serio *serio, struct serio_dev *dev)
input_register_device(&stinger->dev);
printk(KERN_INFO "input: %s on %s\n", stinger_name, serio->phys);
}
/*
......
......@@ -198,6 +198,7 @@ static void twidjoy_connect(struct serio *serio, struct serio_dev *dev)
sprintf(twidjoy->phys, "%s/input0", serio->phys);
init_input_dev(&twidjoy->dev);
twidjoy->dev.name = twidjoy_name;
twidjoy->dev.phys = twidjoy->phys;
twidjoy->dev.id.bustype = BUS_RS232;
......@@ -224,7 +225,6 @@ static void twidjoy_connect(struct serio *serio, struct serio_dev *dev)
}
twidjoy->dev.private = twidjoy;
serio->private = twidjoy;
if (serio_open(serio, dev)) {
......
......@@ -155,6 +155,7 @@ static void warrior_connect(struct serio *serio, struct serio_dev *dev)
sprintf(warrior->phys, "%s/input0", serio->phys);
init_input_dev(&warrior->dev);
warrior->dev.name = warrior_name;
warrior->dev.phys = warrior->phys;
warrior->dev.id.bustype = BUS_RS232;
......
......@@ -112,6 +112,8 @@ static int __init amikbd_init(void)
if (!request_mem_region(CIAA_PHYSADDR-1+0xb00, 0x100, "amikeyb"))
return -EBUSY;
init_input_dev(&amibkd_dev);
amikbd_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
amikbd_dev.keycode = amikbd_keycode;
amikbd_dev.keycodesize = sizeof(unsigned char);
......
......@@ -22,9 +22,15 @@
MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
MODULE_DESCRIPTION("AT and PS/2 keyboard driver");
MODULE_PARM(atkbd_set, "1i");
MODULE_PARM(atkbd_reset, "1i");
MODULE_LICENSE("GPL");
static int atkbd_set = 2;
#if defined(__i386__) || defined (__x86_64__)
static int atkbd_reset;
#else
static int atkbd_reset = 1;
#endif
/*
* Scancode to keycode tables. These are just the default setting, and
......@@ -49,11 +55,11 @@ static unsigned char atkbd_set2_keycode[512] = {
252,253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,
0, 0, 92, 90, 85, 0,137, 0, 0, 0, 0, 91, 89,144,115, 0,
136,100,255, 0, 97,149,164, 0,156, 0, 0,140,115, 0, 0,125,
0,150, 0,154,152,163,151,126,112,166, 0,140, 0,147, 0,127,
159,167,139,160,163, 0, 0,116,158, 0,150,165, 0, 0, 0,142,
157, 0,114,166,168, 0, 0, 0,155, 0, 98,113, 0,148, 0,138,
0, 0, 0, 0, 0, 0,153,140, 0,255, 96, 0, 0, 0,143, 0,
217,100,255, 0, 97,165,164, 0,156, 0, 0,140,115, 0, 0,125,
173,114, 0,113,152,163,151,126,128,166, 0,140, 0,147, 0,127,
159,167,115,160,164, 0, 0,116,158, 0,150,166, 0, 0, 0,142,
157, 0,114,166,168, 0, 0, 0,155, 0, 98,113, 0,163, 0,138,
226, 0, 0, 0, 0, 0,153,140, 0,255, 96, 0, 0, 0,143, 0,
133, 0,116, 0,143, 0,174,133, 0,107, 0,105,102, 0, 0,112,
110,111,108,112,106,103, 0,119, 0,118,109, 0, 99,104,119
};
......@@ -67,7 +73,7 @@ static unsigned char atkbd_set3_keycode[512] = {
113,114, 40, 84, 26, 13, 87, 99,100, 54, 28, 27, 43, 84, 88, 70,
108,105,119,103,111,107, 14,110, 0, 79,106, 75, 71,109,102,104,
82, 83, 80, 76, 77, 72, 69, 98, 0, 96, 81, 0, 78, 73, 55, 85,
89, 90, 91, 92, 74, 0, 0, 0, 0, 0, 0,125,126,127,112, 0,
89, 90, 91, 92, 74,185,184,182, 0, 0, 0,125,126,127,112, 0,
0,139,150,163,165,115,152,150,166,140,160,154,113,114,167,168,
148,149,147,140, 0, 0, 0, 0, 0, 0,251, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
......@@ -89,6 +95,7 @@ static unsigned char atkbd_set3_keycode[512] = {
#define ATKBD_CMD_RESEND 0x00fe
#define ATKBD_CMD_EX_ENABLE 0x10ea
#define ATKBD_CMD_EX_SETLEDS 0x20eb
#define ATKBD_CMD_OK_GETID 0x02e8
#define ATKBD_RET_ACK 0xfa
#define ATKBD_RET_NAK 0xfe
......@@ -113,6 +120,7 @@ struct atkbd {
unsigned char cmdbuf[4];
unsigned char cmdcnt;
unsigned char set;
unsigned char oldset;
unsigned char release;
signed char ack;
unsigned char emul;
......@@ -134,7 +142,6 @@ static void atkbd_interrupt(struct serio *serio, unsigned char data, unsigned in
printk(KERN_DEBUG "atkbd.c: Received %02x flags %02x\n", data, flags);
#endif
/* Interface error. Request that the keyboard resend. */
if ((flags & (SERIO_FRAME | SERIO_PARITY)) && (~flags & SERIO_TIMEOUT) && atkbd->write) {
printk("atkbd.c: frame/parity error: %02x\n", flags);
serio_write(serio, ATKBD_CMD_RESEND);
......@@ -205,7 +212,9 @@ static int atkbd_sendbyte(struct atkbd *atkbd, unsigned char byte)
#ifdef ATKBD_DEBUG
printk(KERN_DEBUG "atkbd.c: Sent: %02x\n", byte);
#endif
serio_write(atkbd->serio, byte);
if (serio_write(atkbd->serio, byte))
return -1;
while (!atkbd->ack && timeout--) udelay(10);
return -(atkbd->ack <= 0);
......@@ -289,34 +298,42 @@ static int atkbd_event(struct input_dev *dev, unsigned int type, unsigned int co
static int atkbd_set_3(struct atkbd *atkbd)
{
unsigned char param;
unsigned char param[2];
/*
* Remember original scancode set value, so that we can restore it on exit.
*/
if (atkbd_command(atkbd, &atkbd->oldset, ATKBD_CMD_GSCANSET))
atkbd->oldset = 2;
/*
* For known special keyboards we can go ahead and set the correct set.
* We check for NCD PS/2 Sun, NorthGate OmniKey 101 and IBM RapidAccess
* keyboards.
*/
if (atkbd->id == 0xaca1) {
param = 3;
atkbd_command(atkbd, &param, ATKBD_CMD_SSCANSET);
param[0] = 3;
atkbd_command(atkbd, param, ATKBD_CMD_SSCANSET);
return 3;
}
/*
* We check for the extra keys on an some keyboards that need extra
* command to get enabled. This shouldn't harm any keyboards not
* knowing the command.
*/
if (!atkbd_command(atkbd, param, ATKBD_CMD_OK_GETID)) {
atkbd->id = param[0] << 8 | param[1];
return 2;
}
param = 0x71;
if (!atkbd_command(atkbd, &param, ATKBD_CMD_EX_ENABLE))
param[0] = 0x71;
if (!atkbd_command(atkbd, param, ATKBD_CMD_EX_ENABLE))
return 4;
/*
* Try to set the set we want.
*/
param = atkbd_set;
if (atkbd_command(atkbd, &param, ATKBD_CMD_SSCANSET))
param[0] = atkbd_set;
if (atkbd_command(atkbd, param, ATKBD_CMD_SSCANSET))
return 2;
/*
......@@ -327,8 +344,8 @@ static int atkbd_set_3(struct atkbd *atkbd)
* In that case we time out, and return 2.
*/
param = 0;
if (atkbd_command(atkbd, &param, ATKBD_CMD_GSCANSET))
param[0] = 0;
if (atkbd_command(atkbd, param, ATKBD_CMD_GSCANSET))
return 2;
/*
......@@ -336,7 +353,7 @@ static int atkbd_set_3(struct atkbd *atkbd)
* itself.
*/
return (param == 3) ? 3 : 2;
return (param[0] == 3) ? 3 : 2;
}
/*
......@@ -353,10 +370,9 @@ static int atkbd_probe(struct atkbd *atkbd)
* these systems the BIOS also usually doesn't do it for us.
*/
#ifdef CONFIG_KEYBOARD_ATKBD_RESET
if (atkbd_reset)
if (atkbd_command(atkbd, NULL, ATKBD_CMD_RESET_BAT))
printk(KERN_WARNING "atkbd.c: keyboard reset failed\n");
#endif
/*
* Next we check we can set LEDs on the keyboard. This should work on every
......@@ -405,7 +421,18 @@ static int atkbd_probe(struct atkbd *atkbd)
}
/*
* atkbd_disconnect() cleans up behind us ...
* atkbd_cleanup() restores the keyboard state so that BIOS is happy after a
* reboot.
*/
static void atkbd_cleanup(struct serio *serio)
{
struct atkbd *atkbd = serio->private;
atkbd_command(atkbd, &atkbd->oldset, ATKBD_CMD_SSCANSET);
}
/*
* atkbd_disconnect() closes and frees.
*/
static void atkbd_disconnect(struct serio *serio)
......@@ -447,6 +474,8 @@ static void atkbd_connect(struct serio *serio, struct serio_dev *dev)
atkbd->serio = serio;
init_input_dev(&atkbd->dev);
atkbd->dev.keycode = atkbd->keycode;
atkbd->dev.keycodesize = sizeof(unsigned char);
atkbd->dev.keycodemax = ARRAY_SIZE(atkbd_set2_keycode);
......@@ -508,18 +537,28 @@ static void atkbd_connect(struct serio *serio, struct serio_dev *dev)
static struct serio_dev atkbd_dev = {
.interrupt = atkbd_interrupt,
.connect = atkbd_connect,
.disconnect = atkbd_disconnect
.disconnect = atkbd_disconnect,
.cleanup = atkbd_cleanup,
};
#ifndef MODULE
static int __init atkbd_setup(char *str)
static int __init atkbd_setup_set(char *str)
{
int ints[4];
str = get_options(str, ARRAY_SIZE(ints), ints);
if (ints[0] > 0) atkbd_set = ints[1];
return 1;
}
__setup("atkbd_set=", atkbd_setup);
static int __init atkbd_setup_reset(char *str)
{
int ints[4];
str = get_options(str, ARRAY_SIZE(ints), ints);
if (ints[0] > 0) atkbd_reset = ints[1];
return 1;
}
__setup("atkbd_set=", atkbd_setup_set);
__setup("atkbd_reset", atkbd_setup_reset);
#endif
int __init atkbd_init(void)
......
......@@ -93,11 +93,11 @@ void nkbd_connect(struct serio *serio, struct serio_dev *dev)
nkbd->serio = serio;
init_input_dev(&nkbd->dev);
nkbd->dev.keycode = nkbd->keycode;
nkbd->dev.keycodesize = sizeof(unsigned char);
nkbd->dev.keycodemax = ARRAY_SIZE(nkbd_keycode);
nkbd->dev.private = nkbd;
serio->private = nkbd;
if (serio_open(serio, dev)) {
......
......@@ -234,6 +234,8 @@ static void sunkbd_connect(struct serio *serio, struct serio_dev *dev)
memset(sunkbd, 0, sizeof(struct sunkbd));
init_input_dev(&sunkbd->dev);
sunkbd->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_SND) | BIT(EV_REP);
sunkbd->dev.ledbit[0] = BIT(LED_CAPSL) | BIT(LED_COMPOSE) | BIT(LED_SCROLLL) | BIT(LED_NUML);
sunkbd->dev.sndbit[0] = BIT(SND_CLICK) | BIT(SND_BELL);
......
......@@ -100,6 +100,7 @@ void xtkbd_connect(struct serio *serio, struct serio_dev *dev)
xtkbd->serio = serio;
init_input_dev(&xtkbd->dev);
xtkbd->dev.keycode = xtkbd->keycode;
xtkbd->dev.keycodesize = sizeof(unsigned char);
xtkbd->dev.keycodemax = ARRAY_SIZE(xtkbd_keycode);
......
......@@ -8,4 +8,7 @@ dep_tristate ' PC Speaker support' CONFIG_INPUT_PCSPKR $CONFIG_INPUT $CONFIG_IN
if [ "$CONFIG_SPARC32" = "y" -o "$CONFIG_SPARC64" = "y" ]; then
dep_tristate ' SPARC Speaker support' CONFIG_INPUT_SPARCSPKR $CONFIG_INPUT $CONFIG_INPUT_MISC
fi
if [ "$CONFIG_M68K" = "y" ]; then
dep_tristate ' M68k Beeper support' CONFIG_INPUT_M68K_BEEP $CONFIG_INPUT $CONFIG_INPUT_MISC
fi
dep_tristate ' User level driver support' CONFIG_INPUT_UINPUT $CONFIG_INPUT $CONFIG_INPUT_MISC
......@@ -6,6 +6,7 @@
obj-$(CONFIG_INPUT_SPARCSPKR) += sparcspkr.o
obj-$(CONFIG_INPUT_PCSPKR) += pcspkr.o
obj-$(CONFIG_INPUT_M68K_BEEP) += m68kspkr.o
obj-$(CONFIG_INPUT_UINPUT) += uinput.o
# The global Rules.make.
......
/*
* m68k beeper driver for Linux
*
* Copyright (c) 2002 Richard Zidlicky
* Copyright (c) 2002 Vojtech Pavlik
* Copyright (c) 1992 Orest Zborowski
*
*/
/*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/input.h>
#include <asm/machdep.h>
#include <asm/io.h>
MODULE_AUTHOR("Richard Zidlicky <rz@linux-m68k.org>");
MODULE_DESCRIPTION("m68k beeper driver");
MODULE_LICENSE("GPL");
static char m68kspkr_name[] = "m68k beeper";
static char m68kspkr_phys[] = "m68k/generic";
static struct input_dev m68kspkr_dev;
static int m68kspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
{
unsigned int count = 0;
if (type != EV_SND)
return -1;
switch (code) {
case SND_BELL: if (value) value = 1000;
case SND_TONE: break;
default: return -1;
}
if (value > 20 && value < 32767)
count = 1193182 / value;
mach_beep(count, -1);
return 0;
}
static int __init m68kspkr_init(void)
{
if (!mach_beep){
printk("%s: no lowlevel beep support\n", m68kspkr_name);
return -1;
}
m68kspkr_dev.evbit[0] = BIT(EV_SND);
m68kspkr_dev.sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE);
m68kspkr_dev.event = m68kspkr_event;
m68kspkr_dev.name = m68kspkr_name;
m68kspkr_dev.phys = m68kspkr_phys;
m68kspkr_dev.id.bustype = BUS_HOST;
m68kspkr_dev.id.vendor = 0x001f;
m68kspkr_dev.id.product = 0x0001;
m68kspkr_dev.id.version = 0x0100;
input_register_device(&m68kspkr_dev);
printk(KERN_INFO "input: %s\n", m68kspkr_name);
return 0;
}
static void __exit m68kspkr_exit(void)
{
input_unregister_device(&m68kspkr_dev);
}
module_init(m68kspkr_init);
module_exit(m68kspkr_exit);
......@@ -115,6 +115,12 @@ static struct input_dev inport_dev = {
.close = inport_close,
.name = INPORT_NAME,
.phys = "isa023c/input0",
.id = {
.bustype = BUS_ISA,
.vendor = INPORT_VENDOR,
.product = 0x0001,
.version = 0x0100,
},
};
static void inport_interrupt(int irq, void *dev_id, struct pt_regs *regs)
......@@ -158,30 +164,27 @@ static int __init inport_init(void)
{
unsigned char a,b,c;
if (check_region(INPORT_BASE, INPORT_EXTENT))
if (!request_region(INPORT_BASE, INPORT_EXTENT, "inport")) {
printk(KERN_ERR "inport.c: Can't allocate ports at %#x\n", INPORT_BASE);
return -EBUSY;
}
a = inb(INPORT_SIGNATURE_PORT);
b = inb(INPORT_SIGNATURE_PORT);
c = inb(INPORT_SIGNATURE_PORT);
if (( a == b ) || ( a != c ))
if (( a == b ) || ( a != c )) {
release_region(INPORT_BASE, INPORT_EXTENT);
printk(KERN_ERR "inport.c: Didn't find InPort mouse at %#x\n", INPORT_BASE);
return -ENODEV;
}
outb(INPORT_RESET, INPORT_CONTROL_PORT);
outb(INPORT_REG_MODE, INPORT_CONTROL_PORT);
outb(INPORT_MODE_BASE, INPORT_DATA_PORT);
request_region(INPORT_BASE, INPORT_EXTENT, "inport");
input_register_device(&inport_dev);
inport_dev.id.bustype =BUS_ISA;
inport_dev.id.vendor =INPORT_VENDOR;
inport_dev.id.product =0x0001;
inport_dev.id.version =0x0100;
printk(KERN_INFO "input: " INPORT_NAME " at %#x irq %d\n",
INPORT_BASE, inport_irq);
printk(KERN_INFO "input: " INPORT_NAME " at %#x irq %d\n", INPORT_BASE, inport_irq);
return 0;
}
......
......@@ -105,6 +105,12 @@ static struct input_dev logibm_dev = {
.close = logibm_close,
.name = "Logitech bus mouse",
.phys = "isa023c/input0",
.id = {
.bustype = BUS_ISA,
.vendor = 0x0003,
.product = 0x0001,
.version = 0x0100,
},
};
static void logibm_interrupt(int irq, void *dev_id, struct pt_regs *regs)
......@@ -165,10 +171,6 @@ static int __init logibm_init(void)
outb(LOGIBM_DISABLE_IRQ, LOGIBM_CONTROL_PORT);
input_register_device(&logibm_dev);
logibm_dev.id.bustype = BUS_ISA;
logibm_dev.id.vendor = 0x0003;
logibm_dev.id.product = 0x0001;
logibm_dev.id.version = 0x0100;
printk(KERN_INFO "input: Logitech bus mouse at %#x irq %d\n", LOGIBM_BASE, logibm_irq);
......
......@@ -20,8 +20,11 @@
MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
MODULE_DESCRIPTION("PS/2 mouse driver");
MODULE_PARM(psmouse_noext, "1i");
MODULE_LICENSE("GPL");
static int psmouse_noext;
#define PSMOUSE_CMD_SETSCALE11 0x00e6
#define PSMOUSE_CMD_SETRES 0x10e8
#define PSMOUSE_CMD_GETINFO 0x03e9
......@@ -32,6 +35,7 @@ MODULE_LICENSE("GPL");
#define PSMOUSE_CMD_SETRATE 0x10f3
#define PSMOUSE_CMD_ENABLE 0x00f4
#define PSMOUSE_CMD_RESET_DIS 0x00f6
#define PSMOUSE_CMD_RESET_BAT 0x02ff
#define PSMOUSE_RET_BAT 0xaa
#define PSMOUSE_RET_ACK 0xfa
......@@ -197,7 +201,7 @@ static void psmouse_interrupt(struct serio *serio, unsigned char data, unsigned
psmouse->packet[psmouse->pktcnt++] = data;
if (psmouse->pktcnt == 3 + (psmouse->type >= PSMOUSE_GENPS)) {
if ((psmouse->packet[0] & 0x08) == 0x08) psmouse_process_packet(psmouse);
psmouse_process_packet(psmouse);
psmouse->pktcnt = 0;
return;
}
......@@ -220,7 +224,11 @@ static int psmouse_sendbyte(struct psmouse *psmouse, unsigned char byte)
psmouse->ack = 0;
psmouse->acking = 1;
serio_write(psmouse->serio, byte);
if (serio_write(psmouse->serio, byte)) {
psmouse->acking = 0;
return -1;
}
while (!psmouse->ack && timeout--) udelay(10);
return -(psmouse->ack <= 0);
......@@ -300,6 +308,9 @@ static int psmouse_extensions(struct psmouse *psmouse)
psmouse->name = "Mouse";
psmouse->model = 0;
if (psmouse_noext)
return PSMOUSE_PS2;
/*
* Try Genius NetMouse magic init.
*/
......@@ -336,8 +347,8 @@ static int psmouse_extensions(struct psmouse *psmouse)
if (param[1]) {
int i;
static int logitech_4btn[] = { 12, 40, 41, 42, 43, 73, 80, -1 };
static int logitech_wheel[] = { 75, 76, 80, 81, 83, 88, -1 };
static int logitech_4btn[] = { 12, 40, 41, 42, 43, 52, 73, 80, -1 };
static int logitech_wheel[] = { 52, 75, 76, 80, 81, 83, 88, -1 };
static int logitech_ps2pp[] = { 12, 13, 40, 41, 42, 43, 50, 51, 52, 53, 73, 75,
76, 80, 81, 83, 88, 96, 97, -1 };
psmouse->vendor = "Logitech";
......@@ -527,15 +538,24 @@ static void psmouse_initialize(struct psmouse *psmouse)
* Last, we enable the mouse so that we get reports from it.
*/
if (psmouse_command(psmouse, NULL, PSMOUSE_CMD_ENABLE)) {
if (psmouse_command(psmouse, NULL, PSMOUSE_CMD_ENABLE))
printk(KERN_WARNING "psmouse.c: Failed to enable mouse on %s\n", psmouse->serio->phys);
}
}
/*
* psmouse_disconnect() cleans up after we don't want talk
* to the mouse anymore.
* psmouse_cleanup() resets the mouse into power-on state.
*/
static void psmouse_cleanup(struct serio *serio)
{
struct psmouse *psmouse = serio->private;
unsigned char param[2];
psmouse_command(psmouse, param, PSMOUSE_CMD_RESET_BAT);
}
/*
* psmouse_disconnect() closes and frees.
*/
static void psmouse_disconnect(struct serio *serio)
......@@ -563,6 +583,7 @@ static void psmouse_connect(struct serio *serio, struct serio_dev *dev)
memset(psmouse, 0, sizeof(struct psmouse));
init_input_dev(&psmouse->dev);
psmouse->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
psmouse->dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT);
psmouse->dev.relbit[0] = BIT(REL_X) | BIT(REL_Y);
......@@ -605,9 +626,19 @@ static void psmouse_connect(struct serio *serio, struct serio_dev *dev)
static struct serio_dev psmouse_dev = {
.interrupt = psmouse_interrupt,
.connect = psmouse_connect,
.disconnect = psmouse_disconnect
.disconnect = psmouse_disconnect,
.cleanup = psmouse_cleanup,
};
#ifndef MODULE
static int __init psmouse_setup(char *str)
{
psmouse_noext = 1;
return 1;
}
__setup("psmouse_noext", psmouse_setup);
#endif
int __init psmouse_init(void)
{
serio_register_device(&psmouse_dev);
......
......@@ -41,6 +41,12 @@ static struct input_dev rpcmouse_dev = {
.relbit = { BIT(REL_X) | BIT(REL_Y) },
.name = "Acorn RiscPC Mouse",
.phys = "rpcmouse/input0",
.id = {
.bustype = BUS_HOST,
.vendor = 0x0005,
.product = 0x0001,
.version = 0x0100,
},
};
static void rpcmouse_irq(int irq, void *dev_id, struct pt_regs *regs)
......@@ -69,6 +75,8 @@ static void rpcmouse_irq(int irq, void *dev_id, struct pt_regs *regs)
static int __init rpcmouse_init(void)
{
init_input_dev(&rpcmouse_dev);
rpcmouse_lastx = (short) iomd_readl(IOMD_MOUSEX);
rpcmouse_lasty = (short) iomd_readl(IOMD_MOUSEY);
......@@ -78,10 +86,6 @@ static int __init rpcmouse_init(void)
}
input_register_device(&rpcmouse_dev);
rpcmouse.id.bustype =BUS_HOST,
rpcmouse.id.vendor =0x0005,
rpcmouse.id.product =0x0001,
rpcmouse.id.version =0x0100,
printk(KERN_INFO "input: Acorn RiscPC mouse irq %d", IRQ_VSYNCPULSE);
......
......@@ -155,7 +155,7 @@ static void sermouse_process_ms(struct sermouse *sermouse, signed char data)
case SERIO_MZ:
input_report_key(dev, BTN_MIDDLE, (data >> 4) & 1);
input_report_rel(dev, REL_WHEEL, (data & 7) - (data & 8));
input_report_rel(dev, REL_WHEEL, (data & 8) - (data & 7));
break;
}
......@@ -204,7 +204,7 @@ static void sermouse_interrupt(struct serio *serio, unsigned char data, unsigned
{
struct sermouse *sermouse = serio->private;
if (time_after(jiffies, sermouse->last + HZ/20)) sermouse->count = 0;
if (time_after(jiffies, sermouse->last + HZ/10)) sermouse->count = 0;
sermouse->last = jiffies;
if (sermouse->type > SERIO_SUN)
......@@ -247,6 +247,7 @@ static void sermouse_connect(struct serio *serio, struct serio_dev *dev)
memset(sermouse, 0, sizeof(struct sermouse));
init_input_dev(&sermouse->dev);
sermouse->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
sermouse->dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT);
sermouse->dev.relbit[0] = BIT(REL_X) | BIT(REL_Y);
......
This diff is collapsed.
......@@ -13,6 +13,7 @@
#define I8042_KBD_PHYS_DESC "isa0060/serio0"
#define I8042_AUX_PHYS_DESC "isa0060/serio1"
#define I8042_MUX_PHYS_DESC "isa0060/serio%d"
/*
* IRQs.
......@@ -64,9 +65,13 @@ static inline int i8042_platform_init(void)
*/
#if !defined(__i386__) && !defined(__sh__) && !defined(__alpha__) && !defined(__x86_64__)
if (!request_region(I8042_DATA_REG, 16, "i8042"))
return 0;
return -1;
#endif
#if !defined(__i386__) && !defined(__x86_64__)
i8042_reset = 1;
#endif
return 1;
return 0;
}
static inline void i8042_platform_exit(void)
......
......@@ -14,6 +14,7 @@
#define I8042_KBD_PHYS_DESC "walnutps2/serio0"
#define I8042_AUX_PHYS_DESC "walnutps2/serio1"
#define I8042_MUX_PHYS_DESC "walnutps2/serio%d"
extern void *kb_cs;
extern void *kb_data;
......@@ -34,18 +35,17 @@ static inline int i8042_read_status(void)
static inline void i8042_write_data(int val)
{
writeb(val, kb_data);
return;
}
static inline void i8042_write_command(int val)
{
writeb(val, kb_cs);
return;
}
static inline int i8042_platform_init(void)
{
return 1;
i8042_reset = 1;
return 0;
}
static inline void i8042_platform_exit(void)
......@@ -59,6 +59,7 @@ static inline void i8042_platform_exit(void)
#define I8042_KBD_PHYS_DESC "spruceps2/serio0"
#define I8042_AUX_PHYS_DESC "spruceps2/serio1"
#define I8042_MUX_PHYS_DESC "spruceps2/serio%d"
#define I8042_COMMAND_REG 0xff810000
#define I8042_DATA_REG 0xff810001
......@@ -109,18 +110,17 @@ static inline int i8042_read_status(void)
static inline void i8042_write_data(int val)
{
*((unsigned char *)0xff810000) = (char)val;
return;
}
static inline void i8042_write_command(int val)
{
*((unsigned char *)0xff810001) = (char)val;
return;
}
static inline int i8042_platform_init(void)
{
return 1;
i8042_reset = 1;
return 0;
}
static inline void i8042_platform_exit(void)
......
......@@ -11,6 +11,7 @@ static int i8042_aux_irq = -1;
#define I8042_KBD_PHYS_DESC "sparcps2/serio0"
#define I8042_AUX_PHYS_DESC "sparcps2/serio1"
#define I8042_MUX_PHYS_DESC "sparcps2/serio%d"
static unsigned long kbd_iobase;
......@@ -50,14 +51,14 @@ static int i8042_platform_init(void)
len = prom_getproperty(prom_root_node, "name", prop, sizeof(prop));
if (len < 0) {
printk("i8042: Cannot get name property of root OBP node.\n");
return 0;
return -1;
}
if (strncmp(prop, "SUNW,JavaStation-1", len) == 0) {
/* Hardcoded values for MrCoffee. */
i8042_kbd_irq = i8042_aux_irq = 13 | 0x20;
kbd_iobase = (unsigned long) ioremap(0x71300060, 8);
if (!kbd_iobase)
return 0;
return -1;
} else {
struct linux_ebus *ebus;
struct linux_ebus_device *edev;
......@@ -69,7 +70,7 @@ static int i8042_platform_init(void)
goto edev_found;
}
}
return 0;
return -1;
edev_found:
for_each_edevchild(edev, child) {
......@@ -87,11 +88,13 @@ static int i8042_platform_init(void)
i8042_aux_irq == -1) {
printk("i8042: Error, 8042 device lacks both kbd and "
"mouse nodes.\n");
return 0;
return -1;
}
}
return 1;
i8042_reset = 1;
return 0;
}
static inline void i8042_platform_exit(void)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -120,6 +120,7 @@ static void gunze_connect(struct serio *serio, struct serio_dev *dev)
memset(gunze, 0, sizeof(struct gunze));
init_input_dev(&gunze->dev);
gunze->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
gunze->dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y);
gunze->dev.keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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