/* $NetBSD: opl3sa3reg.h,v 1.5 2008/04/28 20:23:51 martin Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by ITOH Yasufumi.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* YAMAHA YMF711 (OPL3 Single-chip Audio System 2; OPL3-SA2)
* YAMAHA YMF715x (OPL3 Single-chip Audio System 3; OPL3-SA3)
* control register description
*
* Other ports (SBpro, WSS CODEC, MPU401, OPL3, etc.) are NOT listed here.
*/
/* [2]: OPL3-SA2 only, [3]: OPL3-SA3 only */
/*
* direct registers
*/
/* offset from the base address */
#define SA3_CTL_INDEX 0 /* Index port (R/W) */
#define SA3_CTL_DATA 1 /* Data register port (R/W) */
#define SA3_CTL_NPORT 2 /* number of ports */
/*
* indirect registers
*/
#define SA3_PWR_MNG 0x01 /* Power management (R/W) */
#define SA2_PWR_MNG_SRST 0x80 /* [2] Software reset */
#define SA3_PWR_MNG_ADOWN 0x20 /* [3] Analog Down */
#define SA2_PWR_MNG_CLKO 0x10 /* [2] Master Clock disable */
#define SA2_PWR_MNG_FMPS 0x08 /* [2] OPL3 power down */
#define SA3_PWR_MNG_PSV 0x04 /* Power save */
#define SA3_PWR_MNG_PDN 0x02 /* Power down */
#define SA3_PWR_MNG_PDX 0x01 /* Oscillation stop */
#define SA3_PWR_MNG_DEFAULT 0x00 /* default value */
#define SA3_SYS_CTL 0x02 /* System control (R/W) */
#define SA3_SYS_CTL_SBHE 0x80 /* 0: AT-bus, 1: XT-bus */
#define SA3_SYS_CTL_YMODE 0x30 /* [3] 3D Enhancement mode */
#define SA3_SYS_CTL_YMODE0 0x00 /* Desktop mode (speaker 5-12cm) */
#define SA3_SYS_CTL_YMODE1 0x10 /* Notebook PC mode (1) (3cm) */
#define SA3_SYS_CTL_YMODE2 0x20 /* Notebook PC mode (2) (1.5cm) */
#define SA3_SYS_CTL_YMODE3 0x30 /* Hi-Fi mode (16-38cm) */
#define SA3_SYS_CTL_IDSEL 0x06 /* Specify DSP version of SBPro */
#define SA3_SYS_CTL_IDSEL0 0x00 /* major 0x03, minor 0x01 */
#define SA3_SYS_CTL_IDSEL1 0x02 /* major 0x02, minor 0x01 */
#define SA3_SYS_CTL_IDSEL2 0x04 /* major 0x01, minor 0x05 */
#define SA3_SYS_CTL_IDSEL3 0x06 /* major 0x00, minor 0x00 */
#define SA3_SYS_CTL_VZE 0x01 /* ZV */
#define SA3_SYS_CTL_DEFAULT 0x00 /* default value */
/* WSS DMA Base counters (R/W) used for suspend/resume */
#define SA3_DMA_CNT_PLAY_LOW 0x0b /* Playback Base Counter (Low) */
#define SA3_DMA_CNT_PLAY_HIGH 0x0c /* Playback Base Counter (High) */
#define SA3_DMA_CNT_REC_LOW 0x0d /* Recording Base Counter (Low) */
#define SA3_DMA_CNT_REC_HIGH 0x0e /* Recording Base Counter (High) */
/* [3] */
#define SA3_WSS_INT_SCAN 0x0f /* WSS Interrupt Scan out/in (R/W)*/
#define SA3_WSS_INT_SCAN_STI 0x04 /* 1: TI = "1" and IRQ active */
#define SA3_WSS_INT_SCAN_SCI 0x02 /* 1: CI = "1" and IRQ active */
#define SA3_WSS_INT_SCAN_SPI 0x01 /* 1: PI = "1" and IRQ active */
#define SA3_WSS_INT_DEFAULT 0x00 /* default value */
/* [3] */
#define SA3_SB_SCAN 0x10 /* SB Internal State Scan out/in (R/W)*/
#define SA3_SB_SCAN_SBPDA 0x80 /* Sound Blaster Power Down ack */
#define SA3_SB_SCAN_SS 0x08 /* Scan Select */
#define SA3_SB_SCAN_SM 0x04 /* Scan Mode 1: read out, 0: write in */
#define SA3_SB_SCAN_SE 0x02 /* Scan Enable */
#define SA3_SB_SCAN_SBPDR 0x01 /* Sound Blaster Power Down Request */
#define SA3_SB_SCAN_DEFAULT 0x00 /* default value */
/* [3] */
#define SA3_SB_SCAN_DATA 0x11 /* SB Internal State Scan Data (R/W)*/
/* [3] */
#define SA3_DPWRDWN 0x12 /* Digital Partial Power Down (R/W) */
#define SA3_DPWRDWN_JOY 0x80 /* Joystick power down */
#define SA3_DPWRDWN_MPU 0x40 /* MPU401 power down */
#define SA3_DPWRDWN_MCLKO 0x20 /* Master Clock disable */
#define SA3_DPWRDWN_FM 0x10 /* FM (OPL3) power down */
#define SA3_DPWRDWN_WSS_R 0x08 /* WSS recording power down */
#define SA3_DPWRDWN_WSS_P 0x04 /* WSS playback power down */
#define SA3_DPWRDWN_SB 0x02 /* Sound Blaster power down */
#define SA3_DPWRDWN_PNP 0x01 /* PnP power down */
#define SA3_DPWRDWN_DEFAULT 0x00 /* default value */
/* [3] */
#define SA3_APWRDWN 0x13 /* Analog Partial Power Down (R/W) */
#define SA3_APWRDWN_FMDAC 0x10 /* FMDAC for OPL3 power down */
#define SA3_APWRDWN_AD 0x08 /* A/D for WSS recording power down */
#define SA3_APWRDWN_DA 0x04 /* D/A for WSS playback power down */
#define SA3_APWRDWN_SBDAC 0x02 /* D/A for SB power down */
#define SA3_APWRDWN_WIDE 0x01 /* Wide Stereo power down */
#define SA3_APWRDWN_DEFAULT 0x00 /* default value */
/* [3] */
#define SA3_3D_WIDE 0x14 /* 3D Enhanced control (WIDE) (R/W) */
#define SA3_3D_WIDE_WIDER 0x70 /* Rch of wide 3D enhanced control */
#define SA3_3D_WIDE_WIDEL 0x07 /* Lch of wide 3D enhanced control */
#define SA3_3D_WIDE_DEFAULT 0x00 /* default value */
/* [3] */
#define SA3_3D_BASS 0x15 /* 3D Enhanced control (BASS) (R/W) */
#define SA3_3D_BASS_BASSR 0x70 /* Rch of bass 3D enhanced control */
#define SA3_3D_BASS_BASSL 0x07 /* Lch of bass 3D enhanced control */
#define SA3_3D_BASS_DEFAULT 0x00 /* default value */
/* [3] */
#define SA3_3D_TREBLE 0x16 /* 3D Enhanced control (TREBLE) (R/W) */
#define SA3_3D_TREBLE_TRER 0x70 /* Rch of treble 3D enhanced control */
#define SA3_3D_TREBLE_TREL 0x07 /* Lch of treble 3D enhanced control */
#define SA3_3D_TREBLE_DEFAULT 0x00 /* default value */
/* common to the 3D enhance registers */
#define SA3_3D_BITS 0x07
#define SA3_3D_LSHIFT 0
#define SA3_3D_RSHIFT 4