Commit 77f1a9e6 authored by Franz Sirl's avatar Franz Sirl Committed by Vojtech Pavlik

Hi Vojtech,

I noticed you just pushed the pc_keyb.c removal to linux-input, here is the
PPC part of it that removes now superflous stuff. The small change in
keyboard.c is a bugfix from 2.4 and ruby that didn't make it into 2.5 yet.
Franz.
parent 66562390
...@@ -540,11 +540,6 @@ if [ "$CONFIG_ALL_PPC" = "y" ]; then ...@@ -540,11 +540,6 @@ if [ "$CONFIG_ALL_PPC" = "y" ]; then
bool ' Support for mouse button 2+3 emulation' CONFIG_MAC_EMUMOUSEBTN bool ' Support for mouse button 2+3 emulation' CONFIG_MAC_EMUMOUSEBTN
fi fi
fi fi
# This is for drivers/macintosh/mac_hid.o, which is needed if the input
# layer is used.
if [ "$CONFIG_INPUT" != "n" ]; then
define_bool CONFIG_MAC_HID y
fi
if [ "$CONFIG_ADB_CUDA" != "n" ]; then if [ "$CONFIG_ADB_CUDA" != "n" ]; then
bool 'Support for ANS LCD display' CONFIG_ANSLCD bool 'Support for ANS LCD display' CONFIG_ANSLCD
fi fi
......
...@@ -68,7 +68,6 @@ void rtas_indicator_progress(char *, unsigned short); ...@@ -68,7 +68,6 @@ void rtas_indicator_progress(char *, unsigned short);
void btext_progress(char *, unsigned short); void btext_progress(char *, unsigned short);
extern unsigned long pmac_find_end_of_memory(void); extern unsigned long pmac_find_end_of_memory(void);
extern void select_adb_keyboard(void);
extern int of_show_percpuinfo(struct seq_file *, int); extern int of_show_percpuinfo(struct seq_file *, int);
extern kdev_t boot_dev; extern kdev_t boot_dev;
...@@ -437,22 +436,6 @@ chrp_init2(void) ...@@ -437,22 +436,6 @@ chrp_init2(void)
if (ppc_md.progress) if (ppc_md.progress)
ppc_md.progress(" Have fun! ", 0x7777); ppc_md.progress(" Have fun! ", 0x7777);
#if defined(CONFIG_VT) && defined(CONFIG_INPUT)
/* see if there is a keyboard in the device tree
with a parent of type "adb" */
{
struct device_node *kbd;
for (kbd = find_devices("keyboard"); kbd; kbd = kbd->next) {
if (kbd->parent && kbd->parent->type
&& strcmp(kbd->parent->type, "adb") == 0) {
select_adb_keyboard();
break;
}
}
}
#endif /* CONFIG_VT && CONFIG_INPUT */
} }
void __init void __init
......
...@@ -66,7 +66,6 @@ ...@@ -66,7 +66,6 @@
#include <asm/ohare.h> #include <asm/ohare.h>
#include <asm/mediabay.h> #include <asm/mediabay.h>
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/keyboard.h>
#include <asm/dma.h> #include <asm/dma.h>
#include <asm/bootx.h> #include <asm/bootx.h>
#include <asm/cputable.h> #include <asm/cputable.h>
...@@ -617,15 +616,6 @@ pmac_find_end_of_memory(void) ...@@ -617,15 +616,6 @@ pmac_find_end_of_memory(void)
return total; return total;
} }
void __init
select_adb_keyboard(void)
{
#ifdef CONFIG_VT
ppc_md.kbd_translate = mac_hid_kbd_translate;
ppc_md.kbd_unexpected_up = mac_hid_kbd_unexpected_up;
#endif /* CONFIG_VT */
}
void __init void __init
pmac_init(unsigned long r3, unsigned long r4, unsigned long r5, pmac_init(unsigned long r3, unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7) unsigned long r6, unsigned long r7)
...@@ -666,8 +656,6 @@ pmac_init(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -666,8 +656,6 @@ pmac_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.feature_call = pmac_do_feature_call; ppc_md.feature_call = pmac_do_feature_call;
select_adb_keyboard();
#ifdef CONFIG_BOOTX_TEXT #ifdef CONFIG_BOOTX_TEXT
ppc_md.progress = pmac_progress; ppc_md.progress = pmac_progress;
#endif /* CONFIG_BOOTX_TEXT */ #endif /* CONFIG_BOOTX_TEXT */
......
...@@ -222,7 +222,7 @@ void compute_shiftstate(void) ...@@ -222,7 +222,7 @@ void compute_shiftstate(void)
if (!test_bit(k, key_down)) if (!test_bit(k, key_down))
continue; continue;
sym = U(plain_map[k]); sym = U(key_maps[0][k]);
if (KTYP(sym) != KT_SHIFT && KTYP(sym) != KT_SLOCK) if (KTYP(sym) != KT_SHIFT && KTYP(sym) != KT_SLOCK)
continue; continue;
......
...@@ -20,7 +20,7 @@ obj-$(CONFIG_MAC_SERIAL) += macserial.o ...@@ -20,7 +20,7 @@ obj-$(CONFIG_MAC_SERIAL) += macserial.o
ifneq ($(CONFIG_MAC),y) ifneq ($(CONFIG_MAC),y)
obj-$(CONFIG_NVRAM) += nvram.o obj-$(CONFIG_NVRAM) += nvram.o
endif endif
obj-$(CONFIG_MAC_HID) += mac_hid.o obj-$(CONFIG_MAC_EMUMOUSEBTN) += mac_hid.o
obj-$(CONFIG_INPUT_ADBHID) += adbhid.o obj-$(CONFIG_INPUT_ADBHID) += adbhid.o
obj-$(CONFIG_PPC_RTC) += rtc.o obj-$(CONFIG_PPC_RTC) += rtc.o
obj-$(CONFIG_ANSLCD) += ans-lcd.o obj-$(CONFIG_ANSLCD) += ans-lcd.o
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* Copyright (C) 2000 Franz Sirl. * Copyright (C) 2000 Franz Sirl.
* *
* Stuff inside CONFIG_MAC_EMUMOUSEBTN should really be moved to userspace. * This file will soon be removed in favor of an uinput userspace tool.
*/ */
#include <linux/config.h> #include <linux/config.h>
...@@ -16,36 +16,14 @@ ...@@ -16,36 +16,14 @@
#include <linux/module.h> #include <linux/module.h>
static unsigned char e0_keys[128] = {
0, 0, 0, KEY_KPCOMMA, 0, KEY_INTL3, 0, 0, /* 0x00-0x07 */
0, 0, 0, 0, KEY_LANG1, KEY_LANG2, 0, 0, /* 0x08-0x0f */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10-0x17 */
0, 0, 0, 0, KEY_KPENTER, KEY_RIGHTCTRL, KEY_VOLUMEUP, 0,/* 0x18-0x1f */
0, 0, 0, 0, 0, KEY_VOLUMEDOWN, KEY_MUTE, 0, /* 0x20-0x27 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x28-0x2f */
0, 0, 0, 0, 0, KEY_KPSLASH, 0, KEY_SYSRQ, /* 0x30-0x37 */
KEY_RIGHTALT, KEY_BRIGHTNESSUP, KEY_BRIGHTNESSDOWN,
KEY_EJECTCD, 0, 0, 0, 0, /* 0x38-0x3f */
0, 0, 0, 0, 0, 0, 0, KEY_HOME, /* 0x40-0x47 */
KEY_UP, KEY_PAGEUP, 0, KEY_LEFT, 0, KEY_RIGHT, 0, KEY_END, /* 0x48-0x4f */
KEY_DOWN, KEY_PAGEDOWN, KEY_INSERT, KEY_DELETE, 0, 0, 0, 0, /* 0x50-0x57 */
0, 0, 0, KEY_LEFTMETA, KEY_RIGHTMETA, KEY_COMPOSE, KEY_POWER, 0, /* 0x58-0x5f */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60-0x67 */
0, 0, 0, 0, 0, 0, 0, KEY_MACRO, /* 0x68-0x6f */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70-0x77 */
0, 0, 0, 0, 0, 0, 0, 0 /* 0x78-0x7f */
};
#ifdef CONFIG_MAC_EMUMOUSEBTN
static struct input_dev emumousebtn; static struct input_dev emumousebtn;
static void emumousebtn_input_register(void); static void emumousebtn_input_register(void);
static int mouse_emulate_buttons = 0; static int mouse_emulate_buttons = 0;
static int mouse_button2_keycode = KEY_RIGHTCTRL; /* right control key */ static int mouse_button2_keycode = KEY_RIGHTCTRL; /* right control key */
static int mouse_button3_keycode = KEY_RIGHTALT; /* right option key */ static int mouse_button3_keycode = KEY_RIGHTALT; /* right option key */
static int mouse_last_keycode = 0; static int mouse_last_keycode = 0;
#endif
#if defined(CONFIG_SYSCTL) && defined(CONFIG_MAC_EMUMOUSEBTN) #if defined(CONFIG_SYSCTL)
/* file(s) in /proc/sys/dev/mac_hid */ /* file(s) in /proc/sys/dev/mac_hid */
ctl_table mac_hid_files[] = ctl_table mac_hid_files[] =
{ {
...@@ -85,76 +63,11 @@ static struct ctl_table_header *mac_hid_sysctl_header; ...@@ -85,76 +63,11 @@ static struct ctl_table_header *mac_hid_sysctl_header;
#endif /* endif CONFIG_SYSCTL */ #endif /* endif CONFIG_SYSCTL */
int mac_hid_kbd_translate(unsigned char scancode, unsigned char *keycode,
char raw_mode)
{
/* This code was copied from char/pc_keyb.c and will be
* superflous when the input layer is fully integrated.
* We don't need the high_keys handling, so this part
* has been removed.
*/
static int prev_scancode = 0;
/* special prefix scancodes.. */
if (scancode == 0xe0 || scancode == 0xe1) {
prev_scancode = scancode;
return 0;
}
scancode &= 0x7f;
if (prev_scancode) {
if (prev_scancode != 0xe0) {
if (prev_scancode == 0xe1 && scancode == 0x1d) {
prev_scancode = 0x100;
return 0;
} else if (prev_scancode == 0x100 && scancode == 0x45) {
*keycode = KEY_PAUSE;
prev_scancode = 0;
} else {
if (!raw_mode)
printk(KERN_INFO "keyboard: unknown e1 escape sequence\n");
prev_scancode = 0;
return 0;
}
} else {
prev_scancode = 0;
if (scancode == 0x2a || scancode == 0x36)
return 0;
}
if (e0_keys[scancode])
*keycode = e0_keys[scancode];
else {
if (!raw_mode)
printk(KERN_INFO "keyboard: unknown scancode e0 %02x\n",
scancode);
return 0;
}
} else {
switch (scancode) {
case 91: scancode = KEY_LINEFEED; break;
case 92: scancode = KEY_KPEQUAL; break;
case 125: scancode = KEY_INTL1; break;
}
*keycode = scancode;
}
return 1;
}
char mac_hid_kbd_unexpected_up(unsigned char keycode)
{
if (keycode == KEY_F13)
return 0;
else
return 0x80;
}
#ifdef CONFIG_MAC_EMUMOUSEBTN
int mac_hid_mouse_emulate_buttons(int caller, unsigned int keycode, int down) int mac_hid_mouse_emulate_buttons(int caller, unsigned int keycode, int down)
{ {
switch (caller) { switch (caller) {
case 1: case 1:
/* Called from keybdev.c */ /* Called from keyboard.c */
if (mouse_emulate_buttons if (mouse_emulate_buttons
&& (keycode == mouse_button2_keycode && (keycode == mouse_button2_keycode
|| keycode == mouse_button3_keycode)) { || keycode == mouse_button3_keycode)) {
...@@ -191,16 +104,13 @@ static void emumousebtn_input_register(void) ...@@ -191,16 +104,13 @@ static void emumousebtn_input_register(void)
printk(KERN_INFO "input: Macintosh mouse button emulation\n"); printk(KERN_INFO "input: Macintosh mouse button emulation\n");
} }
#endif
int __init mac_hid_init(void) int __init mac_hid_init(void)
{ {
#ifdef CONFIG_MAC_EMUMOUSEBTN
emumousebtn_input_register(); emumousebtn_input_register();
#endif
#if defined(CONFIG_SYSCTL) && defined(CONFIG_MAC_EMUMOUSEBTN) #if defined(CONFIG_SYSCTL)
mac_hid_sysctl_header = register_sysctl_table(mac_hid_root_dir, 1); mac_hid_sysctl_header = register_sysctl_table(mac_hid_root_dir, 1);
#endif /* CONFIG_SYSCTL */ #endif /* CONFIG_SYSCTL */
......
...@@ -57,12 +57,6 @@ struct machdep_calls { ...@@ -57,12 +57,6 @@ struct machdep_calls {
unsigned char (*nvram_read_val)(int addr); unsigned char (*nvram_read_val)(int addr);
void (*nvram_write_val)(int addr, unsigned char val); void (*nvram_write_val)(int addr, unsigned char val);
/* Tons of keyboard stuff. */
int (*kbd_translate)(unsigned char scancode,
unsigned char *keycode,
char raw_mode);
char (*kbd_unexpected_up)(unsigned char keycode);
/* /*
* optional PCI "hooks" * optional PCI "hooks"
*/ */
......
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