Lines Matching +full:ac +full:- +full:detect +full:- +full:gpios
1 // SPDX-License-Identifier: GPL-2.0-or-later
9 * Rewritted from card-es1938.c source.
27 * encoding. The codecs are almost always AC-97 compliant codecs,
88 #include <linux/dma-mapping.h>
102 #include <media/drv-intf/tea575x.h>
119 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 1-MAX */
122 static int total_bufsize[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1024 };
123 static int pcm_substreams_p[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4 };
124 static int pcm_substreams_c[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1 };
126 static int use_pm[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
127 static int enable_mpu[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
131 static int radio_nr[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
146 MODULE_PARM_DESC(clock, "Clock on " CARD_NAME " soundcard. (0 = auto-detect)");
148 MODULE_PARM_DESC(use_pm, "Toggle power-management. (0 = off, 1 = on, 2 = auto)");
300 /* APU Modes: reg 0x00, bit 4-7 */
304 #define ESM_APU_16BITLINEAR 0x01 /* 16-Bit Linear Sample Player */
305 #define ESM_APU_16BITSTEREO 0x02 /* 16-Bit Stereo Sample Player */
306 #define ESM_APU_8BITLINEAR 0x03 /* 8-Bit Linear Sample Player */
307 #define ESM_APU_8BITSTEREO 0x04 /* 8-Bit Stereo Sample Player */
308 #define ESM_APU_8BITDIFF 0x05 /* 8-Bit Differential Sample Playrer */
315 #define ESM_APU_16BITPINGPONG 0x0C /* 16-Bit Ping-Pong Sample Player */
355 /* reg 0x05 - wave start offset */
356 /* reg 0x06 - wave end offset */
357 /* reg 0x07 - wave loop length */
368 /* bit 0-7 amplitude dest? */
508 int do_pm; /* power-management enabled */
578 outw(reg, chip->io_port + ESM_INDEX); in __maestro_write()
579 outw(data, chip->io_port + ESM_DATA); in __maestro_write()
580 chip->maestro_map[reg] = data; in __maestro_write()
586 spin_lock_irqsave(&chip->reg_lock, flags); in maestro_write()
588 spin_unlock_irqrestore(&chip->reg_lock, flags); in maestro_write()
595 outw(reg, chip->io_port + ESM_INDEX); in __maestro_read()
596 chip->maestro_map[reg] = inw(chip->io_port + ESM_DATA); in __maestro_read()
598 return chip->maestro_map[reg]; in __maestro_read()
605 spin_lock_irqsave(&chip->reg_lock, flags); in maestro_read()
607 spin_unlock_irqrestore(&chip->reg_lock, flags); in maestro_read()
616 while (timeout-- > 0) { in snd_es1968_ac97_wait()
617 if (!(inb(chip->io_port + ESM_AC97_INDEX) & 1)) in snd_es1968_ac97_wait()
621 dev_dbg(chip->card->dev, "ac97 timeout\n"); in snd_es1968_ac97_wait()
629 while (timeout-- > 0) { in snd_es1968_ac97_wait_poll()
630 if (!(inb(chip->io_port + ESM_AC97_INDEX) & 1)) in snd_es1968_ac97_wait_poll()
633 dev_dbg(chip->card->dev, "ac97 timeout\n"); in snd_es1968_ac97_wait_poll()
639 struct es1968 *chip = ac97->private_data; in snd_es1968_ac97_write()
644 outw(val, chip->io_port + ESM_AC97_DATA); in snd_es1968_ac97_write()
646 outb(reg, chip->io_port + ESM_AC97_INDEX); in snd_es1968_ac97_write()
653 struct es1968 *chip = ac97->private_data; in snd_es1968_ac97_read()
657 outb(reg | 0x80, chip->io_port + ESM_AC97_INDEX); in snd_es1968_ac97_read()
661 data = inw(chip->io_port + ESM_AC97_DATA); in snd_es1968_ac97_read()
676 dev_dbg(chip->card->dev, "APU register select failed. (Timeout)\n"); in apu_index_set()
688 dev_dbg(chip->card->dev, "APU register set probably failed (Timeout)!\n"); in apu_data_set()
697 chip->apu_map[channel][reg] = data; in __apu_set_register()
707 spin_lock_irqsave(&chip->reg_lock, flags); in apu_set_register()
709 spin_unlock_irqrestore(&chip->reg_lock, flags); in apu_set_register()
725 spin_lock_irqsave(&chip->reg_lock, flags); in apu_get_register()
727 spin_unlock_irqrestore(&chip->reg_lock, flags); in apu_get_register()
737 spin_lock_irqsave(&chip->reg_lock, flags);
738 outl(reg, chip->io_port + ASSP_INDEX);
739 outl(value, chip->io_port + ASSP_DATA);
740 spin_unlock_irqrestore(&chip->reg_lock, flags);
748 spin_lock_irqsave(&chip->reg_lock, flags);
749 outl(reg, chip->io_port + ASSP_INDEX);
750 value = inl(chip->io_port + ASSP_DATA);
751 spin_unlock_irqrestore(&chip->reg_lock, flags);
762 spin_lock_irqsave(&chip->reg_lock, flags); in wave_set_register()
763 outw(reg, chip->io_port + WC_INDEX); in wave_set_register()
764 outw(value, chip->io_port + WC_DATA); in wave_set_register()
765 spin_unlock_irqrestore(&chip->reg_lock, flags); in wave_set_register()
773 spin_lock_irqsave(&chip->reg_lock, flags); in wave_get_register()
774 outw(reg, chip->io_port + WC_INDEX); in wave_get_register()
775 value = inw(chip->io_port + WC_DATA); in wave_get_register()
776 spin_unlock_irqrestore(&chip->reg_lock, flags); in wave_get_register()
805 if (chip->bob_freq > (ESS_SYSCLK >> (prescale + 9))) in snd_es1968_bob_start()
811 prescale--; in snd_es1968_bob_start()
816 /* now fine-tune the divider for best match */ in snd_es1968_bob_start()
818 if (chip->bob_freq > in snd_es1968_bob_start()
825 prescale--; in snd_es1968_bob_start()
827 divide--; in snd_es1968_bob_start()
839 chip->bobclient++; in snd_es1968_bob_inc()
840 if (chip->bobclient == 1) { in snd_es1968_bob_inc()
841 chip->bob_freq = freq; in snd_es1968_bob_inc()
843 } else if (chip->bob_freq < freq) { in snd_es1968_bob_inc()
845 chip->bob_freq = freq; in snd_es1968_bob_inc()
853 chip->bobclient--; in snd_es1968_bob_dec()
854 if (chip->bobclient <= 0) in snd_es1968_bob_dec()
856 else if (chip->bob_freq > ESM_BOB_FREQ) { in snd_es1968_bob_dec()
860 list_for_each_entry(es, &chip->substream_list, list) { in snd_es1968_bob_dec()
861 if (max_freq < es->bob_freq) in snd_es1968_bob_dec()
862 max_freq = es->bob_freq; in snd_es1968_bob_dec()
864 if (max_freq != chip->bob_freq) { in snd_es1968_bob_dec()
866 chip->bob_freq = max_freq; in snd_es1968_bob_dec()
877 int freq = runtime->rate * 4; in snd_es1968_calc_bob_rate()
878 if (es->fmt & ESS_FMT_STEREO) in snd_es1968_calc_bob_rate()
880 if (es->fmt & ESS_FMT_16BIT) in snd_es1968_calc_bob_rate()
882 freq /= es->frag_size; in snd_es1968_calc_bob_rate()
897 u32 rate = (freq << 16) / chip->clock; in snd_es1968_compute_rate()
911 offset = apu_get_register(chip, es->apu[0], 5); in snd_es1968_get_dma_ptr()
913 offset -= es->base[0]; in snd_es1968_get_dma_ptr()
937 spin_lock(&chip->reg_lock); in snd_es1968_pcm_start()
938 __apu_set_register(chip, es->apu[0], 5, es->base[0]); in snd_es1968_pcm_start()
939 snd_es1968_trigger_apu(chip, es->apu[0], es->apu_mode[0]); in snd_es1968_pcm_start()
940 if (es->mode == ESM_MODE_CAPTURE) { in snd_es1968_pcm_start()
941 __apu_set_register(chip, es->apu[2], 5, es->base[2]); in snd_es1968_pcm_start()
942 snd_es1968_trigger_apu(chip, es->apu[2], es->apu_mode[2]); in snd_es1968_pcm_start()
944 if (es->fmt & ESS_FMT_STEREO) { in snd_es1968_pcm_start()
945 __apu_set_register(chip, es->apu[1], 5, es->base[1]); in snd_es1968_pcm_start()
946 snd_es1968_trigger_apu(chip, es->apu[1], es->apu_mode[1]); in snd_es1968_pcm_start()
947 if (es->mode == ESM_MODE_CAPTURE) { in snd_es1968_pcm_start()
948 __apu_set_register(chip, es->apu[3], 5, es->base[3]); in snd_es1968_pcm_start()
949 snd_es1968_trigger_apu(chip, es->apu[3], es->apu_mode[3]); in snd_es1968_pcm_start()
952 spin_unlock(&chip->reg_lock); in snd_es1968_pcm_start()
957 spin_lock(&chip->reg_lock); in snd_es1968_pcm_stop()
958 snd_es1968_trigger_apu(chip, es->apu[0], 0); in snd_es1968_pcm_stop()
959 snd_es1968_trigger_apu(chip, es->apu[1], 0); in snd_es1968_pcm_stop()
960 if (es->mode == ESM_MODE_CAPTURE) { in snd_es1968_pcm_stop()
961 snd_es1968_trigger_apu(chip, es->apu[2], 0); in snd_es1968_pcm_stop()
962 snd_es1968_trigger_apu(chip, es->apu[3], 0); in snd_es1968_pcm_stop()
964 spin_unlock(&chip->reg_lock); in snd_es1968_pcm_stop()
971 u32 tmpval = (addr - 0x10) & 0xFFF8; in snd_es1968_program_wavecache()
974 if (!(es->fmt & ESS_FMT_16BIT)) in snd_es1968_program_wavecache()
976 if (es->fmt & ESS_FMT_STEREO) in snd_es1968_program_wavecache()
981 wave_set_register(chip, es->apu[channel] << 3, tmpval); in snd_es1968_program_wavecache()
984 es->wc_map[channel] = tmpval; in snd_es1968_program_wavecache()
999 size = es->dma_size >> es->wav_shift; in snd_es1968_playback_setup()
1001 if (es->fmt & ESS_FMT_STEREO) in snd_es1968_playback_setup()
1005 apu = es->apu[channel]; in snd_es1968_playback_setup()
1007 snd_es1968_program_wavecache(chip, es, channel, es->memory->buf.addr, 0); in snd_es1968_playback_setup()
1010 pa = es->memory->buf.addr; in snd_es1968_playback_setup()
1011 pa -= chip->dma.addr; in snd_es1968_playback_setup()
1016 if (es->fmt & ESS_FMT_STEREO) { in snd_es1968_playback_setup()
1020 if (es->fmt & ESS_FMT_16BIT) in snd_es1968_playback_setup()
1026 es->base[channel] = pa & 0xFFFF; in snd_es1968_playback_setup()
1048 if (es->fmt & ESS_FMT_16BIT) in snd_es1968_playback_setup()
1049 es->apu_mode[channel] = ESM_APU_16BITLINEAR; in snd_es1968_playback_setup()
1051 es->apu_mode[channel] = ESM_APU_8BITLINEAR; in snd_es1968_playback_setup()
1053 if (es->fmt & ESS_FMT_STEREO) { in snd_es1968_playback_setup()
1058 and not the APU Regs 4-5. */ in snd_es1968_playback_setup()
1061 es->apu_mode[channel] += 1; /* stereo */ in snd_es1968_playback_setup()
1066 spin_lock_irqsave(&chip->reg_lock, flags); in snd_es1968_playback_setup()
1068 outw(1, chip->io_port + 0x04); in snd_es1968_playback_setup()
1070 outw(inw(chip->io_port + ESM_PORT_HOST_IRQ) | ESM_HIRQ_DSIE, chip->io_port + ESM_PORT_HOST_IRQ); in snd_es1968_playback_setup()
1071 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1968_playback_setup()
1073 freq = runtime->rate; in snd_es1968_playback_setup()
1081 if (!(es->fmt & ESS_FMT_16BIT) && !(es->fmt & ESS_FMT_STEREO)) in snd_es1968_playback_setup()
1087 snd_es1968_apu_set_freq(chip, es->apu[0], freq); in snd_es1968_playback_setup()
1088 snd_es1968_apu_set_freq(chip, es->apu[1], freq); in snd_es1968_playback_setup()
1096 int i, apu = es->apu[channel]; in init_capture_apu()
1098 es->apu_mode[channel] = mode; in init_capture_apu()
1104 pa -= chip->dma.addr; in init_capture_apu()
1109 es->base[channel] = pa & 0xFFFF; in init_capture_apu()
1110 pa |= 0x00400000; /* bit 22 -> System RAM */ in init_capture_apu()
1144 size = es->dma_size >> es->wav_shift; in snd_es1968_capture_setup()
1157 /* parallel in crap, see maestro reg 0xC [8-11] */ in snd_es1968_capture_setup()
1159 es->mixbuf->buf.addr, ESM_MIXBUF_SIZE/4, /* in words */ in snd_es1968_capture_setup()
1162 init_capture_apu(chip, es, 0, es->memory->buf.addr, size, in snd_es1968_capture_setup()
1163 ESM_APU_SRCONVERTOR, es->apu[2]); in snd_es1968_capture_setup()
1164 if (es->fmt & ESS_FMT_STEREO) { in snd_es1968_capture_setup()
1167 es->mixbuf->buf.addr + ESM_MIXBUF_SIZE/2, in snd_es1968_capture_setup()
1172 es->memory->buf.addr + size*2, size, in snd_es1968_capture_setup()
1173 ESM_APU_SRCONVERTOR, es->apu[3]); in snd_es1968_capture_setup()
1176 freq = runtime->rate; in snd_es1968_capture_setup()
1186 snd_es1968_apu_set_freq(chip, es->apu[0], freq); in snd_es1968_capture_setup()
1187 snd_es1968_apu_set_freq(chip, es->apu[1], freq); in snd_es1968_capture_setup()
1191 snd_es1968_apu_set_freq(chip, es->apu[2], freq); in snd_es1968_capture_setup()
1192 snd_es1968_apu_set_freq(chip, es->apu[3], freq); in snd_es1968_capture_setup()
1194 spin_lock_irqsave(&chip->reg_lock, flags); in snd_es1968_capture_setup()
1196 outw(1, chip->io_port + 0x04); in snd_es1968_capture_setup()
1198 outw(inw(chip->io_port + ESM_PORT_HOST_IRQ) | ESM_HIRQ_DSIE, chip->io_port + ESM_PORT_HOST_IRQ); in snd_es1968_capture_setup()
1199 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1968_capture_setup()
1209 struct snd_pcm_runtime *runtime = substream->runtime; in snd_es1968_pcm_prepare()
1210 struct esschan *es = runtime->private_data; in snd_es1968_pcm_prepare()
1212 es->dma_size = snd_pcm_lib_buffer_bytes(substream); in snd_es1968_pcm_prepare()
1213 es->frag_size = snd_pcm_lib_period_bytes(substream); in snd_es1968_pcm_prepare()
1215 es->wav_shift = 1; /* maestro handles always 16bit */ in snd_es1968_pcm_prepare()
1216 es->fmt = 0; in snd_es1968_pcm_prepare()
1217 if (snd_pcm_format_width(runtime->format) == 16) in snd_es1968_pcm_prepare()
1218 es->fmt |= ESS_FMT_16BIT; in snd_es1968_pcm_prepare()
1219 if (runtime->channels > 1) { in snd_es1968_pcm_prepare()
1220 es->fmt |= ESS_FMT_STEREO; in snd_es1968_pcm_prepare()
1221 if (es->fmt & ESS_FMT_16BIT) /* 8bit is already word shifted */ in snd_es1968_pcm_prepare()
1222 es->wav_shift++; in snd_es1968_pcm_prepare()
1224 es->bob_freq = snd_es1968_calc_bob_rate(chip, es, runtime); in snd_es1968_pcm_prepare()
1226 switch (es->mode) { in snd_es1968_pcm_prepare()
1241 struct esschan *es = substream->runtime->private_data; in snd_es1968_pcm_trigger()
1243 spin_lock(&chip->substream_lock); in snd_es1968_pcm_trigger()
1247 if (es->running) in snd_es1968_pcm_trigger()
1249 snd_es1968_bob_inc(chip, es->bob_freq); in snd_es1968_pcm_trigger()
1250 es->count = 0; in snd_es1968_pcm_trigger()
1251 es->hwptr = 0; in snd_es1968_pcm_trigger()
1253 es->running = 1; in snd_es1968_pcm_trigger()
1257 if (! es->running) in snd_es1968_pcm_trigger()
1260 es->running = 0; in snd_es1968_pcm_trigger()
1264 spin_unlock(&chip->substream_lock); in snd_es1968_pcm_trigger()
1271 struct esschan *es = substream->runtime->private_data; in snd_es1968_pcm_pointer()
1274 ptr = snd_es1968_get_dma_ptr(chip, es) << es->wav_shift; in snd_es1968_pcm_pointer()
1276 return bytes_to_frames(substream->runtime, ptr % es->dma_size); in snd_es1968_pcm_pointer()
1333 mutex_lock(&chip->memory_mutex); in calc_available_memory_size()
1334 list_for_each_entry(buf, &chip->buf_list, list) { in calc_available_memory_size()
1335 if (buf->empty && buf->buf.bytes > max_size) in calc_available_memory_size()
1336 max_size = buf->buf.bytes; in calc_available_memory_size()
1338 mutex_unlock(&chip->memory_mutex); in calc_available_memory_size()
1350 mutex_lock(&chip->memory_mutex); in snd_es1968_new_memory()
1351 list_for_each_entry(buf, &chip->buf_list, list) { in snd_es1968_new_memory()
1352 if (buf->empty && buf->buf.bytes >= size) in snd_es1968_new_memory()
1355 mutex_unlock(&chip->memory_mutex); in snd_es1968_new_memory()
1359 if (buf->buf.bytes > size) { in snd_es1968_new_memory()
1362 mutex_unlock(&chip->memory_mutex); in snd_es1968_new_memory()
1365 chunk->buf = buf->buf; in snd_es1968_new_memory()
1366 chunk->buf.bytes -= size; in snd_es1968_new_memory()
1367 chunk->buf.area += size; in snd_es1968_new_memory()
1368 chunk->buf.addr += size; in snd_es1968_new_memory()
1369 chunk->empty = 1; in snd_es1968_new_memory()
1370 buf->buf.bytes = size; in snd_es1968_new_memory()
1371 list_add(&chunk->list, &buf->list); in snd_es1968_new_memory()
1373 buf->empty = 0; in snd_es1968_new_memory()
1374 mutex_unlock(&chip->memory_mutex); in snd_es1968_new_memory()
1383 mutex_lock(&chip->memory_mutex); in snd_es1968_free_memory()
1384 buf->empty = 1; in snd_es1968_free_memory()
1385 if (buf->list.prev != &chip->buf_list) { in snd_es1968_free_memory()
1386 chunk = list_entry(buf->list.prev, struct esm_memory, list); in snd_es1968_free_memory()
1387 if (chunk->empty) { in snd_es1968_free_memory()
1388 chunk->buf.bytes += buf->buf.bytes; in snd_es1968_free_memory()
1389 list_del(&buf->list); in snd_es1968_free_memory()
1394 if (buf->list.next != &chip->buf_list) { in snd_es1968_free_memory()
1395 chunk = list_entry(buf->list.next, struct esm_memory, list); in snd_es1968_free_memory()
1396 if (chunk->empty) { in snd_es1968_free_memory()
1397 buf->buf.bytes += chunk->buf.bytes; in snd_es1968_free_memory()
1398 list_del(&chunk->list); in snd_es1968_free_memory()
1402 mutex_unlock(&chip->memory_mutex); in snd_es1968_free_memory()
1409 if (! chip->dma.area) in snd_es1968_free_dmabuf()
1411 snd_dma_free_pages(&chip->dma); in snd_es1968_free_dmabuf()
1412 while ((p = chip->buf_list.next) != &chip->buf_list) { in snd_es1968_free_dmabuf()
1426 &chip->pci->dev, in snd_es1968_init_dmabuf()
1427 chip->total_bufsize, &chip->dma); in snd_es1968_init_dmabuf()
1428 if (err < 0 || ! chip->dma.area) { in snd_es1968_init_dmabuf()
1429 dev_err(chip->card->dev, in snd_es1968_init_dmabuf()
1431 chip->total_bufsize); in snd_es1968_init_dmabuf()
1432 return -ENOMEM; in snd_es1968_init_dmabuf()
1434 if ((chip->dma.addr + chip->dma.bytes - 1) & ~((1 << 28) - 1)) { in snd_es1968_init_dmabuf()
1435 snd_dma_free_pages(&chip->dma); in snd_es1968_init_dmabuf()
1436 dev_err(chip->card->dev, "DMA buffer beyond 256MB.\n"); in snd_es1968_init_dmabuf()
1437 return -ENOMEM; in snd_es1968_init_dmabuf()
1440 INIT_LIST_HEAD(&chip->buf_list); in snd_es1968_init_dmabuf()
1445 return -ENOMEM; in snd_es1968_init_dmabuf()
1447 memset(chip->dma.area, 0, ESM_MEM_ALIGN); in snd_es1968_init_dmabuf()
1448 chunk->buf = chip->dma; in snd_es1968_init_dmabuf()
1449 chunk->buf.area += ESM_MEM_ALIGN; in snd_es1968_init_dmabuf()
1450 chunk->buf.addr += ESM_MEM_ALIGN; in snd_es1968_init_dmabuf()
1451 chunk->buf.bytes -= ESM_MEM_ALIGN; in snd_es1968_init_dmabuf()
1452 chunk->empty = 1; in snd_es1968_init_dmabuf()
1453 list_add(&chunk->list, &chip->buf_list); in snd_es1968_init_dmabuf()
1459 /* buffer is extracted from the pre-allocated memory chunk */
1464 struct snd_pcm_runtime *runtime = substream->runtime; in snd_es1968_hw_params()
1465 struct esschan *chan = runtime->private_data; in snd_es1968_hw_params()
1468 if (chan->memory) { in snd_es1968_hw_params()
1469 if (chan->memory->buf.bytes >= size) { in snd_es1968_hw_params()
1470 runtime->dma_bytes = size; in snd_es1968_hw_params()
1473 snd_es1968_free_memory(chip, chan->memory); in snd_es1968_hw_params()
1475 chan->memory = snd_es1968_new_memory(chip, size); in snd_es1968_hw_params()
1476 if (chan->memory == NULL) { in snd_es1968_hw_params()
1477 dev_dbg(chip->card->dev, in snd_es1968_hw_params()
1479 return -ENOMEM; in snd_es1968_hw_params()
1481 snd_pcm_set_runtime_buffer(substream, &chan->memory->buf); in snd_es1968_hw_params()
1489 struct snd_pcm_runtime *runtime = substream->runtime; in snd_es1968_hw_free()
1492 if (runtime->private_data == NULL) in snd_es1968_hw_free()
1494 chan = runtime->private_data; in snd_es1968_hw_free()
1495 if (chan->memory) { in snd_es1968_hw_free()
1496 snd_es1968_free_memory(chip, chan->memory); in snd_es1968_hw_free()
1497 chan->memory = NULL; in snd_es1968_hw_free()
1511 if (chip->apu[apu] == ESM_APU_FREE && in snd_es1968_alloc_apu_pair()
1512 chip->apu[apu + 1] == ESM_APU_FREE) { in snd_es1968_alloc_apu_pair()
1513 chip->apu[apu] = chip->apu[apu + 1] = type; in snd_es1968_alloc_apu_pair()
1517 return -EBUSY; in snd_es1968_alloc_apu_pair()
1525 chip->apu[apu] = chip->apu[apu + 1] = ESM_APU_FREE; in snd_es1968_free_apu_pair()
1536 struct snd_pcm_runtime *runtime = substream->runtime; in snd_es1968_playback_open()
1548 return -ENOMEM; in snd_es1968_playback_open()
1551 es->apu[0] = apu1; in snd_es1968_playback_open()
1552 es->apu[1] = apu1 + 1; in snd_es1968_playback_open()
1553 es->apu_mode[0] = 0; in snd_es1968_playback_open()
1554 es->apu_mode[1] = 0; in snd_es1968_playback_open()
1555 es->running = 0; in snd_es1968_playback_open()
1556 es->substream = substream; in snd_es1968_playback_open()
1557 es->mode = ESM_MODE_PLAY; in snd_es1968_playback_open()
1559 runtime->private_data = es; in snd_es1968_playback_open()
1560 runtime->hw = snd_es1968_playback; in snd_es1968_playback_open()
1561 runtime->hw.buffer_bytes_max = runtime->hw.period_bytes_max = in snd_es1968_playback_open()
1564 spin_lock_irq(&chip->substream_lock); in snd_es1968_playback_open()
1565 list_add(&es->list, &chip->substream_list); in snd_es1968_playback_open()
1566 spin_unlock_irq(&chip->substream_lock); in snd_es1968_playback_open()
1573 struct snd_pcm_runtime *runtime = substream->runtime; in snd_es1968_capture_open()
1591 return -ENOMEM; in snd_es1968_capture_open()
1594 es->apu[0] = apu1; in snd_es1968_capture_open()
1595 es->apu[1] = apu1 + 1; in snd_es1968_capture_open()
1596 es->apu[2] = apu2; in snd_es1968_capture_open()
1597 es->apu[3] = apu2 + 1; in snd_es1968_capture_open()
1598 es->apu_mode[0] = 0; in snd_es1968_capture_open()
1599 es->apu_mode[1] = 0; in snd_es1968_capture_open()
1600 es->apu_mode[2] = 0; in snd_es1968_capture_open()
1601 es->apu_mode[3] = 0; in snd_es1968_capture_open()
1602 es->running = 0; in snd_es1968_capture_open()
1603 es->substream = substream; in snd_es1968_capture_open()
1604 es->mode = ESM_MODE_CAPTURE; in snd_es1968_capture_open()
1607 if ((es->mixbuf = snd_es1968_new_memory(chip, ESM_MIXBUF_SIZE)) == NULL) { in snd_es1968_capture_open()
1611 return -ENOMEM; in snd_es1968_capture_open()
1613 memset(es->mixbuf->buf.area, 0, ESM_MIXBUF_SIZE); in snd_es1968_capture_open()
1615 runtime->private_data = es; in snd_es1968_capture_open()
1616 runtime->hw = snd_es1968_capture; in snd_es1968_capture_open()
1617 runtime->hw.buffer_bytes_max = runtime->hw.period_bytes_max = in snd_es1968_capture_open()
1618 calc_available_memory_size(chip) - 1024; /* keep MIXBUF size */ in snd_es1968_capture_open()
1621 spin_lock_irq(&chip->substream_lock); in snd_es1968_capture_open()
1622 list_add(&es->list, &chip->substream_list); in snd_es1968_capture_open()
1623 spin_unlock_irq(&chip->substream_lock); in snd_es1968_capture_open()
1633 if (substream->runtime->private_data == NULL) in snd_es1968_playback_close()
1635 es = substream->runtime->private_data; in snd_es1968_playback_close()
1636 spin_lock_irq(&chip->substream_lock); in snd_es1968_playback_close()
1637 list_del(&es->list); in snd_es1968_playback_close()
1638 spin_unlock_irq(&chip->substream_lock); in snd_es1968_playback_close()
1639 snd_es1968_free_apu_pair(chip, es->apu[0]); in snd_es1968_playback_close()
1650 if (substream->runtime->private_data == NULL) in snd_es1968_capture_close()
1652 es = substream->runtime->private_data; in snd_es1968_capture_close()
1653 spin_lock_irq(&chip->substream_lock); in snd_es1968_capture_close()
1654 list_del(&es->list); in snd_es1968_capture_close()
1655 spin_unlock_irq(&chip->substream_lock); in snd_es1968_capture_close()
1656 snd_es1968_free_memory(chip, es->mixbuf); in snd_es1968_capture_close()
1657 snd_es1968_free_apu_pair(chip, es->apu[0]); in snd_es1968_capture_close()
1658 snd_es1968_free_apu_pair(chip, es->apu[2]); in snd_es1968_capture_close()
1698 if (chip->clock == 0) in es1968_measure_clock()
1699 chip->clock = 48000; /* default clock value */ in es1968_measure_clock()
1703 dev_err(chip->card->dev, "Hmm, cannot find empty APU pair!?\n"); in es1968_measure_clock()
1707 dev_warn(chip->card->dev, in es1968_measure_clock()
1708 "cannot allocate dma buffer - using default clock %d\n", in es1968_measure_clock()
1709 chip->clock); in es1968_measure_clock()
1714 memset(memory->buf.area, 0, CLOCK_MEASURE_BUFSIZE); in es1968_measure_clock()
1716 wave_set_register(chip, apu << 3, (memory->buf.addr - 0x10) & 0xfff8); in es1968_measure_clock()
1718 pa = (unsigned int)((memory->buf.addr - chip->dma.addr) >> 1); in es1968_measure_clock()
1734 spin_lock_irq(&chip->reg_lock); in es1968_measure_clock()
1735 outw(1, chip->io_port + 0x04); /* clear WP interrupts */ in es1968_measure_clock()
1736 …outw(inw(chip->io_port + ESM_PORT_HOST_IRQ) | ESM_HIRQ_DSIE, chip->io_port + ESM_PORT_HOST_IRQ); /… in es1968_measure_clock()
1737 spin_unlock_irq(&chip->reg_lock); in es1968_measure_clock()
1739 snd_es1968_apu_set_freq(chip, apu, ((unsigned int)48000 << 16) / chip->clock); /* 48000 Hz */ in es1968_measure_clock()
1741 chip->in_measurement = 1; in es1968_measure_clock()
1742 chip->measure_apu = apu; in es1968_measure_clock()
1743 spin_lock_irq(&chip->reg_lock); in es1968_measure_clock()
1748 spin_unlock_irq(&chip->reg_lock); in es1968_measure_clock()
1750 spin_lock_irq(&chip->reg_lock); in es1968_measure_clock()
1755 chip->in_measurement = 0; in es1968_measure_clock()
1756 spin_unlock_irq(&chip->reg_lock); in es1968_measure_clock()
1759 offset -= (pa & 0xffff); in es1968_measure_clock()
1761 offset += chip->measure_count * (CLOCK_MEASURE_BUFSIZE/2); in es1968_measure_clock()
1766 dev_err(chip->card->dev, "?? calculation error..\n"); in es1968_measure_clock()
1772 chip->clock = (chip->clock * offset) / 48000; in es1968_measure_clock()
1774 dev_info(chip->card->dev, "clocking to %d\n", chip->clock); in es1968_measure_clock()
1786 struct es1968 *esm = pcm->private_data; in snd_es1968_pcm_free()
1788 esm->pcm = NULL; in snd_es1968_pcm_free()
1802 wave_set_register(chip, 0x01FC, chip->dma.addr >> 12); in snd_es1968_pcm()
1803 wave_set_register(chip, 0x01FD, chip->dma.addr >> 12); in snd_es1968_pcm()
1804 wave_set_register(chip, 0x01FE, chip->dma.addr >> 12); in snd_es1968_pcm()
1805 wave_set_register(chip, 0x01FF, chip->dma.addr >> 12); in snd_es1968_pcm()
1807 if ((err = snd_pcm_new(chip->card, "ESS Maestro", device, in snd_es1968_pcm()
1808 chip->playback_streams, in snd_es1968_pcm()
1809 chip->capture_streams, &pcm)) < 0) in snd_es1968_pcm()
1812 pcm->private_data = chip; in snd_es1968_pcm()
1813 pcm->private_free = snd_es1968_pcm_free; in snd_es1968_pcm()
1818 pcm->info_flags = 0; in snd_es1968_pcm()
1820 strcpy(pcm->name, "ESS Maestro"); in snd_es1968_pcm()
1822 chip->pcm = pcm; in snd_es1968_pcm()
1837 diff = (cp1 > cp2 ? cp1 - cp2 : cp2 - cp1); in snd_es1968_suppress_jitter()
1850 struct snd_pcm_substream *subs = es->substream; in snd_es1968_update_pcm()
1852 if (subs == NULL || !es->running) in snd_es1968_update_pcm()
1855 hwptr = snd_es1968_get_dma_ptr(chip, es) << es->wav_shift; in snd_es1968_update_pcm()
1856 hwptr %= es->dma_size; in snd_es1968_update_pcm()
1858 diff = (es->dma_size + hwptr - es->hwptr) % es->dma_size; in snd_es1968_update_pcm()
1860 es->hwptr = hwptr; in snd_es1968_update_pcm()
1861 es->count += diff; in snd_es1968_update_pcm()
1863 if (es->count > es->frag_size) { in snd_es1968_update_pcm()
1864 spin_unlock(&chip->substream_lock); in snd_es1968_update_pcm()
1866 spin_lock(&chip->substream_lock); in snd_es1968_update_pcm()
1867 es->count %= es->frag_size; in snd_es1968_update_pcm()
1873 generating an interrupt. The pair of counters is stored in bits 1-3 and 5-7
1883 x = inb(chip->io_port + 0x1c) & 0xee; in es1968_update_hw_volume()
1885 outb(0x88, chip->io_port + 0x1c); in es1968_update_hw_volume()
1886 outb(0x88, chip->io_port + 0x1d); in es1968_update_hw_volume()
1887 outb(0x88, chip->io_port + 0x1e); in es1968_update_hw_volume()
1888 outb(0x88, chip->io_port + 0x1f); in es1968_update_hw_volume()
1890 if (chip->in_suspend) in es1968_update_hw_volume()
1894 if (! chip->master_switch || ! chip->master_volume) in es1968_update_hw_volume()
1897 val = snd_ac97_read(chip->ac97, AC97_MASTER); in es1968_update_hw_volume()
1906 val--; in es1968_update_hw_volume()
1908 val -= 0x0100; in es1968_update_hw_volume()
1918 if (snd_ac97_update(chip->ac97, AC97_MASTER, val)) in es1968_update_hw_volume()
1919 snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE, in es1968_update_hw_volume()
1920 &chip->master_volume->id); in es1968_update_hw_volume()
1922 if (!chip->input_dev) in es1968_update_hw_volume()
1934 /* counters increased by 1 -> volume up */ in es1968_update_hw_volume()
1938 /* counters decreased by 1 -> volume down */ in es1968_update_hw_volume()
1944 input_report_key(chip->input_dev, val, 1); in es1968_update_hw_volume()
1945 input_sync(chip->input_dev); in es1968_update_hw_volume()
1946 input_report_key(chip->input_dev, val, 0); in es1968_update_hw_volume()
1947 input_sync(chip->input_dev); in es1968_update_hw_volume()
1960 if (!(event = inb(chip->io_port + 0x1A))) in snd_es1968_interrupt()
1963 outw(inw(chip->io_port + 4) & 1, chip->io_port + 4); in snd_es1968_interrupt()
1966 schedule_work(&chip->hwvol_work); in snd_es1968_interrupt()
1969 outb(0xFF, chip->io_port + 0x1A); in snd_es1968_interrupt()
1971 if ((event & ESM_MPU401_IRQ) && chip->rmidi) { in snd_es1968_interrupt()
1972 snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data); in snd_es1968_interrupt()
1977 spin_lock(&chip->substream_lock); in snd_es1968_interrupt()
1978 list_for_each_entry(es, &chip->substream_list, list) { in snd_es1968_interrupt()
1979 if (es->running) { in snd_es1968_interrupt()
1981 if (es->fmt & ESS_FMT_STEREO) in snd_es1968_interrupt()
1985 spin_unlock(&chip->substream_lock); in snd_es1968_interrupt()
1986 if (chip->in_measurement) { in snd_es1968_interrupt()
1987 unsigned int curp = __apu_get_register(chip, chip->measure_apu, 5); in snd_es1968_interrupt()
1988 if (curp < chip->measure_lastpos) in snd_es1968_interrupt()
1989 chip->measure_count++; in snd_es1968_interrupt()
1990 chip->measure_lastpos = curp; in snd_es1968_interrupt()
2015 if ((err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus)) < 0) in snd_es1968_mixer()
2017 pbus->no_vra = 1; /* ES1968 doesn't need VRA */ in snd_es1968_mixer()
2021 if ((err = snd_ac97_mixer(pbus, &ac97, &chip->ac97)) < 0) in snd_es1968_mixer()
2029 chip->master_switch = snd_ctl_find_id(chip->card, &elem_id); in snd_es1968_mixer()
2033 chip->master_volume = snd_ctl_find_id(chip->card, &elem_id); in snd_es1968_mixer()
2045 unsigned long ioaddr = chip->io_port; in snd_es1968_ac97_reset()
2060 /* disable ac link */ in snd_es1968_ac97_reset()
2063 pci_read_config_word(chip->pci, 0x58, &w); /* something magical with gpio and bus arb. */ in snd_es1968_ac97_reset()
2064 pci_read_config_dword(chip->pci, PCI_SUBSYSTEM_VENDOR_ID, &vend); in snd_es1968_ac97_reset()
2080 /* disable ac link */ in snd_es1968_ac97_reset()
2094 dev_info(chip->card->dev, "trying software reset\n"); in snd_es1968_ac97_reset()
2152 chip->io_port + ESM_PORT_HOST_IRQ); in snd_es1968_reset()
2154 outw(0x0000, chip->io_port + ESM_PORT_HOST_IRQ); in snd_es1968_reset()
2163 struct pci_dev *pci = chip->pci; in snd_es1968_chip_init()
2165 unsigned long iobase = chip->io_port; in snd_es1968_chip_init()
2286 /* Write 0 into the buffer area 0x1E0->1EF */ in snd_es1968_chip_init()
2291 * 0x1D0-0x1DF too.*/ in snd_es1968_chip_init()
2323 /* Wave cache control on - test off, sg off, in snd_es1968_chip_init()
2356 if (chip->rmidi) in snd_es1968_start_irq()
2358 outb(w, chip->io_port + 0x1A); in snd_es1968_start_irq()
2359 outw(w, chip->io_port + ESM_PORT_HOST_IRQ); in snd_es1968_start_irq()
2369 struct es1968 *chip = card->private_data; in es1968_suspend()
2371 if (! chip->do_pm) in es1968_suspend()
2374 chip->in_suspend = 1; in es1968_suspend()
2375 cancel_work_sync(&chip->hwvol_work); in es1968_suspend()
2377 snd_ac97_suspend(chip->ac97); in es1968_suspend()
2385 struct es1968 *chip = card->private_data; in es1968_resume()
2388 if (! chip->do_pm) in es1968_resume()
2394 if (chip->dma.addr) { in es1968_resume()
2396 wave_set_register(chip, 0x01FC, chip->dma.addr >> 12); in es1968_resume()
2402 snd_ac97_resume(chip->ac97); in es1968_resume()
2404 list_for_each_entry(es, &chip->substream_list, list) { in es1968_resume()
2405 switch (es->mode) { in es1968_resume()
2407 snd_es1968_playback_setup(chip, es, es->substream->runtime); in es1968_resume()
2410 snd_es1968_capture_setup(chip, es, es->substream->runtime); in es1968_resume()
2416 if (chip->bobclient) in es1968_resume()
2420 chip->in_suspend = 0; in es1968_resume()
2439 return -ENODEV; in snd_es1968_create_gameport()
2443 return -EBUSY; in snd_es1968_create_gameport()
2445 chip->gameport = gp = gameport_allocate_port(); in snd_es1968_create_gameport()
2447 dev_err(chip->card->dev, in snd_es1968_create_gameport()
2450 return -ENOMEM; in snd_es1968_create_gameport()
2453 pci_read_config_word(chip->pci, ESM_LEGACY_AUDIO_CONTROL, &val); in snd_es1968_create_gameport()
2454 pci_write_config_word(chip->pci, ESM_LEGACY_AUDIO_CONTROL, val | 0x04); in snd_es1968_create_gameport()
2457 gameport_set_phys(gp, "pci%s/gameport0", pci_name(chip->pci)); in snd_es1968_create_gameport()
2458 gameport_set_dev_parent(gp, &chip->pci->dev); in snd_es1968_create_gameport()
2459 gp->io = JOYSTICK_ADDR; in snd_es1968_create_gameport()
2469 if (chip->gameport) { in snd_es1968_free_gameport()
2470 struct resource *r = gameport_get_port_data(chip->gameport); in snd_es1968_free_gameport()
2472 gameport_unregister_port(chip->gameport); in snd_es1968_free_gameport()
2473 chip->gameport = NULL; in snd_es1968_free_gameport()
2479 static inline int snd_es1968_create_gameport(struct es1968 *chip, int dev) { return -ENOSYS; } in snd_es1968_create_gameport()
2491 return -ENOMEM; in snd_es1968_input_register()
2493 snprintf(chip->phys, sizeof(chip->phys), "pci-%s/input0", in snd_es1968_input_register()
2494 pci_name(chip->pci)); in snd_es1968_input_register()
2496 input_dev->name = chip->card->driver; in snd_es1968_input_register()
2497 input_dev->phys = chip->phys; in snd_es1968_input_register()
2498 input_dev->id.bustype = BUS_PCI; in snd_es1968_input_register()
2499 input_dev->id.vendor = chip->pci->vendor; in snd_es1968_input_register()
2500 input_dev->id.product = chip->pci->device; in snd_es1968_input_register()
2501 input_dev->dev.parent = &chip->pci->dev; in snd_es1968_input_register()
2503 __set_bit(EV_KEY, input_dev->evbit); in snd_es1968_input_register()
2504 __set_bit(KEY_MUTE, input_dev->keybit); in snd_es1968_input_register()
2505 __set_bit(KEY_VOLUMEDOWN, input_dev->keybit); in snd_es1968_input_register()
2506 __set_bit(KEY_VOLUMEUP, input_dev->keybit); in snd_es1968_input_register()
2514 chip->input_dev = input_dev; in snd_es1968_input_register()
2533 { .data = 6, .clk = 7, .wren = 8, .most = 9, .name = "SF64-PCE2" },
2538 (&snd_es1968_tea575x_gpios[(chip)->tea575x_tuner])
2543 struct es1968 *chip = tea->private_data; in snd_es1968_tea575x_set_pins()
2551 outw(val, chip->io_port + GPIO_DATA); in snd_es1968_tea575x_set_pins()
2556 struct es1968 *chip = tea->private_data; in snd_es1968_tea575x_get_pins()
2558 u16 val = inw(chip->io_port + GPIO_DATA); in snd_es1968_tea575x_get_pins()
2571 struct es1968 *chip = tea->private_data; in snd_es1968_tea575x_set_direction()
2572 unsigned long io = chip->io_port + GPIO_DATA; in snd_es1968_tea575x_set_direction()
2598 cancel_work_sync(&chip->hwvol_work); in snd_es1968_free()
2600 if (chip->input_dev) in snd_es1968_free()
2601 input_unregister_device(chip->input_dev); in snd_es1968_free()
2604 if (chip->io_port) { in snd_es1968_free()
2605 outw(1, chip->io_port + 0x04); /* clear WP interrupts */ in snd_es1968_free()
2606 outw(0, chip->io_port + ESM_PORT_HOST_IRQ); /* disable IRQ */ in snd_es1968_free()
2610 snd_tea575x_exit(&chip->tea); in snd_es1968_free()
2611 v4l2_device_unregister(&chip->v4l2_dev); in snd_es1968_free()
2614 if (chip->irq >= 0) in snd_es1968_free()
2615 free_irq(chip->irq, chip); in snd_es1968_free()
2617 pci_release_regions(chip->pci); in snd_es1968_free()
2618 pci_disable_device(chip->pci); in snd_es1968_free()
2625 struct es1968 *chip = device->device_data; in snd_es1968_dev_free()
2642 { TYPE_MAESTRO2, 0x125d }, /* a PCI card, e.g. SF64-PCE2 */
2671 if (dma_set_mask(&pci->dev, DMA_BIT_MASK(28)) < 0 || in snd_es1968_create()
2672 dma_set_coherent_mask(&pci->dev, DMA_BIT_MASK(28)) < 0) { in snd_es1968_create()
2673 dev_err(card->dev, in snd_es1968_create()
2676 return -ENXIO; in snd_es1968_create()
2682 return -ENOMEM; in snd_es1968_create()
2686 chip->type = chip_type; in snd_es1968_create()
2687 spin_lock_init(&chip->reg_lock); in snd_es1968_create()
2688 spin_lock_init(&chip->substream_lock); in snd_es1968_create()
2689 INIT_LIST_HEAD(&chip->buf_list); in snd_es1968_create()
2690 INIT_LIST_HEAD(&chip->substream_list); in snd_es1968_create()
2691 mutex_init(&chip->memory_mutex); in snd_es1968_create()
2692 INIT_WORK(&chip->hwvol_work, es1968_update_hw_volume); in snd_es1968_create()
2693 chip->card = card; in snd_es1968_create()
2694 chip->pci = pci; in snd_es1968_create()
2695 chip->irq = -1; in snd_es1968_create()
2696 chip->total_bufsize = total_bufsize; /* in bytes */ in snd_es1968_create()
2697 chip->playback_streams = play_streams; in snd_es1968_create()
2698 chip->capture_streams = capt_streams; in snd_es1968_create()
2705 chip->io_port = pci_resource_start(pci, 0); in snd_es1968_create()
2706 if (request_irq(pci->irq, snd_es1968_interrupt, IRQF_SHARED, in snd_es1968_create()
2708 dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq); in snd_es1968_create()
2710 return -EBUSY; in snd_es1968_create()
2712 chip->irq = pci->irq; in snd_es1968_create()
2713 card->sync_irq = chip->irq; in snd_es1968_create()
2717 chip->maestro_map[i] = 0; in snd_es1968_create()
2721 chip->apu[i] = ESM_APU_FREE; in snd_es1968_create()
2727 /* disable power-management if not on the allowlist */ in snd_es1968_create()
2729 pci_read_config_word(chip->pci, PCI_SUBSYSTEM_VENDOR_ID, &vend); in snd_es1968_create()
2731 if (chip->type == pm_allowlist[i].type && in snd_es1968_create()
2739 dev_info(card->dev, "not attempting power management.\n"); in snd_es1968_create()
2743 chip->do_pm = do_pm; in snd_es1968_create()
2753 /* don't play with GPIOs on laptops */ in snd_es1968_create()
2754 if (chip->pci->subsystem_vendor != 0x125d) in snd_es1968_create()
2756 err = v4l2_device_register(&pci->dev, &chip->v4l2_dev); in snd_es1968_create()
2761 chip->tea.v4l2_dev = &chip->v4l2_dev; in snd_es1968_create()
2762 chip->tea.private_data = chip; in snd_es1968_create()
2763 chip->tea.radio_nr = radio_nr; in snd_es1968_create()
2764 chip->tea.ops = &snd_es1968_tea_ops; in snd_es1968_create()
2765 sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci)); in snd_es1968_create()
2767 chip->tea575x_tuner = i; in snd_es1968_create()
2768 if (!snd_tea575x_init(&chip->tea, THIS_MODULE)) { in snd_es1968_create()
2769 dev_info(card->dev, "detected TEA575x radio type %s\n", in snd_es1968_create()
2770 get_tea575x_gpio(chip)->name); in snd_es1968_create()
2771 strlcpy(chip->tea.card, get_tea575x_gpio(chip)->name, in snd_es1968_create()
2772 sizeof(chip->tea.card)); in snd_es1968_create()
2797 return -ENODEV; in snd_es1968_probe()
2800 return -ENOENT; in snd_es1968_probe()
2803 err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, in snd_es1968_probe()
2816 pci_id->driver_data, in snd_es1968_probe()
2823 card->private_data = chip; in snd_es1968_probe()
2825 switch (chip->type) { in snd_es1968_probe()
2827 strcpy(card->driver, "ES1978"); in snd_es1968_probe()
2828 strcpy(card->shortname, "ESS ES1978 (Maestro 2E)"); in snd_es1968_probe()
2831 strcpy(card->driver, "ES1968"); in snd_es1968_probe()
2832 strcpy(card->shortname, "ESS ES1968 (Maestro 2)"); in snd_es1968_probe()
2835 strcpy(card->driver, "ESM1"); in snd_es1968_probe()
2836 strcpy(card->shortname, "ESS Maestro 1"); in snd_es1968_probe()
2853 pci_read_config_word(chip->pci, PCI_SUBSYSTEM_VENDOR_ID, &vend); in snd_es1968_probe()
2855 if (chip->type == mpu_denylist[i].type && in snd_es1968_probe()
2864 chip->io_port + ESM_MPU401_PORT, in snd_es1968_probe()
2867 -1, &chip->rmidi)) < 0) { in snd_es1968_probe()
2868 dev_warn(card->dev, "skipping MPU-401 MIDI support..\n"); in snd_es1968_probe()
2877 dev_warn(card->dev, in snd_es1968_probe()
2883 chip->clock = clock[dev]; in snd_es1968_probe()
2884 if (! chip->clock) in snd_es1968_probe()
2887 sprintf(card->longname, "%s at 0x%lx, irq %i", in snd_es1968_probe()
2888 card->shortname, chip->io_port, chip->irq); in snd_es1968_probe()