xref: /netbsd-src/sys/dev/midi_mod.c (revision d2d4d4364b9d8722beb6d7447a1f362b0d25ddd3)
1*d2d4d436Spgoyette /*	$NetBSD: midi_mod.c,v 1.1 2022/06/04 03:31:10 pgoyette Exp $ */
2*d2d4d436Spgoyette 
3*d2d4d436Spgoyette /*
4*d2d4d436Spgoyette  * Copyright (c) 2022 The NetBSD Foundation, Inc.
5*d2d4d436Spgoyette  * All rights reserved.
6*d2d4d436Spgoyette  *
7*d2d4d436Spgoyette  * This code is derived from software contributed to The NetBSD Foundation
8*d2d4d436Spgoyette  * by Paul Goyette
9*d2d4d436Spgoyette  *
10*d2d4d436Spgoyette  * Redistribution and use in source and binary forms, with or without
11*d2d4d436Spgoyette  * modification, are permitted provided that the following conditions
12*d2d4d436Spgoyette  * are met:
13*d2d4d436Spgoyette  * 1. Redistributions of source code must retain the above copyright
14*d2d4d436Spgoyette  *    notice, this list of conditions and the following disclaimer.
15*d2d4d436Spgoyette  * 2. Redistributions in binary form must reproduce the above copyright
16*d2d4d436Spgoyette  *    notice, this list of conditions and the following disclaimer in the
17*d2d4d436Spgoyette  *    documentation and/or other materials provided with the distribution.
18*d2d4d436Spgoyette  *
19*d2d4d436Spgoyette  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20*d2d4d436Spgoyette  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21*d2d4d436Spgoyette  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22*d2d4d436Spgoyette  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23*d2d4d436Spgoyette  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24*d2d4d436Spgoyette  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25*d2d4d436Spgoyette  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26*d2d4d436Spgoyette  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27*d2d4d436Spgoyette  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28*d2d4d436Spgoyette  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29*d2d4d436Spgoyette  * POSSIBILITY OF SUCH DAMAGE.
30*d2d4d436Spgoyette  */
31*d2d4d436Spgoyette 
32*d2d4d436Spgoyette #include <sys/cdefs.h>
33*d2d4d436Spgoyette __KERNEL_RCSID(0, "$NetBSD: midi_mod.c,v 1.1 2022/06/04 03:31:10 pgoyette Exp $");
34*d2d4d436Spgoyette 
35*d2d4d436Spgoyette #include <sys/param.h>
36*d2d4d436Spgoyette #include <sys/systm.h>
37*d2d4d436Spgoyette #include <sys/kernel.h>
38*d2d4d436Spgoyette #include <sys/module.h>
39*d2d4d436Spgoyette 
40*d2d4d436Spgoyette /*
41*d2d4d436Spgoyette  * The midi module itself doesn't do anything.  It exists only to
42*d2d4d436Spgoyette  * ensure that the combo-module for midi-plus-sequencer is loaded.
43*d2d4d436Spgoyette  * This allows us to have both midi and sequencer code to refer
44*d2d4d436Spgoyette  * to each other, avoiding a circular module dependency.
45*d2d4d436Spgoyette  */
46*d2d4d436Spgoyette 
47*d2d4d436Spgoyette MODULE(MODULE_CLASS_DRIVER, midi, "midi_seq");
48*d2d4d436Spgoyette 
49*d2d4d436Spgoyette static int
midi_modcmd(modcmd_t cmd,void * arg)50*d2d4d436Spgoyette midi_modcmd(modcmd_t cmd, void *arg)
51*d2d4d436Spgoyette {
52*d2d4d436Spgoyette 	int error = 0;
53*d2d4d436Spgoyette 
54*d2d4d436Spgoyette 	switch (cmd) {
55*d2d4d436Spgoyette 	case MODULE_CMD_INIT:
56*d2d4d436Spgoyette 	case MODULE_CMD_FINI:
57*d2d4d436Spgoyette 		break;
58*d2d4d436Spgoyette 	default:
59*d2d4d436Spgoyette 		error = ENOTTY;
60*d2d4d436Spgoyette 		break;
61*d2d4d436Spgoyette 	}
62*d2d4d436Spgoyette 	return error;
63*d2d4d436Spgoyette }
64