tice, this list of conditions, and the following disclaimer,
 *    without modification.
 * 2. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * Alternatively, this software may be distributed and/or modified under the
 * terms of the GNU General Public License as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option) any later
 * version.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
 */

#include "opl4_local.h"
#include <linux/delay.h>
#include <asm/io.h>
#include <sound/asoundef.h>

/* GM2 controllers */
#ifndef MIDI_CTL_RELEASE_TIME
#define MIDI_CTL_RELEASE_TIME	0x48
#define MIDI_CTL_ATTACK_TIME	0x49
#define MIDI_CTL_DECAY_TIME	0x4b
#define MIDI_CTL_VIBRATO_RATE	0x4c
#define MIDI_CTL_VIBRATO_DEPTH	0x4d
#define MIDI_CTL_VIBRATO_DELAY	0x4e
#endif

/*
 * This table maps 100/128 cents to F_NUMBER.
 */
static const s16 snd_opl4_pitch_map[0x600] = {
	0x000,0x000,0x001,0x001,0x002,0x002,0x003,0x003,
	0x004,0x004,0x005,0x005,0x006,0x006,0x006,0x007,
	0x007,0x008,0x008,0x009,0x009,0x00a,0x00a,0x00b,
	0x00b,0x00c,0x00c,0x00d,0x00d,0x00d,0x00e,0x00e,
	0x00f,0x00f,0x010,0x010,0x011,0x011,0x012,0x012,
	0x013,0x013,0x014,0x014,0x015,0x015,0x015,0x016,
	0x016,0x017,0x