Lines Matching +full:esm +full:- +full:pins
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>
115 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 1-MAX */
118 static int total_bufsize[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1024 };
119 static int pcm_substreams_p[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4 };
120 static int pcm_substreams_c[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1 };
122 static int use_pm[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
123 static int enable_mpu[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
127 static int radio_nr[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
142 MODULE_PARM_DESC(clock, "Clock on " CARD_NAME " soundcard. (0 = auto-detect)");
144 MODULE_PARM_DESC(use_pm, "Toggle power-management. (0 = off, 1 = on, 2 = auto)");
296 /* APU Modes: reg 0x00, bit 4-7 */
300 #define ESM_APU_16BITLINEAR 0x01 /* 16-Bit Linear Sample Player */
301 #define ESM_APU_16BITSTEREO 0x02 /* 16-Bit Stereo Sample Player */
302 #define ESM_APU_8BITLINEAR 0x03 /* 8-Bit Linear Sample Player */
303 #define ESM_APU_8BITSTEREO 0x04 /* 8-Bit Stereo Sample Player */
304 #define ESM_APU_8BITDIFF 0x05 /* 8-Bit Differential Sample Playrer */
311 #define ESM_APU_16BITPINGPONG 0x0C /* 16-Bit Ping-Pong Sample Player */
351 /* reg 0x05 - wave start offset */
352 /* reg 0x06 - wave end offset */
353 /* reg 0x07 - wave loop length */
364 /* bit 0-7 amplitude dest? */
504 int do_pm; /* power-management enabled */
574 outw(reg, chip->io_port + ESM_INDEX); in __maestro_write()
575 outw(data, chip->io_port + ESM_DATA); in __maestro_write()
576 chip->maestro_map[reg] = data; in __maestro_write()
582 spin_lock_irqsave(&chip->reg_lock, flags); in maestro_write()
584 spin_unlock_irqrestore(&chip->reg_lock, flags); in maestro_write()
591 outw(reg, chip->io_port + ESM_INDEX); in __maestro_read()
592 chip->maestro_map[reg] = inw(chip->io_port + ESM_DATA); in __maestro_read()
594 return chip->maestro_map[reg]; in __maestro_read()
601 spin_lock_irqsave(&chip->reg_lock, flags); in maestro_read()
603 spin_unlock_irqrestore(&chip->reg_lock, flags); in maestro_read()
612 while (timeout-- > 0) { in snd_es1968_ac97_wait()
613 if (!(inb(chip->io_port + ESM_AC97_INDEX) & 1)) in snd_es1968_ac97_wait()
617 dev_dbg(chip->card->dev, "ac97 timeout\n"); in snd_es1968_ac97_wait()
625 while (timeout-- > 0) { in snd_es1968_ac97_wait_poll()
626 if (!(inb(chip->io_port + ESM_AC97_INDEX) & 1)) in snd_es1968_ac97_wait_poll()
629 dev_dbg(chip->card->dev, "ac97 timeout\n"); in snd_es1968_ac97_wait_poll()
635 struct es1968 *chip = ac97->private_data; in snd_es1968_ac97_write()
640 outw(val, chip->io_port + ESM_AC97_DATA); in snd_es1968_ac97_write()
642 outb(reg, chip->io_port + ESM_AC97_INDEX); in snd_es1968_ac97_write()
649 struct es1968 *chip = ac97->private_data; in snd_es1968_ac97_read()
653 outb(reg | 0x80, chip->io_port + ESM_AC97_INDEX); in snd_es1968_ac97_read()
657 data = inw(chip->io_port + ESM_AC97_DATA); in snd_es1968_ac97_read()
672 dev_dbg(chip->card->dev, "APU register select failed. (Timeout)\n"); in apu_index_set()
684 dev_dbg(chip->card->dev, "APU register set probably failed (Timeout)!\n"); in apu_data_set()
693 chip->apu_map[channel][reg] = data; in __apu_set_register()
703 spin_lock_irqsave(&chip->reg_lock, flags); in apu_set_register()
705 spin_unlock_irqrestore(&chip->reg_lock, flags); in apu_set_register()
721 spin_lock_irqsave(&chip->reg_lock, flags); in apu_get_register()
723 spin_unlock_irqrestore(&chip->reg_lock, flags); in apu_get_register()
733 spin_lock_irqsave(&chip->reg_lock, flags);
734 outl(reg, chip->io_port + ASSP_INDEX);
735 outl(value, chip->io_port + ASSP_DATA);
736 spin_unlock_irqrestore(&chip->reg_lock, flags);
744 spin_lock_irqsave(&chip->reg_lock, flags);
745 outl(reg, chip->io_port + ASSP_INDEX);
746 value = inl(chip->io_port + ASSP_DATA);
747 spin_unlock_irqrestore(&chip->reg_lock, flags);
758 spin_lock_irqsave(&chip->reg_lock, flags); in wave_set_register()
759 outw(reg, chip->io_port + WC_INDEX); in wave_set_register()
760 outw(value, chip->io_port + WC_DATA); in wave_set_register()
761 spin_unlock_irqrestore(&chip->reg_lock, flags); in wave_set_register()
769 spin_lock_irqsave(&chip->reg_lock, flags); in wave_get_register()
770 outw(reg, chip->io_port + WC_INDEX); in wave_get_register()
771 value = inw(chip->io_port + WC_DATA); in wave_get_register()
772 spin_unlock_irqrestore(&chip->reg_lock, flags); in wave_get_register()
801 if (chip->bob_freq > (ESS_SYSCLK >> (prescale + 9))) in snd_es1968_bob_start()
807 prescale--; in snd_es1968_bob_start()
812 /* now fine-tune the divider for best match */ in snd_es1968_bob_start()
814 if (chip->bob_freq > in snd_es1968_bob_start()
821 prescale--; in snd_es1968_bob_start()
823 divide--; in snd_es1968_bob_start()
835 chip->bobclient++; in snd_es1968_bob_inc()
836 if (chip->bobclient == 1) { in snd_es1968_bob_inc()
837 chip->bob_freq = freq; in snd_es1968_bob_inc()
839 } else if (chip->bob_freq < freq) { in snd_es1968_bob_inc()
841 chip->bob_freq = freq; in snd_es1968_bob_inc()
849 chip->bobclient--; in snd_es1968_bob_dec()
850 if (chip->bobclient <= 0) in snd_es1968_bob_dec()
852 else if (chip->bob_freq > ESM_BOB_FREQ) { in snd_es1968_bob_dec()
856 list_for_each_entry(es, &chip->substream_list, list) { in snd_es1968_bob_dec()
857 if (max_freq < es->bob_freq) in snd_es1968_bob_dec()
858 max_freq = es->bob_freq; in snd_es1968_bob_dec()
860 if (max_freq != chip->bob_freq) { in snd_es1968_bob_dec()
862 chip->bob_freq = max_freq; in snd_es1968_bob_dec()
873 int freq = runtime->rate * 4; in snd_es1968_calc_bob_rate()
874 if (es->fmt & ESS_FMT_STEREO) in snd_es1968_calc_bob_rate()
876 if (es->fmt & ESS_FMT_16BIT) in snd_es1968_calc_bob_rate()
878 freq /= es->frag_size; in snd_es1968_calc_bob_rate()
893 u32 rate = (freq << 16) / chip->clock; in snd_es1968_compute_rate()
907 offset = apu_get_register(chip, es->apu[0], 5); in snd_es1968_get_dma_ptr()
909 offset -= es->base[0]; in snd_es1968_get_dma_ptr()
923 static inline void snd_es1968_trigger_apu(struct es1968 *esm, int apu, int mode) in snd_es1968_trigger_apu() argument
926 __apu_set_register(esm, apu, 0, in snd_es1968_trigger_apu()
927 (__apu_get_register(esm, apu, 0) & 0xff0f) | in snd_es1968_trigger_apu()
933 spin_lock(&chip->reg_lock); in snd_es1968_pcm_start()
934 __apu_set_register(chip, es->apu[0], 5, es->base[0]); in snd_es1968_pcm_start()
935 snd_es1968_trigger_apu(chip, es->apu[0], es->apu_mode[0]); in snd_es1968_pcm_start()
936 if (es->mode == ESM_MODE_CAPTURE) { in snd_es1968_pcm_start()
937 __apu_set_register(chip, es->apu[2], 5, es->base[2]); in snd_es1968_pcm_start()
938 snd_es1968_trigger_apu(chip, es->apu[2], es->apu_mode[2]); in snd_es1968_pcm_start()
940 if (es->fmt & ESS_FMT_STEREO) { in snd_es1968_pcm_start()
941 __apu_set_register(chip, es->apu[1], 5, es->base[1]); in snd_es1968_pcm_start()
942 snd_es1968_trigger_apu(chip, es->apu[1], es->apu_mode[1]); in snd_es1968_pcm_start()
943 if (es->mode == ESM_MODE_CAPTURE) { in snd_es1968_pcm_start()
944 __apu_set_register(chip, es->apu[3], 5, es->base[3]); in snd_es1968_pcm_start()
945 snd_es1968_trigger_apu(chip, es->apu[3], es->apu_mode[3]); in snd_es1968_pcm_start()
948 spin_unlock(&chip->reg_lock); in snd_es1968_pcm_start()
953 spin_lock(&chip->reg_lock); in snd_es1968_pcm_stop()
954 snd_es1968_trigger_apu(chip, es->apu[0], 0); in snd_es1968_pcm_stop()
955 snd_es1968_trigger_apu(chip, es->apu[1], 0); in snd_es1968_pcm_stop()
956 if (es->mode == ESM_MODE_CAPTURE) { in snd_es1968_pcm_stop()
957 snd_es1968_trigger_apu(chip, es->apu[2], 0); in snd_es1968_pcm_stop()
958 snd_es1968_trigger_apu(chip, es->apu[3], 0); in snd_es1968_pcm_stop()
960 spin_unlock(&chip->reg_lock); in snd_es1968_pcm_stop()
967 u32 tmpval = (addr - 0x10) & 0xFFF8; in snd_es1968_program_wavecache()
970 if (!(es->fmt & ESS_FMT_16BIT)) in snd_es1968_program_wavecache()
972 if (es->fmt & ESS_FMT_STEREO) in snd_es1968_program_wavecache()
977 wave_set_register(chip, es->apu[channel] << 3, tmpval); in snd_es1968_program_wavecache()
980 es->wc_map[channel] = tmpval; in snd_es1968_program_wavecache()
995 size = es->dma_size >> es->wav_shift; in snd_es1968_playback_setup()
997 if (es->fmt & ESS_FMT_STEREO) in snd_es1968_playback_setup()
1001 apu = es->apu[channel]; in snd_es1968_playback_setup()
1003 snd_es1968_program_wavecache(chip, es, channel, es->memory->buf.addr, 0); in snd_es1968_playback_setup()
1006 pa = es->memory->buf.addr; in snd_es1968_playback_setup()
1007 pa -= chip->dma.addr; in snd_es1968_playback_setup()
1012 if (es->fmt & ESS_FMT_STEREO) { in snd_es1968_playback_setup()
1016 if (es->fmt & ESS_FMT_16BIT) in snd_es1968_playback_setup()
1022 es->base[channel] = pa & 0xFFFF; in snd_es1968_playback_setup()
1044 if (es->fmt & ESS_FMT_16BIT) in snd_es1968_playback_setup()
1045 es->apu_mode[channel] = ESM_APU_16BITLINEAR; in snd_es1968_playback_setup()
1047 es->apu_mode[channel] = ESM_APU_8BITLINEAR; in snd_es1968_playback_setup()
1049 if (es->fmt & ESS_FMT_STEREO) { in snd_es1968_playback_setup()
1054 and not the APU Regs 4-5. */ in snd_es1968_playback_setup()
1057 es->apu_mode[channel] += 1; /* stereo */ in snd_es1968_playback_setup()
1062 spin_lock_irqsave(&chip->reg_lock, flags); in snd_es1968_playback_setup()
1064 outw(1, chip->io_port + 0x04); in snd_es1968_playback_setup()
1066 outw(inw(chip->io_port + ESM_PORT_HOST_IRQ) | ESM_HIRQ_DSIE, chip->io_port + ESM_PORT_HOST_IRQ); in snd_es1968_playback_setup()
1067 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1968_playback_setup()
1069 freq = runtime->rate; in snd_es1968_playback_setup()
1077 if (!(es->fmt & ESS_FMT_16BIT) && !(es->fmt & ESS_FMT_STEREO)) in snd_es1968_playback_setup()
1083 snd_es1968_apu_set_freq(chip, es->apu[0], freq); in snd_es1968_playback_setup()
1084 snd_es1968_apu_set_freq(chip, es->apu[1], freq); in snd_es1968_playback_setup()
1092 int i, apu = es->apu[channel]; in init_capture_apu()
1094 es->apu_mode[channel] = mode; in init_capture_apu()
1100 pa -= chip->dma.addr; in init_capture_apu()
1105 es->base[channel] = pa & 0xFFFF; in init_capture_apu()
1106 pa |= 0x00400000; /* bit 22 -> System RAM */ in init_capture_apu()
1140 size = es->dma_size >> es->wav_shift; in snd_es1968_capture_setup()
1153 /* parallel in crap, see maestro reg 0xC [8-11] */ in snd_es1968_capture_setup()
1155 es->mixbuf->buf.addr, ESM_MIXBUF_SIZE/4, /* in words */ in snd_es1968_capture_setup()
1158 init_capture_apu(chip, es, 0, es->memory->buf.addr, size, in snd_es1968_capture_setup()
1159 ESM_APU_SRCONVERTOR, es->apu[2]); in snd_es1968_capture_setup()
1160 if (es->fmt & ESS_FMT_STEREO) { in snd_es1968_capture_setup()
1163 es->mixbuf->buf.addr + ESM_MIXBUF_SIZE/2, in snd_es1968_capture_setup()
1168 es->memory->buf.addr + size*2, size, in snd_es1968_capture_setup()
1169 ESM_APU_SRCONVERTOR, es->apu[3]); in snd_es1968_capture_setup()
1172 freq = runtime->rate; in snd_es1968_capture_setup()
1182 snd_es1968_apu_set_freq(chip, es->apu[0], freq); in snd_es1968_capture_setup()
1183 snd_es1968_apu_set_freq(chip, es->apu[1], freq); in snd_es1968_capture_setup()
1187 snd_es1968_apu_set_freq(chip, es->apu[2], freq); in snd_es1968_capture_setup()
1188 snd_es1968_apu_set_freq(chip, es->apu[3], freq); in snd_es1968_capture_setup()
1190 spin_lock_irqsave(&chip->reg_lock, flags); in snd_es1968_capture_setup()
1192 outw(1, chip->io_port + 0x04); in snd_es1968_capture_setup()
1194 outw(inw(chip->io_port + ESM_PORT_HOST_IRQ) | ESM_HIRQ_DSIE, chip->io_port + ESM_PORT_HOST_IRQ); in snd_es1968_capture_setup()
1195 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1968_capture_setup()
1205 struct snd_pcm_runtime *runtime = substream->runtime; in snd_es1968_pcm_prepare()
1206 struct esschan *es = runtime->private_data; in snd_es1968_pcm_prepare()
1208 es->dma_size = snd_pcm_lib_buffer_bytes(substream); in snd_es1968_pcm_prepare()
1209 es->frag_size = snd_pcm_lib_period_bytes(substream); in snd_es1968_pcm_prepare()
1211 es->wav_shift = 1; /* maestro handles always 16bit */ in snd_es1968_pcm_prepare()
1212 es->fmt = 0; in snd_es1968_pcm_prepare()
1213 if (snd_pcm_format_width(runtime->format) == 16) in snd_es1968_pcm_prepare()
1214 es->fmt |= ESS_FMT_16BIT; in snd_es1968_pcm_prepare()
1215 if (runtime->channels > 1) { in snd_es1968_pcm_prepare()
1216 es->fmt |= ESS_FMT_STEREO; in snd_es1968_pcm_prepare()
1217 if (es->fmt & ESS_FMT_16BIT) /* 8bit is already word shifted */ in snd_es1968_pcm_prepare()
1218 es->wav_shift++; in snd_es1968_pcm_prepare()
1220 es->bob_freq = snd_es1968_calc_bob_rate(chip, es, runtime); in snd_es1968_pcm_prepare()
1222 switch (es->mode) { in snd_es1968_pcm_prepare()
1237 struct esschan *es = substream->runtime->private_data; in snd_es1968_pcm_trigger()
1239 spin_lock(&chip->substream_lock); in snd_es1968_pcm_trigger()
1243 if (es->running) in snd_es1968_pcm_trigger()
1245 snd_es1968_bob_inc(chip, es->bob_freq); in snd_es1968_pcm_trigger()
1246 es->count = 0; in snd_es1968_pcm_trigger()
1247 es->hwptr = 0; in snd_es1968_pcm_trigger()
1249 es->running = 1; in snd_es1968_pcm_trigger()
1253 if (! es->running) in snd_es1968_pcm_trigger()
1256 es->running = 0; in snd_es1968_pcm_trigger()
1260 spin_unlock(&chip->substream_lock); in snd_es1968_pcm_trigger()
1267 struct esschan *es = substream->runtime->private_data; in snd_es1968_pcm_pointer()
1270 ptr = snd_es1968_get_dma_ptr(chip, es) << es->wav_shift; in snd_es1968_pcm_pointer()
1272 return bytes_to_frames(substream->runtime, ptr % es->dma_size); in snd_es1968_pcm_pointer()
1329 mutex_lock(&chip->memory_mutex); in calc_available_memory_size()
1330 list_for_each_entry(buf, &chip->buf_list, list) { in calc_available_memory_size()
1331 if (buf->empty && buf->buf.bytes > max_size) in calc_available_memory_size()
1332 max_size = buf->buf.bytes; in calc_available_memory_size()
1334 mutex_unlock(&chip->memory_mutex); in calc_available_memory_size()
1346 mutex_lock(&chip->memory_mutex); in snd_es1968_new_memory()
1347 list_for_each_entry(buf, &chip->buf_list, list) { in snd_es1968_new_memory()
1348 if (buf->empty && buf->buf.bytes >= size) in snd_es1968_new_memory()
1351 mutex_unlock(&chip->memory_mutex); in snd_es1968_new_memory()
1355 if (buf->buf.bytes > size) { in snd_es1968_new_memory()
1358 mutex_unlock(&chip->memory_mutex); in snd_es1968_new_memory()
1361 chunk->buf = buf->buf; in snd_es1968_new_memory()
1362 chunk->buf.bytes -= size; in snd_es1968_new_memory()
1363 chunk->buf.area += size; in snd_es1968_new_memory()
1364 chunk->buf.addr += size; in snd_es1968_new_memory()
1365 chunk->empty = 1; in snd_es1968_new_memory()
1366 buf->buf.bytes = size; in snd_es1968_new_memory()
1367 list_add(&chunk->list, &buf->list); in snd_es1968_new_memory()
1369 buf->empty = 0; in snd_es1968_new_memory()
1370 mutex_unlock(&chip->memory_mutex); in snd_es1968_new_memory()
1379 mutex_lock(&chip->memory_mutex); in snd_es1968_free_memory()
1380 buf->empty = 1; in snd_es1968_free_memory()
1381 if (buf->list.prev != &chip->buf_list) { in snd_es1968_free_memory()
1382 chunk = list_entry(buf->list.prev, struct esm_memory, list); in snd_es1968_free_memory()
1383 if (chunk->empty) { in snd_es1968_free_memory()
1384 chunk->buf.bytes += buf->buf.bytes; in snd_es1968_free_memory()
1385 list_del(&buf->list); in snd_es1968_free_memory()
1390 if (buf->list.next != &chip->buf_list) { in snd_es1968_free_memory()
1391 chunk = list_entry(buf->list.next, struct esm_memory, list); in snd_es1968_free_memory()
1392 if (chunk->empty) { in snd_es1968_free_memory()
1393 buf->buf.bytes += chunk->buf.bytes; in snd_es1968_free_memory()
1394 list_del(&chunk->list); in snd_es1968_free_memory()
1398 mutex_unlock(&chip->memory_mutex); in snd_es1968_free_memory()
1405 if (! chip->dma.area) in snd_es1968_free_dmabuf()
1407 snd_dma_free_pages(&chip->dma); in snd_es1968_free_dmabuf()
1408 while ((p = chip->buf_list.next) != &chip->buf_list) { in snd_es1968_free_dmabuf()
1422 &chip->pci->dev, in snd_es1968_init_dmabuf()
1423 chip->total_bufsize, &chip->dma); in snd_es1968_init_dmabuf()
1424 if (err < 0 || ! chip->dma.area) { in snd_es1968_init_dmabuf()
1425 dev_err(chip->card->dev, in snd_es1968_init_dmabuf()
1427 chip->total_bufsize); in snd_es1968_init_dmabuf()
1428 return -ENOMEM; in snd_es1968_init_dmabuf()
1430 if ((chip->dma.addr + chip->dma.bytes - 1) & ~((1 << 28) - 1)) { in snd_es1968_init_dmabuf()
1431 snd_dma_free_pages(&chip->dma); in snd_es1968_init_dmabuf()
1432 dev_err(chip->card->dev, "DMA buffer beyond 256MB.\n"); in snd_es1968_init_dmabuf()
1433 return -ENOMEM; in snd_es1968_init_dmabuf()
1436 INIT_LIST_HEAD(&chip->buf_list); in snd_es1968_init_dmabuf()
1441 return -ENOMEM; in snd_es1968_init_dmabuf()
1443 memset(chip->dma.area, 0, ESM_MEM_ALIGN); in snd_es1968_init_dmabuf()
1444 chunk->buf = chip->dma; in snd_es1968_init_dmabuf()
1445 chunk->buf.area += ESM_MEM_ALIGN; in snd_es1968_init_dmabuf()
1446 chunk->buf.addr += ESM_MEM_ALIGN; in snd_es1968_init_dmabuf()
1447 chunk->buf.bytes -= ESM_MEM_ALIGN; in snd_es1968_init_dmabuf()
1448 chunk->empty = 1; in snd_es1968_init_dmabuf()
1449 list_add(&chunk->list, &chip->buf_list); in snd_es1968_init_dmabuf()
1455 /* buffer is extracted from the pre-allocated memory chunk */
1460 struct snd_pcm_runtime *runtime = substream->runtime; in snd_es1968_hw_params()
1461 struct esschan *chan = runtime->private_data; in snd_es1968_hw_params()
1464 if (chan->memory) { in snd_es1968_hw_params()
1465 if (chan->memory->buf.bytes >= size) { in snd_es1968_hw_params()
1466 runtime->dma_bytes = size; in snd_es1968_hw_params()
1469 snd_es1968_free_memory(chip, chan->memory); in snd_es1968_hw_params()
1471 chan->memory = snd_es1968_new_memory(chip, size); in snd_es1968_hw_params()
1472 if (chan->memory == NULL) { in snd_es1968_hw_params()
1473 dev_dbg(chip->card->dev, in snd_es1968_hw_params()
1475 return -ENOMEM; in snd_es1968_hw_params()
1477 snd_pcm_set_runtime_buffer(substream, &chan->memory->buf); in snd_es1968_hw_params()
1485 struct snd_pcm_runtime *runtime = substream->runtime; in snd_es1968_hw_free()
1488 if (runtime->private_data == NULL) in snd_es1968_hw_free()
1490 chan = runtime->private_data; in snd_es1968_hw_free()
1491 if (chan->memory) { in snd_es1968_hw_free()
1492 snd_es1968_free_memory(chip, chan->memory); in snd_es1968_hw_free()
1493 chan->memory = NULL; in snd_es1968_hw_free()
1507 if (chip->apu[apu] == ESM_APU_FREE && in snd_es1968_alloc_apu_pair()
1508 chip->apu[apu + 1] == ESM_APU_FREE) { in snd_es1968_alloc_apu_pair()
1509 chip->apu[apu] = chip->apu[apu + 1] = type; in snd_es1968_alloc_apu_pair()
1513 return -EBUSY; in snd_es1968_alloc_apu_pair()
1521 chip->apu[apu] = chip->apu[apu + 1] = ESM_APU_FREE; in snd_es1968_free_apu_pair()
1532 struct snd_pcm_runtime *runtime = substream->runtime; in snd_es1968_playback_open()
1544 return -ENOMEM; in snd_es1968_playback_open()
1547 es->apu[0] = apu1; in snd_es1968_playback_open()
1548 es->apu[1] = apu1 + 1; in snd_es1968_playback_open()
1549 es->apu_mode[0] = 0; in snd_es1968_playback_open()
1550 es->apu_mode[1] = 0; in snd_es1968_playback_open()
1551 es->running = 0; in snd_es1968_playback_open()
1552 es->substream = substream; in snd_es1968_playback_open()
1553 es->mode = ESM_MODE_PLAY; in snd_es1968_playback_open()
1555 runtime->private_data = es; in snd_es1968_playback_open()
1556 runtime->hw = snd_es1968_playback; in snd_es1968_playback_open()
1557 runtime->hw.buffer_bytes_max = runtime->hw.period_bytes_max = in snd_es1968_playback_open()
1560 spin_lock_irq(&chip->substream_lock); in snd_es1968_playback_open()
1561 list_add(&es->list, &chip->substream_list); in snd_es1968_playback_open()
1562 spin_unlock_irq(&chip->substream_lock); in snd_es1968_playback_open()
1569 struct snd_pcm_runtime *runtime = substream->runtime; in snd_es1968_capture_open()
1587 return -ENOMEM; in snd_es1968_capture_open()
1590 es->apu[0] = apu1; in snd_es1968_capture_open()
1591 es->apu[1] = apu1 + 1; in snd_es1968_capture_open()
1592 es->apu[2] = apu2; in snd_es1968_capture_open()
1593 es->apu[3] = apu2 + 1; in snd_es1968_capture_open()
1594 es->apu_mode[0] = 0; in snd_es1968_capture_open()
1595 es->apu_mode[1] = 0; in snd_es1968_capture_open()
1596 es->apu_mode[2] = 0; in snd_es1968_capture_open()
1597 es->apu_mode[3] = 0; in snd_es1968_capture_open()
1598 es->running = 0; in snd_es1968_capture_open()
1599 es->substream = substream; in snd_es1968_capture_open()
1600 es->mode = ESM_MODE_CAPTURE; in snd_es1968_capture_open()
1603 es->mixbuf = snd_es1968_new_memory(chip, ESM_MIXBUF_SIZE); in snd_es1968_capture_open()
1604 if (!es->mixbuf) { in snd_es1968_capture_open()
1608 return -ENOMEM; in snd_es1968_capture_open()
1610 memset(es->mixbuf->buf.area, 0, ESM_MIXBUF_SIZE); in snd_es1968_capture_open()
1612 runtime->private_data = es; in snd_es1968_capture_open()
1613 runtime->hw = snd_es1968_capture; in snd_es1968_capture_open()
1614 runtime->hw.buffer_bytes_max = runtime->hw.period_bytes_max = in snd_es1968_capture_open()
1615 calc_available_memory_size(chip) - 1024; /* keep MIXBUF size */ in snd_es1968_capture_open()
1618 spin_lock_irq(&chip->substream_lock); in snd_es1968_capture_open()
1619 list_add(&es->list, &chip->substream_list); in snd_es1968_capture_open()
1620 spin_unlock_irq(&chip->substream_lock); in snd_es1968_capture_open()
1630 if (substream->runtime->private_data == NULL) in snd_es1968_playback_close()
1632 es = substream->runtime->private_data; in snd_es1968_playback_close()
1633 spin_lock_irq(&chip->substream_lock); in snd_es1968_playback_close()
1634 list_del(&es->list); in snd_es1968_playback_close()
1635 spin_unlock_irq(&chip->substream_lock); in snd_es1968_playback_close()
1636 snd_es1968_free_apu_pair(chip, es->apu[0]); in snd_es1968_playback_close()
1647 if (substream->runtime->private_data == NULL) in snd_es1968_capture_close()
1649 es = substream->runtime->private_data; in snd_es1968_capture_close()
1650 spin_lock_irq(&chip->substream_lock); in snd_es1968_capture_close()
1651 list_del(&es->list); in snd_es1968_capture_close()
1652 spin_unlock_irq(&chip->substream_lock); in snd_es1968_capture_close()
1653 snd_es1968_free_memory(chip, es->mixbuf); in snd_es1968_capture_close()
1654 snd_es1968_free_apu_pair(chip, es->apu[0]); in snd_es1968_capture_close()
1655 snd_es1968_free_apu_pair(chip, es->apu[2]); in snd_es1968_capture_close()
1695 if (chip->clock == 0) in es1968_measure_clock()
1696 chip->clock = 48000; /* default clock value */ in es1968_measure_clock()
1701 dev_err(chip->card->dev, "Hmm, cannot find empty APU pair!?\n"); in es1968_measure_clock()
1706 dev_warn(chip->card->dev, in es1968_measure_clock()
1707 "cannot allocate dma buffer - using default clock %d\n", in es1968_measure_clock()
1708 chip->clock); in es1968_measure_clock()
1713 memset(memory->buf.area, 0, CLOCK_MEASURE_BUFSIZE); in es1968_measure_clock()
1715 wave_set_register(chip, apu << 3, (memory->buf.addr - 0x10) & 0xfff8); in es1968_measure_clock()
1717 pa = (unsigned int)((memory->buf.addr - chip->dma.addr) >> 1); in es1968_measure_clock()
1733 spin_lock_irq(&chip->reg_lock); in es1968_measure_clock()
1734 outw(1, chip->io_port + 0x04); /* clear WP interrupts */ in es1968_measure_clock()
1735 …outw(inw(chip->io_port + ESM_PORT_HOST_IRQ) | ESM_HIRQ_DSIE, chip->io_port + ESM_PORT_HOST_IRQ); /… in es1968_measure_clock()
1736 spin_unlock_irq(&chip->reg_lock); in es1968_measure_clock()
1738 snd_es1968_apu_set_freq(chip, apu, ((unsigned int)48000 << 16) / chip->clock); /* 48000 Hz */ in es1968_measure_clock()
1740 chip->in_measurement = 1; in es1968_measure_clock()
1741 chip->measure_apu = apu; in es1968_measure_clock()
1742 spin_lock_irq(&chip->reg_lock); in es1968_measure_clock()
1747 spin_unlock_irq(&chip->reg_lock); in es1968_measure_clock()
1749 spin_lock_irq(&chip->reg_lock); in es1968_measure_clock()
1754 chip->in_measurement = 0; in es1968_measure_clock()
1755 spin_unlock_irq(&chip->reg_lock); in es1968_measure_clock()
1758 offset -= (pa & 0xffff); in es1968_measure_clock()
1760 offset += chip->measure_count * (CLOCK_MEASURE_BUFSIZE/2); in es1968_measure_clock()
1765 dev_err(chip->card->dev, "?? calculation error..\n"); in es1968_measure_clock()
1771 chip->clock = (chip->clock * offset) / 48000; in es1968_measure_clock()
1773 dev_info(chip->card->dev, "clocking to %d\n", chip->clock); in es1968_measure_clock()
1785 struct es1968 *esm = pcm->private_data; in snd_es1968_pcm_free() local
1786 snd_es1968_free_dmabuf(esm); in snd_es1968_pcm_free()
1787 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 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); in snd_es1968_pcm()
1813 pcm->private_data = chip; in snd_es1968_pcm()
1814 pcm->private_free = snd_es1968_pcm_free; in snd_es1968_pcm()
1819 pcm->info_flags = 0; in snd_es1968_pcm()
1821 strcpy(pcm->name, "ESS Maestro"); in snd_es1968_pcm()
1823 chip->pcm = pcm; in snd_es1968_pcm()
1838 diff = (cp1 > cp2 ? cp1 - cp2 : cp2 - cp1); in snd_es1968_suppress_jitter()
1851 struct snd_pcm_substream *subs = es->substream; in snd_es1968_update_pcm()
1853 if (subs == NULL || !es->running) in snd_es1968_update_pcm()
1856 hwptr = snd_es1968_get_dma_ptr(chip, es) << es->wav_shift; in snd_es1968_update_pcm()
1857 hwptr %= es->dma_size; in snd_es1968_update_pcm()
1859 diff = (es->dma_size + hwptr - es->hwptr) % es->dma_size; in snd_es1968_update_pcm()
1861 es->hwptr = hwptr; in snd_es1968_update_pcm()
1862 es->count += diff; in snd_es1968_update_pcm()
1864 if (es->count > es->frag_size) { in snd_es1968_update_pcm()
1865 spin_unlock(&chip->substream_lock); in snd_es1968_update_pcm()
1867 spin_lock(&chip->substream_lock); in snd_es1968_update_pcm()
1868 es->count %= es->frag_size; in snd_es1968_update_pcm()
1874 generating an interrupt. The pair of counters is stored in bits 1-3 and 5-7
1884 x = inb(chip->io_port + 0x1c) & 0xee; in es1968_update_hw_volume()
1886 outb(0x88, chip->io_port + 0x1c); in es1968_update_hw_volume()
1887 outb(0x88, chip->io_port + 0x1d); in es1968_update_hw_volume()
1888 outb(0x88, chip->io_port + 0x1e); in es1968_update_hw_volume()
1889 outb(0x88, chip->io_port + 0x1f); in es1968_update_hw_volume()
1891 if (chip->in_suspend) in es1968_update_hw_volume()
1895 if (! chip->master_switch || ! chip->master_volume) in es1968_update_hw_volume()
1898 val = snd_ac97_read(chip->ac97, AC97_MASTER); in es1968_update_hw_volume()
1907 val--; in es1968_update_hw_volume()
1909 val -= 0x0100; in es1968_update_hw_volume()
1919 if (snd_ac97_update(chip->ac97, AC97_MASTER, val)) in es1968_update_hw_volume()
1920 snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE, in es1968_update_hw_volume()
1921 &chip->master_volume->id); in es1968_update_hw_volume()
1923 if (!chip->input_dev) in es1968_update_hw_volume()
1935 /* counters increased by 1 -> volume up */ in es1968_update_hw_volume()
1939 /* counters decreased by 1 -> volume down */ in es1968_update_hw_volume()
1945 input_report_key(chip->input_dev, val, 1); in es1968_update_hw_volume()
1946 input_sync(chip->input_dev); in es1968_update_hw_volume()
1947 input_report_key(chip->input_dev, val, 0); in es1968_update_hw_volume()
1948 input_sync(chip->input_dev); in es1968_update_hw_volume()
1961 event = inb(chip->io_port + 0x1A); in snd_es1968_interrupt()
1965 outw(inw(chip->io_port + 4) & 1, chip->io_port + 4); in snd_es1968_interrupt()
1968 schedule_work(&chip->hwvol_work); in snd_es1968_interrupt()
1971 outb(0xFF, chip->io_port + 0x1A); in snd_es1968_interrupt()
1973 if ((event & ESM_MPU401_IRQ) && chip->rmidi) { in snd_es1968_interrupt()
1974 snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data); in snd_es1968_interrupt()
1979 spin_lock(&chip->substream_lock); in snd_es1968_interrupt()
1980 list_for_each_entry(es, &chip->substream_list, list) { in snd_es1968_interrupt()
1981 if (es->running) { in snd_es1968_interrupt()
1983 if (es->fmt & ESS_FMT_STEREO) in snd_es1968_interrupt()
1987 spin_unlock(&chip->substream_lock); in snd_es1968_interrupt()
1988 if (chip->in_measurement) { in snd_es1968_interrupt()
1989 unsigned int curp = __apu_get_register(chip, chip->measure_apu, 5); in snd_es1968_interrupt()
1990 if (curp < chip->measure_lastpos) in snd_es1968_interrupt()
1991 chip->measure_count++; in snd_es1968_interrupt()
1992 chip->measure_lastpos = curp; in snd_es1968_interrupt()
2014 err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus); in snd_es1968_mixer()
2017 pbus->no_vra = 1; /* ES1968 doesn't need VRA */ in snd_es1968_mixer()
2021 err = snd_ac97_mixer(pbus, &ac97, &chip->ac97); in snd_es1968_mixer()
2027 chip->master_switch = snd_ctl_find_id_mixer(chip->card, in snd_es1968_mixer()
2029 chip->master_volume = snd_ctl_find_id_mixer(chip->card, in snd_es1968_mixer()
2042 unsigned long ioaddr = chip->io_port; in snd_es1968_ac97_reset()
2060 pci_read_config_word(chip->pci, 0x58, &w); /* something magical with gpio and bus arb. */ in snd_es1968_ac97_reset()
2061 pci_read_config_dword(chip->pci, PCI_SUBSYSTEM_VENDOR_ID, &vend); in snd_es1968_ac97_reset()
2091 dev_info(chip->card->dev, "trying software reset\n"); in snd_es1968_ac97_reset()
2149 chip->io_port + ESM_PORT_HOST_IRQ); in snd_es1968_reset()
2151 outw(0x0000, chip->io_port + ESM_PORT_HOST_IRQ); in snd_es1968_reset()
2160 struct pci_dev *pci = chip->pci; in snd_es1968_chip_init()
2162 unsigned long iobase = chip->io_port; in snd_es1968_chip_init()
2283 /* Write 0 into the buffer area 0x1E0->1EF */ in snd_es1968_chip_init()
2288 * 0x1D0-0x1DF too.*/ in snd_es1968_chip_init()
2320 /* Wave cache control on - test off, sg off, in snd_es1968_chip_init()
2353 if (chip->rmidi) in snd_es1968_start_irq()
2355 outb(w, chip->io_port + 0x1A); in snd_es1968_start_irq()
2356 outw(w, chip->io_port + ESM_PORT_HOST_IRQ); in snd_es1968_start_irq()
2366 struct es1968 *chip = card->private_data; in es1968_suspend()
2368 if (! chip->do_pm) in es1968_suspend()
2371 chip->in_suspend = 1; in es1968_suspend()
2372 cancel_work_sync(&chip->hwvol_work); in es1968_suspend()
2374 snd_ac97_suspend(chip->ac97); in es1968_suspend()
2382 struct es1968 *chip = card->private_data; in es1968_resume()
2385 if (! chip->do_pm) in es1968_resume()
2391 if (chip->dma.addr) { in es1968_resume()
2393 wave_set_register(chip, 0x01FC, chip->dma.addr >> 12); in es1968_resume()
2399 snd_ac97_resume(chip->ac97); in es1968_resume()
2401 list_for_each_entry(es, &chip->substream_list, list) { in es1968_resume()
2402 switch (es->mode) { in es1968_resume()
2404 snd_es1968_playback_setup(chip, es, es->substream->runtime); in es1968_resume()
2407 snd_es1968_capture_setup(chip, es, es->substream->runtime); in es1968_resume()
2413 if (chip->bobclient) in es1968_resume()
2417 chip->in_suspend = 0; in es1968_resume()
2436 return -ENODEV; in snd_es1968_create_gameport()
2438 r = devm_request_region(&chip->pci->dev, JOYSTICK_ADDR, 8, in snd_es1968_create_gameport()
2441 return -EBUSY; in snd_es1968_create_gameport()
2443 chip->gameport = gp = gameport_allocate_port(); in snd_es1968_create_gameport()
2445 dev_err(chip->card->dev, in snd_es1968_create_gameport()
2447 return -ENOMEM; in snd_es1968_create_gameport()
2450 pci_read_config_word(chip->pci, ESM_LEGACY_AUDIO_CONTROL, &val); in snd_es1968_create_gameport()
2451 pci_write_config_word(chip->pci, ESM_LEGACY_AUDIO_CONTROL, val | 0x04); in snd_es1968_create_gameport()
2454 gameport_set_phys(gp, "pci%s/gameport0", pci_name(chip->pci)); in snd_es1968_create_gameport()
2455 gameport_set_dev_parent(gp, &chip->pci->dev); in snd_es1968_create_gameport()
2456 gp->io = JOYSTICK_ADDR; in snd_es1968_create_gameport()
2465 if (chip->gameport) { in snd_es1968_free_gameport()
2466 gameport_unregister_port(chip->gameport); in snd_es1968_free_gameport()
2467 chip->gameport = NULL; in snd_es1968_free_gameport()
2471 static inline int snd_es1968_create_gameport(struct es1968 *chip, int dev) { return -ENOSYS; } in snd_es1968_create_gameport()
2481 input_dev = devm_input_allocate_device(&chip->pci->dev); in snd_es1968_input_register()
2483 return -ENOMEM; in snd_es1968_input_register()
2485 snprintf(chip->phys, sizeof(chip->phys), "pci-%s/input0", in snd_es1968_input_register()
2486 pci_name(chip->pci)); in snd_es1968_input_register()
2488 input_dev->name = chip->card->driver; in snd_es1968_input_register()
2489 input_dev->phys = chip->phys; in snd_es1968_input_register()
2490 input_dev->id.bustype = BUS_PCI; in snd_es1968_input_register()
2491 input_dev->id.vendor = chip->pci->vendor; in snd_es1968_input_register()
2492 input_dev->id.product = chip->pci->device; in snd_es1968_input_register()
2493 input_dev->dev.parent = &chip->pci->dev; in snd_es1968_input_register()
2495 __set_bit(EV_KEY, input_dev->evbit); in snd_es1968_input_register()
2496 __set_bit(KEY_MUTE, input_dev->keybit); in snd_es1968_input_register()
2497 __set_bit(KEY_VOLUMEDOWN, input_dev->keybit); in snd_es1968_input_register()
2498 __set_bit(KEY_VOLUMEUP, input_dev->keybit); in snd_es1968_input_register()
2504 chip->input_dev = input_dev; in snd_es1968_input_register()
2523 { .data = 6, .clk = 7, .wren = 8, .most = 9, .name = "SF64-PCE2" },
2528 (&snd_es1968_tea575x_gpios[(chip)->tea575x_tuner])
2531 static void snd_es1968_tea575x_set_pins(struct snd_tea575x *tea, u8 pins) in snd_es1968_tea575x_set_pins() argument
2533 struct es1968 *chip = tea->private_data; in snd_es1968_tea575x_set_pins()
2537 val |= (pins & TEA575X_DATA) ? (1 << gpio.data) : 0; in snd_es1968_tea575x_set_pins()
2538 val |= (pins & TEA575X_CLK) ? (1 << gpio.clk) : 0; in snd_es1968_tea575x_set_pins()
2539 val |= (pins & TEA575X_WREN) ? (1 << gpio.wren) : 0; in snd_es1968_tea575x_set_pins()
2541 outw(val, chip->io_port + GPIO_DATA); in snd_es1968_tea575x_set_pins()
2546 struct es1968 *chip = tea->private_data; in snd_es1968_tea575x_get_pins()
2548 u16 val = inw(chip->io_port + GPIO_DATA); in snd_es1968_tea575x_get_pins()
2561 struct es1968 *chip = tea->private_data; in snd_es1968_tea575x_set_direction()
2562 unsigned long io = chip->io_port + GPIO_DATA; in snd_es1968_tea575x_set_direction()
2588 struct es1968 *chip = card->private_data; in snd_es1968_free()
2590 cancel_work_sync(&chip->hwvol_work); in snd_es1968_free()
2592 if (chip->io_port) { in snd_es1968_free()
2593 outw(1, chip->io_port + 0x04); /* clear WP interrupts */ in snd_es1968_free()
2594 outw(0, chip->io_port + ESM_PORT_HOST_IRQ); /* disable IRQ */ in snd_es1968_free()
2598 snd_tea575x_exit(&chip->tea); in snd_es1968_free()
2599 v4l2_device_unregister(&chip->v4l2_dev); in snd_es1968_free()
2618 { TYPE_MAESTRO2, 0x125d }, /* a PCI card, e.g. SF64-PCE2 */
2634 struct es1968 *chip = card->private_data; in snd_es1968_create()
2642 if (dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(28))) { in snd_es1968_create()
2643 dev_err(card->dev, in snd_es1968_create()
2645 return -ENXIO; in snd_es1968_create()
2649 chip->type = chip_type; in snd_es1968_create()
2650 spin_lock_init(&chip->reg_lock); in snd_es1968_create()
2651 spin_lock_init(&chip->substream_lock); in snd_es1968_create()
2652 INIT_LIST_HEAD(&chip->buf_list); in snd_es1968_create()
2653 INIT_LIST_HEAD(&chip->substream_list); in snd_es1968_create()
2654 mutex_init(&chip->memory_mutex); in snd_es1968_create()
2655 INIT_WORK(&chip->hwvol_work, es1968_update_hw_volume); in snd_es1968_create()
2656 chip->card = card; in snd_es1968_create()
2657 chip->pci = pci; in snd_es1968_create()
2658 chip->irq = -1; in snd_es1968_create()
2659 chip->total_bufsize = total_bufsize; /* in bytes */ in snd_es1968_create()
2660 chip->playback_streams = play_streams; in snd_es1968_create()
2661 chip->capture_streams = capt_streams; in snd_es1968_create()
2666 chip->io_port = pci_resource_start(pci, 0); in snd_es1968_create()
2667 if (devm_request_irq(&pci->dev, pci->irq, snd_es1968_interrupt, in snd_es1968_create()
2669 dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq); in snd_es1968_create()
2670 return -EBUSY; in snd_es1968_create()
2672 chip->irq = pci->irq; in snd_es1968_create()
2673 card->sync_irq = chip->irq; in snd_es1968_create()
2674 card->private_free = snd_es1968_free; in snd_es1968_create()
2678 chip->maestro_map[i] = 0; in snd_es1968_create()
2682 chip->apu[i] = ESM_APU_FREE; in snd_es1968_create()
2688 /* disable power-management if not on the allowlist */ in snd_es1968_create()
2690 pci_read_config_word(chip->pci, PCI_SUBSYSTEM_VENDOR_ID, &vend); in snd_es1968_create()
2692 if (chip->type == pm_allowlist[i].type && in snd_es1968_create()
2700 dev_info(card->dev, "not attempting power management.\n"); in snd_es1968_create()
2704 chip->do_pm = do_pm; in snd_es1968_create()
2710 if (chip->pci->subsystem_vendor != 0x125d) in snd_es1968_create()
2712 err = v4l2_device_register(&pci->dev, &chip->v4l2_dev); in snd_es1968_create()
2715 chip->tea.v4l2_dev = &chip->v4l2_dev; in snd_es1968_create()
2716 chip->tea.private_data = chip; in snd_es1968_create()
2717 chip->tea.radio_nr = radio_nr; in snd_es1968_create()
2718 chip->tea.ops = &snd_es1968_tea_ops; in snd_es1968_create()
2719 sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci)); in snd_es1968_create()
2721 chip->tea575x_tuner = i; in snd_es1968_create()
2722 if (!snd_tea575x_init(&chip->tea, THIS_MODULE)) { in snd_es1968_create()
2723 dev_info(card->dev, "detected TEA575x radio type %s\n", in snd_es1968_create()
2724 get_tea575x_gpio(chip)->name); in snd_es1968_create()
2725 strscpy(chip->tea.card, get_tea575x_gpio(chip)->name, in snd_es1968_create()
2726 sizeof(chip->tea.card)); in snd_es1968_create()
2747 return -ENODEV; in __snd_es1968_probe()
2750 return -ENOENT; in __snd_es1968_probe()
2753 err = snd_devm_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, in __snd_es1968_probe()
2757 chip = card->private_data; in __snd_es1968_probe()
2767 pci_id->driver_data, in __snd_es1968_probe()
2773 switch (chip->type) { in __snd_es1968_probe()
2775 strcpy(card->driver, "ES1978"); in __snd_es1968_probe()
2776 strcpy(card->shortname, "ESS ES1978 (Maestro 2E)"); in __snd_es1968_probe()
2779 strcpy(card->driver, "ES1968"); in __snd_es1968_probe()
2780 strcpy(card->shortname, "ESS ES1968 (Maestro 2)"); in __snd_es1968_probe()
2783 strcpy(card->driver, "ESM1"); in __snd_es1968_probe()
2784 strcpy(card->shortname, "ESS Maestro 1"); in __snd_es1968_probe()
2799 pci_read_config_word(chip->pci, PCI_SUBSYSTEM_VENDOR_ID, &vend); in __snd_es1968_probe()
2801 if (chip->type == mpu_denylist[i].type && in __snd_es1968_probe()
2810 chip->io_port + ESM_MPU401_PORT, in __snd_es1968_probe()
2813 -1, &chip->rmidi); in __snd_es1968_probe()
2815 dev_warn(card->dev, "skipping MPU-401 MIDI support..\n"); in __snd_es1968_probe()
2823 dev_warn(card->dev, in __snd_es1968_probe()
2829 chip->clock = clock[dev]; in __snd_es1968_probe()
2830 if (! chip->clock) in __snd_es1968_probe()
2833 sprintf(card->longname, "%s at 0x%lx, irq %i", in __snd_es1968_probe()
2834 card->shortname, chip->io_port, chip->irq); in __snd_es1968_probe()
2847 return snd_card_free_on_error(&pci->dev, __snd_es1968_probe(pci, pci_id)); in snd_es1968_probe()