File: adlib_card.c

package info (click to toggle)
kernel-image-2.4.17-hppa 32.4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 156,356 kB
  • ctags: 442,585
  • sloc: ansic: 2,542,442; asm: 144,771; makefile: 8,468; sh: 3,097; perl: 2,578; yacc: 1,177; tcl: 577; lex: 352; awk: 251; lisp: 218; sed: 72
file content (73 lines) | stat: -rw-r--r-- 1,389 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
 * sound/adlib_card.c
 *
 * Detection routine for the AdLib card.
 *
 * Copyright (C) by Hannu Savolainen 1993-1997
 *
 * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
 * Version 2 (June 1991). See the "COPYING" file distributed with this software
 * for more info.
 */

#include <linux/module.h>
#include <linux/init.h>

#include "sound_config.h"

#include "opl3.h"

static void __init attach_adlib_card(struct address_info *hw_config)
{
	hw_config->slots[0] = opl3_init(hw_config->io_base, hw_config->osp, THIS_MODULE);
}

static int __init probe_adlib(struct address_info *hw_config)
{
	return opl3_detect(hw_config->io_base, hw_config->osp);
}

static struct address_info cfg;

static int __initdata io = -1;

MODULE_PARM(io, "i");

static int __init init_adlib(void)
{
	cfg.io_base = io;

	if (cfg.io_base == -1) {
		printk(KERN_ERR "adlib: must specify I/O address.\n");
		return -EINVAL;
	}
	if (probe_adlib(&cfg) == 0)
		return -ENODEV;
	attach_adlib_card(&cfg);

	return 0;
}

static void __exit cleanup_adlib(void)
{
	sound_unload_synthdev(cfg.slots[0]);
	
}

module_init(init_adlib);
module_exit(cleanup_adlib);

#ifndef MODULE
static int __init setup_adlib(char *str)
{
        /* io */
	int ints[2];
	str = get_options(str, ARRAY_SIZE(ints), ints);
	
	io = ints[1];

	return 1;
}
__setup("adlib=", setup_adlib);
#endif
MODULE_LICENSE("GPL");