Lines Matching +full:idma +full:- +full:addr
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? */
502 int do_pm; /* power-management enabled */
570 outw(reg, chip->io_port + ESM_INDEX); in __maestro_write()
571 outw(data, chip->io_port + ESM_DATA); in __maestro_write()
572 chip->maestro_map[reg] = data; in __maestro_write()
578 spin_lock_irqsave(&chip->reg_lock, flags); in maestro_write()
580 spin_unlock_irqrestore(&chip->reg_lock, flags); in maestro_write()
587 outw(reg, chip->io_port + ESM_INDEX); in __maestro_read()
588 chip->maestro_map[reg] = inw(chip->io_port + ESM_DATA); in __maestro_read()
590 return chip->maestro_map[reg]; in __maestro_read()
597 spin_lock_irqsave(&chip->reg_lock, flags); in maestro_read()
599 spin_unlock_irqrestore(&chip->reg_lock, flags); in maestro_read()
608 while (timeout-- > 0) { in snd_es1968_ac97_wait()
609 if (!(inb(chip->io_port + ESM_AC97_INDEX) & 1)) in snd_es1968_ac97_wait()
613 dev_dbg(chip->card->dev, "ac97 timeout\n"); in snd_es1968_ac97_wait()
621 while (timeout-- > 0) { in snd_es1968_ac97_wait_poll()
622 if (!(inb(chip->io_port + ESM_AC97_INDEX) & 1)) in snd_es1968_ac97_wait_poll()
625 dev_dbg(chip->card->dev, "ac97 timeout\n"); in snd_es1968_ac97_wait_poll()
631 struct es1968 *chip = ac97->private_data; in snd_es1968_ac97_write()
636 outw(val, chip->io_port + ESM_AC97_DATA); in snd_es1968_ac97_write()
638 outb(reg, chip->io_port + ESM_AC97_INDEX); in snd_es1968_ac97_write()
645 struct es1968 *chip = ac97->private_data; in snd_es1968_ac97_read()
649 outb(reg | 0x80, chip->io_port + ESM_AC97_INDEX); in snd_es1968_ac97_read()
653 data = inw(chip->io_port + ESM_AC97_DATA); in snd_es1968_ac97_read()
668 dev_dbg(chip->card->dev, "APU register select failed. (Timeout)\n"); in apu_index_set()
680 dev_dbg(chip->card->dev, "APU register set probably failed (Timeout)!\n"); in apu_data_set()
688 chip->apu_map[channel][reg] = data; in __apu_set_register()
697 spin_lock_irqsave(&chip->reg_lock, flags); in apu_set_register()
699 spin_unlock_irqrestore(&chip->reg_lock, flags); in apu_set_register()
715 spin_lock_irqsave(&chip->reg_lock, flags); in apu_get_register()
717 spin_unlock_irqrestore(&chip->reg_lock, flags); in apu_get_register()
727 spin_lock_irqsave(&chip->reg_lock, flags);
728 outl(reg, chip->io_port + ASSP_INDEX);
729 outl(value, chip->io_port + ASSP_DATA);
730 spin_unlock_irqrestore(&chip->reg_lock, flags);
738 spin_lock_irqsave(&chip->reg_lock, flags);
739 outl(reg, chip->io_port + ASSP_INDEX);
740 value = inl(chip->io_port + ASSP_DATA);
741 spin_unlock_irqrestore(&chip->reg_lock, flags);
752 spin_lock_irqsave(&chip->reg_lock, flags); in wave_set_register()
753 outw(reg, chip->io_port + WC_INDEX); in wave_set_register()
754 outw(value, chip->io_port + WC_DATA); in wave_set_register()
755 spin_unlock_irqrestore(&chip->reg_lock, flags); in wave_set_register()
763 spin_lock_irqsave(&chip->reg_lock, flags); in wave_get_register()
764 outw(reg, chip->io_port + WC_INDEX); in wave_get_register()
765 value = inw(chip->io_port + WC_DATA); in wave_get_register()
766 spin_unlock_irqrestore(&chip->reg_lock, flags); in wave_get_register()
795 if (chip->bob_freq > (ESS_SYSCLK >> (prescale + 9))) in snd_es1968_bob_start()
801 prescale--; in snd_es1968_bob_start()
806 /* now fine-tune the divider for best match */ in snd_es1968_bob_start()
808 if (chip->bob_freq > in snd_es1968_bob_start()
815 prescale--; in snd_es1968_bob_start()
817 divide--; in snd_es1968_bob_start()
829 chip->bobclient++; in snd_es1968_bob_inc()
830 if (chip->bobclient == 1) { in snd_es1968_bob_inc()
831 chip->bob_freq = freq; in snd_es1968_bob_inc()
833 } else if (chip->bob_freq < freq) { in snd_es1968_bob_inc()
835 chip->bob_freq = freq; in snd_es1968_bob_inc()
843 chip->bobclient--; in snd_es1968_bob_dec()
844 if (chip->bobclient <= 0) in snd_es1968_bob_dec()
846 else if (chip->bob_freq > ESM_BOB_FREQ) { in snd_es1968_bob_dec()
850 list_for_each_entry(es, &chip->substream_list, list) { in snd_es1968_bob_dec()
851 if (max_freq < es->bob_freq) in snd_es1968_bob_dec()
852 max_freq = es->bob_freq; in snd_es1968_bob_dec()
854 if (max_freq != chip->bob_freq) { in snd_es1968_bob_dec()
856 chip->bob_freq = max_freq; in snd_es1968_bob_dec()
867 int freq = runtime->rate * 4; in snd_es1968_calc_bob_rate()
868 if (es->fmt & ESS_FMT_STEREO) in snd_es1968_calc_bob_rate()
870 if (es->fmt & ESS_FMT_16BIT) in snd_es1968_calc_bob_rate()
872 freq /= es->frag_size; in snd_es1968_calc_bob_rate()
887 u32 rate = (freq << 16) / chip->clock; in snd_es1968_compute_rate()
901 offset = apu_get_register(chip, es->apu[0], 5); in snd_es1968_get_dma_ptr()
903 offset -= es->base[0]; in snd_es1968_get_dma_ptr()
927 spin_lock(&chip->reg_lock); in snd_es1968_pcm_start()
928 __apu_set_register(chip, es->apu[0], 5, es->base[0]); in snd_es1968_pcm_start()
929 snd_es1968_trigger_apu(chip, es->apu[0], es->apu_mode[0]); in snd_es1968_pcm_start()
930 if (es->mode == ESM_MODE_CAPTURE) { in snd_es1968_pcm_start()
931 __apu_set_register(chip, es->apu[2], 5, es->base[2]); in snd_es1968_pcm_start()
932 snd_es1968_trigger_apu(chip, es->apu[2], es->apu_mode[2]); in snd_es1968_pcm_start()
934 if (es->fmt & ESS_FMT_STEREO) { in snd_es1968_pcm_start()
935 __apu_set_register(chip, es->apu[1], 5, es->base[1]); in snd_es1968_pcm_start()
936 snd_es1968_trigger_apu(chip, es->apu[1], es->apu_mode[1]); in snd_es1968_pcm_start()
937 if (es->mode == ESM_MODE_CAPTURE) { in snd_es1968_pcm_start()
938 __apu_set_register(chip, es->apu[3], 5, es->base[3]); in snd_es1968_pcm_start()
939 snd_es1968_trigger_apu(chip, es->apu[3], es->apu_mode[3]); in snd_es1968_pcm_start()
942 spin_unlock(&chip->reg_lock); in snd_es1968_pcm_start()
947 spin_lock(&chip->reg_lock); in snd_es1968_pcm_stop()
948 snd_es1968_trigger_apu(chip, es->apu[0], 0); in snd_es1968_pcm_stop()
949 snd_es1968_trigger_apu(chip, es->apu[1], 0); in snd_es1968_pcm_stop()
950 if (es->mode == ESM_MODE_CAPTURE) { in snd_es1968_pcm_stop()
951 snd_es1968_trigger_apu(chip, es->apu[2], 0); in snd_es1968_pcm_stop()
952 snd_es1968_trigger_apu(chip, es->apu[3], 0); in snd_es1968_pcm_stop()
954 spin_unlock(&chip->reg_lock); in snd_es1968_pcm_stop()
959 int channel, u32 addr, int capture) in snd_es1968_program_wavecache() argument
961 u32 tmpval = (addr - 0x10) & 0xFFF8; in snd_es1968_program_wavecache()
964 if (!(es->fmt & ESS_FMT_16BIT)) in snd_es1968_program_wavecache()
966 if (es->fmt & ESS_FMT_STEREO) in snd_es1968_program_wavecache()
971 wave_set_register(chip, es->apu[channel] << 3, tmpval); in snd_es1968_program_wavecache()
973 es->wc_map[channel] = tmpval; in snd_es1968_program_wavecache()
987 size = es->dma_size >> es->wav_shift; in snd_es1968_playback_setup()
989 if (es->fmt & ESS_FMT_STEREO) in snd_es1968_playback_setup()
993 apu = es->apu[channel]; in snd_es1968_playback_setup()
995 snd_es1968_program_wavecache(chip, es, channel, es->memory->buf.addr, 0); in snd_es1968_playback_setup()
998 pa = es->memory->buf.addr; in snd_es1968_playback_setup()
999 pa -= chip->dma.addr; in snd_es1968_playback_setup()
1004 if (es->fmt & ESS_FMT_STEREO) { in snd_es1968_playback_setup()
1008 if (es->fmt & ESS_FMT_16BIT) in snd_es1968_playback_setup()
1014 es->base[channel] = pa & 0xFFFF; in snd_es1968_playback_setup()
1036 if (es->fmt & ESS_FMT_16BIT) in snd_es1968_playback_setup()
1037 es->apu_mode[channel] = ESM_APU_16BITLINEAR; in snd_es1968_playback_setup()
1039 es->apu_mode[channel] = ESM_APU_8BITLINEAR; in snd_es1968_playback_setup()
1041 if (es->fmt & ESS_FMT_STEREO) { in snd_es1968_playback_setup()
1046 and not the APU Regs 4-5. */ in snd_es1968_playback_setup()
1049 es->apu_mode[channel] += 1; /* stereo */ in snd_es1968_playback_setup()
1054 spin_lock_irqsave(&chip->reg_lock, flags); in snd_es1968_playback_setup()
1056 outw(1, chip->io_port + 0x04); in snd_es1968_playback_setup()
1058 outw(inw(chip->io_port + ESM_PORT_HOST_IRQ) | ESM_HIRQ_DSIE, chip->io_port + ESM_PORT_HOST_IRQ); in snd_es1968_playback_setup()
1059 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1968_playback_setup()
1061 freq = runtime->rate; in snd_es1968_playback_setup()
1069 if (!(es->fmt & ESS_FMT_16BIT) && !(es->fmt & ESS_FMT_STEREO)) in snd_es1968_playback_setup()
1075 snd_es1968_apu_set_freq(chip, es->apu[0], freq); in snd_es1968_playback_setup()
1076 snd_es1968_apu_set_freq(chip, es->apu[1], freq); in snd_es1968_playback_setup()
1084 int i, apu = es->apu[channel]; in init_capture_apu()
1086 es->apu_mode[channel] = mode; in init_capture_apu()
1092 pa -= chip->dma.addr; in init_capture_apu()
1097 es->base[channel] = pa & 0xFFFF; in init_capture_apu()
1098 pa |= 0x00400000; /* bit 22 -> System RAM */ in init_capture_apu()
1132 size = es->dma_size >> es->wav_shift; in snd_es1968_capture_setup()
1145 /* parallel in crap, see maestro reg 0xC [8-11] */ in snd_es1968_capture_setup()
1147 es->mixbuf->buf.addr, ESM_MIXBUF_SIZE/4, /* in words */ in snd_es1968_capture_setup()
1150 init_capture_apu(chip, es, 0, es->memory->buf.addr, size, in snd_es1968_capture_setup()
1151 ESM_APU_SRCONVERTOR, es->apu[2]); in snd_es1968_capture_setup()
1152 if (es->fmt & ESS_FMT_STEREO) { in snd_es1968_capture_setup()
1155 es->mixbuf->buf.addr + ESM_MIXBUF_SIZE/2, in snd_es1968_capture_setup()
1160 es->memory->buf.addr + size*2, size, in snd_es1968_capture_setup()
1161 ESM_APU_SRCONVERTOR, es->apu[3]); in snd_es1968_capture_setup()
1164 freq = runtime->rate; in snd_es1968_capture_setup()
1174 snd_es1968_apu_set_freq(chip, es->apu[0], freq); in snd_es1968_capture_setup()
1175 snd_es1968_apu_set_freq(chip, es->apu[1], freq); in snd_es1968_capture_setup()
1179 snd_es1968_apu_set_freq(chip, es->apu[2], freq); in snd_es1968_capture_setup()
1180 snd_es1968_apu_set_freq(chip, es->apu[3], freq); in snd_es1968_capture_setup()
1182 spin_lock_irqsave(&chip->reg_lock, flags); in snd_es1968_capture_setup()
1184 outw(1, chip->io_port + 0x04); in snd_es1968_capture_setup()
1186 outw(inw(chip->io_port + ESM_PORT_HOST_IRQ) | ESM_HIRQ_DSIE, chip->io_port + ESM_PORT_HOST_IRQ); in snd_es1968_capture_setup()
1187 spin_unlock_irqrestore(&chip->reg_lock, flags); in snd_es1968_capture_setup()
1197 struct snd_pcm_runtime *runtime = substream->runtime; in snd_es1968_pcm_prepare()
1198 struct esschan *es = runtime->private_data; in snd_es1968_pcm_prepare()
1200 es->dma_size = snd_pcm_lib_buffer_bytes(substream); in snd_es1968_pcm_prepare()
1201 es->frag_size = snd_pcm_lib_period_bytes(substream); in snd_es1968_pcm_prepare()
1203 es->wav_shift = 1; /* maestro handles always 16bit */ in snd_es1968_pcm_prepare()
1204 es->fmt = 0; in snd_es1968_pcm_prepare()
1205 if (snd_pcm_format_width(runtime->format) == 16) in snd_es1968_pcm_prepare()
1206 es->fmt |= ESS_FMT_16BIT; in snd_es1968_pcm_prepare()
1207 if (runtime->channels > 1) { in snd_es1968_pcm_prepare()
1208 es->fmt |= ESS_FMT_STEREO; in snd_es1968_pcm_prepare()
1209 if (es->fmt & ESS_FMT_16BIT) /* 8bit is already word shifted */ in snd_es1968_pcm_prepare()
1210 es->wav_shift++; in snd_es1968_pcm_prepare()
1212 es->bob_freq = snd_es1968_calc_bob_rate(chip, es, runtime); in snd_es1968_pcm_prepare()
1214 switch (es->mode) { in snd_es1968_pcm_prepare()
1229 struct esschan *es = substream->runtime->private_data; in snd_es1968_pcm_trigger()
1231 spin_lock(&chip->substream_lock); in snd_es1968_pcm_trigger()
1235 if (es->running) in snd_es1968_pcm_trigger()
1237 snd_es1968_bob_inc(chip, es->bob_freq); in snd_es1968_pcm_trigger()
1238 es->count = 0; in snd_es1968_pcm_trigger()
1239 es->hwptr = 0; in snd_es1968_pcm_trigger()
1241 es->running = 1; in snd_es1968_pcm_trigger()
1245 if (! es->running) in snd_es1968_pcm_trigger()
1248 es->running = 0; in snd_es1968_pcm_trigger()
1252 spin_unlock(&chip->substream_lock); in snd_es1968_pcm_trigger()
1259 struct esschan *es = substream->runtime->private_data; in snd_es1968_pcm_pointer()
1262 ptr = snd_es1968_get_dma_ptr(chip, es) << es->wav_shift; in snd_es1968_pcm_pointer()
1264 return bytes_to_frames(substream->runtime, ptr % es->dma_size); in snd_es1968_pcm_pointer()
1321 mutex_lock(&chip->memory_mutex); in calc_available_memory_size()
1322 list_for_each_entry(buf, &chip->buf_list, list) { in calc_available_memory_size()
1323 if (buf->empty && buf->buf.bytes > max_size) in calc_available_memory_size()
1324 max_size = buf->buf.bytes; in calc_available_memory_size()
1326 mutex_unlock(&chip->memory_mutex); in calc_available_memory_size()
1338 mutex_lock(&chip->memory_mutex); in snd_es1968_new_memory()
1339 list_for_each_entry(buf, &chip->buf_list, list) { in snd_es1968_new_memory()
1340 if (buf->empty && buf->buf.bytes >= size) in snd_es1968_new_memory()
1343 mutex_unlock(&chip->memory_mutex); in snd_es1968_new_memory()
1347 if (buf->buf.bytes > size) { in snd_es1968_new_memory()
1350 mutex_unlock(&chip->memory_mutex); in snd_es1968_new_memory()
1353 chunk->buf = buf->buf; in snd_es1968_new_memory()
1354 chunk->buf.bytes -= size; in snd_es1968_new_memory()
1355 chunk->buf.area += size; in snd_es1968_new_memory()
1356 chunk->buf.addr += size; in snd_es1968_new_memory()
1357 chunk->empty = 1; in snd_es1968_new_memory()
1358 buf->buf.bytes = size; in snd_es1968_new_memory()
1359 list_add(&chunk->list, &buf->list); in snd_es1968_new_memory()
1361 buf->empty = 0; in snd_es1968_new_memory()
1362 mutex_unlock(&chip->memory_mutex); in snd_es1968_new_memory()
1371 mutex_lock(&chip->memory_mutex); in snd_es1968_free_memory()
1372 buf->empty = 1; in snd_es1968_free_memory()
1373 if (buf->list.prev != &chip->buf_list) { in snd_es1968_free_memory()
1374 chunk = list_entry(buf->list.prev, struct esm_memory, list); in snd_es1968_free_memory()
1375 if (chunk->empty) { in snd_es1968_free_memory()
1376 chunk->buf.bytes += buf->buf.bytes; in snd_es1968_free_memory()
1377 list_del(&buf->list); in snd_es1968_free_memory()
1382 if (buf->list.next != &chip->buf_list) { in snd_es1968_free_memory()
1383 chunk = list_entry(buf->list.next, struct esm_memory, list); in snd_es1968_free_memory()
1384 if (chunk->empty) { in snd_es1968_free_memory()
1385 buf->buf.bytes += chunk->buf.bytes; in snd_es1968_free_memory()
1386 list_del(&chunk->list); in snd_es1968_free_memory()
1390 mutex_unlock(&chip->memory_mutex); in snd_es1968_free_memory()
1397 if (! chip->dma.area) in snd_es1968_free_dmabuf()
1399 snd_dma_free_pages(&chip->dma); in snd_es1968_free_dmabuf()
1400 while ((p = chip->buf_list.next) != &chip->buf_list) { in snd_es1968_free_dmabuf()
1414 &chip->pci->dev, in snd_es1968_init_dmabuf()
1415 chip->total_bufsize, &chip->dma); in snd_es1968_init_dmabuf()
1416 if (err < 0 || ! chip->dma.area) { in snd_es1968_init_dmabuf()
1417 dev_err(chip->card->dev, in snd_es1968_init_dmabuf()
1419 chip->total_bufsize); in snd_es1968_init_dmabuf()
1420 return -ENOMEM; in snd_es1968_init_dmabuf()
1422 if ((chip->dma.addr + chip->dma.bytes - 1) & ~((1 << 28) - 1)) { in snd_es1968_init_dmabuf()
1423 snd_dma_free_pages(&chip->dma); in snd_es1968_init_dmabuf()
1424 dev_err(chip->card->dev, "DMA buffer beyond 256MB.\n"); in snd_es1968_init_dmabuf()
1425 return -ENOMEM; in snd_es1968_init_dmabuf()
1428 INIT_LIST_HEAD(&chip->buf_list); in snd_es1968_init_dmabuf()
1433 return -ENOMEM; in snd_es1968_init_dmabuf()
1435 memset(chip->dma.area, 0, ESM_MEM_ALIGN); in snd_es1968_init_dmabuf()
1436 chunk->buf = chip->dma; in snd_es1968_init_dmabuf()
1437 chunk->buf.area += ESM_MEM_ALIGN; in snd_es1968_init_dmabuf()
1438 chunk->buf.addr += ESM_MEM_ALIGN; in snd_es1968_init_dmabuf()
1439 chunk->buf.bytes -= ESM_MEM_ALIGN; in snd_es1968_init_dmabuf()
1440 chunk->empty = 1; in snd_es1968_init_dmabuf()
1441 list_add(&chunk->list, &chip->buf_list); in snd_es1968_init_dmabuf()
1447 /* buffer is extracted from the pre-allocated memory chunk */
1452 struct snd_pcm_runtime *runtime = substream->runtime; in snd_es1968_hw_params()
1453 struct esschan *chan = runtime->private_data; in snd_es1968_hw_params()
1456 if (chan->memory) { in snd_es1968_hw_params()
1457 if (chan->memory->buf.bytes >= size) { in snd_es1968_hw_params()
1458 runtime->dma_bytes = size; in snd_es1968_hw_params()
1461 snd_es1968_free_memory(chip, chan->memory); in snd_es1968_hw_params()
1463 chan->memory = snd_es1968_new_memory(chip, size); in snd_es1968_hw_params()
1464 if (chan->memory == NULL) { in snd_es1968_hw_params()
1465 dev_dbg(chip->card->dev, in snd_es1968_hw_params()
1467 return -ENOMEM; in snd_es1968_hw_params()
1469 snd_pcm_set_runtime_buffer(substream, &chan->memory->buf); in snd_es1968_hw_params()
1477 struct snd_pcm_runtime *runtime = substream->runtime; in snd_es1968_hw_free()
1480 if (runtime->private_data == NULL) in snd_es1968_hw_free()
1482 chan = runtime->private_data; in snd_es1968_hw_free()
1483 if (chan->memory) { in snd_es1968_hw_free()
1484 snd_es1968_free_memory(chip, chan->memory); in snd_es1968_hw_free()
1485 chan->memory = NULL; in snd_es1968_hw_free()
1499 if (chip->apu[apu] == ESM_APU_FREE && in snd_es1968_alloc_apu_pair()
1500 chip->apu[apu + 1] == ESM_APU_FREE) { in snd_es1968_alloc_apu_pair()
1501 chip->apu[apu] = chip->apu[apu + 1] = type; in snd_es1968_alloc_apu_pair()
1505 return -EBUSY; in snd_es1968_alloc_apu_pair()
1513 chip->apu[apu] = chip->apu[apu + 1] = ESM_APU_FREE; in snd_es1968_free_apu_pair()
1524 struct snd_pcm_runtime *runtime = substream->runtime; in snd_es1968_playback_open()
1536 return -ENOMEM; in snd_es1968_playback_open()
1539 es->apu[0] = apu1; in snd_es1968_playback_open()
1540 es->apu[1] = apu1 + 1; in snd_es1968_playback_open()
1541 es->apu_mode[0] = 0; in snd_es1968_playback_open()
1542 es->apu_mode[1] = 0; in snd_es1968_playback_open()
1543 es->running = 0; in snd_es1968_playback_open()
1544 es->substream = substream; in snd_es1968_playback_open()
1545 es->mode = ESM_MODE_PLAY; in snd_es1968_playback_open()
1547 runtime->private_data = es; in snd_es1968_playback_open()
1548 runtime->hw = snd_es1968_playback; in snd_es1968_playback_open()
1549 runtime->hw.buffer_bytes_max = runtime->hw.period_bytes_max = in snd_es1968_playback_open()
1552 spin_lock_irq(&chip->substream_lock); in snd_es1968_playback_open()
1553 list_add(&es->list, &chip->substream_list); in snd_es1968_playback_open()
1554 spin_unlock_irq(&chip->substream_lock); in snd_es1968_playback_open()
1561 struct snd_pcm_runtime *runtime = substream->runtime; in snd_es1968_capture_open()
1579 return -ENOMEM; in snd_es1968_capture_open()
1582 es->apu[0] = apu1; in snd_es1968_capture_open()
1583 es->apu[1] = apu1 + 1; in snd_es1968_capture_open()
1584 es->apu[2] = apu2; in snd_es1968_capture_open()
1585 es->apu[3] = apu2 + 1; in snd_es1968_capture_open()
1586 es->apu_mode[0] = 0; in snd_es1968_capture_open()
1587 es->apu_mode[1] = 0; in snd_es1968_capture_open()
1588 es->apu_mode[2] = 0; in snd_es1968_capture_open()
1589 es->apu_mode[3] = 0; in snd_es1968_capture_open()
1590 es->running = 0; in snd_es1968_capture_open()
1591 es->substream = substream; in snd_es1968_capture_open()
1592 es->mode = ESM_MODE_CAPTURE; in snd_es1968_capture_open()
1595 es->mixbuf = snd_es1968_new_memory(chip, ESM_MIXBUF_SIZE); in snd_es1968_capture_open()
1596 if (!es->mixbuf) { in snd_es1968_capture_open()
1600 return -ENOMEM; in snd_es1968_capture_open()
1602 memset(es->mixbuf->buf.area, 0, ESM_MIXBUF_SIZE); in snd_es1968_capture_open()
1604 runtime->private_data = es; in snd_es1968_capture_open()
1605 runtime->hw = snd_es1968_capture; in snd_es1968_capture_open()
1606 runtime->hw.buffer_bytes_max = runtime->hw.period_bytes_max = in snd_es1968_capture_open()
1607 calc_available_memory_size(chip) - 1024; /* keep MIXBUF size */ in snd_es1968_capture_open()
1610 spin_lock_irq(&chip->substream_lock); in snd_es1968_capture_open()
1611 list_add(&es->list, &chip->substream_list); in snd_es1968_capture_open()
1612 spin_unlock_irq(&chip->substream_lock); in snd_es1968_capture_open()
1622 if (substream->runtime->private_data == NULL) in snd_es1968_playback_close()
1624 es = substream->runtime->private_data; in snd_es1968_playback_close()
1625 spin_lock_irq(&chip->substream_lock); in snd_es1968_playback_close()
1626 list_del(&es->list); in snd_es1968_playback_close()
1627 spin_unlock_irq(&chip->substream_lock); in snd_es1968_playback_close()
1628 snd_es1968_free_apu_pair(chip, es->apu[0]); in snd_es1968_playback_close()
1639 if (substream->runtime->private_data == NULL) in snd_es1968_capture_close()
1641 es = substream->runtime->private_data; in snd_es1968_capture_close()
1642 spin_lock_irq(&chip->substream_lock); in snd_es1968_capture_close()
1643 list_del(&es->list); in snd_es1968_capture_close()
1644 spin_unlock_irq(&chip->substream_lock); in snd_es1968_capture_close()
1645 snd_es1968_free_memory(chip, es->mixbuf); in snd_es1968_capture_close()
1646 snd_es1968_free_apu_pair(chip, es->apu[0]); in snd_es1968_capture_close()
1647 snd_es1968_free_apu_pair(chip, es->apu[2]); in snd_es1968_capture_close()
1687 if (chip->clock == 0) in es1968_measure_clock()
1688 chip->clock = 48000; /* default clock value */ in es1968_measure_clock()
1693 dev_err(chip->card->dev, "Hmm, cannot find empty APU pair!?\n"); in es1968_measure_clock()
1698 dev_warn(chip->card->dev, in es1968_measure_clock()
1699 "cannot allocate dma buffer - using default clock %d\n", in es1968_measure_clock()
1700 chip->clock); in es1968_measure_clock()
1705 memset(memory->buf.area, 0, CLOCK_MEASURE_BUFSIZE); in es1968_measure_clock()
1707 wave_set_register(chip, apu << 3, (memory->buf.addr - 0x10) & 0xfff8); in es1968_measure_clock()
1709 pa = (unsigned int)((memory->buf.addr - chip->dma.addr) >> 1); in es1968_measure_clock()
1725 spin_lock_irq(&chip->reg_lock); in es1968_measure_clock()
1726 outw(1, chip->io_port + 0x04); /* clear WP interrupts */ in es1968_measure_clock()
1727 …outw(inw(chip->io_port + ESM_PORT_HOST_IRQ) | ESM_HIRQ_DSIE, chip->io_port + ESM_PORT_HOST_IRQ); /… in es1968_measure_clock()
1728 spin_unlock_irq(&chip->reg_lock); in es1968_measure_clock()
1730 snd_es1968_apu_set_freq(chip, apu, ((unsigned int)48000 << 16) / chip->clock); /* 48000 Hz */ in es1968_measure_clock()
1732 chip->in_measurement = 1; in es1968_measure_clock()
1733 chip->measure_apu = apu; in es1968_measure_clock()
1734 spin_lock_irq(&chip->reg_lock); in es1968_measure_clock()
1739 spin_unlock_irq(&chip->reg_lock); in es1968_measure_clock()
1741 spin_lock_irq(&chip->reg_lock); in es1968_measure_clock()
1746 chip->in_measurement = 0; in es1968_measure_clock()
1747 spin_unlock_irq(&chip->reg_lock); in es1968_measure_clock()
1750 offset -= (pa & 0xffff); in es1968_measure_clock()
1752 offset += chip->measure_count * (CLOCK_MEASURE_BUFSIZE/2); in es1968_measure_clock()
1757 dev_err(chip->card->dev, "?? calculation error..\n"); in es1968_measure_clock()
1763 chip->clock = (chip->clock * offset) / 48000; in es1968_measure_clock()
1765 dev_info(chip->card->dev, "clocking to %d\n", chip->clock); in es1968_measure_clock()
1777 struct es1968 *esm = pcm->private_data; in snd_es1968_pcm_free()
1779 esm->pcm = NULL; in snd_es1968_pcm_free()
1794 wave_set_register(chip, 0x01FC, chip->dma.addr >> 12); in snd_es1968_pcm()
1795 wave_set_register(chip, 0x01FD, chip->dma.addr >> 12); in snd_es1968_pcm()
1796 wave_set_register(chip, 0x01FE, chip->dma.addr >> 12); in snd_es1968_pcm()
1797 wave_set_register(chip, 0x01FF, chip->dma.addr >> 12); in snd_es1968_pcm()
1799 err = snd_pcm_new(chip->card, "ESS Maestro", device, in snd_es1968_pcm()
1800 chip->playback_streams, in snd_es1968_pcm()
1801 chip->capture_streams, &pcm); in snd_es1968_pcm()
1805 pcm->private_data = chip; in snd_es1968_pcm()
1806 pcm->private_free = snd_es1968_pcm_free; in snd_es1968_pcm()
1811 pcm->info_flags = 0; in snd_es1968_pcm()
1813 strcpy(pcm->name, "ESS Maestro"); in snd_es1968_pcm()
1815 chip->pcm = pcm; in snd_es1968_pcm()
1830 diff = (cp1 > cp2 ? cp1 - cp2 : cp2 - cp1); in snd_es1968_suppress_jitter()
1843 struct snd_pcm_substream *subs = es->substream; in snd_es1968_update_pcm()
1845 if (subs == NULL || !es->running) in snd_es1968_update_pcm()
1848 hwptr = snd_es1968_get_dma_ptr(chip, es) << es->wav_shift; in snd_es1968_update_pcm()
1849 hwptr %= es->dma_size; in snd_es1968_update_pcm()
1851 diff = (es->dma_size + hwptr - es->hwptr) % es->dma_size; in snd_es1968_update_pcm()
1853 es->hwptr = hwptr; in snd_es1968_update_pcm()
1854 es->count += diff; in snd_es1968_update_pcm()
1856 if (es->count > es->frag_size) { in snd_es1968_update_pcm()
1857 spin_unlock(&chip->substream_lock); in snd_es1968_update_pcm()
1859 spin_lock(&chip->substream_lock); in snd_es1968_update_pcm()
1860 es->count %= es->frag_size; in snd_es1968_update_pcm()
1866 generating an interrupt. The pair of counters is stored in bits 1-3 and 5-7
1876 x = inb(chip->io_port + 0x1c) & 0xee; in es1968_update_hw_volume()
1878 outb(0x88, chip->io_port + 0x1c); in es1968_update_hw_volume()
1879 outb(0x88, chip->io_port + 0x1d); in es1968_update_hw_volume()
1880 outb(0x88, chip->io_port + 0x1e); in es1968_update_hw_volume()
1881 outb(0x88, chip->io_port + 0x1f); in es1968_update_hw_volume()
1883 if (chip->in_suspend) in es1968_update_hw_volume()
1887 if (! chip->master_switch || ! chip->master_volume) in es1968_update_hw_volume()
1890 val = snd_ac97_read(chip->ac97, AC97_MASTER); in es1968_update_hw_volume()
1899 val--; in es1968_update_hw_volume()
1901 val -= 0x0100; in es1968_update_hw_volume()
1911 if (snd_ac97_update(chip->ac97, AC97_MASTER, val)) in es1968_update_hw_volume()
1912 snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE, in es1968_update_hw_volume()
1913 &chip->master_volume->id); in es1968_update_hw_volume()
1915 if (!chip->input_dev) in es1968_update_hw_volume()
1927 /* counters increased by 1 -> volume up */ in es1968_update_hw_volume()
1931 /* counters decreased by 1 -> volume down */ in es1968_update_hw_volume()
1937 input_report_key(chip->input_dev, val, 1); in es1968_update_hw_volume()
1938 input_sync(chip->input_dev); in es1968_update_hw_volume()
1939 input_report_key(chip->input_dev, val, 0); in es1968_update_hw_volume()
1940 input_sync(chip->input_dev); in es1968_update_hw_volume()
1953 event = inb(chip->io_port + 0x1A); in snd_es1968_interrupt()
1957 outw(inw(chip->io_port + 4) & 1, chip->io_port + 4); in snd_es1968_interrupt()
1960 schedule_work(&chip->hwvol_work); in snd_es1968_interrupt()
1963 outb(0xFF, chip->io_port + 0x1A); in snd_es1968_interrupt()
1965 if ((event & ESM_MPU401_IRQ) && chip->rmidi) { in snd_es1968_interrupt()
1966 snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data); in snd_es1968_interrupt()
1971 spin_lock(&chip->substream_lock); in snd_es1968_interrupt()
1972 list_for_each_entry(es, &chip->substream_list, list) { in snd_es1968_interrupt()
1973 if (es->running) { in snd_es1968_interrupt()
1975 if (es->fmt & ESS_FMT_STEREO) in snd_es1968_interrupt()
1979 spin_unlock(&chip->substream_lock); in snd_es1968_interrupt()
1980 if (chip->in_measurement) { in snd_es1968_interrupt()
1981 unsigned int curp = __apu_get_register(chip, chip->measure_apu, 5); in snd_es1968_interrupt()
1982 if (curp < chip->measure_lastpos) in snd_es1968_interrupt()
1983 chip->measure_count++; in snd_es1968_interrupt()
1984 chip->measure_lastpos = curp; in snd_es1968_interrupt()
2006 err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus); in snd_es1968_mixer()
2009 pbus->no_vra = 1; /* ES1968 doesn't need VRA */ in snd_es1968_mixer()
2013 err = snd_ac97_mixer(pbus, &ac97, &chip->ac97); in snd_es1968_mixer()
2019 chip->master_switch = snd_ctl_find_id_mixer(chip->card, in snd_es1968_mixer()
2021 chip->master_volume = snd_ctl_find_id_mixer(chip->card, in snd_es1968_mixer()
2034 unsigned long ioaddr = chip->io_port; in snd_es1968_ac97_reset()
2052 pci_read_config_word(chip->pci, 0x58, &w); /* something magical with gpio and bus arb. */ in snd_es1968_ac97_reset()
2053 pci_read_config_dword(chip->pci, PCI_SUBSYSTEM_VENDOR_ID, &vend); in snd_es1968_ac97_reset()
2083 dev_info(chip->card->dev, "trying software reset\n"); in snd_es1968_ac97_reset()
2141 chip->io_port + ESM_PORT_HOST_IRQ); in snd_es1968_reset()
2143 outw(0x0000, chip->io_port + ESM_PORT_HOST_IRQ); in snd_es1968_reset()
2152 struct pci_dev *pci = chip->pci; in snd_es1968_chip_init()
2154 unsigned long iobase = chip->io_port; in snd_es1968_chip_init()
2198 w &= ~IDMA_CONFB; /* IDMA off (undocumented) */ in snd_es1968_chip_init()
2275 /* Write 0 into the buffer area 0x1E0->1EF */ in snd_es1968_chip_init()
2280 * 0x1D0-0x1DF too.*/ in snd_es1968_chip_init()
2312 /* Wave cache control on - test off, sg off, in snd_es1968_chip_init()
2345 if (chip->rmidi) in snd_es1968_start_irq()
2347 outb(w, chip->io_port + 0x1A); in snd_es1968_start_irq()
2348 outw(w, chip->io_port + ESM_PORT_HOST_IRQ); in snd_es1968_start_irq()
2357 struct es1968 *chip = card->private_data; in es1968_suspend()
2359 if (! chip->do_pm) in es1968_suspend()
2362 chip->in_suspend = 1; in es1968_suspend()
2363 cancel_work_sync(&chip->hwvol_work); in es1968_suspend()
2365 snd_ac97_suspend(chip->ac97); in es1968_suspend()
2373 struct es1968 *chip = card->private_data; in es1968_resume()
2376 if (! chip->do_pm) in es1968_resume()
2382 if (chip->dma.addr) { in es1968_resume()
2384 wave_set_register(chip, 0x01FC, chip->dma.addr >> 12); in es1968_resume()
2390 snd_ac97_resume(chip->ac97); in es1968_resume()
2392 list_for_each_entry(es, &chip->substream_list, list) { in es1968_resume()
2393 switch (es->mode) { in es1968_resume()
2395 snd_es1968_playback_setup(chip, es, es->substream->runtime); in es1968_resume()
2398 snd_es1968_capture_setup(chip, es, es->substream->runtime); in es1968_resume()
2404 if (chip->bobclient) in es1968_resume()
2408 chip->in_suspend = 0; in es1968_resume()
2423 return -ENODEV; in snd_es1968_create_gameport()
2425 r = devm_request_region(&chip->pci->dev, JOYSTICK_ADDR, 8, in snd_es1968_create_gameport()
2428 return -EBUSY; in snd_es1968_create_gameport()
2430 chip->gameport = gp = gameport_allocate_port(); in snd_es1968_create_gameport()
2432 dev_err(chip->card->dev, in snd_es1968_create_gameport()
2434 return -ENOMEM; in snd_es1968_create_gameport()
2437 pci_read_config_word(chip->pci, ESM_LEGACY_AUDIO_CONTROL, &val); in snd_es1968_create_gameport()
2438 pci_write_config_word(chip->pci, ESM_LEGACY_AUDIO_CONTROL, val | 0x04); in snd_es1968_create_gameport()
2441 gameport_set_phys(gp, "pci%s/gameport0", pci_name(chip->pci)); in snd_es1968_create_gameport()
2442 gameport_set_dev_parent(gp, &chip->pci->dev); in snd_es1968_create_gameport()
2443 gp->io = JOYSTICK_ADDR; in snd_es1968_create_gameport()
2452 if (chip->gameport) { in snd_es1968_free_gameport()
2453 gameport_unregister_port(chip->gameport); in snd_es1968_free_gameport()
2454 chip->gameport = NULL; in snd_es1968_free_gameport()
2458 static inline int snd_es1968_create_gameport(struct es1968 *chip, int dev) { return -ENOSYS; } in snd_es1968_create_gameport()
2468 input_dev = devm_input_allocate_device(&chip->pci->dev); in snd_es1968_input_register()
2470 return -ENOMEM; in snd_es1968_input_register()
2472 snprintf(chip->phys, sizeof(chip->phys), "pci-%s/input0", in snd_es1968_input_register()
2473 pci_name(chip->pci)); in snd_es1968_input_register()
2475 input_dev->name = chip->card->driver; in snd_es1968_input_register()
2476 input_dev->phys = chip->phys; in snd_es1968_input_register()
2477 input_dev->id.bustype = BUS_PCI; in snd_es1968_input_register()
2478 input_dev->id.vendor = chip->pci->vendor; in snd_es1968_input_register()
2479 input_dev->id.product = chip->pci->device; in snd_es1968_input_register()
2480 input_dev->dev.parent = &chip->pci->dev; in snd_es1968_input_register()
2482 __set_bit(EV_KEY, input_dev->evbit); in snd_es1968_input_register()
2483 __set_bit(KEY_MUTE, input_dev->keybit); in snd_es1968_input_register()
2484 __set_bit(KEY_VOLUMEDOWN, input_dev->keybit); in snd_es1968_input_register()
2485 __set_bit(KEY_VOLUMEUP, input_dev->keybit); in snd_es1968_input_register()
2491 chip->input_dev = input_dev; in snd_es1968_input_register()
2510 { .data = 6, .clk = 7, .wren = 8, .most = 9, .name = "SF64-PCE2" },
2515 (&snd_es1968_tea575x_gpios[(chip)->tea575x_tuner])
2520 struct es1968 *chip = tea->private_data; in snd_es1968_tea575x_set_pins()
2528 outw(val, chip->io_port + GPIO_DATA); in snd_es1968_tea575x_set_pins()
2533 struct es1968 *chip = tea->private_data; in snd_es1968_tea575x_get_pins()
2535 u16 val = inw(chip->io_port + GPIO_DATA); in snd_es1968_tea575x_get_pins()
2548 struct es1968 *chip = tea->private_data; in snd_es1968_tea575x_set_direction()
2549 unsigned long io = chip->io_port + GPIO_DATA; in snd_es1968_tea575x_set_direction()
2575 struct es1968 *chip = card->private_data; in snd_es1968_free()
2577 cancel_work_sync(&chip->hwvol_work); in snd_es1968_free()
2579 if (chip->io_port) { in snd_es1968_free()
2580 outw(1, chip->io_port + 0x04); /* clear WP interrupts */ in snd_es1968_free()
2581 outw(0, chip->io_port + ESM_PORT_HOST_IRQ); /* disable IRQ */ in snd_es1968_free()
2585 snd_tea575x_exit(&chip->tea); in snd_es1968_free()
2586 v4l2_device_unregister(&chip->v4l2_dev); in snd_es1968_free()
2605 { TYPE_MAESTRO2, 0x125d }, /* a PCI card, e.g. SF64-PCE2 */
2621 struct es1968 *chip = card->private_data; in snd_es1968_create()
2629 if (dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(28))) { in snd_es1968_create()
2630 dev_err(card->dev, in snd_es1968_create()
2632 return -ENXIO; in snd_es1968_create()
2636 chip->type = chip_type; in snd_es1968_create()
2637 spin_lock_init(&chip->reg_lock); in snd_es1968_create()
2638 spin_lock_init(&chip->substream_lock); in snd_es1968_create()
2639 INIT_LIST_HEAD(&chip->buf_list); in snd_es1968_create()
2640 INIT_LIST_HEAD(&chip->substream_list); in snd_es1968_create()
2641 mutex_init(&chip->memory_mutex); in snd_es1968_create()
2642 INIT_WORK(&chip->hwvol_work, es1968_update_hw_volume); in snd_es1968_create()
2643 chip->card = card; in snd_es1968_create()
2644 chip->pci = pci; in snd_es1968_create()
2645 chip->irq = -1; in snd_es1968_create()
2646 chip->total_bufsize = total_bufsize; /* in bytes */ in snd_es1968_create()
2647 chip->playback_streams = play_streams; in snd_es1968_create()
2648 chip->capture_streams = capt_streams; in snd_es1968_create()
2653 chip->io_port = pci_resource_start(pci, 0); in snd_es1968_create()
2654 if (devm_request_irq(&pci->dev, pci->irq, snd_es1968_interrupt, in snd_es1968_create()
2656 dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq); in snd_es1968_create()
2657 return -EBUSY; in snd_es1968_create()
2659 chip->irq = pci->irq; in snd_es1968_create()
2660 card->sync_irq = chip->irq; in snd_es1968_create()
2661 card->private_free = snd_es1968_free; in snd_es1968_create()
2665 chip->maestro_map[i] = 0; in snd_es1968_create()
2669 chip->apu[i] = ESM_APU_FREE; in snd_es1968_create()
2675 /* disable power-management if not on the allowlist */ in snd_es1968_create()
2677 pci_read_config_word(chip->pci, PCI_SUBSYSTEM_VENDOR_ID, &vend); in snd_es1968_create()
2679 if (chip->type == pm_allowlist[i].type && in snd_es1968_create()
2687 dev_info(card->dev, "not attempting power management.\n"); in snd_es1968_create()
2691 chip->do_pm = do_pm; in snd_es1968_create()
2697 if (chip->pci->subsystem_vendor != 0x125d) in snd_es1968_create()
2699 err = v4l2_device_register(&pci->dev, &chip->v4l2_dev); in snd_es1968_create()
2702 chip->tea.v4l2_dev = &chip->v4l2_dev; in snd_es1968_create()
2703 chip->tea.private_data = chip; in snd_es1968_create()
2704 chip->tea.radio_nr = radio_nr; in snd_es1968_create()
2705 chip->tea.ops = &snd_es1968_tea_ops; in snd_es1968_create()
2706 sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci)); in snd_es1968_create()
2708 chip->tea575x_tuner = i; in snd_es1968_create()
2709 if (!snd_tea575x_init(&chip->tea, THIS_MODULE)) { in snd_es1968_create()
2710 dev_info(card->dev, "detected TEA575x radio type %s\n", in snd_es1968_create()
2711 get_tea575x_gpio(chip)->name); in snd_es1968_create()
2712 strscpy(chip->tea.card, get_tea575x_gpio(chip)->name, in snd_es1968_create()
2713 sizeof(chip->tea.card)); in snd_es1968_create()
2734 return -ENODEV; in __snd_es1968_probe()
2737 return -ENOENT; in __snd_es1968_probe()
2740 err = snd_devm_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, in __snd_es1968_probe()
2744 chip = card->private_data; in __snd_es1968_probe()
2754 pci_id->driver_data, in __snd_es1968_probe()
2760 switch (chip->type) { in __snd_es1968_probe()
2762 strcpy(card->driver, "ES1978"); in __snd_es1968_probe()
2763 strcpy(card->shortname, "ESS ES1978 (Maestro 2E)"); in __snd_es1968_probe()
2766 strcpy(card->driver, "ES1968"); in __snd_es1968_probe()
2767 strcpy(card->shortname, "ESS ES1968 (Maestro 2)"); in __snd_es1968_probe()
2770 strcpy(card->driver, "ESM1"); in __snd_es1968_probe()
2771 strcpy(card->shortname, "ESS Maestro 1"); in __snd_es1968_probe()
2786 pci_read_config_word(chip->pci, PCI_SUBSYSTEM_VENDOR_ID, &vend); in __snd_es1968_probe()
2788 if (chip->type == mpu_denylist[i].type && in __snd_es1968_probe()
2797 chip->io_port + ESM_MPU401_PORT, in __snd_es1968_probe()
2800 -1, &chip->rmidi); in __snd_es1968_probe()
2802 dev_warn(card->dev, "skipping MPU-401 MIDI support..\n"); in __snd_es1968_probe()
2810 dev_warn(card->dev, in __snd_es1968_probe()
2816 chip->clock = clock[dev]; in __snd_es1968_probe()
2817 if (! chip->clock) in __snd_es1968_probe()
2820 sprintf(card->longname, "%s at 0x%lx, irq %i", in __snd_es1968_probe()
2821 card->shortname, chip->io_port, chip->irq); in __snd_es1968_probe()
2834 return snd_card_free_on_error(&pci->dev, __snd_es1968_probe(pci, pci_id)); in snd_es1968_probe()