Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 104204
b: refs/heads/master
c: 82547e9
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Torokhov committed Jun 30, 2008
1 parent 6d70c0e commit dd2a821
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 819561286b8eca845ce741141a016de2b51e90c7
refs/heads/master: 82547e9074a23d9d722a5f6053f4734566127da6
27 changes: 12 additions & 15 deletions trunk/drivers/input/mouse/atarimouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,12 @@ MODULE_AUTHOR("Michael Schmitz <schmitz@biophys.uni-duesseldorf.de>");
MODULE_DESCRIPTION("Atari mouse driver");
MODULE_LICENSE("GPL");

static int mouse_threshold[2] = {2,2};
static int mouse_threshold[2] = {2, 2};
module_param_array(mouse_threshold, int, NULL, 0);

#ifdef __MODULE__
MODULE_PARM(mouse_threshold, "2i");
#endif
#ifdef FIXED_ATARI_JOYSTICK
extern int atari_mouse_buttons;
#endif
static int atamouse_used = 0;

static struct input_dev *atamouse_dev;

Expand Down Expand Up @@ -97,33 +94,31 @@ static void atamouse_interrupt(char *buf)

static int atamouse_open(struct input_dev *dev)
{
if (atamouse_used++)
return 0;

#ifdef FIXED_ATARI_JOYSTICK
atari_mouse_buttons = 0;
#endif
ikbd_mouse_y0_top();
ikbd_mouse_thresh(mouse_threshold[0], mouse_threshold[1]);
ikbd_mouse_rel_pos();
atari_input_mouse_interrupt_hook = atamouse_interrupt;

return 0;
}

static void atamouse_close(struct input_dev *dev)
{
if (!--atamouse_used) {
ikbd_mouse_disable();
atari_mouse_interrupt_hook = NULL;
}
ikbd_mouse_disable();
atari_mouse_interrupt_hook = NULL;
}

static int __init atamouse_init(void)
{
int error;

if (!MACH_IS_ATARI || !ATARIHW_PRESENT(ST_MFP))
return -ENODEV;

if (!(atari_keyb_init()))
if (!atari_keyb_init())
return -ENODEV;

atamouse_dev = input_allocate_device();
Expand All @@ -141,12 +136,14 @@ static int __init atamouse_init(void)
atamouse_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y);
atamouse_dev->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) |
BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT);

atamouse_dev->open = atamouse_open;
atamouse_dev->close = atamouse_close;

if (input_register_device(atamouse_dev)) {
error = input_register_device(atamouse_dev);
if (error) {
input_free_device(atamouse_dev);
return -ENOMEM;
return error;
}

return 0;
Expand Down

0 comments on commit dd2a821

Please sign in to comment.