Commit e8d5b0ba authored by Richard Zidlicky's avatar Richard Zidlicky Committed by Vojtech Pavlik

Move beeping and sysrq to input layer on m68k.

Add an m68k beeper input module.
parent f20bf018
......@@ -33,7 +33,6 @@
#include <asm/amigaints.h>
#include <asm/irq.h>
#include <asm/rtc.h>
#include <asm/keyboard.h>
#include <asm/machdep.h>
#include <asm/io.h>
......@@ -71,11 +70,6 @@ static char amiga_model_name[13] = "Amiga ";
extern char m68k_debug_device[];
static void amiga_sched_init(void (*handler)(int, void *, struct pt_regs *));
/* amiga specific keyboard functions */
extern int amiga_keyb_init(void);
extern int amiga_kbdrate (struct kbd_repeat *);
extern int amiga_kbd_translate(unsigned char keycode, unsigned char *keycodep,
char raw_mode);
/* amiga specific irq functions */
extern void amiga_init_IRQ (void);
extern void (*amiga_default_handler[]) (int, void *, struct pt_regs *);
......@@ -94,7 +88,6 @@ static unsigned long amiga_gettimeoffset (void);
static int a3000_hwclk (int, struct rtc_time *);
static int a2000_hwclk (int, struct rtc_time *);
static int amiga_set_clock_mmss (unsigned long);
extern void amiga_mksound( unsigned int count, unsigned int ticks );
#ifdef CONFIG_AMIGA_FLOPPY
extern void amiga_floppy_setup(char *, int *);
#endif
......@@ -116,18 +109,6 @@ static struct console amiga_console_driver = {
.index = -1,
};
#ifdef CONFIG_MAGIC_SYSRQ
static char amiga_sysrq_xlate[128] =
"\0001234567890-=\\\000\000" /* 0x00 - 0x0f */
"qwertyuiop[]\000123" /* 0x10 - 0x1f */
"asdfghjkl;'\000\000456" /* 0x20 - 0x2f */
"\000zxcvbnm,./\000+789" /* 0x30 - 0x3f */
" \177\t\r\r\000\177\000\000\000-\000\000\000\000\000" /* 0x40 - 0x4f */
"\000\201\202\203\204\205\206\207\210\211()/*+\000" /* 0x50 - 0x5f */
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" /* 0x60 - 0x6f */
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"; /* 0x70 - 0x7f */
#endif
/*
* Motherboard Resources present in all Amiga models
......@@ -388,11 +369,6 @@ void __init config_amiga(void)
request_resource(&iomem_resource, &((struct resource *)&mb_resources)[i]);
mach_sched_init = amiga_sched_init;
#ifdef CONFIG_VT
mach_keyb_init = amiga_keyb_init;
mach_kbdrate = amiga_kbdrate;
mach_kbd_translate = amiga_kbd_translate;
#endif
mach_init_IRQ = amiga_init_IRQ;
mach_default_handler = &amiga_default_handler;
mach_request_irq = amiga_request_irq;
......@@ -432,16 +408,10 @@ void __init config_amiga(void)
#ifdef CONFIG_DUMMY_CONSOLE
conswitchp = &dummy_con;
#endif
#ifdef CONFIG_VT
kd_mksound = amiga_mksound;
#endif
#ifdef CONFIG_MAGIC_SYSRQ
SYSRQ_KEY = 0xff;
mach_sysrq_key = 0x5f; /* HELP */
mach_sysrq_shift_state = 0x03; /* SHIFT+ALTGR */
mach_sysrq_shift_mask = 0xff; /* all modifiers except CapsLock */
mach_sysrq_xlate = amiga_sysrq_xlate;
#ifdef CONFIG_INPUT_M68K_BEEP
mach_beep = amiga_mksound;
#endif
#ifdef CONFIG_HEARTBEAT
mach_heartbeat = amiga_heartbeat;
#endif
......@@ -709,7 +679,7 @@ static void amiga_reset (void)
unsigned long jmp_addr040 = virt_to_phys(&&jmp_addr_label040);
unsigned long jmp_addr = virt_to_phys(&&jmp_addr_label);
cli();
local_irq_disable();
if (CPU_IS_040_OR_060)
/* Setup transparent translation registers for mapping
* of 16 MB kernel segment before disabling translation
......
......@@ -39,7 +39,6 @@
#include <asm/atariints.h>
#include <asm/atari_stram.h>
#include <asm/system.h>
#include <asm/keyboard.h>
#include <asm/machdep.h>
#include <asm/hwtest.h>
#include <asm/io.h>
......@@ -59,12 +58,6 @@ extern void atari_floppy_setup(char *, int *);
static void atari_get_model(char *model);
static int atari_get_hardware_list(char *buffer);
/* atari specific keyboard functions */
extern int atari_keyb_init(void);
extern int atari_kbdrate (struct kbd_repeat *);
extern int atari_kbd_translate(unsigned char keycode, unsigned char *keycodep,
char raw_mode);
extern void atari_kbd_leds (unsigned int);
/* atari specific irq functions */
extern void atari_init_IRQ (void);
extern int atari_request_irq (unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
......@@ -73,7 +66,6 @@ extern void atari_free_irq (unsigned int irq, void *dev_id);
extern void atari_enable_irq (unsigned int);
extern void atari_disable_irq (unsigned int);
extern int show_atari_interrupts (struct seq_file *, void *);
extern void atari_mksound( unsigned int count, unsigned int ticks );
#ifdef CONFIG_HEARTBEAT
static void atari_heartbeat( int on );
#endif
......@@ -89,18 +81,6 @@ extern int atari_tt_set_clock_mmss (unsigned long);
/* atari specific debug functions (in debug.c) */
extern void atari_debug_init(void);
#ifdef CONFIG_MAGIC_SYSRQ
static char atari_sysrq_xlate[128] =
"\000\0331234567890-=\177\t" /* 0x00 - 0x0f */
"qwertyuiop[]\r\000as" /* 0x10 - 0x1f */
"dfghjkl;'`\000\\zxcv" /* 0x20 - 0x2f */
"bnm,./\000\000\000 \000\201\202\203\204\205" /* 0x30 - 0x3f */
"\206\207\210\211\212\000\000\000\000\000-\000\000\000+\000"/* 0x40 - 0x4f */
"\000\000\000\177\000\000\000\000\000\000\000\000\000\000\000\000" /* 0x50 - 0x5f */
"\000\000\000()/*789456123" /* 0x60 - 0x6f */
"0.\r\000\000\000\000\000\000\000\000\000\000\000\000\000"; /* 0x70 - 0x7f */
#endif
/* I've moved hwreg_present() and hwreg_present_bywrite() out into
* mm/hwtest.c, to avoid having multiple copies of the same routine
......@@ -254,12 +234,6 @@ void __init config_atari(void)
to 4GB. */
mach_sched_init = atari_sched_init;
#ifdef CONFIG_VT
mach_keyb_init = atari_keyb_init;
mach_kbdrate = atari_kbdrate;
mach_kbd_translate = atari_kbd_translate;
mach_kbd_leds = atari_kbd_leds;
#endif
mach_init_IRQ = atari_init_IRQ;
mach_request_irq = atari_request_irq;
mach_free_irq = atari_free_irq;
......@@ -277,15 +251,8 @@ void __init config_atari(void)
conswitchp = &dummy_con;
#endif
mach_max_dma_address = 0xffffff;
#ifdef CONFIG_VT
kd_mksound = atari_mksound;
#endif
#ifdef CONFIG_MAGIC_SYSRQ
SYSRQ_KEY = 0xff;
mach_sysrq_key = 98; /* HELP */
mach_sysrq_shift_state = 8; /* Alt */
mach_sysrq_shift_mask = 0xff; /* all modifiers except CapsLock */
mach_sysrq_xlate = atari_sysrq_xlate;
#ifdef CONFIG_INPUT_M68K_BEEP
mach_beep = atari_mksound;
#endif
#ifdef CONFIG_HEARTBEAT
mach_heartbeat = atari_heartbeat;
......
......@@ -45,12 +45,9 @@ static void bvme6000_get_model(char *model);
static int bvme6000_get_hardware_list(char *buffer);
extern int bvme6000_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id);
extern void bvme6000_sched_init(void (*handler)(int, void *, struct pt_regs *));
extern int bvme6000_keyb_init(void);
extern int bvme6000_kbdrate (struct kbd_repeat *);
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_mksound( unsigned int count, unsigned int ticks );
extern void bvme6000_reset (void);
extern void bvme6000_waitbut(void);
void bvme6000_set_vectors (void);
......@@ -72,15 +69,6 @@ int bvme6000_parse_bootinfo(const struct bi_record *bi)
return 1;
}
int bvme6000_kbdrate (struct kbd_repeat *k)
{
return 0;
}
void bvme6000_mksound( unsigned int count, unsigned int ticks )
{
}
void bvme6000_reset()
{
volatile PitRegsPtr pit = (PitRegsPtr)BVME_PIT_BASE;
......@@ -133,15 +121,10 @@ void __init config_bvme6000(void)
mach_max_dma_address = 0xffffffff;
mach_sched_init = bvme6000_sched_init;
#ifdef CONFIG_VT
mach_keyb_init = bvme6000_keyb_init;
mach_kbdrate = bvme6000_kbdrate;
#endif
mach_init_IRQ = bvme6000_init_IRQ;
mach_gettimeoffset = bvme6000_gettimeoffset;
mach_hwclk = bvme6000_hwclk;
mach_set_clock_mmss = bvme6000_set_clock_mmss;
/* mach_mksound = bvme6000_mksound; */
mach_reset = bvme6000_reset;
mach_free_irq = bvme6000_free_irq;
mach_process_int = bvme6000_process_int;
......@@ -394,8 +377,3 @@ int bvme6000_set_clock_mmss (unsigned long nowtime)
return retval;
}
int bvme6000_keyb_init (void)
{
return 0;
}
......@@ -3,6 +3,7 @@
# see Documentation/kbuild/config-language.txt.
#
define_bool CONFIG_M68K y
define_bool CONFIG_UID16 y
define_bool CONFIG_RWSEM_GENERIC_SPINLOCK y
define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM n
......
......@@ -17,7 +17,6 @@
#include <linux/init.h>
#include <asm/machdep.h>
#include <asm/blinken.h>
#include <asm/io.h> /* readb() and writeb() */
#include <asm/hwtest.h> /* hwreg_present() */
#include "ints.h"
......@@ -27,14 +26,6 @@ extern void hp300_reset(void);
extern void (*hp300_default_handler[])(int, void *, struct pt_regs *);
extern int show_hp300_interrupts(struct seq_file *, void *);
#ifdef CONFIG_VT
extern int hp300_keyb_init(void);
static int hp300_kbdrate(struct kbd_repeat *k)
{
return 0;
}
#endif
#ifdef CONFIG_HEARTBEAT
static void hp300_pulse(int x)
{
......@@ -53,10 +44,6 @@ static void hp300_get_model(char *model)
void __init config_hp300(void)
{
mach_sched_init = hp300_sched_init;
#ifdef CONFIG_VT
mach_keyb_init = hp300_keyb_init;
mach_kbdrate = hp300_kbdrate;
#endif
mach_init_IRQ = hp300_init_IRQ;
mach_request_irq = hp300_request_irq;
mach_free_irq = hp300_free_irq;
......
......@@ -71,13 +71,6 @@ char saved_command_line[CL_SIZE];
char m68k_debug_device[6] = "";
void (*mach_sched_init) (void (*handler)(int, void *, struct pt_regs *)) __initdata = NULL;
/* machine dependent keyboard functions */
#ifdef CONFIG_VT
int (*mach_keyb_init) (void) __initdata = NULL;
int (*mach_kbdrate) (struct kbd_repeat *) = NULL;
void (*mach_kbd_leds) (unsigned int) = NULL;
int (*mach_kbd_translate)(unsigned char scancode, unsigned char *keycode, char raw_mode) = NULL;
#endif
/* machine dependent irq functions */
void (*mach_init_IRQ) (void) __initdata = NULL;
void (*(*mach_default_handler)[]) (int, void *, struct pt_regs *) = NULL;
......@@ -89,6 +82,8 @@ void (*mach_process_int) (int, struct pt_regs *) = NULL;
unsigned long (*mach_gettimeoffset) (void);
int (*mach_hwclk) (int, struct rtc_time*) = NULL;
int (*mach_set_clock_mmss) (unsigned long) = NULL;
int (*mach_get_rtc_pll)(struct rtc_pll_info *) = NULL;
int (*mach_set_rtc_pll)(struct rtc_pll_info *) = NULL;
void (*mach_reset)( void );
void (*mach_halt)( void ) = NULL;
void (*mach_power_off)( void ) = NULL;
......@@ -103,15 +98,9 @@ EXPORT_SYMBOL(mach_heartbeat);
#ifdef CONFIG_M68K_L2_CACHE
void (*mach_l2_flush) (int) = NULL;
#endif
#ifdef CONFIG_MAGIC_SYSRQ
unsigned int SYSRQ_KEY;
int mach_sysrq_key = -1;
int mach_sysrq_shift_state = 0;
int mach_sysrq_shift_mask = 0;
char *mach_sysrq_xlate = NULL;
#ifdef CONFIG_INPUT_M68K_BEEP
void (*mach_beep)(unsigned int, unsigned int) = NULL;
#endif
#if defined(CONFIG_ISA) && defined(MULTI_ISA)
int isa_type;
int isa_sex;
......
......@@ -78,27 +78,12 @@ extern void oss_init(void);
extern void psc_init(void);
extern void baboon_init(void);
extern void mac_mksound(unsigned int, unsigned int);
extern void nubus_sweep_video(void);
/* Mac specific debug functions (in debug.c) */
extern void mac_debug_init(void);
extern void mac_debugging_long(int, long);
extern int mackbd_init_hw(void);
extern void mackbd_leds(unsigned int leds);
extern int mackbd_translate(unsigned char keycode, unsigned char *keycodep, char raw_mode);
extern void mac_hid_init_hw(void);
extern int mac_hid_kbd_translate(unsigned char scancode, unsigned char *keycode, char raw_mode);
#ifdef CONFIG_MAGIC_SYSRQ
extern unsigned char mac_hid_kbd_sysrq_xlate[128];
extern unsigned char pckbd_sysrq_xlate[128];
extern unsigned char mackbd_sysrq_xlate[128];
#endif /* CONFIG_MAGIC_SYSRQ */
static void mac_get_model(char *str);
void mac_bang(int irq, void *vector, struct pt_regs *p)
......@@ -207,33 +192,6 @@ void __init config_mac(void)
printk("ERROR: no Mac, but config_mac() called!! \n");
}
#ifdef CONFIG_VT
#ifdef CONFIG_INPUT_ADBHID
mach_keyb_init = mac_hid_init_hw;
mach_kbd_translate = mac_hid_kbd_translate;
#ifdef CONFIG_MAGIC_SYSRQ
#ifdef CONFIG_MAC_ADBKEYCODES
if (!keyboard_sends_linux_keycodes) {
mach_sysrq_xlate = mac_hid_kbd_sysrq_xlate;
SYSRQ_KEY = 0x69;
} else
#endif /* CONFIG_MAC_ADBKEYCODES */
{
mach_sysrq_xlate = pckbd_sysrq_xlate;
SYSRQ_KEY = 0x54;
}
#endif /* CONFIG_MAGIC_SYSRQ */
#elif defined(CONFIG_ADB_KEYBOARD)
mach_keyb_init = mackbd_init_hw;
mach_kbd_leds = mackbd_leds;
mach_kbd_translate = mackbd_translate;
#ifdef CONFIG_MAGIC_SYSRQ
mach_sysrq_xlate = mackbd_sysrq_xlate;
SYSRQ_KEY = 0x69;
#endif /* CONFIG_MAGIC_SYSRQ */
#endif /* CONFIG_INPUT_ADBHID */
#endif /* CONFIG_VT */
mach_sched_init = mac_sched_init;
mach_init_IRQ = mac_init_IRQ;
mach_request_irq = mac_request_irq;
......@@ -249,9 +207,6 @@ void __init config_mac(void)
mach_hwclk = mac_hwclk;
#endif
mach_set_clock_mmss = mac_set_clock_mmss;
#if 0
mach_mksound = mac_mksound;
#endif
mach_reset = mac_reset;
mach_halt = mac_poweroff;
mach_power_off = mac_poweroff;
......@@ -262,8 +217,8 @@ void __init config_mac(void)
#if 0
mach_debug_init = mac_debug_init;
#endif
#ifdef CONFIG_VT
kd_mksound = mac_mksound;
#ifdef CONFIG_INPUT_M68K_BEEP
mach_beep = mac_mksound;
#endif
#ifdef CONFIG_HEARTBEAT
#if 0
......@@ -287,10 +242,6 @@ void __init config_mac(void)
|| macintosh_config->ident == MAC_MODEL_IIFX) {
mach_l2_flush = mac_cache_card_flush;
}
#ifdef MAC_DEBUG_SOUND
/* goes on forever if timers broken */
mac_mksound(1000,10);
#endif
/*
* Check for machine specific fixups.
......
......@@ -45,8 +45,6 @@ static void mvme147_get_model(char *model);
static int mvme147_get_hardware_list(char *buffer);
extern int mvme147_request_irq (unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id);
extern void mvme147_sched_init(void (*handler)(int, void *, struct pt_regs *));
extern int mvme147_keyb_init(void);
extern int mvme147_kbdrate (struct kbd_repeat *);
extern unsigned long mvme147_gettimeoffset (void);
extern int mvme147_hwclk (int, struct rtc_time *);
extern int mvme147_set_clock_mmss (unsigned long);
......@@ -70,11 +68,6 @@ int mvme147_parse_bootinfo(const struct bi_record *bi)
return 1;
}
int mvme147_kbdrate (struct kbd_repeat *k)
{
return 0;
}
void mvme147_reset()
{
printk ("\r\n\nCalled mvme147_reset\r\n");
......@@ -102,10 +95,6 @@ void __init config_mvme147(void)
{
mach_max_dma_address = 0x01000000;
mach_sched_init = mvme147_sched_init;
#ifdef CONFIG_VT
mach_keyb_init = mvme147_keyb_init;
mach_kbdrate = mvme147_kbdrate;
#endif
mach_init_IRQ = mvme147_init_IRQ;
mach_gettimeoffset = mvme147_gettimeoffset;
mach_hwclk = mvme147_hwclk;
......
......@@ -49,12 +49,9 @@ static void mvme16x_get_model(char *model);
static int mvme16x_get_hardware_list(char *buffer);
extern int mvme16x_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id);
extern void mvme16x_sched_init(void (*handler)(int, void *, struct pt_regs *));
extern int mvme16x_keyb_init(void);
extern int mvme16x_kbdrate (struct kbd_repeat *);
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_mksound( unsigned int count, unsigned int ticks );
extern void mvme16x_reset (void);
extern void mvme16x_waitbut(void);
......@@ -77,15 +74,6 @@ int mvme16x_parse_bootinfo(const struct bi_record *bi)
return 1;
}
int mvme16x_kbdrate (struct kbd_repeat *k)
{
return 0;
}
void mvme16x_mksound( unsigned int count, unsigned int ticks )
{
}
void mvme16x_reset()
{
printk ("\r\n\nCalled mvme16x_reset\r\n"
......@@ -144,17 +132,10 @@ void __init config_mvme16x(void)
mach_max_dma_address = 0xffffffff;
mach_sched_init = mvme16x_sched_init;
#ifdef CONFIG_VT
mach_keyb_init = mvme16x_keyb_init;
mach_kbdrate = mvme16x_kbdrate;
#endif
mach_init_IRQ = mvme16x_init_IRQ;
mach_gettimeoffset = mvme16x_gettimeoffset;
mach_hwclk = mvme16x_hwclk;
mach_set_clock_mmss = mvme16x_set_clock_mmss;
#ifdef CONFIG_VT
/* kd_mksound = mvme16x_mksound; */
#endif
mach_reset = mvme16x_reset;
mach_free_irq = mvme16x_free_irq;
mach_process_int = mvme16x_process_int;
......@@ -301,8 +282,3 @@ int mvme16x_set_clock_mmss (unsigned long nowtime)
return 0;
}
int mvme16x_keyb_init (void)
{
return 0;
}
......@@ -36,12 +36,9 @@
#include <asm/rtc.h>
#include <asm/machdep.h>
#include <asm/q40_master.h>
#include <asm/keyboard.h>
extern void floppy_setup(char *str, int *ints);
extern int q40kbd_translate(unsigned char scancode, unsigned char *keycode,
char raw_mode);
extern void q40_process_int (int level, struct pt_regs *regs);
extern void (*q40_sys_default_handler[]) (int, void *, struct pt_regs *); /* added just for debugging */
extern void q40_init_IRQ (void);
......@@ -62,8 +59,6 @@ void q40_halt(void);
extern void q40_waitbut(void);
void q40_set_vectors (void);
void q40_mksound(unsigned int /*freq*/, unsigned int /*ticks*/ );
extern char *saved_command_line;
extern char m68k_debug_device[];
static void q40_mem_console_write(struct console *co, const char *b,
......@@ -82,14 +77,6 @@ static struct console q40_console_driver = {
extern char *q40_mem_cptr; /*=(char *)0xff020000;*/
static int _cpleft;
#if 0
int q40_kbd_translate(unsigned char keycode, unsigned char *keycodep, char raw_mode)
{
*keycodep = keycode;
return 1;
}
#endif
static void q40_mem_console_write(struct console *co, const char *s,
unsigned int count)
{
......@@ -117,13 +104,6 @@ void printq40(char *str)
}
#endif
#if 0
int q40_kbdrate (struct kbd_repeat *k)
{
return 0;
}
#endif
static int halted=0;
#ifdef CONFIG_HEARTBEAT
......@@ -185,10 +165,6 @@ void __init config_q40(void)
{
mach_sched_init = q40_sched_init;
#ifdef CONFIG_VT
mach_keyb_init = q40kbd_init_hw;
mach_kbd_translate = q40kbd_translate;
#endif
mach_init_IRQ = q40_init_IRQ;
mach_gettimeoffset = q40_gettimeoffset;
mach_hwclk = q40_hwclk;
......@@ -204,12 +180,9 @@ void __init config_q40(void)
mach_default_handler = &q40_sys_default_handler;
mach_get_model = q40_get_model;
mach_get_hardware_list = q40_get_hardware_list;
#ifdef CONFIG_VT
kd_mksound = q40_mksound;
#endif
#ifdef CONFIG_MAGIC_SYSRQ
mach_sysrq_key = 0x54;
#ifdef CONFIG_INPUT_M68K_BEEP
mach_beep = q40_mksound;
#endif
#ifdef CONFIG_HEARTBEAT
mach_heartbeat = q40_heartbeat;
......
......@@ -8,4 +8,7 @@ dep_tristate ' PC Speaker support' CONFIG_INPUT_PCSPKR $CONFIG_INPUT $CONFIG_IN
if [ "$CONFIG_SPARC32" = "y" -o "$CONFIG_SPARC64" = "y" ]; then
dep_tristate ' SPARC Speaker support' CONFIG_INPUT_SPARCSPKR $CONFIG_INPUT $CONFIG_INPUT_MISC
fi
if [ "$CONFIG_M68K" = "y" ]; then
dep_tristate ' M68K Beeper support' CONFIG_INPUT_M68K_BEEP $CONFIG_INPUT $CONFIG_INPUT_MISC
fi
dep_tristate ' User level driver support' CONFIG_INPUT_UINPUT $CONFIG_INPUT $CONFIG_INPUT_MISC
......@@ -6,6 +6,7 @@
obj-$(CONFIG_INPUT_SPARCSPKR) += sparcspkr.o
obj-$(CONFIG_INPUT_PCSPKR) += pcspkr.o
obj-$(CONFIG_INPUT_M68K_BEEP) += m68kspkr.o
obj-$(CONFIG_INPUT_UINPUT) += uinput.o
# The global Rules.make.
......
/*
* m68k beeper driver for Linux
*
* Copyright (c) 2002 Richard Zidlicky
* Copyright (c) 2002 Vojtech Pavlik
* Copyright (c) 1992 Orest Zborowski
*
*/
/*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/input.h>
#include <asm/machdep.h>
#include <asm/io.h>
MODULE_AUTHOR("Richard Zidlicky <rz@linux-m68k.org>");
MODULE_DESCRIPTION("m68k beeper driver");
MODULE_LICENSE("GPL");
static char m68kspkr_name[] = "m68k beeper";
static char m68kspkr_phys[] = "m68k/generic";
static struct input_dev m68kspkr_dev;
static int m68kspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
{
unsigned int count = 0;
unsigned long flags;
if (type != EV_SND)
return -1;
switch (code) {
case SND_BELL: if (value) value = 1000;
case SND_TONE: break;
default: return -1;
}
if (value > 20 && value < 32767)
count = 1193182 / value;
mach_beep(count, -1);
return 0;
}
static int __init m68kspkr_init(void)
{
if (!mach_beep){
printk("%s: no lowlevel beep support\n", m68kspkr_name);
return -1;
}
m68kspkr_dev.evbit[0] = BIT(EV_SND);
m68kspkr_dev.sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE);
m68kspkr_dev.event = m68kspkr_event;
m68kspkr_dev.name = m68kspkr_name;
m68kspkr_dev.phys = m68kspkr_phys;
m68kspkr_dev.id.bustype = BUS_HOST;
m68kspkr_dev.id.vendor = 0x001f;
m68kspkr_dev.id.product = 0x0001;
m68kspkr_dev.id.version = 0x0100;
input_register_device(&m68kspkr_dev);
printk(KERN_INFO "input: %s\n", m68kspkr_name);
return 0;
}
static void __exit m68kspkr_exit(void)
{
input_unregister_device(&m68kspkr_dev);
}
module_init(m68kspkr_init);
module_exit(m68kspkr_exit);
......@@ -4,17 +4,12 @@
#include <linux/seq_file.h>
struct pt_regs;
struct kbd_repeat;
struct mktime;
struct rtc_time;
struct rtc_pll_info;
struct buffer_head;
extern void (*mach_sched_init) (void (*handler)(int, void *, struct pt_regs *));
/* machine dependent keyboard functions */
extern int (*mach_keyb_init) (void);
extern int (*mach_kbdrate) (struct kbd_repeat *);
extern void (*mach_kbd_leds) (unsigned int);
extern int (*mach_kbd_translate)(unsigned char scancode, unsigned char *keycode, char raw_mode);
/* machine dependent irq functions */
extern void (*mach_init_IRQ) (void);
extern void (*(*mach_default_handler)[]) (int, void *, struct pt_regs *);
......@@ -28,6 +23,8 @@ extern void (*mach_process_int) (int irq, struct pt_regs *fp);
/* machine dependent timer functions */
extern unsigned long (*mach_gettimeoffset)(void);
extern int (*mach_hwclk)(int, struct rtc_time*);
extern int (*mach_get_rtc_pll)(struct rtc_pll_info *);
extern int (*mach_set_rtc_pll)(struct rtc_pll_info *);
extern int (*mach_set_clock_mmss)(unsigned long);
extern void (*mach_reset)( void );
extern void (*mach_halt)( void );
......@@ -38,9 +35,6 @@ extern long mach_max_dma_address;
extern void (*mach_floppy_setup)(char *, int *);
extern void (*mach_heartbeat) (int);
extern void (*mach_l2_flush) (int);
extern int mach_sysrq_key;
extern int mach_sysrq_shift_state;
extern int mach_sysrq_shift_mask;
extern char *mach_sysrq_xlate;
extern void (*mach_beep) (unsigned int, unsigned int);
#endif /* _M68K_MACHDEP_H */
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