0001
0002 #ifndef __SOUND_VT1724_H
0003 #define __SOUND_VT1724_H
0004
0005
0006
0007
0008
0009
0010
0011 #include <sound/control.h>
0012 #include <sound/ac97_codec.h>
0013 #include <sound/rawmidi.h>
0014 #include <sound/i2c.h>
0015 #include <sound/pcm.h>
0016
0017 #include "ice1712.h"
0018
0019 enum {
0020 ICE_EEP2_SYSCONF = 0,
0021 ICE_EEP2_ACLINK,
0022 ICE_EEP2_I2S,
0023 ICE_EEP2_SPDIF,
0024 ICE_EEP2_GPIO_DIR,
0025 ICE_EEP2_GPIO_DIR1,
0026 ICE_EEP2_GPIO_DIR2,
0027 ICE_EEP2_GPIO_MASK,
0028 ICE_EEP2_GPIO_MASK1,
0029 ICE_EEP2_GPIO_MASK2,
0030 ICE_EEP2_GPIO_STATE,
0031 ICE_EEP2_GPIO_STATE1,
0032 ICE_EEP2_GPIO_STATE2
0033 };
0034
0035
0036
0037
0038
0039 #define ICEREG1724(ice, x) ((ice)->port + VT1724_REG_##x)
0040
0041 #define VT1724_REG_CONTROL 0x00
0042 #define VT1724_RESET 0x80
0043 #define VT1724_REG_IRQMASK 0x01
0044 #define VT1724_IRQ_MPU_RX 0x80
0045 #define VT1724_IRQ_MPU_TX 0x20
0046 #define VT1724_IRQ_MTPCM 0x10
0047 #define VT1724_REG_IRQSTAT 0x02
0048
0049 #define VT1724_REG_SYS_CFG 0x04
0050 #define VT1724_CFG_CLOCK 0xc0
0051 #define VT1724_CFG_CLOCK512 0x00
0052 #define VT1724_CFG_CLOCK384 0x40
0053 #define VT1724_CFG_MPU401 0x20
0054 #define VT1724_CFG_ADC_MASK 0x0c
0055 #define VT1724_CFG_ADC_NONE 0x0c
0056 #define VT1724_CFG_DAC_MASK 0x03
0057
0058 #define VT1724_REG_AC97_CFG 0x05
0059 #define VT1724_CFG_PRO_I2S 0x80
0060 #define VT1724_CFG_AC97_PACKED 0x01
0061
0062 #define VT1724_REG_I2S_FEATURES 0x06
0063 #define VT1724_CFG_I2S_VOLUME 0x80
0064 #define VT1724_CFG_I2S_96KHZ 0x40
0065 #define VT1724_CFG_I2S_RESMASK 0x30
0066 #define VT1724_CFG_I2S_192KHZ 0x08
0067 #define VT1724_CFG_I2S_OTHER 0x07
0068
0069 #define VT1724_REG_SPDIF_CFG 0x07
0070 #define VT1724_CFG_SPDIF_OUT_EN 0x80
0071 #define VT1724_CFG_SPDIF_OUT_INT 0x40
0072 #define VT1724_CFG_I2S_CHIPID 0x3c
0073 #define VT1724_CFG_SPDIF_IN 0x02
0074 #define VT1724_CFG_SPDIF_OUT 0x01
0075
0076
0077
0078
0079
0080 #define VT1724_REG_MPU_TXFIFO 0x0a
0081 #define VT1724_REG_MPU_RXFIFO 0x0b
0082
0083 #define VT1724_REG_MPU_DATA 0x0c
0084 #define VT1724_REG_MPU_CTRL 0x0d
0085 #define VT1724_MPU_UART 0x01
0086 #define VT1724_MPU_TX_EMPTY 0x02
0087 #define VT1724_MPU_TX_FULL 0x04
0088 #define VT1724_MPU_RX_EMPTY 0x08
0089 #define VT1724_MPU_RX_FULL 0x10
0090
0091 #define VT1724_REG_MPU_FIFO_WM 0x0e
0092 #define VT1724_MPU_RX_FIFO 0x20
0093 #define VT1724_MPU_FIFO_MASK 0x1f
0094
0095 #define VT1724_REG_I2C_DEV_ADDR 0x10
0096 #define VT1724_I2C_WRITE 0x01
0097 #define VT1724_REG_I2C_BYTE_ADDR 0x11
0098 #define VT1724_REG_I2C_DATA 0x12
0099 #define VT1724_REG_I2C_CTRL 0x13
0100 #define VT1724_I2C_EEPROM 0x80
0101 #define VT1724_I2C_BUSY 0x01
0102
0103 #define VT1724_REG_GPIO_DATA 0x14
0104 #define VT1724_REG_GPIO_WRITE_MASK 0x16
0105 #define VT1724_REG_GPIO_DIRECTION 0x18
0106
0107
0108 #define VT1724_REG_POWERDOWN 0x1c
0109 #define VT1724_REG_GPIO_DATA_22 0x1e
0110 #define VT1724_REG_GPIO_WRITE_MASK_22 0x1f
0111
0112
0113
0114
0115
0116
0117 #define ICEMT1724(ice, x) ((ice)->profi_port + VT1724_MT_##x)
0118
0119 #define VT1724_MT_IRQ 0x00
0120 #define VT1724_MULTI_PDMA4 0x80
0121 #define VT1724_MULTI_PDMA3 0x40
0122 #define VT1724_MULTI_PDMA2 0x20
0123 #define VT1724_MULTI_PDMA1 0x10
0124 #define VT1724_MULTI_FIFO_ERR 0x08
0125 #define VT1724_MULTI_RDMA1 0x04
0126 #define VT1724_MULTI_RDMA0 0x02
0127 #define VT1724_MULTI_PDMA0 0x01
0128
0129 #define VT1724_MT_RATE 0x01
0130 #define VT1724_SPDIF_MASTER 0x10
0131 #define VT1724_MT_I2S_FORMAT 0x02
0132 #define VT1724_MT_I2S_MCLK_128X 0x08
0133 #define VT1724_MT_I2S_FORMAT_MASK 0x03
0134 #define VT1724_MT_I2S_FORMAT_I2S 0x00
0135 #define VT1724_MT_DMA_INT_MASK 0x03
0136
0137 #define VT1724_MT_AC97_INDEX 0x04
0138 #define VT1724_MT_AC97_CMD 0x05
0139 #define VT1724_AC97_COLD 0x80
0140 #define VT1724_AC97_WARM 0x40
0141 #define VT1724_AC97_WRITE 0x20
0142 #define VT1724_AC97_READ 0x10
0143 #define VT1724_AC97_READY 0x08
0144 #define VT1724_AC97_ID_MASK 0x03
0145 #define VT1724_MT_AC97_DATA 0x06
0146 #define VT1724_MT_PLAYBACK_ADDR 0x10
0147 #define VT1724_MT_PLAYBACK_SIZE 0x14
0148 #define VT1724_MT_DMA_CONTROL 0x18
0149 #define VT1724_PDMA4_START 0x80
0150 #define VT1724_PDMA3_START 0x40
0151 #define VT1724_PDMA2_START 0x20
0152 #define VT1724_PDMA1_START 0x10
0153 #define VT1724_RDMA1_START 0x04
0154 #define VT1724_RDMA0_START 0x02
0155 #define VT1724_PDMA0_START 0x01
0156 #define VT1724_MT_BURST 0x19
0157 #define VT1724_MT_DMA_FIFO_ERR 0x1a
0158 #define VT1724_PDMA4_UNDERRUN 0x80
0159 #define VT1724_PDMA2_UNDERRUN 0x40
0160 #define VT1724_PDMA3_UNDERRUN 0x20
0161 #define VT1724_PDMA1_UNDERRUN 0x10
0162 #define VT1724_RDMA1_UNDERRUN 0x04
0163 #define VT1724_RDMA0_UNDERRUN 0x02
0164 #define VT1724_PDMA0_UNDERRUN 0x01
0165 #define VT1724_MT_DMA_PAUSE 0x1b
0166 #define VT1724_PDMA4_PAUSE 0x80
0167 #define VT1724_PDMA3_PAUSE 0x40
0168 #define VT1724_PDMA2_PAUSE 0x20
0169 #define VT1724_PDMA1_PAUSE 0x10
0170 #define VT1724_RDMA1_PAUSE 0x04
0171 #define VT1724_RDMA0_PAUSE 0x02
0172 #define VT1724_PDMA0_PAUSE 0x01
0173 #define VT1724_MT_PLAYBACK_COUNT 0x1c
0174 #define VT1724_MT_CAPTURE_ADDR 0x20
0175 #define VT1724_MT_CAPTURE_SIZE 0x24
0176 #define VT1724_MT_CAPTURE_COUNT 0x26
0177
0178 #define VT1724_MT_ROUTE_PLAYBACK 0x2c
0179
0180 #define VT1724_MT_RDMA1_ADDR 0x30
0181 #define VT1724_MT_RDMA1_SIZE 0x34
0182 #define VT1724_MT_RDMA1_COUNT 0x36
0183
0184 #define VT1724_MT_SPDIF_CTRL 0x3c
0185 #define VT1724_MT_MONITOR_PEAKINDEX 0x3e
0186 #define VT1724_MT_MONITOR_PEAKDATA 0x3f
0187
0188
0189 #define VT1724_MT_PDMA4_ADDR 0x40
0190 #define VT1724_MT_PDMA4_SIZE 0x44
0191 #define VT1724_MT_PDMA4_COUNT 0x46
0192 #define VT1724_MT_PDMA3_ADDR 0x50
0193 #define VT1724_MT_PDMA3_SIZE 0x54
0194 #define VT1724_MT_PDMA3_COUNT 0x56
0195 #define VT1724_MT_PDMA2_ADDR 0x60
0196 #define VT1724_MT_PDMA2_SIZE 0x64
0197 #define VT1724_MT_PDMA2_COUNT 0x66
0198 #define VT1724_MT_PDMA1_ADDR 0x70
0199 #define VT1724_MT_PDMA1_SIZE 0x74
0200 #define VT1724_MT_PDMA1_COUNT 0x76
0201
0202
0203 unsigned char snd_vt1724_read_i2c(struct snd_ice1712 *ice, unsigned char dev, unsigned char addr);
0204 void snd_vt1724_write_i2c(struct snd_ice1712 *ice, unsigned char dev, unsigned char addr, unsigned char data);
0205
0206 #endif