16 #include <linux/kernel.h>
17 #include <linux/module.h>
19 #include <linux/input.h>
21 #include <asm/machdep.h>
30 static int m68kspkr_event(
struct input_dev *
dev,
unsigned int type,
unsigned int code,
int value)
32 unsigned int count = 0;
38 case SND_BELL:
if (value) value = 1000;
43 if (value > 20 && value < 32767)
44 count = 1193182 /
value;
53 struct input_dev *input_dev;
56 input_dev = input_allocate_device();
60 input_dev->name =
"m68k beeper";
61 input_dev->phys =
"m68k/generic";
63 input_dev->id.vendor = 0x001f;
64 input_dev->id.product = 0x0001;
65 input_dev->id.version = 0x0100;
66 input_dev->dev.parent = &dev->
dev;
70 input_dev->event = m68kspkr_event;
72 err = input_register_device(input_dev);
74 input_free_device(input_dev);
78 platform_set_drvdata(dev, input_dev);
85 struct input_dev *input_dev = platform_get_drvdata(dev);
87 input_unregister_device(input_dev);
88 platform_set_drvdata(dev,
NULL);
106 .probe = m68kspkr_probe,
108 .shutdown = m68kspkr_shutdown,
111 static int __init m68kspkr_init(
void)
125 if (!m68kspkr_platform_device) {
127 goto err_unregister_driver;
132 goto err_free_device;
138 err_unregister_driver:
144 static void __exit m68kspkr_exit(
void)