summaryrefslogtreecommitdiffstats
path: root/drivers/sound/vidc_synth.c
blob: 7e6797e8ee3c93668d6da569d3c1e10aeb7bdfe5 (plain)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
 * drivers/sound/vidc_synth.c
 *
 * Synthesizer routines for the VIDC
 *
 * Copyright (C) 1997 Russell King <rmk@arm.uk.linux.org>
 */

#include "sound_config.h"
#include "vidc.h"

static struct synth_info vidc_info =
{
	"VIDCsound",		/* name                 */
	0,			/* device               */
	SYNTH_TYPE_SAMPLE,	/* synth_type           */
	0,			/* synth_subtype        */
	0,			/* perc_mode            */
	16,			/* nr_voices            */
	0,			/* nr_drums             */
	0,			/* instr_bank_size      */
	0,			/* capabilities         */
};

int             vidc_sdev;
int             vidc_synth_volume;

static int vidc_synth_open(int dev, int mode)
{
	if (vidc_busy)
		return -EBUSY;

	vidc_busy = 1;
	return 0;
}

static void vidc_synth_close(int dev)
{
	vidc_busy = 0;
}


static struct synth_operations vidc_synth_operations =
{
	&vidc_info,		/* info                 */
	0,			/* midi_dev             */
	SYNTH_TYPE_SAMPLE,	/* synth_type           */
				/*SAMPLE_TYPE_XXX */ 0,
				/* SAMPLE_TYPE GUS *//* synth_subtype                */
	vidc_synth_open,	/* open                 */
	vidc_synth_close,	/* close                */
	NULL,			/* ioctl                */
	NULL,			/* kill_note            */
	NULL,			/* start_note           */
	NULL,			/* set_instr            */
	NULL,			/* reset                */
	NULL,			/* hw_control           */
	NULL,			/* load_patch           */
	NULL,			/* aftertouch           */
	NULL,			/* controller           */
	NULL,			/* panning              */
	NULL,			/* volume_method        */
	NULL,			/* patchmgr             */
	NULL,			/* bender               */
	NULL,			/* alloc                */
	NULL,			/* setup_voice          */
	NULL,			/* send_sysex           */
				/* alloc                */
				/* chn_info[16]         */
};

int  vidc_synth_get_volume(void)
{
	return vidc_synth_volume;
}

int vidc_synth_set_volume(int newvol)
{
	return vidc_synth_volume = newvol;
}

void vidc_synth_init(struct address_info *hw_config)
{
	vidc_synth_volume = 100 | (100 << 8);
	if ((vidc_sdev=sound_alloc_synthdev())!=-1)
		synth_devs[vidc_sdev] = &vidc_synth_operations;
	else
		printk(KERN_ERR "VIDCsound: Too many synthesizers\n");
}