* Re: linux-next: boot-params tree build failure
[not found] <20081217165557.b4898a4b.sfr@canb.auug.org.au>
@ 2008-12-17 8:18 ` Geert Uytterhoeven
2008-12-21 11:12 ` [PATCH] m68k: Kill several external declarations in source files (was: Re: linux-next: boot-params tree build failure) Geert Uytterhoeven
0 siblings, 1 reply; 26+ messages in thread
From: Geert Uytterhoeven @ 2008-12-17 8:18 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: Rusty Russell, linux-next, Linux/m68k
On Wed, 17 Dec 2008, Stephen Rothwell wrote:
> The build of next-20081216 (m68k defconfig) failed like this:
>
> arch/m68k/kernel/setup.c:230: error: conflicting types for '_end'
> arch/m68k/kernel/setup.c:215: error: previous declaration of '_end' was here
>
> Caused by commit 0de5c2d9f02d2018fd671ca1015432dffa5eb338 ("param:
> arch_get_boot_command_line()") from the poot-params tree.
This is due to the existing
extern int _etext, _edata, _end;
in and the newly added
extern char _end[];
to arch/m68k/kernel/setup.c.
As these are already declared in asm-generic/sections.h (which is used by
asm-m68k/sections.h), I'll switch arch/m68k/kernel/setup.c to using them.
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] 26+ messages in thread
* [PATCH] m68k: Kill several external declarations in source files (was: Re: linux-next: boot-params tree build failure)
2008-12-17 8:18 ` linux-next: boot-params tree build failure Geert Uytterhoeven
@ 2008-12-21 11:12 ` Geert Uytterhoeven
2008-12-21 22:21 ` Rusty Russell
2008-12-28 22:00 ` [PATCH] m68k: Fix atarimouse init Michael Schmitz
0 siblings, 2 replies; 26+ messages in thread
From: Geert Uytterhoeven @ 2008-12-21 11:12 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Rusty Russell, linux-next, Linux/m68k, Linux Kernel Development
On Wed, 17 Dec 2008, Geert Uytterhoeven wrote:
> On Wed, 17 Dec 2008, Stephen Rothwell wrote:
> > The build of next-20081216 (m68k defconfig) failed like this:
> >
> > arch/m68k/kernel/setup.c:230: error: conflicting types for '_end'
> > arch/m68k/kernel/setup.c:215: error: previous declaration of '_end' was here
> >
> > Caused by commit 0de5c2d9f02d2018fd671ca1015432dffa5eb338 ("param:
> > arch_get_boot_command_line()") from the poot-params tree.
>
> This is due to the existing
>
> extern int _etext, _edata, _end;
>
> in and the newly added
>
> extern char _end[];
>
> to arch/m68k/kernel/setup.c.
>
> As these are already declared in asm-generic/sections.h (which is used by
> asm-m68k/sections.h), I'll switch arch/m68k/kernel/setup.c to using them.
Subject: [PATCH] m68k: Kill several external declarations in source files
- Replace external declarations by proper includes where availiable.
The accesses to some symbols had to be modified, as before they were
declared using e.g. "extern int _end", while asm-generic/sections.h uses
e.g. "extern char _end[]"
- Remove unused or superfluous external declarations
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
Shall I cherry pick this into my for-next branch (breaking Rusty's changes),
or wait until the current linux-next has been merged by Linus (and maybe
postpone to .30)?
arch/m68k/apollo/config.c | 4 ----
arch/m68k/atari/atakeyb.c | 1 -
arch/m68k/bvme6000/config.c | 1 -
arch/m68k/kernel/setup.c | 11 +++++------
arch/m68k/mac/config.c | 12 ------------
arch/m68k/mac/debug.c | 1 -
arch/m68k/mac/macints.c | 10 +---------
arch/m68k/mac/misc.c | 1 -
arch/m68k/mac/via.c | 2 +-
arch/m68k/math-emu/fp_log.c | 1 -
arch/m68k/mm/init.c | 4 +---
arch/m68k/mm/motorola.c | 7 +++----
arch/m68k/mvme147/config.c | 1 -
arch/m68k/mvme16x/config.c | 1 -
arch/m68k/q40/config.c | 3 ---
arch/m68k/sun3/config.c | 8 +++-----
arch/m68k/sun3/mmu_emu.c | 1 -
arch/m68k/sun3x/config.c | 1 -
18 files changed, 14 insertions(+), 56 deletions(-)
diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c
index 78df98f..cf215a0 100644
--- a/arch/m68k/apollo/config.c
+++ b/arch/m68k/apollo/config.c
@@ -31,10 +31,6 @@ extern unsigned long dn_gettimeoffset(void);
extern int dn_dummy_hwclk(int, struct rtc_time *);
extern int dn_dummy_set_clock_mmss(unsigned long);
extern void dn_dummy_reset(void);
-extern void dn_dummy_waitbut(void);
-extern struct fb_info *dn_fb_init(long *);
-extern void dn_dummy_debug_init(void);
-extern irqreturn_t dn_process_int(int irq, struct pt_regs *fp);
#ifdef CONFIG_HEARTBEAT
static void dn_heartbeat(int on);
#endif
diff --git a/arch/m68k/atari/atakeyb.c b/arch/m68k/atari/atakeyb.c
index 2c16dcb..dedfc09 100644
--- a/arch/m68k/atari/atakeyb.c
+++ b/arch/m68k/atari/atakeyb.c
@@ -33,7 +33,6 @@
#include <asm/atari_joystick.h>
#include <asm/irq.h>
-extern unsigned int keymap_count;
/* Hook for MIDI serial driver */
void (*atari_MIDI_interrupt_hook) (void);
diff --git a/arch/m68k/bvme6000/config.c b/arch/m68k/bvme6000/config.c
index c072595..9fe6fef 100644
--- a/arch/m68k/bvme6000/config.c
+++ b/arch/m68k/bvme6000/config.c
@@ -43,7 +43,6 @@ 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_reset (void);
-extern void bvme6000_waitbut(void);
void bvme6000_set_vectors (void);
/* Save tick handler routine pointer, will point to do_timer() in
diff --git a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c
index 066faec..594cbd1 100644
--- a/arch/m68k/kernel/setup.c
+++ b/arch/m68k/kernel/setup.c
@@ -26,6 +26,7 @@
#include <linux/initrd.h>
#include <asm/bootinfo.h>
+#include <asm/sections.h>
#include <asm/setup.h>
#include <asm/fpu.h>
#include <asm/irq.h>
@@ -63,7 +64,6 @@ EXPORT_SYMBOL(vme_brdtype);
int m68k_is040or060;
EXPORT_SYMBOL(m68k_is040or060);
-extern int end;
extern unsigned long availmem;
int m68k_num_memory;
@@ -216,11 +216,10 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
void __init setup_arch(char **cmdline_p)
{
- extern int _etext, _edata, _end;
int i;
/* The bootinfo is located right after the kernel bss */
- m68k_parse_bootinfo((const struct bi_record *)&_end);
+ m68k_parse_bootinfo((const struct bi_record *)_end);
if (CPU_IS_040)
m68k_is040or060 = 4;
@@ -253,9 +252,9 @@ void __init setup_arch(char **cmdline_p)
}
init_mm.start_code = PAGE_OFFSET;
- init_mm.end_code = (unsigned long) &_etext;
- init_mm.end_data = (unsigned long) &_edata;
- init_mm.brk = (unsigned long) &_end;
+ init_mm.end_code = (unsigned long)_etext;
+ init_mm.end_data = (unsigned long)_edata;
+ init_mm.brk = (unsigned long)_end;
*cmdline_p = m68k_command_line;
memcpy(boot_command_line, *cmdline_p, CL_SIZE);
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
index a7b42ac..be01798 100644
--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -52,13 +52,6 @@
struct mac_booter_data mac_bi_data;
-/* New m68k bootinfo stuff and videobase */
-
-extern int m68k_num_memory;
-extern struct mem_info m68k_memory[NUM_MEMINFO];
-
-extern struct mem_info m68k_ramdisk;
-
/* The phys. video addr. - might be bogus on some machines */
static unsigned long mac_orig_videoaddr;
@@ -66,7 +59,6 @@ static unsigned long mac_orig_videoaddr;
extern unsigned long mac_gettimeoffset(void);
extern int mac_hwclk(int, struct rtc_time *);
extern int mac_set_clock_mmss(unsigned long);
-extern int show_mac_interrupts(struct seq_file *, void *);
extern void iop_preinit(void);
extern void iop_init(void);
extern void via_init(void);
@@ -865,10 +857,6 @@ static void __init mac_identify(void)
mac_bi_data.boottime, mac_bi_data.gmtbias);
printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n",
mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
-#if 0
- printk("Ramdisk: addr 0x%lx size 0x%lx\n",
- m68k_ramdisk.addr, m68k_ramdisk.size);
-#endif
iop_init();
via_init();
diff --git a/arch/m68k/mac/debug.c b/arch/m68k/mac/debug.c
index 65dd77a..bce074c 100644
--- a/arch/m68k/mac/debug.c
+++ b/arch/m68k/mac/debug.c
@@ -27,7 +27,6 @@
#include <asm/macints.h>
extern unsigned long mac_videobase;
-extern unsigned long mac_videodepth;
extern unsigned long mac_rowbytes;
extern void mac_serial_print(const char *);
diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c
index 82e560c..7d0cbf3 100644
--- a/arch/m68k/mac/macints.c
+++ b/arch/m68k/mac/macints.c
@@ -134,6 +134,7 @@
#include <asm/errno.h>
#include <asm/macints.h>
#include <asm/irq_regs.h>
+#include <asm/mac_oss.h>
#define DEBUG_SPURIOUS
#define SHUTUP_SONIC
@@ -146,7 +147,6 @@ static int scc_mask;
* VIA/RBV hooks
*/
-extern void via_init(void);
extern void via_register_interrupts(void);
extern void via_irq_enable(int);
extern void via_irq_disable(int);
@@ -157,9 +157,6 @@ extern int via_irq_pending(int);
* OSS hooks
*/
-extern int oss_present;
-
-extern void oss_init(void);
extern void oss_register_interrupts(void);
extern void oss_irq_enable(int);
extern void oss_irq_disable(int);
@@ -170,9 +167,6 @@ extern int oss_irq_pending(int);
* PSC hooks
*/
-extern int psc_present;
-
-extern void psc_init(void);
extern void psc_register_interrupts(void);
extern void psc_irq_enable(int);
extern void psc_irq_disable(int);
@@ -191,12 +185,10 @@ extern void iop_register_interrupts(void);
extern int baboon_present;
-extern void baboon_init(void);
extern void baboon_register_interrupts(void);
extern void baboon_irq_enable(int);
extern void baboon_irq_disable(int);
extern void baboon_irq_clear(int);
-extern int baboon_irq_pending(int);
/*
* SCC interrupt routines
diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c
index a44c708..5d81856 100644
--- a/arch/m68k/mac/misc.c
+++ b/arch/m68k/mac/misc.c
@@ -35,7 +35,6 @@
#define RTC_OFFSET 2082844800
-extern struct mac_booter_data mac_bi_data;
static void (*rom_reset)(void);
#ifdef CONFIG_ADB_CUDA
diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c
index 490dcb0..796c822 100644
--- a/arch/m68k/mac/via.c
+++ b/arch/m68k/mac/via.c
@@ -34,6 +34,7 @@
#include <asm/macints.h>
#include <asm/mac_via.h>
#include <asm/mac_psc.h>
+#include <asm/mac_oss.h>
volatile __u8 *via1, *via2;
int rbv_present;
@@ -84,7 +85,6 @@ void via_irq_disable(int irq);
void via_irq_clear(int irq);
extern irqreturn_t mac_scc_dispatch(int, void *);
-extern int oss_present;
/*
* Initialize the VIAs
diff --git a/arch/m68k/math-emu/fp_log.c b/arch/m68k/math-emu/fp_log.c
index b1033ae..367ecee 100644
--- a/arch/m68k/math-emu/fp_log.c
+++ b/arch/m68k/math-emu/fp_log.c
@@ -24,7 +24,6 @@ static const struct fp_ext fp_one =
extern struct fp_ext *fp_fadd(struct fp_ext *dest, const struct fp_ext *src);
extern struct fp_ext *fp_fdiv(struct fp_ext *dest, const struct fp_ext *src);
-extern struct fp_ext *fp_fmul(struct fp_ext *dest, const struct fp_ext *src);
struct fp_ext *
fp_fsqrt(struct fp_ext *dest, struct fp_ext *src)
diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c
index 81bb08c..0007b2a 100644
--- a/arch/m68k/mm/init.c
+++ b/arch/m68k/mm/init.c
@@ -28,6 +28,7 @@
#ifdef CONFIG_ATARI
#include <asm/atari_stram.h>
#endif
+#include <asm/sections.h>
#include <asm/tlb.h>
DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
@@ -73,9 +74,6 @@ extern void init_pointer_table(unsigned long ptable);
/* References to section boundaries */
-extern char _text[], _etext[];
-extern char __init_begin[], __init_end[];
-
extern pmd_t *zero_pgtable;
void __init mem_init(void)
diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
index c5dbb9b..4665fc8 100644
--- a/arch/m68k/mm/motorola.c
+++ b/arch/m68k/mm/motorola.c
@@ -30,6 +30,7 @@
#ifdef CONFIG_ATARI
#include <asm/atari_stram.h>
#endif
+#include <asm/sections.h>
#undef DEBUG
@@ -301,14 +302,12 @@ void __init paging_init(void)
}
}
-extern char __init_begin, __init_end;
-
void free_initmem(void)
{
unsigned long addr;
- addr = (unsigned long)&__init_begin;
- for (; addr < (unsigned long)&__init_end; addr += PAGE_SIZE) {
+ addr = (unsigned long)__init_begin;
+ for (; addr < (unsigned long)__init_end; addr += PAGE_SIZE) {
virt_to_page(addr)->flags &= ~(1 << PG_reserved);
init_page_count(virt_to_page(addr));
free_page(addr);
diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c
index 43cdf47..b72f079 100644
--- a/arch/m68k/mvme147/config.c
+++ b/arch/m68k/mvme147/config.c
@@ -42,7 +42,6 @@ extern unsigned long mvme147_gettimeoffset (void);
extern int mvme147_hwclk (int, struct rtc_time *);
extern int mvme147_set_clock_mmss (unsigned long);
extern void mvme147_reset (void);
-extern void mvme147_waitbut(void);
static int bcd2int (unsigned char b);
diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c
index 84ce1d8..fbdced1 100644
--- a/arch/m68k/mvme16x/config.c
+++ b/arch/m68k/mvme16x/config.c
@@ -48,7 +48,6 @@ 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_reset (void);
-extern void mvme16x_waitbut(void);
int bcd2int (unsigned char b);
diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c
index 7110546..31ab3f0 100644
--- a/arch/m68k/q40/config.c
+++ b/arch/m68k/q40/config.c
@@ -36,7 +36,6 @@
#include <asm/machdep.h>
#include <asm/q40_master.h>
-extern irqreturn_t q40_process_int(int level, struct pt_regs *regs);
extern void q40_init_IRQ(void);
static void q40_get_model(char *model);
extern void q40_sched_init(irq_handler_t handler);
@@ -47,8 +46,6 @@ static unsigned int q40_get_ss(void);
static int q40_set_clock_mmss(unsigned long);
static int q40_get_rtc_pll(struct rtc_pll_info *pll);
static int q40_set_rtc_pll(struct rtc_pll_info *pll);
-extern void q40_waitbut(void);
-void q40_set_vectors(void);
extern void q40_mksound(unsigned int /*freq*/, unsigned int /*ticks*/);
diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c
index 8dfaa20..2ca25bd 100644
--- a/arch/m68k/sun3/config.c
+++ b/arch/m68k/sun3/config.c
@@ -27,23 +27,21 @@
#include <asm/sun3mmu.h>
#include <asm/rtc.h>
#include <asm/machdep.h>
+#include <asm/idprom.h>
#include <asm/intersil.h>
#include <asm/irq.h>
+#include <asm/sections.h>
#include <asm/segment.h>
#include <asm/sun3ints.h>
-extern char _text, _end;
-
char sun3_reserved_pmeg[SUN3_PMEGS_NUM];
extern unsigned long sun3_gettimeoffset(void);
static void sun3_sched_init(irq_handler_t handler);
extern void sun3_get_model (char* model);
-extern void idprom_init (void);
extern int sun3_hwclk(int set, struct rtc_time *t);
volatile char* clock_va;
-extern volatile unsigned char* sun3_intreg;
extern unsigned long availmem;
unsigned long num_pages;
@@ -149,7 +147,7 @@ void __init config_sun3(void)
mach_halt = sun3_halt;
mach_get_hardware_list = sun3_get_hardware_list;
- memory_start = ((((int)&_end) + 0x2000) & ~0x1fff);
+ memory_start = ((((unsigned long)_end) + 0x2000) & ~0x1fff);
// PROM seems to want the last couple of physical pages. --m
memory_end = *(romvec->pv_sun3mem) + PAGE_OFFSET - 2*PAGE_SIZE;
diff --git a/arch/m68k/sun3/mmu_emu.c b/arch/m68k/sun3/mmu_emu.c
index 60f9d45..3cd1939 100644
--- a/arch/m68k/sun3/mmu_emu.c
+++ b/arch/m68k/sun3/mmu_emu.c
@@ -27,7 +27,6 @@
#include <asm/mmu_context.h>
#include <asm/dvma.h>
-extern void prom_reboot (char *) __attribute__ ((__noreturn__));
#undef DEBUG_MMU_EMU
#define DEBUG_PROM_MAPS
diff --git a/arch/m68k/sun3x/config.c b/arch/m68k/sun3x/config.c
index 2b1ca2d..fc599fa 100644
--- a/arch/m68k/sun3x/config.c
+++ b/arch/m68k/sun3x/config.c
@@ -23,7 +23,6 @@
#include "time.h"
volatile char *clock_va;
-extern volatile unsigned char *sun3_intreg;
extern void sun3_get_model(char *model);
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 related [flat|nested] 26+ messages in thread
* Re: [PATCH] m68k: Kill several external declarations in source files (was: Re: linux-next: boot-params tree build failure)
2008-12-21 11:12 ` [PATCH] m68k: Kill several external declarations in source files (was: Re: linux-next: boot-params tree build failure) Geert Uytterhoeven
@ 2008-12-21 22:21 ` Rusty Russell
2008-12-22 7:30 ` Geert Uytterhoeven
2008-12-28 22:00 ` [PATCH] m68k: Fix atarimouse init Michael Schmitz
1 sibling, 1 reply; 26+ messages in thread
From: Rusty Russell @ 2008-12-21 22:21 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Stephen Rothwell, linux-next, Linux/m68k,
Linux Kernel Development
On Sunday 21 December 2008 21:42:44 Geert Uytterhoeven wrote:
> Shall I cherry pick this into my for-next branch (breaking Rusty's changes),
> or wait until the current linux-next has been merged by Linus (and maybe
> postpone to .30)?
Good q. I can take the just setup.c changes and roll them into the
boot-params tree if you want?
ie. something like:
Subject: m68k: Use asm/sections.h in kernel/setup.c
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/kernel/setup.c | 11 +++++------
diff --git a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c
index 066faec..594cbd1 100644
--- a/arch/m68k/kernel/setup.c
+++ b/arch/m68k/kernel/setup.c
@@ -26,6 +26,7 @@
#include <linux/initrd.h>
#include <asm/bootinfo.h>
+#include <asm/sections.h>
#include <asm/setup.h>
#include <asm/fpu.h>
#include <asm/irq.h>
@@ -63,7 +64,6 @@ EXPORT_SYMBOL(vme_brdtype);
int m68k_is040or060;
EXPORT_SYMBOL(m68k_is040or060);
-extern int end;
extern unsigned long availmem;
int m68k_num_memory;
@@ -216,11 +216,10 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
void __init setup_arch(char **cmdline_p)
{
- extern int _etext, _edata, _end;
int i;
/* The bootinfo is located right after the kernel bss */
- m68k_parse_bootinfo((const struct bi_record *)&_end);
+ m68k_parse_bootinfo((const struct bi_record *)_end);
if (CPU_IS_040)
m68k_is040or060 = 4;
@@ -253,9 +252,9 @@ void __init setup_arch(char **cmdline_p)
}
init_mm.start_code = PAGE_OFFSET;
- init_mm.end_code = (unsigned long) &_etext;
- init_mm.end_data = (unsigned long) &_edata;
- init_mm.brk = (unsigned long) &_end;
+ init_mm.end_code = (unsigned long)_etext;
+ init_mm.end_data = (unsigned long)_edata;
+ init_mm.brk = (unsigned long)_end;
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH] m68k: Kill several external declarations in source files (was: Re: linux-next: boot-params tree build failure)
2008-12-21 22:21 ` Rusty Russell
@ 2008-12-22 7:30 ` Geert Uytterhoeven
0 siblings, 0 replies; 26+ messages in thread
From: Geert Uytterhoeven @ 2008-12-22 7:30 UTC (permalink / raw)
To: Rusty Russell
Cc: Stephen Rothwell, linux-next, Linux/m68k,
Linux Kernel Development
On Mon, 22 Dec 2008, Rusty Russell wrote:
> On Sunday 21 December 2008 21:42:44 Geert Uytterhoeven wrote:
> > Shall I cherry pick this into my for-next branch (breaking Rusty's changes),
> > or wait until the current linux-next has been merged by Linus (and maybe
> > postpone to .30)?
>
> Good q. I can take the just setup.c changes and roll them into the
> boot-params tree if you want?
Fine for me! Thx!
> ie. something like:
>
> Subject: m68k: Use asm/sections.h in kernel/setup.c
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] 26+ messages in thread
* [PATCH] m68k: Fix atarimouse init
2008-12-21 11:12 ` [PATCH] m68k: Kill several external declarations in source files (was: Re: linux-next: boot-params tree build failure) Geert Uytterhoeven
2008-12-21 22:21 ` Rusty Russell
@ 2008-12-28 22:00 ` Michael Schmitz
2008-12-29 10:57 ` Geert Uytterhoeven
1 sibling, 1 reply; 26+ messages in thread
From: Michael Schmitz @ 2008-12-28 22:00 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Linux/m68k
Hi,
following up on Geert's report that atarimouse does fail to load as a module
(with ENODEV), here's the fix.
Brown paper bag, well and truely. Got the semantics of the atari_keyb_init
return reversed (not that atari_keyb_init ever returns anything but success, but
that's for another day).
I still get no mouse events in either /dev/input/mice or .../mouse0, though. I
suspect the mouse open hook never gets called. Same bug might affect amimouse
(though the open function does do the full hardware setup there).
Michael
drivers/input/mouse/atarimouse.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/input/mouse/atarimouse.c b/drivers/input/mouse/atarimouse.c
index a57143c..1b5f4dd 100644
--- a/drivers/input/mouse/atarimouse.c
+++ b/drivers/input/mouse/atarimouse.c
@@ -118,7 +118,7 @@ static int __init atamouse_init(void)
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();
Signed-off-by: Michael Schmitz <schmitz@debian.org>
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH] m68k: Fix atarimouse init
2008-12-28 22:00 ` [PATCH] m68k: Fix atarimouse init Michael Schmitz
@ 2008-12-29 10:57 ` Geert Uytterhoeven
2008-12-30 9:18 ` Petr Stehlik
2009-01-02 0:12 ` Michael Schmitz
0 siblings, 2 replies; 26+ messages in thread
From: Geert Uytterhoeven @ 2008-12-29 10:57 UTC (permalink / raw)
To: Michael Schmitz; +Cc: Linux/m68k
On Sun, 28 Dec 2008, Michael Schmitz wrote:
> following up on Geert's report that atarimouse does fail to load as a module
> (with ENODEV), here's the fix.
>
> Brown paper bag, well and truely. Got the semantics of the atari_keyb_init
> return reversed (not that atari_keyb_init ever returns anything but success, but
> that's for another day).
>
> I still get no mouse events in either /dev/input/mice or .../mouse0, though. I
> suspect the mouse open hook never gets called. Same bug might affect amimouse
> (though the open function does do the full hardware setup there).
Thanks, we're making progress :-)
I get events from /dev/input/mouse0 and /dev/input/mice (atari_defconfig).
The kernel says (ARAnyM, windowed mode):
| input: Atari mouse as /devices/virtual/input/input1
| Reseting weird mouse packet: 942, 379, 0
| Reseting weird mouse packet: 943, 379, 0
| Reseting weird mouse packet: 945, 378, 0
| Reseting weird mouse packet: 948, 378, 0
| Reseting weird mouse packet: 956, 376, 0
When running X under ARAnyM (depth 16), some shortcomings show up:
- up and down are interchanged (works fine when rolling the mouse over the
bottom surface of the table --- old arabic map style ;-)
- the left and right mouse button are interchanged
- the middle mouse button is dead
Please put a `---' here, so `git am' will strip the signature and the diffstat.
> Michael
>
> drivers/input/mouse/atarimouse.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/input/mouse/atarimouse.c b/drivers/input/mouse/atarimouse.c
> index a57143c..1b5f4dd 100644
> --- a/drivers/input/mouse/atarimouse.c
> +++ b/drivers/input/mouse/atarimouse.c
> @@ -118,7 +118,7 @@ static int __init atamouse_init(void)
> 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();
>
> Signed-off-by: Michael Schmitz <schmitz@debian.org>
Please put the SoB just below the changelog, else `git am' will strip it off.
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] 26+ messages in thread
* Re: [PATCH] m68k: Fix atarimouse init
2008-12-29 10:57 ` Geert Uytterhoeven
@ 2008-12-30 9:18 ` Petr Stehlik
2009-01-02 0:27 ` Michael Schmitz
2009-01-02 0:12 ` Michael Schmitz
1 sibling, 1 reply; 26+ messages in thread
From: Petr Stehlik @ 2008-12-30 9:18 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Michael Schmitz, Linux/m68k
Geert Uytterhoeven píše v Po 29. 12. 2008 v 11:57 +0100:
> I get events from /dev/input/mouse0 and /dev/input/mice (atari_defconfig).
>
> When running X under ARAnyM (depth 16), some shortcomings show up:
> - the middle mouse button is dead
BTW, ARAnyM implements a mouse extension for the wheels that is
compatible with an existing hardware modification (or an add-on).
Sometime later we could implement its support in linux to get true
middle mouse button and its wheels.
Petr
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" 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] 26+ messages in thread
* Re: [PATCH] m68k: Fix atarimouse init
2008-12-29 10:57 ` Geert Uytterhoeven
2008-12-30 9:18 ` Petr Stehlik
@ 2009-01-02 0:12 ` Michael Schmitz
2009-01-02 9:42 ` Andreas Schwab
1 sibling, 1 reply; 26+ messages in thread
From: Michael Schmitz @ 2009-01-02 0:12 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Linux/m68k
Hi Geert,
> > I still get no mouse events in either /dev/input/mice or .../mouse0, though. I
> > suspect the mouse open hook never gets called. Same bug might affect amimouse
> > (though the open function does do the full hardware setup there).
>
> Thanks, we're making progress :-)
Sort of ...
> I get events from /dev/input/mouse0 and /dev/input/mice (atari_defconfig).
>
> The kernel says (ARAnyM, windowed mode):
> | input: Atari mouse as /devices/virtual/input/input1
> | Reseting weird mouse packet: 942, 379, 0
> | Reseting weird mouse packet: 943, 379, 0
> | Reseting weird mouse packet: 945, 378, 0
> | Reseting weird mouse packet: 948, 378, 0
> | Reseting weird mouse packet: 956, 376, 0
That's the broken packets - the real ones shoule be fine (small x and y
increments in byte 1 and 2, 0x8 in byte 0 unless button pressed).
>
> When running X under ARAnyM (depth 16), some shortcomings show up:
> - up and down are interchanged (works fine when rolling the mouse over the
> bottom surface of the table --- old arabic map style ;-)
Weird - the inversion of the y direction increment is taken from the old
busmouse driver code where it used to work OK. The point of reference is set to
be at the top of the 'screen' so moving the mouse down ought to generate
positive increments. I'll test that. If the point of reference changed between
busmouse and generic input mouse, just drop the sign inversion on buf[2].
> - the left and right mouse button are interchanged
The busmouse driver had no annotation as to the semantics of the buttons so O
guessed bit 0 was for the left button. Guessed wrong, it seems.
> - the middle mouse button is dead
As is expexcted - the original code was for a two-button mouse only. If Petr
knows what the ikbd format for the third button is (on real hardware) it's easy
to add that in. WAG: bit three of the first byte, so make
buttons = (buf[0] & 1) | ((buf[0] & 2) << 1);
into
buttons = ((buf[0] & 1) << 2) | ((buf[0] & 2) >> 1) | ((buf[0] & 4) >> 1) ;
and give it a whirl!
>
> Please put a `---' here, so `git am' will strip the signature and the diffstat.
OK, noted.
> > Signed-off-by: Michael Schmitz <schmitz@debian.org>
>
> Please put the SoB just below the changelog, else `git am' will strip it off.
OK; I'll stick that into my commit message and try to get that into the diff.
Cheers,
Michael
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH] m68k: Fix atarimouse init
2008-12-30 9:18 ` Petr Stehlik
@ 2009-01-02 0:27 ` Michael Schmitz
0 siblings, 0 replies; 26+ messages in thread
From: Michael Schmitz @ 2009-01-02 0:27 UTC (permalink / raw)
To: Petr Stehlik; +Cc: Geert Uytterhoeven, Linux/m68k
Hi Petr,
> > I get events from /dev/input/mouse0 and /dev/input/mice (atari_defconfig).
> >
> > When running X under ARAnyM (depth 16), some shortcomings show up:
> > - the middle mouse button is dead
>
> BTW, ARAnyM implements a mouse extension for the wheels that is
> compatible with an existing hardware modification (or an add-on).
> Sometime later we could implement its support in linux to get true
> middle mouse button and its wheels.
So what would the middle button and wheel events be reported at?
Michael
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH] m68k: Fix atarimouse init
2009-01-02 0:12 ` Michael Schmitz
@ 2009-01-02 9:42 ` Andreas Schwab
2009-01-02 10:20 ` Petr Stehlik
2009-01-02 22:10 ` Michael Schmitz
0 siblings, 2 replies; 26+ messages in thread
From: Andreas Schwab @ 2009-01-02 9:42 UTC (permalink / raw)
To: Michael Schmitz; +Cc: Geert Uytterhoeven, Linux/m68k
Michael Schmitz <schmitz@biophys.uni-duesseldorf.de> writes:
> Hi Geert,
>
>> The kernel says (ARAnyM, windowed mode):
>> | Reseting weird mouse packet: 942, 379, 0
>> | Reseting weird mouse packet: 943, 379, 0
>> | Reseting weird mouse packet: 945, 378, 0
>> | Reseting weird mouse packet: 948, 378, 0
>> | Reseting weird mouse packet: 956, 376, 0
These messages come from ARAnyM.
>>
>> When running X under ARAnyM (depth 16), some shortcomings show up:
>> - up and down are interchanged (works fine when rolling the mouse over the
>> bottom surface of the table --- old arabic map style ;-)
>
> Weird - the inversion of the y direction increment is taken from the old
> busmouse driver code where it used to work OK. The point of reference is set to
> be at the top of the 'screen' so moving the mouse down ought to generate
> positive increments.
ARAnyM's emulation of the IKBD does not support changing the y origin.
>> - the left and right mouse button are interchanged
>
> The busmouse driver had no annotation as to the semantics of the buttons so O
> guessed bit 0 was for the left button. Guessed wrong, it seems.
Note that the mouse button bits are also inverted, ie. 0 means down.
>> - the middle mouse button is dead
>
> As is expexcted - the original code was for a two-button mouse only. If Petr
> knows what the ikbd format for the third button is (on real hardware) it's easy
> to add that in.
The IKBD does not support more than two buttons. For a three button
mouse the middle button was apparently wired to the joystick port.
See also <http://dev-docs.atariforge.org/files/ikbd_Prot_2-26-1985.pdf>.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" 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] 26+ messages in thread
* Re: [PATCH] m68k: Fix atarimouse init
2009-01-02 9:42 ` Andreas Schwab
@ 2009-01-02 10:20 ` Petr Stehlik
2009-01-02 22:10 ` Michael Schmitz
1 sibling, 0 replies; 26+ messages in thread
From: Petr Stehlik @ 2009-01-02 10:20 UTC (permalink / raw)
To: Andreas Schwab; +Cc: Michael Schmitz, Geert Uytterhoeven, Linux/m68k
Andreas Schwab píše v Pá 02. 01. 2009 v 10:42 +0100:
> > Hi Geert,
> >
> >> The kernel says (ARAnyM, windowed mode):
> >> | Reseting weird mouse packet: 942, 379, 0
> >> | Reseting weird mouse packet: 943, 379, 0
> >> | Reseting weird mouse packet: 945, 378, 0
> >> | Reseting weird mouse packet: 948, 378, 0
> >> | Reseting weird mouse packet: 956, 376, 0
>
> These messages come from ARAnyM.
..and indicates that something wrong is going on. Normally there is only
one such message when entering the ARAnyM window.
> ARAnyM's emulation of the IKBD does not support changing the y origin.
will add it there.
> >> - the middle mouse button is dead
> >
> > As is expexcted - the original code was for a two-button mouse only. If Petr
> > knows what the ikbd format for the third button is (on real hardware) it's easy
> > to add that in.
>
> The IKBD does not support more than two buttons. For a three button
> mouse the middle button was apparently wired to the joystick port.
Yes, that was an old Linux-m68k extension.
What I meant by hardware supporting the mouse wheels was Eiffel:
http://pagesperso-orange.fr/didierm/eiffel-e.htm
In about 3/4 of the long page there is a table labelled "Mouse elements"
that shows the mouse wheels and buttons scan codes. ARAnyM supports the
wheels (not sure about the buttons 3,4,5 - will check and add it there
eventually).
Petr
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" 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] 26+ messages in thread
* Re: [PATCH] m68k: Fix atarimouse init
2009-01-02 9:42 ` Andreas Schwab
2009-01-02 10:20 ` Petr Stehlik
@ 2009-01-02 22:10 ` Michael Schmitz
2009-01-03 5:53 ` Petr Stehlik
1 sibling, 1 reply; 26+ messages in thread
From: Michael Schmitz @ 2009-01-02 22:10 UTC (permalink / raw)
To: Andreas Schwab; +Cc: Geert Uytterhoeven, Linux/m68k
Hi Andreas,
> > Weird - the inversion of the y direction increment is taken from the old
> > busmouse driver code where it used to work OK. The point of reference is set to
> > be at the top of the 'screen' so moving the mouse down ought to generate
> > positive increments.
>
> ARAnyM's emulation of the IKBD does not support changing the y origin.
Bummer - any reason the origin was set to the top initially? I guess we could
reverse that (at least for ARAnyM). Would make the rest of the code more sane as
well. How would I go about figuring out the kernel runs on ARAnyM, Petr?
> >> - the left and right mouse button are interchanged
> >
> > The busmouse driver had no annotation as to the semantics of the buttons so O
> > guessed bit 0 was for the left button. Guessed wrong, it seems.
>
> Note that the mouse button bits are also inverted, ie. 0 means down.
You're right. I'd been wondering about that part in the old mouse driver...
> > knows what the ikbd format for the third button is (on real hardware) it's easy
> > to add that in.
>
> The IKBD does not support more than two buttons. For a three button
> mouse the middle button was apparently wired to the joystick port.
>
> See also <http://dev-docs.atariforge.org/files/ikbd_Prot_2-26-1985.pdf>.
Thanks, Andreas. Seems I'll have to revive the old joystick code, then.
Cheers,
Michael
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH] m68k: Fix atarimouse init
2009-01-02 22:10 ` Michael Schmitz
@ 2009-01-03 5:53 ` Petr Stehlik
2009-01-03 6:15 ` Petr Stehlik
2009-01-03 7:23 ` Michael Schmitz
0 siblings, 2 replies; 26+ messages in thread
From: Petr Stehlik @ 2009-01-03 5:53 UTC (permalink / raw)
To: Michael Schmitz; +Cc: Andreas Schwab, Geert Uytterhoeven, Linux/m68k
Michael Schmitz píše v Pá 02. 01. 2009 v 23:10 +0100:
> > > Weird - the inversion of the y direction increment is taken from the old
> > > busmouse driver code where it used to work OK. The point of reference is set to
> > > be at the top of the 'screen' so moving the mouse down ought to generate
> > > positive increments.
> >
> > ARAnyM's emulation of the IKBD does not support changing the y origin.
>
> Bummer - any reason the origin was set to the top initially?
Isn't it sane to have the origin at top so the mouse increments are
logically in sync with video coordinates?
I mean I am not sure what's wrong in this chain but I have just tested
ARAnyM to ensure that moving the mouse down on the screen generates
positive y-axis increments.
> I guess we could reverse that (at least for ARAnyM).
I am against changing generic Atari related things just for ARAnyM. I
said earlier (about 12 hours before you posted this mail) that I would
fix anything in ARAnyM to make it more linux-m68k compatible.
I am just not sure what's wrong here - does the linux-m68k indeed
switches the point of origin to bottom of screen and relies on that? Why
if you say that the old busmouse code used the "normal" top-screen
origin?
> How would I go about figuring out the kernel runs on ARAnyM, Petr?
Using the NatFeats, of course. But see above - I am against such hacks
and I'll add the code for reversing Y-axis real quick if its really
necessary.
> > > knows what the ikbd format for the third button is (on real hardware) it's easy
> > > to add that in.
> >
> > The IKBD does not support more than two buttons. For a three button
> > mouse the middle button was apparently wired to the joystick port.
> >
> > See also <http://dev-docs.atariforge.org/files/ikbd_Prot_2-26-1985.pdf>.
>
> Thanks, Andreas. Seems I'll have to revive the old joystick code, then.
Michael, I don't think there is anybody out there using such hardware
joystick-mouse modification. But there is number of people using the
Eiffel PS/2 adapter so if supporting anything then I'd go for that.
BTW, is it just my feeling that you kind of didn't take my mail
(Thursday 11:20) into account when replying to Andreas?
Petr
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" 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] 26+ messages in thread
* Re: [PATCH] m68k: Fix atarimouse init
2009-01-03 5:53 ` Petr Stehlik
@ 2009-01-03 6:15 ` Petr Stehlik
2009-01-03 7:23 ` Michael Schmitz
1 sibling, 0 replies; 26+ messages in thread
From: Petr Stehlik @ 2009-01-03 6:15 UTC (permalink / raw)
To: Michael Schmitz; +Cc: Andreas Schwab, Geert Uytterhoeven, Linux/m68k
Petr Stehlik píše v So 03. 01. 2009 v 06:53 +0100:
> Michael Schmitz píše v Pá 02. 01. 2009 v 23:10 +0100:
> > > > Weird - the inversion of the y direction increment is taken from the old
> > > > busmouse driver code where it used to work OK. The point of reference is set to
> > > > be at the top of the 'screen' so moving the mouse down ought to generate
> > > > positive increments.
> > >
> > > ARAnyM's emulation of the IKBD does not support changing the y origin.
> >
> > Bummer - any reason the origin was set to the top initially?
>
> Isn't it sane to have the origin at top so the mouse increments are
> logically in sync with video coordinates?
BTW, I have just noticed that "origin at top = lower left of screen". I
was thinking that top would be upper left of screen. Sorry. Anyway, I am
just adding the 0x0f/0x10 IKBD opcodes support to ARAnyM.
Petr
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" 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] 26+ messages in thread
* Re: [PATCH] m68k: Fix atarimouse init
2009-01-03 5:53 ` Petr Stehlik
2009-01-03 6:15 ` Petr Stehlik
@ 2009-01-03 7:23 ` Michael Schmitz
2009-01-03 8:16 ` Petr Stehlik
2009-01-03 8:45 ` [PATCH] m68k: Fix atarimouse init Andreas Schwab
1 sibling, 2 replies; 26+ messages in thread
From: Michael Schmitz @ 2009-01-03 7:23 UTC (permalink / raw)
To: Petr Stehlik; +Cc: Andreas Schwab, Geert Uytterhoeven, Linux/m68k
Hi,
> > > ARAnyM's emulation of the IKBD does not support changing the y origin.
> >
> > Bummer - any reason the origin was set to the top initially?
>
> Isn't it sane to have the origin at top so the mouse increments are
> logically in sync with video coordinates?
That may have been the reason, perhaps before the mouse driver was written to
the busmouse interface (not sure I have kernel sources dating that far back).
> > I guess we could reverse that (at least for ARAnyM).
>
> I am against changing generic Atari related things just for ARAnyM. I
> said earlier (about 12 hours before you posted this mail) that I would
> fix anything in ARAnyM to make it more linux-m68k compatible.
Yep, I do recall that - my intention was to reverse the logic in order to give
Geert (and myself) something to test while you add the necessary bits to ARAnyM.
Such a hack would definitely be removed as soon as possible.
> I am just not sure what's wrong here - does the linux-m68k indeed
> switches the point of origin to bottom of screen and relies on that? Why
> if you say that the old busmouse code used the "normal" top-screen
> origin?
The original (and current) mouse driver explicitly set the top screen origin -
either at keyboard init (old) or at mouse device open (now). I do assume that is
not the default, power-up state of the hardware.
> > How would I go about figuring out the kernel runs on ARAnyM, Petr?
>
> Using the NatFeats, of course. But see above - I am against such hacks
> and I'll add the code for reversing Y-axis real quick if its really
> necessary.
Point taken - I'll not complexify things further by attempting to detect ARAnyM
at runtime, then. I have a patch that should work on both current ARAnyM and
real hardware for Geert to test, and the hack is easily removed later on.
> > Thanks, Andreas. Seems I'll have to revive the old joystick code, then.
>
> Michael, I don't think there is anybody out there using such hardware
> joystick-mouse modification. But there is number of people using the
> Eiffel PS/2 adapter so if supporting anything then I'd go for that.
How does that one work?
The only reason for reviving the joystick hack would have been to have a
'standard' way of passing a third mouse button. If the PS/2 adapter is that
standard way now, that's fine. I'll just need to know what interrupt/device this
is hooked up to, and what the data format is.
> BTW, is it just my feeling that you kind of didn't take my mail
> (Thursday 11:20) into account when replying to Andreas?
I was mainly looking for a quick way to accomodate current ARAnyM users like
Geert and me while a fix is being worked on. I did read your mail, and take
notice of your offer to incorporate a fix for ARAnyM, even though I did not
refer to your mail in my reply.
I'd still have to get a working X server before testing any of this, so it
probably won't matter either way.
Michael
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH] m68k: Fix atarimouse init
2009-01-03 7:23 ` Michael Schmitz
@ 2009-01-03 8:16 ` Petr Stehlik
2009-01-04 3:12 ` Michael Schmitz
2009-01-04 7:15 ` [PATCH] m68k: Add Eiffel PS/2 support for Atari mouse driver Michael Schmitz
2009-01-03 8:45 ` [PATCH] m68k: Fix atarimouse init Andreas Schwab
1 sibling, 2 replies; 26+ messages in thread
From: Petr Stehlik @ 2009-01-03 8:16 UTC (permalink / raw)
To: Michael Schmitz; +Cc: Andreas Schwab, Geert Uytterhoeven, Linux/m68k
Michael Schmitz píše v So 03. 01. 2009 v 08:23 +0100:
> Yep, I do recall that - my intention was to reverse the logic in order to give
> Geert (and myself) something to test while you add the necessary bits to ARAnyM.
I have added it already. Can you use CVS version of ARAnyM?
> The original (and current) mouse driver explicitly set the top screen origin -
> either at keyboard init (old) or at mouse device open (now). I do assume that is
> not the default, power-up state of the hardware.
I have added the 0x0f, 0x10 IKBD opcodes emulation to ARAnyM but I don't
see how that could help if linux-m68k sets the upper left screen as the
mouse origin (I am trying to avoid the "top"/"bottom" words as they are
implemented differently in the IKBD than in my head).
Anyway, just give it a try, please, and let me know.
> > Michael, I don't think there is anybody out there using such hardware
> > joystick-mouse modification. But there is number of people using the
> > Eiffel PS/2 adapter so if supporting anything then I'd go for that.
>
> How does that one work?
http://hardware.atari.org/eiffel/index.htm
http://hardware.atari.org/photos/eiffel.jpg
You can attach any PS/2 mouse and keyboard to Atari.
> The only reason for reviving the joystick hack would have been to have a
> 'standard' way of passing a third mouse button. If the PS/2 adapter is that
> standard way now, that's fine. I'll just need to know what interrupt/device this
> is hooked up to, and what the data format is.
It just adds new scancodes - I have provided a link to the scan codes
table in one of my previous mails.
The middle mouse button is mapped to scancode 0x37 (IIRC) while the
mouse wheels are provided in IKBD status packet.
Or check this:
http://www.sophics.cz/cgi-bin/viewvc.cgi/aranym/src/input.cpp?view=markup
search for SDL_BUTTON_MIDDLE and SDL_BUTTON_WHEELUP/WHEELDOWN.
Petr
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" 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] 26+ messages in thread
* Re: [PATCH] m68k: Fix atarimouse init
2009-01-03 7:23 ` Michael Schmitz
2009-01-03 8:16 ` Petr Stehlik
@ 2009-01-03 8:45 ` Andreas Schwab
2009-01-04 2:05 ` Michael Schmitz
1 sibling, 1 reply; 26+ messages in thread
From: Andreas Schwab @ 2009-01-03 8:45 UTC (permalink / raw)
To: Michael Schmitz; +Cc: Petr Stehlik, Geert Uytterhoeven, Linux/m68k
Michael Schmitz <schmitz@biophys.uni-duesseldorf.de> writes:
> That may have been the reason, perhaps before the mouse driver was written to
> the busmouse interface (not sure I have kernel sources dating that far back).
You can get historical sources from
<git://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git>. Tag
v2.5.41 is the last one containing the old atarimouse driver.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" 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] 26+ messages in thread
* Re: [PATCH] m68k: Fix atarimouse init
2009-01-03 8:45 ` [PATCH] m68k: Fix atarimouse init Andreas Schwab
@ 2009-01-04 2:05 ` Michael Schmitz
0 siblings, 0 replies; 26+ messages in thread
From: Michael Schmitz @ 2009-01-04 2:05 UTC (permalink / raw)
To: Andreas Schwab; +Cc: Petr Stehlik, Geert Uytterhoeven, Linux/m68k
Hi Andreas,
> > That may have been the reason, perhaps before the mouse driver was written to
> > the busmouse interface (not sure I have kernel sources dating that far back).
>
> You can get historical sources from
> <git://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git>. Tag
> v2.5.41 is the last one containing the old atarimouse driver.
If that's been the same as on the 0.9 series, I already have that (in 2.4.30).
Thanks, that information helps me quite a bit aLready.
Michael
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH] m68k: Fix atarimouse init
2009-01-03 8:16 ` Petr Stehlik
@ 2009-01-04 3:12 ` Michael Schmitz
2009-01-04 7:34 ` Petr Stehlik
2009-01-04 7:15 ` [PATCH] m68k: Add Eiffel PS/2 support for Atari mouse driver Michael Schmitz
1 sibling, 1 reply; 26+ messages in thread
From: Michael Schmitz @ 2009-01-04 3:12 UTC (permalink / raw)
To: Petr Stehlik; +Cc: Andreas Schwab, Geert Uytterhoeven, Linux/m68k
Hi Petr,
> > Geert (and myself) something to test while you add the necessary bits to ARAnyM.
>
> I have added it already. Can you use CVS version of ARAnyM?
I've not tried to compile ARAnyM myself in a while, rather installed the latest
Debian package as it becomes available.
> I have added the 0x0f, 0x10 IKBD opcodes emulation to ARAnyM but I don't
> see how that could help if linux-m68k sets the upper left screen as the
> mouse origin (I am trying to avoid the "top"/"bottom" words as they are
> implemented differently in the IKBD than in my head).
>
> Anyway, just give it a try, please, and let me know.
Will do -
> > > Michael, I don't think there is anybody out there using such hardware
> > > joystick-mouse modification. But there is number of people using the
> > > Eiffel PS/2 adapter so if supporting anything then I'd go for that.
> >
> > How does that one work?
>
> http://hardware.atari.org/eiffel/index.htm
> http://hardware.atari.org/photos/eiffel.jpg
>
> You can attach any PS/2 mouse and keyboard to Atari.
Seems like this hooks up to the standard keyboard connector so it should behave
the same as the regular keyboard/mouse. Good.
> > The only reason for reviving the joystick hack would have been to have a
> > 'standard' way of passing a third mouse button. If the PS/2 adapter is that
> > standard way now, that's fine. I'll just need to know what interrupt/device this
> > is hooked up to, and what the data format is.
>
> It just adds new scancodes - I have provided a link to the scan codes
> table in one of my previous mails.
Sorry, I must have missed that.
> The middle mouse button is mapped to scancode 0x37 (IIRC) while the
> mouse wheels are provided in IKBD status packet.
>
> Or check this:
> http://www.sophics.cz/cgi-bin/viewvc.cgi/aranym/src/input.cpp?view=markup
> search for SDL_BUTTON_MIDDLE and SDL_BUTTON_WHEELUP/WHEELDOWN.
Thanks, that does in fact explain it in sufficient detail. I'll try to add that
to the core keyboard driver, and synthesize the appropriate mouse packets.
Michael
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH] m68k: Add Eiffel PS/2 support for Atari mouse driver
2009-01-03 8:16 ` Petr Stehlik
2009-01-04 3:12 ` Michael Schmitz
@ 2009-01-04 7:15 ` Michael Schmitz
2009-01-04 7:41 ` Petr Stehlik
2009-01-05 1:32 ` [PATCH] m68k: Add Eiffel PS/2 support for Atari mouse driver (updated) Michael Schmitz
1 sibling, 2 replies; 26+ messages in thread
From: Michael Schmitz @ 2009-01-04 7:15 UTC (permalink / raw)
To: Petr Stehlik; +Cc: Geert Uytterhoeven, Linux/m68k
Hi Petr, Geert,
> > The only reason for reviving the joystick hack would have been to have a
> > 'standard' way of passing a third mouse button. If the PS/2 adapter is that
> > standard way now, that's fine. I'll just need to know what interrupt/device this
> > is hooked up to, and what the data format is.
>
> It just adds new scancodes - I have provided a link to the scan codes
> table in one of my previous mails.
>
> The middle mouse button is mapped to scancode 0x37 (IIRC) while the
> mouse wheels are provided in IKBD status packet.
I've written the first part of the Eiffel PS/2 mouse support, adding middle
mouse button support based on the scancode you specified. Implementing the
middle mouse button as a toggle is a bit awkward :-( It's basically what the
joystick middle mouse button code did, so it should hopefully work. Comments
welcome.
I've not tested the code beyond making sure the two regular buttons still work -
I do not quite see how to activate Eiffel mouse support in ARAnyM. Maybe I'll
hijack another scancode for the tests.
Adding the wheel events looks quite straightforward; I'll get to that later.
Signed-off-by: Michael Schmitz <schmitz@debian.org>
---
arch/m68k/atari/atakeyb.c | 27 ++++++++++++++++++++++-
drivers/input/mouse/atarimouse.c | 44 +++++++++++++++++++++++++++++++++++++-
2 files changed, 69 insertions(+), 2 deletions(-)
diff --git a/arch/m68k/atari/atakeyb.c b/arch/m68k/atari/atakeyb.c
index 2c16dcb..83209fa 100644
--- a/arch/m68k/atari/atakeyb.c
+++ b/arch/m68k/atari/atakeyb.c
@@ -55,6 +55,8 @@ static unsigned long broken_keys[128/(sizeof(unsigned long)*8)] = { 0, };
#define BREAK_MASK (0x80)
+#define SUPPORT_EIFFEL 1
+
/*
* ++roman: The following changes were applied manually:
*
@@ -189,6 +191,22 @@ repeat:
kb_state.len = 1;
kb_state.buf[0] = scancode;
break;
+#if defined (SUPPORT_EIFFEL)
+ case 0x37: /* middle button clicked */
+ kb_state.state = RMOUSE;
+ kb_state.len = 3;
+ kb_state.buf[0] = 0xFC;
+ kb_state.buf[1] = 0;
+ kb_state.buf[2] = 0;
+ break;
+ case 0xB7: /* middle button released */
+ kb_state.state = RMOUSE;
+ kb_state.len = 3;
+ kb_state.buf[0] = 0xF4;
+ kb_state.buf[1] = 0;
+ kb_state.buf[2] = 0;
+ break;
+#endif
case 0xFC:
kb_state.state = CLOCK;
@@ -252,6 +270,9 @@ repeat:
kb_state.buf[kb_state.len++] = scancode;
if (kb_state.len == 5) {
kb_state.state = KEYBOARD;
+#if defined (DEBUG)
+ printk(KERN_INFO "atakeyb: AMOUSE %d %d %d %d %d\n", kb_state.buf[0], kb_state.buf[1], kb_state.buf[2], kb_state.buf[4], kb_state.buf[4]);
+#endif
/* not yet used */
/* wake up someone waiting for this */
}
@@ -261,8 +282,12 @@ repeat:
kb_state.buf[kb_state.len++] = scancode;
if (kb_state.len == 3) {
kb_state.state = KEYBOARD;
- if (atari_input_mouse_interrupt_hook)
+ if (atari_input_mouse_interrupt_hook) {
+#if defined (DEBUG)
+ printk(KERN_INFO "atakeyb: RMOUSE packet\n");
+#endif
atari_input_mouse_interrupt_hook(kb_state.buf);
+ }
}
break;
diff --git a/drivers/input/mouse/atarimouse.c b/drivers/input/mouse/atarimouse.c
index 1b5f4dd..e5274cf 100644
--- a/drivers/input/mouse/atarimouse.c
+++ b/drivers/input/mouse/atarimouse.c
@@ -60,25 +60,62 @@ MODULE_LICENSE("GPL");
static int mouse_threshold[2] = {2, 2};
module_param_array(mouse_threshold, int, NULL, 0);
+#define SUPPORT_EIFFEL 1
+
#ifdef FIXED_ATARI_JOYSTICK
extern int atari_mouse_buttons;
#endif
+#if defined (SUPPORT_EIFFEL)
+static int eiffel_mouse_buttons;
+#endif
static struct input_dev *atamouse_dev;
static void atamouse_interrupt(char *buf)
{
int buttons, dx, dy;
+#if defined (DEBUG)
+ printk(KERN_INFO "atarimouse: %x %x %x\n", buf[0], buf[1], buf[2]);
+#endif
+#if defined (SUPPORT_EIFFEL)
+ if ((buf[0] & 0xc) == 0x8) /* real mouse packet */
+#endif
+ buttons = ((buf[0] & 1) << 2) | ((buf[0] & 2) >> 1);
- buttons = (buf[0] & 1) | ((buf[0] & 2) << 1);
#ifdef FIXED_ATARI_JOYSTICK
buttons |= atari_mouse_buttons & 2;
atari_mouse_buttons = buttons;
#endif
+#if defined (SUPPORT_EIFFEL)
+ if (buf[1] == 0 && buf[2] == 0 && (buf[0] & 4)) {
+ /* middle mouse button toggle */
+ switch (buf[0]) {
+ case 0xFC:
+ eiffel_mouse_buttons |= 0x2;
+ break;
+ case 0xF4:
+ eiffel_mouse_buttons &= ~0x2;
+ break;
+ default:
+ break;
+ }
+ }
+ buttons |= eiffel_mouse_buttons & 2;
+ eiffel_mouse_buttons = buttons;
+#endif
+
/* only relative events get here */
dx = buf[1];
+#if defined (CONFIG_ARANYM)
+ dy = buf[2];
+#else
dy = -buf[2];
+#endif
+
+#if defined (DEBUG)
+ printk(KERN_INFO "atarimouse: dx %d dy %d buttons %x\n", dx, dy, buttons);
+#endif
input_report_rel(atamouse_dev, REL_X, dx);
input_report_rel(atamouse_dev, REL_Y, dy);
@@ -97,7 +134,12 @@ static int atamouse_open(struct input_dev *dev)
#ifdef FIXED_ATARI_JOYSTICK
atari_mouse_buttons = 0;
#endif
+#if defined (CONFIG_ARANYM)
+ printk(KERN_INFO "atarimouse: set reference origin=bottom (ARAnyM mode)!\n");
+ ikbd_mouse_y0_bot();
+#else
ikbd_mouse_y0_top();
+#endif
ikbd_mouse_thresh(mouse_threshold[0], mouse_threshold[1]);
ikbd_mouse_rel_pos();
atari_input_mouse_interrupt_hook = atamouse_interrupt;
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH] m68k: Fix atarimouse init
2009-01-04 3:12 ` Michael Schmitz
@ 2009-01-04 7:34 ` Petr Stehlik
0 siblings, 0 replies; 26+ messages in thread
From: Petr Stehlik @ 2009-01-04 7:34 UTC (permalink / raw)
To: Michael Schmitz; +Cc: Andreas Schwab, Geert Uytterhoeven, Linux/m68k
Michael Schmitz píše v Ne 04. 01. 2009 v 04:12 +0100:
> > I have added it already. Can you use CVS version of ARAnyM?
>
> I've not tried to compile ARAnyM myself in a while, rather installed the latest
> Debian package as it becomes available.
It's a matter of simple ./autogen.sh && make but I could create a binary
deb for i386 or amd64 if it was of any help (probably not :) Or maybe I
could try creating deb-src.
> > You can attach any PS/2 mouse and keyboard to Atari.
>
> Seems like this hooks up to the standard keyboard connector so it should behave
> the same as the regular keyboard/mouse. Good.
right
Petr
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" 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] 26+ messages in thread
* Re: [PATCH] m68k: Add Eiffel PS/2 support for Atari mouse driver
2009-01-04 7:15 ` [PATCH] m68k: Add Eiffel PS/2 support for Atari mouse driver Michael Schmitz
@ 2009-01-04 7:41 ` Petr Stehlik
2009-01-04 21:50 ` Michael Schmitz
2009-01-05 1:32 ` [PATCH] m68k: Add Eiffel PS/2 support for Atari mouse driver (updated) Michael Schmitz
1 sibling, 1 reply; 26+ messages in thread
From: Petr Stehlik @ 2009-01-04 7:41 UTC (permalink / raw)
To: Michael Schmitz; +Cc: Geert Uytterhoeven, Linux/m68k
Michael Schmitz píše v Ne 04. 01. 2009 v 08:15 +0100:
> > The middle mouse button is mapped to scancode 0x37 (IIRC) while the
> > mouse wheels are provided in IKBD status packet.
>
> I've written the first part of the Eiffel PS/2 mouse support, adding middle
> mouse button support based on the scancode you specified. Implementing the
> middle mouse button as a toggle is a bit awkward :-(
Note that I have yet to find out whether _releasing_ the middle mouse
button on real Eiffel hardware does send the 0x37|0x80 scancode or not.
This is unclear from the documentation so I am trying to get a
definitive answer from someone who owns the actual hardware.
> I've not tested the code beyond making sure the two regular buttons still work -
> I do not quite see how to activate Eiffel mouse support in ARAnyM.
You must be kidding :-) Get to the SETUP somehow ("aranym -G -c
your_config_file", for example, or use the hotkey) and click the
[ Keyboard + Mouse ] button. The rest (click radio button, click OK,
click Save) should be obvious. Or simply edit the aranym config file you
use for booting your linux setup, find the [IKBD] section and set the
"WheelEiffel = Yes".
Petr
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" 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] 26+ messages in thread
* Re: [PATCH] m68k: Add Eiffel PS/2 support for Atari mouse driver
2009-01-04 7:41 ` Petr Stehlik
@ 2009-01-04 21:50 ` Michael Schmitz
2009-01-04 22:10 ` Petr Stehlik
0 siblings, 1 reply; 26+ messages in thread
From: Michael Schmitz @ 2009-01-04 21:50 UTC (permalink / raw)
To: Petr Stehlik; +Cc: Geert Uytterhoeven, Linux/m68k
Hi Petr,
> > I've written the first part of the Eiffel PS/2 mouse support, adding middle
> > mouse button support based on the scancode you specified. Implementing the
> > middle mouse button as a toggle is a bit awkward :-(
>
> Note that I have yet to find out whether _releasing_ the middle mouse
> button on real Eiffel hardware does send the 0x37|0x80 scancode or not.
> This is unclear from the documentation so I am trying to get a
> definitive answer from someone who owns the actual hardware.
Well, if it sends a different scancode that's easy enough to accomodate.
> > I've not tested the code beyond making sure the two regular buttons still work -
> > I do not quite see how to activate Eiffel mouse support in ARAnyM.
>
> You must be kidding :-) Get to the SETUP somehow ("aranym -G -c
> your_config_file", for example, or use the hotkey) and click the
Actually I'm not. The 'pause' hotkey for setup has never worked (neither has any
of the various hotkeys for mouse release, BTW). That wasn't a big deal for me so
far.
> [ Keyboard + Mouse ] button. The rest (click radio button, click OK,
> click Save) should be obvious. Or simply edit the aranym config file you
> use for booting your linux setup, find the [IKBD] section and set the
> "WheelEiffel = Yes".
As you will have guessed, I did edit the config file directly for all my
customized settings so far. I had done a search for the proper mouse release
keycode but to no avail (both in /usr/share/doc/aranym and on the wiki).
Must have been the wrong keyword, or on the old (0.9.4) version or something.
Anyway, still no luck with the ungrab hotkey. And setting WheelEiffel = Yes did
not yield an additional mouse event so far. I'll keep trying :-)
Michael
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH] m68k: Add Eiffel PS/2 support for Atari mouse driver
2009-01-04 21:50 ` Michael Schmitz
@ 2009-01-04 22:10 ` Petr Stehlik
2009-01-05 1:11 ` Michael Schmitz
0 siblings, 1 reply; 26+ messages in thread
From: Petr Stehlik @ 2009-01-04 22:10 UTC (permalink / raw)
To: Michael Schmitz; +Cc: Geert Uytterhoeven, Linux/m68k
Michael Schmitz píše v Ne 04. 01. 2009 v 22:50 +0100:
> > Note that I have yet to find out whether _releasing_ the middle mouse
> > button on real Eiffel hardware does send the 0x37|0x80 scancode or not.
> > This is unclear from the documentation so I am trying to get a
> > definitive answer from someone who owns the actual hardware.
>
> Well, if it sends a different scancode that's easy enough to accomodate.
Well I meant that maybe it doesn't send anything.
> > You must be kidding :-) Get to the SETUP somehow ("aranym -G -c
> > your_config_file", for example, or use the hotkey) and click the
>
> Actually I'm not. The 'pause' hotkey for setup has never worked (neither has any
> of the various hotkeys for mouse release, BTW).
That's why I suggested you to start aranym with "-G". Try that and click
on the [Hotkeys] dialog to define your own hotkeys.
> Anyway, still no luck with the ungrab hotkey.
See above, it's dead easy to choose your own key.
> And setting WheelEiffel = Yes did not yield an additional mouse event so far.
Try the wheel - it must work even with 0.9.4, I think. The middle mouse
is supported in the CVS version only.
Petr
--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" 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] 26+ messages in thread
* Re: [PATCH] m68k: Add Eiffel PS/2 support for Atari mouse driver
2009-01-04 22:10 ` Petr Stehlik
@ 2009-01-05 1:11 ` Michael Schmitz
0 siblings, 0 replies; 26+ messages in thread
From: Michael Schmitz @ 2009-01-05 1:11 UTC (permalink / raw)
To: Petr Stehlik; +Cc: Geert Uytterhoeven, Linux/m68k
> > > This is unclear from the documentation so I am trying to get a
> > > definitive answer from someone who owns the actual hardware.
> >
> > Well, if it sends a different scancode that's easy enough to accomodate.
>
> Well I meant that maybe it doesn't send anything.
It does in fact not send any scancode ... bummer. I'll use another (regular
keyboard) scancode for the middle mouse button tests... Whoa - nice oops there.
New patch coming your way shortly, guys.
> > Actually I'm not. The 'pause' hotkey for setup has never worked (neither has any
> > of the various hotkeys for mouse release, BTW).
>
> That's why I suggested you to start aranym with "-G". Try that and click
> on the [Hotkeys] dialog to define your own hotkeys.
I see. Turns out that my alt and apple keys (Powerbook G4 keyboard) were
ignored. Used control as modifier and it works now, thanks.
> See above, it's dead easy to choose your own key.
Modifiers on Mac powerbooks seem to cause trouble for SDL - how would I go about
debugging this?
> > And setting WheelEiffel = Yes did not yield an additional mouse event so far.
>
> Try the wheel - it must work even with 0.9.4, I think. The middle mouse
> is supported in the CVS version only.
The wheel does send what it's supposed to in 0.9.7beta - for the final tests,
I'll have to get the CVS version it seems. Using F10 as middle mouse button did
help debugging the whole shebang quite a bit already.
Michael
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH] m68k: Add Eiffel PS/2 support for Atari mouse driver (updated)
2009-01-04 7:15 ` [PATCH] m68k: Add Eiffel PS/2 support for Atari mouse driver Michael Schmitz
2009-01-04 7:41 ` Petr Stehlik
@ 2009-01-05 1:32 ` Michael Schmitz
1 sibling, 0 replies; 26+ messages in thread
From: Michael Schmitz @ 2009-01-05 1:32 UTC (permalink / raw)
To: Petr Stehlik; +Cc: Geert Uytterhoeven, Linux/m68k
Hi,
as hinted at in my previous mail, here's version 2 of the Eiffel mouse emulation
code, tested using F10 as a fake mouse "button" (set DEBUG in atakeyb.c to
activate this). Still no wheels, though.
Please test with the CVS version of ARAnyM, or real hardware (I've removed the
y movement hack in this version).
The code is looking ugly enough to make me think about using a separate hook to
report the additional buttons in future.
Parseable by git-am now, Geert?
Signed-off-by: Michael Schmitz <schmitz@debian.org>
---
arch/m68k/atari/atakeyb.c | 46 +++++++++++++++++++++++++++++++++++++-
drivers/input/mouse/atarimouse.c | 40 ++++++++++++++++++++++++++++++++-
2 files changed, 84 insertions(+), 2 deletions(-)
diff --git a/arch/m68k/atari/atakeyb.c b/arch/m68k/atari/atakeyb.c
index 2c16dcb..6215060 100644
--- a/arch/m68k/atari/atakeyb.c
+++ b/arch/m68k/atari/atakeyb.c
@@ -55,6 +55,8 @@ static unsigned long broken_keys[128/(sizeof(unsigned long)*8)] = { 0, };
#define BREAK_MASK (0x80)
+#define SUPPORT_EIFFEL 1
+
/*
* ++roman: The following changes were applied manually:
*
@@ -189,6 +191,41 @@ repeat:
kb_state.len = 1;
kb_state.buf[0] = scancode;
break;
+#if defined (SUPPORT_EIFFEL)
+ /*
+ * middle mouse button and wheel events are reported
+ * as follows:
+ * Middle button: mouse packet with 0xFC/0xF4 (bit 2
+ * set) and zero movement bytes
+ * Wheel: Mouse packet with bit 2 _and_ 3 clear and
+ * zero movement bytes
+ */
+
+#if defined (DEBUG)
+ case 0x44:
+#endif
+ case 0x37: /* middle button clicked */
+ kb_state.state = RMOUSE;
+ kb_state.len = 2;
+ kb_state.buf[0] = 0xFC;
+ kb_state.buf[1] = 0;
+ kb_state.buf[2] = 0;
+ scancode = 0;
+ goto interpret_scancode;
+ break;
+#if defined (DEBUG)
+ case 0xC4:
+#endif
+ case 0xB7: /* middle button released */
+ kb_state.state = RMOUSE;
+ kb_state.len = 2;
+ kb_state.buf[0] = 0xF4;
+ kb_state.buf[1] = 0;
+ kb_state.buf[2] = 0;
+ scancode = 0;
+ goto interpret_scancode;
+ break;
+#endif
case 0xFC:
kb_state.state = CLOCK;
@@ -252,6 +289,9 @@ repeat:
kb_state.buf[kb_state.len++] = scancode;
if (kb_state.len == 5) {
kb_state.state = KEYBOARD;
+#if defined (DEBUG)
+ printk(KERN_INFO "atakeyb: AMOUSE %d %d %d %d %d\n", kb_state.buf[0], kb_state.buf[1], kb_state.buf[2], kb_state.buf[4], kb_state.buf[4]);
+#endif
/* not yet used */
/* wake up someone waiting for this */
}
@@ -261,8 +301,12 @@ repeat:
kb_state.buf[kb_state.len++] = scancode;
if (kb_state.len == 3) {
kb_state.state = KEYBOARD;
- if (atari_input_mouse_interrupt_hook)
+ if (atari_input_mouse_interrupt_hook) {
+#if defined (DEBUG)
+ printk(KERN_INFO "atakeyb: RMOUSE packet\n");
+#endif
atari_input_mouse_interrupt_hook(kb_state.buf);
+ }
}
break;
diff --git a/drivers/input/mouse/atarimouse.c b/drivers/input/mouse/atarimouse.c
index 1b5f4dd..8cf2ffd 100644
--- a/drivers/input/mouse/atarimouse.c
+++ b/drivers/input/mouse/atarimouse.c
@@ -60,26 +60,64 @@ MODULE_LICENSE("GPL");
static int mouse_threshold[2] = {2, 2};
module_param_array(mouse_threshold, int, NULL, 0);
+#define SUPPORT_EIFFEL 1
+
#ifdef FIXED_ATARI_JOYSTICK
extern int atari_mouse_buttons;
#endif
+#if defined (SUPPORT_EIFFEL)
+static int eiffel_mouse_buttons;
+#endif
static struct input_dev *atamouse_dev;
static void atamouse_interrupt(char *buf)
{
int buttons, dx, dy;
+#if defined (DEBUG)
+ printk(KERN_INFO "atarimouse: %x %x %x\n", buf[0], buf[1], buf[2]);
+#endif
+#if defined (SUPPORT_EIFFEL)
+ if ((buf[0] & 0xc) == 0x8) /* real mouse packet */
+#endif
+ buttons = ((buf[0] & 1) << 2) | ((buf[0] & 2) >> 1);
+#if defined (SUPPORT_EIFFEL)
+ else
+ buttons = eiffel_mouse_buttons;
+#endif
- buttons = (buf[0] & 1) | ((buf[0] & 2) << 1);
#ifdef FIXED_ATARI_JOYSTICK
buttons |= atari_mouse_buttons & 2;
atari_mouse_buttons = buttons;
#endif
+#if defined (SUPPORT_EIFFEL)
+ if (buf[1] == 0 && buf[2] == 0 && (buf[0] & 4)) {
+ /* middle mouse button toggle */
+ switch (buf[0] & 0xff) {
+ case 0xFC:
+ eiffel_mouse_buttons |= 0x2;
+ break;
+ case 0xF4:
+ eiffel_mouse_buttons &= ~0x2;
+ break;
+ default:
+ break;
+ }
+ }
+ buttons = (buttons & ~0x2) | eiffel_mouse_buttons & 2;
+ eiffel_mouse_buttons = buttons;
+#endif
+
/* only relative events get here */
dx = buf[1];
dy = -buf[2];
+#if defined (DEBUG)
+ printk(KERN_INFO "atarimouse: dx %d dy %d buttons %x eiffel %x\n",
+ dx, dy, buttons, eiffel_mouse_buttons);
+#endif
+
input_report_rel(atamouse_dev, REL_X, dx);
input_report_rel(atamouse_dev, REL_Y, dy);
^ permalink raw reply related [flat|nested] 26+ messages in thread
end of thread, other threads:[~2009-01-05 1:32 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20081217165557.b4898a4b.sfr@canb.auug.org.au>
2008-12-17 8:18 ` linux-next: boot-params tree build failure Geert Uytterhoeven
2008-12-21 11:12 ` [PATCH] m68k: Kill several external declarations in source files (was: Re: linux-next: boot-params tree build failure) Geert Uytterhoeven
2008-12-21 22:21 ` Rusty Russell
2008-12-22 7:30 ` Geert Uytterhoeven
2008-12-28 22:00 ` [PATCH] m68k: Fix atarimouse init Michael Schmitz
2008-12-29 10:57 ` Geert Uytterhoeven
2008-12-30 9:18 ` Petr Stehlik
2009-01-02 0:27 ` Michael Schmitz
2009-01-02 0:12 ` Michael Schmitz
2009-01-02 9:42 ` Andreas Schwab
2009-01-02 10:20 ` Petr Stehlik
2009-01-02 22:10 ` Michael Schmitz
2009-01-03 5:53 ` Petr Stehlik
2009-01-03 6:15 ` Petr Stehlik
2009-01-03 7:23 ` Michael Schmitz
2009-01-03 8:16 ` Petr Stehlik
2009-01-04 3:12 ` Michael Schmitz
2009-01-04 7:34 ` Petr Stehlik
2009-01-04 7:15 ` [PATCH] m68k: Add Eiffel PS/2 support for Atari mouse driver Michael Schmitz
2009-01-04 7:41 ` Petr Stehlik
2009-01-04 21:50 ` Michael Schmitz
2009-01-04 22:10 ` Petr Stehlik
2009-01-05 1:11 ` Michael Schmitz
2009-01-05 1:32 ` [PATCH] m68k: Add Eiffel PS/2 support for Atari mouse driver (updated) Michael Schmitz
2009-01-03 8:45 ` [PATCH] m68k: Fix atarimouse init Andreas Schwab
2009-01-04 2:05 ` Michael Schmitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox