52 #include <linux/pci.h>
53 #include <linux/slab.h>
54 #include <linux/gameport.h>
55 #include <linux/module.h>
74 "{TerraTec,128i PCI}}");
76 #if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
77 #define SUPPORT_JOYSTICK 1
91 #define SLIO_REG(chip, x) ((chip)->io_port + ESSIO_REG_##x)
93 #define SLDM_REG(chip, x) ((chip)->ddma_port + ESSDM_REG_##x)
95 #define SLSB_REG(chip, x) ((chip)->sb_port + ESSSB_REG_##x)
97 #define SL_PCI_LEGACYCONTROL 0x40
98 #define SL_PCI_CONFIG 0x50
99 #define SL_PCI_DDMACONTROL 0x60
101 #define ESSIO_REG_AUDIO2DMAADDR 0
102 #define ESSIO_REG_AUDIO2DMACOUNT 4
103 #define ESSIO_REG_AUDIO2MODE 6
104 #define ESSIO_REG_IRQCONTROL 7
106 #define ESSDM_REG_DMAADDR 0x00
107 #define ESSDM_REG_DMACOUNT 0x04
108 #define ESSDM_REG_DMACOMMAND 0x08
109 #define ESSDM_REG_DMASTATUS 0x08
110 #define ESSDM_REG_DMAMODE 0x0b
111 #define ESSDM_REG_DMACLEAR 0x0d
112 #define ESSDM_REG_DMAMASK 0x0f
114 #define ESSSB_REG_FMLOWADDR 0x00
115 #define ESSSB_REG_FMHIGHADDR 0x02
116 #define ESSSB_REG_MIXERADDR 0x04
117 #define ESSSB_REG_MIXERDATA 0x05
119 #define ESSSB_IREG_AUDIO1 0x14
120 #define ESSSB_IREG_MICMIX 0x1a
121 #define ESSSB_IREG_RECSRC 0x1c
122 #define ESSSB_IREG_MASTER 0x32
123 #define ESSSB_IREG_FM 0x36
124 #define ESSSB_IREG_AUXACD 0x38
125 #define ESSSB_IREG_AUXB 0x3a
126 #define ESSSB_IREG_PCSPEAKER 0x3c
127 #define ESSSB_IREG_LINE 0x3e
128 #define ESSSB_IREG_SPATCONTROL 0x50
129 #define ESSSB_IREG_SPATLEVEL 0x52
130 #define ESSSB_IREG_MASTER_LEFT 0x60
131 #define ESSSB_IREG_MASTER_RIGHT 0x62
132 #define ESSSB_IREG_MPU401CONTROL 0x64
133 #define ESSSB_IREG_MICMIXRECORD 0x68
134 #define ESSSB_IREG_AUDIO2RECORD 0x69
135 #define ESSSB_IREG_AUXACDRECORD 0x6a
136 #define ESSSB_IREG_FMRECORD 0x6b
137 #define ESSSB_IREG_AUXBRECORD 0x6c
138 #define ESSSB_IREG_MONO 0x6d
139 #define ESSSB_IREG_LINERECORD 0x6e
140 #define ESSSB_IREG_MONORECORD 0x6f
141 #define ESSSB_IREG_AUDIO2SAMPLE 0x70
142 #define ESSSB_IREG_AUDIO2MODE 0x71
143 #define ESSSB_IREG_AUDIO2FILTER 0x72
144 #define ESSSB_IREG_AUDIO2TCOUNTL 0x74
145 #define ESSSB_IREG_AUDIO2TCOUNTH 0x76
146 #define ESSSB_IREG_AUDIO2CONTROL1 0x78
147 #define ESSSB_IREG_AUDIO2CONTROL2 0x7a
148 #define ESSSB_IREG_AUDIO2 0x7c
150 #define ESSSB_REG_RESET 0x06
152 #define ESSSB_REG_READDATA 0x0a
153 #define ESSSB_REG_WRITEDATA 0x0c
154 #define ESSSB_REG_READSTATUS 0x0c
156 #define ESSSB_REG_STATUS 0x0e
158 #define ESS_CMD_EXTSAMPLERATE 0xa1
159 #define ESS_CMD_FILTERDIV 0xa2
160 #define ESS_CMD_DMACNTRELOADL 0xa4
161 #define ESS_CMD_DMACNTRELOADH 0xa5
162 #define ESS_CMD_ANALOGCONTROL 0xa8
163 #define ESS_CMD_IRQCONTROL 0xb1
164 #define ESS_CMD_DRQCONTROL 0xb2
165 #define ESS_CMD_RECLEVEL 0xb4
166 #define ESS_CMD_SETFORMAT 0xb6
167 #define ESS_CMD_SETFORMAT2 0xb7
168 #define ESS_CMD_DMACONTROL 0xb8
169 #define ESS_CMD_DMATYPE 0xb9
170 #define ESS_CMD_OFFSETLEFT 0xba
171 #define ESS_CMD_OFFSETRIGHT 0xbb
172 #define ESS_CMD_READREG 0xc0
173 #define ESS_CMD_ENABLEEXT 0xc6
174 #define ESS_CMD_PAUSEDMA 0xd0
175 #define ESS_CMD_ENABLEAUDIO1 0xd1
176 #define ESS_CMD_STOPAUDIO1 0xd3
177 #define ESS_CMD_AUDIO1STATUS 0xd8
178 #define ESS_CMD_CONTDMA 0xd4
179 #define ESS_CMD_TESTIRQ 0xf2
181 #define ESS_RECSRC_MIC 0
182 #define ESS_RECSRC_AUXACD 2
183 #define ESS_RECSRC_AUXB 5
184 #define ESS_RECSRC_LINE 6
185 #define ESS_RECSRC_NONE 7
195 #define SAVED_REG_SIZE 32
236 #ifdef SUPPORT_JOYSTICK
239 #ifdef CONFIG_PM_SLEEP
253 #define RESET_LOOP_TIMEOUT 0x10000
254 #define WRITE_LOOP_TIMEOUT 0x10000
255 #define GET_LOOP_TIMEOUT 0x01000
261 static void snd_es1938_mixer_write(
struct es1938 *
chip,
unsigned char reg,
unsigned char val)
267 spin_unlock_irqrestore(&chip->
mixer_lock, flags);
276 static int snd_es1938_mixer_read(
struct es1938 *
chip,
unsigned char reg)
283 spin_unlock_irqrestore(&chip->
mixer_lock, flags);
293 static int snd_es1938_mixer_bits(
struct es1938 *chip,
unsigned char reg,
294 unsigned char mask,
unsigned char val)
297 unsigned char old,
new, oval;
303 new = (old & ~mask) | (val & mask);
310 spin_unlock_irqrestore(&chip->
mixer_lock, flags);
317 static void snd_es1938_write_cmd(
struct es1938 *chip,
unsigned char cmd)
322 if (!(v =
inb(
SLSB_REG(chip, READSTATUS)) & 0x80)) {
327 printk(
KERN_ERR "snd_es1938_write_cmd timeout (0x02%x/0x02%x)\n", cmd, v);
333 static int snd_es1938_get_byte(
struct es1938 *chip)
347 static void snd_es1938_write(
struct es1938 *chip,
unsigned char reg,
unsigned char val)
351 snd_es1938_write_cmd(chip, reg);
352 snd_es1938_write_cmd(chip, val);
353 spin_unlock_irqrestore(&chip->
reg_lock, flags);
362 static unsigned char snd_es1938_read(
struct es1938 *chip,
unsigned char reg)
368 snd_es1938_write_cmd(chip, reg);
369 val = snd_es1938_get_byte(chip);
370 spin_unlock_irqrestore(&chip->
reg_lock, flags);
380 static int snd_es1938_bits(
struct es1938 *chip,
unsigned char reg,
unsigned char mask,
384 unsigned char old,
new, oval;
387 snd_es1938_write_cmd(chip, reg);
388 old = snd_es1938_get_byte(chip);
391 snd_es1938_write_cmd(chip, reg);
392 new = (old & ~mask) | (val & mask);
393 snd_es1938_write_cmd(chip,
new);
399 spin_unlock_irqrestore(&chip->
reg_lock, flags);
406 static void snd_es1938_reset(
struct es1938 *chip)
436 snd_es1938_mixer_write(chip, 0x54, 0x8f);
437 snd_es1938_mixer_write(chip, 0x56, 0x95);
438 snd_es1938_mixer_write(chip, 0x58, 0x94);
439 snd_es1938_mixer_write(chip, 0x5a, 0x80);
445 static void snd_es1938_reset_fifo(
struct es1938 *chip)
472 static void snd_es1938_rate_set(
struct es1938 *chip,
476 unsigned int bits, div0;
484 div0 = 256 - 7160000*20/(8*82*runtime->
rate);
487 snd_es1938_mixer_write(chip, 0x70, bits);
488 snd_es1938_mixer_write(chip, 0x72, div0);
490 snd_es1938_write(chip, 0xA1, bits);
491 snd_es1938_write(chip, 0xA2, div0);
499 static void snd_es1938_playback1_setdma(
struct es1938 *chip)
507 static void snd_es1938_playback2_setdma(
struct es1938 *chip)
522 static void snd_es1938_capture_setdma(
struct es1938 *chip)
622 switch (substream->
number) {
624 return snd_es1938_playback1_trigger(substream, cmd);
626 return snd_es1938_playback2_trigger(substream, cmd);
640 unsigned int size = snd_pcm_lib_buffer_bytes(substream);
641 unsigned int count = snd_pcm_lib_period_bytes(substream);
646 mono = (runtime->
channels > 1) ? 0 : 1;
652 snd_es1938_reset_fifo(chip);
658 snd_es1938_rate_set(chip, substream,
ADC1);
660 count = 0x10000 -
count;
668 (is8 ? 0x00 : 0x04) |
669 (mono ? 0x40 : 0x08));
674 snd_es1938_capture_setdma(chip);
688 unsigned int size = snd_pcm_lib_buffer_bytes(substream);
689 unsigned int count = snd_pcm_lib_period_bytes(substream);
694 mono = (runtime->
channels > 1) ? 0 : 1;
700 snd_es1938_reset_fifo(chip);
703 snd_es1938_rate_set(chip, substream,
DAC2);
706 count = 0x10000 -
count;
712 (mono ? 0 : 2) | (is8 ? 0 : 1));
715 snd_es1938_playback1_setdma(chip);
725 unsigned int size = snd_pcm_lib_buffer_bytes(substream);
726 unsigned int count = snd_pcm_lib_period_bytes(substream);
731 mono = (runtime->
channels > 1) ? 0 : 1;
737 count = 0x10000 -
count;
740 snd_es1938_reset_fifo(chip);
745 snd_es1938_rate_set(chip, substream,
DAC1);
753 0x90 | (mono ? 0x40 : 0x08) |
754 (is8 ? 0x00 : 0x04) | (u ? 0x00 : 0x20));
757 snd_es1938_playback2_setdma(chip);
764 switch (substream->
number) {
766 return snd_es1938_playback1_prepare(substream);
768 return snd_es1938_playback2_prepare(substream);
790 while ((
new =
inw(
SLDM_REG(chip, DMACOUNT))) != old)
832 while ((
new =
inw(
SLDM_REG(chip, DMACOUNT))) != old)
843 switch (substream->
number) {
845 return snd_es1938_playback1_pointer(substream);
847 return snd_es1938_playback2_pointer(substream);
871 if (
put_user(runtime->
dma_area[0], ((
unsigned char __user *)dst) + count - 1))
910 .buffer_bytes_max = 0x8000,
911 .period_bytes_min = 64,
912 .period_bytes_max = 0x8000,
933 .buffer_bytes_max = 0x8000,
934 .period_bytes_min = 64,
935 .period_bytes_max = 0x8000,
949 runtime->
hw = snd_es1938_capture;
951 &hw_constraints_clocks);
961 switch (substream->
number) {
974 runtime->
hw = snd_es1938_playback;
976 &hw_constraints_clocks);
993 switch (substream->
number) {
1007 static struct snd_pcm_ops snd_es1938_playback_ops = {
1008 .open = snd_es1938_playback_open,
1009 .close = snd_es1938_playback_close,
1011 .hw_params = snd_es1938_pcm_hw_params,
1012 .hw_free = snd_es1938_pcm_hw_free,
1013 .prepare = snd_es1938_playback_prepare,
1014 .trigger = snd_es1938_playback_trigger,
1015 .pointer = snd_es1938_playback_pointer,
1018 static struct snd_pcm_ops snd_es1938_capture_ops = {
1019 .open = snd_es1938_capture_open,
1020 .close = snd_es1938_capture_close,
1022 .hw_params = snd_es1938_pcm_hw_params,
1023 .hw_free = snd_es1938_pcm_hw_free,
1024 .prepare = snd_es1938_capture_prepare,
1025 .trigger = snd_es1938_capture_trigger,
1026 .pointer = snd_es1938_capture_pointer,
1027 .copy = snd_es1938_capture_copy,
1035 if ((err =
snd_pcm_new(chip->
card,
"es-1938-1946", device, 2, 1, &pcm)) < 0)
1056 static int snd_es1938_info_mux(
struct snd_kcontrol *kcontrol,
1059 static char *texts[8] = {
1060 "Mic",
"Mic Master",
"CD",
"AOUT",
1061 "Mic1",
"Mix",
"Line",
"Master"
1073 static int snd_es1938_get_mux(
struct snd_kcontrol *kcontrol,
1077 ucontrol->
value.enumerated.item[0] = snd_es1938_mixer_read(chip, 0x1c) & 0x07;
1081 static int snd_es1938_put_mux(
struct snd_kcontrol *kcontrol,
1085 unsigned char val = ucontrol->
value.enumerated.item[0];
1089 return snd_es1938_mixer_bits(chip, 0x1c, 0x07, val) !=
val;
1092 #define snd_es1938_info_spatializer_enable snd_ctl_boolean_mono_info
1094 static int snd_es1938_get_spatializer_enable(
struct snd_kcontrol *kcontrol,
1098 unsigned char val = snd_es1938_mixer_read(chip, 0x50);
1099 ucontrol->
value.integer.value[0] = !!(val & 8);
1103 static int snd_es1938_put_spatializer_enable(
struct snd_kcontrol *kcontrol,
1107 unsigned char oval, nval;
1109 nval = ucontrol->
value.integer.value[0] ? 0x0c : 0x04;
1110 oval = snd_es1938_mixer_read(chip, 0x50) & 0x0c;
1111 change = nval != oval;
1113 snd_es1938_mixer_write(chip, 0x50, nval & ~0x04);
1114 snd_es1938_mixer_write(chip, 0x50, nval);
1119 static int snd_es1938_info_hw_volume(
struct snd_kcontrol *kcontrol,
1129 static int snd_es1938_get_hw_volume(
struct snd_kcontrol *kcontrol,
1133 ucontrol->
value.integer.value[0] = snd_es1938_mixer_read(chip, 0x61) & 0x3f;
1134 ucontrol->
value.integer.value[1] = snd_es1938_mixer_read(chip, 0x63) & 0x3f;
1138 #define snd_es1938_info_hw_switch snd_ctl_boolean_stereo_info
1140 static int snd_es1938_get_hw_switch(
struct snd_kcontrol *kcontrol,
1144 ucontrol->
value.integer.value[0] = !(snd_es1938_mixer_read(chip, 0x61) & 0x40);
1145 ucontrol->
value.integer.value[1] = !(snd_es1938_mixer_read(chip, 0x63) & 0x40);
1149 static void snd_es1938_hwv_free(
struct snd_kcontrol *kcontrol)
1158 static int snd_es1938_reg_bits(
struct es1938 *chip,
unsigned char reg,
1159 unsigned char mask,
unsigned char val)
1162 return snd_es1938_mixer_bits(chip, reg, mask, val);
1164 return snd_es1938_bits(chip, reg, mask, val);
1167 static int snd_es1938_reg_read(
struct es1938 *chip,
unsigned char reg)
1170 return snd_es1938_mixer_read(chip, reg);
1172 return snd_es1938_read(chip, reg);
1175 #define ES1938_SINGLE_TLV(xname, xindex, reg, shift, mask, invert, xtlv) \
1176 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
1177 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ,\
1178 .name = xname, .index = xindex, \
1179 .info = snd_es1938_info_single, \
1180 .get = snd_es1938_get_single, .put = snd_es1938_put_single, \
1181 .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24), \
1182 .tlv = { .p = xtlv } }
1183 #define ES1938_SINGLE(xname, xindex, reg, shift, mask, invert) \
1184 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
1185 .info = snd_es1938_info_single, \
1186 .get = snd_es1938_get_single, .put = snd_es1938_put_single, \
1187 .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) }
1189 static int snd_es1938_info_single(
struct snd_kcontrol *kcontrol,
1201 static int snd_es1938_get_single(
struct snd_kcontrol *kcontrol,
1211 val = snd_es1938_reg_read(chip, reg);
1212 ucontrol->
value.integer.value[0] = (val >> shift) & mask;
1214 ucontrol->
value.integer.value[0] = mask - ucontrol->
value.integer.value[0];
1218 static int snd_es1938_put_single(
struct snd_kcontrol *kcontrol,
1228 val = (ucontrol->
value.integer.value[0] &
mask);
1233 return snd_es1938_reg_bits(chip, reg, mask, val) !=
val;
1236 #define ES1938_DOUBLE_TLV(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert, xtlv) \
1237 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
1238 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ,\
1239 .name = xname, .index = xindex, \
1240 .info = snd_es1938_info_double, \
1241 .get = snd_es1938_get_double, .put = snd_es1938_put_double, \
1242 .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22), \
1243 .tlv = { .p = xtlv } }
1244 #define ES1938_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \
1245 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
1246 .info = snd_es1938_info_double, \
1247 .get = snd_es1938_get_double, .put = snd_es1938_put_double, \
1248 .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) }
1250 static int snd_es1938_info_double(
struct snd_kcontrol *kcontrol,
1262 static int snd_es1938_get_double(
struct snd_kcontrol *kcontrol,
1274 left = snd_es1938_reg_read(chip, left_reg);
1275 if (left_reg != right_reg)
1276 right = snd_es1938_reg_read(chip, right_reg);
1279 ucontrol->
value.integer.value[0] = (left >> shift_left) & mask;
1282 ucontrol->
value.integer.value[0] = mask - ucontrol->
value.integer.value[0];
1283 ucontrol->
value.integer.value[1] = mask - ucontrol->
value.integer.value[1];
1288 static int snd_es1938_put_double(
struct snd_kcontrol *kcontrol,
1299 unsigned char val1, val2, mask1, mask2;
1301 val1 = ucontrol->
value.integer.value[0] &
mask;
1302 val2 = ucontrol->
value.integer.value[1] &
mask;
1307 val1 <<= shift_left;
1309 mask1 = mask << shift_left;
1311 if (left_reg != right_reg) {
1313 if (snd_es1938_reg_bits(chip, left_reg, mask1, val1) != val1)
1315 if (snd_es1938_reg_bits(chip, right_reg, mask2, val2) != val2)
1318 change = (snd_es1938_reg_bits(chip, left_reg, mask1 | mask2,
1319 val1 | val2) != (val1 | val2));
1354 ES1938_DOUBLE(
"Master Playback Switch", 0, 0x60, 0x62, 6, 6, 1, 1),
1357 .name =
"Hardware Master Playback Volume",
1359 .info = snd_es1938_info_hw_volume,
1360 .get = snd_es1938_get_hw_volume,
1366 .
name =
"Hardware Master Playback Switch",
1368 .
get = snd_es1938_get_hw_switch,
1369 .
tlv = { .p = db_scale_master },
1374 ES1938_DOUBLE(
"CD Playback Volume", 0, 0x38, 0x38, 4, 0, 15, 0),
1390 .name =
"Capture Source",
1391 .info = snd_es1938_info_mux,
1392 .get = snd_es1938_get_mux,
1393 .put = snd_es1938_put_mux,
1418 .name =
"3D Control - Switch",
1420 .get = snd_es1938_get_spatializer_enable,
1421 .put = snd_es1938_put_spatializer_enable,
1433 static void snd_es1938_chip_init(
struct es1938 *chip)
1436 snd_es1938_reset(chip);
1459 #ifdef CONFIG_PM_SLEEP
1465 0x14, 0x1a, 0x1c, 0x3a, 0x3c, 0x3e, 0x36, 0x38,
1466 0x50, 0x52, 0x60, 0x61, 0x62, 0x63, 0x64, 0x68,
1467 0x69, 0x6a, 0x6b, 0x6d, 0x6e, 0x6f, 0x7c, 0x7d,
1472 static int es1938_suspend(
struct device *
dev)
1477 unsigned char *
s, *
d;
1480 snd_pcm_suspend_all(chip->
pcm);
1483 for (s = saved_regs, d = chip->saved_regs; *s; s++, d++)
1484 *d = snd_es1938_reg_read(chip, *s);
1487 if (chip->
irq >= 0) {
1497 static int es1938_resume(
struct device *dev)
1502 unsigned char *
s, *
d;
1508 "disabling device\n");
1516 "disabling device\n", pci->
irq);
1521 snd_es1938_chip_init(chip);
1524 for (s = saved_regs, d = chip->saved_regs; *s; s++, d++) {
1526 snd_es1938_mixer_write(chip, *s, *d);
1528 snd_es1938_write(chip, *s, *d);
1536 #define ES1938_PM_OPS &es1938_pm
1538 #define ES1938_PM_OPS NULL
1541 #ifdef SUPPORT_JOYSTICK
1546 chip->gameport = gp = gameport_allocate_port();
1548 printk(
KERN_ERR "es1938: cannot allocate memory for gameport\n");
1552 gameport_set_name(gp,
"ES1938");
1554 gameport_set_dev_parent(gp, &chip->
pci->dev);
1557 gameport_register_port(gp);
1562 static void snd_es1938_free_gameport(
struct es1938 *chip)
1564 if (chip->gameport) {
1566 chip->gameport =
NULL;
1570 static inline int snd_es1938_create_gameport(
struct es1938 *chip) {
return -
ENOSYS; }
1571 static inline void snd_es1938_free_gameport(
struct es1938 *chip) { }
1574 static int snd_es1938_free(
struct es1938 *chip)
1581 snd_es1938_free_gameport(chip);
1591 static int snd_es1938_dev_free(
struct snd_device *device)
1594 return snd_es1938_free(chip);
1604 .dev_free = snd_es1938_dev_free,
1614 pci_set_consistent_dma_mask(pci,
DMA_BIT_MASK(24)) < 0) {
1641 KBUILD_MODNAME, chip)) {
1643 snd_es1938_free(chip);
1647 #ifdef ES1938_DDEBUG
1654 snd_es1938_chip_init(chip);
1657 snd_es1938_free(chip);
1673 unsigned char status, audiostatus;
1682 if (status & 0x10) {
1685 "Es1938debug - AUDIO channel 1 interrupt\n");
1687 "Es1938debug - AUDIO channel 1 DMAC DMA count: %u\n",
1690 "Es1938debug - AUDIO channel 1 DMAC DMA base: %u\n",
1693 "Es1938debug - AUDIO channel 1 DMAC DMA status: 0x%x\n",
1706 if (status & 0x20) {
1709 "Es1938debug - AUDIO channel 2 interrupt\n");
1711 "Es1938debug - AUDIO channel 2 DMAC DMA count: %u\n",
1714 "Es1938debug - AUDIO channel 2 DMAC DMA base: %u\n",
1726 if (status & 0x40) {
1727 int split = snd_es1938_mixer_read(chip, 0x64) & 0x80;
1738 snd_es1938_mixer_write(chip, 0x66, 0x00);
1742 if (status & 0x80) {
1755 #define ES1938_DMA_SIZE 64
1767 for (idx = 0; idx <
ARRAY_SIZE(snd_es1938_controls); idx++) {
1814 for (idx = 0; idx < 5; idx++) {
1821 if ((err = snd_es1938_create(card, pci, &chip)) < 0) {
1834 if ((err = snd_es1938_new_pcm(chip, 0)) < 0) {
1838 if ((err = snd_es1938_mixer(chip)) < 0) {
1861 -1, &chip->
rmidi) < 0) {
1869 snd_es1938_create_gameport(chip);
1876 pci_set_drvdata(pci, card);
1884 pci_set_drvdata(pci,
NULL);
1888 .name = KBUILD_MODNAME,
1889 .id_table = snd_es1938_ids,
1890 .probe = snd_es1938_probe,