2005-04-17 00:20:36 +02:00
|
|
|
/*
|
|
|
|
* Driver for PC-speaker like devices found on various Sparc systems.
|
|
|
|
*
|
|
|
|
* Copyright (c) 2002 Vojtech Pavlik
|
2008-04-27 06:02:21 +02:00
|
|
|
* Copyright (c) 2002, 2006, 2008 David S. Miller (davem@davemloft.net)
|
2005-04-17 00:20:36 +02:00
|
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/input.h>
|
2008-04-27 06:02:21 +02:00
|
|
|
#include <linux/of_device.h>
|
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.
percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.
http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.
* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.
* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.
The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.
2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.
3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.
4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.
5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.
6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).
* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig
8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.
Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-24 09:04:11 +01:00
|
|
|
#include <linux/slab.h>
|
2005-04-17 00:20:36 +02:00
|
|
|
|
|
|
|
#include <asm/io.h>
|
|
|
|
|
2006-06-23 10:44:10 +02:00
|
|
|
MODULE_AUTHOR("David S. Miller <davem@davemloft.net>");
|
2005-09-15 09:01:51 +02:00
|
|
|
MODULE_DESCRIPTION("Sparc Speaker beeper driver");
|
2005-04-17 00:20:36 +02:00
|
|
|
MODULE_LICENSE("GPL");
|
|
|
|
|
2008-04-27 06:02:21 +02:00
|
|
|
struct grover_beep_info {
|
|
|
|
void __iomem *freq_regs;
|
|
|
|
void __iomem *enable_reg;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct bbc_beep_info {
|
|
|
|
u32 clock_freq;
|
|
|
|
void __iomem *regs;
|
|
|
|
};
|
|
|
|
|
2006-06-23 10:44:10 +02:00
|
|
|
struct sparcspkr_state {
|
|
|
|
const char *name;
|
|
|
|
int (*event)(struct input_dev *dev, unsigned int type, unsigned int code, int value);
|
|
|
|
spinlock_t lock;
|
|
|
|
struct input_dev *input_dev;
|
2008-04-27 06:02:21 +02:00
|
|
|
union {
|
|
|
|
struct grover_beep_info grover;
|
|
|
|
struct bbc_beep_info bbc;
|
|
|
|
} u;
|
2006-06-23 10:44:10 +02:00
|
|
|
};
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2008-04-27 06:02:21 +02:00
|
|
|
static u32 bbc_count_to_reg(struct bbc_beep_info *info, unsigned int count)
|
|
|
|
{
|
|
|
|
u32 val, clock_freq = info->clock_freq;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (!count)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
if (count <= clock_freq >> 20)
|
|
|
|
return 1 << 18;
|
|
|
|
|
|
|
|
if (count >= clock_freq >> 12)
|
|
|
|
return 1 << 10;
|
|
|
|
|
|
|
|
val = 1 << 18;
|
|
|
|
for (i = 19; i >= 11; i--) {
|
|
|
|
val >>= 1;
|
|
|
|
if (count <= clock_freq >> i)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return val;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int bbc_spkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
2007-04-12 07:35:32 +02:00
|
|
|
struct sparcspkr_state *state = dev_get_drvdata(dev->dev.parent);
|
2008-04-27 06:02:21 +02:00
|
|
|
struct bbc_beep_info *info = &state->u.bbc;
|
2005-04-17 00:20:36 +02:00
|
|
|
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;
|
|
|
|
|
2008-04-27 06:02:21 +02:00
|
|
|
count = bbc_count_to_reg(info, count);
|
|
|
|
|
2006-06-23 10:44:10 +02:00
|
|
|
spin_lock_irqsave(&state->lock, flags);
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2008-04-27 06:02:21 +02:00
|
|
|
if (count) {
|
|
|
|
outb(0x01, info->regs + 0);
|
|
|
|
outb(0x00, info->regs + 2);
|
|
|
|
outb((count >> 16) & 0xff, info->regs + 3);
|
|
|
|
outb((count >> 8) & 0xff, info->regs + 4);
|
|
|
|
outb(0x00, info->regs + 5);
|
|
|
|
} else {
|
|
|
|
outb(0x00, info->regs + 0);
|
|
|
|
}
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2006-06-23 10:44:10 +02:00
|
|
|
spin_unlock_irqrestore(&state->lock, flags);
|
2005-04-17 00:20:36 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-04-27 06:02:21 +02:00
|
|
|
static int grover_spkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
2007-04-12 07:35:32 +02:00
|
|
|
struct sparcspkr_state *state = dev_get_drvdata(dev->dev.parent);
|
2008-04-27 06:02:21 +02:00
|
|
|
struct grover_beep_info *info = &state->u.grover;
|
2005-04-17 00:20:36 +02:00
|
|
|
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;
|
|
|
|
|
2006-06-23 10:44:10 +02:00
|
|
|
spin_lock_irqsave(&state->lock, flags);
|
2005-04-17 00:20:36 +02:00
|
|
|
|
|
|
|
if (count) {
|
|
|
|
/* enable counter 2 */
|
2008-04-27 06:02:21 +02:00
|
|
|
outb(inb(info->enable_reg) | 3, info->enable_reg);
|
2005-04-17 00:20:36 +02:00
|
|
|
/* set command for counter 2, 2 byte write */
|
2008-04-27 06:02:21 +02:00
|
|
|
outb(0xB6, info->freq_regs + 1);
|
2005-04-17 00:20:36 +02:00
|
|
|
/* select desired HZ */
|
2008-04-27 06:02:21 +02:00
|
|
|
outb(count & 0xff, info->freq_regs + 0);
|
|
|
|
outb((count >> 8) & 0xff, info->freq_regs + 0);
|
2005-04-17 00:20:36 +02:00
|
|
|
} else {
|
|
|
|
/* disable counter 2 */
|
2008-04-27 06:02:21 +02:00
|
|
|
outb(inb_p(info->enable_reg) & 0xFC, info->enable_reg);
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
2006-06-23 10:44:10 +02:00
|
|
|
spin_unlock_irqrestore(&state->lock, flags);
|
2005-04-17 00:20:36 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-11-24 06:38:25 +01:00
|
|
|
static int sparcspkr_probe(struct device *dev)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
2006-06-23 10:44:10 +02:00
|
|
|
struct sparcspkr_state *state = dev_get_drvdata(dev);
|
2005-12-21 06:52:35 +01:00
|
|
|
struct input_dev *input_dev;
|
|
|
|
int error;
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2005-12-21 06:52:35 +01:00
|
|
|
input_dev = input_allocate_device();
|
|
|
|
if (!input_dev)
|
2005-09-15 09:01:51 +02:00
|
|
|
return -ENOMEM;
|
|
|
|
|
2006-06-23 10:44:10 +02:00
|
|
|
input_dev->name = state->name;
|
2005-12-21 06:52:35 +01:00
|
|
|
input_dev->phys = "sparc/input0";
|
|
|
|
input_dev->id.bustype = BUS_ISA;
|
|
|
|
input_dev->id.vendor = 0x001f;
|
|
|
|
input_dev->id.product = 0x0001;
|
|
|
|
input_dev->id.version = 0x0100;
|
2007-04-12 07:35:32 +02:00
|
|
|
input_dev->dev.parent = dev;
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2007-10-19 08:40:32 +02:00
|
|
|
input_dev->evbit[0] = BIT_MASK(EV_SND);
|
|
|
|
input_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE);
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2006-06-23 10:44:10 +02:00
|
|
|
input_dev->event = state->event;
|
2005-12-21 06:52:35 +01:00
|
|
|
|
|
|
|
error = input_register_device(input_dev);
|
|
|
|
if (error) {
|
|
|
|
input_free_device(input_dev);
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
2006-06-23 10:44:10 +02:00
|
|
|
state->input_dev = input_dev;
|
2005-04-17 00:20:36 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2005-12-21 06:52:35 +01:00
|
|
|
|
2011-02-23 04:01:33 +01:00
|
|
|
static void sparcspkr_shutdown(struct platform_device *dev)
|
2005-12-21 06:52:35 +01:00
|
|
|
{
|
2013-05-23 18:20:21 +02:00
|
|
|
struct sparcspkr_state *state = platform_get_drvdata(dev);
|
2006-06-23 10:44:10 +02:00
|
|
|
struct input_dev *input_dev = state->input_dev;
|
2005-12-21 06:52:35 +01:00
|
|
|
|
|
|
|
/* turn off the speaker */
|
2006-06-23 10:44:10 +02:00
|
|
|
state->event(input_dev, EV_SND, SND_BELL, 0);
|
2005-12-21 06:52:35 +01:00
|
|
|
}
|
|
|
|
|
2012-11-24 06:38:25 +01:00
|
|
|
static int bbc_beep_probe(struct platform_device *op)
|
2005-12-21 06:52:35 +01:00
|
|
|
{
|
2008-04-27 06:02:21 +02:00
|
|
|
struct sparcspkr_state *state;
|
|
|
|
struct bbc_beep_info *info;
|
|
|
|
struct device_node *dp;
|
|
|
|
int err = -ENOMEM;
|
2006-06-23 10:44:10 +02:00
|
|
|
|
2008-04-27 06:02:21 +02:00
|
|
|
state = kzalloc(sizeof(*state), GFP_KERNEL);
|
|
|
|
if (!state)
|
|
|
|
goto out_err;
|
|
|
|
|
|
|
|
state->name = "Sparc BBC Speaker";
|
|
|
|
state->event = bbc_spkr_event;
|
|
|
|
spin_lock_init(&state->lock);
|
|
|
|
|
|
|
|
dp = of_find_node_by_path("/");
|
|
|
|
err = -ENODEV;
|
|
|
|
if (!dp)
|
|
|
|
goto out_free;
|
|
|
|
|
|
|
|
info = &state->u.bbc;
|
|
|
|
info->clock_freq = of_getintprop_default(dp, "clock-frequency", 0);
|
|
|
|
if (!info->clock_freq)
|
|
|
|
goto out_free;
|
|
|
|
|
|
|
|
info->regs = of_ioremap(&op->resource[0], 0, 6, "bbc beep");
|
|
|
|
if (!info->regs)
|
|
|
|
goto out_free;
|
|
|
|
|
2013-05-23 18:20:21 +02:00
|
|
|
platform_set_drvdata(op, state);
|
2008-04-27 06:02:21 +02:00
|
|
|
|
|
|
|
err = sparcspkr_probe(&op->dev);
|
|
|
|
if (err)
|
|
|
|
goto out_clear_drvdata;
|
2006-06-23 10:44:10 +02:00
|
|
|
|
|
|
|
return 0;
|
2008-04-27 06:02:21 +02:00
|
|
|
|
|
|
|
out_clear_drvdata:
|
|
|
|
of_iounmap(&op->resource[0], info->regs, 6);
|
|
|
|
|
|
|
|
out_free:
|
|
|
|
kfree(state);
|
|
|
|
out_err:
|
|
|
|
return err;
|
2006-06-23 10:44:10 +02:00
|
|
|
}
|
|
|
|
|
2012-11-24 06:50:47 +01:00
|
|
|
static int bbc_remove(struct platform_device *op)
|
2006-06-23 10:44:10 +02:00
|
|
|
{
|
2013-05-23 18:20:21 +02:00
|
|
|
struct sparcspkr_state *state = platform_get_drvdata(op);
|
2008-04-27 06:02:21 +02:00
|
|
|
struct input_dev *input_dev = state->input_dev;
|
|
|
|
struct bbc_beep_info *info = &state->u.bbc;
|
2006-06-23 10:44:10 +02:00
|
|
|
|
2008-04-27 06:02:21 +02:00
|
|
|
/* turn off the speaker */
|
|
|
|
state->event(input_dev, EV_SND, SND_BELL, 0);
|
2006-06-23 10:44:10 +02:00
|
|
|
|
2008-04-27 06:02:21 +02:00
|
|
|
input_unregister_device(input_dev);
|
2006-06-23 10:44:10 +02:00
|
|
|
|
2008-04-27 06:02:21 +02:00
|
|
|
of_iounmap(&op->resource[0], info->regs, 6);
|
2006-06-23 10:44:10 +02:00
|
|
|
|
2008-04-27 06:02:21 +02:00
|
|
|
kfree(state);
|
2006-06-23 10:44:10 +02:00
|
|
|
|
|
|
|
return 0;
|
2005-12-21 06:52:35 +01:00
|
|
|
}
|
|
|
|
|
2008-08-31 10:23:17 +02:00
|
|
|
static const struct of_device_id bbc_beep_match[] = {
|
2006-06-23 10:44:10 +02:00
|
|
|
{
|
|
|
|
.name = "beep",
|
2008-04-27 06:02:21 +02:00
|
|
|
.compatible = "SUNW,bbc-beep",
|
2005-12-21 06:52:35 +01:00
|
|
|
},
|
2006-06-23 10:44:10 +02:00
|
|
|
{},
|
2005-12-21 06:52:35 +01:00
|
|
|
};
|
|
|
|
|
2011-02-23 04:01:33 +01:00
|
|
|
static struct platform_driver bbc_beep_driver = {
|
2010-04-14 01:13:02 +02:00
|
|
|
.driver = {
|
|
|
|
.name = "bbcbeep",
|
|
|
|
.owner = THIS_MODULE,
|
|
|
|
.of_match_table = bbc_beep_match,
|
|
|
|
},
|
2008-04-27 06:02:21 +02:00
|
|
|
.probe = bbc_beep_probe,
|
2012-11-24 06:27:39 +01:00
|
|
|
.remove = bbc_remove,
|
2006-06-23 10:44:10 +02:00
|
|
|
.shutdown = sparcspkr_shutdown,
|
|
|
|
};
|
2005-12-21 06:52:35 +01:00
|
|
|
|
2012-11-24 06:38:25 +01:00
|
|
|
static int grover_beep_probe(struct platform_device *op)
|
2005-12-21 06:52:35 +01:00
|
|
|
{
|
2006-06-23 10:44:10 +02:00
|
|
|
struct sparcspkr_state *state;
|
2008-04-27 06:02:21 +02:00
|
|
|
struct grover_beep_info *info;
|
|
|
|
int err = -ENOMEM;
|
2005-12-21 06:52:35 +01:00
|
|
|
|
2006-06-23 10:44:10 +02:00
|
|
|
state = kzalloc(sizeof(*state), GFP_KERNEL);
|
|
|
|
if (!state)
|
2008-04-27 06:02:21 +02:00
|
|
|
goto out_err;
|
2005-12-21 06:52:35 +01:00
|
|
|
|
2008-04-27 06:02:21 +02:00
|
|
|
state->name = "Sparc Grover Speaker";
|
|
|
|
state->event = grover_spkr_event;
|
2006-06-23 10:44:10 +02:00
|
|
|
spin_lock_init(&state->lock);
|
|
|
|
|
2008-04-27 06:02:21 +02:00
|
|
|
info = &state->u.grover;
|
|
|
|
info->freq_regs = of_ioremap(&op->resource[2], 0, 2, "grover beep freq");
|
|
|
|
if (!info->freq_regs)
|
|
|
|
goto out_free;
|
2005-12-21 06:52:35 +01:00
|
|
|
|
2008-04-27 06:02:21 +02:00
|
|
|
info->enable_reg = of_ioremap(&op->resource[3], 0, 1, "grover beep enable");
|
|
|
|
if (!info->enable_reg)
|
|
|
|
goto out_unmap_freq_regs;
|
|
|
|
|
2013-05-23 18:20:21 +02:00
|
|
|
platform_set_drvdata(op, state);
|
2008-04-27 06:02:21 +02:00
|
|
|
|
|
|
|
err = sparcspkr_probe(&op->dev);
|
|
|
|
if (err)
|
|
|
|
goto out_clear_drvdata;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
out_clear_drvdata:
|
|
|
|
of_iounmap(&op->resource[3], info->enable_reg, 1);
|
|
|
|
|
|
|
|
out_unmap_freq_regs:
|
|
|
|
of_iounmap(&op->resource[2], info->freq_regs, 2);
|
|
|
|
out_free:
|
|
|
|
kfree(state);
|
|
|
|
out_err:
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
|
2012-11-24 06:50:47 +01:00
|
|
|
static int grover_remove(struct platform_device *op)
|
2008-04-27 06:02:21 +02:00
|
|
|
{
|
2013-05-23 18:20:21 +02:00
|
|
|
struct sparcspkr_state *state = platform_get_drvdata(op);
|
2008-04-27 06:02:21 +02:00
|
|
|
struct grover_beep_info *info = &state->u.grover;
|
|
|
|
struct input_dev *input_dev = state->input_dev;
|
|
|
|
|
|
|
|
/* turn off the speaker */
|
|
|
|
state->event(input_dev, EV_SND, SND_BELL, 0);
|
|
|
|
|
|
|
|
input_unregister_device(input_dev);
|
|
|
|
|
|
|
|
of_iounmap(&op->resource[3], info->enable_reg, 1);
|
|
|
|
of_iounmap(&op->resource[2], info->freq_regs, 2);
|
|
|
|
|
|
|
|
kfree(state);
|
2005-12-21 06:52:35 +01:00
|
|
|
|
|
|
|
return 0;
|
2006-06-23 10:44:10 +02:00
|
|
|
}
|
2005-12-21 06:52:35 +01:00
|
|
|
|
2008-08-31 10:23:17 +02:00
|
|
|
static const struct of_device_id grover_beep_match[] = {
|
2006-06-23 10:44:10 +02:00
|
|
|
{
|
2008-04-27 06:02:21 +02:00
|
|
|
.name = "beep",
|
|
|
|
.compatible = "SUNW,smbus-beep",
|
2006-06-23 10:44:10 +02:00
|
|
|
},
|
|
|
|
{},
|
|
|
|
};
|
2005-12-21 06:52:35 +01:00
|
|
|
|
2011-02-23 04:01:33 +01:00
|
|
|
static struct platform_driver grover_beep_driver = {
|
2010-04-14 01:13:02 +02:00
|
|
|
.driver = {
|
|
|
|
.name = "groverbeep",
|
|
|
|
.owner = THIS_MODULE,
|
|
|
|
.of_match_table = grover_beep_match,
|
|
|
|
},
|
2008-04-27 06:02:21 +02:00
|
|
|
.probe = grover_beep_probe,
|
2012-11-24 06:27:39 +01:00
|
|
|
.remove = grover_remove,
|
2006-06-23 10:44:10 +02:00
|
|
|
.shutdown = sparcspkr_shutdown,
|
|
|
|
};
|
2005-04-17 00:20:36 +02:00
|
|
|
|
|
|
|
static int __init sparcspkr_init(void)
|
|
|
|
{
|
2011-02-23 04:01:33 +01:00
|
|
|
int err = platform_driver_register(&bbc_beep_driver);
|
2006-06-23 10:44:10 +02:00
|
|
|
|
|
|
|
if (!err) {
|
2011-02-23 04:01:33 +01:00
|
|
|
err = platform_driver_register(&grover_beep_driver);
|
2006-06-23 10:44:10 +02:00
|
|
|
if (err)
|
2011-02-23 04:01:33 +01:00
|
|
|
platform_driver_unregister(&bbc_beep_driver);
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
2006-06-23 10:44:10 +02:00
|
|
|
return err;
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void __exit sparcspkr_exit(void)
|
|
|
|
{
|
2011-02-23 04:01:33 +01:00
|
|
|
platform_driver_unregister(&bbc_beep_driver);
|
|
|
|
platform_driver_unregister(&grover_beep_driver);
|
2005-04-17 00:20:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
module_init(sparcspkr_init);
|
|
|
|
module_exit(sparcspkr_exit);
|