11a59d1b8SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
21da177e4SLinus Torvalds #ifndef __SOUND_GUS_H
31da177e4SLinus Torvalds #define __SOUND_GUS_H
41da177e4SLinus Torvalds
51da177e4SLinus Torvalds /*
61da177e4SLinus Torvalds * Global structures used for GUS part of ALSA driver
7c1017a4cSJaroslav Kysela * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
81da177e4SLinus Torvalds */
91da177e4SLinus Torvalds
10a1ce3928SDavid Howells #include <sound/pcm.h>
11a1ce3928SDavid Howells #include <sound/rawmidi.h>
12a1ce3928SDavid Howells #include <sound/timer.h>
13a1ce3928SDavid Howells #include <sound/seq_midi_emul.h>
14a1ce3928SDavid Howells #include <sound/seq_device.h>
156cbbfe1cSTakashi Iwai #include <linux/io.h>
161da177e4SLinus Torvalds
171da177e4SLinus Torvalds /* IO ports */
181da177e4SLinus Torvalds
191da177e4SLinus Torvalds #define GUSP(gus, x) ((gus)->gf1.port + SNDRV_g_u_s_##x)
201da177e4SLinus Torvalds
211da177e4SLinus Torvalds #define SNDRV_g_u_s_MIDICTRL (0x320-0x220)
221da177e4SLinus Torvalds #define SNDRV_g_u_s_MIDISTAT (0x320-0x220)
231da177e4SLinus Torvalds #define SNDRV_g_u_s_MIDIDATA (0x321-0x220)
241da177e4SLinus Torvalds
251da177e4SLinus Torvalds #define SNDRV_g_u_s_GF1PAGE (0x322-0x220)
261da177e4SLinus Torvalds #define SNDRV_g_u_s_GF1REGSEL (0x323-0x220)
271da177e4SLinus Torvalds #define SNDRV_g_u_s_GF1DATALOW (0x324-0x220)
281da177e4SLinus Torvalds #define SNDRV_g_u_s_GF1DATAHIGH (0x325-0x220)
291da177e4SLinus Torvalds #define SNDRV_g_u_s_IRQSTAT (0x226-0x220)
301da177e4SLinus Torvalds #define SNDRV_g_u_s_TIMERCNTRL (0x228-0x220)
311da177e4SLinus Torvalds #define SNDRV_g_u_s_TIMERDATA (0x229-0x220)
321da177e4SLinus Torvalds #define SNDRV_g_u_s_DRAM (0x327-0x220)
331da177e4SLinus Torvalds #define SNDRV_g_u_s_MIXCNTRLREG (0x220-0x220)
341da177e4SLinus Torvalds #define SNDRV_g_u_s_IRQDMACNTRLREG (0x22b-0x220)
351da177e4SLinus Torvalds #define SNDRV_g_u_s_REGCNTRLS (0x22f-0x220)
361da177e4SLinus Torvalds #define SNDRV_g_u_s_BOARDVERSION (0x726-0x220)
371da177e4SLinus Torvalds #define SNDRV_g_u_s_MIXCNTRLPORT (0x726-0x220)
381da177e4SLinus Torvalds #define SNDRV_g_u_s_IVER (0x325-0x220)
391da177e4SLinus Torvalds #define SNDRV_g_u_s_MIXDATAPORT (0x326-0x220)
401da177e4SLinus Torvalds #define SNDRV_g_u_s_MAXCNTRLPORT (0x326-0x220)
411da177e4SLinus Torvalds
421da177e4SLinus Torvalds /* GF1 registers */
431da177e4SLinus Torvalds
441da177e4SLinus Torvalds /* global registers */
451da177e4SLinus Torvalds #define SNDRV_GF1_GB_ACTIVE_VOICES 0x0e
461da177e4SLinus Torvalds #define SNDRV_GF1_GB_VOICES_IRQ 0x0f
471da177e4SLinus Torvalds #define SNDRV_GF1_GB_GLOBAL_MODE 0x19
481da177e4SLinus Torvalds #define SNDRV_GF1_GW_LFO_BASE 0x1a
491da177e4SLinus Torvalds #define SNDRV_GF1_GB_VOICES_IRQ_READ 0x1f
501da177e4SLinus Torvalds #define SNDRV_GF1_GB_DRAM_DMA_CONTROL 0x41
511da177e4SLinus Torvalds #define SNDRV_GF1_GW_DRAM_DMA_LOW 0x42
521da177e4SLinus Torvalds #define SNDRV_GF1_GW_DRAM_IO_LOW 0x43
531da177e4SLinus Torvalds #define SNDRV_GF1_GB_DRAM_IO_HIGH 0x44
541da177e4SLinus Torvalds #define SNDRV_GF1_GB_SOUND_BLASTER_CONTROL 0x45
551da177e4SLinus Torvalds #define SNDRV_GF1_GB_ADLIB_TIMER_1 0x46
561da177e4SLinus Torvalds #define SNDRV_GF1_GB_ADLIB_TIMER_2 0x47
571da177e4SLinus Torvalds #define SNDRV_GF1_GB_RECORD_RATE 0x48
581da177e4SLinus Torvalds #define SNDRV_GF1_GB_REC_DMA_CONTROL 0x49
591da177e4SLinus Torvalds #define SNDRV_GF1_GB_JOYSTICK_DAC_LEVEL 0x4b
601da177e4SLinus Torvalds #define SNDRV_GF1_GB_RESET 0x4c
611da177e4SLinus Torvalds #define SNDRV_GF1_GB_DRAM_DMA_HIGH 0x50
621da177e4SLinus Torvalds #define SNDRV_GF1_GW_DRAM_IO16 0x51
631da177e4SLinus Torvalds #define SNDRV_GF1_GW_MEMORY_CONFIG 0x52
641da177e4SLinus Torvalds #define SNDRV_GF1_GB_MEMORY_CONTROL 0x53
651da177e4SLinus Torvalds #define SNDRV_GF1_GW_FIFO_RECORD_BASE_ADDR 0x54
661da177e4SLinus Torvalds #define SNDRV_GF1_GW_FIFO_PLAY_BASE_ADDR 0x55
671da177e4SLinus Torvalds #define SNDRV_GF1_GW_FIFO_SIZE 0x56
681da177e4SLinus Torvalds #define SNDRV_GF1_GW_INTERLEAVE 0x57
691da177e4SLinus Torvalds #define SNDRV_GF1_GB_COMPATIBILITY 0x59
701da177e4SLinus Torvalds #define SNDRV_GF1_GB_DECODE_CONTROL 0x5a
711da177e4SLinus Torvalds #define SNDRV_GF1_GB_VERSION_NUMBER 0x5b
721da177e4SLinus Torvalds #define SNDRV_GF1_GB_MPU401_CONTROL_A 0x5c
731da177e4SLinus Torvalds #define SNDRV_GF1_GB_MPU401_CONTROL_B 0x5d
741da177e4SLinus Torvalds #define SNDRV_GF1_GB_EMULATION_IRQ 0x60
751da177e4SLinus Torvalds /* voice specific registers */
761da177e4SLinus Torvalds #define SNDRV_GF1_VB_ADDRESS_CONTROL 0x00
771da177e4SLinus Torvalds #define SNDRV_GF1_VW_FREQUENCY 0x01
781da177e4SLinus Torvalds #define SNDRV_GF1_VW_START_HIGH 0x02
791da177e4SLinus Torvalds #define SNDRV_GF1_VW_START_LOW 0x03
801da177e4SLinus Torvalds #define SNDRV_GF1_VA_START SNDRV_GF1_VW_START_HIGH
811da177e4SLinus Torvalds #define SNDRV_GF1_VW_END_HIGH 0x04
821da177e4SLinus Torvalds #define SNDRV_GF1_VW_END_LOW 0x05
831da177e4SLinus Torvalds #define SNDRV_GF1_VA_END SNDRV_GF1_VW_END_HIGH
841da177e4SLinus Torvalds #define SNDRV_GF1_VB_VOLUME_RATE 0x06
851da177e4SLinus Torvalds #define SNDRV_GF1_VB_VOLUME_START 0x07
861da177e4SLinus Torvalds #define SNDRV_GF1_VB_VOLUME_END 0x08
871da177e4SLinus Torvalds #define SNDRV_GF1_VW_VOLUME 0x09
881da177e4SLinus Torvalds #define SNDRV_GF1_VW_CURRENT_HIGH 0x0a
891da177e4SLinus Torvalds #define SNDRV_GF1_VW_CURRENT_LOW 0x0b
901da177e4SLinus Torvalds #define SNDRV_GF1_VA_CURRENT SNDRV_GF1_VW_CURRENT_HIGH
911da177e4SLinus Torvalds #define SNDRV_GF1_VB_PAN 0x0c
921da177e4SLinus Torvalds #define SNDRV_GF1_VW_OFFSET_RIGHT 0x0c
931da177e4SLinus Torvalds #define SNDRV_GF1_VB_VOLUME_CONTROL 0x0d
941da177e4SLinus Torvalds #define SNDRV_GF1_VB_UPPER_ADDRESS 0x10
951da177e4SLinus Torvalds #define SNDRV_GF1_VW_EFFECT_HIGH 0x11
961da177e4SLinus Torvalds #define SNDRV_GF1_VW_EFFECT_LOW 0x12
971da177e4SLinus Torvalds #define SNDRV_GF1_VA_EFFECT SNDRV_GF1_VW_EFFECT_HIGH
981da177e4SLinus Torvalds #define SNDRV_GF1_VW_OFFSET_LEFT 0x13
991da177e4SLinus Torvalds #define SNDRV_GF1_VB_ACCUMULATOR 0x14
1001da177e4SLinus Torvalds #define SNDRV_GF1_VB_MODE 0x15
1011da177e4SLinus Torvalds #define SNDRV_GF1_VW_EFFECT_VOLUME 0x16
1021da177e4SLinus Torvalds #define SNDRV_GF1_VB_FREQUENCY_LFO 0x17
1031da177e4SLinus Torvalds #define SNDRV_GF1_VB_VOLUME_LFO 0x18
1041da177e4SLinus Torvalds #define SNDRV_GF1_VW_OFFSET_RIGHT_FINAL 0x1b
1051da177e4SLinus Torvalds #define SNDRV_GF1_VW_OFFSET_LEFT_FINAL 0x1c
1061da177e4SLinus Torvalds #define SNDRV_GF1_VW_EFFECT_VOLUME_FINAL 0x1d
1071da177e4SLinus Torvalds
1081da177e4SLinus Torvalds /* ICS registers */
1091da177e4SLinus Torvalds
1101da177e4SLinus Torvalds #define SNDRV_ICS_MIC_DEV 0
1111da177e4SLinus Torvalds #define SNDRV_ICS_LINE_DEV 1
1121da177e4SLinus Torvalds #define SNDRV_ICS_CD_DEV 2
1131da177e4SLinus Torvalds #define SNDRV_ICS_GF1_DEV 3
1141da177e4SLinus Torvalds #define SNDRV_ICS_NONE_DEV 4
1151da177e4SLinus Torvalds #define SNDRV_ICS_MASTER_DEV 5
1161da177e4SLinus Torvalds
1171da177e4SLinus Torvalds /* LFO */
1181da177e4SLinus Torvalds
1191da177e4SLinus Torvalds #define SNDRV_LFO_TREMOLO 0
1201da177e4SLinus Torvalds #define SNDRV_LFO_VIBRATO 1
1211da177e4SLinus Torvalds
1221da177e4SLinus Torvalds /* misc */
1231da177e4SLinus Torvalds
1241da177e4SLinus Torvalds #define SNDRV_GF1_DMA_UNSIGNED 0x80
1251da177e4SLinus Torvalds #define SNDRV_GF1_DMA_16BIT 0x40
1261da177e4SLinus Torvalds #define SNDRV_GF1_DMA_IRQ 0x20
1271da177e4SLinus Torvalds #define SNDRV_GF1_DMA_WIDTH16 0x04
1281da177e4SLinus Torvalds #define SNDRV_GF1_DMA_READ 0x02 /* read from GUS's DRAM */
1291da177e4SLinus Torvalds #define SNDRV_GF1_DMA_ENABLE 0x01
1301da177e4SLinus Torvalds
1311da177e4SLinus Torvalds /* ramp ranges */
1321da177e4SLinus Torvalds
1331da177e4SLinus Torvalds #define SNDRV_GF1_ATTEN(x) (snd_gf1_atten_table[x])
1341da177e4SLinus Torvalds #define SNDRV_GF1_MIN_VOLUME 1800
1351da177e4SLinus Torvalds #define SNDRV_GF1_MAX_VOLUME 4095
1361da177e4SLinus Torvalds #define SNDRV_GF1_MIN_OFFSET (SNDRV_GF1_MIN_VOLUME>>4)
1371da177e4SLinus Torvalds #define SNDRV_GF1_MAX_OFFSET 255
1381da177e4SLinus Torvalds #define SNDRV_GF1_MAX_TDEPTH 90
1391da177e4SLinus Torvalds
1401da177e4SLinus Torvalds /* defines for memory manager */
1411da177e4SLinus Torvalds
1421da177e4SLinus Torvalds #define SNDRV_GF1_MEM_BLOCK_16BIT 0x0001
1431da177e4SLinus Torvalds
1441da177e4SLinus Torvalds #define SNDRV_GF1_MEM_OWNER_DRIVER 0x0001
1451da177e4SLinus Torvalds #define SNDRV_GF1_MEM_OWNER_WAVE_SIMPLE 0x0002
1461da177e4SLinus Torvalds #define SNDRV_GF1_MEM_OWNER_WAVE_GF1 0x0003
1471da177e4SLinus Torvalds #define SNDRV_GF1_MEM_OWNER_WAVE_IWFFFF 0x0004
1481da177e4SLinus Torvalds
1491da177e4SLinus Torvalds /* constants for interrupt handlers */
1501da177e4SLinus Torvalds
1511da177e4SLinus Torvalds #define SNDRV_GF1_HANDLER_MIDI_OUT 0x00010000
1521da177e4SLinus Torvalds #define SNDRV_GF1_HANDLER_MIDI_IN 0x00020000
1531da177e4SLinus Torvalds #define SNDRV_GF1_HANDLER_TIMER1 0x00040000
1541da177e4SLinus Torvalds #define SNDRV_GF1_HANDLER_TIMER2 0x00080000
1551da177e4SLinus Torvalds #define SNDRV_GF1_HANDLER_VOICE 0x00100000
1561da177e4SLinus Torvalds #define SNDRV_GF1_HANDLER_DMA_WRITE 0x00200000
1571da177e4SLinus Torvalds #define SNDRV_GF1_HANDLER_DMA_READ 0x00400000
1581da177e4SLinus Torvalds #define SNDRV_GF1_HANDLER_ALL (0xffff0000&~SNDRV_GF1_HANDLER_VOICE)
1591da177e4SLinus Torvalds
1601da177e4SLinus Torvalds /* constants for DMA flags */
1611da177e4SLinus Torvalds
1621da177e4SLinus Torvalds #define SNDRV_GF1_DMA_TRIGGER 1
1631da177e4SLinus Torvalds
1641da177e4SLinus Torvalds /* --- */
1651da177e4SLinus Torvalds
1665e2da206STakashi Iwai struct snd_gus_card;
1671da177e4SLinus Torvalds
1681da177e4SLinus Torvalds /* GF1 specific structure */
1691da177e4SLinus Torvalds
1705e2da206STakashi Iwai struct snd_gf1_bank_info {
1711da177e4SLinus Torvalds unsigned int address;
1721da177e4SLinus Torvalds unsigned int size;
1735e2da206STakashi Iwai };
1741da177e4SLinus Torvalds
1755e2da206STakashi Iwai struct snd_gf1_mem_block {
1761da177e4SLinus Torvalds unsigned short flags; /* flags - SNDRV_GF1_MEM_BLOCK_XXXX */
1771da177e4SLinus Torvalds unsigned short owner; /* owner - SNDRV_GF1_MEM_OWNER_XXXX */
1781da177e4SLinus Torvalds unsigned int share; /* share count */
1791da177e4SLinus Torvalds unsigned int share_id[4]; /* share ID */
1801da177e4SLinus Torvalds unsigned int ptr;
1811da177e4SLinus Torvalds unsigned int size;
1821da177e4SLinus Torvalds char *name;
1835e2da206STakashi Iwai struct snd_gf1_mem_block *next;
1845e2da206STakashi Iwai struct snd_gf1_mem_block *prev;
1855e2da206STakashi Iwai };
1861da177e4SLinus Torvalds
1875e2da206STakashi Iwai struct snd_gf1_mem {
1885e2da206STakashi Iwai struct snd_gf1_bank_info banks_8[4];
1895e2da206STakashi Iwai struct snd_gf1_bank_info banks_16[4];
1905e2da206STakashi Iwai struct snd_gf1_mem_block *first;
1915e2da206STakashi Iwai struct snd_gf1_mem_block *last;
1928b7547f9SIngo Molnar struct mutex memory_mutex;
1935e2da206STakashi Iwai };
1941da177e4SLinus Torvalds
1955e2da206STakashi Iwai struct snd_gf1_dma_block {
1961da177e4SLinus Torvalds void *buffer; /* buffer in computer's RAM */
1971da177e4SLinus Torvalds unsigned long buf_addr; /* buffer address */
1981da177e4SLinus Torvalds unsigned int addr; /* address in onboard memory */
1991da177e4SLinus Torvalds unsigned int count; /* count in bytes */
2001da177e4SLinus Torvalds unsigned int cmd; /* DMA command (format) */
2015e2da206STakashi Iwai void (*ack)(struct snd_gus_card * gus, void *private_data);
2021da177e4SLinus Torvalds void *private_data;
2031da177e4SLinus Torvalds struct snd_gf1_dma_block *next;
2045e2da206STakashi Iwai };
2051da177e4SLinus Torvalds
2065e2da206STakashi Iwai struct snd_gus_port {
2075e2da206STakashi Iwai struct snd_midi_channel_set * chset;
2085e2da206STakashi Iwai struct snd_gus_card * gus;
2091da177e4SLinus Torvalds int mode; /* operation mode */
2101da177e4SLinus Torvalds int client; /* sequencer client number */
2111da177e4SLinus Torvalds int port; /* sequencer port number */
2121da177e4SLinus Torvalds unsigned int midi_has_voices: 1;
2135e2da206STakashi Iwai };
2141da177e4SLinus Torvalds
2155e2da206STakashi Iwai struct snd_gus_voice;
2161da177e4SLinus Torvalds
2171da177e4SLinus Torvalds #define SNDRV_GF1_VOICE_TYPE_PCM 0
2181da177e4SLinus Torvalds #define SNDRV_GF1_VOICE_TYPE_SYNTH 1
2191da177e4SLinus Torvalds #define SNDRV_GF1_VOICE_TYPE_MIDI 2
2201da177e4SLinus Torvalds
2211da177e4SLinus Torvalds #define SNDRV_GF1_VFLG_RUNNING (1<<0)
2221da177e4SLinus Torvalds #define SNDRV_GF1_VFLG_EFFECT_TIMER1 (1<<1)
2231da177e4SLinus Torvalds #define SNDRV_GF1_VFLG_PAN (1<<2)
2241da177e4SLinus Torvalds
2255e2da206STakashi Iwai enum snd_gus_volume_state {
2261da177e4SLinus Torvalds VENV_BEFORE,
2271da177e4SLinus Torvalds VENV_ATTACK,
2281da177e4SLinus Torvalds VENV_SUSTAIN,
2291da177e4SLinus Torvalds VENV_RELEASE,
2301da177e4SLinus Torvalds VENV_DONE,
2311da177e4SLinus Torvalds VENV_VOLUME
2325e2da206STakashi Iwai };
2331da177e4SLinus Torvalds
2345e2da206STakashi Iwai struct snd_gus_voice {
2351da177e4SLinus Torvalds int number;
2361da177e4SLinus Torvalds unsigned int use: 1,
2371da177e4SLinus Torvalds pcm: 1,
2381da177e4SLinus Torvalds synth:1,
2391da177e4SLinus Torvalds midi: 1;
2401da177e4SLinus Torvalds unsigned int flags;
2411da177e4SLinus Torvalds unsigned char client;
2421da177e4SLinus Torvalds unsigned char port;
2431da177e4SLinus Torvalds unsigned char index;
2441da177e4SLinus Torvalds unsigned char pad;
2451da177e4SLinus Torvalds
2461da177e4SLinus Torvalds #ifdef CONFIG_SND_DEBUG
2471da177e4SLinus Torvalds unsigned int interrupt_stat_wave;
2481da177e4SLinus Torvalds unsigned int interrupt_stat_volume;
2491da177e4SLinus Torvalds #endif
2505e2da206STakashi Iwai void (*handler_wave) (struct snd_gus_card * gus, struct snd_gus_voice * voice);
2515e2da206STakashi Iwai void (*handler_volume) (struct snd_gus_card * gus, struct snd_gus_voice * voice);
2525e2da206STakashi Iwai void (*handler_effect) (struct snd_gus_card * gus, struct snd_gus_voice * voice);
2535e2da206STakashi Iwai void (*volume_change) (struct snd_gus_card * gus);
2541da177e4SLinus Torvalds
2555e2da206STakashi Iwai struct snd_gus_sample_ops *sample_ops;
2561da177e4SLinus Torvalds
2571da177e4SLinus Torvalds /* running status / registers */
2581da177e4SLinus Torvalds
2591da177e4SLinus Torvalds unsigned short fc_register;
2601da177e4SLinus Torvalds unsigned short fc_lfo;
2611da177e4SLinus Torvalds unsigned short gf1_volume;
2621da177e4SLinus Torvalds unsigned char control;
2631da177e4SLinus Torvalds unsigned char mode;
2641da177e4SLinus Torvalds unsigned char gf1_pan;
2651da177e4SLinus Torvalds unsigned char effect_accumulator;
2661da177e4SLinus Torvalds unsigned char volume_control;
2671da177e4SLinus Torvalds unsigned char venv_value_next;
2685e2da206STakashi Iwai enum snd_gus_volume_state venv_state;
2695e2da206STakashi Iwai enum snd_gus_volume_state venv_state_prev;
2701da177e4SLinus Torvalds unsigned short vlo;
2711da177e4SLinus Torvalds unsigned short vro;
2721da177e4SLinus Torvalds unsigned short gf1_effect_volume;
2731da177e4SLinus Torvalds
2741da177e4SLinus Torvalds /* --- */
2751da177e4SLinus Torvalds
2761da177e4SLinus Torvalds void *private_data;
2775e2da206STakashi Iwai void (*private_free)(struct snd_gus_voice *voice);
2781da177e4SLinus Torvalds };
2791da177e4SLinus Torvalds
2805e2da206STakashi Iwai struct snd_gf1 {
2811da177e4SLinus Torvalds
2821da177e4SLinus Torvalds unsigned int enh_mode:1, /* enhanced mode (GFA1) */
2831da177e4SLinus Torvalds hw_lfo:1, /* use hardware LFO */
2841da177e4SLinus Torvalds sw_lfo:1, /* use software LFO */
2851da177e4SLinus Torvalds effect:1; /* use effect voices */
2861da177e4SLinus Torvalds
2871da177e4SLinus Torvalds unsigned long port; /* port of GF1 chip */
2881da177e4SLinus Torvalds struct resource *res_port1;
2891da177e4SLinus Torvalds struct resource *res_port2;
2901da177e4SLinus Torvalds int irq; /* IRQ number */
2911da177e4SLinus Torvalds int dma1; /* DMA1 number */
2921da177e4SLinus Torvalds int dma2; /* DMA2 number */
2931da177e4SLinus Torvalds unsigned int memory; /* GUS's DRAM size in bytes */
2941da177e4SLinus Torvalds unsigned int rom_memory; /* GUS's ROM size in bytes */
2951da177e4SLinus Torvalds unsigned int rom_present; /* bitmask */
2961da177e4SLinus Torvalds unsigned int rom_banks; /* GUS's ROM banks */
2971da177e4SLinus Torvalds
2985e2da206STakashi Iwai struct snd_gf1_mem mem_alloc;
2991da177e4SLinus Torvalds
3001da177e4SLinus Torvalds /* registers */
3011da177e4SLinus Torvalds unsigned short reg_page;
3021da177e4SLinus Torvalds unsigned short reg_regsel;
3031da177e4SLinus Torvalds unsigned short reg_data8;
3041da177e4SLinus Torvalds unsigned short reg_data16;
3051da177e4SLinus Torvalds unsigned short reg_irqstat;
3061da177e4SLinus Torvalds unsigned short reg_dram;
3071da177e4SLinus Torvalds unsigned short reg_timerctrl;
3081da177e4SLinus Torvalds unsigned short reg_timerdata;
3091da177e4SLinus Torvalds unsigned char ics_regs[6][2];
3101da177e4SLinus Torvalds /* --------- */
3111da177e4SLinus Torvalds
3121da177e4SLinus Torvalds unsigned char active_voices; /* active voices */
3131da177e4SLinus Torvalds unsigned char active_voice; /* selected voice (GF1PAGE register) */
3141da177e4SLinus Torvalds
3155e2da206STakashi Iwai struct snd_gus_voice voices[32]; /* GF1 voices */
3161da177e4SLinus Torvalds
3171da177e4SLinus Torvalds unsigned int default_voice_address;
3181da177e4SLinus Torvalds
3191da177e4SLinus Torvalds unsigned short playback_freq; /* GF1 playback (mixing) frequency */
3201da177e4SLinus Torvalds unsigned short mode; /* see to SNDRV_GF1_MODE_XXXX */
3211da177e4SLinus Torvalds unsigned char volume_ramp;
3221da177e4SLinus Torvalds unsigned char smooth_pan;
3231da177e4SLinus Torvalds unsigned char full_range_pan;
3241da177e4SLinus Torvalds unsigned char pad0;
3251da177e4SLinus Torvalds
3261da177e4SLinus Torvalds unsigned char *lfos;
3271da177e4SLinus Torvalds
3281da177e4SLinus Torvalds /* interrupt handlers */
3291da177e4SLinus Torvalds
3305e2da206STakashi Iwai void (*interrupt_handler_midi_out) (struct snd_gus_card * gus);
3315e2da206STakashi Iwai void (*interrupt_handler_midi_in) (struct snd_gus_card * gus);
3325e2da206STakashi Iwai void (*interrupt_handler_timer1) (struct snd_gus_card * gus);
3335e2da206STakashi Iwai void (*interrupt_handler_timer2) (struct snd_gus_card * gus);
3345e2da206STakashi Iwai void (*interrupt_handler_dma_write) (struct snd_gus_card * gus);
3355e2da206STakashi Iwai void (*interrupt_handler_dma_read) (struct snd_gus_card * gus);
3361da177e4SLinus Torvalds
3371da177e4SLinus Torvalds #ifdef CONFIG_SND_DEBUG
3381da177e4SLinus Torvalds unsigned int interrupt_stat_midi_out;
3391da177e4SLinus Torvalds unsigned int interrupt_stat_midi_in;
3401da177e4SLinus Torvalds unsigned int interrupt_stat_timer1;
3411da177e4SLinus Torvalds unsigned int interrupt_stat_timer2;
3421da177e4SLinus Torvalds unsigned int interrupt_stat_dma_write;
3431da177e4SLinus Torvalds unsigned int interrupt_stat_dma_read;
3441da177e4SLinus Torvalds unsigned int interrupt_stat_voice_lost;
3451da177e4SLinus Torvalds #endif
3461da177e4SLinus Torvalds
3471da177e4SLinus Torvalds /* synthesizer */
3481da177e4SLinus Torvalds
3491da177e4SLinus Torvalds int seq_client;
3505e2da206STakashi Iwai struct snd_gus_port seq_ports[4];
3511da177e4SLinus Torvalds
3521da177e4SLinus Torvalds /* timer */
3531da177e4SLinus Torvalds
3541da177e4SLinus Torvalds unsigned short timer_enabled;
3555e2da206STakashi Iwai struct snd_timer *timer1;
3565e2da206STakashi Iwai struct snd_timer *timer2;
3571da177e4SLinus Torvalds
3581da177e4SLinus Torvalds /* midi */
3591da177e4SLinus Torvalds
3601da177e4SLinus Torvalds unsigned short uart_cmd;
3611da177e4SLinus Torvalds unsigned int uart_framing;
3621da177e4SLinus Torvalds unsigned int uart_overrun;
3631da177e4SLinus Torvalds
3641da177e4SLinus Torvalds /* dma operations */
3651da177e4SLinus Torvalds
3661da177e4SLinus Torvalds unsigned int dma_flags;
3671da177e4SLinus Torvalds unsigned int dma_shared;
3685e2da206STakashi Iwai struct snd_gf1_dma_block *dma_data_pcm;
3695e2da206STakashi Iwai struct snd_gf1_dma_block *dma_data_pcm_last;
3705e2da206STakashi Iwai struct snd_gf1_dma_block *dma_data_synth;
3715e2da206STakashi Iwai struct snd_gf1_dma_block *dma_data_synth_last;
3725e2da206STakashi Iwai void (*dma_ack)(struct snd_gus_card * gus, void *private_data);
3731da177e4SLinus Torvalds void *dma_private_data;
3741da177e4SLinus Torvalds
3751da177e4SLinus Torvalds /* pcm */
3761da177e4SLinus Torvalds int pcm_channels;
3771da177e4SLinus Torvalds int pcm_alloc_voices;
3781da177e4SLinus Torvalds unsigned short pcm_volume_level_left;
3791da177e4SLinus Torvalds unsigned short pcm_volume_level_right;
3801da177e4SLinus Torvalds unsigned short pcm_volume_level_left1;
3811da177e4SLinus Torvalds unsigned short pcm_volume_level_right1;
3821da177e4SLinus Torvalds
3831da177e4SLinus Torvalds unsigned char pcm_rcntrl_reg;
3841da177e4SLinus Torvalds unsigned char pad_end;
3851da177e4SLinus Torvalds };
3861da177e4SLinus Torvalds
3871da177e4SLinus Torvalds /* main structure for GUS card */
3881da177e4SLinus Torvalds
3895e2da206STakashi Iwai struct snd_gus_card {
3905e2da206STakashi Iwai struct snd_card *card;
3911da177e4SLinus Torvalds
3921da177e4SLinus Torvalds unsigned int
3931da177e4SLinus Torvalds initialized: 1, /* resources were initialized */
3941da177e4SLinus Torvalds equal_irq:1, /* GF1 and CODEC shares IRQ (GUS MAX only) */
3951da177e4SLinus Torvalds equal_dma:1, /* if dma channels are equal (not valid for daughter board) */
3961da177e4SLinus Torvalds ics_flag:1, /* have we ICS mixer chip */
3971da177e4SLinus Torvalds ics_flipped:1, /* ICS mixer have flipped some channels? */
3981da177e4SLinus Torvalds codec_flag:1, /* have we CODEC chip? */
3991da177e4SLinus Torvalds max_flag:1, /* have we GUS MAX card? */
4001da177e4SLinus Torvalds max_ctrl_flag:1, /* have we original GUS MAX card? */
4011da177e4SLinus Torvalds daughter_flag:1, /* have we daughter board? */
4021da177e4SLinus Torvalds interwave:1, /* hey - we have InterWave card */
4031da177e4SLinus Torvalds ess_flag:1, /* ESS chip found... GUS Extreme */
4041da177e4SLinus Torvalds ace_flag:1, /* GUS ACE detected */
4051da177e4SLinus Torvalds uart_enable:1; /* enable MIDI UART */
4061da177e4SLinus Torvalds unsigned short revision; /* revision of chip */
4071da177e4SLinus Torvalds unsigned short max_cntrl_val; /* GUS MAX control value */
4081da177e4SLinus Torvalds unsigned short mix_cntrl_reg; /* mixer control register */
4091da177e4SLinus Torvalds unsigned short joystick_dac; /* joystick DAC level */
4101da177e4SLinus Torvalds int timer_dev; /* timer device */
4111da177e4SLinus Torvalds
4125e2da206STakashi Iwai struct snd_gf1 gf1; /* gf1 specific variables */
4135e2da206STakashi Iwai struct snd_pcm *pcm;
4145e2da206STakashi Iwai struct snd_pcm_substream *pcm_cap_substream;
4151da177e4SLinus Torvalds unsigned int c_dma_size;
4161da177e4SLinus Torvalds unsigned int c_period_size;
4171da177e4SLinus Torvalds unsigned int c_pos;
4181da177e4SLinus Torvalds
4195e2da206STakashi Iwai struct snd_rawmidi *midi_uart;
4205e2da206STakashi Iwai struct snd_rawmidi_substream *midi_substream_output;
4215e2da206STakashi Iwai struct snd_rawmidi_substream *midi_substream_input;
4221da177e4SLinus Torvalds
4231da177e4SLinus Torvalds spinlock_t reg_lock;
4241da177e4SLinus Torvalds spinlock_t voice_alloc;
4251da177e4SLinus Torvalds spinlock_t active_voice_lock;
4261da177e4SLinus Torvalds spinlock_t event_lock;
4271da177e4SLinus Torvalds spinlock_t dma_lock;
4281da177e4SLinus Torvalds spinlock_t pcm_volume_level_lock;
4291da177e4SLinus Torvalds spinlock_t uart_cmd_lock;
4308b7547f9SIngo Molnar struct mutex dma_mutex;
4318b7547f9SIngo Molnar struct mutex register_mutex;
4321da177e4SLinus Torvalds };
4331da177e4SLinus Torvalds
4341da177e4SLinus Torvalds /* I/O functions for GF1/InterWave chip - gus_io.c */
4351da177e4SLinus Torvalds
snd_gf1_select_voice(struct snd_gus_card * gus,int voice)4365e2da206STakashi Iwai static inline void snd_gf1_select_voice(struct snd_gus_card * gus, int voice)
4371da177e4SLinus Torvalds {
4381da177e4SLinus Torvalds unsigned long flags;
4391da177e4SLinus Torvalds
4401da177e4SLinus Torvalds spin_lock_irqsave(&gus->active_voice_lock, flags);
4411da177e4SLinus Torvalds if (voice != gus->gf1.active_voice) {
4421da177e4SLinus Torvalds gus->gf1.active_voice = voice;
4431da177e4SLinus Torvalds outb(voice, GUSP(gus, GF1PAGE));
4441da177e4SLinus Torvalds }
4451da177e4SLinus Torvalds spin_unlock_irqrestore(&gus->active_voice_lock, flags);
4461da177e4SLinus Torvalds }
4471da177e4SLinus Torvalds
snd_gf1_uart_cmd(struct snd_gus_card * gus,unsigned char b)4485e2da206STakashi Iwai static inline void snd_gf1_uart_cmd(struct snd_gus_card * gus, unsigned char b)
4491da177e4SLinus Torvalds {
4501da177e4SLinus Torvalds outb(gus->gf1.uart_cmd = b, GUSP(gus, MIDICTRL));
4511da177e4SLinus Torvalds }
4521da177e4SLinus Torvalds
snd_gf1_uart_stat(struct snd_gus_card * gus)4535e2da206STakashi Iwai static inline unsigned char snd_gf1_uart_stat(struct snd_gus_card * gus)
4541da177e4SLinus Torvalds {
4551da177e4SLinus Torvalds return inb(GUSP(gus, MIDISTAT));
4561da177e4SLinus Torvalds }
4571da177e4SLinus Torvalds
snd_gf1_uart_put(struct snd_gus_card * gus,unsigned char b)4585e2da206STakashi Iwai static inline void snd_gf1_uart_put(struct snd_gus_card * gus, unsigned char b)
4591da177e4SLinus Torvalds {
4601da177e4SLinus Torvalds outb(b, GUSP(gus, MIDIDATA));
4611da177e4SLinus Torvalds }
4621da177e4SLinus Torvalds
snd_gf1_uart_get(struct snd_gus_card * gus)4635e2da206STakashi Iwai static inline unsigned char snd_gf1_uart_get(struct snd_gus_card * gus)
4641da177e4SLinus Torvalds {
4651da177e4SLinus Torvalds return inb(GUSP(gus, MIDIDATA));
4661da177e4SLinus Torvalds }
4671da177e4SLinus Torvalds
4685e2da206STakashi Iwai extern void snd_gf1_delay(struct snd_gus_card * gus);
4691da177e4SLinus Torvalds
4705e2da206STakashi Iwai extern void snd_gf1_ctrl_stop(struct snd_gus_card * gus, unsigned char reg);
4711da177e4SLinus Torvalds
4725e2da206STakashi Iwai extern void snd_gf1_write8(struct snd_gus_card * gus, unsigned char reg, unsigned char data);
4735e2da206STakashi Iwai extern unsigned char snd_gf1_look8(struct snd_gus_card * gus, unsigned char reg);
snd_gf1_read8(struct snd_gus_card * gus,unsigned char reg)4745e2da206STakashi Iwai static inline unsigned char snd_gf1_read8(struct snd_gus_card * gus, unsigned char reg)
4751da177e4SLinus Torvalds {
4761da177e4SLinus Torvalds return snd_gf1_look8(gus, reg | 0x80);
4771da177e4SLinus Torvalds }
4785e2da206STakashi Iwai extern void snd_gf1_write16(struct snd_gus_card * gus, unsigned char reg, unsigned int data);
4795e2da206STakashi Iwai extern unsigned short snd_gf1_look16(struct snd_gus_card * gus, unsigned char reg);
snd_gf1_read16(struct snd_gus_card * gus,unsigned char reg)4805e2da206STakashi Iwai static inline unsigned short snd_gf1_read16(struct snd_gus_card * gus, unsigned char reg)
4811da177e4SLinus Torvalds {
4821da177e4SLinus Torvalds return snd_gf1_look16(gus, reg | 0x80);
4831da177e4SLinus Torvalds }
4845e2da206STakashi Iwai extern void snd_gf1_adlib_write(struct snd_gus_card * gus, unsigned char reg, unsigned char data);
4855e2da206STakashi Iwai extern void snd_gf1_dram_addr(struct snd_gus_card * gus, unsigned int addr);
4865e2da206STakashi Iwai extern void snd_gf1_poke(struct snd_gus_card * gus, unsigned int addr, unsigned char data);
4875e2da206STakashi Iwai extern unsigned char snd_gf1_peek(struct snd_gus_card * gus, unsigned int addr);
4885e2da206STakashi Iwai extern void snd_gf1_write_addr(struct snd_gus_card * gus, unsigned char reg, unsigned int addr, short w_16bit);
4895e2da206STakashi Iwai extern unsigned int snd_gf1_read_addr(struct snd_gus_card * gus, unsigned char reg, short w_16bit);
4905e2da206STakashi Iwai extern void snd_gf1_i_ctrl_stop(struct snd_gus_card * gus, unsigned char reg);
4915e2da206STakashi Iwai extern void snd_gf1_i_write8(struct snd_gus_card * gus, unsigned char reg, unsigned char data);
4925e2da206STakashi Iwai extern unsigned char snd_gf1_i_look8(struct snd_gus_card * gus, unsigned char reg);
4935e2da206STakashi Iwai extern void snd_gf1_i_write16(struct snd_gus_card * gus, unsigned char reg, unsigned int data);
snd_gf1_i_read8(struct snd_gus_card * gus,unsigned char reg)4945e2da206STakashi Iwai static inline unsigned char snd_gf1_i_read8(struct snd_gus_card * gus, unsigned char reg)
4951da177e4SLinus Torvalds {
4961da177e4SLinus Torvalds return snd_gf1_i_look8(gus, reg | 0x80);
4971da177e4SLinus Torvalds }
4985e2da206STakashi Iwai extern unsigned short snd_gf1_i_look16(struct snd_gus_card * gus, unsigned char reg);
snd_gf1_i_read16(struct snd_gus_card * gus,unsigned char reg)4995e2da206STakashi Iwai static inline unsigned short snd_gf1_i_read16(struct snd_gus_card * gus, unsigned char reg)
5001da177e4SLinus Torvalds {
5011da177e4SLinus Torvalds return snd_gf1_i_look16(gus, reg | 0x80);
5021da177e4SLinus Torvalds }
5031da177e4SLinus Torvalds
5045e2da206STakashi Iwai extern void snd_gf1_select_active_voices(struct snd_gus_card * gus);
5051da177e4SLinus Torvalds
5061da177e4SLinus Torvalds /* gus_lfo.c */
5071da177e4SLinus Torvalds
5081da177e4SLinus Torvalds struct _SND_IW_LFO_PROGRAM {
5091da177e4SLinus Torvalds unsigned short freq_and_control;
5101da177e4SLinus Torvalds unsigned char depth_final;
5111da177e4SLinus Torvalds unsigned char depth_inc;
5121da177e4SLinus Torvalds unsigned short twave;
5131da177e4SLinus Torvalds unsigned short depth;
5141da177e4SLinus Torvalds };
5151da177e4SLinus Torvalds
5161da177e4SLinus Torvalds #if 0
5175e2da206STakashi Iwai extern irqreturn_t snd_gf1_lfo_effect_interrupt(struct snd_gus_card * gus, snd_gf1_voice_t * voice);
5181da177e4SLinus Torvalds #endif
5195e2da206STakashi Iwai extern void snd_gf1_lfo_init(struct snd_gus_card * gus);
5205e2da206STakashi Iwai extern void snd_gf1_lfo_done(struct snd_gus_card * gus);
5215e2da206STakashi Iwai extern void snd_gf1_lfo_program(struct snd_gus_card * gus, int voice, int lfo_type, struct _SND_IW_LFO_PROGRAM *program);
5225e2da206STakashi Iwai extern void snd_gf1_lfo_enable(struct snd_gus_card * gus, int voice, int lfo_type);
5235e2da206STakashi Iwai extern void snd_gf1_lfo_disable(struct snd_gus_card * gus, int voice, int lfo_type);
5245e2da206STakashi Iwai extern void snd_gf1_lfo_change_freq(struct snd_gus_card * gus, int voice, int lfo_type, int freq);
5255e2da206STakashi Iwai extern void snd_gf1_lfo_change_depth(struct snd_gus_card * gus, int voice, int lfo_type, int depth);
5265e2da206STakashi Iwai extern void snd_gf1_lfo_setup(struct snd_gus_card * gus, int voice, int lfo_type, int freq, int current_depth, int depth, int sweep, int shape);
5275e2da206STakashi Iwai extern void snd_gf1_lfo_shutdown(struct snd_gus_card * gus, int voice, int lfo_type);
5281da177e4SLinus Torvalds #if 0
5295e2da206STakashi Iwai extern void snd_gf1_lfo_command(struct snd_gus_card * gus, int voice, unsigned char *command);
5301da177e4SLinus Torvalds #endif
5311da177e4SLinus Torvalds
5321da177e4SLinus Torvalds /* gus_mem.c */
5331da177e4SLinus Torvalds
5345e2da206STakashi Iwai void snd_gf1_mem_lock(struct snd_gf1_mem * alloc, int xup);
5355e2da206STakashi Iwai int snd_gf1_mem_xfree(struct snd_gf1_mem * alloc, struct snd_gf1_mem_block * block);
5365e2da206STakashi Iwai struct snd_gf1_mem_block *snd_gf1_mem_alloc(struct snd_gf1_mem * alloc, int owner,
5371da177e4SLinus Torvalds char *name, int size, int w_16,
5381da177e4SLinus Torvalds int align, unsigned int *share_id);
5395e2da206STakashi Iwai int snd_gf1_mem_free(struct snd_gf1_mem * alloc, unsigned int address);
5405e2da206STakashi Iwai int snd_gf1_mem_free_owner(struct snd_gf1_mem * alloc, int owner);
5415e2da206STakashi Iwai int snd_gf1_mem_init(struct snd_gus_card * gus);
5425e2da206STakashi Iwai int snd_gf1_mem_done(struct snd_gus_card * gus);
5431da177e4SLinus Torvalds
5441da177e4SLinus Torvalds /* gus_mem_proc.c */
5451da177e4SLinus Torvalds
5465e2da206STakashi Iwai int snd_gf1_mem_proc_init(struct snd_gus_card * gus);
5471da177e4SLinus Torvalds
5481da177e4SLinus Torvalds /* gus_dma.c */
5491da177e4SLinus Torvalds
5505e2da206STakashi Iwai int snd_gf1_dma_init(struct snd_gus_card * gus);
5515e2da206STakashi Iwai int snd_gf1_dma_done(struct snd_gus_card * gus);
5525e2da206STakashi Iwai int snd_gf1_dma_transfer_block(struct snd_gus_card * gus,
5535e2da206STakashi Iwai struct snd_gf1_dma_block * block,
5541da177e4SLinus Torvalds int atomic,
5551da177e4SLinus Torvalds int synth);
5561da177e4SLinus Torvalds
5571da177e4SLinus Torvalds /* gus_volume.c */
5581da177e4SLinus Torvalds
5591da177e4SLinus Torvalds unsigned short snd_gf1_lvol_to_gvol_raw(unsigned int vol);
5605e2da206STakashi Iwai unsigned short snd_gf1_translate_freq(struct snd_gus_card * gus, unsigned int freq2);
5611da177e4SLinus Torvalds
5621da177e4SLinus Torvalds /* gus_reset.c */
5631da177e4SLinus Torvalds
5645e2da206STakashi Iwai void snd_gf1_set_default_handlers(struct snd_gus_card * gus, unsigned int what);
5655e2da206STakashi Iwai void snd_gf1_smart_stop_voice(struct snd_gus_card * gus, unsigned short voice);
5665e2da206STakashi Iwai void snd_gf1_stop_voice(struct snd_gus_card * gus, unsigned short voice);
5675e2da206STakashi Iwai void snd_gf1_stop_voices(struct snd_gus_card * gus, unsigned short v_min, unsigned short v_max);
5685e2da206STakashi Iwai struct snd_gus_voice *snd_gf1_alloc_voice(struct snd_gus_card * gus, int type, int client, int port);
5695e2da206STakashi Iwai void snd_gf1_free_voice(struct snd_gus_card * gus, struct snd_gus_voice *voice);
5705e2da206STakashi Iwai int snd_gf1_start(struct snd_gus_card * gus);
5715e2da206STakashi Iwai int snd_gf1_stop(struct snd_gus_card * gus);
5721da177e4SLinus Torvalds
5731da177e4SLinus Torvalds /* gus_mixer.c */
5741da177e4SLinus Torvalds
5755e2da206STakashi Iwai int snd_gf1_new_mixer(struct snd_gus_card * gus);
5761da177e4SLinus Torvalds
5771da177e4SLinus Torvalds /* gus_pcm.c */
5781da177e4SLinus Torvalds
579db5abb3cSLars-Peter Clausen int snd_gf1_pcm_new(struct snd_gus_card *gus, int pcm_dev, int control_index);
5801da177e4SLinus Torvalds
5811da177e4SLinus Torvalds #ifdef CONFIG_SND_DEBUG
5825e2da206STakashi Iwai extern void snd_gf1_print_voice_registers(struct snd_gus_card * gus);
5831da177e4SLinus Torvalds #endif
5841da177e4SLinus Torvalds
5851da177e4SLinus Torvalds /* gus.c */
5861da177e4SLinus Torvalds
5875e2da206STakashi Iwai int snd_gus_use_inc(struct snd_gus_card * gus);
5885e2da206STakashi Iwai void snd_gus_use_dec(struct snd_gus_card * gus);
5895e2da206STakashi Iwai int snd_gus_create(struct snd_card *card,
5901da177e4SLinus Torvalds unsigned long port,
5911da177e4SLinus Torvalds int irq, int dma1, int dma2,
5921da177e4SLinus Torvalds int timer_dev,
5931da177e4SLinus Torvalds int voices,
5941da177e4SLinus Torvalds int pcm_channels,
5951da177e4SLinus Torvalds int effect,
5965e2da206STakashi Iwai struct snd_gus_card ** rgus);
5975e2da206STakashi Iwai int snd_gus_initialize(struct snd_gus_card * gus);
5981da177e4SLinus Torvalds
5991da177e4SLinus Torvalds /* gus_irq.c */
6001da177e4SLinus Torvalds
6017d12e780SDavid Howells irqreturn_t snd_gus_interrupt(int irq, void *dev_id);
6021da177e4SLinus Torvalds #ifdef CONFIG_SND_DEBUG
6035e2da206STakashi Iwai void snd_gus_irq_profile_init(struct snd_gus_card *gus);
6041da177e4SLinus Torvalds #endif
6051da177e4SLinus Torvalds
6061da177e4SLinus Torvalds /* gus_uart.c */
6071da177e4SLinus Torvalds
608db5abb3cSLars-Peter Clausen int snd_gf1_rawmidi_new(struct snd_gus_card *gus, int device);
6091da177e4SLinus Torvalds
6101da177e4SLinus Torvalds /* gus_dram.c */
6115e2da206STakashi Iwai int snd_gus_dram_write(struct snd_gus_card *gus, char __user *ptr,
6121da177e4SLinus Torvalds unsigned int addr, unsigned int size);
6135e2da206STakashi Iwai int snd_gus_dram_read(struct snd_gus_card *gus, char __user *ptr,
6141da177e4SLinus Torvalds unsigned int addr, unsigned int size, int rom);
6151da177e4SLinus Torvalds
616*65cec1efSPierre-Louis Bossart /* gus_timer.c */
617*65cec1efSPierre-Louis Bossart void snd_gf1_timers_init(struct snd_gus_card *gus);
618*65cec1efSPierre-Louis Bossart void snd_gf1_timers_done(struct snd_gus_card *gus);
619*65cec1efSPierre-Louis Bossart
6201da177e4SLinus Torvalds #endif /* __SOUND_GUS_H */
621