Lines Matching refs:azx_dev
39 static inline struct azx_dev *
51 static inline void azx_release_device(struct azx_dev *azx_dev) in azx_release_device() argument
53 snd_hdac_stream_release(azx_stream(azx_dev)); in azx_release_device()
92 struct azx_dev *azx_dev = get_azx_dev(substream); in azx_pcm_close() local
94 trace_azx_pcm_close(chip, azx_dev); in azx_pcm_close()
96 azx_release_device(azx_dev); in azx_pcm_close()
110 struct azx_dev *azx_dev = get_azx_dev(substream); in azx_pcm_hw_params() local
113 trace_azx_pcm_hw_params(chip, azx_dev); in azx_pcm_hw_params()
114 dsp_lock(azx_dev); in azx_pcm_hw_params()
115 if (dsp_is_locked(azx_dev)) { in azx_pcm_hw_params()
120 azx_dev->core.bufsize = 0; in azx_pcm_hw_params()
121 azx_dev->core.period_bytes = 0; in azx_pcm_hw_params()
122 azx_dev->core.format_val = 0; in azx_pcm_hw_params()
125 dsp_unlock(azx_dev); in azx_pcm_hw_params()
132 struct azx_dev *azx_dev = get_azx_dev(substream); in azx_pcm_hw_free() local
136 dsp_lock(azx_dev); in azx_pcm_hw_free()
137 if (!dsp_is_locked(azx_dev)) in azx_pcm_hw_free()
138 snd_hdac_stream_cleanup(azx_stream(azx_dev)); in azx_pcm_hw_free()
142 azx_stream(azx_dev)->prepared = 0; in azx_pcm_hw_free()
143 dsp_unlock(azx_dev); in azx_pcm_hw_free()
151 struct azx_dev *azx_dev = get_azx_dev(substream); in azx_pcm_prepare() local
160 trace_azx_pcm_prepare(chip, azx_dev); in azx_pcm_prepare()
161 dsp_lock(azx_dev); in azx_pcm_prepare()
162 if (dsp_is_locked(azx_dev)) { in azx_pcm_prepare()
167 snd_hdac_stream_reset(azx_stream(azx_dev)); in azx_pcm_prepare()
181 err = snd_hdac_stream_set_params(azx_stream(azx_dev), format_val); in azx_pcm_prepare()
185 snd_hdac_stream_setup(azx_stream(azx_dev)); in azx_pcm_prepare()
187 stream_tag = azx_dev->core.stream_tag; in azx_pcm_prepare()
193 azx_dev->core.format_val, substream); in azx_pcm_prepare()
197 azx_stream(azx_dev)->prepared = 1; in azx_pcm_prepare()
198 dsp_unlock(azx_dev); in azx_pcm_prepare()
207 struct azx_dev *azx_dev; in azx_pcm_trigger() local
214 azx_dev = get_azx_dev(substream); in azx_pcm_trigger()
215 trace_azx_pcm_trigger(chip, azx_dev, cmd); in azx_pcm_trigger()
217 hstr = azx_stream(azx_dev); in azx_pcm_trigger()
223 if (dsp_is_locked(azx_dev) || !hstr->prepared) in azx_pcm_trigger()
244 azx_dev = get_azx_dev(s); in azx_pcm_trigger()
245 sbits |= 1 << azx_dev->core.index; in azx_pcm_trigger()
257 azx_dev = get_azx_dev(s); in azx_pcm_trigger()
259 azx_dev->insufficient = 1; in azx_pcm_trigger()
260 snd_hdac_stream_start(azx_stream(azx_dev), true); in azx_pcm_trigger()
262 snd_hdac_stream_stop(azx_stream(azx_dev)); in azx_pcm_trigger()
278 unsigned int azx_get_pos_lpib(struct azx *chip, struct azx_dev *azx_dev) in azx_get_pos_lpib() argument
280 return snd_hdac_stream_get_pos_lpib(azx_stream(azx_dev)); in azx_get_pos_lpib()
284 unsigned int azx_get_pos_posbuf(struct azx *chip, struct azx_dev *azx_dev) in azx_get_pos_posbuf() argument
286 return snd_hdac_stream_get_pos_posbuf(azx_stream(azx_dev)); in azx_get_pos_posbuf()
291 struct azx_dev *azx_dev) in azx_get_position() argument
293 struct snd_pcm_substream *substream = azx_dev->core.substream; in azx_get_position()
299 pos = chip->get_position[stream](chip, azx_dev); in azx_get_position()
301 pos = azx_get_pos_posbuf(chip, azx_dev); in azx_get_position()
303 if (pos >= azx_dev->core.bufsize) in azx_get_position()
311 delay += chip->get_delay[stream](chip, azx_dev, pos); in azx_get_position()
318 trace_azx_get_position(chip, azx_dev, pos, delay); in azx_get_position()
327 struct azx_dev *azx_dev = get_azx_dev(substream); in azx_pcm_pointer() local
329 azx_get_position(chip, azx_dev)); in azx_pcm_pointer()
368 struct azx_dev *azx_dev = get_azx_dev(substream); in azx_get_sync_time() local
391 (azx_dev->core.stream_tag - 1); in azx_get_sync_time()
495 struct azx_dev *azx_dev = get_azx_dev(substream); in azx_get_time_info() local
506 nsec = timecounter_read(&azx_dev->core.tc); in azx_get_time_info()
582 struct azx_dev *azx_dev; in azx_pcm_open() local
589 azx_dev = azx_assign_device(chip, substream); in azx_pcm_open()
590 trace_azx_pcm_open(chip, azx_dev); in azx_pcm_open()
591 if (azx_dev == NULL) { in azx_pcm_open()
595 runtime->private_data = azx_dev; in azx_pcm_open()
637 azx_release_device(azx_dev); in azx_pcm_open()
646 azx_release_device(azx_dev); in azx_pcm_open()
942 static struct azx_dev *
961 struct azx_dev *azx_dev; in snd_hda_codec_load_dsp_prepare() local
966 azx_dev = azx_get_dsp_loader_dev(chip); in snd_hda_codec_load_dsp_prepare()
967 hstr = azx_stream(azx_dev); in snd_hda_codec_load_dsp_prepare()
970 chip->saved_azx_dev = *azx_dev; in snd_hda_codec_load_dsp_prepare()
979 *azx_dev = chip->saved_azx_dev; in snd_hda_codec_load_dsp_prepare()
993 struct azx_dev *azx_dev = azx_get_dsp_loader_dev(chip); in snd_hda_codec_load_dsp_trigger() local
995 snd_hdac_dsp_trigger(azx_stream(azx_dev), start); in snd_hda_codec_load_dsp_trigger()
1004 struct azx_dev *azx_dev = azx_get_dsp_loader_dev(chip); in snd_hda_codec_load_dsp_cleanup() local
1005 struct hdac_stream *hstr = azx_stream(azx_dev); in snd_hda_codec_load_dsp_cleanup()
1013 *azx_dev = chip->saved_azx_dev; in snd_hda_codec_load_dsp_cleanup()
1053 struct azx_dev *azx_dev = stream_to_azx_dev(s); in stream_update() local
1057 chip->ops->position_check(chip, azx_dev)) { in stream_update()
1059 snd_pcm_period_elapsed(azx_stream(azx_dev)->substream); in stream_update()
1289 struct azx_dev *azx_dev = kzalloc(sizeof(*azx_dev), GFP_KERNEL); in azx_init_streams() local
1292 if (!azx_dev) in azx_init_streams()
1306 snd_hdac_stream_init(azx_bus(chip), azx_stream(azx_dev), in azx_init_streams()