Ignore:
Timestamp:
Dec 11, 2005, 5:57:39 PM (20 years ago)
Author:
vladest
Message:

Latest update from ALSA. some intial > 15 interrupts support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk/alsa-kernel/include/sound/emu10k1.h

    r33 r34  
    2626#ifdef __KERNEL__
    2727
    28 #include "pcm.h"
    29 #include "rawmidi.h"
    30 #include "hwdep.h"
    31 #include "ac97_codec.h"
    32 #include "util_mem.h"
     28#include <sound/pcm.h>
     29#include <sound/rawmidi.h>
     30#include <sound/hwdep.h>
     31#include <sound/ac97_codec.h>
     32#include <sound/util_mem.h>
    3333#include <sound/pcm-indirect.h>
     34#include <sound/timer.h>
     35#include <linux/interrupt.h>
    3436#include <asm/io.h>
    35 #include <sound/timer.h>
    36 
    37 #ifndef PCI_VENDOR_ID_CREATIVE
    38 #define PCI_VENDOR_ID_CREATIVE          0x1102
    39 #endif
    40 #ifndef PCI_DEVICE_ID_CREATIVE_EMU10K1
    41 #define PCI_DEVICE_ID_CREATIVE_EMU10K1  0x0002
    42 #endif
    4337
    4438/* ------------------- DEFINES -------------------- */
     
    5145#define NUM_G           64              /* use all channels */
    5246#define NUM_FXSENDS     4
    53 //#define NUM_EFX_PLAYBACK    16
    54 #define NUM_EFX_PLAYBACK    6
     47#define NUM_EFX_PLAYBACK    16
    5548
    5649/* FIXME? - according to the OSS driver the EMU10K1 needs a 29 bit DMA mask */
    5750#define EMU10K1_DMA_MASK        0x7fffffffUL    /* 31bit */
    58 #define AUDIGY_DMA_MASK         0xffffffffUL    /* 32bit */
    59 
     51#define AUDIGY_DMA_MASK         0x7fffffffUL    /* 31bit FIXME - 32 should work? */
     52                                                /* See ALSA bug #1276 - rlrevell */
    6053
    6154#define TMEMSIZE        256*1024
     
    8578                                                /* Clear pending interrupts by writing a 1 to   */
    8679                                                /* the relevant bits and zero to the other bits */
    87 
    88 #define IPR_P16V                0x80000000      /* Bit set when the CA0151 P16V chip wishes to interrupt */
    89 #define IPR_GPIOMSG             0x20000000      /* GPIO message interrupt (RE'd, still not sure which INTE bits enable it)                   */
     80#define IPR_P16V                0x80000000      /* Bit set when the CA0151 P16V chip wishes
     81                                                   to interrupt */
     82#define IPR_GPIOMSG             0x20000000      /* GPIO message interrupt (RE'd, still not sure
     83                                                   which INTE bits enable it)                   */
    9084
    9185/* The next two interrupts are for the midi port on the Audigy Drive (A_MPU1)                   */
     
    9387#define IPR_A_MIDIRECVBUFEMPTY2 0x08000000      /* MIDI UART receive buffer empty               */
    9488
    95 #define IPR_SPDIFBUFFULL        0x04000000      /* SPDIF capture related, 10k2 only? (RE)       */
    96 #define IPR_SPDIFBUFHALFFULL    0x02000000      /* SPDIF capture related? (RE)                  */
     89#define IPR_SPDIFBUFFULL        0x04000000      /* SPDIF capture related, 10k2 only? (RE)       */
     90#define IPR_SPDIFBUFHALFFULL    0x02000000      /* SPDIF capture related? (RE)                  */
     91
    9792#define IPR_SAMPLERATETRACKER   0x01000000      /* Sample rate tracker lock status change       */
    9893#define IPR_FXDSP               0x00800000      /* Enable FX DSP interrupts                     */
     
    113108#define IPR_MIDITRANSBUFEMPTY   0x00000100      /* MIDI UART transmit buffer empty              */
    114109#define IPR_MIDIRECVBUFEMPTY    0x00000080      /* MIDI UART receive buffer empty               */
    115 #define IPR_CHANNELLOOP         0x00000040      /* Channel (half) loop interrupt(s) pending     */
     110#define IPR_CHANNELLOOP         0x00000040      /* Channel (half) loop interrupt(s) pending     */
    116111#define IPR_CHANNELNUMBERMASK   0x0000003f      /* When IPR_CHANNELLOOP is set, indicates the   */
    117                                                 /* Highest set channel in CLIPL or CLIPH.  When */
    118                                                 /* IP is written with CL set, the bit in CLIPL  */
    119                                                 /* or CLIPH corresponding to the CIN value      */
    120                                                 /* written will be cleared.                     */
     112                                                /* highest set channel in CLIPL, CLIPH, HLIPL,  */
     113                                                /* or HLIPH.  When IP is written with CL set,   */
     114                                                /* the bit in H/CLIPL or H/CLIPH corresponding  */
     115                                                /* to the CIN value written will be cleared.    */
    121116
    122117#define INTE                    0x0c            /* Interrupt enable register                    */
     
    245240#define A_GPINPUT_MASK          0xff00
    246241#define A_GPOUTPUT_MASK         0x00ff
     242
    247243// Audigy output/GPIO stuff taken from the kX drivers
    248 #define A_IOCFG_GPOUT0          0x0044          /* analog/digital                               */
    249 #define A_IOCFG_DISABLE_ANALOG  0x0040          /* = 'enable' for Audigy2 (chiprev=4)           */
    250 #define A_IOCFG_ENABLE_DIGITAL  0x0004
     244#define A_IOCFG_GPOUT0          0x0044          /* analog/digital                               */
     245#define A_IOCFG_DISABLE_ANALOG  0x0040          /* = 'enable' for Audigy2 (chiprev=4)           */
     246#define A_IOCFG_ENABLE_DIGITAL  0x0004
    251247#define A_IOCFG_UNKNOWN_20      0x0020
    252 #define A_IOCFG_DISABLE_AC97_FRONT      0x0080  /* turn off ac97 front -> front (10k2.1)        */
    253 #define A_IOCFG_GPOUT1          0x0002          /* IR? drive's internal bypass (?)              */
     248#define A_IOCFG_DISABLE_AC97_FRONT      0x0080  /* turn off ac97 front -> front (10k2.1)        */
     249#define A_IOCFG_GPOUT1          0x0002          /* IR? drive's internal bypass (?)              */
    254250#define A_IOCFG_GPOUT2          0x0001          /* IR */
    255 
    256 #define A_IOCFG_MULTIPURPOSE_JACK       0x2000  /* center+lfe+rear_center (a2/a2ex)             */
    257 /* + digital for generic 10k2                   */
    258 #define A_IOCFG_DIGITAL_JACK    0x1000          /* digital for a2 platinum                      */
     251#define A_IOCFG_MULTIPURPOSE_JACK       0x2000  /* center+lfe+rear_center (a2/a2ex)             */
     252                                                /* + digital for generic 10k2                   */
     253#define A_IOCFG_DIGITAL_JACK    0x1000          /* digital for a2 platinum                      */
    259254#define A_IOCFG_FRONT_JACK      0x4000
    260255#define A_IOCFG_REAR_JACK       0x8000
    261 #define A_IOCFG_PHONES_JACK     0x0100          /* LiveDrive                                    */
     256#define A_IOCFG_PHONES_JACK     0x0100          /* LiveDrive                                    */
    262257
    263258/* outputs:
    264  *      for audigy2 platinum:   0xa00
    265  *      for a2 platinum ex:     0x1c00
    266  *      for a1 platinum:        0x0
     259 *      for audigy2 platinum:   0xa00
     260 *      for a2 platinum ex:     0x1c00
     261 *      for a1 platinum:        0x0
    267262 */
     263
    268264#define TIMER                   0x1a            /* Timer terminal count register                */
    269265                                                /* NOTE: After the rate is changed, a maximum   */
     
    281277
    282278/* Available on the Audigy 2 and Audigy 4 only. This is the P16V chip. */
    283 #define PTR2                    0x20            /* Indexed register set pointer register        */
    284 #define DATA2                   0x24            /* Indexed register set data register           */
    285 #define IPR2                    0x28            /* P16V interrupt pending register              */
     279#define PTR2                    0x20            /* Indexed register set pointer register        */
     280#define DATA2                   0x24            /* Indexed register set data register           */
     281#define IPR2                    0x28            /* P16V interrupt pending register              */
    286282#define IPR2_PLAYBACK_CH_0_LOOP      0x00001000 /* Playback Channel 0 loop                               */
    287283#define IPR2_PLAYBACK_CH_0_HALF_LOOP 0x00000100 /* Playback Channel 0 half loop                          */
    288284#define IPR2_CAPTURE_CH_0_LOOP       0x00100000 /* Capture Channel 0 loop                               */
    289285#define IPR2_CAPTURE_CH_0_HALF_LOOP  0x00010000 /* Capture Channel 0 half loop                          */
    290 /* 0x00000100 Playback. Only in once per period.
    291  * 0x00110000 Capture. Int on half buffer.
    292  */
    293 #define INTE2                   0x2c            /* P16V Interrupt enable register.      */
     286                                                /* 0x00000100 Playback. Only in once per period.
     287                                                * 0x00110000 Capture. Int on half buffer.
     288                                                */
     289#define INTE2                   0x2c            /* P16V Interrupt enable register.      */
    294290#define INTE2_PLAYBACK_CH_0_LOOP      0x00001000 /* Playback Channel 0 loop                               */
    295291#define INTE2_PLAYBACK_CH_0_HALF_LOOP 0x00000100 /* Playback Channel 0 half loop                          */
     
    302298#define INTE2_CAPTURE_CH_0_LOOP       0x00100000 /* Capture Channel 0 loop                               */
    303299#define INTE2_CAPTURE_CH_0_HALF_LOOP  0x00010000 /* Caputre Channel 0 half loop                          */
    304 #define HCFG2                   0x34            /* Defaults: 0, win2000 sets it to 00004201 */
    305 /* 0x00000000 2-channel output. */
    306 /* 0x00000200 8-channel output. */
    307 /* 0x00000004 pauses stream/irq fail. */
    308 /* Rest of bits no nothing to sound output */
    309 /* bit 0: Enable P16V audio.
    310  * bit 1: Lock P16V record memory cache.
    311  * bit 2: Lock P16V playback memory cache.
    312  * bit 3: Dummy record insert zero samples.
    313  * bit 8: Record 8-channel in phase.
    314  * bit 9: Playback 8-channel in phase.
    315  * bit 11-12: Playback mixer attenuation: 0=0dB, 1=-6dB, 2=-12dB, 3=Mute.
    316  * bit 13: Playback mixer enable.
    317  * bit 14: Route SRC48 mixer output to fx engine.
    318  * bit 15: Enable IEEE 1394 chip.
    319  */
    320 #define IPR3                    0x38            /* Cdif interrupt pending register              */
    321 #define INTE3                   0x3c            /* Cdif interrupt enable register.      */
     300#define HCFG2                   0x34            /* Defaults: 0, win2000 sets it to 00004201 */
     301                                                /* 0x00000000 2-channel output. */
     302                                                /* 0x00000200 8-channel output. */
     303                                                /* 0x00000004 pauses stream/irq fail. */
     304                                                /* Rest of bits no nothing to sound output */
     305                                                /* bit 0: Enable P16V audio.
     306                                                * bit 1: Lock P16V record memory cache.
     307                                                * bit 2: Lock P16V playback memory cache.
     308                                                * bit 3: Dummy record insert zero samples.
     309                                                * bit 8: Record 8-channel in phase.
     310                                                * bit 9: Playback 8-channel in phase.
     311                                                * bit 11-12: Playback mixer attenuation: 0=0dB, 1=-6dB, 2=-12dB, 3=Mute.
     312                                                * bit 13: Playback mixer enable.
     313                                                * bit 14: Route SRC48 mixer output to fx engine.
     314                                                * bit 15: Enable IEEE 1394 chip.
     315                                                */
     316#define IPR3                    0x38            /* Cdif interrupt pending register              */
     317#define INTE3                   0x3c            /* Cdif interrupt enable register.      */
    322318/************************************************************************************************/
    323319/* PCI function 1 registers, address = <val> + PCIBASE1                                         */
     
    443439
    444440#define ENVVOL                  0x10            /* Volume envelope register                             */
    445 #define ENVVOL_MASK             0x0000ffff      /* Current value of volume envelope state variable      */
     441#define ENVVOL_MASK             0x0000ffff      /* Current value of volume envelope state variable      */ 
    446442                                                /* 0x8000-n == 666*n usec delay                         */
    447443
     
    529525                                                /* NOTE: All channels contain internal variables; do    */
    530526                                                /* not write to these locations.                        */
     527
    531528/* 1f something */
     529
    532530#define CD0                     0x20            /* Cache data 0 register                                */
    533531#define CD1                     0x21            /* Cache data 1 register                                */
     
    579577#define FXWC                    0x43            /* FX output write channels register                    */
    580578                                                /* When set, each bit enables the writing of the        */
    581                                                 /* corresponding FX output channel into host memory     */
     579                                                /* corresponding FX output channel (internal registers  */
     580                                                /* 0x20-0x3f) to host memory.  This mode of recording   */
     581                                                /* is 16bit, 48KHz only. All 32 channels can be enabled */
     582                                                /* simultaneously.                                      */
     583
    582584#define FXWC_DEFAULTROUTE_C     (1<<0)          /* left emu out? */
    583585#define FXWC_DEFAULTROUTE_B     (1<<1)          /* right emu out? */
     
    613615#define FXBA                    0x47            /* FX Buffer Address */
    614616#define FXBA_MASK               0xfffff000      /* 20 bit base address                                  */
    615  /* 0x48 something - word access, defaults to 3f */
     617
     618/* 0x48 something - word access, defaults to 3f */
     619
    616620#define MICBS                   0x49            /* Microphone buffer size register                      */
    617621
     
    717721
    718722#define SPBYPASS                0x5e            /* SPDIF BYPASS mode register                   */
    719 #define SPBYPASS_SPDIF0_MASK    0x00000003      /* SPDIF 0 bypass mode                          */
    720 #define SPBYPASS_SPDIF1_MASK    0x0000000c      /* SPDIF 1 bypass mode                          */
    721 /* bypass mode: 0 - DSP; 1 - SPDIF A, 2 - SPDIF B, 3 - SPDIF C                                  */
    722 #define SPBYPASS_FORMAT         0x00000f00      /* If 1, SPDIF XX uses 24 bit, if 0 - 20 bit    */
     723#define SPBYPASS_SPDIF0_MASK    0x00000003      /* SPDIF 0 bypass mode                          */
     724#define SPBYPASS_SPDIF1_MASK    0x0000000c      /* SPDIF 1 bypass mode                          */
     725/* bypass mode: 0 - DSP; 1 - SPDIF A, 2 - SPDIF B, 3 - SPDIF C                                  */
     726#define SPBYPASS_FORMAT         0x00000f00      /* If 1, SPDIF XX uses 24 bit, if 0 - 20 bit    */
     727
    723728#define AC97SLOT                0x5f            /* additional AC97 slots enable bits            */
    724 #define AC97SLOT_REAR_RIGHT     0x01            /* Rear left */
    725 #define AC97SLOT_REAR_LEFT      0x02            /* Rear right */
     729#define AC97SLOT_REAR_RIGHT     0x01            /* Rear left */
     730#define AC97SLOT_REAR_LEFT      0x02            /* Rear right */
    726731#define AC97SLOT_CNTR           0x10            /* Center enable */
    727732#define AC97SLOT_LFE            0x20            /* LFE enable */
     
    737742
    738743/* These three bitfields apply to CDSRCS, GPSRCS, and (except as noted) ZVSRCS.                 */
    739 #define SRCS_SPDIFVALID         0x04000000      /* SPDIF stream valid                           */
     744#define SRCS_SPDIFVALID         0x04000000      /* SPDIF stream valid                           */
    740745#define SRCS_SPDIFLOCKED        0x02000000      /* SPDIF stream locked                          */
    741746#define SRCS_RATELOCKED         0x01000000      /* Sample rate locked                           */
     
    765770#define FXIDX_IDX               0x10000065
    766771
    767 /* The 32-bit HLIx and HLIPx registers all have one bit per channel control/status                      */
    768 #define HLIEL                   0x66            /* Channel half loop interrupt enable low register      */
    769 
    770 #define HLIEH                   0x67            /* Channel half loop interrupt enable high register     */
    771 
    772 #define HLIPL                   0x68            /* Channel half loop interrupt pending low register     */
    773 
    774 #define HLIPH                   0x69            /* Channel half loop interrupt pending high register    */
     772/* The 32-bit HLIx and HLIPx registers all have one bit per channel control/status                      */
     773#define HLIEL                   0x66            /* Channel half loop interrupt enable low register      */
     774
     775#define HLIEH                   0x67            /* Channel half loop interrupt enable high register     */
     776
     777#define HLIPL                   0x68            /* Channel half loop interrupt pending low register     */
     778
     779#define HLIPH                   0x69            /* Channel half loop interrupt pending high register    */
    775780
    776781// 0x6a,6b,6c used for some recording
     
    786791#define A_MUDATA2               0x72
    787792#define A_MUCMD2                0x73
    788 #define A_MUSTAT2               A_MUCMD2
     793#define A_MUSTAT2               A_MUCMD2       
    789794
    790795/* The next two are the Audigy equivalent of FXWC                                               */
     
    795800
    796801#define A_SPDIF_SAMPLERATE      0x76            /* Set the sample rate of SPDIF output          */
    797 #define A_SAMPLE_RATE           0x76            /* Various sample rate settings. */
    798 #define A_SAMPLE_RATE_NOT_USED  0x0ffc111e      /* Bits that are not used and cannot be set.    */
    799 #define A_SAMPLE_RATE_UNKNOWN   0xf0030001      /* Bits that can be set, but have unknown use.  */
    800 #define A_SPDIF_RATE_MASK       0x000000e0      /* Any other values for rates, just use 48000   */
    801 #define A_SPDIF_48000           0x00000000
    802 #define A_SPDIF_192000          0x00000020
    803 #define A_SPDIF_96000           0x00000040
    804 #define A_SPDIF_44100           0x00000080
    805 
    806 #define A_I2S_CAPTURE_RATE_MASK 0x00000e00      /* This sets the capture PCM rate, but it is    */
    807 #define A_I2S_CAPTURE_48000     0x00000000      /* unclear if this sets the ADC rate as well.   */
    808 #define A_I2S_CAPTURE_192000    0x00000200
    809 #define A_I2S_CAPTURE_96000     0x00000400
    810 #define A_I2S_CAPTURE_44100     0x00000800
    811 
    812 #define A_PCM_RATE_MASK         0x0000e000      /* This sets the playback PCM rate on the P16V  */
    813 #define A_PCM_48000             0x00000000
    814 #define A_PCM_192000            0x00002000
    815 #define A_PCM_96000             0x00004000
    816 #define A_PCM_44100             0x00008000
    817 /* 0x77,0x78,0x79 "something i2s-related" - default to 0x01080000 on my audigy 2 ZS --rlrevell  */
     802#define A_SAMPLE_RATE           0x76            /* Various sample rate settings. */
     803#define A_SAMPLE_RATE_NOT_USED  0x0ffc111e      /* Bits that are not used and cannot be set.    */
     804#define A_SAMPLE_RATE_UNKNOWN   0xf0030001      /* Bits that can be set, but have unknown use.  */
     805#define A_SPDIF_RATE_MASK       0x000000e0      /* Any other values for rates, just use 48000   */
     806#define A_SPDIF_48000           0x00000000
     807#define A_SPDIF_192000          0x00000020
     808#define A_SPDIF_96000           0x00000040
     809#define A_SPDIF_44100           0x00000080
     810
     811#define A_I2S_CAPTURE_RATE_MASK 0x00000e00      /* This sets the capture PCM rate, but it is    */
     812#define A_I2S_CAPTURE_48000     0x00000000      /* unclear if this sets the ADC rate as well.   */
     813#define A_I2S_CAPTURE_192000    0x00000200
     814#define A_I2S_CAPTURE_96000     0x00000400
     815#define A_I2S_CAPTURE_44100     0x00000800
     816
     817#define A_PCM_RATE_MASK         0x0000e000      /* This sets the playback PCM rate on the P16V  */
     818#define A_PCM_48000             0x00000000
     819#define A_PCM_192000            0x00002000
     820#define A_PCM_96000             0x00004000
     821#define A_PCM_44100             0x00008000
     822
     823/* 0x77,0x78,0x79 "something i2s-related" - default to 0x01080000 on my audigy 2 ZS --rlrevell  */
    818824/* 0x7a, 0x7b - lookup tables */
    819825
     
    830836#define A_FXSENDAMOUNT_H_MASK   0x000000FF
    831837/* 0x7c, 0x7e "high bit is used for filtering" */
     838 
    832839/* The send amounts for this one are the same as used with the emu10k1 */
    833840#define A_FXRT1                 0x7e
     
    842849#define A_FXGPREGBASE           0x400           /* Audigy GPRs, 0x400 to 0x5ff                  */
    843850
    844 #define A_TANKMEMCTLREGBASE     0x100           /* Tank memory control registers base - only for Audigy */
    845 #define A_TANKMEMCTLREG_MASK    0x1f            /* only 5 bits used - only for Audigy */
     851#define A_TANKMEMCTLREGBASE     0x100           /* Tank memory control registers base - only for Audigy */
     852#define A_TANKMEMCTLREG_MASK    0x1f            /* only 5 bits used - only for Audigy */
    846853
    847854/* Tank audio data is logarithmically compressed down to 16 bits before writing to TRAM and is  */
     
    881888/* ------------------- STRUCTURES -------------------- */
    882889
    883 typedef struct _snd_emu10k1 emu10k1_t;
    884 typedef struct _snd_emu10k1_voice emu10k1_voice_t;
    885 typedef struct _snd_emu10k1_pcm emu10k1_pcm_t;
    886 
    887 typedef enum {
    888     EMU10K1_EFX,
    889     EMU10K1_PCM,
    890     EMU10K1_SYNTH,
    891     EMU10K1_MIDI
    892 } emu10k1_voice_type_t;
    893 
    894 struct _snd_emu10k1_voice {
    895         emu10k1_t *emu;
     890enum {
     891        EMU10K1_EFX,
     892        EMU10K1_PCM,
     893        EMU10K1_SYNTH,
     894        EMU10K1_MIDI
     895};
     896
     897struct snd_emu10k1;
     898
     899struct snd_emu10k1_voice {
     900        struct snd_emu10k1 *emu;
    896901        int number;
    897         int use: 1,
    898         pcm: 1,
    899         efx: 1,
    900         synth: 1,
    901         midi: 1;
    902         void (*interrupt)(emu10k1_t *emu, emu10k1_voice_t *pvoice);
    903 
    904         emu10k1_pcm_t *epcm;
    905 };
    906 
    907 typedef enum {
    908     PLAYBACK_EMUVOICE,
    909     PLAYBACK_EFX,
    910     CAPTURE_AC97ADC,
    911     CAPTURE_AC97MIC,
    912     CAPTURE_EFX
    913 } snd_emu10k1_pcm_type_t;
    914 
    915 struct _snd_emu10k1_pcm {
    916         emu10k1_t *emu;
    917         snd_emu10k1_pcm_type_t type;
    918         snd_pcm_substream_t *substream;
    919         emu10k1_voice_t *voices[NUM_EFX_PLAYBACK];
    920         emu10k1_voice_t *extra;
     902        unsigned int use: 1,
     903            pcm: 1,
     904            efx: 1,
     905            synth: 1,
     906            midi: 1;
     907        void (*interrupt)(struct snd_emu10k1 *emu, struct snd_emu10k1_voice *pvoice);
     908
     909        struct snd_emu10k1_pcm *epcm;
     910};
     911
     912enum {
     913        PLAYBACK_EMUVOICE,
     914        PLAYBACK_EFX,
     915        CAPTURE_AC97ADC,
     916        CAPTURE_AC97MIC,
     917        CAPTURE_EFX
     918};
     919
     920struct snd_emu10k1_pcm {
     921        struct snd_emu10k1 *emu;
     922        int type;
     923        struct snd_pcm_substream *substream;
     924        struct snd_emu10k1_voice *voices[NUM_EFX_PLAYBACK];
     925        struct snd_emu10k1_voice *extra;
    921926        unsigned short running;
    922927        unsigned short first_ptr;
    923         snd_util_memblk_t *memblk;
     928        struct snd_util_memblk *memblk;
    924929        unsigned int start_addr;
    925930        unsigned int ccca_start_addr;
     
    935940};
    936941
    937 typedef struct {
     942struct snd_emu10k1_pcm_mixer {
     943        /* mono, left, right x 8 sends (4 on emu10k1) */
    938944        unsigned char send_routing[3][8];
    939945        unsigned char send_volume[3][8];
    940946        unsigned short attn[3];
    941         emu10k1_pcm_t *epcm;
    942 } emu10k1_pcm_mixer_t;
     947        struct snd_emu10k1_pcm *epcm;
     948};
    943949
    944950#define snd_emu10k1_compose_send_routing(route) \
     
    951957((unsigned int)route[4] | ((unsigned int)route[5] << 8) | ((unsigned int)route[6] << 16) | ((unsigned int)route[7] << 24))
    952958
    953 typedef struct snd_emu10k1_memblk {
    954         snd_util_memblk_t mem;
     959struct snd_emu10k1_memblk {
     960        struct snd_util_memblk mem;
    955961        /* private part */
    956962        int first_page, last_page, pages, mapped_page;
     
    958964        struct list_head mapped_link;
    959965        struct list_head mapped_order_link;
    960 } emu10k1_memblk_t;
     966};
    961967
    962968#define snd_emu10k1_memblk_offset(blk)  (((blk)->mapped_page << PAGE_SHIFT) | ((blk)->mem.offset & (PAGE_SIZE - 1)))
     
    964970#define EMU10K1_MAX_TRAM_BLOCKS_PER_CODE        16
    965971
    966 typedef struct {
     972struct snd_emu10k1_fx8010_ctl {
    967973        struct list_head list;          /* list link container */
    968974        unsigned int vcount;
    969975        unsigned int count;             /* count of GPR (1..16) */
    970         unsigned short gpr[32];         /* GPR number(s) */
     976        unsigned short gpr[32];         /* GPR number(s) */
    971977        unsigned int value[32];
    972978        unsigned int min;               /* minimum range */
    973979        unsigned int max;               /* maximum range */
    974980        unsigned int translation;       /* translation type (EMU10K1_GPR_TRANSLATION*) */
    975         snd_kcontrol_t *kcontrol;
    976 } snd_emu10k1_fx8010_ctl_t;
    977 
    978 typedef void (snd_fx8010_irq_handler_t)(emu10k1_t *emu, void *private_data);
    979 
    980 typedef struct _snd_emu10k1_fx8010_irq {
    981         struct _snd_emu10k1_fx8010_irq *next;
    982         snd_fx8010_irq_handler_t *handler;
    983         unsigned short gpr_running;
     981        struct snd_kcontrol *kcontrol;
     982};
     983
     984typedef void (snd_fx8010_irq_handler_t)(struct snd_emu10k1 *emu, void *private_data);
     985
     986struct snd_emu10k1_fx8010_irq {
     987        struct snd_emu10k1_fx8010_irq *next;
     988        snd_fx8010_irq_handler_t *handler;
     989        unsigned short gpr_running;
    984990        void *private_data;
    985 } snd_emu10k1_fx8010_irq_t;
    986 
    987 typedef struct {
     991};
     992
     993struct snd_emu10k1_fx8010_pcm {
    988994        unsigned int valid: 1,
    989995                     opened: 1,
     
    991997        unsigned int channels;          /* 16-bit channels count */
    992998        unsigned int tram_start;        /* initial ring buffer position in TRAM (in samples) */
    993         unsigned int buffer_size;       /* count of buffered samples */
    994         unsigned short gpr_size;                /* GPR containing size of ring buffer in samples (host) */
    995         unsigned short gpr_ptr;         /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */
    996         unsigned short gpr_count;       /* GPR containing count of samples between two interrupts (host) */
    997         unsigned short gpr_tmpcount;    /* GPR containing current count of samples to interrupt (host = set, FX8010) */
    998         unsigned short gpr_trigger;     /* GPR containing trigger (activate) information (host) */
    999         unsigned short gpr_running;     /* GPR containing info if PCM is running (FX8010) */
    1000         unsigned char etram[32];        /* external TRAM address & data */
    1001         snd_pcm_indirect_t pcm_rec;
     999        unsigned int buffer_size;       /* count of buffered samples */
     1000        unsigned short gpr_size;                /* GPR containing size of ring buffer in samples (host) */
     1001        unsigned short gpr_ptr;         /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */
     1002        unsigned short gpr_count;       /* GPR containing count of samples between two interrupts (host) */
     1003        unsigned short gpr_tmpcount;    /* GPR containing current count of samples to interrupt (host = set, FX8010) */
     1004        unsigned short gpr_trigger;     /* GPR containing trigger (activate) information (host) */
     1005        unsigned short gpr_running;     /* GPR containing info if PCM is running (FX8010) */
     1006        unsigned char etram[32];        /* external TRAM address & data */
     1007        struct snd_pcm_indirect pcm_rec;
    10021008        unsigned int tram_pos;
    10031009        unsigned int tram_shift;
    1004         snd_emu10k1_fx8010_irq_t *irq;
    1005 } snd_emu10k1_fx8010_pcm_t;
    1006 
    1007 typedef struct {
     1010        struct snd_emu10k1_fx8010_irq *irq;
     1011};
     1012
     1013struct snd_emu10k1_fx8010 {
    10081014        unsigned short fxbus_mask;      /* used FX buses (bitmask) */
    10091015        unsigned short extin_mask;      /* used external inputs (bitmask) */
    10101016        unsigned short extout_mask;     /* used external outputs (bitmask) */
    10111017        unsigned short pad1;
    1012         unsigned int itram_size;        /* internal TRAM size in samples */
    1013         struct snd_dma_buffer etram_pages; /* external TRAM pages and size */
     1018        unsigned int itram_size;        /* internal TRAM size in samples */
     1019        struct snd_dma_buffer etram_pages; /* external TRAM pages and size */
    10141020        unsigned int dbg;               /* FX debugger register */
    10151021        unsigned char name[128];
     
    10181024        struct list_head gpr_ctl;       /* GPR controls */
    10191025        struct semaphore lock;
    1020         snd_emu10k1_fx8010_pcm_t pcm[8];
     1026        struct snd_emu10k1_fx8010_pcm pcm[8];
    10211027        spinlock_t irq_lock;
    1022         snd_emu10k1_fx8010_irq_t *irq_handlers;
    1023 } snd_emu10k1_fx8010_t;
    1024 
    1025 #define emu10k1_gpr_ctl(n) list_entry(n, snd_emu10k1_fx8010_ctl_t, list)
    1026 
    1027 typedef struct {
    1028         struct _snd_emu10k1 *emu;
    1029         snd_rawmidi_t *rmidi;
    1030         snd_rawmidi_substream_t *substream_input;
    1031         snd_rawmidi_substream_t *substream_output;
     1028        struct snd_emu10k1_fx8010_irq *irq_handlers;
     1029};
     1030
     1031#define emu10k1_gpr_ctl(n) list_entry(n, struct snd_emu10k1_fx8010_ctl, list)
     1032
     1033struct snd_emu10k1_midi {
     1034        struct snd_emu10k1 *emu;
     1035        struct snd_rawmidi *rmidi;
     1036        struct snd_rawmidi_substream *substream_input;
     1037        struct snd_rawmidi_substream *substream_output;
    10321038        unsigned int midi_mode;
    10331039        spinlock_t input_lock;
     
    10371043        int port;
    10381044        int ipr_tx, ipr_rx;
    1039         void (*interrupt)(emu10k1_t *emu, unsigned int status);
    1040 } emu10k1_midi_t;
    1041 
    1042 typedef struct {
    1043     u32 vendor;
    1044     u32 device;
    1045     u32 subsystem;
    1046     unsigned char revision;
    1047     unsigned char emu10k1_chip; /* Original SB Live. Not SB Live 24bit. */
    1048     unsigned char emu10k2_chip; /* Audigy 1 or Audigy 2. */
    1049     unsigned char ca0102_chip;  /* Audigy 1 or Audigy 2. Not SB Audigy 2 Value. */
    1050     unsigned char ca_cardbus_chip; /* Audigy 2 ZS Notebook */
    1051     unsigned char ca0108_chip;  /* Audigy 2 Value */
    1052     unsigned char ca0151_chip;  /* P16V */
    1053     unsigned char spk71;        /* Has 7.1 speakers */
    1054     unsigned char sblive51;     /* SBLive! 5.1 - extout 0x11 -> center, 0x12 -> lfe */
    1055     unsigned char spdif_bug;    /* Has Spdif phasing bug */
    1056     unsigned char ac97_chip;    /* Has an AC97 chip */
    1057     unsigned char ecard;        /* APS EEPROM */
    1058     const char * driver;
    1059     const char * name;
    1060     const char *id;         /* for backward compatibility - can be NULL if not needed */
    1061 } emu_chip_details_t;
    1062 
    1063 struct _snd_emu10k1 {
     1045        void (*interrupt)(struct snd_emu10k1 *emu, unsigned int status);
     1046};
     1047
     1048struct snd_emu_chip_details {
     1049        u32 vendor;
     1050        u32 device;
     1051        u32 subsystem;
     1052        unsigned char revision;
     1053        unsigned char emu10k1_chip; /* Original SB Live. Not SB Live 24bit. */
     1054        unsigned char emu10k2_chip; /* Audigy 1 or Audigy 2. */
     1055        unsigned char ca0102_chip;  /* Audigy 1 or Audigy 2. Not SB Audigy 2 Value. */
     1056        unsigned char ca0108_chip;  /* Audigy 2 Value */
     1057        unsigned char ca_cardbus_chip; /* Audigy 2 ZS Notebook */
     1058        unsigned char ca0151_chip;  /* P16V */
     1059        unsigned char spk71;        /* Has 7.1 speakers */
     1060        unsigned char sblive51;     /* SBLive! 5.1 - extout 0x11 -> center, 0x12 -> lfe */
     1061        unsigned char spdif_bug;    /* Has Spdif phasing bug */
     1062        unsigned char ac97_chip;    /* Has an AC97 chip: 1 = mandatory, 2 = optional */
     1063        unsigned char ecard;        /* APS EEPROM */
     1064        const char *driver;
     1065        const char *name;
     1066        const char *id;         /* for backward compatibility - can be NULL if not needed */
     1067};
     1068
     1069struct snd_emu10k1 {
    10641070        int irq;
    10651071
    1066         unsigned long port;                     /* I/O port number */
    1067         unsigned int tos_link: 1,               /* tos link detected */
    1068             rear_ac97: 1;                       /* rear channels are on AC'97 */
    1069         const emu_chip_details_t *card_capabilities;  /* Contains profile of card capabilities */
     1072        unsigned long port;                     /* I/O port number */
     1073        unsigned int tos_link: 1,               /* tos link detected */
     1074                rear_ac97: 1,                   /* rear channels are on AC'97 */
     1075                enable_ir: 1;
     1076        /* Contains profile of card capabilities */
     1077        const struct snd_emu_chip_details *card_capabilities;
    10701078        unsigned int audigy;                    /* is Audigy? */
    10711079        unsigned int revision;                  /* chip revision */
     
    10741082        unsigned int card_type;                 /* EMU10K1_CARD_* */
    10751083        unsigned int ecard_ctrl;                /* ecard control bits */
    1076         unsigned long dma_mask;                 /* PCI DMA mask */
    1077         int max_cache_pages;                    /* max memory size / PAGE_SIZE */
    1078         struct snd_dma_buffer silent_page;      /* silent page */
    1079         struct snd_dma_buffer ptb_pages;        /* page table pages */
    1080         struct snd_dma_device p16v_dma_dev;
    1081         struct snd_dma_buffer p16v_buffer;
    1082         snd_util_memhdr_t *memhdr;              /* page allocation list */
    1083         emu10k1_memblk_t *reserved_page;        /* reserved page */
     1084        unsigned long dma_mask;                 /* PCI DMA mask */
     1085        int max_cache_pages;                    /* max memory size / PAGE_SIZE */
     1086        struct snd_dma_buffer silent_page;      /* silent page */
     1087        struct snd_dma_buffer ptb_pages;        /* page table pages */
     1088        struct snd_dma_device p16v_dma_dev;
     1089        struct snd_dma_buffer p16v_buffer;
     1090
     1091        struct snd_util_memhdr *memhdr;         /* page allocation list */
     1092        struct snd_emu10k1_memblk *reserved_page;       /* reserved page */
    10841093
    10851094        struct list_head mapped_link_head;
     
    10911100        unsigned int spdif_bits[3];             /* s/pdif out setup */
    10921101
    1093         snd_emu10k1_fx8010_t fx8010;            /* FX8010 info */
     1102        struct snd_emu10k1_fx8010 fx8010;               /* FX8010 info */
    10941103        int gpr_base;
    1095 
    1096         ac97_t *ac97;
     1104       
     1105        struct snd_ac97 *ac97;
    10971106
    10981107        struct pci_dev *pci;
    1099         snd_card_t *card;
    1100         snd_pcm_t *pcm;
    1101         snd_pcm_t *pcm_mic;
    1102         snd_pcm_t *pcm_efx;
    1103         snd_pcm_t *pcm_p16v;
     1108        struct snd_card *card;
     1109        struct snd_pcm *pcm;
     1110        struct snd_pcm *pcm_mic;
     1111        struct snd_pcm *pcm_efx;
     1112        struct snd_pcm *pcm_multi;
     1113        struct snd_pcm *pcm_p16v;
    11041114
    11051115        spinlock_t synth_lock;
    11061116        void *synth;
    1107         int (*get_synth_voice)(emu10k1_t *emu);
     1117        int (*get_synth_voice)(struct snd_emu10k1 *emu);
    11081118
    11091119        spinlock_t reg_lock;
     
    11121122        struct semaphore ptb_lock;
    11131123
    1114         emu10k1_voice_t voices[NUM_G];
    1115         emu10k1_voice_t p16v_voices[4];
    1116         emu10k1_voice_t p16v_capture_voice;
    1117         int p16v_device_offset;
    1118         u32 p16v_capture_source;
    1119         u32 p16v_capture_channel;
    1120         emu10k1_pcm_mixer_t pcm_mixer[32];
    1121         emu10k1_pcm_mixer_t efx_pcm_mixer[NUM_EFX_PLAYBACK];
    1122         snd_kcontrol_t *ctl_send_routing;
    1123         snd_kcontrol_t *ctl_send_volume;
    1124         snd_kcontrol_t *ctl_attn;
    1125         snd_kcontrol_t *ctl_efx_send_routing;
    1126         snd_kcontrol_t *ctl_efx_send_volume;
    1127         snd_kcontrol_t *ctl_efx_attn;
    1128 
    1129         void (*hwvol_interrupt)(emu10k1_t *emu, unsigned int status);
    1130         void (*capture_interrupt)(emu10k1_t *emu, unsigned int status);
    1131         void (*capture_mic_interrupt)(emu10k1_t *emu, unsigned int status);
    1132         void (*capture_efx_interrupt)(emu10k1_t *emu, unsigned int status);
    1133         void (*spdif_interrupt)(emu10k1_t *emu, unsigned int status);
    1134         void (*dsp_interrupt)(emu10k1_t *emu);
    1135 
    1136         snd_pcm_substream_t *pcm_capture_substream;
    1137         snd_pcm_substream_t *pcm_capture_mic_substream;
    1138         snd_pcm_substream_t *pcm_capture_efx_substream;
    1139         snd_pcm_substream_t *pcm_playback_efx_substream;
    1140 
    1141         snd_timer_t *timer;
    1142 
    1143         emu10k1_midi_t midi;
    1144         emu10k1_midi_t midi2; /* for audigy */
    1145 
    1146         unsigned int efx_voices_mask[2];
    1147         unsigned int next_free_voice;
    1148 };
    1149 
    1150 int snd_emu10k1_create(snd_card_t * card,
     1124        struct snd_emu10k1_voice voices[NUM_G];
     1125        struct snd_emu10k1_voice p16v_voices[4];
     1126        struct snd_emu10k1_voice p16v_capture_voice;
     1127        int p16v_device_offset;
     1128        u32 p16v_capture_source;
     1129        u32 p16v_capture_channel;
     1130        struct snd_emu10k1_pcm_mixer pcm_mixer[32];
     1131        struct snd_emu10k1_pcm_mixer efx_pcm_mixer[NUM_EFX_PLAYBACK];
     1132        struct snd_kcontrol *ctl_send_routing;
     1133        struct snd_kcontrol *ctl_send_volume;
     1134        struct snd_kcontrol *ctl_attn;
     1135        struct snd_kcontrol *ctl_efx_send_routing;
     1136        struct snd_kcontrol *ctl_efx_send_volume;
     1137        struct snd_kcontrol *ctl_efx_attn;
     1138
     1139        void (*hwvol_interrupt)(struct snd_emu10k1 *emu, unsigned int status);
     1140        void (*capture_interrupt)(struct snd_emu10k1 *emu, unsigned int status);
     1141        void (*capture_mic_interrupt)(struct snd_emu10k1 *emu, unsigned int status);
     1142        void (*capture_efx_interrupt)(struct snd_emu10k1 *emu, unsigned int status);
     1143        void (*spdif_interrupt)(struct snd_emu10k1 *emu, unsigned int status);
     1144        void (*dsp_interrupt)(struct snd_emu10k1 *emu);
     1145
     1146        struct snd_pcm_substream *pcm_capture_substream;
     1147        struct snd_pcm_substream *pcm_capture_mic_substream;
     1148        struct snd_pcm_substream *pcm_capture_efx_substream;
     1149        struct snd_pcm_substream *pcm_playback_efx_substream;
     1150
     1151        struct snd_timer *timer;
     1152
     1153        struct snd_emu10k1_midi midi;
     1154        struct snd_emu10k1_midi midi2; /* for audigy */
     1155
     1156        unsigned int efx_voices_mask[2];
     1157        unsigned int next_free_voice;
     1158
     1159#ifdef CONFIG_PM
     1160        unsigned int *saved_ptr;
     1161        unsigned int *saved_gpr;
     1162        unsigned int *tram_val_saved;
     1163        unsigned int *tram_addr_saved;
     1164        unsigned int *saved_icode;
     1165        unsigned int *p16v_saved;
     1166        unsigned int saved_a_iocfg, saved_hcfg;
     1167#endif
     1168
     1169};
     1170
     1171int snd_emu10k1_create(struct snd_card *card,
    11511172                       struct pci_dev *pci,
    11521173                       unsigned short extin_mask,
    11531174                       unsigned short extout_mask,
    11541175                       long max_cache_bytes,
    1155                        int enable_ir,
    1156                        uint subsystem,
    1157                        emu10k1_t ** remu);
    1158 
    1159 int snd_emu10k1_pcm(emu10k1_t * emu, int device, snd_pcm_t ** rpcm);
    1160 int snd_emu10k1_pcm_mic(emu10k1_t * emu, int device, snd_pcm_t ** rpcm);
    1161 int snd_emu10k1_pcm_efx(emu10k1_t * emu, int device, snd_pcm_t ** rpcm);
    1162 int snd_p16v_pcm(emu10k1_t * emu, int device, snd_pcm_t ** rpcm);
    1163 int snd_p16v_free(emu10k1_t * emu);
    1164 int snd_p16v_mixer(emu10k1_t * emu);
    1165 int snd_emu10k1_pcm_multi(emu10k1_t * emu, int device, snd_pcm_t ** rpcm);
    1166 int snd_emu10k1_fx8010_pcm(emu10k1_t * emu, int device, snd_pcm_t ** rpcm);
    1167 int snd_emu10k1_mixer(emu10k1_t * emu, int pcm_device, int multi_device);
    1168 int snd_emu10k1_timer(emu10k1_t * emu, int device);
    1169 int snd_emu10k1_fx8010_new(emu10k1_t *emu, int device, snd_hwdep_t ** rhwdep);
     1176                       int enable_ir,
     1177                       uint subsystem,
     1178                       struct snd_emu10k1 ** remu);
     1179
     1180int snd_emu10k1_pcm(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm);
     1181int snd_emu10k1_pcm_mic(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm);
     1182int snd_emu10k1_pcm_efx(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm);
     1183int snd_p16v_pcm(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm);
     1184int snd_p16v_free(struct snd_emu10k1 * emu);
     1185int snd_p16v_mixer(struct snd_emu10k1 * emu);
     1186int snd_emu10k1_pcm_multi(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm);
     1187int snd_emu10k1_fx8010_pcm(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm);
     1188int snd_emu10k1_mixer(struct snd_emu10k1 * emu, int pcm_device, int multi_device);
     1189int snd_emu10k1_timer(struct snd_emu10k1 * emu, int device);
     1190int snd_emu10k1_fx8010_new(struct snd_emu10k1 *emu, int device, struct snd_hwdep ** rhwdep);
    11701191
    11711192irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs);
    11721193
    1173 /* initialization */
    1174 void snd_emu10k1_voice_init(emu10k1_t * emu, int voice);
    1175 int snd_emu10k1_init_efx(emu10k1_t *emu);
    1176 void snd_emu10k1_free_efx(emu10k1_t *emu);
    1177 int snd_emu10k1_fx8010_tram_setup(emu10k1_t *emu, u32 size);
     1194void snd_emu10k1_voice_init(struct snd_emu10k1 * emu, int voice);
     1195int snd_emu10k1_init_efx(struct snd_emu10k1 *emu);
     1196void snd_emu10k1_free_efx(struct snd_emu10k1 *emu);
     1197int snd_emu10k1_fx8010_tram_setup(struct snd_emu10k1 *emu, u32 size);
     1198int snd_emu10k1_done(struct snd_emu10k1 * emu);
    11781199
    11791200/* I/O functions */
    1180 unsigned int snd_emu10k1_ptr_read(emu10k1_t * emu, unsigned int reg, unsigned int chn);
    1181 void snd_emu10k1_ptr_write(emu10k1_t *emu, unsigned int reg, unsigned int chn, unsigned int data);
    1182 unsigned int snd_emu10k1_ptr20_read(emu10k1_t * emu, unsigned int reg, unsigned int chn);
    1183 void snd_emu10k1_ptr20_write(emu10k1_t *emu, unsigned int reg, unsigned int chn, unsigned int data);
    1184 void snd_emu10k1_efx_write(emu10k1_t *emu, unsigned int pc, unsigned int data);
    1185 unsigned int snd_emu10k1_efx_read(emu10k1_t *emu, unsigned int pc);
    1186 void snd_emu10k1_intr_enable(emu10k1_t *emu, unsigned int intrenb);
    1187 void snd_emu10k1_intr_disable(emu10k1_t *emu, unsigned int intrenb);
    1188 void snd_emu10k1_voice_intr_enable(emu10k1_t *emu, unsigned int voicenum);
    1189 void snd_emu10k1_voice_intr_disable(emu10k1_t *emu, unsigned int voicenum);
    1190 void snd_emu10k1_voice_intr_ack(emu10k1_t *emu, unsigned int voicenum);
    1191 void snd_emu10k1_voice_half_loop_intr_enable(emu10k1_t *emu, unsigned int voicenum);
    1192 void snd_emu10k1_voice_half_loop_intr_disable(emu10k1_t *emu, unsigned int voicenum);
    1193 void snd_emu10k1_voice_half_loop_intr_ack(emu10k1_t *emu, unsigned int voicenum);
    1194 void snd_emu10k1_voice_set_loop_stop(emu10k1_t *emu, unsigned int voicenum);
    1195 void snd_emu10k1_voice_clear_loop_stop(emu10k1_t *emu, unsigned int voicenum);
    1196 void snd_emu10k1_wait(emu10k1_t *emu, unsigned int wait);
    1197 static inline unsigned int snd_emu10k1_wc(emu10k1_t *emu) { return (inl(emu->port + WC) >> 6) & 0xfffff; }
    1198 unsigned short snd_emu10k1_ac97_read(ac97_t *ac97, unsigned short reg);
    1199 void snd_emu10k1_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short data);
     1201unsigned int snd_emu10k1_ptr_read(struct snd_emu10k1 * emu, unsigned int reg, unsigned int chn);
     1202void snd_emu10k1_ptr_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data);
     1203unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu, unsigned int reg, unsigned int chn);
     1204void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data);
     1205unsigned int snd_emu10k1_efx_read(struct snd_emu10k1 *emu, unsigned int pc);
     1206void snd_emu10k1_intr_enable(struct snd_emu10k1 *emu, unsigned int intrenb);
     1207void snd_emu10k1_intr_disable(struct snd_emu10k1 *emu, unsigned int intrenb);
     1208void snd_emu10k1_voice_intr_enable(struct snd_emu10k1 *emu, unsigned int voicenum);
     1209void snd_emu10k1_voice_intr_disable(struct snd_emu10k1 *emu, unsigned int voicenum);
     1210void snd_emu10k1_voice_intr_ack(struct snd_emu10k1 *emu, unsigned int voicenum);
     1211void snd_emu10k1_voice_half_loop_intr_enable(struct snd_emu10k1 *emu, unsigned int voicenum);
     1212void snd_emu10k1_voice_half_loop_intr_disable(struct snd_emu10k1 *emu, unsigned int voicenum);
     1213void snd_emu10k1_voice_half_loop_intr_ack(struct snd_emu10k1 *emu, unsigned int voicenum);
     1214void snd_emu10k1_voice_set_loop_stop(struct snd_emu10k1 *emu, unsigned int voicenum);
     1215void snd_emu10k1_voice_clear_loop_stop(struct snd_emu10k1 *emu, unsigned int voicenum);
     1216void snd_emu10k1_wait(struct snd_emu10k1 *emu, unsigned int wait);
     1217static inline unsigned int snd_emu10k1_wc(struct snd_emu10k1 *emu) { return (inl(emu->port + WC) >> 6) & 0xfffff; }
     1218unsigned short snd_emu10k1_ac97_read(struct snd_ac97 *ac97, unsigned short reg);
     1219void snd_emu10k1_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short data);
    12001220unsigned int snd_emu10k1_rate_to_pitch(unsigned int rate);
    1201 unsigned char snd_emu10k1_sum_vol_attn(unsigned int value);
     1221
     1222#ifdef CONFIG_PM
     1223void snd_emu10k1_suspend_regs(struct snd_emu10k1 *emu);
     1224void snd_emu10k1_resume_init(struct snd_emu10k1 *emu);
     1225void snd_emu10k1_resume_regs(struct snd_emu10k1 *emu);
     1226int snd_emu10k1_efx_alloc_pm_buffer(struct snd_emu10k1 *emu);
     1227void snd_emu10k1_efx_free_pm_buffer(struct snd_emu10k1 *emu);
     1228void snd_emu10k1_efx_suspend(struct snd_emu10k1 *emu);
     1229void snd_emu10k1_efx_resume(struct snd_emu10k1 *emu);
     1230int snd_p16v_alloc_pm_buffer(struct snd_emu10k1 *emu);
     1231void snd_p16v_free_pm_buffer(struct snd_emu10k1 *emu);
     1232void snd_p16v_suspend(struct snd_emu10k1 *emu);
     1233void snd_p16v_resume(struct snd_emu10k1 *emu);
     1234#endif
    12021235
    12031236/* memory allocation */
    1204 snd_util_memblk_t *snd_emu10k1_alloc_pages(emu10k1_t *emu, snd_pcm_substream_t *substream);
    1205 int snd_emu10k1_free_pages(emu10k1_t *emu, snd_util_memblk_t *blk);
    1206 snd_util_memblk_t *snd_emu10k1_synth_alloc(emu10k1_t *emu, unsigned int size);
    1207 int snd_emu10k1_synth_free(emu10k1_t *emu, snd_util_memblk_t *blk);
    1208 int snd_emu10k1_synth_bzero(emu10k1_t *emu, snd_util_memblk_t *blk, int offset, int size);
    1209 int snd_emu10k1_synth_copy_from_user(emu10k1_t *emu, snd_util_memblk_t *blk, int offset, const char *data, int size);
    1210 int snd_emu10k1_memblk_map(emu10k1_t *emu, emu10k1_memblk_t *blk);
     1237struct snd_util_memblk *snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *substream);
     1238int snd_emu10k1_free_pages(struct snd_emu10k1 *emu, struct snd_util_memblk *blk);
     1239struct snd_util_memblk *snd_emu10k1_synth_alloc(struct snd_emu10k1 *emu, unsigned int size);
     1240int snd_emu10k1_synth_free(struct snd_emu10k1 *emu, struct snd_util_memblk *blk);
     1241int snd_emu10k1_synth_bzero(struct snd_emu10k1 *emu, struct snd_util_memblk *blk, int offset, int size);
     1242int snd_emu10k1_synth_copy_from_user(struct snd_emu10k1 *emu, struct snd_util_memblk *blk, int offset, const char __user *data, int size);
     1243int snd_emu10k1_memblk_map(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk *blk);
    12111244
    12121245/* voice allocation */
    1213 int snd_emu10k1_voice_alloc(emu10k1_t *emu, emu10k1_voice_type_t type, int pair, emu10k1_voice_t **rvoice);
    1214 int snd_emu10k1_voice_free(emu10k1_t *emu, emu10k1_voice_t *pvoice);
     1246int snd_emu10k1_voice_alloc(struct snd_emu10k1 *emu, int type, int pair, struct snd_emu10k1_voice **rvoice);
     1247int snd_emu10k1_voice_free(struct snd_emu10k1 *emu, struct snd_emu10k1_voice *pvoice);
    12151248
    12161249/* MIDI uart */
    1217 int snd_emu10k1_midi(emu10k1_t * emu);
    1218 int snd_emu10k1_audigy_midi(emu10k1_t * emu);
     1250int snd_emu10k1_midi(struct snd_emu10k1 * emu);
     1251int snd_emu10k1_audigy_midi(struct snd_emu10k1 * emu);
    12191252
    12201253/* proc interface */
    1221 int snd_emu10k1_proc_init(emu10k1_t * emu);
     1254int snd_emu10k1_proc_init(struct snd_emu10k1 * emu);
    12221255
    12231256/* fx8010 irq handler */
    1224 int snd_emu10k1_fx8010_register_irq_handler(emu10k1_t *emu,
    1225                                             snd_fx8010_irq_handler_t *handler,
    1226                                             unsigned char gpr_running,
    1227                                             void *private_data,
    1228                                             snd_emu10k1_fx8010_irq_t **r_irq);
    1229 int snd_emu10k1_fx8010_unregister_irq_handler(emu10k1_t *emu,
    1230                                               snd_emu10k1_fx8010_irq_t *irq);
     1257int snd_emu10k1_fx8010_register_irq_handler(struct snd_emu10k1 *emu,
     1258                                            snd_fx8010_irq_handler_t *handler,
     1259                                            unsigned char gpr_running,
     1260                                            void *private_data,
     1261                                            struct snd_emu10k1_fx8010_irq **r_irq);
     1262int snd_emu10k1_fx8010_unregister_irq_handler(struct snd_emu10k1 *emu,
     1263                                              struct snd_emu10k1_fx8010_irq *irq);
    12311264
    12321265#endif /* __KERNEL__ */
     
    12621295#define FXBUS(x)        (0x00 + (x))    /* x = 0x00 - 0x0f */
    12631296#define EXTIN(x)        (0x10 + (x))    /* x = 0x00 - 0x0f */
    1264 #define EXTOUT(x)       (0x20 + (x))    /* x = 0x00 - 0x0f physical outs -> FXWC low 16 bits */
    1265 #define FXBUS2(x)       (0x30 + (x))    /* x = 0x00 - 0x0f copies of fx buses for capture -> FXWC high 16 bits */
    1266 /* NB: 0x31 and 0x32 are shared with Center/LFE on SB live 5.1 */
     1297#define EXTOUT(x)       (0x20 + (x))    /* x = 0x00 - 0x0f physical outs -> FXWC low 16 bits */
     1298#define FXBUS2(x)       (0x30 + (x))    /* x = 0x00 - 0x0f copies of fx buses for capture -> FXWC high 16 bits */
     1299                                        /* NB: 0x31 and 0x32 are shared with Center/LFE on SB live 5.1 */
    12671300
    12681301#define C_00000000      0x40
     
    13001333#define ETRAM_ADDR(x)   (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
    13011334
    1302 #define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
    1303 #define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
    1304 #define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
    1305 #define A_ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
    1306 #define A_ITRAM_CTL(x)  (A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
    1307 #define A_ETRAM_CTL(x)  (A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
    1308 
    1309 #define A_FXBUS(x)      (0x00 + (x))    /* x = 0x00 - 0x3f FX buses */
    1310 #define A_EXTIN(x)      (0x40 + (x))    /* x = 0x00 - 0x0f physical ins */
    1311 #define A_P16VIN(x)     (0x50 + (x))    /* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */
    1312 #define A_EXTOUT(x)     (0x60 + (x))    /* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown   */
    1313 #define A_FXBUS2(x)     (0x80 + (x))    /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */
    1314 #define A_EMU32OUTH(x)  (0xa0 + (x))    /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" - ??? */
    1315 #define A_EMU32OUTL(x)  (0xb0 + (x))    /* x = 0x00 - 0x0f "EMU32_OUT_1 - _F" - ??? */
     1335#define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
     1336#define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
     1337#define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
     1338#define A_ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
     1339#define A_ITRAM_CTL(x)  (A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
     1340#define A_ETRAM_CTL(x)  (A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
     1341
     1342#define A_FXBUS(x)      (0x00 + (x))    /* x = 0x00 - 0x3f FX buses */
     1343#define A_EXTIN(x)      (0x40 + (x))    /* x = 0x00 - 0x0f physical ins */
     1344#define A_P16VIN(x)     (0x50 + (x))    /* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */
     1345#define A_EXTOUT(x)     (0x60 + (x))    /* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown   */
     1346#define A_FXBUS2(x)     (0x80 + (x))    /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */
     1347#define A_EMU32OUTH(x)  (0xa0 + (x))    /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" - ??? */
     1348#define A_EMU32OUTL(x)  (0xb0 + (x))    /* x = 0x00 - 0x0f "EMU32_OUT_1 - _F" - ??? */
    13161349#define A_GPR(x)        (A_FXGPREGBASE + (x))
    13171350
     
    13371370#define FXBUS_MIDI_REVERB       0x0c
    13381371#define FXBUS_MIDI_CHORUS       0x0d
    1339 #define FXBUS_PCM_LEFT_SIDE     0x0e
    1340 #define FXBUS_PCM_RIGHT_SIDE    0x0f
     1372#define FXBUS_PCM_LEFT_SIDE     0x0e
     1373#define FXBUS_PCM_RIGHT_SIDE    0x0f
    13411374#define FXBUS_PT_LEFT           0x14
    13421375#define FXBUS_PT_RIGHT          0x15
     
    13631396#define EXTOUT_TOSLINK_L   0x02 /* LiveDrive - TOSLink Optical - left */
    13641397#define EXTOUT_TOSLINK_R   0x03 /* LiveDrive - TOSLink Optical - right */
    1365 #define EXTOUT_AC97_CENTER 0x04 /* SB Live 5.1 - center */
    1366 #define EXTOUT_AC97_LFE    0x05 /* SB Live 5.1 - LFE */
     1398#define EXTOUT_AC97_CENTER 0x04 /* SB Live 5.1 - center */
     1399#define EXTOUT_AC97_LFE    0x05 /* SB Live 5.1 - LFE */
    13671400#define EXTOUT_HEADPHONE_L 0x06 /* LiveDrive - Headphone - left */
    13681401#define EXTOUT_HEADPHONE_R 0x07 /* LiveDrive - Headphone - right */
     
    13721405#define EXTOUT_ADC_CAP_R   0x0b /* ADC Capture buffer - right */
    13731406#define EXTOUT_MIC_CAP     0x0c /* MIC Capture buffer */
    1374 #define EXTOUT_AC97_REAR_L 0x0d /* SB Live 5.1 (c) 2003 - Rear Left */
    1375 #define EXTOUT_AC97_REAR_R 0x0e /* SB Live 5.1 (c) 2003 - Rear Right */
     1407#define EXTOUT_AC97_REAR_L 0x0d /* SB Live 5.1 (c) 2003 - Rear Left */
     1408#define EXTOUT_AC97_REAR_R 0x0e /* SB Live 5.1 (c) 2003 - Rear Right */
    13761409#define EXTOUT_ACENTER     0x11 /* Analog Center */
    13771410#define EXTOUT_ALFE        0x12 /* Analog LFE */
     
    13831416#define A_EXTIN_SPDIF_CD_R      0x03    /* digital CD left */
    13841417#define A_EXTIN_OPT_SPDIF_L     0x04    /* audigy drive Optical SPDIF - left */
    1385 #define A_EXTIN_OPT_SPDIF_R     0x05    /*                              right */
     1418#define A_EXTIN_OPT_SPDIF_R     0x05    /*                              right */ 
    13861419#define A_EXTIN_LINE2_L         0x08    /* audigy drive line2/mic2 - left */
    13871420#define A_EXTIN_LINE2_R         0x09    /*                           right */
     
    14041437#define A_EXTOUT_ACENTER        0x0a    /* analog center */
    14051438#define A_EXTOUT_ALFE           0x0b    /* analog LFE */
    1406 #define A_EXTOUT_ASIDE_L        0x0c    /* analog side left  - Audigy 2 ZS */
    1407 #define A_EXTOUT_ASIDE_R        0x0d    /*             right - Audigy 2 ZS */
     1439#define A_EXTOUT_ASIDE_L        0x0c    /* analog side left  - Audigy 2 ZS */
     1440#define A_EXTOUT_ASIDE_R        0x0d    /*             right - Audigy 2 ZS */
    14081441#define A_EXTOUT_AREAR_L        0x0e    /* analog rear left */
    14091442#define A_EXTOUT_AREAR_R        0x0f    /*             right */
     
    14391472#define A_GPR_ACCU      0xd6            /* ACCUM, accumulator */
    14401473#define A_GPR_COND      0xd7            /* CCR, condition register */
    1441 #define A_GPR_NOISE0    0xd8            /* noise source */
    1442 #define A_GPR_NOISE1    0xd9            /* noise source */
    1443 #define A_GPR_IRQ       0xda            /* IRQ register */
    1444 #define A_GPR_DBAC      0xdb            /* TRAM Delay Base Address Counter - internal */
    1445 #define A_GPR_DBACE     0xde            /* TRAM Delay Base Address Counter - external */
     1474#define A_GPR_NOISE0    0xd8            /* noise source */
     1475#define A_GPR_NOISE1    0xd9            /* noise source */
     1476#define A_GPR_IRQ       0xda            /* IRQ register */
     1477#define A_GPR_DBAC      0xdb            /* TRAM Delay Base Address Counter - internal */
     1478#define A_GPR_DBACE     0xde            /* TRAM Delay Base Address Counter - external */
    14461479
    14471480/* definitions for debug register */
     
    14631496#endif
    14641497
    1465 typedef struct {
     1498struct snd_emu10k1_fx8010_info {
    14661499        unsigned int internal_tram_size;        /* in samples */
    14671500        unsigned int external_tram_size;        /* in samples */
     
    14701503        char extout_names[32][32];              /* names of external outputs */
    14711504        unsigned int gpr_controls;              /* count of GPR controls */
    1472 } emu10k1_fx8010_info_t;
     1505};
    14731506
    14741507#define EMU10K1_GPR_TRANSLATION_NONE            0
     
    14781511#define EMU10K1_GPR_TRANSLATION_ONOFF           4
    14791512
    1480 typedef struct {
    1481         snd_ctl_elem_id_t id;           /* full control ID definition */
     1513struct snd_emu10k1_fx8010_control_gpr {
     1514        struct snd_ctl_elem_id id;              /* full control ID definition */
    14821515        unsigned int vcount;            /* visible count */
    14831516        unsigned int count;             /* count of GPR (1..16) */
    1484         unsigned short gpr[32];         /* GPR number(s) */
     1517        unsigned short gpr[32];         /* GPR number(s) */
    14851518        unsigned int value[32];         /* initial values */
    14861519        unsigned int min;               /* minimum range */
    14871520        unsigned int max;               /* maximum range */
    14881521        unsigned int translation;       /* translation type (EMU10K1_GPR_TRANSLATION*) */
    1489 } emu10k1_fx8010_control_gpr_t;
    1490 
    1491 typedef struct {
     1522};
     1523
     1524struct snd_emu10k1_fx8010_code {
    14921525        char name[128];
    14931526
    1494         DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */
    1495         u_int32_t __user *gpr_map;      /* initializers */
     1527        DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */
     1528        u_int32_t __user *gpr_map;        /* initializers */
    14961529
    14971530        unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */
    1498         emu10k1_fx8010_control_gpr_t *gpr_add_controls; /* GPR controls to add/replace */
     1531        struct snd_emu10k1_fx8010_control_gpr __user *gpr_add_controls; /* GPR controls to add/replace */
    14991532
    15001533        unsigned int gpr_del_control_count; /* count of GPR controls to remove */
    1501         snd_ctl_elem_id_t *gpr_del_controls; /* IDs of GPR controls to remove */
     1534        struct snd_ctl_elem_id __user *gpr_del_controls; /* IDs of GPR controls to remove */
    15021535
    15031536        unsigned int gpr_list_control_count; /* count of GPR controls to list */
    15041537        unsigned int gpr_list_control_total; /* total count of GPR controls */
    1505         emu10k1_fx8010_control_gpr_t *gpr_list_controls; /* listed GPR controls */
    1506 
    1507         DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */
    1508         u_int32_t __user *tram_data_map;  /* data initializers */
    1509         u_int32_t __user *tram_addr_map;  /* map initializers */
    1510 
    1511         DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */
    1512         u_int32_t __user *code;           /* one instruction - 64 bits */
    1513 } emu10k1_fx8010_code_t;
    1514 
    1515 typedef struct {
     1538        struct snd_emu10k1_fx8010_control_gpr __user *gpr_list_controls; /* listed GPR controls */
     1539
     1540        DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */
     1541        u_int32_t __user *tram_data_map;  /* data initializers */
     1542        u_int32_t __user *tram_addr_map;  /* map initializers */
     1543
     1544        DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */
     1545        u_int32_t __user *code;           /* one instruction - 64 bits */
     1546};
     1547
     1548struct snd_emu10k1_fx8010_tram {
    15161549        unsigned int address;           /* 31.bit == 1 -> external TRAM */
    15171550        unsigned int size;              /* size in samples (4 bytes) */
    15181551        unsigned int *samples;          /* pointer to samples (20-bit) */
    15191552                                        /* NULL->clear memory */
    1520 } emu10k1_fx8010_tram_t;
    1521 
    1522 typedef struct {
     1553};
     1554
     1555struct snd_emu10k1_fx8010_pcm_rec {
    15231556        unsigned int substream;         /* substream number */
    15241557        unsigned int res1;              /* reserved */
    15251558        unsigned int channels;          /* 16-bit channels count, zero = remove this substream */
    15261559        unsigned int tram_start;        /* ring buffer position in TRAM (in samples) */
    1527         unsigned int buffer_size;       /* count of buffered samples */
    1528         unsigned short gpr_size;                /* GPR containing size of ringbuffer in samples (host) */
    1529         unsigned short gpr_ptr;         /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */
    1530         unsigned short gpr_count;       /* GPR containing count of samples between two interrupts (host) */
    1531         unsigned short gpr_tmpcount;    /* GPR containing current count of samples to interrupt (host = set, FX8010) */
    1532         unsigned short gpr_trigger;     /* GPR containing trigger (activate) information (host) */
    1533         unsigned short gpr_running;     /* GPR containing info if PCM is running (FX8010) */
     1560        unsigned int buffer_size;       /* count of buffered samples */
     1561        unsigned short gpr_size;                /* GPR containing size of ringbuffer in samples (host) */
     1562        unsigned short gpr_ptr;         /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */
     1563        unsigned short gpr_count;       /* GPR containing count of samples between two interrupts (host) */
     1564        unsigned short gpr_tmpcount;    /* GPR containing current count of samples to interrupt (host = set, FX8010) */
     1565        unsigned short gpr_trigger;     /* GPR containing trigger (activate) information (host) */
     1566        unsigned short gpr_running;     /* GPR containing info if PCM is running (FX8010) */
    15341567        unsigned char pad;              /* reserved */
    15351568        unsigned char etram[32];        /* external TRAM address & data (one per channel) */
    15361569        unsigned int res2;              /* reserved */
    1537 } emu10k1_fx8010_pcm_t;
    1538 
    1539 #define SNDRV_EMU10K1_IOCTL_INFO        _IOR ('H', 0x10, emu10k1_fx8010_info_t)
    1540 #define SNDRV_EMU10K1_IOCTL_CODE_POKE   _IOW ('H', 0x11, emu10k1_fx8010_code_t)
    1541 #define SNDRV_EMU10K1_IOCTL_CODE_PEEK   _IOWR('H', 0x12, emu10k1_fx8010_code_t)
     1570};
     1571
     1572#define SNDRV_EMU10K1_IOCTL_INFO        _IOR ('H', 0x10, struct snd_emu10k1_fx8010_info)
     1573#define SNDRV_EMU10K1_IOCTL_CODE_POKE   _IOW ('H', 0x11, struct snd_emu10k1_fx8010_code)
     1574#define SNDRV_EMU10K1_IOCTL_CODE_PEEK   _IOWR('H', 0x12, struct snd_emu10k1_fx8010_code)
    15421575#define SNDRV_EMU10K1_IOCTL_TRAM_SETUP  _IOW ('H', 0x20, int)
    1543 #define SNDRV_EMU10K1_IOCTL_TRAM_POKE   _IOW ('H', 0x21, emu10k1_fx8010_tram_t)
    1544 #define SNDRV_EMU10K1_IOCTL_TRAM_PEEK   _IOWR('H', 0x22, emu10k1_fx8010_tram_t)
    1545 #define SNDRV_EMU10K1_IOCTL_PCM_POKE    _IOW ('H', 0x30, emu10k1_fx8010_pcm_t)
    1546 #define SNDRV_EMU10K1_IOCTL_PCM_PEEK    _IOWR('H', 0x31, emu10k1_fx8010_pcm_t)
     1576#define SNDRV_EMU10K1_IOCTL_TRAM_POKE   _IOW ('H', 0x21, struct snd_emu10k1_fx8010_tram)
     1577#define SNDRV_EMU10K1_IOCTL_TRAM_PEEK   _IOWR('H', 0x22, struct snd_emu10k1_fx8010_tram)
     1578#define SNDRV_EMU10K1_IOCTL_PCM_POKE    _IOW ('H', 0x30, struct snd_emu10k1_fx8010_pcm_rec)
     1579#define SNDRV_EMU10K1_IOCTL_PCM_PEEK    _IOWR('H', 0x31, struct snd_emu10k1_fx8010_pcm_rec)
    15471580#define SNDRV_EMU10K1_IOCTL_STOP        _IO  ('H', 0x80)
    15481581#define SNDRV_EMU10K1_IOCTL_CONTINUE    _IO  ('H', 0x81)
     
    15511584#define SNDRV_EMU10K1_IOCTL_DBG_READ    _IOR ('H', 0x84, int)
    15521585
     1586/* typedefs for compatibility to user-space */
     1587typedef struct snd_emu10k1_fx8010_info emu10k1_fx8010_info_t;
     1588typedef struct snd_emu10k1_fx8010_control_gpr emu10k1_fx8010_control_gpr_t;
     1589typedef struct snd_emu10k1_fx8010_code emu10k1_fx8010_code_t;
     1590typedef struct snd_emu10k1_fx8010_tram emu10k1_fx8010_tram_t;
     1591typedef struct snd_emu10k1_fx8010_pcm_rec emu10k1_fx8010_pcm_t;
     1592
    15531593#endif  /* __SOUND_EMU10K1_H */
Note: See TracChangeset for help on using the changeset viewer.