]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/sound/emu10k1.h
Merge master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
[linux-2.6-omap-h63xx.git] / include / sound / emu10k1.h
index 7cfa91e7bde84a068fd79ab995ff154cb1216fa4..eb7ce96ddf3ad4c103718f7501196a78b6615003 100644 (file)
 #define FXRT_CHANNELC          0x0f000000      /* Effects send bus number for channel's effects send C */
 #define FXRT_CHANNELD          0xf0000000      /* Effects send bus number for channel's effects send D */
 
+#define A_HR                   0x0b    /* High Resolution. 24bit playback from host to DSP. */
 #define MAPA                   0x0c            /* Cache map A                                          */
 
 #define MAPB                   0x0d            /* Cache map B                                          */
 #define MAP_PTE_MASK           0xffffe000      /* The 19 MSBs of the PTE indexed by the PTI            */
 #define MAP_PTI_MASK           0x00001fff      /* The 13 bit index to one of the 8192 PTE dwords       */
 
+/* 0x0e, 0x0f: Not used */
+
 #define ENVVOL                 0x10            /* Volume envelope register                             */
 #define ENVVOL_MASK            0x0000ffff      /* Current value of volume envelope state variable      */  
                                                /* 0x8000-n == 666*n usec delay                         */
                                                /* NOTE: All channels contain internal variables; do    */
                                                /* not write to these locations.                        */
 
-/* 1f something */
+/* 0x1f: not used */
 
 #define CD0                    0x20            /* Cache data 0 register                                */
 #define CD1                    0x21            /* Cache data 1 register                                */
 #define FXWC_SPDIFLEFT          (1<<22)                /* 0x00400000 */
 #define FXWC_SPDIFRIGHT         (1<<23)                /* 0x00800000 */
 
+#define A_TBLSZ        `               0x43    /* Effects Tank Internal Table Size. Only low byte or register used */
+
 #define TCBS                   0x44            /* Tank cache buffer size register                      */
 #define TCBS_MASK              0x00000007      /* Tank cache buffer size field                         */
 #define TCBS_BUFFSIZE_16K      0x00000000
 #define FXBA                   0x47            /* FX Buffer Address */
 #define FXBA_MASK              0xfffff000      /* 20 bit base address                                  */
 
-/* 0x48 something - word access, defaults to 3f */
+#define A_HWM                  0x48    /* High PCI Water Mark - word access, defaults to 3f */
 
 #define MICBS                  0x49            /* Microphone buffer size register                      */
 
 #define ADCBS_BUFSIZE_57344    0x0000001e
 #define ADCBS_BUFSIZE_65536    0x0000001f
 
+/* Current Send B, A Amounts */
+#define A_CSBA                 0x4c
+
+/* Current Send D, C Amounts */
+#define A_CSDC                 0x4d
+
+/* Current Send F, E Amounts */
+#define A_CSFE                 0x4e
+
+/* Current Send H, G Amounts */
+#define A_CSHG                 0x4f
+
 
 #define CDCS                   0x50            /* CD-ROM digital channel status register       */
 
 
 #define DBG                    0x52            /* DO NOT PROGRAM THIS REGISTER!!! MAY DESTROY CHIP */
 
+/* S/PDIF Input C Channel Status */
+#define A_SPSC                 0x52
+
 #define REG53                  0x53            /* DO NOT PROGRAM THIS REGISTER!!! MAY DESTROY CHIP */
 
 #define A_DBG                   0x53
 #define SPCS_NOTAUDIODATA      0x00000002      /* 0 = Digital audio, 1 = not audio             */
 #define SPCS_PROFESSIONAL      0x00000001      /* 0 = Consumer (IEC-958), 1 = pro (AES3-1992)  */
 
+/* 0x57: Not used */
+
 /* The 32-bit CLIx and SOLx registers all have one bit per channel control/status                      */
 #define CLIEL                  0x58            /* Channel loop interrupt enable low register   */
 
 #define AC97SLOT_CNTR          0x10            /* Center enable */
 #define AC97SLOT_LFE           0x20            /* LFE enable */
 
+/* PCB Revision */
+#define A_PCB                  0x5f
+
 // NOTE: 0x60,61,62: 64-bit
 #define CDSRCS                 0x60            /* CD-ROM Sample Rate Converter status register */
 
 
 #define HLIPH                  0x69            /* Channel half loop interrupt pending high register    */
 
-// 0x6a,6b,6c used for some recording
-// 0x6d unused
-// 0x6e,6f - tanktable base / offset
+/* S/PDIF Host Record Index (bypasses SRC) */
+#define A_SPRI                 0x6a
+/* S/PDIF Host Record Address */
+#define A_SPRA                 0x6b
+/* S/PDIF Host Record Control */
+#define A_SPRC                 0x6c
+/* Delayed Interrupt Counter & Enable */
+#define A_DICE                 0x6d
+/* Tank Table Base */
+#define A_TTB                  0x6e
+/* Tank Delay Offset */
+#define A_TDOF                 0x6f
 
 /* This is the MPU port on the card (via the game port)                                                */
 #define A_MUDATA1              0x70
 #define A_FXWC1                        0x74            /* Selects 0x7f-0x60 for FX recording           */
 #define A_FXWC2                        0x75            /* Selects 0x9f-0x80 for FX recording           */
 
+/* Extended Hardware Control */
 #define A_SPDIF_SAMPLERATE     0x76            /* Set the sample rate of SPDIF output          */
 #define A_SAMPLE_RATE          0x76            /* Various sample rate settings. */
 #define A_SAMPLE_RATE_NOT_USED  0x0ffc111e     /* Bits that are not used and cannot be set.    */
 #define A_PCM_96000            0x00004000
 #define A_PCM_44100            0x00008000
 
-/* 0x77,0x78,0x79 "something i2s-related" - default to 0x01080000 on my audigy 2 ZS --rlrevell */
-/* 0x7a, 0x7b - lookup tables */
+/* I2S0 Sample Rate Tracker Status */
+#define A_SRT3                 0x77
+
+/* I2S1 Sample Rate Tracker Status */
+#define A_SRT4                 0x78
+
+/* I2S2 Sample Rate Tracker Status */
+#define A_SRT5                 0x79
+/* - default to 0x01080000 on my audigy 2 ZS --rlrevell        */
+
+/* Tank Table DMA Address */
+#define A_TTDA                 0x7a
+/* Tank Table DMA Data */
+#define A_TTDD                 0x7b
 
 #define A_FXRT2                        0x7c
 #define A_FXRT_CHANNELE                0x0000003f      /* Effects send bus number for channel's effects send E */
 #define A_FXRT_CHANNELC                0x003f0000
 #define A_FXRT_CHANNELD                0x3f000000
 
-
+/* 0x7f: Not used */
 /* Each FX general purpose register is 32 bits in length, all bits are used                    */
 #define FXGPREGBASE            0x100           /* FX general purpose registers base            */
 #define A_FXGPREGBASE          0x400           /* Audigy GPRs, 0x400 to 0x5ff                  */
@@ -1392,6 +1439,7 @@ struct snd_emu1010 {
        unsigned int input_source[64];
        unsigned int adc_pads; /* bit mask */
        unsigned int dac_pads; /* bit mask */
+       unsigned int internal_clock; /* 44100 or 48000 */
 };
 
 struct snd_emu10k1 {
@@ -1401,6 +1449,7 @@ struct snd_emu10k1 {
        unsigned int tos_link: 1,               /* tos link detected */
                rear_ac97: 1,                   /* rear channels are on AC'97 */
                enable_ir: 1;
+       unsigned int support_tlv :1;
        /* Contains profile of card capabilities */
        const struct snd_emu_chip_details *card_capabilities;
        unsigned int audigy;                    /* is Audigy? */
@@ -1426,6 +1475,8 @@ struct snd_emu10k1 {
        spinlock_t memblk_lock;
 
        unsigned int spdif_bits[3];             /* s/pdif out setup */
+       unsigned int i2c_capture_source;
+       u8 i2c_capture_volume[4][2];
 
        struct snd_emu10k1_fx8010 fx8010;               /* FX8010 info */
        int gpr_base;
@@ -1531,6 +1582,7 @@ void snd_emu10k1_ptr_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned i
 unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu, unsigned int reg, unsigned int chn);
 void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data);
 int snd_emu10k1_spi_write(struct snd_emu10k1 * emu, unsigned int data);
+int snd_emu10k1_i2c_write(struct snd_emu10k1 *emu, u32 reg, u32 value);
 int snd_emu1010_fpga_write(struct snd_emu10k1 * emu, int reg, int value);
 int snd_emu1010_fpga_read(struct snd_emu10k1 * emu, int reg, int *value);
 int snd_emu1010_fpga_link_dst_src_write(struct snd_emu10k1 * emu, int dst, int src);
@@ -1850,11 +1902,20 @@ struct snd_emu10k1_fx8010_control_gpr {
        unsigned int value[32];         /* initial values */
        unsigned int min;               /* minimum range */
        unsigned int max;               /* maximum range */
-       union {
-               snd_kcontrol_tlv_rw_t *c;
-               unsigned int *p;
-       } tlv;
        unsigned int translation;       /* translation type (EMU10K1_GPR_TRANSLATION*) */
+       const unsigned int *tlv;
+};
+
+/* old ABI without TLV support */
+struct snd_emu10k1_fx8010_control_old_gpr {
+       struct snd_ctl_elem_id id;
+       unsigned int vcount;
+       unsigned int count;
+       unsigned short gpr[32];
+       unsigned int value[32];
+       unsigned int min;
+       unsigned int max;
+       unsigned int translation;
 };
 
 struct snd_emu10k1_fx8010_code {
@@ -1905,6 +1966,8 @@ struct snd_emu10k1_fx8010_pcm_rec {
        unsigned int res2;              /* reserved */
 };
 
+#define SNDRV_EMU10K1_VERSION          SNDRV_PROTOCOL_VERSION(1, 0, 1)
+
 #define SNDRV_EMU10K1_IOCTL_INFO       _IOR ('H', 0x10, struct snd_emu10k1_fx8010_info)
 #define SNDRV_EMU10K1_IOCTL_CODE_POKE  _IOW ('H', 0x11, struct snd_emu10k1_fx8010_code)
 #define SNDRV_EMU10K1_IOCTL_CODE_PEEK  _IOWR('H', 0x12, struct snd_emu10k1_fx8010_code)
@@ -1913,6 +1976,7 @@ struct snd_emu10k1_fx8010_pcm_rec {
 #define SNDRV_EMU10K1_IOCTL_TRAM_PEEK  _IOWR('H', 0x22, struct snd_emu10k1_fx8010_tram)
 #define SNDRV_EMU10K1_IOCTL_PCM_POKE   _IOW ('H', 0x30, struct snd_emu10k1_fx8010_pcm_rec)
 #define SNDRV_EMU10K1_IOCTL_PCM_PEEK   _IOWR('H', 0x31, struct snd_emu10k1_fx8010_pcm_rec)
+#define SNDRV_EMU10K1_IOCTL_PVERSION   _IOR ('H', 0x40, int)
 #define SNDRV_EMU10K1_IOCTL_STOP       _IO  ('H', 0x80)
 #define SNDRV_EMU10K1_IOCTL_CONTINUE   _IO  ('H', 0x81)
 #define SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER _IO ('H', 0x82)