linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Atari input patches
@ 2011-05-08  9:17 Geert Uytterhoeven
  2011-05-08  9:17 ` [PATCH 1/3] input/atari: Use the correct mouse interrupt hook Geert Uytterhoeven
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2011-05-08  9:17 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-m68k, linux-kernel

	Hi Dmitry,

Here are 3 patches to fix keyboard and mouse on Atari, after conversion to
the "new" (several years old) input framework.

  [1/3] input/atari: Use the correct mouse interrupt hook
  [2/3] input/atari: Fix atarimouse init
  [3/3] input/atari: Fix mouse movement and button mapping

Will you take them for 2.6.40, or can I get them in through my m68k tree?

Thanks in advance!

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] input/atari: Use the correct mouse interrupt hook
  2011-05-08  9:17 [PATCH 0/3] Atari input patches Geert Uytterhoeven
@ 2011-05-08  9:17 ` Geert Uytterhoeven
  2011-05-08  9:17 ` [PATCH 2/3] input/atari: Fix atarimouse init Geert Uytterhoeven
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2011-05-08  9:17 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, linux-m68k, linux-kernel, Michael Schmitz,
	Michael Schmitz, Geert Uytterhoeven

From: Michael Schmitz <schmitz@biophys.uni-duesseldorf.de>

The Atari keyboard driver calls atari_mouse_interrupt_hook if it's set, not
atari_input_mouse_interrupt_hook. Fix below.

[geert] Killed off atari_mouse_interrupt_hook completely, after fixing another
incorrect assignment in atarimouse.c.

Signed-off-by: Michael Schmitz <schmitz@debian.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/atari/atakeyb.c        |    7 ++-----
 arch/m68k/include/asm/atarikb.h  |    2 --
 drivers/input/mouse/atarimouse.c |    2 +-
 3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/arch/m68k/atari/atakeyb.c b/arch/m68k/atari/atakeyb.c
index db26f0e..95022b0 100644
--- a/arch/m68k/atari/atakeyb.c
+++ b/arch/m68k/atari/atakeyb.c
@@ -36,13 +36,10 @@
 
 /* Hook for MIDI serial driver */
 void (*atari_MIDI_interrupt_hook) (void);
-/* Hook for mouse driver */
-void (*atari_mouse_interrupt_hook) (char *);
 /* Hook for keyboard inputdev  driver */
 void (*atari_input_keyboard_interrupt_hook) (unsigned char, char);
 /* Hook for mouse inputdev  driver */
 void (*atari_input_mouse_interrupt_hook) (char *);
-EXPORT_SYMBOL(atari_mouse_interrupt_hook);
 EXPORT_SYMBOL(atari_input_keyboard_interrupt_hook);
 EXPORT_SYMBOL(atari_input_mouse_interrupt_hook);
 
@@ -263,8 +260,8 @@ repeat:
 			kb_state.buf[kb_state.len++] = scancode;
 			if (kb_state.len == 3) {
 				kb_state.state = KEYBOARD;
-				if (atari_mouse_interrupt_hook)
-					atari_mouse_interrupt_hook(kb_state.buf);
+				if (atari_input_mouse_interrupt_hook)
+					atari_input_mouse_interrupt_hook(kb_state.buf);
 			}
 			break;
 
diff --git a/arch/m68k/include/asm/atarikb.h b/arch/m68k/include/asm/atarikb.h
index 546e7da..68f3622 100644
--- a/arch/m68k/include/asm/atarikb.h
+++ b/arch/m68k/include/asm/atarikb.h
@@ -34,8 +34,6 @@ void ikbd_joystick_disable(void);
 
 /* Hook for MIDI serial driver */
 extern void (*atari_MIDI_interrupt_hook) (void);
-/* Hook for mouse driver */
-extern void (*atari_mouse_interrupt_hook) (char *);
 /* Hook for keyboard inputdev  driver */
 extern void (*atari_input_keyboard_interrupt_hook) (unsigned char, char);
 /* Hook for mouse inputdev  driver */
diff --git a/drivers/input/mouse/atarimouse.c b/drivers/input/mouse/atarimouse.c
index adf45b3..a57143c 100644
--- a/drivers/input/mouse/atarimouse.c
+++ b/drivers/input/mouse/atarimouse.c
@@ -108,7 +108,7 @@ static int atamouse_open(struct input_dev *dev)
 static void atamouse_close(struct input_dev *dev)
 {
 	ikbd_mouse_disable();
-	atari_mouse_interrupt_hook = NULL;
+	atari_input_mouse_interrupt_hook = NULL;
 }
 
 static int __init atamouse_init(void)
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] input/atari: Fix atarimouse init
  2011-05-08  9:17 [PATCH 0/3] Atari input patches Geert Uytterhoeven
  2011-05-08  9:17 ` [PATCH 1/3] input/atari: Use the correct mouse interrupt hook Geert Uytterhoeven
@ 2011-05-08  9:17 ` Geert Uytterhoeven
  2011-05-08  9:17 ` [PATCH 3/3] input/atari: Fix mouse movement and button mapping Geert Uytterhoeven
  2011-05-09  6:00 ` [PATCH 0/3] Atari input patches Dmitry Torokhov
  3 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2011-05-08  9:17 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, linux-m68k, linux-kernel, Michael Schmitz,
	Michael Schmitz, Geert Uytterhoeven

From: Michael Schmitz <schmitz@biophys.uni-duesseldorf.de>

Atarimouse fails to load as a module (with ENODEV), due to a brown paper
bag bug, misinterpreting the semantics of atari_keyb_init().

[geert] Propagate the return value of atari_keyb_init() everywhere

Signed-off-by: Michael Schmitz <schmitz@debian.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drivers/input/keyboard/atakbd.c  |    5 +++--
 drivers/input/mouse/atarimouse.c |    5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/atakbd.c b/drivers/input/keyboard/atakbd.c
index 1839194..10bcd4a 100644
--- a/drivers/input/keyboard/atakbd.c
+++ b/drivers/input/keyboard/atakbd.c
@@ -223,8 +223,9 @@ static int __init atakbd_init(void)
 		return -ENODEV;
 
 	// need to init core driver if not already done so
-	if (atari_keyb_init())
-		return -ENODEV;
+	error = atari_keyb_init();
+	if (error)
+		return error;
 
 	atakbd_dev = input_allocate_device();
 	if (!atakbd_dev)
diff --git a/drivers/input/mouse/atarimouse.c b/drivers/input/mouse/atarimouse.c
index a57143c..16a9d0f 100644
--- a/drivers/input/mouse/atarimouse.c
+++ b/drivers/input/mouse/atarimouse.c
@@ -118,8 +118,9 @@ static int __init atamouse_init(void)
 	if (!MACH_IS_ATARI || !ATARIHW_PRESENT(ST_MFP))
 		return -ENODEV;
 
-	if (!atari_keyb_init())
-		return -ENODEV;
+	error = atari_keyb_init();
+	if (error)
+		return error;
 
 	atamouse_dev = input_allocate_device();
 	if (!atamouse_dev)
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] input/atari: Fix mouse movement and button mapping
  2011-05-08  9:17 [PATCH 0/3] Atari input patches Geert Uytterhoeven
  2011-05-08  9:17 ` [PATCH 1/3] input/atari: Use the correct mouse interrupt hook Geert Uytterhoeven
  2011-05-08  9:17 ` [PATCH 2/3] input/atari: Fix atarimouse init Geert Uytterhoeven
@ 2011-05-08  9:17 ` Geert Uytterhoeven
  2011-05-09  6:00 ` [PATCH 0/3] Atari input patches Dmitry Torokhov
  3 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2011-05-08  9:17 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-m68k, linux-kernel, Geert Uytterhoeven

Up and down movements were reversed, left and right buttons were swapped.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drivers/input/mouse/atarimouse.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/mouse/atarimouse.c b/drivers/input/mouse/atarimouse.c
index 16a9d0f..5c4a692 100644
--- a/drivers/input/mouse/atarimouse.c
+++ b/drivers/input/mouse/atarimouse.c
@@ -77,15 +77,15 @@ static void atamouse_interrupt(char *buf)
 #endif
 
 	/* only relative events get here */
-	dx =  buf[1];
-	dy = -buf[2];
+	dx = buf[1];
+	dy = buf[2];
 
 	input_report_rel(atamouse_dev, REL_X, dx);
 	input_report_rel(atamouse_dev, REL_Y, dy);
 
-	input_report_key(atamouse_dev, BTN_LEFT,   buttons & 0x1);
+	input_report_key(atamouse_dev, BTN_LEFT,   buttons & 0x4);
 	input_report_key(atamouse_dev, BTN_MIDDLE, buttons & 0x2);
-	input_report_key(atamouse_dev, BTN_RIGHT,  buttons & 0x4);
+	input_report_key(atamouse_dev, BTN_RIGHT,  buttons & 0x1);
 
 	input_sync(atamouse_dev);
 
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/3] Atari input patches
  2011-05-08  9:17 [PATCH 0/3] Atari input patches Geert Uytterhoeven
                   ` (2 preceding siblings ...)
  2011-05-08  9:17 ` [PATCH 3/3] input/atari: Fix mouse movement and button mapping Geert Uytterhoeven
@ 2011-05-09  6:00 ` Dmitry Torokhov
  2011-05-09  7:10   ` Geert Uytterhoeven
  3 siblings, 1 reply; 6+ messages in thread
From: Dmitry Torokhov @ 2011-05-09  6:00 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-input, linux-m68k, linux-kernel

Hi Geert,

On Sun, May 08, 2011 at 11:17:24AM +0200, Geert Uytterhoeven wrote:
> 	Hi Dmitry,
> 
> Here are 3 patches to fix keyboard and mouse on Atari, after conversion to
> the "new" (several years old) input framework.
> 
>   [1/3] input/atari: Use the correct mouse interrupt hook
>   [2/3] input/atari: Fix atarimouse init
>   [3/3] input/atari: Fix mouse movement and button mapping
> 
> Will you take them for 2.6.40, or can I get them in through my m68k tree?

I can either take them or you can push them. I do not really have a
preference. There is nothing in my tree that would conflict with these
as far as I know.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/3] Atari input patches
  2011-05-09  6:00 ` [PATCH 0/3] Atari input patches Dmitry Torokhov
@ 2011-05-09  7:10   ` Geert Uytterhoeven
  0 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2011-05-09  7:10 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-m68k, linux-kernel

Hi Dmitry,

On Mon, May 9, 2011 at 08:00, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> On Sun, May 08, 2011 at 11:17:24AM +0200, Geert Uytterhoeven wrote:
>> Here are 3 patches to fix keyboard and mouse on Atari, after conversion to
>> the "new" (several years old) input framework.
>>
>>   [1/3] input/atari: Use the correct mouse interrupt hook
>>   [2/3] input/atari: Fix atarimouse init
>>   [3/3] input/atari: Fix mouse movement and button mapping
>>
>> Will you take them for 2.6.40, or can I get them in through my m68k tree?
>
> I can either take them or you can push them. I do not really have a
> preference. There is nothing in my tree that would conflict with these
> as far as I know.

In that case I'll push them myself. Thx again!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-05-09  7:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-08  9:17 [PATCH 0/3] Atari input patches Geert Uytterhoeven
2011-05-08  9:17 ` [PATCH 1/3] input/atari: Use the correct mouse interrupt hook Geert Uytterhoeven
2011-05-08  9:17 ` [PATCH 2/3] input/atari: Fix atarimouse init Geert Uytterhoeven
2011-05-08  9:17 ` [PATCH 3/3] input/atari: Fix mouse movement and button mapping Geert Uytterhoeven
2011-05-09  6:00 ` [PATCH 0/3] Atari input patches Dmitry Torokhov
2011-05-09  7:10   ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).