pcspkr.c (292dd876ee765c478b27c93cc51e93a558ed58bf) pcspkr.c (e5c6c8e457d16c7cbc12f849ad18d4d508950de2)
1/*
2 * PC Speaker beeper driver for Linux
3 *
4 * Copyright (c) 2002 Vojtech Pavlik
5 * Copyright (c) 1992 Orest Zborowski
6 *
7 */
8

--- 10 unchanged lines hidden (view full) ---

19#include <linux/platform_device.h>
20#include <asm/8253pit.h>
21#include <asm/io.h>
22
23MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
24MODULE_DESCRIPTION("PC Speaker beeper driver");
25MODULE_LICENSE("GPL");
26
1/*
2 * PC Speaker beeper driver for Linux
3 *
4 * Copyright (c) 2002 Vojtech Pavlik
5 * Copyright (c) 1992 Orest Zborowski
6 *
7 */
8

--- 10 unchanged lines hidden (view full) ---

19#include <linux/platform_device.h>
20#include <asm/8253pit.h>
21#include <asm/io.h>
22
23MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
24MODULE_DESCRIPTION("PC Speaker beeper driver");
25MODULE_LICENSE("GPL");
26
27static struct platform_device *pcspkr_platform_device;
28static DEFINE_SPINLOCK(i8253_beep_lock);
29
30static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
31{
32 unsigned int count = 0;
33 unsigned long flags;
34
35 if (type != EV_SND)

--- 94 unchanged lines hidden (view full) ---

130 .remove = __devexit_p(pcspkr_remove),
131 .suspend = pcspkr_suspend,
132 .shutdown = pcspkr_shutdown,
133};
134
135
136static int __init pcspkr_init(void)
137{
27static DEFINE_SPINLOCK(i8253_beep_lock);
28
29static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
30{
31 unsigned int count = 0;
32 unsigned long flags;
33
34 if (type != EV_SND)

--- 94 unchanged lines hidden (view full) ---

129 .remove = __devexit_p(pcspkr_remove),
130 .suspend = pcspkr_suspend,
131 .shutdown = pcspkr_shutdown,
132};
133
134
135static int __init pcspkr_init(void)
136{
138 int err;
139
140 err = platform_driver_register(&pcspkr_platform_driver);
141 if (err)
142 return err;
143
144 pcspkr_platform_device = platform_device_alloc("pcspkr", -1);
145 if (!pcspkr_platform_device) {
146 err = -ENOMEM;
147 goto err_unregister_driver;
148 }
149
150 err = platform_device_add(pcspkr_platform_device);
151 if (err)
152 goto err_free_device;
153
154 return 0;
155
156 err_free_device:
157 platform_device_put(pcspkr_platform_device);
158 err_unregister_driver:
159 platform_driver_unregister(&pcspkr_platform_driver);
160
161 return err;
137 return platform_driver_register(&pcspkr_platform_driver);
162}
163
164static void __exit pcspkr_exit(void)
165{
138}
139
140static void __exit pcspkr_exit(void)
141{
166 platform_device_unregister(pcspkr_platform_device);
167 platform_driver_unregister(&pcspkr_platform_driver);
168}
169
170module_init(pcspkr_init);
171module_exit(pcspkr_exit);
142 platform_driver_unregister(&pcspkr_platform_driver);
143}
144
145module_init(pcspkr_init);
146module_exit(pcspkr_exit);