• Home
  • Raw
  • Download

Lines Matching refs:es

873 		struct esschan *es;  in snd_es1968_bob_dec()  local
874 list_for_each_entry(es, &chip->substream_list, list) { in snd_es1968_bob_dec()
875 if (max_freq < es->bob_freq) in snd_es1968_bob_dec()
876 max_freq = es->bob_freq; in snd_es1968_bob_dec()
887 snd_es1968_calc_bob_rate(struct es1968 *chip, struct esschan *es, in snd_es1968_calc_bob_rate() argument
892 if (es->fmt & ESS_FMT_STEREO) in snd_es1968_calc_bob_rate()
894 if (es->fmt & ESS_FMT_16BIT) in snd_es1968_calc_bob_rate()
896 freq /= es->frag_size; in snd_es1968_calc_bob_rate()
921 snd_es1968_get_dma_ptr(struct es1968 *chip, struct esschan *es) in snd_es1968_get_dma_ptr() argument
925 offset = apu_get_register(chip, es->apu[0], 5); in snd_es1968_get_dma_ptr()
927 offset -= es->base[0]; in snd_es1968_get_dma_ptr()
949 static void snd_es1968_pcm_start(struct es1968 *chip, struct esschan *es) in snd_es1968_pcm_start() argument
952 __apu_set_register(chip, es->apu[0], 5, es->base[0]); in snd_es1968_pcm_start()
953 snd_es1968_trigger_apu(chip, es->apu[0], es->apu_mode[0]); in snd_es1968_pcm_start()
954 if (es->mode == ESM_MODE_CAPTURE) { in snd_es1968_pcm_start()
955 __apu_set_register(chip, es->apu[2], 5, es->base[2]); in snd_es1968_pcm_start()
956 snd_es1968_trigger_apu(chip, es->apu[2], es->apu_mode[2]); in snd_es1968_pcm_start()
958 if (es->fmt & ESS_FMT_STEREO) { in snd_es1968_pcm_start()
959 __apu_set_register(chip, es->apu[1], 5, es->base[1]); in snd_es1968_pcm_start()
960 snd_es1968_trigger_apu(chip, es->apu[1], es->apu_mode[1]); in snd_es1968_pcm_start()
961 if (es->mode == ESM_MODE_CAPTURE) { in snd_es1968_pcm_start()
962 __apu_set_register(chip, es->apu[3], 5, es->base[3]); in snd_es1968_pcm_start()
963 snd_es1968_trigger_apu(chip, es->apu[3], es->apu_mode[3]); in snd_es1968_pcm_start()
969 static void snd_es1968_pcm_stop(struct es1968 *chip, struct esschan *es) in snd_es1968_pcm_stop() argument
972 snd_es1968_trigger_apu(chip, es->apu[0], 0); in snd_es1968_pcm_stop()
973 snd_es1968_trigger_apu(chip, es->apu[1], 0); in snd_es1968_pcm_stop()
974 if (es->mode == ESM_MODE_CAPTURE) { in snd_es1968_pcm_stop()
975 snd_es1968_trigger_apu(chip, es->apu[2], 0); in snd_es1968_pcm_stop()
976 snd_es1968_trigger_apu(chip, es->apu[3], 0); in snd_es1968_pcm_stop()
982 static void snd_es1968_program_wavecache(struct es1968 *chip, struct esschan *es, in snd_es1968_program_wavecache() argument
988 if (!(es->fmt & ESS_FMT_16BIT)) in snd_es1968_program_wavecache()
990 if (es->fmt & ESS_FMT_STEREO) in snd_es1968_program_wavecache()
995 wave_set_register(chip, es->apu[channel] << 3, tmpval); in snd_es1968_program_wavecache()
998 es->wc_map[channel] = tmpval; in snd_es1968_program_wavecache()
1003 static void snd_es1968_playback_setup(struct es1968 *chip, struct esschan *es, in snd_es1968_playback_setup() argument
1013 size = es->dma_size >> es->wav_shift; in snd_es1968_playback_setup()
1015 if (es->fmt & ESS_FMT_STEREO) in snd_es1968_playback_setup()
1019 apu = es->apu[channel]; in snd_es1968_playback_setup()
1021 snd_es1968_program_wavecache(chip, es, channel, es->memory->buf.addr, 0); in snd_es1968_playback_setup()
1024 pa = es->memory->buf.addr; in snd_es1968_playback_setup()
1030 if (es->fmt & ESS_FMT_STEREO) { in snd_es1968_playback_setup()
1034 if (es->fmt & ESS_FMT_16BIT) in snd_es1968_playback_setup()
1040 es->base[channel] = pa & 0xFFFF; in snd_es1968_playback_setup()
1062 if (es->fmt & ESS_FMT_16BIT) in snd_es1968_playback_setup()
1063 es->apu_mode[channel] = ESM_APU_16BITLINEAR; in snd_es1968_playback_setup()
1065 es->apu_mode[channel] = ESM_APU_8BITLINEAR; in snd_es1968_playback_setup()
1067 if (es->fmt & ESS_FMT_STEREO) { in snd_es1968_playback_setup()
1075 es->apu_mode[channel] += 1; /* stereo */ in snd_es1968_playback_setup()
1095 if (!(es->fmt & ESS_FMT_16BIT) && !(es->fmt & ESS_FMT_STEREO)) in snd_es1968_playback_setup()
1101 snd_es1968_apu_set_freq(chip, es->apu[0], freq); in snd_es1968_playback_setup()
1102 snd_es1968_apu_set_freq(chip, es->apu[1], freq); in snd_es1968_playback_setup()
1106 static void init_capture_apu(struct es1968 *chip, struct esschan *es, int channel, in init_capture_apu() argument
1110 int i, apu = es->apu[channel]; in init_capture_apu()
1112 es->apu_mode[channel] = mode; in init_capture_apu()
1115 snd_es1968_program_wavecache(chip, es, channel, pa, 1); in init_capture_apu()
1123 es->base[channel] = pa & 0xFFFF; in init_capture_apu()
1151 static void snd_es1968_capture_setup(struct es1968 *chip, struct esschan *es, in snd_es1968_capture_setup() argument
1158 size = es->dma_size >> es->wav_shift; in snd_es1968_capture_setup()
1172 init_capture_apu(chip, es, 2, in snd_es1968_capture_setup()
1173 es->mixbuf->buf.addr, ESM_MIXBUF_SIZE/4, /* in words */ in snd_es1968_capture_setup()
1176 init_capture_apu(chip, es, 0, es->memory->buf.addr, size, in snd_es1968_capture_setup()
1177 ESM_APU_SRCONVERTOR, es->apu[2]); in snd_es1968_capture_setup()
1178 if (es->fmt & ESS_FMT_STEREO) { in snd_es1968_capture_setup()
1180 init_capture_apu(chip, es, 3, in snd_es1968_capture_setup()
1181 es->mixbuf->buf.addr + ESM_MIXBUF_SIZE/2, in snd_es1968_capture_setup()
1185 init_capture_apu(chip, es, 1, in snd_es1968_capture_setup()
1186 es->memory->buf.addr + size*2, size, in snd_es1968_capture_setup()
1187 ESM_APU_SRCONVERTOR, es->apu[3]); in snd_es1968_capture_setup()
1200 snd_es1968_apu_set_freq(chip, es->apu[0], freq); in snd_es1968_capture_setup()
1201 snd_es1968_apu_set_freq(chip, es->apu[1], freq); in snd_es1968_capture_setup()
1205 snd_es1968_apu_set_freq(chip, es->apu[2], freq); in snd_es1968_capture_setup()
1206 snd_es1968_apu_set_freq(chip, es->apu[3], freq); in snd_es1968_capture_setup()
1224 struct esschan *es = runtime->private_data; in snd_es1968_pcm_prepare() local
1226 es->dma_size = snd_pcm_lib_buffer_bytes(substream); in snd_es1968_pcm_prepare()
1227 es->frag_size = snd_pcm_lib_period_bytes(substream); in snd_es1968_pcm_prepare()
1229 es->wav_shift = 1; /* maestro handles always 16bit */ in snd_es1968_pcm_prepare()
1230 es->fmt = 0; in snd_es1968_pcm_prepare()
1232 es->fmt |= ESS_FMT_16BIT; in snd_es1968_pcm_prepare()
1234 es->fmt |= ESS_FMT_STEREO; in snd_es1968_pcm_prepare()
1235 if (es->fmt & ESS_FMT_16BIT) /* 8bit is already word shifted */ in snd_es1968_pcm_prepare()
1236 es->wav_shift++; in snd_es1968_pcm_prepare()
1238 es->bob_freq = snd_es1968_calc_bob_rate(chip, es, runtime); in snd_es1968_pcm_prepare()
1240 switch (es->mode) { in snd_es1968_pcm_prepare()
1242 snd_es1968_playback_setup(chip, es, runtime); in snd_es1968_pcm_prepare()
1245 snd_es1968_capture_setup(chip, es, runtime); in snd_es1968_pcm_prepare()
1255 struct esschan *es = substream->runtime->private_data; in snd_es1968_pcm_trigger() local
1261 if (es->running) in snd_es1968_pcm_trigger()
1263 snd_es1968_bob_inc(chip, es->bob_freq); in snd_es1968_pcm_trigger()
1264 es->count = 0; in snd_es1968_pcm_trigger()
1265 es->hwptr = 0; in snd_es1968_pcm_trigger()
1266 snd_es1968_pcm_start(chip, es); in snd_es1968_pcm_trigger()
1267 es->running = 1; in snd_es1968_pcm_trigger()
1271 if (! es->running) in snd_es1968_pcm_trigger()
1273 snd_es1968_pcm_stop(chip, es); in snd_es1968_pcm_trigger()
1274 es->running = 0; in snd_es1968_pcm_trigger()
1285 struct esschan *es = substream->runtime->private_data; in snd_es1968_pcm_pointer() local
1288 ptr = snd_es1968_get_dma_ptr(chip, es) << es->wav_shift; in snd_es1968_pcm_pointer()
1290 return bytes_to_frames(substream->runtime, ptr % es->dma_size); in snd_es1968_pcm_pointer()
1553 struct esschan *es; in snd_es1968_playback_open() local
1561 es = kzalloc(sizeof(*es), GFP_KERNEL); in snd_es1968_playback_open()
1562 if (!es) { in snd_es1968_playback_open()
1567 es->apu[0] = apu1; in snd_es1968_playback_open()
1568 es->apu[1] = apu1 + 1; in snd_es1968_playback_open()
1569 es->apu_mode[0] = 0; in snd_es1968_playback_open()
1570 es->apu_mode[1] = 0; in snd_es1968_playback_open()
1571 es->running = 0; in snd_es1968_playback_open()
1572 es->substream = substream; in snd_es1968_playback_open()
1573 es->mode = ESM_MODE_PLAY; in snd_es1968_playback_open()
1575 runtime->private_data = es; in snd_es1968_playback_open()
1581 list_add(&es->list, &chip->substream_list); in snd_es1968_playback_open()
1591 struct esschan *es; in snd_es1968_capture_open() local
1603 es = kzalloc(sizeof(*es), GFP_KERNEL); in snd_es1968_capture_open()
1604 if (!es) { in snd_es1968_capture_open()
1610 es->apu[0] = apu1; in snd_es1968_capture_open()
1611 es->apu[1] = apu1 + 1; in snd_es1968_capture_open()
1612 es->apu[2] = apu2; in snd_es1968_capture_open()
1613 es->apu[3] = apu2 + 1; in snd_es1968_capture_open()
1614 es->apu_mode[0] = 0; in snd_es1968_capture_open()
1615 es->apu_mode[1] = 0; in snd_es1968_capture_open()
1616 es->apu_mode[2] = 0; in snd_es1968_capture_open()
1617 es->apu_mode[3] = 0; in snd_es1968_capture_open()
1618 es->running = 0; in snd_es1968_capture_open()
1619 es->substream = substream; in snd_es1968_capture_open()
1620 es->mode = ESM_MODE_CAPTURE; in snd_es1968_capture_open()
1623 if ((es->mixbuf = snd_es1968_new_memory(chip, ESM_MIXBUF_SIZE)) == NULL) { in snd_es1968_capture_open()
1626 kfree(es); in snd_es1968_capture_open()
1629 memset(es->mixbuf->buf.area, 0, ESM_MIXBUF_SIZE); in snd_es1968_capture_open()
1631 runtime->private_data = es; in snd_es1968_capture_open()
1638 list_add(&es->list, &chip->substream_list); in snd_es1968_capture_open()
1647 struct esschan *es; in snd_es1968_playback_close() local
1651 es = substream->runtime->private_data; in snd_es1968_playback_close()
1653 list_del(&es->list); in snd_es1968_playback_close()
1655 snd_es1968_free_apu_pair(chip, es->apu[0]); in snd_es1968_playback_close()
1656 kfree(es); in snd_es1968_playback_close()
1664 struct esschan *es; in snd_es1968_capture_close() local
1668 es = substream->runtime->private_data; in snd_es1968_capture_close()
1670 list_del(&es->list); in snd_es1968_capture_close()
1672 snd_es1968_free_memory(chip, es->mixbuf); in snd_es1968_capture_close()
1673 snd_es1968_free_apu_pair(chip, es->apu[0]); in snd_es1968_capture_close()
1674 snd_es1968_free_apu_pair(chip, es->apu[2]); in snd_es1968_capture_close()
1675 kfree(es); in snd_es1968_capture_close()
1847 static void snd_es1968_suppress_jitter(struct es1968 *chip, struct esschan *es) in snd_es1968_suppress_jitter() argument
1864 static void snd_es1968_update_pcm(struct es1968 *chip, struct esschan *es) in snd_es1968_update_pcm() argument
1868 struct snd_pcm_substream *subs = es->substream; in snd_es1968_update_pcm()
1870 if (subs == NULL || !es->running) in snd_es1968_update_pcm()
1873 hwptr = snd_es1968_get_dma_ptr(chip, es) << es->wav_shift; in snd_es1968_update_pcm()
1874 hwptr %= es->dma_size; in snd_es1968_update_pcm()
1876 diff = (es->dma_size + hwptr - es->hwptr) % es->dma_size; in snd_es1968_update_pcm()
1878 es->hwptr = hwptr; in snd_es1968_update_pcm()
1879 es->count += diff; in snd_es1968_update_pcm()
1881 if (es->count > es->frag_size) { in snd_es1968_update_pcm()
1885 es->count %= es->frag_size; in snd_es1968_update_pcm()
1994 struct esschan *es; in snd_es1968_interrupt() local
1996 list_for_each_entry(es, &chip->substream_list, list) { in snd_es1968_interrupt()
1997 if (es->running) { in snd_es1968_interrupt()
1998 snd_es1968_update_pcm(chip, es); in snd_es1968_interrupt()
1999 if (es->fmt & ESS_FMT_STEREO) in snd_es1968_interrupt()
2000 snd_es1968_suppress_jitter(chip, es); in snd_es1968_interrupt()
2405 struct esschan *es; in es1968_resume() local
2423 list_for_each_entry(es, &chip->substream_list, list) { in es1968_resume()
2424 switch (es->mode) { in es1968_resume()
2426 snd_es1968_playback_setup(chip, es, es->substream->runtime); in es1968_resume()
2429 snd_es1968_capture_setup(chip, es, es->substream->runtime); in es1968_resume()