xref: /openbsd/sys/dev/pci/fmsreg.h (revision d874cce4)
1*d874cce4Sray /*	$OpenBSD: fmsreg.h,v 1.3 2008/06/26 05:42:17 ray Exp $	*/
2a40ea746Smickey /*	$NetBSD: fms.c,v 1.5.4.1 2000/06/30 16:27:50 simonb Exp $	*/
3a40ea746Smickey 
4a40ea746Smickey /*-
5a40ea746Smickey  * Copyright (c) 1999 The NetBSD Foundation, Inc.
6a40ea746Smickey  * All rights reserved.
7a40ea746Smickey  *
8a40ea746Smickey  * This code is derived from software contributed to The NetBSD Foundation
9a40ea746Smickey  * by Witold J. Wnuk.
10a40ea746Smickey  *
11a40ea746Smickey  * Redistribution and use in source and binary forms, with or without
12a40ea746Smickey  * modification, are permitted provided that the following conditions
13a40ea746Smickey  * are met:
14a40ea746Smickey  * 1. Redistributions of source code must retain the above copyright
15a40ea746Smickey  *    notice, this list of conditions and the following disclaimer.
16a40ea746Smickey  * 2. Redistributions in binary form must reproduce the above copyright
17a40ea746Smickey  *    notice, this list of conditions and the following disclaimer in the
18a40ea746Smickey  *    documentation and/or other materials provided with the distribution.
19a40ea746Smickey  *
20a40ea746Smickey  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
21a40ea746Smickey  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22a40ea746Smickey  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23a40ea746Smickey  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24a40ea746Smickey  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25a40ea746Smickey  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26a40ea746Smickey  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27a40ea746Smickey  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28a40ea746Smickey  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29a40ea746Smickey  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30a40ea746Smickey  * POSSIBILITY OF SUCH DAMAGE.
31a40ea746Smickey  */
32a40ea746Smickey 
33a40ea746Smickey 
34a40ea746Smickey #ifndef _DEV_PCI_FMSREG_H_
35a40ea746Smickey #define _DEV_PCI_FMSREG_H_
36a40ea746Smickey 
37a40ea746Smickey #define FM_PCM_VOLUME		0x00
38a40ea746Smickey #define FM_FM_VOLUME		0x02
39a40ea746Smickey #define FM_I2S_VOLUME		0x04
40a40ea746Smickey #define FM_RECORD_SOURCE	0x06
41a40ea746Smickey 
42a40ea746Smickey #define FM_PLAY_CTL		0x08
43a40ea746Smickey #define  FM_PLAY_RATE_MASK		0x0f00
44a40ea746Smickey #define  FM_PLAY_BUF1_LAST		0x0001
45a40ea746Smickey #define  FM_PLAY_BUF2_LAST		0x0002
46a40ea746Smickey #define  FM_PLAY_START			0x0020
47a40ea746Smickey #define  FM_PLAY_PAUSE			0x0040
48a40ea746Smickey #define  FM_PLAY_STOPNOW		0x0080
49a40ea746Smickey #define  FM_PLAY_16BIT			0x4000
50a40ea746Smickey #define  FM_PLAY_STEREO			0x8000
51a40ea746Smickey 
52a40ea746Smickey #define FM_PLAY_DMALEN		0x0a
53a40ea746Smickey #define FM_PLAY_DMABUF1		0x0c
54a40ea746Smickey #define FM_PLAY_DMABUF2		0x10
55a40ea746Smickey 
56a40ea746Smickey 
57a40ea746Smickey #define FM_REC_CTL		0x14
58a40ea746Smickey #define  FM_REC_RATE_MASK		0x0f00
59a40ea746Smickey #define  FM_REC_BUF1_LAST		0x0001
60a40ea746Smickey #define  FM_REC_BUF2_LAST		0x0002
61a40ea746Smickey #define  FM_REC_START			0x0020
62a40ea746Smickey #define  FM_REC_PAUSE			0x0040
63a40ea746Smickey #define  FM_REC_STOPNOW			0x0080
64a40ea746Smickey #define  FM_REC_16BIT			0x4000
65a40ea746Smickey #define  FM_REC_STEREO			0x8000
66a40ea746Smickey 
67a40ea746Smickey 
68a40ea746Smickey #define FM_REC_DMALEN		0x16
69a40ea746Smickey #define FM_REC_DMABUF1		0x18
70a40ea746Smickey #define FM_REC_DMABUF2		0x1c
71a40ea746Smickey 
72a40ea746Smickey #define FM_CODEC_CTL		0x22
73a40ea746Smickey #define FM_VOLUME		0x26
74a40ea746Smickey #define  FM_VOLUME_MUTE			0x8000
75a40ea746Smickey 
76a40ea746Smickey #define FM_CODEC_CMD		0x2a
77a40ea746Smickey #define  FM_CODEC_CMD_READ		0x0080
78a40ea746Smickey #define  FM_CODEC_CMD_VALID		0x0100
79a40ea746Smickey #define  FM_CODEC_CMD_BUSY		0x0200
80a40ea746Smickey 
81a40ea746Smickey #define FM_CODEC_DATA		0x2c
82a40ea746Smickey 
83a40ea746Smickey #define FM_IO_CTL		0x52
84acf3fc98Smickey #define  FM_IO_GPIO(x)			((x) << 12)
85acf3fc98Smickey #define  FM_IO_GPIO_ALL			FM_IO_GPIO(0xf)
86acf3fc98Smickey #define  FM_IO_GPIO_IN(x)		((x) << 8)
87acf3fc98Smickey #define  FM_IO_PIN0			0x0001
88acf3fc98Smickey #define  FM_IO_PIN1			0x0002
89acf3fc98Smickey #define  FM_IO_PIN2			0x0004
90acf3fc98Smickey #define  FM_IO_PIN3			0x0008
91a40ea746Smickey 
92a40ea746Smickey #define FM_CARD_CTL		0x54
93a40ea746Smickey 
94a40ea746Smickey #define FM_INTMASK		0x56
95a40ea746Smickey #define  FM_INTMASK_PLAY		0x0001
96a40ea746Smickey #define  FM_INTMASK_REC			0x0002
97a40ea746Smickey #define  FM_INTMASK_VOL			0x0040
98a40ea746Smickey #define  FM_INTMASK_MPU			0x0080
99a40ea746Smickey 
100a40ea746Smickey #define FM_INTSTATUS		0x5a
101a40ea746Smickey #define  FM_INTSTATUS_PLAY		0x0100
102a40ea746Smickey #define  FM_INTSTATUS_REC		0x0200
103a40ea746Smickey #define  FM_INTSTATUS_VOL		0x4000
104a40ea746Smickey #define  FM_INTSTATUS_MPU		0x8000
105a40ea746Smickey 
106a40ea746Smickey #endif /* _DEV_PCI_FMSREG_H_ */
107