141120Sjdp/*	$NetBSD: opmbellio.h,v 1.6 2024/01/07 07:58:33 isaki Exp $	*/
2103976Spst
341120Sjdp/*
441120Sjdp * Copyright (c) 1995 Takuya Harakawa.
541120Sjdp * All rights reserved.
641120Sjdp *
741120Sjdp * Redistribution and use in source and binary forms, with or without
841120Sjdp * modification, are permitted provided that the following conditions
941120Sjdp * are met:
1041120Sjdp * 1. Redistributions of source code must retain the above copyright
1141120Sjdp *    notice, this list of conditions and the following disclaimer.
1241120Sjdp * 2. Redistributions in binary form must reproduce the above copyright
1341120Sjdp *    notice, this list of conditions and the following disclaimer in the
1441120Sjdp *    documentation and/or other materials provided with the distribution.
1541120Sjdp * 3. All advertising materials mentioning features or use of this software
1641120Sjdp *    must display the following acknowledgement:
1741120Sjdp *      This product includes software developed by Minoura Makoto.
1841120Sjdp * 4. The name of the author may not be used to endorse or promote products
1941120Sjdp *    derived from this software without specific prior written permission
2041120Sjdp *
2141120Sjdp * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
2241120Sjdp * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2341120Sjdp * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2441120Sjdp * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2541120Sjdp * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2641120Sjdp * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2741120Sjdp * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2841120Sjdp * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2941120Sjdp * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3041120Sjdp * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3141120Sjdp */
3241120Sjdp
3341120Sjdp/*
3441120Sjdp * Copyright (c) 1990 The Regents of the University of California.
3541120Sjdp * All rights reserved.
3641120Sjdp *
3741120Sjdp * Redistribution and use in source and binary forms, with or without
3841120Sjdp * modification, are permitted provided that the following conditions
3941120Sjdp * are met:
4041120Sjdp * 1. Redistributions of source code must retain the above copyright
4141120Sjdp *    notice, this list of conditions and the following disclaimer.
4241120Sjdp * 2. Redistributions in binary form must reproduce the above copyright
4341120Sjdp *    notice, this list of conditions and the following disclaimer in the
44103976Spst *    documentation and/or other materials provided with the distribution.
45103976Spst * 3. Neither the name of the University nor the names of its contributors
46103976Spst *    may be used to endorse or promote products derived from this software
47103976Spst *    without specific prior written permission.
4841120Sjdp *
4941120Sjdp * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
5041120Sjdp * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
5141120Sjdp * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
5241120Sjdp * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
5341120Sjdp * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
5441120Sjdp * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
5541120Sjdp * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
5641120Sjdp * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
5741120Sjdp * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
5841120Sjdp * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
5941120Sjdp * SUCH DAMAGE.
6041120Sjdp *
6141120Sjdp *	$NetBSD: opmbellio.h,v 1.6 2024/01/07 07:58:33 isaki Exp $
6241120Sjdp */
6341120Sjdp
6441120Sjdp#ifndef _X68K_OPMBELLIO_H_
6541120Sjdp#define _X68K_OPMBELLIO_H_
6641120Sjdp#ifndef _IOCTL_
6741120Sjdp#include <sys/ioctl.h>
6841120Sjdp#endif
6941120Sjdp#include <machine/opmreg.h>
7041120Sjdp
7141120Sjdpstruct bell_info {
7241120Sjdp    int	volume;
7341120Sjdp    int	pitch;
7441120Sjdp    int	msec;
7541120Sjdp};
7641120Sjdp
7741120Sjdp/* default values */
7841120Sjdp#define BELL_VOLUME	100	/* percentage */
7941120Sjdp#define BELL_PITCH	440
8041120Sjdp#define BELL_DURATION	100
8141120Sjdp#define BELL_CHANNEL	7
8241120Sjdp
8341120Sjdp/* Initial Voice Parameter; struct opm_voice */
8441120Sjdp#define DEFAULT_BELL_VOICE {				\
8541120Sjdp/*  AR  DR  SR  RR  SL  OL  KS  ML DT1 DT2 AME  */	\
8641120Sjdp  { 31,  0,  0,  0,  0, 39,  1,  1,  0,  0,  0, },	\
8741120Sjdp  { 19, 11,  0, 11,  4, 37,  0,  2,  0,  0,  0, },	\
8841120Sjdp  { 31, 15,  0,  9,  0, 55,  1,  4,  0,  0,  0, },	\
89103976Spst  { 19, 15,  0,  9,  0,  0,  1,  1,  0,  0,  0, },	\
90103976Spst/*  CON FL  OP  */					\
91103976Spst    3,  7, 15						\
92103976Spst}
93103976Spst
94103976Spst/* limits */
95103976Spst#define	MAXBVOLUME	100	/* 100 percent */
96103976Spst#define	MAXBPITCH	4698
97103976Spst#define MINBPITCH	20
98103976Spst#define MAXBTIME	5000	/* 5 seconds */
99103976Spst
100103976Spst#define BELLIOCSPARAM	_IOW('B', 0x1, struct bell_info)
101103976Spst#define BELLIOCGPARAM	_IOR('B', 0x2, struct bell_info)
102103976Spst#define BELLIOCSVOICE	_IOW('B', 0x3, struct opm_voice)
103103976Spst#define BELLIOCGVOICE	_IOR('B', 0x4, struct opm_voice)
104103976Spst
105103976Spst#endif
10641120Sjdp