• Home
  • Raw
  • Download

Lines Matching refs:str

52 					  struct lola_stream *str)  in lola_stream_clear_pending_irq()  argument
54 unsigned int val = lola_dsd_read(chip, str->dsd, STS); in lola_stream_clear_pending_irq()
57 lola_dsd_write(chip, str->dsd, STS, val); in lola_stream_clear_pending_irq()
60 static void lola_stream_start(struct lola *chip, struct lola_stream *str, in lola_stream_start() argument
63 lola_stream_clear_pending_irq(chip, str); in lola_stream_start()
64 lola_dsd_write(chip, str->dsd, CTL, in lola_stream_start()
72 static void lola_stream_stop(struct lola *chip, struct lola_stream *str, in lola_stream_stop() argument
75 lola_dsd_write(chip, str->dsd, CTL, in lola_stream_stop()
80 lola_stream_clear_pending_irq(chip, str); in lola_stream_stop()
83 static void wait_for_srst_clear(struct lola *chip, struct lola_stream *str) in wait_for_srst_clear() argument
88 val = lola_dsd_read(chip, str->dsd, CTL); in wait_for_srst_clear()
93 dev_warn(chip->card->dev, "SRST not clear (stream %d)\n", str->dsd); in wait_for_srst_clear()
97 struct lola_stream *str, in lola_stream_wait_for_fifo() argument
103 unsigned int reg = lola_dsd_read(chip, str->dsd, STS); in lola_stream_wait_for_fifo()
108 dev_warn(chip->card->dev, "FIFO not ready (stream %d)\n", str->dsd); in lola_stream_wait_for_fifo()
127 struct lola_stream *str; in lola_sync_wait_for_fifo() local
130 str = lola_get_stream(s); in lola_sync_wait_for_fifo()
131 if (str->prepared && str->paused) { in lola_sync_wait_for_fifo()
133 reg = lola_dsd_read(chip, str->dsd, STS); in lola_sync_wait_for_fifo()
135 pending = str->dsd + 1; in lola_sync_wait_for_fifo()
139 str->paused = 0; in lola_sync_wait_for_fifo()
158 struct lola_stream *str; in lola_sync_pause() local
161 str = lola_get_stream(s); in lola_sync_pause()
162 if (str->paused && str->prepared) in lola_sync_pause()
163 lola_dsd_write(chip, str->dsd, CTL, LOLA_DSD_CTL_SRUN | in lola_sync_pause()
169 static void lola_stream_reset(struct lola *chip, struct lola_stream *str) in lola_stream_reset() argument
171 if (str->prepared) { in lola_stream_reset()
172 if (str->paused) in lola_stream_reset()
173 lola_sync_pause(chip, str->substream); in lola_stream_reset()
174 str->prepared = 0; in lola_stream_reset()
175 lola_dsd_write(chip, str->dsd, CTL, in lola_stream_reset()
177 lola_stream_wait_for_fifo(chip, str, false); in lola_stream_reset()
178 lola_stream_clear_pending_irq(chip, str); in lola_stream_reset()
179 lola_dsd_write(chip, str->dsd, CTL, LOLA_DSD_CTL_SRST); in lola_stream_reset()
180 lola_dsd_write(chip, str->dsd, LVI, 0); in lola_stream_reset()
181 lola_dsd_write(chip, str->dsd, BDPU, 0); in lola_stream_reset()
182 lola_dsd_write(chip, str->dsd, BDPL, 0); in lola_stream_reset()
183 wait_for_srst_clear(chip, str); in lola_stream_reset()
214 struct lola_stream *str = lola_get_stream(substream); in lola_pcm_open() local
218 if (str->opened) { in lola_pcm_open()
222 str->substream = substream; in lola_pcm_open()
223 str->master = NULL; in lola_pcm_open()
224 str->opened = 1; in lola_pcm_open()
226 runtime->hw.channels_max = pcm->num_streams - str->index; in lola_pcm_open()
247 struct lola_stream *str) in lola_cleanup_slave_streams() argument
250 for (i = str->index + 1; i < pcm->num_streams; i++) { in lola_cleanup_slave_streams()
252 if (s->master != str) in lola_cleanup_slave_streams()
262 struct lola_stream *str = lola_get_stream(substream); in lola_pcm_close() local
265 if (str->substream == substream) { in lola_pcm_close()
266 str->substream = NULL; in lola_pcm_close()
267 str->opened = 0; in lola_pcm_close()
280 struct lola_stream *str = lola_get_stream(substream); in lola_pcm_hw_params() local
282 str->bufsize = 0; in lola_pcm_hw_params()
283 str->period_bytes = 0; in lola_pcm_hw_params()
284 str->format_verb = 0; in lola_pcm_hw_params()
293 struct lola_stream *str = lola_get_stream(substream); in lola_pcm_hw_free() local
296 lola_stream_reset(chip, str); in lola_pcm_hw_free()
297 lola_cleanup_slave_streams(pcm, str); in lola_pcm_hw_free()
306 struct lola_stream *str, __le32 **bdlp, in setup_bdle() argument
315 if (str->frags >= LOLA_MAX_BDL_ENTRIES) in setup_bdle()
331 str->frags++; in setup_bdle()
343 struct lola_stream *str) in lola_setup_periods() argument
348 period_bytes = str->period_bytes; in lola_setup_periods()
349 periods = str->bufsize / period_bytes; in lola_setup_periods()
352 bdl = (__le32 *)(pcm->bdl.area + LOLA_BDL_ENTRY_SIZE * str->index); in lola_setup_periods()
354 str->frags = 0; in lola_setup_periods()
356 ofs = setup_bdle(substream, str, &bdl, ofs, period_bytes); in lola_setup_periods()
364 str->bufsize, period_bytes); in lola_setup_periods()
393 struct lola_stream *str, in lola_set_stream_config() argument
402 err = lola_codec_read(chip, str->nid, LOLA_VERB_SET_STREAM_FORMAT, in lola_set_stream_config()
403 str->format_verb, 0, &val, NULL); in lola_set_stream_config()
406 str->format_verb); in lola_set_stream_config()
412 verb = (str->index << 6) | i; in lola_set_stream_config()
413 err = lola_codec_read(chip, str[i].nid, in lola_set_stream_config()
429 struct lola_stream *str) in lola_setup_controller() argument
433 if (str->prepared) in lola_setup_controller()
437 bdl = pcm->bdl.addr + LOLA_BDL_ENTRY_SIZE * str->index; in lola_setup_controller()
438 lola_dsd_write(chip, str->dsd, BDPL, (u32)bdl); in lola_setup_controller()
439 lola_dsd_write(chip, str->dsd, BDPU, upper_32_bits(bdl)); in lola_setup_controller()
441 lola_dsd_write(chip, str->dsd, LVI, str->frags - 1); in lola_setup_controller()
442 lola_stream_clear_pending_irq(chip, str); in lola_setup_controller()
444 lola_dsd_write(chip, str->dsd, CTL, in lola_setup_controller()
447 str->prepared = 1; in lola_setup_controller()
449 return lola_stream_wait_for_fifo(chip, str, true); in lola_setup_controller()
456 struct lola_stream *str = lola_get_stream(substream); in lola_pcm_prepare() local
462 lola_stream_reset(chip, str); in lola_pcm_prepare()
463 lola_cleanup_slave_streams(pcm, str); in lola_pcm_prepare()
464 if (str->index + runtime->channels > pcm->num_streams) { in lola_pcm_prepare()
469 str[i].master = str; in lola_pcm_prepare()
470 str[i].opened = 1; in lola_pcm_prepare()
478 str->bufsize = bufsize; in lola_pcm_prepare()
479 str->period_bytes = period_bytes; in lola_pcm_prepare()
480 str->format_verb = format_verb; in lola_pcm_prepare()
482 err = lola_setup_periods(chip, pcm, substream, str); in lola_pcm_prepare()
491 err = lola_set_stream_config(chip, str, runtime->channels); in lola_pcm_prepare()
495 err = lola_setup_controller(chip, pcm, str); in lola_pcm_prepare()
497 lola_stream_reset(chip, str); in lola_pcm_prepare()
507 struct lola_stream *str; in lola_pcm_trigger() local
538 str = lola_get_stream(s); in lola_pcm_trigger()
540 lola_stream_start(chip, str, tstamp); in lola_pcm_trigger()
542 lola_stream_stop(chip, str, tstamp); in lola_pcm_trigger()
543 str->running = start; in lola_pcm_trigger()
544 str->paused = !start; in lola_pcm_trigger()
554 struct lola_stream *str = lola_get_stream(substream); in lola_pcm_pointer() local
555 unsigned int pos = lola_dsd_read(chip, str->dsd, LPIB); in lola_pcm_pointer()
557 if (pos >= str->bufsize) in lola_pcm_pointer()
568 struct lola_stream *str = &pcm->streams[i]; in lola_pcm_update() local
569 if (str->substream && str->running) in lola_pcm_update()
570 snd_pcm_period_elapsed(str->substream); in lola_pcm_update()
629 static int lola_init_stream(struct lola *chip, struct lola_stream *str, in lola_init_stream() argument
635 str->nid = nid; in lola_init_stream()
636 str->index = idx; in lola_init_stream()
637 str->dsd = idx; in lola_init_stream()
639 str->dsd += MAX_STREAM_IN_COUNT; in lola_init_stream()
675 str->can_float = true; in lola_init_stream()