Commit ae5ec6fe authored by Vojtech Pavlik's avatar Vojtech Pavlik

Remove several files no longer used on m68k.

Input layer now handles those devices.
parent e8d5b0ba
This diff is collapsed.
/*
* 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;
}
This diff is collapsed.
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.
This diff is collapsed.
/*
* linux/include/asm-m68k/q40_keyboard.h
*
* Q40 specific keyboard definitions
*/
#ifdef __KERNEL__
#include <asm/machdep.h>
extern int q40kbd_setkeycode(unsigned int scancode, unsigned int keycode);
extern int q40kbd_getkeycode(unsigned int scancode);
extern int q40kbd_pretranslate(unsigned char scancode, char raw_mode);
extern int q40kbd_translate(unsigned char scancode, unsigned char *keycode,
char raw_mode);
extern char q40kbd_unexpected_up(unsigned char keycode);
extern void q40kbd_leds(unsigned char leds);
extern int q40kbd_is_sysrq(unsigned char keycode);
extern int q40kbd_init_hw(void);
extern unsigned char q40kbd_sysrq_xlate[128];
#endif /* __KERNEL__ */
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